aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSegher Boessenkool <segher@kernel.crashing.org>2017-11-29 23:51:16 +0100
committerSegher Boessenkool <segher@gcc.gnu.org>2017-11-29 23:51:16 +0100
commit3d985316b89f2551a8fb39687bf4972b372ffdd7 (patch)
tree18c98170abdf7bfb6a805c7fba55b1797cfbd691 /gcc
parent4a01617886c1833f456948048e5167dac784ef19 (diff)
downloadgcc-3d985316b89f2551a8fb39687bf4972b372ffdd7.zip
gcc-3d985316b89f2551a8fb39687bf4972b372ffdd7.tar.gz
gcc-3d985316b89f2551a8fb39687bf4972b372ffdd7.tar.bz2
combine: Print to dump if some insn cannot be combined into i3
Eventually we should print the reason that any combination fails. This is a good start (these happen often). * combine.c (try_combine): Print a message to dump file whenever I0, I1, or I2 cannot be combined into I3. From-SVN: r255261
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/combine.c24
2 files changed, 23 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c13f67e..d1838f1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2017-11-29 Segher Boessenkool <segher@kernel.crashing.org>
+ * combine.c (try_combine): Print a message to dump file whenever
+ I0, I1, or I2 cannot be combined into I3.
+
+2017-11-29 Segher Boessenkool <segher@kernel.crashing.org>
+
PR rtl-optimization/83156
PR rtl-optimization/82621
* combine.c (try_combine): Don't split an I2 if one of the dests is
diff --git a/gcc/combine.c b/gcc/combine.c
index cfe24f4..863abd7 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -3035,13 +3035,25 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0,
SUBST (PATTERN (i2), XVECEXP (PATTERN (i2), 0, 1));
}
- /* Verify that I2 and I1 are valid for combining. */
- if (! can_combine_p (i2, i3, i0, i1, NULL, NULL, &i2dest, &i2src)
- || (i1 && ! can_combine_p (i1, i3, i0, NULL, i2, NULL,
- &i1dest, &i1src))
- || (i0 && ! can_combine_p (i0, i3, NULL, NULL, i1, i2,
- &i0dest, &i0src)))
+ /* Verify that I2 and maybe I1 and I0 can be combined into I3. */
+ if (!can_combine_p (i2, i3, i0, i1, NULL, NULL, &i2dest, &i2src))
{
+ if (dump_file)
+ fprintf (dump_file, "Can't combine i2 into i3\n");
+ undo_all ();
+ return 0;
+ }
+ if (i1 && !can_combine_p (i1, i3, i0, NULL, i2, NULL, &i1dest, &i1src))
+ {
+ if (dump_file)
+ fprintf (dump_file, "Can't combine i1 into i3\n");
+ undo_all ();
+ return 0;
+ }
+ if (i0 && !can_combine_p (i0, i3, NULL, NULL, i1, i2, &i0dest, &i0src))
+ {
+ if (dump_file)
+ fprintf (dump_file, "Can't combine i0 into i3\n");
undo_all ();
return 0;
}