[Bug fortran/93787] Rejects non-ambigous specific in generic –

2021-02-15 Thread burnus at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93787

--- Comment #4 from Tobias Burnus  ---
The problem is in count_types_test:

For 'type(*),dimension(..)', compare_type_rank_if accepts a scalar integer
For 'type(*),dimension(*)', it does not.

As 'dimension(..)' accepts scalars, the symmetry is broken.
* For count_types_test f1=(a,async), f2=(a,len,async), the check
   if (ac1 > ac2)
  is false as  ac1 < ac2
* For count_types_test f1=(a,len,async), f2=(a,async), counting
   for f1's: 'len': ac1 = 2 ('len', 'async' – as 'a' as different rank != 0)
  That's fine but now:
counting all type-rank-compatibles in f2 finds '(a,async)'
  again 2 → 'if (ac1 > ac2)'

(Looking through the checks, I wonder whether there is an ambiguity issue with
 dimension(*) vs. dimension(1,*) vs. dimension(1,1,*)
as one can pass to all of them any array rank, including rank=0 (for array
element), but I have no checked whether other checks catch this nor what the
spec says.)


In this case, a simple count of all nonoptional arguments would solve it, but I
wonder whether there are some gotchas when playing more with dimension(..) (and
possibly type(*) or NO_ARG_CHECK).

[Bug fortran/93787] Rejects non-ambigous specific in generic –

2021-02-14 Thread dominiq at lps dot ens.fr via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93787

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Last reconfirmed||2021-02-14

--- Comment #3 from Dominique d'Humieres  ---
Confirmed.

[Bug fortran/93787] Rejects non-ambigous specific in generic –

2020-02-18 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93787

--- Comment #2 from Tobias Burnus  ---
Note: Once this bug is fixed, libgomp/openacc_lib.h shall be updated as the
'async_' name is user visible and wrong.

[Bug fortran/93787] Rejects non-ambigous specific in generic –

2020-02-17 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93787

--- Comment #1 from Tobias Burnus  ---
The following compiles with free-form source code but shows for fixed-form
source code:

Error: Ambiguous interfaces in generic interface 'acc_create_async' for
‘acc_create_async_32_h’ at (1) and ‘acc_create_async_array_h’ at (2)

The difference is that for fixed-form source, the !GCC$ is ignored (which is
fine). But the real question is: Why does this make a difference?
(Semantically, without GCC directive, it should reject scalars while with it
should also accept them. I believe that's the only difference.)

  interface acc_create_async
subroutine acc_create_async_32_h (a, len, async)
  use iso_c_binding, only: c_int32_t
  !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
  type (*), dimension (*) :: a
  integer (c_int32_t) len
  integer (4) async
end subroutine

subroutine acc_create_async_array_h (a, async)
  type (*), dimension (..), contiguous :: a
  integer (4) async
end subroutine
  end interface
  end