This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/29198] [4.0/4.1/4.2 Regression] Incorrect reference to __thread array with -fPIC -O2 on x86
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Sep 2006 05:34:04 -0000
- Subject: [Bug target/29198] [4.0/4.1/4.2 Regression] Incorrect reference to __thread array with -fPIC -O2 on x86
- References: <bug-29198-1313@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from pinskia at gcc dot gnu dot org 2006-09-24 05:34 -------
Here is a testcase which shows this is a latent bug:
extern int f2 (int, int, int, int);
struct s { char b[4]; };
__thread struct s a[2];
void f1 (int a1, int a2)
{
int i, j;
for (i = 0; i < 4; i++)
{
int tot = 0;
for (j = 0; j < 4; j++)
tot += f2 (a1, a2, i, j);
*(&a[0].b[0] + i) = tot;
}
}
------
But since the orginal testcase worked in 3.4.0, this should be still marked as
a regression, IV-OPTs is causing the latent bug to show up.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29198