re PR fortran/70937 (ICE: tree code ‘ssa_name’ is not supported in LTO streams)
authorRichard Biener <rguenther@suse.de>
Mon, 9 May 2016 07:42:45 +0000 (07:42 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 9 May 2016 07:42:45 +0000 (07:42 +0000)
2016-05-09  Richard Biener  <rguenther@suse.de>

PR fortran/70937
* trans-decl.c: Include gimplify.h for unshare_expr.
(gfc_trans_vla_one_sizepos): Unshare exprs before inserting
them into the IL.

* gfortran.dg/pr70937.f90: New testcase.

From-SVN: r236021

gcc/fortran/ChangeLog
gcc/fortran/trans-decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr70937.f90 [new file with mode: 0644]

index bad524c82ea879385ae08a4a6893f9d5cf8aaa6c..f683869f8c39f5e902249ad6feb708d56c103a25 100644 (file)
@@ -1,3 +1,10 @@
+2016-05-09  Richard Biener  <rguenther@suse.de>
+
+       PR fortran/70937
+       * trans-decl.c: Include gimplify.h for unshare_expr.
+       (gfc_trans_vla_one_sizepos): Unshare exprs before inserting
+       them into the IL.
+
 2016-05-07  Fritz Reese  <fritzoreese@gmail.com>
 
        PR fortran/56226
index d4ea6c8ee681816af8a99b34e61ec2b98d7e9b8d..2f5e4342afaf6ff5d40e1841ad380e2138b91538 100644 (file)
@@ -45,6 +45,7 @@ along with GCC; see the file COPYING3.  If not see
 /* Only for gfc_trans_code.  Shouldn't need to include this.  */
 #include "trans-stmt.h"
 #include "gomp-constants.h"
+#include "gimplify.h"
 
 #define MAX_LABEL_VALUE 99999
 
@@ -3754,7 +3755,7 @@ gfc_trans_vla_one_sizepos (tree *tp, stmtblock_t *body)
 
   var = gfc_create_var_np (TREE_TYPE (t), NULL);
   gfc_add_decl_to_function (var);
-  gfc_add_modify (body, var, val);
+  gfc_add_modify (body, var, unshare_expr (val));
   if (TREE_CODE (t) == SAVE_EXPR)
     TREE_OPERAND (t, 0) = var;
   *tp = var;
index 99d6e4413c0b89ffc498028d2656190d9458eb36..02bdf337c92a5cff8804c1e7fb4e62e2579d3f9d 100644 (file)
@@ -1,3 +1,8 @@
+2016-05-09  Richard Biener  <rguenther@suse.de>
+
+       PR fortran/70937
+       * gfortran.dg/pr70937.f90: New testcase.
+
 2016-05-08  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * gcc.dg/ipa/pure-const-3.c: Scan local-pure-const1 dump.
diff --git a/gcc/testsuite/gfortran.dg/pr70937.f90 b/gcc/testsuite/gfortran.dg/pr70937.f90
new file mode 100644 (file)
index 0000000..3fb17bd
--- /dev/null
@@ -0,0 +1,10 @@
+! { dg-do compile }
+! { dg-options "-flto" }
+  SUBROUTINE dbcsr_test_read_args(narg, args)
+    CHARACTER(len=*), DIMENSION(:), &
+      INTENT(out)         :: args
+    CHARACTER(len=80)     :: line
+    DO
+       args(narg) = line
+    ENDDO
+  END SUBROUTINE dbcsr_test_read_args