News for hackers. Stuff that matters.
Re:Workaround Clang v15 AArch64 miscompile that affects para... by benmmurphy on Monday October 21, 2024 @06:12PM (#41909088)
i tried reproducing the zipped example on macOS 14.4.1 (23E224) and Apple clang version 15.0.0 (clang-1500.3.9.4) and it looks like the issue is not present on that version.

here are the instructions marked with '<<<<' from `disassem.txt` and my version:

    0x1000026a8 <+3300>: adrp   x14, 6152a                ; <<<<<< address used for `in_parallel_sweepers`?
      1000026a8: 9000c04e     adrp x14, 0x10180a000 <_tgc+0x6c8>

    0x100002bb8 <+4596>: ldr    w22, [x14]               ; <<<<<< load for `in_par` value, offset missing?
      100002bb8: b94961d6     ldr     w22, [x14, #2400]

    0x100002c60 <+4764>: cbnz   w22, 0x100002bec          ; <+4648> at gc.c:264:34  <<<<<<< branch on `in_par` value?
      100002c60: 35fffc76     cbnz    w22, 0x100002bec <_sweep_thread+0x1228>

    0x100002c64 <+4768>: ldr    w11, [x14, #0x960]        ;                         <<<<<<< addition ot `in_parallel_sweepers`, has offset
      100002c64: b94961cb     ldr     w11, [x14, #2400]
on my version it uses the offset for the first load #2400 = #0x960. so i guess it must have been fixed somewhere between `clang-1500.0.40.1` and `clang-1500.3.9.4`. but that is an insane bug. also, `sweep_thread` seems to have the exact same number of instructions under both versions of clang and i'm guessing the only difference is this offset which is kind of wild.
Re:Workaround Clang v15 AArch64 miscompile that affects para... by jshier on Monday October 21, 2024 @10:32PM (#41910640)
Apple clang versions don't coincide with public clang versions. Apple clang's major versions follow Xcode's. For instance, Xcode 16.1's clang is 16.0.0 (clang-1600.0.26.4).