From: Tobias Burnus Date: Sun, 7 Apr 2013 08:41:17 +0000 (+0200) Subject: re PR fortran/56849 (Missing compile-time shape check for RESHAPE assignments with... X-Git-Tag: upstream/12.2.0~70450 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=7c42966e8533afa8a5102e4fd072c825d57fea2e;p=platform%2Fupstream%2Fgcc.git re PR fortran/56849 (Missing compile-time shape check for RESHAPE assignments with an ORDER= attribute) 2013-04-07 Tobias Burnus PR fortran/56849 * iresolve.c (gfc_resolve_reshape): Set shape also with order=. 2013-04-07 Tobias Burnus PR fortran/56849 * gfortran.dg/reshape_5.f90: New. From-SVN: r197550 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 6692350..bf6f7d8 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2013-04-07 Tobias Burnus + + PR fortran/56849 + * iresolve.c (gfc_resolve_reshape): Set shape also + with order=. + 2013-04-04 Janus Weil PR fortran/40881 diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c index 2b92b7c..af452b3 100644 --- a/gcc/fortran/iresolve.c +++ b/gcc/fortran/iresolve.c @@ -2154,10 +2154,7 @@ gfc_resolve_reshape (gfc_expr *f, gfc_expr *source, gfc_expr *shape, break; } - /* TODO: Make this work with a constant ORDER parameter. */ - if (shape->expr_type == EXPR_ARRAY - && gfc_is_constant_expr (shape) - && order == NULL) + if (shape->expr_type == EXPR_ARRAY && gfc_is_constant_expr (shape)) { gfc_constructor *c; f->shape = gfc_get_shape (f->rank); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4bea9b6..15896c3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-04-07 Tobias Burnus + + PR fortran/56849 + * gfortran.dg/reshape_5.f90: New. + 2013-04-05 Bill Schmidt PR target/56843 diff --git a/gcc/testsuite/gfortran.dg/reshape_5.f90 b/gcc/testsuite/gfortran.dg/reshape_5.f90 new file mode 100644 index 0000000..a7d4a3f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/reshape_5.f90 @@ -0,0 +1,10 @@ +! { dg-do compile } +! +! PR fortran/56849 +! +integer :: x(2,2),y(4) +y = reshape([1,2,3,4],[4]) +x(:,1:1) = reshape(y(::2), [1,2], order=[1,2]) ! { dg-error "Different shape for array assignment at .1. on dimension 1 .2 and 1." } +print *, y +print *, x(:,1) +end