mastodon.gamedev.place is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mastodon server focused on game development and related topics.

Server stats:

5.3K
active users

Sometimes it takes more time to refute a `gcc` bug than confirm it. This week I spent most time on gcc.gnu.org/PR114872 where `sagemath` `SIGSEGV`ed on some simple inputs.

Bug updates are a bit hard to read and are missing a bit of compiler-unrelated context. I wrote something more coherent in trofi.github.io/posts/312-the-

gcc.gnu.org114872 – [13/14/15 Regression] Miscompilation with -O2 after commit r13-8037

@trofi Sad fact: we unsuccessfully attempted to upstream a GCC patch that would warn about this. The idea was exactly that you can get a warning *before* upgrading the compiler breaks the code. Our current iteration of that patch produces 142 warnings on that testcase from the GCC Bugzilla.

@amonakov Oh, that's unfortunate :(

Out of idle curiosity: did your change analyze the program before or after `gcc` optimization passes (or both?) when detecting such rule violations?

I wonder if `gcc` could introduce problematic variable clobbers (like stack reuse) where there are none at the source level and whether you ever saw anything like that. It feels like `gcc` could break programs this way, but I did not try to construct the example.

@trofi re first question: in the middle :)

re the second: if I understand the question correctly, that would be a compiler bug, and so far I've seen that just once (the bug being marked a dup is somewhat incorrect but I was tired of arguing): gcc.gnu.org/bugzilla/show_bug.

gcc.gnu.org108117 – Wrong instruction scheduling on value coming from abnormal SSA
Alexander Monakov

@trofi by the way, the existing -Wclobbered warning already produces 73 warnings for that testcase in gcc-13 (the existing warning detects a subset of violations, but tends to report cases where the compiler did, in fact, likely break the code)