From 8d8e740c1cfb53908ad2a6af6ddbbae5c611c941 Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Thu, 4 Aug 2016 13:23:36 +0000 Subject: [PATCH] 016-08-04 Bernd Edlinger 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 --- gcc/ChangeLog | 5 +++++ gcc/emit-rtl.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6c41321c47a..551019e7f3c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2016-08-04 Bernd Edlinger + 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 055cee9e7a0..99f052d22d7 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 -- 2.30.2