In this testcase, because sizeof (T) - 5 has unsigned type, it ends up being an extremely large number rather than a negative one. valid_constant_size_p seems to be a useful predicate for recognizing problematic cases; tree_int_cst_sign_bit should also work, but seems more subtle. While I was looking at this I also noticed that the standard has changed to specify that array bounds are converted constant expressions, which allows us to simplify some of the code earlier in the function. Tested x86_64-pc-linux-gnu, applying to trunk.