This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][OBVIOUS] Fix -Wimplicit-fallthrough in combine.c


Hi.

I'm going to install the patch that suppresses -O0 warning:

../../gcc/combine.c: In function ‘rtx_code simplify_compare_const(rtx_code, machine_mode, rtx, rtx_def**)’:
../../gcc/combine.c:11789:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
       if (const_op > 0)
       ^~
../../gcc/combine.c:11808:5: note: here
     case LEU:
     ^~~~
../../gcc/combine.c:11826:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
       if (const_op > 1)
       ^~
../../gcc/combine.c:11846:5: note: here
     case GTU:
     ^~~~

Martin

gcc/ChangeLog:

2017-10-18  Martin Liska  <mliska@suse.cz>

	* combine.c (simplify_compare_const): Add gcc_fallthrough.
---
 gcc/combine.c | 2 ++
 1 file changed, 2 insertions(+)


diff --git a/gcc/combine.c b/gcc/combine.c
index 3b96d86bdb3..757ae6fc93e 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -11791,6 +11791,7 @@ simplify_compare_const (enum rtx_code code, machine_mode mode,
 	  const_op -= 1;
 	  code = LEU;
 	  /* ... fall through ...  */
+	  gcc_fallthrough ();
 	}
       /* (unsigned) < 0x80000000 is equivalent to >= 0.  */
       else if (is_a <scalar_int_mode> (mode, &int_mode)
@@ -11828,6 +11829,7 @@ simplify_compare_const (enum rtx_code code, machine_mode mode,
 	  const_op -= 1;
 	  code = GTU;
 	  /* ... fall through ...  */
+	  gcc_fallthrough ();
 	}
 
       /* (unsigned) >= 0x80000000 is equivalent to < 0.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]