This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, Fortran] Fix type decl of coarrays
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 28 May 2011 14:50:26 +0200
- Subject: Re: [Patch, Fortran] Fix type decl of coarrays
- References: <4DE09530.2020103@net-b.de>
On Sat, May 28, 2011 at 8:24 AM, Tobias Burnus <burnus@net-b.de> wrote:
> Thanks for Richard for debugging this!
>
> Setting TREE_TYPE in trans-decl.c is nonsense and leads to types of the form
> "_Complex _Complex int". The fix is rather obvious.
>
> Build and regtested on x86-64-linux.
> OK for the trunk?
Note that I thought that instead of
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index 94b9a59..02a75fd 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -1423,10 +1423,7 @@ gfc_get_nodesc_array_type (tree etype,
gfc_array_spec * as, gfc_packed packed,
if (as->rank)
type = make_node (ARRAY_TYPE);
else
- {
- type = build_variant_type_copy (etype);
- TREE_TYPE (type) = etype;
- }
+ type = build_variant_type_copy (etype);
GFC_ARRAY_TYPE_P (type) = 1;
TYPE_LANG_SPECIFIC (type)
what was probably intended was
- {
- type = build_variant_type_copy (etype);
- TREE_TYPE (type) = etype;
- }
+ type = build_variant_type_copy (type);
because when copying the element type the following line
GFC_ARRAY_TYPE_P (type) = 1;
doesn't make too much sense (to me). And the copying was
probably to avoid clobbering the shared type.
So, please figure out what is really intended here ;)
Richard.
> Tobias
>