[PATCH] Fortran: Fix incompatible types between INTEGER(8) and TYPE(c_ptr)
Paul-Antoine Arras
pa@codesourcery.com
Thu Oct 26 16:28:07 GMT 2023
Hi Thomas,
On 26/10/2023 18:16, you wrote:
> Hi!
>
> On 2023-10-26T13:24:04+0200, Paul-Antoine Arras <pa@codesourcery.com> wrote:
>> --- /dev/null
>> +++ b/gcc/testsuite/gfortran.dg/c_ptr_tests_20.f90
>> @@ -0,0 +1,57 @@
>> +! { dg-do compile }
>> +! { dg-additional-options "-fopenmp" }
>> +[...]
>
>> --- /dev/null
>> +++ b/gcc/testsuite/gfortran.dg/c_ptr_tests_21.f90
>> @@ -0,0 +1,57 @@
>> +! { dg-do compile }
>> +! { dg-additional-options "-fopenmp" }
>> +[...]
>
> OpenMP is not universally supported across different GCC configurations,
> so this will FAIL for some. Therefore, please either guard with
> effective target:
>
> @item fopenmp
> Target supports OpenMP via @option{-fopenmp}.
>
Would the following be enough?
> diff --git gcc/testsuite/gfortran.dg/c_ptr_tests_20.f90 gcc/testsuite/gfortran.dg/c_ptr_tests_20.f90
> index 7dd510400f3..131603d3819 100644
> --- gcc/testsuite/gfortran.dg/c_ptr_tests_20.f90
> +++ gcc/testsuite/gfortran.dg/c_ptr_tests_20.f90
> @@ -1,4 +1,5 @@
> ! { dg-do compile }
> +! { dg-require-effective-target fopenmp }
> ! { dg-additional-options "-fopenmp" }
> !
> ! This failed to compile the declare variant directive due to the C_PTR
> diff --git gcc/testsuite/gfortran.dg/c_ptr_tests_21.f90 gcc/testsuite/gfortran.dg/c_ptr_tests_21.f90
> index 05ccb771eee..060d29d0275 100644
> --- gcc/testsuite/gfortran.dg/c_ptr_tests_21.f90
> +++ gcc/testsuite/gfortran.dg/c_ptr_tests_21.f90
> @@ -1,4 +1,5 @@
> ! { dg-do compile }
> +! { dg-require-effective-target fopenmp }
> ! { dg-additional-options "-fopenmp" }
> !
> ! Ensure that C_PTR and C_FUNPTR are reported as incompatible types in variant
Thanks,
--
PA
More information about the Gcc-patches
mailing list