This is the mail archive of the
mailing list for the GCC project.
Re: [Ping^4] [Patch, AArch64, ILP32] 3/5 Minor change in function.c:assign_parm_find_data_types()
- From: Yufeng Zhang <Yufeng dot Zhang at arm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Richard Henderson <rth at redhat dot com>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>
- Date: Thu, 15 Aug 2013 19:21:16 +0100
- Subject: Re: [Ping^4] [Patch, AArch64, ILP32] 3/5 Minor change in function.c:assign_parm_find_data_types()
- References: <51CB6AAE dot 8030101 at arm dot com> <51CB6D86 dot 9020304 at arm dot com> <51D357BA dot 5050907 at arm dot com> <51DA9053 dot 3050304 at arm dot com> <51E7C35A dot 2060105 at arm dot com>
I am aware that it is currently holiday season, but it would be really
nice if this tiny patch can get some further comments even if it is not
The original RFA email is here:
On 07/18/13 11:28, Yufeng Zhang wrote:
On 07/08/13 11:11, Yufeng Zhang wrote:
On 07/02/13 23:44, Yufeng Zhang wrote:
Can I get an OK please if there is no objection?
On 06/26/13 23:39, Yufeng Zhang wrote:
This patch updates assign_parm_find_data_types to assign passed_mode and
nominal_mode with the mode of the built pointer type instead of the
hard-coded Pmode in the case of pass-by-reference. This is in line with
the assignment to passed_mode and nominal_mode in other cases inside the
assign_parm_find_data_types generally uses TYPE_MODE to calculate
passed_mode and nominal_mode:
/* Find mode of arg as it is passed, and mode of arg as it should be
during execution of this function. */
passed_mode = TYPE_MODE (passed_type);
nominal_mode = TYPE_MODE (nominal_type);
this includes the case when the passed argument is a pointer by itself.
However there is a discrepancy when it deals with argument passed by
invisible reference; it builds the argument's corresponding pointer
type, but sets passed_mode and nominal_mode with Pmode directly.
This is OK for targets where Pmode == ptr_mode, but on AArch64 with
ILP32 they are different with Pmode as DImode and ptr_mode as SImode.
When such a reference is passed on stack, the reference is prepared by
the caller in the lower 4 bytes of an 8-byte slot but is fetched by the
callee as an 8-byte datum, of which the higher 4 bytes may contain junk.
It is probably the combination of Pmode != ptr_mode and the particular
ABI specification that make the AArch64 ILP32 the first target on which
the issue manifests itself.
Bootstrapped on x86_64-none-linux-gnu.
OK for the trunk?
* function.c (assign_parm_find_data_types): Set passed_mode and
nominal_mode to the TYPE_MODE of nominal_type for the built
pointer type in case of the struct-pass-by-reference.