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 '!op1->isUsedFromMemory()' #76511

Closed
BruceForstall opened this issue Oct 2, 2022 · 4 comments · Fixed by #76517
Closed

Assertion failed '!op1->isUsedFromMemory()' #76511

BruceForstall opened this issue Oct 2, 2022 · 4 comments · Fixed by #76517
Assignees
Labels
arch-arm64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI blocking-outerloop Blocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runs
Milestone

Comments

@BruceForstall
Copy link
Member

"runtime-coreclr outerloop" R2R-CG2 test failures on arm64 in JIT\Regression\JitBlue\Runtime_76273\Runtime_76273\Runtime_76273.cmd:

https://dev.azure.com/dnceng-public/public/_build/results?buildId=37881&view=ms.vss-test-web.build-test-results-tab&runId=755738&resultId=108102&paneView=dotnet-dnceng.dnceng-build-release-tasks.helix-test-information-tab

    JIT\Regression\JitBlue\Runtime_76273\Runtime_76273\Runtime_76273.cmd [FAIL]
      
      Return code:      1
      Raw output file:      D:\h\w\B49209AE\w\A7DB0945\uploads\Reports\JIT.Regression\JitBlue\Runtime_76273\Runtime_76273\Runtime_76273.output.txt
      Raw output:
      BEGIN EXECUTION
      Runtime_76273.dll
              1 file(s) copied.
       7:07:25.95
      Response file: D:\h\w\B49209AE\w\A7DB0945\e\JIT\Regression\JitBlue\Runtime_76273\Runtime_76273\Runtime_76273.dll.rsp
      D:\h\w\B49209AE\w\A7DB0945\e\JIT\Regression\JitBlue\Runtime_76273\Runtime_76273\IL-CG2\Runtime_76273.dll
      -o:D:\h\w\B49209AE\w\A7DB0945\e\JIT\Regression\JitBlue\Runtime_76273\Runtime_76273\Runtime_76273.dll
      --targetarch:arm64
      --verify-type-and-field-layout
      --method-layout:random
      -r:D:\h\w\B49209AE\p\System.*.dll
      -r:D:\h\w\B49209AE\p\Microsoft.*.dll
      -r:D:\h\w\B49209AE\p\mscorlib.dll
      -r:D:\h\w\B49209AE\p\netstandard.dll
      -O
      " "dotnet" "D:\h\w\B49209AE\p\crossgen2\crossgen2.dll" @"D:\h\w\B49209AE\w\A7DB0945\e\JIT\Regression\JitBlue\Runtime_76273\Runtime_76273\Runtime_76273.dll.rsp"   -r:D:\h\w\B49209AE\w\A7DB0945\e\JIT\Regression\JitBlue\Runtime_76273\Runtime_76273\IL-CG2\*.dll"
      D:\a\_work\1\s\src\coreclr\jit\codegenarm64.cpp:4543
      Assertion failed '!op1->isUsedFromMemory()' in 'Program:M11(C0,short)' during 'Generate code' (IL size 87; hash 0xb0dcda0a; FullOpts)
      
       7:07:33.84
      Crossgen2 failed with exitcode - -2147483645
      Test Harness Exitcode is : 1

@dotnet/jit-contrib

@BruceForstall BruceForstall added arch-arm64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI blocking-outerloop Blocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runs labels Oct 2, 2022
@BruceForstall BruceForstall added this to the 8.0.0 milestone Oct 2, 2022
@ghost
Copy link

ghost commented Oct 2, 2022

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

Issue Details

"runtime-coreclr outerloop" R2R-CG2 test failures on arm64 in JIT\Regression\JitBlue\Runtime_76273\Runtime_76273\Runtime_76273.cmd:

