[fortran, patch] Fix PR24978, ICEs in DATA statements

Daniel Franke franke.daniel@gmail.com
Fri Apr 30 21:08:00 GMT 2010


Hi all.

Attached patch fixes all the ICEs reported in PR24978 by removing the repeat-
count from the constructure structure and unrolling the repeats instead. This 
simplifies the required checks significantly. However, I wouldn't be overly 
surprised if this would cause some trouble with real-life code ...

There are too many errors in the testcase to match them all (especially 
repeated errors for multiple re-initializations in the same statement), thus I 
added a catch-all "dg-excess-errors" at the bottom.

There's still some room for improvement, e.g. one could short-cut 
gfc_assign_data_value_range() if gfc_assign_data_value() returns FAILURE. Not 
sure if this is necessary, though. Comments welcome :)

Bootstrapped and regression tested on i686-pc-linux-gnu.
Ok for trunk?

	Daniel


gcc/fortran:
2010-04-30  Daniel Franke  <franke.daniel@gmail.com>

	PR fortran/24978
	* gfortran.h: Removed repeat count from constructor,
	removed all usages.
	* data.c (gfc_assign_data_value): Add location to constructor element.
	(gfc_assign_data_value_range): Call gfc_assign_data_value()
	for each element in range.

gcc/testsuite:
2010-04-30  Daniel Franke  <franke.daniel@gmail.com>

	PR fortran/24978
	* gfortran.dg/data_invalid.f90: New.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: data_invalid.f90
Type: text/x-fortran
Size: 4440 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100430/4be07795/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr24978.diff
Type: text/x-patch
Size: 10367 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100430/4be07795/attachment-0001.bin>


More information about the Gcc-patches mailing list