On 11/30/2026 9:12 AM, Tim Rentsch wrote:
> a…@littlepinkcloud.invalid writes: > > [...] >
>> No pass within GCC (and probably any other compiler) may introduce >> undefined behaviour where there was none in the program. That is >> because a later pass might detect the introduced UB and miscompile >> it, or even drop it onto the floor altogether.
> > I understand what you're trying to say, but this isn't how to say > it. "Undefined behavior" is a circumstance that depends on > program source code and on the state of the abstract machine > during a putative execution. A compiler cannot "introduce > undefined behavior"; what it can do (but shouldn't) is transform > the program being compiled in a way that changes the semantics > required by the language being translated.
Yeah. Most of us would probably describe this as "a compiler bug" or similar. I did find one in BGBCC not too long ago, where DLL's were broken in the RISC-V and XG3 modes: Instead of doing the correct thing: Save GP; Load pointer from 0(GP) Load an address relative to this pointer into GP. ... Restore GP; Return It was doing: Save GP; AUIPC+ADDI to get the start of ".data" (within the PE image space); ... Which, works if compiling a one-off binary image, but does not match my ABI. So, it might seem to work in a narrow sense, but then fails dramatically in another. TODO: Update the posted version of TestKern again to include the relevant reloc for RV64G and XG3, as my PE loader had also been lacking this case. Though, I suspect this was more a case of the initial implementation for RISC-V support in BGBCC didn't really account for multi-instancing or DLLs (it wouldn't matter for a single-instanced EXE, matters a lot more for DLLs). Also TODO: Debate how to better handle this for plain RV64G in a way that allows for more than 256 DLLs; For XG3 and RV64G+Jx, the limit is drastically larger, but in the present implementation, for RV64G it sets a limit of 256. Though, the most likely option is to change it to a LUI+ADD+LD sequence if RV64G/RV64GC and not JX; with a Disp33 load being used if XG3 (or RV64+Jx). Can also note that my port of Quake 3 Arena has broken, but I had yet to go up the debugging treadmill here. Don't know if due to more compiler bugs or something else. So, it is like, the ISA itself is mostly stabilized it seems, but BGBCC and TestKern still have a lot of corner cases. There is still the theoretical question of if/how to eventually handle EXEs and DLLs being modified, but Windows seems to give clues. In older Windows, it was simply not allowed to change an EXE or DLL if it was still in use (it seems to still enforce this for EXEs, but was partly relaxed for DLLs). However, can note that for DLLs, it is seemingly necessary to close all programs using said DLL, before the OS will upgrade newly launched programs to the more recent version. This would appear to imply that the windows behavior is essentially to unload the EXE or DLL once no running program instances exist (and if a new program instance is created for an EXE or DLL that was still active, it will reuse the previously loaded version). Also the unload behavior seems to be "lazy", in that if the close, recompile, restart cycle happens too quickly, the program may still launch with a stale version of the EXE or DLL (sometimes a bit of an annoyance when debugging stuff). From the way it behave, I suspect it may be something like a 5 or 10 second timer delay between the time the program is clones, and the relevant PE images being unloaded. Well, say, vs more clever options, like if the OS's PE-loader allow multiple versions of a DLL to exist at the same time, or actively keeping track of the filesystem to know whether the previously loaded version is still the most recent version. ... Well, in the off chance anyone cares, wrote another fiction/sci-fi story: https://github.com/cr88192/bgbtech_fiction/blob/main/stories/2026-10-28_Bradley1.txt It is admittedly one I have more mixed feelings about, more heavily focused on world-building and psychology; very little action. partly it is based on stuff that had been beating around in my head for a while, but hadn't been written out in a story. Setting is mostly present day, but in different timelines that differ from our own (one that had technology like our own, but a much more strictly heteronormative culture; the other is more progressive, but went down a very different path regarding technology). I did implement something following the general structure of the VQ codec idea from the story, which became BTIC6A: https://github.com/cr88192/bgbtech_misc/blob/master/test_btic6a/2026-11-05_BTIC6A.txt Which basically worked, and while it doesn't exactly break any Q/bpp records, it is fast enough to do 2160p30 in a single-threaded plain-C decoder. It was also added to my BTIC1H2 codec driver as an option, requires editing a config file to select for encoding though (due to an annoyance of how VfW works, would either need to make a configuration dialog/tool, or create a separate codec DLL for each encoder to have them in the main codec list). Differs from the in-story version primarily in that it was implemented around Little-Endian, one can just sort of imagine the story version as being like BT6A but with the TLV endianess swapped, and the command tag-packing transposed (starts at MSB in story world). Say: 0iiiiiii 1001pppp-pppppppp Etc. I went with an LE design mostly because it would be more efficient on real-world targets. Even if not 1:1 for that imagined for the story setting (in effect, the version I implemented was more a "proof of concept" of the design). ...