Commit df1c8791 by Steven G. Kargl

re PR fortran/58989 (internal compiler error when using reshape function)

2013-11-05  Steven G. Kargl <kargl@gcc.gnu.org>

	PR fortran/58989
	* check.c (gfc_check_reshape): ensure that shape is a constant
	expression.

2013-11-05  Steven G. Kargl <kargl@gcc.gnu.org>

	PR fortran/58989
	* gfortran.dg/reshape_6.f90: New test.

From-SVN: r204419
parent ae40b2ff
2013-11-05 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/58989
* check.c (gfc_check_reshape): ensure that shape is a constant
expression.
2013-11-05 Tobias Burnus <burnus@net-b.de> 2013-11-05 Tobias Burnus <burnus@net-b.de>
* lang.opt (fopenmp-simd): New option. * lang.opt (fopenmp-simd): New option.
......
...@@ -3277,7 +3277,7 @@ gfc_check_reshape (gfc_expr *source, gfc_expr *shape, ...@@ -3277,7 +3277,7 @@ gfc_check_reshape (gfc_expr *source, gfc_expr *shape,
"than %d elements", &shape->where, GFC_MAX_DIMENSIONS); "than %d elements", &shape->where, GFC_MAX_DIMENSIONS);
return false; return false;
} }
else if (shape->expr_type == EXPR_ARRAY) else if (shape->expr_type == EXPR_ARRAY && gfc_is_constant_expr (shape))
{ {
gfc_expr *e; gfc_expr *e;
int i, extent; int i, extent;
......
2013-11-05 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/58989
* gfortran.dg/reshape_6.f90: New test.
2013-10-05 Jeff Law <law@redhat.com> 2013-10-05 Jeff Law <law@redhat.com>
* gcc.dg/pr38984.c: Add -fno-isolate-erroneous-paths. * gcc.dg/pr38984.c: Add -fno-isolate-erroneous-paths.
......
! { dg-do compile }
! PR fortran/58989
!
program test
real(8), dimension(4,4) :: fluxes
real(8), dimension(2,2,2,2) :: f
integer, dimension(3) :: dmmy
integer, parameter :: indx(4)=(/2,2,2,2/)
fluxes = 1
dmmy = (/2,2,2/)
f = reshape(fluxes,(/dmmy,2/)) ! Caused an ICE
f = reshape(fluxes,(/2,2,2,2/)) ! Works as expected
f = reshape(fluxes,indx) ! Works as expected
end program test
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