NaNs are invalid values in Ada so the language doesn't specify how they should be handled but GNAT nevertheless attempts to implement sensible semantics for them. This patch extends this to the Min and Max attributes.
Tested on x86_64-suse-linux, applied on the mainline. 2014-12-22 Eric Botcazou <ebotca...@adacore.com> * gcc-interface/trans.c (Attribute_to_gnu) <Attr_{Min,Max}>: If the type is a floating-point type, implement the semantics of the C99 f{min,max} routines with regard to NaNs. (gnat_to_gnu): Call builtin_decl_implicit. * gcc-interface/utils2.c (compare_arrays): Adjust comments. 2014-12-22 Eric Botcazou <ebotca...@adacore.com> * gnat.dg/nan_max.adb: New test. -- Eric Botcazou