on 2024/1/24 23:51, Peter Bergner wrote: > On 1/24/24 12:04 AM, Kewen.Lin wrote: >> on 2024/1/24 11:11, Peter Bergner wrote: >>> But not with this. The -mdejagnu-cpu=power10 option already enables -mvsx. >>> If the user explcitly forces -mno-vsx via RUNTESTFLAGS, then let them. >>> The options set in RUNTESTFLAGS come after the options in the dg-options >>> line, so even adding -mvsx like the above won't help the test case PASS >> >> But this is NOT true, at least on one of internal Power10 machine >> (ltcden2-lp1). >> >> With the command below: >> >> make check-gcc-c RUNTESTFLAGS="--target_board=unix/-mno-vsx >> powerpc.exp=pr112886.c" >> >> this test case fails without the explicit -mvsx in dg-options. >> >> From the verbose dumping, the compilation command looks like: >> >> /home/linkw/gcc/build/gcc-test-debug/gcc/xgcc >> -B/home/linkw/gcc/build/gcc-test-debug/gcc/ >> /home/linkw/gcc/gcc-test/gcc/testsuite/gcc.target/powerpc/pr112886.c >> -mno-vsx >> -fdiagnostics-plain-output -mdejagnu-cpu=power10 -O2 -ffat-lto-objects >> -fno-ident -S >> -o pr112886.s >> >> "-mno-vsx" comes **before** "-mdejagnu-cpu=power10 -O2" rather than >> **after**. >> >> I guess it might be due to different behaviors of different versions of >> runtest framework? > > That is confusing, unless as you say, the behavior changed. The whole reason > we added > -mdejagnu-cpu= (and the dg-skip usage before that) was due to encountering > problems > when the test case wanted a specific -mcpu= value and the user overrode it in > their > RUNTESTFLAGS and that can only happen when its options come last on the > command line.
I think the behavior changed, or more accurately: the behavior doesn't keep consistent on all test environments (suspecting due to different versions of runtest). > > Then again, why didn't the powerpc_vsx_ok test not save us here? Same reason, -mno-vsx comes before the append "-mvsx", so the checking passes. > > > >> So there can be two cases with user explicitly specified -mno-vsx: >> >> 1) RUNTESTFLAGS comes after dg-options (assuming same order for -mvsx in >> powerpc_vsx_ok) >> >> powerpc_vsx_ok test failed, so UNSUPPORTED >> >> // with explicit -mvsx does nothing as you said. >> >> 2) RUNTESTFLAGS comes before dg-options >> >> powerpc_vsx_ok test succeeds, but FAIL. >> >> // with suggested -mvsx, make it match the powerpc_vsx_ok checking and the >> case not fail. >> >> As above I think we still need to append the "-mvsx" explicitly. As >> tested/verified, it >> does help the case not to fail on ltcden2-lp1. > > I'd like to verify that the behavior did change before we enforce adding that > option. Great. > The problem is, there are a HUGE number of older test cases that would need > updating > to "fix" them too. ...and not just adding -mnsx, but -maltivec and basically > any > -mfoo option where the test case is expecting the feature foo to be > used/tested. > It would be a huge mess. I agree, such "-mno-foo" is rarely used in testing, so it doesn't get enough notices. BR, Kewen