public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/54993] New: [4.8 regression] PIC register not marked as live
@ 2012-10-19 21:45 schwab@linux-m68k.org
  2012-10-22  9:08 ` [Bug rtl-optimization/54993] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: schwab@linux-m68k.org @ 2012-10-19 21:45 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 54993
           Summary: [4.8 regression] PIC register not marked as live
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: schwab@linux-m68k.org
                CC: steven@gcc.gnu.org
            Target: m68k-*-*


Created attachment 28496
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28496
preprocessed from libstdc++-v3/testsuite/30_threads/future/members/wait.cc

The patch for bug 38711 is causing the PIC register not being marked as live.

Compiled with -O2 -std=gnu++0x.

@@ -1668,17 +1663,16 @@
        .cfi_startproc
        .cfi_personality 0,__gxx_personality_v0
        .cfi_lsda 0,.LLSDA2633
-       link.w %fp,#-72
+       link.w %fp,#-68
        .cfi_offset 14, -8
        .cfi_def_cfa 14, 8
        movem.l #12348,-(%sp)
-       .cfi_offset 2, -104
-       .cfi_offset 3, -100
-       .cfi_offset 10, -96
-       .cfi_offset 11, -92
-       .cfi_offset 12, -88
-       .cfi_offset 13, -84
-       lea (%pc, _GLOBAL_OFFSET_TABLE_@GOTPC), %a5
+       .cfi_offset 2, -100
+       .cfi_offset 3, -96
+       .cfi_offset 10, -92
+       .cfi_offset 11, -88
+       .cfi_offset 12, -84
+       .cfi_offset 13, -80
        clr.l -48(%fp)
        clr.l -44(%fp)
        pea 104.w


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

* [Bug rtl-optimization/54993] [4.8 regression] PIC register not marked as live
  2012-10-19 21:45 [Bug rtl-optimization/54993] New: [4.8 regression] PIC register not marked as live schwab@linux-m68k.org
@ 2012-10-22  9:08 ` rguenth at gcc dot gnu.org
  2012-10-28 12:34 ` steven at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-10-22  9:08 UTC (permalink / raw)
  To: gcc-bugs


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.8.0


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

* [Bug rtl-optimization/54993] [4.8 regression] PIC register not marked as live
  2012-10-19 21:45 [Bug rtl-optimization/54993] New: [4.8 regression] PIC register not marked as live schwab@linux-m68k.org
  2012-10-22  9:08 ` [Bug rtl-optimization/54993] " rguenth at gcc dot gnu.org
@ 2012-10-28 12:34 ` steven at gcc dot gnu.org
  2012-10-28 15:30 ` schwab@linux-m68k.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: steven at gcc dot gnu.org @ 2012-10-28 12:34 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #1 from Steven Bosscher <steven at gcc dot gnu.org> 2012-10-28 12:33:50 UTC ---
I cannot reproduce this problem, neither before nor after r192890. Can you
please attach the .ira dump (with -fdump-rtl-ira-all) after r192890, with and
without the following patch applied?

Index: ira.c
===================================================================
--- ira.c       (revision 192893)
+++ ira.c       (working copy)
@@ -4405,9 +4405,11 @@
      interpretation of the DF_LR problem.  See PR38711.
      Remove the problem, so that we don't spend time updating it in
      any of the df_analyze() calls during IRA/LRA.  */
+#if 0
   if (optimize > 1)
     df_remove_problem (df_live);
   gcc_checking_assert (df_live == NULL);
+#endif

 #ifdef ENABLE_CHECKING
   df->changeable_flags |= DF_VERIFY_SCHEDULED;


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

* [Bug rtl-optimization/54993] [4.8 regression] PIC register not marked as live
  2012-10-19 21:45 [Bug rtl-optimization/54993] New: [4.8 regression] PIC register not marked as live schwab@linux-m68k.org
  2012-10-22  9:08 ` [Bug rtl-optimization/54993] " rguenth at gcc dot gnu.org
  2012-10-28 12:34 ` steven at gcc dot gnu.org
@ 2012-10-28 15:30 ` schwab@linux-m68k.org
  2012-10-28 15:37 ` schwab@linux-m68k.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: schwab@linux-m68k.org @ 2012-10-28 15:30 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Andreas Schwab <schwab@linux-m68k.org> 2012-10-28 15:30:37 UTC ---
What exactly did you test?  The bug is clearly present before r192890.  Here is
the diff between r192889 and r192890:

@@ -1663,16 +1663,17 @@ _Z6test01v:
     .cfi_startproc
     .cfi_personality 0,__gxx_personality_v0
     .cfi_lsda 0,.LLSDA2633
