From: Segher Boessenkool Date: Fri, 10 Aug 2018 20:46:04 +0000 (+0200) Subject: backport: re PR target/86197 (POWERPC: float128 parameter passing) X-Git-Tag: releases/gcc-6.5.0~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c63d458a39cb08bf8e2cc60d9fe3ffc8bfec8c0;p=thirdparty%2Fgcc.git backport: re PR target/86197 (POWERPC: float128 parameter passing) Backport from mainline 2018-06-19 Segher Boessenkool 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: r263479 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 40af297e4d07..c7f615047572 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2018-08-10 Segher Boessenkool + + Backport from mainline + 2018-06-19 Segher Boessenkool + + 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-07-29 John David Anglin * config/pa/pa.c (pa_output_addr_vec): Align address table. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 04696580fa60..733589c659ca 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -10381,12 +10381,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;