[PATCH] Fall-through warnings in combine.c

Fritz Reese fritzoreese@gmail.com
Mon Oct 31 17:16:00 GMT 2016


I think this is obvious, the following code in combine.c which intends
to fallthrough some switch cases is not marked with 'gcc_fallthrough'
as it should be, thus producing warnings during compilation.

---
Fritz Reese


2016-10-31  Fritz Reese  <fritzoreese@gmail.com>

        gcc/combine.c (simplify_compare_const): Mark fallthrough cases.
-------------- next part --------------
diff --git a/gcc/combine.c b/gcc/combine.c
index 60a127f..6cbb8cf 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -11414,6 +11414,7 @@ simplify_compare_const (enum rtx_code code, machine_mode mode,
 	  const_op -= 1;
 	  code = LE;
 	  /* ... fall through to LE case below.  */
+	  gcc_fallthrough ();
 	}
       else
 	break;
@@ -11443,6 +11444,7 @@ simplify_compare_const (enum rtx_code code, machine_mode mode,
 	  const_op -= 1;
 	  code = GT;
 	  /* ... fall through to GT below.  */
+	  gcc_fallthrough ();
 	}
       else
 	break;


More information about the Gcc-patches mailing list