From 071c789bd036235b7cd7321b31013f9c7fc14e25 Mon Sep 17 00:00:00 2001 From: TIHan Date: Fri, 22 Mar 2024 11:06:12 -0700 Subject: [PATCH 1/2] Set bbCodeOffsEnd to BAD_IL_OFFSET when expanding static init calls --- src/coreclr/jit/helperexpansion.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/coreclr/jit/helperexpansion.cpp b/src/coreclr/jit/helperexpansion.cpp index 5a07d84be7f11..3bf37b93798e9 100644 --- a/src/coreclr/jit/helperexpansion.cpp +++ b/src/coreclr/jit/helperexpansion.cpp @@ -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; } From e9c57ea1d1c3f09a306c1e93c2644f7726eee7e0 Mon Sep 17 00:00:00 2001 From: TIHan Date: Fri, 22 Mar 2024 11:18:28 -0700 Subject: [PATCH 2/2] Re-enable NativeAOT tests that were failing --- src/tests/JIT/Stress/ABI/pinvokes_d.csproj | 3 --- src/tests/JIT/Stress/ABI/pinvokes_do.csproj | 3 --- src/tests/JIT/Stress/ABI/stubs_do.csproj | 3 --- src/tests/JIT/Stress/ABI/tailcalls_d.csproj | 3 --- src/tests/JIT/Stress/ABI/tailcalls_do.csproj | 3 --- 5 files changed, 15 deletions(-) diff --git a/src/tests/JIT/Stress/ABI/pinvokes_d.csproj b/src/tests/JIT/Stress/ABI/pinvokes_d.csproj index 0fa967a0c4351..734e0a53fdd34 100644 --- a/src/tests/JIT/Stress/ABI/pinvokes_d.csproj +++ b/src/tests/JIT/Stress/ABI/pinvokes_d.csproj @@ -10,9 +10,6 @@ True true true - - - true Full diff --git a/src/tests/JIT/Stress/ABI/pinvokes_do.csproj b/src/tests/JIT/Stress/ABI/pinvokes_do.csproj index f471e30b30f03..309cb73d7b11e 100644 --- a/src/tests/JIT/Stress/ABI/pinvokes_do.csproj +++ b/src/tests/JIT/Stress/ABI/pinvokes_do.csproj @@ -10,9 +10,6 @@ True true true - - - true Full diff --git a/src/tests/JIT/Stress/ABI/stubs_do.csproj b/src/tests/JIT/Stress/ABI/stubs_do.csproj index 38c8f167d1a26..074d268462d20 100644 --- a/src/tests/JIT/Stress/ABI/stubs_do.csproj +++ b/src/tests/JIT/Stress/ABI/stubs_do.csproj @@ -10,9 +10,6 @@ True true true - - - true Full diff --git a/src/tests/JIT/Stress/ABI/tailcalls_d.csproj b/src/tests/JIT/Stress/ABI/tailcalls_d.csproj index 9b916ec615643..f4a41e649c4bc 100644 --- a/src/tests/JIT/Stress/ABI/tailcalls_d.csproj +++ b/src/tests/JIT/Stress/ABI/tailcalls_d.csproj @@ -10,9 +10,6 @@ True true true - - - true Full diff --git a/src/tests/JIT/Stress/ABI/tailcalls_do.csproj b/src/tests/JIT/Stress/ABI/tailcalls_do.csproj index 5a71a5843a221..c295fce88b56d 100644 --- a/src/tests/JIT/Stress/ABI/tailcalls_do.csproj +++ b/src/tests/JIT/Stress/ABI/tailcalls_do.csproj @@ -10,9 +10,6 @@ True true true - - - true Full