{"id":2232123,"url":"http://patchwork.ozlabs.org/api/patches/2232123/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/0e17381b-cfb4-49d3-abf5-aea2b0263214@baylibre.com/","project":{"id":17,"url":"http://patchwork.ozlabs.org/api/projects/17/?format=json","name":"GNU Compiler Collection","link_name":"gcc","list_id":"gcc-patches.gcc.gnu.org","list_email":"gcc-patches@gcc.gnu.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<0e17381b-cfb4-49d3-abf5-aea2b0263214@baylibre.com>","list_archive_url":null,"date":"2026-05-02T20:27:37","name":"[committed] Fortran/OpenMP: cleanup gfc_free_omp_namelist","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"9ac06395d3862d67099563af3796b43d8e94ac67","submitter":{"id":87873,"url":"http://patchwork.ozlabs.org/api/people/87873/?format=json","name":"Tobias Burnus","email":"tburnus@baylibre.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/0e17381b-cfb4-49d3-abf5-aea2b0263214@baylibre.com/mbox/","series":[{"id":502550,"url":"http://patchwork.ozlabs.org/api/series/502550/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=502550","date":"2026-05-02T20:27:37","name":"[committed] Fortran/OpenMP: cleanup gfc_free_omp_namelist","version":1,"mbox":"http://patchwork.ozlabs.org/series/502550/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2232123/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2232123/checks/","tags":{},"related":[],"headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=baylibre-com.20251104.gappssmtp.com\n header.i=@baylibre-com.20251104.gappssmtp.com header.a=rsa-sha256\n header.s=20251104 header.b=sc/aVe9s;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key,\n unprotected) header.d=baylibre-com.20251104.gappssmtp.com\n header.i=@baylibre-com.20251104.gappssmtp.com header.a=rsa-sha256\n header.s=20251104 header.b=sc/aVe9s","sourceware.org;\n dmarc=none (p=none dis=none) header.from=baylibre.com","sourceware.org; spf=pass smtp.mailfrom=baylibre.com","server2.sourceware.org;\n arc=none smtp.remote-ip=2a00:1450:4864:20::443"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g7KHM6BDBz1y04\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 03 May 2026 06:28:30 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 3CC274BB5902\n\tfor <incoming@patchwork.ozlabs.org>; Sat,  2 May 2026 20:28:28 +0000 (GMT)","from mail-wr1-x443.google.com (mail-wr1-x443.google.com\n [IPv6:2a00:1450:4864:20::443])\n by sourceware.org (Postfix) with ESMTPS id 670654BB58AA\n for <gcc-patches@gcc.gnu.org>; Sat,  2 May 2026 20:27:41 +0000 (GMT)","by mail-wr1-x443.google.com with SMTP id\n ffacd0b85a97d-448528f4e69so1669267f8f.3\n for <gcc-patches@gcc.gnu.org>; Sat, 02 May 2026 13:27:41 -0700 (PDT)","from ?IPV6:2001:16b8:3ddc:4000:df93:2767:a92a:c28c?\n ([2001:16b8:3ddc:4000:df93:2767:a92a:c28c])\n by smtp.gmail.com with ESMTPSA id\n ffacd0b85a97d-44a8ea7d0c9sm13662014f8f.7.2026.05.02.13.27.38\n (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n Sat, 02 May 2026 13:27:39 -0700 (PDT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 3CC274BB5902","OpenDKIM Filter v2.11.0 sourceware.org 670654BB58AA"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 670654BB58AA","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 670654BB58AA","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777753661; cv=none;\n b=TToQkyUER2jCtSJSZn0EQqY2Z2DCajn2hOJ8dkOK5iCjF13VAphKH4kyxju3bKFpRZt+9R1OgYaOLCfw9rtmxfsyDH4AuXexmG5yXHra6fuWi1e9FZAJJ6MfKfoTCmp8rl6kCihz5eW3NcWqYlQSK4Gf5/8l5E0YsB0hoxKc4zY=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777753661; c=relaxed/simple;\n bh=XXZ/AGGNSO/kn04Hb8brj/4Jdb8yCMLkmUlUSsZ/AHE=;\n h=DKIM-Signature:Message-ID:Date:MIME-Version:To:From:Subject;\n b=qQ9CY//k8UUtZw57IjeqSgN3jcFu+DZx0m6sB6flt2lHDgfqB8mfQuBCKCAkn3KmNKX924hJgWSXV8Vyfas9IjuHByl53e0FT+4Le8Itl2CziTlxJxEtlZ3iLzD6f462E9kCfs2D8MZ7E9ZEhUDLD7fTp6T+xO2FOR/S8jogm9I=","ARC-Authentication-Results":"i=1; server2.sourceware.org","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=baylibre-com.20251104.gappssmtp.com; s=20251104; t=1777753660;\n x=1778358460;\n darn=gcc.gnu.org;\n h=subject:from:to:content-language:user-agent:mime-version:date\n :message-id:from:to:cc:subject:date:message-id:reply-to;\n bh=BQ6GMy3xDUU5LbfVYUicc+ql6dlLUmm+izSOvbAm+pU=;\n b=sc/aVe9szLfLskHRT6dkRsr4Z/ghHfXt5fRQ/xNgtHFBbUcntwOSrIQk7JvsjT+sXp\n Le2ekLA8Gl+aQoeWJQrjI3sytdK4iwcrb7ZjlB7V0nHzyQiXvRic/Nw5p/ZZXAqHCTJq\n AQp4/mG7samrOvtEagsp8tNnWQwJFQKIu8Q0sqjbuEnPyWyLIGWFgDLBiw4WJAA/qrC4\n clwc4z0o6b9cj/Mka7pT1AYASCmpxSKHnMcvyhwwEBO1YSWpbQdP7XRyJ+Ip8VFjkGTY\n 7T8aGktjUqju8HvIcQlZQ5F1/Zbv67DztsbaB7B+RnafRBZtkmCjeuXidKndrXf1JZlM\n lJIw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777753660; x=1778358460;\n h=subject:from:to:content-language:user-agent:mime-version:date\n :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=BQ6GMy3xDUU5LbfVYUicc+ql6dlLUmm+izSOvbAm+pU=;\n b=D+WbDmVj+rw2aub9aKpLhDqb1/sHwItIIPQ4c0/jOkhsfiDatB1GjOndhSHha8/wes\n vzZ/XjDbyKdpjL3ZC0ZBRDYguqgfuTZq/nShAO2kYmg3OeSqm/9niNvNs8kcoSJVADZu\n o7/6o0bJHyLhNQuEuuV0W4D1MgP3eLT+rBBy06HT7MsxBHoqVrV/WISh6xSzikS+evWM\n PQnNhDmhI/16ClI1eC5LrPWqFA1vcFzjaaZRH+Sy2ad8xVuPaxd6K8HMOnWnbUm0cEWX\n l+duc9HirIk+8QI6x9eyoy+VYDmnL9Qo2R7md4iLz1Qe1PKSTrxSMHLQarbG67oKo568\n tX/A==","X-Gm-Message-State":"AOJu0YxXwYFGVhytFnqa8/7iSvkjXs5tdXUjd9o0Qz7hKTM1dGeCyZZp\n +X7IQH5Z5mAtmIE+7JVE+VGz6xpYvW4xVSiAWIg/y1kwmsvXMt9blPLYaRHmbe7FMk67Zo/kvEY\n tgTAQT4YLwg==","X-Gm-Gg":"AeBDieu2rqhACHHTbZKzuRecRHKDpJnGlFrhGqACxtX5WlsQRyHSYXJhJNEck2J6JV6\n vxlIsSwrYEZYQ0PNHTar9seKO30xV/jlBLfP+PYi6Nq+MIZ9T8NJwAZdvnjg+uWQRFN8F6qVH51\n sVNlVrMUcagekT8K6xxDG45w8fZysNOdKIMYGvtPPZJq9+FOyMxS7h1szztIApYfVRuiQwJxFbp\n du/InbLVx8Zy2z2OWzwaI1Yx9dLfpboWXuVBXaG8Ml1dq5gcLy4B5tQRyrdlXVTVoxABOAG1wW7\n Zy4+x6Demc/wreHyFcOCGkO9I3iNXUUc3ZlFPAu5B3k5tJDPeij0I49HxxrXQoHrMFeuyloidUq\n Met88vIrMM2JCbQOBwdV4ZbjtD+0V4VYS521I7J8Cy6n3PDfDvN9yOW+q6MwDB76tm+tYjCJEdh\n wB0Y9JPh2FnFfsuWD3uDC1hdxz0/qLZ+ARHO/L2Yx6YHACD8OVmGS2pQ7rl9N8QLlJoYu+KrC2L\n pLckUKj6MwtGg==","X-Received":"by 2002:adf:fc88:0:b0:44d:821:1a09 with SMTP id\n ffacd0b85a97d-44d08211b76mr1143111f8f.25.1777753659766;\n Sat, 02 May 2026 13:27:39 -0700 (PDT)","Content-Type":"multipart/mixed; boundary=\"------------SIwMbRmbgoUHeI0exQ0pEJmC\"","Message-ID":"<0e17381b-cfb4-49d3-abf5-aea2b0263214@baylibre.com>","Date":"Sat, 2 May 2026 22:27:37 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Content-Language":"en-US","To":"gcc-patches <gcc-patches@gcc.gnu.org>,\n \"fortran@gcc.gnu.org\" <fortran@gcc.gnu.org>","From":"Tobias Burnus <tburnus@baylibre.com>","Subject":"[committed] Fortran/OpenMP: cleanup gfc_free_omp_namelist","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"},"content":"One has to admit that gfc_free_omp_namelist got a bit unhandy.\n\nSolution pass the OMP_LIST_ enum value instead of a bunch of\nbooleans. The change has been split-off from Julian's mapper\npatch, which otherwise had to add another boolean.\n\nContrary to his patch, it adds a name to the enum and uses\nthe enum; the argument is also mandatory to make the caller\nthink whether it is needed or not. And it also replaces\n0 byOMP_LIST_FIRST (=OMP_LIST_PRIVATE) to avoid magic numbers.\n  \nJulian's patch is part of commit on OG14 (devel/omp/gcc-14)\n   015cb4002d6 OpenMP: Fortran \"!$omp declare mapper\" support\naliashttps://gcc.gnu.org/g:015cb4002d6 - originally put on\nOG13 as 6d82b6c4156 Jun 30, 2023.(Post-commit) comments, remarks, suggestions? Committed as \nr17-279-g357207648f16ee Tobias PS: Next step is to add the Fortran \nparser support parts of Julian's declare-mapper commit.","diff":"commit 357207648f16eeb6768e081d320bf131a33316fc\nAuthor: Tobias Burnus <tburnus@baylibre.com>\nDate:   Sat May 2 22:25:48 2026 +0200\n\n    Fortran/OpenMP: cleanup gfc_free_omp_namelist\n    \n    Move the logic to deduce what needs to be freed from the\n    caller to the callee by passing the OMP_LIST_... enum value\n    instead of multiple bool arguments to gfc_free_omp_namelist.\n    \n    Additionally, add the name 'gfc_omp_list_type' to the existing\n    OMP_LIST_... enum values and OMP_LIST_NONE (== OMP_LIST_NUM)\n    as special value.\n    \n    As an enum is available, use it properly and replace 0 by\n    OMP_LIST_FIRST in the list walks.\n    \n    gcc/fortran/ChangeLog:\n    \n            * gfortran.h (enum gfc_omp_list_type): Add this name\n            to the existing OMP_LIST... enum; add OMP_LIST_NONE.\n            (gfc_free_omp_namelist): Take that enum as arg instead of bool args.\n            * match.cc (gfc_free_omp_namelist): Update.\n            * openmp.cc (gfc_free_omp_clauses, gfc_free_omp_declare_variant_list,\n            gfc_match_omp_clause_reduction, gfc_match_omp_clauses,\n            gfc_match_omp_allocate, gfc_match_omp_flush,\n            gfc_match_omp_declare_target, resolve_omp_clauses,\n            gfc_resolve_omp_parallel_blocks, resolve_omp_do,\n            gfc_resolve_oacc_blocks, gfc_resolve_oacc_declare): Update\n            gfc_free_omp_namelist call and used enum type instead of\n            int.\n            * st.cc (gfc_free_statement): Likewise.\n    \n    Co-Authored-By: Julian Brown <julian@codesourcery.com>\n\n gcc/fortran/gfortran.h |  7 ++--\n gcc/fortran/match.cc   |  9 +++--\n gcc/fortran/openmp.cc  | 95 ++++++++++++++++++++++++++------------------------\n gcc/fortran/st.cc      |  2 +-\n 4 files changed, 61 insertions(+), 52 deletions(-)\n","prefixes":["committed"]}