aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2016-08-04 13:23:36 +0000
committerBernd Edlinger <edlinger@gcc.gnu.org>2016-08-04 13:23:36 +0000
commit8d8e740c1cfb53908ad2a6af6ddbbae5c611c941 (patch)
tree373b21aed6744d1186c6db90a6e983e157047698 /gcc
parent086ad22e0e7bbff4329d0dcbdc1b4be04ba4a868 (diff)
downloadgcc-8d8e740c1cfb53908ad2a6af6ddbbae5c611c941.zip
gcc-8d8e740c1cfb53908ad2a6af6ddbbae5c611c941.tar.gz
gcc-8d8e740c1cfb53908ad2a6af6ddbbae5c611c941.tar.bz2
016-08-04 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR rtl-optimization/71779 * emit-rtl.c (set_reg_attrs_from_value): Only propagate REG_POINTER, if the value was sign-extended according to POINTERS_EXTEND_UNSIGNED or if it was truncated. From-SVN: r239123
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/emit-rtl.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6c41321..551019e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2016-08-04 Bernd Edlinger <bernd.edlinger@hotmail.de>
+ PR rtl-optimization/71779
+ * emit-rtl.c (set_reg_attrs_from_value): Only propagate REG_POINTER,
+ if the value was sign-extended according to POINTERS_EXTEND_UNSIGNED
+ or if it was truncated.
+
PR rtl-optimization/70903
* cse.c (cse_insn): If DEST is a paradoxical SUBREG, don't record DEST.
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 055cee9..99f052d 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -1156,7 +1156,11 @@ set_reg_attrs_from_value (rtx reg, rtx x)
{
#if defined(POINTERS_EXTEND_UNSIGNED)
if (((GET_CODE (x) == SIGN_EXTEND && POINTERS_EXTEND_UNSIGNED)
- || (GET_CODE (x) != SIGN_EXTEND && ! POINTERS_EXTEND_UNSIGNED))
+ || (GET_CODE (x) == ZERO_EXTEND && ! POINTERS_EXTEND_UNSIGNED)
+ || (paradoxical_subreg_p (x)
+ && ! (SUBREG_PROMOTED_VAR_P (x)
+ && SUBREG_CHECK_PROMOTED_SIGN (x,
+ POINTERS_EXTEND_UNSIGNED))))
&& !targetm.have_ptr_extend ())
can_be_reg_pointer = false;
#endif