This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/22141] [4.0/4.1/4.2/4.3 Regression] Missing optimization when storing structures
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Jan 2008 12:08:23 -0000
- Subject: [Bug middle-end/22141] [4.0/4.1/4.2/4.3 Regression] Missing optimization when storing structures
- References: <bug-22141-9973@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #11 from rguenth at gcc dot gnu dot org 2008-01-18 12:08 -------
For 3.3-hammer I get (x86_64):
;; Function f
(note 2 0 3 NOTE_INSN_DELETED)
(note 3 2 4 NOTE_INSN_FUNCTION_BEG)
(note 4 3 5 NOTE_INSN_DELETED)
(note 5 4 6 NOTE_INSN_DELETED)
(note 6 5 8 NOTE_INSN_DELETED)
(insn 8 6 9 (nil) (set (reg/v:SI 58 [ <anonymous> ])
(const_int 0 [0x0])) -1 (nil)
(nil))
(insn 9 8 10 (nil) (set (strict_low_part (subreg:QI (reg/v:SI 58 [ <anonymous>
]) 0))
(const_int 1 [0x1])) -1 (nil)
(nil))
(insn 10 9 11 (nil) (set (reg:DI 59)
(const_int 2 [0x2])) -1 (nil)
(expr_list:REG_EQUAL (const_int 2 [0x2])
(nil)))
(insn 11 10 13 (nil) (set (zero_extract:DI (subreg:DI (reg/v:SI 58 [
<anonymous> ]) 0)
(const_int 8 [0x8])
(const_int 8 [0x8]))
(reg:DI 59)) -1 (nil)
(nil))
(insn 13 11 14 (nil) (parallel [
(set (reg/v:SI 58 [ <anonymous> ])
(and:SI (reg/v:SI 58 [ <anonymous> ])
(const_int -16711681 [0xffffffffff00ffff])))
(clobber (reg:CC 17 flags))
]) -1 (nil)
(nil))
(insn 14 13 16 (nil) (parallel [
(set (reg/v:SI 58 [ <anonymous> ])
(ior:SI (reg/v:SI 58 [ <anonymous> ])
(const_int 196608 [0x30000])))
(clobber (reg:CC 17 flags))
]) -1 (nil)
(nil))
(insn 16 14 17 (nil) (parallel [
(set (reg/v:SI 58 [ <anonymous> ])
(and:SI (reg/v:SI 58 [ <anonymous> ])
(const_int 16777215 [0xffffff])))
(clobber (reg:CC 17 flags))
]) -1 (nil)
(nil))
(insn 17 16 18 (nil) (parallel [
(set (reg/v:SI 58 [ <anonymous> ])
(ior:SI (reg/v:SI 58 [ <anonymous> ])
(const_int 67108864 [0x4000000])))
(clobber (reg:CC 17 flags))
]) -1 (nil)
(nil))
(insn 18 17 19 (nil) (set (mem/s:SI (symbol_ref:DI ("u")) [2 u+0 S4 A8])
(reg/v:SI 58 [ <anonymous> ])) -1 (nil)
(nil))
(note 19 18 21 NOTE_INSN_FUNCTION_END)
(code_label 21 19 0 1 "" [0 uses])
while on the trunk I see:
;; Function f (f)
;;
;; Full RTL generated for this function:
;;
(note 1 0 3 NOTE_INSN_DELETED)
;; Start of basic block ( 0) -> 2
;; Pred edge ENTRY [100.0%] (fallthru)
(note 3 1 2 2 [bb 2] NOTE_INSN_BASIC_BLOCK)
(note 2 3 4 2 NOTE_INSN_FUNCTION_BEG)
;; End of basic block 2 -> ( 3)
;; Succ edge 3 [100.0%] (fallthru)
;; Start of basic block ( 2) -> 3
;; Pred edge 2 [100.0%] (fallthru)
(note 4 2 5 3 [bb 3] NOTE_INSN_BASIC_BLOCK)
(insn 5 4 6 3 t.c:12 (set (reg/f:DI 58)
(symbol_ref:DI ("u") <var_decl 0x2b813a2b8460 u>)) -1 (nil))
(insn 6 5 7 3 t.c:12 (set (mem/s/c:QI (reg/f:DI 58) [0 u.a+0 S1 A8])
(const_int 1 [0x1])) -1 (nil))
(insn 7 6 8 3 t.c:12 (set (reg/f:DI 59)
(const:DI (plus:DI (symbol_ref:DI ("u") <var_decl 0x2b813a2b8460 u>)
(const_int 1 [0x1])))) -1 (nil))
(insn 8 7 9 3 t.c:12 (set (mem/s/c:QI (reg/f:DI 59) [0 u.b+0 S1 A8])
(const_int 2 [0x2])) -1 (nil))
(insn 9 8 10 3 t.c:12 (set (reg/f:DI 60)
(const:DI (plus:DI (symbol_ref:DI ("u") <var_decl 0x2b813a2b8460 u>)
(const_int 2 [0x2])))) -1 (nil))
(insn 10 9 11 3 t.c:12 (set (mem/s/c:QI (reg/f:DI 60) [0 u.c+0 S1 A8])
(const_int 3 [0x3])) -1 (nil))
(insn 11 10 12 3 t.c:12 (set (reg/f:DI 61)
(const:DI (plus:DI (symbol_ref:DI ("u") <var_decl 0x2b813a2b8460 u>)
(const_int 3 [0x3])))) -1 (nil))
(insn 12 11 17 3 t.c:12 (set (mem/s/c:QI (reg/f:DI 61) [0 u.d+0 S1 A8])
(const_int 4 [0x4])) -1 (nil))
;; End of basic block 3 -> ( 4)
;; Succ edge 4 [100.0%] (fallthru)
;; Start of basic block ( 3) -> 4
;; Pred edge 3 [100.0%] (fallthru)
(note 17 12 14 4 [bb 4] NOTE_INSN_BASIC_BLOCK)
(jump_insn 14 17 15 4 t.c:13 (set (pc)
(label_ref 16)) -1 (nil))
;; End of basic block 4 -> ( 6)
;; Succ edge 6 [100.0%]
(barrier 15 14 13)
;; Start of basic block () -> 5
(code_label 13 15 18 5 1 "" [0 uses])
(note 18 13 16 5 [bb 5] NOTE_INSN_BASIC_BLOCK)
;; End of basic block 5 -> ( 6)
;; Succ edge 6 [100.0%] (fallthru)
;; Start of basic block ( 4 5) -> 6
;; Pred edge 4 [100.0%]
;; Pred edge 5 [100.0%] (fallthru)
(code_label 16 18 19 6 2 "" [1 uses])
(note 19 16 0 6 [bb 6] NOTE_INSN_BASIC_BLOCK)
;; End of basic block 6 -> ( 1)
;; Succ edge EXIT [100.0%] (fallthru)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22141