Bugzilla – Bug 501
[llvm-g++] Crash compiling anonymous union
Last modified: 2005-02-11 13:28:29
You need to log in before you can comment on or make changes to this bug.
LLVM 1.4 failed to compile two files critical to building Trolltech's Qt4 toolkit. I tried to build this with 1.3 and it ran into a bug which has since been fixed, but now it is running into these. Two files are confirmed crash: qt4/src/moc/qstring.cpp and qt4/src/moc/qhash.cpp Here is the compile line and output for qstring.cpp: g++ -c -pipe -g -Wall -W -DQT_MOC -DQT_NO_CODECS -DQT_LITE_UNICODE -DQT_NO_COMPONENT -DQT_NO_STL -DQT_NO_COMPRESS -DQT_NO_DATASTREAM -DQT_NO_TEXTSTREAM -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_THREAD -DQT_NO_REGEXP -DQT_NO_QOBJECT -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I/home/manyoso/dev/qt4/mkspecs/linux-g++ -I. -I../core/arch/generic -I../../include -I. -I../../include/QtCore -I. -o .-shared-debug/qstring.o ../core/tools/qstring.cpp ERROR: In function genllvm_decl_stmt:2637, tree not handled by LLVM yet! <decl_stmt 0x40c29b7c tree_1 arg 0 <var_decl 0x40c2b1c0 type <union_type 0x40c22ee0 ._61 type_5 BLK size <integer_cst 0x40396654 constant 320> unit size <integer_cst 0x4034c938 constant 40> align 32 symtab 0 alias set -1 fields <field_decl 0x40c2a230 digitUsed> context <function_decl 0x4068dd20 multiArg> pointer_to_this <pointer_type 0x40c2a000> reference_to_this <reference_type 0x40c2aa10> chain <type_decl 0x40c2a070 ._61>> addressable BLK file ../core/tools/qstring.cpp line 5867 size <integer_cst 0x40396654 320> unit size <integer_cst 0x4034c938 40> align 32 context <function_decl 0x4068dd20 multiArg> chain <var_decl 0x40c2b310 uc type <pointer_type 0x40362f50> addressable unsigned used tree_1 SI file ../core/tools/qstring.cpp line 5868 size <integer_cst 0x4001f9b0 constant 32> unit size <integer_cst 0x4001f9d8 constant 4> align 32 context <function_decl 0x4068dd20 multiArg> initial <nop_expr 0x40c29c94> chain <var_decl 0x40c2b4d0 args>>> chain <decl_stmt 0x40c29cd0 tree_1 arg 0 <var_decl 0x40c2b310 uc> chain <decl_stmt 0x40c29dc0 tree_1 arg 0 <var_decl 0x40c2b4d0 args> chain <decl_stmt 0x40c29e9c tree_1 arg 0 <var_decl 0x40c2b540 len> chain <decl_stmt 0x40c29f28 tree_1 arg 0 <var_decl 0x40c2b5b0 end> chain <decl_stmt 0x40c29fb4 tree_1 arg 0 <var_decl 0x40c2b620 lastDigit> chain <decl_stmt 0x40c29fdc tree_1 arg 0 <var_decl 0x40c2b690 i> chain <expr_stmt 0x40c2c21c>>>>>>>> ../core/tools/qstring.cpp: In member function `QString QString::multiArg(int, const QString&, const QString&, const QString&, const QString&) const': ../core/tools/qstring.cpp:5867: internal compiler error: in genllvm_decl_stmt, at llvm-expand.c:2637 Here is the compile line and output for qhash.cpp: g++ -c -pipe -g -Wall -W -DQT_MOC -DQT_NO_CODECS -DQT_LITE_UNICODE -DQT_NO_COMPONENT -DQT_NO_STL -DQT_NO_COMPRESS -DQT_NO_DATASTREAM -DQT_NO_TEXTSTREAM -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_THREAD -DQT_NO_REGEXP -DQT_NO_QOBJECT -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I/home/manyoso/dev/qt4/mkspecs/linux-g++ -I. -I../core/arch/generic -I../../include -I. -I../../include/QtCore -I. -o .-shared-debug/qhash.o ../core/tools/qhash.cpp ERROR: In function genllvm_decl_stmt:2637, tree not handled by LLVM yet! <decl_stmt 0x409b1064 tree_1 arg 0 <var_decl 0x409b0150 type <union_type 0x409af070 ._34 type_5 SI size <integer_cst 0x4001f9b0 constant 32> unit size <integer_cst 0x4001f9d8 constant 4> align 32 symtab 0 alias set -1 fields <field_decl 0x409af2a0 d> context <function_decl 0x405cb3f0 detach_helper> pointer_to_this <pointer_type 0x409af150> reference_to_this <reference_type 0x409af9a0> chain <type_decl 0x409af1c0 ._34>> SI file ../core/tools/qhash.cpp line 134 size <integer_cst 0x4001f9b0 32> unit size <integer_cst 0x4001f9d8 4> align 32 context <function_decl 0x405cb3f0 detach_helper>> chain <expr_stmt 0x409b11b8 tree_1 arg 0 <convert_expr 0x409b11a4 type <void_type 0x4014acb0 void> side-effects arg 0 <modify_expr 0x409ab528 type <pointer_type 0x405c7af0> side-effects arg 0 <component_ref 0x409ab4c8 type <pointer_type 0x405c7af0> arg 0 <var_decl 0x409b0150> arg 1 <field_decl 0x409af2a0 d>> arg 1 <nop_expr 0x409b1168 type <pointer_type 0x405c7af0> side-effects static arg 0 <nop_expr 0x409b1154 type <pointer_type 0x405c7af0> side-effects arg 0 <call_expr 0x409ab510 type <pointer_type 0x4014ad20> side-effects arg 0 <addr_expr 0x409b1140> arg 1 <tree_list 0x409b112c>>>>>> chain <expr_stmt 0x409b126c tree_1 arg 0 <convert_expr 0x409b1258 type <void_type 0x4014acb0 void> side-effects arg 0 <modify_expr 0x409ab558 type <pointer_type 0x405c7d20> side-effects arg 0 <component_ref 0x409ab540 type <pointer_type 0x405c7d20> arg 0 <indirect_ref 0x409b11cc type <record_type 0x405c7a10 QHashData> arg 0 <component_ref 0x409ab4c8>> arg 1 <field_decl 0x405c9d20 fakeNext>> arg 1 <integer_cst 0x409b1244 constant 0>>> chain <expr_stmt 0x409b1320 tree_1 arg 0 <convert_expr 0x409b130c type <void_type 0x4014acb0 void> side-effects arg 0 <modify_expr 0x409ab588 type <pointer_type 0x405c9d90> side-effects arg 0 <component_ref 0x409ab570 type <pointer_type 0x405c9d90> arg 0 <indirect_ref 0x409b1280> arg 1 <field_decl 0x405c9e00 buckets>> arg 1 <integer_cst 0x409b12f8 constant 0>>> chain <expr_stmt 0x409b149c tree_1 arg 0 <call_expr 0x409ab618 type <void_type 0x4014acb0 void> side-effects nothrow arg 0 <addr_expr 0x409b1488 type <pointer_type 0x401d8930> arg 0 <function_decl 0x401b2850 init>> arg 1 <tree_list 0x409b1460 value <nop_expr 0x409b144c> chain <tree_list 0x409b1474>>> chain <expr_stmt 0x409b1550 tree_1 arg 0 <convert_expr 0x409b153c type <void_type 0x4014acb0 void> side-effects arg 0 <modify_expr 0x409ab660>> chain <expr_stmt 0x409b1604 tree_1 arg 0 <convert_expr 0x409b15f0> chain <expr_stmt 0x409b16b8>>>>>>>> ../core/tools/qhash.cpp: In member function `QHashData* QHashData::detach_helper(QHashData::Node*(*)(QHashData::Node*))': ../core/tools/qhash.cpp:134: internal compiler error: in genllvm_decl_stmt, at llvm-expand.c:2637
Created an attachment (id=199) [details] Preprocessed source for qstring.cpp
Created an attachment (id=200) [details] Preprocessed source for qhash.cpp
I will look into this today, thanks!! -Chris
Here's a reduced testcase: int test(float F) { union { float G; int i; }; G = F; return i; } -Chris
Fixed. Testcase here: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050207/024014.html Patch here: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050207/024015.html Thanks a lot! -Chris