[Bug target/29198] [4.0/4.1/4.2 Regression] Incorrect reference to __thread array with -fPIC -O2 on x86

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sun Sep 24 05:34:00 GMT 2006



------- 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



More information about the Gcc-bugs mailing list