[Patch, Fortran] PR 43331 - Fix Cray pointer (middle-end) type declaration
Tobias Burnus
burnus@net-b.de
Thu Mar 11 21:14:00 GMT 2010
Tobias Burnus wrote:
> This patch changes it have an unknown upper bound. The patch is straight
> forward, except for the change in trans-decl.c's
> gfc_trans_deferred_vars
>
I just saw that the patch has a problem, which one sees in the dump; it
changes from
integer(kind=4) ipte1[1] [value-expr: *(integer(kind=4)[1] *) iptr4];
to
integer(kind=4)[0:] * restrict ipte1 [value-expr:
(integer(kind=4)[0:] * restrict) iptr4];
The [1] vs. [0:] is the reason for this patch; I think that also the
change from "integer" to "integer *" is correct. However, my according
to (limited) understanding of Cray pointer, the "restrict" qualifier is
wrong.
Tobias
PS: Patch
--- trans-decl.c (Revision 157391)
+++ trans-decl.c
@@ -598,6 +598,7 @@ gfc_finish_var_decl (tree decl, gfc_symb
if (!sym->attr.target
&& !sym->attr.pointer
+ && !sym->attr.cray_pointee
&& !sym->attr.proc_pointer)
DECL_RESTRICTED_P (decl) = 1;
}
--- trans-types.c (Revision 157391)
+++ trans-types.c
@@ -1775,7 +1775,7 @@ gfc_sym_type (gfc_symbol * sym)
byref = 0;
restricted = !sym->attr.target && !sym->attr.pointer
- && !sym->attr.proc_pointer;
+ && !sym->attr.proc_pointer && !sym->attr.cray_pointee;
if (sym->attr.dimension)
{
if (gfc_is_nodesc_array (sym))
More information about the Gcc-patches
mailing list