This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, Fortran] PR 78392: ICE in gfc_trans_auto_array_allocation, at fortran/trans-array.c:5979
- From: Janus Weil <janus at gcc dot gnu dot org>
- To: Dominique d'Humières <dominiq at lps dot ens dot fr>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 18 Nov 2016 22:06:09 +0100
- Subject: Re: [Patch, Fortran] PR 78392: ICE in gfc_trans_auto_array_allocation, at fortran/trans-array.c:5979
- Authentication-results: sourceware.org; auth=none
- References: <2709BC01-540E-4BB6-8266-355357EA7138@lps.ens.fr>
Hi Dominique,
>> the attached patch fixes an ice-on-valid problem, simply by removing an assert. ...
>
> I have several instances in my test suite showing that the proposed patch removes the ICE but generates wrong code:
>
> pr42359, second test, => ICE on another place
> pr54613, sixth and eighth tests,
thanks for the comments, those cases are closely related.
I previously assumed that the test case for this PR would be legal,
but by now I think that's wrong. The test case should be rejected, and
we already have checking mechanisms for this (see
resolve_fl_variable), but apparently they are not working.
My current suspicion is that 'gfc_is_constant_expr' has a bug, because
it claims the call to the function 'get_i' to be a constant
expression. This is not true, because get_i() can not be reduced to a
compile-time constant.
In any case the patch I proposed is wrong and the assert should stay.
Cheers,
Janus