https://dev.azure.com/dnceng-public/public/_build/results?buildId=37881&view=ms.vss-test-web.build-test-results-tab&runId=755738&resultId=108102&paneView=dotnet-dnceng.dnceng-build-release-tasks.helix-test-information-tab

    JIT\Regression\JitBlue\Runtime_76273\Runtime_76273\Runtime_76273.cmd [FAIL]
      
      Return code:      1
      Raw output file:      D:\h\w\B49209AE\w\A7DB0945\uploads\Reports\JIT.Regression\JitBlue\Runtime_76273\Runtime_76273\Runtime_76273.output.txt
      Raw output:
      BEGIN EXECUTION
      Runtime_76273.dll
              1 file(s) copied.
       7:07:25.95
      Response file: D:\h\w\B49209AE\w\A7DB0945\e\JIT\Regression\JitBlue\Runtime_76273\Runtime_76273\Runtime_76273.dll.rsp
      D:\h\w\B49209AE\w\A7DB0945\e\JIT\Regression\JitBlue\Runtime_76273\Runtime_76273\IL-CG2\Runtime_76273.dll
      -o:D:\h\w\B49209AE\w\A7DB0945\e\JIT\Regression\JitBlue\Runtime_76273\Runtime_76273\Runtime_76273.dll
      --targetarch:arm64
      --verify-type-and-field-layout
      --method-layout:random
      -r:D:\h\w\B49209AE\p\System.*.dll
      -r:D:\h\w\B49209AE\p\Microsoft.*.dll
      -r:D:\h\w\B49209AE\p\mscorlib.dll
      -r:D:\h\w\B49209AE\p\netstandard.dll
      -O
      " "dotnet" "D:\h\w\B49209AE\p\crossgen2\crossgen2.dll" @"D:\h\w\B49209AE\w\A7DB0945\e\JIT\Regression\JitBlue\Runtime_76273\Runtime_76273\Runtime_76273.dll.rsp"   -r:D:\h\w\B49209AE\w\A7DB0945\e\JIT\Regression\JitBlue\Runtime_76273\Runtime_76273\IL-CG2\*.dll"
      D:\a\_work\1\s\src\coreclr\jit\codegenarm64.cpp:4543
      Assertion failed '!op1->isUsedFromMemory()' in 'Program:M11(C0,short)' during 'Generate code' (IL size 87; hash 0xb0dcda0a; FullOpts)
      
       7:07:33.84
      Crossgen2 failed with exitcode - -2147483645
      Test Harness Exitcode is : 1

@dotnet/jit-contrib

Author: BruceForstall
Assignees: -
Labels:

arch-arm64, area-CodeGen-coreclr, blocking-outerloop

Milestone: 8.0.0

@EgorBo
Copy link
Member

EgorBo commented Oct 2, 2022

cc @tannergooding who added this test recently in #76273

@SingleAccretion
Copy link
Contributor

The fix:

diff --git a/src/coreclr/jit/lower.cpp b/src/coreclr/jit/lower.cpp
index 176828d17ed..3fb6ed57317 100644
--- a/src/coreclr/jit/lower.cpp
+++ b/src/coreclr/jit/lower.cpp
@@ -2816,6 +2816,8 @@ GenTree* Lowering::OptimizeConstCompare(GenTree* cmp)
                 op2->gtType    = castToType;
 #endif
                 // If we have any contained memory ops on castOp, they must now not be contained.
+                castOp->ClearContained();
+
                 if (castOp->OperIs(GT_OR, GT_XOR, GT_AND))
                 {
                     GenTree* op1 = castOp->gtGetOp1();
@@ -2829,10 +2831,6 @@ GenTree* Lowering::OptimizeConstCompare(GenTree* cmp)
                         op2->ClearContained();
                     }
                 }
-                else
-                {
-                    castOp->ClearContained();
-                }

                 cmp->AsOp()->gtOp1 = castOp;

@tannergooding
Copy link
Member

Was getting more details on discord, this bug is really "unrelated" to the ADDEX change and is likely just exposed by it due to the other transforms happening.

That being said, we are doing castOp->ClearContained() in IsContainableBinaryOp "too early" and we could probably do with fixing that as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-arm64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI blocking-outerloop Blocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants