1// PR tree-optimization/42645
2// { dg-do compile }
3// { dg-options "-fcompare-debug -O1" }
4
5extern void foo ();
6
7struct S
8{
9  struct T
10  {
11    int t1;
12    char t2[4];
13    T *t3;
14  } t;
15  int m1 () const { return t.t3[0].t1; }
16  char *m2 () { foo (); }
17  void m3 (int x) { char *m = m2 (); if (m1 () > 0 && x > 0); }
18  void m4 () { if (m1 () > 0) for (int i = 0; i < 4; i++) t.t2[i] = 0; }
19};
20
21void
22f (S *a)
23{
24  a->m3 (0);
25  a->m4 ();
26}
27