If edges are swapped so are PHI args, the following adjusts the pattern for this case.
Committed. Richard. 2016-08-05 Richard Biener <rguent...@suse.de> * gcc.dg/tree-ssa/ivopt_5.c: Make robust against edge swapping. Index: gcc/testsuite/gcc.dg/tree-ssa/ivopt_5.c =================================================================== --- gcc/testsuite/gcc.dg/tree-ssa/ivopt_5.c (revision 239164) +++ gcc/testsuite/gcc.dg/tree-ssa/ivopt_5.c (working copy) @@ -20,4 +20,4 @@ void foo1 (char *pstart, int n) *p = 1; } -/* { dg-final { scan-tree-dump-times "ivtmp.\[0-9_\]* = PHI <\[^0\]" 0 "ivopts"} } */ +/* { dg-final { scan-tree-dump-times "ivtmp.\[0-9_\]* = PHI <\[^0\]\[^,\]*, \[^0\]" 0 "ivopts"} } */