Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion failed '!"Unhandled must expand intrinsic, throwing PlatformNotSupportedException"' in Checked mode #97272

Closed
akoeplinger opened this issue Jan 21, 2024 · 4 comments · Fixed by #99818
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI in-pr There is an active PR which will close this issue when it is merged Priority:2 Work that is important, but not critical for the release
Milestone

Comments

@akoeplinger
Copy link
Member

akoeplinger commented Jan 21, 2024

Found in #97087 (comment), only happens in Checked build.

Generating native code
ILC: D:\a_work\1\s\src\coreclr\jit\importercalls.cpp:4106
ILC: Assertion failed '!"Unhandled must expand intrinsic, throwing PlatformNotSupportedException"' in 'System.Type:get_IsPrimitive():ubyte:this' during 'Morph - Inlining' (IL size 7; hash 0x30bca526; FullOpts)

Likely caused by #96226

Happens in:

  • DisabledRuntimeMarshalling_Disabled_NativeAssemblyEnabled.csproj
  • AmbiguousImplementationException.ilproj
  • Pause_ro.csproj
  • Regression2_Regressions.csproj
@akoeplinger akoeplinger added disabled-test The test is disabled in source code against the issue area-NativeAOT-coreclr labels Jan 21, 2024
@ghost
Copy link

ghost commented Jan 21, 2024

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

Found in #97087 (comment)

Generating native code
ILC: D:\a_work\1\s\src\coreclr\jit\importercalls.cpp:4106
ILC: Assertion failed '!"Unhandled must expand intrinsic, throwing PlatformNotSupportedException"' in 'System.Type:get_IsPrimitive():ubyte:this' during 'Morph - Inlining' (IL size 7; hash 0x30bca526; FullOpts)

Disabled the test in the .csproj

Author: akoeplinger
Assignees: -
Labels:

disabled-test, area-NativeAOT-coreclr

Milestone: -

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jan 21, 2024
@akoeplinger akoeplinger changed the title DisabledRuntimeMarshalling_Disabled_NativeAssemblyEnabled failing in Checked mode NativeAOT: Assertion failed '!"Unhandled must expand intrinsic, throwing PlatformNotSupportedException"' in Checked mode Jan 21, 2024
@EgorBo EgorBo self-assigned this Jan 21, 2024
@EgorBo EgorBo added this to the 9.0.0 milestone Jan 21, 2024
@EgorBo EgorBo removed the untriaged New issue has not been triaged by the area owner label Jan 21, 2024
@MichalStrehovsky
Copy link
Member

I looked at this because I didn't like where the workarounds in #97087 were going.

This is a JIT issue; it's not even native AOT specific, I could probably hit this assert with tiered JIT too but maybe that's harder to setup. It is not specific to get_IsPrimitive either, we just happen to hit it there.

We're hitting the mustExpand logic in the JIT because we devirtualized and inlined TypeDelegator.get_IsPrimitiveImpl into Type.get_IsPrimitive and suddenly JIT thinks Type.get_IsPrimitive is one of those intrinsics that just recursively call themselves and that must be expanded. I think we need a check that this doesn't come from an inlinee or that the this is different... or something like that.

I'll mark get_IsPrimitive no-optimization to work around (search for this issue number). Undo that when this is fixed.

****** START compiling System.Type:get_IsPrimitive():ubyte:this (MethodHash=30bca526)
Generating code for Windows x64
OPTIONS: compCodeOpt = BLENDED_CODE
OPTIONS: compDbgCode = false
OPTIONS: compDbgInfo = true
OPTIONS: compDbgEnC  = false
OPTIONS: compProcedureSplitting   = false
OPTIONS: compProcedureSplittingEH = false
OPTIONS: Jit invoked for ngen
IL to import:
IL_0000  02                ldarg.0
IL_0001  6f b6 05 00 06    callvirt     0x60005B6
IL_0006  2a                ret

lvaSetClass: setting class for V00 to (4000000000422AE0) System.Type
'this'    passed in register rcx

lvaGrabTemp returning 1 (V01 tmp0) (a long lifetime temp) called for OutgoingArgSpace.

Local V01 should not be enregistered because: it is address exposed
; Initial local variable assignments
;
;  V00 this              ref  this class-hnd <System.Type>
;  V01 OutArgs        struct <0> do-not-enreg[XS] addr-exposed "OutgoingArgSpace"
*************** In compInitDebuggingInfo() for System.Type:get_IsPrimitive():ubyte:this
getVars() returned cVars = 0, extendOthers = true
info.compVarScopesCount = 1
        VarNum  LVNum         Name      Beg     End
 0:     00h     00h       V00 this      000h    007h
