From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20517 invoked by alias); 21 Oct 2011 02:29:43 -0000 Received: (qmail 20508 invoked by uid 22791); 21 Oct 2011 02:29:42 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from ra.se.axis.com (HELO ra.se.axis.com) (195.60.68.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 21 Oct 2011 02:29:24 +0000 Received: from localhost (localhost [127.0.0.1]) by ra.se.axis.com (Postfix) with ESMTP id EAAFC12524; Fri, 21 Oct 2011 04:29:22 +0200 (CEST) Received: from ra.se.axis.com ([127.0.0.1]) by localhost (ra.se.axis.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 8sgj7kUsP4nE; Fri, 21 Oct 2011 04:29:22 +0200 (CEST) Received: from seth.se.axis.com (seth.se.axis.com [10.0.2.172]) by ra.se.axis.com (Postfix) with ESMTP id 94397124CC; Fri, 21 Oct 2011 04:29:21 +0200 (CEST) Received: from ignucius.se.axis.com (ignucius.se.axis.com [10.88.21.50]) by seth.se.axis.com (Postfix) with ESMTP id 82F693E0CF; Fri, 21 Oct 2011 04:29:21 +0200 (CEST) Received: from ignucius.se.axis.com (localhost [127.0.0.1]) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) with ESMTP id p9L2TLF6010681; Fri, 21 Oct 2011 04:29:21 +0200 Received: (from hp@localhost) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) id p9L2TKmx010677; Fri, 21 Oct 2011 04:29:20 +0200 Date: Fri, 21 Oct 2011 05:22:00 -0000 Message-Id: <201110210229.p9L2TKmx010677@ignucius.se.axis.com> From: Hans-Peter Nilsson To: hubicka@ucw.cz CC: hp@axis.com, hubicka@ucw.cz, gcc-patches@gcc.gnu.org, dnovillo@google.com, rguenther@suse.de, ak@linux.intel.com In-reply-to: <20111020221932.GA13355@kam.mff.cuni.cz> (message from Jan Hubicka on Fri, 21 Oct 2011 00:19:32 +0200) Subject: [RFA:] fix breakage with "Update testsuite to run with slim LTO" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg01922.txt.bz2 > Date: Fri, 21 Oct 2011 00:19:32 +0200 > From: Jan Hubicka > Yes, if we scan assembler, we likely want -fno-fat-lto-objects. > > then IIUC you need to patch *all* torture tests that use > > scan-assembler and scan-assembler-not. Alternatively, patch > > somewhere else, like not passing it if certain directives are > > used, like scan-assembler{,-not}. And either way, is it safe to > > add that option always, not just when also passing "-flto" or > > something? > > Hmm, some of assembler scans still works because they check for > presence of symbols we output anyway, but indeed, it would make more > sense to automatically imply -ffat-lto-object when scan-assembler > is used. I am not sure if my dejagnu skill as on par here however. Maybe you could make amends ;) by testing the following, which seems to work at least for dg-torture.exp and cris-elf/cris-sim, in which -ffat-lto-object is automatically added for each scan-assembler and scan-assembler-not test, extensible for other dg-final actions without polluting with checking LTO options and whatnot across the files. I checked (and corrected) so it also works when !check_effective_target_lto by commenting out the setting in the second chunk. gcc/testsuite: * lib/gcc-dg.exp (gcc_force_conventional_output): New global variable, default empty, -ffat-lto-objects for effective_target_lto. (gcc-dg-test-1): Add options from dg-final methods. * lib/scanasm.exp (scan-assembler_required_options) (scan-assembler-not_required_options): New procs. Ok to commit? Index: lib/gcc-dg.exp =================================================================== --- lib/gcc-dg.exp (revision 180270) +++ lib/gcc-dg.exp (working copy) @@ -68,6 +68,13 @@ if [info exists ADDITIONAL_TORTURE_OPTIO } set LTO_TORTURE_OPTIONS "" + +# Some torture-options cause intermediate code output, unusable for +# testing using e.g. scan-assembler. In this variable are the options +# how to force it, when needed. +global gcc_force_conventional_output +set gcc_force_conventional_output "" + if [check_effective_target_lto] { # When having plugin test both slim and fat LTO and plugin/nonplugin # path. @@ -76,6 +83,7 @@ if [check_effective_target_lto] { { -O2 -flto -fno-use-linker-plugin -flto-partition=none } \ { -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects } ] + set gcc_force_conventional_output "-ffat-lto-objects" } else { set LTO_TORTURE_OPTIONS [list \ { -O2 -flto -flto-partition=none } \ @@ -154,6 +162,19 @@ proc gcc-dg-test-1 { target_compile prog default { perror "$do_what: not a valid dg-do keyword" return "" + } + } + + # Let { dg-final { action } } force options as returned by an + # optional proc ${action}_required_options. + upvar 2 dg-final-code finalcode + foreach x [split $finalcode "\n"] { + set finalcmd [lindex $x 0] + if { [info procs ${finalcmd}_required_options] != "" } { + set req [${finalcmd}_required_options] + if { $req != "" } { + lappend extra_tool_flags $req + } } } Index: lib/scanasm.exp =================================================================== --- lib/scanasm.exp (revision 180270) +++ lib/scanasm.exp (working copy) @@ -85,6 +85,11 @@ proc scan-assembler { args } { dg-scan "scan-assembler" 1 $testcase $output_file $args } +proc scan-assembler_required_options { args } { + global gcc_force_conventional_output + return $gcc_force_conventional_output +} + # Check that a pattern is not present in the .s file produced by the # compiler. See dg-scan for details. @@ -94,6 +99,11 @@ proc scan-assembler-not { args } { set output_file "[file rootname [file tail $testcase]].s" dg-scan "scan-assembler-not" 0 $testcase $output_file $args +} + +proc scan-assembler-not_required_options { args } { + global gcc_force_conventional_output + return $gcc_force_conventional_output } # Return the scan for the assembly for hidden visibility. brgds, H-P