diff options
author | Segher Boessenkool <segher@kernel.crashing.org> | 2018-06-19 12:52:39 +0200 |
---|---|---|
committer | Segher Boessenkool <segher@gcc.gnu.org> | 2018-06-19 12:52:39 +0200 |
commit | 6b3a917093b98258a1a23dd1839be76bd4051065 (patch) | |
tree | 0cba56082f3d32d179a5733fb852ade0d908694f | |
parent | 7f1387e0f270d42df03d33c41e4bdac8d1491cdb (diff) | |
download | gcc-6b3a917093b98258a1a23dd1839be76bd4051065.zip gcc-6b3a917093b98258a1a23dd1839be76bd4051065.tar.gz gcc-6b3a917093b98258a1a23dd1839be76bd4051065.tar.bz2 |
rs6000: Fix vector homogeneous aggregates (PR86197)
The existing code allows only 4 vectors worth of ieee128 homogeneous
aggregates, but it should be 8. This happens because at one spot it
is mistakenly qualified as being passed in floating point registers.
PR target/86197
* config/rs6000/rs6000.md (rs6000_discover_homogeneous_aggregate): An
ieee128 argument takes up only one (vector) register, not two (floating
point) registers.
From-SVN: r261738
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3d3707d..f580b4e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-06-19 Segher Boessenkool <segher@kernel.crashing.org> + + PR target/86197 + * config/rs6000/rs6000.md (rs6000_discover_homogeneous_aggregate): An + ieee128 argument takes up only one (vector) register, not two (floating + point) registers. + 2018-06-19 Eric Botcazou <ebotcazou@adacore.com> * gimplify.c (gimplify_init_constructor): Really never clear for an diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 31c5bcf..11ef766 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -10887,12 +10887,12 @@ rs6000_discover_homogeneous_aggregate (machine_mode mode, const_tree type, if (field_count > 0) { - int n_regs = (SCALAR_FLOAT_MODE_P (field_mode) ? - (GET_MODE_SIZE (field_mode) + 7) >> 3 : 1); + int reg_size = ALTIVEC_OR_VSX_VECTOR_MODE (field_mode) ? 16 : 8; + int field_size = ROUND_UP (GET_MODE_SIZE (field_mode), reg_size); /* The ELFv2 ABI allows homogeneous aggregates to occupy up to AGGR_ARG_NUM_REG registers. */ - if (field_count * n_regs <= AGGR_ARG_NUM_REG) + if (field_count * field_size <= AGGR_ARG_NUM_REG * reg_size) { if (elt_mode) *elt_mode = field_mode; |