Post B31FOb2oKmUVmGGGpc by pervognsen@mastodon.social
 (DIR) More posts by pervognsen@mastodon.social
 (DIR) Post #B31FOVayaqFssUCTFg by pervognsen@mastodon.social
       2026-02-05T10:14:04Z
       
       0 likes, 0 repeats
       
       Weird FUD by Phoronix about LTO builds since Mesa is apparently turning off their LTO builds due to "impossible to reproduce bugs that only happen in LTO builds". I'd like to get other people's take, but I'm assuming what's actually happening is that like with -O1 vs -O3, optimizing across translation units is exposing latent UB bugs (or much less likely, latent compiler bugs not directly related to LTO), and it's not that the LTO pass itself is buggy.
       
 (DIR) Post #B31FOb1kOjdlixlQAq by pervognsen@mastodon.social
       2026-02-05T10:15:23Z
       
       0 likes, 0 repeats
       
       Incidentally, this has always been one of the socio-technical problems I've had with LTO in large C and C++ code bases. All the scariest bugs in code bases for those languages are UB-related and might only show up at higher optimization levels. And because of slow build times, most devs understandably don't want to do all their local rebuilds at -O3, never mind -O3 plus LTO (even thin LTO), so you're not actually iterating and dogfooding the thing you're shipping if you ship LTO.
       
 (DIR) Post #B31FOb2oKmUVmGGGpc by pervognsen@mastodon.social
       2026-02-05T12:11:40Z
       
       0 likes, 0 repeats
       
       With the right adjustment in your mindset, any time you find that a bug with your code only materializes with different compilers or compiler versions or optimization flags, you're given a gift that lets you root out UB bugs in your code. Or, much more rarely, you get to root out compiler bugs, which is less fun. But having been in the situation of trying to ship things with latent UB like this, I understand the frustration. So don't ship LTO for now, but you (probably) still have serious bugs.
       
 (DIR) Post #B31FOfdpF6Ta2Dbt56 by pervognsen@mastodon.social
       2026-02-05T12:16:23Z
       
       0 likes, 0 repeats
       
       If you're a real psychopath you can try to fuzz your code for UB by compiling and auto-testing it with many different permutations of compilers and compiler configurations like that.