From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 0A6183858D28 for ; Wed, 3 May 2023 11:46:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0A6183858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 2C58620050; Wed, 3 May 2023 11:46:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1683114410; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=mtGur7SK4x9tEmeNuLhg45rL0Zu5rL6iAouB4R3gIFk=; b=XQkfoBEwyH31YESRKO56H65PncvmKphBn3Al3wYLs+rPmldI3FrGin4E9/YCK3zOpPAMXq T1H0by0qliRRA9KvuHmykWfM6S6aq8QBAWCtGQ5H4l/hyUsQQOD5PsHvAgxdgsP+rMRkeK IeauktvHFvVVyldqcxteOqcKWlNSSaI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1683114410; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=mtGur7SK4x9tEmeNuLhg45rL0Zu5rL6iAouB4R3gIFk=; b=4DMrITcg6lBHk77k9QLZ75pTqG3oml1/0iOLGSpEL6dS9wSrDMLuMgZl+IjZ/JvddSM2IC iHBUGoi2ypl45aDg== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id D324C2C141; Wed, 3 May 2023 11:46:49 +0000 (UTC) Date: Wed, 3 May 2023 11:46:49 +0000 (UTC) From: Richard Biener To: Thomas Schwinge cc: Jan Hubicka , gcc-patches@gcc.gnu.org, Rainer Orth , Mike Stump Subject: Re: Let each 'lto_init' determine the default 'LTO_OPTIONS', and 'torture-init' the 'LTO_TORTURE_OPTIONS' (was: Update testsuite to run with slim LTO) In-Reply-To: <875y99d5rt.fsf@euler.schwinge.homeip.net> Message-ID: References: <20110927172322.GA21068@kam.mff.cuni.cz> <875y99d5rt.fsf@euler.schwinge.homeip.net> User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 List-Id: On Wed, 3 May 2023, Thomas Schwinge wrote: > Hi! > > This very likely isn't the only instance of such a kind of problem in the > GCC testsuite ;-) -- but it's one that I've run into, and analyzed: > > On 2011-09-27T19:23:22+0200, Jan Hubicka wrote: > > this patch updates testsuite to cover both fat and slim LTO when linker plugin > > is used [...] > > This change here: > > > *** lib/lto.exp (revision 179274) > > --- lib/lto.exp (working copy) > > *************** proc lto_init { args } { > > *** 66,79 **** > > # You can put this in the environment before site.exp is written or > > # add it to site.exp directly. > > if ![info exists LTO_OPTIONS] { > > ! set LTO_OPTIONS [list \ > > ! {-O0 -flto -flto-partition=none } \ > > ! {-O2 -flto -flto-partition=none } \ > > ! {-O0 -flto -flto-partition=1to1 } \ > > ! {-O2 -flto -flto-partition=1to1 } \ > > ! {-O0 -flto} \ > > ! {-O2 -flto} \ > > ! ] > > } > > } > > > > --- 66,89 ---- > > # You can put this in the environment before site.exp is written or > > # add it to site.exp directly. > > if ![info exists LTO_OPTIONS] { > > ! if [check_linker_plugin_available] { > > ! set LTO_OPTIONS [list \ > > ! {-O0 -flto -flto-partition=none -fuse-linker-plugin} \ > > ! {-O2 -flto -flto-partition=none -fuse-linker-plugin -fno-fat-lto-objects } \ > > ! {-O0 -flto -flto-partition=1to1 -fno-use-linker-plugin } \ > > ! {-O2 -flto -flto-partition=1to1 -fno-use-linker-plugin } \ > > ! {-O0 -flto -fuse-linker-plugin -fno-fat-lto-objects } \ > > ! {-O2 -flto -fuse-linker-plugin} \ > > ! ] > > ! } else { > > ! set LTO_OPTIONS [list \ > > ! {-O0 -flto -flto-partition=none } \ > > ! {-O2 -flto -flto-partition=none } \ > > ! {-O0 -flto -flto-partition=1to1 } \ > > ! {-O2 -flto -flto-partition=1to1 } \ > > ! {-O0 -flto } \ > > ! {-O2 -flto} \ > > ! } > > } > > } > > ... is problematic: initializing the persistent 'LTO_OPTIONS' dependent > on 'check_linker_plugin_available' that is (potentially) variable per > testing variant ('RUNTESTFLAGS=--target_board=unix\{-m64,-m32\}', for > example). > > Similarly: > > > *** lib/c-torture.exp (revision 179274) > > --- lib/c-torture.exp (working copy) > > *************** if [info exists ADDITIONAL_TORTURE_OPTIO > > *** 52,61 **** > > > > set LTO_TORTURE_OPTIONS "" > > if [check_effective_target_lto] { > > ! set LTO_TORTURE_OPTIONS [list \ > > ! { -O2 -flto -flto-partition=none } \ > > ! { -O2 -flto } > > ! ] > > } > > > > global GCC_UNDER_TEST > > --- 52,69 ---- > > > > set LTO_TORTURE_OPTIONS "" > > if [check_effective_target_lto] { > > ! # When having plugin test both slim and fat LTO and plugin/nonplugin > > ! # path. > > ! if [check_linker_plugin_available] { > > ! set LTO_TORTURE_OPTIONS [list \ > > ! { -O2 -flto -fno-use-linker-plugin -flto-partition=none } \ > > ! { -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects } > > ! ] > > ! } else { > > ! set LTO_TORTURE_OPTIONS [list \ > > ! { -O2 -flto -flto-partition=none } \ > > ! { -O2 -flto -fuse-linker-plugin } > > ! } > > } > > ..., and: > > > *** lib/gcc-dg.exp (revision 179274) > > --- lib/gcc-dg.exp (working copy) > > *************** if [info exists ADDITIONAL_TORTURE_OPTIO > > *** 69,78 **** > > > > set LTO_TORTURE_OPTIONS "" > > if [check_effective_target_lto] { > > ! set LTO_TORTURE_OPTIONS [list \ > > ! { -O2 -flto -flto-partition=none } \ > > ! { -O2 -flto } > > ! ] > > } > > > > > > --- 69,86 ---- > > > > set LTO_TORTURE_OPTIONS "" > > if [check_effective_target_lto] { > > ! # When having plugin test both slim and fat LTO and plugin/nonplugin > > ! # path. > > ! if [check_linker_plugin_available] { > > ! set LTO_TORTURE_OPTIONS [list \ > > ! { -O2 -flto -fno-use-linker-plugin -flto-partition=none } \ > > ! { -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects } > > ! ] > > ! } else { > > ! set LTO_TORTURE_OPTIONS [list \ > > ! { -O2 -flto -flto-partition=none } \ > > ! { -O2 -flto -fuse-linker-plugin } > > ! } > > } > > OK to push the attached LGTM, please leave the others a chance to comment in case they spotted anything wrong. Richard. > "Let each 'lto_init' determine the default 'LTO_OPTIONS', and 'torture-init' the 'LTO_TORTURE_OPTIONS'"? > > > Gr??e > Thomas > > > ----------------- > Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra?e 201, 80634 M?nchen; Gesellschaft mit beschr?nkter Haftung; Gesch?ftsf?hrer: Thomas Heurung, Frank Th?rauf; Sitz der Gesellschaft: M?nchen; Registergericht M?nchen, HRB 106955 > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman; HRB 36809 (AG Nuernberg)