aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2020-10-14 15:25:53 +0200
committerTom de Vries <tdevries@suse.de>2020-10-14 23:08:42 +0200
commit30d06b7d30792bc621202af2099c21fc24157856 (patch)
tree61ee7216123403dcbb1eac8340ad141dd395fa3f /gcc/builtins.c
parentdc570700beab4080040884690deb6016090b4fa8 (diff)
downloadgcc-30d06b7d30792bc621202af2099c21fc24157856.zip
gcc-30d06b7d30792bc621202af2099c21fc24157856.tar.gz
gcc-30d06b7d30792bc621202af2099c21fc24157856.tar.bz2
[testsuite] Don't overwrite compiler_flags in check_compile
Consider the test-case gcc.c-torture/compile/pr42717.c, which has: ... /* { dg-xfail-if "ptxas crashes" { nvptx-*-* } { "-O0" } { "" } } */ ... When running make check-gcc, I get: ... XPASS: gcc.c-torture/compile/pr42717.c -O0 (test for excess errors) ... but when forcing to run only that test-case using RUNTESTFLAGS=compile.exp=pr42717.c I get instead: ... PASS: gcc.c-torture/compile/pr42717.c -O0 (test for excess errors) ... Using RUNTESTFLAGS="-v -v -v" we can see what happens: ... check_cached_effective_target exceptions_enabled: \ returning 1 for nvptx-none-run Limited to targets: *-*-* Will search for options "-O0" Will exclude for options "" Compiler flags are: exceptions_enabled9848.cc -fdiagnostics-plain-output \ --sysroot=/home/vries/nvptx/trunk/install/nvptx-none -S -isystem \ /home/vries/nvptx/trunk/build-gcc/nvptx-none/./newlib/targ-include \ -isystem /home/vries/nvptx/trunk/source-gcc/newlib/libc/include \ -o exceptions_enabled9848.s Checking "*-*-*" against "nvptx-unknown-none" Looking for -O0 to include in the compiler flags Looking for to exclude in the compiler flags This is not a conditional match PASS: gcc.c-torture/compile/pr42717.c -O0 (test for excess errors) ... The effective target exceptions_enabled is tested from gcc-dg-prune, but the calculation overwrites $compiler_flags, which is subsequently tested for -O0. Fix this by saving and restoring $compiler_flags when calling ${tool}_target_compile in check_compile. Tested on nvptx. gcc/testsuite/ChangeLog: 2020-10-14 Tom de Vries <tdevries@suse.de> * lib/target-supports.exp (check_compile): Save and restore $compiler_flags when calling ${tool}_target_compile.
Diffstat (limited to 'gcc/builtins.c')
0 files changed, 0 insertions, 0 deletions