re PR fortran/37203 (Check ORDER= of RESHAPE)
2009-06-06 Daniel Franke <franke.daniel@gmail.com> PR fortran/37203 * simplify.c (gfc_simplify_reshape): Fixed reshaping of empty * arrays without padding. 2009-06-06 Daniel Franke <franke.daniel@gmail.com> PR fortran/37203 * reshape_zerosize_2.f90: New. From-SVN: r148238
This commit is contained in:
parent
7ba8c18c1e
commit
f7cfd28c03
@ -1,3 +1,9 @@
|
||||
2009-06-06 Daniel Franke <franke.daniel@gmail.com>
|
||||
|
||||
PR fortran/37203
|
||||
* simplify.c (gfc_simplify_reshape): Fixed reshaping of empty arrays
|
||||
without padding.
|
||||
|
||||
2009-06-06 Daniel Franke <franke.daniel@gmail.com>
|
||||
|
||||
PR fortran/32890
|
||||
|
@ -3808,7 +3808,7 @@ gfc_simplify_reshape (gfc_expr *source, gfc_expr *shape_exp,
|
||||
for (i = 0; i < rank; i++)
|
||||
x[i] = 0;
|
||||
|
||||
for (;;)
|
||||
while (nsource > 0 || npad > 0)
|
||||
{
|
||||
/* Figure out which element to extract. */
|
||||
mpz_set_ui (index, 0);
|
||||
|
@ -1,3 +1,8 @@
|
||||
2009-06-06 Daniel Franke <franke.daniel@gmail.com>
|
||||
|
||||
PR fortran/37203
|
||||
* reshape_zerosize_2.f90: New.
|
||||
|
||||
2009-06-06 Daniel Franke <franke.daniel@gmail.com>
|
||||
|
||||
PR fortran/32890
|
||||
|
11
gcc/testsuite/gfortran.dg/reshape_zerosize_2.f90
Normal file
11
gcc/testsuite/gfortran.dg/reshape_zerosize_2.f90
Normal file
@ -0,0 +1,11 @@
|
||||
! { dg-do "run" }
|
||||
|
||||
! Simplifier of RESHAPE was broken when reshaping an empty array.
|
||||
INTEGER, PARAMETER :: empty(0,0) = RESHAPE(SHAPE(1), (/0, 0/))
|
||||
|
||||
! same with surplus padding
|
||||
INTEGER, PARAMETER :: empty_padding(0,0) = RESHAPE(SHAPE(1), (/0, 0/), PAD=( (/ 1, 2 /) ))
|
||||
|
||||
! same with required padding
|
||||
INTEGER, PARAMETER :: non_empty(2,2) = RESHAPE(SHAPE(1), (/2, 2/), PAD=( (/ 1, 2 /) ))
|
||||
END
|
Loading…
x
Reference in New Issue
Block a user