Looks good to me.

Thanks for the patch!

Tobias

On 8/27/20 8:17 AM, Paul Richard Thomas via Fortran wrote:
Hi All,

Here is another of Steve Kargl's patches.

Before the patch is applied, the following code is generated:
     atmp.0.span = 4;
     atmp.0.data = 0B;
     atmp.0.offset = 0;
     (*(integer(kind=4)[0] * restrict) atmp.0.data)[0] = 1;
     (*(integer(kind=4)[0] * restrict) atmp.0.data)[1] = 2;

which causes a segfault at run time. The test case counts the number of
occurrences of 'data' to check that the bad assignments have gone.

Regtests OK on FC31/x86_64 - OK for aster?

This patch fixes PR96624.

2020-08-27  Paul Thomas  <pa...@gcc.gnu.org>

gcc/fortran
PR fortran/96624
* simplify.c (gfc_simplify_reshape): Detect zero shape and
clear index if found.

gcc/testsuite/
PR fortran/96624
* gfortran.dg/reshape_8.f90 : New test.
-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander 
Walter

Reply via email to