On Thu, 21 Aug 2025 at 15:39, Thomas de Bock via Gcc <gcc@gcc.gnu.org> wrote: > > Hey, I'm working on an optimization pass that merges the comparisons in > defaulted struct equality operators, the spaceship-* testcases all pass, > except for spaceship-eq12.C: > > > FAIL: g++.dg/cpp2a/spaceship-eq12.C -std=gnu++20 (test for excess errors) > FAIL: g++.dg/cpp2a/spaceship-eq12.C -std=gnu++26 (test for excess errors) > FAIL: g++.dg/cpp2a/spaceship-eq12.C -std=gnu++23 (test for excess errors) > > === g++ Summary === > > # of expected passes 209 > # of unexpected failures 3 > /home/tdebock/gcc-vectorize/gcc/objdir/gcc/xg++ version 16.0.0 20250704 > (experimental) (GCC) > > > This confuses me, since when compiling the testcase with, and without the > optimization enabled and running them, they both return the same value. > > This is not surprising since they are the exact same binaries: > > > sha1sum test_optimization_off > c45352213dd39a6a3b32d3549b40aeb9a17db464 test_optimization_off > > sha1sum test_optimization_on > c45352213dd39a6a3b32d3549b40aeb9a17db464 test_optimization_on > > > The only thing the optimization does on this testcase is, during the SSA > pass, switch the != operators on component refs out for ==, switching the > basic blocks' edges as well. > > Does DejaGnu test some attributes about the intermediate languages as well, > what is going on here?
"test for excess errors" means it is checking the output of the compilation (and linking) for unexpected diagnostics. Any unexpected warnings or errors will cause it to fail. Failure to compile the code will also cause that error, but in that case you'd see other errors too (and you wouldn't be able to run the binary!) It has nothing to do with the binary or the result of executing the binary, it's just what the compiler prints while compiling it. Look in the logs, you should see what the excess errors are.