public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][ARM] Fix -Wimplicit-fallthrough warnings
@ 2016-09-27 13:34 Kyrill Tkachov
  0 siblings, 0 replies; only message in thread
From: Kyrill Tkachov @ 2016-09-27 13:34 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 755 bytes --]

Hi all,

This patch adjusts the fallthrough comments in the arm backend to not trigger the -Wimplicit-fallthrough warning
which is currently causing arm bootstrap to fail.

Bootstrapped and tested on arm-none-linux-gnueabihf.

Committing to trunk in the interest of fixing bootstrap.

Thanks,
Kyrill

2016-09-27  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * config/arm/arm.c (const_ok_for_op): Use "Fall through" comment form
     expected by -Wimplicit-fallthrough.
     (thumb1_size_rtx_costs): Likewise.
     (thumb2_reorg): Likewise.
     (tls_mentioned_p): Add "Fall through" comment.
     (thumb2_reorg): Likewise.
     * config/arm/arm-builtins.c (arm_expand_neon_args): Use "Fall through"
     comment form expected by -Wimplicit-fallthrough.

[-- Attachment #2: arm-fallthrough.patch --]
[-- Type: text/x-patch, Size: 1868 bytes --]

diff --git a/gcc/config/arm/arm-builtins.c b/gcc/config/arm/arm-builtins.c
index 70bcc07..4fafefc 100644
--- a/gcc/config/arm/arm-builtins.c
+++ b/gcc/config/arm/arm-builtins.c
@@ -2153,9 +2153,9 @@ arm_expand_neon_args (rtx target, machine_mode map_mode, int fcode,
 		  enum machine_mode vmode = mode[argc - 1];
 		  neon_lane_bounds (op[argc], 0, GET_MODE_NUNITS (vmode), exp);
 		}
-	      /* Fall through - if the lane index isn't a constant then
-		 the next case will error.  */
-
+	      /* If the lane index isn't a constant then the next
+		 case will error.  */
+	      /* Fall through.  */
 	    case NEON_ARG_CONSTANT:
 constant_arg:
 	      if (!(*insn_data[icode].operand[opno].predicate)
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index feb54cb..705fa00 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -4001,8 +4001,7 @@ const_ok_for_op (HOST_WIDE_INT i, enum rtx_code code)
 	  && ((i & 0xfffff000) == 0
 	      || ((-i) & 0xfffff000) == 0))
 	return 1;
-      /* else fall through.  */
-
+      /* Fall through.  */
     case COMPARE:
     case EQ:
     case NE:
@@ -9129,7 +9128,7 @@ thumb1_size_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer)
 	  || (GET_CODE (XEXP (x, 1)) == MULT
 	      && power_of_two_operand (XEXP (XEXP (x, 1), 1), SImode)))
 	return COSTS_N_INSNS (2);
-      /* On purpose fall through for normal RTX.  */
+      /* Fall through.  */
     case COMPARE:
     case NEG:
     case NOT:
@@ -13371,6 +13370,7 @@ tls_mentioned_p (rtx x)
       if (XINT (x, 1) == UNSPEC_TLS)
 	return 1;
 
+    /* Fall through.  */
     default:
       return 0;
     }
@@ -17568,7 +17568,7 @@ thumb2_reorg (void)
 			 test the global flag here.  */
 		      if (!optimize_size)
 			break;
-		      /* else fall through.  */
+		      /* Fall through.  */
 		    case AND:
 		    case IOR:
 		    case XOR:

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-09-27 13:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-27 13:34 [PATCH][ARM] Fix -Wimplicit-fallthrough warnings Kyrill Tkachov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).