Commit 727dc121 by Joost VandeVondele

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
parent c9aa0007
2014-09-19 Joost VandeVondele <vondele@gcc.gnu.org>
PR fortran/63152
* trans-array.c (gfc_trans_deferred_array): Only nullify allocatables.
2014-09-15 Jakub Jelinek <jakub@redhat.com> 2014-09-15 Jakub Jelinek <jakub@redhat.com>
* Make-lang.in (check_gfortran_parallelize): Change to just an upper * Make-lang.in (check_gfortran_parallelize): Change to just an upper
......
...@@ -8647,8 +8647,8 @@ gfc_trans_deferred_array (gfc_symbol * sym, gfc_wrapped_block * block) ...@@ -8647,8 +8647,8 @@ gfc_trans_deferred_array (gfc_symbol * sym, gfc_wrapped_block * block)
type = TREE_TYPE (descriptor); type = TREE_TYPE (descriptor);
} }
/* NULLIFY the data pointer. */ /* NULLIFY the data pointer, for non-saved allocatables. */
if (GFC_DESCRIPTOR_TYPE_P (type) && !sym->attr.save) if (GFC_DESCRIPTOR_TYPE_P (type) && !sym->attr.save && sym->attr.allocatable)
gfc_conv_descriptor_data_set (&init, descriptor, null_pointer_node); gfc_conv_descriptor_data_set (&init, descriptor, null_pointer_node);
gfc_restore_backend_locus (&loc); gfc_restore_backend_locus (&loc);
......
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.
2014-09-19 Paolo Carlini <paolo.carlini@oracle.com> 2014-09-19 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58328 PR c++/58328
......
...@@ -11,6 +11,8 @@ end module global ...@@ -11,6 +11,8 @@ end module global
program oh_no_not_pr15908_again program oh_no_not_pr15908_again
character(12), dimension(:), pointer :: ptr character(12), dimension(:), pointer :: ptr
nullify(ptr)
call a (ptr, 12) call a (ptr, 12)
if (.not.associated (ptr) ) call abort () if (.not.associated (ptr) ) call abort ()
if (any (ptr.ne."abc")) call abort () if (any (ptr.ne."abc")) call abort ()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment