public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/45026]  New: Empty function compiles to many loads and stores
@ 2010-07-21 21:06 steven at gcc dot gnu dot org
  2010-07-26 20:08 ` [Bug target/45026] " sje at cup dot hp dot com
  0 siblings, 1 reply; 4+ messages in thread
From: steven at gcc dot gnu dot org @ 2010-07-21 21:06 UTC (permalink / raw)
  To: gcc-bugs

Consider this test case:
typedef struct teststruct
{
  double d;
  char f1;
  int arr[15];
} teststruct;

void
copystruct5 (teststruct param)
{
  return;
}

The mighty copystruct5 function does absolutely nothing, so I expect this to be
compiled to absolutely nothing. But not so with r162374 at -O2:

        .file   "t.c"
        .pred.safe_across_calls p1-p5,p16-p63
        .text
        .align 16
        .align 64
        .global copystruct5#
        .type   copystruct5#, @function
        .proc copystruct5#
copystruct5:
        .prologue
        .spill 48
        .mmi
        .fframe 48
        adds r12 = -48, r12
[.L2:]  
        .body
        ;;
        mov r14 = r12
        adds r15 = 16, r12
        ;;
        .mmi
        st8 [r14] = r32, 8
        st8 [r15] = r34
        nop 0
        ;;
        .mmi
        st8 [r14] = r33
        nop 0
        adds r14 = 24, r12
        ;;
        .mmi
        st8 [r14] = r35
        nop 0
        adds r14 = 32, r12
        ;;
        .mmi
        st8 [r14] = r36
        nop 0
        adds r14 = 40, r12
        ;;
        .mmi
        st8 [r14] = r37
        nop 0
        adds r14 = 48, r12
        ;;
        .mmi
        st8 [r14] = r38
        nop 0
        adds r14 = 56, r12
        ;;
        .mib
        st8 [r14] = r39
        .restore sp
        adds r12 = 48, r12
        br.ret.sptk.many b0
        .endp copystruct5#
        .ident  "GCC: (GNU) 4.6.0 20100721 (experimental) [trunk revision
162374]"

What's that?!


-- 
           Summary: Empty function compiles to many loads and stores
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: steven at gcc dot gnu dot org
GCC target triplet: ia64-unknown-linux-gnu


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


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

end of thread, other threads:[~2021-08-14 21:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-45026-4@http.gcc.gnu.org/bugzilla/>
2011-02-25 23:17 ` [Bug target/45026] Empty function compiles to many loads and stores steven at gcc dot gnu.org
2021-08-14 21:30 ` [Bug rtl-optimization/45026] struct passed as argument in memory compiles to dead stores pinskia at gcc dot gnu.org
2021-08-14 21:31 ` pinskia at gcc dot gnu.org
2010-07-21 21:06 [Bug target/45026] New: Empty function compiles to many loads and stores steven at gcc dot gnu dot org
2010-07-26 20:08 ` [Bug target/45026] " sje at cup dot hp 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).