how to debug openmp program? For example, xx = bb; I use print("xx = %d bb = %d\n",xx,bb); and the two value is the same. But when I insert a breakpoint after the "xx=bb" using gdb, the two value is not the same.
Please consult a gdb documentation of multithreaded programs debugging.
https://sourceware.org/gdb/current/onlinedocs/gdb/Threads.html
For more complete information about compiler optimizations, see our Optimization Notice.