Chandler Carruth
2008-Mar-27 15:52 UTC
[LLVMdev] llvm-gcc 4.2 assertion failed on linux x86_64
Here you go: Starting program: /home/chandlerc/code/compilers/build/llvm-gcc/gcc/cc1 -fpreprocessed -march=k8 testcase.i -o /dev/null warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7fff0d5fe000 [Thread debugging using libthread_db enabled] foocc1: /home/chandlerc/code/compilers/llvm-gcc/gcc/llvm-types.cpp:81: const llvm::Type* llvm_set_type(tree_node*, const llvm::Type*): Assertion `(!(__extension__ ({ const tree __t = (Tr); if (tree_code_type[(int) (((enum tree_code) (__t)->common.code))] != (tcc_type)) tree_class_check_failed (__t, (tcc_type), "/home/chandlerc/code/compilers/llvm-gcc/gcc/llvm- types.cpp", 81, __FUNCTION__); __t; })->type.size) || !Ty->isSized() || !isInt64((__extension__ ({ const tree __t = (Tr); if (tree_code_type[(int) (((enum tree_code) (__t)->common.code))] != (tcc_type)) tree_class_check_failed (__t, (tcc_type), "/home/chandlerc/code/compilers/llvm-gcc/gcc/llvm-types.cpp", 81, __FUNCTION__); __t; })->type.size), true) || getInt64((__extension__ ({ const tree __t = (Tr); if (tree_code_type[(int) (((enum tree_code) (__t)-> common.code))] != (tcc_type)) tree_class_check_failed (__t, (tcc_type), "/home/chandlerc/code/compilers/llvm-gcc/gcc/llvm-types.cpp", 81, __FUNCTION__); __t; })->type.size), true) =getTargetData().getABITypeSizeInBits(Ty)) && "LLVM type size doesn't match GCC type size!"' failed. [New Thread 0x2b709e7b8440 (LWP 15687)] Program received signal SIGABRT, Aborted. [Switching to Thread 0x2b709e7b8440 (LWP 15687)] 0x00002b709e48afa5 in raise () from /lib/libc.so.6 (gdb) up #1 0x00002b709e48ca00 in abort () from /lib/libc.so.6 (gdb) up #2 0x00002b709e4843df in __assert_fail () from /lib/libc.so.6 (gdb) up #3 0x0000000000a84d3b in llvm_set_type (Tr=0x2b709d6f8790, Ty=0x166c210) at /home/chandlerc/code/compilers/llvm-gcc/gcc/llvm-types.cpp:78 78 assert((!TYPE_SIZE(Tr) || !Ty->isSized() || !isInt64(TYPE_SIZE(Tr), true) || (gdb) Ty->dump() Undefined command: "Ty->dump". Try "help". (gdb) call Ty->dump() x86_fp80 (gdb) call debug_tree(type) No symbol "type" in current context. (gdb) up #4 0x0000000000a86501 in TypeConverter::ConvertType (this=0x16941a0, orig_type=0x2b709d6f8790) at /home/chandlerc/code/compilers/llvm-gcc/gcc/llvm-types.cpp:756 756 case 80: return SET_TYPE_LLVM(type, Type::X86_FP80Ty); (gdb) call debug_tree(type) <real_type 0x2b709d6f8790 long double sizes-gimplified XF size <integer_cst 0x2b709d6f39c0 type <integer_type 0x2b709d6e4370 bit_size_type> constant invariant 96> unit size <integer_cst 0x2b709d6f39f0 type <integer_type 0x2b709d6e42c0 long unsigned int> constant invariant 12> align 32 symtab 0 alias set -1 precision 80 pointer_to_this <pointer_type 0x2b709d6f89a0>> (gdb) On Thu, Mar 27, 2008 at 1:18 AM, Duncan Sands <baldrick at free.fr> wrote:> Hi Chandler, > > > > void > > foo () { > > float x __attribute__ ((mode (XF))); > > } > > nice reduction. I don't see any problem on x86-32, > and I don't have access to an x86-64 box right now. > Can you please open a PR for this, and also run in > the debugger. When you hit the abort, use "up" to > go up a stack frame or two or three, and print out > the gcc types [use: call debug_tree(type) ] and the > LLVM type [use: call Ty->dump() ]. > > Thanks, > > Duncan. >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080327/075975c5/attachment.html>
Duncan Sands
2008-Mar-27 16:04 UTC
[LLVMdev] llvm-gcc 4.2 assertion failed on linux x86_64
Does this fix it? Index: lib/Target/X86/X86Subtarget.h ==================================================================--- lib/Target/X86/X86Subtarget.h (revision 48879) +++ lib/Target/X86/X86Subtarget.h (working copy) @@ -144,9 +144,12 @@ std::string getDataLayout() const { const char *p; - if (is64Bit()) - p = "e-p:64:64-s:64-f64:64:64-i64:64:64-f80:128:128"; - else { + if (is64Bit()) { + if (isTargetDarwin()) + p = "e-p:64:64-s:64-f64:64:64-i64:64:64-f80:128:128"; + else + p = "e-p:64:64-s:64-f64:64:64-i64:64:64-f80:32:32"; + } else { if (isTargetDarwin()) p = "e-p:32:32-f64:32:64-i64:32:64-f80:128:128"; else
Probably better to move the discussion to a bug? Evan On Mar 27, 2008, at 9:04 AM, Duncan Sands wrote:> Does this fix it? > > Index: lib/Target/X86/X86Subtarget.h > ==================================================================> --- lib/Target/X86/X86Subtarget.h (revision 48879) > +++ lib/Target/X86/X86Subtarget.h (working copy) > @@ -144,9 +144,12 @@ > > std::string getDataLayout() const { > const char *p; > - if (is64Bit()) > - p = "e-p:64:64-s:64-f64:64:64-i64:64:64-f80:128:128"; > - else { > + if (is64Bit()) { > + if (isTargetDarwin()) > + p = "e-p:64:64-s:64-f64:64:64-i64:64:64-f80:128:128"; > + else > + p = "e-p:64:64-s:64-f64:64:64-i64:64:64-f80:32:32"; > + } else { > if (isTargetDarwin()) > p = "e-p:32:32-f64:32:64-i64:32:64-f80:128:128"; > else > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev