From patchwork Tue May 21 02:51:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 1937196 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=kwWLvmpn; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VjzWP41gWz20KF for ; Tue, 21 May 2024 12:52:49 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6101B3858C3A for ; Tue, 21 May 2024 02:52:46 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by sourceware.org (Postfix) with ESMTPS id EB4E93858D1E for ; Tue, 21 May 2024 02:52:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EB4E93858D1E Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EB4E93858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716259939; cv=none; b=GVPaY+8eq57HHr76BY0k1k4CXxA0cH0TBnhiYpMU4k888yoiM7RvLSuFcu5OlcUTRm3jJCc66n5QDmEPMpD/l0AdC1u9LGYka0b3pgMFMNLQU2R2pYlDwN3OTSqfenkNIl0kX2447vKdcIin382HChrmsNCBPfy+Y1yGuyMXl9c= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716259939; c=relaxed/simple; bh=InWpfWjXz/400MBQTE7oQrWqNnfbZ1OTXi6og4CN5mc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=GylEd17K1MIABaN1pSv3VUFL6lGhChnCSTjtH5DQniODqm7AHq3HJKMaL3oGov+f7VRCNGa+OsW6HUG2he+oGLB3nm1ZiPlzT//fFOKGEhRTL7D3F5cA05MEbuwjDsKTWwLi7TXBlm4mw/t2GycIkjQ8NSCh6R0xaCqbhzTjqH4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1ee12baa01cso102148385ad.0 for ; Mon, 20 May 2024 19:52:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1716259933; x=1716864733; darn=gcc.gnu.org; h=mime-version:user-agent:message-id:date:organization:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=ivU/TnjmOFrF3FilLL+xLyXp7gMyjLtg9gRYMkKJuXM=; b=kwWLvmpngmoG1/V2sV+wafibQaXSf1WRJtIAxC6H2cZXU3dRHG6Jk64e9/u84CMvkU X9LwodRsZenDhNTOc5HmMJ2KTue9x5Zlt5etarmTH00utNB9g5Oxr3MhFI06gl5DdtM1 zrrhE7inB7ZLWB32NhuPzXnay6l+mB8U6/R8lh/GLKVlQc+Y1kH+tllXEu0e62PTETK8 c5qxNCIeDzx6C+SThfmbyNbFdxfBLf2KMbH+f00PgcaIPfBbT62y/PId+q6FM2gPRlXI uikfEwqs4/f/RIB7WaT1K0xH70s+ZHPFwGVRLq96f/jnFGMgkIUeo0l/qTFOayHIzrEr L4fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716259933; x=1716864733; h=mime-version:user-agent:message-id:date:organization:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ivU/TnjmOFrF3FilLL+xLyXp7gMyjLtg9gRYMkKJuXM=; b=WEIExpHBO8C+GTHpcDOFDo10Km+JGdb8N0a/+Yad/nrL+0pUQJFrNG7Vzvbor2w696 9gsu4NUj5hhlrbtOWu+4gnc0t5ynT5wzdv5Elte7kDxdYzbTSEiFT1WLhYgZFDTwFi+k uN6CbD8U+N6pVT8QZVTsCdh9qCc8THpJAy1g9bquCPjPFrC0Y3kHo2Bv4zYYFIQNfu57 zbEDwJ2Rpfq8eBBl7cEtU3T9JWVAKm1nbwtjAkarjVZlTqmvF3dCaxW3xjZaIRTIAJ9y r0wiOj/Vkb51gfUqOyZxHX46UGkp7ur1oQ3l+wY/Kt5NRTiY2XVuZy9ruL6qiW1xTz8u Syfw== X-Gm-Message-State: AOJu0YwUWm3V3TMf3jGzbTIH8GGUyeMTLmxeymspt4dH9gegfb3E8UvU OwQxU43sEs8D9qiNZ092JVodzX2eLmmpNk/GWtjZBL3RkSTfYQ/GxIRLbGQunDFQclAu4t5rPz2 fCg== X-Google-Smtp-Source: AGHT+IH0hW9thFybw/0sInvByIQkByZc2lBqt4K7mBt1BtBXFVTd9Bz1sxb6Wrej6Hb3SZQREJAzDQ== X-Received: by 2002:a05:6a20:dc94:b0:1af:a9ad:fbb9 with SMTP id adf61e73a8af0-1afde1c5dcemr25832096637.59.1716259932617; Mon, 20 May 2024 19:52:12 -0700 (PDT) Received: from free.home ([2804:7f1:218b:1961:ef8:d680:5399:8b1a]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f4d2a86fb3sm19712905b3a.86.2024.05.20.19.52.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 19:52:12 -0700 (PDT) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 44L2pmwG092708 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 20 May 2024 23:51:49 -0300 From: Alexandre Oliva To: gcc-patches@gcc.gnu.org Cc: Rainer Orth , Mike Stump , Joel Sherrill , Ralf Corsepius , Sebastian Huber Subject: [PATCH] [testsuite] cope with rtems implicit -ftls-model=local-exec Organization: Free thinker, does not speak for AdaCore Date: Mon, 20 May 2024 23:51:48 -0300 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, WEIRD_QUOTING 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org gcc/config/rtems.h's OS_CC1_SPEC changes the -ftls-model default to local-exec, which breaks some tests that compile with PIC and thus expect dynamic TLS access models. I assume the default overriding even with PIC is intended, so I'm adjusting the testcases. For those in gcc.dg/tls, I adjusted the ipa dump expectations, so that they check for tls-local- only, which covers both -dynamic and -exec. For those in g{cc,++}.target/aarch64/sve, I've added a -ftls-local overrider, so that the expected opcodes for dynamic TLS are generated. Regstrapped on x86_64-linux-gnu. Also tested with gcc-13 targeting aarch64-rtems6. Ok to install? for gcc/testsuite/ChangeLog * gcc.dg/tls/vis-attr-hidden.c: Match tls-local- for both -dynamic and -exec. Note rtems's default. * gcc.dg/tls/vis-flag-hidden.c: Likewise. * gcc.dg/tls/vis-pragma-hidden.c: Likewise. * gcc.target/aarch64/sve/tls_1.c: Override -ftls-model default on rtems. * gcc.target/aarch64/sve/tls_preserve_2.c: Likewise. * gcc.target/aarch64/sve/tls_preserve_3.c: Likewise. * g++.target/aarch64/sve/tls_2.C: Likewise. --- gcc/testsuite/g++.target/aarch64/sve/tls_2.C | 1 + gcc/testsuite/gcc.dg/tls/vis-attr-hidden.c | 3 ++- gcc/testsuite/gcc.dg/tls/vis-flag-hidden.c | 3 ++- gcc/testsuite/gcc.dg/tls/vis-pragma-hidden.c | 3 ++- gcc/testsuite/gcc.target/aarch64/sve/tls_1.c | 1 + .../gcc.target/aarch64/sve/tls_preserve_2.c | 1 + .../gcc.target/aarch64/sve/tls_preserve_3.c | 1 + 7 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/g++.target/aarch64/sve/tls_2.C b/gcc/testsuite/g++.target/aarch64/sve/tls_2.C index a1a2c85e59106..23004d9984d5f 100644 --- a/gcc/testsuite/g++.target/aarch64/sve/tls_2.C +++ b/gcc/testsuite/g++.target/aarch64/sve/tls_2.C @@ -2,6 +2,7 @@ /* { dg-require-effective-target tls } */ /* { dg-options "-O2 -fPIC -msve-vector-bits=256" } */ /* { dg-require-effective-target fpic } */ +/* { dg-additional-options "-ftls-model=global-dynamic" { target *-*-rtems* } } */ #include diff --git a/gcc/testsuite/gcc.dg/tls/vis-attr-hidden.c b/gcc/testsuite/gcc.dg/tls/vis-attr-hidden.c index 0d43fc565b090..007d382fa9a0a 100644 --- a/gcc/testsuite/gcc.dg/tls/vis-attr-hidden.c +++ b/gcc/testsuite/gcc.dg/tls/vis-attr-hidden.c @@ -9,4 +9,5 @@ __thread int x; void reference() { x++; } -/* { dg-final { scan-ipa-dump "Varpool flags: tls-local-dynamic" "whole-program" } } */ +/* rtems defaults to local-exec, others should get local-dynamic. */ +/* { dg-final { scan-ipa-dump "Varpool flags: tls-local-" "whole-program" } } */ diff --git a/gcc/testsuite/gcc.dg/tls/vis-flag-hidden.c b/gcc/testsuite/gcc.dg/tls/vis-flag-hidden.c index a15df092d4d0c..baf248dc3babc 100644 --- a/gcc/testsuite/gcc.dg/tls/vis-flag-hidden.c +++ b/gcc/testsuite/gcc.dg/tls/vis-flag-hidden.c @@ -9,4 +9,5 @@ __thread int x; void reference() { x++; } -/* { dg-final { scan-ipa-dump "Varpool flags: tls-local-dynamic" "whole-program" } } */ +/* rtems defaults to local-exec, others should get local-dynamic. */ +/* { dg-final { scan-ipa-dump "Varpool flags: tls-local-" "whole-program" } } */ diff --git a/gcc/testsuite/gcc.dg/tls/vis-pragma-hidden.c b/gcc/testsuite/gcc.dg/tls/vis-pragma-hidden.c index 1be97644243ab..50cd010924cfb 100644 --- a/gcc/testsuite/gcc.dg/tls/vis-pragma-hidden.c +++ b/gcc/testsuite/gcc.dg/tls/vis-pragma-hidden.c @@ -13,4 +13,5 @@ __thread int x; void reference() { x++; } -/* { dg-final { scan-ipa-dump "Varpool flags: tls-local-dynamic" "whole-program" } } */ +/* rtems defaults to local-exec, others should get local-dynamic. */ +/* { dg-final { scan-ipa-dump "Varpool flags: tls-local-" "whole-program" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/sve/tls_1.c b/gcc/testsuite/gcc.target/aarch64/sve/tls_1.c index 43c52bc2b9061..71f354dfe1b48 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/tls_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/tls_1.c @@ -1,5 +1,6 @@ /* { dg-options "-O2 -fPIC -msve-vector-bits=256" } */ /* { dg-require-effective-target fpic } */ +/* { dg-additional-options "-ftls-model=global-dynamic" { target *-*-rtems* } } */ typedef unsigned int v8si __attribute__((vector_size(32))); diff --git a/gcc/testsuite/gcc.target/aarch64/sve/tls_preserve_2.c b/gcc/testsuite/gcc.target/aarch64/sve/tls_preserve_2.c index 20e939fbb85b4..1f477ba8c2599 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/tls_preserve_2.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/tls_preserve_2.c @@ -2,6 +2,7 @@ /* { dg-options "-O3 -fpic -msve-vector-bits=256 -fno-schedule-insns" } */ /* { dg-require-effective-target fpic } */ /* { dg-require-effective-target tls_native } */ +/* { dg-additional-options "-ftls-model=global-dynamic" { target *-*-rtems* } } */ typedef float v8si __attribute__ ((vector_size (32))); diff --git a/gcc/testsuite/gcc.target/aarch64/sve/tls_preserve_3.c b/gcc/testsuite/gcc.target/aarch64/sve/tls_preserve_3.c index a19908f29b6a1..6e1a82698bde2 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/tls_preserve_3.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/tls_preserve_3.c @@ -2,6 +2,7 @@ /* { dg-options "-O3 -fpic -msve-vector-bits=512 -fno-schedule-insns" } */ /* { dg-require-effective-target fpic } */ /* { dg-require-effective-target tls_native } */ +/* { dg-additional-options "-ftls-model=global-dynamic" { target *-*-rtems* } } */ typedef float v16si __attribute__ ((vector_size (64)));