http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61144
--- Comment #12 from Rich Felker <bugdal at aerifal dot cx> --- Furthermore, __builtin_constant_p(dummy) wrongly returns 1, even though dummy is modifiable externally via foo (assuming foo is not replaced by a strong definition elsewhere). Perhaps this should be filed as a separate bug since it's also user-visible, but I think the cause is the same. On the other hand, according to my tests on gcc.godbolt.org, the incorrect value for __builtin_constant_p predates the optimization bug. This could mean they're separate bugs, but I suspect the later changes that cause the optimization bug were "correct" except that they're using the wrong concept of "is this expression constant?" from the earlier bug.