summaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog39
-rw-r--r--gcc/c/c-parser.c22
2 files changed, 61 insertions, 0 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index ee50c304b5f..75f39d7ed8b 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,42 @@
+2016-11-14 Prasad Ghangal <prasad.ghangal@gmail.com>
+ Richard Biener <rguenther@suse.de>
+
+ * Make-lang.in (C_AND_OBJC_OBJS): Add gimple-parser.o.
+ * config-lang.in (gtfiles): Add c/c-parser.h.
+ * c-tree.h (enum c_declspec_word): Add cdw_gimple.
+ (struct c_declspecs): Add gimple_pass member and gimple_p flag.
+ * c-parser.c (enum c_id_kind, struct c_token,
+ c_parser_next_token_is, c_parser_next_token_is_not,
+ c_parser_next_token_is_keyword,
+ enum c_lookahead_kind, enum c_dtr_syn, enum c_parser_prec):
+ Split out to ...
+ * c-parser.h: ... new header.
+ * c-parser.c: Include c-parser.h and gimple-parser.h.
+ (c_parser_peek_token, c_parser_peek_2nd_token,
+ c_token_starts_typename, c_parser_next_token_starts_declspecs,
+ c_parser_next_tokens_start_declaration, c_parser_consume_token,
+ c_parser_error, c_parser_require, c_parser_skip_until_found,
+ c_parser_declspecs, c_parser_declarator, c_parser_peek_nth_token,
+ c_parser_type_name): Export.
+ (c_parser_tokens_buf): New function.
+ (c_parser_error): Likewise.
+ (c_parser_set_error): Likewise.
+ (c_parser_declspecs): Handle RID_GIMPLE.
+ (c_parser_declaration_or_fndef): Parse __GIMPLE marked body
+ via c_parser_parse_gimple_body.
+ * c-parser.h (c_parser_peek_token, c_parser_peek_2nd_token,
+ c_token_starts_typename, c_parser_next_token_starts_declspecs,
+ c_parser_next_tokens_start_declaration, c_parser_consume_token,
+ c_parser_error, c_parser_require, c_parser_skip_until_found,
+ c_parser_declspecs, c_parser_declarator, c_parser_peek_nth_token,
+ c_parser_type_name): Declare.
+ (struct c_parser): Declare forward.
+ (c_parser_tokens_buf): Declare.
+ (c_parser_error): Likewise.
+ (c_parser_set_error): Likewise.
+ * gimple-parser.c: New file.
+ * gimple-parser.h: Likewise.
+
2016-09-11 Le-Chun Wu <lcwu@google.com>
Mark Wielaard <mjw@redhat.com>
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index 08a7d788a01..00fe7312c4c 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -8374,6 +8374,28 @@ c_parser_postfix_expression_after_primary (c_parser *parser,
warn_for_memset (expr_loc, arg0, arg2, literal_zero_mask);
}
+ if (TREE_CODE (expr.value) == FUNCTION_DECL && warn_restrict)
+ {
+ unsigned i;
+ tree arg;
+ FOR_EACH_VEC_SAFE_ELT (exprlist, i, arg)
+ TREE_VISITED (arg) = 0;
+
+ unsigned param_pos = 0;
+ function_args_iterator iter;
+ tree t;
+ FOREACH_FUNCTION_ARGS (TREE_TYPE (expr.value), t, iter)
+ {
+ if (POINTER_TYPE_P (t) && TYPE_RESTRICT (t)
+ && !TYPE_READONLY (TREE_TYPE (t)))
+ warn_for_restrict (param_pos, exprlist);
+ param_pos++;
+ }
+
+ FOR_EACH_VEC_SAFE_ELT (exprlist, i, arg)
+ TREE_VISITED (arg) = 0;
+ }
+
start = expr.get_start ();
finish = parser->tokens_buf[0].get_finish ();
expr.value