]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++, gimplify: Implement C++26 P2795R5 - Erroneous behavior for uninitialized reads...
authorThomas Schwinge <tschwinge@baylibre.com>
Mon, 20 Oct 2025 15:36:49 +0000 (17:36 +0200)
committerThomas Schwinge <tschwinge@baylibre.com>
Mon, 20 Oct 2025 19:28:34 +0000 (21:28 +0200)
With commit r16-4212-gf256a13f8aed833fe964a2ba541b7b30ad9b4a76
"c++, gimplify: Implement C++26 P2795R5 - Erroneous behavior for uninitialized reads [PR114457]",
we acquired:

    {+FAIL: libgomp.c++/target-flex-101.C (internal compiler error: in assign_temp, at function.cc:990)+}
    [-PASS:-]{+FAIL:+} libgomp.c++/target-flex-101.C (test for excess errors)
    [-PASS:-]{+UNRESOLVED:+} libgomp.c++/target-flex-101.C [-execution test-]{+compilation failed to produce executable+}

... for GCN, nvptx offloading compilation, and on the other hand:

    [-XFAIL:-]{+XPASS:+} libgomp.c++/target-std__flat_map-concurrent.C (internal compiler error[-: in assign_temp, at function.cc:990)-]
    [-XFAIL:-]{+XPASS:+} libgomp.c++/target-std__flat_map-concurrent.C (test for excess errors)
    [-UNRESOLVED:-]{+PASS:+} libgomp.c++/target-std__flat_map-concurrent.C [-compilation failed to produce executable-]{+execution test+}

    [-XFAIL:-]{+XPASS:+} libgomp.c++/target-std__flat_multimap-concurrent.C (internal compiler error[-: in assign_temp, at function.cc:990)-]
    [-XFAIL:-]{+XPASS:+} libgomp.c++/target-std__flat_multimap-concurrent.C (test for excess errors)
    [-UNRESOLVED:-]{+PASS:+} libgomp.c++/target-std__flat_multimap-concurrent.C [-compilation failed to produce executable-]{+execution test+}

... for GCN offloading compilation (already PASSed for nvptx).

Note that these test cases explicitly use '-std=c++23', so don't undergo the
new C++26 P2795R5 functionality.  Yet, comparing before vs. after that commit,
in the 'gimple' dumps (that is, early host compilation), there are a lot of
changes where 'gimple_assign <constructor, [...], {CLOBBER(bob)}, NULL, NULL>'s
and relatedly 'gimple_bind's newly appear/no longer appear elsewhere.  This
leads to correspondingly different code at the beginning of offloading
compilation.  Why/how that now ('libgomp.c++/target-flex-101.C') vs. before
('libgomp.c++/{target-std__flat_map-concurrent.C,target-std__flat_multimap-concurrent.C}')
translates into 'expand' ICEs, I can't tell.

PR c++/114457
PR c++/122268
PR c++/120450
libgomp/
* testsuite/libgomp.c++/target-flex-101.C: XFAIL GCN, nvptx
offloading compilation.
* testsuite/libgomp.c++/target-std__flat_map-concurrent.C:
Un-XFAIL GCN offloading compilation.
* testsuite/libgomp.c++/target-std__flat_multimap-concurrent.C:
Likewise.

libgomp/testsuite/libgomp.c++/target-flex-101.C
libgomp/testsuite/libgomp.c++/target-std__flat_map-concurrent.C
libgomp/testsuite/libgomp.c++/target-std__flat_multimap-concurrent.C

index be9037e97180d2bfb0e8e28a1462b99d7fd341e8..28201f468b6134c4716946b13b66b293a8c0947e 100644 (file)
@@ -1,5 +1,8 @@
 /* { dg-additional-options -std=c++23 } */
 
+/* { dg-ice {TODO PR122268} { offload_target_amdgcn || offload_target_nvptx } }
+   { dg-excess-errors {'mkoffload' failure etc.} { xfail { offload_target_amdgcn || offload_target_nvptx } } } */
+
 /* C++23 container adaptors in target region.
    Severely needs additional tests.  */
 
index 9e59907c09b6ec41f498043fe334d15734e1c85a..8a3082cceda1ae258b3d2217a0389f1e6be7d8ae 100644 (file)
@@ -2,10 +2,6 @@
 // { dg-additional-options "-std=c++23" }
 // { dg-additional-options -DMEM_SHARED { target offload_device_shared_as } }
 
-/* { dg-ice {TODO PR120450} { offload_target_amdgcn && { ! offload_device_shared_as } } }
-   { dg-excess-errors {'mkoffload' failure etc.} { xfail { offload_target_amdgcn && { ! offload_device_shared_as } } } }
-   (For effective-target 'offload_device_shared_as', we've got '-DMEM_SHARED', and therefore don't invoke the constructor with placement new.)  */
-
 #include <stdlib.h>
 #include <time.h>
 #include <set>
index 1dc60c8a627c268cbd47c5677b593762e034d583..0a1377d13c7287484d82673b6f3c187c9f69dba0 100644 (file)
@@ -2,10 +2,6 @@
 // { dg-additional-options "-std=c++23" }
 // { dg-additional-options -DMEM_SHARED { target offload_device_shared_as } }
 
-/* { dg-ice {TODO PR120450} { offload_target_amdgcn && { ! offload_device_shared_as } } }
-   { dg-excess-errors {'mkoffload' failure etc.} { xfail { offload_target_amdgcn && { ! offload_device_shared_as } } } }
-   (For effective-target 'offload_device_shared_as', we've got '-DMEM_SHARED', and therefore don't invoke the constructor with placement new.)  */
-
 #include <stdlib.h>
 #include <time.h>
 #include <flat_map>