Hi!
On Mon, 15 Aug 2016 18:54:49 -0700, Cesar Philippidis <[email protected]>
wrote:
> For the moment, I'm ignoring the
> device_type problem and handling all of the matching errors in
> gfc_match_oacc_routine.
OK for the moment; my idea has been to do it generally enough already
now, using generic infrastructure I have been/will be adding for C/C++,
so that device_type support will later be simple to implement for all
three front ends. But, let's leave that aside for the moment.
> You're patch was handling those errors in
> add_attributes_to_decls, which I think is too late.
I can't tell why that's "too late". Anyway, we can save this discussion
for later. ;-)
> Thomas, does this patch ok to you for gomp4?
Yes, please commit, so that we can move this whole thing forward. :-)
A few quick comments anyway:
> --- a/gcc/fortran/openmp.c
> +++ b/gcc/fortran/openmp.c
> @@ -1993,19 +2002,24 @@ gfc_match_oacc_routine (void)
> dims = gfc_oacc_routine_dims (c);
> if (dims == OACC_FUNCTION_NONE)
> {
> gfc_error ("Multiple loop axes specified in !$ACC ROUTINE at %C");
> - goto cleanup;
> +
> + /* Don't abort early, because it's important to let the user
> + know of any potential duplicate routine directives. */
> + seen_error = true;
> }
Hmm, I don't know if that's really important? I mean, if we run into
"Multiple loop axes specified", that is a hard semantic error already?
Anyway, this can be reconsidered later.
> if (isym != NULL)
> {
> if (c && (c->gang || c->worker || c->vector))
> {
> - gfc_error ("Intrinsic function specified in !$ACC ROUTINE ( NAME )"
> - " at %C, with incompatible GANG, WORKER, or VECTOR
> clause");
> + gfc_error ("Intrinsic symbol specified in !$ACC ROUTINE ( NAME ) "
> + "at %C, with incompatible clauses specifying the level "
> + "of parallelism");
> goto cleanup;
> }
You're re-introducing the wording I had used earlier, before I changed
that to the more specific one mentioning the clause names. Why change
that again? Also something the can be reconsidered later. (Goes
together with the gcc/testsuite/gfortran.dg/goacc/pr72741-intrinsic-2.f
changes.)
> --- a/gcc/testsuite/gfortran.dg/goacc/pr72741-intrinsic-1.f
> +++ b/gcc/testsuite/gfortran.dg/goacc/pr72741-intrinsic-1.f
> @@ -1,17 +1,13 @@
> -! Check for valid clauses with intrinsic function specified in !$ACC ROUTINE
> ( NAME ).
> -
> SUBROUTINE sub_1
> IMPLICIT NONE
> -!$ACC ROUTINE (ABORT)
> -!$ACC ROUTINE (ABORT) SEQ
> +!$ACC ROUTINE (ABORT) SEQ VECTOR ! { dg-error "Intrinsic symbol specified in
> \\!\\\$ACC ROUTINE \\( NAME \\) at \\(1\\), with incompatible clauses
> specifying the level of parallelism" }
>
> CALL ABORT
> END SUBROUTINE sub_1
>
> MODULE m_w_1
> IMPLICIT NONE
> -!$ACC ROUTINE (ABORT) SEQ
> -!$ACC ROUTINE (ABORT)
> +!$ACC ROUTINE (ABORT) VECTOR GANG ! { dg-error "Intrinsic symbol specified
> in \\!\\\$ACC ROUTINE \\( NAME \\) at \\(1\\), with incompatible clauses
> specifying the level of parallelism" }
This changes the intention of this test file? Another thing that can be
reconsidered later.
So, please commit as-is, and I'll then base my other changes on top of
that.
Grüße
Thomas