epiphany: fix -Wimplicit-fallthrough warnings in epiphany.c.

Message ID 03380edf-3c4f-4d2c-c59a-4e967b7cf9ee@suse.cz
State New
Headers
Series epiphany: fix -Wimplicit-fallthrough warnings in epiphany.c. |

Commit Message

Martin Liška Jan. 12, 2022, 9:56 a.m. UTC
  This is RFC.

Cheers,
Martin

gcc/ChangeLog:

	* config/epiphany/epiphany.c (epiphany_mode_priority):
	Use gcc_unreachable for not handled cases.
---
  gcc/config/epiphany/epiphany.c | 3 +++
  1 file changed, 3 insertions(+)
  

Comments

Jeff Law Jan. 12, 2022, 4:21 p.m. UTC | #1
On 1/12/2022 2:56 AM, Martin Liška wrote:
> This is RFC.
>
> Cheers,
> Martin
>
> gcc/ChangeLog:
>
>     * config/epiphany/epiphany.c (epiphany_mode_priority):
>     Use gcc_unreachable for not handled cases.
OK.  As are similar changes in other ports.

jeff
  

Patch

diff --git a/gcc/config/epiphany/epiphany.c b/gcc/config/epiphany/epiphany.c
index a2743436f38..88283419dc1 100644
--- a/gcc/config/epiphany/epiphany.c
+++ b/gcc/config/epiphany/epiphany.c
@@ -2369,6 +2369,7 @@  epiphany_mode_priority (int entity, int priority)
  	  case 2: return (epiphany_normal_fp_rounding == FP_MODE_ROUND_NEAREST
  			  ? FP_MODE_ROUND_TRUNC : FP_MODE_ROUND_NEAREST);
  	  case 3: return FP_MODE_CALLER;
+	  default: gcc_unreachable ();
  	  }
        case FP_MODE_ROUND_NEAREST:
        case FP_MODE_CALLER:
@@ -2378,6 +2379,7 @@  epiphany_mode_priority (int entity, int priority)
  	  case 1: return FP_MODE_ROUND_TRUNC;
  	  case 2: return FP_MODE_INT;
  	  case 3: return FP_MODE_CALLER;
+	  default: gcc_unreachable ();
  	  }
        case FP_MODE_ROUND_TRUNC:
  	switch (priority)
@@ -2386,6 +2388,7 @@  epiphany_mode_priority (int entity, int priority)
  	  case 1: return FP_MODE_ROUND_NEAREST;
  	  case 2: return FP_MODE_INT;
  	  case 3: return FP_MODE_CALLER;
+	  default: gcc_unreachable ();
  	  }
        case FP_MODE_ROUND_UNKNOWN:
        case FP_MODE_NONE: