From f8a27206853f8c0ed76feed9bbf77d1c598242c7 Mon Sep 17 00:00:00 2001 From: Andrew Pinski Date: Tue, 25 Sep 2018 00:12:18 +0000 Subject: [PATCH] aarch64.c (aarch_macro_fusion_pair_p): Don't access prev before checking it for NULLness in the... 2018-09-24 Andrew Pinski * config/aarch64/aarch64.c (aarch_macro_fusion_pair_p): Don't access prev before checking it for NULLness in the AARCH64_FUSE_CMP_BRANCH case. From-SVN: r264548 --- gcc/ChangeLog | 6 ++++++ gcc/config/aarch64/aarch64.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b3d14b95530..8011490e00c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-09-24 Andrew Pinski + + * config/aarch64/aarch64.c (aarch_macro_fusion_pair_p): Don't + access prev before checking it for NULLness in the + AARCH64_FUSE_CMP_BRANCH case. + 2018-09-24 H.J. Lu PR target/82699 diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 9c68025e1f1..12f7dfe9a75 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -16510,8 +16510,6 @@ aarch_macro_fusion_pair_p (rtx_insn *prev, rtx_insn *curr) if (aarch64_fusion_enabled_p (AARCH64_FUSE_CMP_BRANCH) && any_condjump_p (curr)) { - enum attr_type prev_type = get_attr_type (prev); - unsigned int condreg1, condreg2; rtx cc_reg_1; aarch64_fixed_condition_code_regs (&condreg1, &condreg2); @@ -16521,6 +16519,8 @@ aarch_macro_fusion_pair_p (rtx_insn *prev, rtx_insn *curr) && prev && modified_in_p (cc_reg_1, prev)) { + enum attr_type prev_type = get_attr_type (prev); + /* FIXME: this misses some which is considered simple arthematic instructions for ThunderX. Simple shifts are missed here. */ if (prev_type == TYPE_ALUS_SREG -- 2.30.2