[PATCH][PR target/94542]Don't allow PC-relative addressing for TLS data

acsawdey acsawdey@linux.ibm.com
Fri Apr 10 23:00:45 GMT 2020


One of the things that address_to_insn_form() is used for is determining 
whether a PC-relative addressing instruction could be used. In 
particular predicate pcrel_external_address and function 
prefixed_paddi_p() both use it for this purpose. So what emerged in 
PR/94542 is that it should be looking to see if the associated 
symbol_ref is a TLS symbol of some kind. TLS symbols cannot be addressed 
with PC-relative. This patch fixes both places in address_to_insn_form() 
where it is looking at a symbol_ref.

Regression tests passed with trunk 
38e62001c576b8c6ba2e08eb4673d69ec4c5b0f9 on ppc64le power9, and 
PC-relative code is now correct. OK for trunk?

Thanks!
    Aaron

2020-04-10  Aaron Sawdey  <acsawdey@linux.ibm.com>

	PR target/94542
	* config/rs6000/rs6000.c (address_to_insn_form): Do not attempt to
	use PC-relative addressing for TLS references.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr94542.patch
Type: text/x-diff
Size: 1845 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200410/bfe4b5b7/attachment.bin>


More information about the Gcc-patches mailing list