From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31965 invoked by alias); 10 Mar 2005 17:31:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 31911 invoked by uid 48); 10 Mar 2005 17:30:54 -0000 Date: Thu, 10 Mar 2005 17:31:00 -0000 Message-ID: <20050310173054.31910.qmail@sourceware.org> From: "pinskia at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050310154814.20408.chris@bubblescope.net> References: <20050310154814.20408.chris@bubblescope.net> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug middle-end/20408] Unnecessary code generated for empty structs X-Bugzilla-Reason: CC X-SW-Source: 2005-03/txt/msg01310.txt.bz2 List-Id: ------- Additional Comments From pinskia at gcc dot gnu dot org 2005-03-10 17:30 ------- (In reply to comment #10) > I think we should produce an empty CONSTRUCTOR (which I am testing right now). That did not fix it, we still get code generated for the "empty" struct: ;; D.1594 = {} (nil) ;; foo (D.1594) [tail call] (insn 10 8 11 (set (mem:QI (reg/f:SI 56 virtual-outgoing-args) [0 S1 A32]) (reg:QI 58 [ D.1594 ])) -1 (nil) (nil)) (call_insn 11 10 0 (call (mem:QI (symbol_ref:SI ("_Z3foo1X") [flags 0x41] ) [0 S1 A8]) (const_int 4 [0x4])) -1 (nil) (nil) (nil)) But on PPC we get: ;; D.1588 = {} (nil) ;; foo (D.1588) [tail call] (insn 10 8 11 0 (set (reg:QI 3 r3) (reg:QI 118 [ D.1588 ])) -1 (nil) (nil)) (call_insn/j 11 10 12 0 (parallel [ (call (mem:SI (symbol_ref:SI ("_Z3foo1X") [flags 0x41] ) [0 S4 A8]) (const_int 32 [0x20])) (use (const_int 0 [0x0])) (use (reg:SI 119)) (return) ]) -1 (nil) (nil) (expr_list:REG_DEP_TRUE (use (reg:QI 3 r3)) (nil))) See the difference is that we pass on ppc via a register but on x86 we pass via the stack. I don't know a way to fix this with a front-end change. -- What |Removed |Added ---------------------------------------------------------------------------- Component|c++ |middle-end http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20408