From 6894d9101e6324972b5b105227f3412a6c46549d Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Fri, 10 Apr 2020 09:19:22 +0000 Subject: [PATCH] [Ada] Remove handling of 'Pos and 'Val attributes from gigi 2020-06-19 Eric Botcazou gcc/ada/ * gcc-interface/trans.c (lvalue_required_for_attribute_p): Do not deal with 'Pos or 'Val. (Attribute_to_gnu): Likewise. * gcc-interface/utils.c (create_field_decl): Small formatting fix. --- gcc/ada/gcc-interface/trans.c | 13 ------------- gcc/ada/gcc-interface/utils.c | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 3a6aa75b4d5..313a2fbcbaf 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -773,8 +773,6 @@ lvalue_required_for_attribute_p (Node_Id gnat_node) { switch (Get_Attribute_Id (Attribute_Name (gnat_node))) { - case Attr_Pos: - case Attr_Val: case Attr_Pred: case Attr_Succ: case Attr_First: @@ -1701,17 +1699,6 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) switch (attribute) { - case Attr_Pos: - case Attr_Val: - /* These are just conversions since representation clauses for - enumeration types are handled in the front-end. */ - gnu_expr = gnat_to_gnu (First (Expressions (gnat_node))); - if (attribute == Attr_Pos) - gnu_expr = maybe_character_value (gnu_expr); - gnu_result_type = get_unpadded_type (Etype (gnat_node)); - gnu_result = convert (gnu_result_type, gnu_expr); - break; - case Attr_Pred: case Attr_Succ: /* These just add or subtract the constant 1 since representation diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 2a6ed04756b..7adc3131a41 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -3017,7 +3017,7 @@ create_field_decl (tree name, tree type, tree record_type, tree size, tree pos, unsigned int known_align; if (tree_fits_uhwi_p (pos)) - known_align = tree_to_uhwi (pos) & - tree_to_uhwi (pos); + known_align = tree_to_uhwi (pos) & -tree_to_uhwi (pos); else known_align = BITS_PER_UNIT; -- 2.30.2