public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/14240] New: crossjumping deletes jump table
@ 2004-02-22  6:11 dje at gcc dot gnu dot org
  2004-02-23 20:40 ` [Bug optimization/14240] " dje at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: dje at gcc dot gnu dot org @ 2004-02-22  6:11 UTC (permalink / raw)
  To: gcc-bugs

While trying to add POWER5 scheduling support to GCC, I am encountering 
what appears to be a bug with crossjumping.  If I disable crossjumping, the 
problem does not occur.  The bug occurs when compiling
insn-attrtab.c:insn_latency().  The resulting assembly code fragment with
the failure looks like the following:

LC..218:
        .tc L..8258[TC],L..8258
LC..219:
        .tc L..8266[TC],L..8266
L..8258:
L..8259:
        addi 0,10,-272
        cmplwi 7,0,4
        bgt- 7,L..8215
        lwz 11,LC..219(2)       # label L..8266
L..8301:
        slwi 0,0,2
        lwzx 9,11,0
        add 9,9,11
        mtctr 9
        bctr
        .align 2
        .align 2
L..8266:
        .long L..8265-L..8266
        .long L..8265-L..8266
        .long L..8265-L..8266
        .long L..8265-L..8266
        .long L..8265-L..8266
L..8251:
        addi 0,10,-272
        cmplwi 7,0,4
        bgt- 7,L..8215
        lwz 11,LC..218(2)       # label L..8258
        b L..8301

The code is performing a tablejump.  The failure path starts at the bottom, 
loading the address of label L..8258 into %r11, then branching to L..8301, 
introduced by crossjumping, which performs the remainder of the tablejump 
code.  The problem is that %r11 should be loaded with a label corresponding to 
the base of a jump table, like L..8266 in the straightline codepath from the 
top.  When the code loads the value from the jump table that should be a 
difference of two labels, it instead loads the hex value of a PowerPC 
instruction at L..8258, which is a large number, adds that to the base address, 
and jumps to an illegal address.

        It looks like a jump table that should be located at L..8258 was
deleted.

-- 
           Summary: crossjumping deletes jump table
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dje at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: powrepc-ibm-aix5.2.0.0
  GCC host triplet: powerpc-ibm-aix5.2.0.0
GCC target triplet: powerpc-ibm-aix5.2.0.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14240


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

* [Bug optimization/14240] crossjumping deletes jump table
  2004-02-22  6:11 [Bug optimization/14240] New: crossjumping deletes jump table dje at gcc dot gnu dot org
@ 2004-02-23 20:40 ` dje at gcc dot gnu dot org
  2004-02-23 23:28 ` dje at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dje at gcc dot gnu dot org @ 2004-02-23 20:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dje at gcc dot gnu dot org  2004-02-23 20:40 -------
Created an attachment (id=5785)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5785&action=view)
fragment of insn-attrtab.c that is miscompiled


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14240


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

* [Bug optimization/14240] crossjumping deletes jump table
  2004-02-22  6:11 [Bug optimization/14240] New: crossjumping deletes jump table dje at gcc dot gnu dot org
  2004-02-23 20:40 ` [Bug optimization/14240] " dje at gcc dot gnu dot org
  2004-02-23 23:28 ` dje at gcc dot gnu dot org
@ 2004-02-23 23:28 ` dje at gcc dot gnu dot org
  2004-02-23 23:45 ` dje at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dje at gcc dot gnu dot org @ 2004-02-23 23:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dje at gcc dot gnu dot org  2004-02-23 23:28 -------
Created an attachment (id=5788)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5788&action=view)
fragment of ce3 output


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14240


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

* [Bug optimization/14240] crossjumping deletes jump table
  2004-02-22  6:11 [Bug optimization/14240] New: crossjumping deletes jump table dje at gcc dot gnu dot org
  2004-02-23 20:40 ` [Bug optimization/14240] " dje at gcc dot gnu dot org
@ 2004-02-23 23:28 ` dje at gcc dot gnu dot org
  2004-02-23 23:28 ` dje at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dje at gcc dot gnu dot org @ 2004-02-23 23:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dje at gcc dot gnu dot org  2004-02-23 23:28 -------
Created an attachment (id=5787)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5787&action=view)
fragment of flow2 output


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14240


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

* [Bug optimization/14240] crossjumping deletes jump table
  2004-02-22  6:11 [Bug optimization/14240] New: crossjumping deletes jump table dje at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-02-23 23:28 ` dje at gcc dot gnu dot org
@ 2004-02-23 23:45 ` dje at gcc dot gnu dot org
  2004-02-24  1:24 ` giovannibajo at libero dot it
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dje at gcc dot gnu dot org @ 2004-02-23 23:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dje at gcc dot gnu dot org  2004-02-23 23:45 -------
ce3 phase splits the tablejump BB and updates all references to the label_ref of
the jumptable, but on AIX and PPC64 Linux, the label_ref only is referenced in a
REG_EQUIV.  The updating code does not fix the reference to the label_ref in the
constant pool.  Either the constant pool value needs to be updated or the
instruction needs to reference the pool entry for the other jumptable.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-02-23 23:45:39
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14240


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

* [Bug optimization/14240] crossjumping deletes jump table
  2004-02-22  6:11 [Bug optimization/14240] New: crossjumping deletes jump table dje at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2004-02-24  1:24 ` giovannibajo at libero dot it
