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: Sylvain Pion <Sylvain dot Pion at mpi-sb dot mpg dot de>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Roger Sayle <roger at eyesopen dot com>, Sylvain Pion <Sylvain dot Pion at mpi-sb dot mpg dot de>
- Date: Mon, 11 Aug 2003 19:24:55 +0200
- Subject: Re: [PATCH] Negation related constant folding improvements
Roger,
> Then having made heavy use of negate_expr_p and negate, I thought
> it best to add support optimizing negation of multiplications and
> divisions. These operations may be efficiently negated by negating
> either of their operands, so -(X*C) is conveniently implemented as
> X*(-C) for a constant value, C. Similarly, -(X/C) is X/(-C) and
> -(C/X) is (-C)/X.
I believe this part is not correct for IEEE arithmetic, if you consider
rounding modes towards some infinity.
I don't have the impression that your patch checks for this, but
at least the explanation doesn't mention this.
Can you double check ?
--
Sylvain