Prevent invalid register mode changes in combine
authorRichard Sandiford <richard.sandiford@linaro.org>
Wed, 1 Nov 2017 08:54:22 +0000 (08:54 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Wed, 1 Nov 2017 08:54:22 +0000 (08:54 +0000)
commita9b76c8962410173ba0351b5b05b5f1f91742fc6
tree15cc0b6bcadb90da797eecab3ad626c487496ade
parent6e0cb45f0c11d30f03498039b2f650ead28658bd
Prevent invalid register mode changes in combine

This patch stops combine from changing the mode of an existing register
in-place if doing so would change the size of the underlying register
allocation size, as given by REGMODE_NATURAL_SIZE.  Without this,
many tests fail in adjust_reg_mode after SVE is added.  One example
is gcc.c-torture/compile/20090401-1.c.

2017-11-01  Richard Sandiford  <richard.sandiford@linaro.org>
    Alan Hayward  <alan.hayward@arm.com>
    David Sherwood  <david.sherwood@arm.com>

gcc/
* combine.c (can_change_dest_mode): Reject changes in
REGMODE_NATURAL_SIZE.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r254291
gcc/ChangeLog
gcc/combine.c