Re: -funsafe-math-optimizations effect on linking mkl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 05, 2025 at 11:29:27PM +0200, Marc Glisse via Gcc-help wrote:
> On Thu, 5 Jun 2025, Nicola Giuliani via Gcc-help wrote:
> 
> >What do you think of this particular problem? Does it make any sense to
> >you? Can you tell me how to recover the same behavior at linking time
> >without turning on the unsafe math optimizations?
> 
> To understand what is going on, add -v to the compile line. This will show 
> you how the linker (possibly called collect2 or ld) is invoked. Do it once 
> with -funsafe-math-optimizations and once without. Look at the diff. 
> Notice the addition of crtfastmath.o.
> (if motivated, look at the source 
> https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=libgcc/config/i386/crtfastmath.c;hb=HEAD 
> )

The -ffast-math stuff is needed, because this compiler behaviour is
simply incorrect without that: by default we want the compiler to
generate code that does follow all relevant standards!


Segher



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux