From patchwork Wed Oct 13 05:20:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: initialize incr in c-parser.c:c_parser_for_statement Date: Tue, 12 Oct 2010 19:20:04 -0000 From: Alexandre Oliva X-Patchwork-Id: 67642 Message-Id: To: gcc-patches@gcc.gnu.org Bootstrap fails with bootstrap-O3 because GCC gets the impression that incr is used without being initialized. AFAICT the impression is wrong, and incr is initialized in every path that leads to the use, but it's not too much of a problem to initialize it with the value that is stored in it in most other paths anyway. I'm checking this in as obviously correct. Regstrapped on x86_64-linux-gnu and i686-pc-linux-gnu. for gcc/ChangeLog from Alexandre Oliva * c-parser.c (c_parser_for_statement): Initialize incr. Index: gcc/c-parser.c =================================================================== --- gcc/c-parser.c.orig 2010-10-08 20:24:43.873491162 -0300 +++ gcc/c-parser.c 2010-10-08 20:29:04.034490577 -0300 @@ -4538,6 +4538,9 @@ c_parser_for_statement (c_parser *parser /* Parse the initialization declaration or expression. */ cond = error_mark_node; object_expression = error_mark_node; + /* Initializing incr should not be necessary, but it avoids + bogus warnings of uninitialized uses. */ + incr = error_mark_node; if (c_parser_next_token_is (parser, CPP_SEMICOLON)) {