-    link.w %fp,#-68
+    link.w %fp,#-72
     .cfi_offset 14, -8
     .cfi_def_cfa 14, 8
     movem.l #12348,-(%sp)
-    .cfi_offset 2, -100
-    .cfi_offset 3, -96
-    .cfi_offset 10, -92
-    .cfi_offset 11, -88
-    .cfi_offset 12, -84
-    .cfi_offset 13, -80
+    .cfi_offset 2, -104
+    .cfi_offset 3, -100
+    .cfi_offset 10, -96
+    .cfi_offset 11, -92
+    .cfi_offset 12, -88
+    .cfi_offset 13, -84
+    lea (%pc, _GLOBAL_OFFSET_TABLE_@GOTPC), %a5
     clr.l -48(%fp)
     clr.l -44(%fp)
     pea 104.w
@@ -1791,22 +1792,22 @@ _Z6test01v:
     jsr _ZNSt6thread15_M_start_threadESt10shared_ptrINS_10_Impl_baseEE
 .LEHE14:
     addq.l #8,%sp
-    move.l -16(%fp),%a5
-    tst.l %a5
+    move.l -16(%fp),%a1
+    tst.l %a1
     jeq .L329
-    lea (4,%a5),%a0
+    lea (4,%a1),%a0
     move.l #_ZL28__gthrw___pthread_key_createPjPFvPvE,%d2
     jeq .L323
     move.l (%a0),%d0
 .L324:
-    move.l %d0,%a1
+    move.l %d0,%d3
     move.l %d0,%d1
     subq.l #1,%d1
     cas.l %d0,%d1,(%a0)
     seq %d1
     tst.b %d1
     jeq .L324
-    move.l %a1,%d0
+    move.l %d3,%d0
     moveq #1,%d1
     cmp.l %d0,%d1
     jeq .L446
@@ -1925,7 +1926,7 @@ _Z6test01v:
     cmp.l %a0,%d1
     jeq .L450
 .L309:
-    movem.l -92(%fp),#15372
+    movem.l -96(%fp),#15372
     unlk %fp
     rts
 .L351:
@@ -2005,30 +2006,32 @@ _Z6test01v:
     sub.l %a0,%a0
     jra .L321
 .L446:
-    move.l (%a5),%a0
-    move.l %a5,-(%sp)
+    move.l (%a1),%a0
+    move.l %a1,-(%sp)
     move.l 8(%a0),%a0
+    move.l %a1,-72(%fp)
     jsr (%a0)
-    lea (8,%a5),%a0
+    move.l -72(%fp),%a1
+    lea (8,%a1),%a0
     addq.l #4,%sp
     tst.l %d2
     jeq .L326
     move.l (%a0),%d0
 .L327:
-    move.l %d0,%a1
+    move.l %d0,%d2
     move.l %d0,%d1
     subq.l #1,%d1
     cas.l %d0,%d1,(%a0)
     seq %d1
     tst.b %d1
     jeq .L327
-    move.l %a1,%d0
+    move.l %d2,%d0
     moveq #1,%d1
     cmp.l %d0,%d1
     jne .L329
 .L452:
-    move.l (%a5),%a0
-    move.l %a5,-(%sp)
+    move.l (%a1),%a0
+    move.l %a1,-(%sp)
     move.l 12(%a0),%a0
     jsr (%a0)
     addq.l #4,%sp
@@ -2056,7 +2059,7 @@ _Z6test01v:
     move.l 12(%a0),%a0
     jsr (%a0)
     addq.l #4,%sp
-    movem.l -92(%fp),#15372
+    movem.l -96(%fp),#15372
     unlk %fp
     rts
 .L449:
@@ -2147,19 +2150,19 @@ _Z6test01v:
     addq.l #1,4(%a2)
     jra .L312
 .L323:
-    move.l 4(%a5),%d0
+    move.l 4(%a1),%d0
     move.l %d0,%d1
     subq.l #1,%d1
-    move.l %d1,4(%a5)
+    move.l %d1,4(%a1)
     moveq #1,%d1
     cmp.l %d0,%d1
     jne .L329
     jra .L446
 .L326:
-    move.l 8(%a5),%d0
+    move.l 8(%a1),%d0
     move.l %d0,%d1
     subq.l #1,%d1
-    move.l %d1,8(%a5)
+    move.l %d1,8(%a1)
     moveq #1,%d1
     cmp.l %d0,%d1
     jne .L329


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

