------- Comment #3 from jakub at gcc dot gnu dot org 2009-09-30 10:07 ------- Try using 4U instead of 4 or (size_t) 4 and you'll see it not optimized out either. The problem is that the second comparison is done in size_t, unsigned type, so if argc is say -3, the function doesn't return -1 early. And, as __builtin_object_size (buffer, 0) is (size_t) 10, if argc is -1, (size_t) 10 < -1 is true and thus undefined_on_purpose should be called.
-- jakub at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41516