From b5cbe7eee3cb428d07035b33c3d79684684e93bd Mon Sep 17 00:00:00 2001 From: "Steven G. Kargl" Date: Fri, 13 Jan 2006 21:09:24 +0000 Subject: [PATCH] [multiple changes] 2006-01-13 Steven G. Kargl PR fortran/25756 * symbol.c (gfc_free_st_label): Give variable meaningful name. Remove unneeded parenthesis. Fix-up the head of the list (2 lines gleaned from g95). 2006-01-13 Bernhard Fischer PR fortran/25756 * gfortran.dg/label_3.f90: New test. From-SVN: r109674 --- gcc/fortran/ChangeLog | 7 +++++++ gcc/fortran/symbol.c | 22 +++++++++++++--------- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/label_3.f90 | 5 +++++ 4 files changed, 30 insertions(+), 9 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/label_3.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 5f18c766185f..29a4c77ffb07 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2006-01-13 Steven G. Kargl + + PR fortran/25756 + * symbol.c (gfc_free_st_label): Give variable meaningful name. Remove + unneeded parenthesis. Fix-up the head of the list (2 lines gleaned + from g95). + 2006-01-13 Diego Novillo * trans.c (gfc_add_expr_to_block): Do not fold tcc_statement diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index bda1c1d4f7af..6eec85308ec3 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -1473,21 +1473,25 @@ gfc_get_component_attr (symbol_attribute * attr, gfc_component * c) occurs. */ void -gfc_free_st_label (gfc_st_label * l) +gfc_free_st_label (gfc_st_label * label) { - if (l == NULL) + if (label == NULL) return; - if (l->prev) - (l->prev->next = l->next); + if (label->prev) + label->prev->next = label->next; - if (l->next) - (l->next->prev = l->prev); + if (label->next) + label->next->prev = label->prev; - if (l->format != NULL) - gfc_free_expr (l->format); - gfc_free (l); + if (gfc_current_ns->st_labels == label) + gfc_current_ns->st_labels = label->next; + + if (label->format != NULL) + gfc_free_expr (label->format); + + gfc_free (label); } /* Free a whole list of gfc_st_label structures. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1a59f59c355c..daf4596b8c44 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-01-13 Bernhard Fischer + + PR fortran/25756 + * gfortran.dg/label_3.f90: New test. + 2006-01-13 Daniel Berlin PR tree-optimization/25771 diff --git a/gcc/testsuite/gfortran.dg/label_3.f90 b/gcc/testsuite/gfortran.dg/label_3.f90 new file mode 100644 index 000000000000..5cebe935b227 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/label_3.f90 @@ -0,0 +1,5 @@ +! { 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 -- 2.47.2