Hi all, I am working with gcc 4.1.1.
I have a target dependent function attribute to check the function mode. Before emitting the call instruction, i just want to check the function attribute and depending on that i need to emit the call instruction. After making the modifications, while building the compiler, i am getting the following errors: /home/rohit/TestPXE/BUILD/gcc-new4.1.1/./gcc/xgcc -B/home/rohit/TestPXE/BUILD/gcc-new4.1.1/./gcc/ -B/home/rohit/Z-MOD//bin/ -B/home/rohit/Z-MOD/lib/ -isystem /home/rohit/Z-MOD/include -isystem /home/rohit/Z-MOD/sys-include -O2 -O2 -g -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -malign-lbranch -mno-multiply-high -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../../../gcc-4.1.1/gcc -I../../../gcc-4.1.1/gcc/. -I../../../gcc-4.1.1/gcc/../include -I../../../gcc-4.1.1/gcc/../libcpp/include -DL_absvsi2 -c ../../../gcc-4.1.1/gcc/libgcc2.c -o libgcc/./_absvsi2.o Error is : ../../../gcc-pxe-4.1.1/gcc/libgcc2.c: In function â__absvsi2â: ../../../gcc-pxe-4.1.1/gcc/libgcc2.c:220: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. The error is due to the statement: gcc_assert (TREE_CODE (func_decl) == FUNCTION_DECL); Actual error due to: TREE_CODE (func_decl) The source file: #ifdef L_absvsi2 Wtype __absvSI2 (Wtype a) { Wtype w = a; if (a < 0) #ifdef L_negvsi2 w = __negvSI2 (a); #else w = -a; if (w < 0) abort (); // Error line #endif return w; } When the compiler emits a function call for abort(), i get the above mentioned error. When we look at the command line options, O2 optimization is enabled. If O0 is given , the code works fine. Any idea where i am going wrong!! Regards, Rohit