aboutsummaryrefslogtreecommitdiff
path: root/gcc/cse.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2015-04-15 06:24:28 -0600
committerJeff Law <law@gcc.gnu.org>2015-04-15 06:24:28 -0600
commit5141ed426365a752343b2a8961d7b578f255b769 (patch)
tree1d0879dbbab7c2c5b15c92110904392c69270b07 /gcc/cse.c
parent366ee94b445fd959c7947e45d2cb9a2a4a0b4509 (diff)
downloadgcc-5141ed426365a752343b2a8961d7b578f255b769.zip
gcc-5141ed426365a752343b2a8961d7b578f255b769.tar.gz
gcc-5141ed426365a752343b2a8961d7b578f255b769.tar.bz2
re PR rtl-optimization/42522 ((zero_extract:SI (mem:QI) ...) misoptimized)
PR rtl-optimization/42522 * cse.c (fold_rtx): Try to simplify a ZERO_EXTRACT or SIGN_EXTRACT as a whole object rather than simplifying its operand. From-SVN: r222125
Diffstat (limited to 'gcc/cse.c')
-rw-r--r--gcc/cse.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index 2a33827..d7638f0 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -3150,6 +3150,15 @@ fold_rtx (rtx x, rtx_insn *insn)
{
case MEM:
case SUBREG:
+ /* The first operand of a SIGN/ZERO_EXTRACT has a different meaning
+ than it would in other contexts. Basically its mode does not
+ signify the size of the object read. That information is carried
+ by size operand. If we happen to have a MEM of the appropriate
+ mode in our tables with a constant value we could simplify the
+ extraction incorrectly if we allowed substitution of that value
+ for the MEM. */
+ case ZERO_EXTRACT:
+ case SIGN_EXTRACT:
if ((new_rtx = equiv_constant (x)) != NULL_RTX)
return new_rtx;
return x;