This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: Gimplilfy ICE in gnat.dg/array18.adb
- From: BELBACHIR Selim <selim dot belbachir at fr dot thalesgroup dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Fri, 6 Jun 2014 11:25:55 +0200
- Subject: RE: Gimplilfy ICE in gnat.dg/array18.adb
- Authentication-results: sourceware.org; auth=none
- References: <31560_1401966257_53904EB0_31560_3896_1_9C88BF562A27AA41B242B2780441926E212BC5C066 at THSONEA01CMS05P dot one dot grp> <2481416 dot miaf1UtpPu at polaris> <9368_1402042411_5391782B_9368_7183_1_9C88BF562A27AA41B242B2780441926E212BCF8D94 at THSONEA01CMS05P dot one dot grp> <24601701 dot JpZxCiu66K at polaris>
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