First Last Prev Next    No search results available
Details
: CFrontend crashes when compiling C99 compound expressions...
Bug#: 81
: 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 <clattner@apple.com>

Attachments


Note

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

Related actions


Description:   Opened: 2003-11-01 15:33
Reduced from linux-2.4.22/kernel/kmod.c:call_usermodehelper().
Ordinary gcc accepts this code, which makes use of the ancient
pre-C99 syntax for partial structure initialization, so it's
technically a "C extension". Linux seems to use this syntax a
lot.

419 gally> cat kmod4.c
typedef struct { int foo; } spinlock_t;
typedef struct wait_queue_head_t { spinlock_t lock; } wait_queue_head_t;
void call_usermodehelper(void) { struct wait_queue_head_t work = { lock:
(spinlock_t) { 0 }, }; }

420 gally> llvm-gcc -c kmod4.c
kmod4.c: In function `call_usermodehelper':
kmod4.c:3: internal compiler error: tree check: expected constructor, have
compound_literal_expr in llvm_expand_constructor_elements, at llvm-expand.c:3305
------- Comment #1 From Brian R. Gaeke 2003-11-01 15:35:49 -------
It doesn't seem to like the C99 syntax  (... { .lock = (spinlock_t) ...) either.
------- Comment #2 From Chris Lattner 2003-11-01 18:24:09 -------
Fixed.

Testcase: test/Regression/CFrontend/2003-11-01-C99-CompoundLiteral.c

Thanks!

-Chris

First Last Prev Next    No search results available