I've found compiler bugs before, but this is the first compiler-compiler bug I've ever seen – incredible stuff:

https://issues.chromium.org/issues/336399264

Chromium

@dougall Also perhaps noteworthy: the commit that fixes it is a revert of a revert...of a revert. (Hello, semantic satiation.)

And further, the commit hashes of second and third commits in that chain of reverts (the most recent two) just so happen to have fourteen prefix bits in common, throwing off my mental tracking of which was which via the first three hex digits when trying to count how many reversions had actually happened.

@dougall after reading through all that I can see why it might not fall under their VRP, but my *goodness* it's hard not to wish they'd throw the initial reporter a few bucks for the effort and persistence to find something that turned out so *weird*
@rf Yeah, I'd argue that this finding is more valuable/notable from a security perspective than many that do get rewarded, but I'm glad I don't have to make those decisions.
@dougall @rf Should be tossing some cash to Florian for gifting us this beautiful bug to begin with, IMO. Art.
@dougall wow, what an amazing read. pretty impressive how they managed to track the cause down eventually
@dougall I once ran into an issue with a Lua script printing incorrect output. This turned out to be a GCC bug, resulting in a miscompile of the Lua bytecode compiler.
@neocturne @dougall I once had QtQuick having very weird behavior on a Raspberry Pi, and it took me days and the smart people on the LLVM IRC channel to figure out it was a bug in LLVM ARMv7 codegen, miscompiling the QML interpreter.
@dougall So I guess in the future the best compiler packages will come with a Certified Pedigree document, listing all compilers that were used to compile their lineage, back to the first assembler particles that were created during the Big Bang.
@ollibaba @dougall Isn't it what the Go team does?
https://go.dev/blog/rebuild
Perfectly Reproducible, Verified Go Toolchains - The Go Programming Language

Go 1.21 is the first perfectly reproducible Go toolchain.

@dougall It's always heartwarming to find bug threads like this: "I love this bug so much."
@dougall From comment #90:
« So the exercise isn't finding out why we get bad codegen for repro.cc but instead why we get bad codegen for Clang. »
@dougall I've always suspected that something like this might exist but it's really cool (and kind-of frightening..) to see in practice. oh man