This is the mail archive of the gcc-patches@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: [Patch, Fortran] PR 43331 - Fix Cray pointer (middle-end) type declaration


On Thu, Mar 11, 2010 at 9:31 PM, Tobias Burnus <burnus@net-b.de> wrote:
> 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.

Yep.  Without the restrict qualifier it looks sensible to me.
Note that you changed ipte1 from being an array to being
a pointer - no idea if that causes problems for the frontend
when creating accesses via ipte1 or if it magically can cope
with that change.  But it's certainly way more straight-forward
to have a pointer represented as a pointer ;)

Btw, we don't necessarily need to make this change for 4.5.

Thanks,
Richard.

> 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))
>
>


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