Skip to content

Conversation

@kunalspathak
Copy link
Contributor

The empty IGs are sometimes created before the loop that we are trying to align to ensure the loop size calculation is correct.

Fixes: #62250

@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Dec 15, 2021
@kunalspathak
Copy link
Contributor Author

@dotnet/jit-contrib

@ghost ghost assigned kunalspathak Dec 15, 2021
@ghost
Copy link

ghost commented Dec 15, 2021

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

Issue Details

The empty IGs are sometimes created before the loop that we are trying to align to ensure the loop size calculation is correct.

Fixes: #62250

Author: kunalspathak
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

Copy link
Contributor

@BruceForstall BruceForstall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I apologize, since I suggested to you to loosen the assert, but after looking at the test case for a while, I think this is the wrong fix. I think there's a bug in the split algorithm (emitSplit) for zero sized IGs. Do you mind if I take the issue?

@ghost ghost added the needs-author-action An issue or pull request that requires more info or actions from the author. label Dec 16, 2021
@kunalspathak
Copy link
Contributor Author

Now that I was able to debug the issue with your minimum repro, I think the problem is that we should not report the candidate if it has size zero. So, may be something like this? I verified and it fixes the issue. Were you thinking similar fix?

@@ -2764,6 +2764,10 @@ void emitter::emitSplit(emitLocation*         startLoc,
         {
             // We can't update the candidate
         }
+        else if (ig->igSize == 0)
+        {
+            // We can't update the candiate because it is empty.
+        }
         else
         {
             igLastCandidate = ig;

@ghost ghost removed the needs-author-action An issue or pull request that requires more info or actions from the author. label Dec 16, 2021
@BruceForstall
Copy link
Contributor

@kunalspathak Almost; here's my proposal: #62931

@kunalspathak
Copy link
Contributor Author

#62931 will take care of this.

@ghost ghost locked as resolved and limited conversation to collaborators Jan 16, 2022
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assertion failed 'endOffset > startOffset' during 'Emit GC+EH tables'

2 participants