* [patch, fortran, committed] Fix PR 80162, warning about missing location information
@ 2017-03-22 15:25 Thomas Koenig
0 siblings, 0 replies; only message in thread
From: Thomas Koenig @ 2017-03-22 15:25 UTC (permalink / raw)
To: fortran, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 627 bytes --]
Hello world,
I have committed the attached patch as obvious and simple
after regression-testing, as rev. 246388.
This is a case where the location checking pass did its job
and found a place where the location information was indeed
missing.
Regards
Thomas
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.
[-- Attachment #2: p7.diff --]
[-- Type: text/x-patch, Size: 488 bytes --]
Index: frontend-passes.c
===================================================================
--- frontend-passes.c (Revision 245760)
+++ frontend-passes.c (Arbeitskopie)
@@ -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)
[-- Attachment #3: any_loc.f90 --]
[-- Type: text/x-fortran, Size: 835 bytes --]
! { 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-03-22 15:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-22 15:25 [patch, fortran, committed] Fix PR 80162, warning about missing location information Thomas Koenig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).