summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2017-02-23 12:38:39 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2017-02-23 12:38:39 +0000
commita450df95c215fd7af0eb42e1d6c46354324dad44 (patch)
treeeb4ff64f1a5bc2b51736f879d007e709b701437d
parentaa81cea403a738d9e0442e0a1597b87440df4530 (diff)
downloadgcc-a450df95c215fd7af0eb42e1d6c46354324dad44.tar.gz
2017-02-23 Richard Biener <rguenther@suse.de>
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245681 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/c/ChangeLog9
-rw-r--r--gcc/c/gimple-parser.c13
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 <rguenther@suse.de>
+
+ 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 <polacek@redhat.com>
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: