[PATCH, middle-end]: Prevent invalid transformations for modes with signed zeros.
Uros Bizjak
ubizjak@gmail.com
Tue Mar 4 12:20:00 GMT 2008
Hello!
Current gcc transforms "x >= 0.0 ? x : -x" into fabs(), which is wrong
for modes with signed zeros [when x equals -0.0, this code returns
-0.0, where fabs() returns 0.0]. Attached patch fixes a couple of
places where this wrong transformation is performed, including
transforms to ABS_EXPR, MAX_EXPR and MIN_EXPR.
2008-03-04 Uros Bizjak <ubizjak@gmail.com>
PR middle-end/35456
* fold-const.c (fold_cond_expr_with_comparison): Prevent
transformations for modes that have signed zeros.
* ifcvt.c (noce_try_abs): Ditto.
2008-03-04 Uros Bizjak <ubizjak@gmail.com>
PR middle-end/35456
* gcc.c-torture/execute/pr35456.c: New test.
Patch was bootstrapped and regression tested on i686-pc-linux-gnu. OK
for mainline?
Uros.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: p.diff.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080304/77f42b78/attachment.txt>
More information about the Gcc-patches
mailing list