From 9dc44b4173b72d15fa7ee49d1b196c2d11c84d02 Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Tue, 20 Feb 2018 00:32:37 +0530 Subject: arm: Fix implicit-fallthrough warnings when building with gcc-7+ gcc 7 onwards have additional heuristics to detect implicit fallthroughs and it fails the build with warnings for ARM as a result. There was one gcc bug[1] that I fixed but the rest are cases that gcc cannot detect due to the point at which it does the fallthrough check. Most of this patch adds __builtin_unreachable() hints in places that throw this warning to indicate to gcc that the fallthrough will never happen. The remaining cases are actually possible fallthroughs due to incorrect code running on the simulator; in which case an Unknown instruction is returned. [1] https://gcc.gnu.org/ml/gcc-patches/2018-02/msg01105.html Change-Id: I1baa9fa0ed15181c10c755c0bd777f88b607c158 Signed-off-by: Siddhesh Poyarekar Reviewed-on: https://gem5-review.googlesource.com/8541 Reviewed-by: Giacomo Travaglini Maintainer: Giacomo Travaglini --- src/arch/arm/insts/pred_inst.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/arch/arm/insts') diff --git a/src/arch/arm/insts/pred_inst.hh b/src/arch/arm/insts/pred_inst.hh index b4186c8e5..ce4d41bac 100644 --- a/src/arch/arm/insts/pred_inst.hh +++ b/src/arch/arm/insts/pred_inst.hh @@ -150,7 +150,7 @@ simd_modified_imm(bool op, uint8_t cmode, uint8_t data, bool &immValid, break; } } - // Fall through, immediate encoding is invalid. + M5_FALLTHROUGH; default: immValid = false; break; -- cgit v1.2.3