diff options
author | Joost VandeVondele <vondele@gcc.gnu.org> | 2014-09-19 10:28:00 +0000 |
---|---|---|
committer | Joost VandeVondele <vondele@gcc.gnu.org> | 2014-09-19 10:28:00 +0000 |
commit | 727dc1217d05e7879a782b534deb0ec65bce5c91 (patch) | |
tree | 4b275cc930633ec63242b9b56e57e42d37e573a1 /gcc/fortran/trans-array.c | |
parent | c9aa0007f8147be06783e9f7365d2b5241dee7cb (diff) | |
download | gcc-727dc1217d05e7879a782b534deb0ec65bce5c91.zip gcc-727dc1217d05e7879a782b534deb0ec65bce5c91.tar.gz gcc-727dc1217d05e7879a782b534deb0ec65bce5c91.tar.bz2 |
re PR fortran/63152 (needless initialization of local pointer arrays.)
2014-09-19 Joost VandeVondele <vondele@gcc.gnu.org>
PR fortran/63152
* trans-array.c (gfc_trans_deferred_array): Only nullify allocatables.
2014-09-19 Joost VandeVondele <vondele@gcc.gnu.org>
PR fortran/63152
* gfortran.dg/auto_char_dummy_array_1.f90: Fix undefined behavior.
* gfortran.dg/pr63152.f90: New test.
From-SVN: r215387
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r-- | gcc/fortran/trans-array.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 123df5d..3ac6523 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -8647,8 +8647,8 @@ gfc_trans_deferred_array (gfc_symbol * sym, gfc_wrapped_block * block) type = TREE_TYPE (descriptor); } - /* NULLIFY the data pointer. */ - if (GFC_DESCRIPTOR_TYPE_P (type) && !sym->attr.save) + /* NULLIFY the data pointer, for non-saved allocatables. */ + if (GFC_DESCRIPTOR_TYPE_P (type) && !sym->attr.save && sym->attr.allocatable) gfc_conv_descriptor_data_set (&init, descriptor, null_pointer_node); gfc_restore_backend_locus (&loc); |