2007-10-07 Pranav Bhandarkar <pranav.bhandarkar@celunite.com>
* fold-const.c (fold_comparison): fold (a OP c) CMP (b OP c) -> a
CMP b, iff c is not zero
* testsuite/pr31098.c: New
+ /* (a OP c) CMP (b OP c) -> a CMP b, iff c is not zero */
+ if (fast_math_flags_set_p () && (TREE_CODE (arg0) == TREE_CODE (arg1))
Do we really need all "fast math" flags set to enable this opt? E.g.
surely we don't care about !flag_signed_zeros since you disable the code
when "c" is zero. Perhaps other sub-bits of "fast math" can also be
ignored for this purpose.