I am porting gcc to a new architecture, and have yet another problem that I've been staring at for far too long now.
Whenever I compile a program that calls malloc, GCC crashes with: /cygdrive/c/home/risc/src/gcc-4.1.2/gcc/unwind-dw2-fde.c: In function '__register_frame': /cygdrive/c/home/risc/src/gcc-4.1.2/gcc/unwind-dw2-fde.c:119: 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. make[3]: *** [libgcc/./unwind-dw2-fde.o] Error 1 (this example is from compiling libgcc, but the exact same thing happens for any file that calls malloc). I've looked at it in gdb and the error occurs in expand_call() in gcc/calls.c, at line 2787: rtx temp = gen_reg_rtx (GET_MODE (valreg)); where valreg is a null pointer. I've looked at the source, but I really can't see why it would be anything other than zero at that point, so I don't understand what is causing this. Does anyone have an idea about where to look for the cause of the problem?