aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2024-08-20 22:59:58 +0200
committerMarc Poulhiès <dkm@gcc.gnu.org>2024-09-03 10:16:47 +0200
commitd8d191469e1e08e7b8530874cbb0f2781dc2e14d (patch)
tree9fcbc78b5d7143d816a53344ff2ff75ea8b68e94
parent9ba7262c8de0a96e85cc1ad05e2c3666228c74e8 (diff)
downloadgcc-d8d191469e1e08e7b8530874cbb0f2781dc2e14d.zip
gcc-d8d191469e1e08e7b8530874cbb0f2781dc2e14d.tar.gz
gcc-d8d191469e1e08e7b8530874cbb0f2781dc2e14d.tar.bz2
ada: Pass unaligned record components by copy in calls on all platforms
This has historically been done only on platforms requiring the strict alignment of memory references, but this can arguably be considered as being mandated by the language on all of them. gcc/ada/ * gcc-interface/trans.cc (addressable_p) <COMPONENT_REF>: Take into account the alignment of the field on all platforms.
-rw-r--r--gcc/ada/gcc-interface/trans.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/ada/gcc-interface/trans.cc b/gcc/ada/gcc-interface/trans.cc
index 3f2eadd..7cced04 100644
--- a/gcc/ada/gcc-interface/trans.cc
+++ b/gcc/ada/gcc-interface/trans.cc
@@ -10289,9 +10289,8 @@ addressable_p (tree gnu_expr, tree gnu_type)
check the alignment of the containing record, as it is
guaranteed to be not smaller than that of its most
aligned field that is not a bit-field. */
- && (!STRICT_ALIGNMENT
- || DECL_ALIGN (TREE_OPERAND (gnu_expr, 1))
- >= TYPE_ALIGN (TREE_TYPE (gnu_expr))))
+ && DECL_ALIGN (TREE_OPERAND (gnu_expr, 1))
+ >= TYPE_ALIGN (TREE_TYPE (gnu_expr)))
/* The field of a padding record is always addressable. */
|| TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (gnu_expr, 0))))
&& addressable_p (TREE_OPERAND (gnu_expr, 0), NULL_TREE));