re PR tree-optimization/77719 (ICE in pp_string, at pretty-print.c:955)
authorKugan Vivekanandarajah <kuganv@linaro.org>
Mon, 26 Sep 2016 18:16:23 +0000 (18:16 +0000)
committerKugan Vivekanandarajah <kugan@gcc.gnu.org>
Mon, 26 Sep 2016 18:16:23 +0000 (18:16 +0000)
Fix PR77719
gcc/testsuite/ChangeLog:

2016-09-26  Kugan Vivekanandarajah  <kuganv@linaro.org>

PR middle-end/77719
* gfortran.dg/pr77719.f90: New test.

gcc/ChangeLog:

2016-09-26  Kugan Vivekanandarajah  <kuganv@linaro.org>

PR middle-end/77719
* tree-ssa-reassoc.c (make_new_ssa_for_def): Use gimple_get_lhs to get lhs
instead of gimple_assign_lhs as stmt can be builtins too.

From-SVN: r240505

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr77719.f90 [new file with mode: 0644]
gcc/tree-ssa-reassoc.c

index a1c1620833eb4e12c1e0c1d585758b248089a09b..0d529dee90e4d49d933005c5944f4e2be32b9538 100644 (file)
@@ -1,3 +1,9 @@
+2016-09-26  Kugan Vivekanandarajah  <kuganv@linaro.org>
+
+       PR middle-end/77719
+       * tree-ssa-reassoc.c (make_new_ssa_for_def): Use gimple_get_lhs to get lhs
+       instead of gimple_assign_lhs as stmt can be builtins too.
+
 2016-09-26  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
        * tree.h (memmodel_from_int, memmodel_base, is_mm_relaxed,
index e2b54b9030d9c3583447bba3f271f5d534d9776c..b9b0996767554e09954c64ed9afce2998107adb8 100644 (file)
@@ -1,3 +1,8 @@
+2016-09-26  Kugan Vivekanandarajah  <kuganv@linaro.org>
+
+       PR middle-end/77719
+       * gfortran.dg/pr77719.f90: New test.
+
 2016-09-26  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
        * gcc.dg/tree-ssa/builtin-sprintf-warn-1.c: Adjust regex to accept
diff --git a/gcc/testsuite/gfortran.dg/pr77719.f90 b/gcc/testsuite/gfortran.dg/pr77719.f90
new file mode 100644 (file)
index 0000000..974d70a
--- /dev/null
@@ -0,0 +1,26 @@
+! PR middle-end/77719
+! { dg-do compile }
+! { dg-options "-O3 -ffast-math" }
+
+SUBROUTINE urep_egr(erep,derep,surr)
+  INTEGER, PARAMETER :: dp=8
+  REAL(dp), INTENT(inout)                  :: erep, derep(3)
+  REAL(dp), INTENT(in)                     :: surr(2)
+  REAL(dp)                                 :: de_z, rz
+  INTEGER :: isp,spdim,jsp,nsp
+  IF (n_urpoly > 0) THEN
+    IF (r < spxr(1,1)) THEN
+      ispg: DO isp = 1,spdim ! condition ca)
+        IF (isp /= spdim) THEN
+          nsp = 5 ! condition cb
+          DO jsp = 0,nsp
+            IF( jsp <= 3 ) THEN
+            ELSE
+              erep = erep + surr(jsp-3)*rz**(jsp)
+            ENDIF
+          END DO
+        END IF
+      END DO ispg
+    END IF
+  END IF
+END SUBROUTINE urep_egr
index 8fc76e4fb6fe5af19e667931645c7e7db9569f0d..d94ff70ebb05ef866ea39630797ced84592f781d 100644 (file)
@@ -1158,7 +1158,7 @@ make_new_ssa_for_def (gimple *stmt)
   use_operand_p use;
   imm_use_iterator iter;
   tree new_lhs;
-  tree lhs = gimple_assign_lhs (stmt);
+  tree lhs = gimple_get_lhs (stmt);
 
   new_lhs = make_ssa_name (TREE_TYPE (lhs));
   gimple_set_lhs (stmt, new_lhs);