the testcase uplevi.c is to show that for OpenMP programs, gcc reference uplevel variable by [%fp - 4] in each thread.
micro# cat uplevi.c int main() { int i; void sub() { printf("0x%x\n", &i); } #pragma omp parallel num_threads(4) sub(); return 0; } micro# /import/dr3/s10/gcc-4.2/bin/gcc uplevi.c -fopenmp -w micro# ./a.out 0xfeffbecc 0xfeefbecc 0xffbffa8c 0xff0fbecc micro# /import/dr3/s10/gcc-4.2/bin/gcc -v Using built-in specs. Target: sparc-sun-solaris2.10 Configured with: /import/dr2/starlex/1/gcc-4.2-20070228/configure --prefix=/import/dr3/s10/gcc-4.2 --enable-languages=c,c++,fortran --enable-rpath --with-mpfr=/import/dr3/s10/gcc-4.2 --with-gmp=/import/dr3/s10/gcc-4.2 Thread model: posix gcc version 4.2.0 20070228 (prerelease) -- Summary: gcc handled OpenMP programs with uplevel reference wrongly Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: major Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: hailijuan at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36354