1  /* PR tree-optimization/84478 */
       2  
       3  long poolptr;
       4  unsigned char *strpool;
       5  static const char *poolfilearr[] = {
       6    "mu",
       7    "",
       8  #define A "x",
       9  #define B A "xx", A A "xxx", A A A A A
      10  #define C B B B B B B B B B B
      11  #define D C C C C C C C C C C
      12    D C C C C C C C B B B
      13   ((void *)0) 
      14  };
      15  
      16  __attribute__((noipa)) long
      17  makestring (void)
      18  {
      19    return 1;
      20  }
      21  
      22  __attribute__((noipa)) long
      23  loadpoolstrings (long spare_size)
      24  {
      25    const char *s;
      26    long g = 0;
      27    int i = 0, j = 0;
      28    while ((s = poolfilearr[j++]))
      29      {
      30        int l = __builtin_strlen (s);
      31        i += l;
      32        if (i >= spare_size) return 0;
      33        while (l-- > 0) strpool[poolptr++] = *s++;
      34        g = makestring ();
      35      }
      36    return g;
      37  }
      38  
      39  int
      40  main ()
      41  {
      42    strpool = __builtin_malloc (4000);
      43    if (!strpool)
      44      return 0;
      45    asm volatile ("" : : : "memory");
      46    volatile int r = loadpoolstrings (4000);
      47    __builtin_free (strpool);
      48    return 0;
      49  }