This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16590] [3.4 regression] Incorrect execution when compiling with -O2
- From: "mmitchel at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Aug 2004 23:02:54 -0000
- Subject: [Bug c++/16590] [3.4 regression] Incorrect execution when compiling with -O2
- References: <20040716145633.16590.m.galante@centrosistemi.it>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From mmitchel at gcc dot gnu dot org 2004-08-17 23:02 -------
This is a GCSE bug.
In the 07.addressof dump, we have:
(insn 56 104 57 1 (parallel [
(set (reg/f:SI 77)
(plus:SI (reg/f:SI 20 frame)
(const_int -11 [0xfffffff5])))
(clobber (reg:CC 17 flags))
]) 138 {*addsi_1} (nil)
(nil))
(insn 57 56 58 1 (set (mem/s:SI (plus:SI (reg/f:SI 20 frame)
(const_int -24 [0xffffffe8])) [4 p.p+0 S4 A32])
(reg/f:SI 77)) 36 {*movsi_1} (nil)
(nil))
(code_label 58 57 105 2 3 "" [1 uses])
(note 105 58 62 2 [bb 2] NOTE_INSN_BASIC_BLOCK)
(insn 62 105 63 2 (set (reg:SI 78 [ p.p ])
(mem/s:SI (plus:SI (reg/f:SI 20 frame)
(const_int -24 [0xffffffe8])) [4 p.p+0 S4 A32])) 36 {*movsi_1} (nil)
(nil))
(insn 63 62 64 2 (parallel [
(set (reg:SI 79)
(plus:SI (reg:SI 78 [ p.p ])
(const_int -1 [0xffffffff])))
(clobber (reg:CC 17 flags))
]) 138 {*addsi_1} (nil)
(nil))
After GCSE, we have:
(insn 56 104 114 1 (parallel [
(set (reg/f:SI 77)
(plus:SI (reg/f:SI 20 frame)
(const_int -11 [0xfffffff5])))
(clobber (reg:CC 17 flags))
]) 138 {*addsi_1} (nil)
(nil))
(insn 114 56 58 1 (set (reg/f:SI 86 [ start ])
(reg/f:SI 77)) -1 (nil)
(nil))
(code_label 58 114 105 2 3 "" [1 uses])
(note 105 58 112 2 [bb 2] NOTE_INSN_BASIC_BLOCK)
(insn 112 105 63 2 (set (reg/f:SI 78 [ p.p ])
(reg/f:SI 86 [ start ])) -1 (nil)
(expr_list:REG_EQUAL (mem/s:SI (plus:SI (reg/f:SI 20 frame)
(const_int -24 [0xffffffe8])) [4 p.p+0 S4 A32])
(nil)))
Note that we now have a REG_EQUAL note on insn 112 that is a lie, since insn 114
no longer sets the memory.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16590