This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gomp4.1] depend(sink) and depend(source) parsing for C
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 13 Jul 2015 19:32:39 +0200
- Subject: Re: [gomp4.1] depend(sink) and depend(source) parsing for C
- Authentication-results: sourceware.org; auth=none
- References: <559EBC6C dot 70109 at redhat dot com> <20150709185315 dot GY10247 at tucnak dot redhat dot com> <55A008FF dot 10609 at redhat dot com> <55A161F8 dot 8010800 at redhat dot com> <20150713135618 dot GQ1788 at tucnak dot redhat dot com> <55A3F147 dot 10301 at redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Jul 13, 2015 at 10:11:35AM -0700, Aldy Hernandez wrote:
> On 07/13/2015 06:56 AM, Jakub Jelinek wrote:
> >On Sat, Jul 11, 2015 at 11:35:36AM -0700, Aldy Hernandez wrote:
>
> >On the C++ FE side, please also try a testcase in g++.dg/gomp/ where
> >the ordered(n) loop with #pragma omp ordered depend({source,sink}) will be
> >in a template, to make sure pt.c does the right thing with it.
>
> I assume you mean something like:
>
> void bar (int, int, int);
>
> template<typename T>
> T baz (T arg)
> {
> int i, j, k;
Yeah, or even better T i, j, k;
As you don't use the argument, it can be just
template<typename T>
void baz ()
{
> Also, was this supposed to work?:
>
> template<int N>
> int foo()
> {
> int i, j, k;
> #pragma omp parallel for ordered(N)
It is not 100% clear, but we don't support collapse(N)
either when N is a template parameter, as it affects
parsing of the code, we require that it is a non-dependent
constant expression.
Whether depend(sink:) should allow template parameters
depends on whether it will be required to be integer constant
or integer constant expression, right now it should be the former.
> >If you want to spend time on something still in the FE, it would be nice to
> >resolve the C++ iteration var issue (i.e. increase OMP_FOR number of
> >arguments, so that it could have yet another (optional) vector, say
> >OMP_FOR_ORIG_DECLS. If that vector would be NULL, the gimplifier would
> >assume that all the decls in OMP_FOR_INIT are the ones present in the
> >source, if it would be present, you'd use them for the variable checking
> >instead of the ones from OMP_FOR_INIT (but, replace them with the
> >decls from OMP_FOR_INIT after the checking).
> >
> >There is another issue - if some iterator var has pointer type, supposedly
> >we want somewhere in the FEs already multiply it by the size of what they
> >point to (and convert to sizetype). For C FE, it can be done already during
> >parsing, we should know the type of the iterator var already at that point,
> >for C++ FE it needs to be done only in finish_omp_clauses if
> >!processing_template_decl, because in templates we might not know the type.
>
> Sure. As follow-ups?
Of course.
Jakub