info.compStmtOffsetsCount    = 0
info.compStmtOffsetsImplicit = 0007h ( STACK_EMPTY NOP CALL_SITE )
*************** In fgFindBasicBlocks() for System.Type:get_IsPrimitive():ubyte:this
Jump targets:
  none
New Basic Block BB01 [0000] created.
BB01 [0000] [000..007)
INLINER: during 'prejit' result 'PreJIT Success' reason 'PreJIT Success' for 'n/a' calling 'System.Type:get_IsPrimitive():ubyte:this'
INLINER: during 'prejit' result 'PreJIT Success' reason 'PreJIT Success'
IL Code Size,Instr    7,   3, Basic Block count   1, Local Variable Num,Ref count   2,  1 for method System.Type:get_IsPrimitive():ubyte:this
OPTIONS: opts.MinOpts() == false
Basic block list for 'System.Type:get_IsPrimitive():ubyte:this'

-----------------------------------------------------------------------------------------------------------------------------------------
BBnum BBid ref try hnd preds           weight    lp [IL range]     [jump]      [EH region]         [flags]
-----------------------------------------------------------------------------------------------------------------------------------------
BB01 [0000]  1                             1       [000..007)        (return)
-----------------------------------------------------------------------------------------------------------------------------------------

*************** Starting PHASE Pre-import

*************** Finishing PHASE Pre-import
Trees after Pre-import

-----------------------------------------------------------------------------------------------------------------------------------------
BBnum BBid ref try hnd preds           weight    lp [IL range]     [jump]      [EH region]         [flags]
-----------------------------------------------------------------------------------------------------------------------------------------
BB01 [0000]  1                             1       [000..007)        (return)
-----------------------------------------------------------------------------------------------------------------------------------------

------------ BB01 [0000] [000..007) (return), preds={} succs={}

-------------------------------------------------------------------------------------------------------------------
*************** In fgDebugCheckBBlist

*************** Starting PHASE Profile incorporation
BBOPT not set

*************** Finishing PHASE Profile incorporation [no changes]

*************** Starting PHASE Importation

impImportBlockPending for BB01

Importing BB01 (PC=000) of 'System.Type:get_IsPrimitive():ubyte:this'
    [ 0]   0 (0x000) ldarg.0
    [ 1]   1 (0x001) callvirt 060005B6
 (Implicit Tail call: prefixFlags |= PREFIX_TAILCALL_IMPLICIT)
In Compiler::impImportCall: opcode is callvirt, kind=4, callRetType is ubyte, structSize is 0

impDevirtualizeCall: Trying to devirtualize virtual call:
    class for 'this' is System.Type (attrib 20000400)
    base method is System.Type::IsPrimitiveImpl
--- no derived method: object class cannot be referenced from R2R code due to missing tokens
    Class not final or exact, and method not final
Considering guarded devirtualization at IL offset 1 (0x1)
We have exactly 2 classes implementing System.Type:
  0) System.RuntimeType
Marking call [000001] as guarded devirtualization candidate; will guess for class System.RuntimeType
  1) System.Reflection.TypeDelegator
Marking call [000001] as guarded devirtualization candidate; will guess for class System.Reflection.TypeDelegator

GTF_CALL_M_IMPLICIT_TAILCALL set for call [000001]

CheckCanInline: fetching method info for inline candidate IsPrimitiveImpl -- context 40000000004211E9
Class context: System.RuntimeType
INLINER: during 'impMarkInlineCandidate for GDV' result 'CheckCanInline Success' reason 'CheckCanInline Success' for 'System.Type:get_IsPrimitive():ubyte:this' calling 'System.Type:IsPrimitiveImpl():ubyte:this'
INLINER: during 'impMarkInlineCandidate for GDV' result 'CheckCanInline Success' reason 'CheckCanInline Success'

CheckCanInline: fetching method info for inline candidate IsPrimitiveImpl -- context 4000000000427069
Class context: System.Reflection.TypeDelegator
INLINER: during 'impMarkInlineCandidate for GDV' result 'CheckCanInline Success' reason 'CheckCanInline Success' for 'System.Type:get_IsPrimitive():ubyte:this' calling 'System.Type:IsPrimitiveImpl():ubyte:this'
INLINER: during 'impMarkInlineCandidate for GDV' result 'CheckCanInline Success' reason 'CheckCanInline Success'


