From patchwork Thu Oct 24 18:42:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 2001889 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=GOdClitr; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; 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 [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 4XZFD82hG1z1xw8 for ; Fri, 25 Oct 2024 05:43:20 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3A8493858406 for ; Thu, 24 Oct 2024 18:43:18 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 53D0F3858D21 for ; Thu, 24 Oct 2024 18:42:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 53D0F3858D21 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 53D0F3858D21 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729795373; cv=none; b=bLS/oy3k4qFjYyN84hG0aEIhbvv/Fg8wAuqlfJdMpgt5NpL+ObT3A4KD6ekKRamuWz2RtEhQQdaNzlkpYQ9ZrOmaTHu/bBZyLmNKyqMx7V7RnJySL5qSbDh4il3rGRSVSUWXXX2Bj+U1eK26Aacb0OzXr0vU0kazx6XtlFjTv9s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729795373; c=relaxed/simple; bh=BrQu5BlfEPiakN38rgaJByaxH63wznbOZ3pR/ArXAqg=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=JD39+JicDY66VTUjVqqLvEAAy6Lu90osroZIO7rho4Hg7Cvnrnfbi6/gsX804BFwLGpSBvvOqk0cKak9rHuPVpSRWirqaMVwv10H42cgjfDMYO1JDKwMVfx7C8+c7p+/DZHkMvxQMEeiZHd49uyhfDnzX2KOEFs0V8hTNKDgLkw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729795371; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=y+nVj7afbp6811K5zqMPKtjkvZM6+0N8jDtgqs5EEXQ=; b=GOdClitrYntqqoJNNdCFBnhagSt7AzPeVnMCoi7vhpScNsPS/zWWSWx8Fv0vB5kq8kBHUe Fz8U1wknl/KsVvwL7XwUbYkkpF0r7eq4O1vz7h/ajuAYK3B3ewvZ9LPMZJaKRFEiHYKdrE 25EuqOyu95AJUdzVyl9drWDp1SgKCHY= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-173-O00zRNFeMVOKDXtlZsfHXQ-1; Thu, 24 Oct 2024 14:42:49 -0400 X-MC-Unique: O00zRNFeMVOKDXtlZsfHXQ-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4314f1e0f2bso9048655e9.1 for ; Thu, 24 Oct 2024 11:42:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729795368; x=1730400168; h=mime-version:message-id:subject:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=y+nVj7afbp6811K5zqMPKtjkvZM6+0N8jDtgqs5EEXQ=; b=Q22M1TAPWorojDcEoHtcniMuPJzZfEnJPGjtAtUPqXbyaOP6HW8LWof51y8r6N3/+r lE0EhB8wXGUxyCz5S3CvIfLvpbq2LWDp+ozI7JDGhMjYuHDB0tl5rnqezcT7LQ+bRXHR 6/VbnkGI8tGXXXYTCoDCPFvQBWOZyGTNXiM3egfwTd2Nkzi3m6mO4AwtrtGf/+qR2CyN CKP5Nf1kOtRZn5K4EH6UvTPJkycwYfMqua98ykNXusTfXkMrccgheXv3gxkcXSNNPFke 7QYsbwWhsbEEbEbzLHE/uEvV+H/fMcA2ppCX0hD5j6k6X3OPuNtTGoY+GV65D+ESYh9c /k2g== X-Gm-Message-State: AOJu0YzhFZRCWlHyWMNc7NbcU0CnrLLJ6HRNM2C5Zrooygq/0Xe4gJOl acG0sSxyvWbTgP/YV7+xmpm/SAjs5lbWWpi9gYGG0ZRqlLO+nyr0NbOyO6C2/l23d9bwXy6nP9V ARlGJIkqCyaijKkJoO52vaCxqxqW1Gbrl+Wc9Zey8hsPO/sR326K8AqTHe8eolRGnQnldQf8abq U+2O0DV9dWr/WnvMp4f+D/Q1VgiIZ1hrxkMZcljss= X-Received: by 2002:a5d:6707:0:b0:37e:d2b7:acd5 with SMTP id ffacd0b85a97d-37efceedf6cmr4359271f8f.8.1729795368233; Thu, 24 Oct 2024 11:42:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEFYEnG/qgBBBxMtM1aZTIVmgyPn3RMg+mdqqE4Dz8bRfkCScE6WnM1JUrpwQAlKbbVHQHz0w== X-Received: by 2002:a5d:6707:0:b0:37e:d2b7:acd5 with SMTP id ffacd0b85a97d-37efceedf6cmr4359262f8f.8.1729795367732; Thu, 24 Oct 2024 11:42:47 -0700 (PDT) Received: from digraph.polyomino.org.uk (digraph.polyomino.org.uk. [2001:8b0:bf73:93f7::51bb:e332]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37ee0a37a2fsm11930776f8f.22.2024.10.24.11.42.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 11:42:47 -0700 (PDT) Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.97) (envelope-from ) id 1t42mX-00000006hv7-3uhf for gcc-patches@gcc.gnu.org; Thu, 24 Oct 2024 18:42:01 +0000 Date: Thu, 24 Oct 2024 18:42:01 +0000 (UTC) From: Joseph Myers To: gcc-patches@gcc.gnu.org Subject: testsuite: Use -fno-ipa-icf in gcc.dg/stack-check-2.c Message-ID: <9a8c3137-db22-9217-2307-6dffe964a67a@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, 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.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 One test failing with a -std=gnu23 default that I wanted to investigate further is gcc.dg/stack-check-2.c. The failures are FAIL: gcc.dg/stack-check-2.c scan-tree-dump-not optimized "tail call" FAIL: gcc.dg/stack-check-2.c scan-tree-dump-not tailc "tail call" but it turns out the tail calls in question are not the ones that test is actually checking for. Rather, when () is interpreted as (void) in C23 mode, ICF notices that certain functions are identical and so turns test_indirect_2 into a tail call to text_indirect_1 and test_indirect_casted_2 into a tail call to test_indirect_casted_1 (which it didn't do previously when one function used () and one used (void)). To avoid these spurious failures, make the test use -fno-ipa-icf rather than relying on () and (void) giving different function types to avoid ICF. Tested for x86_64-pc-linux-gnu. OK to commit? * gcc.dg/stack-check-2.c: Use -fno-ipa-icf. diff --git a/gcc/testsuite/gcc.dg/stack-check-2.c b/gcc/testsuite/gcc.dg/stack-check-2.c index 196c4bbfbdd..a821c0ef865 100644 --- a/gcc/testsuite/gcc.dg/stack-check-2.c +++ b/gcc/testsuite/gcc.dg/stack-check-2.c @@ -12,7 +12,7 @@ depend on to elide stack probes. */ /* { dg-do compile } */ -/* { dg-options "-O2 -fstack-clash-protection -fdump-tree-tailc -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fstack-clash-protection -fdump-tree-tailc -fdump-tree-optimized -fno-ipa-icf" } */ /* { dg-require-effective-target supports_stack_clash_protection } */ extern void foo (void) __attribute__ ((__noreturn__));