diff options
author | Jeff Law <law@redhat.com> | 2014-05-01 23:46:38 -0600 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2014-05-01 23:46:38 -0600 |
commit | 4bd2511b3c0f8bf4d447d5765c0b3a247c66ca89 (patch) | |
tree | 7c60ee1f177375d0d8f015913516c97b9fcf11e0 /gcc/c | |
parent | 6a358dcb65c409f966347dc4cfce1f53942f7173 (diff) | |
download | gcc-4bd2511b3c0f8bf4d447d5765c0b3a247c66ca89.zip gcc-4bd2511b3c0f8bf4d447d5765c0b3a247c66ca89.tar.gz gcc-4bd2511b3c0f8bf4d447d5765c0b3a247c66ca89.tar.bz2 |
revert: c-parser.c (c_parser_sizeof_expression): Reorganize slightly to avoid goto.
2014-05-01 Jeff Law <law@redhat.com>
Revert:
2014-04-24 Prathamesh Kulkarni <bilbotheelffriend@gmail.com>
* c-parser.c (c_parser_sizeof_expression): Reorganize slightly to
avoid goto.
From-SVN: r209999
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 13 | ||||
-rw-r--r-- | gcc/c/c-parser.c | 31 |
2 files changed, 24 insertions, 20 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 8fc20cf..4931e79 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,11 @@ +2014-05-01 Jeff Law <law@redhat.com> + + Revert: + + 2014-04-24 Prathamesh Kulkarni <bilbotheelffriend@gmail.com> + * c-parser.c (c_parser_sizeof_expression): Reorganize slightly to + avoid goto. + 2014-05-02 Marek Polacek <polacek@redhat.com> PR c/60784 @@ -88,11 +96,6 @@ (process_init_element): Add location_t parameter. Pass loc to output_init_element. -2014-04-24 Prathamesh Kulkarni <bilbotheelffriend@gmail.com> - - * c-parser.c (c_parser_sizeof_expression): Reorganize slightly to - avoid goto. - 2014-04-24 Jakub Jelinek <jakub@redhat.com> * c-parser.c (c_parser_omp_atomic): Allow seq_cst before diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index c22c4ab..7947355 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -6529,29 +6529,30 @@ c_parser_sizeof_expression (c_parser *parser) return ret; } if (c_parser_next_token_is (parser, CPP_OPEN_BRACE)) - expr = c_parser_postfix_expression_after_paren_type (parser, - type_name, - expr_loc); - else { - /* sizeof ( type-name ). */ - c_inhibit_evaluation_warnings--; - in_sizeof--; - return c_expr_sizeof_type (expr_loc, type_name); + expr = c_parser_postfix_expression_after_paren_type (parser, + type_name, + expr_loc); + goto sizeof_expr; } + /* sizeof ( type-name ). */ + c_inhibit_evaluation_warnings--; + in_sizeof--; + return c_expr_sizeof_type (expr_loc, type_name); } else { expr_loc = c_parser_peek_token (parser)->location; expr = c_parser_unary_expression (parser); + sizeof_expr: + c_inhibit_evaluation_warnings--; + in_sizeof--; + mark_exp_read (expr.value); + if (TREE_CODE (expr.value) == COMPONENT_REF + && DECL_C_BIT_FIELD (TREE_OPERAND (expr.value, 1))) + error_at (expr_loc, "%<sizeof%> applied to a bit-field"); + return c_expr_sizeof_expr (expr_loc, expr); } - c_inhibit_evaluation_warnings--; - in_sizeof--; - mark_exp_read (expr.value); - if (TREE_CODE (expr.value) == COMPONENT_REF - && DECL_C_BIT_FIELD (TREE_OPERAND (expr.value, 1))) - error_at (expr_loc, "%<sizeof%> applied to a bit-field"); - return c_expr_sizeof_expr (expr_loc, expr); } /* Parse an alignof expression. */ |