public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/42612]  New: [4.4/4.5] post-increment addressing not used
@ 2010-01-04 16:02 jon at beniston dot com
  2010-01-04 16:11 ` [Bug rtl-optimization/42612] " rguenth at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: jon at beniston dot com @ 2010-01-04 16:02 UTC (permalink / raw)
  To: gcc-bugs

It seems post-increment addressing is not used as often as it could be,
resulting in sub-optimal code. Take this trivial test case:

char * func(char *p)
{
  *p++=0;
  *p++=0;
  *p++=0;
  return p;
}

On ARM, we end up with:

        mov     r2, #0  @ 6
        mov     r3, r0  @ 28
        strb    r2, [r3], #1
        strb    r2, [r0, #1]
        add     r0, r3, #2         
        strb    r2, [r3, #1]
        bx      lr      

The add instruction could be removed if all of the strb instructions used
post-increment addressing.

Problem seems to occur in both 4.4.0 and 4.5.0 latest svn. Also seems to effect
other targets that have post-increment addressing, not just ARM.


-- 
           Summary: [4.4/4.5] post-increment addressing not used
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jon at beniston dot com
GCC target triplet: arm-elf and others


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-07-12  5:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-42612-4@http.gcc.gnu.org/bugzilla/>
2012-08-23 14:16 ` [Bug rtl-optimization/42612] post-increment addressing not used olegendo at gcc dot gnu.org
2015-05-22 13:57 ` olegendo at gcc dot gnu.org
2022-07-12  5:21 ` bd at mail dot ru
2022-07-12  5:39 ` pinskia at gcc dot gnu.org
2010-01-04 16:02 [Bug c/42612] New: [4.4/4.5] " jon at beniston dot com
2010-01-04 16:11 ` [Bug rtl-optimization/42612] " rguenth at gcc dot gnu dot org
2010-01-04 18:53 ` steven at gcc dot gnu dot org
2010-01-05 11:43 ` bonzini at gnu dot org
2010-01-05 12:13 ` jon at beniston dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).