now that the apply_distributive_law change is in, I'd like to pick up
Richard's original patch, see discussion here:
The version below integrates all requests for changes that were raised.
It's been part of Linaro GCC releases in this form for a while with no
problem reported. We see performance improvements in several libav loops,
as described in Richard's original mail. We've seen no test case so far
where this patch (against current baseline) has shown any significant
Re-tested on arm-linux-gnueabi and i386-linux-gnu with no regressions.
OK for mainline?
* fwprop.c (propagate_rtx): Also set PR_CAN_APPEAR for subregs.
=== modified file 'gcc/fwprop.c'
--- gcc/fwprop.c 2011-12-19 22:05:28 +0000
+++ gcc/fwprop.c 2012-02-22 11:57:19 +0000
@@ -664,7 +664,12 @@
flags = 0;
- if (REG_P (new_rtx) || CONSTANT_P (new_rtx))
+ if (REG_P (new_rtx)
+ || CONSTANT_P (new_rtx)
+ || (GET_CODE (new_rtx) == SUBREG
+ && REG_P (SUBREG_REG (new_rtx))
+ && (GET_MODE_SIZE (mode)
+ <= GET_MODE_SIZE (GET_MODE (SUBREG_REG (new_rtx))))))
flags |= PR_CAN_APPEAR;
if (!for_each_rtx (&new_rtx, varying_mem_p, NULL))
flags |= PR_HANDLE_MEM;
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE