1  /* PR c/5681
       2     This testcase failed on IA-32 at -O0, because safe_from_p
       3     incorrectly assumed it is safe to first write into a.a2 b-1
       4     and then read the original value from it.  */
       5  
       6  int bar (float);
       7  
       8  struct A {
       9    float a1;
      10    int a2;
      11  } a;
      12  
      13  int b;
      14  
      15  void foo (void)
      16  {
      17    a.a2 = bar (a.a1);
      18    a.a2 = a.a2 < b - 1 ? a.a2 : b - 1;
      19    if (a.a2 >= b - 1)
      20      abort ();
      21  }
      22  
      23  int bar (float x)
      24  {
      25    return 2241;
      26  }
      27  
      28  int main()
      29  {
      30    a.a1 = 1.0f;
      31    b = 3384;
      32    foo ();
      33    return 0;
      34  }