view gcc/testsuite/gcc.dg/tls/pr83945.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children
line wrap: on
line source

/* PR middle-end/83945 */
/* { dg-do compile { target tls } } */
/* { dg-options "-O2" } */

struct S { int a[1]; };
__thread struct T { int c; } e;
int f;
void bar (int);

void
foo (int f, int x)
{
  struct S *h = (struct S *) &e.c;
  for (;;)
    {
      int *a = h->a, i;
      for (i = x; i; i--)
	bar (a[f]);
      bar (a[f]);
    }
}