1  /* PR tree-optimization/18828 */
       2  /* { dg-do compile } */
       3  /* { dg-options "-O2" } */
       4  
       5  #include <stdarg.h>
       6  
       7  extern void abort (void);
       8  
       9  void foo (int x, ...)
      10  {
      11    va_list ap;
      12    if (x != 21)
      13      abort ();
      14    va_start (ap, x);
      15    va_end (ap);
      16  }
      17  
      18  void bar (int x, ...)
      19  {
      20    va_list ap;
      21    x++;
      22    va_start (ap, x);
      23    va_end (ap);
      24  }
      25  
      26  void baz (int x, ...)
      27  {
      28    va_list ap;
      29    x = 0;
      30    va_start (ap, x);
      31    va_end (ap);
      32  }