Hi, Ian, I have created a simpler example, just a function computing a sum of its arguments:
int sum(int a, int b, int c, int d, int e, int f, int g, int h) { return a + b + c + d + e + f + g + h; } The "argp" is a pseudo-register included in all register classes, that contain normal general-purpose regs. Here is the assembly output (msp430-gcc -O0): sum: push r4 mov r1, argp add #4, argp sub #8, r1 mov r1, r4 /* prologue ends here (frame size = 8) */ .L__FrameSize_sum=0x8 .L__FrameOffset_sum=0xa mov r15, @r4 mov r14, 2(r4) mov r13, 4(r4) mov r12, 6(r4) mov @r4, r15 add 2(r4), r15 add 4(r4), r15 add 6(r4), r15 add @r16, r15 add 2(r16), r15 add 4(r16), r15 add 6(r16), r15 /* epilogue: frame size = 8 */ add #8, r1 pop r4 ret .Lfe1: .size sum,.Lfe1-sum ;; End of function As you can see, argp does not get eliminated. During reload phase, all pseudo-registers have reg_equiv_mem[i] and reg_equiv_address[i] set to NULL, that prevents elimination from being executed. Looks that some transformation before elimination has already substituted "argp+offset" values into INSNs, preventing them from being processed by elimination procedure. Here is a short example from the test.c.172r.ira dump file (that should correspond to pre-reload pass): (insn 12 11 13 2 2.c:3 (set (reg:HI 15 r15 [orig:24 D.1206 ] [24]) (plus:HI (reg:HI 15 r15 [orig:25 D.1205 ] [25]) (mem/c/i:HI (reg/f:HI 16 argp) [0 e+0 S2 A16]))) 73 {*addhi3_3} (nil)) Presently I am trying to compare RTL dumps from different passes with ones produced by i386-gcc. It seems that in x86 the argp register gets eliminated before the reload phase. However, on my msp430 port this does not happen due to some reason. Do you have any ideas, what other code can be responsible for eliminating argp? -- Best regards, Ivan Shcherbakov mailto:shcherba...@eit.uni-kl.de TU Kaiserslautern, Germany Department of Real-Time Systems