https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119662
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[OpenMP] Unhelpful debug |[OpenMP] Wrong-code for
|line location for |'omp dispatch' with
|append_args call |append_args clause and
| |unhelpful debug line
| |location
Keywords| |wrong-code
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> ---
-fdump-tree-optimized-lineno:
[testsuite/libgomp.c/append-args-fr-1.c:66:21] is_targetsync = 0;
interopobjs.56[0] = &interop.58;
tgt_tgtsync.57[0] = 1;
GOMP_interop (-5, 1, interopobjs.56, tgt_tgtsync.57, 0B, 0, 0B, 0, 0B, 0,
0B);
[testsuite/libgomp.c/append-args-fr-1.c:68:13] interop.60_58 = interop.58;
[testsuite/libgomp.c/append-args-fr-1.c:68:13] cleanuptmp.59_60 = f0_1_tg_
(interop.60_58);
[testsuite/libgomp.c/append-args-fr-1.c:68:9 discrim 1] GOMP_interop (-5, 0,
0B, 0B, 0B, 0, 0B, 1, interopobjs.56, 0, 0B);
[testsuite/libgomp.c/append-args-fr-1.c:68:9 discrim 2] interop.58 ={v}
{CLOBBER(eob)};
[testsuite/libgomp.c/append-args-fr-1.c:68:11 discrim 2] i_63 =
cleanuptmp.59_60;
[testsuite/libgomp.c/append-args-fr-1.c:69:7] if (i_63 == 4242)
* * *
WRONG CODE ISSUE:
The original issue leading me to find the debugger issue is a crash at runtime.
The problem is a missing '&' before 'interopobjs' in:
GOMP_interop (-5, 1, interopobjs.56, tgt_tgtsync.57, 0B, 0, 0B, 0, 0B, 0,
0B);
GOMP_interop (-5, 0, 0B, 0B, 0B, 0, 0B, 1, interopobjs.56, 0, 0B);
I keep getting confused whether the '&' is technically required or not, but
#pragma omp interop init(target: myobj)
successfully uses
interopobjs.88[0] = &myobj;
tgt_tgtsync.89[0] = 1;
GOMP_interop (-5, 1, &interopobjs.88, &tgt_tgtsync.89, 0B, 0, 0B, 0, 0B, 0,
0B);
* * *
I think the problem is the following (at least on x86-64-gnu-linux).
Assume 'omp_interop_t interopobjs[2]'.
Without '&', I think a 2*sizeof(omp_interop_t) = 2*sizeof(void *) object is
passed on the stack (by value).
But we want to pass the address of the 'interopobjs' array - which is
sizeof(void*).