------- Comment #14 from acarmeli at mathworks dot com 2008-05-28 12:25 ------- You are correct. But step 6 did not reveal that, and provided a correct s64 result. This result should have been carried over to step 7 to lead to a correct result.
Otherwise, it will not be possible to get the result through a folded expression. It seems to me that adding more to the expression changes the optimization to inner expressions in a way that compromizes the numerical stability. We also tried masking to eliminate unwanted bits. The masks seem to have no effect and we suspect they get optimized out. It was an unfavorable solution anyway, due to the cost of the mask. In effect, there is no reliable way to grow a folded expression and consistently preserve the result of inner expressions. The only solution we have is temporary variables, which might get optimized out and folded as well. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36300