summaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-30 11:13:07 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-30 11:13:07 +0000
commit8487161bceef3cc7dcb4e3f89f7f1e1de621b6c9 (patch)
tree6bc23f98d78296461a08329d8739d6513cb9b8a6 /gcc/combine.c
parent54f1cbe958be3f49702d69ca3b5eee77ed16f0c0 (diff)
downloadgcc-8487161bceef3cc7dcb4e3f89f7f1e1de621b6c9.tar.gz
* combine.c (reg_nonzero_bits_for_combine): Apply mask transformation
as applied to nonzero_sign_valid when last_set_mode has less precision than mode. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205550 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index d685a7f6a66..25cf273f808 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -9472,7 +9472,13 @@ reg_nonzero_bits_for_combine (const_rtx x, enum machine_mode mode,
(DF_LR_IN (ENTRY_BLOCK_PTR_FOR_FN (cfun)->next_bb),
REGNO (x)))))
{
- *nonzero &= rsp->last_set_nonzero_bits;
+ unsigned HOST_WIDE_INT mask = rsp->last_set_nonzero_bits;
+
+ if (GET_MODE_PRECISION (rsp->last_set_mode) < GET_MODE_PRECISION (mode))
+ /* We don't know anything about the upper bits. */
+ mask |= GET_MODE_MASK (mode) ^ GET_MODE_MASK (rsp->last_set_mode);
+
+ *nonzero &= mask;
return NULL;
}
@@ -9505,6 +9511,7 @@ reg_nonzero_bits_for_combine (const_rtx x, enum machine_mode mode,
if (GET_MODE_PRECISION (GET_MODE (x)) < GET_MODE_PRECISION (mode))
/* We don't know anything about the upper bits. */
mask |= GET_MODE_MASK (mode) ^ GET_MODE_MASK (GET_MODE (x));
+
*nonzero &= mask;
}