william xiao wrote: > I' m trying to make some changes to GCC4.2. I want to obtain some > information about callee so i add one statment to function: rtx > expand_call (tree exp, rtx target, int ignore) as follows: > > 2702 /* Generate the actual call instruction. */ > 2703 emit_call_1 (funexp, exp, fndecl, funtype, unadjusted_args_size, > 2704 adjusted_args_size.constant, struct_value_size, > 2705 next_arg_reg, valreg, old_inhibit_defer_pop, call_fusage, > 2706 flags, & args_so_far); > 2707 tree callee = DECL_SAVED_TREE(fndecl); /* added stamtment by myself > */ > > Then, i get following strange make error message: > > > make[2]: *** [crtend.o] Error 1 > ../.././gcc/crtstuff.c: In function ‘__do_global_ctors_aux’: > ../.././gcc/crtstuff.c:521: internal compiler error: Segmentation > ../.././gcc/crtstuff.c: In function ‘__do_global_dtors_aux’: > ../.././gcc/crtstuff.c:287: internal compiler error: Segmentation fault > make[2]: *** [crtbegin.o] Error 1 > make[2]: Leaving directory `/wxiao3/src/gcc-4.2.0/host-i686-pc-linux-gnu/gcc' > make[1]: *** [install-gcc] Error 2 > make[1]: Leaving directory `/wxiao3/src/gcc-4.2.0' > make: *** [install] Error 2 > > What's the cause of these errors? I have never touch the files such > as crtend.c and crtstuff.c. I only add one statement to calls.c.
The files crtend.c and crtstuff.c are being compiled by the newly-built compiler, as the form part of the libgcc for the target, and it is your newly-built compiler that is crashing, owing to a bug in the change you made to calls.c. It's really hard to see what could be wrong with adding a call to DECL_SAVED_TREE if fndecl isn't NULL, but from the look of some of the code just a few lines earlier in the function: /* If register arguments require space on the stack and stack space was not preallocated, allocate stack space here for arguments passed in registers. */ if (OUTGOING_REG_PARM_STACK_SPACE ((!fndecl ? fntype : TREE_TYPE (fndecl))) ... it seems to me that that is at least a possibility that you have to deal with. cheers, DaveK