Hi, When Naveen committed the following patch: 2017-06-29 Naveen H.S <naveen.hurugalaw...@cavium.com>
* config/aarch64/aarch64.c (aarch_macro_fusion_pair_p): Push the check for CC usage into AARCH64_FUSE_CMP_BRANCH. * config/i386/i386.c (ix86_macro_fusion_pair_p): Push the check for CC usage from generic code to here. * sched-deps.c (sched_macro_fuse_insns): Move the condition for CC usage into the target macros. He made a small mistake and accessed prev before checking it was NULL in the AARCH64_FUSE_CMP_BRANCH case. This patch fixes the problem. Committed to both the trunk and the GCC 8 branch. Thanks, Andrew Pinski ChangeLog: 2018-09-24 Andrew Pinski <apin...@marvell.com> * 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.
Index: config/aarch64/aarch64.c =================================================================== --- config/aarch64/aarch64.c (revision 264547) +++ config/aarch64/aarch64.c (working copy) @@ -16510,8 +16510,6 @@ aarch_macro_fusion_pair_p (rtx_insn *pre 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 *pre && 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