STMT00000 ( 0x000[E-] ... ??? )
               [000001] &-C-G------                         *  CALLV vt-ind int    System.Type:IsPrimitiveImpl():ubyte:this (exactContextHnd=0x40000000004211E9)
               [000000] ----------- this                    \--*  LCL_VAR   ref    V00 this

    [ 1]   6 (0x006) ret

STMT00001 ( 0x000[E-] ... ??? )
               [000003] --C--------                         *  RETURN    int
               [000002] --C--------                         \--*  RET_EXPR  int   (for [000001])

*************** Finishing PHASE Importation
Trees after Importation

-----------------------------------------------------------------------------------------------------------------------------------------
BBnum BBid ref try hnd preds           weight    lp [IL range]     [jump]      [EH region]         [flags]
-----------------------------------------------------------------------------------------------------------------------------------------
BB01 [0000]  1                             1       [000..007)        (return)                     i
-----------------------------------------------------------------------------------------------------------------------------------------

------------ BB01 [0000] [000..007) (return), preds={} succs={}

***** BB01 [0000]
STMT00000 ( 0x000[E-] ... 0x006 )
               [000001] &-C-G------                         *  CALLV vt-ind int    System.Type:IsPrimitiveImpl():ubyte:this (exactContextHnd=0x40000000004211E9)
               [000000] ----------- this                    \--*  LCL_VAR   ref    V00 this

***** BB01 [0000]
STMT00001 ( 0x000[E-] ... ??? )
               [000003] --C--------                         *  RETURN    int
               [000002] --C--------                         \--*  RET_EXPR  int   (for [000001])

-------------------------------------------------------------------------------------------------------------------
*************** In fgDebugCheckBBlist
*************** In fgDebugCheckLoopTable: loop table not valid

*************** Starting PHASE Expand patchpoints

 -- no patchpoints to transform

*************** Finishing PHASE Expand patchpoints [no changes]

*************** Starting PHASE Indirect call transform

----------------

*** GuardedDevirtualization contemplating [000001] in BB01
Likelihood of correct guess is 50
Expansion will not chain to the previous GDV due to multiple type checks
*** GuardedDevirtualization: transforming STMT00000

lvaGrabTemp returning 2 (V02 tmp1) (a long lifetime temp) called for guarded devirt return temp.
Reworking call(s) to return value via a new temp V02
Linking GT_RET_EXPR [000002] to refer to temp V02
New Basic Block BB02 [0001] created.
Setting edge weights for BB01 -> BB02 to [0 .. 3.402823e+38]
New Basic Block BB03 [0002] created.
Setting edge weights for BB01 -> BB03 to [0 .. 3.402823e+38]
Setting edge weights for BB03 -> BB02 to [0 .. 3.402823e+38]

lvaGrabTemp returning 3 (V03 tmp2) (a long lifetime temp) called for guarded devirt this exact temp.

lvaSetClass: setting class for V03 to (40000000004211E8) System.RuntimeType  [exact]
Direct call [000012] in block BB03

impDevirtualizeCall: Trying to devirtualize virtual call:
    class for 'this' is System.RuntimeType [exact] (attrib 20000010)
    base method is System.RuntimeType::IsPrimitiveImpl
    devirt to System.RuntimeType::IsPrimitiveImpl -- exact
               [000012] &-C-G------                         *  CALLV vt-ind int    System.Type:IsPrimitiveImpl():ubyte:this (exactContextHnd=0x40000000004211E9)
               [000014] ----------- this                    \--*  LCL_VAR   ref    V03 tmp2
    exact; can devirtualize
... after devirt...
               [000012] --C-G------                         *  CALL nullcheck int    System.RuntimeType:IsPrimitiveImpl():ubyte:this
               [000014] ----------- this                    \--*  LCL_VAR   ref    V03 tmp2
[000012] is in tail position and is not recursive
New Basic Block BB04 [0003] created.
Setting edge weights for BB01 -> BB04 to [0 .. 3.402823e+38]
New Basic Block BB05 [0004] created.
Setting edge weights for BB04 -> BB05 to [0 .. 3.402823e+38]
Setting edge weights for BB05 -> BB02 to [0 .. 3.402823e+38]

lvaGrabTemp returning 4 (V04 tmp3) (a long lifetime temp) called for guarded devirt this exact temp.

lvaSetClass: setting class for V04 to (4000000000427068) System.Reflection.TypeDelegator  [exact]
Direct call [000020] in block BB05

