On Fri, Oct 23, 2015 at 01:39:36PM -0400, Michael Meissner wrote: > This patch prevents the compiler from calling the IEEE 128-bit emulation > functions with the vector value in both GPRs and vector registers due to the > fact that the library function did not have a prototype. > > I have built the compiler with this patch and the previous subpatches (1-4). > I > have bootstrapped the compiler with all 16 subpatches installed, and there > were > no regressions. Is it ok to install in the trunk? > > 2015-10-22 Michael Meissner <meiss...@linux.vnet.ibm.com> > > * config/rs6000/rs6000.c (init_cumulative_args): Initialize > libcall field in CUMULATIVE_ARGS. > (rs6000_function_arg): Treat library functions as if they had > prototypes to prevent IEEE 128-bit support functions from passing > arguments in both GPRs and vector registers. > (rs6000_arg_partial_bytes): Likewise.
I forgot to attach the patch. -- Michael Meissner, IBM IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA email: meiss...@linux.vnet.ibm.com, phone: +1 (978) 899-4797
Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 229187) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -9441,6 +9441,7 @@ init_cumulative_args (CUMULATIVE_ARGS *c ? CALL_LIBCALL : CALL_NORMAL); cum->sysv_gregno = GP_ARG_MIN_REG; cum->stdarg = stdarg_p (fntype); + cum->libcall = libcall; cum->nargs_prototype = 0; if (incoming || cum->prototype) @@ -10613,9 +10614,11 @@ rs6000_function_arg (cumulative_args_t c rtx r, off; int i, k = 0; - /* Do we also need to pass this argument in the parameter - save area? */ - if (TARGET_64BIT && ! cum->prototype) + /* Do we also need to pass this argument in the parameter save area? + Library support functions for IEEE 128-bit are assumed to not need the + value passed both in GPRs and in vector registers. */ + if (TARGET_64BIT && !cum->prototype + && (!cum->libcall || !FLOAT128_VECTOR_P (elt_mode))) { int align_words = ROUND_UP (cum->words, 2); k = rs6000_psave_function_arg (mode, type, align_words, rvec); @@ -10846,11 +10849,14 @@ rs6000_arg_partial_bytes (cumulative_arg if (USE_ALTIVEC_FOR_ARG_P (cum, elt_mode, named)) { - /* If we are passing this arg in the fixed parameter save area - (gprs or memory) as well as VRs, we do not use the partial - bytes mechanism; instead, rs6000_function_arg will return a - PARALLEL including a memory element as necessary. */ - if (TARGET_64BIT && ! cum->prototype) + /* If we are passing this arg in the fixed parameter save area (gprs or + memory) as well as VRs, we do not use the partial bytes mechanism; + instead, rs6000_function_arg will return a PARALLEL including a memory + element as necessary. Library support functions for IEEE 128-bit are + assumed to not need the value passed both in GPRs and in vector + registers. */ + if (TARGET_64BIT && !cum->prototype + && (!cum->libcall || !FLOAT128_VECTOR_P (elt_mode))) return 0; /* Otherwise, we pass in VRs only. Check for partial copies. */