We were using g++ (GCC) 3.4.6 20060404 (Red Hat 3.4.6.9) on Linux 2.6.24.14 SMP
X86_64 GNU/Linux 4-core Intel @2.66GHz.
We executed: g++ -O0 test.cc
./a.out
./a.out causes segmentation fault.
The file test.cc folows below:
__thread int testarray[2];
int main()
{
int i = 2;
testarray[i-1] = 1;
int p;
p = testarray[i-1];
p = p + 1;
printf("%d\n", p);
return 0;
}
--
Summary: __thread generators a.out that creates segmentation
fault
Product: gcc
Version: 3.4.6
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: xindong at ccs dot neu dot edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35080