uweigand wrote:

> The clang patch was written the way it was because it was necessary to comply 
> with the ABI rules. Strings passed to printf don't have any sort of alignment 
> requirement, so you can't really appeal to the ABI rules here, I think?

Just to be clear, the ABI requirement is that every symbol has to be at least 
2-byte aligned.  The problem is not passing the address of the string to 
printf, the problem is loading that address into a register in the first place. 
 The most efficient way to load an address uses a PC-relative load address 
instruction, and this requires that the target symbol is 2-byte aligned.


https://github.com/llvm/llvm-project/pull/142346
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to