Commit 712dff31 by Steven G. Kargl

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
parent fb42421e
2016-07-30 Steven G. Kargl <kargl@gcc.gnu.org> 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 PR fortran/71730
* decl.c (char_len_param_value): Check return value of * decl.c (char_len_param_value): Check return value of
gfc_reduce_init_expr(). gfc_reduce_init_expr().
......
...@@ -3052,7 +3052,7 @@ gfc_resolve_dt (gfc_dt *dt, locus *loc) ...@@ -3052,7 +3052,7 @@ gfc_resolve_dt (gfc_dt *dt, locus *loc)
&& dt->format_label->defined == ST_LABEL_UNKNOWN) && dt->format_label->defined == ST_LABEL_UNKNOWN)
{ {
gfc_error ("FORMAT label %d at %L not defined", dt->format_label->value, gfc_error ("FORMAT label %d at %L not defined", dt->format_label->value,
&dt->format_label->where); loc);
return false; return false;
} }
......
...@@ -8966,7 +8966,7 @@ resolve_branch (gfc_st_label *label, gfc_code *code) ...@@ -8966,7 +8966,7 @@ resolve_branch (gfc_st_label *label, gfc_code *code)
if (label->defined == ST_LABEL_UNKNOWN) if (label->defined == ST_LABEL_UNKNOWN)
{ {
gfc_error ("Label %d referenced at %L is never defined", label->value, gfc_error ("Label %d referenced at %L is never defined", label->value,
&label->where); &code->loc);
return; return;
} }
......
2016-07-30 Steven G. Kargl <kargl@gcc.gnu.org> 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 PR fortran/71730
* gfortran.dg/pr71730.f90: New test. * gfortran.dg/pr71730.f90: New test.
* gfortran.dg/bounds_check_strlen_2.f90: Fix invalid code. * gfortran.dg/bounds_check_strlen_2.f90: Fix invalid code.
......
! { 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
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