http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57328
--- Comment #8 from Bud Davis <bdavis at gcc dot gnu.org> --- The compiler generates code for min and max that checks if an argument is NaN. (floating point numbers only, of course). This is different than the example you posted, as it would not give the correct answer when an argument is NaN.