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 08/25] Fix co-array allocation


Please send fortran patches to the fortran list as well!

On Wed, Sep 5, 2018 at 7:54 PM Toon Moene <toon@moene.org> wrote:

>
>
>
> -------- Forwarded Message --------
> Subject: [PATCH 08/25] Fix co-array allocation
> Date: Wed, 5 Sep 2018 12:49:40 +0100
> From: ams@codesourcery.com
> To: gcc-patches@gcc.gnu.org
>
>
> The Fortran front-end has a bug in which it uses "int" values for "size_t"
> parameters.  I don't know why this isn't problem for all 64-bit
> architectures,
> but GCN ends up with the data in the wrong argument register and/or
> stack slot,
> and bad things happen.
>
> This patch corrects the issue by setting the correct type.
>
> 2018-09-05  Kwok Cheung Yeung  <kcy@codesourcery.com>
>
>         gcc/fortran/
>         * trans-expr.c (gfc_trans_structure_assign): Ensure that
>         integer_zero_node is of sizetype when used as the first
>         argument of a call to _gfortran_caf_register.
>

The argument must be of type size_type_node, not sizetype. Please instead
use

size = build_zero_cst (size_type_node);


>         * trans-intrinsic.c (conv_intrinsic_event_query): Convert computed
>         index to a size_t type.
>

Using integer_type_node is wrong, but the correct type for calculating
array indices (lbound, ubound,  etc.) is not size_type_node but rather
gfc_array_index_type (which in practice maps to ptrdiff_t). So please use
that, and then fold_convert index to size_type_node just before generating
the call to event_query.


>         * trans-stmt.c (gfc_trans_event_post_wait): Likewise.
>

Same here as above.

Thanks,
-- 
Janne Blomqvist


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