summaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index f669a4729da..2f9ffc3b622 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -761,13 +761,9 @@ pop_scope (void)
error ("label %q+D used but not defined", p);
DECL_INITIAL (p) = error_mark_node;
}
- else if (!TREE_USED (p) && warn_unused_label)
- {
- if (DECL_INITIAL (p))
- warning (0, "label %q+D defined but not used", p);
- else
- warning (0, "label %q+D declared but not defined", p);
- }
+ else
+ warn_for_unused_label (p);
+
/* Labels go in BLOCK_VARS. */
TREE_CHAIN (p) = BLOCK_VARS (block);
BLOCK_VARS (block) = p;