http://bugzilla.suse.com/show_bug.cgi?id=1169156
http://bugzilla.suse.com/show_bug.cgi?id=1169156#c9
--- Comment #9 from Petr Tesařík ---
I'm afraid this is not quite what I mean. The issue is that
__builtin_constant_p() is not tightly coupled with the knowledge of something
actually being constant. So, you process code that looks (roughly) like:
var = 1;
if (something)
cond = __builtin_constant_p(var);
else {
var = unknown_result();
cond = __builtin_constant_p(var);
}
if (cond) {
d = y / var;
}
If cond is true, then var must be 1 (known to be constant), so GCC could
optimize the expression (y / var) to (y / 1). I know this can be hard to track.
--
You are receiving this mail because:
You are on the CC list for the bug.