This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

assign_temp at function.c


Hello, good to see you.

I'm porting binutils, gnu compiler collection, and newlib to a new
architecture. Last time, i asked about compiling with debug option
'-g'. and i resolved it with Ian's help.

so, now i'm trying compiling newlib in order to make whole gcc
including libgcc, libssp. etc. However, I'm in trouble.

when i compile newlib with my gcc, i get the segmentation fault
message in __adjust at stdlib/__adjust.c in newlib, also, _svfprintf_r
at stdio/vfprintf.c

I backtraced the fault with gdb. and the result is shown below.

 __sprint_r _svfprintf_r
Program received signal SIGSEGV, Segmentation fault.
assign_temp (type_or_decl=0x0, keep=0, memory_required=1,
dont_promote=1) at ../../../sdk/gcc-4.3.3/gcc/function.c:807
807       if (DECL_P (type_or_decl))
(gdb) bt
#0  assign_temp (type_or_decl=0x0, keep=0, memory_required=1,
dont_promote=1) at ../../../sdk/gcc-4.3.3/gcc/function.c:807
#1  0x0814d05c in emit_push_insn (x=0xb79ba038, mode=DFmode, type=0x0,
size=0xb79bc240, align=32, partial=0, reg=0x0, extra=0,
    args_addr=0xb79be2a0, args_so_far=0xb79bc200,
reg_parm_stack_space=0, alignment_pad=0xb79bc200)
    at ../../../sdk/gcc-4.3.3/gcc/expr.c:3731
#2  0x080cb966 in emit_library_call_value_1 (retval=1,
orgfun=0xb76ec4f0, value=0x0, fn_type=LCT_CONST, outmode=SImode,
    nargs=3, p=0xbff14764 "") at ../../../sdk/gcc-4.3.3/gcc/calls.c:3730
#3  0x080cc8c1 in emit_library_call_value (orgfun=0xb76ec4f0,
value=0x0, fn_type=LCT_CONST, outmode=SImode, nargs=2)
    at ../../../sdk/gcc-4.3.3/gcc/calls.c:4055
#4  0x081c5e63 in emit_cmp_and_jump_insns (x=0xb76e6300, y=0xb79ba038,
comparison=LT, size=0x0, mode=SImode, unsignedp=0,
    label=0xb76f0240) at ../../../sdk/gcc-4.3.3/gcc/optabs.c:4597
#5  0x08102d0c in do_compare_rtx_and_jump (op0=0xb76e6300,
op1=0xb79ba038, code=LT, unsignedp=0, mode=DFmode, size=0x0,
    if_false_label=0xb76f021c, if_true_label=0xb76f0240) at
../../../sdk/gcc-4.3.3/gcc/dojump.c:935
#6  0x08103748 in do_compare_and_jump (exp=<value optimized out>,
signed_code=LT, unsigned_code=LTU,
    if_false_label=0xb76f021c, if_true_label=0x0) at
../../../sdk/gcc-4.3.3/gcc/dojump.c:1015
#7  0x08103e5a in do_jump (exp=0xb78d65a0, if_false_label=0xb76f021c,
if_true_label=0x0)
    at ../../../sdk/gcc-4.3.3/gcc/dojump.c:395
#8  0x081047d0 in jumpifnot (exp=0xb78d65a0, label=0xb76f021c) at
../../../sdk/gcc-4.3.3/gcc/dojump.c:102
#9  0x083a0897 in expand_gimple_basic_block (bb=0xb7937834) at
../../../sdk/gcc-4.3.3/gcc/cfgexpand.c:1325
#10 0x083a0e89 in tree_expand_cfg () at
../../../sdk/gcc-4.3.3/gcc/cfgexpand.c:1921
#11 0x081d1467 in execute_one_pass (pass=0x84fad00) at
../../../sdk/gcc-4.3.3/gcc/passes.c:1122
#12 0x081d1617 in execute_pass_list (pass=0x84fad00) at
../../../sdk/gcc-4.3.3/gcc/passes.c:1176
#13 0x0827ba1a in tree_rest_of_compilation (fndecl=0xb7a998c0) at
../../../sdk/gcc-4.3.3/gcc/tree-optimize.c:404
#14 0x083650e8 in cgraph_expand_function (node=0xb79bf700) at
../../../sdk/gcc-4.3.3/gcc/cgraphunit.c:1166
#15 0x08366a5f in cgraph_optimize () at
../../../sdk/gcc-4.3.3/gcc/cgraphunit.c:1229
#16 0x0805946c in c_write_global_declarations () at
../../../sdk/gcc-4.3.3/gcc/c-decl.c:8086
#17 0x08247c01 in toplev_main (argc=21, argv=0xbff14bb4) at
../../../sdk/gcc-4.3.3/gcc/toplev.c:1055
#18 0x080a8902 in main (argc=2031645, argv=0x0) at
../../../sdk/gcc-4.3.3/gcc/main.c:35


two segmentation faults occurs at the same function, assign_temp.

as you see, assign_temp requires tree parameter, but in the message
above, the tree parameter is NULL.  in the assign_temp, it seems to
access the member of the tree. As a result, the pointer goes out of
bound, So it results SIGSEGV.

I think this is occurred by my mistake in target.h or target.md . Does
anyone know why this happens? I'm digging this problem without any
achievement for 2 days :(

-- Eunchan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]