impDevirtualizeCall: Trying to devirtualize virtual call:
    class for 'this' is System.Reflection.TypeDelegator [exact] (attrib 21000010)
    base method is System.Reflection.TypeDelegator::IsPrimitiveImpl
    devirt to System.Reflection.TypeDelegator::IsPrimitiveImpl -- exact
               [000020] &-C-G------                         *  CALLV vt-ind int    System.Type:IsPrimitiveImpl():ubyte:this (exactContextHnd=0x40000000004211E9)
               [000022] ----------- this                    \--*  LCL_VAR   ref    V04 tmp3
    exact; can devirtualize
... after devirt...
               [000020] --C-G------                         *  CALL nullcheck int    System.Reflection.TypeDelegator:IsPrimitiveImpl():ubyte:this
               [000022] ----------- this                    \--*  LCL_VAR   ref    V04 tmp3
[000020] is in tail position and is not recursive
New Basic Block BB06 [0005] created.
Setting edge weights for BB06 -> BB02 to [0 .. 3.402823e+38]
Residual call [000001] moved to block BB06

 -- 1 calls transformed

*************** Finishing PHASE Indirect call transform
Trees after Indirect call transform

-----------------------------------------------------------------------------------------------------------------------------------------
BBnum BBid ref try hnd preds           weight    lp [IL range]     [jump]      [EH region]         [flags]
-----------------------------------------------------------------------------------------------------------------------------------------
BB01 [0000]  1                             1       [000..000)-> BB04 ( cond )                     i q
BB03 [0002]  1       BB01                  0.50    [???..???)-> BB02 (always)                     i internal q
BB04 [0003]  1       BB01                  0.50    [???..???)-> BB05 (always)                     i internal q
BB05 [0004]  1       BB04                  0.50    [???..???)-> BB02 (always)                     i internal q
BB06 [0005]  0                             0       [???..???)-> BB02 (always)                     i rare internal q
BB02 [0001]  3       BB03,BB05,BB06        1       [000..007)        (return)                     i internal
-----------------------------------------------------------------------------------------------------------------------------------------

------------ BB01 [0000] [000..000) -> BB04 (cond), preds={} succs={BB03,BB04}

***** BB01 [0000]
STMT00002 ( 0x000[E-] ... ??? )
               [000009] ---X-------                         *  JTRUE     void
               [000008] ---X-------                         \--*  NE        int
               [000007] H----------                            +--*  CNS_INT(h) long   0x400000000042f368 class
               [000006] #--X-------                            \--*  IND       long
               [000005] -----------                               \--*  LCL_VAR   ref    V00 this

------------ BB03 [0002] [???..???) -> BB02 (always), preds={BB01} succs={BB02}

***** BB03 [0002]
STMT00003 ( ??? ... ??? )
               [000011] DA---------                         *  STORE_LCL_VAR ref    V03 tmp2
               [000010] -----------                         \--*  LCL_VAR   ref    V00 this

***** BB03 [0002]
STMT00004 ( 0x000[E-] ... ??? )
               [000012] I-C-G------                         *  CALL nullcheck int    System.RuntimeType:IsPrimitiveImpl():ubyte:this (exactContextHnd=0x40000000004211E9)
               [000014] ----------- this                    \--*  LCL_VAR   ref    V03 tmp2

***** BB03 [0002]
STMT00005 ( ??? ... ??? )
               [000016] DAC--------                         *  STORE_LCL_VAR int    V02 tmp1
               [000015] --C--------                         \--*  RET_EXPR  int   (for [000012])

------------ BB04 [0003] [???..???) -> BB05 (always), preds={BB01} succs={BB05}

------------ BB05 [0004] [???..???) -> BB02 (always), preds={BB04} succs={BB02}

***** BB05 [0004]
STMT00006 ( ??? ... ??? )
               [000019] DA---------                         *  STORE_LCL_VAR ref    V04 tmp3
               [000018] -----------                         \--*  LCL_VAR   ref    V00 this

***** BB05 [0004]
STMT00007 ( 0x000[E-] ... ??? )
               [000020] I-C-G------                         *  CALL nullcheck int    System.Reflection.TypeDelegator:IsPrimitiveImpl():ubyte:this (exactContextHnd=0x4000000000427069)
               [000022] ----------- this                    \--*  LCL_VAR   ref    V04 tmp3

***** BB05 [0004]
STMT00008 ( ??? ... ??? )
               [000024] DAC--------                         *  STORE_LCL_VAR int    V02 tmp1
               [000023] --C--------                         \--*  RET_EXPR  int   (for [000020])

------------ BB06 [0005] [???..???) -> BB02 (always), preds={} succs={BB02}

