[Bug tree-optimization/64308] Missed optimization: 64-bit divide used when 32-bit divide would work

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Dec 15 08:55:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64308

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Not sure if your analysis is correct, but value-range propagation computes

ret_4: VARYING
...
_12: [0, 4294967295]
_13: [0, 4294967295]
_14: [0, 18446744065119617025]
_15: [0, 4294967295]
_16: [0, +INF]

for

Folding statement: _12 = (long long unsigned int) ret_4;
Not folded
Folding statement: _13 = (long long unsigned int) b_1;
Not folded
Folding statement: _14 = _12 * _13;
Not folded
Folding statement: _15 = (long long unsigned int) m_6(D);
Not folded
Folding statement: _16 = _14 % _15;

so its analysis needs to be improved (didn't investigate exactly where it
fails, but IIRC modulo is not handled here because m may be zero).



More information about the Gcc-bugs mailing list