https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117912
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rejects-valid |wrong-code --- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> --- rejects-valid seems inappropriate here, sure, with the error attribute one can error on all kinds of things and so most missed optimizations could be that way rejects-valid as well. I think it is wrong-code, __builtin_object_size (x, 1) is supposed to return the minimum object size, so returning something smaller (like here 0) than the minimum (which isn't really known, because we don't see what allocated it and it is flexible array member) is wrong-code, returning something larger is perhaps missed optimization (but we document that it can always give up and return something more conservative up to all ones).