[Bug target/42017] gcc compiling C for ARM has stopped using r14 in leaf functions?

2019-05-17 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42017

Wilco  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||wilco at gcc dot gnu.org
 Resolution|--- |WORKSFORME

--- Comment #6 from Wilco  ---
This has been fixed since at least GCC5.4: https://www.godbolt.org/z/6IAGfh

[Bug target/42017] gcc compiling C for ARM has stopped using r14 in leaf functions?

2009-11-16 Thread ramana at gcc dot gnu dot org


--- Comment #5 from ramana at gcc dot gnu dot org  2009-11-16 09:58 ---
Confirmed. LR could have been used instead of using the stack here. 


-- 

ramana at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|WAITING |NEW
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2009-11-16 09:58:48
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42017



[Bug target/42017] gcc compiling C for ARM has stopped using r14 in leaf functions?

2009-11-14 Thread nickpelling at nanodome dot com


--- Comment #4 from nickpelling at nanodome dot com  2009-11-14 16:50 
---
Actually, I am targeting ARM (not Thumb1).

I don't currently have easy access to 4.2.1 and 4.3.2, but I am assured that
the former does indeed use r14 and the latter does indeed not use r14.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42017



[Bug target/42017] gcc compiling C for ARM has stopped using r14 in leaf functions?

2009-11-14 Thread nickpelling at nanodome dot com


--- Comment #3 from nickpelling at nanodome dot com  2009-11-14 16:48 
---
Created an attachment (id=19018)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19018&action=view)
This is the assembler file generated by gcc 4.4.1 for the C test file

Note the presence of "[sp, #0]" in the listing at the points where it really
ought to be using the lr register (AKA r14).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42017



[Bug target/42017] gcc compiling C for ARM has stopped using r14 in leaf functions?

2009-11-14 Thread nickpelling at nanodome dot com


--- Comment #2 from nickpelling at nanodome dot com  2009-11-14 16:45 
---
Created an attachment (id=19017)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19017&action=view)
Test C file for which gcc -O3 should (but currently doesn't) use r14


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42017



[Bug target/42017] gcc compiling C for ARM has stopped using r14 in leaf functions?

2009-11-13 Thread ramana at gcc dot gnu dot org


--- 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 for(r3=0;r3 for(r4=0;r4 for(r5=0;r5 for(r6=0;r6 for(r7=0;r7 for(r8=0;r8 for(r9=0;r9 for(r10=0;r10 for(r11=0;r11 for(r12=0;r12 for(r13=0;r13 for(r14=0;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



[Bug target/42017] gcc compiling C for ARM has stopped using r14 in leaf functions?

2009-11-13 Thread nickpelling at nanodome dot com


-- 

nickpelling at nanodome dot com changed:

   What|Removed |Added

   Severity|normal  |minor
 GCC target triplet||ARM


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42017



[Bug target/42017] gcc compiling C for ARM has stopped using r14 in leaf functions?

2009-11-12 Thread nickpelling at nanodome dot com


-- 

nickpelling at nanodome dot com changed:

   What|Removed |Added

   Severity|minor   |normal


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42017