This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/12067] New: combine error
- From: "amodra at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Aug 2003 14:33:18 -0000
- Subject: [Bug optimization/12067] New: combine error
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12067
Summary: combine error
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: amodra at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
A current mainline bootstrap fails with an unrecognizable insn when compiling
libjava/verify.cc if configured with:
CFLAGS="-g -O" CXXFLAGS="-g -O" /src/gcc-current/configure
This results in verify.cc being compiled with -O1 instead of the normal -O2.
What seems to be happening is that the following three insns:
(insn 138 514 139 5 /src/gcc-current/libjava/verify.cc:553 (set (reg:SI 94 [
<variable>.local_changed ])
(mem/s/j:SI (plus:SI (reg/v/f:SI 59 [ copy ])
(const_int 16 [0x10])) [0 <variable>.local_changed+0 S4 A32]))
-1 (nil)
(nil))
(insn 139 138 517 5 /src/gcc-current/libjava/verify.cc:553 (set (reg:CCZ 17 flags)
(compare:CCZ (mem:QI (plus:SI (reg:SI 94 [ <variable>.local_changed ])
(reg/v:SI 84 [ i ])) [0 S1 A8])
(const_int 0 [0x0]))) -1 (insn_list 138 (nil))
(expr_list:REG_UNUSED (reg:CCZ 17 flags)
(nil)))
(insn 517 139 518 5 /src/gcc-current/libjava/verify.cc:553 (set (reg:CC 17 flags)
(compare:CC (mem:QI (plus:SI (reg:SI 94 [ <variable>.local_changed ])
(reg/v:SI 84 [ i ])) [0 S1 A8])
(const_int 1 [0x1]))) -1 (nil)
(expr_list:REG_DEAD (reg:SI 94 [ <variable>.local_changed ])
(nil)))
are combined (well, the first two), to
(gdb) p debug_rtx (newpat)
(parallel [
(set (reg:CCZ 17 flags)
(compare:CCZ (mem:QI (plus:SI (mem/s/j:SI (plus:SI (reg/v/f:SI 59 [
copy ])
(const_int 16 [0x10])) [0
<variable>.local_changed+0 S4 A32])
(reg/v:SI 84 [ i ])) [0 S1 A8])
(const_int 0 [0x0])))
(set (reg:SI 94 [ <variable>.local_changed ])
(mem/s/j:SI (plus:SI (reg/v/f:SI 59 [ copy ])
(const_int 16 [0x10])) [0 <variable>.local_changed+0 S4 A32]))
])
which is invalid, but code at combine.c:2046 figures correctly that the
first set is setting an unused reg so can be eliminated. The second set
is just insn 138 again and is obviously valid. The trouble is that
reg:SI 94 is also substituted in insn 517, at the time the first two
insns are combined, giving us:
(note 138 514 139 5 NOTE_INSN_DELETED)
(insn 139 138 517 5 /src/gcc-current/libjava/verify.cc:553 (set (reg:SI 94 [
<variable>.local_changed ])
(mem/s/j:SI (plus:SI (reg/v/f:SI 59 [ copy ])
(const_int 16 [0x10])) [0 <variable>.local_changed+0 S4 A32]))
38 {*movsi_1} (nil)
(nil))
(insn 517 139 518 5 /src/gcc-current/libjava/verify.cc:553 (set (reg:CC 17 flags)
(compare:CC (mem:QI (plus:SI (mem/s/j:SI (plus:SI (reg/v/f:SI 59 [ copy ])
(const_int 16 [0x10])) [0 <variable>.local_changed+0
S4 A32])
(reg/v:SI 84 [ i ])) [0 S1 A8])
(const_int 1 [0x1]))) -1 (nil)
(expr_list:REG_DEAD (reg:SI 94 [ <variable>.local_changed ])
(nil)))