diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2009-01-12 19:14:43 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2009-01-12 19:14:43 +0000 |
commit | 3b9c1abd29ba5fe93ba4bcae18c8d324657f5dcb (patch) | |
tree | b9bc38ea99e07f72885d6aa102a34dd0274bb1e5 /gcc/ada/gcc-interface/decl.c | |
parent | 406c72ce52ff86d21f11bf0b90c4df6e34dcfb63 (diff) | |
download | gcc-3b9c1abd29ba5fe93ba4bcae18c8d324657f5dcb.zip gcc-3b9c1abd29ba5fe93ba4bcae18c8d324657f5dcb.tar.gz gcc-3b9c1abd29ba5fe93ba4bcae18c8d324657f5dcb.tar.bz2 |
decl.c (gnat_to_gnu_entity): Really strip only useless conversions around renamed objects.
* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Really strip
only useless conversions around renamed objects.
From-SVN: r143303
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 0c7321d..25c4d81 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -843,7 +843,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) == RECORD_TYPE && TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (gnu_expr, 0)))) /* Strip useless conversions around the object. */ - || TREE_CODE (gnu_expr) == NOP_EXPR) + || (TREE_CODE (gnu_expr) == NOP_EXPR + && gnat_types_compatible_p + (TREE_TYPE (gnu_expr), + TREE_TYPE (TREE_OPERAND (gnu_expr, 0))))) { gnu_expr = TREE_OPERAND (gnu_expr, 0); gnu_type = TREE_TYPE (gnu_expr); |