[Bug 198] Optimization makes incorrect results
d.gnu at puremagic.com
Mon Sep 14 00:11:24 PDT 2015
--- Comment #2 from Iain Buclaw <ibuclaw at gdcproject.org> ---
Seems to be something bizarre going on with struct member functions, possibly
only related to instantiated members. Having a bare function works just fine.
ref Vector opOpAssign (ref Vector rthis, Vector operand)
rthis.x += operand.x;
rthis.y += operand.y;
rthis.z += operand.z;
Either a mismatch between function type and function parameter types are
throwing off the optimizer, or something else is afoot to make it believe that
the 'this' value members can never change.
In gdc-5, all optimisation levels constfold the answer correctly in the
testcase, except for -Og level, which calls f(), but the entire foreach loop
has been reduced to nothing, so it passes Vector(0,0,0) to sum().
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the D.gnu