diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2008-09-26 20:11:52 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2008-09-26 20:11:52 +0000 |
commit | bb3da4f27b9d7241a626695e80edc285561f2506 (patch) | |
tree | d07c6f8831a4d81fa09ec5f6ea14bfb44f9d7b87 /gcc/ada/gcc-interface/decl.c | |
parent | 0da7a284ef2d91cc468145b88893c99e938d5be0 (diff) | |
download | gcc-bb3da4f27b9d7241a626695e80edc285561f2506.zip gcc-bb3da4f27b9d7241a626695e80edc285561f2506.tar.gz gcc-bb3da4f27b9d7241a626695e80edc285561f2506.tar.bz2 |
decl.c (gnat_to_gnu_entity): Cap the alignment promotion to that of ptr_mode instead of word_mode.
* decl.c (gnat_to_gnu_entity) <object>: Cap the alignment promotion
to that of ptr_mode instead of word_mode.
From-SVN: r140711
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index d343b14..b0dfc7d 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -734,10 +734,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) && TREE_CODE (TYPE_SIZE (gnu_type)) == INTEGER_CST) { /* No point in jumping through all the hoops needed in order - to support BIGGEST_ALIGNMENT if we don't really have to. */ + to support BIGGEST_ALIGNMENT if we don't really have to. + So we cap to the smallest alignment that corresponds to + a known efficient memory access pattern of the target. */ unsigned int align_cap = Is_Atomic (gnat_entity) ? BIGGEST_ALIGNMENT - : get_mode_alignment (word_mode); + : get_mode_alignment (ptr_mode); if (!host_integerp (TYPE_SIZE (gnu_type), 1) || compare_tree_int (TYPE_SIZE (gnu_type), align_cap) >= 0) |