sched-deps.c (sched_macro_fuse_insns): Check return value of targetm.fixed_condition_...
authorJoern Rennecke <joern.rennecke@embecosm.com>
Fri, 5 Apr 2019 15:01:01 +0000 (15:01 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Fri, 5 Apr 2019 15:01:01 +0000 (16:01 +0100)
        * sched-deps.c (sched_macro_fuse_insns): Check return value of
        targetm.fixed_condition_code_regs.

From-SVN: r270167

gcc/ChangeLog
gcc/sched-deps.c

index 53b58ef3df03e55acdfc14f6af187cfb74cc870b..f4075784288c212bcd5f853d715493488e518b47 100644 (file)
@@ -1,3 +1,8 @@
+2019-04-05  Joern Rennecke  <joern.rennecke@embecosm.com>
+
+       * sched-deps.c (sched_macro_fuse_insns): Check return value of
+       targetm.fixed_condition_code_regs.
+
 2019-04-05  Richard Biener  <rguenther@suse.de>
 
        PR debug/89892
index eda0c669771c35355e91efeaadab3cf0ac3fcfeb..28b9d38ab3f0e7001b77171184a6cee1ecc3ad5a 100644 (file)
@@ -2857,14 +2857,16 @@ sched_macro_fuse_insns (rtx_insn *insn)
     {
       unsigned int condreg1, condreg2;
       rtx cc_reg_1;
-      targetm.fixed_condition_code_regs (&condreg1, &condreg2);
-      cc_reg_1 = gen_rtx_REG (CCmode, condreg1);
-      if (reg_referenced_p (cc_reg_1, PATTERN (insn))
-         && modified_in_p (cc_reg_1, prev))
+      if (targetm.fixed_condition_code_regs (&condreg1, &condreg2))
        {
-         if (targetm.sched.macro_fusion_pair_p (prev, insn))
-           SCHED_GROUP_P (insn) = 1;
-         return;
+         cc_reg_1 = gen_rtx_REG (CCmode, condreg1);
+         if (reg_referenced_p (cc_reg_1, PATTERN (insn))
+             && modified_in_p (cc_reg_1, prev))
+           {
+             if (targetm.sched.macro_fusion_pair_p (prev, insn))
+               SCHED_GROUP_P (insn) = 1;
+             return;
+           }
        }
     }