From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11482 invoked by alias); 3 Nov 2004 22:24:14 -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 11466 invoked by uid 48); 3 Nov 2004 22:24:13 -0000 Date: Wed, 03 Nov 2004 22:24:00 -0000 From: "steven at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org Message-ID: <20041103222411.18293.steven@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug middle-end/18293] New: Redundant copy operation introduced by expand X-Bugzilla-Reason: CC X-SW-Source: 2004-11/txt/msg00395.txt.bz2 List-Id: Given this piece of code, struct deferred_access; extern struct deferred_access *D25481; struct deferred_access * foo (void) { return (struct deferred_access *) ((long unsigned int) D25481 * 16); } which generates on i686 in .00.expand (-fdump-rtl-expand-details): ;; return (struct deferred_access *) ((long unsigned int) (int) D25481 * 16) (insn 10 9 11 (set (reg:SI 60) (mem/f/i:SI (symbol_ref:SI ("D25481") [flags 0x40] ) [2 D25481+0 S4 A32])) -1 (nil) (nil)) (insn 11 10 12 (set (reg:SI 61) (reg:SI 60)) -1 (nil) (nil)) (insn 12 11 13 (parallel [ (set (reg:SI 62) (ashift:SI (reg:SI 61) (const_int 4 [0x4]))) (clobber (reg:CC 17 flags)) ]) -1 (nil) (expr_list:REG_EQUAL (mult:SI (reg:SI 60) (const_int 16 [0x10])) (nil))) (insn 13 12 14 (set (reg:SI 58 [ ]) (reg:SI 62)) -1 (nil) (nil)) Notice the unnecessary copy insn 11: (insn 11 10 12 (set (reg:SI 61) (reg:SI 60)) -1 (nil) (nil)) Is there some way, oh RTL gurus tell me!, to avoid introducing this garbage RTL that only introduces work for the RTL optimizers? -- Summary: Redundant copy operation introduced by expand Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: steven at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org,sayle at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18293