re PR fortran/39893 ([4.4] gfortran ICE on invalid program)

2009-04-26  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/39893
	* gfortran.dg/assumed_charlen_dummy.f90: New Test.


2009-04-26  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/39893
	fortran/data.c (gfc_assign_data_value): If the lvalue is an 
	assumed character length entity in a data statement, then 
	return FAILURE to prevent segmentation fault.

From-SVN: r146816
This commit is contained in:
Steven G. Kargl 2009-04-26 19:27:50 +00:00
parent 17c665a997
commit 5846213b87
4 changed files with 27 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2009-04-26 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/39893
fortran/data.c (gfc_assign_data_value): If the lvalue is an
assumed character length entity in a data statement, then
return FAILURE to prevent segmentation fault.
2009-04-26 Jakub Jelinek <jakub@redhat.com>
* trans-decl.c: Include pointer-set.h.

View File

@ -416,7 +416,11 @@ gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index)
}
if (ref || last_ts->type == BT_CHARACTER)
expr = create_character_intializer (init, last_ts, ref, rvalue);
{
if (lvalue->ts.cl->length == NULL && !(ref && ref->u.ss.length != NULL))
return FAILURE;
expr = create_character_intializer (init, last_ts, ref, rvalue);
}
else
{
/* Overwriting an existing initializer is non-standard but usually only

View File

@ -1,3 +1,8 @@
2009-04-26 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/39893
* gfortran.dg/assumed_charlen_dummy.f90: New Test.
2009-04-26 Jakub Jelinek <jakub@redhat.com>
PR inline-asm/39543

View File

@ -0,0 +1,10 @@
! { dg-do compile }
! Test the fix for PR fortran/39893.
! Original testcase provided by Deji Akingunola.
! Reduced testcase provided by Dominique d'Humieres.
!
SUBROUTINE XAUTOGET()
CHARACTER*(*) DICBA ! { dg-error "Entity with assumed character" }
DATA DICBA /"CLIP" /
RETURN
END