mirror of git://gcc.gnu.org/git/gcc.git
[PATCH 1/2][AArch64] Implement AAPCS64 updates for alignment attribute
gcc/ChangeLog: * config/aarch64/aarch64.c (aarch64_function_arg_alignment): Rewrite, looking one level down for records and arrays. From-SVN: r237224
This commit is contained in:
parent
4ccab56d73
commit
75d6cc8193
|
|
@ -1,3 +1,8 @@
|
||||||
|
2016-06-08 Alan Lawrence <alan.lawrence@arm.com>
|
||||||
|
|
||||||
|
* config/aarch64/aarch64.c (aarch64_function_arg_alignment):
|
||||||
|
Rewrite, looking one level down for records and arrays.
|
||||||
|
|
||||||
2016-06-08 David Malcolm <dmalcolm@redhat.com>
|
2016-06-08 David Malcolm <dmalcolm@redhat.com>
|
||||||
|
|
||||||
* pretty-print.c: Include "selftest.h".
|
* pretty-print.c: Include "selftest.h".
|
||||||
|
|
|
||||||
|
|
@ -1961,22 +1961,23 @@ aarch64_vfp_is_call_candidate (cumulative_args_t pcum_v, machine_mode mode,
|
||||||
static unsigned int
|
static unsigned int
|
||||||
aarch64_function_arg_alignment (machine_mode mode, const_tree type)
|
aarch64_function_arg_alignment (machine_mode mode, const_tree type)
|
||||||
{
|
{
|
||||||
unsigned int alignment;
|
if (!type)
|
||||||
|
return GET_MODE_ALIGNMENT (mode);
|
||||||
|
if (integer_zerop (TYPE_SIZE (type)))
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (type)
|
gcc_assert (TYPE_MODE (type) == mode);
|
||||||
{
|
|
||||||
if (!integer_zerop (TYPE_SIZE (type)))
|
if (!AGGREGATE_TYPE_P (type))
|
||||||
{
|
return TYPE_ALIGN (TYPE_MAIN_VARIANT (type));
|
||||||
if (TYPE_MODE (type) == mode)
|
|
||||||
alignment = TYPE_ALIGN (type);
|
if (TREE_CODE (type) == ARRAY_TYPE)
|
||||||
else
|
return TYPE_ALIGN (TREE_TYPE (type));
|
||||||
alignment = GET_MODE_ALIGNMENT (mode);
|
|
||||||
}
|
unsigned int alignment = 0;
|
||||||
else
|
|
||||||
alignment = 0;
|
for (tree field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
|
||||||
}
|
alignment = std::max (alignment, DECL_ALIGN (field));
|
||||||
else
|
|
||||||
alignment = GET_MODE_ALIGNMENT (mode);
|
|
||||||
|
|
||||||
return alignment;
|
return alignment;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue