re PR c/77946 (-Wimplicit-fallthrough=1 ICE: tree check: expected tree that contains...
authorJakub Jelinek <jakub@redhat.com>
Thu, 13 Oct 2016 10:42:36 +0000 (12:42 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 13 Oct 2016 10:42:36 +0000 (12:42 +0200)
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
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/Wimplicit-fallthrough-34.c [new file with mode: 0644]
gcc/tree.h
gcc/varasm.c

index 449a759f45821823b9846bee6f4f547f06838376..b2b3ab5804c6388d092275fbc514fff58d56b9f6 100644 (file)
@@ -1,3 +1,10 @@
+2016-10-13  Jakub Jelinek  <jakub@redhat.com>
+
+       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  <bin.cheng@arm.com>
 
        * tree-vect-loop-manip.c (slpeel_can_duplicate_loop_p): Fix code
index c059a1d79d32c27f9c8d265d70edece13df32047..5dc04c5e65974d42816b5d75e785ab17252c1c49 100644 (file)
@@ -1,3 +1,8 @@
+2016-10-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/77946
+       * c-c++-common/Wimplicit-fallthrough-34.c: New test.
+
 2016-10-13  Martin Liska  <mliska@suse.cz>
 
        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 (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 30c643968dece32e972f80727559e7c2f819d713..434a7a13076b91d069e5387d3e30a7538afaad9e 100644 (file)
@@ -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 *'.
index a03687210c0b3b7d62a8704ccfcf4f93acc2ed1f..99dd4cb3cfcdfee5f8156e2f2c7c1c6bec921585 100644 (file)
@@ -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.  */