From 06d750319f4c0c85748f175b380affc344d0defe Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Thu, 26 Mar 2015 21:12:55 +0000 Subject: [PATCH] * gcc-interface/trans.c (Attribute_to_gnu) : New case. From-SVN: r221711 --- gcc/ada/ChangeLog | 4 ++++ gcc/ada/gcc-interface/trans.c | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index ca430dc9da3..e7c67496c82 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +2015-03-26 Eric Botcazou + + * gcc-interface/trans.c (Attribute_to_gnu) : New case. + 2015-03-24 Gary Dismukes * sem_ch3.adb: Minor typo fix (missing paren). diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index a4ba82e5dfc..73794772158 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -2469,6 +2469,18 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) } break; + case Attr_Deref: + prefix_unused = true; + gnu_expr = gnat_to_gnu (First (Expressions (gnat_node))); + gnu_result_type = get_unpadded_type (Etype (gnat_node)); + /* This can be a random address so build an alias-all pointer type. */ + gnu_expr + = convert (build_pointer_type_for_mode (gnu_result_type, ptr_mode, + true), + gnu_expr); + gnu_result = build_unary_op (INDIRECT_REF, NULL_TREE, gnu_expr); + break; + default: /* This abort means that we have an unimplemented attribute. */ gcc_unreachable (); -- 2.30.2