re PR fortran/66347 (Seg fault (ICE) on compile)

2015-06-05  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/66347
	* resolve.c (apply_default_init_local): Do not dereference a NULL
	pointer.

2015-06-05  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/66347
	* gfortran.dg/blockdata_9.f: New test.

From-SVN: r224175
This commit is contained in:
Steven G. Kargl 2015-06-05 23:01:22 +00:00
parent e475345168
commit d012125dd7
4 changed files with 25 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2015-06-05 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/66347
* resolve.c (apply_default_init_local): Do not dereference a NULL
pointer.
2015-06-05 Thomas Koenig <tkoenig@gcc.gnu.org> 2015-06-05 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/66385 PR fortran/66385

View File

@ -10949,7 +10949,7 @@ apply_default_init_local (gfc_symbol *sym)
result variable, which are also nonstatic. */ result variable, which are also nonstatic. */
if (sym->attr.save || sym->ns->save_all if (sym->attr.save || sym->ns->save_all
|| (flag_max_stack_var_size == 0 && !sym->attr.result || (flag_max_stack_var_size == 0 && !sym->attr.result
&& !sym->ns->proc_name->attr.recursive && (sym->ns->proc_name && !sym->ns->proc_name->attr.recursive)
&& (!sym->attr.dimension || !is_non_constant_shape_array (sym)))) && (!sym->attr.dimension || !is_non_constant_shape_array (sym))))
{ {
/* Don't clobber an existing initializer! */ /* Don't clobber an existing initializer! */

View File

@ -1,3 +1,8 @@
2015-06-05 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/66347
* gfortran.dg/blockdata_9.f: New test.
2015-06-05 Thomas Koenig <tkoenig@gcc.gnu.org> 2015-06-05 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/66385 PR fortran/66385

View File

@ -0,0 +1,13 @@
! { dg-do compile }
! { dg-options "-fno-automatic -finit-local-zero" }
! PR fortran/66347
block data
implicit none
integer i, n
parameter (n=1)
character*2 s1(n)
character*8 s2(n)
common /foo/ s1, s2
data (s1(i),s2(i),i=1,n)/"ab","12345678"/
end