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] <var_decl 0x401d489c D25481>) [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 [ <result> ]) (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