***** BB06 [0005]
STMT00009 ( 0x000[E-] ... ??? )
               [000025] DAC-G------                         *  STORE_LCL_VAR int    V02 tmp1
               [000001] --C-G------                         \--*  CALLV vt-ind int    System.Type:IsPrimitiveImpl():ubyte:this
               [000000] ----------- this                       \--*  LCL_VAR   ref    V00 this

------------ BB02 [0001] [000..007) (return), preds={BB03,BB05,BB06} succs={}

***** BB02 [0001]
STMT00001 ( 0x000[E-] ... ??? )
               [000003] --C--------                         *  RETURN    int
               [000002] --C--------                         \--*  RET_EXPR  int   (for [000001]) -> [000004]

-------------------------------------------------------------------------------------------------------------------
*************** In fgDebugCheckBBlist
*************** In fgDebugCheckLoopTable: loop table not valid

*************** Starting PHASE Post-import

*************** Finishing PHASE Post-import [no changes]

*************** Starting PHASE Morph - Init

New BlockSet epoch 1, # of blocks (including unused BB00): 7, bitset array size: 1 (short)

*************** Finishing PHASE Morph - Init [no changes]

*************** Starting PHASE Morph - Inlining
Expanding INLINE_CANDIDATE in statement STMT00004 in BB03:
STMT00004 ( 0x000[E-] ... ??? )
               [000012] I-C-G------                         *  CALL nullcheck int    System.RuntimeType:IsPrimitiveImpl():ubyte:this (exactContextHnd=0x40000000004211E9)
               [000014] ----------- this                    \--*  LCL_VAR   ref    V03 tmp2
Note: candidate is implicit tail call
thisArg: is a local var
               [000014] -----------                         *  LCL_VAR   ref    V03 tmp2

INLINER: inlineInfo.tokenLookupContextHandle for System.RuntimeType:IsPrimitiveImpl():ubyte:this set to 0x40000000004211E9:

Invoking compiler for the inlinee method System.RuntimeType:IsPrimitiveImpl():ubyte:this :
IL to import:
IL_0000  02                ldarg.0
IL_0001  7b b8 00 00 04    ldfld        0x40000B8
IL_0006  0a                stloc.0
IL_0007  06                ldloc.0
IL_0008  16                ldc.i4.0
IL_0009  e0                conv.u
IL_000a  2e 07             beq.s        7 (IL_0013)
IL_000c  06                ldloc.0
IL_000d  28 4d 80 00 06    call         0x600804D
IL_0012  2a                ret
IL_0013  02                ldarg.0
IL_0014  28 8c 02 00 06    call         0x600028C
IL_0019  6f 9d 75 00 06    callvirt     0x600759D
IL_001e  2a                ret

INLINER impTokenLookupContextHandle for System.RuntimeType:IsPrimitiveImpl():ubyte:this is 0x40000000004211E9.
*************** In compInitDebuggingInfo() for System.RuntimeType:IsPrimitiveImpl():ubyte:this
info.compStmtOffsetsCount    = 0
info.compStmtOffsetsImplicit = 0007h ( STACK_EMPTY NOP CALL_SITE )
*************** In fgFindBasicBlocks() for System.RuntimeType:IsPrimitiveImpl():ubyte:this
weight= 31 : state 191 [ ldarg.0 -> ldfld ]
weight= 20 : state 199 [ stloc.0 -> ldloc.0 ]
weight= 15 : state  23 [ ldc.i4.0 ]
weight=-36 : state 165 [ conv.u ]
weight=  6 : state  46 [ beq.s ]
weight= 12 : state   7 [ ldloc.0 ]
weight= 79 : state  40 [ call ]
weight= 19 : state  42 [ ret ]
weight= 10 : state   3 [ ldarg.0 ]
weight= 79 : state  40 [ call ]
weight= 83 : state  99 [ callvirt ]
weight= 19 : state  42 [ ret ]

Inline candidate looks like a wrapper method.  Multiplier increased to 1.
Inline candidate has an arg that feeds a constant test.  Multiplier increased to 2.
Inline candidate callsite is boring.  Multiplier increased to 3.3.
calleeNativeSizeEstimate=337
callsiteNativeSizeEstimate=85
benefit multiplier=3.3
threshold=280
Native estimate for function size exceeds threshold for inlining 33.7 > 28 (multiplier = 3.3)


