Skip to content

RyuJIT x86: EBP frame is sometimes required if overflow operations are present #6113

Description

@mikedn

Found in dotnet/coreclr#4986. An assert fires in test JIT\Regression\JitBlue\DevDiv_200492\DevDiv_200492\DevDiv_200492.cmd when an overflow operation is used as a call argument:

G_M30135_IG02:
       33C0         xor      eax, eax
       50           push     eax                                   ; push loResult
       83FA00       cmp      edx, 0                                ; overflow check for hiResult
       7C0A         jl       SHORT G_M30135_IG04                   ; exit bb
       8BC2         mov      eax, edx
       50           push     eax                                   ; push hiResult
       FF15FC7BF902 call     [TestUlongAttribute:Store(long):this]
G_M30135_IG03:
       C3           ret      
G_M30135_IG04:
       E87199AA50   call     CORINFO_HELP_OVERFLOW
       CC           int3     

I doubt that it's valid to throw when esp doesn't point to the current frame and that's probably what the assert is trying to tell. Hoisting the overflow check out of the call is unlikely to work in the general case as that will affect evaluation order so I guess that such methods require a ebp frame.

Metadata

Metadata

Assignees

Labels

arch-x86area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIbug

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions