Bugzilla – Bug 79
llvm-gcc crashes compiling global union initializer
Last modified: 2003-11-01 19:20:42
You need to log in before you can comment on or make changes to this bug.
I will post a reduced test case as an attachment.
Created an attachment (id=3) [details] reduced testcase from sched.c The code tries to statically initialize a union with a constant initializer. Apparently llvm-gcc thinks the type of the initializer doesn't match the type of the union, or something. I get the error message: cc1: ../../gcc-3.4/gcc/llvm-expand.c:3237: llvm_expand_constructor_element: Assertion `0 && "Cannot adjust type of aggregate constant initializer!"' failed. bug.i:14: internal compiler error: Aborted I wonder why llvm_type_is_composite didn't return true for this?
We found a simpler test case, this time reduced from linux-2.4.22/fs/buffer.c. 503 gally> cat carp4.c union bdflush_param { struct { int x; } b_un; int y[1]; } bdf_prm = {{30}};
This is now fixed. Testcase: test/Regression/CFrontend/2003-11-01-GlobalUnionInit.c It's possible that there are other bugs similar to this one, which haven't been fixed. If you run into any more, please reopen this bug and add another testcase. Thanks, -Chris