Hacker News new | ask | show | jobs
by leni536 732 days ago
-ffast-math affects other translation units too, because it introduces a global initialization that affects some CPU flags. You can't really contain it to a single TU.
1 comments

It seems like this depends on whether you specify -ffast-math when linking or only when compiling: https://stackoverflow.com/a/68938551

My understanding is that if you don't specify -ffast-math when linking then you shouldn't get crtfastmath.o linked in.

so this is complicated by the fact that GCC has a bug until last year where it would set the subnormal truncation flag when it wasn't supposed to.