This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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: libgomp failure (was: Re: [FORTRAN mainline] dereference POINTER_PLUS_EXPR check)


Hi folks.  Hi Jakub.

I've found what the cause of the problem reported below, but I am unsure
as to how to fix it.  Perhaps Jakub can shed some light.

With the patch below, the type of the P_P_E is now:

    type <reference_type 0x2aaaaab90240
        type <array_type 0x2aaaaab90180 type ...

gfc_omp_privatize_by_reference is now being called with a temporary of
the above type.  This function returns TRUE for any REFERENCE_TYPE.
Without the patch, it obviously returned pchar_type_node which returned
false.

My naive solution is to use PTR_TYPE_NODE instead of TREE_TYPE(dest) in
my original patch, but Richard G had commented that we should ideally be
type-exact in the expression tree.  Do folks care if I make this
PTR_TYPE_NODE, or is a fix in gfc_omp_privatize_by_reference in order?

Thanks.
Aldy

> This patch seems to cause a lot of libgomp regressions.
> See: http://gcc.gnu.org/ml/fortran/2007-11/msg00209.html
...
> +       * trans-expr.c (gfc_trans_string_copy): Use "void *" when building a
> +       memset.
> > 	* trans-expr.c (gfc_trans_string_copy): Use "void *" when building a
> > 	memset.
> >  
> > --- trans-expr.c	(revision 130355)
> > +++ trans-expr.c	(local)
> > @@ -2701,7 +2701,7 @@ gfc_trans_string_copy (stmtblock_t * blo
> >    tmp3 = build_call_expr (built_in_decls[BUILT_IN_MEMMOVE],
> >  			  3, dest, src, slen);
> >  
> > -  tmp4 = fold_build2 (POINTER_PLUS_EXPR, pchar_type_node, dest,
> > +  tmp4 = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (dest), dest,
> >  		      fold_convert (sizetype, slen));
> >    tmp4 = build_call_expr (built_in_decls[BUILT_IN_MEMSET], 3,


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