diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2017-03-22 15:20:17 +0000 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2017-03-22 15:20:17 +0000 |
commit | 4154f31701fbd9c6eab3e3e4ec136958d81bb40d (patch) | |
tree | 04d07422c565ded933af59995d6e0beebad319aa | |
parent | a2b3ce91b5734fd46e5e18d93c727ca87d66eca4 (diff) |
2017-03-22 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/80142
* frontend-passes.c (combine_array_constructor): Take
location of new expression from constructor expression instead
of constructor.
2017-03-22 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/80142
* gfortran.dg/any_loc.f90: New test case.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@246388 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/frontend-passes.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/any_loc.f90 | 27 |
4 files changed, 40 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 5c99e1fb24a..1dce756ecc6 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2017-03-22 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR fortran/80142 + * frontend-passes.c (combine_array_constructor): Take + location of new expression from constructor expression instead + of constructor. + 2017-03-18 Paul Thomas <pault@gcc.gnu.org> PR fortran/79676 diff --git a/gcc/fortran/frontend-passes.c b/gcc/fortran/frontend-passes.c index b255e98af31..459967d5c35 100644 --- a/gcc/fortran/frontend-passes.c +++ b/gcc/fortran/frontend-passes.c @@ -1381,7 +1381,7 @@ combine_array_constructor (gfc_expr *e) new_expr->ts = e->ts; new_expr->expr_type = EXPR_OP; new_expr->rank = c->expr->rank; - new_expr->where = c->where; + new_expr->where = c->expr->where; new_expr->value.op.op = e->value.op.op; if (scalar_first) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ead24fa48d3..53474a1b1aa 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-03-22 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR fortran/80142 + * gfortran.dg/any_loc.f90: New test case. + 2017-03-22 Thomas Preud'homme <thomas.preudhomme@arm.com> PR target/80082 diff --git a/gcc/testsuite/gfortran.dg/any_loc.f90 b/gcc/testsuite/gfortran.dg/any_loc.f90 new file mode 100644 index 00000000000..1a220508d9e --- /dev/null +++ b/gcc/testsuite/gfortran.dg/any_loc.f90 @@ -0,0 +1,27 @@ +! { dg-do compile } +! { dg-options "-ffrontend-optimize" } +! PR fortran/80142 - the location on the expression of the +! unrolled any statement was not correctly set. +! Test case by Harald Anlauf. +MODULE gfcbug140 + implicit none + integer ,parameter :: WV_NONE = 1 + integer, parameter :: WV_CDV_4 = 23 + integer, parameter :: WV_CDV_8 = 24 + integer, parameter :: wv_CDV_list(2) = [ WV_CDV_4, WV_CDV_8 ] + integer :: basis = WV_NONE +contains + subroutine wave_1d (x) + real, intent(inout) :: x(:,:) + integer :: oldbase + oldbase = basis + if (any (basis == wv_CDV_list(:))) then + end if + basis = oldbase + end subroutine wave_1d + !- + subroutine mr_gp_mat (A) + real, intent(inout) :: A (:,:) + call wave_1d (A) + end subroutine mr_gp_mat +end module gfcbug140 |