Correct the order of multilib_flags
Some testcases need explicit GCC options to properly run, like
gcc.target/i386/sse2-init-v2di-2.c has
/* { dg-options "-O2 -msse4 -march=core2 -dp" } */
-march=core2 is specified explicitly. But with multlib, like
make check-gcc RUNTESTFLAGS="--target_board='unix{-march=k8}'
-march=k8 is appended to the command line options, which overrides
the the command line options specified by dg-options. multlib flags
should be placed at the beginning of the command line options, not at
the end. This patch adds gcc_default_target_compile, which is
almost identical to default_target_compile in dejagnu, except that
it has
if {[board_info $dest exists multilib_flags]} {
set add_flags "[board_info $dest multilib_flags] $add_flags"
}
instead of
if {[board_info $dest exists multilib_flags]} {
append add_flags " [board_info $dest multilib_flags]"
}
It replaces default_target_compile with gcc_default_target_compile.
Tested on Linux/x86-64 with RUNTESTFLAGS="--target_board='unix{-m32,}'".
PR testsuite/59971
* lib/gcc-defs.exp (gcc_default_target_compile): New. Replace
default_target_compile with gcc_default_target_compile.