PR testsuite/86649
[official-gcc.git] / gcc / testsuite / g++.dg / tree-ssa / sra-1.C
blobe3e3918eb78f2e7963f9d5fe2432b8f8651a0c9e
1 /* https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=223576 */
3 /* SRA failed to canonicalize bit-field types, introducing type
4    mismatches.  */
6 /* { dg-do compile } */
7 /* { dg-options "-O2" } */
9 struct A
11   int a:16;
12   /* These dummy bit-fields are here to prevent GCC 4.2+ from merging
13      the bit-field compares into a single word compare, which disables
14      SRA.  */
15   int a2:16;
16   int a3:16;
17   int a4:16;
18   int b:8;
19   bool operator==(A const x) const
20   {
21     return (this->a == x.a && this->b == x.b);
22   }
25 bool
26 foo (A const x, A const y)
28   return x == y;