* [Bug rtl-optimization/54993] [4.8 regression] PIC register not marked as live
  2012-10-19 21:45 [Bug rtl-optimization/54993] New: [4.8 regression] PIC register not marked as live schwab@linux-m68k.org
                   ` (2 preceding siblings ...)
  2012-10-28 15:30 ` schwab@linux-m68k.org
@ 2012-10-28 15:37 ` schwab@linux-m68k.org
  2012-10-28 15:38 ` schwab@linux-m68k.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: schwab@linux-m68k.org @ 2012-10-28 15:37 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Andreas Schwab <schwab@linux-m68k.org> 2012-10-28 15:36:55 UTC ---
Created attachment 28546
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28546
wait.ii.203r.ira.r192889


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

* [Bug rtl-optimization/54993] [4.8 regression] PIC register not marked as live
  2012-10-19 21:45 [Bug rtl-optimization/54993] New: [4.8 regression] PIC register not marked as live schwab@linux-m68k.org
                   ` (3 preceding siblings ...)
  2012-10-28 15:37 ` schwab@linux-m68k.org
@ 2012-10-28 15:38 ` schwab@linux-m68k.org
  2012-10-28 17:24 ` steven at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: schwab@linux-m68k.org @ 2012-10-28 15:38 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Andreas Schwab <schwab@linux-m68k.org> 2012-10-28 15:38:09 UTC ---
Created attachment 28547
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28547
wait.ii.203r.ira.r192890


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

* [Bug rtl-optimization/54993] [4.8 regression] PIC register not marked as live
  2012-10-19 21:45 [Bug rtl-optimization/54993] New: [4.8 regression] PIC register not marked as live schwab@linux-m68k.org
                   ` (4 preceding siblings ...)
  2012-10-28 15:38 ` schwab@linux-m68k.org
@ 2012-10-28 17:24 ` steven at gcc dot gnu.org
  2012-10-28 18:35 ` schwab@linux-m68k.org
  2012-11-09 23:41 ` steven at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: steven at gcc dot gnu.org @ 2012-10-28 17:24 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Steven Bosscher <steven at gcc dot gnu.org> 2012-10-28 17:24:17 UTC ---
(In reply to comment #2)
> What exactly did you test?  The bug is clearly present before r192890.

I was testing a cross from powerpc64-unknown-linux-gnu to m68k-linux-gnu,
your wait.ii test case, with "-fPIC -O2 -std=gnu++0x".  Perhaps I somehow
messed up, I'll try again.


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

* [Bug rtl-optimization/54993] [4.8 regression] PIC register not marked as live
  2012-10-19 21:45 [Bug rtl-optimization/54993] New: [4.8 regression] PIC register not marked as live schwab@linux-m68k.org
                   ` (5 preceding siblings ...)
  2012-10-28 17:24 ` steven at gcc dot gnu.org
@ 2012-10-28 18:35 ` schwab@linux-m68k.org
  2012-11-09 23:41 ` steven at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: schwab@linux-m68k.org @ 2012-10-28 18:35 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #6 from Andreas Schwab <schwab@linux-m68k.org> 2012-10-28 18:34:52 UTC ---
I didn't write anything about -fPIC.  The PIC register is used for TLS
accesses.


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

* [Bug rtl-optimization/54993] [4.8 regression] PIC register not marked as live
  2012-10-19 21:45 [Bug rtl-optimization/54993] New: [4.8 regression] PIC register not marked as live schwab@linux-m68k.org
                   ` (6 preceding siblings ...)
  2012-10-28 18:35 ` schwab@linux-m68k.org
@ 2012-11-09 23:41 ` steven at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: steven at gcc dot gnu.org @ 2012-11-09 23:41 UTC (permalink / raw)
  To: gcc-bugs


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

Steven Bosscher <steven at gcc dot gnu.org> changed:

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

--- Comment #7 from Steven Bosscher <steven at gcc dot gnu.org> 2012-11-09 23:40:48 UTC ---
Fixed by revert.


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

end of thread, other threads:[~2012-11-09 23:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-19 21:45 [Bug rtl-optimization/54993] New: [4.8 regression] PIC register not marked as live schwab@linux-m68k.org
2012-10-22  9:08 ` [Bug rtl-optimization/54993] " rguenth at gcc dot gnu.org
2012-10-28 12:34 ` steven at gcc dot gnu.org
2012-10-28 15:30 ` schwab@linux-m68k.org
2012-10-28 15:37 ` schwab@linux-m68k.org
2012-10-28 15:38 ` schwab@linux-m68k.org
2012-10-28 17:24 ` steven at gcc dot gnu.org
2012-10-28 18:35 ` schwab@linux-m68k.org
2012-11-09 23:41 ` steven at gcc dot gnu.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).