joeylib2/installer/patches/amigaGcc/README.md

14 lines
1.2 KiB
Markdown

# m68k-amigaos-gcc 6.5 patches
install.sh (component `amigaGcc`) applies these to the pinned `gcc`
sub-project (`projects/gcc`) in filename order before it builds the
toolchain.
| Patch | What it fixes | Needed by |
|---|---|---|
| 0001-bbb-moveq-mask | A miscompile in Bebbo's post-pass optimizer (`gcc/bbb-opts.c`, on by default at `-O2`). The backend loads a data register's word or byte constant in -128..127 with `moveq`, which writes all 32 bits, sign-extended; the optimizer's register tracker took it for a word or byte write and kept the upper word's old "known clear" mask. After a negative one (a `moveq #-1,dN` for a compare with 0xFFFF, say), its `(e0)` step then deleted a later zero-extension's `moveq #0,dN` before `move.w x,dN` as superfluous, so a 16-bit offset carried 0xFFFF in its upper word into a 32-bit pointer add. It struck `jlSpriteRestoreUnder`'s fused stage restore, which wrote 64 KB below the planes once a neighbouring inline asm call changed the register allocation. Upstream (`amiga6.5`, 2026-09-26) has the same code. | every Amiga build |
## License
The patch modifies GCC and contains its code, so it is under GCC's license,
the GNU GPL v3 or later, not JoeyLib's MIT License.