Fixed with the following, committed. Incidentially this is the only constant folding pattern that also applies to floats - otherwise the use of the integer_* predicates prevent that.
Richard. 2014-08-06 Richard Biener <rguent...@suse.de> * match-constant-folding.pd (minus @0 @0): Restrict to modes without NaNs. Index: gcc/match-constant-folding.pd =================================================================== --- gcc/match-constant-folding.pd (revision 213651) +++ gcc/match-constant-folding.pd (working copy) @@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. (simplify (minus @0 @0) + (if (!HONOR_NANS (TYPE_MODE (type)))) { build_zero_cst (type); }) (simplify