1 /* { dg-do compile } */ 2 /* { dg-options "-O2 -fdump-tree-sink" } */ 3 4 int x; foo(int b)5void foo (int b) 6 { 7 if (b) 8 x = b; 9 else 10 x = 2; 11 } 12 13 /* We should have sunk the store and inserted a PHI to merge the 14 stored values. */ 15 16 /* { dg-final { scan-tree-dump-times " = PHI" 1 "sink" } } */ 17 /* { dg-final { scan-tree-dump-times "x = " 1 "sink" } } */ 18