-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
[llvmgcc] Global unions initialization does not work in all cases #534
Comments
Note that this bug seems to prevent LLVM GCC from compiling on Sparc, so I'm The problem seems to occur because we use the same code to initialize structures I've hacked up a patch that seems to more or less work (but may not totally be |
My proposed patch fixes GCC so that it can build on Sparc again, but it produces After further investigation, I found the following:
I believe the second and third points are the cause of the problem. The failing llvm-gcc converts this union to a structure with one integer member. When |
I belive this summary describes the problem a little more precisely: Unions in C/C++ are reduced to an LLVM structure containing the largest member. |
Unfortunately, there isn't really any way to fix this without a substantial -Chris |
Ugh. I looked into this more, and this is precisely the case that I need to I changed the subject line to be a bit more amorphous, because there are other -Chris |
perhaps next release |
*** Bug llvm/llvm-bugzilla-archive#650 has been marked as a duplicate of this bug. *** |
*** Bug #528 has been marked as a duplicate of this bug. *** |
When working on this bug, please make sure that all of the marked duplicates are fixed before this one is -Chris |
Testcase here: llvm-test/SingleSource/UnitTests/2006-01-23-UnionInit.c -Chris |
This is fixed in llvmgcc4. |
mentioned in issue llvm/llvm-bugzilla-archive#199 |
Extended Description
The GCC front end hits an assertion when compiling
llvm/test/Regression/CFrontend/2003-01-30-UnionInit.c (named test.c in the
following sample output):
cc1: ../../src/gcc/llvm-expand.c:4679: llvm_expand_constant_expr: Assertion `0
&& "Couldn't expand constructor in this context!"' failed.
test.c:8: internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See URL:http://llvm.cs.uiuc.edu for instructions.
The text was updated successfully, but these errors were encountered: