> >     * gcc-interface/decl.c (gnat_to_gnu_entity): Check that
> >     type is array or integer prior checking string flag.
> 
> The test for array is superfluous here.
> 
> >     * gcc-interface/gigi.h (gnat_signed_type_for,
> >     maybe_character_value): Likewise.
> 
> Wrong ChangeLog, the first modified function is maybe_character_type.
> 
> I have installed the attached patchlet after testing it on x86-64/Linux.
> 
> 
>       * gcc-interface/decl.c (gnat_to_gnu_entity): Remove superfluous test in
>       previous change.
>       * gcc-interface/gigi.h (maybe_character_type): Fix formatting.
>       (maybe_character_value): Likewise.

Thanks a lot. I was not quite sure if ARRAY_TYPEs can happen there
and I should have added you to the CC.

Honza
> 
> -- 
> Eric Botcazou

> Index: gcc-interface/decl.c
> ===================================================================
> --- gcc-interface/decl.c      (revision 272633)
> +++ gcc-interface/decl.c      (working copy)
> @@ -1855,8 +1855,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entit
>         = Has_Biased_Representation (gnat_entity);
>  
>        /* Do the same processing for Character subtypes as for types.  */
> -      if ((TREE_CODE (TREE_TYPE (gnu_type)) == INTEGER_TYPE
> -        || TREE_CODE (TREE_TYPE (gnu_type)) == ARRAY_TYPE)
> +      if (TREE_CODE (TREE_TYPE (gnu_type)) == INTEGER_TYPE
>         && TYPE_STRING_FLAG (TREE_TYPE (gnu_type)))
>       {
>         TYPE_NAME (gnu_type) = gnu_entity_name;
> Index: gcc-interface/gigi.h
> ===================================================================
> --- gcc-interface/gigi.h      (revision 272633)
> +++ gcc-interface/gigi.h      (working copy)
> @@ -1139,7 +1139,8 @@ static inline tree
>  maybe_character_type (tree type)
>  {
>    if (TREE_CODE (type) == INTEGER_TYPE
> -      && TYPE_STRING_FLAG (type) && !TYPE_UNSIGNED (type))
> +      && TYPE_STRING_FLAG (type)
> +      && !TYPE_UNSIGNED (type))
>      type = gnat_unsigned_type_for (type);
>  
>    return type;
> @@ -1153,7 +1154,8 @@ maybe_character_value (tree expr)
>    tree type = TREE_TYPE (expr);
>  
>    if (TREE_CODE (type) == INTEGER_TYPE
> -      && TYPE_STRING_FLAG (type) && !TYPE_UNSIGNED (type))
> +      && TYPE_STRING_FLAG (type)
> +      && !TYPE_UNSIGNED (type))
>      {
>        type = gnat_unsigned_type_for (type);
>        expr = convert (type, expr);

Reply via email to