]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/c/ChangeLog
PR target/83488
[thirdparty/gcc.git] / gcc / c / ChangeLog
CommitLineData
82841c8f 12017-12-22 Mike Stump <mikestump@comcast.net>
2 Eric Botcazou <ebotcazou@adacore.com>
3
4 * c-parser.c (c_parser_while_statement): Add unroll parameter and
5 build ANNOTATE_EXPR if present. Add 3rd operand to ANNOTATE_EXPR.
6 (c_parser_do_statement): Likewise.
7 (c_parser_for_statement): Likewise.
8 (c_parser_statement_after_labels): Adjust calls to above.
9 (c_parse_pragma_ivdep): New static function.
10 (c_parser_pragma_unroll): Likewise.
11 (c_parser_pragma) <PRAGMA_IVDEP>: Add support for pragma Unroll.
12 <PRAGMA_UNROLL>: New case.
13
c9281ef8 142017-12-19 Jakub Jelinek <jakub@redhat.com>
15
16 * c-typeck.c (comptypes_internal, function_types_compatible_p,
17 perform_integral_promotions, digest_init): Replace Yoda conditions
18 with typical order conditions.
19 * c-decl.c (check_bitfield_type_and_width): Likewise.
20
d76c514d 212017-12-14 Bernd Edlinger <bernd.edlinger@hotmail.de>
22
23 * c-typeck.c (c_safe_arg_type_equiv_p,
24 c_safe_function_type_cast_p): New function.
25 (build_c_cast): Implement -Wcast-function-type.
26
00e92272 272017-12-14 Richard Biener <rguenther@suse.de>
28
29 PR c/83415
30 * c-fold.c (c_fully_fold_internal): Treat VIEW_CONVERT_EXPR
31 like REALPART_EXPR for the behavior of whether its operand
32 is an lvalue.
33
a7625351 342017-12-12 Marek Polacek <polacek@redhat.com>
35
36 PR c/82679
37 * c-decl.c (grokdeclarator): Check declspecs insted of atomicp.
38
90567983 392017-12-12 Alexandre Oliva <aoliva@redhat.com>
40
41 * c-objc-common.h (LANG_HOOKS_EMITS_BEGIN_STMT): Redefine as true.
42 * c-parser.c (add_debug_begin_stmt): New.
43 (c_parser_declaration_or_fndef): Call it.
44 (c_parser_compound_statement_nostart): Likewise.
45 (c_parser_statement_after_labels): Likewise.
46 * c-typeck (c_finish_stmt_expr): Skip begin stmts markers.
47
a52dedf5 482017-12-07 Joseph Myers <joseph@codesourcery.com>
49
50 * c-decl.c (build_compound_literal): Add parameter alignas_align
51 and set alignment of decl if nonzero.
52 * c-parser.c (c_keyword_starts_typename): Allow RID_ALIGNAS.
53 (c_parser_declspecs): Allow RID_ALIGNAS to follow a type, like a
54 qualifier.
55 (c_parser_struct_declaration): Update syntax comment.
56 (c_parser_type_name): Add alignas_ok argument and pass it to
57 c_parser_declspecs.
58 (c_parser_cast_expression): Pass true to c_parser_type_name and
59 give error if a cast used an _Alignas specifier.
60 (c_parser_sizeof_expression): Pass true to c_parser_type_name and
61 give error if sizeof (type-name) used an _Alignas specifier.
62 (c_parser_alignof_expression): Pass true to c_parser_type_name and
63 give error if _Alignof (type-name) used an _Alignas specifier.
64 (c_parser_postfix_expression_after_paren_type): Check specified
65 alignment for a compound literal and pass it to
66 build_compound_literal.
67 * c-parser.h (c_parser_type_name): Update prototype.
68 * c-tree.h (build_compound_literal): Update prototype.
69
dab0e385 702017-12-07 Martin Sebor <msebor@redhat.com>
71
72 PR c/81544
73 * c-decl.c (c_decl_attributes): Look up existing declaration and
74 pass it to decl_attributes.
75
08233401 762017-12-06 David Malcolm <dmalcolm@redhat.com>
77
78 PR c/83236
79 * c-decl.c (lookup_name_fuzzy): Don't suggest names that are
80 reserved for use by the implementation.
81
aa0e50a0 822017-12-06 David Malcolm <dmalcolm@redhat.com>
83
84 * c-decl.c: Include "c-family/c-spellcheck.h".
85
eabe2d94 862017-12-05 Martin Liska <mliska@suse.cz>
87 Jakub Jelinek <jakub@redhat.com>
88
89 * c-typeck.c (pointer_diff): Add new argument and instrument
90 pointer subtraction.
91 (build_binary_op): Similar for pointer comparison.
92
a8f15ac7 932017-12-01 Jakub Jelinek <jakub@redhat.com>
94
17cf92d6 95 PR c/79153
96 * c-parser.c: Include tree-iterator.h.
97 (c_parser_switch_statement): Emit LABEL_EXPR for the break label
98 into SWITCH_BODY instead of after it and set SWITCH_BREAK_LABEL_P
99 on it.
100
a8f15ac7 101 PR c/83222
102 * c-tree.h (decl_constant_value_1): Declare.
103 * c-typeck.c (decl_constant_value_1): New function.
104 (decl_constant_value): Use it.
105 * c-fold.c (c_fully_fold_internal): If in_init, use
106 decl_constant_value_1 instead of decl_constant_value.
107
7f38a6aa 1082017-11-30 Jakub Jelinek <jakub@redhat.com>
109
110 * c-parser.c (c_parser_postfix_expression): Use ; instead of ;;.
111
dfa10f0d 1122017-11-28 Jakub Jelinek <jakub@redhat.com>
113
114 PR sanitizer/81275
115 * c-typeck.c (c_finish_case): Set SWITCH_ALL_CASES_P if
116 c_switch_covers_all_cases_p returns true.
117
efa02472 1182017-11-28 Julia Koval <julia.koval@intel.com>
119 Sebastian Peryt <sebastian.peryt@intel.com>
120
121 * Make-lang.in (c/c-array-notation.o): Remove.
122 * c-array-notation.c: Delete.
123 * c-decl.c: Remove cilkplus condition.
124 * c-parser.c (c_parser_cilk_simd, c_parser_cilk_for,
125 c_parser_cilk_verify_simd, c_parser_array_notation,
126 c_parser_cilk_clause_vectorlength, c_parser_cilk_grainsize,
127 c_parser_cilk_simd_fn_vector_attrs,
128 c_finish_cilk_simd_fn_tokens): Delete.
129 (c_parser_declaration_or_fndef): Remove cilkplus condition.
130 (c_parser_direct_declarator_inner): Ditto.
131 (CILK_SIMD_FN_CLAUSE_MASK): Delete.
132 (c_parser_attributes, c_parser_compound_statement,
133 c_parser_statement_after_labels, c_parser_if_statement,
134 c_parser_switch_statement, c_parser_while_statement,
135 c_parser_do_statement, c_parser_for_statement,
136 c_parser_unary_expression, c_parser_postfix_expression,
137 c_parser_postfix_expression_after_primary,
138 c_parser_pragma, c_parser_omp_clause_name, c_parser_omp_all_clauses,
139 c_parser_omp_for_loop, c_finish_omp_declare_simd): Remove cilkplus
140 support.
141 * c-typeck.c (build_array_ref, build_function_call_vec,
142 convert_arguments,
143 lvalue_p, build_compound_expr, c_finish_return, c_finish_if_stmt,
144 c_finish_loop, build_binary_op): Remove cilkplus support.
145
bd37ce3e 1462017-11-28 Jakub Jelinek <jakub@redhat.com>
147
148 * c-typeck.c (c_start_case): Build SWITCH_EXPR using build2 instead
149 of build3.
150
864319e6 1512017-11-14 Boris Kolpackov <boris@codesynthesis.com>
152
153 * Make-lang.in (c.install-plugin): Install backend import library.
154
59b23ab9 1552017-11-23 Jakub Jelinek <jakub@redhat.com>
156
157 * c-parser.c (c_parser_omp_declare_simd): Reject declare simd in
158 pragma_stmt context.
159
2a09b28c 1602017-11-23 Mike Stump <mikestump@comcast.net>
161 Eric Botcazou <ebotcazou@adacore.com>
162
163 * c-parser.c (c_parser_while_statement): Pass 3rd operand to
164 ANNOTATE_EXPR.
165 (c_parser_do_statement): Likewise.
166 (c_parser_for_statement): Likewise.
167
8e4391a5 1682017-11-22 David Malcolm <dmalcolm@redhat.com>
169
170 PR c++/62170
171 * c-objc-common.c (c_tree_printer): Convert penultimate param from
172 bool to bool *. Within '%T' handling, if showing an "aka", use
173 "quoted" param to add appropriate quoting.
174
532d84ff 1752017-11-22 Marek Polacek <polacek@redhat.com>
176
177 PR c++/60336
178 PR middle-end/67239
179 PR target/68355
180 * c-decl.c (grokdeclarator): Set DECL_PADDING_P on unnamed bit-fields.
181
b8a6d52b 1822017-11-21 David Malcolm <dmalcolm@redhat.com>
183
184 PR c/83056
185 * c-decl.c (lookup_name_fuzzy): Don't suggest names that came from
186 earlier failed lookups.
187
57e83b58 1882017-11-21 Marc Glisse <marc.glisse@inria.fr>
189
190 * c-fold.c (c_fully_fold_internal): Handle POINTER_DIFF_EXPR.
191 * c-typeck.c (pointer_diff): Use POINTER_DIFF_EXPR.
192
145fb49f 1932017-11-20 David Malcolm <dmalcolm@redhat.com>
194
195 PR c/81404
196 * c-decl.c: Include "c-family/known-headers.h".
197 (get_c_name_hint): Rename to get_stdlib_header_for_name and move
198 to known-headers.cc.
199 (class suggest_missing_header): Move to known-header.h.
200 (lookup_name_fuzzy): Call get_c_stdlib_header_for_name rather
201 than get_c_name_hint.
202
0911a8d3 2032017-11-20 David Malcolm <dmalcolm@redhat.com>
204
205 * c-decl.c (get_c_name_hint): New function.
206 (class suggest_missing_header): New class.
207 (lookup_name_fuzzy): Call get_c_name_hint and use it to
208 suggest missing headers to the user.
209
dd008336 2102017-11-20 David Malcolm <dmalcolm@redhat.com>
211
212 * c-decl.c: Define INCLUDE_UNIQUE_PTR before including system.h.
213 Include "c-family/name-hint.h"
214 (implicit_decl_warning): Convert "hint" from
215 const char * to name_hint. Pass location to
216 lookup_name_fuzzy. Suppress any deferred diagnostic if the
217 warning was not printed.
218 (undeclared_variable): Likewise for "guessed_id".
219 (lookup_name_fuzzy): Convert return type from const char *
220 to name_hint. Add location_t param.
221 * c-parser.c: Define INCLUDE_UNIQUE_PTR before including system.h.
222 Include "c-family/name-hint.h"
223 (c_parser_declaration_or_fndef): Convert "hint" from
224 const char * to name_hint. Pass location to lookup_name_fuzzy.
225 (c_parser_parameter_declaration): Likewise.
226
69cd03b2 2272017-11-19 Jakub Jelinek <jakub@redhat.com>
228
229 PR c/66618
230 PR c/69960
231 * c-parser.c (c_parser_omp_atomic): Pass true as LVAL to c_fully_fold
232 where needed.
233 * c-typeck.c (build_unary_op, build_modify_expr, build_asm_expr,
234 handle_omp_array_sections): Likewise.
235 (digest_init): Don't call decl_constant_value_for_optimization.
236 * c-tree.h (decl_constant_value_for_optimization): Removed.
237 * c-fold.c (c_fold_array_ref): New function.
238 (c_fully_fold_internal): Add LVAL argument, propagate it through
239 recursive calls. For VAR_P call decl_constant_value and
240 unshare if not LVAL and either optimizing or IN_INIT. Remove
241 decl_constant_value_for_optimization calls. If IN_INIT and not LVAL,
242 fold ARRAY_REF with STRING_CST and INTEGER_CST operands.
243 (c_fully_fold): Add LVAL argument, pass it through to
244 c_fully_fold_internal.
245 (decl_constant_value_for_optimization): Removed.
246
aac64699 2472017-11-15 Joseph Myers <joseph@codesourcery.com>
248
249 PR c/81156
250 * c-parser.c (check_tgmath_function): New function.
251 (enum tgmath_parm_kind): New enum.
252 (c_parser_postfix_expression): Handle __builtin_tgmath.
253
3b6578b3 2542017-10-31 David Malcolm <dmalcolm@redhat.com>
255
256 * c-decl.c (implicit_decl_warning): Update for renaming of
257 pedwarn_at_rich_loc and warning_at_rich_loc.
258 (implicitly_declare): Likewise for renaming of inform_at_rich_loc.
259 (undeclared_variable): Likewise for renaming of error_at_rich_loc.
260 * c-parser.c (c_parser_declaration_or_fndef): Likewise.
261 (c_parser_struct_or_union_specifier): Likewise for renaming of
262 pedwarn_at_rich_loc.
263 (c_parser_parameter_declaration): Likewise for renaming of
264 error_at_rich_loc.
265 * c-typeck.c (build_component_ref): Likewise.
266 (build_unary_op): Likewise for renaming of inform_at_rich_loc.
267 (pop_init_level): Likewise for renaming of warning_at_rich_loc.
268 (set_init_label): Likewise for renaming of error_at_rich_loc.
269
c22b2783 2702017-10-30 Richard Biener <rguenther@suse.de>
271
272 * gimple-parser.c (c_parser_gimple_statement): Parse conditional
273 stmts.
274
8c32188e 2752017-10-27 Michael Meissner <meissner@linux.vnet.ibm.com>
276
277 * c-decl.c (header_for_builtin_fn): Add support for copysign, fma,
278 fmax, fmin, and sqrt _Float<N> and _Float<N>X variants.
279
133bd9b8 2802017-10-25 David Malcolm <dmalcolm@redhat.com>
281
282 PR c/7356
283 * c-parser.c (c_parser_declaration_or_fndef): Detect missing
284 semicolons.
285
ac50cb09 2862017-10-25 Jakub Jelinek <jakub@redhat.com>
287
288 PR libstdc++/81706
289 * c-decl.c (merge_decls): Copy "omp declare simd" attributes from
290 newdecl to corresponding __builtin_ if any.
291
41ca0095 2922017-10-24 Paolo Carlini <paolo.carlini@oracle.com>
293
294 PR c++/82466
295 * c-decl.c (diagnose_mismatched_decls): Use
296 OPT_Wbuiltin_declaration_mismatch.
297
74578794 2982017-10-12 David Malcolm <dmalcolm@redhat.com>
299
300 * c-parser.c (c_parser_require): Add "type_is_unique" param and
301 use it to guard calls to maybe_suggest_missing_token_insertion.
302 (c_parser_parms_list_declarator): Override default value of new
303 "type_is_unique" param to c_parser_require.
304 (c_parser_asm_statement): Likewise.
305 * c-parser.h (c_parser_require): Add "type_is_unique" param,
306 defaulting to true.
307
3bdf5a5d 3082017-10-11 Nathan Sidwell <nathan@acm.org>
309
310 * c-decl.c (grokdeclarator): Check HAS_DECL_ASSEMBLER_NAME_P too.
311
e3d0f65c 3122017-10-10 Richard Sandiford <richard.sandiford@linaro.org>
313
314 * c-parser.c (c_parser_cilk_clause_vectorlength): Use wi::to_wide when
315 operating on trees as wide_ints.
316 * c-typeck.c (build_c_cast, c_finish_omp_clauses): Likewise.
317 (c_tree_equal): Likewise.
318
b6fde48e 3192017-10-04 David Malcolm <dmalcolm@redhat.com>
320
321 * c-decl.c (push_parm_decl): Store c_parm's location into the
322 PARAM_DECL.
323 (build_c_parm): Add "loc" param and store it within the c_parm.
324 * c-parser.c (struct c_parser): Add "last_token_location" field.
325 (c_parser_consume_token): Store location of the token into the
326 new field.
327 (c_parser_declaration_or_fndef): Store params into DECL_ARGUMENTS
328 when handling a FUNCTION_DECL, if it doesn't already have them.
329 (c_parser_parameter_declaration): Generate a location for the
330 parameter, and pass it to the call to build_c_parm.
331 * c-tree.h (struct c_parm): Add field "loc".
332 (build_c_parm): Add location_t param.
333 * c-typeck.c (get_fndecl_argument_location): New function.
334 (inform_for_arg): New function.
335 (convert_for_assignment): Use inform_for_arg when dealing with
336 ic_argpass.
337
e786f452 3382017-09-29 Jakub Jelinek <jakub@redhat.com>
339
52f26f82 340 * c-decl.c (grokfield): Use SET_DECL_C_BIT_FIELD here if
341 width is non-NULL.
342 (finish_struct): Test DECL_C_BIT_FIELD instead of DECL_INITIAL,
343 don't SET_DECL_C_BIT_FIELD here.
344
e786f452 345 PR c/82340
346 * c-decl.c (build_compound_literal): Use c_apply_type_quals_to_decl
347 instead of trying to set just TREE_READONLY manually.
348
93b7a91b 3492017-09-16 Tom de Vries <tom@codesourcery.com>
350
351 PR c/81875
352 * c-parser.c (c_parser_omp_for_loop): Fold only operands of cond, not
353 cond itself.
354
3507457a 3552017-09-15 Joseph Myers <joseph@codesourcery.com>
356
357 PR c/82071
358 * c-typeck.c (ep_convert_and_check): Just call convert_and_check
359 for C11.
360 (build_conditional_expr): For C11, generate result with excess
361 precision when one argument is an integer and the other is of a
362 type using excess precision.
363
7ceee42d 3642017-09-15 Bernd Edlinger <bernd.edlinger@hotmail.de>
365
366 * c-typeck.c (build_c_cast): Implement -Wcast-align=strict.
367
2be90a05 3682017-09-13 Marek Polacek <polacek@redhat.com>
369
370 PR c/82167
371 * c-typeck.c (c_expr_sizeof_expr): Use the type of expr.value rather
372 than expr.original_type.
373
daf40ee6 3742017-09-12 Nathan Sidwell <nathan@acm.org>
375
376 * c-decl.c (field_decl_cmp, resort_data, resort_field_decl_cmp,
377 resort_sorted_fields): Moved from c-family/c-common.c.
378 * c-lang.h (struct sorted_fields_type): Moved from c-family/c-common.h.
379
de7757ed 3802017-09-01 Joseph Myers <joseph@codesourcery.com>
381
382 PR c/82071
383 * c-typeck.c (build_atomic_assign): Handle argument with excess
384 precision. Ensure any EXCESS_PRECISION_EXPR is present in
385 argument passed to build_binary_op and convert_for_assignment but
386 not for call to c_fully_fold.
387 (build_modify_expr): Do not remove EXCESS_PRECISION_EXPR early.
388 Ensure build_binary_op is called with argument with original
389 semantic type. Avoid calling c_fully_fold with an
390 EXCESS_PRECISION_EXPR from build_binary_op.
391
1e52a582 3922017-09-01 Jakub Jelinek <jakub@redhat.com>
393
394 PR c/81887
395 * c-parser.c (c_parser_omp_ordered): Handle -fopenmp-simd.
396
3d2b0034 3972017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
398 Alan Hayward <alan.hayward@arm.com>
399 David Sherwood <david.sherwood@arm.com>
400
401 * c-typeck.c (build_binary_op): Use SCALAR_TYPE_MODE.
402 (c_common_type): Likewise. Use as_a <scalar_mode> when setting
403 m1 and m2 to the signed equivalent of a fixed-point
404 SCALAR_TYPE_MODE.
405
0bdd7941 4062017-08-24 David Malcolm <dmalcolm@redhat.com>
407
408 * c-tree.h (c_expr::get_location) Use EXPR_HAS_LOCATION rather
409 than CAN_HAVE_LOCATION_P when determining whether to use the
410 location_t value within "value".
411
43f0de17 4122017-08-21 David Malcolm <dmalcolm@redhat.com>
413
414 * c-parser.c (c_parser_expr_list): Use c_expr::get_location ()
415 rather than peeking the location of the first token.
416 * c-tree.h (c_expr::get_location): New method.
417
a115c319 4182017-08-21 David Malcolm <dmalcolm@redhat.com>
419
420 * c-typeck.c (build_function_call_vec): Pass arg_loc to call
421 to check_function_arguments.
422
23bafc2f 4232017-08-18 Marek Polacek <polacek@redhat.com>
424
425 * c-parser.c (c_parser_postfix_expression): Remove unused code. Update
426 commentary.
427
4bec7283 4282017-08-18 H.J. Lu <hongjiu.lu@intel.com>
429
430 PR c/53037
431 * c-decl.c (merge_decls): Also merge DECL_WARN_IF_NOT_ALIGN.
432 (check_bitfield_type_and_width): Don't allow bit-field with
433 warn_if_not_aligned type.
434
c8616982 4352017-08-14 Martin Sebor <msebor@redhat.com>
436
437 PR c/81117
438 * c-objc-common.c (c_objc_common_init): Handle 'G'.
439
0eb79e8b 4402017-08-11 Marek Polacek <polacek@redhat.com>
441
442 PR c/81795
443 * c-decl.c (pushtag): Only print inform if the warning was printed.
444 (grokdeclarator): Likewise.
445
3fe34694 4462017-08-10 David Malcolm <dmalcolm@redhat.com>
447
448 * c-parser.c (c_parser_error): Rename to...
449 (c_parser_error_richloc): ...this, making static, and adding
450 "richloc" parameter, passing it to the c_parse_error call,
451 rather than calling c_parser_set_source_position_from_token.
452 (c_parser_error): Reintroduce, reimplementing in terms of the
453 above, converting return type from void to bool.
454 (class token_pair): New class.
455 (struct matching_paren_traits): New struct.
456 (matching_parens): New typedef.
457 (struct matching_brace_traits): New struct.
458 (matching_braces): New typedef.
459 (get_matching_symbol): New function.
460 (c_parser_require): Add param MATCHING_LOCATION, using it to
461 highlight matching "opening" tokens for missing "closing" tokens.
462 (c_parser_skip_until_found): Likewise.
463 (c_parser_static_assert_declaration_no_semi): Convert explicit
464 parsing of CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of
465 class matching_parens, so that the pertinent open parenthesis is
466 highlighted when there are problems locating the close
467 parenthesis.
468 (c_parser_struct_or_union_specifier): Likewise.
469 (c_parser_typeof_specifier): Likewise.
470 (c_parser_alignas_specifier): Likewise.
471 (c_parser_simple_asm_expr): Likewise.
472 (c_parser_braced_init): Likewise, for matching_braces.
473 (c_parser_paren_condition): Likewise, for matching_parens.
474 (c_parser_switch_statement): Likewise.
475 (c_parser_for_statement): Likewise.
476 (c_parser_asm_statement): Likewise.
477 (c_parser_asm_operands): Likewise.
478 (c_parser_cast_expression): Likewise.
479 (c_parser_sizeof_expression): Likewise.
480 (c_parser_alignof_expression): Likewise.
481 (c_parser_generic_selection): Likewise.
482 (c_parser_postfix_expression): Likewise for cases RID_VA_ARG,
483 RID_OFFSETOF, RID_TYPES_COMPATIBLE_P, RID_AT_SELECTOR,
484 RID_AT_PROTOCOL, RID_AT_ENCODE, reindenting as necessary.
485 In case CPP_OPEN_PAREN, pass loc_open_paren to the
486 c_parser_skip_until_found call.
487 (c_parser_objc_class_definition): Use class matching_parens as
488 above.
489 (c_parser_objc_method_decl): Likewise.
490 (c_parser_objc_try_catch_finally_statement): Likewise.
491 (c_parser_objc_synchronized_statement): Likewise.
492 (c_parser_objc_at_property_declaration): Likewise.
493 (c_parser_oacc_wait_list): Likewise.
494 (c_parser_omp_var_list_parens): Likewise.
495 (c_parser_omp_clause_collapse): Likewise.
496 (c_parser_omp_clause_default): Likewise.
497 (c_parser_omp_clause_if): Likewise.
498 (c_parser_omp_clause_num_threads): Likewise.
499 (c_parser_omp_clause_num_tasks): Likewise.
500 (c_parser_omp_clause_grainsize): Likewise.
501 (c_parser_omp_clause_priority): Likewise.
502 (c_parser_omp_clause_hint): Likewise.
503 (c_parser_omp_clause_defaultmap): Likewise.
504 (c_parser_oacc_single_int_clause): Likewise.
505 (c_parser_omp_clause_ordered): Likewise.
506 (c_parser_omp_clause_reduction): Likewise.
507 (c_parser_omp_clause_schedule): Likewise.
508 (c_parser_omp_clause_num_teams): Likewise.
509 (c_parser_omp_clause_thread_limit): Likewise.
510 (c_parser_omp_clause_aligned): Likewise.
511 (c_parser_omp_clause_linear): Likewise.
512 (c_parser_omp_clause_safelen): Likewise.
513 (c_parser_omp_clause_simdlen): Likewise.
514 (c_parser_omp_clause_depend): Likewise.
515 (c_parser_omp_clause_map): Likewise.
516 (c_parser_omp_clause_device): Likewise.
517 (c_parser_omp_clause_dist_schedule): Likewise.
518 (c_parser_omp_clause_proc_bind): Likewise.
519 (c_parser_omp_clause_uniform): Likewise.
520 (c_parser_omp_for_loop): Likewise.
521 (c_parser_cilk_clause_vectorlength): Likewise.
522 (c_parser_cilk_clause_linear): Likewise.
523 (c_parser_transaction_expression): Likewise.
524 * c-parser.h (c_parser_require): Add param matching_location with
525 default UNKNOWN_LOCATION.
526 (c_parser_error): Convert return type from void to bool.
527 (c_parser_skip_until_found): Add param matching_location with
528 default UNKNOWN_LOCATION.
529
623ee358 5302017-08-09 Marek Polacek <polacek@redhat.com>
531
532 * c-decl.c (build_enumerator): Use true/false instead of 1/0.
533 * c-tree.h (build_external_ref): Update declaration.
534 * c-typeck.c (build_array_ref): Use true/false instead of 1/0.
535 (build_external_ref): Change the type of a parameter to bool.
536 (parser_build_binary_op): Use true/false instead of 1/0.
537 (pointer_diff): Likewise.
538 (build_modify_expr): Likewise.
539 (set_designator): Change the type of a parameter to bool.
540 (set_init_index): Use true/false instead of 1/0.
541 (set_init_label): Likewise.
542 (output_init_element): Change the type of a parameter to bool.
543 (output_pending_init_elements): Use true/false instead of 1/0.
544 (process_init_element): Likewise.
545 (build_binary_op): Change the type of a parameter to bool.
546
88539b96 5472017-08-09 Marek Polacek <polacek@redhat.com>
548
549 PR c/81233
550 * c-typeck.c (pedwarn_init): Make the function take a variable list.
551 Call emit_diagnostic_valist instead of pedwarn.
552 (convert_for_assignment): Unroll the PEDWARN_FOR_ASSIGNMENT macro.
553 Print the relevant types in diagnostics.
554
cb4d9ee2 5552017-08-09 Marek Polacek <polacek@redhat.com>
556
557 PR c/81417
558 * c-array-notation.c (fix_builtin_array_notation_fn): Update calls to
559 build_conditional_expr.
560 * c-parser.c (c_parser_conditional_expression): Create locations for
561 EXP1 and EXP2 from their source ranges. Pass the locations down to
562 build_conditional_expr.
563 * c-tree.h (build_conditional_expr): Update declaration.
564 * c-typeck.c (build_conditional_expr): Add location_t parameters.
565 For -Wsign-compare, also print the types.
566
30a86690 5672017-08-08 Martin Liska <mliska@suse.cz>
568
569 * c-convert.c: Include header files.
570 * c-typeck.c: Likewise.
571
1610e7fb 5722017-08-07 Martin Liska <mliska@suse.cz>
573
574 * c-parser.c (c_parser_attributes): Canonicalize name of an
575 attribute.
576
9b184593 5772017-08-02 Marek Polacek <polacek@redhat.com>
578
579 PR c/81289
580 * c-parser.c (c_parser_unary_expression): Use set_error.
581
ef85bba9 582 PR c/81448
583 PR c/81306
584 * c-warn.c (warn_for_multistatement_macros): Prevent bogus
585 warnings. Avoid walking MACRO_MAP_LOCATIONS.
586
38ef3642 5872017-07-31 Jan Hubicka <hubicka@ucw.cz>
588 Martin Liska <mliska@suse.cz>
589
590 * c-typeck.c (c_finish_goto_label): Build gimple predict
9b184593 591 statement.
38ef3642 592
dadc219c 5932017-07-31 Martin Liska <mliska@suse.cz>
594
595 PR sanitize/81530
596 * c-convert.c (convert): Guard condition with flag_sanitize_p
597 also with current_function_decl non-null equality.
598 * c-decl.c (grokdeclarator): Likewise.
599 * c-typeck.c (build_binary_op): Likewise.
600
abec4134 6012017-07-25 Marek Polacek <polacek@redhat.com>
602
603 * c-decl.c (grokfield): Remove local variable.
604
662c96a9 6052017-07-25 Marek Polacek <polacek@redhat.com>
606
607 PR c/81364
608 * c-parser.c (c_parser_else_body): Don't warn about multistatement
609 macro expansion if the body is in { }.
610 (c_parser_while_statement): Likewise.
611 (c_parser_for_statement): Likewise.
612
a8de6c92 6132017-07-18 Nathan Sidwell <nathan@acm.org>
614
615 * c-parser.c (c_parser_array_notation): Use TYPE_{MIN,MAX}_VALUE.
616
7f9c8569 6172017-07-14 David Malcolm <dmalcolm@redhat.com>
618
619 * c-decl.c (implicitly_declare): When suggesting a missing
620 #include, provide a fix-it hint.
621
7051d239 6222017-07-06 David Malcolm <dmalcolm@redhat.com>
623
624 * c-lang.c (selftest::run_c_tests): Move body to c_family_tests,
625 and call that instead.
626 * c-tree.h (selftest::run_c_tests): New decl.
627
2bfb0686 6282017-06-26 Marek Polacek <polacek@redhat.com>
629
630 PR c/80116
631 * c-parser.c (c_parser_if_body): Set the location of the
632 body of the conditional after parsing all the labels. Call
633 warn_for_multistatement_macros.
634 (c_parser_else_body): Likewise.
635 (c_parser_switch_statement): Likewise.
636 (c_parser_while_statement): Likewise.
637 (c_parser_for_statement): Likewise.
638 (c_parser_statement): Add a default argument. Save the location
639 after labels have been parsed.
640 (c_parser_c99_block_statement): Likewise.
641
edd07ff6 6422017-06-19 Richard Biener <rguenther@suse.de>
643
644 * gimple-parser.c (c_parser_gimple_postfix_expression): Handle
645 negated _Literals to parse _Literal (int) -1.
646
9917317a 6472017-06-13 Martin Liska <mliska@suse.cz>
648
649 PR sanitize/78204
650 * c-convert.c (convert): Use sanitize_flags_p.
651 * c-decl.c (grokdeclarator): Likewise.
652 * c-typeck.c (convert_for_assignment): Likewise.
653 (c_finish_return): Likewise.
654 (build_binary_op): Likewise.
655
37ce62dc 6562017-06-08 Jakub Jelinek <jakub@redhat.com>
657
658 PR c/81006
659 * c-typeck.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
660 to sizetype before size_binop.
661
73714718 6622017-06-07 Jakub Jelinek <jakub@redhat.com>
663
664 * gimple-parser.c (c_parser_parse_gimple_body): Use TDI_gimple instead
665 of TDI_generic.
666
1d1d0f37 6672017-06-06 Marek Polacek <polacek@redhat.com>
668
669 PR c/79983
670 * c-decl.c (start_struct): Use the location of TYPE_STUB_DECL of
671 ref.
672 (start_enum): Use the location of TYPE_STUB_DECL of enumtype.
673
0ca70bfd 6742017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
675
676 * c-parser.c (c_parser_binary_expression): Implement the
677 -Wsizeof_pointer_div warning.
678 (c_parser_postfix_expression): Allow SIZEOF_EXPR as expr.original_code
679 from a parenthesized expression.
680 (c_parser_expr_list): Use c_last_sizeof_loc.
681 * c-tree.h (c_last_sizeof_loc): New external.
682 * c-typeck.c (c_last_sizeof_loc): New variable.
683 (c_expr_sizeof_expr, c_expr_sizeof_type): Assign c_last_sizeof_loc.
684
8c7a5be5 6852017-05-31 Mikhail Maltsev <maltsevm@gmail.com>
686
687 PR testsuite/80580
688 * gimple-parser.c (c_parser_gimple_if_stmt): Check for empty labels.
689
4d1eda3a 6902017-05-30 David Malcolm <dmalcolm@redhat.com>
691
692 * c-objc-common.c (c_tree_printer): Gain bool and const char **
693 parameters.
694
645b0f8d 6952017-05-24 Martin Sebor <msebor@redhat.com>
696
697 PR c/80731
698 * c-fold.c (c_fully_fold_internal): Adjust.
699 * c-typeck.c (parser_build_unary_op): Adjust.
700
9d5c2cca 7012017-05-23 Thomas Schwinge <thomas@codesourcery.com>
702
703 * c-parser.c (OACC_KERNELS_CLAUSE_MASK): Add
704 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
705 "VECTOR_LENGTH".
706
50253e07 7072017-05-23 Marek Polacek <polacek@redhat.com>
708
709 * c-parser.c (c_parser_compound_statement_nostart): Remove redundant
710 quotes.
711
5c05c939 7122017-05-22 Jakub Jelinek <jakub@redhat.com>
713
714 * c-fold.c (c_fully_fold_internal): Save the c_fully_fold_internal
715 result for SAVE_EXPR operand and set SAVE_EXPR_FOLDED_P even if
716 it returned invariant. Call tree_invariant_p unconditionally
717 afterwards to decide whether to return expr or op0.
718
88df6264 7192017-05-22 Nathan Sidwell <nathan@acm.org>
720
721 * c-decl.c (c_parse_final_cleanups): Drop TDI_tu handling.
722
6acf639f 7232017-05-19 Thomas Schwinge <thomas@codesourcery.com>
724
725 * c-parser.c (c_parser_omp_clause_default): Handle
726 "OMP_CLAUSE_DEFAULT_PRESENT".
727
1bccae6b 7282017-05-18 Bernd Edlinger <bernd.edlinger@hotmail.de>
729
730 * config-lang.in (gtfiles): Add c-family/c-format.c.
731
8eb8a179 7322017-05-18 Nathan Sidwell <nathan@acm.org>
733
734 * c-decl.c (pushdecl_top_level): Delete unused function.
735
78173203 7362017-05-18 Marek Polacek <polacek@redhat.com>
737
738 * c-decl.c (match_builtin_function_types): Use NULL_TREE instead of 0.
739 (check_earlier_gotos): Likewise.
740 (define_label): Likewise.
741 (pending_xref_error): Likewise.
742 (smallest_type_quals_location): Likewise.
743 (grokdeclarator): Likewise.
744 (grokparms): Likewise.
745 (identifier_global_value): Likewise.
746 * c-typeck.c (set_nonincremental_init_from_string): Likewise.
747 (find_init_member): Likewise.
748
2823920b 7492017-05-18 Marek Polacek <polacek@redhat.com>
750
751 * c-decl.c (start_decl): Use false/true instead of 0/1.
752 (grokdeclarator): Likewise.
753 (finish_struct): Likewise.
754 (start_function): Change the return type to bool. Use false/true
755 instead of 0/1.
756 (declspecs_add_qual): Use UNKNOWN_LOCATION instead of 0.
757 * c-tree.h (start_function): Update.
758 * c-typeck.c (same_translation_unit_p): Change the return type to bool.
759 (set_designator): Change the return type to bool. Use false/true
760 instead of 0/1.
761
72749341 7622017-05-17 Marek Polacek <polacek@redhat.com>
763
764 * c-decl.c: Use NULL_TREE instead of 0 where appropriate.
765 * c-typeck.c: Likewise.
766
63b8aca5 7672017-05-17 Marek Polacek <polacek@redhat.com>
768
769 PR sanitizer/80659
770 * c-decl.c (build_compound_literal): Set DECL_ARTIFICIAL and
771 DECL_IGNORED_P even for non-static compound literals.
772
3f6e5ced 7732017-05-17 Martin Liska <mliska@suse.cz>
774
775 * c-decl.c (c_parse_final_cleanups): Introduce dump_flags_t type and
776 use it instead of int type.
777
d0869ea4 7782017-05-17 Marek Polacek <polacek@redhat.com>
779
780 * c-convert.c (convert): Replace c_save_expr with save_expr. Don't
781 call c_fully_fold.
782 (convert) <case COMPLEX_TYPE>: Remove special handling of COMPLEX_TYPEs.
783 * c-decl.c (grokdeclarator): Replace c_save_expr with save_expr.
784 * c-fold.c (c_fully_fold_internal): Handle SAVE_EXPR.
785 * c-parser.c (c_parser_declaration_or_fndef): Replace c_save_expr with
786 save_expr.
787 (c_parser_conditional_expression): Likewise.
788 * c-tree.h (SAVE_EXPR_FOLDED_P): Define.
789 * c-typeck.c (build_modify_expr): Replace c_save_expr with save_expr.
790 (process_init_element): Likewise.
791 (build_binary_op): Likewise.
792 (handle_omp_array_sections_1): Likewise.
793
641fc3ae 7942017-05-12 Thomas Schwinge <thomas@codesourcery.com>
795
796 * c-parser.c (c_parser_omp_clause_num_gangs)
797 (c_parser_omp_clause_num_workers)
798 (c_parser_omp_clause_vector_length): Merge functions into...
799 (c_parser_oacc_single_int_clause): ... this new function. Adjust
800 all users.
801
930c75f4 8022017-05-11 Nathan Sidwell <nathan@acm.org>
803
804 * gimple-parser.c: Don't #include tree-dump.h.
805
22ba59df 8062017-05-11 Mikhail Maltsev <maltsevm@gmail.com>
807
808 PR testsuite/80580
809 * gimple-parser.c (c_parser_parse_ssa_name): Validate SSA name base.
810
e58d47fc 8112017-05-11 Mikhail Maltsev <maltsevm@gmail.com>
812
813 PR testsuite/80580
814 * gimple-parser.c (c_parser_gimple_postfix_expression): Handle
815 incorrect __MEM syntax.
816
a38eda85 8172017-05-11 Mikhail Maltsev <maltsevm@gmail.com>
818
819 PR testsuite/80580
820 * gimple-parser.c (c_parser_gimple_unary_expression): Check argument
821 type of unary '*'.
822
cdf05a3f 8232017-05-09 Nathan Sidwell <nathan@acm.org>
824
825 * c-tree.h (pushdecl): Declare.
826
56b8400f 8272017-05-05 David Malcolm <dmalcolm@redhat.com>
828
829 * c-decl.c (warn_defaults_to): Replace report_diagnostic
830 with diagnostic_report_diagnostic.
831 * c-errors.c (pedwarn_c99): Likewise.
832 (pedwarn_c90): Likewise.
833
92bc38e7 8342017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
835
836 PR c++/80038
837 * c-gimplify.c (c_gimplify_expr): Remove calls to
838 cilk_gimplifY_call_params_in_spawned_fn.
839
112e1c2c 8402017-04-25 David Malcolm <dmalcolm@redhat.com>
841
842 * c-parser.c (c_parser_struct_or_union_specifier): Add fix-it
843 hint for removing extra semicolon.
844
0b515531 8452017-04-21 Jakub Jelinek <jakub@redhat.com>
846
847 PR c/80468
848 * c-decl.c (finish_declspecs) <case cts_int_n>: If int_n_idx is not
849 enabled, set specs->type to integer_type_node.
850
2fbe7a32 8512017-04-03 Jonathan Wakely <jwakely@redhat.com>
852
853 * c-array-notation.c: Fix typo in comment.
854
3582b9a6 8552017-03-29 Marek Polacek <polacek@redhat.com>
856
857 PR c/79730
858 * c-decl.c (finish_decl): Check VAR_P.
859
3385a573 8602017-03-27 Jakub Jelinek <jakub@redhat.com>
861
862 PR middle-end/80162
863 * c-tree.h (c_mark_addressable): Add array_ref_p argument.
864 * c-typeck.c (c_mark_addressable): Likewise. Look through
865 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
866 to ARRAY_TYPE.
867 (build_array_ref): Pass true as array_ref_p to c_mark_addressable.
868
5c1d51e3 8692017-03-23 Marek Polacek <polacek@redhat.com>
870
871 * c-tree.h: Remove a C_RID_YYCODE reference.
872
048100df 8732017-03-21 Jakub Jelinek <jakub@redhat.com>
874
875 PR c/80097
876 * c-typeck.c (build_binary_op): Add EXCESS_PRECISION_EXPR only around
877 optional COMPOUND_EXPR with ubsan instrumentation.
878
c153c724 8792017-03-17 Marek Polacek <polacek@redhat.com>
880
881 * c-parser.c: Add C11 references.
882
51eb47a0 8832017-03-15 Marek Polacek <polacek@redhat.com>
884
885 * c-parser.c (c_parser_enum_specifier): Remove redundant line.
886
726add0b 8872017-03-11 Marek Polacek <polacek@redhat.com>
888
889 * c-decl.c (implicit_decl_warning): Add a comment. Fix formatting.
890
ca1f4c7a 8912017-03-10 David Malcolm <dmalcolm@redhat.com>
892
893 PR translation/79848
894 * c-decl.c (declspecs_add_type): Simplify uses of "%<%s%>" to
895 "%qs".
896 * c-parser.c (c_parser_oacc_shape_clause): Likewise.
897
e14b765f 8982017-03-09 Marek Polacek <polacek@redhat.com>
899
900 PR sanitizer/79757
901 * c-parser.c (c_parser_declaration_or_fndef): Don't sanitize old-style
902 parameter declarations with initializers.
903
7ad571b2 9042017-03-09 Jakub Jelinek <jakub@redhat.com>
905
906 PR c/79969
907 * c-decl.c (start_enum): Adjust DECL_SOURCE_LOCATION of
908 TYPE_STUB_DECL.
909
d87f668a 9102017-03-07 Jakub Jelinek <jakub@redhat.com>
911
912 PR c/79834
913 * c-parser.c (c_parser_pragma): Use error_at instead of c_parser_error
914 for "may only be used in compound statements" diagnostics, change it
915 such that the same translatable string is used for all pragmas. For
916 PRAGMA_OACC_WAIT use "acc wait" rather than "acc enter data" in the
917 diagnostics.
918 (c_parser_omp_cancellation_point, c_parser_omp_target_update,
919 c_parser_omp_target_enter_data, c_parser_omp_target_exit_data): Change
920 "may only be used in compound statements" diagnostics, such that the
921 same translatable string is used for all pragmas.
922
16b0e324 9232017-03-04 Marek Polacek <polacek@redhat.com>
924
925 PR c/79847
926 * c-decl.c (implicit_decl_warning): Add missing space.
927
f2360ea5 9282017-03-03 Marek Polacek <polacek@redhat.com>
929
930 PR c/79758
931 * c-decl.c (store_parm_decls_oldstyle): Check if the element of
932 current_function_prototype_arg_types is error_mark_node. Fix
933 formatting. Use TREE_VALUE instead of TREE_TYPE.
934
d33f5911 9352017-03-03 Jakub Jelinek <jakub@redhat.com>
936
408a47b2 937 PR c/79837
938 * c-parser.c (c_parser_omp_clause_reduction): Don't mention
939 %<min%> or %<max%> in the diagnostics, instead mention identifier.
940 (c_parser_omp_declare_reduction): Don't mention %<min%> in the
941 diagnostics.
942
d33f5911 943 PR c/79836
944 * c-parser.c (c_parser_generic_selection): Use %<_Generic%>
945 instead of %<_Generic>.
946 (c_parser_omp_ordered): Use %<depend%> instead of %<depend>.
947 (c_parser_omp_target_exit_data): Use %<release%> instead of
948 %<release>.
949
1caf9cb4 9502017-02-28 Jakub Jelinek <jakub@redhat.com>
951
952 * c-parser.c (c_parser_asm_statement): Use cond ? G_("...") : G_("...")
953 instead of just cond ? "..." : "...".
954 (c_parser_oacc_enter_exit_data): Use %s and ternary operator only
955 for "enter"/"exit" keyword.
956 (c_finish_oacc_routine): Don't use %s to supply portions of the
957 message.
958
bbd5521e 9592017-02-24 Jakub Jelinek <jakub@redhat.com>
960
961 PR c++/79588
962 * c-parser.c (c_parser_postfix_expression_after_primary): Don't
963 handle -Wrestrict here.
964 * c-typeck.c (build_function_call_vec): Adjust
965 check_function_arguments caller.
966
a450df95 9672017-02-23 Richard Biener <rguenther@suse.de>
968
969 PR c/79684
970 * gimple-parser.c (c_parser_gimple_statement): Use set_error
971 to initialize c_exprs to return.
972 (c_parser_gimple_binary_expression): Likewise.
973 (c_parser_gimple_unary_expression): Likewise.
974 (c_parser_gimple_postfix_expression): Likewise.
975
2567d975 9762017-02-22 Marek Polacek <polacek@redhat.com>
977
978 PR c/79662
979 * c-typeck.c (convert_arguments): Handle error_mark_node.
980
21bfe0d4 9812017-02-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
982
983 * gimple-parser.c (c_parser_gimple_postfix_expression): Check return
984 value of c_parser_parse_ssa_name against error_mark_node and emit
985 error if ssa name is anonymous and written as default definition.
986
a8deddc8 9872017-02-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
988
989 * gimple-parser.c (c_parser_gimple_postfix_expression): Handle
990 FMA_EXPR.
991
79878c89 9922017-02-16 Jakub Jelinek <jakub@redhat.com>
993
994 PR c++/79512
995 * c-parser.c (c_parser_omp_target): For -fopenmp-simd
996 ignore #pragma omp target even when not followed by identifier.
997
78c6d67e 9982017-02-14 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
999
1000 * gimpler-parser.c (c_parser_gimple_statement): Handle ABS_EXPR.
1001 (c_parser_gimple_unary_expression): Likewise.
1002
19efce70 10032017-02-13 Jakub Jelinek <jakub@redhat.com>
1004
1005 * c-parser.c (c_parser_oacc_declare): Add missing space in
1006 diagnostics.
1007
32b8484d 10082017-02-13 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
1009
1010 PR c/79478
1011 * gimple-parser.c (c_parser_gimple_postfix_expression): Call
1012 set_c_expr_source_range when parsing ssa-name.
1013
b91919ba 10142017-02-10 Prasad Ghangal <prasad.ghangal@gmail.com>
1015 Richard Biener <rguenther@suse.de>
1016
1017 * gimple-parser.c (c_parser_gimple_binary_expression): Avoid
1018 building IL when arguments are error_mark_node.
1019 (c_parser_gimple_unary_expression): Likewise.
1020 (c_parser_gimple_if_stmt): Likewise.
1021 (c_parser_gimple_switch_stmt): Likewise.
1022 (c_parser_gimple_return_stmt): Likewise.
1023 (c_parser_parse_ssa_name): When name lookup fails do not build
1024 an SSA name. Use undeclared rather than not declared in error
1025 reporting.
1026
127144a0 10272017-02-09 Marek Polacek <polacek@redhat.com>
1028
1029 PR c/79428
1030 * c-parser.c (c_parser_omp_ordered): Call c_parser_skip_to_pragma_eol
1031 instead of c_parser_skip_until_found.
1032
b5c83b44 10332017-02-09 Jakub Jelinek <jakub@redhat.com>
1034
1035 PR c/79431
1036 * c-parser.c (c_parser_omp_declare_target): Don't invoke
1037 symtab_node::get on automatic variables.
1038
719a7570 10392016-02-09 Nathan Sidwell <nathan@codesourcery.com>
1040 Chung-Lin Tang <cltang@codesourcery.com>
1041
1042 * c-parser.c (c_parser_omp_clause_collapse): Disallow tile.
1043 (c_parser_oacc_clause_tile): Disallow collapse. Fix parsing and
1044 semantic checking.
1045 * c-parser.c (c_parser_omp_for_loop): Accept tiling constructs.
1046
29beab79 10472017-02-07 Richard Biener <rguenther@suse.de>
1048
1049 * gimple-parser.c (c_parser_gimple_expr_list): Simplify.
1050 (c_parser_gimple_postfix_expression_after_primary):
1051 Do not use c_build_function_call_vec to avoid folding and promotion.
1052 Simplify.
1053
96afa092 10542017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
1055
1056 PR lto/79061
1057 * c-decl.c (pop_scope): Pass main_input_filename to
1058 build_translation_unit_decl.
1059
175e0d6b 10602017-01-24 David Malcolm <dmalcolm@redhat.com>
1061
1062 * c-parser.c: Include "read-rtl-function.h" and
1063 "run-rtl-passes.h".
1064 (c_parser_declaration_or_fndef): Rename "gimple-pass-list" in
1065 grammar to gimple-or-rtl-pass-list. Add rtl-function-definition
1066 production. Update for renaming of field "gimple_pass" to
1067 "gimple_or_rtl_pass". If __RTL was seen, call
1068 c_parser_parse_rtl_body. Convert a timevar_push/pop pair
1069 to an auto_timevar, to cope with early exit.
1070 (c_parser_declspecs): Update RID_GIMPLE handling for renaming of
1071 field "gimple_pass" to "gimple_or_rtl_pass", and for renaming of
1072 c_parser_gimple_pass_list to c_parser_gimple_or_rtl_pass_list.
1073 Handle RID_RTL.
1074 (c_parser_parse_rtl_body): New function.
1075 * c-tree.h (enum c_declspec_word): Add cdw_rtl.
1076 (struct c_declspecs): Rename field "gimple_pass" to
1077 "gimple_or_rtl_pass". Add field "rtl_p".
1078 * gimple-parser.c (c_parser_gimple_pass_list): Rename to...
1079 (c_parser_gimple_or_rtl_pass_list): ...this, updating accordingly.
1080 * gimple-parser.h (c_parser_gimple_pass_list): Rename to...
1081 (c_parser_gimple_or_rtl_pass_list): ...this.
1082
3ef7eab1 10832017-01-20 Marek Polacek <polacek@redhat.com>
1084
1085 PR c/64279
1086 * c-typeck.c (build_conditional_expr): Warn about duplicated branches.
1087
785353b9 10882017-01-13 Richard Biener <rguenther@suse.de>
1089
1090 * gimple-parser.c (c_parser_gimple_compound_statement): Handle
1091 nops.
1092
ac5f04c1 10932017-01-13 Richard Biener <rguenther@suse.de>
1094
1095 * gimple-parser.c (c_parser_gimple_postfix_expression): Parse
1096 _Literal ( type-name ) number.
1097
2b11c996 10982017-01-12 Richard Biener <rguenther@suse.de>
1099
1100 * gimple-parser.c (c_parser_gimple_postfix_expression): Parse
1101 __MEM.
1102
9a26d403 11032017-01-11 Jakub Jelinek <jakub@redhat.com>
1104
1105 PR c++/72813
1106 * c-decl.c (pop_file_scope): Set flag_syntax_only to 1 after writing
1107 PCH file.
1108
a19c4dc1 11092017-01-11 Richard Biener <rguenther@suse.de>
1110
1111 PR bootstrap/79052
1112 * gimple-parser.c (c_parser_gimple_switch_stmt): Add missing
1113 returns on parse errors.
1114
6124217c 11152017-01-04 Marek Polacek <polacek@redhat.com>
1116
1117 PR c++/64767
1118 * c-parser.c (c_parser_postfix_expression): Mark zero character
1119 constants by setting original_type in c_expr.
1120 * c-typeck.c (parser_build_binary_op): Warn when a pointer is compared
1121 with a zero character constant.
1122 (char_type_p): New function.
1123
8ccda24a 11242017-01-04 David Malcolm <dmalcolm@redhat.com>
1125
1126 * c-parser.c (c_parser_declaration_or_fndef): Create a
1127 rich_location at init_loc and parse it to start_init.
1128 (last_init_list_comma): New global.
1129 (c_parser_braced_init): Update last_init_list_comma when parsing
1130 commas. Pass it to pop_init_level. Pass location of closing
1131 brace to pop_init_level.
1132 (c_parser_postfix_expression_after_paren_type): Create a
1133 rich_location at type_loc and parse it to start_init.
1134 (c_parser_omp_declare_reduction): Likewise for loc.
1135 * c-tree.h (start_init): Add rich_location * param.
1136 (pop_init_level): Add location_t param.
1137 * c-typeck.c (struct initializer_stack): Add field
1138 "missing_brace_richloc".
1139 (start_init): Add richloc param, use it to initialize
1140 the stack node's missing_brace_richloc.
1141 (last_init_list_comma): New decl.
1142 (finish_implicit_inits): Pass last_init_list_comma to
1143 pop_init_level.
1144 (push_init_level): When finding missing open braces, add fix-it
1145 hints to the richloc.
1146 (pop_init_level): Add "insert_before" param and pass it
1147 when calling pop_init_level. Add fixits about missing
1148 close braces to any richloc. Use the richloc for the
1149 -Wmissing-braces warning.
1150 (set_designator): Pass last_init_list_comma to pop_init_level.
1151 (process_init_element): Likewise.
1152
aad93da1 11532017-01-01 Jakub Jelinek <jakub@redhat.com>
1154
1155 Update copyright years.
1156
3713d2e2 11572016-12-21 Jakub Jelinek <jakub@redhat.com>
1158
184fac50 1159 PR bootstrap/78817
1160 * c-typeck.c (build_function_call_vec): If check_function_arguments
1161 returns true, set TREE_NO_WARNING on CALL_EXPR.
1162
3713d2e2 1163 PR c/77767
1164 * c-decl.c (grokdeclarator): If *expr is non-NULL, append expression
1165 to *expr instead of overwriting it.
1166
3e677d45 11672016-12-20 Richard Biener <rguenther@suse.de>
1168
1169 * gimple-parser.c (c_parser_gimple_compound_statement): Improve
1170 error recovery.
1171 (c_parser_gimple_statement): Only build assigns for non-error
1172 stmts.
1173 (c_parser_gimple_postfix_expression_after): Improve error recovery.
1174
4954efd4 11752016-12-14 Martin Jambor <mjambor@suse.cz>
1176
1177 * c-parser.c: Include omp-general.h and omp-offload.h instead of
1178 omp-low.h.
1179 (c_finish_oacc_routine): Adjusted call to
1180 get_oacc_fn_attrib, build_oacc_routine_dims and replace_oacc_fn_attrib
1181 to use their new names.
1182 (c_parser_oacc_enter_exit_data): Adjusted call to find_omp_clause to
1183 use its new name.
1184 (c_parser_oacc_update): Likewise.
1185 (c_parser_omp_simd): Likewise.
1186 (c_parser_omp_target_update): Likewise.
1187 * c-typeck.c: Include omp-general.h instead of omp-low.h.
1188 (c_finish_omp_cancel): Adjusted call to find_omp_clause to use its new
1189 name.
1190 (c_finish_omp_cancellation_point): Likewise.
1191 * gimple-parser.c: Do not include omp-low.h
1192
4c50b884 11932016-12-02 Cesar Philippidis <cesar@codesourcery.com>
1194 James Norris <jnorris@codesourcery.com>
1195
1196 * c-parser.c (c_parser_pragma): Error when PRAGMA_OACC_{ENTER_DATA,
1197 EXIT_DATA,WAIT} are not used in compound statements.
1198 (c_parser_oacc_enter_exit_data): Update diagnostics.
1199
f1b3e1c9 12002016-11-21 Bernd Edlinger <bernd.edlinger@hotmail.de>
1201
1202 PR c++/71973
1203 * c-decl.c (diagnose_mismatched_decls): Use
1204 OPT_Wbuiltin_declaration_mismatch here too.
1205
adc78298 12062016-11-18 Richard Sandiford <richard.sandiford@arm.com>
f1b3e1c9 1207 Alan Hayward <alan.hayward@arm.com>
1208 David Sherwood <david.sherwood@arm.com>
adc78298 1209
1210 * c-decl.c (merge_decls): Use SET_DECL_MODE.
1211 (make_label, finish_struct): Likewise.
1212
b1f04d34 12132016-11-14 Prasad Ghangal <prasad.ghangal@gmail.com>
a49621cf 1214 Richard Biener <rguenther@suse.de>
9b8f3aa1 1215
a49621cf 1216 * Make-lang.in (C_AND_OBJC_OBJS): Add gimple-parser.o.
1217 * config-lang.in (gtfiles): Add c/c-parser.h.
1218 * c-tree.h (enum c_declspec_word): Add cdw_gimple.
1219 (struct c_declspecs): Add gimple_pass member and gimple_p flag.
1220 * c-parser.c (enum c_id_kind, struct c_token,
1221 c_parser_next_token_is, c_parser_next_token_is_not,
1222 c_parser_next_token_is_keyword,
1223 enum c_lookahead_kind, enum c_dtr_syn, enum c_parser_prec):
1224 Split out to ...
1225 * c-parser.h: ... new header.
1226 * c-parser.c: Include c-parser.h and gimple-parser.h.
b1f04d34 1227 (c_parser_peek_token, c_parser_peek_2nd_token,
a49621cf 1228 c_token_starts_typename, c_parser_next_token_starts_declspecs,
1229 c_parser_next_tokens_start_declaration, c_parser_consume_token,
1230 c_parser_error, c_parser_require, c_parser_skip_until_found,
1231 c_parser_declspecs, c_parser_declarator, c_parser_peek_nth_token,
1232 c_parser_type_name): Export.
1233 (c_parser_tokens_buf): New function.
1234 (c_parser_error): Likewise.
1235 (c_parser_set_error): Likewise.
1236 (c_parser_declspecs): Handle RID_GIMPLE.
b1f04d34 1237 (c_parser_declaration_or_fndef): Parse __GIMPLE marked body
1238 via c_parser_parse_gimple_body.
a49621cf 1239 * c-parser.h (c_parser_peek_token, c_parser_peek_2nd_token,
1240 c_token_starts_typename, c_parser_next_token_starts_declspecs,
1241 c_parser_next_tokens_start_declaration, c_parser_consume_token,
1242 c_parser_error, c_parser_require, c_parser_skip_until_found,
1243 c_parser_declspecs, c_parser_declarator, c_parser_peek_nth_token,
1244 c_parser_type_name): Declare.
b1f04d34 1245 (struct c_parser): Declare forward.
1246 (c_parser_tokens_buf): Declare.
a49621cf 1247 (c_parser_error): Likewise.
1248 (c_parser_set_error): Likewise.
1249 * gimple-parser.c: New file.
1250 * gimple-parser.h: Likewise.
b1f04d34 1251
9b8f3aa1 12522016-11-13 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
1253
1254 PR c/35503
1255 * c-parser.c (c_parser_postfix_expression_after_primary): Call
1256 warn_for_restrict.
1257
50d3ad71 12582016-09-11 Le-Chun Wu <lcwu@google.com>
1259 Mark Wielaard <mjw@redhat.com>
1260
1261 * c-decl.c (warn_if_shadowing): Use the warning code corresponding
1262 to the given -Wshadow= variant.
1263
ad7b10a2 12642016-10-13 Thomas Preud'homme <thomas.preudhomme@arm.com>
1265
1266 * c-typeck.c: Include memmodel.h.
1267
8a23256f 12682016-10-13 Jakub Jelinek <jakub@redhat.com>
1269
1270 PR target/77957
1271 * c-objc-common.h (LANG_HOOKS_GETDECLS): Use hook_tree_void_null
1272 instead of lhd_return_null_tree_v.
1273
30ac4925 12742016-10-07 Bernd Schmidt <bschmidt@redhat.com>
1275
1276 PR c++/69733
1277 * c-decl.c (smallest_type_quals_location): New static function.
1278 (grokdeclarator): Try to find the correct location for an ignored
1279 qualifier.
1280
3c77f69c 12812016-09-26 Marek Polacek <polacek@redhat.com>
1282
1283 PR c/7652
1284 * c-decl.c (pop_scope): Add gcc_fallthrough.
1285
12862016-09-26 Marek Polacek <polacek@redhat.com>
1287
1288 PR c/7652
1289 * c-parser.c (struct c_token): Add flags field.
1290 (c_lex_one_token): Pass it to c_lex_with_flags.
1291 (c_parser_declaration_or_fndef): Turn __attribute__((fallthrough));
1292 into IFN_FALLTHROUGH.
1293 (c_parser_label): Set FALLTHROUGH_LABEL_P on labels. Handle
1294 attribute fallthrough after a case label or default label.
1295 (c_parser_statement_after_labels): Handle RID_ATTRIBUTE.
1296
481ce481 12972016-09-24 Marek Polacek <polacek@redhat.com>
1298
1299 PR c/77490
1300 * c-typeck.c (build_unary_op): Warn about bit not on expressions that
1301 have boolean value. Warn about ++/-- on booleans.
1302
16fb756f 13032016-09-23 Jakub Jelinek <jakub@redhat.com>
1304
1305 * c-parser.c (incomplete_record_decls): Remove unnecessary
1306 = vNULL initialization of file scope vec.
1307
d80c1c6c 13082016-09-16 Marek Polacek <polacek@redhat.com>
1309
1310 * c-typeck.c (lvalue_p): Use true and false instead of 1 and 0.
1311
b99cc6da 13122016-09-14 Marek Polacek <polacek@redhat.com>
1313
1314 * c-array-notation.c (create_cmp_incr): Use false instead of 0.
1315 (fix_array_notation_expr): Likewise.
1316 * c-decl.c (finish_decl): Likewise.
1317 * c-parser.c (c_parser_postfix_expression_after_primary): Likewise.
1318 * c-typeck.c (array_to_pointer_conversion): Use true instead of 1.
1319 (function_to_pointer_conversion): Use false instead of 0.
1320 (convert_lvalue_to_rvalue): Likewise.
1321 (parser_build_unary_op): Likewise.
1322 (build_atomic_assign): Likewise.
1323 (build_unary_op): Change nonconvert parameter type to bool, use
1324 true/false instead of 1/0.
1325 (build_binary_op): Use true instead of 1.
1326
68ef907c 13272016-09-13 David Malcolm <dmalcolm@redhat.com>
1328
1329 * c-parser.c (c_parser_declaration_or_fndef): Update for renaming
1330 of add_fixit_insert to add_fixit_insert_before.
1331
89bcb5a3 13322016-09-13 Marek Polacek <polacek@redhat.com>
1333
1334 * c-typeck.c (build_unary_op): Rename FLAG parameter to NOCONVERT. Use
1335 it.
1336
7a21b590 13372016-09-12 Bernd Edlinger <bernd.edlinger@hotmail.de>
1338
1339 PR c++/77496
1340 * c-parser.c (c_parser_conditional_expression): Pass the rightmost
1341 COMPOUND_EXPR to warn_for_omitted_condop.
1342
3da97ff7 13432016-09-07 David Malcolm <dmalcolm@redhat.com>
1344
1345 * c-lang.c (LANG_HOOKS_GET_SUBSTRING_LOCATION): Use
1346 c_get_substring_location for this new langhook.
1347
0b80c4b2 13482016-09-02 Jakub Jelinek <jakub@redhat.com>
1349
1350 PR c/65467
1351 * c-parser.c (c_parser_declspecs): Don't sorry about _Atomic if
1352 flag_openmp.
1353 (c_parser_omp_variable_list): Use convert_lvalue_to_rvalue
1354 instead of mark_exp_read on low_bound/length expression.
1355 (c_parser_omp_clause_num_gangs, c_parser_omp_clause_num_threads,
1356 c_parser_omp_clause_num_tasks, c_parser_omp_clause_grainsize,
1357 c_parser_omp_clause_priority, c_parser_omp_clause_hint,
1358 c_parser_omp_clause_num_workers, c_parser_oacc_shape_clause,
1359 c_parser_oacc_clause_tile, c_parser_omp_clause_schedule,
1360 c_parser_omp_clause_vector_length, c_parser_omp_clause_num_teams,
1361 c_parser_omp_clause_thread_limit, c_parser_omp_clause_aligned,
1362 c_parser_omp_clause_linear, c_parser_omp_clause_safelen,
1363 c_parser_omp_clause_simdlen, c_parser_omp_clause_device,
1364 c_parser_omp_clause_dist_schedule): Use convert_lvalue_to_rvalue
1365 instead of mark_expr_read.
1366 (c_parser_omp_declare_reduction): Reject _Atomic qualified types.
1367 * c-objc-common.h (LANG_HOOKS_OMP_CLAUSE_COPY_CTOR,
1368 LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP): Redefine.
1369 * c-tree.h (c_omp_clause_copy_ctor): New prototype.
1370 * c-typeck.c (handle_omp_array_sections_1): Diagnose _Atomic qualified
1371 array section bases outside of depend clause, for depend clause
1372 use convert_lvalue_to_rvalue on the base.
1373 (c_finish_omp_clauses): Reject _Atomic qualified vars in reduction,
1374 linear, aligned, map, to and from clauses.
1375 (c_omp_clause_copy_ctor): New function.
1376
c7afb782 13772016-09-01 Marek Polacek <polacek@redhat.com>
1378
1379 PR c/7652
1380 * c-typeck.c (composite_type): Add FALLTHRU comment.
1381
986530da 13822016-08-31 David Malcolm <dmalcolm@redhat.com>
1383
1384 * c-parser.c (c_parser_declaration_or_fndef): Add trailing space
1385 to the insertion fixits for "struct", "union", and "enum".
1386
850c2009 13872016-08-30 David Malcolm <dmalcolm@redhat.com>
1388
1389 * c-decl.c (implicit_decl_warning): Use add_fixit_replace
1390 rather than add_fixit_misspelled_id.
1391 (undeclared_variable): Likewise.
1392 * c-parser.c (c_parser_declaration_or_fndef): Likewise. Remove
1393 now-redundant "here" params from add_fixit_insert method calls.
1394 (c_parser_parameter_declaration): Likewise.
1395 * c-typeck.c (build_component_ref): Remove now-redundant range
1396 param from add_fixit_replace method calls.
1397
c4963714 13982016-08-25 Marek Polacek <polacek@redhat.com>
1399
1400 * c-typeck.c (parser_build_binary_op): Pass LHS to
1401 warn_logical_not_parentheses.
1402
49e1f4eb 14032016-08-25 Marek Polacek <polacek@redhat.com>
1404
1405 PR c/77323
1406 * c-decl.c (declspecs_add_type): Set typespec_word even when __intN
1407 or _FloatN or _FloatNx is not supported.
1408 (finish_declspecs): Set type to integer_type_node when _FloatN or
1409 _FloatNx is not supported.
1410
82c85aba 14112016-08-19 Joseph Myers <joseph@codesourcery.com>
1412
1413 PR c/32187
1414 * c-tree.h (cts_floatn_nx): New enum c_typespec_keyword value.
1415 (struct c_declspecs): Add field floatn_nx_idx.
1416 * c-decl.c (declspecs_add_type, finish_declspecs): Handle _FloatN
1417 and _FloatNx type specifiers.
1418 * c-parser.c (c_keyword_starts_typename, c_token_starts_declspecs)
1419 (c_parser_declspecs, c_parser_attribute_any_word)
1420 (c_parser_objc_selector): Use CASE_RID_FLOATN_NX.
1421 * c-typeck.c (c_common_type): Handle _FloatN and _FloatNx types.
1422 (convert_arguments): Avoid promoting _FloatN and _FloatNx types
1423 narrower than double.
1424
7175bb2a 14252016-08-12 Jakub Jelinek <jakub@redhat.com>
1426 Martin Liska <mliska@suse.cz>
1427
1428 PR c/67410
1429 * c-typeck.c (set_nonincremental_init_from_string): Use / instead of
1430 % to determine val element to change. Assert that
1431 wchar_bytes * charwidth fits into val array.
1432
e3533433 14332016-08-12 Marek Polacek <polacek@redhat.com>
1434
1435 PR c/7652
1436 * c-parser.c (c_parser_external_declaration): Add FALLTHRU.
1437 (c_parser_postfix_expression): Likewise.
1438 * c-typeck.c (build_unary_op): Adjust fall through comment.
1439 (c_mark_addressable): Likewise.
1440
74be5bc1 14412016-08-11 Jakub Jelinek <jakub@redhat.com>
1442
1443 PR c/72816
1444 * c-decl.c (grokdeclarator): When adding TYPE_DOMAIN for flexible
1445 array member through typedef, for orig_qual_indirect == 0 clear
1446 orig_qual_type.
1447
7af4d06b 14482016-08-08 David Malcolm <dmalcolm@redhat.com>
1449
1450 PR c/64955
1451 * c-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): If CHECKING_P, wire
1452 this up to selftest::run_c_tests.
1453 (selftest::run_c_tests): New function.
1454
5f429ee2 14552016-08-04 Thomas Schwinge <thomas@codesourcery.com>
1456
1fa5d8ba 1457 * c-parser.c (struct oacc_routine_data): Add error_seen and
1458 fndecl_seen members.
1459 (c_finish_oacc_routine): Use these.
1460 (c_parser_declaration_or_fndef): Adjust.
1461 (c_parser_oacc_routine): Likewise. Support more C language
1462 constructs, and improve diagnostics. Move pragma context
1463 checking...
1464 (c_parser_pragma): ... here.
1465
5f429ee2 1466 * c-parser.c (struct oacc_routine_data): New.
1467 (c_parser_declaration_or_fndef, c_parser_oacc_routine): Use it.
1468 Simplify code.
1469 (c_finish_oacc_routine): Likewise. Don't attach clauses to "omp
1470 declare target" attribute.
1471
f3c032a4 14722016-08-01 Jan Beulich <jbeulich@suse.com>
1473
1474 * c-fold.c (c_fully_fold_internal): Also emit shift count
1475 warnings for vector types.
1476 * c-typeck.c (build_binary_op): Likewise.
1477
4ebf85be 14782016-07-29 Marek Polacek <polacek@redhat.com>
1479
1480 PR c/71742
1481 * c-decl.c (finish_struct): Rephrase an error message.
1482
9efe5be6 1483 PR c/71853
1484 * c-parser.c (c_parser_switch_statement): Initialize ce.original_type
1485 to error node for invalid code.
1486
4c4548bb 1487 PR c/71573
1488 * c-decl.c (implicitly_declare): Return decl early not only for
1489 error_mark_nodes, but for anything that is not a FUNCTION_DECL.
1490
322d4184 14912016-07-29 Jakub Jelinek <jakub@redhat.com>
1492
1493 PR c/71969
1494 * c-decl.c (finish_function): Only set DECL_DISREGARD_INLINE_LIMITS
1495 on GNU extern inline functions.
1496
35fddbd6 14972016-07-29 Marek Polacek <polacek@redhat.com>
1498
1499 PR c/71583
1500 * c-parser.c (c_parser_postfix_expression_after_paren_type): Also
1501 check expr.value.
1502
59c1507a 15032016-07-22 Uros Bizjak <ubizjak@gmail.com>
1504
1505 * c-typeck.c: Use HOST_WIDE_INT_1 instead of (HOST_WIDE_INT) 1,
1506
d0f11d68 15072016-07-20 David Malcolm <dmalcolm@redhat.com>
1508
1509 * c-decl.c (struct edit_distance_traits<cpp_hashnode *>): Move to
1510 spellcheck-tree.h
1511 (best_macro_match): Likewise, converting from a typedef to a
1512 subclass.
1513 (find_closest_macro_cpp_cb): Move to spellcheck-tree.c.
1514 (lookup_name_fuzzy): Update for change of best_macro_match to a
1515 subclass with a ctor that calls cpp_forall_identifiers.
1516
d208f6e6 15172016-07-20 David Malcolm <dmalcolm@redhat.com>
1518
1519 * c-decl.c (implicit_decl_warning): Update for conversion of
1520 return type of lookup_name_fuzzy to const char *.
1521 (undeclared_variable): Likewise.
1522 (lookup_name_fuzzy): Convert return type from tree to
1523 const char *.
1524 * c-parser.c (c_parser_declaration_or_fndef): Update for
1525 conversion of return type of lookup_name_fuzzy to const char *.
1526 (c_parser_parameter_declaration): Likewise.
1527
0ef9358d 15282016-07-15 Cesar Philippidis <cesar@codesourcery.com>
1529
1530 * c-parser.c (c_parser_oacc_declare): Don't scan for
1531 GOMP_MAP_POINTER.
1532 * c-typeck.c (handle_omp_array_sections): Mark data clauses with
1533 GOMP_MAP_FORCE_{PRESENT,TO,FROM,TOFROM} as potentially having
1534 zero-length subarrays.
1535
0dd7db3b 15362016-07-15 Jakub Jelinek <jakub@redhat.com>
1537
1538 PR c/71858
1539 * c-decl.c (implicit_decl_warning): Use FUZZY_LOOKUP_FUNCTION_NAME
1540 instead of FUZZY_LOOKUP_NAME.
1541 (lookup_name_fuzzy): For FUZZY_LOOKUP_FUNCTION_NAME consider
1542 FUNCTION_DECLs, {VAR,PARM}_DECLs function pointers and macros.
1543
28413b15 15442016-07-14 Jakub Jelinek <jakub@redhat.com>
1545
1546 PR c/71858
1547 * c-decl.c (lookup_name_fuzzy): Ignore binding->invisible.
1548
e9258aee 15492016-07-12 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
1550
1551 * c-parser.c (c_parser_generic_selection): Make type of variable
1552 auto_vec.
1553 (c_parser_omp_declare_simd): Likewise.
1554
57f91a55 15552016-07-12 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
1556
1557 * c-decl.c (struct c_struct_parse_info): Change member types
1558 from vec to auto_vec.
1559 (start_struct): Adjust.
1560 (finish_struct): Likewise.
1561
c364d0f3 15622016-07-02 Jakub Jelinek <jakub@redhat.com>
1563
1564 PR c/71719
1565 * c-typeck.c (mark_exp_read): Handle VIEW_CONVERT_EXPR.
1566
44e775d8 15672016-06-29 Thomas Schwinge <thomas@codesourcery.com>
1568
1569 * c-parser.c (c_parser_pragma) <PRAGMA_OMP_CANCELLATION_POINT>:
1570 Move pragma context checking into...
1571 (c_parser_omp_cancellation_point): ... here, and improve
1572 diagnostic messages.
1573 * c-typeck.c (c_finish_omp_cancel)
1574 (c_finish_omp_cancellation_point): Improve diagnostic messages.
1575
1af10ce6 15762016-06-29 Jakub Jelinek <jakub@redhat.com>
1577
1578 PR c/71685
1579 * c-typeck.c (c_build_qualified_type): Don't clear
1580 C_TYPE_INCOMPLETE_VARS for the main variant.
1581
15822016-06-28 Martin Sebor <msebor@redhat.com>
9c3ffbcb 1583
1584 PR c/71552
1585 * c-typeck.c (output_init_element): Diagnose incompatible types
1586 before non-constant initializers.
1587
6eb2402f 15882016-06-28 Jakub Jelinek <jakub@redhat.com>
1589
1590 * Make-lang.in: Don't cat ../stage_current if it does not exist.
1591
b4c71cbb 15922016-06-23 Andi Kleen <ak@linux.intel.com>
1593
1594 * Make-lang.in: Add support for autofdo.
1595
8469aece 15962016-06-22 David Malcolm <dmalcolm@redhat.com>
1597
1598 PR c/70339
1599 * c-decl.c: Include spellcheck-tree.h and gcc-rich-location.h.
1600 (implicit_decl_warning): When issuing warnings for implicit
1601 declarations, attempt to provide a suggestion via
1602 lookup_name_fuzzy.
1603 (undeclared_variable): Likewise when issuing errors.
1604 (lookup_name_in_scope): Likewise.
1605 (struct edit_distance_traits<cpp_hashnode *>): New struct.
1606 (best_macro_match): New typedef.
1607 (find_closest_macro_cpp_cb): New function.
1608 (lookup_name_fuzzy): New function.
1609 * c-parser.c: Include gcc-rich-location.h.
1610 (c_token_starts_typename): Split out case CPP_KEYWORD into...
1611 (c_keyword_starts_typename): ...this new function.
1612 (c_parser_declaration_or_fndef): When issuing errors about
1613 missing "struct" etc, add a fixit. For other kinds of errors,
1614 attempt to provide a suggestion via lookup_name_fuzzy.
1615 (c_parser_parms_declarator): When looking ahead to detect typos in
1616 type names, also reject CPP_KEYWORD.
1617 (c_parser_parameter_declaration): When issuing errors about
1618 unknown type names, attempt to provide a suggestion via
1619 lookup_name_fuzzy.
1620 * c-tree.h (c_keyword_starts_typename): New prototype.
1621
e218d07f 16222016-06-20 Joseph Myers <joseph@codesourcery.com>
1623
1624 PR c/71601
1625 * c-typeck.c (build_conditional_expr): Return error_mark_node if
1626 c_common_type returns error_mark_node.
1627
92a44a68 16282016-06-19 Martin Sebor <msebor@redhat.com>
21897f47 1629
1630 PR c/69507
1631 * c-parser.c (c_parser_alignof_expression): Avoid diagnosing
1632 __alignof__ (expression).
1633
f0d77991 16342016-06-14 David Malcolm <dmalcolm@redhat.com>
1635
1636 * c-typeck.c: Include spellcheck-tree.h rather than spellcheck.h.
1637
2a990300 16382016-06-14 David Malcolm <dmalcolm@redhat.com>
1639
1640 * c-typeck.c (build_component_ref): Simplify fixit code by
1641 using gcc_rich_location::add_fixit_misspelled_id.
1642 (set_init_label): Likewise.
1643
527790c1 16442016-06-13 David Malcolm <dmalcolm@redhat.com>
1645
1646 * c-parser.c (c_parser_initelt): Provide location of name for new
1647 location_t param of set_init_label.
1648 * c-tree.h (set_init_label): Add location_t param.
1649 * c-typeck.c (set_init_index): Add "fieldname_loc" location_t
1650 param and use it when issuing error messages about unrecognized
1651 field names. Attempt to provide a fixit hint if appropriate,
1652 otherwise update the error message to provide the type name.
1653
ccfa030f 16542016-06-10 Thomas Schwinge <thomas@codesourcery.com>
1655
1656 PR c/71381
1657 * c-parser.c (c_parser_omp_variable_list) <OMP_CLAUSE__CACHE_>:
1658 Loosen checking.
1659
732905bb 16602016-06-08 Martin Sebor <msebor@redhat.com>
1661 Jakub Jelinek <jakub@redhat.com>
1662
1663 PR c++/70507
1664 PR c/68120
1665 * c-typeck.c (convert_arguments): Don't promote last argument
1666 of BUILT_IN_{ADD,SUB,MUL}_OVERFLOW_P.
1667
bafc7b1d 16682016-06-08 Marek Polacek <polacek@redhat.com>
1669
1670 PR c/71418
1671 * c-decl.c (grokdeclarator): Check TYPE_P.
1672
06e590e7 1673 PR c/71426
1674 * c-decl.c (get_parm_info): Don't crash on an assert on invalid
1675 code.
1676
7cfde92a 16772016-06-07 David Malcolm <dmalcolm@redhat.com>
1678
1679 * c-parser.c (c_parser_postfix_expression): In __builtin_offsetof
1680 and structure element reference, capture the location of the
1681 element name token and pass it to build_component_ref.
1682 (c_parser_postfix_expression_after_primary): Likewise for
1683 structure element dereference.
1684 (c_parser_omp_variable_list): Likewise for
1685 OMP_CLAUSE_{_CACHE, MAP, FROM, TO},
1686 * c-tree.h (build_component_ref): Add location_t param.
1687 * c-typeck.c (build_component_ref): Add location_t param
1688 COMPONENT_LOC. Use it, if available, when issuing hints about
1689 mispelled member names to provide a fixit replacement hint.
1690
61f1f80c 16912016-06-06 Marek Polacek <polacek@redhat.com>
1692
1693 PR c/71362
1694 * c-parser.c (c_parser_direct_declarator): Set location.
1695
e4b92538 16962016-06-06 Marek Polacek <polacek@redhat.com>
1697
1698 * c-typeck.c (comptypes_internal): Handle comparisons of
1699 INTEGER_TYPE, FIXED_POINT_TYPE, and REAL_TYPE nodes. Don't check
1700 TYPE_REF_CAN_ALIAS_ALL.
1701
2234363c 17022016-06-03 Chung-Lin Tang <cltang@codesourcery.com>
1703
1704 * c-typeck.c (c_finish_omp_clauses): Mark OpenACC reduction
1705 arguments as addressable when async clause exists.
1706
b6431756 17072016-05-30 Jakub Jelinek <jakub@redhat.com>
1708
1709 PR c++/71349
1710 * c-parser.c (c_parser_omp_for): Don't disallow nowait clause
1711 when combined with target construct.
1712
6feab9ce 17132016-05-26 Jakub Jelinek <jakub@redhat.com>
1714
1715 * c-parser.c (c_parser_omp_clause_schedule): Warn if
1716 OMP_CLAUSE_SCHEDULE_CHUNK_EXPR is known not to be positive.
1717
2c995da9 17182016-05-25 Marek Polacek <polacek@redhat.com>
1719
1720 PR c/71265
1721 * c-decl.c (c_make_fname_decl): Don't check seen_error.
1722
abfbb5b5 1723 PR c/71266
1724 * c-decl.c (store_parm_decls_oldstyle): Skip non-PARM_DECLs.
1725
6d6a3fc3 17262016-05-24 Cesar Philippidis <cesar@codesourcery.com>
1727
1728 * c-parser.c (c_parser_oacc_declare): Add support for
1729 GOMP_MAP_FIRSTPRIVATE_POINTER.
1730 * c-typeck.c (handle_omp_array_sections_1): Replace bool is_omp
1731 argument with enum c_omp_region_type ort.
1732 (handle_omp_array_sections): Likewise. Update call to
1733 handle_omp_array_sections_1.
1734 (c_finish_omp_clauses): Add specific errors and warning messages for
1735 OpenACC. Use firsrtprivate pointers for OpenACC subarrays. Update
1736 call to handle_omp_array_sections.
1737
c9d624bd 17382016-05-24 Thomas Schwinge <thomas@codesourcery.com>
1739
1740 * c-parser.c (c_parser_oacc_routine): Tighten syntax checks.
1741
7345b977 17422016-05-24 Richard Biener <rguenther@suse.de>
1743
1744 PR middle-end/70434
1745 PR c/69504
1746 * c-typeck.c (build_array_ref): Do not complain about indexing
1747 non-lvalue vectors. Adjust for function name change.
1748
8bdfbc08 17492016-05-20 Martin Sebor <msebor@redhat.com>
1750
1751 PR c/71115
1752 * c-typeck.c (error_init): Use
1753 expansion_point_location_if_in_system_header.
1754 (warning_init): Same.
1755
97c71d71 17562016-05-19 David Malcolm <dmalcolm@redhat.com>
1757
1758 PR c/71171
1759 * c-parser.c (c_parser_generic_selection): Use c_expr::set_error
1760 in error-handling.
1761 (c_parser_postfix_expression): Likewise.
1762 * c-tree.h (c_expr::set_error): New method.
1763 * c-typeck.c (parser_build_binary_op): In error-handling, ensure
1764 that result's range is initialized.
1765
e68d7b49 17662016-05-17 James Greenhalgh <james.greenhalgh@arm.com>
1767
1768 * c-typeck.c (parser_build_unary_op): Fix formatting.
1769
624115b4 17702016-05-16 Matthew Wahab <matthew.wahab@arm.com>
1771
1772 * c-decl.c (grokdeclarator): Remove errmsg and use of
1773 targetm.invalid_return_type.
1774 (grokparms): Remove errmsg and use of
1775 targetm.invalid_parameter_type.
1776
90c88567 17772016-05-13 Joseph Myers <joseph@codesourcery.com>
1778
1779 * c-decl.c (grokdeclarator): For C11, discard qualifiers on
1780 function return type.
1781
22a3f7bd 17822016-05-12 Marek Polacek <polacek@redhat.com>
1783
1784 PR c/70756
1785 * c-decl.c (build_compound_literal): Pass LOC down to
1786 c_incomplete_type_error.
1787 * c-tree.h (require_complete_type): Adjust declaration.
1788 (c_incomplete_type_error): Likewise.
1789 * c-typeck.c (require_complete_type): Add location parameter, pass it
1790 down to c_incomplete_type_error.
1791 (c_incomplete_type_error): Add location parameter, pass it down to
1792 error_at.
1793 (build_component_ref): Pass location down to c_incomplete_type_error.
1794 (default_conversion): Pass location down to require_complete_type.
1795 (build_array_ref): Likewise.
1796 (build_function_call_vec): Likewise.
1797 (convert_arguments): Likewise.
1798 (build_unary_op): Likewise.
1799 (build_c_cast): Likewise.
1800 (build_modify_expr): Likewise.
1801 (convert_for_assignment): Likewise.
1802 (c_finish_omp_clauses): Likewise.
1803
54c4d22e 18042016-05-11 Mikhail Maltsev <maltsevm@gmail.com>
1805
1806 PR c/43651
1807 * c-decl.c (declspecs_add_qual): Warn when -Wduplicate-decl-specifier
1808 is enabled.
1809 * c-errors.c (pedwarn_c90): Return true if warned.
1810 * c-tree.h (pedwarn_c90): Change return type to bool.
1811 (enum c_declspec_word): Add new enumerator cdw_atomic.
1812
7f8012a5 18132016-05-11 Marek Polacek <polacek@redhat.com>
1814
1815 PR c++/71024
1816 * c-decl.c (diagnose_mismatched_decls): Factor out code to
1817 diagnose_mismatched_attributes and call it.
1818
3fa82609 18192016-05-10 Marek Polacek <polacek@redhat.com>
1820
1821 PR c/70255
1822 * c-decl.c (diagnose_mismatched_decls): Warn for optimize attribute
1823 on a declaration following the definition.
1824
871164c4 18252016-05-05 Jakub Jelinek <jakub@redhat.com>
1826
1827 * c-parser.c (c_parser_switch_statement): Add IF_P argument,
1828 parse it through to c_parser_c99_block_statement.
1829 (c_parser_statement_after_labels): Adjust c_parser_switch_statement
1830 caller.
1831
1d52c456 18322016-05-04 Marek Polacek <polacek@redhat.com>
1833
1834 * c-parser.c (c_parser_if_statement): Replace OPT_Wparentheses with
1835 OPT_Wdangling_else.
1836
a64030fe 18372016-05-04 Marek Polacek <polacek@redhat.com>
1838
1839 PR c/48778
1840 * c-typeck.c (build_binary_op): Don't issue -Waddress warnings
1841 for macro expansions.
1842
5d4db8ef 18432016-05-03 Marek Polacek <polacek@redhat.com>
1844
1845 PR c/70859
1846 * c-typeck.c (build_function_call_vec): Pass LOC and ARG_LOC down to
1847 check_builtin_function_arguments.
1848
0bd2fc6e 18492016-05-03 Richard Biener <rguenther@suse.de>
1850
1851 * Make-lang.in (cc1-checksum.c): For stage-final re-use
1852 the checksum from the previous stage.
1853
b5e88f74 18542016-05-02 Cesar Philippidis <cesar@codesourcery.com>
1855
1856 * c-parser.c (c_parser_oacc_all_clauses): Update call to
1857 c_finish_omp_clauses.
1858 (c_parser_omp_all_clauses): Likewise.
1859 (c_parser_oacc_cache): Likewise.
1860 (c_parser_oacc_loop): Likewise.
1861 (omp_split_clauses): Likewise.
1862 (c_parser_omp_declare_target): Likewise.
1863 (c_parser_cilk_all_clauses): Likewise.
1864 (c_parser_cilk_for): Likewise.
1865 * c-typeck.c (c_finish_omp_clauses): Replace bool arguments
1866 is_omp, declare_simd, and is_cilk with enum c_omp_region_type ort.
1867
dd185f6e 18682016-05-02 Marek Polacek <polacek@redhat.com>
1869
1870 PR c/70851
1871 * c-decl.c (grokdeclarator): Diagnose when array's size has an
1872 incomplete type.
1873
4d0a8bac 18742016-04-29 Cesar Philippidis <cesar@codesourcery.com>
1875
1876 PR middle-end/70626
1877 * c-parser.c (c_parser_oacc_loop): Don't augment mask with
1878 OACC_LOOP_CLAUSE_MASK.
1879 (c_parser_oacc_kernels_parallel): Update call to
1880 c_oacc_split_loop_clauses.
1881
d215eeca 18822016-04-28 Andrew MacLeod <amacleod@redhat.com>
1883
1884 * c-array-notation.c (fix_builtin_array_notation_fn): Fix final
1885 argument to build_modify_expr in two cases.
1886
40385231 18872016-04-27 Bernd Schmidt <bschmidt@redhat.com>
1888
1889 * c-parser.c (c_parser_postfix_expression_after_primary): Call
1890 warn_for_memset instead of warning directly here.
1891
fa20ebd3 18922016-04-26 Marek Polacek <polacek@redhat.com>
1893
1894 PR c/67784
1895 * c-parser.c (c_parser_maybe_reclassify_token): New function factored
1896 out of ...
1897 (c_parser_for_statement): ... here.
1898 (c_parser_if_statement): Use it.
1899 (c_parser_switch_statement): Use it.
1900 (c_parser_while_statement): Use it.
1901
9db47803 1902 PR c/70791
1903 * c-decl.c (pushdecl): Pass LOCUS down to warning.
1904
70574e60 19052016-04-20 Ilya Verbin <ilya.verbin@intel.com>
1906
1907 PR c++/69363
1908 * c-parser.c (c_parser_cilk_all_clauses): Use c_finish_omp_clauses
1909 instead of c_finish_cilk_clauses.
1910 * c-tree.h (c_finish_omp_clauses): Add new default argument.
1911 * c-typeck.c (c_finish_omp_clauses): Add new argument. Allow
1912 floating-point variables in the linear clause for Cilk Plus.
1913
5d4b30ea 19142016-04-18 Michael Matz <matz@suse.de>
1915
1916 * c-decl.c (merge_decls): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
1917 (grokdeclarator, parser_xref_tag, finish_enum): Use SET_TYPE_ALIGN.
1918
eac243e7 19192016-04-15 Marek Polacek <polacek@redhat.com>
1920
1921 PR c/70671
1922 * c-typeck.c (build_unary_op): Pass location down to error and
1923 warning call.
1924
b4ba8358 19252016-04-15 Jakub Jelinek <jakub@redhat.com>
1926
1927 PR c/70436
1928 * c-parser.c (c_parser_pragma): Add IF_P argument, pass it down
1929 where needed.
1930 (c_parser_external_declaration, c_parser_struct_or_union_specifier,
1931 c_parser_parameter_declaration, c_parser_compound_statement_nostart,
1932 c_parser_objc_class_instance_variables, c_parser_objc_methodprotolist):
1933 Adjust c_parser_pragma callers.
1934 (c_parser_statement_after_labels): Likewise. Adjust c_parser_cilk_for
1935 caller.
1936 (c_parser_omp_structured_block): Add IF_P argument, pass it down to
1937 c_parser_statement.
1938 (c_parser_oacc_data, c_parser_oacc_host_data, c_parser_oacc_loop,
1939 c_parser_oacc_kernels_parallel, c_parser_omp_critical,
1940 c_parser_omp_simd, c_parser_omp_for, c_parser_omp_master,
1941 c_parser_omp_ordered, c_parser_omp_parallel, c_parser_omp_single,
1942 c_parser_omp_task, c_parser_omp_taskgroup, c_parser_omp_distribute,
1943 c_parser_omp_teams, c_parser_omp_target_data, c_parser_omp_target,
1944 c_parser_omp_taskloop, c_parser_omp_construct, c_parser_cilk_grainsize,
1945 c_parser_cilk_simd, c_parser_cilk_for): Add IF_P argument, pass it
1946 down where needed.
1947 (c_parser_omp_for_loop): Likewise. Clear IF_P if nbraces.
1948 (c_parser_omp_sections_scope): Adjust c_parser_omp_structured_block
1949 calls.
1950
0241e4dc 19512016-04-13 Marek Polacek <polacek@redhat.com>
1952
1953 PR c/70436
1954 * c-parser.c (c_parser_statement_after_labels): Add IF_P argument and
1955 adjust callers.
1956 (c_parser_statement): Likewise.
1957 (c_parser_c99_block_statement): Likewise.
1958 (c_parser_while_statement): Likewise.
1959 (c_parser_for_statement): Likewise.
1960 (c_parser_if_body): Don't set IF_P here.
1961 (c_parser_if_statement): Add IF_P argument. Set IF_P here. Warn
1962 about dangling else here.
1963 * c-tree.h (c_finish_if_stmt): Adjust declaration.
1964 * c-typeck.c (c_finish_if_stmt): Remove NESTED_IF parameter. Don't
1965 warn about dangling else here.
1966
c4f5465d 19672016-04-04 Marek Polacek <polacek@redhat.com>
1968
1969 PR c/70307
1970 * c-fold.c (c_fully_fold_internal): Handle VEC_COND_EXPR.
1971
7952b661 19722016-03-31 Marek Polacek <polacek@redhat.com>
1973
1974 PR c/70297
1975 * c-decl.c (merge_decls): Also set TYPE_ALIGN and TYPE_USER_ALIGN.
1976
5539bc70 19772016-03-18 David Malcolm <dmalcolm@redhat.com>
1978
1979 PR c/70281
1980 * c-parser.c (c_parser_postfix_expression): Set the source range
1981 for uses of "__builtin_types_compatible_p".
1982
29a514fa 19832016-03-17 Jakub Jelinek <jakub@redhat.com>
1984
1985 PR c/70280
1986 * c-typeck.c (composite_type): Don't count void_list_node
1987 into len, if the list is terminated by void_list_node, start
1988 with void_list_node instead of NULL for newargs. Stop
1989 at void_list_node.
1990
462ca422 19912016-03-16 Marek Polacek <polacek@redhat.com>
1992
1993 PR c/70093
1994 * c-typeck.c (build_function_call_vec): Create a TARGET_EXPR for
1995 nested functions returning VM types.
1996
27dcb7a8 19972016-03-09 Cesar Philippidis <cesar@codesourcery.com>
1998
1999 * c-parser.c (c_parser_oacc_loop): Update cclauses and clauses
2000 when calling c_finish_omp_clauses.
2001
2d1d2e55 20022016-03-04 Bernd Schmidt <bschmidt@redhat.com>
2003
2004 PR c/69824
2005 * c-decl.c (get_parm_info): Don't queue implicit function declarations
2006 for later.
2007
6560d1ad 20082016-03-04 Marek Polacek <polacek@redhat.com>
2009
2010 PR c/69798
2011 * c-parser.c (c_parser_postfix_expression): Call
2012 c_parser_cast_expression rather than c_parser_postfix_expression.
2013
40e9ce2d 20142016-03-01 Jakub Jelinek <jakub@redhat.com>
2015
2016 PR c/69796
2017 PR c/69974
2018 * c-parser.c (c_parser_translation_unit): Don't change TREE_TYPE
2019 of incomplete decls to error_mark_node.
2020
f0ea75d1 20212016-02-24 Marek Polacek <polacek@redhat.com>
2022
2023 PR c/69819
2024 * c-decl.c (finish_decl): Don't update the copy of the type of a
2025 different decl type.
2026
d41ab738 20272016-02-23 Jakub Jelinek <jakub@redhat.com>
2028
2029 PR objc/69844
2030 * c-parser.c (c_parser_for_statement): Properly handle ObjC classes
2031 in id_kind reclassification.
2032
7675e968 20332016-02-16 Jakub Jelinek <jakub@redhat.com>
2034
2035 PR c/69835
2036 * c-typeck.c (build_binary_op): Revert 2015-09-09 change.
2037
28072426 20382016-02-16 James Norris <jnorris@codesourcery.com>
2039
2040 PR c/64748
2041 * c-parser.c (c_parser_oacc_data_clause_deviceptr): Allow parms.
2042
74a4140f 20432016-02-12 Bernd Schmidt <bschmidt@redhat.com>
2044
7c25ed5c 2045 * c-decl.c (build_null_declspecs): Zero the entire struct.
2046
74a4140f 2047 PR c/69522
2048 * c-parser.c (c_parser_braced_init): New arg outer_obstack. All
2049 callers changed. If nested_p is true, use it to call
2050 finish_implicit_inits.
2051 * c-tree.h (finish_implicit_inits): Declare.
2052 * c-typeck.c (finish_implicit_inits): New function. Move code
2053 from ...
2054 (push_init_level): ... here.
2055 (set_designator, process_init_element): Call finish_implicit_inits.
2056
40b38ace 20572016-02-11 Jakub Jelinek <jakub@redhat.com>
2058
2059 PR c/69768
2060 * c-typeck.c (parser_build_binary_op): Strip nops from integer_zerop
2061 arguments for -Waddress warning.
2062
6b098e91 20632016-02-04 Jakub Jelinek <jakub@redhat.com>
2064
2065 PR c/69669
2066 * c-decl.c (finish_enum): When honoring mode attribute,
2067 make sure to use proper TYPE_MIN_VALUE and TYPE_MAX_VALUE.
2068
ff5e28e9 20692016-01-29 Jakub Jelinek <jakub@redhat.com>
2070
2071 PR debug/69518
2072 * c-decl.c (finish_struct): Clear C_TYPE_INCOMPLETE_VARS in
2073 all type variants, not just TYPE_MAIN_VARIANT.
2074
78e516eb 20752016-01-27 Jakub Jelinek <jakub@redhat.com>
2076
2077 PR debug/66869
2078 * c-decl.c (c_write_global_declarations_1): Warn with
2079 warn_unused_function if static prototype without definition
2080 is not C_DECL_USED.
2081
fee5e491 20822016-01-27 Marek Polacek <polacek@redhat.com>
2083
2084 PR c/68062
2085 * c-typeck.c (build_binary_op) [EQ_EXPR, GE_EXPR]: Promote operand
2086 to unsigned, if needed. Add -Wsign-compare warning.
2087
9bbfd060 20882016-01-26 Jakub Jelinek <jakub@redhat.com>
2089
2090 PR tree-optimization/69483
2091 * c-parser.c (c_parser_translation_unit): Use FOR_EACH_VEC_ELT.
2092
6ebc6587 20932016-01-20 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
16d4186f 2094
2095 PR c/24293
2096 * c-tree.h (incomplete_record_decls): Declare.
2097 * c-parser.c (incomplete_record_decls): Define.
2098 (c_parser_translation_unit): Iterate through incomplete_record_decls and
2099 report error if any decl has zero size.
2100 * c-decl.c (finish_decl): Append static decl with incomplete struct/union
2101 or enum type to incomplete_record_decls.
2102
4c39e3a5 21032016-01-14 Tom de Vries <tom@codesourcery.com>
2104
2105 PR tree-optimization/68773
2106 * c-parser.c (c_parser_oacc_declare, c_parser_omp_declare_target): Don't
2107 set force_output.
2108
77f35cec 21092016-01-14 Marek Polacek <polacek@redhat.com>
2110
2111 PR c/69262
2112 * c-decl.c (grokdeclarator): Provide more information for invalid
2113 array declarations.
2114
d74214f3 21152016-01-06 David Malcolm <dmalcolm@redhat.com>
2116
2117 * c-parser.c (c_parser_unary_expression): For dereferences, build
2118 a combined location before calling build_indirect_ref, so that
2119 error reports cover the full range, manually updating the c_expr
2120 src_range.
2121
be3c9981 21222016-01-06 Marek Polacek <polacek@redhat.com>
2123
2124 PR sanitizer/69099
2125 * c-convert.c (convert) [INTEGER_TYPE]: Drop ARG. Don't pass ARG to
2126 ubsan_instrument_float_cast. Fold EXPR. Use NULL_TREE instead of
2127 NULL.
2128
f1717362 21292016-01-04 Jakub Jelinek <jakub@redhat.com>
2130
2131 Update copyright years.
2132
d7d6a3ab 21332016-01-04 Marek Polacek <polacek@redhat.com>
2134
2135 PR c/68908
2136 * c-typeck.c (build_atomic_assign): Improve commentary. Add
2137 optimization to use __atomic_fetch_* built-in if possible.
2138
9d5fd7c6 21392015-12-23 Thomas Schwinge <thomas@codesourcery.com>
2140
2141 * c-parser.c (c_parser_oacc_clause_use_device): Merge function
2142 into...
2143 (c_parser_omp_clause_use_device_ptr): ... this function. Adjust
2144 all users.
2145
37e2d32f 21462015-12-22 Marek Polacek <polacek@redhat.com>
2147
2148 PR c/69002
2149 * c-typeck.c (build_component_ref): Warn when acessing elements of
2150 atomic structures or unions.
2151
c0bf500c 21522015-12-21 David Malcolm <dmalcolm@redhat.com>
2153
2154 * c-typeck.c: Include "gcc-rich-location.h".
2155 (build_binary_op): In the two places that call binary_op_error,
2156 create a gcc_rich_location and populate it with the location of
2157 the binary op and its two operands.
2158
b9f9586a 21592015-12-16 David Malcolm <dmalcolm@redhat.com>
2160
2161 * c-parser.c (c_parser_statement_after_labels): When calling
2162 c_finish_return, Use the return expression's location if it has
2163 one, falling back to the location of the first token within it.
2164 * c-typeck.c (c_finish_return): When issuing warnings about
2165 the incorrect presence/absence of a return value, issue a note
2166 showing the declaration of the function.
2167
dbd79382 21682015-12-16 David Malcolm <dmalcolm@redhat.com>
2169
2170 * c-parser.c (struct c_parser): Expand array "tokens_buf" from 2
2171 to 4.
2172 (c_parser_peek_nth_token): New function.
2173 (c_parser_peek_conflict_marker): New function.
2174 (c_parser_error): Detect conflict markers and report them as such.
2175
e2093e02 21762015-12-16 David Malcolm <dmalcolm@redhat.com>
2177
2178 * c-parser.c (c_parser_postfix_expression): Use EXPR_LOC_OR_LOC
2179 to preserve range information for the primary expression
2180 in the call to c_parser_postfix_expression_after_primary.
2181
b49f1fbb 21822015-12-16 David Malcolm <dmalcolm@redhat.com>
2183
2184 * c-parser.c (c_parser_static_assert_declaration_no_semi): Use the
2185 expression location, falling back on the first token location,
2186 rather than always using the latter.
2187
1d65bac2 21882015-12-16 Marek Polacek <polacek@redhat.com>
2189
2190 PR c/64637
2191 * c-typeck.c (c_process_expr_stmt): Use location of the expression if
2192 available.
2193
75e722a6 21942015-12-15 Marek Polacek <polacek@redhat.com>
2195
2196 PR c/68907
2197 * c-typeck.c (build_atomic_assign): Set TREE_NO_WARNING on an
2198 artificial decl.
2199
7063d45b 22002015-12-08 David Malcolm <dmalcolm@redhat.com>
2201
2202 * c-parser.c (c_parser_alignof_expression): Capture location of
2203 closing parenthesis (if any), or of end of unary expression, and
2204 use it to build a src_range for the expression.
2205
f73b4782 22062015-12-08 David Malcolm <dmalcolm@redhat.com>
2207
2208 PR c/68757
2209 * c-parser.c (c_parser_get_builtin_args): Add
2210 "out_close_paren_loc" param, and write back to it.
2211 (c_parser_postfix_expression): Capture the closing
2212 parenthesis location for RID_CHOOSE_EXPR,
2213 RID_BUILTIN_CALL_WITH_STATIC_CHAIN, RID_BUILTIN_COMPLEX,
2214 RID_BUILTIN_SHUFFLE and use it to set the source range
2215 for such expressions; within RID_BUILTIN_COMPLEX set
2216 the underlying location.
2217
1b062945 22182015-12-07 Marek Polacek <polacek@redhat.com>
2219
2220 PR c/68668
2221 * c-decl.c (grokdeclarator): If ORIG_QUAL_INDIRECT is indirect, use
2222 TREE_TYPE of ORIG_QUAL_TYPE, otherwise decrement ORIG_QUAL_INDIRECT.
2223
a4ab54ac 22242015-12-04 Eric Botcazou <ebotcazou@adacore.com>
2225
2226 * c-tree.h (c_build_va_arg): Adjust prototype.
2227 * c-parser.c (c_parser_postfix_expression): Adjust call to above.
2228 * c-typeck.c (c_build_va_arg): Rename LOC parameter to LOC2, add LOC1
2229 parameter, adjust throughout and issue an error if EXPR is a component
2230 with reverse storage order.
2231
da562e32 22322015-12-02 Jason Merrill <jason@redhat.com>
2233
2234 * c-fold.c (c_disable_warnings, c_enable_warnings, c_fully_fold)
2235 (c_fully_fold_internal, decl_constant_value_for_optimization):
2236 Move from c-common.c.
2237 * c-tree.h: Declare decl_constant_value_for_optimization.
2238 * Make-lang.in (C_AND_OBJC_OBJS): Add c-fold.o.
2239
89f16034 22402015-12-02 Joseph Myers <joseph@codesourcery.com>
2241
2242 PR c/68162
2243 * c-decl.c (grokdeclarator): Set first_non_attr_kind before
2244 following link from declarator to next declarator. Track original
2245 qualified type and pass it to c_build_qualified_type.
2246 * c-typeck.c (c_build_qualified_type): Add arguments
2247 orig_qual_type and orig_qual_indirect.
2248
2a7545d5 22492015-12-02 Thomas Schwinge <thomas@codesourcery.com>
2250
2251 * c-parser.c (c_parser_omp_clause_name)
2252 (c_parser_oacc_all_clauses): Alphabetical sorting.
2253
ad80582d 22542015-12-02 Jakub Jelinek <jakub@redhat.com>
2255
2256 PR c/68533
2257 * c-decl.c (get_parm_info): Use b->locus instead of input_location
2258 for diagnostics.
2259
571b3486 22602015-12-01 Julian Brown <julian@codesourcery.com>
2261 Cesar Philippidis <cesar@codesourcery.com>
2262 James Norris <James_Norris@mentor.com>
2263
2264 * c-parser.c (c_parser_omp_clause_name): Add use_device support.
2265 (c_parser_oacc_clause_use_device): New function.
2266 (c_parser_oacc_all_clauses): Add use_device support.
2267 (OACC_HOST_DATA_CLAUSE_MASK): New macro.
2268 (c_parser_oacc_host_data): New function.
2269 (c_parser_omp_construct): Add host_data support.
2270 * c-tree.h (c_finish_oacc_host_data): Add prototype.
2271 * c-typeck.c (c_finish_oacc_host_data): New function.
2272 (c_finish_omp_clauses): Add use_device support.
2273
c4848393 22742015-11-29 Jan Hubicka <hubicka@ucw.cz>
2275
2276 PR c/67106
2277 * c-decl.c: Set TYPE_PACKED in variants.
2278
d4e328e9 22792015-11-27 Martin Liska <mliska@suse.cz>
2280
2281 PR c++/68312
2282 * c-array-notation.c (fix_builtin_array_notation_fn):
2283 Use release_vec_vec instead of vec::release.
2284 (build_array_notation_expr): Likewise.
2285 (fix_conditional_array_notations_1): Likewise.
2286 (fix_array_notation_expr): Likewise.
2287 (fix_array_notation_call_expr): Likewise.
2288
c5e4f591 22892015-11-27 Jakub Jelinek <jakub@redhat.com>
2290
2291 PR c/63326
2292 * c-parser.c (c_parser_compound_statement_nostart): If
2293 last_label is true, use pragma_stmt instead of pragma_compound
2294 as second c_parser_pragma argument.
2295 (c_parser_omp_ordered, c_parser_omp_target_update,
2296 c_parser_omp_target_enter_data, c_parser_omp_target_exit_data): Pass
2297 false as second argument to c_parser_skip_to_pragma_eol after
2298 diagnosing standalone directives used in pragma_stmt context.
2299
c954a5bd 23002015-11-24 Ilya Verbin <ilya.verbin@intel.com>
2301
2302 * c-parser.c (c_parser_oacc_declare): Replace "ifdef ENABLE_OFFLOADING"
2303 with "if (ENABLE_OFFLOADING)".
2304
daebf4f3 23052015-11-23 David Malcolm <dmalcolm@redhat.com>
2306
2307 PR objc/68438
2308 * c-parser.c (c_parser_postfix_expression): Set up source ranges
2309 for various Objective-C constructs: Class.name syntax,
2310 @selector(), @protocol(), @encode(), and [] message syntax.
2311
734caf84 23122015-11-20 David Malcolm <dmalcolm@redhat.com>
2313
2314 PR 62314
2315 * c-typeck.c (should_suggest_deref_p): New function.
2316 (build_component_ref): Special-case POINTER_TYPE when
2317 generating a "not a structure of union" error message, and
2318 suggest a "->" rather than a ".", providing a fix-it hint.
2319
11d8dd6f 23202015-11-19 David Malcolm <dmalcolm@redhat.com>
2321
2322 * c-typeck.c (lookup_field_fuzzy): Move determination of closest
2323 candidate into a new function, find_closest_identifier.
2324
62efaf6b 23252015-11-19 Marek Polacek <polacek@redhat.com>
2326
2327 PR c/68412
2328 * c-typeck.c (parser_build_binary_op): Properly handle
2329 C_MAYBE_CONST_EXPR before calling warn_tautological_cmp.
2330
9dfffd6d 23312015-11-17 David Malcolm <dmalcolm@redhat.com>
2332
2333 * c-parser.c (set_c_expr_source_range): Bulletproof both
2334 overloaded implementations against NULL expr->value.
2335 (c_parser_braced_init): Set src_range for "ret" to a sane pair of
2336 values.
2337 (c_parser_unary_expression): Likewise when handling addresses of
2338 labels.
2339 (c_parser_postfix_expression): Likewise for statement expressions,
2340 for __FUNCTION__, __PRETTY_FUNCTION_ and __func__ keywords, for
2341 __builtin_va_arg, and for __builtin_offset_of.
2342 (c_parser_postfix_expression_after_paren_type): Initialize expr's
2343 src_range using the range of the braced initializer.
2344 (c_parser_transaction_expression): Set src_range for "ret" to a
2345 sane pair of values.
2346
c58a4cfd 23472015-11-16 Kirill Yukhin <kirill.yukhin@intel.com>
2348
2349 * c-parser.c (c_finish_omp_declare_simd): Look for
2350 "simd" attribute as well. Update error message.
2351
5f3001a9 23522015-11-14 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
2353
2354 * c-parser.c (c_parser_omp_declare_target): Adjust.
2355
a9833286 23562015-11-14 Jakub Jelinek <jakub@redhat.com>
2357
2358 * c-typeck.c (c_finish_omp_clauses): Don't mark
2359 GOMP_MAP_FIRSTPRIVATE_POINTER decls addressable.
2360
ef61516b 23612015-11-14 Marek Polacek <polacek@redhat.com>
2362
2363 * c-decl.c: Use RECORD_OR_UNION_TYPE_P throughout.
2364 * c-typeck.c: Likewise.
2365
a96cefb2 23662015-11-13 David Malcolm <dmalcolm@redhat.com>
2367
2368 * c-decl.c (warn_defaults_to): Pass line_table to
2369 rich_location ctor.
2370 * c-errors.c (pedwarn_c99): Likewise.
2371 (pedwarn_c90): Likewise.
2372 * c-parser.c (set_c_expr_source_range): New functions.
2373 (c_token::get_range): New method.
2374 (c_token::get_finish): New method.
2375 (c_parser_expr_no_commas): Call set_c_expr_source_range on the ret
2376 based on the range from the start of the LHS to the end of the
2377 RHS.
2378 (c_parser_conditional_expression): Likewise, based on the range
2379 from the start of the cond.value to the end of exp2.value.
2380 (c_parser_binary_expression): Call set_c_expr_source_range on
2381 the stack values for TRUTH_ANDIF_EXPR and TRUTH_ORIF_EXPR.
2382 (c_parser_cast_expression): Call set_c_expr_source_range on ret
2383 based on the cast_loc through to the end of the expr.
2384 (c_parser_unary_expression): Likewise, based on the
2385 op_loc through to the end of op.
2386 (c_parser_sizeof_expression) Likewise, based on the start of the
2387 sizeof token through to either the closing paren or the end of
2388 expr.
2389 (c_parser_postfix_expression): Likewise, using the token range,
2390 or from the open paren through to the close paren for
2391 parenthesized expressions.
2392 (c_parser_postfix_expression_after_primary): Likewise, for
2393 various kinds of expression.
2394 * c-tree.h (struct c_expr): Add field "src_range".
2395 (c_expr::get_start): New method.
2396 (c_expr::get_finish): New method.
2397 (set_c_expr_source_range): New decls.
2398 * c-typeck.c (parser_build_unary_op): Call set_c_expr_source_range
2399 on ret for prefix unary ops.
2400 (parser_build_binary_op): Likewise, running from the start of
2401 arg1.value through to the end of arg2.value.
2402
7a810b2f 24032015-11-13 Marek Polacek <polacek@redhat.com>
2404
2405 PR c/68320
2406 * c-parser.c (c_parser_for_statement): Treat unknown tokens as IDs.
2407
b67f0560 24082015-11-13 David Malcolm <dmalcolm@redhat.com>
2409
2410 * c-typeck.c: Include spellcheck.h.
2411 (lookup_field_fuzzy_find_candidates): New function.
2412 (lookup_field_fuzzy): New function.
2413 (build_component_ref): If the field was not found, try using
2414 lookup_field_fuzzy and potentially offer a suggestion.
2415
2fc5e987 24162015-11-12 James Norris <jnorris@codesourcery.com>
2417 Joseph Myers <joseph@codesourcery.com>
2418
2419 * c-parser.c (c_parser_pragma): Handle PRAGMA_OACC_DECLARE.
2420 (c_parser_omp_clause_name): Handle 'device_resident' clause.
2421 (c_parser_oacc_data_clause): Handle PRAGMA_OACC_CLAUSE_DEVICE_RESIDENT
2422 and PRAGMA_OMP_CLAUSE_LINK.
2423 (c_parser_oacc_all_clauses): Handle PRAGMA_OACC_CLAUSE_DEVICE_RESIDENT
2424 and PRAGMA_OACC_CLAUSE_LINK.
2425 (OACC_DECLARE_CLAUSE_MASK): New definition.
2426 (c_parser_oacc_declare): New function.
2427
28a70e29 24282015-11-12 Marek Polacek <polacek@redhat.com>
2429
2430 PR c/67784
2431 * c-parser.c (c_parser_for_statement): Reclassify the token in
2432 a correct scope.
2433
81b1b2a8 24342015-11-11 Marek Polacek <polacek@redhat.com>
2435
2436 PR c/68107
2437 PR c++/68266
2438 * c-decl.c (grokdeclarator): Call valid_array_size_p. Remove code
2439 checking the size of an array.
2440
6e803544 24412015-11-11 Andrew MacLeod <amacleod@redhat.com>
2442
2443 * c-array-notation.c: Remove unused header files.
2444 * c-aux-info.c: Likewise.
2445 * c-convert.c: Likewise.
2446 * c-decl.c: Likewise.
2447 * c-errors.c: Likewise.
2448 * c-lang.c: Likewise.
2449 * c-objc-common.c: Likewise.
2450 * c-parser.c: Likewise.
2451 * c-typeck.c: Likewise.
2452 * gccspec.c: Likewise.
2453
a1b7fe4b 24542015-11-09 Thomas Schwinge <thomas@codesourcery.com>
2455 Cesar Philippidis <cesar@codesourcery.com>
2456 James Norris <jnorris@codesourcery.com>
2457 Julian Brown <julian@codesourcery.com>
2458 Nathan Sidwell <nathan@codesourcery.com>
2459
2460 c/
2461 * c-parser.c (c_parser_declaration_or_fndef): Add OpenACC
2462 routine arg.
2463 (c_parser_declaration_or_fndef): Call c_finish_oacc_routine.
2464 (c_parser_pragma): Parse 'acc routine'.
2465 (OACC_ROUTINE_CLAUSE_MARK): Define.
2466 (c_parser_oacc_routine, (c_finish_oacc_routine): New.
2467
7758d608 24682015-11-09 Andreas Arnez <arnez@linux.vnet.ibm.com>
2469
2470 PR debug/67192
2471 * c-typeck.c (c_finish_loop): For unconditional loops, set the
2472 location of the backward-goto to the start of the loop body.
2473
c2bf2fb2 24742015-11-09 Andreas Arnez <arnez@linux.vnet.ibm.com>
2475
2476 PR debug/67192
2477 * c-parser.c (c_parser_while_statement): Finish the loop before
2478 parsing ahead for misleading indentation.
2479 (c_parser_for_statement): Likewise.
2480
292237f3 24812015-11-08 Eric Botcazou <ebotcazou@adacore.com>
2482
2483 * c-decl.c (finish_struct): If the structure has reverse storage
2484 order, rewrite the type of array fields with scalar component. Call
2485 maybe_apply_pragma_scalar_storage_order on entry.
2486 * c-typeck.c (build_unary_op) <ADDR_EXPR>: Remove left-overs. Issue
2487 errors on bit-fields and reverse SSO here and not...
2488 (c_mark_addressable): ...here.
2489 (output_init_element): Adjust call to initializer_constant_valid_p.
2490 (c_build_qualified_type): Propagate TYPE_REVERSE_STORAGE_ORDER.
2491
f0479000 24922015-11-06 David Malcolm <dmalcolm@redhat.com>
2493
2494 * c-decl.c (warn_defaults_to): Update for change in signature
2495 of diagnostic_set_info.
2496 * c-errors.c (pedwarn_c99): Likewise.
2497 (pedwarn_c90): Likewise.
2498 * c-objc-common.c (c_tree_printer): Update for new "caret_p" param
2499 for textinfo::set_location.
2500
ef014f95 25012015-11-05 Cesar Philippidis <cesar@codesourcery.com>
2502 Thomas Schwinge <thomas@codesourcery.com>
2503 James Norris <jnorris@codesourcery.com>
2504
2505 * c-parser.c (c_parser_omp_clause_name): Add support for
2506 PRAGMA_OACC_CLAUSE_INDEPENDENT and PRAGMA_OACC_CLAUSE_TILE.
2507 (c_parser_omp_clause_default): Add is_oacc argument. Handle
2508 default(none) in OpenACC.
2509 (c_parser_oacc_shape_clause): Allow pointer variables as gang static
2510 arguments.
2511 (c_parser_oacc_clause_tile): New function.
2512 (c_parser_oacc_all_clauses): Add support for OMP_CLAUSE_DEFAULT,
2513 OMP_CLAUSE_INDEPENDENT and OMP_CLAUSE_TILE.
2514 (OACC_LOOP_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_{PRIVATE,INDEPENDENT,
2515 TILE}.
2516 (OACC_KERNELS_MASK): Add PRAGMA_OACC_CLAUSE_DEFAULT.
2517 (OACC_PARALLEL_MASK): Add PRAGMA_OACC_CLAUSE_{DEFAULT,PRIVATE,
2518 FIRSTPRIVATE}.
2519 (c_parser_omp_all_clauses): Update call to c_parser_omp_clause_default.
2520 (c_parser_oacc_update): Update the error message for missing clauses.
2521 * c-typeck.c (c_finish_omp_clauses): Add support for OMP_CLAUSE_TILE
2522 and OMP_CLAUSE_INDEPENDENT.
2523
f480ca9a 25242015-11-05 Marek Polacek <polacek@redhat.com>
2525
2526 PR c/68090
2527 * c-parser.c (c_parser_postfix_expression_after_paren_type): Don't
2528 deal with pre-evaluation on invalid types.
2529
9561765e 25302015-11-05 Jakub Jelinek <jakub@redhat.com>
2531 Ilya Verbin <ilya.verbin@intel.com>
2532
2533 * c-parser.c: Include context.h and gimple-expr.h.
2534 (c_parser_omp_clause_schedule): Parse schedule modifiers, diagnose
2535 monotonic together with nonmonotonic.
2536 (c_parser_omp_for_loop): Call c_omp_check_loop_iv. Call add_stmt here.
2537 (OMP_DISTRIBUTE_CLAUSE_MASK): Add lastprivate clause.
2538 (c_parser_omp_target_data, c_parser_omp_target_enter_data,
2539 c_parser_omp_target_exit_data): Allow GOMP_MAP_ALWAYS_POINTER.
2540 (c_parser_omp_target): Likewise. Evaluate num_teams and thread_limit
2541 expressions on combined target teams before the target.
2542 (c_parser_omp_declare_target): If decl has "omp declare target" or
2543 "omp declare target link" attribute, and cgraph or varpool node already
2544 exists, then set corresponding flags. Call c_finish_omp_clauses
2545 in the parenthesized extended-list syntax case.
2546 * c-decl.c (c_decl_attributes): Don't diagnose block scope vars inside
2547 declare target.
2548 * c-typeck.c (handle_omp_array_sections_1): Allow non-zero low-bound
2549 on OMP_CLAUSE_REDUCTION array sections.
2550 (handle_omp_array_sections): Encode low-bound into the MEM_REF, either
2551 into the constant offset, or for variable low-bound using
2552 POINTER_PLUS_EXPR. For structure element based array sections use
2553 GOMP_MAP_ALWAYS_POINTER instead of GOMP_MAP_FIRSTPRIVATE_POINTER.
2554 (c_finish_omp_clauses): Drop generic_field_head, structure
2555 elements are now always mapped even as array section bases,
2556 diagnose same var in data sharing and mapping clauses. Diagnose if
2557 linear step on declare simd is neither a constant nor a uniform
2558 parameter. Look through POINTER_PLUS_EXPR for array section
2559 reductions. Diagnose the same var or function appearing multiple
2560 times on the same directive. Fix up wording for the to clause if t
2561 is neither a FUNCTION_DECL nor a VAR_DECL. Diagnose nonmonotonic
2562 modifier on kinds other than dynamic or guided or nonmonotonic
2563 modifier together with ordered clause.
2564
9e10bfb7 25652015-11-03 Thomas Schwinge <thomas@codesourcery.com>
2566 Chung-Lin Tang <cltang@codesourcery.com>
2567
2568 * c-parser.c (c_parser_omp_construct): Handle PRAGMA_OACC_ATOMIC.
2569
4cba6f60 25702015-10-29 Andrew MacLeod <amacleod@redhat.com>
2571
2572 * c-array-notation.c: Reorder #include's and remove duplicates.
2573 * c-aux-info.c: Likewise.
2574 * c-convert.c: Likewise.
2575 * c-decl.c: Likewise.
2576 * c-errors.c: Likewise.
2577 * c-lang.c: Likewise.
2578 * c-objc-common.c: Likewise.
2579 * c-parser.c: Likewise.
2580 * c-typeck.c: Likewise.
2581
7b15d957 25822015-10-26 Jim Wilson <jim.wilson@linaro.org>
2583
2584 PR debug/66068
2585 * c-typeck.c (c_build_qualified_type): Clear C_TYPE_INCOMPLETE_VARS
2586 after calling build_qualified_type.
2587
62c48328 25882015-10-27 Cesar Philippidis <cesar@codesourcery.com>
2589 Thomas Schwinge <thomas@codesourcery.com>
2590 James Norris <jnorris@codesourcery.com>
2591 Joseph Myers <joseph@codesourcery.com>
2592 Julian Brown <julian@codesourcery.com>
2593 Bernd Schmidt <bschmidt@redhat.com>
2594
2595 * c-parser.c (c_parser_oacc_shape_clause): New.
2596 (c_parser_oacc_simple_clause): New.
2597 (c_parser_oacc_all_clauses): Add auto, gang, seq, vector, worker.
2598 (OACC_LOOP_CLAUSE_MASK): Add gang, worker, vector, auto, seq.
2599
2c4c8725 26002015-10-27 Thomas Schwinge <thomas@codesourcery.com>
2601 James Norris <jnorris@codesourcery.com>
2602 Cesar Philippidis <cesar@codesourcery.com>
2603
2604 PR c/64765
2605 PR c/64880
2606 * c-parser.c (c_parser_oacc_loop): Add mask, cclauses formal
2607 parameters, and handle these. Adjust all users.
2608 (c_parser_oacc_kernels, c_parser_oacc_parallel): Merge functions
2609 into...
2610 (c_parser_oacc_kernels_parallel): ... this new function. Adjust
2611 all users.
2612 * c-tree.h (c_finish_oacc_parallel, c_finish_oacc_kernels): Don't
2613 declare functions.
2614 (c_finish_omp_construct): Declare function.
2615 * c-typeck.c (c_finish_oacc_parallel, c_finish_oacc_kernels):
2616 Merge functions into...
2617 (c_finish_omp_construct): ... this new function.
2618
844cece0 26192015-10-22 Richard Biener <rguenther@suse.de>
2620
2621 * c-typeck.c (c_finish_omp_clauses): Properly convert operands
2622 before folding a MINUS_EXPR.
2623
5ce1b137 26242015-10-21 Marek Polacek <polacek@redhat.com>
2625
2626 PR c/68024
2627 * c-decl.c (start_function): Warn about vararg functions without
2628 a prototype.
2629
1f137e6d 26302015-10-21 Ilya Enkovich <enkovich.gnu@gmail.com>
2631
2632 * c-typeck.c (build_conditional_expr): Use boolean vector
2633 type for vector comparison.
2634 (build_vec_cmp): New.
2635 (build_binary_op): Use build_vec_cmp for comparison.
2636
8523243e 26372015-10-20 Marek Polacek <polacek@redhat.com>
2638
2639 * c-parser.c (is_cilkplus_vector_p): Don't define here.
2640
3f73be3e 26412015-10-20 Marek Polacek <polacek@redhat.com>
2642
2643 PR c/67964
2644 * c-parser.c (c_parser_attributes): Break out of the loop if the
2645 token after an attribute isn't a comma.
2646
43895be5 26472015-10-13 Jakub Jelinek <jakub@redhat.com>
2648 Aldy Hernandez <aldyh@redhat.com>
2649
2650 * c-parser.c (c_parser_pragma): Handle PRAGMA_OMP_ORDERED here.
2651 (c_parser_omp_clause_name): Handle OpenMP 4.5 clauses.
2652 (c_parser_omp_variable_list): Handle structure elements for
2653 map, to and from clauses. Handle array sections in reduction
2654 clause. Formatting fixes.
2655 (c_parser_omp_clause_if): Add IS_OMP argument, handle parsing of
2656 if clause modifiers.
2657 (c_parser_omp_clause_num_tasks, c_parser_omp_clause_grainsize,
2658 c_parser_omp_clause_priority, c_parser_omp_clause_hint,
2659 c_parser_omp_clause_defaultmap, c_parser_omp_clause_use_device_ptr,
2660 c_parser_omp_clause_is_device_ptr): New functions.
2661 (c_parser_omp_clause_ordered): Parse optional parameter.
2662 (c_parser_omp_clause_reduction): Handle array reductions.
2663 (c_parser_omp_clause_schedule): Parse optional simd modifier.
2664 (c_parser_omp_clause_nogroup, c_parser_omp_clause_orderedkind): New
2665 functions.
2666 (c_parser_omp_clause_linear): Parse linear clause modifiers.
2667 (c_parser_omp_clause_depend_sink): New function.
2668 (c_parser_omp_clause_depend): Parse source/sink depend kinds.
2669 (c_parser_omp_clause_map): Parse release/delete map kinds and
2670 optional always modifier.
2671 (c_parser_oacc_all_clauses): Adjust c_parser_omp_clause_if
2672 and c_finish_omp_clauses callers.
2673 (c_parser_omp_all_clauses): Likewise. Parse OpenMP 4.5 clauses.
2674 Parse "to" as OMP_CLAUSE_TO_DECLARE if on declare target directive.
2675 (c_parser_oacc_cache): Adjust c_finish_omp_clauses caller.
2676 (OMP_CRITICAL_CLAUSE_MASK): Define.
2677 (c_parser_omp_critical): Parse critical clauses.
2678 (c_parser_omp_for_loop): Handle doacross loops, adjust
2679 c_finish_omp_for and c_finish_omp_clauses callers.
2680 (OMP_SIMD_CLAUSE_MASK): Add simdlen clause.
2681 (c_parser_omp_simd): Allow ordered clause if it has no parameter.
2682 (OMP_FOR_CLAUSE_MASK): Add linear clause.
2683 (c_parser_omp_for): Disallow ordered clause when combined with
2684 distribute. Disallow linear clause when combined with distribute
2685 and not combined with simd.
2686 (OMP_ORDERED_CLAUSE_MASK, OMP_ORDERED_DEPEND_CLAUSE_MASK): Define.
2687 (c_parser_omp_ordered): Add CONTEXT argument, remove LOC argument,
2688 parse clauses and if depend clause is found, don't parse a body.
2689 (c_parser_omp_parallel): Disallow copyin clause on target parallel.
2690 Allow target parallel without for after it.
2691 (OMP_TASK_CLAUSE_MASK): Add priority clause.
2692 (OMP_TARGET_DATA_CLAUSE_MASK): Add use_device_ptr clause.
2693 (c_parser_omp_target_data): Diagnose no map clauses or clauses with
2694 invalid kinds.
2695 (OMP_TARGET_UPDATE_CLAUSE_MASK): Add depend and nowait clauses.
2696 (OMP_TARGET_ENTER_DATA_CLAUSE_MASK,
2697 OMP_TARGET_EXIT_DATA_CLAUSE_MASK): Define.
2698 (c_parser_omp_target_enter_data, c_parser_omp_target_exit_data): New
2699 functions.
2700 (OMP_TARGET_CLAUSE_MASK): Add depend, nowait, private, firstprivate,
2701 defaultmap and is_device_ptr clauses.
2702 (c_parser_omp_target): Parse target parallel and target simd. Set
2703 OMP_TARGET_COMBINED on combined constructs. Parse target enter data
2704 and target exit data. Diagnose invalid map kinds.
2705 (OMP_DECLARE_TARGET_CLAUSE_MASK): Define.
2706 (c_parser_omp_declare_target): Parse OpenMP 4.5 forms of this
2707 construct.
2708 (c_parser_omp_declare_reduction): Use STRIP_NOPS when checking for
2709 &omp_priv.
2710 (OMP_TASKLOOP_CLAUSE_MASK): Define.
2711 (c_parser_omp_taskloop): New function.
2712 (c_parser_omp_construct): Don't handle PRAGMA_OMP_ORDERED here,
2713 handle PRAGMA_OMP_TASKLOOP.
2714 (c_parser_cilk_for): Adjust c_finish_omp_clauses callers.
2715 * c-tree.h (c_finish_omp_clauses): Add two new arguments.
2716 * c-typeck.c (handle_omp_array_sections_1): Fix comment typo.
2717 Add IS_OMP argument, handle structure element bases, diagnose
2718 bitfields, pass IS_OMP recursively, diagnose known zero length
2719 array sections in depend clauses, handle array sections in reduction
2720 clause, diagnose negative length even for pointers.
2721 (handle_omp_array_sections): Add IS_OMP argument, use auto_vec for
2722 types, pass IS_OMP down to handle_omp_array_sections_1, handle
2723 array sections in reduction clause, set
2724 OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION if map could be zero
2725 length array section, use GOMP_MAP_FIRSTPRIVATE_POINTER for IS_OMP.
2726 (c_finish_omp_clauses): Add IS_OMP and DECLARE_SIMD arguments.
2727 Handle new OpenMP 4.5 clauses and new restrictions for the old ones.
2728
789fbb51 27292015-10-06 Marek Polacek <polacek@redhat.com>
2730
2731 * c-parser.c (c_parser_statement_after_labels): Use
2732 protected_set_expr_location.
2733 (c_parser_omp_clause_num_gangs): Likewise.
2734 (c_parser_omp_clause_num_threads): Likewise.
2735 (c_parser_omp_clause_num_workers): Likewise.
2736 (c_parser_omp_clause_vector_length): Likewise.
2737 (c_parser_omp_clause_num_teams): Likewise.
2738 (c_parser_omp_clause_thread_limit): Likewise.
2739 * c-typeck.c (build_c_cast): Likewise.
2740 (c_cast_expr): Likewise.
2741
20cb53c9 27422015-10-05 Richard Sandiford <richard.sandiford@arm.com>
2743
2744 * c-typeck.c (c_tree_equal): Use real_equal instead of
2745 REAL_VALUES_EQUAL.
2746
6d02e6b2 27472015-10-04 Jason Merrill <jason@redhat.com>
2748
2749 * c-parser.c (c_lex_one_token): Handle @synchronized.
2750 * c-decl.c (match_builtin_function_types): A declaration of a built-in
2751 can change whether the function is transaction_safe.
2752
802c32cd 27532015-10-02 Marek Polacek <polacek@redhat.com>
2754
2755 PR c/67730
2756 * c-typeck.c (convert_for_assignment): Use the expansion point
2757 location throughout.
2758
ef17a71a 27592015-10-02 Marek Polacek <polacek@redhat.com>
2760
2761 PR c/64249
2762 * c-parser.c (c_parser_statement_after_labels): Add CHAIN parameter
2763 and pass it down to c_parser_if_statement.
2764 (c_parser_else_body): Add CHAIN parameter and pass it down to
2765 c_parser_statement_after_labels.
2766 (c_parser_if_statement): Add CHAIN parameter. Add code to warn about
2767 duplicated if-else-if conditions.
2768
7e93eb1a 27692015-10-01 Marek Polacek <polacek@redhat.com>
2770
2771 * c-typeck.c (convert_for_assignment): Improve commentary.
2772
ab4c803c 27732015-09-30 Marek Polacek <polacek@redhat.com>
2774
2775 PR c/67730
2776 * c-typeck.c (c_finish_return): Use the expansion point location for
2777 certain "return with value" warnings.
2778
ed536208 27792015-09-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
2780
2781 * c-parser.c (pragma_lex): Add loc argument.
2782
03e8b174 27832015-09-15 Marek Polacek <polacek@redhat.com>
2784
2785 PR c/67580
2786 * c-decl.c (tag_exists_p): New function.
2787 * c-parser.c (c_parser_declaration_or_fndef): Give a hint when
2788 struct/union/enum keywords are missing.
2789 * c-tree.h (tag_exists_p): Declare.
2790
a39b4dc0 27912015-09-15 Marek Polacek <polacek@redhat.com>
2792
2793 * c-decl.c (lookup_label): Return NULL_TREE instead of 0.
2794 (lookup_tag): Change the type of THISLEVEL_ONLY to bool.
2795 Return NULL_TREE instead of 0.
2796 (lookup_name): Return NULL_TREE instead of 0.
2797 (lookup_name_in_scope): Likewise.
2798 (shadow_tag_warned): Use true instead of 1 and NULL_TREE instead of 0.
2799 (parser_xref_tag): Use false instead of 0.
2800 (start_struct): Use true instead of 1.
2801 (start_enum): Use true instead of 1 and NULL_TREE instead of 0.
2802
85f5e2ee 28032015-09-14 Marek Polacek <polacek@redhat.com>
2804
2805 * c-typeck.c (set_nonincremental_init_from_string): Use
2806 HOST_WIDE_INT_M1U when shifting a negative value.
2807
739237d5 28082015-09-09 Mark Wielaard <mjw@redhat.com>
2809
2810 * c-typeck.c (build_binary_op): Check and warn when nonnull arg
2811 parm against NULL.
2812
d2b2788c 28132015-09-10 Jakub Jelinek <jakub@redhat.com>
2814
2815 PR c/67502
2816 * c-parser.c (c_parser_omp_for_loop): Emit DECL_EXPR stmts
2817 into OMP_FOR_PRE_BODY rather than before the loop.
2818
deef87db 28192015-09-09 Jakub Jelinek <jakub@redhat.com>
2820
c43f93d7 2821 PR c/67501
2822 * c-parser.c (c_parser_oacc_all_clauses,
2823 c_parser_omp_all_clauses): Remove invalid clause from
2824 list of clauses even if parser->error is set.
2825
0fdcfb93 2826 PR c/67500
2827 * c-parser.c (c_parser_omp_clause_aligned,
2828 c_parser_omp_clause_safelen, c_parser_omp_clause_simdlen): Fix up
2829 test for errors.
2830 * c-decl.c (temp_pop_parm_decls): Allow b->decl equal to
2831 error_mark_node.
2832
deef87db 2833 PR c/67495
2834 * c-parser.c (c_parser_omp_atomic): Use c_parser_cast_expression
2835 instead of c_parser_unary_expression. If the result is !lvalue_p,
2836 wrap the result of c_fully_fold into NON_LVALUE_EXPR.
2837
e96292e9 28382015-09-04 Marek Polacek <polacek@redhat.com>
2839
2840 PR sanitizer/67279
2841 * c-typeck.c (build_binary_op): Don't instrument static initializers.
2842
547c6b1f 28432015-09-03 Martin Sebor <msebor@redhat.com>
2844
2845 PR c/66516
6ccd7236 2846 * c-typeck.c (convert_arguments, parser_build_unary_op,
2847 build_conditional_expr, c_cast_expr, convert_for_assignment,
2848 build_binary_op, _objc_common_truthvalue_conversion): Call
547c6b1f 2849 reject_gcc_builtin.
2850 (c_decl_implicit): Define.
2851
bd66724c 28522015-09-02 Marek Polacek <polacek@redhat.com>
2853
2854 PR c/67432
2855 * c-parser.c (c_parser_enum_specifier): Give a better error for
2856 an empty enum.
2857
6dc50383 28582015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org>
2859
2860 * c-aux-info.c, c-parser.c, c-tree.h: Remove useless typedefs.
2861
7ad1d78d 28622015-08-12 Marek Polacek <polacek@redhat.com>
2863
2864 * c-decl.c (grokdeclarator): Call error_at instead of error and pass
2865 LOC to it.
2866
c9099388 28672015-08-03 Marek Polacek <polacek@redhat.com>
2868
2869 PR c/67088
2870 * c-decl.c (check_bitfield_type_and_width): Add location parameter.
2871 Use it.
2872 (grokdeclarator): Pass LOC down to check_bitfield_type_and_width.
2873
9255be07 28742015-08-02 Patrick Palka <ppalka@gcc.gnu.org>
2875
2876 * c-parser.c (c_parser_if_body): Take token_indent_info
2877 argument. Call warn_for_misleading_indentation even when the
2878 body is a semicolon. Extract token_indent_infos corresponding
2879 to the guard, body and next tokens. Adjust call to
2880 warn_for_misleading_indentation accordingly.
2881 (c_parser_else_body): Likewise.
2882 (c_parser_if_statement): Likewise.
2883 (c_parser_while_statement): Likewise.
2884 (c_parser_for_statement): Likewise.
2885
dbbd4c6d 28862015-07-28 Luis Felipe Strano Moraes <luis.strano@gmail.com>
2887 Manuel López-Ibáñez <manu@gcc.gnu.org>
2888
2889 * c-decl.c (get_parm_info): Remove static var. Update warning
2890 message.
2891
6784a472 28922015-07-27 Marek Polacek <polacek@redhat.com>
2893
2894 PR c++/66555
2895 PR c/54979
2896 * c-typeck.c (parser_build_binary_op): Call warn_tautological_cmp.
2897
8d669e79 28982015-07-20 Marek Polacek <polacek@redhat.com>
2899
2900 PR c++/55095
2901 * c-typeck.c (digest_init): Pass OPT_Wpedantic to pedwarn_init.
2902 (build_binary_op): Warn about left shift overflows.
2903
1eacc14a 29042015-07-09 Andrew MacLeod <amacleod@redhat.com>
2905
2906 * c-array-notation.c: Adjust includes for flags.h changes.
2907 * c-objc-common.c: Likewise.
2908
9ef16211 29092015-07-07 Andrew MacLeod <amacleod@redhat.com>
2910
2911 * c-array-notation.c: Adjust includes.
2912 * c-aux-info.c: Likewise.
2913 * c-convert.c: Likewise.
2914 * c-decl.c: Likewise.
2915 * c-errors.c: Likewise.
2916 * c-lang.c: Likewise.
2917 * c-objc-common.c: Likewise.
2918 * c-parser.c: Likewise.
2919 * c-typeck.c: Likewise.
2920
0949f227 29212015-06-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
2922
2923 PR fortran/66605
2924 * c-decl.c (finish_function): Call do_warn_unused_parameter.
2925
be23b16f 29262015-06-29 Marek Polacek <polacek@redhat.com>
2927
2928 PR c/66322
2929 * c-typeck.c (struct c_switch): Add BOOL_COND_P and OUTSIDE_RANGE_P.
2930 (c_start_case): Set BOOL_COND_P and OUTSIDE_RANGE_P. Don't warn
2931 about -Wswitch-bool here.
2932 (do_case): Update c_add_case_label call.
2933 (c_finish_case): Update c_do_switch_warnings call.
2934
6290f0db 29352015-06-27 Marek Polacek <polacek@redhat.com>
2936
2937 * c-typeck.c: Use VECTOR_TYPE_P throughout.
2938
aa3e402e 29392015-06-26 Marek Polacek <polacek@redhat.com>
2940
2941 * c-array-notation.c (fix_builtin_array_notation_fn): Use
2942 INDIRECT_REF_P.
2943 * c-typeck.c (array_to_pointer_conversion): Likewise.
2944 (build_unary_op): Likewise.
2945 (c_finish_return): Likewise.
2946
ec2e0095 29472015-06-25 Andrew MacLeod <amacleod@redhat.com>
2948
2949 * c-decl.c: Remove ipa-ref.h and plugin-api.h from include list.
2950 * c-parser.c: Likewise.
2951
770ff93b 29522015-06-25 Richard Sandiford <richard.sandiford@arm.com>
2953
2954 * c-decl.c (detect_field_duplicates_hash): Use nofree_ptr_hash
2955 instead of pointer_hash.
2956 (detect_field_duplicates): Likewise.
2957
f48c7f4a 29582015-06-25 Marek Polacek <polacek@redhat.com>
2959
2960 * c-array-notation.c: Use VAR_P throughout.
2961 * c-decl.c: Likewise.
2962 * c-objc-common.c: Likewise.
2963 * c-parser.c: Likewise.
2964 * c-typeck.c: Likewise.
2965
ce41e81a 29662015-06-25 Marek Polacek <polacek@redhat.com>
2967
2968 * c-decl.c: Use is_global_var throughout.
2969 * c-parser.c: Likewise.
2970 * c-typeck.c: Likewise.
2971
f2ab3bac 29722015-06-17 Andrew MacLeod <amacleod@redhat.com>
2973
2974 * c-array-notation.c: Do not include input.h, line-map.h or is-a.h.
2975 * c-aux-info.c: Likewise.
2976 * c-convert.c: Likewise.
2977 * c-decl.c: Likewise.
2978 * c-errors.c: Likewise.
2979 * c-lang.c: Likewise.
2980 * c-objc-common.c: Likewise.
2981 * c-parser.c: Likewise.
2982 * c-typeck.c: Likewise.
2983
647730ab 29842015-06-11 Jan Hubicka <hubicka@ucw.cz>
2985
2986 PR middle-end/66325
2987 * c-decl.c (start_enum): Set TYPE_PACKED consistently among type
2988 variants.
2989
dd4b0a0d 29902015-06-11 Pierre-Marie de Rodat <derodat@adacore.com>
2991
2992 * c-decl.c (pop_scope): Register the main translation unit
2993 through the new debug hook.
2994
64486212 29952015-06-08 Andrew MacLeod <amacleod@redhat.com>
2996
2997 * c-array-notation.c : Adjust include files.
2998 * c-aux-info.c : Likewise.
2999 * c-convert.c : Likewise.
3000 * c-decl.c : Likewise.
3001 * c-errors.c : Likewise.
3002 * c-lang.c : Likewise.
3003 * c-lang.h : Likewise.
3004 * c-objc-common.c : Likewise.
3005 * c-parser.c : Likewise.
3006 * c-typeck.c : Likewise.
3007
3a1c9df2 30082015-06-05 Aldy Hernandez <aldyh@redhat.com>
3009
3010 * c-decl.c (finish_struct): Save C_TYPE_INCOMPLETE_VARS and
3011 immediately clobber it.
3012 (c_write_global_declarations_1): Remove call to
3013 check_global_declaration_1.
3014 (c_write_global_declarations_2): Remove.
3015 (c_write_final_cleanups): Rename from c_write_global_declarations.
3016 Remove call to finalize_compilation_unit.
3017 Remove calls to debugging hooks.
3018 * c-objc-common.c: Adjust comment for c_warn_unused_global_decl.
3019 * c-objc-common.h: Remove LANG_HOOKS_WRITE_GLOBALS.
3020 * c-tree.h: Remove c_write_global_declarations.
3021
f77c0292 30222015-06-04 Andrew MacLeod <amacleod@redhat.com>
3023
3024 * c-array-notation.c: Adjust includes for restructured coretypes.h.
3025 * c-aux-info.c: Likewise.
3026 * c-convert.c: Likewise.
3027 * c-decl.c: Likewise.
3028 * c-errors.c: Likewise.
3029 * c-lang.c: Likewise.
3030 * c-objc-common.c: Likewise.
3031 * c-parser.c: Likewise.
3032 * c-typeck.c: Likewise.
3033
b44134dc 30342015-06-04 Marek Polacek <polacek@redhat.com>
3035
3036 PR c/66341
3037 * c-typeck.c (build_c_cast): Wrap VALUE into NON_LVALUE_EXPR if
3038 it is a lvalue.
3039
d1df0bfc 30402015-06-03 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
3041
3042 * c-decl.c (warn_cxx_compat_finish_struct): New parameters code, record_loc.
3043 Warn for empty struct.
3044 (finish_struct): Pass TREE_CODE(t) and loc to warn_cxx_compat_finish_struct.
3045
f8363c5d 30462015-06-02 Andres Tiraboschi <andres.tiraboschi@tallertechnologies.com>
3047
3048 * c-decl.c (start_function): Call plugin before parsing.
3049 (finish_function): Call plugin after parsing.
3050
5b9761f5 30512015-06-02 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
3052
3053 PR c/49551
3054 * c-decl.c (merge_decls): Merge DECL_COMMON.
3055
eeec71b4 30562015-05-22 Jim Wilson <jim.wilson@linaro.org>
3057
3058 * Make-lang.in (check_gcc_pallelize): Define.
3059
5a4c69dd 30602015-05-22 Marek Polacek <polacek@redhat.com>
3061
3062 PR c/47043
3063 * c-parser.c (c_parser_enum_specifier): Parse and apply enumerator
3064 attributes.
3065
5650b4ff 30662015-05-21 Marek Polacek <polacek@redhat.com>
3067
3068 * c-typeck.c (inform_declaration): Use DECL_IS_BUILTIN instead of
3069 DECL_BUILT_IN.
3070
b443c459 30712015-05-20 Marek Polacek <polacek@redhat.com>
3072
3073 * c-decl.c: Use VAR_OR_FUNCTION_DECL_P throughout.
3074 * c-typeck.c: Likewise.
3075
9e73638f 30762015-05-19 Marek Polacek <polacek@redhat.com>
3077
3078 * c-typeck.c (start_init): Use AGGREGATE_TYPE_P.
3079
d7729e26 30802015-05-19 Jakub Jelinek <jakub@redhat.com>
3081
3082 PR middle-end/66199
3083 * c-parser.c (c_parser_omp_for_loop): Don't add
3084 OMP_CLAUSE_SHARED to OMP_PARALLEL_CLAUSES when moving
3085 OMP_CLAUSE_LASTPRIVATE clause to OMP_FOR_CLAUSES.
3086 (c_parser_omp_teams): Set OMP_TEAMS_COMBINED for combined
3087 constructs.
3088
dfcf26a5 30892015-05-19 Mikhail Maltsev <maltsevm@gmail.com>
3090
3091 * c-typeck.c (build_array_ref): Use std::swap instead of explicit
9e73638f 3092 swaps.
dfcf26a5 3093
09172322 30942015-05-16 Manuel López-Ibáñez <manu@gcc.gnu.org>
3095
3096 PR fortran/44054
3097 * c-objc-common.c (c_tree_printer): Replace locus pointer with
3098 accessor function.
3099
aac24642 31002015-05-14 Marek Polacek <polacek@redhat.com>
3101
3102 PR c/66066
3103 PR c/66127
3104 * c-typeck.c (digest_init): Call pedwarn_init with OPT_Wpedantic
3105 rather than with 0.
3106
e5f01cba 31072015-05-12 David Malcolm <dmalcolm@redhat.com>
3108
3109 * c-parser.c (c_parser_if_body): Add param "if_loc", use it
3110 to add a call to warn_for_misleading_indentation.
3111 (c_parser_else_body): Likewise, adding param "else_loc".
3112 (c_parser_if_statement): Check for misleading indentation.
3113 (c_parser_while_statement): Likewise.
3114 (c_parser_for_statement): Likewise.
3115
dc5945dc 31162015-05-08 Marek Polacek <polacek@redhat.com>
3117
3118 PR c/64918
3119 * c-typeck.c (add_pending_init): Use OPT_Woverride_init_side_effects.
3120 (output_init_element): Likewise.
3121
cdc64059 31222015-05-07 Marek Polacek <polacek@redhat.com>
3123
3124 PR c/65179
3125 * c-typeck.c (build_binary_op): Warn when left shifting a negative
3126 value.
3127
6fa7118e 31282015-04-30 Marek Polacek <polacek@redhat.com>
3129
3130 * c-typeck.c (set_init_label): Call error_at instead of error and
3131 pass LOC to it.
3132
98f44804 3133 * c-typeck.c (c_incomplete_type_error): Refactor to use %qT. Print
3134 the type of a decl.
3135
2cd7caae 3136 * c-typeck.c (c_build_va_arg): Clarify the error message.
3137
95cfd391 31382015-04-29 Thomas Schwinge <thomas@codesourcery.com>
3139
3140 * c-parser.c (c_parser_oacc_enter_exit_data): Use
3141 OMP_STANDALONE_CLAUSES.
3142
e65e39f8 31432015-04-28 Marek Polacek <polacek@redhat.com>
3144
3145 * c-parser.c (c_parser_binary_expression): Remove duplicate line.
3146
5580bf42 31472015-04-28 Marek Polacek <polacek@redhat.com>
3148
3149 PR c/65901
3150 * c-typeck.c (c_build_va_arg): Require TYPE be a complete type.
3151
c3468fc2 31522015-04-25 Marek Polacek <polacek@redhat.com>
3153
3154 PR c/52085
3155 * c-decl.c (finish_enum): Copy over TYPE_ALIGN. Also check for "mode"
3156 attribute.
3157
0cd6b1b4 31582015-04-23 Marek Polacek <polacek@redhat.com>
3159
3160 PR c/65345
3161 * c-decl.c (set_labels_context_r): New function.
3162 (store_parm_decls): Call it via walk_tree_without_duplicates.
3163 * c-typeck.c (convert_lvalue_to_rvalue): Use create_tmp_var_raw
3164 instead of create_tmp_var. Build TARGET_EXPR instead of
3165 COMPOUND_EXPR.
3166 (build_atomic_assign): Use create_tmp_var_raw instead of
3167 create_tmp_var. Build TARGET_EXPRs instead of MODIFY_EXPR.
3168
05a827ce 31692015-04-20 Ilya Verbin <ilya.verbin@intel.com>
3170
3171 * c-parser.c (c_parser_oacc_enter_exit_data): Remove excess semicolon.
3172 (c_parser_omp_target_update): Add missed %> to error_at ().
3173
de801c28 31742015-04-10 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
3175
3176 PR target/55143
3177 * c-decl.c (c_default_pointer_mode): Remove definition.
3178 * c-tree.h (c_default_pointer_mode): Remove declaration.
3179
c3b1dca4 31802015-03-27 Tobias Burnus <burnus@net-b.de>
3181
3182 PR c/65586
3183 * c-parser.c (c_parser_skip_to_pragma_eol): Optionally, don't
3184 error out.
3185 (c_parser_omp_for, c_parser_omp_parallel, c_parser_omp_distribute,
3186 c_parser_omp_teams, c_parser_omp_target, c_parser_omp_declare):
3187 Update calls to not error for skipped omp pragmas with -fopenmp-simd.
3188
1443772f 31892015-03-19 Jakub Jelinek <jakub@redhat.com>
3190
3191 * c-decl.c (c_decl_attributes): Also add "omp declare target"
3192 attribute for DECL_EXTERNAL VAR_DECLs.
3193
76738f56 31942015-03-11 Jakub Jelinek <jakub@redhat.com>
3195
3196 * c-parser.c (c_parse_init): Don't call xstrdup on get_identifier
3197 argument.
3198
16f958b3 31992015-03-10 Jakub Jelinek <jakub@redhat.com>
3200
3201 PR c/65120
3202 * c-typeck.c (parser_build_binary_op): Check for tcc_comparison
3203 before preparing arguments to warn_logical_not_parentheses.
3204
6054103a 32052015-03-09 Jakub Jelinek <jakub@redhat.com>
3206
3207 PR c/65120
3208 * c-typeck.c (parser_build_binary_op): Don't warn for
3209 !!x == y or !b == y where b is _Bool.
3210
de3a1e03 32112015-03-09 Marek Polacek <polacek@redhat.com>
3212
3213 * c-convert.c (convert): Make use of do_ubsan_in_current_function.
3214 * c-decl.c (grokdeclarator): Likewise.
3215 * c-typeck.c (build_binary_op): Likewise.
3216
084e6bf0 32172015-02-27 Marek Polacek <polacek@redhat.com>
3218
3219 PR c/65228
3220 * c-decl.c (start_decl): Return NULL_TREE if decl is an error node.
3221
4d7c4134 32222015-02-14 Marek Polacek <polacek@redhat.com>
3223
3224 PR c/64768
3225 * c-decl.c (grokdeclarator): Set the range of a flexible array member
3226 declared through a typedef name.
3227
b1380826 32282015-02-13 Marek Polacek <polacek@redhat.com>
3229
3230 PR c/65050
3231 * c-decl.c (grokdeclarator): Print also the type when giving
3232 the error message about array's incomplete element type.
3233
35ff54b5 32342015-02-11 Jakub Jelinek <jakub@redhat.com>
3235
3236 PR c/64824
3237 * c-parser.c (c_parser_binary_expression): Fix OpenMP stack[sp].prec
3238 check in the POP macro.
3239
46861609 32402015-02-09 Marek Polacek <polacek@redhat.com>
3241
3242 PR c/64856
3243 * c-typeck.c (process_init_element): Don't always wrap
3244 COMPOUND_LITERAL_EXPR in a SAVE_EXPR in C99 mode when
3245 initializing a range of elements.
3246
bbf8fbec 32472015-02-04 Jakub Jelinek <jakub@redhat.com>
3248
3249 PR c/64824
3250 PR c/64868
3251 * c-parser.c (c_parser_omp_atomic): Handle RDIV_EXPR.
3252
46861609 32532015-02-02 Bruno Loff <bruno.loff@gmail.com>
1f0ce3ac 3254
3255 * c-parser.c (c_parser_declspecs): Call invoke_plugin_callbacks after
3256 processing enum declaration.
3257
70279be9 32582015-01-29 Marek Polacek <polacek@redhat.com>
3259
3260 PR c/64709
3261 * c-typeck.c (pop_init_level): If constructor_elements has
3262 exactly one element with integer_zerop value, set constructor_zeroinit
3263 to 1. Remove braces around warning_init call.
3264
591970b4 32652015-01-27 Jakub Jelinek <jakub@redhat.com>
3266
3267 PR c/64766
3268 * c-typeck.c (store_init_value): Don't overwrite DECL_INITIAL
3269 of FUNCTION_DECLs with error_mark_node.
3270
87778dc4 32712015-01-26 Jakub Jelinek <jakub@redhat.com>
3272
3273 PR c/64778
3274 * c-typeck.c (convert_arguments): Return -1 if there are
3275 error_args, even if we've diagnosed too many arguments.
3276
cffdfb3d 32772015-01-21 Richard Biener <rguenther@suse.de>
3278
3279 PR middle-end/64313
3280 * c-decl.c (merge_decls): Call set_builtin_decl_declared_p
3281 for builtins the user declared correctly.
3282
ca4c3545 32832015-01-15 Thomas Schwinge <thomas@codesourcery.com>
3284 Bernd Schmidt <bernds@codesourcery.com>
3285 Cesar Philippidis <cesar@codesourcery.com>
3286 James Norris <jnorris@codesourcery.com>
3287 Jakub Jelinek <jakub@redhat.com>
3288 Ilmir Usmanov <i.usmanov@samsung.com>
3289
3290 * c-parser.c: Include "gomp-constants.h".
3291 (c_parser_omp_clause_map): Use enum gomp_map_kind instead of enum
3292 omp_clause_map_kind. Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
3293 Use OMP_CLAUSE_SET_MAP_KIND.
3294 (c_parser_pragma): Handle PRAGMA_OACC_ENTER_DATA,
3295 PRAGMA_OACC_EXIT_DATA, PRAGMA_OACC_UPDATE.
3296 (c_parser_omp_construct): Handle PRAGMA_OACC_CACHE,
3297 PRAGMA_OACC_DATA, PRAGMA_OACC_KERNELS, PRAGMA_OACC_LOOP,
3298 PRAGMA_OACC_PARALLEL, PRAGMA_OACC_WAIT.
3299 (c_parser_omp_clause_name): Handle "auto", "async", "copy",
3300 "copyout", "create", "delete", "deviceptr", "gang", "host",
3301 "num_gangs", "num_workers", "present", "present_or_copy", "pcopy",
3302 "present_or_copyin", "pcopyin", "present_or_copyout", "pcopyout",
3303 "present_or_create", "pcreate", "seq", "self", "vector",
3304 "vector_length", "wait", "worker".
3305 (OACC_DATA_CLAUSE_MASK, OACC_KERNELS_CLAUSE_MASK)
3306 (OACC_ENTER_DATA_CLAUSE_MASK, OACC_EXIT_DATA_CLAUSE_MASK)
3307 (OACC_LOOP_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK)
3308 (OACC_UPDATE_CLAUSE_MASK, OACC_WAIT_CLAUSE_MASK): New macros.
3309 (c_parser_omp_variable_list): Handle OMP_CLAUSE__CACHE_.
3310 (c_parser_oacc_wait_list, c_parser_oacc_data_clause)
3311 (c_parser_oacc_data_clause_deviceptr)
3312 (c_parser_omp_clause_num_gangs, c_parser_omp_clause_num_workers)
3313 (c_parser_oacc_clause_async, c_parser_oacc_clause_wait)
3314 (c_parser_omp_clause_vector_length, c_parser_oacc_all_clauses)
3315 (c_parser_oacc_cache, c_parser_oacc_data, c_parser_oacc_kernels)
3316 (c_parser_oacc_enter_exit_data, c_parser_oacc_loop)
3317 (c_parser_oacc_parallel, c_parser_oacc_update)
3318 (c_parser_oacc_wait): New functions.
3319 * c-tree.h (c_finish_oacc_parallel, c_finish_oacc_kernels)
3320 (c_finish_oacc_data): New prototypes.
3321 * c-typeck.c: Include "gomp-constants.h".
3322 (handle_omp_array_sections): Handle GOMP_MAP_FORCE_DEVICEPTR. Use
3323 GOMP_MAP_* instead of OMP_CLAUSE_MAP_*. Use
3324 OMP_CLAUSE_SET_MAP_KIND.
3325 (c_finish_oacc_parallel, c_finish_oacc_kernels)
3326 (c_finish_oacc_data): New functions.
3327 (c_finish_omp_clauses): Handle OMP_CLAUSE__CACHE_,
3328 OMP_CLAUSE_NUM_GANGS, OMP_CLAUSE_NUM_WORKERS,
3329 OMP_CLAUSE_VECTOR_LENGTH, OMP_CLAUSE_ASYNC, OMP_CLAUSE_WAIT,
3330 OMP_CLAUSE_AUTO, OMP_CLAUSE_SEQ, OMP_CLAUSE_GANG,
3331 OMP_CLAUSE_WORKER, OMP_CLAUSE_VECTOR, and OMP_CLAUSE_MAP's
3332 GOMP_MAP_FORCE_DEVICEPTR.
3333
1f78217c 33342015-01-09 Michael Collison <michael.collison@linaro.org>
3335
3336 * c-array-notation.c: Include hash-set.h, machmode.h,
3337 vec.h, double-int.h, input.h, alias.h, symtab.h, options.h
3338 fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h.
3339 * c-aux-info.c: Ditto.
3340 * c-convert.c: Ditto.
3341 * c-decl.c: Ditto.
3342 * c-errors.c: Ditto.
3343 * c-lang.c: Dittoxs.
3344 * c-objc-common.c: Ditto.
3345 * c-parser.c: Ditto.
3346 * c-typeck.c: Include hash-set.h, machmode.h,
3347 vec.h, double-int.h, input.h, alias.h, symtab.h, options.h
3348 fold-const.h, wide-int.h, inchash.h, real.h and
3349 fixed-value.h due to flattening of tree.h.
3350
15e18a8c 33512015-01-07 Marek Polacek <polacek@redhat.com>
3352
3353 PR c/64417
3354 * c-typeck.c (process_init_element): Disallow initialization of
3355 a flexible array member with a string constant if the structure
3356 is in an array.
3357
d353bf18 33582015-01-05 Jakub Jelinek <jakub@redhat.com>
3359
823a9dd4 3360 PR sanitizer/64344
3361 * c-typeck.c (convert_for_assignment, c_finish_return): For
3362 -fsanitize=float-cast-overflow casts from REAL_TYPE to integer/enum
3363 types also set in_late_binary_op around convert call.
3364 * c-convert.c (convert): For -fsanitize=float-cast-overflow REAL_TYPE
3365 to integral type casts, if not in_late_binary_op, pass c_fully_fold
3366 result on expr as last argument to ubsan_instrument_float_cast,
3367 if in_late_binary_op, don't use c_save_expr but save_expr.
3368
d353bf18 3369 Update copyright years.
3370
92b63884 33712015-01-05 Marek Polacek <polacek@redhat.com>
3372
3373 PR c/64423
3374 * c-typeck.c (build_array_ref): Pass loc down to
3375 warn_array_subscript_with_type_char.
3376
92a44a68 33772014-12-20 Martin Uecker <uecker@eecs.berkeley.edu>
8a8211df 3378
3379 * c-typeck.c: New behavious for pointers to arrays with qualifiers
a49621cf 3380 (common-pointer-type): For pointers to arrays take qualifiers from
8a8211df 3381 element type.
a49621cf 3382 (build_conditional_expr): Add warnings for lost qualifiers.
8a8211df 3383 (comp-target-types): Allow pointers to arrays with different qualifiers.
a49621cf 3384 (convert-for-assignment): Adapt warnings for discarded qualifiers. Add
8a8211df 3385 WARNING_FOR_QUALIFIERS macro and rename WARN_FOR_QUALIFIERS
a49621cf 3386 to PEDWARN_FOR_QUALIFIERS.
8a8211df 3387
35ea0139 33882014-12-17 Jakub Jelinek <jakub@redhat.com>
3389
3390 PR sanitizer/64289
3391 * c-convert.c: Include ubsan.h.
3392 (convert): For real -> integral casts and
3393 -fsanitize=float-cast-overflow don't call convert_to_integer, but
3394 instead instrument the float cast directly.
3395
f9e245b2 33962014-11-29 Jakub Jelinek <jakub@redhat.com>
3397
3398 * c-typeck.c (convert_lvalue_to_rvalue, build_atomic_assign,
3399 c_finish_stmt_expr): Remove NULL last argument from
3400 create_tmp_var_raw and create_tmp_var calls.
3401 * c-array-notation.c (fix_builtin_array_notation_fn,
3402 build_array_notation_expr, fix_conditional_array_notations_1,
3403 fix_array_notation_expr, fix_array_notation_call_expr): Likewise.
3404
fce2dbd1 34052014-11-28 Marek Polacek <polacek@redhat.com>
3406
3407 PR c/63862
3408 * c-typeck.c (build_binary_op) <RSHIFT_EXPR, LSHIFT_EXPR>: Don't
3409 convert the right operand to integer type.
3410
396c36b7 34112014-11-25 Marek Polacek <polacek@redhat.com>
3412
3413 PR c/63877
3414 * c-decl.c (start_function): Disable -Wmissing-declarations warning
3415 for inline functions.
3416
c61ef207 34172014-11-21 Jakub Jelinek <jakub@redhat.com>
3418
3419 PR target/63764
3420 * c-typeck.c (build_array_ref): Adjust
3421 convert_vector_to_pointer_for_subscript caller. If it returns true,
3422 call non_lvalue_loc on the result.
3423
565353e8 34242014-11-11 Richard Biener <rguenther@suse.de>
3425
3426 * c-decl.c (c_init_decl_processing): Do not set pedantic_lvalues
3427 to true.
3428
fdd735a7 34292014-11-10 Andi Kleen <ak@linux.intel.com>
3430
3431 PR c/60804
3432 * c-parser.c (c_parser_statement_after_labels): Call
3433 check_no_cilk.
3434 (c_parser_if_statement): Dito.
3435 (c_parser_switch_statement): Dito.
3436 (c_parser_while_statement): Dito.
3437 (c_parser_do_statement): Dito.
3438 (c_parser_for_statement): Dito.
3439 * c-typeck.c (c_finish_loop): Dito.
3440
0feb4de1 34412014-11-10 Paolo Carlini <paolo.carlini@oracle.com>
3442
3443 * c-typeck.c (build_binary_op): Use OPT_Wshift_count_negative and
3444 OPT_Wshift_count_overflow in the warnings.
3445
a3fec48a 34462014-10-30 Marek Polacek <polacek@redhat.com>
3447
3448 * c-objc-common.c (c_tree_printer) <case 'T'>: For a typedef name,
3449 print the stripped version as well, if they're not the same.
3450
3754d046 34512014-10-29 Richard Sandiford <richard.sandiford@arm.com>
3452
3453 * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from
3454 machine_mode.
3455
1140c305 34562014-10-28 Andrew MacLeod <amacleod@redhat.com>
3457
3458 * c-decl.c: Adjust include files.
3459 * c-parser.c: Ditto.
3460
ab103e33 34612014-10-27 Phil Muldoon <pmuldoon@redhat.com>
3462 Tom Tromey <tromey@redhat.com>
3463
3464 * c-tree.h (enum c_oracle_request): New.
3465 (c_binding_oracle_function): New typedef.
3466 (c_binding_oracle, c_pushtag, c_bind): Declare.
3467 * c-decl.c (c_binding_oracle): New global.
3468 (I_SYMBOL_CHECKED): New macro.
3469 (i_symbol_binding): New function.
3470 (I_SYMBOL_BINDING, I_SYMBOL_DECL): Redefine.
3471 (I_TAG_CHECKED): New macro.
3472 (i_tag_binding): New function.
3473 (I_TAG_BINDING, I_TAG_DECL): Redefine.
3474 (I_LABEL_CHECKED): New macro.
3475 (i_label_binding): New function.
3476 (I_LABEL_BINDING, I_LABEL_DECL): Redefine.
3477 (c_print_identifier): Save and restore c_binding_oracle.
3478 (c_pushtag, c_bind): New functions.
3479
94ea8568 34802014-10-27 Andrew MacLeod <amacleod@redhat.com>
3481
3482 * c-typeck.c: Adjust include files.
3483
32ecf960 34842014-10-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
3485
3486 PR c++/53061
3487 * c-objc-common.c (c_objc_common_init): Do not do diagnostics
3488 initialization here...
3489 (c_initialize_diagnostics): ... but here. Set defaults after
3490 building pretty-printer.
3491
2981340f 34922014-10-23 Marek Polacek <polacek@redhat.com>
3493
3494 PR c/63626
3495 * c-decl.c (pop_scope): Don't print warning in external_scope.
3496
d303aeaf 34972014-10-19 Marek Polacek <polacek@redhat.com>
3498
3499 PR c/63567
3500 * c-typeck.c (output_init_element): Allow initializing objects with
3501 static storage duration with compound literals even in C99 and add
3502 pedwarn for it.
3503
bccf97da 35042014-10-17 Marek Polacek <polacek@redhat.com>
3505
3506 PR c/63567
3507 * c-typeck.c (digest_init): Allow initializing objects with static
3508 storage duration with compound literals even in C99 and add pedwarn
3509 for it.
3510
d9c77450 35112014-10-17 Marek Polacek <polacek@redhat.com>
3512
3513 PR c/63543
3514 * c-tree.h (C_TYPE_ERROR_REPORTED): Define.
3515 * c-typeck.c (build_indirect_ref): Don't print the "dereferencing..."
3516 error multiple times. Print the type.
3517
a2bbd0a7 35182014-10-17 Marek Polacek <polacek@redhat.com>
3519
3520 PR c/63549
3521 * c-typeck.c (build_array_ref): Bail if the index in an incomplete
3522 type.
3523
e610d2b2 35242014-10-17 Marek Polacek <polacek@redhat.com>
3525
3526 * c-decl.c (grokdeclarator): Use OPT_Wimplicit_int unconditionally.
3527 (start_function): Use OPT_Wimplicit_int instead of 0.
3528 (store_parm_decls_oldstyle): Likewise.
3529
6b6e56b6 35302014-10-17 Alan Modra <amodra@gmail.com>
3531
3532 PR middle-end/61848
3533 * c-decl.c (merge_decls): Don't merge section name or tls model
3534 to newdecl symtab node, instead merge to olddecl. Override
3535 existing olddecl section name. Set tls_model for all thread-local
3536 vars, not just OMP thread-private ones. Remove incorrect comment.
3537
a3020f2f 35382014-10-16 Andrew MacLeod <amacleod@redhat.com>
3539
3540 * c-decl.c: Adjust include files.
3541
9f75f026 35422014-10-14 DJ Delorie <dj@redhat.com>
3543
3544 * c-parser.c (c_parse_init): Add RID entries for each __intN.
3545 (c_token_starts_typename): Check all __intN, not just __int128.
3546 (c_token_starts_declspecs): Likewise.
3547 (c_parser_declspecs): Likewise.
3548 (c_parser_attribute_any_word): Likewise.
3549 (c_parser_objc_selector): Likewise.
3550 * c-tree.h (c_typespec_keyword): cts_int128 -> cts_int_n.
3551 (struct c_declspecs): Add int_n_idx field to record *which* __intN
3552 is specified.
3553 * c-decl.c (declspecs_add_type): Check for all __intN, not just
3554 __int128.
3555 (finish_declspecs): Likewise.
3556
4f284d4a 35572014-10-13 Anthony Brandon <anthony.brandon@gmail.com>
3558
a49621cf 3559 * c-parser.c (c_parser_all_labels): New function to replace
4f284d4a 3560 the duplicate code.
a49621cf 3561 (c_parser_statement): Call the new function.
4f284d4a 3562
61a892dc 35632014-10-09 Marek Polacek <polacek@redhat.com>
3564
3565 PR c/63480
3566 * c-typeck.c (pop_init_level): Don't warn about initializing
3567 with { }.
3568
4e888fd9 35692014-10-07 Marek Polacek <polacek@redhat.com>
3570
3571 PR c/59717
3572 * c-decl.c (header_for_builtin_fn): New function.
3573 (implicitly_declare): Suggest which header to include.
3574
224bdd51 35752014-10-07 Marek Polacek <polacek@redhat.com>
3576
3577 * c-convert.c (convert): Use error_operand_p.
3578 * c-typeck.c (require_complete_type): Likewise.
3579 (really_atomic_lvalue): Likewise.
3580 (digest_init): Likewise.
3581 (handle_omp_array_sections_1): Likewise.
3582
a2bc79db 35832014-10-03 Marek Polacek <polacek@redhat.com>
3584
3585 PR c/63453
3586 * c-decl.c (pop_scope): Don't warn about "inline function declared
3587 but never defined" for functions marked with gnu_inline attribute.
3588
4fc4088b 35892014-09-25 Jakub Jelinek <jakub@redhat.com>
3590
3591 PR c++/63249
3592 * c-parser.c (c_parser_omp_variable_list): Call mark_exp_read
3593 on low_bound and length.
3594
5213d6c9 35952014-09-24 Marek Polacek <polacek@redhat.com>
3596
3597 PR c/61405
3598 PR c/53874
3599 * c-parser.c: Don't define CPP_KEYWORD.
3600 (c_parser_switch_statement): Pass original type to c_finish_case.
3601 * c-tree.h (c_finish_case): Update declaration.
3602 * c-typeck.c (c_finish_case): Add TYPE parameter. Pass it
3603 conditionally to c_do_switch_warnings.
3604
6ea2b1bc 36052014-09-03 Marek Polacek <polacek@redhat.com>
3606
3607 PR c/62024
3608 * c-parser.c (c_parser_static_assert_declaration_no_semi): Strip no-op
3609 conversions.
3610
40750995 36112014-09-02 Jakub Jelinek <jakub@redhat.com>
3612 Balaji V. Iyer <balaji.v.iyer@intel.com>
3613 Igor Zamyatin <igor.zamyatin@intel.com>
3614
3615 * c-parser.c (c_parser_cilk_for): New function.
3616 (c_parser_cilk_grainsize): Likewise.
3617 (c_get_temp_regvar): Likewise.
3618 (c_parser_statement_after_labels): Added RID_CILK_FOR case.
3619 (c_parser_pragma): Added PRAGMA_CILK_GRAINSIZE case.
3620 (c_parser_omp_for_loop): Added CILK_FOR and CILK_SIMD checks.
3621 * c-typeck.c (c_finish_omp_clauses): Added OMP_CLAUSE__CILK_FOR_COUNT_
3622 case.
3623
8c583613 36242014-08-27 Chen Gang <gang.chen.5i5j@gmail.com>
3625
3626 * c-aux-info.c (gen_type): Resize 'buff' from 10 to 23 bytes,
3627 with using HOST_WIDE_INT without truncation to 'int'
3628
dc6229e8 36292014-08-22 Marek Polacek <polacek@redhat.com>
3630
3631 PR c++/62199
3632 * c-typeck.c (parser_build_binary_op): Adjust call to
3633 warn_logical_not_parentheses.
3634
5fdda74b 36352014-08-22 Igor Zamyatin <igor.zamyatin@intel.com>
3636
3637 PR other/62008
3638 * c-parser.c (c_parser_array_notation): Check for correct
3639 type of an array added.
3640
78bf4156 36412014-08-19 Marek Polacek <polacek@redhat.com>
3642
3643 PR c++/62153
3644 * c-typeck.c (build_binary_op): If either operand of a comparison
3645 is a boolean expression, call maybe_warn_bool_compare.
3646
005b8fe7 36472014-08-19 Patrick Palka <ppalka@gcc.gnu.org>
3648
3649 PR c/45584
3650 * c-typeck.c (build_c_cast): Do a conversion even when the
3651 TYPE_MAIN_VARIANTs are the same.
3652
508ea33a 36532014-08-19 Marek Polacek <polacek@redhat.com>
3654
3655 * c-decl.c (diagnose_mismatched_decls): Unconditionally call
3656 pedwarn_c99 instead of pedwarn.
3657 (grokfield): Likewise.
3658 (warn_defaults_to): New function.
3659 (grokdeclarator): Call warn_defaults_to instead of pedwarn_c99.
3660 Unconditionally call pedwarn_c99 instead of pedwarn.
3661 (start_function): Call warn_defaults_to instead of pedwarn_c99.
3662 (declspecs_add_scspec): Call pedwarn_c99 instead of pedwarn, don't
3663 check flag_isoc11 before.
3664 * c-errors.c (pedwarn_c99): Change the return type to bool.
3665 Handle -Wc99-c11-compat.
3666 * c-parser.c (disable_extension_diagnostics): Handle
3667 warn_c99_c11_compat.
3668 (restore_extension_diagnostics): Likewise.
3669 (c_parser_static_assert_declaration_no_semi): Call pedwarn_c99
3670 instead of pedwarn, don't check flag_isoc11 before.
3671 (c_parser_declspecs): Likewise.
3672 (c_parser_alignas_specifier): Likewise.
3673 (c_parser_alignof_expression): Likewise.
3674 (c_parser_generic_selection): Likewise.
3675 * c-tree.h (pedwarn_c99): Update declaration.
3676 * c-typeck.c (c_finish_return): Call pedwarn or warning_at instead
3677 of pedwarn_c99.
3678
806fe15e 36792014-08-19 Marek Polacek <polacek@redhat.com>
3680
3681 * c-decl.c (warn_variable_length_array): Pass OPT_Wvla unconditionally
3682 to pedwarn_c90.
3683 * c-errors.c: Include "opts.h".
3684 (pedwarn_c90): Rewrite to handle -Wno-c90-c99-compat better.
3685 * c-parser.c (disable_extension_diagnostics): Handle negative value
3686 of warn_c90_c99_compat, too.
3687 (restore_extension_diagnostics): Likewise.
3688 (c_parser_compound_statement_nostart): Pass
3689 OPT_Wdeclaration_after_statement unconditionally to pedwarn_c90.
3690
89868e45 36912014-08-12 Marek Polacek <polacek@redhat.com>
3692
3693 * c-parser.c (c_parser_postfix_expression) <case RID_FUNCTION_NAME>:
3694 Add pedwarn.
3695 (c_parser_postfix_expression) <case RID_PRETTY_FUNCTION_NAME>:
3696 Likewise.
3697 (c_parser_postfix_expression) <case RID_C99_FUNCTION_NAME>: Likewise.
3698
92a44a68 36992014-08-10 Marek Polacek <polacek@redhat.com>
890c2e2f 3700
3701 PR c/51849
3702 * c-decl.c (build_array_declarator): Remove check for !flag_isoc99.
3703 Call pedwarn_c90 instead of pedwarn.
3704 (check_bitfield_type_and_width): Likewise.
3705 (declspecs_add_qual): Likewise.
3706 (declspecs_add_type): Likewise.
3707 (warn_variable_length_array): Unify function for -pedantic and -Wvla.
3708 Adjust to only call pedwarn_c90.
3709 (grokdeclarator): Remove pedantic && !flag_isoc99 check. Call
3710 pedwarn_c90 instead of pedwarn.
3711 * c-errors.c (pedwarn_c90): Handle -Wc90-c99-compat.
3712 * c-parser.c (disable_extension_diagnostics): Handle
3713 warn_c90_c99_compat.
3714 (restore_extension_diagnostics): Likewise.
3715 (c_parser_enum_specifier): Remove check for !flag_isoc99. Call
3716 pedwarn_c90 instead of pedwarn.
3717 (c_parser_initelt): Likewise.
3718 (c_parser_postfix_expression): Likewise.
3719 (c_parser_postfix_expression_after_paren_type): Likewise.
3720 (c_parser_compound_statement_nostart): Remove check for !flag_isoc99.
3721 * c-tree.h: Fix formatting.
3722 * c-typeck.c (build_array_ref): Remove check for !flag_isoc99. Call
3723 pedwarn_c90 instead of pedwarn.
3724
7149db5f 37252014-08-07 Trevor Saunders <tsaunders@mozilla.com>
3726
3727 * c-typeck.c: Remove include of pointer-set.h.
3728
1c75251e 37292014-08-07 Marek Polacek <polacek@redhat.com>
3730
3731 * c-typeck.c (pointer_diff): Remove P - (P + CST) optimization.
3732
06ecf488 37332014-08-02 Trevor Saunders <tsaunders@mozilla.com>
3734
3735 * c-typeck.c: Use hash_map instead of pointer_map.
3736
431205b7 37372014-08-02 Trevor Saunders <tsaunders@mozilla.com>
3738
3739 * c-decl.c: Use hash_set instead of pointer_set.
3740
3394c80c 37412014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
3742
3743 PR middle-end/61455
3744 * c-array-notation.c (expand_array_notations): Handling
3745 of DECL_EXPR added.
3746
f22a2cb7 37472014-07-31 Marc Glisse <marc.glisse@inria.fr>
3748
3749 PR c++/60517
3750 * c-typeck.c (c_finish_return): Return 0 instead of the address of
3751 a local variable.
3752
74691f46 37532014-07-30 Tom Tromey <tromey@redhat.com>
3754
3755 * c-typeck.c (struct constructor_stack) <designator_depth>: New
3756 field.
3757 (really_start_incremental_init, push_init_level): Initialize
3758 designator_depth.
3759 (pop_init_level): Set global designator_depth.
3760 (process_init_element): Check for designated_init attribute.
3761
f9767fb6 37622014-07-20 Marek Polacek <polacek@redhat.com>
3763
3764 PR c/61852
3765 * c-decl.c (implicit_decl_warning): Add location_t parameter. Use it.
3766 (implicitly_declare): Pass location to implicit_decl_warning.
3767
305d96bc 37682014-07-14 Jakub Jelinek <jakub@redhat.com>
3769
3770 PR middle-end/61294
3771 * c-parser.c (c_parser_expr_list): Add new argument literal_zero_mask.
3772 If non-NULL, call c_parser_check_literal_zero.
3773 (c_parser_check_literal_zero): New function.
3774 (c_parser_postfix_expression_after_primary): Adjust
3775 c_parser_expr_list caller, handle -Wmemset-transposed-args.
3776
87d59e72 37772014-07-06 Marek Polacek <polacek@redhat.com>
3778
3779 PR c/6940
3780 * c-decl.c (grokdeclarator): Set C_ARRAY_PARAMETER.
3781 * c-tree.h (C_ARRAY_PARAMETER): Define.
3782 * c-typeck.c (c_expr_sizeof_expr): Warn when using sizeof on an array
3783 function parameter.
3784
752098c8 37852014-07-02 Jan Hubicka <hubicka@ucw.cz>
92a44a68 3786 Chen Gang <gang.chen.5i5j@gmail.com>
752098c8 3787
3788 * c-decl.c (duplicate_decls): CLear DECL_STRUCT_FUNCTION before
3789 releasing symbol.
3790
1207866e 37912014-07-01 Marek Polacek <polacek@redhat.com>
3792
3793 * c-typeck.c (convert_for_assignment): Pass OPT_Wint_conversion
3794 instead of 0 to WARN_FOR_ASSIGNMENT.
3795
7a6bbb76 37962014-07-01 Marek Polacek <polacek@redhat.com>
3797
3798 PR c/58286
3799 * c-typeck.c (convert_for_assignment): Pass
3800 OPT_Wincompatible_pointer_types instead of 0 to WARN_FOR_ASSIGNMENT.
3801
70575064 38022014-06-30 Marek Polacek <polacek@redhat.com>
3803
3804 * c-decl.c (grokdeclarator): Don't instrument VLAs if the function
3805 has no_sanitize_undefined attribute.
3806
4879e4cf 38072014-06-30 Igor Zamyatin <igor.zamyatin@intel.com>
3808
3809 PR middle-end/57541
3810 * c-array-notation.c (fix_builtin_array_notation_fn):
3811 Check for 0 arguments in builtin call. Check that bultin argument is
3812 correct.
3813 * c-parser.c (c_parser_array_notation): Check for incorrect initial
3814 index.
3815
45c5b823 38162014-06-27 Sebastian Huber <sebastian.huber@embedded-brains.de>
3817
3818 * c-parser.c (c_parser_declaration_or_fndef): Discard all type
3819 qualifiers in __auto_type for atomic types.
3820 (c_parser_typeof_specifier): Discard all type qualifiers in
3821 __typeof__ for atomic types.
3822
430b73ee 38232014-06-25 Marek Polacek <polacek@redhat.com>
3824
3825 PR c/61162
3826 * c-parser.c (c_parser_statement_after_labels): Pass the location of
3827 the return expression to c_finish_return.
3828
9580cb79 38292014-06-25 Jakub Jelinek <jakub@redhat.com>
3830
3831 * c-typeck.c (c_finish_omp_clauses): Make sure
3832 OMP_CLAUSE_LINEAR_STEP has correct type.
3833
c1f445d2 38342014-06-24 Trevor Saunders <tsaunders@mozilla.com>
3835
3836 * c-decl.c: Adjust.
3837
e471cc6f 38382014-06-24 Jakub Jelinek <jakub@redhat.com>
3839
3840 * c-parser.c (c_parser_omp_for_loop): For
3841 #pragma omp parallel for simd move lastprivate clause from parallel
3842 to for rather than simd.
3843
499b7390 38442014-06-23 Marek Polacek <polacek@redhat.com>
3845
3846 * c-typeck.c (parser_build_binary_op): Don't call
3847 warn_logical_not_parentheses if the RHS is TRUTH_NOT_EXPR.
3848
5e68df57 38492014-06-15 Jan Hubicka <hubicka@ucw.cz>
3850
3851 * c-parser.c (c_parser_omp_threadprivate): Likewise.
3852 * c-decl.c (merge_decls): Likewise.
3853
064b0d02 38542014-06-09 Marek Polacek <polacek@redhat.com>
3855
3856 PR c/36446
3857 * c-typeck.c (error_init): Call inform instead of error_at.
3858 (pedwarn_init): Call inform instead of pedwarn.
3859 (warning_init): Call inform instead of warning_at.
3860
71e19e54 38612014-06-07 Jan Hubicka <hubicka@ucw.cz>
3862
3863 * c-decl.c (merge_decls): Use set_decl_section_name.
3864 (duplicate_decls): Remove node if it exists.
3865
95cdf3fd 38662014-06-05 S. Gilles <sgilles@terpmail.umd.edu>
3867
3868 PR c/53119
3869 * c-typeck.c (push_init_level, process_init_element,
3870 pop_init_level): Correct check for zero initialization, move
3871 missing brace warning to respect zero initialization.
3872
a07f86a6 38732014-06-05 Marek Polacek <polacek@redhat.com>
3874
3875 PR c/56724
3876 * c-typeck.c (convert_for_assignment): Use expr_loc for ic_argpass.
3877
32dc1512 38782014-06-05 Marek Polacek <polacek@redhat.com>
3879
3880 PR c/49706
3881 * c-typeck.c (parser_build_binary_op): Warn when logical not is used
3882 on the left hand side operand of a comparison.
3883
64cf1262 38842014-06-05 Marek Polacek <polacek@redhat.com>
3885
3886 PR c/48062
3887 * c-decl.c (warn_if_shadowing): Call inform instead of warning_at.
3888 Print note only if the warning was printed.
3889
071f6d39 38902014-06-04 Igor Zamyatin <igor.zamyatin@intel.com>
3891
3892 PR c/58942
3893 * c-array-notation.c (fix_builtin_array_notation_fn): Handle the case
3894 with a pointer.
3895
c69ec07d 38962014-06-03 Marek Polacek <polacek@redhat.com>
3897
3898 PR c/60439
3899 * c-parser.c (c_parser_switch_statement): Pass explicit_cast_p to
3900 c_start_case.
3901 * c-tree.h (c_start_case): Update.
3902 * c-typeck.c (c_start_case): Add new boolean parameter. Warn if
3903 switch condition has boolean value.
3904
f7715905 39052014-06-02 Andrew MacLeod <amacleod@redhat.com>
3906
3907 * c-decl.c: Include builtins.h.
3908 * c-parser.c: Likewise.
3909
dcfff6f9 39102014-05-27 Marek Polacek <polacek@redhat.com>
3911
3912 PR c/56724
3913 * c-typeck.c (convert_arguments): Get location of a parameter. Change
3914 error and warning calls to error_at and warning_at. Pass location of
3915 a parameter to it. Call warning_at with OPT_Wtraditional_conversion.
3916 (convert_for_assignment): Add parameter to WARN_FOR_ASSIGNMENT and
3917 WARN_FOR_QUALIFIERS. Pass expr_loc to those.
3918
c048c42c 39192014-05-26 Igor Zamyatin <igor.zamyatin@intel.com>
3920
3921 PR c/61191
3922 * c-array-notation.c (fix_builtin_array_notation_fn): Check invalid
3923 function parameters.
3924
8c016392 39252014-05-23 Jan Hubicka <hubicka@ucw.cz>
3926
3927 * c-decl.c (merge_decls): Preserve symtab node pointers.
3928 (duplicate_decls): Free new decl.
3929
184a718f 39302014-05-23 Thomas Schwinge <thomas@codesourcery.com>
3931
6ce915ef 3932 * c-typeck.c (c_finish_omp_clauses): Remove duplicated variable
3933 initialization.
3934
184a718f 3935 * c-parser.c (c_parser_omp_target): Return bool values.
3936
22ac3f78 39372014-05-22 Thomas Schwinge <thomas@codesourcery.com>
3938
3939 * c-parser.c (c_parser_omp_clause_thread_limit): Rename
3940 num_teams_loc variable to num_thread_limit_loc.
3941
3ab4693e 39422014-05-21 Richard Sandiford <rsandifo@linux.vnet.ibm.com>
3943
3944 * c-array-notation.c (expand_array_notations): Use void_node
3945 instead of void_zero_node.
3946
25a27413 39472014-05-17 Trevor Saunders <tsaunders@mozilla.com>
3948
3949 * c-decl.c (finish_struct): Adjust.
3950 (finish_enum): Likewise.
3951 (bind): Adjust.
3952 (record_inline_static): Likewise.
3953 (push_scope): Likewise.
3954 (make_label): Likewise.
3955 (lookup_label_for_goto): Likewise.
3956 (finish_struct): Likewise.
3957 (finish_enum): Likewise.
3958 (store_parm_decls): Likewise.
3959 (c_push_function_context): Likewise.
3960 * c-lang.h: Remove usage of variable_size gty attribute.
3961 * c-parser.c (c_parse_init): Adjust.
3962 (c_parse_file): Likewise.
3963
172b8440 39642014-05-13 Marek Polacek <polacek@redhat.com>
3965
3966 PR c/61162
3967 * c-typeck.c (convert_for_assignment): Pass location to
3968 WARN_FOR_ASSIGNMENT instead of input_location.
3969
c9e51d25 39702014-05-10 Marek Polacek <polacek@redhat.com>
3971
3972 * c-parser.c (c_parser_declaration_or_fndef): Pass init_loc to
3973 maybe_warn_string_init.
3974 (c_parser_postfix_expression_after_paren_type): Pass type_loc to
3975 maybe_warn_string_init.
3976 * c-tree.h (maybe_warn_string_init): Update declaration.
3977 * c-typeck.c (maybe_warn_string_init): Add location parameter.
3978 Call pedwarn_init with loc instead of with input_location.
3979 (digest_init): Pass init_loc to maybe_warn_string_init.
3980 (pop_init_level): Call pedwarn_init with loc instead of with
3981 input_location.
3982 (set_init_index): Likewise.
3983 (process_init_element): Likewise.
3984
53de1631 39852014-05-09 Marek Polacek <polacek@redhat.com>
3986
3987 PR c/61096
3988 * c-parser.c (c_parser_braced_init): Pass brace_loc to push_init_level.
3989 (c_parser_initelt): Pass location to set_init_label. Pass array index
3990 location to set_init_index.
3991 * c-tree.h (push_init_level): Update declaration.
3992 (pop_init_level): Likewise.
3993 (set_init_index): Likewise.
3994 (set_init_label): Likewise.
3995 * c-typeck.c (error_init): Add location parameter. Call error_at
3996 instead of error.
3997 (digest_init): Pass init_loc to error_init.
3998 (really_start_incremental_init):
3999 (push_init_level): Add location parameter. Pass loc to pop_init_level
4000 and error_init.
4001 (pop_init_level): Likewise.
4002 (set_designator): Add location parameter. Pass loc to pop_init_level,
4003 push_init_level, and error_init.
4004 (set_init_index): Add location parameter. Pass loc to error_init and
4005 set_designator.
4006 (set_init_label): Likewise.
4007 (output_init_element): Pass loc to error_init.
4008 (process_init_element): Pass loc to error_init, pop_init_level,
4009 pedwarn_init, and push_init_level.
4010
3e5a8b00 40112014-05-09 Marek Polacek <polacek@redhat.com>
4012
4013 PR c/50459
4014 * c-parser.c (c_parser_attributes): Parse the arguments as an
4015 expression-list if the attribute takes identifier.
4016
c2c4ae8d 40172014-05-08 Marek Polacek <polacek@redhat.com>
4018
4019 PR c/61053
4020 * c-decl.c (grokdeclarator): Use min_align_of_type instead of
4021 TYPE_ALIGN_UNIT.
4022
2026249a 40232014-05-08 Marek Polacek <polacek@redhat.com>
4024
4025 PR c/61077
4026 * c-decl.c (start_function): Warn for _Atomic-qualified return type
4027 of main.
4028
960d5a55 40292014-05-06 Kenneth Zadeck <zadeck@naturalbridge.com>
4030 Mike Stump <mikestump@comcast.net>
4031 Richard Sandiford <rdsandiford@googlemail.com>
4032
4033 * c-decl.c (check_bitfield_type_and_width): Use TYPE_SIGN.
4034 (finish_enum): Use wide-int interfaces.
4035 * c-parser.c (c_parser_cilk_clause_vectorlength): Likewise.
4036 * c-typeck.c (build_c_cast): Likewise.
4037 (set_nonincremental_init_from_string): Likewise.
4038 (c_tree_equal): Likewise.
4039
e0e14cbd 40402014-05-02 Marek Polacek <polacek@redhat.com>
4041
4042 PR c/25801
4043 * c-typeck.c (c_size_in_bytes): Update comment. Don't call error.
4044 Return size_one_node when the type is not complete.
4045 (pointer_diff): Remove comment.
4046 (build_unary_op): Improve error messages.
4047
27ff10cb 40482014-05-02 Marek Polacek <polacek@redhat.com>
4049
4050 * c-typeck.c (c_finish_return): Separate warning_at calls.
4051
68410ce9 40522014-05-02 Marek Polacek <polacek@redhat.com>
4053
4054 * c-tree.h (error_init): Remove declaration.
4055 (pedwarn_init): Likewise.
4056 * c-typeck.c (error_init): Make static and move above.
4057 (pedwarn_init): Likewise.
4058 (warning_init): Move above.
4059 (maybe_warn_string_init): Likewise.
4060
e8e27117 40612014-05-01 Jeff Law <law@redhat.com>
4062
4063 Revert:
4064
4065 2014-04-24 Prathamesh Kulkarni <bilbotheelffriend@gmail.com>
4066 * c-parser.c (c_parser_sizeof_expression): Reorganize slightly to
4067 avoid goto.
4068
971df357 40692014-05-02 Marek Polacek <polacek@redhat.com>
4070
4071 PR c/60784
4072 * c-typeck.c (push_init_level): Set constructor_designated to
4073 p->designated for structures.
4074
de548fe5 40752014-05-01 Marek Polacek <polacek@redhat.com>
4076
4077 PR c/60915
4078 * c-parser.c (c_parser_declaration_or_fndef): Give better error if
4079 function-definition has an attribute after the declarator.
4080
053a0ded 40812014-05-01 Marek Polacek <polacek@redhat.com>
4082
4083 PR c/60257
4084 * c-typeck.c (warning_init): Add location_t parameter. Call
4085 warning_at instead of warning.
4086 (push_init_level): Pass input_location to warning_init.
4087 (add_pending_init): Add location_t parameter. Pass loc to
4088 warning_init.
4089 (set_nonincremental_init): Pass input_location to add_pending_init.
4090 (set_nonincremental_init_from_string): Likewise.
4091 (output_init_element): Pass loc to warning_init and to
4092 add_pending_init.
4093
694296f2 40942014-05-01 Marek Polacek <polacek@redhat.com>
4095
4096 PR c/43395
4097 * c-typeck.c (c_finish_return): Distinguish between label and variable
4098 when warning about returning local address.
4099
86bbd7f9 41002014-05-01 Marek Polacek <polacek@redhat.com>
4101
4102 PR c/29467
4103 * c-decl.c (declspecs_add_type): Pedwarn if boolean types are used
4104 in C89 mode.
4105
e4ab2ef3 41062014-05-01 Marek Polacek <polacek@redhat.com>
4107
4108 PR c/43245
4109 * c-typeck.c (convert_for_assignment): Pass OPT_Wdiscarded_qualifiers
4110 instead of 0 to WARN_FOR_QUALIFIERS.
4111
ca3999cb 41122014-05-01 Marek Polacek <polacek@redhat.com>
4113
4114 PR c/56989
4115 * c-typeck.c (default_conversion): Use better location for
4116 error call.
4117
52cc0072 41182014-04-30 Marek Polacek <polacek@redhat.com>
4119
4120 * c-typeck.c (build_binary_op): Call ubsan_instrument_division
4121 also when SANITIZE_FLOAT_DIVIDE is on.
4122
af379dd3 41232014-04-30 Marek Polacek <polacek@redhat.com>
4124
4125 PR c/60139
4126 * c-typeck.c (output_init_element): Pass OPT_Wpedantic to pedwarn
4127 and pedwarn_init. Use loc insted of input_location.
4128
b069c2a0 41292014-04-30 Marek Polacek <polacek@redhat.com>
4130
4131 PR c/60351
4132 * c-typeck.c (build_binary_op): Use location when warning about
4133 shift count.
4134
4a026b48 41352014-04-25 Marek Polacek <polacek@redhat.com>
4136
4137 PR c/18079
4138 * c-decl.c (diagnose_mismatched_decls): Warn for mismatched
4139 always_inline/noinline and hot/cold attributes.
4140
adc93f31 41412014-04-25 Marek Polacek <polacek@redhat.com>
4142
4143 PR c/60114
4144 * c-parser.c (c_parser_initelt): Pass input_location to
4145 process_init_element.
4146 (c_parser_initval): Pass loc to process_init_element.
4147 * c-tree.h (process_init_element): Adjust declaration.
4148 * c-typeck.c (push_init_level): Pass input_location to
4149 process_init_element.
4150 (pop_init_level): Likewise.
4151 (set_designator): Likewise.
4152 (output_init_element): Add location_t parameter. Pass loc to
4153 digest_init.
4154 (output_pending_init_elements): Pass input_location to
4155 output_init_element.
4156 (process_init_element): Add location_t parameter. Pass loc to
4157 output_init_element.
4158
e1029911 41592014-04-24 Jakub Jelinek <jakub@redhat.com>
4160
4161 * c-parser.c (c_parser_omp_atomic): Allow seq_cst before
4162 atomic-clause, allow comma in between atomic-clause and
4163 seq_cst.
4164
9f0a7bc6 41652014-04-22 Jakub Jelinek <jakub@redhat.com>
4166
4167 PR c/59073
4168 * c-parser.c (c_parser_omp_parallel): If c_parser_omp_for
4169 fails, don't set OM_PARALLEL_COMBINED and return NULL.
4170
094da06d 41712014-04-12 Igor Zamyatin <igor.zamyatin@intel.com>
4172
4173 PR middle-end/60469
4174 * c-array-notation.c (fix_builtin_array_notation_fn): Use
4175 create_tmp_var instead build_decl for creating temps.
4176 (build_array_notation_expr): Likewise.
4177 (fix_conditional_array_notations_1): Likewise.
4178 (fix_array_notation_expr): Likewise.
4179 (fix_array_notation_call_expr): Likewise.
4180
5a672e62 41812014-03-28 Jakub Jelinek <jakub@redhat.com>
4182
4183 PR c++/60689
4184 * c-tree.h (c_build_function_call_vec): New prototype.
4185 * c-typeck.c (build_function_call_vec): Don't call
4186 resolve_overloaded_builtin here.
4187 (c_build_function_call_vec): New wrapper function around
4188 build_function_call_vec. Call resolve_overloaded_builtin here.
4189 (convert_lvalue_to_rvalue, build_function_call, build_atomic_assign):
4190 Call c_build_function_call_vec instead of build_function_call_vec.
4191 * c-parser.c (c_parser_postfix_expression_after_primary): Likewise.
4192 * c-decl.c (finish_decl): Likewise.
4193
f40f5e0e 41942014-03-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
4195
4196 PR c/55383
4197 * c-typeck.c: Use correct format string in cast-qual warning
4198
9ec099a3 41992014-03-07 Thomas Schwinge <thomas@codesourcery.com>
4200
4201 * c-decl.c (c_decl_attributes): Use
4202 lang_hooks.types.omp_mappable_type.
4203 * c-typeck.c (c_finish_omp_clauses): Likewise.
4204
3bfdc94f 42052014-03-06 Marek Polacek <polacek@redhat.com>
4206
4207 PR c/60197
4208 * c-typeck.c (c_finish_return): Call contains_cilk_spawn_stmt instead
4209 of checking tree code.
4210
8f1128f8 42112014-02-19 Prathamesh Kulkarni <bilbotheelffriend@gmail.com>
4212
4213 * c-parser.c (c_parser_declspecs): Replace call to error by error_at.
4214 (c_parser_parameter_declaration): Likewise.
4215
977b1853 42162014-02-19 Marek Polacek <polacek@redhat.com>
4217
4218 PR c/60195
4219 * c-typeck.c (convert_lvalue_to_rvalue): Set TREE_NO_WARNING on tmp.
4220 Call mark_exp_read on exp.value.
4221 (build_atomic_assign): Set TREE_NO_WARNING on val and old. Set
4222 TREE_ADDRESSABLE on old instead of val.
4223 (emit_side_effect_warnings): Warn only if RHS has !TREE_NO_WARNING.
4224
825cd6ef 42252014-02-07 Prathamesh Kulkarni <bilbotheelffriend@gmail.com>
4226
4227 * c-parser.c (c_parser_get_builtin_args): Replace calls to
4228 C_EXPR_APPEND by vec_safe_push.
4229 * c-tree.h (C_EXPR_APPEND): Remove.
4230
ec761d5a 42312014-01-31 Marek Polacek <polacek@redhat.com>
4232
4233 PR c/59963
4234 * c-typeck.c (convert_lvalue_to_rvalue): Pass vNULL to
4235 build_function_call_vec.
4236 (build_function_call): Likewise.
4237 (build_atomic_assign): Likewise.
4238 (build_function_call_vec): Add arg_loc parameter. Use it.
4239 (convert_arguments): Likewise.
4240 (convert_for_assignment): Rename rhs_loc to expr_loc.
4241 * c-parser.c (c_parser_attributes): Pass NULL to c_parser_expr_list.
4242 (c_parser_objc_keywordexpr): Likewise.
4243 (c_parser_postfix_expression_after_primary): Call
4244 build_function_call_vec with expr_loc rather than op_loc.
4245 Call c_parser_expr_list to fill arg_loc. Pass arg_loc to
4246 build_function_call_vec.
4247 (c_parser_expr_list): Add locations parameter. Fill it with locations
4248 of function arguments.
4249 * c-decl.c (finish_decl): Pass vNULL to build_function_call_vec.
4250
22a75734 42512014-01-30 Marek Polacek <polacek@redhat.com>
4252
4253 PR c/59940
4254 * c-typeck.c (build_function_call_vec): Use loc parameter.
4255 (convert_arguments): Add location parameter. Use it.
4256 (ep_convert_and_check): Likewise.
4257 (build_atomic_assign): Adjust convert_for_assignment call.
4258 (build_modify_expr): Likewise.
4259 (digest_init): Likewise.
4260 (c_finish_return): Likewise.
4261 (build_conditional_expr): Adjust ep_convert_and_check calls.
4262 (convert_for_assignment): Add rhs_loc parameter. Use it.
4263 (build_binary_op): Adjust convert_and_check and ep_convert_and_check
4264 calls.
4265
29f580ac 42662014-01-30 Richard Biener <rguenther@suse.de>
4267
4268 PR c/59905
4269 * c-typeck.c (build_function_call_vec): Do not replace calls
4270 to a function via an incompatible type with a runtime abort.
4271
a89e6c15 42722014-01-24 Balaji V. Iyer <balaji.v.iyer@intel.com>
4273
4274 * c-parser.c (c_parser_declaration_or_fndef): Replaced
4275 flag_enable_cilkplus with flag_cilkplus.
4276 (c_parser_direct_declarator_inner): Likewise.
4277 (c_parser_attribute_any_word): Likewise.
4278 (c_parser_attributes): Likewise.
4279 (c_parser_compound_statement): Likewise.
4280 (c_parser_statement_after_labels): Likewise.
4281 (c_parser_if_statement): Likewise.
4282 (c_parser_switch_statement): Likewise.
4283 (c_parser_do_statement): Likewise.
4284 (c_parser_for_statement): Likewise.
4285 (c_parser_unary_expression): Likewise.
4286 (c_parser_postfix_expression): Likewise.
4287 (c_parser_postfix_expression_after_primary): Likewise.
4288 (c_parser_postfix_expression_after_primary): Likewise.
4289 (c_parser_omp_clause_name): Likewise.
4290 (c_finish_omp_declare_simd): Likewise.
4291 (c_parser_cilk_verify_simd): Likewise.
4292 * c-typeck.c (build_array_ref): Likewise.
4293 (build_function_call_vec): Likewise.
4294 (convert_arguments): Likewise.
4295 (build_compound_expr): Likewise.
4296 (c_finish_return): Likewise.
4297 (c_finish_if_stmt): Likewise.
4298 (c_finish_loop): Likewise.
4299 (build_binary_op): Likewise.
4300
2623625f 43012014-01-23 Marek Polacek <polacek@redhat.com>
4302
4303 PR c/59846
4304 * c-typeck.c (parser_build_binary_op): Use location instead of
4305 input_location.
4306 (build_binary_op): Pass location to shorten_compare.
4307
46da3601 43082014-01-23 Marek Polacek <polacek@redhat.com>
4309
4310 PR c/58346
4311 * c-typeck.c (pointer_diff): Give an error on arithmetic on pointer to
4312 an empty aggregate.
4313
9a9db3c1 43142014-01-23 Marek Polacek <polacek@redhat.com>
4315
4316 PR c/59871
4317 * c-typeck.c (build_compound_expr): Warn even for right-hand operand
4318 of a comma expression.
4319 (emit_side_effect_warnings): Likewise.
4320
69c9b607 43212014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com>
4322
4323 PR c/59825
4324 * c-array-notation.c (expand_array_notation_exprs): Rewrote this
4325 function to use walk_tree and moved a lot of its functionality to
4326 expand_array_notations.
4327 (expand_array_notations): New function.
4328
7e005ab5 43292014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com>
4330
4331 * c-parser.c (c_finish_omp_declare_simd): Made "cilk simd function"
4332 attribute an attribute without value.
4333
d6779b5f 43342014-01-23 Jakub Jelinek <jakub@redhat.com>
4335
4336 PR middle-end/58809
4337 * c-typeck.c (c_finish_omp_clause): Reject MIN_EXPR, MAX_EXPR,
4338 BIT_AND_EXPR, BIT_IOR_EXPR and BIT_XOR_EXPR on COMPLEX_TYPEs.
4339
ec431042 43402014-01-22 Marek Polacek <polacek@redhat.com>
4341
4342 PR c/59891
4343 * c-typeck.c (build_conditional_expr): Call c_fully_fold instead
4344 of remove_c_maybe_const_expr on op1 and op2.
4345
1248c663 43462014-01-15 Jakub Jelinek <jakub@redhat.com>
4347
4348 PR c/58943
4349 * c-typeck.c (build_modify_expr): For lhs op= rhs, if rhs has side
4350 effects, preevaluate rhs using SAVE_EXPR first.
4351
0bc789fc 43522014-01-09 Balaji V. Iyer <balaji.v.iyer@intel.com>
4353
4354 PR c++/59631
4355 * c-parser.c (c_parser_postfix_expression): Replaced consecutive if
4356 statements with if-elseif statements.
4357
6685d11c 43582014-01-06 Marek Polacek <polacek@redhat.com>
4359
4360 PR c/57773
4361 * c-decl.c (check_bitfield_type_and_width): Warn for implementation
4362 defined bit-field types only in ISO C.
4363
3aea1f79 43642014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
4365
4366 Update copyright years
4367
e4f22041 43682014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
4369
4370 * c-array-notation.c: Use the standard form for the copyright notice.
4371
74acc703 43722013-12-18 Balaji V. Iyer <balaji.v.iyer@intel.com>
4373
4374 * c-parser.c (struct c_parser::cilk_simd_fn_tokens): Added new field.
4375 (c_parser_declaration_or_fndef): Added a check if cilk_simd_fn_tokens
4376 field in parser is not empty. If not-empty, call the function
4377 c_parser_finish_omp_declare_simd.
4378 (c_parser_cilk_clause_vectorlength): Modified function to be shared
4379 between SIMD-enabled functions and #pragma simd. Added new parameter.
4380 (c_parser_cilk_all_clauses): Modified the usage of the function
4381 c_parser_cilk_clause_vectorlength as mentioned above.
4382 (c_parser_cilk_simd_fn_vector_attrs): New function.
4383 (c_finish_cilk_simd_fn_tokens): Likewise.
4384 (is_cilkplus_vector_p): Likewise.
4385 (c_parser_omp_clause_name): Added checking for "vectorlength,"
4386 "nomask," and "mask" strings in clause name.
4387 (c_parser_omp_all_clauses): Added 3 new case statements:
4388 PRAGMA_CILK_CLAUSE_VECTORLENGTH, PRAGMA_CILK_CLAUSE_MASK and
4389 PRAGMA_CILK_CLAUSE_NOMASK.
4390 (c_parser_attributes): Added a cilk_simd_fn_tokens parameter. Added a
4391 check for vector attribute and if so call the function
4392 c_parser_cilk_simd_fn_vector_attrs. Also, when Cilk plus is enabled,
4393 called the function c_finish_cilk_simd_fn_tokens.
4394 (c_finish_omp_declare_simd): Added a check if cilk_simd_fn_tokens in
4395 parser field is non-empty. If so, parse them as you would parse
4396 the omp declare simd pragma.
4397 (c_parser_omp_clause_linear): Added a new bool parm. is_cilk_simd_fn.
4398 Added a check when step is a parameter and flag it as error.
4399 (CILK_SIMD_FN_CLAUSE_MASK): New #define.
4400 (c_parser_cilk_clause_name): Changed pragma_cilk_clause to
4401 pragma_omp_clause.
4402
395dc01c 44032013-12-17 Thomas Schwinge <thomas@codesourcery.com>
4404
4405 * c-parser.c (c_parser_omp_parallel): Fix description.
4406
433e804e 44072013-12-11 Balaji V. Iyer <balaji.v.iyer@intel.com>
4408
4409 * c-objc-common.h (LANG_HOOKS_CILKPLUS_FRAME_CLEANUP): Remove.
4410 (LANG_HOOKS_CILKPLUS_DETECT_SPAWN_AND_UNWRAP): Likewise.
4411 (LANG_HOOKS_CILKPLUS_CILKPLUS_GIMPLIFY_SPAWN): Likewise.
4412 * c-typeck.c (cilk_install_body_with_frame_cleanup): New function.
4413
a179a7dc 44142013-12-04 Joseph Myers <joseph@codesourcery.com>
4415
4416 PR c/52023
4417 * c-parser.c (c_parser_alignas_specifier): Use
4418 c_sizeof_or_alignof_type instead of c_alignof.
4419 (c_parser_alignof_expression): Likewise, with min_alignof
4420 parameter depending on alignof spelling used.
4421
bdf1e3c7 44222013-12-04 Marek Polacek <polacek@redhat.com>
4423
4424 PR c/54113
4425 * c-decl.c (start_function): Don't warn for missing prototype for
4426 inline functions.
4427
05e8f674 44282013-12-03 Marek Polacek <polacek@redhat.com>
4429
4430 PR c/59351
4431 * c-decl.c (build_compound_literal): Allow compound literals with
4432 empty initial value.
4433
39f74d66 44342013-12-02 Joseph Myers <joseph@codesourcery.com>
4435
4436 PR c/58235
4437 * c-typeck.c (build_modify_expr): Diagnose assignment to
4438 expression with array type.
4439
f221adca 44402013-11-29 Joseph Myers <joseph@codesourcery.com>
4441
4442 PR c/42262
4443 * c-typeck.c (process_init_element): Do not treat a string as
4444 initializing a whole array when used with a designator for an
4445 individual element.
4446
75bce827 44472013-11-29 Joseph Myers <joseph@codesourcery.com>
4448
4449 PR c/57574
4450 * c-decl.c (merge_decls): Clear DECL_EXTERNAL for a definition of
4451 an inline function following a static declaration.
4452
dc133326 44532013-11-28 Jakub Jelinek <jakub@redhat.com>
4454
4455 PR c/59310
4456 * c-parser.c (c_parser_omp_target): Copy "#pragma omp target"
4457 to p_name before calling c_parser_omp_teams instead of after.
4458 (c_parser_cilk_simd): Remove wrong ATTRIBUTE_UNUSED from parser
4459 argument. Remove unused p_name variable.
4460
d09768a4 44612013-11-27 Aldy Hernandez <aldyh@redhat.com>
4462 Jakub Jelinek <jakub@redhat.com>
4463
4464 * c-decl.c (c_builtin_function_ext_scope): Avoid binding if
4465 external_scope is NULL.
4466
73fd9cbe 44672013-11-27 Tom de Vries <tom@codesourcery.com>
4468 Marc Glisse <marc.glisse@inria.fr>
4469
4470 PR c++/59032
4471 * c-typeck.c (build_unary_op): Allow vector increment and decrement.
4472
bc61cadb 44732013-11-22 Andrew MacLeod <amacleod@redhat.com>
4474
4475 * c-typeck.c: Add required include files from gimple.h.
4476
3df42822 44772013-11-22 David Malcolm <dmalcolm@redhat.com>
4478
4479 * c-decl.c (define_label, shadow_tag_warned)
4480 (check_bitfield_type_and_width, grokdeclarator, grokparms,
4481 store_parm_decls_newstyle, store_parm_decls_oldstyle)
4482 (declspecs_add_type): Remove use of in_system_header macro.
4483 * c-parser.c (c_parser_unary_expression): Likewise.
4484 * c-typeck.c (store_init_value, process_init_element)
4485 (c_start_case): Likewise.
4486
4487 * c-decl.c (build_enumerator): Remove use of EXPR_LOC_OR_HERE
4488 macro.
4489
4490 * c-parser.c (c_parser_set_source_position_from_token): Remove
4491 reference to in_system_header from comment.
4492
08f817b3 44932013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
4494
4495 * c-decl.c (grokdeclarator): Update comment to refer to
4496 tree_to_[su]hwi rather than tree_low_cst.
4497
6a0712d4 44982013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
4499
4500 * c-decl.c, c-typeck.c: Replace tree_low_cst (..., 1) with
4501 tree_to_uhwi throughout.
4502
fcb97e84 45032013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
4504
4505 * c-parser.c: Replace tree_low_cst (..., 0) with tree_to_shwi
4506 throughout.
4507
35ec552a 45082013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
4509
4510 * c-parser.c: Replace host_integerp (..., 0) with tree_fits_shwi_p
4511 throughout.
4512
f2697631 45132013-11-15 Aldy Hernandez <aldyh@redhat.com>
4514
4515 * c-parser.c (c_parser_cilk_simd): New.
4516 (c_parser_cilk_verify_simd): New.
4517 (c_parser_pragma): Add case for PRAGMA_CILK_SIMD.
4518 (c_parser_omp_for_loop): Add case for NE_EXPR.
4519 Set c_break_label for CILK_SIMD.
4520 (c_parser_cilk_clause_vectorlength): New.
4521 (c_parser_cilk_clause_linear): New.
4522 (c_parser_cilk_clause_name): New.
4523 (c_parser_cilk_all_clauses): New.
4524 * c-typeck.c (build_unary_op): Pass location argument to
4525 readonly_error.
4526 (build_modify_expr): Same.
4527 (build_asm_expr): Same.
4528 (c_finish_bc_stmt): Error on break/continue in loops.
4529
e795d6e1 45302013-11-14 Andrew MacLeod <amacleod@redhat.com>
4531
4532 * c-typeck.c: Include only gimplify.h and gimple.h as needed.
4533
9ed99284 45342013-11-14 Diego Novillo <dnovillo@google.com>
4535
4536 * c-decl.c: Include print-tree.h.
4537 Include stor-layout.h.
4538 Include varasm.h.
4539 Include attribs.h.
4540 Include stringpool.h.
4541 * c-lang.c: Include fold-const.h.
4542 * c-parser.c: Include stringpool.h.
4543 Include attribs.h.
4544 Include stor-layout.h.
4545 Include varasm.h.
4546 Include trans-mem.h.
4547 * c-typeck.c: Include stor-layout.h.
4548 Include trans-mem.h.
4549 Include varasm.h.
4550 Include stmt.h.
4551
4fba5eb9 45522013-11-13 Joseph Myers <joseph@codesourcery.com>
4553
4554 * c-tree.h (c_typespec_keyword): Add cts_auto_type.
4555 * c-decl.c (declspecs_add_type, finish_declspecs): Handle
4556 __auto_type.
4557 * c-parser.c (c_token_starts_typename, c_token_starts_declspecs)
4558 (c_parser_attribute_any_word, c_parser_objc_selector): Handle
4559 RID_AUTO_TYPE.
4560 (c_parser_declspecs): Take argument AUTO_TYPE_OK.
4561 (c_parser_declaration_or_fndef, c_parser_struct_declaration)
4562 (c_parser_declarator, c_parser_direct_declarator_inner)
4563 (c_parser_parameter_declaration, c_parser_type_name): All callers
4564 changed.
4565 (c_parser_declaration_or_fndef): Handle declarations with type
4566 determined from the initializer.
4567
a8783bee 45682013-11-12 Andrew MacLeod <amacleod@redhat.com>
4569
e795d6e1 4570 * c-typeck.c: Include gimplify.h.
a8783bee 4571
d184e0c0 45722013-11-12 Joseph Myers <joseph@codesourcery.com>
4573
4574 * c-tree.h (struct c_declspecs): Add thread_gnu_p field.
4575 * c-parser.c (c_parser_declspecs): Mention _Thread_local in
4576 comment.
4577 * c-decl.c (shadow_tag_warned, grokdeclarator): Mention __thread
4578 or _Thread_local as appropriate in diagnostics.
4579 (build_null_declspecs): Initialize ret->thread_gnu_p.
4580 (declspecs_add_scspec): Handle either __thread or _Thread_local
4581 for RID_THREAD. Diagnose _Thread_local for pre-C11 standards if
4582 pedantic. Do not disallow _Thread_local extern and _Thread_local
4583 static.
4584
b560fabd 45852013-11-07 Joseph Myers <joseph@codesourcery.com>
4586 Andrew MacLeod <amacleod@redhat.com>
4587
4588 * c-aux-info.c (gen_type): Handle atomic qualifier.
4589 * c-decl.c (validate_proto_after_old_defn): Do not remove atomic
4590 qualifiers when compating types.
4591 (shadow_tag_warned): Handle atomic_p in declspecs.
4592 (quals_from_declspecs): Likewise.
4593 (start_decl): Use c_type_promotes_to when promoting argument
4594 types.
4595 (grokdeclarator): Handle _Atomic.
4596 (get_parm_info): Diagnose any qualifier on "void" as only
4597 parameter.
4598 (store_parm_decls_oldstyle): Do not remove atomic qualifiers when
4599 comparing types. Use c_type_promotes_to when promoting argument
4600 types.
4601 (finish_function): Use c_type_promotes_to when promoting argument
4602 types.
4603 (build_null_declspecs): Handle atomic_p in declspecs.
4604 (declspecs_add_qual): Handle RID_ATOMIC.
4605 * c-parser.c (c_token_starts_typename, c_token_is_qualifier)
4606 (c_token_starts_declspecs): Handle RID_ATOMIC.
4607 (c_parser_declspecs): Handle atomic type specifiers and
4608 qualifiers.
4609 (c_parser_typeof_specifier): Remove const and _Atomic qualifiers
4610 from types of expressions with atomic type.
4611 (c_parser_direct_declarator_inner): Use convert_lvalue_to_rvalue.
4612 (c_parser_attribute_any_word): Handle RID_ATOMIC.
4613 (c_parser_initializer, c_parser_initelt, c_parser_initval)
4614 (c_parser_statement_after_labels, c_parser_switch_statement)
4615 (c_parser_for_statement, c_parser_expr_no_commas)
4616 (c_parser_conditional_expression, c_parser_binary_expression)
4617 (c_parser_cast_expression, c_parser_unary_expression)
4618 (c_parser_postfix_expression)
4619 (c_parser_postfix_expression_after_primary, c_parser_expression):
4620 Use convert_lvalue_to_rvalue.
4621 (c_parser_expression_conv, c_parser_expr_list): Document
4622 conversion of lvalues to rvalues. Use convert_lvalue_to_rvalue.
4623 (c_parser_objc_synchronized_statement): Use
4624 convert_lvalue_to_rvalue.
4625 (c_parser_objc_selector): Handle RID_ATOMIC.
4626 (c_parser_objc_receiver, c_parser_array_notation): Use
4627 convert_lvalue_to_rvalue.
4628 * c-tree.h (ctsk_typeof): Adjust comment to mention use for
4629 _Atomic (type-name).
4630 (struct c_declspecs): Add atomic_p field.
4631 (convert_lvalue_to_rvalue): Declare.
4632 * c-typeck.c (c_type_promotes_to): Promote atomic types to
4633 corresponding atomic types.
4634 (qualify_type): Don't add _Atomic qualifiers from second argument.
4635 (comp_target_types): Do not allow _Atomic mismatches.
4636 (type_lists_compatible_p): Do not remove atomic qualifiers when
4637 comparing types.
4638 (really_atomic_lvalue, convert_lvalue_to_rvalue)
4639 (build_atomic_assign): New functions.
4640 (build_unary_op): Use build_atomic_assign for atomic increment and
4641 decrement.
4642 (build_conditional_expr): Do not treat _Atomic void as a qualified
4643 version of void.
4644 (build_modify_expr): Use build_atomic_assign for atomic LHS.
4645 (find_anonymous_field_with_type, convert_to_anonymous_field)
4646 (convert_for_assignment): Do not remove atomic qualifiers when
4647 comparing types.
4648 (digest_init): Do not accept initialization of arrays of atomic
4649 elements by string constants.
4650 (build_asm_expr): Use convert_lvalue_to_rvalue.
4651 (build_binary_op): Do not treat _Atomic void as a qualified
4652 version of void.
4653
8b023e7c 46542013-11-06 DJ Delorie <dj@redhat.com>
4655
4656 * c-decl.c (locate_old_decl): If a previous conflicting decl is
4657 both explicit and builtin, print the location of the explicit one.
4658
c630ef93 46592013-11-05 Tobias Burnus <burnus@net-b.de>
4660
4661 * c-parser.c (c_parser_omp_for, c_parser_omp_parallel,
4662 c_parser_omp_distribute, c_parser_omp_teams,
4663 c_parser_omp_target, c_parser_omp_declare): Handle
4664 -fopenmp-simd.
4665
2c4c3477 46662013-11-03 Marek Polacek <polacek@redhat.com>
4667
4668 * c-decl.c (grokdeclarator): Add VLA instrumentation.
4669
df205251 46702013-11-01 Jakub Jelinek <jakub@redhat.com>
4671
4672 * c-typeck.c (c_finish_omp_clauses) <case OMP_CLAUSE_UNIFORM>: Go to
4673 check_dup_generic at the end, unless remove is true.
4674 (c_finish_omp_clauses) <case OMP_CLAUSE_REDUCTION>: Add break; after
4675 remove = true;.
4676 (c_finish_omp_clauses) <case OMP_CLAUSE_COPYIN>: Likewise.
4677
23871d0c 46782013-10-31 Jakub Jelinek <jakub@redhat.com>
4679
4680 * c-typeck.c (c_finish_omp_clauses): Diagnose aligned clause
4681 with decl that is not pointer nor array.
4682
d037099f 46832013-10-29 Balaji V. Iyer <balaji.v.iyer@intel.com>
4684
4685 * c-decl.c (finish_function): Added a call for insert_cilk_frame when
4686 a spawning function is found.
4687 * c-objc-common.h (LANG_HOOKS_CILKPLUS_GIMPLIFY_SPAWN): New #define.
4688 (LANG_HOOKS_CILKPLUS_FRAME_CLEANUP): Likewise.
4689 (LANG_HOOKS_CILKPLUS_DETECT_SPAWN_AND_UNWRAP): Likewise.
4690 * c-parser.c (c_parser_statement_after_labels): Added RID_CILK_SYNC
4691 case.
4692 (c_parser_postfix_expression): Added RID_CILK_SPAWN case.
4693 * c-typeck.c (build_compound_expr): Reject _Cilk_spawn in a comma
4694 expr.
4695 (c_finish_return): Added a check to reject _Cilk_spawn in return
4696 expression.
4697 (build_cilk_spawn): New function.
4698 (build_cilk_sync): Likewise.
4699 * Makefile.in (c-decl.o): Added cilk.h in dependency list.
4700
4c90c04c 47012013-10-27 Tobias Burnus <burnus@net-b.de>
4702
4703 PR other/33426
4704 * c-parser.c (c_parser_while_statement, c_parser_while_statement,
4705 c_parser_pragma): Add GCC ivdep support to 'do' and 'while'.
4706 (c_parser_statement_after_labels): Update calls.
4707
48a972c8 47082013-10-24 Tobias Burnus <burnus@net-b.de>
4644b593 4709
4710 PR other/33426
4711 * c-parser.c (c_parser_pragma, c_parser_for_statement):
4712 Handle PRAGMA_IVDEP.
4713 (c_parser_statement_after_labels): Update call.
4714
12f86df0 47152013-10-24 Marek Polacek <polacek@redhat.com>
4716
4717 * c-parser.c (c_parser_struct_declaration): Add a comment.
4718 (c_parser_declarator): Don't allow _Alignas here.
4719
7740abd8 47202013-10-17 Andrew MacLeod <amacleod@redhat.com>
4721
4722 * c-parser.c: Include omp-low.h.
4723 * c-typeck.c: Likewise.
4724
43d03c23 47252013-10-17 Marek Polacek <polacek@redhat.com>
4726
4727 PR c/58267
4728 * c-parser.c (c_parser_declspecs): Add alignspec_ok parameter.
4729 Document syntax of the array-declarator.
4730 (c_parser_declspecs) <RID_ALIGNAS>: Bail out if alignment specs
4731 are not permitted.
4732 (c_parser_declaration_or_fndef): Adjust c_parser_declspecs call.
4733 (c_parser_struct_declaration): Likewise.
4734 (c_parser_declarator): Likewise.
4735 (c_parser_direct_declarator_inner): Likewise.
4736 (c_parser_parameter_declaration): Likewise.
4737 (c_parser_type_name): Likewise.
4738
bc7bff74 47392013-10-11 Jakub Jelinek <jakub@redhat.com>
4740
4741 * c-lang.h (current_omp_declare_target_attribute): New extern
4742 decl.
4743 * c-parser.c: Include c-lang.h.
4744 (struct c_parser): Change tokens to c_token *.
4745 Add tokens_buf field. Change tokens_avail type to unsigned int.
4746 (c_parser_consume_token): If parser->tokens isn't
4747 &parser->tokens_buf[0], increment parser->tokens.
4748 (c_parser_consume_pragma): Likewise.
4749 (enum pragma_context): Add pragma_struct and pragma_param.
4750 (c_parser_external_declaration): Adjust
4751 c_parser_declaration_or_fndef caller.
4752 (c_parser_declaration_or_fndef): Add omp_declare_simd_clauses
4753 argument, if it is non-vNULL vector, call c_finish_omp_declare_simd.
4754 Adjust recursive call.
4755 (c_parser_struct_or_union_specifier): Use pragma_struct instead
4756 of pragma_external.
4757 (c_parser_parameter_declaration): Use pragma_param instead of
4758 pragma_external.
4759 (c_parser_compound_statement_nostart, c_parser_label,
4760 c_parser_for_statement): Adjust
4761 c_parser_declaration_or_fndef callers.
4762 (c_parser_expr_no_commas): Add omp_atomic_lhs argument, pass
4763 it through to c_parser_conditional_expression.
4764 (c_parser_conditional_expression): Add omp_atomic_lhs argument,
4765 pass it through to c_parser_binary_expression. Adjust recursive
4766 call.
4767 (c_parser_binary_expression): Remove prec argument, add
4768 omp_atomic_lhs argument instead. Always start from PREC_NONE, if
4769 omp_atomic_lhs is non-NULL and one of the arguments of toplevel
4770 binop matches it, use build2 instead of parser_build_binary_op.
4771 (c_parser_pragma): Handle PRAGMA_OMP_CANCEL,
4772 PRAGMA_OMP_CANCELLATION_POINT, PRAGMA_OMP_TARGET,
4773 PRAGMA_OMP_END_DECLARE_TARGET, PRAGMA_OMP_DECLARE_REDUCTION.
4774 Handle pragma_struct and pragma_param the same as pragma_external.
4775 (c_parser_omp_clause_name): Parse new OpenMP 4.0 clause names.
4776 (c_parser_omp_variable_list): Parse array sections for
4777 OMP_CLAUSE_{DEPEND,MAP,TO,FROM} clauses.
4778 (c_parser_omp_clause_collapse): Fully fold collapse expression.
4779 (c_parser_omp_clause_reduction): Handle user defined reductions.
4780 (c_parser_omp_clause_branch, c_parser_omp_clause_cancelkind,
4781 c_parser_omp_clause_num_teams, c_parser_omp_clause_thread_limit,
4782 c_parser_omp_clause_aligned, c_parser_omp_clause_linear,
4783 c_parser_omp_clause_safelen, c_parser_omp_clause_simdlen,
4784 c_parser_omp_clause_depend, c_parser_omp_clause_map,
4785 c_parser_omp_clause_device, c_parser_omp_clause_dist_schedule,
4786 c_parser_omp_clause_proc_bind, c_parser_omp_clause_to,
4787 c_parser_omp_clause_from, c_parser_omp_clause_uniform): New functions.
4788 (c_parser_omp_all_clauses): Add finish_p argument. Don't call
4789 c_finish_omp_clauses if it is false. Handle new OpenMP 4.0 clauses.
4790 (c_parser_omp_atomic): Parse seq_cst clause, pass true if it is
4791 present to c_finish_omp_atomic. Handle OpenMP 4.0 atomic forms.
4792 (c_parser_omp_for_loop): Add CODE argument, pass it through
4793 to c_finish_omp_for. Change last argument to cclauses,
4794 and adjust uses to grab parallel clauses from the array of all
4795 the split clauses. Adjust c_parser_binary_expression,
4796 c_parser_declaration_or_fndef and c_finish_omp_for callers.
4797 (omp_split_clauses): New function.
4798 (c_parser_omp_simd): New function.
4799 (c_parser_omp_for): Add p_name, mask and cclauses arguments.
4800 Allow the function to be called also when parsing combined constructs,
4801 and call c_parser_omp_simd when parsing for simd.
4802 (c_parser_omp_sections_scope): If section-sequence doesn't start with
4803 #pragma omp section, require exactly one structured-block instead of
4804 sequence of statements.
4805 (c_parser_omp_sections): Add p_name, mask and cclauses arguments.
4806 Allow the function to be called also when parsing combined constructs.
4807 (c_parser_omp_parallel): Add p_name, mask and cclauses arguments.
4808 Allow the function to be called also when parsing combined
4809 constructs.
4810 (c_parser_omp_taskgroup, c_parser_omp_cancel,
4811 c_parser_omp_cancellation_point, c_parser_omp_distribute,
4812 c_parser_omp_teams, c_parser_omp_target_data,
4813 c_parser_omp_target_update, c_parser_omp_target,
4814 c_parser_omp_declare_simd, c_finish_omp_declare_simd,
4815 c_parser_omp_declare_target, c_parser_omp_end_declare_target,
4816 c_parser_omp_declare_reduction, c_parser_omp_declare): New functions.
4817 (c_parser_omp_construct): Add p_name and mask vars. Handle
4818 PRAGMA_OMP_DISTRIBUTE, PRAGMA_OMP_SIMD, PRAGMA_OMP_TASKGROUP,
4819 PRAGMA_OMP_TEAMS. Adjust c_parser_omp_for, c_parser_omp_parallel
4820 and c_parser_omp_sections callers.
4821 (c_parse_file): Initialize tparser.tokens and the_parser->tokens here.
4822 (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK,
4823 OMP_SINGLE_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1.
4824 (OMP_PARALLEL_CLAUSE_MASK): Likewise. Add OMP_CLAUSE_PROC_BIND.
4825 (OMP_TASK_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1. Add
4826 OMP_CLAUSE_DEPEND.
4827 (OMP_SIMD_CLAUSE_MASK, OMP_CANCEL_CLAUSE_MASK,
4828 OMP_CANCELLATION_POINT_CLAUSE_MASK, OMP_DISTRIBUTE_CLAUSE_MASK,
4829 OMP_TEAMS_CLAUSE_MASK, OMP_TARGET_DATA_CLAUSE_MASK,
4830 OMP_TARGET_UPDATE_CLAUSE_MASK, OMP_TARGET_CLAUSE_MASK,
4831 OMP_DECLARE_SIMD_CLAUSE_MASK): Define.
4832 * c-typeck.c: Include tree-inline.h.
4833 (c_finish_omp_cancel, c_finish_omp_cancellation_point,
4834 handle_omp_array_sections_1, handle_omp_array_sections,
4835 c_clone_omp_udr, c_find_omp_placeholder_r): New functions.
4836 (c_finish_omp_clauses): Handle new OpenMP 4.0 clauses and
4837 user defined reductions.
4838 (c_tree_equal): New function.
4839 * c-tree.h (temp_store_parm_decls, temp_pop_parm_decls,
4840 c_finish_omp_cancel, c_finish_omp_cancellation_point, c_tree_equal,
4841 c_omp_reduction_id, c_omp_reduction_decl, c_omp_reduction_lookup,
4842 c_check_omp_declare_reduction_r): New prototypes.
4843 * c-decl.c (current_omp_declare_target_attribute): New variable.
4844 (c_decl_attributes): New function.
4845 (start_decl, start_function): Use it instead of decl_attributes.
4846 (temp_store_parm_decls, temp_pop_parm_decls, c_omp_reduction_id,
4847 c_omp_reduction_decl, c_omp_reduction_lookup,
4848 c_check_omp_declare_reduction_r): New functions.
4849
3ce7d1bd 48502013-09-25 Tom Tromey <tromey@redhat.com>
4851
4852 * Make-lang.in (c/gccspec.o): Remove.
4853 (CFLAGS-c/gccspec.o): New variable.
4854 (cc1-checksum.o, C_TREE_H, c/c-aux-info.o, c/c-convert.o)
4855 (c/c-decl.o, c/c-errors.o, c/c-lang.o, c/c-objc-common.o)
4856 (c/c-parser.o, c/c-typeck.o, c/c-array-notation.o): Remove.
4857
96da1c1d 48582013-09-25 Tom Tromey <tromey@redhat.com>
4859
4860 * Make-lang.in (c/gccspec.o): Don't use subshell.
4861
1b309377 48622013-09-18 Marek Polacek <polacek@redhat.com>
4863
4864 PR sanitize/58443
4865 * c-typeck.c (build_binary_op): Properly honor -fsanitize options.
4866 Remove unnecessary check.
4867
05f893e1 48682013-09-18 Marek Polacek <polacek@redhat.com>
4869
4870 PR sanitizer/58411
4871 * c-typeck.c (build_binary_op): Don't sanitize function if it has the
4872 no_sanitize_undefined attribute.
4873
bda0b9d2 48742013-09-13 Kai Tietz <ktietz@redhat.com>
4875
4876 PR target/57848
4877 * c-decl.c (c_builtin_function_ext_scope): Remove
4878 wrong assumption that it is never called on prexisting
4879 symbol.
4880
73437615 48812013-09-08 Joern Rennecke <joern.rennecke@embecosm.com>
4882
4883 * c-typeck.c (build_binary_op): Use vector_types_compatible_elements_p.
4884
eaab24b9 48852013-09-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
4886
4887 * c-objc-common.c (c_tree_printer): Tidy.
4888
9e46467d 48892013-08-30 Marek Polacek <polacek@redhat.com>
4890
4891 * c-typeck.c (build_binary_op): Add division by zero and shift
4892 instrumentation.
4893
f8234178 48942013-08-26 Joern Rennecke <joern.rennecke@embecosm.com>
f9086116 4895 Joseph Myers <joseph@codesourcery.com>
f8234178 4896
c90a7d10 4897 PR c/35649
f8234178 4898 * c-typeck.c (c_common_type): Prefer double_type_node over
4899 other REAL_TYPE types with the same precision.
4900 (convert_arguments): Likewise.
4901
6f07f480 49022013-08-23 Gabriel Dos Reis <gdr@integrable-solutions.net>
4903
4904 * c-objc-common.c (c_tree_printer): Document the nature of the cast.
4905 (c_initialize_diagnostics): Call a destructor for the early printer.
4906
eed6bc21 49072013-08-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
4908
4909 * c-objc-common.c (c_initialize_diagnostics): Simplify C pretty
4910 printer initialization.
4911
57717943 49122013-08-19 Balaji V. Iyer <balaji.v.iyer@intel.com>
eed6bc21 4913
57717943 4914 PR c/57490
4915 * c-array-notation.c (fix_conditional_array_notations_1): Added a
4916 check for truth values.
4917 (expand_array_notation_exprs): Added truth values case. Removed an
4918 unwanted else. Added for-loop to walk through subtrees in default
4919 case.
4920
a94db6b0 49212013-08-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
4922
4923 * c-objc-common.c (c_initialize_diagnostics): Don't call pp_base.
4924
e76163a9 49252013-07-23 Joseph Myers <joseph@codesourcery.com>
4926
4927 * c-parser.c (struct c_generic_association): Fix typo.
4928
7aa04c8d 49292013-07-23 Tom Tromey <tromey@redhat.com>
4930 Joseph Myers <joseph@codesourcery.com>
4931
4932 * c-parser.c (struct c_generic_association): New.
4933 (c_generic_association_d): New typedef.
4934 (c_parser_generic_selection): New function.
4935 (c_parser_postfix_expression): Handle RID_GENERIC.
4936
76bbe4ca 49372013-07-13 Jason Merrill <jason@redhat.com>
4938
4939 PR c++/57793
4940 * c-decl.c (finish_struct): Check for too-large class.
4941
21ebaa24 49422013-07-04 Joern Rennecke <joern.rennecke@embecosm.com>
f5298614 4943
4944 PR c/57821
4945 * c-typeck.c (set_init_index): When folding, check for index overflow.
4946
936c3081 49472013-06-28 Balaji V. Iyer <balaji.v.iyer@intel.com>
4948
4949 * c-parser.c (c_parser_array_notation): Removed rejection of array
4950 notations in an array of function pointers.
4951
50acebe0 49522013-06-21 Balaji V. Iyer <balaji.v.iyer@intel.com>
4953
4954 * c-array-notation.c (make_triplet_val_inv): New function.
4955 (create_cmp_incr): Likewise.
4956 (create_array_refs): Likewise.
4957 (fix_builtin_array_notation_fn): Replaced all mallocs with tree vec.
4958 Also modularized common parts between functions and called the function.
4959 (build_array_notation_expr): Likewise.
4960 (fix_conditional_array_notations_1): Likewise.
4961 (fix_array_notation_expr): Likewise.
4962 (fix_array_notation_call_expr): Likewise.
4963
01e6cdb4 49642013-06-18 Marek Polacek <polacek@redhat.com>
4965
4966 PR c/57630
4967 * c-decl.c (check_for_loop_decls): Improve diagnostics messages.
4968
6a3adac6 49692013-06-12 Balaji V. Iyer <balaji.v.iyer@intel.com>
4970
4971 * c-array-notation.c (build_array_notation_expr): Reject array notation
4972 mismatch between LHS and RHS even inside a call_expr. Also, removed
4973 a couple while statements that were dead code.
4974
62aab3f3 49752013-06-10 Balaji V. Iyer <balaji.v.iyer@intel.com>
4976
4977 * c-array-notation.c (fix_builtin_array_notation_fn): Fully folded
4978 excessive precision expressions in function parameters. Also removed
4979 couple unwanted while statements.
4980
bfc83720 49812013-06-07 Balaji V. Iyer <balaji.v.iyer@intel.com>
4982
4983 * c-array-notation.c (expand_array_notation_exprs): Added
4984 ARRAY_NOTATION_REF case.
4985
09970d67 49862013-06-07 Balaji V. Iyer <balaji.v.iyer@intel.com>
4987
4988 * c-array-notation.c (length_mismatch_in_expr_p): Moved this
4989 function to c-family/array-notation-common.c.
4990 (is_cilkplus_reduce_builtin): Likewise.
4991 (find_rank): Likewise.
4992 (extract_array_notation_exprs): Likewise.
4993 (replace_array_notations): Likewise.
4994 (find_inv_trees): Likewise.
4995 (replace_inv_trees): Likewise.
4996 (contains_array_notation_expr): Likewise.
4997 (find_correct_array_notation_type): Likewise.
4998 (replace_invariant_exprs): Initialized additional_tcodes to NULL.
4999 (struct inv_list): Moved this to c-family/array-notation-common.c.
5000 * c-tree.h (is_cilkplus_builtin_reduce): Remove prototype.
5001
6e13bc01 50022013-06-05 Balaji V. Iyer <balaji.v.iyer@intel.com>
5003
5004 * c-typeck.c (convert_arguments): Moved checking of builtin cilkplus
5005 reduction functions outside the for-loop. Added a check if the fundecl
5006 is non-NULL. Finally, removed an unwanted if-statement, and made the
5007 body unconditional.
5008
cc92dddc 50092013-06-03 Balaji V. Iyer <balaji.v.iyer@intel.com>
5010
5011 * c-typeck.c (c_finish_if_stmt): Added a check to see if the rank of the
5012 condition of the if-statement matches the rank of else-block and then-
5013 block when array notations are used.
5014 * c-parser.c (c_parser_declaration_or_fndef): Expanded array notation
5015 expression after the entire function body is parsed.
5016 (c_parser_expr_no_commas): Delayed creating array notation expressions
5017 to the end of function parsing.
5018 * c-array-notation.c (fix_conditional_array_notations_1): Expanded the
5019 whole if-statement instead of just the condition.
5020 (expand_array_notation_exprs): Added MODIFY_EXPR case.
5021
eddc63fd 50222013-06-03 Balaji V. Iyer <balaji.v.iyer@intel.com>
5023
5024 PR c/57474
5025 * c-array-notation.c (build_array_notation_expr): Initialized rhs_length
5026 array to NULL_TREE if they are unused. Also added a check for the
5027 field to be NULL before its fields are used in future.
5028
a2115a4a 50292013-05-29 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5030
5031 PR bootstrap/57450
5032 * c-array-notation.c (length_mismatch_in_expr_p): Use absu_hwi.
5033 (build_array_notation_expr): Likewise.
5034
3c6d4197 50352013-05-28 Balaji V. Iyer <balaji.v.iyer@intel.com>
5036
5037 * c-typeck.c (build_array_ref): Added a check to see if array's
5038 index is greater than one. If true, then emit an error.
5039 (build_function_call_vec): Exclude error reporting and checking
5040 for builtin array-notation functions.
5041 (convert_arguments): Likewise.
5042 (c_finish_return): Added a check for array notations as a return
5043 expression. If true, then emit an error.
5044 (c_finish_loop): Added a check for array notations in a loop
5045 condition. If true then emit an error.
5046 (lvalue_p): Added a ARRAY_NOTATION_REF case.
5047 (build_binary_op): Added a check for array notation expr inside
5048 op1 and op0. If present, we call another function to find correct
5049 type.
5050 * Make-lang.in (C_AND_OBJC_OBJS): Added c-array-notation.o.
5051 * c-parser.c (c_parser_compound_statement): Check if array
5052 notation code is used in tree, if so, then transform them into
5053 appropriate C code.
5054 (c_parser_expr_no_commas): Check if array notation is used in LHS
5055 or RHS, if so, then build array notation expression instead of
5056 regular modify.
5057 (c_parser_postfix_expression_after_primary): Added a check for
5058 colon(s) after square braces, if so then handle it like an array
5059 notation. Also, break up array notations in unary op if found.
5060 (c_parser_direct_declarator_inner): Added a check for array
5061 notation.
5062 (c_parser_compound_statement): Added a check for array notation in
5063 a stmt. If one is present, then expand array notation expr.
5064 (c_parser_if_statement): Likewise.
5065 (c_parser_switch_statement): Added a check for array notations in
5066 a switch statement's condition. If true, then output an error.
5067 (c_parser_while_statement): Similarly, but for a while.
5068 (c_parser_do_statement): Similarly, but for a do-while.
5069 (c_parser_for_statement): Similarly, but for a for-loop.
5070 (c_parser_unary_expression): Check if array notation is used in a
5071 pre-increment or pre-decrement expression. If true, then expand
5072 them.
5073 (c_parser_array_notation): New function.
5074 * c-array-notation.c: New file.
5075 * c-tree.h (is_cilkplus_reduce_builtin): Protoize.
5076
2c1c8a2c 50772013-05-23 Mike Stump <mikestump@comcast.net>
5078
5079 * c-typeck.c (convert_for_assignment): Handle references to memory
5080 spaces better.
5081
be5f9e46 50822013-05-16 Jason Merrill <jason@redhat.com>
5083
5084 * Make-lang.in (cc1$(exeext)): Use link mutex.
5085
9205a6cc 50862013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
5087
5088 * c-typeck.c (pointer_diff): Change -Wpointer-arith pedwarns
5089 to simply use OPT_Wpointer_arith.
5090 (build_unary_op): Likewise.
5091
0b049e15 50922013-04-03 Jakub Jelinek <jakub@redhat.com>
5093
5094 PR c/19449
5095 * c-parser.c (c_parser_get_builtin_args): Add choose_expr_p
5096 argument. If set, or it temporarily for parsing of the first
5097 argument into force_folding_builtin_constant_p.
5098 (c_parser_postfix_expression): Adjust callers.
5099
8e966116 51002013-03-21 Richard Biener <rguenther@suse.de>
5101
5102 * c-objc-common.c (c_tree_printer): Use DECL_HAS_DEBUG_EXPR_P
5103 instead of DECL_DEBUG_EXPR_IS_FROM. Guard properly.
5104
b862f263 51052013-02-12 Marek Polacek <polacek@redhat.com>
5106
5107 PR c/44938
5108 * c-parser.c (c_parser_postfix_expression_after_primary): Initialize
5109 origtypes to NULL.
5110
54550ecb 51112013-01-24 Jakub Jelinek <jakub@redhat.com>
5112
5113 PR c/56078
5114 * c-typeck.c (set_nonincremental_init_from_string): If
5115 constructor_max_index is NULL, treat it as if tree_int_cst_lt
5116 returned false.
5117 (process_init_element): Likewise.
5118
035b65e2 51192012-12-20 Jakub Jelinek <jakub@redhat.com>
5120
5121 PR c++/55619
5122 * c-parser.c (c_parser_asm_operands): Remove CONVERT_P
5123 argument, don't call default_function_array_conversion
5124 nor c_fully_fold here.
5125 (c_parser_asm_statement): Adjust callers.
5126 * c-typeck.c (build_asm_expr): Call c_fully_fold on inputs
5127 and outputs here, and call default_function_array_conversion
5128 on inputs that don't need to be addressable.
5129
7cbb7f1a 51302012-12-18 Jakub Jelinek <jakub@redhat.com>
5131
5132 PR c/39464
5133 * c-typeck.c (convert_for_assignment): For -Wpointer-sign
5134 warning require that both c_common_unsigned_type as well as
5135 c_common_signed_type is the same for both mvl and mvr types.
5136
f1f41a6c 51372012-11-16 Diego Novillo <dnovillo@google.com>
5138
5139 Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)
5140
5141 * c-common.c: Use new vec API in vec.h.
5142 * c-common.h: Likewise.
5143 * c-gimplify.c: Likewise.
5144 * c-pragma.c: Likewise.
5145 * c-pretty-print.c: Likewise.
5146 * c-pretty-print.h: Likewise.
5147 * c-semantics.c: Likewise.
5148 * c-decl.c: Likewise.
5149 * c-parser.c: Likewise.
5150 * c-tree.h: Likewise.
5151 * c-typeck.c: Likewise.
5152
8b447d3f 51532012-10-29 Jonathan Wakely <jwakely.gcc@gmail.com>
5154
5155 PR c++/54930
5156 * c-typeck.c (c_finish_return): Use OPT_Wreturn_local_addr.
5157
08fc5390 51582012-10-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
5159
5160 PR c/53066
5161 * c-decl.c (warn_if_shadowing): Do not warn if a variable
5162 shadows a function, unless the variable is a function or a
5163 pointer-to-function.
5164
57f872a2 51652012-10-12 Jakub Jelinek <jakub@redhat.com>
5166
5167 PR c/54381
5168 * c-parser.c (struct c_tree_loc_pair): Removed.
5169 (c_parser_expr_list): Remove struct c_tree_loc_pair * argument,
5170 add location_t * and tree * arguments, fill in array of 3
5171 sizeof_arg trees and corresponding locs.
5172 (c_parser_attributes, c_parser_objc_keywordexpr): Adjust
5173 c_parser_expr_list callers.
5174 (c_parser_postfix_expression_after_primary): Likewise. Pass
5175 array of 3 sizeof_arg trees and locs (corresponding to first
5176 3 arguments) to sizeof_pointer_memaccess_warning.
5177
d1455aa3 51782012-10-09 Lawrence Crowl <crowl@google.com>
5179
5180 * Make-lang.in (c-decl.o): Add dependence on hash-table.h.
5181 * c-decl.c (detect_field_duplicates_hash): Change to new type-safe
5182 hash table.
5183
b0e7825e 51842012-10-09 Paolo Carlini <paolo.carlini@oracle.com>
5185
5186 PR c++/54194
5187 * c-typeck.c (parser_build_binary_op): Update warn_about_parentheses
5188 call.
5189
41ed701a 51902012-10-09 Marc Glisse <marc.glisse@inria.fr>
5191
5192 PR c++/54427
5193 * c-typeck.c: Include c-common.h.
5194 (enum stv_conv): Moved to c-common.h.
5195 (scalar_to_vector): Moved to c-common.c.
5196 (build_binary_op): Adapt to scalar_to_vector's new prototype.
5197 * Make-lang.in: c-typeck.c depends on c-common.h.
5198
ef34afc1 51992012-10-04 Arnaud Charlet <charlet@adacore.com>
5200
5201 * c-decl.c (c_write_global_declarations): Fix handling of
5202 -fdump-ada-spec*.
5203
7bd765d4 52042012-09-30 Sharad Singhai <singhai@google.com>
5205
5206 * c-decl.c (c_write_global_declarations): Use a different method
5207 to determine if the dump has ben initialized.
5208
c4b1a13a 52092012-09-14 Joseph Myers <joseph@codesourcery.com>
5210
5211 PR c/54552
5212 * c-typeck.c (c_cast_expr): When casting to a type requiring
5213 C_MAYBE_CONST_EXPR to be created, pass the inner expression to
5214 c_fully_fold first.
5215
bb554051 52162012-09-14 Joseph Myers <joseph@codesourcery.com>
5217
5218 PR c/54103
5219 * c-typeck.c (build_unary_op): Pass original argument of
5220 TRUTH_NOT_EXPR to c_objc_common_truthvalue_conversion, then remove
5221 any C_MAYBE_CONST_EXPR, if it has integer operands.
5222 (build_binary_op): Pass original arguments of TRUTH_ANDIF_EXPR,
5223 TRUTH_ORIF_EXPR, TRUTH_AND_EXPR, TRUTH_OR_EXPR and TRUTH_XOR_EXPR
5224 to c_objc_common_truthvalue_conversion, then remove any
5225 C_MAYBE_CONST_EXPR, if they have integer operands. Use
5226 c_objc_common_truthvalue_conversion not
5227 c_common_truthvalue_conversion.
5228 (c_objc_common_truthvalue_conversion): Build NE_EXPR directly and
5229 call note_integer_operands for arguments with integer operands
5230 that are not integer constants.
5231
c708c6ef 52322012-09-13 Jakub Jelinek <jakub@redhat.com>
5233
5234 PR c/54559
5235 * c-typeck.c (c_finish_return): Do convert to BOOLEAN_TYPE or
5236 COMPLEX_TYPE with in_late_binary_op set temporarily to true.
5237
cce20430 52382012-08-31 Jakub Jelinek <jakub@redhat.com>
5239
5240 PR c/54428
5241 * c-convert.c (convert): Don't call fold_convert_loc if
5242 TYPE_MAIN_VARIANT of a COMPLEX_TYPE is the same, unless e
5243 is a COMPLEX_EXPR. Remove TYPE_MAIN_VARIANT check from
5244 COMPLEX_TYPE -> COMPLEX_TYPE conversion.
5245
a90d57ed 52462012-08-24 Jakub Jelinek <jakub@redhat.com>
5247
5248 PR c/54355
5249 * c-decl.c (c_parser_label): Pass true as nested and fix up comments
5250 for nested and empty_ok arguments in the call to
5251 c_parser_declaration_or_fndef.
5252
f003f5dc 52532012-08-17 Jakub Jelinek <jakub@redhat.com>
5254
5255 * c-tree.h (c_last_sizeof_arg): Declare.
5256 * c-parser.c (struct c_tree_loc_pair): New type.
5257 (c_parser_expr_list): Add sizeof_arg argument. Fill it in if
5258 non-NULL.
5259 (c_parser_attributes, c_parser_objc_keywordexpr): Adjust callers.
5260 (c_parser_postfix_expression_after_primary): Likewise. Call
5261 sizeof_pointer_memaccess_warning if needed.
5262 (sizeof_ptr_memacc_comptypes): New function.
5263 * c-typeck.c (c_last_sizeof_arg): New global variable.
5264 (c_expr_sizeof_expr, c_expr_sizeof_type): Initialize it.
5265
a5656b73 52662012-07-24 Uros Bizjak <ubizjak@gmail.com>
5267
5268 * c-lang.h (lang_decl): Add variable_size GTY option.
5269
b9ed1410 52702012-07-16 Steven Bosscher <steven@gcc.gnu.org>
5271
5272 * c-decl.c: Include dumpfile.h instead of tree-dump.h.
5273 * Make-lang.in: Fix dependencies.
5274
e53d55e7 52752012-06-29 Steven Bosscher <steven@gcc.gnu.org>
5276
5277 * Make-lang.in: New file, rules migrated from gcc/Makefile.in
5278 and add language Makefile hooks.
5279 * config-lang.in: New file.
5280 * c-config-lang.in: Moved from gcc/config-lang.in to here, and
5281 add the required "normal" config-lang.in rules.
5282 * c-lang.h: Moved from gcc/ to here.
5283 * c-tree.h: Likewise.
5284 * c-objc-common.c: Likewise.
5285 * c-objc-common.h: Likewise.
5286 * c-typeck.c: Likewise.
5287 * c-convert.c: Likewise.
5288 * c-lang.c: Likewise.
5289 * c-aux-info.c: Likewise.
5290 * c-errors.c: Likewise.
5291 * gccspec.c: Likewise.
5292 * c-decl.c: Likewise. Include gt-c-c-decl.h, not gt-c-decl.h.
5293 * c-parser.c: Likewise. Include gt-c-c-parser.h, not gt-c-parser.h.
5294\f
aad93da1 5295Copyright (C) 2012-2017 Free Software Foundation, Inc.
e53d55e7 5296
5297Copying and distribution of this file, with or without modification,
5298are permitted in any medium without royalty provided the copyright
5299notice and this notice are preserved.