public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/12067] New: combine error
@ 2003-08-26 14:33 amodra at gcc dot gnu dot org
  2003-08-26 15:23 ` [Bug optimization/12067] combine error due to rtl sharing amodra at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: amodra at gcc dot gnu dot org @ 2003-08-26 14:33 UTC (permalink / raw)
  To: gcc-bugs

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)))


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-11-29  1:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-26 14:33 [Bug optimization/12067] New: combine error amodra at gcc dot gnu dot org
2003-08-26 15:23 ` [Bug optimization/12067] combine error due to rtl sharing amodra at gcc dot gnu dot org
2003-08-27  2:02 ` amodra at gcc dot gnu dot org
2003-08-27  2:32 ` amodra at gcc dot gnu dot org
2003-10-30  7:17 ` pinskia at gcc dot gnu dot org
2003-11-25  3:32 ` amodra at gcc dot gnu dot org
2003-11-29  1:28 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).