https://bugs.winehq.org/show_bug.cgi?id=38470
--- Comment #16 from MY123 mmediouni@gmx.fr --- (In reply to André H. from comment #15)
(In reply to MY123 from comment #14)
There is a separate issue with LLVM -mcode-model=large because that also uses r12 for __chkstk calls, but that bug is not triggered by MSVC or the normal LLVM code model.
No, no problem. AJ optimized your code, and it doesn't use r12/ip anymore: https://source.winehq.org/git/wine.git/commitdiff/ 2b095beace7b457586bd33b3b1c81df116215193
With you original version there wouldn't have been an issue either, you modified r12 in the function, llvm modifies r12 to call the function and can't expect it to be unchanged afterwards as it's a scratch register
There is an issue with my patch because LLVM -mcode-model=large emits that:
movw r4, #constant movw r12, :lower16:__chkstk movt r12, :upper16:__chkstk blx r12 sub.w sp, sp, r4
AJ fixed it with the use of lsl :-)