On Fri, Jan 03, 2014 at 10:44:21AM +0100, BELBACHIR Selim wrote: > When the standard pattern 'sqrtm2' is defined I don't understand why calls > to sqrt or __builtin_sqrt is always followed by a comparison of the result > with itself (checking the NaN ?) and a conditional branch to sqrt symbol > (so linking with libm is always mandatory).
Because -fmath-errno is the default and sqrt for negative value (including -Inf) is supposed to set errno. Use -ffast-math or -fno-math-errno if you don't need/want that. On some targets GCC is able to emit code to set errno directly, on others GCC just emits a call to the library function so that it handles errno properly. Jakub