gcc 12.0.0 20220116 snapshot (g:90045c5df5b3c8853e7740fb72a11aead1c489bb) ICEs when compiling the following testcase, reduced from libgomp/testsuite/libgomp.oacc-c-c++-common/declare-vla.c, w/ -fopenacc --param openacc-kernels=decompose: void foo (void) { #pragma acc data { int i; #pragma acc kernels i = 0; } } % gcc-12.0.0 -fopenacc --param openacc-kernels=decompose -c n3ipdwdp.c during GIMPLE pass: omplower n3ipdwdp.c: In function 'foo': n3ipdwdp.c:8:9: internal compiler error: in lower_omp_target, at omp-low.c:13075 8 | #pragma acc kernels | ^~~ 0x7035f7 lower_omp_target /var/tmp/portage/sys-devel/gcc-12.0.0_p20220116/work/gcc-12-20220116/gcc/omp-low.c:13075 0xd773f1 lower_omp_1 /var/tmp/portage/sys-devel/gcc-12.0.0_p20220116/work/gcc-12-20220116/gcc/omp-low.c:14223 0xd773f1 lower_omp /var/tmp/portage/sys-devel/gcc-12.0.0_p20220116/work/gcc-12-20220116/gcc/omp-low.c:14362 0xd77d01 lower_omp_1 /var/tmp/portage/sys-devel/gcc-12.0.0_p20220116/work/gcc-12-20220116/gcc/omp-low.c:14152 0xd77d01 lower_omp /var/tmp/portage/sys-devel/gcc-12.0.0_p20220116/work/gcc-12-20220116/gcc/omp-low.c:14362 0xd77d01 lower_omp_1 /var/tmp/portage/sys-devel/gcc-12.0.0_p20220116/work/gcc-12-20220116/gcc/omp-low.c:14152 0xd77d01 lower_omp /var/tmp/portage/sys-devel/gcc-12.0.0_p20220116/work/gcc-12-20220116/gcc/omp-low.c:14362 0xd769b4 lower_omp_1 /var/tmp/portage/sys-devel/gcc-12.0.0_p20220116/work/gcc-12-20220116/gcc/omp-low.c:14139 0xd769b4 lower_omp /var/tmp/portage/sys-devel/gcc-12.0.0_p20220116/work/gcc-12-20220116/gcc/omp-low.c:14362 0xd71fc7 lower_omp_target /var/tmp/portage/sys-devel/gcc-12.0.0_p20220116/work/gcc-12-20220116/gcc/omp-low.c:12870 0xd773f1 lower_omp_1 /var/tmp/portage/sys-devel/gcc-12.0.0_p20220116/work/gcc-12-20220116/gcc/omp-low.c:14223 0xd773f1 lower_omp /var/tmp/portage/sys-devel/gcc-12.0.0_p20220116/work/gcc-12-20220116/gcc/omp-low.c:14362 0xd77d01 lower_omp_1 /var/tmp/portage/sys-devel/gcc-12.0.0_p20220116/work/gcc-12-20220116/gcc/omp-low.c:14152 0xd77d01 lower_omp /var/tmp/portage/sys-devel/gcc-12.0.0_p20220116/work/gcc-12-20220116/gcc/omp-low.c:14362 0xd7bdac execute_lower_omp /var/tmp/portage/sys-devel/gcc-12.0.0_p20220116/work/gcc-12-20220116/gcc/omp-low.c:14401 0xd7bdac execute /var/tmp/portage/sys-devel/gcc-12.0.0_p20220116/work/gcc-12-20220116/gcc/omp-low.c:14449
The master branch has been updated by Thomas Schwinge <tschwinge@gcc.gnu.org>: https://gcc.gnu.org/g:9781ae3a254a8c17ef4ffa70f21ed1728ff3c707 commit r12-7623-g9781ae3a254a8c17ef4ffa70f21ed1728ff3c707 Author: Thomas Schwinge <thomas@codesourcery.com> Date: Tue Jan 18 17:22:14 2022 +0100 Add 'c-c++-common/goacc/kernels-decompose-pr104086-1.c' [PR104086] ..., currently XFAILed with 'dg-ice', as it runs into 'gcc/omp-low.cc:lower_omp_target': 13125 else if (is_gimple_reg (var)) 13126 { 13127 gcc_assert (offloaded); This means, the recent PR100280 etc. changes are still not sufficient. gcc/testsuite/ PR middle-end/104086 * c-c++-common/goacc/kernels-decompose-pr104086-1.c: New file.
The master branch has been updated by Thomas Schwinge <tschwinge@gcc.gnu.org>: https://gcc.gnu.org/g:337ed336d7dd83526891bdb436f0bfe9e351f69d commit r12-7624-g337ed336d7dd83526891bdb436f0bfe9e351f69d Author: Thomas Schwinge <thomas@codesourcery.com> Date: Thu Feb 17 14:18:57 2022 +0100 OpenACC 'kernels' decomposition: Mark variables used in 'present' clauses as addressable [PR100280, PR104086] ... like in recent commit 9b32c1669aad5459dd053424f9967011348add83 "OpenACC 'kernels' decomposition: Mark variables used in synthesized data clauses as addressable [PR100280]". Otherwise, we may run into 'gcc/omp-low.cc:lower_omp_target': 13125 else if (is_gimple_reg (var)) 13126 { 13127 gcc_assert (offloaded); PR middle-end/100280 PR middle-end/104086 gcc/ * omp-oacc-kernels-decompose.cc (omp_oacc_kernels_decompose_1): Mark variables used in 'present' clauses as addressable. * omp-low.cc (scan_sharing_clauses) <OMP_CLAUSE_MAP>: Gracefully handle duplicate 'OMP_CLAUSE_MAP_DECL_MAKE_ADDRESSABLE'. gcc/testsuite/ * c-c++-common/goacc/kernels-decompose-pr104086-1.c: Adjust, extend. libgomp/ * testsuite/libgomp.oacc-c-c++-common/declare-vla-kernels-decompose-ice-1.c: Merge this... * testsuite/libgomp.oacc-c-c++-common/declare-vla-kernels-decompose.c: ..., and this... * testsuite/libgomp.oacc-c-c++-common/declare-vla.c: ... into this, and adjust. * testsuite/libgomp.oacc-c-c++-common/kernels-decompose-1.c: Extend.
.