[patch, fortran] Updated fix PR 92961, ICE on division by zero error in array bounds

Thomas Koenig tkoenig@netcologne.de
Sun Dec 22 17:10:00 GMT 2019


Hello world,

here is an update for the fix for PR 92961, which also takes care
of the second test case in the PR (included in the first one).

The patch itself should be clear enough - make sure that there
is a MATCH_ERROR on matching an array spec which contains 0/(0).
Rather than pass around information several calls deep, I chose
to use a global variable.

Regression-tested. OK for trunk?

(Only a few bugs to fix to be at least below 900 bugs at the end
of the year, by the way - we are at 389 submitted bugs vs. 461 closed,
which is not bad).

Regards

	Thomas

2019-12-22  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/92961
	* gfortran.h (gfc_seen_div0): Add declaration.
	* arith.h (gfc_seen_div0): Add definition.
	(eval_intrinsic): For integer division by zero, set gfc_seen_div0.
	* decl.c (variable_decl):  If resolution resp. simplification
	fails for array spec and a division of zero error has been
	seen, return MATCH_ERROR.

2019-12-22  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/92961
	* gfortran.dg/arith_divide_2.f90: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p6.diff
Type: text/x-patch
Size: 2887 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20191222/3790d772/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arith_divide_2.f90
Type: text/x-fortran
Size: 399 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20191222/3790d772/attachment-0001.bin>


More information about the Gcc-patches mailing list