On Mon, Jan 12, 2026 at 1:32 PM Frank Scheiner <[email protected]> wrote: > > Bootstrapping GCC (c, c++) on ia64 w/o support for LTO ([1]) showed that > the testsuite (specifically c-c++-common/guality) executes tests with > `-flto` although there was no support for LTO configured: > > [1]: https://gcc.gnu.org/pipermail/gcc-testresults/2025-December/865397.html > > Here for g++, but identical for gcc, too: > ``` > [...] > FAIL: c-c++-common/guality/Og-dce-1.c -Og line 13 *ptr == 1 > FAIL: c-c++-common/guality/Og-dce-1.c -Og -flto (test for excess errors) > UNRESOLVED: c-c++-common/guality/Og-dce-1.c -Og -flto compilation failed to > produce executable > FAIL: c-c++-common/guality/Og-dce-2.c -Og -flto (test for excess errors) > UNRESOLVED: c-c++-common/guality/Og-dce-2.c -Og -flto compilation failed to > produce executable > FAIL: c-c++-common/guality/Og-dce-3.c -Og line 17 x == 1 > FAIL: c-c++-common/guality/Og-dce-3.c -Og line 18 x == 101 > FAIL: c-c++-common/guality/Og-dce-3.c -Og line 20 x == 102 > FAIL: c-c++-common/guality/Og-dce-3.c -Og -flto (test for excess errors) > UNRESOLVED: c-c++-common/guality/Og-dce-3.c -Og -flto compilation failed to > produce executable > FAIL: c-c++-common/guality/Og-global-dse-1.c -Og line 13 gs1.i == 1 > FAIL: c-c++-common/guality/Og-global-dse-1.c -Og line 14 gs1.j == 2 > FAIL: c-c++-common/guality/Og-global-dse-1.c -Og -flto (test for excess > errors) > UNRESOLVED: c-c++-common/guality/Og-global-dse-1.c -Og -flto compilation > failed to produce executable > FAIL: c-c++-common/guality/Og-static-wo-1.c -Og line 13 x == 1 > FAIL: c-c++-common/guality/Og-static-wo-1.c -Og -flto (test for excess > errors) > UNRESOLVED: c-c++-common/guality/Og-static-wo-1.c -Og -flto compilation > failed to produce executable > [...] > > === g++ Summary === > > # of expected passes 245668 > # of unexpected failures 282 > # of unexpected successes 3 > # of expected failures 2188 > # of unresolved testcases 5 > # of unsupported tests 2221 > ``` > > This is because [...]/guality.exp adds test permutations w/`-flto` > unconditionally. Fix that by checking for LTO support and drop > permutations w/`-flto` if unsupported. > > Tested successfully with `check-gcc RUNTESTFLAGS="dg.exp"`: > > Again for g++, but same for gcc: > ``` > [...] > FAIL: c-c++-common/guality/Og-dce-1.c -Og line 13 *ptr == 1 > FAIL: c-c++-common/guality/Og-dce-3.c -Og line 17 x == 1 > FAIL: c-c++-common/guality/Og-dce-3.c -Og line 18 x == 101 > FAIL: c-c++-common/guality/Og-dce-3.c -Og line 20 x == 102 > FAIL: c-c++-common/guality/Og-global-dse-1.c -Og line 13 gs1.i == 1 > FAIL: c-c++-common/guality/Og-global-dse-1.c -Og line 14 gs1.j == 2 > FAIL: c-c++-common/guality/Og-static-wo-1.c -Og line 13 x == 1 > [...] > === g++ Summary === > > # of expected passes 245668 > # of unexpected failures 278 > # of unexpected successes 3 > # of expected failures 2188 > # of unsupported tests 2208 > ``` > > If there's a way to just execute the above c-c++-common/guality > tests, please let me know, because I didn't find the correct > RUNTESTFLAGS to achieve that. > > Suggested by Sam. > > **** > > Posting as RFC, as I'm unsure if this is the right approach to "fix" > the testsuite in regard to LTO support.
This is the correct approach. The problem was introduced with r10-2142-gec8ac265ff21fb which added the testcases named Og- being handled specially. Before that commit $LTO_TORTURE_OPTIONS was used for all testcases (still is used for the general ones) which also uses the same check of check_effective_target_lto . Thanks, Andrew > > Cheers, > Frank
