gcc/testsuite/gcc.dg/tree-ssa/dup_compare_cond-2.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-fgimple -O2 -fdump-tree-optimized " } */ |
| 3 | /* PR middle-end/105715 */ |
| 4 | |
| 5 | int __GIMPLE() f(int a, int b, int c, int d, int e) |
| 6 | { |
| 7 | _Bool t; |
| 8 | int ff; |
| 9 | int gg; |
| 10 | int res; |
| 11 | t = a == b; |
| 12 | ff = t ? a : e; |
| 13 | gg = t ? d : b; |
| 14 | res = ff+gg; |
| 15 | return res; |
| 16 | } |
| 17 | |
| 18 | /* At -O2 we should have duplicate the comparison. */ |
| 19 | /* { dg-final { scan-tree-dump-times " == " 2 "optimized" } } */ |