Inline expansion aborted, inline not profitable
Inlining [000012] failed, so bashing STMT00004 to NOP
INLINER: during 'fgInline' result 'failed this call site' reason 'unprofitable inline' for 'System.Type:get_IsPrimitive():ubyte:this' calling 'System.RuntimeType:IsPrimitiveImpl():ubyte:this'
INLINER: during 'fgInline' result 'failed this call site' reason 'unprofitable inline'

Replacing the return expression placeholder [000015] with [000012]
               [000015] --C--------                         *  RET_EXPR  int   (for [000012]) -> [000012]

Inserting the inline return expression
               [000012] --C-G------                         *  CALL nullcheck int    System.RuntimeType:IsPrimitiveImpl():ubyte:this
               [000014] ----------- this                    \--*  LCL_VAR   ref    V03 tmp2

Expanding INLINE_CANDIDATE in statement STMT00007 in BB05:
STMT00007 ( 0x000[E-] ... ??? )
               [000020] I-C-G------                         *  CALL nullcheck int    System.Reflection.TypeDelegator:IsPrimitiveImpl():ubyte:this (exactContextHnd=0x4000000000427069)
               [000022] ----------- this                    \--*  LCL_VAR   ref    V04 tmp3
Note: candidate is implicit tail call
thisArg: is a local var
               [000022] -----------                         *  LCL_VAR   ref    V04 tmp3

INLINER: inlineInfo.tokenLookupContextHandle for System.Reflection.TypeDelegator:IsPrimitiveImpl():ubyte:this set to 0x4000000000427069:

Invoking compiler for the inlinee method System.Reflection.TypeDelegator:IsPrimitiveImpl():ubyte:this :
IL to import:
IL_0000  02                ldarg.0
IL_0001  7b 33 18 00 04    ldfld        0x4001833
IL_0006  6f b5 05 00 06    callvirt     0x60005B5
IL_000b  2a                ret

INLINER impTokenLookupContextHandle for System.Reflection.TypeDelegator:IsPrimitiveImpl():ubyte:this is 0x4000000000427069.
*************** In compInitDebuggingInfo() for System.Reflection.TypeDelegator:IsPrimitiveImpl():ubyte:this
info.compStmtOffsetsCount    = 0
info.compStmtOffsetsImplicit = 0007h ( STACK_EMPTY NOP CALL_SITE )
*************** In fgFindBasicBlocks() for System.Reflection.TypeDelegator:IsPrimitiveImpl():ubyte:this
Jump targets:
  none
New Basic Block BB01 [0006] created.
BB01 [0006] [000..00C)
Basic block list for 'System.Reflection.TypeDelegator:IsPrimitiveImpl():ubyte:this'

-----------------------------------------------------------------------------------------------------------------------------------------
BBnum BBid ref try hnd preds           weight    lp [IL range]     [jump]      [EH region]         [flags]
-----------------------------------------------------------------------------------------------------------------------------------------
BB01 [0006]  1                             1       [000..00C)        (return)
-----------------------------------------------------------------------------------------------------------------------------------------

*************** Inline @[000020] Starting PHASE Pre-import

*************** Inline @[000020] Finishing PHASE Pre-import
Trees after Pre-import

-----------------------------------------------------------------------------------------------------------------------------------------
BBnum BBid ref try hnd preds           weight    lp [IL range]     [jump]      [EH region]         [flags]
-----------------------------------------------------------------------------------------------------------------------------------------
BB01 [0006]  1                             1       [000..00C)        (return)
-----------------------------------------------------------------------------------------------------------------------------------------

------------ BB01 [0006] [000..00C) (return), preds={} succs={}

-------------------------------------------------------------------------------------------------------------------
*************** In fgDebugCheckBBlist

*************** Inline @[000020] Starting PHASE Profile incorporation
BBOPT not set
Computing inlinee profile scale:
   ... no callee profile data, will use non-pgo weight to scale
   ... call site not profiled, will use non-pgo weight to scale
   call site count 50 callee entry count 100 scale 0.5
Scaling inlinee blocks

*************** Inline @[000020] Finishing PHASE Profile incorporation
Trees after Profile incorporation

-----------------------------------------------------------------------------------------------------------------------------------------
BBnum BBid ref try hnd preds           weight    lp [IL range]     [jump]      [EH region]         [flags]
-----------------------------------------------------------------------------------------------------------------------------------------
BB01 [0006]  1                             1       [000..00C)        (return)
-----------------------------------------------------------------------------------------------------------------------------------------

------------ BB01 [0006] [000..00C) (return), preds={} succs={}

-------------------------------------------------------------------------------------------------------------------
*************** In fgDebugCheckBBlist

*************** Inline @[000020] Starting PHASE Importation

