------- Comment #1 from ramana at gcc dot gnu dot org 2009-11-13 17:32 -------
(In reply to comment #0) > In gcc4.2.1 targeting ARM processors, pure leaf functions were able to make > use > of r14 / lr (the link register). However, in gcc4.3.2 and gcc4.4.1 (and > presumably since then, since I can't find it mentioned in any gcc bug > reports), > this now uses the stack instead rather than this spare register (boo, hiss). Can you post specifically what output you got with 4.2.1, what you get with 4.3 and what you get with 4.4 ? Presumably you are targetting Thumb1 but you need to make that explicit. > > Here's some C test code: when compiled with the -O3 option, this uses lr on > gcc4.2.1 but [sp] on gcc4.3.2 and gcc4.4.1. > > int foo(int r0) { > int r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14; > > r1 = 0; > > for(r2=0;r2<r0;r2++) > for(r3=0;r3<r0;r3++) > for(r4=0;r4<r0;r4++) > for(r5=0;r5<r0;r5++) > for(r6=0;r6<r0;r6++) > for(r7=0;r7<r0;r7++) > for(r8=0;r8<r0;r8++) > for(r9=0;r9<r0;r9++) > for(r10=0;r10<r0;r10++) > for(r11=0;r11<r0;r11++) > for(r12=0;r12<r0;r12++) > for(r13=0;r13<r0;r13++) > for(r14=0;r14<r0;r14++) > r1++; > > return r1; > } > > PS: my guess is that this might have got broken when Thumb2 and ARMv7 support > was added in (round about gcc4.3)... > -- ramana at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |WAITING http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42017