diff options
author | Jakub Jelinek <jakub@redhat.com> | 2021-04-13 09:41:20 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2021-04-13 09:41:20 +0200 |
commit | c0f772894b6b3cd8ed5c5dd09d0c7917f51cf70f (patch) | |
tree | f3c9b87a6f383fe48a8a5d70620442faab556002 /libcpp/identifiers.c | |
parent | c755e1b3eadaf1c7e751a2c7ce1d418c6db8463a (diff) | |
download | gcc-c0f772894b6b3cd8ed5c5dd09d0c7917f51cf70f.zip gcc-c0f772894b6b3cd8ed5c5dd09d0c7917f51cf70f.tar.gz gcc-c0f772894b6b3cd8ed5c5dd09d0c7917f51cf70f.tar.bz2 |
simplify-rtx: Punt on simplify_{,gen_}subreg to IBM double double if bits are lost [PR99648]
Similarly to PR95450 done on GIMPLE, this patch punts if we try to
simplify_{gen_,}subreg from some constant into the IBM double double
IFmode (or sometimes TFmode) if the double double format wouldn't preserve
the bits. Not all values are valid in IBM double double, e.g. the format
requires that the upper double is the whole value rounded to double, and
if in some cases such as in the pr71522.c testcase with -m32 -Os -mcpu=power7
some non-floating data is copied through long double variable, we can
simplify a subreg into something that has different value.
Fixed by punting if the planned simplify_immed_subreg result doesn't
encode to bitwise identical values compared to what we were decoding.
As for the simplify_gen_subreg change, I think it would be desirable
to just avoid creating SUBREGs of constants on all targets and for all
constants, if simplify_immed_subreg simplified, fine, otherwise punt,
but as we are late in GCC11 development, the patch instead guards this
behavior on MODE_COMPOSITE_P (outermode) - i.e. only conversions to
powerpc{,64,64le} double double long double - and only for the cases where
simplify_immed_subreg was called.
2021-04-13 Jakub Jelinek <jakub@redhat.com>
PR target/99648
* simplify-rtx.c (simplify_immed_subreg): For MODE_COMPOSITE_P
outermode, return NULL if the result doesn't encode back to the
original byte sequence.
(simplify_gen_subreg): Don't create SUBREGs from constants to
MODE_COMPOSITE_P outermode.
Diffstat (limited to 'libcpp/identifiers.c')
0 files changed, 0 insertions, 0 deletions