Commit 6e7cc036 by Mikael Morin Committed by Mikael Morin

re PR fortran/38184 (invariant RESHAPE not expanded if SOURCE is empty)

2008-11-24  Mikael Morin  <mikael.morin@tele2.fr>

	PR fortran/38184
	* simplify.c (is_constant_array_expr): Return true instead of false
	if the array constructor is empty.

2008-11-24  Mikael Morin  <mikael.morin@tele2.fr>

	PR fortran/38184
	* gfortran.dg/reshape_empty_1.f03: New test.

From-SVN: r142168
parent c63d7754
2008-11-24 Mikael Morin <mikael.morin@tele2.fr>
PR fortran/38184
* simplify.c (is_constant_array_expr): Return true instead of false
if the array constructor is empty.
2008-11-24 Daniel Kraft <d@domob.eu>
PR fortran/37779
......
......@@ -3410,9 +3410,6 @@ is_constant_array_expr (gfc_expr *e)
if (e->expr_type != EXPR_ARRAY || !gfc_is_constant_expr (e))
return false;
if (e->value.constructor == NULL)
return false;
for (c = e->value.constructor; c; c = c->next)
if (c->expr->expr_type != EXPR_CONSTANT)
return false;
......
2008-11-24 Mikael Morin <mikael.morin@tele2.fr>
PR fortran/38184
* gfortran.dg/reshape_empty_1.f03: New test.
2008-11-24 Jack Howarth <howarth@bromo.med.uc.edu>
PR testsuite/38241
......
! { dg-do run }
! { dg-options "-fdump-tree-original" }
!
! PR fortran/38184
! invariant RESHAPE not expanded if SOURCE is empty.
!
! Original program by James Van Buskirk
integer, parameter :: N = 3
integer, parameter :: A(N,N) = reshape([integer::],[N,N],reshape([1],[N+1],[2]))
integer, parameter :: K = N*A(2,2)+A(2,3)
integer :: B(N,N) = reshape([1,2,2,2,1,2,2,2,1],[3,3])
integer :: i
i = 5
if (any(A /= B)) call abort
if (K /= i) call abort
end
! { dg-final { scan-tree-dump-times "\\\{1, 2, 2, 2, 1, 2, 2, 2, 1\\\}" 2 "original" } }
! { dg-final { cleanup-tree-dump "original" } }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment