-
- Downloads
Fortran: Fix location_t in gfc_get_extern_function_decl; support 'omp dispatch interop'
The declaration created by gfc_get_extern_function_decl used input_location as DECL_SOURCE_LOCATION, which gave rather odd results with 'declared here' diagnostic. - It is much more useful to use the gfc_symbol's declated_at, which this commit now does. Additionally, it adds support for the 'interop' clause of OpenMP's 'dispatch' directive. As the argument order matters, gfc_match_omp_variable_list gained a 'reverse_order' flag to use the same order as the C/C++ parser. gcc/fortran/ChangeLog: * gfortran.h: Add OMP_LIST_INTEROP to the unnamed OMP_LIST_ enum. * openmp.cc (gfc_match_omp_variable_list): Add reverse_order boolean argument, defaulting to false. (enum omp_mask2, OMP_DISPATCH_CLAUSES): Add OMP_CLAUSE_INTEROP. (gfc_match_omp_clauses, resolve_omp_clauses): Handle dispatch's 'interop' clause. * trans-decl.cc (gfc_get_extern_function_decl): Use sym->declared_at instead input_location as DECL_SOURCE_LOCATION. * trans-openmp.cc (gfc_trans_omp_clauses): Handle OMP_LIST_INTEROP. gcc/testsuite/ChangeLog: * gfortran.dg/goacc/routine-external-level-of-parallelism-2.f: Update xfail'ed 'dg-bogus' for the better 'declared here' location. * gfortran.dg/gomp/dispatch-11.f90: New test. * gfortran.dg/gomp/dispatch-12.f90: New test.
Showing
- gcc/fortran/gfortran.h 1 addition, 0 deletionsgcc/fortran/gfortran.h
- gcc/fortran/openmp.cc 41 additions, 12 deletionsgcc/fortran/openmp.cc
- gcc/fortran/trans-decl.cc 1 addition, 1 deletiongcc/fortran/trans-decl.cc
- gcc/fortran/trans-openmp.cc 3 additions, 0 deletionsgcc/fortran/trans-openmp.cc
- gcc/testsuite/gfortran.dg/goacc/routine-external-level-of-parallelism-2.f 15 additions, 13 deletions...ortran.dg/goacc/routine-external-level-of-parallelism-2.f
- gcc/testsuite/gfortran.dg/gomp/dispatch-11.f90 85 additions, 0 deletionsgcc/testsuite/gfortran.dg/gomp/dispatch-11.f90
- gcc/testsuite/gfortran.dg/gomp/dispatch-12.f90 49 additions, 0 deletionsgcc/testsuite/gfortran.dg/gomp/dispatch-12.f90
Loading