This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Negation related constant folding improvements
- From: Richard Henderson <rth at redhat dot com>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 11 Aug 2003 15:12:13 -0700
- Subject: Re: [PATCH] Negation related constant folding improvements
- References: <Pine.LNX.4.44.0308102141040.8052-100000@www.eyesopen.com>
On Sun, Aug 10, 2003 at 10:04:31PM -0600, Roger Sayle wrote:
> case INTEGER_CST:
> - case REAL_CST:
> if (! TREE_UNSIGNED (type)
> && 0 != (tem = fold (build1 (NEGATE_EXPR, type, t)))
> && ! TREE_OVERFLOW (tem))
> return tem;
> break;
>
> + case REAL_CST:
> + return fold (build1 (NEGATE_EXPR, type, t));
This is correct only if the fp representation is sign+magnitude.
This is not true of the C4X format.
Rounding problem pointed out upthread.
r~