[PR87874] avoid const-wide-int subreg in LRA
commit198a0ce90f7f31eb196068569c1a27b188d642d7
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Nov 2018 06:25:30 +0000 (7 06:25 +0000)
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Nov 2018 06:25:30 +0000 (7 06:25 +0000)
treebaa2a3a8ccecccdcb8110541d7a9f419fc409709
parent60ff6a8a784e7a2f33fbfae293a10d00886e387a
[PR87874] avoid const-wide-int subreg in LRA

Just like CONST_INT, CONST_WIDE_INT is VOIDmode, so LRA might be
tempted to build a SUBREG to "convert" it to the wanted mode.  That's
no use.  Test for CONST_SCALAR_INT_P instead of CONST_INT_P so that we
skip the subreg creation for both.

for  gcc/ChangeLog

PR rtl-optimization/87874
* lra.c (lra_substitute_pseudo): Do not create a subreg for
const wide ints.

for  gcc/testsuite/ChangeLog

PR rtl-optimization/87874
* gcc.dg/pr87874.c: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@265860 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/lra.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr87874.c [new file with mode: 0644]