diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2008-04-20 10:32:55 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2008-04-20 10:32:55 +0000 |
commit | e871a8730ae8bd2a50a47a6c87691078e2e7fff6 (patch) | |
tree | ea175801501f23572184c58df3fcd73cad6a8ea7 /gcc/ada/trans.c | |
parent | def9bf340183a00cbc648eaddf24ed2d3baf32b4 (diff) | |
download | gcc-e871a8730ae8bd2a50a47a6c87691078e2e7fff6.zip gcc-e871a8730ae8bd2a50a47a6c87691078e2e7fff6.tar.gz gcc-e871a8730ae8bd2a50a47a6c87691078e2e7fff6.tar.bz2 |
decl.c (gnat_to_gnu_entity): Also promote the alignment of constant objects, but not exceptions.
* decl.c (gnat_to_gnu_entity) <object>: Also promote the alignment of
constant objects, but not exceptions.
* trans.c (add_decl_expr): Use gnat_types_compatible_p for type
compatibility test.
* utils.c (create_var_decl_1): Likewise.
* utils2.c (build_binary_op) <MODIFY_EXPR>: Also use the padded view of
the type when copying to padded object and the source is a constructor.
From-SVN: r134483
Diffstat (limited to 'gcc/ada/trans.c')
-rw-r--r-- | gcc/ada/trans.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ada/trans.c b/gcc/ada/trans.c index 300ac78..a6492c5 100644 --- a/gcc/ada/trans.c +++ b/gcc/ada/trans.c @@ -5098,7 +5098,7 @@ add_decl_expr (tree gnu_decl, Entity_Id gnat_entity) valid for the context. Similar to init_const in create_var_decl_1. */ if (TREE_CODE (gnu_decl) == VAR_DECL && (gnu_init = DECL_INITIAL (gnu_decl)) != NULL_TREE - && (TYPE_MAIN_VARIANT (type) != TYPE_MAIN_VARIANT (TREE_TYPE (gnu_init)) + && (!gnat_types_compatible_p (type, TREE_TYPE (gnu_init)) || (TREE_STATIC (gnu_decl) && !initializer_constant_valid_p (gnu_init, TREE_TYPE (gnu_init))))) |