https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113226
Bug ID: 113226 Summary: [14 Regression] testsuite/std/ranges/iota/max_size_type.cc fails for cris-elf after r14-6888-ga138b99646a555 Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: testsuite Assignee: unassigned at gcc dot gnu.org Reporter: hp at gcc dot gnu.org Target Milestone: --- After r14-6888-ga138b99646a555, I see, for cris-elf (32-bit target, no 128bit): FAIL: std/ranges/iota/max_size_type.cc -std=gnu++20 execution test FAIL: std/ranges/iota/max_size_type.cc -std=gnu++26 execution test And in the .log: spawn cris-elf-run ./max_size_type.exe^ Inconsistency found: 1 0 -100 -100^ /x/gcc/libstdc++-v3/testsuite/std/ranges/iota/max_size_type.cc:246: void test02() [with bool signed_p = true; bool shorten_p = false]: Assertion '0' failed. program stopped with signal 6 (Aborted). FAIL: std/ranges/iota/max_size_type.cc -std=gnu++20 execution test Changing all s/ok &=/VERIFY/ (plus adding one level of parentheses to one of the lines) show: /x/gcc/libstdc++-v3/testsuite/std/ranges/iota/max_size_type.cc:217: void test02() [with bool signed_p = true; bool shorten_p = false]: Assertion 'i*j == shorten_type(max_type(i)*j)' failed. program stopped with signal 6 (Aborted). Further instrumentation, adding among other lines: ``` if (signed_p && ! shorten_p) std::cerr << "j == " << int64_t(j) << std::endl; if (!(i*j == shorten_type(max_type(i)*j))) { std::cerr << "i == " << int64_t(i) << ", j == " << j << ", i*j == " << int64_t(i*j) << ", max_type(i) == \ " << int64_t(max_type(i)); std::cerr << ", max_type(i)*j == " << int64_t(max_type(i)*j) << std::endl; } ''' shows that this is (see above for template parameters): i == 1, j == -100, i*j == 4294967196, max_type(i) == 1, max_type(i)*j == -100 and that large number is as you might guess, (unsigned) -100. Not sure if this is a bug in the testcase or elsewhere, but I'll start my guessing with testsuite.