http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57066
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Known to work| |4.1.3 Keywords| |wrong-code Last reconfirmed| |2013-04-25 Ever Confirmed|0 |1 Summary|std::logb(-inf) returns |[4.7/4.8/4.9 Regression] |wrong value |std::logb(-inf) returns | |wrong value Target Milestone|--- |4.7.4 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> 2013-04-25 08:05:04 UTC --- /* Fold a call to builtin logb/ilogb. */ static tree fold_builtin_logb (location_t loc, tree arg, tree rettype) { ... switch (value->cl) { case rvc_nan: case rvc_inf: /* If arg is Inf or NaN and we're logb, return it. */ if (TREE_CODE (rettype) == REAL_TYPE) return fold_convert_loc (loc, rettype, arg); is wrong for -inf. Folding introduced in 2007 thus a regression.