]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
revert: c-parser.c (c_parser_sizeof_expression): Reorganize slightly to avoid goto.
authorJeff Law <law@redhat.com>
Fri, 2 May 2014 05:46:38 +0000 (23:46 -0600)
committerJeff Law <law@gcc.gnu.org>
Fri, 2 May 2014 05:46:38 +0000 (23:46 -0600)
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

gcc/c/ChangeLog
gcc/c/c-parser.c

index 8fc20cf2c8133f76de53ba7763ef7b9c0ac7349e..4931e79e0d0023b6d03023f342d8d600d7aa787e 100644 (file)
@@ -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
        (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
index c22c4abcb263a0e605166a4a8e1adfeef912d090..7947355c2150485880105962c4fd1d71b5592711 100644 (file)
@@ -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.  */