I'm getting the following assembler error with current gcc 4.3. This worked with 20070604 and is probably due to the dataflow merge. tbm@coconut0:~$ /usr/lib/gcc-snapshot/bin/gcc -c -O1 ccmalloc-callchain.c ccmalloc-callchain.c: In function 'backtrace': ccmalloc-callchain.c:14: warning: unsupported argument to '__builtin_return_address' /tmp/ccMB3CzF.s: Assembler messages: /tmp/ccMB3CzF.s:10: Warning: Second operand of .save contradicts .prologue /tmp/ccMB3CzF.s:17: Error: Register number out of range 0..1 /tmp/ccMB3CzF.s:17: Warning: Use of 'mov' violates WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 33 /tmp/ccMB3CzF.s:17: Warning: Only the first path encountering the conflict is reported /tmp/ccMB3CzF.s:14: Warning: This is the location of the conflicting usage /tmp/ccMB3CzF.s:39: Error: Register number out of range 0..1 /tmp/ccMB3CzF.s:60: Error: Register number out of range 0..1 Testcase: typedef struct __jmp_buf_tag { } jmp_buf[1]; static jmp_buf backtrace_jump; static char * return_address (unsigned i) { switch (i) { case 0: return (char *) __builtin_return_address (0); case 1: return (char *) __builtin_return_address (1); } } backtrace (int skip) { if (_setjmp (backtrace_jump) == 0) { int i = ++skip; while (1) { char *pc = return_address (i++); if (!pc) break; } } }
Created attachment 13846 [details] gcc43-pr32337.patch The problem seems to be caused by the addition of the emitted_frame_related_regs array, there are several issues I found (see this patch) and in the end two of the 3 saved registers (RP, PFS, FP) were saved in the same register, which caused severe havoc. I'll try to bootstrap/regtest this on ia64-linux, so far I have only tested that it cures the testcase.
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128490