From 1a1ab05e906d5fe546e72354dd79d455becd71df Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 13 Oct 2016 12:42:36 +0200 Subject: [PATCH] =?utf8?q?re=20PR=20c/77946=20(-Wimplicit-fallthrough=3D1?= =?utf8?q?=20ICE:=20tree=20check:=20expected=20tree=20that=20contains=20?= =?utf8?q?=E2=80=98decl=20with=20visibility=E2=80=99=20structure,=20have?= =?utf8?q?=20=E2=80=98label=5Fdecl=E2=80=99)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit PR c/77946 * tree.h (FALLTHROUGH_LABEL_P): Use private_flag instead of public_flag. * varasm.c (default_binds_local_p_3): Formatting fix. * c-c++-common/Wimplicit-fallthrough-34.c: New test. From-SVN: r241094 --- gcc/ChangeLog | 7 +++++++ gcc/testsuite/ChangeLog | 5 +++++ .../c-c++-common/Wimplicit-fallthrough-34.c | 12 ++++++++++++ gcc/tree.h | 2 +- gcc/varasm.c | 4 ++-- 5 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/c-c++-common/Wimplicit-fallthrough-34.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 449a759f458..b2b3ab5804c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-10-13 Jakub Jelinek + + PR c/77946 + * tree.h (FALLTHROUGH_LABEL_P): Use private_flag instead of + public_flag. + * varasm.c (default_binds_local_p_3): Formatting fix. + 2016-10-13 Bin Cheng * tree-vect-loop-manip.c (slpeel_can_duplicate_loop_p): Fix code diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c059a1d79d3..5dc04c5e659 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-10-13 Jakub Jelinek + + PR c/77946 + * c-c++-common/Wimplicit-fallthrough-34.c: New test. + 2016-10-13 Martin Liska PR tree-optimization/77943 diff --git a/gcc/testsuite/c-c++-common/Wimplicit-fallthrough-34.c b/gcc/testsuite/c-c++-common/Wimplicit-fallthrough-34.c new file mode 100644 index 00000000000..9168c5225f0 --- /dev/null +++ b/gcc/testsuite/c-c++-common/Wimplicit-fallthrough-34.c @@ -0,0 +1,12 @@ +/* PR c/77946 */ +/* { dg-do compile } */ +/* { dg-options "-Wimplicit-fallthrough" } */ + +void +foo (void) +{ + static void *p = &&lab; + goto *p; + /*FALLTHRU*/ + lab:; +} diff --git a/gcc/tree.h b/gcc/tree.h index 30c643968de..434a7a13076 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -777,7 +777,7 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int, /* Whether a case or a user-defined label is allowed to fall through to. This is used to implement -Wimplicit-fallthrough. */ #define FALLTHROUGH_LABEL_P(NODE) \ - (LABEL_DECL_CHECK (NODE)->base.public_flag) + (LABEL_DECL_CHECK (NODE)->base.private_flag) /* Nonzero means this expression is volatile in the C sense: its address should be of type `volatile WHATEVER *'. diff --git a/gcc/varasm.c b/gcc/varasm.c index a03687210c0..99dd4cb3cfc 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -6856,8 +6856,8 @@ default_binds_local_p_3 (const_tree exp, bool shlib, bool weak_dominate, FIXME: We can resolve the weakref case more curefuly by looking at the weakref alias. */ if (lookup_attribute ("weakref", DECL_ATTRIBUTES (exp)) - || (TREE_CODE (exp) == FUNCTION_DECL - && lookup_attribute ("ifunc", DECL_ATTRIBUTES (exp)))) + || (TREE_CODE (exp) == FUNCTION_DECL + && lookup_attribute ("ifunc", DECL_ATTRIBUTES (exp)))) return false; /* Static variables are always local. */ -- 2.30.2