From: Alexander Monakov Date: Thu, 14 Jan 2010 10:46:57 +0000 (+0300) Subject: re PR rtl-optimization/42294 (ICE in code_motion_path_driver for 416.gamess) X-Git-Tag: releases/gcc-4.5.0~1233 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=14f30b877fe018475154a6e4d8979bc57528232d;p=thirdparty%2Fgcc.git re PR rtl-optimization/42294 (ICE in code_motion_path_driver for 416.gamess) 2010-01-14 Alexander Monakov 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 768e12598cc5..c8bd4c97f7ef 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2010-01-14 Alexander Monakov + + 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 PR rtl-optimization/39453 diff --git a/gcc/sel-sched-ir.h b/gcc/sel-sched-ir.h index db2989b61117..50eb903dac10 100644 --- a/gcc/sel-sched-ir.h +++ b/gcc/sel-sched-ir.h @@ -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. */ diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c index 4ca8ab22f858..1ec2eeb292d5 100644 --- a/gcc/sel-sched.c +++ b/gcc/sel-sched.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index af31ac36ba27..6389af52eaf3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-01-14 Alexander Monakov + + PR rtl-optimization/42294 + * gfortran.dg/pr42294.f: New. + 2010-01-14 Alexander Monakov PR rtl-optimization/39453 diff --git a/gcc/testsuite/gfortran.dg/pr42294.f b/gcc/testsuite/gfortran.dg/pr42294.f new file mode 100644 index 000000000000..9464379083d7 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr42294.f @@ -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 + +