From 7a27d38f4e63f2bbfebe046be2d7097d11b24e50 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Mon, 9 May 2016 07:42:45 +0000 Subject: [PATCH] =?utf8?q?re=20PR=20fortran/70937=20(ICE:=20tree=20code=20?= =?utf8?q?=E2=80=98ssa=5Fname=E2=80=99=20is=20not=20supported=20in=20LTO?= =?utf8?q?=20streams)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 2016-05-09 Richard Biener 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 | 7 +++++++ gcc/fortran/trans-decl.c | 3 ++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/pr70937.f90 | 10 ++++++++++ 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gfortran.dg/pr70937.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index bad524c82ea..f683869f8c3 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2016-05-09 Richard Biener + + 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 PR fortran/56226 diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index d4ea6c8ee68..2f5e4342afa 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 99d6e4413c0..02bdf337c92 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-05-09 Richard Biener + + PR fortran/70937 + * gfortran.dg/pr70937.f90: New testcase. + 2016-05-08 Rainer Orth * 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 index 00000000000..3fb17bd227e --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr70937.f90 @@ -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 -- 2.30.2