* [Bug c++/108422] [13 Regression] ICE: base pointer cycle detected
2023-01-16 17:49 [Bug c++/108422] New: [13 Regression] ICE: base pointer cycle detected gscfq@t-online.de
@ 2023-01-17 7:04 ` rguenth at gcc dot gnu.org
2023-01-17 13:29 ` [Bug c++/108422] [13 Regression] ICE: base pointer cycle detected since r13-2661-gb57abd072dd319a7 marxin at gcc dot gnu.org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-01-17 7:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108422
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-valid-code
Target Milestone|--- |13.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/108422] [13 Regression] ICE: base pointer cycle detected since r13-2661-gb57abd072dd319a7
2023-01-16 17:49 [Bug c++/108422] New: [13 Regression] ICE: base pointer cycle detected gscfq@t-online.de
2023-01-17 7:04 ` [Bug c++/108422] " rguenth at gcc dot gnu.org
@ 2023-01-17 13:29 ` marxin at gcc dot gnu.org
2023-02-20 9:26 ` burnus at gcc dot gnu.org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2023-01-17 13:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108422
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[13 Regression] ICE: base |[13 Regression] ICE: base
|pointer cycle detected |pointer cycle detected
| |since
| |r13-2661-gb57abd072dd319a7
Last reconfirmed| |2023-01-17
Ever confirmed|0 |1
CC| |julian at codesourcery dot com,
| |marxin at gcc dot gnu.org
Status|UNCONFIRMED |NEW
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r13-2661-gb57abd072dd319a7.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/108422] [13 Regression] ICE: base pointer cycle detected since r13-2661-gb57abd072dd319a7
2023-01-16 17:49 [Bug c++/108422] New: [13 Regression] ICE: base pointer cycle detected gscfq@t-online.de
2023-01-17 7:04 ` [Bug c++/108422] " rguenth at gcc dot gnu.org
2023-01-17 13:29 ` [Bug c++/108422] [13 Regression] ICE: base pointer cycle detected since r13-2661-gb57abd072dd319a7 marxin at gcc dot gnu.org
@ 2023-02-20 9:26 ` burnus at gcc dot gnu.org
2023-02-20 9:45 ` burnus at gcc dot gnu.org
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu.org @ 2023-02-20 9:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108422
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org
Keywords| |ice-on-invalid-code
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
#pragma omp target parallel
#pragma omp target
++a;
This violates:
"Restrictions to the target construct are as follows:
• Device-affecting constructs, other than target constructs for which the
ancestor device-modifier is specified, must not be encountered during execution
of a target region."
And GCC should print (existing check):
warning: ‘target’ construct inside of ‘target’ region
However, when making it valid by adding
#pragma omp requires reverse_offload
+ adding 'device(ancestor:1)' to the second 'omp target',
it still fails with the ICE.
* * *
For the failing case,
Breakpoint 4, gimplify_scan_omp_clauses (list_p=0x7ffff6fc5570,
pre_p=0x7fffffffd7a0, region_type=ORT_TARGET, code=OMP_TARGET) at
../../repos/gcc/gcc/gimplify.cc:10771
10771 outlist = omp_tsort_mapping_groups (groups, grpmap);
(gdb) p debug(groups->m_vec->m_vecdata.grp_start[0])
map(to:*(const struct ._anon_0 *) __closure)
map(firstprivate:__closure [pointer assign, bias: 0])
map(tofrom:*__closure->__a [len: 4])
map(always_pointer:__closure->__a [pointer assign, bias: 0])
map(to:*__closure)
map(to:*(const struct ._anon_0 *) __closure)
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/108422] [13 Regression] ICE: base pointer cycle detected since r13-2661-gb57abd072dd319a7
2023-01-16 17:49 [Bug c++/108422] New: [13 Regression] ICE: base pointer cycle detected gscfq@t-online.de
` (2 preceding siblings ...)
2023-02-20 9:26 ` burnus at gcc dot gnu.org
@ 2023-02-20 9:45 ` burnus at gcc dot gnu.org
2023-02-20 10:02 ` burnus at gcc dot gnu.org
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu.org @ 2023-02-20 9:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108422
--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> ---
FOR_EACH_VEC_ELT (*groups, i, grp)
{
if (grp->mark != PERMANENT)
if (!omp_tsort_mapping_groups_1 (&cursor, groups, grpmap, grp))
return NULL;
}
first processes:
map(to:*(const struct ._anon_0 *) __closure) map(firstprivate:__closure
[pointer assign, bias: 0]) map(tofrom:*__closure->__a [len: 4])
map(always_pointer:__closure->__a [pointer assign, bias: 0]) map(to:*__closure)
map(to:*(const struct ._anon_0 *) __closure)
which then has:
*innerp == grp
in omp_tsort_mapping_groups_1.
The next VEC has:
(gdb) p debug(*grp.grp_start)
map(tofrom:*__closure->__a [len: 4]) map(always_pointer:__closure->__a [pointer
assign, bias: 0]) map(to:*__closure) map(to:*(const struct ._anon_0 *)
__closure)
But the inner one is again the previous one:
(gdb) p debug(**innerp.grp_start)
map(to:*(const struct ._anon_0 *) __closure) map(firstprivate:__closure
[pointer assign, bias: 0]) map(tofrom:*__closure->__a [len: 4])
map(always_pointer:__closure->__a [pointer assign, bias: 0]) map(to:*__closure)
map(to:*(const struct ._anon_0 *) __closure)
where:
(gdb) p (*innerp)->mark
$78 = PERMANENT
Untested patch:
--- a/gcc/gimplify.cc
+++ b/gcc/gimplify.cc
@@ -9643 +9643 @@ omp_tsort_mapping_groups_1 (omp_mapping_group ***outlist,
- if (innerp && *innerp != grp)
+ if (innerp && *innerp != grp && (*innerp)->mark != PERMANENT)
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/108422] [13 Regression] ICE: base pointer cycle detected since r13-2661-gb57abd072dd319a7
2023-01-16 17:49 [Bug c++/108422] New: [13 Regression] ICE: base pointer cycle detected gscfq@t-online.de
` (3 preceding siblings ...)
2023-02-20 9:45 ` burnus at gcc dot gnu.org
@ 2023-02-20 10:02 ` burnus at gcc dot gnu.org
2023-02-21 13:05 ` rguenth at gcc dot gnu.org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu.org @ 2023-02-20 10:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108422
--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Created attachment 54491
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54491&action=edit
Testcase - compile with 'g++ -fopenmp' + run
(In reply to Tobias Burnus from comment #3)
> --- a/gcc/gimplify.cc
> +++ b/gcc/gimplify.cc
> @@ -9643 +9643 @@ omp_tsort_mapping_groups_1 (omp_mapping_group ***outlist,
> - if (innerp && *innerp != grp)
> + if (innerp && *innerp != grp && (*innerp)->mark != PERMANENT)
While COMPILING WORKS and the expected nested-target warning is printed,
it FAILS at RUNTIME (on a system not configured for offloading) with a
segfault.
That's related to the warning:
test.cc:20:13: warning: '__closure' is used uninitialized [-Wuninitialized]
which appears at the location of the outer 'omp target (parallel)'.
Note: without inner target construct (reverse offload), the program runs fine.
(Independent of the one-line patch.)
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/108422] [13 Regression] ICE: base pointer cycle detected since r13-2661-gb57abd072dd319a7
2023-01-16 17:49 [Bug c++/108422] New: [13 Regression] ICE: base pointer cycle detected gscfq@t-online.de
` (4 preceding siblings ...)
2023-02-20 10:02 ` burnus at gcc dot gnu.org
@ 2023-02-21 13:05 ` rguenth at gcc dot gnu.org
2023-02-21 17:43 ` burnus at gcc dot gnu.org
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-02-21 13:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108422
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Priority|P3 |P1
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/108422] [13 Regression] ICE: base pointer cycle detected since r13-2661-gb57abd072dd319a7
2023-01-16 17:49 [Bug c++/108422] New: [13 Regression] ICE: base pointer cycle detected gscfq@t-online.de
` (5 preceding siblings ...)
2023-02-21 13:05 ` rguenth at gcc dot gnu.org
@ 2023-02-21 17:43 ` burnus at gcc dot gnu.org
2023-04-26 6:57 ` [Bug c++/108422] [13/14 " rguenth at gcc dot gnu.org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu.org @ 2023-02-21 17:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108422
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P1 |P3
--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> ---
As discussed with richi on #gcc IRC: it shouldn't be P1 - and I could/should
mark it as P3, which I now did.
Reasoning:
- With GCC 12, it compiles without an ICE but as with mainline with the patch
in
comment 4 applied, it will fail (segfault) at runtime
(→ testcase in attachment 54491)
- If being strict, nested target is not permitted - except with
'reverse offload', which fails in GCC 12 (sorry) as not supported.
(Still, we should try to fix the ICE - but best instead of creating invalid
code,
either a sorry or working code would be good.)
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/108422] [13/14 Regression] ICE: base pointer cycle detected since r13-2661-gb57abd072dd319a7
2023-01-16 17:49 [Bug c++/108422] New: [13 Regression] ICE: base pointer cycle detected gscfq@t-online.de
` (6 preceding siblings ...)
2023-02-21 17:43 ` burnus at gcc dot gnu.org
@ 2023-04-26 6:57 ` rguenth at gcc dot gnu.org
2023-07-27 9:25 ` rguenth at gcc dot gnu.org
2024-05-21 9:13 ` [Bug c++/108422] [13/14/15 " jakub at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-04-26 6:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108422
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|13.0 |13.2
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 13.1 is being released, retargeting bugs to GCC 13.2.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/108422] [13/14 Regression] ICE: base pointer cycle detected since r13-2661-gb57abd072dd319a7
2023-01-16 17:49 [Bug c++/108422] New: [13 Regression] ICE: base pointer cycle detected gscfq@t-online.de
` (7 preceding siblings ...)
2023-04-26 6:57 ` [Bug c++/108422] [13/14 " rguenth at gcc dot gnu.org
@ 2023-07-27 9:25 ` rguenth at gcc dot gnu.org
2024-05-21 9:13 ` [Bug c++/108422] [13/14/15 " jakub at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-27 9:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108422
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|13.2 |13.3
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 13.2 is being released, retargeting bugs to GCC 13.3.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/108422] [13/14/15 Regression] ICE: base pointer cycle detected since r13-2661-gb57abd072dd319a7
2023-01-16 17:49 [Bug c++/108422] New: [13 Regression] ICE: base pointer cycle detected gscfq@t-online.de
` (8 preceding siblings ...)
2023-07-27 9:25 ` rguenth at gcc dot gnu.org
@ 2024-05-21 9:13 ` jakub at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-05-21 9:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108422
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|13.3 |13.4
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 13.3 is being released, retargeting bugs to GCC 13.4.
^ permalink raw reply [flat|nested] 11+ messages in thread