From 5d972e66ba61be501c98be1c6aa565d42c1737e5 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 23 Feb 2017 12:38:39 +0000 Subject: [PATCH] re PR c/79684 (Conditional jump or move depends on uninitialised value in GIMPLE FE) 2017-02-23 Richard Biener PR c/79684 * gimple-parser.c (c_parser_gimple_statement): Use set_error to initialize c_exprs to return. (c_parser_gimple_binary_expression): Likewise. (c_parser_gimple_unary_expression): Likewise. (c_parser_gimple_postfix_expression): Likewise. From-SVN: r245681 --- gcc/c/ChangeLog | 9 +++++++++ gcc/c/gimple-parser.c | 13 +++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 8283c827d87..70cfdc20980 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,12 @@ +2017-02-23 Richard Biener + + PR c/79684 + * gimple-parser.c (c_parser_gimple_statement): Use set_error + to initialize c_exprs to return. + (c_parser_gimple_binary_expression): Likewise. + (c_parser_gimple_unary_expression): Likewise. + (c_parser_gimple_postfix_expression): Likewise. + 2017-02-22 Marek Polacek PR c/79662 diff --git a/gcc/c/gimple-parser.c b/gcc/c/gimple-parser.c index cb2b6af0cb1..0d6384b55c2 100644 --- a/gcc/c/gimple-parser.c +++ b/gcc/c/gimple-parser.c @@ -270,7 +270,7 @@ c_parser_gimple_statement (c_parser *parser, gimple_seq *seq) lhs = c_parser_gimple_unary_expression (parser); loc = EXPR_LOCATION (lhs.value); - rhs.value = error_mark_node; + rhs.set_error (); /* GIMPLE call statement without LHS. */ if (c_parser_next_token_is (parser, CPP_SEMICOLON) @@ -455,7 +455,7 @@ c_parser_gimple_binary_expression (c_parser *parser) /* Location of the binary operator. */ struct c_expr ret, lhs, rhs; enum tree_code code = ERROR_MARK; - ret.value = error_mark_node; + ret.set_error (); lhs = c_parser_gimple_postfix_expression (parser); if (c_parser_error (parser)) return ret; @@ -553,9 +553,7 @@ c_parser_gimple_unary_expression (c_parser *parser) struct c_expr ret, op; location_t op_loc = c_parser_peek_token (parser)->location; location_t finish; - ret.original_code = ERROR_MARK; - ret.original_type = NULL; - ret.value = error_mark_node; + ret.set_error (); switch (c_parser_peek_token (parser)->type) { case CPP_AND: @@ -723,11 +721,10 @@ c_parser_parse_ssa_name (c_parser *parser, static struct c_expr c_parser_gimple_postfix_expression (c_parser *parser) { - struct c_expr expr; location_t loc = c_parser_peek_token (parser)->location; source_range tok_range = c_parser_peek_token (parser)->get_range (); - expr.original_code = ERROR_MARK; - expr.original_type = NULL; + struct c_expr expr; + expr.set_error (); switch (c_parser_peek_token (parser)->type) { case CPP_NUMBER: -- 2.30.2