]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/42294 (ICE in code_motion_path_driver for 416.gamess)
authorAlexander Monakov <amonakov@ispras.ru>
Thu, 14 Jan 2010 10:46:57 +0000 (13:46 +0300)
committerAlexander Monakov <amonakov@gcc.gnu.org>
Thu, 14 Jan 2010 10:46:57 +0000 (13:46 +0300)
2010-01-14  Alexander Monakov  <amonakov@ispras.ru>

PR rtl-optimization/42294
* sel-sched-ir.h (struct _sel_insn_data): Update comment.
* sel-sched.c (move_exprs_to_boundary): Transitively add all
originators' originators.

* gfortran.dg/pr42294.f: New.

From-SVN: r155893

gcc/ChangeLog
gcc/sel-sched-ir.h
gcc/sel-sched.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr42294.f [new file with mode: 0644]

index 768e12598cc5fe8f55e305e0f55bbd0a1c63217f..c8bd4c97f7eff0265c2b30e3ef12fa6ebcf72c0e 100644 (file)
@@ -1,3 +1,10 @@
+2010-01-14  Alexander Monakov  <amonakov@ispras.ru>
+
+       PR rtl-optimization/42294
+       * sel-sched-ir.h (struct _sel_insn_data): Update comment.
+       * sel-sched.c (move_exprs_to_boundary): Transitively add all
+       originators' originators.
+
 2010-01-14  Alexander Monakov  <amonakov@ispras.ru>
 
        PR rtl-optimization/39453
index db2989b61117fd95ac064957a19f7d2c54295b23..50eb903dac101bc7d2db5f311784890e70f4b19f 100644 (file)
@@ -715,7 +715,8 @@ struct _sel_insn_data
   bitmap found_deps;
 
   /* An INSN_UID bit is set when this is a bookkeeping insn generated from
-     a parent with this uid.  */
+     a parent with this uid.  If a parent is a bookkeeping copy, all its
+     originators are transitively included in this set.  */
   bitmap originators;
 
   /* A hashtable caching the result of insn transformations through this one.  */
index 4ca8ab22f8586885c39155d1f0e0dfdc33f9db6a..1ec2eeb292d5ef90e360d56ec7a759c8eaca7b03 100644 (file)
@@ -5208,12 +5208,21 @@ move_exprs_to_boundary (bnd_t bnd, expr_t expr_vliw,
 
   EXECUTE_IF_SET_IN_BITMAP (current_copies, 0, book_uid, bi)
     {
+      unsigned uid;
+      bitmap_iterator bi;
+
       /* We allocate these bitmaps lazily.  */
       if (! INSN_ORIGINATORS_BY_UID (book_uid))
         INSN_ORIGINATORS_BY_UID (book_uid) = BITMAP_ALLOC (NULL);
 
       bitmap_copy (INSN_ORIGINATORS_BY_UID (book_uid),
                    current_originators);
+
+      /* Transitively add all originators' originators.  */
+      EXECUTE_IF_SET_IN_BITMAP (current_originators, 0, uid, bi)
+       if (INSN_ORIGINATORS_BY_UID (uid))
+        bitmap_ior_into (INSN_ORIGINATORS_BY_UID (book_uid),
+                         INSN_ORIGINATORS_BY_UID (uid));
     }
 
   return should_move;
index af31ac36ba27c19337725b8126065ef93c3aaab8..6389af52eaf3263107d62e8bfe2199486deb9528 100644 (file)
@@ -1,3 +1,8 @@
+2010-01-14  Alexander Monakov <amonakov@ispras.ru>
+
+       PR rtl-optimization/42294
+       * gfortran.dg/pr42294.f: New.
+
 2010-01-14  Alexander Monakov <amonakov@ispras.ru>
 
        PR rtl-optimization/39453
diff --git a/gcc/testsuite/gfortran.dg/pr42294.f b/gcc/testsuite/gfortran.dg/pr42294.f
new file mode 100644 (file)
index 0000000..9464379
--- /dev/null
@@ -0,0 +1,41 @@
+C PR rtl-optimization/42294
+C { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } }
+C { dg-options "-O2 -fselective-scheduling2 -fsel-sched-pipelining -funroll-all-loops" }
+
+      SUBROUTINE ORIEN(IW,NATOT,NTOTORB,NATORB,P,T)
+      IMPLICIT DOUBLE PRECISION(A-H,O-Z)
+      DIMENSION NATORB(NATOT),P(NTOTORB*(NTOTORB+1)/2)
+      DIMENSION T(NTOTORB,NTOTORB)
+      DO 9000 IATOM=1,NATOT
+         ILAST = NTOTORB
+         IF (IATOM.NE.NATOT) ILAST=NATORB(IATOM+1)-1
+         DO 8000 IAOI=NATORB(IATOM),ILAST
+            DO 7000 IAOJ = IAOI+1,ILAST
+               R2 = 0.0D+00
+               R3 = 0.0D+00
+               DO 6000 INOTA=1,NATOT
+                  DO 5000 IK=NATORB(INOTA),NTOTORB
+                     IMAI=MAX(IK,IAOI)
+                     IMII=MIN(IK,IAOI)
+                     IMAJ=MAX(IK,IAOJ)
+                     IMIJ=MIN(IK,IAOJ)
+                     IKI=(IMAI*(IMAI-1))/2 + IMII
+                     IKJ=(IMAJ*(IMAJ-1))/2 + IMIJ
+                     PIKI=P(IKI)
+                     PIKJ=P(IKJ)
+                     R2 = R2 + (PIKI**4)-6*(PIKI*PIKI*PIKJ*PIKJ)+(PIKJ)
+ 5000             CONTINUE
+ 6000          CONTINUE
+               R2 = (R2/4.0D+00)
+               Q = SQRT(R2*R2 + R3*R3)
+               IF (Q.LT.1.0D-08) GO TO 7000
+               A = COS(THETA)
+               B = -SIN(THETA)
+               CALL ROT1INT(NTOTORB,IAOI,IAOJ,A,B,P)
+ 7000       CONTINUE
+ 8000    CONTINUE
+ 9000 CONTINUE
+      RETURN
+      END
+
+