-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile: internal compiler error: bad live variable at entry of f #28445
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
Comments
Kindly paging @randall77 @cherrymui as it appeared after |
Before lower,
which looks correct. After lower,
There is no more memory relationship between the LEAQ and MOVQstoreconst. Note that CMPQload has mem arg v1 (InitMem) instead of v7. Later, schedule puts the LEAQ and the CMPQload (!) before the VarDef and the store,
which is bad. Maybe the problem is to choose the correct memory arg at CMPQload generation? |
Yuck. Even if the It might be safe since stack objects went in. plive now really only handles direct accesses, and all accesses through the pointers are indirect. |
Yeah, with stack objects, this might be safe. |
I think my idea doesn't quite work either. Maybe we need an LEAQ with memory argument? That would definitely be a verbose CL, I'd like to avoid it if anyone can think of a better way. |
@andybons A compiler crash on a valid 8 lines program, introduced during this cycle, is not a release-blocker? |
LEAQ is rematerializeable, and I think this is true for similar instructions on all other architectures. It might be fine if we guarantee to always generate LEAQ as late as we can (and we never spill it). (In this particular example, the CMPQload makes the LEAQ being generated too early.) I think if the LEAQ's result is stored into a stack object, the memory should already be initialized, as the store instruction has the correct memory dependency. I'm not sure how we perform this check in the compiler though. |
@ALTree When triaging, we decided that while the code is valid, it’s likely not common (at least in the form presented). I will leave it to @cherrymui and @randall77 to decide its severity. |
I agree that the repro isn't likely code. The underlying problem, though, might be more common. Hard to be sure. I'm going to mark it as a release blocker for now. |
Thanks, Keith. |
I looked at this some more. My patch to just treat LEAQ as not reading doesn't work because of this case:
At the This live-dead-live transition is bad. Treating |
Change https://golang.org/cl/153641 mentions this issue: |
The following program (reduced from a gosmith-generated one):
crashes the tip compiler with the following error:
It compiles fine on go1.11.
The text was updated successfully, but these errors were encountered: