This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Gimplilfy ICE in gnat.dg/array18.adb


The intent of the patch change is clear. 

The strange thing concern the variable "A" declared this way "A : String (1 .. 1);", used that way "A := F;"  and displayed in tree (gnu_target) as a RECORD_TYPE instead of an ARRAY_TYPE.


The test to know if a temporary for return value is needed only check ARRAY_RANGE_REF and ARRAY_TYPE and not RECORD_TYPE :

TREE_CODE (gnu_target) == ARRAY_RANGE_REF
||
(TREE_CODE (TREE_TYPE (gnu_target)) == ARRAY_TYPE
    && TREE_CODE (TYPE_SIZE (TREE_TYPE (gnu_target)))  == INTEGER_CST)


I don't why in my case fixed Strings are RECORD_TYPE and not ARRAY_TYPE. 
Maybe its normal and I should extend the if condition with RECORD_TYPE :

TREE_CODE (gnu_target) == ARRAY_RANGE_REF
||
(TREE_CODE (TREE_TYPE (gnu_target)) == ARRAY_TYPE
    && TREE_CODE (TYPE_SIZE (TREE_TYPE (gnu_target)))  == INTEGER_CST)
||
(TREE_CODE (TREE_TYPE (gnu_target)) == RECORD_TYPE
    && TREE_CODE (TYPE_SIZE (TREE_TYPE (gnu_target)))  == INTEGER_CST)


-----Message d'origine-----
De : gcc-owner@gcc.gnu.org [mailto:gcc-owner@gcc.gnu.org] De la part de Eric Botcazou
Envoyé : vendredi 6 juin 2014 10:20
À : BELBACHIR Selim
Cc : gcc@gcc.gnu.org
Objet : Re: Gimplilfy ICE in gnat.dg/array18.adb

> strangely my var_decl for 'a' is a record and not an array_type so the 'if'
> condition is false (and true on X86_64).... I looked for somewhere in 
> my backend something that would transform an array_type into a 
> record_type but I did not find anything.

The comment should clearly state the intent of the change though and how to adjust it to your needs.

--
Eric Botcazou


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]