[LLVMdev] trying to build llvm-gcc in linux/amd64

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Sep 12 13:52:30 PDT 2006


> Can you gdb cc1, run until the assertion, then mail the output of "call
> debug_tree(exp)"?  Also, can you include a stack trace with line numbers
> as well?

debug_tree crashes with a segfault. The backtrace is

#0  TreeToLLVM::Emit (this=0x7fff68bf4a40, exp=0x2acb42ae2100,
DestLoc=0x11f98d0) at ../../trunk/gcc/llvm-convert.cpp:441
#1  0x00000000006b16b6 in TreeToLLVM::EmitBuiltinVACopy
(this=0x7fff68bf4a40, exp=0x2acb42a137d0) at
../../trunk/gcc/llvm-convert.cpp:3381
#2  0x00000000006cf57c in TreeToLLVM::EmitBuiltinCall
(this=0x7fff68bf4a40, exp=0x2acb42a137d0, fndecl=0x2acb42aa70e0,
DestLoc=0x0, Result=@0x7fff68bf4648) at
../../trunk/gcc/llvm-convert.cpp:2871
#3  0x00000000006d03d4 in TreeToLLVM::EmitCALL_EXPR
(this=0x7fff68bf4a40, exp=0x2acb42a137d0, DestLoc=0x0) at
../../trunk/gcc/llvm-convert.cpp:1666
#4  0x00000000006ac84f in TreeToLLVM::Emit (this=0x7fff68bf4a40,
exp=0x2acb42a137d0, DestLoc=0x0) at
../../trunk/gcc/llvm-convert.cpp:501
#5  0x00000000006d376b in TreeToLLVM::EmitSTATEMENT_LIST
(this=0x7fff68bf4a40, exp=0x2acb42ae1db0, DestLoc=0x0) at
../../trunk/gcc/llvm-convert.cpp:1155
#6  0x00000000006ac767 in TreeToLLVM::Emit (this=0x7fff68bf4a40,
exp=0x2acb42ae1db0, DestLoc=0x0) at
../../trunk/gcc/llvm-convert.cpp:475
#7  0x00000000006d501d in TreeToLLVM::EmitBIND_EXPR
(this=0x7fff68bf4a40, exp=0x2acb42a13820, DestLoc=0x0) at
../../trunk/gcc/llvm-convert.cpp:1130
#8  0x00000000006ac74d in TreeToLLVM::Emit (this=0x7fff68bf4a40,
exp=0x2acb42a13820, DestLoc=0x0) at
../../trunk/gcc/llvm-convert.cpp:474
#9  0x000000000069922b in llvm_emit_code_for_current_function
(fndecl=0x2acb42ad4460) at ../../trunk/gcc/llvm-backend.cpp:405
#10 0x000000000048921a in tree_rest_of_compilation
(fndecl=0x2acb42ad4460) at ../../trunk/gcc/tree-optimize.c:702
#11 0x0000000000416a1c in c_expand_body (fndecl=0x7fff68bf4a40) at
../../trunk/gcc/c-decl.c:6771
#12 0x0000000000726aae in cgraph_expand_function (node=0x2acb42ad4a80)
at ../../trunk/gcc/cgraphunit.c:896
#13 0x0000000000726c31 in cgraph_assemble_pending_functions () at
../../trunk/gcc/cgraphunit.c:313
#14 0x0000000000729055 in cgraph_finalize_function
(decl=0x2acb42ad4460, nested=false) at
../../trunk/gcc/cgraphunit.c:411
#15 0x0000000000416f65 in finish_function () at ../../trunk/gcc/c-decl.c:6740
#16 0x0000000000409185 in yyparse () at c-parse.y:436
#17 0x000000000040e789 in c_parse_file () at c-parse.y:3438
#18 0x0000000000457df5 in c_common_parse_file (set_yydebug=<value
optimized out>) at ../../trunk/gcc/c-opts.c:1221
#19 0x0000000000670d0a in toplev_main (argc=<value optimized out>,
argv=<value optimized out>) at ../../trunk/gcc/toplev.c:1105
#20 0x00002acb4268e4ca in __libc_start_main () from /lib/libc.so.6
#21 0x0000000000407f7a in _start () at ../sysdeps/x86_64/elf/start.S:113


One think that I find interesting is that amd64 has a different
implementation of varargs. Running cc1 with -fdump-tree-all one gets
the following generic dump:
-----------------------------------------
f ()
{
  struct  va1[1];
  struct  va2[1];

  __builtin_va_copy (&va1, &va2);
}
------------------------------------------
in a x86 the output is

f ()
{
  char * va1;
  char * va2;

  __builtin_va_copy (&va1, va2);
}


> Thanks,
>
> -Chris

Thanks,
Rafael



More information about the llvm-dev mailing list