[patch, fortran] PR68566 ICE on using unusable array in reshape

Jerry DeLisle jvdelisle@charter.net
Fri Apr 1 21:58:00 GMT 2016


This problem is when array indexes are given that have non-integer expressions
or otherwise bad arrays, not just related to reshape.

There are several test cases presented in the PR.  Most of these are fixed by
adding a check for any non-integer in match_array_element_spec.  The patch-let
in gfc_simplify_reshape avoids passing a NULL shape further into simplification.

I will add an additional test case for the original posted problem in the PR.
Two existing tests get exercised, changing the error message.  Finding the
problems earlier in the matchers I think is the right way to go. I am curious if
the old checks ever get triggered (I will look into that a little later.

Regression tested on x86-64-linux.  OK for trunk?


2016-04-02  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/68566
	* array.c (match_array_element_spec): Add check for non-integer dimension given.
	* simplify.c (gfc_simplify_reshape): If source shape is NULL return.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr68566.diff
Type: text/x-patch
Size: 3195 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20160401/4ce59061/attachment.bin>


More information about the Fortran mailing list