On 2024-05-17 02:48, Bruno Haible wrote:
-flto was buggy for a long time. Is whole-program optimization working
fine for you? If so, which compiler version, binutils version, and
compiler options can you recommend?

No, I merely found that problem by program inspection. Like you, I've had problems with -flto.

The longer story is that my coreutils build was using GCC 14's new -Wmissing-variable-declarations behavior, which is a mistake for tests. While noticing the mistake I looked briefly at the complaints. This was an early test that -Wmissing-variable-declarations complained about and when I looked at the complaint I happened to notice the potential problem with whole-program optimization, something that has nothing to do with -Wmissing-variable-declarations.

In my weaker moments I sometimes think we should declare every test-case variable volatile, along the lines of the "volatile-by-default" approach for Java. See:

Liu L, Millstein T, Musuvathi M. Safe-by-default concurrency for modern programming languages. ACM TOPLAS. 2021;43(3):10. https://doi.org/10.1145/3462206

Reply via email to