On Thu, 2 Aug 2012, Richard Guenther wrote: > On Wed, Aug 1, 2012 at 9:21 PM, Marc Glisse wrote: >> Hello, >> >> an opinion on this? >> >> (I just noticed: I'll update the list in the comment visible at the top of >> the patch if this gets in). > > It looks ok to me but I am no floating-point expert. Can you add a testcase? > > Ok with that change. Here again with a testcase. The -O is not necessary for the optimization to happen, but it seemed wrong to me not to include it. I wondered about adding an explicit -ftrapping-math, for documentation purposes. I am redoing the bootstrap+regtest, then I'll commit if I don't hear protests about the testcase. gcc/ChangeLog 2012-06-15 Marc Glisse PR tree-optimization/53805 * fold-const.c (invert_tree_comparison): Do invert ORDERED_EXPR and UNORDERED_EXPR for floating point. gcc/testsuite/ChangeLog 2012-06-15 Marc Glisse PR tree-optimization/53805 * gcc.dg/fold-notunord.c: New testcase. -- Marc Glisse