From: Steven G. Kargl Date: Mon, 22 Aug 2016 18:23:43 +0000 (+0000) Subject: re PR fortran/60774 (f951: internal compiler error: Segmentation fault: 11) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=58338bacdd63bfa128d5884e7ceeb47a4431d1ad;p=gcc.git re PR fortran/60774 (f951: internal compiler error: Segmentation fault: 11) 2016-08-22 Steven G. Kargl Bud Davis PR fortran/60774 * parse.c (next_free,next_fixed): Issue error for statement label without a statement. 2016-08-22 Steven G. Kargl PR fortran/60774 * gfortran.dg/empty_label.f: Adjust test for new error message. * gfortran.dg/empty_label.f90: Ditto. * gfortran.dg/empty_label_typedecl.f90: Ditto. * gfortran.dg/label_3.f90: Deleted (redundant with empty_label.f90). * gfortran.dg/warnings_are_errors_1.f90: Remove invalid statement label. Co-Authored-By: Bud Davis From-SVN: r239668 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index a7be7c6ffd6..3000e919f6b 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2016-08-22 Steven G. Kargl + Bud Davis + + PR fortran/60774 + * parse.c (next_free,next_fixed): Issue error for statement label + without a statement. + 2016-08-22 Steven G. Kargl PR fortran/61318 diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index bd7b1384a0c..deba4311f2a 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -1071,13 +1071,8 @@ next_free (void) } if (gfc_match_eos () == MATCH_YES) - { - gfc_warning_now (0, "Ignoring statement label in empty statement " - "at %L", &label_locus); - gfc_free_st_label (gfc_statement_label); - gfc_statement_label = NULL; - return ST_NONE; - } + gfc_error_now ("Statement label without statement at %L", + &label_locus); } } else if (c == '!') @@ -1333,8 +1328,7 @@ next_fixed (void) blank_line: if (digit_flag) - gfc_warning_now (0, "Ignoring statement label in empty statement at %L", - &label_locus); + gfc_error_now ("Statement label without statement at %L", &label_locus); gfc_current_locus.lb->truncated = 0; gfc_advance_line (); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9cc5fb51739..013cee3798a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2016-08-22 Steven G. Kargl + + PR fortran/60774 + * gfortran.dg/empty_label.f: Adjust test for new error message. + * gfortran.dg/empty_label.f90: Ditto. + * gfortran.dg/empty_label_typedecl.f90: Ditto. + * gfortran.dg/label_3.f90: Deleted (redundant with empty_label.f90). + * gfortran.dg/warnings_are_errors_1.f90: Remove invalid statement label. + 2016-08-22 Steven G. Kargl PR fortran/61318 diff --git a/gcc/testsuite/gfortran.dg/empty_label.f b/gcc/testsuite/gfortran.dg/empty_label.f index fe1665228d3..e66cb877d2e 100644 --- a/gcc/testsuite/gfortran.dg/empty_label.f +++ b/gcc/testsuite/gfortran.dg/empty_label.f @@ -1,7 +1,4 @@ C { dg-do compile } -C { dg-options "-Werror -fmax-errors=1" } -100 ! { dg-error "empty statement" } +100 ! { dg-error "Statement label without statement" } end -subroutine foo ! Not checked ... -end function ! ... but an error -C { dg-excess-errors "warnings being treated as errors" } + diff --git a/gcc/testsuite/gfortran.dg/empty_label.f90 b/gcc/testsuite/gfortran.dg/empty_label.f90 index af067b5f57a..eb7bc512953 100644 --- a/gcc/testsuite/gfortran.dg/empty_label.f90 +++ b/gcc/testsuite/gfortran.dg/empty_label.f90 @@ -1,7 +1,3 @@ ! { dg-do compile } -! { dg-options "-Werror -fmax-errors=1" } -100 ! { dg-error "empty statement" } +100 ! { dg-error "Statement label without statement" } end -subroutine foo ! Not checked ... -end function ! ... but an error -! { dg-excess-errors "warnings being treated as errors" } diff --git a/gcc/testsuite/gfortran.dg/empty_label_typedecl.f90 b/gcc/testsuite/gfortran.dg/empty_label_typedecl.f90 index c85e5be8d08..d4e7f4781ae 100644 --- a/gcc/testsuite/gfortran.dg/empty_label_typedecl.f90 +++ b/gcc/testsuite/gfortran.dg/empty_label_typedecl.f90 @@ -1,8 +1,6 @@ ! { dg-do compile } -! { dg-options "-Werror" } subroutine s type t - 1 ! { dg-error "empty statement" } + 1 ! { dg-error "Statement label without statement" } end type end subroutine -! { dg-excess-errors "warnings being treated as errors" } diff --git a/gcc/testsuite/gfortran.dg/label_3.f90 b/gcc/testsuite/gfortran.dg/label_3.f90 deleted file mode 100644 index 5cebe935b22..00000000000 --- a/gcc/testsuite/gfortran.dg/label_3.f90 +++ /dev/null @@ -1,5 +0,0 @@ -! { dg-do compile } -! PR fortran/25756. -! This used to ICE due to the space after the label. -1 ! { dg-warning "Ignoring statement label in empty statement" } -end diff --git a/gcc/testsuite/gfortran.dg/warnings_are_errors_1.f90 b/gcc/testsuite/gfortran.dg/warnings_are_errors_1.f90 index 6fcd29adebd..150f2346a4f 100644 --- a/gcc/testsuite/gfortran.dg/warnings_are_errors_1.f90 +++ b/gcc/testsuite/gfortran.dg/warnings_are_errors_1.f90 @@ -20,8 +20,6 @@ 1234 complex :: cplx ! { dg-error "defined but cannot be used" } cplx = 20. -! gfc_warning_now: - 1 ! { dg-error "Ignoring statement label in empty statement" } end ! { dg-final { output-exists-not } } ! { dg-excess-errors "warnings being treated as errors" }