From: Tom de Vries Date: Mon, 19 Nov 2012 09:35:48 +0000 (+0000) Subject: re PR rtl-optimization/55315 (comparing address to constant is folded in cse) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bc2164e876329706b17f646bcc2860100a569006;p=gcc.git re PR rtl-optimization/55315 (comparing address to constant is folded in cse) 2012-11-19 Tom de Vries PR rtl-optimization/55315 * rtlanal.c (nonzero_address_p): Don't assume a nonzero address plus a const is a nonzero address. From-SVN: r193616 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0efb46c2f80..e7c797ce231 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2012-11-19 Tom de Vries + + PR rtl-optimization/55315 + + * rtlanal.c (nonzero_address_p): Don't assume a nonzero address plus a + const is a nonzero address. + 2012-11-18 Sandra Loosemore * doc/extend.texi: Use @smallexample consistently. Add @noindent diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index 33be5487386..ecfae4ce9d5 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -392,10 +392,8 @@ nonzero_address_p (const_rtx x) return nonzero_address_p (XEXP (x, 0)); case PLUS: - if (CONST_INT_P (XEXP (x, 1))) - return nonzero_address_p (XEXP (x, 0)); /* Handle PIC references. */ - else if (XEXP (x, 0) == pic_offset_table_rtx + if (XEXP (x, 0) == pic_offset_table_rtx && CONSTANT_P (XEXP (x, 1))) return true; return false;