From patchwork Tue Oct 29 23:08:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 99795 Return-Path: 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 4AB163858294 for ; Tue, 29 Oct 2024 23:08:44 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id 7C6203858C98 for ; Tue, 29 Oct 2024 23:08:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7C6203858C98 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 7C6203858C98 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::42d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730243298; cv=none; b=XDyV1PY9GcBP94oHkCSuXekhh8vR+dnesoQW7pND8OfmPje5dFTxqVv9HcRsOaWuH53M0oFQw9OK9byYRU+yCJsLoi3ywcPeG1G9VUDU0PxkKELTmJGmk4DQgBONxkmn+upO8VwXjOnu4QLndV+vvVpv5CVA1T0ZcKUY7u3G9SE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730243298; c=relaxed/simple; bh=M9fYEtpzMX06/YlvjB8N0uCrASsIBpmm8e0gL+ROWgs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=PIBjaTZUQbpWfoAcd57X45wXkAxAhIti5YRNOm99Lp1wHqMDD+JnblILpN2kye7XZ14xq16Syzb7EkJetw5ann3UZZCkmFlNdd0ejgWGfZ0SyEsluk0Nx8+OZBD69PedLgbC1lz6CWvyDxVo0r7D8mWv0BwRirbRsixJkJi90iU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-71e983487a1so4446835b3a.2 for ; Tue, 29 Oct 2024 16:08:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1730243295; x=1730848095; 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=NWRCn+brn5cbu8XTG8+J+KXF+jvb/nsVBE7T7Fu8SQ8=; b=TpAgOY0ZcaBI7CFaCHVDue/lKMTuWxeSJIpKGIoeo6yQ9tVONl4cmeakAO6pAxrZ82 e253Pup5fIpxF/QwFf57kGLvMFfa6v8WxZFKb1T54T/BW1zYyELOYuG+mxtqjXNHJvDj ZdtRbzsAcXcgSbiMUkVhP0aFmLOba4t3Ow6C18T3CuZReZKVUeNcI5ucxez9SnK8I20i ef5IYqoJA2YiwaavW8AOTZZlWn6GNafyV6iilkQnuK9U5TglU1MQBTJZQOp7sTlN7TWK AX189ltAonU8lfVxR9OhoAwADKJCZUWYsVsz3Xqh+semXzZf231DrwwT/bBjDsknpDs0 xSfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730243295; x=1730848095; 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=NWRCn+brn5cbu8XTG8+J+KXF+jvb/nsVBE7T7Fu8SQ8=; b=G6wNXB5CkbnmBm9101RmA3KqHQdzlh2x3c7tKOtjWCi03q2/1tkEKbOMZ3/T5jcPxE BRcweLKs/i06UYwCzZo/xlGx73J1lubosH43aGebhSISdRgfNgH6N3pJ1qrcePWfLMqH K8lfnCfw7JbQXkxi8spP5YzBp1rUweVxmFbH5JOBJI1e/Q367zi924byC6B7T6MQu+b5 AnrewQxj+Mms45QqTb504dM/rIw92SheMA3tElkN4fIfNIFeEVb+2ABVSs3yOqd6GWyY WVuGESg9hAtNHqBO3XvwIfamvrmmKK/6yOFAqxzBTM5Uuk9SZKXlC6R3jQSA5RWSC/xk pbrg== X-Gm-Message-State: AOJu0YzpjtflHO/zhHeD+ZvWYIn+jW+N1tIM+p4MMnZAnWcxSVpNFSlx jT+LyAdmvgG4oP/YPls4hF9m/2107SpBjg5L8Bl2S5ZWricWmeR9ZmYJasNJXr3r2fugJYn7FgY m15wv X-Google-Smtp-Source: AGHT+IF/VYEK8UYy68aadfagi6a4Ga2IQ2V0TUrdL95dtvHzxx5ocXGWTn+9Scvp1T+rjnJsBzxIkQ== X-Received: by 2002:a05:6a00:cca:b0:71e:64fe:965f with SMTP id d2e1a72fcca58-72063072a39mr19844582b3a.20.1730243295199; Tue, 29 Oct 2024 16:08:15 -0700 (PDT) Received: from free.home ([2804:7f1:218b:69f:6a07:89b4:1723:7949]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7edc8a6f4ddsm8198133a12.91.2024.10.29.16.08.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2024 16:08:14 -0700 (PDT) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 49TN838W1808459 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 29 Oct 2024 20:08:04 -0300 From: Alexandre Oliva To: gcc-patches@gcc.gnu.org Cc: Rainer Orth , Mike Stump Subject: [PATCH] [testsuite] fix pr70321.c PIC expectations Organization: Free thinker, does not speak for AdaCore Date: Tue, 29 Oct 2024 20:08:03 -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.7 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~patchwork=sourceware.org@gcc.gnu.org When we select a non-bx get_pc_thunk, we get an extra mov to set up the PIC register before the abort call. Expect that mov or a get_pc_thunk.bx call. Regstrapped on x86_64-linux-gnu; also tested on i686-linux-gnu with -fPIE. Ok to install? for gcc/testsuite/ChangeLog * gcc.target/i386/pr70321.c: Cope with non-bx get_pc_thunk. --- gcc/testsuite/gcc.target/i386/pr70321.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.target/i386/pr70321.c b/gcc/testsuite/gcc.target/i386/pr70321.c index 58f5f5661c7a2..287b7da1b9501 100644 --- a/gcc/testsuite/gcc.target/i386/pr70321.c +++ b/gcc/testsuite/gcc.target/i386/pr70321.c @@ -9,4 +9,8 @@ void foo (long long ixi) /* { dg-final { scan-assembler-times "mov" 1 { target nonpic } } } */ /* get_pc_thunk adds an extra mov insn. */ -/* { dg-final { scan-assembler-times "mov" 2 { target { ! nonpic } } } } */ +/* Choosing a non-bx get_pc_thunk requires another mov before the abort call. + So we require a match of either that mov or the get_pc_thunk.bx call, in + addition to the other 2 movs. (Hopefully there won't be more calls for a + false positive.) */ +/* { dg-final { scan-assembler-times "mov|call\[^\n\r]*get_pc_thunk\.bx" 3 { target { ! nonpic } } } } */