gcc/testsuite/g++.dg/opt/pr100469.C
raw| 1 | // PR debug/100469 |
| 2 | // { dg-do compile } |
| 3 | // { dg-options "-O2 -fcompare-debug -fno-tree-dse -fno-tree-forwprop -fno-tree-tail-merge --param=sccvn-max-alias-queries-per-access=0" } |
| 4 | |
| 5 | struct S |
| 6 | { |
| 7 | long m; |
| 8 | S (const S &s) |
| 9 | { |
| 10 | m = s.m; |
| 11 | } |
| 12 | S (long l) |
| 13 | { |
| 14 | m = l; |
| 15 | } |
| 16 | bool operatorX (const S &s) |
| 17 | { |
| 18 | return m >= s.m; |
| 19 | } |
| 20 | }; |
| 21 | |
| 22 | static inline S |
| 23 | bar (S a, S b) |
| 24 | { |
| 25 | return a.operatorX (b) ? a : b; |
| 26 | } |
| 27 | |
| 28 | S |
| 29 | foo (S s) |
| 30 | { |
| 31 | return bar (s, (S) 0); |
| 32 | } |