------- Comment #18 from ubizjak at gmail dot com 2007-04-05 16:39 ------- (In reply to comment #17) > Is the output from .optimized different? (once the ssa versions numbers have > been stripped). Those PHIs should be irrelevant, the question is whether the > different versioning has any effect. > > The only way I can think that out-of-ssa could produce different results is if > it had to choose between two same-cost coalesces, and the versioning resulted > in them being in different places in the coalesce list. Check the .optimized > output and if the code is equivalent, the problem is after that stage.
They are _not_ equivalent. We have: --cut here-- <bb 2>: __builtin_puts (&"Start?"[0]); v2x = 0.0; v2y = 1.0e+0; v2z = 0.0; i = 0; v1x = 1.0e+0; v1y = 0.0; v1z = 0.0; <L0>:; v3x = v1y * v2z - v1z * v2y; v3y = v1z * v2x - v1x * v2z; v3z = v1x * v2y - v1y * v2x; i = i + 1; v1z = v2z; v1y = v2y; v1x = v2x; v2z = v3z; v2y = v3y; v2x = v3x; if (i != 100000000) goto <L0>; else goto <L2>; <L2>:; __builtin_puts (&"Stop!"[0]); printf (&"Result = %f, %f, %f\n"[0], (double) v3x, (double) v3y, (double) v3z); return 0; --cut here-- =====VS===== --cut here-- <bb 2>: __builtin_puts (&"Start?"[0]); i = 0; v1x = 1.0e+0; v1y = 0.0; v1z = 0.0; v2x.43 = 0.0; v2y.44 = 1.0e+0; v2z.45 = 0.0; <L0>:; v3x = v1y * v2z.45 - v1z * v2y.44; v3y = v1z * v2x.43 - v1x * v2z.45; v3z = v1x * v2y.44 - v1y * v2x.43; i = i + 1; v2z = v3z; v2y = v3y; v2x = v3x; v1z = v2z.45; v1y = v2y.44; v1x = v2x.43; if (i != 100000000) goto <L8>; else goto <L2>; <L8>:; v2x.43 = v2x; v2y.44 = v2y; v2z.45 = v2z; goto <bb 3> (<L0>); <L2>:; __builtin_puts (&"Stop!"[0]); printf (&"Result = %f, %f, %f\n"[0], (double) v3x, (double) v3y, (double) v3z); return 0; --cut here-- -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19780