impImportBlockPending for BB01

Importing BB01 (PC=000) of 'System.Reflection.TypeDelegator:IsPrimitiveImpl():ubyte:this'
    [ 0]   0 (0x000) ldarg.0
    [ 1]   1 (0x001) ldfld 04001833
    [ 1]   6 (0x006) callvirt 060005B5
 (Inline Implicit Tail call: prefixFlags |= PREFIX_TAILCALL_IMPLICIT)
In Compiler::impImportCall: opcode is callvirt, kind=0, callRetType is ubyte, structSize is 0
Named Intrinsic System.Type.get_IsPrimitive: Recognized
ILC: D:\git\runtime2\src\coreclr\jit\importercalls.cpp:4106
ILC: Assertion failed '!"Unhandled must expand intrinsic, throwing PlatformNotSupportedException"' in 'System.Type:get_IsPrimitive():ubyte:this' during 'Morph - Inlining' (IL size 7; hash 0x30bca526; FullOpts)

@MichalStrehovsky MichalStrehovsky added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI and removed disabled-test The test is disabled in source code against the issue area-NativeAOT-coreclr labels Jan 22, 2024
@ghost
Copy link

ghost commented Jan 22, 2024

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Issue Details

Found in #97087 (comment), only happens in Checked build.

Generating native code
ILC: D:\a_work\1\s\src\coreclr\jit\importercalls.cpp:4106
ILC: Assertion failed '!"Unhandled must expand intrinsic, throwing PlatformNotSupportedException"' in 'System.Type:get_IsPrimitive():ubyte:this' during 'Morph - Inlining' (IL size 7; hash 0x30bca526; FullOpts)

Likely caused by #96226

Happens in:

  • DisabledRuntimeMarshalling_Disabled_NativeAssemblyEnabled.csproj
  • AmbiguousImplementationException.ilproj
  • Pause_ro.csproj
  • Regression2_Regressions.csproj

Disabling the tests in the .csproj in the PR

Author: akoeplinger
Assignees: EgorBo
Labels:

area-CodeGen-coreclr

Milestone: 9.0.0

@MichalStrehovsky MichalStrehovsky changed the title NativeAOT: Assertion failed '!"Unhandled must expand intrinsic, throwing PlatformNotSupportedException"' in Checked mode Assertion failed '!"Unhandled must expand intrinsic, throwing PlatformNotSupportedException"' in Checked mode Jan 22, 2024
ViktorHofer added a commit that referenced this issue Jan 22, 2024
* Update dependencies from https://github.com/dotnet/arcade build 20240116.3

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XliffTasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 9.0.0-beta.23607.2 -> To Version 9.0.0-beta.24066.3

* Update Versions.props

* Make xunit.props respect different versions and assert libraries

* Update dependencies from https://github.com/dotnet/arcade build 20240116.3

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XliffTasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 9.0.0-beta.23607.2 -> To Version 9.0.0-beta.24066.3

* Avoid XUNIT_SPAN unambiguous call issues

* Disable obsoletion warning for xunit Delegating*Sink

* Fix nullable collection test

* Fix "DynamicObject_MissingProperty" null test

* Remove unnecessary Extensions references

* Update dependencies from xharness 9.0.0-prerelease.24066.3

* Try to fix TryCatchFinally test for real

* Fix TryCatchFinally for real real

* Update dependencies from https://github.com/dotnet/arcade build 20240117.4

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XliffTasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 9.0.0-beta.23607.2 -> To Version 9.0.0-beta.24067.4

* Fix TryCatchFinally for real real real

* Update dependencies from https://github.com/dotnet/arcade build 20240118.1

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XliffTasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 9.0.0-beta.23607.2 -> To Version 9.0.0-beta.24068.1

* Work around Mono issue in AppDomainTests.AssemblyLoad

* Update dependencies from https://github.com/dotnet/arcade build 20240118.4

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XliffTasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 9.0.0-beta.23607.2 -> To Version 9.0.0-beta.24068.4

* Update dependencies from https://github.com/dotnet/arcade build 20240119.2

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XliffTasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 9.0.0-beta.23607.2 -> To Version 9.0.0-beta.24069.2

* Update xunit.props

* Update xunit.props

* Update dependencies from https://github.com/dotnet/arcade build 20240119.2

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XliffTasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 9.0.0-beta.23607.2 -> To Version 9.0.0-beta.24069.2

* Disable DisabledRuntimeMarshalling_Disabled_NativeAssemblyEnabled test

See #97272

* Disable AmbiguousImplementationException.ilproj and Pause_ro.csproj too

