From: gjl Date: Fri, 29 Jul 2016 12:34:21 +0000 (+0000) Subject: gcc/ X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3addff4cd86c9801cf89d5c0e3ef2838732d991c;p=thirdparty%2Fgcc.git gcc/ PR rtl-optimization/71976 * combine.c (get_last_value): Return 0 if the argument for which the function is called has a wider mode than the recorded value. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@238863 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 04cf940e7c47..a1822d93c8fa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-07-29 Segher Boessenkool + Georg-Johann Lay + + PR rtl-optimization/71976 + * combine.c (get_last_value): Return 0 if the argument for which + the function is called has a wider mode than the recorded value. + 2016-07-29 Marek Polacek PR c/7652 diff --git a/gcc/combine.c b/gcc/combine.c index 93c17109cc2a..b687867652fc 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -13210,6 +13210,12 @@ get_last_value (const_rtx x) && DF_INSN_LUID (rsp->last_set) >= subst_low_luid) return 0; + /* If fewer bits were set than what we are asked for now, we cannot use + the value. */ + if (GET_MODE_PRECISION (rsp->last_set_mode) + < GET_MODE_PRECISION (GET_MODE (x))) + return 0; + /* If the value has all its registers valid, return it. */ if (get_last_value_validate (&value, rsp->last_set, rsp->last_set_label, 0)) return value;