public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/57830] New: fold_builtin_memory_op expands memcpy without regard to -Os
@ 2013-07-05 12:33 amylaar at gcc dot gnu.org
  2013-07-05 15:58 ` [Bug target/57830] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: amylaar at gcc dot gnu.org @ 2013-07-05 12:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 57830
           Summary: fold_builtin_memory_op expands memcpy without regard
                    to -Os
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: amylaar at gcc dot gnu.org

I see that the memcpy call at the end of gcc.dg/strlenopt-10.c:fn2.c
is expanded for the avr target (which has "#define BIGGEST_ALIGNMENT 8",
 i.e. the "dest_align < TYPE_ALIGN (desttype)" test at builtins.c:8923
 succeeds) irrespective of -Os or the size of the copied object.
So this generates 20 loads, 20 stores, ancillary address arithmetic,
and sky-high register pressure with 18 call-saved registers saved in
the prologue and restored in the epilogue.
Just leaving the call to memcpy alone would generate shorter code.


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

end of thread, other threads:[~2013-07-05 17:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-05 12:33 [Bug tree-optimization/57830] New: fold_builtin_memory_op expands memcpy without regard to -Os amylaar at gcc dot gnu.org
2013-07-05 15:58 ` [Bug target/57830] " pinskia at gcc dot gnu.org
2013-07-05 16:27 ` amylaar at gcc dot gnu.org
2013-07-05 17:47 ` jakub at gcc dot gnu.org

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).