https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128951

            Bug ID: 128951
           Summary: g++.dg/gomp/allocate-16.C fails on
                    --enable-checking=release builds
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: danglin at gcc dot gnu.org
  Target Milestone: ---
              Host: hppa64-hp-hpux11.11
            Target: hppa64-hp-hpux11.11
             Build: hppa64-hp-hpux11.11

Description

On compilers built with --enable-checking=release (where CHECKING_P /
ENABLE_ASSERT_CHECKING is disabled), g++.dg/gomp/allocate-16.C fails with:

g++.dg/gomp/allocate-16.C:95: confused by earlier errors, bailing out
compiler exited with status 1
XPASS: g++.dg/gomp/allocate-16.C  -std=c++17 (internal compiler error)
FAIL: g++.dg/gomp/allocate-16.C  -std=c++17 (test for excess errors)
Excess errors:
/home/dave/gnu/gcc/gcc/gcc/testsuite/g++.dg/gomp/allocate-16.C:95: confused by
earlier errors, bailing out

Because the gcc_assert ICE expected by /* { dg-ice "" { c++17 } } */ is
compiled out in release-checking builds, cc1plus recovers from the expected
errors by emitting confused by earlier errors, bailing out and exiting with
status 1 instead of ICEing.

Restricting dg-ice to { c++17 && checking } and pruning confused by earlier
errors, bailing out resolves both the XPASS and the excess error on
release-checking builds while keeping dg-ice active on --enable-checking=yes
builds:

Untested fix:

--- a/gcc/testsuite/g++.dg/gomp/allocate-16.C
+++ b/gcc/testsuite/g++.dg/gomp/allocate-16.C
@@ -1,5 +1,6 @@
 /* { dg-do compile { target c++11 } } */
-/* { dg-ice "" { c++17 } } */
+/* { dg-ice "" { c++17 && checking } } */
+/* { dg-prune-output "confused by earlier errors, bailing out" } */

Reply via email to