This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: libgomp failure (was: Re: [FORTRAN mainline] dereference POINTER_PLUS_EXPR check)
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: Tobias Burnus <burnus at net-b dot de>, jakub at redhat dot com
- Cc: Jack Howarth <howarth at bromo dot msbb dot uc dot edu>, Richard Guenther <richard dot guenther at gmail dot com>, fortran at gcc dot gnu dot org, Andrew Pinski <pinskia at gmail dot com>, Diego Novillo <dnovillo at google dot com>, gcc-patches at gcc dot gnu dot org
- Date: Sun, 25 Nov 2007 11:04:24 -0400
- Subject: Re: libgomp failure (was: Re: [FORTRAN mainline] dereference POINTER_PLUS_EXPR check)
- References: <20071121215235.GA11077@redhat.com> <84fc9c000711211357w7a2587d2n663dd561845e4e1c@mail.gmail.com> <20071121225800.GA5508@redhat.com> <84fc9c000711211525h37554477yf567a8265f09d59@mail.gmail.com> <20071122005837.GA7171@redhat.com> <de8d50360711211709k61f0f066lf483e97645564df2@mail.gmail.com> <20071122172301.GA17740@redhat.com> <84fc9c000711220948p74bf7bb8he63f95baf9ba38f1@mail.gmail.com> <20071123002727.GA16608@redhat.com> <47484E4F.9090801@net-b.de>
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,