Fix PR43354: Correctly handle default definitions.
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 13 Mar 2010 17:35:45 +0000 (17:35 +0000)
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 13 Mar 2010 17:35:45 +0000 (17:35 +0000)
2010-03-13  Sebastian Pop  <sebastian.pop@amd.com>

PR middle-end/43354
* graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Do not
call insert_out_of_ssa_copy for default definitions.
* gfortran.dg/graphite/id-pr43354.f: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157440 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog.graphite
gcc/graphite-sese-to-poly.c
gcc/testsuite/gfortran.dg/graphite/id-pr43354.f [new file with mode: 0644]

index 331c080..1659de6 100644 (file)
@@ -1,4 +1,11 @@
-2010-03-11  Sebastian Pop  <sebastian.pop@amd.com>
+2010-03-13  Sebastian Pop  <sebastian.pop@amd.com>
+
+       PR middle-end/43354
+       * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Do not
+       call insert_out_of_ssa_copy for default definitions.
+       * gfortran.dg/graphite/id-pr43354.f: New.
+
+2010-03-13  Sebastian Pop  <sebastian.pop@amd.com>
 
        PR middle-end/43349
        * gfortran.dg/graphite/pr43349.f: New.
index 0f370a8..b0bc348 100644 (file)
@@ -2200,7 +2200,8 @@ rewrite_close_phi_out_of_ssa (gimple_stmt_iterator *psi)
   gimple stmt = gimple_build_assign (res, zero_dim_array);
   tree arg = gimple_phi_arg_def (phi, 0);
 
-  if (TREE_CODE (arg) == SSA_NAME)
+  if (TREE_CODE (arg) == SSA_NAME
+      && !SSA_NAME_IS_DEFAULT_DEF (arg))
     insert_out_of_ssa_copy (zero_dim_array, arg);
   else
     insert_out_of_ssa_copy_on_edge (single_pred_edge (gimple_bb (phi)),
diff --git a/gcc/testsuite/gfortran.dg/graphite/id-pr43354.f b/gcc/testsuite/gfortran.dg/graphite/id-pr43354.f
new file mode 100644 (file)
index 0000000..e614f91
--- /dev/null
@@ -0,0 +1,18 @@
+      SUBROUTINE POFUN2(DIM,GRDENT,FPART,FPARTL)
+      DOUBLE PRECISION GRDENT(*)
+      DOUBLE COMPLEX FPART(*)
+      DOUBLE COMPLEX FPARTL(*)
+      INTEGER REFLCT,XRIREF
+      IF (DIM.GT.1) THEN
+         ABCS3=XRCELL(1)
+         IF (ABCS2.EQ.ABCS3) THEN
+         END IF
+      ELSE
+         DO REFLCT=1,XRIREF,1
+            FPARTL(REFLCT)=FPART(REFLCT)
+         END DO
+      END IF
+         IF (ABCS2.EQ.ABCS3) THEN
+            GRDENT(1)=GRDENT(3)
+         END IF
+      END