re PR fortran/70006 (Duplicate errors "label not defined")

2016-07-30  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/70006
	* io.c (gfc_resolve_dt): Use correct locus.
	* resolve.c (resolve_branch): Ditto.

2016-07-30  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/70006
	* gfortran.dg/pr70006.f90: New test.

From-SVN: r238905
This commit is contained in:
Steven G. Kargl 2016-07-30 18:18:49 +00:00
parent fb42421ef0
commit 712dff3172
5 changed files with 22 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2016-07-30 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/70006
* io.c (gfc_resolve_dt): Use correct locus.
* resolve.c (resolve_branch): Ditto.
2016-07-30 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/71730

View File

@ -3052,7 +3052,7 @@ gfc_resolve_dt (gfc_dt *dt, locus *loc)
&& dt->format_label->defined == ST_LABEL_UNKNOWN)
{
gfc_error ("FORMAT label %d at %L not defined", dt->format_label->value,
&dt->format_label->where);
loc);
return false;
}

View File

@ -8966,7 +8966,7 @@ resolve_branch (gfc_st_label *label, gfc_code *code)
if (label->defined == ST_LABEL_UNKNOWN)
{
gfc_error ("Label %d referenced at %L is never defined", label->value,
&label->where);
&code->loc);
return;
}

View File

@ -1,3 +1,8 @@
2016-07-30 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/70006
* gfortran.dg/pr70006.f90: New test.
2016-07-30 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/71730

View File

@ -0,0 +1,9 @@
! { dg-do compile}
program test
print 1, 'string 1' ! { dg-error "FORMAT label 1" " " { target *-*-* } 3 }
print 1, 'string 2' ! { dg-error "FORMAT label 1" " " { target *-*-* } 4 }
!1 format(a)
goto 2 ! { dg-error "Label 2 referenced" " " { target *-*-* } 6 }
goto 2 ! { dg-error "Label 2 referenced" " " { target *-*-* } 7 }
!2 continue
end program