public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: James Greenhalgh <james.greenhalgh@arm.com>
To: gcc-patches@gcc.gnu.org
Cc: rguenther@suse.de,	mikestump.comcast.net
Subject: Re: [PATCH][testsuite] Fix TORTURE_OPTIONS overriding
Date: Tue, 23 Jun 2015 17:26:00 -0000	[thread overview]
Message-ID: <1435077660-14023-1-git-send-email-james.greenhalgh@arm.com> (raw)
In-Reply-To: <93598EAE-787F-42AC-BF98-EFC1A868DB46@comcast.net>

[-- Attachment #1: Type: text/plain, Size: 1823 bytes --]


On Thu, Jun 18, 2015 at 11:10:01AM +0100, Richard Biener wrote:
>
> Currently when doing
>
> make check-gcc RUNTESTFLAGS="TORTURE_OPTIONS=\\\"{ -O3 } { -O2 }\\\"
> dg-torture.exp"
>
> you get -O3 and -O2 but also the two LTO torture option combinations.
> That's undesired (those are the most expensive anyway).  The following
> patch avoids this by setting LTO_TORTURE_OPTIONS only when
> TORTURE_OPTIONS isn't specified.
>
> Tested with and without TORTURE_OPTIONS for C and fortran tortures.
>
> Seems the instruction in c-torture.exp how to override TORTURE_OPTIONS
> is off, RUNTESTFLAGS="TORTURE_OPTIONS=\\\"{ { -O3 } { -O2 } }\\\"
> certainly doesn't do what it should.

This patch causes issues for ARM and AArch64 cross multilib
testing. There are two issues, one is that we now clobber
gcc_force_conventional_output after setting it in the conditional this patch
moved (hits all targets, see the new x86-64 failures like pr61848.c).

The other is that we no longer protect environment settings before calling
check_effective_target_lto, which results in our cross --specs files no
longer being on the path.

I've fixed these issues by rearranging the file again, but I'm not
sure if what I've done is sensible and does not cause other issues. This
seems to bring back the tests I'd lost overnight, and doesn't cause
issues elsewhere.

I've run some cross-tests to ensure this brings back the missing tests,
and a full x86-64 testrun to make sure I haven't dropped any from there.

OK for trunk?

Thanks,
James

---
2015-06-23  James Greenhalgh  <james.greenhalgh@arm.com>

        * lib/c-torture.exp: Don't call check_effective_target_lto
	before setting up environment correctly.
        * lib/gcc-dg.exp: Likewise, and protect
	gcc_force_conventional_output.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Re-PATCH-testsuite-Fix-TORTURE_OPTIONS-overriding.patch --]
[-- Type: text/x-patch;  name=0001-Re-PATCH-testsuite-Fix-TORTURE_OPTIONS-overriding.patch, Size: 3075 bytes --]

diff --git a/gcc/testsuite/lib/c-torture.exp b/gcc/testsuite/lib/c-torture.exp
index 607e7d0..c88c439 100644
--- a/gcc/testsuite/lib/c-torture.exp
+++ b/gcc/testsuite/lib/c-torture.exp
@@ -21,6 +21,20 @@ load_lib file-format.exp
 load_lib target-libpath.exp
 load_lib target-utils.exp
 
+global GCC_UNDER_TEST
+if ![info exists GCC_UNDER_TEST] {
+    set GCC_UNDER_TEST "[find_gcc]"
+}
+
+global orig_environment_saved
+
+# This file may be sourced, so don't override environment settings
+# that have been previously setup.
+if { $orig_environment_saved == 0 } {
+    append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
+    set_ld_library_path_env_vars
+}
+
 # The default option list can be overridden by
 # TORTURE_OPTIONS="{ list1 } ... { listN }"
 
@@ -68,20 +82,6 @@ if [info exists ADDITIONAL_TORTURE_OPTIONS] {
 	[concat $C_TORTURE_OPTIONS $ADDITIONAL_TORTURE_OPTIONS]
 }
 
-global GCC_UNDER_TEST
-if ![info exists GCC_UNDER_TEST] {
-    set GCC_UNDER_TEST "[find_gcc]"
-}
-
-global orig_environment_saved
-
-# This file may be sourced, so don't override environment settings
-# that have been previously setup.
-if { $orig_environment_saved == 0 } {
-    append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
-    set_ld_library_path_env_vars
-}
-
 #
 # c-torture-compile -- runs the Tege C-torture test
 #
diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index 00ca0c5..d463f81 100644
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -46,6 +46,19 @@ if ![info exists GCC_UNDER_TEST] {
     set GCC_UNDER_TEST "[find_gcc]"
 }
 
+# This file may be sourced, so don't override environment settings
+# that have been previously setup.
+if { $orig_environment_saved == 0 } {
+    append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
+    set_ld_library_path_env_vars
+}
+
+# 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 ""
+
 set LTO_TORTURE_OPTIONS ""
 if [info exists TORTURE_OPTIONS] {
     set DG_TORTURE_OPTIONS $TORTURE_OPTIONS
@@ -92,19 +105,6 @@ if [info exists ADDITIONAL_TORTURE_OPTIONS] {
 
 global orig_environment_saved
 
-# This file may be sourced, so don't override environment settings
-# that have been previously setup.
-if { $orig_environment_saved == 0 } {
-    append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
-    set_ld_library_path_env_vars
-}
-
-# 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 ""
-
 # Deduce generated files from tool flags, return finalcode string
 proc schedule-cleanups { opts } {
     global additional_sources

  reply	other threads:[~2015-06-23 16:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-18 10:12 Richard Biener
2015-06-18 19:08 ` Mike Stump
2015-06-23 17:26   ` James Greenhalgh [this message]
2015-06-24  7:55     ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1435077660-14023-1-git-send-email-james.greenhalgh@arm.com \
    --to=james.greenhalgh@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rguenther@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).