rs6000: Wrap diff of immediates in const (PR83629)
commitd83367e980571b83a8ec6b4b38a01914e14ab8b3
authorsegher <segher@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Jan 2018 15:13:07 +0000 (10 15:13 +0000)
committersegher <segher@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Jan 2018 15:13:07 +0000 (10 15:13 +0000)
tree5f267bfaade3241d4a715ef843334ee0deba267d
parent72ce1a746920e6f4548dc22b4d6f3451cf6c81c0
rs6000: Wrap diff of immediates in const (PR83629)

In various of our 32-bit load_toc patterns we take the difference of
two immediates (labels) as a term to something bigger; but this isn't
canonical RTL, it needs to be wrapped in CONST.

PR target/83629
* config/rs6000/rs6000.md (load_toc_v4_PIC_2, load_toc_v4_PIC_3b,
load_toc_v4_PIC_3c): Wrap const term in CONST RTL.

testsuite/
PR target/83629
* gcc.target/powerpc/pr83629.c: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256432 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/rs6000/rs6000.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/pr83629.c [new file with mode: 0644]