https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78977
--- Comment #3 from h2+bugs at fsfe dot org --- (In reply to Jakub Jelinek from comment #1) > You haven't provided a self-contained test, so it is hard to know exactly, > but I bet it is the -fprintf-return-value optimization. Try > -fno-printf-return-value if it helps, Yes, that "fixes" it. > if it does, then we really need self-contained small test. Like I said, it doesn't happen on all the time and I have had difficulties extracting it. I could make something smaller than our whole repo, but it would likely still be quite a lot of code. Or is there some way I can make GCC dump an intermediate version of all the code that it actually uses for building the binary? > Perhaps FreeBSD libc snprintf prints %g differently from what GCC expects, > rounds it differently etc. Hm, could be. Note that FreeBSD still has some brokenness in the lib that mandates using -D_GLIBCXX_USE_C99=1 if you want C99 (which is required for c++11). But I thought this was only related to lacking precision in the math library. (In reply to Martin Sebor from comment #2) > It's possible that this bug will be fixed by my patch for bug 78696. The > patch was approved just before the holidays but I am yet to commit it. Let > me retest it and check it in today. Great, let me know if it's merged, then I will try a newer snapshot!