aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPaulo Matos <pmatos@broadcom.com>2013-11-30 11:13:07 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2013-11-30 11:13:07 +0000
commit67aca9dfae0e68af581a7e43332d49a9fdf498c5 (patch)
tree6bc23f98d78296461a08329d8739d6513cb9b8a6 /gcc
parent483b0aa49b3fc3f981f5bf33a88d100783ee2ed9 (diff)
downloadgcc-67aca9dfae0e68af581a7e43332d49a9fdf498c5.zip
gcc-67aca9dfae0e68af581a7e43332d49a9fdf498c5.tar.gz
gcc-67aca9dfae0e68af581a7e43332d49a9fdf498c5.tar.bz2
combine.c (reg_nonzero_bits_for_combine): Apply mask transformation as applied to nonzero_sign_valid when...
* 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. Co-Authored-By: Eric Botcazou <ebotcazou@adacore.com> From-SVN: r205550
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/combine.c9
2 files changed, 15 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3e11726..ca7b3e8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2013-11-30 Paulo Matos <pmatos@broadcom.com>
+ Eric Botcazou <ebotcazou@adacore.com>
+
+ * 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.
+
2013-11-30 Tobias Burnus <burnus@net-b.de>
PR sanitizer/59275
diff --git a/gcc/combine.c b/gcc/combine.c
index d685a7f..25cf273 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;
}