(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
pr70169.c
       1  /* PR tree-optimization/70169 */
       2  /* { dg-do compile } */
       3  /* { dg-options "-O2 -fno-strict-aliasing -fno-tree-dce" } */
       4  /* { dg-skip-if "Program and data reside in different address spaces" { "avr-*-*" } } */
       5  /* { dg-require-effective-target label_values } */
       6  
       7  int printf (const char *, ...); 
       8  
       9  void
      10  foo ()
      11  {
      12    unsigned char *p = (unsigned char *) &printf;
      13    for (;;)
      14      (*p)++;
      15  }
      16  
      17  void
      18  bar (int x)
      19  {
      20    unsigned char *p = (unsigned char *) &printf;
      21    int i;
      22    for (i = 0; i < x; i++)
      23      (*p)++;
      24  }
      25  
      26  void
      27  baz (int x, int y)
      28  {
      29    unsigned char *p = (unsigned char *) &&lab;
      30    int i;
      31    if (y)
      32      {
      33        for (i = 0; i < x; i++)
      34  	(*p)++;
      35      }
      36    else
      37      {
      38       lab:
      39        asm volatile ("");
      40        foo ();
      41      }
      42  }