------- Comment #3 from pinskia at gcc dot gnu dot org 2008-07-22 21:18 ------- > The warning is very fragile: if the buffer in main() is not static then > there is no failure; is the size is passed as a constant there is no error.
Not really, if you read my comment, you will understand why this is not that fragile after all. I can make it even worse if you do a couple of things to trick one optimization pass up enough so we warn in the first VRP but don't optimize it away until the last VRP pass. But really this is the normal issue with optimizers warnings and is a hard problem to solve in general and I don't think we can count this as a regression really. -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Keywords| |diagnostic Last reconfirmed|0000-00-00 00:00:00 |2008-07-22 21:18:28 date| | Summary|[4.3/4.4 Regression]: Bogus |Array bound warning with |array bound warning |dead code after optimization http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36902