public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/37273]  New: [4.4 Regression] IRA does not re-materializes addresses (loads from the TOC)
@ 2008-08-29  5:01 pinskia at gcc dot gnu dot org
  2008-08-29  5:02 ` [Bug rtl-optimization/37273] " pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-08-29  5:01 UTC (permalink / raw)
  To: gcc-bugs

As reported here http://gcc.gnu.org/ml/gcc-patches/2008-08/msg02071.html, we
now produce worse code for PPC64 Linux (and PPC AIX).
We produce now produce worse code for gcc.dg/20020103-1.c on powerpc64
with TOCs (and the stack space goes up, 256 vs 272).
Before IRA we emitted:
        ld 3,.LC0@toc(2)

but after we had spill the address to the stack which is wrose:
--- before.s    2008-08-28 02:14:27.000000000 +0900
+++ after.s     2008-08-28 02:14:13.000000000 +0900
@@ -40,8 +40,9 @@ bar:
        std 27,-40(1)
        std 28,-32(1)
        std 29,-24(1)
-       stdu 1,-256(1)
+       stdu 1,-272(1)
        lwzu 5,4(31)
+       std 9,112(1)
        lwa 4,0(30)
        lwa 3,0(9)
        extsw 5,5
@@ -52,12 +53,13 @@ bar:
        #asm
  # 0 "" 2
 #NO_APP
+       ld 9,112(1)
        mr 4,30
-       ld 3,.LC0@toc(2)
        mr 5,31
+       mr 3,9
        bl f2
        nop
-       addi 1,1,256
+       addi 1,1,272
        ld 0,16(1)
        ld 14,-144(1)
        mtlr 0

Also if we are going to spill it to memory, then why use another
register and not just r3?

Note the comment on the testcase is incorrect:
/* Verify that constant equivalences get reloaded properly, either by being
   spilled to the stack, or regenerated, but not dropped to memory.  */

We do regnerate it so the check should not be done on lP64 Powerpc (or
any PowerOpen [TOC] based ABIs); I should mention that powerpc64 elf
has @got but xcoff does not have a @got which is why GCC uses the old
way of producing the TOC section.

Also note this testcase now passes on 32bit PPC Linux but that is only because
we spill the address instead of recreating it.

I bet this is a generic issue too and causes performance issues and stack usage
on more than just PowerPC 64.


-- 
           Summary: [4.4 Regression] IRA does not re-materializes addresses
                    (loads from the TOC)
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: missed-optimization, ra
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
GCC target triplet: powerpc64-linux-gnu


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


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

* [Bug rtl-optimization/37273] [4.4 Regression] IRA does not re-materializes addresses (loads from the TOC)
  2008-08-29  5:01 [Bug rtl-optimization/37273] New: [4.4 Regression] IRA does not re-materializes addresses (loads from the TOC) pinskia at gcc dot gnu dot org
@ 2008-08-29  5:02 ` pinskia at gcc dot gnu dot org
  2008-08-29  5:28 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-08-29  5:02 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.4.0


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


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

* [Bug rtl-optimization/37273] [4.4 Regression] IRA does not re-materializes addresses (loads from the TOC)
  2008-08-29  5:01 [Bug rtl-optimization/37273] New: [4.4 Regression] IRA does not re-materializes addresses (loads from the TOC) pinskia at gcc dot gnu dot org
  2008-08-29  5:02 ` [Bug rtl-optimization/37273] " pinskia at gcc dot gnu dot org
@ 2008-08-29  5:28 ` pinskia at gcc dot gnu dot org
  2008-09-09 20:30 ` jsm28 at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-08-29  5:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2008-08-29 05:27 -------
This spilling also happens on x86-darwin.  Note x86-darwin uses -fPIC by
default.
For PPC it looks like IRA is not looking into REG_EQUAL:
We have in the dump right before IRA:
(insn:HI 29 26 30 2 gcc/gcc/testsuite/gcc.dg/20020103-1.c:38 (set (reg:DI 3 3)
        (reg/f:DI 119)) 352 {*movdi_internal64} (expr_list:REG_DEAD (reg/f:DI
119)
        (expr_list:REG_EQUAL (symbol_ref:DI ("ext") [flags 0xc0] <var_decl
0xf7cca6c0 ext>)
            (nil))))

So we had spilled reg 119 instead of the re-materialize the address from the
REG_EQUAL.

x86-darwin looks like a different issue though, but it looks like IRA is not
calling targetm.delegitimize_address to get the original address to
re-materialize it after the asm.


-- 


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


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

* [Bug rtl-optimization/37273] [4.4 Regression] IRA does not re-materializes addresses (loads from the TOC)
  2008-08-29  5:01 [Bug rtl-optimization/37273] New: [4.4 Regression] IRA does not re-materializes addresses (loads from the TOC) pinskia at gcc dot gnu dot org
  2008-08-29  5:02 ` [Bug rtl-optimization/37273] " pinskia at gcc dot gnu dot org
  2008-08-29  5:28 ` pinskia at gcc dot gnu dot org
@ 2008-09-09 20:30 ` jsm28 at gcc dot gnu dot org
  2008-12-31 21:31 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-09-09 20:30 UTC (permalink / raw)
  To: gcc-bugs



-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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


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

