From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5063 invoked by alias); 21 Jul 2010 21:06:25 -0000 Received: (qmail 4975 invoked by uid 48); 21 Jul 2010 21:05:58 -0000 Date: Wed, 21 Jul 2010 21:06:00 -0000 Subject: [Bug target/45026] New: Empty function compiles to many loads and stores X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "steven at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-07/txt/msg02266.txt.bz2 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