From patchwork Tue Jun 4 16:49:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 1943484 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; unprotected) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=RR/7qjfK; 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 4VtxQZ1Rhdz20Tb for ; Wed, 5 Jun 2024 02:49:42 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4C5B53929C4D for ; Tue, 4 Jun 2024 16:49:40 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id 59E1039832DE for ; Tue, 4 Jun 2024 16:49:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 59E1039832DE Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=baylibre.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 59E1039832DE Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::331 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717519758; cv=none; b=OWCoMXFtSbBcygzUqZn2XBuueZCiJUXfKiujZRYWSb9HCWcc3sbRz6DLZGjRrWPZzxXFfXQxh6r+M35I5vFJ8jfD42RowSHJiaLUxOCU9tvdyA5zzp2LuJ3EoNwFgjHTBTU4wXGrB/9sXL7We0UPqelZzJAwEmOgVPEHGhMrGwc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717519758; c=relaxed/simple; bh=96D7TXmDlDNxmPOaegX4dHpqze5SWTy54Afbhc+/hZc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=fX6l+LvEvqi0Xa02nzJYpxdPVkhVj4jakcZbsUQkKtCjVTelHRo5q+K5jny51moFAzTAGe1LXE5Gwq7JEPmuOzJc0rbAkbTCOGvaBjzKvcquG/NZkeorCjBGIeSJJVcYBP8utwhB2LBifVpM94nNVaf5hhGIKpDLva3aDuu9EV8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-42122ac2f38so21945e9.1 for ; Tue, 04 Jun 2024 09:49:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1717519753; x=1718124553; darn=gcc.gnu.org; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=YcfJybWIeXcO+MYfGgeJc2XLax12ArfWFvssxvYXs3k=; b=RR/7qjfKboZS5xCui3w3lf4ZlSRWcfs/5UpEkLG4JDNAfSKFzLe3+xOBaB50hSDVDa N63e5PU3Pi89Dq6Gc6L2q9eEbMWzzLrkYZMK/YTpAIPGhDBggemxwsaajH8xW9U8VSDx zWSo70AVkvJo/B2A52v+8IyoAFGntnuNRr3f3JZTcOCkss9DYyG6MrAoipW2MpyujKV2 9R3RgvUFzBDgAfSUWDqkZQyjdG+vMK18754ZOpXxcv6jJjtzhnxez5uFgM5A/42zA0jo ZW17MkRE060tT6P92OJDpvETYiO+2ZUHR5UmAvhbCd/HgFTFx1nWD+fX4ao3WmxorUIN twwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717519753; x=1718124553; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=YcfJybWIeXcO+MYfGgeJc2XLax12ArfWFvssxvYXs3k=; b=G0GnhIZwACgUS3kMw2igAgdIu+OUrVmEo8rMKPuMRqVplz7QU3VlFCErNElfGaF4/x qqwgLy2860I1NUl5N+XLI9p9ZPLe5Rf9Z30oxel1jHACquLcrc05ToyBvMTmeidX7GI2 xAoMna544KHSj/U3zWHdjTSZzTXvN6CZEgM6gYiCdQ5TGnh7Ae/S2kwZV/6OXJxTN+0k gzAJSq4UOzoe8Y3X+0rVncHDnLxh5EhZtV40As7FP7dCka5GNTuk596OHRe25XogX6O7 UrlgIgQbDPMFELftoxzwrx4dJDsRhlGOBeTBJDPn8cIwxZMei89bw/8CfqOYuOApPP/C gimA== X-Gm-Message-State: AOJu0YyxJ4yhP5e1LdzeId8yaOnIHrXvzeqdlZaBe5Tc3vX0ZpxGPHPN fCb2ymgJRCL5QNBHR6jeg/2YDUmPuPe2KBFLRvdW7OuIz3QleYkMaiZ2srfoSpnpBV5VkO0jmXP d X-Google-Smtp-Source: AGHT+IFwucG9d/wjsbLqSA31jB/QgA/2E3ZyjeO4ayPBJ/O7+/VKydYUKJaG5pFeBkl4+D8urBDYIw== X-Received: by 2002:a05:600c:19c7:b0:421:2ee4:6b94 with SMTP id 5b1f17b1804b1-42145117f43mr31169545e9.5.1717519752932; Tue, 04 Jun 2024 09:49:12 -0700 (PDT) Received: from euler.schwinge.ddns.net (p200300c8b735b200abad01548d5b2541.dip0.t-ipconnect.de. [2003:c8:b735:b200:abad:154:8d5b:2541]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42127062f0dsm190248525e9.17.2024.06.04.09.49.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 09:49:12 -0700 (PDT) From: Thomas Schwinge To: gcc-patches@gcc.gnu.org Cc: Jan Hubicka , "H.J. Lu" , Richard Biener Subject: Clarify that 'gcc.dg/initpri3.c' is a LTO variant of 'gcc.dg/initpri1.c': 'gcc.dg/initpri1-lto.c' [PR46083] (was: PR lto/46083 (destructor priorities are wrong)) In-Reply-To: References: <20110109010150.GE28524@kam.mff.cuni.cz> <20110109175631.GA21649@kam.mff.cuni.cz> User-Agent: Notmuch/0.30+8~g47a4bad (https://notmuchmail.org) Emacs/29.3 (x86_64-pc-linux-gnu) Date: Tue, 04 Jun 2024 18:49:08 +0200 Message-ID: <87y17kejqz.fsf@euler.schwinge.ddns.net> MIME-Version: 1.0 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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 Hi! On 2011-01-10T13:56:06+0100, Richard Guenther wrote: > On Sun, 9 Jan 2011, Jan Hubicka wrote: >> On 2011-01-09T07:24:57-0800, "H.J. Lu" wrote: >> > On Sat, Jan 8, 2011 at 5:01 PM, Jan Hubicka wrote: >> > > the PR is about testsuite/initpri1.c failing with lto. >> > > >> > > I am not sure why the testcase is not run with -flto flags. It is declared as >> > > /* { dg-do run { target init_priority } } */ and thus I would expect all >> > > default flags >> > > to be cycled over. >> > >> > It is because it isn't in lto nor torture directories. >> > > The problem is simple - FINI_PRIORITY is not streamed at all.  [...] >> > >> > Can you add a testcase? >> >> Copying initpri1.c into lto directory should do the trick then, right? >> I will give it a try. > > Ok with a testcase. No need for "Copying initpri1.c" if there's '#include "initpri1.c"'. ;-P (In preparation for further changes) OK to push the attached "Clarify that 'gcc.dg/initpri3.c' is a LTO variant of 'gcc.dg/initpri1.c': 'gcc.dg/initpri1-lto.c' [PR46083]"? Grüße Thomas From 102c530d32b06e98b3536841b760fc16e9fac7eb Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Wed, 24 Apr 2024 10:11:02 +0200 Subject: [PATCH] Clarify that 'gcc.dg/initpri3.c' is a LTO variant of 'gcc.dg/initpri1.c': 'gcc.dg/initpri1-lto.c' [PR46083] Added in commit 06c9eb5136fe0e778cc3a643131eba2a3dfb77a8 (Subversion r168642) "re PR lto/46083 (gcc.dg/initpri1.c FAILs with -flto/-fwhopr (attribute constructor/destructor doesn't work))". PR lto/46083 gcc/testsuite/ * gcc.dg/initpri3.c: Remove. * gcc.dg/initpri1-lto.c: New. --- .../gcc.dg/{initpri3.c => initpri1-lto.c} | 61 +------------------ 1 file changed, 1 insertion(+), 60 deletions(-) rename gcc/testsuite/gcc.dg/{initpri3.c => initpri1-lto.c} (12%) diff --git a/gcc/testsuite/gcc.dg/initpri3.c b/gcc/testsuite/gcc.dg/initpri1-lto.c similarity index 12% rename from gcc/testsuite/gcc.dg/initpri3.c rename to gcc/testsuite/gcc.dg/initpri1-lto.c index 1633da0141f..98a43c3ff0d 100644 --- a/gcc/testsuite/gcc.dg/initpri3.c +++ b/gcc/testsuite/gcc.dg/initpri1-lto.c @@ -2,63 +2,4 @@ /* { dg-require-effective-target lto } */ /* { dg-options "-flto -O3" } */ -extern void abort (); - -int i; -int j; - -void c1() __attribute__((constructor (500))); -void c2() __attribute__((constructor (700))); -void c3() __attribute__((constructor (600))); - -void c1() { - if (i++ != 0) - abort (); -} - -void c2() { - if (i++ != 2) - abort (); -} - -void c3() { - if (i++ != 1) - abort (); -} - -void d1() __attribute__((destructor (500))); -void d2() __attribute__((destructor (700))); -void d3() __attribute__((destructor (600))); - -void d1() { - if (--i != 0) - abort (); -} - -void d2() { - if (--i != 2) - abort (); -} - -void d3() { - if (j != 2) - abort (); - if (--i != 1) - abort (); -} - -void cd4() __attribute__((constructor (800), destructor (800))); - -void cd4() { - if (i != 3) - abort (); - ++j; -} - -int main () { - if (i != 3) - return 1; - if (j != 1) - abort (); - return 0; -} +#include "initpri1.c" -- 2.34.1