PR c/77946 76/251976/1 accepted/tizen_5.5_base accepted/tizen/5.5/base/20210129.091434 submit/tizen_5.5_base/20210122.093747
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 13 Oct 2016 10:42:36 +0000 (10:42 +0000)
committerSlava Barinov <v.barinov@samsung.com>
Thu, 21 Jan 2021 07:47:11 +0000 (10:47 +0300)
        * 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241094 138bc75d-0d04-0410-961f-82ee72b054a4
git-id: c0f4422f26a07270ec6027df89b731e7b9977e14

Change-Id: Ied47aa4857f185e104b3ff29daf46ff11aee8f7d
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
gcc/testsuite/c-c++-common/Wimplicit-fallthrough-34.c [new file with mode: 0644]
gcc/tree.h
gcc/varasm.c

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 (file)
index 0000000..9168c52
--- /dev/null
@@ -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:;
+}
index b6dd4cd..048d4f8 100644 (file)
@@ -769,7 +769,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 *'.
index 1445794..22e499f 100644 (file)
@@ -6888,8 +6888,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.  */