This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libgomp/69555] libgomp.c++/target-6.C fails because of undefined behaviour
- From: "vogt at linux dot vnet.ibm.com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 29 Jan 2016 15:17:09 +0000
- Subject: [Bug libgomp/69555] libgomp.c++/target-6.C fails because of undefined behaviour
- Auto-submitted: auto-generated
- References: <bug-69555-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69555
--- Comment #6 from Dominik Vogt <vogt at linux dot vnet.ibm.com> ---
Example:
-- snip --
#include <stdio.h>
int main ()
{
int a;
int &c = a;
printf("a %p\n", &a);
printf("g %p\n", &c);
#pragma omp target private (c)
{
printf("t %p\n", &c);
}
return 0;
}
-- snip --
prints
a 0x3ffffa0edb4
g 0x3ffffa0edb4
t 0x3ffffa0ea24 <--- c in the loop points to different memory