https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117954
Bug ID: 117954 Summary: [15 Regression] gcc.dg/tree-ssa/pr111456-1.c FAILs for non-LOGICAL_OP_NON_SHORT_CIRCUIT after r15-5646-gd1cf0d7a0f27fd Product: gcc Version: 15.0 Status: UNCONFIRMED Keywords: testsuite-fail Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: hp at gcc dot gnu.org CC: rguenth at gcc dot gnu.org Target Milestone: --- It appears that r15-5646-gd1cf0d7a0f27fd caused gcc.dg/tree-ssa/pr111456-1.c to regress for all non-LOGICAL_OP_NON_SHORT_CIRCUIT targets, alternatively LOGICAL_OP_NON_SHORT_CIRCUIT targets when compiling that test-case with --param logical-op-non-short-circuit=0 as evidenced by the presence of this line: FAIL: gcc.dg/tree-ssa/pr111456-1.c scan-tree-dump-not optimized "foo " in posts to gcc-testresults around that commit for some targets (like pru-unknown-elf s390x-ibm-linux-gnu, powerpc64le-unknown-linux-gnu m68k-unknown-linux-gnu) but not for others (armv8l-unknown-linux-gnueabihf, aarch64-unknown-linux-gnu, x86_64-pc-linux-gnu, i686-pc-linux-gnu). Also seen for cris-elf: before this commit the whole test-case was optimized to return 0 from main, while after, there's a loop with foo called. The commit log for r15-5646-gd1cf0d7a0f27fd does mention fallout and has patches to handle them in various ways, for cases "where we rely on unrolling even when calls are involved". But, here the call seems "involved" primarily in that it isn't optimized out. It's not clear whether this particular fallout is expected. If it's "expected" I suggest xfailing the test and adding "--param logical-op-non-short-circuit=0" to make it (x)fail for all targets. Other "workarounds": set "--param logical-op-non-short-circuit=0" to make it pass for all targets, or adding a "#pragma GCC unroll 2" before the loop, making the test pass. Testresults post examples; affected targets, passing before the triggering commit r15-5620-ga095d720acd pru-unknown-elf https://gcc.gnu.org/pipermail/gcc-testresults/2024-November/831214.html r15-5592-gcdd7171a6b0 s390x-ibm-linux-gnu https://gcc.gnu.org/pipermail/gcc-testresults/2024-November/831146.html r15-5638-g97717af3867 powerpc64le-unknown-linux-gnu https://gcc.gnu.org/pipermail/gcc-testresults/2024-November/831546.html r15-5637-gcc5779fcaf76ae m68k-unknown-linux-gnu https://gcc.gnu.org/pipermail/gcc-testresults/2024-November/831318.html Failing after that commit: r15-5663-gf89c7916b97 pru-unknown-elf https://gcc.gnu.org/pipermail/gcc-testresults/2024-November/831335.html r15-5655-ge876acab6cd s390x-ibm-linux-gnu https://gcc.gnu.org/pipermail/gcc-testresults/2024-November/831310.html r15-5649-g0b47d7579e8 powerpc64le-unknown-linux-gnu https://gcc.gnu.org/pipermail/gcc-testresults/2024-November/831509.html r15-5662-ge6d26a21e03690 m68k-unknown-linux-gnu https://gcc.gnu.org/pipermail/gcc-testresults/2024-November/831378.html Unaffected targets: 15-5663-gf89c7916b97 armv8l-unknown-linux-gnueabihf https://gcc.gnu.org/pipermail/gcc-testresults/2024-November/831345.html 15-5650-gd9c908b75039 aarch64-unknown-linux-gnu https://gcc.gnu.org/pipermail/gcc-testresults/2024-November/831310.html r15-5649-g0b47d7579e8 x86_64-pc-linux-gnu https://gcc.gnu.org/pipermail/gcc-testresults/2024-November/831302.html r15-5648-ge984ba40aa0 i686-pc-linux-gnu https://gcc.gnu.org/pipermail/gcc-testresults/2024-November/831300.html