[PATCH] Fortran : ICE for division by zero in declaration PR95882

Mark Eggleston mark.eggleston@codethink.co.uk
Tue Aug 25 06:33:00 GMT 2020


Second attempt, this time with the correct attachment.

OK to commit and backport?

[PATCH] Fortran  : ICE for division by zero in declaration PR95882

A length expression containing a divide by zero in a character
declaration will result in an ICE if the constant is anymore
complicated that a contant divided by a constant.

The cause was that char_len_param_value can return MATCH_YES
even if a divide by zero was seen.  Prior to returning check
whether a divide by zero was seen and if so set it to MATCH_ERROR.

2020-08-24  Mark Eggleston <markeggleston@gcc.gnu.org>

gcc/fortran

     PR fortran/95882
     * decl.c (char_len_param_value): Check gfc_seen_div0 and
     it is set return MATCH_ERROR.

2020-08-24  Mark Eggleston <markeggleston@gcc.gnu.org>

gcc/testsuite/

     PR fortran/95882
     * gfortran.dg/pr95882_1.f90: New test.
     * gfortran.dg/pr95882_2.f90: New test.
     * gfortran.dg/pr95882_3.f90: New test.
     * gfortran.dg/pr95882_4.f90: New test.
     * gfortran.dg/pr95882_5.f90: New test.

-- 
https://www.codethink.co.uk/privacy.html

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fortran-ICE-for-division-by-zero-in-declaration-pr95.patch
Type: text/x-patch
Size: 3775 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200825/738127f6/attachment-0001.bin>


More information about the Gcc-patches mailing list