This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libgomp/69555] libgomp.c++/target-6.C fails because of undefined behaviour


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]