Skip to content

Commit

Permalink
JIT: Set bbCodeOffsEnd to BAD_IL_OFFSET when expanding static init …
Browse files Browse the repository at this point in the history
…calls (#100152)

* Set bbCodeOffsEnd to BAD_IL_OFFSET when expanding static init calls

* Re-enable NativeAOT tests that were failing
  • Loading branch information
TIHan authored Mar 25, 2024
1 parent 928ffaa commit 305a52d
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 24 deletions.
11 changes: 2 additions & 9 deletions src/coreclr/jit/helperexpansion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1504,15 +1504,8 @@ bool Compiler::fgExpandStaticInitForCall(BasicBlock** pBlock, Statement* stmt, G
// Clear gtInitClsHnd as a mark that we've already visited this call
call->gtInitClsHnd = NO_CLASS_HANDLE;

// Update the IL offsets of the blocks to match the split.

// prevBb->bbCodeOffs remains the same
block->bbCodeOffsEnd = prevBb->bbCodeOffsEnd;

IL_OFFSET splitPointILOffset = fgFindBlockILOffset(block);

prevBb->bbCodeOffsEnd = max(prevBb->bbCodeOffs, splitPointILOffset);
block->bbCodeOffs = min(splitPointILOffset, block->bbCodeOffsEnd);
// The blocks and statements have been modified enough to make the ending offset invalid.
block->bbCodeOffsEnd = BAD_IL_OFFSET;

return true;
}
Expand Down
3 changes: 0 additions & 3 deletions src/tests/JIT/Stress/ABI/pinvokes_d.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<JitOptimizationSensitive>true</JitOptimizationSensitive>
<GCStressIncompatible>true</GCStressIncompatible>

<!-- https://github.com/dotnet/runtime/issues/100125 -->
<NativeAotIncompatible>true</NativeAotIncompatible>
</PropertyGroup>
<PropertyGroup>
<DebugType>Full</DebugType>
Expand Down
3 changes: 0 additions & 3 deletions src/tests/JIT/Stress/ABI/pinvokes_do.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<JitOptimizationSensitive>true</JitOptimizationSensitive>
<GCStressIncompatible>true</GCStressIncompatible>

<!-- https://github.com/dotnet/runtime/issues/100125 -->
<NativeAotIncompatible>true</NativeAotIncompatible>
</PropertyGroup>
<PropertyGroup>
<DebugType>Full</DebugType>
Expand Down
3 changes: 0 additions & 3 deletions src/tests/JIT/Stress/ABI/stubs_do.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<JitOptimizationSensitive>true</JitOptimizationSensitive>
<GCStressIncompatible>true</GCStressIncompatible>

<!-- https://github.com/dotnet/runtime/issues/100125 -->
<NativeAotIncompatible>true</NativeAotIncompatible>
</PropertyGroup>
<PropertyGroup>
<DebugType>Full</DebugType>
Expand Down
3 changes: 0 additions & 3 deletions src/tests/JIT/Stress/ABI/tailcalls_d.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<JitOptimizationSensitive>true</JitOptimizationSensitive>
<GCStressIncompatible>true</GCStressIncompatible>

<!-- https://github.com/dotnet/runtime/issues/100125 -->
<NativeAotIncompatible>true</NativeAotIncompatible>
</PropertyGroup>
<PropertyGroup>
<DebugType>Full</DebugType>
Expand Down
3 changes: 0 additions & 3 deletions src/tests/JIT/Stress/ABI/tailcalls_do.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<JitOptimizationSensitive>true</JitOptimizationSensitive>
<GCStressIncompatible>true</GCStressIncompatible>

<!-- https://github.com/dotnet/runtime/issues/100125 -->
<NativeAotIncompatible>true</NativeAotIncompatible>
</PropertyGroup>
<PropertyGroup>
<DebugType>Full</DebugType>
Expand Down

0 comments on commit 305a52d

Please sign in to comment.