First Last Prev Next    No search results available
Details
: llvm-gcc crashes compiling global union initializer
Bug#: 79
: tools
: llvm-gcc
Status: RESOLVED
Resolution: FIXED
: PC
: Linux
: 1.0
: P2
: normal
: 1.1

:
: compile-fail
:
:
  Show dependency tree - Show dependency graph
People
Reporter: Brian R. Gaeke <gaeke+bugs@uiuc.edu>
Assigned To: Chris Lattner <sabre@nondot.org>

Attachments
reduced testcase from sched.c (403 bytes, text/plain)
2003-11-01 12:58, Brian R. Gaeke
Details


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2003-11-01 12:54
I will post a reduced test case as an attachment.
------- Comment #1 From Brian R. Gaeke 2003-11-01 12:58:38 -------
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?
------- Comment #2 From Brian R. Gaeke 2003-11-01 16:09:27 -------
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}};


------- Comment #3 From Chris Lattner 2003-11-01 18:59:09 -------
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

First Last Prev Next    No search results available