From: Nick Clifton Date: Mon, 30 Sep 2019 15:27:14 +0000 (+0000) Subject: Fix compile time warning about building the FRV backend by adding missing break state... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0c88d078eba7f51d2e5fc76a630f7eb369c09c87;p=gcc.git Fix compile time warning about building the FRV backend by adding missing break statements to the switches in frv_register_move_cost. PR target/85978 * config/frv/frv.c (frv_register_move_cost): Add break statements to avoid falling through to the wrong cases. Tidy code. From-SVN: r276306 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 830c93ddacb..df8a3d22269 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-09-30 Nick Clifton + + PR target/85978 + * config/frv/frv.c (frv_register_move_cost): Add break statements + to avoid falling through to the wrong cases. Tidy code. + 2019-09-30 Richard Sandiford * config/aarch64/aarch64.c (aarch64_hard_regno_call_part_clobbered): diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c index 223415e847c..6526e81729d 100644 --- a/gcc/config/frv/frv.c +++ b/gcc/config/frv/frv.c @@ -6686,7 +6686,6 @@ frv_register_move_cost (machine_mode mode ATTRIBUTE_UNUSED, case FDPIC_REGS: case FDPIC_FPTR_REGS: case FDPIC_CALL_REGS: - switch (to) { default: @@ -6700,7 +6699,6 @@ frv_register_move_cost (machine_mode mode ATTRIBUTE_UNUSED, case FDPIC_REGS: case FDPIC_FPTR_REGS: case FDPIC_CALL_REGS: - return LOW_COST; case FPR_REGS: @@ -6711,6 +6709,7 @@ frv_register_move_cost (machine_mode mode ATTRIBUTE_UNUSED, case SPR_REGS: return LOW_COST; } + break; case QUAD_FPR_REGS: switch (to) @@ -6734,6 +6733,7 @@ frv_register_move_cost (machine_mode mode ATTRIBUTE_UNUSED, case QUAD_FPR_REGS: return LOW_COST; } + break; case LCR_REG: case LR_REG: @@ -6751,9 +6751,9 @@ frv_register_move_cost (machine_mode mode ATTRIBUTE_UNUSED, case FDPIC_REGS: case FDPIC_FPTR_REGS: case FDPIC_CALL_REGS: - return MEDIUM_COST; } + break; case QUAD_ACC_REGS: case ACCG_REGS: @@ -6764,8 +6764,8 @@ frv_register_move_cost (machine_mode mode ATTRIBUTE_UNUSED, case QUAD_FPR_REGS: return MEDIUM_COST; - } + break; } return HIGH_COST;