1  /* PR middle-end/83945 */
       2  /* { dg-do compile { target tls } } */
       3  /* { dg-options "-O2" } */
       4  
       5  struct S { int a[1]; };
       6  __thread struct T { int c; } e;
       7  int f;
       8  void bar (int);
       9  
      10  void
      11  foo (int f, int x)
      12  {
      13    struct S *h = (struct S *) &e.c;
      14    for (;;)
      15      {
      16        int *a = h->a, i;
      17        for (i = x; i; i--)
      18  	bar (a[f]);
      19        bar (a[f]);
      20      }
      21  }