* [Bug rtl-optimization/37273] [4.4 Regression] IRA does not re-materializes addresses (loads from the TOC)
  2008-08-29  5:01 [Bug rtl-optimization/37273] New: [4.4 Regression] IRA does not re-materializes addresses (loads from the TOC) pinskia at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-09-09 20:30 ` jsm28 at gcc dot gnu dot org
@ 2008-12-31 21:31 ` pinskia at gcc dot gnu dot org
  2009-04-21 16:00 ` [Bug rtl-optimization/37273] [4.4/4.5 " jakub at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-31 21:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2008-12-31 21:30 -------
Note the testcase is from gcc.dg/20020103-1.c.


-- 


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


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

* [Bug rtl-optimization/37273] [4.4/4.5 Regression] IRA does not re-materializes addresses (loads from the TOC)
  2008-08-29  5:01 [Bug rtl-optimization/37273] New: [4.4 Regression] IRA does not re-materializes addresses (loads from the TOC) pinskia at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-12-31 21:31 ` pinskia at gcc dot gnu dot org
@ 2009-04-21 16:00 ` jakub at gcc dot gnu dot org
  2009-07-22 10:35 ` jakub at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-04-21 16:00 UTC (permalink / raw)
  To: gcc-bugs



-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.4.0                       |4.4.1


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


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

* [Bug rtl-optimization/37273] [4.4/4.5 Regression] IRA does not re-materializes addresses (loads from the TOC)
  2008-08-29  5:01 [Bug rtl-optimization/37273] New: [4.4 Regression] IRA does not re-materializes addresses (loads from the TOC) pinskia at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2009-04-21 16:00 ` [Bug rtl-optimization/37273] [4.4/4.5 " jakub at gcc dot gnu dot org
@ 2009-07-22 10:35 ` jakub at gcc dot gnu dot org
  2009-10-15 12:54 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-07-22 10:35 UTC (permalink / raw)
  To: gcc-bugs



-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.4.1                       |4.4.2


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


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

* [Bug rtl-optimization/37273] [4.4/4.5 Regression] IRA does not re-materializes addresses (loads from the TOC)
  2008-08-29  5:01 [Bug rtl-optimization/37273] New: [4.4 Regression] IRA does not re-materializes addresses (loads from the TOC) pinskia at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2009-07-22 10:35 ` jakub at gcc dot gnu dot org
@ 2009-10-15 12:54 ` jakub at gcc dot gnu dot org
  2010-01-21 13:15 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-10-15 12:54 UTC (permalink / raw)
  To: gcc-bugs



-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.4.2                       |4.4.3


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


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

* [Bug rtl-optimization/37273] [4.4/4.5 Regression] IRA does not re-materializes addresses (loads from the TOC)
  2008-08-29  5:01 [Bug rtl-optimization/37273] New: [4.4 Regression] IRA does not re-materializes addresses (loads from the TOC) pinskia at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2009-10-15 12:54 ` jakub at gcc dot gnu dot org
@ 2010-01-21 13:15 ` jakub at gcc dot gnu dot org
  2010-03-02 18:18 ` pinskia at gcc dot gnu dot org
  2010-04-30  9:01 ` [Bug rtl-optimization/37273] [4.4/4.5/4.6 " jakub at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-01-21 13:15 UTC (permalink / raw)
  To: gcc-bugs



-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.4.3                       |4.4.4


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


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

* [Bug rtl-optimization/37273] [4.4/4.5 Regression] IRA does not re-materializes addresses (loads from the TOC)
  2008-08-29  5:01 [Bug rtl-optimization/37273] New: [4.4 Regression] IRA does not re-materializes addresses (loads from the TOC) pinskia at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2010-01-21 13:15 ` jakub at gcc dot gnu dot org
@ 2010-03-02 18:18 ` pinskia at gcc dot gnu dot org
  2010-04-30  9:01 ` [Bug rtl-optimization/37273] [4.4/4.5/4.6 " jakub at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-03-02 18:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2010-03-02 18:18 -------
Still happens on the trunk.


-- 


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


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

* [Bug rtl-optimization/37273] [4.4/4.5/4.6 Regression] IRA does not re-materializes addresses (loads from the TOC)
  2008-08-29  5:01 [Bug rtl-optimization/37273] New: [4.4 Regression] IRA does not re-materializes addresses (loads from the TOC) pinskia at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2010-03-02 18:18 ` pinskia at gcc dot gnu dot org
@ 2010-04-30  9:01 ` jakub at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-04-30  9:01 UTC (permalink / raw)
  To: gcc-bugs



-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.4.4                       |4.4.5


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


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

end of thread, other threads:[~2010-04-30  8:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-29  5:01 [Bug rtl-optimization/37273] New: [4.4 Regression] IRA does not re-materializes addresses (loads from the TOC) pinskia at gcc dot gnu dot org
2008-08-29  5:02 ` [Bug rtl-optimization/37273] " pinskia at gcc dot gnu dot org
2008-08-29  5:28 ` pinskia at gcc dot gnu dot org
2008-09-09 20:30 ` jsm28 at gcc dot gnu dot org
2008-12-31 21:31 ` pinskia at gcc dot gnu dot org
2009-04-21 16:00 ` [Bug rtl-optimization/37273] [4.4/4.5 " jakub at gcc dot gnu dot org
2009-07-22 10:35 ` jakub at gcc dot gnu dot org
2009-10-15 12:54 ` jakub at gcc dot gnu dot org
2010-01-21 13:15 ` jakub at gcc dot gnu dot org
2010-03-02 18:18 ` pinskia at gcc dot gnu dot org
2010-04-30  9:01 ` [Bug rtl-optimization/37273] [4.4/4.5/4.6 " jakub 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).