This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix struct passing on targets that rely on TYPE in
On Sun, Oct 26, 2008 at 09:26:25PM -0400, John David Anglin wrote:
> I have committed the following change to resolve PR 37316. The change avoids
> the problematic call to emit_group_store in assign_parm_remove_parallels by
> using BLKmode for the PARALLEL used for structs, aggregates and other
> similar objects. It also fixes the incorrect justification noted in
> debugging this problem for complex and vector types. The change doesn't
> fix the middle-end regression.
>
> Tested on hppa64-hp-hpux11.11. Committed to trunk.
>
> Dave
> --
> J. David Anglin dave.anglin@nrc-cnrc.gc.ca
> National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
>
> 2008-10-26 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
>
> PR middle-end/37316
> * pa.c (function_arg_padding): Pad complex and vector types upward in
> 64-bit runtime.
> (function_arg): Use BLKmode for PARALLEL in 64-bit runtime.
>
> Index: config/pa/pa.c
> ===================================================================
> --- config/pa/pa.c (revision 141361)
> +++ config/pa/pa.c (working copy)
> @@ -5888,7 +5888,11 @@
> function_arg_padding (enum machine_mode mode, const_tree type)
> {
> if (mode == BLKmode
> - || (TARGET_64BIT && type && AGGREGATE_TYPE_P (type)))
> + || (TARGET_64BIT
> + && type
> + && (AGGREGATE_TYPE_P (type)
> + || TREE_CODE (type) == COMPLEX_TYPE
> + || TREE_CODE (type) == VECTOR_TYPE)))
> {
> /* Return none if justification is not required. */
> if (type
> @@ -9277,7 +9281,7 @@
> offset += 8;
> }
>
> - return gen_rtx_PARALLEL (mode, gen_rtvec_v (ub, loc));
> + return gen_rtx_PARALLEL (BLKmode, gen_rtvec_v (ub, loc));
I think this unnecessarily penalizes the code, forces going through memory
always. To work around the emit_group_store bug, if the
assign_parm_remove_parallels bug is fixed, you could IMHO just use BLKmode
for COMPLEX_TYPE.
Jakub