@ 2004-02-24  1:24 ` giovannibajo at libero dot it
  2004-02-24  1:30 ` dje at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: giovannibajo at libero dot it @ 2004-02-24  1:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-02-24 01:24 -------
Reopening.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14240


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

* [Bug optimization/14240] crossjumping deletes jump table
  2004-02-22  6:11 [Bug optimization/14240] New: crossjumping deletes jump table dje at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2004-02-23 23:45 ` dje at gcc dot gnu dot org
@ 2004-02-24  1:24 ` giovannibajo at libero dot it
  2004-02-24  1:24 ` giovannibajo at libero dot it
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: giovannibajo at libero dot it @ 2004-02-24  1:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-02-24 01:23 -------
This bug was confirmed too early. We don't have a reduced testcase, nor it was 
checked for regression status. Closing it to reopen and mark it as unconfirmed 
again.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14240


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

* [Bug optimization/14240] crossjumping deletes jump table
  2004-02-22  6:11 [Bug optimization/14240] New: crossjumping deletes jump table dje at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2004-02-24  1:24 ` giovannibajo at libero dot it
@ 2004-02-24  1:30 ` dje at gcc dot gnu dot org
  2004-02-24  5:04 ` [Bug optimization/14240] [3.4/3.5 Regression] crossjumping does not update labels in constant pool pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dje at gcc dot gnu dot org @ 2004-02-24  1:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dje at gcc dot gnu dot org  2004-02-24 01:30 -------
this bug is confirmed

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2004-02-23 23:45:39         |2004-02-24 01:30:05
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14240


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

* [Bug optimization/14240] [3.4/3.5 Regression] crossjumping does not update labels in constant pool
  2004-02-22  6:11 [Bug optimization/14240] New: crossjumping deletes jump table dje at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2004-02-24  1:30 ` dje at gcc dot gnu dot org
@ 2004-02-24  5:04 ` pinskia at gcc dot gnu dot org
  2004-02-24 21:14 ` zlomek at gcc dot gnu dot org
  2004-02-24 21:50 ` zlomek at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-24  5:04 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-24 05:03 -------
Jan, this is most likely caused by one of your patches for jumptables.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |hubicka at gcc dot gnu dot
                   |dot org                     |org
             Status|REOPENED                    |ASSIGNED
           Keywords|                            |build
   Target Milestone|---                         |3.4.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14240


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

* [Bug optimization/14240] [3.4/3.5 Regression] crossjumping does not update labels in constant pool
  2004-02-22  6:11 [Bug optimization/14240] New: crossjumping deletes jump table dje at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2004-02-24  5:04 ` [Bug optimization/14240] [3.4/3.5 Regression] crossjumping does not update labels in constant pool pinskia at gcc dot gnu dot org
@ 2004-02-24 21:14 ` zlomek at gcc dot gnu dot org
  2004-02-24 21:50 ` zlomek at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: zlomek at gcc dot gnu dot org @ 2004-02-24 21:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From zlomek at gcc dot gnu dot org  2004-02-24 21:14 -------
Proposed patch:
http://gcc.gnu.org/ml/gcc-patches/2004-02/msg02265.html

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14240


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

* [Bug optimization/14240] [3.4/3.5 Regression] crossjumping does not update labels in constant pool
  2004-02-22  6:11 [Bug optimization/14240] New: crossjumping deletes jump table dje at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2004-02-24 21:14 ` zlomek at gcc dot gnu dot org
@ 2004-02-24 21:50 ` zlomek at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: zlomek at gcc dot gnu dot org @ 2004-02-24 21:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From zlomek at gcc dot gnu dot org  2004-02-24 21:50 -------
The patch was commited.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14240


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

end of thread, other threads:[~2004-02-24 21:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-22  6:11 [Bug optimization/14240] New: crossjumping deletes jump table dje at gcc dot gnu dot org
2004-02-23 20:40 ` [Bug optimization/14240] " dje at gcc dot gnu dot org
2004-02-23 23:28 ` dje at gcc dot gnu dot org
2004-02-23 23:28 ` dje at gcc dot gnu dot org
2004-02-23 23:45 ` dje at gcc dot gnu dot org
2004-02-24  1:24 ` giovannibajo at libero dot it
2004-02-24  1:24 ` giovannibajo at libero dot it
2004-02-24  1:30 ` dje at gcc dot gnu dot org
2004-02-24  5:04 ` [Bug optimization/14240] [3.4/3.5 Regression] crossjumping does not update labels in constant pool pinskia at gcc dot gnu dot org
2004-02-24 21:14 ` zlomek at gcc dot gnu dot org
2004-02-24 21:50 ` zlomek 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).