They also fail with #97272

* Disable Regression2_Regressions.csproj too

* Revert "Disable Regression2_Regressions.csproj too"

This reverts commit 4a6bdb8.

* Revert "Disable AmbiguousImplementationException.ilproj and Pause_ro.csproj too"

This reverts commit f5729ce.

* Revert "Disable DisabledRuntimeMarshalling_Disabled_NativeAssemblyEnabled test"

This reverts commit 2267a5c.

* Work around IsPrimitive compilation issue

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
tmds pushed a commit to tmds/runtime that referenced this issue Jan 23, 2024
* Update dependencies from https://github.com/dotnet/arcade build 20240116.3

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XliffTasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 9.0.0-beta.23607.2 -> To Version 9.0.0-beta.24066.3

* Update Versions.props

* Make xunit.props respect different versions and assert libraries

* Update dependencies from https://github.com/dotnet/arcade build 20240116.3

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XliffTasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 9.0.0-beta.23607.2 -> To Version 9.0.0-beta.24066.3

* Avoid XUNIT_SPAN unambiguous call issues

* Disable obsoletion warning for xunit Delegating*Sink

* Fix nullable collection test

* Fix "DynamicObject_MissingProperty" null test

* Remove unnecessary Extensions references

* Update dependencies from xharness 9.0.0-prerelease.24066.3

* Try to fix TryCatchFinally test for real

* Fix TryCatchFinally for real real

* Update dependencies from https://github.com/dotnet/arcade build 20240117.4

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XliffTasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 9.0.0-beta.23607.2 -> To Version 9.0.0-beta.24067.4

* Fix TryCatchFinally for real real real

* Update dependencies from https://github.com/dotnet/arcade build 20240118.1

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XliffTasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 9.0.0-beta.23607.2 -> To Version 9.0.0-beta.24068.1

* Work around Mono issue in AppDomainTests.AssemblyLoad

* Update dependencies from https://github.com/dotnet/arcade build 20240118.4

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XliffTasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 9.0.0-beta.23607.2 -> To Version 9.0.0-beta.24068.4

* Update dependencies from https://github.com/dotnet/arcade build 20240119.2

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XliffTasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 9.0.0-beta.23607.2 -> To Version 9.0.0-beta.24069.2

* Update xunit.props

* Update xunit.props

* Update dependencies from https://github.com/dotnet/arcade build 20240119.2

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XliffTasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 9.0.0-beta.23607.2 -> To Version 9.0.0-beta.24069.2

* Disable DisabledRuntimeMarshalling_Disabled_NativeAssemblyEnabled test

See dotnet#97272

* Disable AmbiguousImplementationException.ilproj and Pause_ro.csproj too

They also fail with dotnet#97272

* Disable Regression2_Regressions.csproj too

* Revert "Disable Regression2_Regressions.csproj too"

This reverts commit 4a6bdb8.

* Revert "Disable AmbiguousImplementationException.ilproj and Pause_ro.csproj too"

This reverts commit f5729ce.

* Revert "Disable DisabledRuntimeMarshalling_Disabled_NativeAssemblyEnabled test"

This reverts commit 2267a5c.

* Work around IsPrimitive compilation issue

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
@filipnavara
Copy link
Member

This seems to fix it:

--- a/src/coreclr/jit/importercalls.cpp
+++ b/src/coreclr/jit/importercalls.cpp
@@ -2616,7 +2616,7 @@ GenTree* Compiler::impIntrinsic(GenTree*                newobjThis,
     if (isIntrinsic)
     {
         // The recursive non-virtual calls to Jit intrinsics are must-expand by convention.
-        mustExpand = gtIsRecursiveCall(method) && !(methodFlags & CORINFO_FLG_VIRTUAL);
+        mustExpand = method == info.compMethodHnd && !(methodFlags & CORINFO_FLG_VIRTUAL);
     }
     else
     {

(suggested by @SingleAccretion)

@dotnet-policy-service dotnet-policy-service bot added the in-pr There is an active PR which will close this issue when it is merged label Mar 11, 2024
filipnavara added a commit to filipnavara/runtime that referenced this issue Mar 13, 2024
filipnavara added a commit to filipnavara/runtime that referenced this issue Mar 13, 2024
@EgorBo EgorBo mentioned this issue Mar 15, 2024
@EgorBo EgorBo added the Priority:2 Work that is important, but not critical for the release label May 6, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI in-pr There is an active PR which will close this issue when it is merged Priority:2 Work that is important, but not critical for the release
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants