aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/gcc-interface')
-rw-r--r--gcc/ada/gcc-interface/decl.c4
-rw-r--r--gcc/ada/gcc-interface/gigi.h6
2 files changed, 7 insertions, 3 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 4dfd76b..df40543 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -1855,7 +1855,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
= Has_Biased_Representation (gnat_entity);
/* Do the same processing for Character subtypes as for types. */
- if (TYPE_STRING_FLAG (TREE_TYPE (gnu_type)))
+ if ((TREE_CODE (TREE_TYPE (gnu_type)) == INTEGER_TYPE
+ || TREE_CODE (TREE_TYPE (gnu_type)) == ARRAY_TYPE)
+ && TYPE_STRING_FLAG (TREE_TYPE (gnu_type)))
{
TYPE_NAME (gnu_type) = gnu_entity_name;
TYPE_STRING_FLAG (gnu_type) = 1;
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h
index 191a017..7254a16 100644
--- a/gcc/ada/gcc-interface/gigi.h
+++ b/gcc/ada/gcc-interface/gigi.h
@@ -1138,7 +1138,8 @@ gnat_signed_type_for (tree type_node)
static inline tree
maybe_character_type (tree type)
{
- if (TYPE_STRING_FLAG (type) && !TYPE_UNSIGNED (type))
+ if (TREE_CODE (type) == INTEGER_TYPE
+ && TYPE_STRING_FLAG (type) && !TYPE_UNSIGNED (type))
type = gnat_unsigned_type_for (type);
return type;
@@ -1151,7 +1152,8 @@ maybe_character_value (tree expr)
{
tree type = TREE_TYPE (expr);
- if (TYPE_STRING_FLAG (type) && !TYPE_UNSIGNED (type))
+ if (TREE_CODE (type) == INTEGER_TYPE
+ && TYPE_STRING_FLAG (type) && !TYPE_UNSIGNED (type))
{
type = gnat_unsigned_type_for (type);
expr = convert (type, expr);