From 0c88d078eba7f51d2e5fc76a630f7eb369c09c87 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 30 Sep 2019 15:27:14 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 6 ++++++ gcc/config/frv/frv.c | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 830c93d..df8a3d2 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 223415e..6526e81 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; -- 2.7.4