Message ID | 20221109190225.96037-1-aldot@gcc.gnu.org |
---|---|
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D8E9238418A5 for <patchwork@sourceware.org>; Wed, 9 Nov 2022 19:03:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D8E9238418A5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668020598; bh=zC8l1lmXQ3uqqz2YdeXRwc1tz9T5a8iLRPcRBWEicfI=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=tHyytAjxlOZtVXn5p5MmV2SuedIgBqmW4ouhABdpQ7CQKTZ5G26N02Lnk8vVBPaSK kaNbF1WFEKjtEhvxlVF8nHmMUY2tJcMkj+TQ50eAcDJk1CPJQJJAOJVZTPWTznue2l O34/lAJgZ/eErQZx7Fy56GXqb5BXVb3jR5gyhcJc= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by sourceware.org (Postfix) with ESMTPS id 9DAC83858D20; Wed, 9 Nov 2022 19:02:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9DAC83858D20 Received: by mail-ed1-x530.google.com with SMTP id i21so28492060edj.10; Wed, 09 Nov 2022 11:02:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zC8l1lmXQ3uqqz2YdeXRwc1tz9T5a8iLRPcRBWEicfI=; b=QPfgRQ4o9J19HfUMX+VvgA0khYJuPO6VoHC+m5+nGYktVN4WV9pCUpzBL4FvPhIQUc SR9mYFUE1I81Mfco1aGNZV9hHVrgGj7t0o7FKI3PY43JEDx73rShA4Jn/lNpQosNEwru jrwWDyTysA6ER/YBBI7p3CEistcpdBRBbGM0L3YX4AvLspFFRsYdm0QwS0ojRoXsyiiN QAId/eI4apxdbZPtazjwSa9r8rAht1Oe+jMLCNZ18yCV35HpxKyGnpt/FNIM6olFKtbt tGvGRzNJV8Edx3Go0P9Phub+aRUTUixZiAXIXCs79XxDsyQkVSgjCJQJaHsu994QDQku nPCA== X-Gm-Message-State: ACrzQf1TG5sNegOe5iOG0U7BSGlXE/Cpje/7dhmxuo9E6H7Dsyjebd0i UQkbNA+xW3q/HZQyPX04CsY= X-Google-Smtp-Source: AMsMyM40+T2wmwWixv8cBQXE5DfBIEP90WNztLknLc8tYmhq0Uh837XlrRWq66y8dLxN9yqPUX5+sA== X-Received: by 2002:a05:6402:5253:b0:461:e870:8507 with SMTP id t19-20020a056402525300b00461e8708507mr60743324edd.323.1668020558172; Wed, 09 Nov 2022 11:02:38 -0800 (PST) Received: from nbbrfq (80-110-214-113.static.upcbusiness.at. [80.110.214.113]) by smtp.gmail.com with ESMTPSA id lb25-20020a170907785900b00780f6071b5dsm6149256ejc.188.2022.11.09.11.02.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 11:02:37 -0800 (PST) X-Google-Original-From: Bernhard Reutner-Fischer <aldot@gcc.gnu.org> Received: from b by nbbrfq with local (Exim 4.96) (envelope-from <b@localhost>) id 1osqLM-000OzI-1w; Wed, 09 Nov 2022 20:02:36 +0100 To: gcc-patches@gcc.gnu.org Cc: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>, Bernhard Reutner-Fischer <aldot@gcc.gnu.org>, gfortran ML <fortran@gcc.gnu.org> Subject: [PATCH 0/2] Fortran: add attribute target_clones Date: Wed, 9 Nov 2022 20:02:23 +0100 Message-Id: <20221109190225.96037-1-aldot@gcc.gnu.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <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>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Bernhard Reutner-Fischer via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
Fortran: add attribute target_clones
|
|
Message
Bernhard Reutner-Fischer
Nov. 9, 2022, 7:02 p.m. UTC
Hi! These two patches add support for attribute target_clones to the fortran frontend. 1) The symtab hunk is identical to the one sent in https://gcc.gnu.org/pipermail/gcc-patches/2022-November/605081.html which had some additional information. I only tested it on x86_64-unknown-linux and for languages c,fortran,c++,lto so far, i.e. not for ada,go,d,modula2 2) fortran FE hunks I'm aware that the documentation will have to be rewritten now for Sphinx. I'll will take care of that before pushing the change anyway, of course. The fortran FE part works as intended. Note that it is of course not possible to mix ISA features of different target architectures, i.e. "sse","avx512f" is fine, "powerpc7" in the same attribute is prohibited. There is a gotcha that took me a while to (re-)notice when writing the testcase though: We (the fortran FE, fortran/cpp.cc) do not define arch defines. Consider: $ echo -e "#ifndef __x86_64__\nbummer\n#endif\nend" > /tmp/ouch.F95 $ ./gfortran -B. -c -o /tmp/ouch.o /tmp/ouch.F95 /tmp/ouch.F95:2:1: 2 | bummer | 1 Error: Unclassifiable statement at (1) $ echo -e "#ifndef __x86_64__\nbummer\n#endif" \ | ./xgcc -B. -x f95-cpp-input -ffree-form -E -dD - | grep -i x86 $ # nothing versus $ echo -e "#ifndef __x86_64__\nbummer\n#endif" \ | ./xgcc -B. -x assembler-with-cpp -E -dD - | grep -i x86 #define __x86_64 1 #define __x86_64__ 1 I'm sure we have existing PRs about those missing defines but i didn't look yet. Bernhard Reutner-Fischer (2): symtab: also change RTL decl name Fortran: add attribute target_clones gcc/fortran/decl.cc | 104 ++++++++++++++++++ gcc/fortran/f95-lang.cc | 4 + gcc/fortran/gfortran.h | 2 + gcc/fortran/gfortran.texi | 31 ++++++ gcc/fortran/trans-decl.cc | 3 + gcc/symtab.cc | 6 +- .../gfortran.dg/attr_target_clones-1.F90 | 30 +++++ 7 files changed, 178 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/attr_target_clones-1.F90