[PATCH] openmp: fix UBSAN error at gcc/fortran/openmp.c:4737

Tobias Burnus tobias@codesourcery.com
Mon Aug 17 08:52:19 GMT 2020


On 8/17/20 10:41 AM, Martin Liška wrote:

> Since 21cfe724cbdc30612bf1ef59b26f19ada2210832 there's a new
> OMP_LIST_NONTEMPORAL value, but it was missing in
> resolve_omp_clauses static array that is defined at the function
> beginning:
>
> gcc/fortran/ChangeLog:
>
>     * openmp.c (resolve_omp_clauses): Add NONTEMPORAL to clause
>     names.

LGTM & thanks! – Sorry for missing it.
(I re-checked against the OMP_LIST_* enum and
it seems to be only missing one.)

Tobias

> ---
>  gcc/fortran/openmp.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c
> index c44a2530b88..60d8e5573c2 100644
> --- a/gcc/fortran/openmp.c
> +++ b/gcc/fortran/openmp.c
> @@ -4369,7 +4369,8 @@ resolve_omp_clauses (gfc_code *code,
> gfc_omp_clauses *omp_clauses,
>      = { "PRIVATE", "FIRSTPRIVATE", "LASTPRIVATE", "COPYPRIVATE",
> "SHARED",
>      "COPYIN", "UNIFORM", "ALIGNED", "LINEAR", "DEPEND", "MAP",
>      "TO", "FROM", "REDUCTION", "DEVICE_RESIDENT", "LINK", "USE_DEVICE",
> -    "CACHE", "IS_DEVICE_PTR", "USE_DEVICE_PTR", "USE_DEVICE_ADDR" };
> +    "CACHE", "IS_DEVICE_PTR", "USE_DEVICE_PTR", "USE_DEVICE_ADDR",
> +    "NONTEMPORAL" };
>
>    if (omp_clauses == NULL)
>      return;
-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter


More information about the Gcc-patches mailing list