Hi,

I have had to use this patch several times when performing cross testing
but I'm not sure if it is the right fix. The MIPS target testsuite runs
all tests regardless of the current compiler configuration and downgrades
run tests to link tests and then to assembly tests depending on what
libraries and hardware is available in the current run.

In order to experiment with how the tests behave for a different
configurations I add things like:

--target_board=multi-sim/-msoft-float

Where the option I am trying may not have libraries available.

The problem comes when the LTO options are tested. The choice of which
LTO options are used is based on a test for whether the LTO linker plugin
is available.  This test fails in my case because there are no suitable
libraries to link against.

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 }
      ]
      set gcc_force_conventional_output "-ffat-lto-objects"
    } else {
      set LTO_TORTURE_OPTIONS [list \
          { -O2 -flto -flto-partition=none } \
          { -O2 -flto }
      ]
    }
}

The problem as I see it is that the gcc_force_conventional_output line
only applies to the first case. I understand why this is generally OK
but if the linker plugin is seen to be available at GCC config time
but is not available for a specific test configuration then there is
a problem.

I'd therefore like to apply the following. Any suggestions on the
testing that this needs? Would a build + regression run of GCC
with binutils configured --disable-plugins be sufficient?

Matthew

gcc/testsuite/

        * lib/gcc-dg.exp: Set gcc_force_conventional_output for whenever
        LTO is used.

diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index 6df8ae1..8d5bf9b 100644
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -88,13 +88,13 @@ 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 } \
          { -O2 -flto }
       ]
     }
+    set gcc_force_conventional_output "-ffat-lto-objects"
 }
 
 global orig_environment_saved

Reply via email to