diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2018-08-31 06:51:31 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2018-08-31 06:51:31 +0000 |
commit | 4e227341f6e6c3ceef721d3839c8d9eb6292db70 (patch) | |
tree | 0527c447bb8c74cd2c74bd4f96e460ce137bded9 /gcc/fortran/trans-array.c | |
parent | ee3ec8ac28ce03874214bde9148bc6e5c6705915 (diff) | |
download | gcc-4e227341f6e6c3ceef721d3839c8d9eb6292db70.zip gcc-4e227341f6e6c3ceef721d3839c8d9eb6292db70.tar.gz gcc-4e227341f6e6c3ceef721d3839c8d9eb6292db70.tar.bz2 |
re PR fortran/86328 (Runtime segfault reading an allocatable class(*) object in allocate statements)
2018-08-31 Paul Thomas <pault@gcc.gnu.org>
PR fortran/86328
PR fortran/86760
* trans-array.c (gfc_conv_scalarized_array_ref): Do not fix
info->descriptor but pass it directly to gfc_build_array_ref.
(gfc_conv_array_ref): Likewise for se->expr.
* trans.c (gfc_build_array_ref): If 'decl' is a COMPONENT_REF
obtain the span field directly from it.
2018-08-31 Paul Thomas <pault@gcc.gnu.org>
PR fortran/86328
PR fortran/86760
* gfortran.dg/pr86328.f90 : New test.
in comment 12 of the PR.
* gfortran.dg/pr86760.f90 : New test.
From-SVN: r264008
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r-- | gcc/fortran/trans-array.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 8133794..adb2c05 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -3414,11 +3414,7 @@ gfc_conv_scalarized_array_ref (gfc_se * se, gfc_array_ref * ar) if (is_pointer_array (info->descriptor)) { if (TREE_CODE (info->descriptor) == COMPONENT_REF) - { - decl = gfc_evaluate_now (info->descriptor, &se->pre); - GFC_DECL_PTR_ARRAY_P (decl) = 1; - TREE_USED (decl) = 1; - } + decl = info->descriptor; else if (TREE_CODE (info->descriptor) == INDIRECT_REF) decl = TREE_OPERAND (info->descriptor, 0); @@ -3659,11 +3655,7 @@ gfc_conv_array_ref (gfc_se * se, gfc_array_ref * ar, gfc_expr *expr, && is_pointer_array (se->expr)) { if (TREE_CODE (se->expr) == COMPONENT_REF) - { - decl = gfc_evaluate_now (se->expr, &se->pre); - GFC_DECL_PTR_ARRAY_P (decl) = 1; - TREE_USED (decl) = 1; - } + decl = se->expr; else if (TREE_CODE (se->expr) == INDIRECT_REF) decl = TREE_OPERAND (se->expr, 0); else |