Being in the middle of determining whether more assembly blocks than the two I already found are broken in the Firefox code base, Iād like to note how much of a massive footgun input, output and clobber definitions are, when they could be derived from the assembly itself. This was not possible in the old GCC model where a C file is preprocessed, then compiled into assembly, and then translated by an assembler into machine code, but in the LLVM model, where the LLVM framework contains the assembler, this could be treated differently. It is a bummer that clang doesnāt for GCC style assembly (at least not now; at the very minimum, I wish it had a warning about misplaced inputs/outputs, and missing clobbers), but it actually does for MSVC style assembly, which doesnāt come with inputs, outputs, and clobbers. Thereās a chunk of code in clang that parses the assembly, and generates inputs, outputs and clobbers from that.
You might say that people writing assembly should write their inputs, outputs and clobbers correctly, but the fact that I was able to find problems in two different third-party code bases used in Firefox, one of which is 8 years old, and that it went undetected for so long is telling. And it only causes problems when things align in a certain way. That is, those things that I found in Firefox⦠they just happen to have been fine so far, but enabling LTO made things go in unexpected ways. And where itās the most interesting is that it didnāt even break consistently on all platforms because things were not aligning the same way on all platforms. So, like, the last one Iām dealing with at the moment only happened in a visible way on mac, although it could very well happen on linux, but didnāt. Thatās why Iām doing a more systemic scan, now.