diff options
author | Andre Vehreschild <vehre@gcc.gnu.org> | 2017-02-19 19:43:49 +0100 |
---|---|---|
committer | Andre Vehreschild <vehre@gcc.gnu.org> | 2017-02-19 19:43:49 +0100 |
commit | 4ca4d1e95e39d256095f8274d8dd0d04aed603da (patch) | |
tree | bb58e020c2ac474097b535a37750596b6616dbf1 /gcc/fortran/trans-expr.c | |
parent | dea71ad06f751484f3eb5c52bf12622e4c06b33a (diff) | |
download | gcc-4ca4d1e95e39d256095f8274d8dd0d04aed603da.zip gcc-4ca4d1e95e39d256095f8274d8dd0d04aed603da.tar.gz gcc-4ca4d1e95e39d256095f8274d8dd0d04aed603da.tar.bz2 |
re PR fortran/79229 (ICE in gfc_trans_assignment_1 with -fcheck=mem)
gcc/testsuite/ChangeLog:
2017-02-19 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/79229
* gfortran.dg/class_allocate_24.f90: New test.
gcc/fortran/ChangeLog:
2017-02-19 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/79229
* trans-expr.c (gfc_trans_assignment_1): Deref indirect refs when
compiling with -fcheck=mem to check the pointer and not the data.
From-SVN: r245581
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r-- | gcc/fortran/trans-expr.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index cc41fe3..9c4715b 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -9961,13 +9961,16 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag, tree cond; const char* msg; + tmp = INDIRECT_REF_P (lse.expr) + ? gfc_build_addr_expr (NULL_TREE, lse.expr) : lse.expr; + /* We should only get array references here. */ - gcc_assert (TREE_CODE (lse.expr) == POINTER_PLUS_EXPR - || TREE_CODE (lse.expr) == ARRAY_REF); + gcc_assert (TREE_CODE (tmp) == POINTER_PLUS_EXPR + || TREE_CODE (tmp) == ARRAY_REF); /* 'tmp' is either the pointer to the array(POINTER_PLUS_EXPR) or the array itself(ARRAY_REF). */ - tmp = TREE_OPERAND (lse.expr, 0); + tmp = TREE_OPERAND (tmp, 0); /* Provide the address of the array. */ if (TREE_CODE (lse.expr) == ARRAY_REF) |