]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/c/ChangeLog
Introduce class edit_context
[thirdparty/gcc.git] / gcc / c / ChangeLog
CommitLineData
c7afb782 12016-09-01 Marek Polacek <polacek@redhat.com>
2
3 PR c/7652
4 * c-typeck.c (composite_type): Add FALLTHRU comment.
5
986530da 62016-08-31 David Malcolm <dmalcolm@redhat.com>
7
8 * c-parser.c (c_parser_declaration_or_fndef): Add trailing space
9 to the insertion fixits for "struct", "union", and "enum".
10
850c2009 112016-08-30 David Malcolm <dmalcolm@redhat.com>
12
13 * c-decl.c (implicit_decl_warning): Use add_fixit_replace
14 rather than add_fixit_misspelled_id.
15 (undeclared_variable): Likewise.
16 * c-parser.c (c_parser_declaration_or_fndef): Likewise. Remove
17 now-redundant "here" params from add_fixit_insert method calls.
18 (c_parser_parameter_declaration): Likewise.
19 * c-typeck.c (build_component_ref): Remove now-redundant range
20 param from add_fixit_replace method calls.
21
c4963714 222016-08-25 Marek Polacek <polacek@redhat.com>
23
24 * c-typeck.c (parser_build_binary_op): Pass LHS to
25 warn_logical_not_parentheses.
26
49e1f4eb 272016-08-25 Marek Polacek <polacek@redhat.com>
28
29 PR c/77323
30 * c-decl.c (declspecs_add_type): Set typespec_word even when __intN
31 or _FloatN or _FloatNx is not supported.
32 (finish_declspecs): Set type to integer_type_node when _FloatN or
33 _FloatNx is not supported.
34
82c85aba 352016-08-19 Joseph Myers <joseph@codesourcery.com>
36
37 PR c/32187
38 * c-tree.h (cts_floatn_nx): New enum c_typespec_keyword value.
39 (struct c_declspecs): Add field floatn_nx_idx.
40 * c-decl.c (declspecs_add_type, finish_declspecs): Handle _FloatN
41 and _FloatNx type specifiers.
42 * c-parser.c (c_keyword_starts_typename, c_token_starts_declspecs)
43 (c_parser_declspecs, c_parser_attribute_any_word)
44 (c_parser_objc_selector): Use CASE_RID_FLOATN_NX.
45 * c-typeck.c (c_common_type): Handle _FloatN and _FloatNx types.
46 (convert_arguments): Avoid promoting _FloatN and _FloatNx types
47 narrower than double.
48
7175bb2a 492016-08-12 Jakub Jelinek <jakub@redhat.com>
50 Martin Liska <mliska@suse.cz>
51
52 PR c/67410
53 * c-typeck.c (set_nonincremental_init_from_string): Use / instead of
54 % to determine val element to change. Assert that
55 wchar_bytes * charwidth fits into val array.
56
e3533433 572016-08-12 Marek Polacek <polacek@redhat.com>
58
59 PR c/7652
60 * c-parser.c (c_parser_external_declaration): Add FALLTHRU.
61 (c_parser_postfix_expression): Likewise.
62 * c-typeck.c (build_unary_op): Adjust fall through comment.
63 (c_mark_addressable): Likewise.
64
74be5bc1 652016-08-11 Jakub Jelinek <jakub@redhat.com>
66
67 PR c/72816
68 * c-decl.c (grokdeclarator): When adding TYPE_DOMAIN for flexible
69 array member through typedef, for orig_qual_indirect == 0 clear
70 orig_qual_type.
71
7af4d06b 722016-08-08 David Malcolm <dmalcolm@redhat.com>
73
74 PR c/64955
75 * c-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): If CHECKING_P, wire
76 this up to selftest::run_c_tests.
77 (selftest::run_c_tests): New function.
78
5f429ee2 792016-08-04 Thomas Schwinge <thomas@codesourcery.com>
80
1fa5d8ba 81 * c-parser.c (struct oacc_routine_data): Add error_seen and
82 fndecl_seen members.
83 (c_finish_oacc_routine): Use these.
84 (c_parser_declaration_or_fndef): Adjust.
85 (c_parser_oacc_routine): Likewise. Support more C language
86 constructs, and improve diagnostics. Move pragma context
87 checking...
88 (c_parser_pragma): ... here.
89
5f429ee2 90 * c-parser.c (struct oacc_routine_data): New.
91 (c_parser_declaration_or_fndef, c_parser_oacc_routine): Use it.
92 Simplify code.
93 (c_finish_oacc_routine): Likewise. Don't attach clauses to "omp
94 declare target" attribute.
95
f3c032a4 962016-08-01 Jan Beulich <jbeulich@suse.com>
97
98 * c-fold.c (c_fully_fold_internal): Also emit shift count
99 warnings for vector types.
100 * c-typeck.c (build_binary_op): Likewise.
101
4ebf85be 1022016-07-29 Marek Polacek <polacek@redhat.com>
103
104 PR c/71742
105 * c-decl.c (finish_struct): Rephrase an error message.
106
9efe5be6 107 PR c/71853
108 * c-parser.c (c_parser_switch_statement): Initialize ce.original_type
109 to error node for invalid code.
110
4c4548bb 111 PR c/71573
112 * c-decl.c (implicitly_declare): Return decl early not only for
113 error_mark_nodes, but for anything that is not a FUNCTION_DECL.
114
322d4184 1152016-07-29 Jakub Jelinek <jakub@redhat.com>
116
117 PR c/71969
118 * c-decl.c (finish_function): Only set DECL_DISREGARD_INLINE_LIMITS
119 on GNU extern inline functions.
120
35fddbd6 1212016-07-29 Marek Polacek <polacek@redhat.com>
122
123 PR c/71583
124 * c-parser.c (c_parser_postfix_expression_after_paren_type): Also
125 check expr.value.
126
59c1507a 1272016-07-22 Uros Bizjak <ubizjak@gmail.com>
128
129 * c-typeck.c: Use HOST_WIDE_INT_1 instead of (HOST_WIDE_INT) 1,
130
d0f11d68 1312016-07-20 David Malcolm <dmalcolm@redhat.com>
132
133 * c-decl.c (struct edit_distance_traits<cpp_hashnode *>): Move to
134 spellcheck-tree.h
135 (best_macro_match): Likewise, converting from a typedef to a
136 subclass.
137 (find_closest_macro_cpp_cb): Move to spellcheck-tree.c.
138 (lookup_name_fuzzy): Update for change of best_macro_match to a
139 subclass with a ctor that calls cpp_forall_identifiers.
140
d208f6e6 1412016-07-20 David Malcolm <dmalcolm@redhat.com>
142
143 * c-decl.c (implicit_decl_warning): Update for conversion of
144 return type of lookup_name_fuzzy to const char *.
145 (undeclared_variable): Likewise.
146 (lookup_name_fuzzy): Convert return type from tree to
147 const char *.
148 * c-parser.c (c_parser_declaration_or_fndef): Update for
149 conversion of return type of lookup_name_fuzzy to const char *.
150 (c_parser_parameter_declaration): Likewise.
151
0ef9358d 1522016-07-15 Cesar Philippidis <cesar@codesourcery.com>
153
154 * c-parser.c (c_parser_oacc_declare): Don't scan for
155 GOMP_MAP_POINTER.
156 * c-typeck.c (handle_omp_array_sections): Mark data clauses with
157 GOMP_MAP_FORCE_{PRESENT,TO,FROM,TOFROM} as potentially having
158 zero-length subarrays.
159
0dd7db3b 1602016-07-15 Jakub Jelinek <jakub@redhat.com>
161
162 PR c/71858
163 * c-decl.c (implicit_decl_warning): Use FUZZY_LOOKUP_FUNCTION_NAME
164 instead of FUZZY_LOOKUP_NAME.
165 (lookup_name_fuzzy): For FUZZY_LOOKUP_FUNCTION_NAME consider
166 FUNCTION_DECLs, {VAR,PARM}_DECLs function pointers and macros.
167
28413b15 1682016-07-14 Jakub Jelinek <jakub@redhat.com>
169
170 PR c/71858
171 * c-decl.c (lookup_name_fuzzy): Ignore binding->invisible.
172
e9258aee 1732016-07-12 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
174
175 * c-parser.c (c_parser_generic_selection): Make type of variable
176 auto_vec.
177 (c_parser_omp_declare_simd): Likewise.
178
57f91a55 1792016-07-12 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
180
181 * c-decl.c (struct c_struct_parse_info): Change member types
182 from vec to auto_vec.
183 (start_struct): Adjust.
184 (finish_struct): Likewise.
185
c364d0f3 1862016-07-02 Jakub Jelinek <jakub@redhat.com>
187
188 PR c/71719
189 * c-typeck.c (mark_exp_read): Handle VIEW_CONVERT_EXPR.
190
44e775d8 1912016-06-29 Thomas Schwinge <thomas@codesourcery.com>
192
193 * c-parser.c (c_parser_pragma) <PRAGMA_OMP_CANCELLATION_POINT>:
194 Move pragma context checking into...
195 (c_parser_omp_cancellation_point): ... here, and improve
196 diagnostic messages.
197 * c-typeck.c (c_finish_omp_cancel)
198 (c_finish_omp_cancellation_point): Improve diagnostic messages.
199
1af10ce6 2002016-06-29 Jakub Jelinek <jakub@redhat.com>
201
202 PR c/71685
203 * c-typeck.c (c_build_qualified_type): Don't clear
204 C_TYPE_INCOMPLETE_VARS for the main variant.
205
2062016-06-28 Martin Sebor <msebor@redhat.com>
9c3ffbcb 207
208 PR c/71552
209 * c-typeck.c (output_init_element): Diagnose incompatible types
210 before non-constant initializers.
211
6eb2402f 2122016-06-28 Jakub Jelinek <jakub@redhat.com>
213
214 * Make-lang.in: Don't cat ../stage_current if it does not exist.
215
b4c71cbb 2162016-06-23 Andi Kleen <ak@linux.intel.com>
217
218 * Make-lang.in: Add support for autofdo.
219
8469aece 2202016-06-22 David Malcolm <dmalcolm@redhat.com>
221
222 PR c/70339
223 * c-decl.c: Include spellcheck-tree.h and gcc-rich-location.h.
224 (implicit_decl_warning): When issuing warnings for implicit
225 declarations, attempt to provide a suggestion via
226 lookup_name_fuzzy.
227 (undeclared_variable): Likewise when issuing errors.
228 (lookup_name_in_scope): Likewise.
229 (struct edit_distance_traits<cpp_hashnode *>): New struct.
230 (best_macro_match): New typedef.
231 (find_closest_macro_cpp_cb): New function.
232 (lookup_name_fuzzy): New function.
233 * c-parser.c: Include gcc-rich-location.h.
234 (c_token_starts_typename): Split out case CPP_KEYWORD into...
235 (c_keyword_starts_typename): ...this new function.
236 (c_parser_declaration_or_fndef): When issuing errors about
237 missing "struct" etc, add a fixit. For other kinds of errors,
238 attempt to provide a suggestion via lookup_name_fuzzy.
239 (c_parser_parms_declarator): When looking ahead to detect typos in
240 type names, also reject CPP_KEYWORD.
241 (c_parser_parameter_declaration): When issuing errors about
242 unknown type names, attempt to provide a suggestion via
243 lookup_name_fuzzy.
244 * c-tree.h (c_keyword_starts_typename): New prototype.
245
e218d07f 2462016-06-20 Joseph Myers <joseph@codesourcery.com>
247
248 PR c/71601
249 * c-typeck.c (build_conditional_expr): Return error_mark_node if
250 c_common_type returns error_mark_node.
251
21897f47 2522016-06-19 Martin Sebor <msebor@redhat.com>
253
254 PR c/69507
255 * c-parser.c (c_parser_alignof_expression): Avoid diagnosing
256 __alignof__ (expression).
257
f0d77991 2582016-06-14 David Malcolm <dmalcolm@redhat.com>
259
260 * c-typeck.c: Include spellcheck-tree.h rather than spellcheck.h.
261
2a990300 2622016-06-14 David Malcolm <dmalcolm@redhat.com>
263
264 * c-typeck.c (build_component_ref): Simplify fixit code by
265 using gcc_rich_location::add_fixit_misspelled_id.
266 (set_init_label): Likewise.
267
527790c1 2682016-06-13 David Malcolm <dmalcolm@redhat.com>
269
270 * c-parser.c (c_parser_initelt): Provide location of name for new
271 location_t param of set_init_label.
272 * c-tree.h (set_init_label): Add location_t param.
273 * c-typeck.c (set_init_index): Add "fieldname_loc" location_t
274 param and use it when issuing error messages about unrecognized
275 field names. Attempt to provide a fixit hint if appropriate,
276 otherwise update the error message to provide the type name.
277
ccfa030f 2782016-06-10 Thomas Schwinge <thomas@codesourcery.com>
279
280 PR c/71381
281 * c-parser.c (c_parser_omp_variable_list) <OMP_CLAUSE__CACHE_>:
282 Loosen checking.
283
732905bb 2842016-06-08 Martin Sebor <msebor@redhat.com>
285 Jakub Jelinek <jakub@redhat.com>
286
287 PR c++/70507
288 PR c/68120
289 * c-typeck.c (convert_arguments): Don't promote last argument
290 of BUILT_IN_{ADD,SUB,MUL}_OVERFLOW_P.
291
bafc7b1d 2922016-06-08 Marek Polacek <polacek@redhat.com>
293
294 PR c/71418
295 * c-decl.c (grokdeclarator): Check TYPE_P.
296
06e590e7 297 PR c/71426
298 * c-decl.c (get_parm_info): Don't crash on an assert on invalid
299 code.
300
7cfde92a 3012016-06-07 David Malcolm <dmalcolm@redhat.com>
302
303 * c-parser.c (c_parser_postfix_expression): In __builtin_offsetof
304 and structure element reference, capture the location of the
305 element name token and pass it to build_component_ref.
306 (c_parser_postfix_expression_after_primary): Likewise for
307 structure element dereference.
308 (c_parser_omp_variable_list): Likewise for
309 OMP_CLAUSE_{_CACHE, MAP, FROM, TO},
310 * c-tree.h (build_component_ref): Add location_t param.
311 * c-typeck.c (build_component_ref): Add location_t param
312 COMPONENT_LOC. Use it, if available, when issuing hints about
313 mispelled member names to provide a fixit replacement hint.
314
61f1f80c 3152016-06-06 Marek Polacek <polacek@redhat.com>
316
317 PR c/71362
318 * c-parser.c (c_parser_direct_declarator): Set location.
319
e4b92538 3202016-06-06 Marek Polacek <polacek@redhat.com>
321
322 * c-typeck.c (comptypes_internal): Handle comparisons of
323 INTEGER_TYPE, FIXED_POINT_TYPE, and REAL_TYPE nodes. Don't check
324 TYPE_REF_CAN_ALIAS_ALL.
325
2234363c 3262016-06-03 Chung-Lin Tang <cltang@codesourcery.com>
327
328 * c-typeck.c (c_finish_omp_clauses): Mark OpenACC reduction
329 arguments as addressable when async clause exists.
330
b6431756 3312016-05-30 Jakub Jelinek <jakub@redhat.com>
332
333 PR c++/71349
334 * c-parser.c (c_parser_omp_for): Don't disallow nowait clause
335 when combined with target construct.
336
6feab9ce 3372016-05-26 Jakub Jelinek <jakub@redhat.com>
338
339 * c-parser.c (c_parser_omp_clause_schedule): Warn if
340 OMP_CLAUSE_SCHEDULE_CHUNK_EXPR is known not to be positive.
341
2c995da9 3422016-05-25 Marek Polacek <polacek@redhat.com>
343
344 PR c/71265
345 * c-decl.c (c_make_fname_decl): Don't check seen_error.
346
abfbb5b5 347 PR c/71266
348 * c-decl.c (store_parm_decls_oldstyle): Skip non-PARM_DECLs.
349
6d6a3fc3 3502016-05-24 Cesar Philippidis <cesar@codesourcery.com>
351
352 * c-parser.c (c_parser_oacc_declare): Add support for
353 GOMP_MAP_FIRSTPRIVATE_POINTER.
354 * c-typeck.c (handle_omp_array_sections_1): Replace bool is_omp
355 argument with enum c_omp_region_type ort.
356 (handle_omp_array_sections): Likewise. Update call to
357 handle_omp_array_sections_1.
358 (c_finish_omp_clauses): Add specific errors and warning messages for
359 OpenACC. Use firsrtprivate pointers for OpenACC subarrays. Update
360 call to handle_omp_array_sections.
361
c9d624bd 3622016-05-24 Thomas Schwinge <thomas@codesourcery.com>
363
364 * c-parser.c (c_parser_oacc_routine): Tighten syntax checks.
365
7345b977 3662016-05-24 Richard Biener <rguenther@suse.de>
367
368 PR middle-end/70434
369 PR c/69504
370 * c-typeck.c (build_array_ref): Do not complain about indexing
371 non-lvalue vectors. Adjust for function name change.
372
8bdfbc08 3732016-05-20 Martin Sebor <msebor@redhat.com>
374
375 PR c/71115
376 * c-typeck.c (error_init): Use
377 expansion_point_location_if_in_system_header.
378 (warning_init): Same.
379
97c71d71 3802016-05-19 David Malcolm <dmalcolm@redhat.com>
381
382 PR c/71171
383 * c-parser.c (c_parser_generic_selection): Use c_expr::set_error
384 in error-handling.
385 (c_parser_postfix_expression): Likewise.
386 * c-tree.h (c_expr::set_error): New method.
387 * c-typeck.c (parser_build_binary_op): In error-handling, ensure
388 that result's range is initialized.
389
e68d7b49 3902016-05-17 James Greenhalgh <james.greenhalgh@arm.com>
391
392 * c-typeck.c (parser_build_unary_op): Fix formatting.
393
624115b4 3942016-05-16 Matthew Wahab <matthew.wahab@arm.com>
395
396 * c-decl.c (grokdeclarator): Remove errmsg and use of
397 targetm.invalid_return_type.
398 (grokparms): Remove errmsg and use of
399 targetm.invalid_parameter_type.
400
90c88567 4012016-05-13 Joseph Myers <joseph@codesourcery.com>
402
403 * c-decl.c (grokdeclarator): For C11, discard qualifiers on
404 function return type.
405
22a3f7bd 4062016-05-12 Marek Polacek <polacek@redhat.com>
407
408 PR c/70756
409 * c-decl.c (build_compound_literal): Pass LOC down to
410 c_incomplete_type_error.
411 * c-tree.h (require_complete_type): Adjust declaration.
412 (c_incomplete_type_error): Likewise.
413 * c-typeck.c (require_complete_type): Add location parameter, pass it
414 down to c_incomplete_type_error.
415 (c_incomplete_type_error): Add location parameter, pass it down to
416 error_at.
417 (build_component_ref): Pass location down to c_incomplete_type_error.
418 (default_conversion): Pass location down to require_complete_type.
419 (build_array_ref): Likewise.
420 (build_function_call_vec): Likewise.
421 (convert_arguments): Likewise.
422 (build_unary_op): Likewise.
423 (build_c_cast): Likewise.
424 (build_modify_expr): Likewise.
425 (convert_for_assignment): Likewise.
426 (c_finish_omp_clauses): Likewise.
427
54c4d22e 4282016-05-11 Mikhail Maltsev <maltsevm@gmail.com>
429
430 PR c/43651
431 * c-decl.c (declspecs_add_qual): Warn when -Wduplicate-decl-specifier
432 is enabled.
433 * c-errors.c (pedwarn_c90): Return true if warned.
434 * c-tree.h (pedwarn_c90): Change return type to bool.
435 (enum c_declspec_word): Add new enumerator cdw_atomic.
436
7f8012a5 4372016-05-11 Marek Polacek <polacek@redhat.com>
438
439 PR c++/71024
440 * c-decl.c (diagnose_mismatched_decls): Factor out code to
441 diagnose_mismatched_attributes and call it.
442
3fa82609 4432016-05-10 Marek Polacek <polacek@redhat.com>
444
445 PR c/70255
446 * c-decl.c (diagnose_mismatched_decls): Warn for optimize attribute
447 on a declaration following the definition.
448
871164c4 4492016-05-05 Jakub Jelinek <jakub@redhat.com>
450
451 * c-parser.c (c_parser_switch_statement): Add IF_P argument,
452 parse it through to c_parser_c99_block_statement.
453 (c_parser_statement_after_labels): Adjust c_parser_switch_statement
454 caller.
455
1d52c456 4562016-05-04 Marek Polacek <polacek@redhat.com>
457
458 * c-parser.c (c_parser_if_statement): Replace OPT_Wparentheses with
459 OPT_Wdangling_else.
460
a64030fe 4612016-05-04 Marek Polacek <polacek@redhat.com>
462
463 PR c/48778
464 * c-typeck.c (build_binary_op): Don't issue -Waddress warnings
465 for macro expansions.
466
5d4db8ef 4672016-05-03 Marek Polacek <polacek@redhat.com>
468
469 PR c/70859
470 * c-typeck.c (build_function_call_vec): Pass LOC and ARG_LOC down to
471 check_builtin_function_arguments.
472
0bd2fc6e 4732016-05-03 Richard Biener <rguenther@suse.de>
474
475 * Make-lang.in (cc1-checksum.c): For stage-final re-use
476 the checksum from the previous stage.
477
b5e88f74 4782016-05-02 Cesar Philippidis <cesar@codesourcery.com>
479
480 * c-parser.c (c_parser_oacc_all_clauses): Update call to
481 c_finish_omp_clauses.
482 (c_parser_omp_all_clauses): Likewise.
483 (c_parser_oacc_cache): Likewise.
484 (c_parser_oacc_loop): Likewise.
485 (omp_split_clauses): Likewise.
486 (c_parser_omp_declare_target): Likewise.
487 (c_parser_cilk_all_clauses): Likewise.
488 (c_parser_cilk_for): Likewise.
489 * c-typeck.c (c_finish_omp_clauses): Replace bool arguments
490 is_omp, declare_simd, and is_cilk with enum c_omp_region_type ort.
491
dd185f6e 4922016-05-02 Marek Polacek <polacek@redhat.com>
493
494 PR c/70851
495 * c-decl.c (grokdeclarator): Diagnose when array's size has an
496 incomplete type.
497
4d0a8bac 4982016-04-29 Cesar Philippidis <cesar@codesourcery.com>
499
500 PR middle-end/70626
501 * c-parser.c (c_parser_oacc_loop): Don't augment mask with
502 OACC_LOOP_CLAUSE_MASK.
503 (c_parser_oacc_kernels_parallel): Update call to
504 c_oacc_split_loop_clauses.
505
d215eeca 5062016-04-28 Andrew MacLeod <amacleod@redhat.com>
507
508 * c-array-notation.c (fix_builtin_array_notation_fn): Fix final
509 argument to build_modify_expr in two cases.
510
40385231 5112016-04-27 Bernd Schmidt <bschmidt@redhat.com>
512
513 * c-parser.c (c_parser_postfix_expression_after_primary): Call
514 warn_for_memset instead of warning directly here.
515
fa20ebd3 5162016-04-26 Marek Polacek <polacek@redhat.com>
517
518 PR c/67784
519 * c-parser.c (c_parser_maybe_reclassify_token): New function factored
520 out of ...
521 (c_parser_for_statement): ... here.
522 (c_parser_if_statement): Use it.
523 (c_parser_switch_statement): Use it.
524 (c_parser_while_statement): Use it.
525
9db47803 526 PR c/70791
527 * c-decl.c (pushdecl): Pass LOCUS down to warning.
528
70574e60 5292016-04-20 Ilya Verbin <ilya.verbin@intel.com>
530
531 PR c++/69363
532 * c-parser.c (c_parser_cilk_all_clauses): Use c_finish_omp_clauses
533 instead of c_finish_cilk_clauses.
534 * c-tree.h (c_finish_omp_clauses): Add new default argument.
535 * c-typeck.c (c_finish_omp_clauses): Add new argument. Allow
536 floating-point variables in the linear clause for Cilk Plus.
537
5d4b30ea 5382016-04-18 Michael Matz <matz@suse.de>
539
540 * c-decl.c (merge_decls): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
541 (grokdeclarator, parser_xref_tag, finish_enum): Use SET_TYPE_ALIGN.
542
eac243e7 5432016-04-15 Marek Polacek <polacek@redhat.com>
544
545 PR c/70671
546 * c-typeck.c (build_unary_op): Pass location down to error and
547 warning call.
548
b4ba8358 5492016-04-15 Jakub Jelinek <jakub@redhat.com>
550
551 PR c/70436
552 * c-parser.c (c_parser_pragma): Add IF_P argument, pass it down
553 where needed.
554 (c_parser_external_declaration, c_parser_struct_or_union_specifier,
555 c_parser_parameter_declaration, c_parser_compound_statement_nostart,
556 c_parser_objc_class_instance_variables, c_parser_objc_methodprotolist):
557 Adjust c_parser_pragma callers.
558 (c_parser_statement_after_labels): Likewise. Adjust c_parser_cilk_for
559 caller.
560 (c_parser_omp_structured_block): Add IF_P argument, pass it down to
561 c_parser_statement.
562 (c_parser_oacc_data, c_parser_oacc_host_data, c_parser_oacc_loop,
563 c_parser_oacc_kernels_parallel, c_parser_omp_critical,
564 c_parser_omp_simd, c_parser_omp_for, c_parser_omp_master,
565 c_parser_omp_ordered, c_parser_omp_parallel, c_parser_omp_single,
566 c_parser_omp_task, c_parser_omp_taskgroup, c_parser_omp_distribute,
567 c_parser_omp_teams, c_parser_omp_target_data, c_parser_omp_target,
568 c_parser_omp_taskloop, c_parser_omp_construct, c_parser_cilk_grainsize,
569 c_parser_cilk_simd, c_parser_cilk_for): Add IF_P argument, pass it
570 down where needed.
571 (c_parser_omp_for_loop): Likewise. Clear IF_P if nbraces.
572 (c_parser_omp_sections_scope): Adjust c_parser_omp_structured_block
573 calls.
574
0241e4dc 5752016-04-13 Marek Polacek <polacek@redhat.com>
576
577 PR c/70436
578 * c-parser.c (c_parser_statement_after_labels): Add IF_P argument and
579 adjust callers.
580 (c_parser_statement): Likewise.
581 (c_parser_c99_block_statement): Likewise.
582 (c_parser_while_statement): Likewise.
583 (c_parser_for_statement): Likewise.
584 (c_parser_if_body): Don't set IF_P here.
585 (c_parser_if_statement): Add IF_P argument. Set IF_P here. Warn
586 about dangling else here.
587 * c-tree.h (c_finish_if_stmt): Adjust declaration.
588 * c-typeck.c (c_finish_if_stmt): Remove NESTED_IF parameter. Don't
589 warn about dangling else here.
590
c4f5465d 5912016-04-04 Marek Polacek <polacek@redhat.com>
592
593 PR c/70307
594 * c-fold.c (c_fully_fold_internal): Handle VEC_COND_EXPR.
595
7952b661 5962016-03-31 Marek Polacek <polacek@redhat.com>
597
598 PR c/70297
599 * c-decl.c (merge_decls): Also set TYPE_ALIGN and TYPE_USER_ALIGN.
600
5539bc70 6012016-03-18 David Malcolm <dmalcolm@redhat.com>
602
603 PR c/70281
604 * c-parser.c (c_parser_postfix_expression): Set the source range
605 for uses of "__builtin_types_compatible_p".
606
29a514fa 6072016-03-17 Jakub Jelinek <jakub@redhat.com>
608
609 PR c/70280
610 * c-typeck.c (composite_type): Don't count void_list_node
611 into len, if the list is terminated by void_list_node, start
612 with void_list_node instead of NULL for newargs. Stop
613 at void_list_node.
614
462ca422 6152016-03-16 Marek Polacek <polacek@redhat.com>
616
617 PR c/70093
618 * c-typeck.c (build_function_call_vec): Create a TARGET_EXPR for
619 nested functions returning VM types.
620
27dcb7a8 6212016-03-09 Cesar Philippidis <cesar@codesourcery.com>
622
623 * c-parser.c (c_parser_oacc_loop): Update cclauses and clauses
624 when calling c_finish_omp_clauses.
625
2d1d2e55 6262016-03-04 Bernd Schmidt <bschmidt@redhat.com>
627
628 PR c/69824
629 * c-decl.c (get_parm_info): Don't queue implicit function declarations
630 for later.
631
6560d1ad 6322016-03-04 Marek Polacek <polacek@redhat.com>
633
634 PR c/69798
635 * c-parser.c (c_parser_postfix_expression): Call
636 c_parser_cast_expression rather than c_parser_postfix_expression.
637
40e9ce2d 6382016-03-01 Jakub Jelinek <jakub@redhat.com>
639
640 PR c/69796
641 PR c/69974
642 * c-parser.c (c_parser_translation_unit): Don't change TREE_TYPE
643 of incomplete decls to error_mark_node.
644
f0ea75d1 6452016-02-24 Marek Polacek <polacek@redhat.com>
646
647 PR c/69819
648 * c-decl.c (finish_decl): Don't update the copy of the type of a
649 different decl type.
650
d41ab738 6512016-02-23 Jakub Jelinek <jakub@redhat.com>
652
653 PR objc/69844
654 * c-parser.c (c_parser_for_statement): Properly handle ObjC classes
655 in id_kind reclassification.
656
7675e968 6572016-02-16 Jakub Jelinek <jakub@redhat.com>
658
659 PR c/69835
660 * c-typeck.c (build_binary_op): Revert 2015-09-09 change.
661
28072426 6622016-02-16 James Norris <jnorris@codesourcery.com>
663
664 PR c/64748
665 * c-parser.c (c_parser_oacc_data_clause_deviceptr): Allow parms.
666
74a4140f 6672016-02-12 Bernd Schmidt <bschmidt@redhat.com>
668
7c25ed5c 669 * c-decl.c (build_null_declspecs): Zero the entire struct.
670
74a4140f 671 PR c/69522
672 * c-parser.c (c_parser_braced_init): New arg outer_obstack. All
673 callers changed. If nested_p is true, use it to call
674 finish_implicit_inits.
675 * c-tree.h (finish_implicit_inits): Declare.
676 * c-typeck.c (finish_implicit_inits): New function. Move code
677 from ...
678 (push_init_level): ... here.
679 (set_designator, process_init_element): Call finish_implicit_inits.
680
40b38ace 6812016-02-11 Jakub Jelinek <jakub@redhat.com>
682
683 PR c/69768
684 * c-typeck.c (parser_build_binary_op): Strip nops from integer_zerop
685 arguments for -Waddress warning.
686
6b098e91 6872016-02-04 Jakub Jelinek <jakub@redhat.com>
688
689 PR c/69669
690 * c-decl.c (finish_enum): When honoring mode attribute,
691 make sure to use proper TYPE_MIN_VALUE and TYPE_MAX_VALUE.
692
ff5e28e9 6932016-01-29 Jakub Jelinek <jakub@redhat.com>
694
695 PR debug/69518
696 * c-decl.c (finish_struct): Clear C_TYPE_INCOMPLETE_VARS in
697 all type variants, not just TYPE_MAIN_VARIANT.
698
78e516eb 6992016-01-27 Jakub Jelinek <jakub@redhat.com>
700
701 PR debug/66869
702 * c-decl.c (c_write_global_declarations_1): Warn with
703 warn_unused_function if static prototype without definition
704 is not C_DECL_USED.
705
fee5e491 7062016-01-27 Marek Polacek <polacek@redhat.com>
707
708 PR c/68062
709 * c-typeck.c (build_binary_op) [EQ_EXPR, GE_EXPR]: Promote operand
710 to unsigned, if needed. Add -Wsign-compare warning.
711
9bbfd060 7122016-01-26 Jakub Jelinek <jakub@redhat.com>
713
714 PR tree-optimization/69483
715 * c-parser.c (c_parser_translation_unit): Use FOR_EACH_VEC_ELT.
716
6ebc6587 7172016-01-20 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
16d4186f 718
719 PR c/24293
720 * c-tree.h (incomplete_record_decls): Declare.
721 * c-parser.c (incomplete_record_decls): Define.
722 (c_parser_translation_unit): Iterate through incomplete_record_decls and
723 report error if any decl has zero size.
724 * c-decl.c (finish_decl): Append static decl with incomplete struct/union
725 or enum type to incomplete_record_decls.
726
4c39e3a5 7272016-01-14 Tom de Vries <tom@codesourcery.com>
728
729 PR tree-optimization/68773
730 * c-parser.c (c_parser_oacc_declare, c_parser_omp_declare_target): Don't
731 set force_output.
732
77f35cec 7332016-01-14 Marek Polacek <polacek@redhat.com>
734
735 PR c/69262
736 * c-decl.c (grokdeclarator): Provide more information for invalid
737 array declarations.
738
d74214f3 7392016-01-06 David Malcolm <dmalcolm@redhat.com>
740
741 * c-parser.c (c_parser_unary_expression): For dereferences, build
742 a combined location before calling build_indirect_ref, so that
743 error reports cover the full range, manually updating the c_expr
744 src_range.
745
be3c9981 7462016-01-06 Marek Polacek <polacek@redhat.com>
747
748 PR sanitizer/69099
749 * c-convert.c (convert) [INTEGER_TYPE]: Drop ARG. Don't pass ARG to
750 ubsan_instrument_float_cast. Fold EXPR. Use NULL_TREE instead of
751 NULL.
752
f1717362 7532016-01-04 Jakub Jelinek <jakub@redhat.com>
754
755 Update copyright years.
756
d7d6a3ab 7572016-01-04 Marek Polacek <polacek@redhat.com>
758
759 PR c/68908
760 * c-typeck.c (build_atomic_assign): Improve commentary. Add
761 optimization to use __atomic_fetch_* built-in if possible.
762
9d5fd7c6 7632015-12-23 Thomas Schwinge <thomas@codesourcery.com>
764
765 * c-parser.c (c_parser_oacc_clause_use_device): Merge function
766 into...
767 (c_parser_omp_clause_use_device_ptr): ... this function. Adjust
768 all users.
769
37e2d32f 7702015-12-22 Marek Polacek <polacek@redhat.com>
771
772 PR c/69002
773 * c-typeck.c (build_component_ref): Warn when acessing elements of
774 atomic structures or unions.
775
c0bf500c 7762015-12-21 David Malcolm <dmalcolm@redhat.com>
777
778 * c-typeck.c: Include "gcc-rich-location.h".
779 (build_binary_op): In the two places that call binary_op_error,
780 create a gcc_rich_location and populate it with the location of
781 the binary op and its two operands.
782
b9f9586a 7832015-12-16 David Malcolm <dmalcolm@redhat.com>
784
785 * c-parser.c (c_parser_statement_after_labels): When calling
786 c_finish_return, Use the return expression's location if it has
787 one, falling back to the location of the first token within it.
788 * c-typeck.c (c_finish_return): When issuing warnings about
789 the incorrect presence/absence of a return value, issue a note
790 showing the declaration of the function.
791
dbd79382 7922015-12-16 David Malcolm <dmalcolm@redhat.com>
793
794 * c-parser.c (struct c_parser): Expand array "tokens_buf" from 2
795 to 4.
796 (c_parser_peek_nth_token): New function.
797 (c_parser_peek_conflict_marker): New function.
798 (c_parser_error): Detect conflict markers and report them as such.
799
e2093e02 8002015-12-16 David Malcolm <dmalcolm@redhat.com>
801
802 * c-parser.c (c_parser_postfix_expression): Use EXPR_LOC_OR_LOC
803 to preserve range information for the primary expression
804 in the call to c_parser_postfix_expression_after_primary.
805
b49f1fbb 8062015-12-16 David Malcolm <dmalcolm@redhat.com>
807
808 * c-parser.c (c_parser_static_assert_declaration_no_semi): Use the
809 expression location, falling back on the first token location,
810 rather than always using the latter.
811
1d65bac2 8122015-12-16 Marek Polacek <polacek@redhat.com>
813
814 PR c/64637
815 * c-typeck.c (c_process_expr_stmt): Use location of the expression if
816 available.
817
75e722a6 8182015-12-15 Marek Polacek <polacek@redhat.com>
819
820 PR c/68907
821 * c-typeck.c (build_atomic_assign): Set TREE_NO_WARNING on an
822 artificial decl.
823
7063d45b 8242015-12-08 David Malcolm <dmalcolm@redhat.com>
825
826 * c-parser.c (c_parser_alignof_expression): Capture location of
827 closing parenthesis (if any), or of end of unary expression, and
828 use it to build a src_range for the expression.
829
f73b4782 8302015-12-08 David Malcolm <dmalcolm@redhat.com>
831
832 PR c/68757
833 * c-parser.c (c_parser_get_builtin_args): Add
834 "out_close_paren_loc" param, and write back to it.
835 (c_parser_postfix_expression): Capture the closing
836 parenthesis location for RID_CHOOSE_EXPR,
837 RID_BUILTIN_CALL_WITH_STATIC_CHAIN, RID_BUILTIN_COMPLEX,
838 RID_BUILTIN_SHUFFLE and use it to set the source range
839 for such expressions; within RID_BUILTIN_COMPLEX set
840 the underlying location.
841
1b062945 8422015-12-07 Marek Polacek <polacek@redhat.com>
843
844 PR c/68668
845 * c-decl.c (grokdeclarator): If ORIG_QUAL_INDIRECT is indirect, use
846 TREE_TYPE of ORIG_QUAL_TYPE, otherwise decrement ORIG_QUAL_INDIRECT.
847
a4ab54ac 8482015-12-04 Eric Botcazou <ebotcazou@adacore.com>
849
850 * c-tree.h (c_build_va_arg): Adjust prototype.
851 * c-parser.c (c_parser_postfix_expression): Adjust call to above.
852 * c-typeck.c (c_build_va_arg): Rename LOC parameter to LOC2, add LOC1
853 parameter, adjust throughout and issue an error if EXPR is a component
854 with reverse storage order.
855
da562e32 8562015-12-02 Jason Merrill <jason@redhat.com>
857
858 * c-fold.c (c_disable_warnings, c_enable_warnings, c_fully_fold)
859 (c_fully_fold_internal, decl_constant_value_for_optimization):
860 Move from c-common.c.
861 * c-tree.h: Declare decl_constant_value_for_optimization.
862 * Make-lang.in (C_AND_OBJC_OBJS): Add c-fold.o.
863
89f16034 8642015-12-02 Joseph Myers <joseph@codesourcery.com>
865
866 PR c/68162
867 * c-decl.c (grokdeclarator): Set first_non_attr_kind before
868 following link from declarator to next declarator. Track original
869 qualified type and pass it to c_build_qualified_type.
870 * c-typeck.c (c_build_qualified_type): Add arguments
871 orig_qual_type and orig_qual_indirect.
872
2a7545d5 8732015-12-02 Thomas Schwinge <thomas@codesourcery.com>
874
875 * c-parser.c (c_parser_omp_clause_name)
876 (c_parser_oacc_all_clauses): Alphabetical sorting.
877
ad80582d 8782015-12-02 Jakub Jelinek <jakub@redhat.com>
879
880 PR c/68533
881 * c-decl.c (get_parm_info): Use b->locus instead of input_location
882 for diagnostics.
883
571b3486 8842015-12-01 Julian Brown <julian@codesourcery.com>
885 Cesar Philippidis <cesar@codesourcery.com>
886 James Norris <James_Norris@mentor.com>
887
888 * c-parser.c (c_parser_omp_clause_name): Add use_device support.
889 (c_parser_oacc_clause_use_device): New function.
890 (c_parser_oacc_all_clauses): Add use_device support.
891 (OACC_HOST_DATA_CLAUSE_MASK): New macro.
892 (c_parser_oacc_host_data): New function.
893 (c_parser_omp_construct): Add host_data support.
894 * c-tree.h (c_finish_oacc_host_data): Add prototype.
895 * c-typeck.c (c_finish_oacc_host_data): New function.
896 (c_finish_omp_clauses): Add use_device support.
897
c4848393 8982015-11-29 Jan Hubicka <hubicka@ucw.cz>
899
900 PR c/67106
901 * c-decl.c: Set TYPE_PACKED in variants.
902
d4e328e9 9032015-11-27 Martin Liska <mliska@suse.cz>
904
905 PR c++/68312
906 * c-array-notation.c (fix_builtin_array_notation_fn):
907 Use release_vec_vec instead of vec::release.
908 (build_array_notation_expr): Likewise.
909 (fix_conditional_array_notations_1): Likewise.
910 (fix_array_notation_expr): Likewise.
911 (fix_array_notation_call_expr): Likewise.
912
c5e4f591 9132015-11-27 Jakub Jelinek <jakub@redhat.com>
914
915 PR c/63326
916 * c-parser.c (c_parser_compound_statement_nostart): If
917 last_label is true, use pragma_stmt instead of pragma_compound
918 as second c_parser_pragma argument.
919 (c_parser_omp_ordered, c_parser_omp_target_update,
920 c_parser_omp_target_enter_data, c_parser_omp_target_exit_data): Pass
921 false as second argument to c_parser_skip_to_pragma_eol after
922 diagnosing standalone directives used in pragma_stmt context.
923
c954a5bd 9242015-11-24 Ilya Verbin <ilya.verbin@intel.com>
925
926 * c-parser.c (c_parser_oacc_declare): Replace "ifdef ENABLE_OFFLOADING"
927 with "if (ENABLE_OFFLOADING)".
928
daebf4f3 9292015-11-23 David Malcolm <dmalcolm@redhat.com>
930
931 PR objc/68438
932 * c-parser.c (c_parser_postfix_expression): Set up source ranges
933 for various Objective-C constructs: Class.name syntax,
934 @selector(), @protocol(), @encode(), and [] message syntax.
935
734caf84 9362015-11-20 David Malcolm <dmalcolm@redhat.com>
937
938 PR 62314
939 * c-typeck.c (should_suggest_deref_p): New function.
940 (build_component_ref): Special-case POINTER_TYPE when
941 generating a "not a structure of union" error message, and
942 suggest a "->" rather than a ".", providing a fix-it hint.
943
11d8dd6f 9442015-11-19 David Malcolm <dmalcolm@redhat.com>
945
946 * c-typeck.c (lookup_field_fuzzy): Move determination of closest
947 candidate into a new function, find_closest_identifier.
948
62efaf6b 9492015-11-19 Marek Polacek <polacek@redhat.com>
950
951 PR c/68412
952 * c-typeck.c (parser_build_binary_op): Properly handle
953 C_MAYBE_CONST_EXPR before calling warn_tautological_cmp.
954
9dfffd6d 9552015-11-17 David Malcolm <dmalcolm@redhat.com>
956
957 * c-parser.c (set_c_expr_source_range): Bulletproof both
958 overloaded implementations against NULL expr->value.
959 (c_parser_braced_init): Set src_range for "ret" to a sane pair of
960 values.
961 (c_parser_unary_expression): Likewise when handling addresses of
962 labels.
963 (c_parser_postfix_expression): Likewise for statement expressions,
964 for __FUNCTION__, __PRETTY_FUNCTION_ and __func__ keywords, for
965 __builtin_va_arg, and for __builtin_offset_of.
966 (c_parser_postfix_expression_after_paren_type): Initialize expr's
967 src_range using the range of the braced initializer.
968 (c_parser_transaction_expression): Set src_range for "ret" to a
969 sane pair of values.
970
c58a4cfd 9712015-11-16 Kirill Yukhin <kirill.yukhin@intel.com>
972
973 * c-parser.c (c_finish_omp_declare_simd): Look for
974 "simd" attribute as well. Update error message.
975
5f3001a9 9762015-11-14 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
977
978 * c-parser.c (c_parser_omp_declare_target): Adjust.
979
a9833286 9802015-11-14 Jakub Jelinek <jakub@redhat.com>
981
982 * c-typeck.c (c_finish_omp_clauses): Don't mark
983 GOMP_MAP_FIRSTPRIVATE_POINTER decls addressable.
984
ef61516b 9852015-11-14 Marek Polacek <polacek@redhat.com>
986
987 * c-decl.c: Use RECORD_OR_UNION_TYPE_P throughout.
988 * c-typeck.c: Likewise.
989
a96cefb2 9902015-11-13 David Malcolm <dmalcolm@redhat.com>
991
992 * c-decl.c (warn_defaults_to): Pass line_table to
993 rich_location ctor.
994 * c-errors.c (pedwarn_c99): Likewise.
995 (pedwarn_c90): Likewise.
996 * c-parser.c (set_c_expr_source_range): New functions.
997 (c_token::get_range): New method.
998 (c_token::get_finish): New method.
999 (c_parser_expr_no_commas): Call set_c_expr_source_range on the ret
1000 based on the range from the start of the LHS to the end of the
1001 RHS.
1002 (c_parser_conditional_expression): Likewise, based on the range
1003 from the start of the cond.value to the end of exp2.value.
1004 (c_parser_binary_expression): Call set_c_expr_source_range on
1005 the stack values for TRUTH_ANDIF_EXPR and TRUTH_ORIF_EXPR.
1006 (c_parser_cast_expression): Call set_c_expr_source_range on ret
1007 based on the cast_loc through to the end of the expr.
1008 (c_parser_unary_expression): Likewise, based on the
1009 op_loc through to the end of op.
1010 (c_parser_sizeof_expression) Likewise, based on the start of the
1011 sizeof token through to either the closing paren or the end of
1012 expr.
1013 (c_parser_postfix_expression): Likewise, using the token range,
1014 or from the open paren through to the close paren for
1015 parenthesized expressions.
1016 (c_parser_postfix_expression_after_primary): Likewise, for
1017 various kinds of expression.
1018 * c-tree.h (struct c_expr): Add field "src_range".
1019 (c_expr::get_start): New method.
1020 (c_expr::get_finish): New method.
1021 (set_c_expr_source_range): New decls.
1022 * c-typeck.c (parser_build_unary_op): Call set_c_expr_source_range
1023 on ret for prefix unary ops.
1024 (parser_build_binary_op): Likewise, running from the start of
1025 arg1.value through to the end of arg2.value.
1026
7a810b2f 10272015-11-13 Marek Polacek <polacek@redhat.com>
1028
1029 PR c/68320
1030 * c-parser.c (c_parser_for_statement): Treat unknown tokens as IDs.
1031
b67f0560 10322015-11-13 David Malcolm <dmalcolm@redhat.com>
1033
1034 * c-typeck.c: Include spellcheck.h.
1035 (lookup_field_fuzzy_find_candidates): New function.
1036 (lookup_field_fuzzy): New function.
1037 (build_component_ref): If the field was not found, try using
1038 lookup_field_fuzzy and potentially offer a suggestion.
1039
2fc5e987 10402015-11-12 James Norris <jnorris@codesourcery.com>
1041 Joseph Myers <joseph@codesourcery.com>
1042
1043 * c-parser.c (c_parser_pragma): Handle PRAGMA_OACC_DECLARE.
1044 (c_parser_omp_clause_name): Handle 'device_resident' clause.
1045 (c_parser_oacc_data_clause): Handle PRAGMA_OACC_CLAUSE_DEVICE_RESIDENT
1046 and PRAGMA_OMP_CLAUSE_LINK.
1047 (c_parser_oacc_all_clauses): Handle PRAGMA_OACC_CLAUSE_DEVICE_RESIDENT
1048 and PRAGMA_OACC_CLAUSE_LINK.
1049 (OACC_DECLARE_CLAUSE_MASK): New definition.
1050 (c_parser_oacc_declare): New function.
1051
28a70e29 10522015-11-12 Marek Polacek <polacek@redhat.com>
1053
1054 PR c/67784
1055 * c-parser.c (c_parser_for_statement): Reclassify the token in
1056 a correct scope.
1057
81b1b2a8 10582015-11-11 Marek Polacek <polacek@redhat.com>
1059
1060 PR c/68107
1061 PR c++/68266
1062 * c-decl.c (grokdeclarator): Call valid_array_size_p. Remove code
1063 checking the size of an array.
1064
6e803544 10652015-11-11 Andrew MacLeod <amacleod@redhat.com>
1066
1067 * c-array-notation.c: Remove unused header files.
1068 * c-aux-info.c: Likewise.
1069 * c-convert.c: Likewise.
1070 * c-decl.c: Likewise.
1071 * c-errors.c: Likewise.
1072 * c-lang.c: Likewise.
1073 * c-objc-common.c: Likewise.
1074 * c-parser.c: Likewise.
1075 * c-typeck.c: Likewise.
1076 * gccspec.c: Likewise.
1077
a1b7fe4b 10782015-11-09 Thomas Schwinge <thomas@codesourcery.com>
1079 Cesar Philippidis <cesar@codesourcery.com>
1080 James Norris <jnorris@codesourcery.com>
1081 Julian Brown <julian@codesourcery.com>
1082 Nathan Sidwell <nathan@codesourcery.com>
1083
1084 c/
1085 * c-parser.c (c_parser_declaration_or_fndef): Add OpenACC
1086 routine arg.
1087 (c_parser_declaration_or_fndef): Call c_finish_oacc_routine.
1088 (c_parser_pragma): Parse 'acc routine'.
1089 (OACC_ROUTINE_CLAUSE_MARK): Define.
1090 (c_parser_oacc_routine, (c_finish_oacc_routine): New.
1091
7758d608 10922015-11-09 Andreas Arnez <arnez@linux.vnet.ibm.com>
1093
1094 PR debug/67192
1095 * c-typeck.c (c_finish_loop): For unconditional loops, set the
1096 location of the backward-goto to the start of the loop body.
1097
c2bf2fb2 10982015-11-09 Andreas Arnez <arnez@linux.vnet.ibm.com>
1099
1100 PR debug/67192
1101 * c-parser.c (c_parser_while_statement): Finish the loop before
1102 parsing ahead for misleading indentation.
1103 (c_parser_for_statement): Likewise.
1104
292237f3 11052015-11-08 Eric Botcazou <ebotcazou@adacore.com>
1106
1107 * c-decl.c (finish_struct): If the structure has reverse storage
1108 order, rewrite the type of array fields with scalar component. Call
1109 maybe_apply_pragma_scalar_storage_order on entry.
1110 * c-typeck.c (build_unary_op) <ADDR_EXPR>: Remove left-overs. Issue
1111 errors on bit-fields and reverse SSO here and not...
1112 (c_mark_addressable): ...here.
1113 (output_init_element): Adjust call to initializer_constant_valid_p.
1114 (c_build_qualified_type): Propagate TYPE_REVERSE_STORAGE_ORDER.
1115
f0479000 11162015-11-06 David Malcolm <dmalcolm@redhat.com>
1117
1118 * c-decl.c (warn_defaults_to): Update for change in signature
1119 of diagnostic_set_info.
1120 * c-errors.c (pedwarn_c99): Likewise.
1121 (pedwarn_c90): Likewise.
1122 * c-objc-common.c (c_tree_printer): Update for new "caret_p" param
1123 for textinfo::set_location.
1124
ef014f95 11252015-11-05 Cesar Philippidis <cesar@codesourcery.com>
1126 Thomas Schwinge <thomas@codesourcery.com>
1127 James Norris <jnorris@codesourcery.com>
1128
1129 * c-parser.c (c_parser_omp_clause_name): Add support for
1130 PRAGMA_OACC_CLAUSE_INDEPENDENT and PRAGMA_OACC_CLAUSE_TILE.
1131 (c_parser_omp_clause_default): Add is_oacc argument. Handle
1132 default(none) in OpenACC.
1133 (c_parser_oacc_shape_clause): Allow pointer variables as gang static
1134 arguments.
1135 (c_parser_oacc_clause_tile): New function.
1136 (c_parser_oacc_all_clauses): Add support for OMP_CLAUSE_DEFAULT,
1137 OMP_CLAUSE_INDEPENDENT and OMP_CLAUSE_TILE.
1138 (OACC_LOOP_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_{PRIVATE,INDEPENDENT,
1139 TILE}.
1140 (OACC_KERNELS_MASK): Add PRAGMA_OACC_CLAUSE_DEFAULT.
1141 (OACC_PARALLEL_MASK): Add PRAGMA_OACC_CLAUSE_{DEFAULT,PRIVATE,
1142 FIRSTPRIVATE}.
1143 (c_parser_omp_all_clauses): Update call to c_parser_omp_clause_default.
1144 (c_parser_oacc_update): Update the error message for missing clauses.
1145 * c-typeck.c (c_finish_omp_clauses): Add support for OMP_CLAUSE_TILE
1146 and OMP_CLAUSE_INDEPENDENT.
1147
f480ca9a 11482015-11-05 Marek Polacek <polacek@redhat.com>
1149
1150 PR c/68090
1151 * c-parser.c (c_parser_postfix_expression_after_paren_type): Don't
1152 deal with pre-evaluation on invalid types.
1153
9561765e 11542015-11-05 Jakub Jelinek <jakub@redhat.com>
1155 Ilya Verbin <ilya.verbin@intel.com>
1156
1157 * c-parser.c: Include context.h and gimple-expr.h.
1158 (c_parser_omp_clause_schedule): Parse schedule modifiers, diagnose
1159 monotonic together with nonmonotonic.
1160 (c_parser_omp_for_loop): Call c_omp_check_loop_iv. Call add_stmt here.
1161 (OMP_DISTRIBUTE_CLAUSE_MASK): Add lastprivate clause.
1162 (c_parser_omp_target_data, c_parser_omp_target_enter_data,
1163 c_parser_omp_target_exit_data): Allow GOMP_MAP_ALWAYS_POINTER.
1164 (c_parser_omp_target): Likewise. Evaluate num_teams and thread_limit
1165 expressions on combined target teams before the target.
1166 (c_parser_omp_declare_target): If decl has "omp declare target" or
1167 "omp declare target link" attribute, and cgraph or varpool node already
1168 exists, then set corresponding flags. Call c_finish_omp_clauses
1169 in the parenthesized extended-list syntax case.
1170 * c-decl.c (c_decl_attributes): Don't diagnose block scope vars inside
1171 declare target.
1172 * c-typeck.c (handle_omp_array_sections_1): Allow non-zero low-bound
1173 on OMP_CLAUSE_REDUCTION array sections.
1174 (handle_omp_array_sections): Encode low-bound into the MEM_REF, either
1175 into the constant offset, or for variable low-bound using
1176 POINTER_PLUS_EXPR. For structure element based array sections use
1177 GOMP_MAP_ALWAYS_POINTER instead of GOMP_MAP_FIRSTPRIVATE_POINTER.
1178 (c_finish_omp_clauses): Drop generic_field_head, structure
1179 elements are now always mapped even as array section bases,
1180 diagnose same var in data sharing and mapping clauses. Diagnose if
1181 linear step on declare simd is neither a constant nor a uniform
1182 parameter. Look through POINTER_PLUS_EXPR for array section
1183 reductions. Diagnose the same var or function appearing multiple
1184 times on the same directive. Fix up wording for the to clause if t
1185 is neither a FUNCTION_DECL nor a VAR_DECL. Diagnose nonmonotonic
1186 modifier on kinds other than dynamic or guided or nonmonotonic
1187 modifier together with ordered clause.
1188
9e10bfb7 11892015-11-03 Thomas Schwinge <thomas@codesourcery.com>
1190 Chung-Lin Tang <cltang@codesourcery.com>
1191
1192 * c-parser.c (c_parser_omp_construct): Handle PRAGMA_OACC_ATOMIC.
1193
4cba6f60 11942015-10-29 Andrew MacLeod <amacleod@redhat.com>
1195
1196 * c-array-notation.c: Reorder #include's and remove duplicates.
1197 * c-aux-info.c: Likewise.
1198 * c-convert.c: Likewise.
1199 * c-decl.c: Likewise.
1200 * c-errors.c: Likewise.
1201 * c-lang.c: Likewise.
1202 * c-objc-common.c: Likewise.
1203 * c-parser.c: Likewise.
1204 * c-typeck.c: Likewise.
1205
7b15d957 12062015-10-26 Jim Wilson <jim.wilson@linaro.org>
1207
1208 PR debug/66068
1209 * c-typeck.c (c_build_qualified_type): Clear C_TYPE_INCOMPLETE_VARS
1210 after calling build_qualified_type.
1211
62c48328 12122015-10-27 Cesar Philippidis <cesar@codesourcery.com>
1213 Thomas Schwinge <thomas@codesourcery.com>
1214 James Norris <jnorris@codesourcery.com>
1215 Joseph Myers <joseph@codesourcery.com>
1216 Julian Brown <julian@codesourcery.com>
1217 Bernd Schmidt <bschmidt@redhat.com>
1218
1219 * c-parser.c (c_parser_oacc_shape_clause): New.
1220 (c_parser_oacc_simple_clause): New.
1221 (c_parser_oacc_all_clauses): Add auto, gang, seq, vector, worker.
1222 (OACC_LOOP_CLAUSE_MASK): Add gang, worker, vector, auto, seq.
1223
2c4c8725 12242015-10-27 Thomas Schwinge <thomas@codesourcery.com>
1225 James Norris <jnorris@codesourcery.com>
1226 Cesar Philippidis <cesar@codesourcery.com>
1227
1228 PR c/64765
1229 PR c/64880
1230 * c-parser.c (c_parser_oacc_loop): Add mask, cclauses formal
1231 parameters, and handle these. Adjust all users.
1232 (c_parser_oacc_kernels, c_parser_oacc_parallel): Merge functions
1233 into...
1234 (c_parser_oacc_kernels_parallel): ... this new function. Adjust
1235 all users.
1236 * c-tree.h (c_finish_oacc_parallel, c_finish_oacc_kernels): Don't
1237 declare functions.
1238 (c_finish_omp_construct): Declare function.
1239 * c-typeck.c (c_finish_oacc_parallel, c_finish_oacc_kernels):
1240 Merge functions into...
1241 (c_finish_omp_construct): ... this new function.
1242
844cece0 12432015-10-22 Richard Biener <rguenther@suse.de>
1244
1245 * c-typeck.c (c_finish_omp_clauses): Properly convert operands
1246 before folding a MINUS_EXPR.
1247
5ce1b137 12482015-10-21 Marek Polacek <polacek@redhat.com>
1249
1250 PR c/68024
1251 * c-decl.c (start_function): Warn about vararg functions without
1252 a prototype.
1253
1f137e6d 12542015-10-21 Ilya Enkovich <enkovich.gnu@gmail.com>
1255
1256 * c-typeck.c (build_conditional_expr): Use boolean vector
1257 type for vector comparison.
1258 (build_vec_cmp): New.
1259 (build_binary_op): Use build_vec_cmp for comparison.
1260
8523243e 12612015-10-20 Marek Polacek <polacek@redhat.com>
1262
1263 * c-parser.c (is_cilkplus_vector_p): Don't define here.
1264
3f73be3e 12652015-10-20 Marek Polacek <polacek@redhat.com>
1266
1267 PR c/67964
1268 * c-parser.c (c_parser_attributes): Break out of the loop if the
1269 token after an attribute isn't a comma.
1270
43895be5 12712015-10-13 Jakub Jelinek <jakub@redhat.com>
1272 Aldy Hernandez <aldyh@redhat.com>
1273
1274 * c-parser.c (c_parser_pragma): Handle PRAGMA_OMP_ORDERED here.
1275 (c_parser_omp_clause_name): Handle OpenMP 4.5 clauses.
1276 (c_parser_omp_variable_list): Handle structure elements for
1277 map, to and from clauses. Handle array sections in reduction
1278 clause. Formatting fixes.
1279 (c_parser_omp_clause_if): Add IS_OMP argument, handle parsing of
1280 if clause modifiers.
1281 (c_parser_omp_clause_num_tasks, c_parser_omp_clause_grainsize,
1282 c_parser_omp_clause_priority, c_parser_omp_clause_hint,
1283 c_parser_omp_clause_defaultmap, c_parser_omp_clause_use_device_ptr,
1284 c_parser_omp_clause_is_device_ptr): New functions.
1285 (c_parser_omp_clause_ordered): Parse optional parameter.
1286 (c_parser_omp_clause_reduction): Handle array reductions.
1287 (c_parser_omp_clause_schedule): Parse optional simd modifier.
1288 (c_parser_omp_clause_nogroup, c_parser_omp_clause_orderedkind): New
1289 functions.
1290 (c_parser_omp_clause_linear): Parse linear clause modifiers.
1291 (c_parser_omp_clause_depend_sink): New function.
1292 (c_parser_omp_clause_depend): Parse source/sink depend kinds.
1293 (c_parser_omp_clause_map): Parse release/delete map kinds and
1294 optional always modifier.
1295 (c_parser_oacc_all_clauses): Adjust c_parser_omp_clause_if
1296 and c_finish_omp_clauses callers.
1297 (c_parser_omp_all_clauses): Likewise. Parse OpenMP 4.5 clauses.
1298 Parse "to" as OMP_CLAUSE_TO_DECLARE if on declare target directive.
1299 (c_parser_oacc_cache): Adjust c_finish_omp_clauses caller.
1300 (OMP_CRITICAL_CLAUSE_MASK): Define.
1301 (c_parser_omp_critical): Parse critical clauses.
1302 (c_parser_omp_for_loop): Handle doacross loops, adjust
1303 c_finish_omp_for and c_finish_omp_clauses callers.
1304 (OMP_SIMD_CLAUSE_MASK): Add simdlen clause.
1305 (c_parser_omp_simd): Allow ordered clause if it has no parameter.
1306 (OMP_FOR_CLAUSE_MASK): Add linear clause.
1307 (c_parser_omp_for): Disallow ordered clause when combined with
1308 distribute. Disallow linear clause when combined with distribute
1309 and not combined with simd.
1310 (OMP_ORDERED_CLAUSE_MASK, OMP_ORDERED_DEPEND_CLAUSE_MASK): Define.
1311 (c_parser_omp_ordered): Add CONTEXT argument, remove LOC argument,
1312 parse clauses and if depend clause is found, don't parse a body.
1313 (c_parser_omp_parallel): Disallow copyin clause on target parallel.
1314 Allow target parallel without for after it.
1315 (OMP_TASK_CLAUSE_MASK): Add priority clause.
1316 (OMP_TARGET_DATA_CLAUSE_MASK): Add use_device_ptr clause.
1317 (c_parser_omp_target_data): Diagnose no map clauses or clauses with
1318 invalid kinds.
1319 (OMP_TARGET_UPDATE_CLAUSE_MASK): Add depend and nowait clauses.
1320 (OMP_TARGET_ENTER_DATA_CLAUSE_MASK,
1321 OMP_TARGET_EXIT_DATA_CLAUSE_MASK): Define.
1322 (c_parser_omp_target_enter_data, c_parser_omp_target_exit_data): New
1323 functions.
1324 (OMP_TARGET_CLAUSE_MASK): Add depend, nowait, private, firstprivate,
1325 defaultmap and is_device_ptr clauses.
1326 (c_parser_omp_target): Parse target parallel and target simd. Set
1327 OMP_TARGET_COMBINED on combined constructs. Parse target enter data
1328 and target exit data. Diagnose invalid map kinds.
1329 (OMP_DECLARE_TARGET_CLAUSE_MASK): Define.
1330 (c_parser_omp_declare_target): Parse OpenMP 4.5 forms of this
1331 construct.
1332 (c_parser_omp_declare_reduction): Use STRIP_NOPS when checking for
1333 &omp_priv.
1334 (OMP_TASKLOOP_CLAUSE_MASK): Define.
1335 (c_parser_omp_taskloop): New function.
1336 (c_parser_omp_construct): Don't handle PRAGMA_OMP_ORDERED here,
1337 handle PRAGMA_OMP_TASKLOOP.
1338 (c_parser_cilk_for): Adjust c_finish_omp_clauses callers.
1339 * c-tree.h (c_finish_omp_clauses): Add two new arguments.
1340 * c-typeck.c (handle_omp_array_sections_1): Fix comment typo.
1341 Add IS_OMP argument, handle structure element bases, diagnose
1342 bitfields, pass IS_OMP recursively, diagnose known zero length
1343 array sections in depend clauses, handle array sections in reduction
1344 clause, diagnose negative length even for pointers.
1345 (handle_omp_array_sections): Add IS_OMP argument, use auto_vec for
1346 types, pass IS_OMP down to handle_omp_array_sections_1, handle
1347 array sections in reduction clause, set
1348 OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION if map could be zero
1349 length array section, use GOMP_MAP_FIRSTPRIVATE_POINTER for IS_OMP.
1350 (c_finish_omp_clauses): Add IS_OMP and DECLARE_SIMD arguments.
1351 Handle new OpenMP 4.5 clauses and new restrictions for the old ones.
1352
789fbb51 13532015-10-06 Marek Polacek <polacek@redhat.com>
1354
1355 * c-parser.c (c_parser_statement_after_labels): Use
1356 protected_set_expr_location.
1357 (c_parser_omp_clause_num_gangs): Likewise.
1358 (c_parser_omp_clause_num_threads): Likewise.
1359 (c_parser_omp_clause_num_workers): Likewise.
1360 (c_parser_omp_clause_vector_length): Likewise.
1361 (c_parser_omp_clause_num_teams): Likewise.
1362 (c_parser_omp_clause_thread_limit): Likewise.
1363 * c-typeck.c (build_c_cast): Likewise.
1364 (c_cast_expr): Likewise.
1365
20cb53c9 13662015-10-05 Richard Sandiford <richard.sandiford@arm.com>
1367
1368 * c-typeck.c (c_tree_equal): Use real_equal instead of
1369 REAL_VALUES_EQUAL.
1370
6d02e6b2 13712015-10-04 Jason Merrill <jason@redhat.com>
1372
1373 * c-parser.c (c_lex_one_token): Handle @synchronized.
1374 * c-decl.c (match_builtin_function_types): A declaration of a built-in
1375 can change whether the function is transaction_safe.
1376
802c32cd 13772015-10-02 Marek Polacek <polacek@redhat.com>
1378
1379 PR c/67730
1380 * c-typeck.c (convert_for_assignment): Use the expansion point
1381 location throughout.
1382
ef17a71a 13832015-10-02 Marek Polacek <polacek@redhat.com>
1384
1385 PR c/64249
1386 * c-parser.c (c_parser_statement_after_labels): Add CHAIN parameter
1387 and pass it down to c_parser_if_statement.
1388 (c_parser_else_body): Add CHAIN parameter and pass it down to
1389 c_parser_statement_after_labels.
1390 (c_parser_if_statement): Add CHAIN parameter. Add code to warn about
1391 duplicated if-else-if conditions.
1392
7e93eb1a 13932015-10-01 Marek Polacek <polacek@redhat.com>
1394
1395 * c-typeck.c (convert_for_assignment): Improve commentary.
1396
ab4c803c 13972015-09-30 Marek Polacek <polacek@redhat.com>
1398
1399 PR c/67730
1400 * c-typeck.c (c_finish_return): Use the expansion point location for
1401 certain "return with value" warnings.
1402
ed536208 14032015-09-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
1404
1405 * c-parser.c (pragma_lex): Add loc argument.
1406
03e8b174 14072015-09-15 Marek Polacek <polacek@redhat.com>
1408
1409 PR c/67580
1410 * c-decl.c (tag_exists_p): New function.
1411 * c-parser.c (c_parser_declaration_or_fndef): Give a hint when
1412 struct/union/enum keywords are missing.
1413 * c-tree.h (tag_exists_p): Declare.
1414
a39b4dc0 14152015-09-15 Marek Polacek <polacek@redhat.com>
1416
1417 * c-decl.c (lookup_label): Return NULL_TREE instead of 0.
1418 (lookup_tag): Change the type of THISLEVEL_ONLY to bool.
1419 Return NULL_TREE instead of 0.
1420 (lookup_name): Return NULL_TREE instead of 0.
1421 (lookup_name_in_scope): Likewise.
1422 (shadow_tag_warned): Use true instead of 1 and NULL_TREE instead of 0.
1423 (parser_xref_tag): Use false instead of 0.
1424 (start_struct): Use true instead of 1.
1425 (start_enum): Use true instead of 1 and NULL_TREE instead of 0.
1426
85f5e2ee 14272015-09-14 Marek Polacek <polacek@redhat.com>
1428
1429 * c-typeck.c (set_nonincremental_init_from_string): Use
1430 HOST_WIDE_INT_M1U when shifting a negative value.
1431
739237d5 14322015-09-09 Mark Wielaard <mjw@redhat.com>
1433
1434 * c-typeck.c (build_binary_op): Check and warn when nonnull arg
1435 parm against NULL.
1436
d2b2788c 14372015-09-10 Jakub Jelinek <jakub@redhat.com>
1438
1439 PR c/67502
1440 * c-parser.c (c_parser_omp_for_loop): Emit DECL_EXPR stmts
1441 into OMP_FOR_PRE_BODY rather than before the loop.
1442
deef87db 14432015-09-09 Jakub Jelinek <jakub@redhat.com>
1444
c43f93d7 1445 PR c/67501
1446 * c-parser.c (c_parser_oacc_all_clauses,
1447 c_parser_omp_all_clauses): Remove invalid clause from
1448 list of clauses even if parser->error is set.
1449
0fdcfb93 1450 PR c/67500
1451 * c-parser.c (c_parser_omp_clause_aligned,
1452 c_parser_omp_clause_safelen, c_parser_omp_clause_simdlen): Fix up
1453 test for errors.
1454 * c-decl.c (temp_pop_parm_decls): Allow b->decl equal to
1455 error_mark_node.
1456
deef87db 1457 PR c/67495
1458 * c-parser.c (c_parser_omp_atomic): Use c_parser_cast_expression
1459 instead of c_parser_unary_expression. If the result is !lvalue_p,
1460 wrap the result of c_fully_fold into NON_LVALUE_EXPR.
1461
e96292e9 14622015-09-04 Marek Polacek <polacek@redhat.com>
1463
1464 PR sanitizer/67279
1465 * c-typeck.c (build_binary_op): Don't instrument static initializers.
1466
547c6b1f 14672015-09-03 Martin Sebor <msebor@redhat.com>
1468
1469 PR c/66516
6ccd7236 1470 * c-typeck.c (convert_arguments, parser_build_unary_op,
1471 build_conditional_expr, c_cast_expr, convert_for_assignment,
1472 build_binary_op, _objc_common_truthvalue_conversion): Call
547c6b1f 1473 reject_gcc_builtin.
1474 (c_decl_implicit): Define.
1475
bd66724c 14762015-09-02 Marek Polacek <polacek@redhat.com>
1477
1478 PR c/67432
1479 * c-parser.c (c_parser_enum_specifier): Give a better error for
1480 an empty enum.
1481
6dc50383 14822015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org>
1483
1484 * c-aux-info.c, c-parser.c, c-tree.h: Remove useless typedefs.
1485
7ad1d78d 14862015-08-12 Marek Polacek <polacek@redhat.com>
1487
1488 * c-decl.c (grokdeclarator): Call error_at instead of error and pass
1489 LOC to it.
1490
c9099388 14912015-08-03 Marek Polacek <polacek@redhat.com>
1492
1493 PR c/67088
1494 * c-decl.c (check_bitfield_type_and_width): Add location parameter.
1495 Use it.
1496 (grokdeclarator): Pass LOC down to check_bitfield_type_and_width.
1497
9255be07 14982015-08-02 Patrick Palka <ppalka@gcc.gnu.org>
1499
1500 * c-parser.c (c_parser_if_body): Take token_indent_info
1501 argument. Call warn_for_misleading_indentation even when the
1502 body is a semicolon. Extract token_indent_infos corresponding
1503 to the guard, body and next tokens. Adjust call to
1504 warn_for_misleading_indentation accordingly.
1505 (c_parser_else_body): Likewise.
1506 (c_parser_if_statement): Likewise.
1507 (c_parser_while_statement): Likewise.
1508 (c_parser_for_statement): Likewise.
1509
dbbd4c6d 15102015-07-28 Luis Felipe Strano Moraes <luis.strano@gmail.com>
1511 Manuel López-Ibáñez <manu@gcc.gnu.org>
1512
1513 * c-decl.c (get_parm_info): Remove static var. Update warning
1514 message.
1515
6784a472 15162015-07-27 Marek Polacek <polacek@redhat.com>
1517
1518 PR c++/66555
1519 PR c/54979
1520 * c-typeck.c (parser_build_binary_op): Call warn_tautological_cmp.
1521
8d669e79 15222015-07-20 Marek Polacek <polacek@redhat.com>
1523
1524 PR c++/55095
1525 * c-typeck.c (digest_init): Pass OPT_Wpedantic to pedwarn_init.
1526 (build_binary_op): Warn about left shift overflows.
1527
1eacc14a 15282015-07-09 Andrew MacLeod <amacleod@redhat.com>
1529
1530 * c-array-notation.c: Adjust includes for flags.h changes.
1531 * c-objc-common.c: Likewise.
1532
9ef16211 15332015-07-07 Andrew MacLeod <amacleod@redhat.com>
1534
1535 * c-array-notation.c: Adjust includes.
1536 * c-aux-info.c: Likewise.
1537 * c-convert.c: Likewise.
1538 * c-decl.c: Likewise.
1539 * c-errors.c: Likewise.
1540 * c-lang.c: Likewise.
1541 * c-objc-common.c: Likewise.
1542 * c-parser.c: Likewise.
1543 * c-typeck.c: Likewise.
1544
0949f227 15452015-06-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
1546
1547 PR fortran/66605
1548 * c-decl.c (finish_function): Call do_warn_unused_parameter.
1549
be23b16f 15502015-06-29 Marek Polacek <polacek@redhat.com>
1551
1552 PR c/66322
1553 * c-typeck.c (struct c_switch): Add BOOL_COND_P and OUTSIDE_RANGE_P.
1554 (c_start_case): Set BOOL_COND_P and OUTSIDE_RANGE_P. Don't warn
1555 about -Wswitch-bool here.
1556 (do_case): Update c_add_case_label call.
1557 (c_finish_case): Update c_do_switch_warnings call.
1558
6290f0db 15592015-06-27 Marek Polacek <polacek@redhat.com>
1560
1561 * c-typeck.c: Use VECTOR_TYPE_P throughout.
1562
aa3e402e 15632015-06-26 Marek Polacek <polacek@redhat.com>
1564
1565 * c-array-notation.c (fix_builtin_array_notation_fn): Use
1566 INDIRECT_REF_P.
1567 * c-typeck.c (array_to_pointer_conversion): Likewise.
1568 (build_unary_op): Likewise.
1569 (c_finish_return): Likewise.
1570
ec2e0095 15712015-06-25 Andrew MacLeod <amacleod@redhat.com>
1572
1573 * c-decl.c: Remove ipa-ref.h and plugin-api.h from include list.
1574 * c-parser.c: Likewise.
1575
770ff93b 15762015-06-25 Richard Sandiford <richard.sandiford@arm.com>
1577
1578 * c-decl.c (detect_field_duplicates_hash): Use nofree_ptr_hash
1579 instead of pointer_hash.
1580 (detect_field_duplicates): Likewise.
1581
f48c7f4a 15822015-06-25 Marek Polacek <polacek@redhat.com>
1583
1584 * c-array-notation.c: Use VAR_P throughout.
1585 * c-decl.c: Likewise.
1586 * c-objc-common.c: Likewise.
1587 * c-parser.c: Likewise.
1588 * c-typeck.c: Likewise.
1589
ce41e81a 15902015-06-25 Marek Polacek <polacek@redhat.com>
1591
1592 * c-decl.c: Use is_global_var throughout.
1593 * c-parser.c: Likewise.
1594 * c-typeck.c: Likewise.
1595
f2ab3bac 15962015-06-17 Andrew MacLeod <amacleod@redhat.com>
1597
1598 * c-array-notation.c: Do not include input.h, line-map.h or is-a.h.
1599 * c-aux-info.c: Likewise.
1600 * c-convert.c: Likewise.
1601 * c-decl.c: Likewise.
1602 * c-errors.c: Likewise.
1603 * c-lang.c: Likewise.
1604 * c-objc-common.c: Likewise.
1605 * c-parser.c: Likewise.
1606 * c-typeck.c: Likewise.
1607
647730ab 16082015-06-11 Jan Hubicka <hubicka@ucw.cz>
1609
1610 PR middle-end/66325
1611 * c-decl.c (start_enum): Set TYPE_PACKED consistently among type
1612 variants.
1613
dd4b0a0d 16142015-06-11 Pierre-Marie de Rodat <derodat@adacore.com>
1615
1616 * c-decl.c (pop_scope): Register the main translation unit
1617 through the new debug hook.
1618
64486212 16192015-06-08 Andrew MacLeod <amacleod@redhat.com>
1620
1621 * c-array-notation.c : Adjust include files.
1622 * c-aux-info.c : Likewise.
1623 * c-convert.c : Likewise.
1624 * c-decl.c : Likewise.
1625 * c-errors.c : Likewise.
1626 * c-lang.c : Likewise.
1627 * c-lang.h : Likewise.
1628 * c-objc-common.c : Likewise.
1629 * c-parser.c : Likewise.
1630 * c-typeck.c : Likewise.
1631
3a1c9df2 16322015-06-05 Aldy Hernandez <aldyh@redhat.com>
1633
1634 * c-decl.c (finish_struct): Save C_TYPE_INCOMPLETE_VARS and
1635 immediately clobber it.
1636 (c_write_global_declarations_1): Remove call to
1637 check_global_declaration_1.
1638 (c_write_global_declarations_2): Remove.
1639 (c_write_final_cleanups): Rename from c_write_global_declarations.
1640 Remove call to finalize_compilation_unit.
1641 Remove calls to debugging hooks.
1642 * c-objc-common.c: Adjust comment for c_warn_unused_global_decl.
1643 * c-objc-common.h: Remove LANG_HOOKS_WRITE_GLOBALS.
1644 * c-tree.h: Remove c_write_global_declarations.
1645
f77c0292 16462015-06-04 Andrew MacLeod <amacleod@redhat.com>
1647
1648 * c-array-notation.c: Adjust includes for restructured coretypes.h.
1649 * c-aux-info.c: Likewise.
1650 * c-convert.c: Likewise.
1651 * c-decl.c: Likewise.
1652 * c-errors.c: Likewise.
1653 * c-lang.c: Likewise.
1654 * c-objc-common.c: Likewise.
1655 * c-parser.c: Likewise.
1656 * c-typeck.c: Likewise.
1657
b44134dc 16582015-06-04 Marek Polacek <polacek@redhat.com>
1659
1660 PR c/66341
1661 * c-typeck.c (build_c_cast): Wrap VALUE into NON_LVALUE_EXPR if
1662 it is a lvalue.
1663
d1df0bfc 16642015-06-03 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
1665
1666 * c-decl.c (warn_cxx_compat_finish_struct): New parameters code, record_loc.
1667 Warn for empty struct.
1668 (finish_struct): Pass TREE_CODE(t) and loc to warn_cxx_compat_finish_struct.
1669
f8363c5d 16702015-06-02 Andres Tiraboschi <andres.tiraboschi@tallertechnologies.com>
1671
1672 * c-decl.c (start_function): Call plugin before parsing.
1673 (finish_function): Call plugin after parsing.
1674
5b9761f5 16752015-06-02 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
1676
1677 PR c/49551
1678 * c-decl.c (merge_decls): Merge DECL_COMMON.
1679
eeec71b4 16802015-05-22 Jim Wilson <jim.wilson@linaro.org>
1681
1682 * Make-lang.in (check_gcc_pallelize): Define.
1683
5a4c69dd 16842015-05-22 Marek Polacek <polacek@redhat.com>
1685
1686 PR c/47043
1687 * c-parser.c (c_parser_enum_specifier): Parse and apply enumerator
1688 attributes.
1689
5650b4ff 16902015-05-21 Marek Polacek <polacek@redhat.com>
1691
1692 * c-typeck.c (inform_declaration): Use DECL_IS_BUILTIN instead of
1693 DECL_BUILT_IN.
1694
b443c459 16952015-05-20 Marek Polacek <polacek@redhat.com>
1696
1697 * c-decl.c: Use VAR_OR_FUNCTION_DECL_P throughout.
1698 * c-typeck.c: Likewise.
1699
9e73638f 17002015-05-19 Marek Polacek <polacek@redhat.com>
1701
1702 * c-typeck.c (start_init): Use AGGREGATE_TYPE_P.
1703
d7729e26 17042015-05-19 Jakub Jelinek <jakub@redhat.com>
1705
1706 PR middle-end/66199
1707 * c-parser.c (c_parser_omp_for_loop): Don't add
1708 OMP_CLAUSE_SHARED to OMP_PARALLEL_CLAUSES when moving
1709 OMP_CLAUSE_LASTPRIVATE clause to OMP_FOR_CLAUSES.
1710 (c_parser_omp_teams): Set OMP_TEAMS_COMBINED for combined
1711 constructs.
1712
dfcf26a5 17132015-05-19 Mikhail Maltsev <maltsevm@gmail.com>
1714
1715 * c-typeck.c (build_array_ref): Use std::swap instead of explicit
9e73638f 1716 swaps.
dfcf26a5 1717
09172322 17182015-05-16 Manuel López-Ibáñez <manu@gcc.gnu.org>
1719
1720 PR fortran/44054
1721 * c-objc-common.c (c_tree_printer): Replace locus pointer with
1722 accessor function.
1723
aac24642 17242015-05-14 Marek Polacek <polacek@redhat.com>
1725
1726 PR c/66066
1727 PR c/66127
1728 * c-typeck.c (digest_init): Call pedwarn_init with OPT_Wpedantic
1729 rather than with 0.
1730
e5f01cba 17312015-05-12 David Malcolm <dmalcolm@redhat.com>
1732
1733 * c-parser.c (c_parser_if_body): Add param "if_loc", use it
1734 to add a call to warn_for_misleading_indentation.
1735 (c_parser_else_body): Likewise, adding param "else_loc".
1736 (c_parser_if_statement): Check for misleading indentation.
1737 (c_parser_while_statement): Likewise.
1738 (c_parser_for_statement): Likewise.
1739
dc5945dc 17402015-05-08 Marek Polacek <polacek@redhat.com>
1741
1742 PR c/64918
1743 * c-typeck.c (add_pending_init): Use OPT_Woverride_init_side_effects.
1744 (output_init_element): Likewise.
1745
cdc64059 17462015-05-07 Marek Polacek <polacek@redhat.com>
1747
1748 PR c/65179
1749 * c-typeck.c (build_binary_op): Warn when left shifting a negative
1750 value.
1751
6fa7118e 17522015-04-30 Marek Polacek <polacek@redhat.com>
1753
1754 * c-typeck.c (set_init_label): Call error_at instead of error and
1755 pass LOC to it.
1756
98f44804 1757 * c-typeck.c (c_incomplete_type_error): Refactor to use %qT. Print
1758 the type of a decl.
1759
2cd7caae 1760 * c-typeck.c (c_build_va_arg): Clarify the error message.
1761
95cfd391 17622015-04-29 Thomas Schwinge <thomas@codesourcery.com>
1763
1764 * c-parser.c (c_parser_oacc_enter_exit_data): Use
1765 OMP_STANDALONE_CLAUSES.
1766
e65e39f8 17672015-04-28 Marek Polacek <polacek@redhat.com>
1768
1769 * c-parser.c (c_parser_binary_expression): Remove duplicate line.
1770
5580bf42 17712015-04-28 Marek Polacek <polacek@redhat.com>
1772
1773 PR c/65901
1774 * c-typeck.c (c_build_va_arg): Require TYPE be a complete type.
1775
c3468fc2 17762015-04-25 Marek Polacek <polacek@redhat.com>
1777
1778 PR c/52085
1779 * c-decl.c (finish_enum): Copy over TYPE_ALIGN. Also check for "mode"
1780 attribute.
1781
0cd6b1b4 17822015-04-23 Marek Polacek <polacek@redhat.com>
1783
1784 PR c/65345
1785 * c-decl.c (set_labels_context_r): New function.
1786 (store_parm_decls): Call it via walk_tree_without_duplicates.
1787 * c-typeck.c (convert_lvalue_to_rvalue): Use create_tmp_var_raw
1788 instead of create_tmp_var. Build TARGET_EXPR instead of
1789 COMPOUND_EXPR.
1790 (build_atomic_assign): Use create_tmp_var_raw instead of
1791 create_tmp_var. Build TARGET_EXPRs instead of MODIFY_EXPR.
1792
05a827ce 17932015-04-20 Ilya Verbin <ilya.verbin@intel.com>
1794
1795 * c-parser.c (c_parser_oacc_enter_exit_data): Remove excess semicolon.
1796 (c_parser_omp_target_update): Add missed %> to error_at ().
1797
de801c28 17982015-04-10 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
1799
1800 PR target/55143
1801 * c-decl.c (c_default_pointer_mode): Remove definition.
1802 * c-tree.h (c_default_pointer_mode): Remove declaration.
1803
c3b1dca4 18042015-03-27 Tobias Burnus <burnus@net-b.de>
1805
1806 PR c/65586
1807 * c-parser.c (c_parser_skip_to_pragma_eol): Optionally, don't
1808 error out.
1809 (c_parser_omp_for, c_parser_omp_parallel, c_parser_omp_distribute,
1810 c_parser_omp_teams, c_parser_omp_target, c_parser_omp_declare):
1811 Update calls to not error for skipped omp pragmas with -fopenmp-simd.
1812
1443772f 18132015-03-19 Jakub Jelinek <jakub@redhat.com>
1814
1815 * c-decl.c (c_decl_attributes): Also add "omp declare target"
1816 attribute for DECL_EXTERNAL VAR_DECLs.
1817
76738f56 18182015-03-11 Jakub Jelinek <jakub@redhat.com>
1819
1820 * c-parser.c (c_parse_init): Don't call xstrdup on get_identifier
1821 argument.
1822
16f958b3 18232015-03-10 Jakub Jelinek <jakub@redhat.com>
1824
1825 PR c/65120
1826 * c-typeck.c (parser_build_binary_op): Check for tcc_comparison
1827 before preparing arguments to warn_logical_not_parentheses.
1828
6054103a 18292015-03-09 Jakub Jelinek <jakub@redhat.com>
1830
1831 PR c/65120
1832 * c-typeck.c (parser_build_binary_op): Don't warn for
1833 !!x == y or !b == y where b is _Bool.
1834
de3a1e03 18352015-03-09 Marek Polacek <polacek@redhat.com>
1836
1837 * c-convert.c (convert): Make use of do_ubsan_in_current_function.
1838 * c-decl.c (grokdeclarator): Likewise.
1839 * c-typeck.c (build_binary_op): Likewise.
1840
084e6bf0 18412015-02-27 Marek Polacek <polacek@redhat.com>
1842
1843 PR c/65228
1844 * c-decl.c (start_decl): Return NULL_TREE if decl is an error node.
1845
4d7c4134 18462015-02-14 Marek Polacek <polacek@redhat.com>
1847
1848 PR c/64768
1849 * c-decl.c (grokdeclarator): Set the range of a flexible array member
1850 declared through a typedef name.
1851
b1380826 18522015-02-13 Marek Polacek <polacek@redhat.com>
1853
1854 PR c/65050
1855 * c-decl.c (grokdeclarator): Print also the type when giving
1856 the error message about array's incomplete element type.
1857
35ff54b5 18582015-02-11 Jakub Jelinek <jakub@redhat.com>
1859
1860 PR c/64824
1861 * c-parser.c (c_parser_binary_expression): Fix OpenMP stack[sp].prec
1862 check in the POP macro.
1863
46861609 18642015-02-09 Marek Polacek <polacek@redhat.com>
1865
1866 PR c/64856
1867 * c-typeck.c (process_init_element): Don't always wrap
1868 COMPOUND_LITERAL_EXPR in a SAVE_EXPR in C99 mode when
1869 initializing a range of elements.
1870
bbf8fbec 18712015-02-04 Jakub Jelinek <jakub@redhat.com>
1872
1873 PR c/64824
1874 PR c/64868
1875 * c-parser.c (c_parser_omp_atomic): Handle RDIV_EXPR.
1876
46861609 18772015-02-02 Bruno Loff <bruno.loff@gmail.com>
1f0ce3ac 1878
1879 * c-parser.c (c_parser_declspecs): Call invoke_plugin_callbacks after
1880 processing enum declaration.
1881
70279be9 18822015-01-29 Marek Polacek <polacek@redhat.com>
1883
1884 PR c/64709
1885 * c-typeck.c (pop_init_level): If constructor_elements has
1886 exactly one element with integer_zerop value, set constructor_zeroinit
1887 to 1. Remove braces around warning_init call.
1888
591970b4 18892015-01-27 Jakub Jelinek <jakub@redhat.com>
1890
1891 PR c/64766
1892 * c-typeck.c (store_init_value): Don't overwrite DECL_INITIAL
1893 of FUNCTION_DECLs with error_mark_node.
1894
87778dc4 18952015-01-26 Jakub Jelinek <jakub@redhat.com>
1896
1897 PR c/64778
1898 * c-typeck.c (convert_arguments): Return -1 if there are
1899 error_args, even if we've diagnosed too many arguments.
1900
cffdfb3d 19012015-01-21 Richard Biener <rguenther@suse.de>
1902
1903 PR middle-end/64313
1904 * c-decl.c (merge_decls): Call set_builtin_decl_declared_p
1905 for builtins the user declared correctly.
1906
ca4c3545 19072015-01-15 Thomas Schwinge <thomas@codesourcery.com>
1908 Bernd Schmidt <bernds@codesourcery.com>
1909 Cesar Philippidis <cesar@codesourcery.com>
1910 James Norris <jnorris@codesourcery.com>
1911 Jakub Jelinek <jakub@redhat.com>
1912 Ilmir Usmanov <i.usmanov@samsung.com>
1913
1914 * c-parser.c: Include "gomp-constants.h".
1915 (c_parser_omp_clause_map): Use enum gomp_map_kind instead of enum
1916 omp_clause_map_kind. Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
1917 Use OMP_CLAUSE_SET_MAP_KIND.
1918 (c_parser_pragma): Handle PRAGMA_OACC_ENTER_DATA,
1919 PRAGMA_OACC_EXIT_DATA, PRAGMA_OACC_UPDATE.
1920 (c_parser_omp_construct): Handle PRAGMA_OACC_CACHE,
1921 PRAGMA_OACC_DATA, PRAGMA_OACC_KERNELS, PRAGMA_OACC_LOOP,
1922 PRAGMA_OACC_PARALLEL, PRAGMA_OACC_WAIT.
1923 (c_parser_omp_clause_name): Handle "auto", "async", "copy",
1924 "copyout", "create", "delete", "deviceptr", "gang", "host",
1925 "num_gangs", "num_workers", "present", "present_or_copy", "pcopy",
1926 "present_or_copyin", "pcopyin", "present_or_copyout", "pcopyout",
1927 "present_or_create", "pcreate", "seq", "self", "vector",
1928 "vector_length", "wait", "worker".
1929 (OACC_DATA_CLAUSE_MASK, OACC_KERNELS_CLAUSE_MASK)
1930 (OACC_ENTER_DATA_CLAUSE_MASK, OACC_EXIT_DATA_CLAUSE_MASK)
1931 (OACC_LOOP_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK)
1932 (OACC_UPDATE_CLAUSE_MASK, OACC_WAIT_CLAUSE_MASK): New macros.
1933 (c_parser_omp_variable_list): Handle OMP_CLAUSE__CACHE_.
1934 (c_parser_oacc_wait_list, c_parser_oacc_data_clause)
1935 (c_parser_oacc_data_clause_deviceptr)
1936 (c_parser_omp_clause_num_gangs, c_parser_omp_clause_num_workers)
1937 (c_parser_oacc_clause_async, c_parser_oacc_clause_wait)
1938 (c_parser_omp_clause_vector_length, c_parser_oacc_all_clauses)
1939 (c_parser_oacc_cache, c_parser_oacc_data, c_parser_oacc_kernels)
1940 (c_parser_oacc_enter_exit_data, c_parser_oacc_loop)
1941 (c_parser_oacc_parallel, c_parser_oacc_update)
1942 (c_parser_oacc_wait): New functions.
1943 * c-tree.h (c_finish_oacc_parallel, c_finish_oacc_kernels)
1944 (c_finish_oacc_data): New prototypes.
1945 * c-typeck.c: Include "gomp-constants.h".
1946 (handle_omp_array_sections): Handle GOMP_MAP_FORCE_DEVICEPTR. Use
1947 GOMP_MAP_* instead of OMP_CLAUSE_MAP_*. Use
1948 OMP_CLAUSE_SET_MAP_KIND.
1949 (c_finish_oacc_parallel, c_finish_oacc_kernels)
1950 (c_finish_oacc_data): New functions.
1951 (c_finish_omp_clauses): Handle OMP_CLAUSE__CACHE_,
1952 OMP_CLAUSE_NUM_GANGS, OMP_CLAUSE_NUM_WORKERS,
1953 OMP_CLAUSE_VECTOR_LENGTH, OMP_CLAUSE_ASYNC, OMP_CLAUSE_WAIT,
1954 OMP_CLAUSE_AUTO, OMP_CLAUSE_SEQ, OMP_CLAUSE_GANG,
1955 OMP_CLAUSE_WORKER, OMP_CLAUSE_VECTOR, and OMP_CLAUSE_MAP's
1956 GOMP_MAP_FORCE_DEVICEPTR.
1957
1f78217c 19582015-01-09 Michael Collison <michael.collison@linaro.org>
1959
1960 * c-array-notation.c: Include hash-set.h, machmode.h,
1961 vec.h, double-int.h, input.h, alias.h, symtab.h, options.h
1962 fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h.
1963 * c-aux-info.c: Ditto.
1964 * c-convert.c: Ditto.
1965 * c-decl.c: Ditto.
1966 * c-errors.c: Ditto.
1967 * c-lang.c: Dittoxs.
1968 * c-objc-common.c: Ditto.
1969 * c-parser.c: Ditto.
1970 * c-typeck.c: Include hash-set.h, machmode.h,
1971 vec.h, double-int.h, input.h, alias.h, symtab.h, options.h
1972 fold-const.h, wide-int.h, inchash.h, real.h and
1973 fixed-value.h due to flattening of tree.h.
1974
15e18a8c 19752015-01-07 Marek Polacek <polacek@redhat.com>
1976
1977 PR c/64417
1978 * c-typeck.c (process_init_element): Disallow initialization of
1979 a flexible array member with a string constant if the structure
1980 is in an array.
1981
d353bf18 19822015-01-05 Jakub Jelinek <jakub@redhat.com>
1983
823a9dd4 1984 PR sanitizer/64344
1985 * c-typeck.c (convert_for_assignment, c_finish_return): For
1986 -fsanitize=float-cast-overflow casts from REAL_TYPE to integer/enum
1987 types also set in_late_binary_op around convert call.
1988 * c-convert.c (convert): For -fsanitize=float-cast-overflow REAL_TYPE
1989 to integral type casts, if not in_late_binary_op, pass c_fully_fold
1990 result on expr as last argument to ubsan_instrument_float_cast,
1991 if in_late_binary_op, don't use c_save_expr but save_expr.
1992
d353bf18 1993 Update copyright years.
1994
92b63884 19952015-01-05 Marek Polacek <polacek@redhat.com>
1996
1997 PR c/64423
1998 * c-typeck.c (build_array_ref): Pass loc down to
1999 warn_array_subscript_with_type_char.
2000
8a8211df 20012014-12-20 Martin Uecker <uecker@eecs.berkeley.edu>
2002
2003 * c-typeck.c: New behavious for pointers to arrays with qualifiers
2004 (common-pointer-type): For pointers to arrays take qualifiers from
2005 element type.
2006 (build_conditional_expr): Add warnings for lost qualifiers.
2007 (comp-target-types): Allow pointers to arrays with different qualifiers.
2008 (convert-for-assignment): Adapt warnings for discarded qualifiers. Add
2009 WARNING_FOR_QUALIFIERS macro and rename WARN_FOR_QUALIFIERS
2010 to PEDWARN_FOR_QUALIFIERS.
2011
35ea0139 20122014-12-17 Jakub Jelinek <jakub@redhat.com>
2013
2014 PR sanitizer/64289
2015 * c-convert.c: Include ubsan.h.
2016 (convert): For real -> integral casts and
2017 -fsanitize=float-cast-overflow don't call convert_to_integer, but
2018 instead instrument the float cast directly.
2019
f9e245b2 20202014-11-29 Jakub Jelinek <jakub@redhat.com>
2021
2022 * c-typeck.c (convert_lvalue_to_rvalue, build_atomic_assign,
2023 c_finish_stmt_expr): Remove NULL last argument from
2024 create_tmp_var_raw and create_tmp_var calls.
2025 * c-array-notation.c (fix_builtin_array_notation_fn,
2026 build_array_notation_expr, fix_conditional_array_notations_1,
2027 fix_array_notation_expr, fix_array_notation_call_expr): Likewise.
2028
fce2dbd1 20292014-11-28 Marek Polacek <polacek@redhat.com>
2030
2031 PR c/63862
2032 * c-typeck.c (build_binary_op) <RSHIFT_EXPR, LSHIFT_EXPR>: Don't
2033 convert the right operand to integer type.
2034
396c36b7 20352014-11-25 Marek Polacek <polacek@redhat.com>
2036
2037 PR c/63877
2038 * c-decl.c (start_function): Disable -Wmissing-declarations warning
2039 for inline functions.
2040
c61ef207 20412014-11-21 Jakub Jelinek <jakub@redhat.com>
2042
2043 PR target/63764
2044 * c-typeck.c (build_array_ref): Adjust
2045 convert_vector_to_pointer_for_subscript caller. If it returns true,
2046 call non_lvalue_loc on the result.
2047
565353e8 20482014-11-11 Richard Biener <rguenther@suse.de>
2049
2050 * c-decl.c (c_init_decl_processing): Do not set pedantic_lvalues
2051 to true.
2052
fdd735a7 20532014-11-10 Andi Kleen <ak@linux.intel.com>
2054
2055 PR c/60804
2056 * c-parser.c (c_parser_statement_after_labels): Call
2057 check_no_cilk.
2058 (c_parser_if_statement): Dito.
2059 (c_parser_switch_statement): Dito.
2060 (c_parser_while_statement): Dito.
2061 (c_parser_do_statement): Dito.
2062 (c_parser_for_statement): Dito.
2063 * c-typeck.c (c_finish_loop): Dito.
2064
0feb4de1 20652014-11-10 Paolo Carlini <paolo.carlini@oracle.com>
2066
2067 * c-typeck.c (build_binary_op): Use OPT_Wshift_count_negative and
2068 OPT_Wshift_count_overflow in the warnings.
2069
a3fec48a 20702014-10-30 Marek Polacek <polacek@redhat.com>
2071
2072 * c-objc-common.c (c_tree_printer) <case 'T'>: For a typedef name,
2073 print the stripped version as well, if they're not the same.
2074
3754d046 20752014-10-29 Richard Sandiford <richard.sandiford@arm.com>
2076
2077 * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from
2078 machine_mode.
2079
1140c305 20802014-10-28 Andrew MacLeod <amacleod@redhat.com>
2081
2082 * c-decl.c: Adjust include files.
2083 * c-parser.c: Ditto.
2084
ab103e33 20852014-10-27 Phil Muldoon <pmuldoon@redhat.com>
2086 Tom Tromey <tromey@redhat.com>
2087
2088 * c-tree.h (enum c_oracle_request): New.
2089 (c_binding_oracle_function): New typedef.
2090 (c_binding_oracle, c_pushtag, c_bind): Declare.
2091 * c-decl.c (c_binding_oracle): New global.
2092 (I_SYMBOL_CHECKED): New macro.
2093 (i_symbol_binding): New function.
2094 (I_SYMBOL_BINDING, I_SYMBOL_DECL): Redefine.
2095 (I_TAG_CHECKED): New macro.
2096 (i_tag_binding): New function.
2097 (I_TAG_BINDING, I_TAG_DECL): Redefine.
2098 (I_LABEL_CHECKED): New macro.
2099 (i_label_binding): New function.
2100 (I_LABEL_BINDING, I_LABEL_DECL): Redefine.
2101 (c_print_identifier): Save and restore c_binding_oracle.
2102 (c_pushtag, c_bind): New functions.
2103
94ea8568 21042014-10-27 Andrew MacLeod <amacleod@redhat.com>
2105
2106 * c-typeck.c: Adjust include files.
2107
32ecf960 21082014-10-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
2109
2110 PR c++/53061
2111 * c-objc-common.c (c_objc_common_init): Do not do diagnostics
2112 initialization here...
2113 (c_initialize_diagnostics): ... but here. Set defaults after
2114 building pretty-printer.
2115
2981340f 21162014-10-23 Marek Polacek <polacek@redhat.com>
2117
2118 PR c/63626
2119 * c-decl.c (pop_scope): Don't print warning in external_scope.
2120
d303aeaf 21212014-10-19 Marek Polacek <polacek@redhat.com>
2122
2123 PR c/63567
2124 * c-typeck.c (output_init_element): Allow initializing objects with
2125 static storage duration with compound literals even in C99 and add
2126 pedwarn for it.
2127
bccf97da 21282014-10-17 Marek Polacek <polacek@redhat.com>
2129
2130 PR c/63567
2131 * c-typeck.c (digest_init): Allow initializing objects with static
2132 storage duration with compound literals even in C99 and add pedwarn
2133 for it.
2134
d9c77450 21352014-10-17 Marek Polacek <polacek@redhat.com>
2136
2137 PR c/63543
2138 * c-tree.h (C_TYPE_ERROR_REPORTED): Define.
2139 * c-typeck.c (build_indirect_ref): Don't print the "dereferencing..."
2140 error multiple times. Print the type.
2141
a2bbd0a7 21422014-10-17 Marek Polacek <polacek@redhat.com>
2143
2144 PR c/63549
2145 * c-typeck.c (build_array_ref): Bail if the index in an incomplete
2146 type.
2147
e610d2b2 21482014-10-17 Marek Polacek <polacek@redhat.com>
2149
2150 * c-decl.c (grokdeclarator): Use OPT_Wimplicit_int unconditionally.
2151 (start_function): Use OPT_Wimplicit_int instead of 0.
2152 (store_parm_decls_oldstyle): Likewise.
2153
6b6e56b6 21542014-10-17 Alan Modra <amodra@gmail.com>
2155
2156 PR middle-end/61848
2157 * c-decl.c (merge_decls): Don't merge section name or tls model
2158 to newdecl symtab node, instead merge to olddecl. Override
2159 existing olddecl section name. Set tls_model for all thread-local
2160 vars, not just OMP thread-private ones. Remove incorrect comment.
2161
a3020f2f 21622014-10-16 Andrew MacLeod <amacleod@redhat.com>
2163
2164 * c-decl.c: Adjust include files.
2165
9f75f026 21662014-10-14 DJ Delorie <dj@redhat.com>
2167
2168 * c-parser.c (c_parse_init): Add RID entries for each __intN.
2169 (c_token_starts_typename): Check all __intN, not just __int128.
2170 (c_token_starts_declspecs): Likewise.
2171 (c_parser_declspecs): Likewise.
2172 (c_parser_attribute_any_word): Likewise.
2173 (c_parser_objc_selector): Likewise.
2174 * c-tree.h (c_typespec_keyword): cts_int128 -> cts_int_n.
2175 (struct c_declspecs): Add int_n_idx field to record *which* __intN
2176 is specified.
2177 * c-decl.c (declspecs_add_type): Check for all __intN, not just
2178 __int128.
2179 (finish_declspecs): Likewise.
2180
4f284d4a 21812014-10-13 Anthony Brandon <anthony.brandon@gmail.com>
2182
2183 * c-parser.c (c_parser_all_labels): New function to replace
2184 the duplicate code.
2185 (c_parser_statement): Call the new function.
2186
61a892dc 21872014-10-09 Marek Polacek <polacek@redhat.com>
2188
2189 PR c/63480
2190 * c-typeck.c (pop_init_level): Don't warn about initializing
2191 with { }.
2192
4e888fd9 21932014-10-07 Marek Polacek <polacek@redhat.com>
2194
2195 PR c/59717
2196 * c-decl.c (header_for_builtin_fn): New function.
2197 (implicitly_declare): Suggest which header to include.
2198
224bdd51 21992014-10-07 Marek Polacek <polacek@redhat.com>
2200
2201 * c-convert.c (convert): Use error_operand_p.
2202 * c-typeck.c (require_complete_type): Likewise.
2203 (really_atomic_lvalue): Likewise.
2204 (digest_init): Likewise.
2205 (handle_omp_array_sections_1): Likewise.
2206
a2bc79db 22072014-10-03 Marek Polacek <polacek@redhat.com>
2208
2209 PR c/63453
2210 * c-decl.c (pop_scope): Don't warn about "inline function declared
2211 but never defined" for functions marked with gnu_inline attribute.
2212
4fc4088b 22132014-09-25 Jakub Jelinek <jakub@redhat.com>
2214
2215 PR c++/63249
2216 * c-parser.c (c_parser_omp_variable_list): Call mark_exp_read
2217 on low_bound and length.
2218
5213d6c9 22192014-09-24 Marek Polacek <polacek@redhat.com>
2220
2221 PR c/61405
2222 PR c/53874
2223 * c-parser.c: Don't define CPP_KEYWORD.
2224 (c_parser_switch_statement): Pass original type to c_finish_case.
2225 * c-tree.h (c_finish_case): Update declaration.
2226 * c-typeck.c (c_finish_case): Add TYPE parameter. Pass it
2227 conditionally to c_do_switch_warnings.
2228
6ea2b1bc 22292014-09-03 Marek Polacek <polacek@redhat.com>
2230
2231 PR c/62024
2232 * c-parser.c (c_parser_static_assert_declaration_no_semi): Strip no-op
2233 conversions.
2234
40750995 22352014-09-02 Jakub Jelinek <jakub@redhat.com>
2236 Balaji V. Iyer <balaji.v.iyer@intel.com>
2237 Igor Zamyatin <igor.zamyatin@intel.com>
2238
2239 * c-parser.c (c_parser_cilk_for): New function.
2240 (c_parser_cilk_grainsize): Likewise.
2241 (c_get_temp_regvar): Likewise.
2242 (c_parser_statement_after_labels): Added RID_CILK_FOR case.
2243 (c_parser_pragma): Added PRAGMA_CILK_GRAINSIZE case.
2244 (c_parser_omp_for_loop): Added CILK_FOR and CILK_SIMD checks.
2245 * c-typeck.c (c_finish_omp_clauses): Added OMP_CLAUSE__CILK_FOR_COUNT_
2246 case.
2247
8c583613 22482014-08-27 Chen Gang <gang.chen.5i5j@gmail.com>
2249
2250 * c-aux-info.c (gen_type): Resize 'buff' from 10 to 23 bytes,
2251 with using HOST_WIDE_INT without truncation to 'int'
2252
dc6229e8 22532014-08-22 Marek Polacek <polacek@redhat.com>
2254
2255 PR c++/62199
2256 * c-typeck.c (parser_build_binary_op): Adjust call to
2257 warn_logical_not_parentheses.
2258
5fdda74b 22592014-08-22 Igor Zamyatin <igor.zamyatin@intel.com>
2260
2261 PR other/62008
2262 * c-parser.c (c_parser_array_notation): Check for correct
2263 type of an array added.
2264
78bf4156 22652014-08-19 Marek Polacek <polacek@redhat.com>
2266
2267 PR c++/62153
2268 * c-typeck.c (build_binary_op): If either operand of a comparison
2269 is a boolean expression, call maybe_warn_bool_compare.
2270
005b8fe7 22712014-08-19 Patrick Palka <ppalka@gcc.gnu.org>
2272
2273 PR c/45584
2274 * c-typeck.c (build_c_cast): Do a conversion even when the
2275 TYPE_MAIN_VARIANTs are the same.
2276
508ea33a 22772014-08-19 Marek Polacek <polacek@redhat.com>
2278
2279 * c-decl.c (diagnose_mismatched_decls): Unconditionally call
2280 pedwarn_c99 instead of pedwarn.
2281 (grokfield): Likewise.
2282 (warn_defaults_to): New function.
2283 (grokdeclarator): Call warn_defaults_to instead of pedwarn_c99.
2284 Unconditionally call pedwarn_c99 instead of pedwarn.
2285 (start_function): Call warn_defaults_to instead of pedwarn_c99.
2286 (declspecs_add_scspec): Call pedwarn_c99 instead of pedwarn, don't
2287 check flag_isoc11 before.
2288 * c-errors.c (pedwarn_c99): Change the return type to bool.
2289 Handle -Wc99-c11-compat.
2290 * c-parser.c (disable_extension_diagnostics): Handle
2291 warn_c99_c11_compat.
2292 (restore_extension_diagnostics): Likewise.
2293 (c_parser_static_assert_declaration_no_semi): Call pedwarn_c99
2294 instead of pedwarn, don't check flag_isoc11 before.
2295 (c_parser_declspecs): Likewise.
2296 (c_parser_alignas_specifier): Likewise.
2297 (c_parser_alignof_expression): Likewise.
2298 (c_parser_generic_selection): Likewise.
2299 * c-tree.h (pedwarn_c99): Update declaration.
2300 * c-typeck.c (c_finish_return): Call pedwarn or warning_at instead
2301 of pedwarn_c99.
2302
806fe15e 23032014-08-19 Marek Polacek <polacek@redhat.com>
2304
2305 * c-decl.c (warn_variable_length_array): Pass OPT_Wvla unconditionally
2306 to pedwarn_c90.
2307 * c-errors.c: Include "opts.h".
2308 (pedwarn_c90): Rewrite to handle -Wno-c90-c99-compat better.
2309 * c-parser.c (disable_extension_diagnostics): Handle negative value
2310 of warn_c90_c99_compat, too.
2311 (restore_extension_diagnostics): Likewise.
2312 (c_parser_compound_statement_nostart): Pass
2313 OPT_Wdeclaration_after_statement unconditionally to pedwarn_c90.
2314
89868e45 23152014-08-12 Marek Polacek <polacek@redhat.com>
2316
2317 * c-parser.c (c_parser_postfix_expression) <case RID_FUNCTION_NAME>:
2318 Add pedwarn.
2319 (c_parser_postfix_expression) <case RID_PRETTY_FUNCTION_NAME>:
2320 Likewise.
2321 (c_parser_postfix_expression) <case RID_C99_FUNCTION_NAME>: Likewise.
2322
890c2e2f 23232014-08-10 Marek Polacek <polacek@redhat.com>
2324
2325 PR c/51849
2326 * c-decl.c (build_array_declarator): Remove check for !flag_isoc99.
2327 Call pedwarn_c90 instead of pedwarn.
2328 (check_bitfield_type_and_width): Likewise.
2329 (declspecs_add_qual): Likewise.
2330 (declspecs_add_type): Likewise.
2331 (warn_variable_length_array): Unify function for -pedantic and -Wvla.
2332 Adjust to only call pedwarn_c90.
2333 (grokdeclarator): Remove pedantic && !flag_isoc99 check. Call
2334 pedwarn_c90 instead of pedwarn.
2335 * c-errors.c (pedwarn_c90): Handle -Wc90-c99-compat.
2336 * c-parser.c (disable_extension_diagnostics): Handle
2337 warn_c90_c99_compat.
2338 (restore_extension_diagnostics): Likewise.
2339 (c_parser_enum_specifier): Remove check for !flag_isoc99. Call
2340 pedwarn_c90 instead of pedwarn.
2341 (c_parser_initelt): Likewise.
2342 (c_parser_postfix_expression): Likewise.
2343 (c_parser_postfix_expression_after_paren_type): Likewise.
2344 (c_parser_compound_statement_nostart): Remove check for !flag_isoc99.
2345 * c-tree.h: Fix formatting.
2346 * c-typeck.c (build_array_ref): Remove check for !flag_isoc99. Call
2347 pedwarn_c90 instead of pedwarn.
2348
7149db5f 23492014-08-07 Trevor Saunders <tsaunders@mozilla.com>
2350
2351 * c-typeck.c: Remove include of pointer-set.h.
2352
1c75251e 23532014-08-07 Marek Polacek <polacek@redhat.com>
2354
2355 * c-typeck.c (pointer_diff): Remove P - (P + CST) optimization.
2356
06ecf488 23572014-08-02 Trevor Saunders <tsaunders@mozilla.com>
2358
2359 * c-typeck.c: Use hash_map instead of pointer_map.
2360
431205b7 23612014-08-02 Trevor Saunders <tsaunders@mozilla.com>
2362
2363 * c-decl.c: Use hash_set instead of pointer_set.
2364
3394c80c 23652014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
2366
2367 PR middle-end/61455
2368 * c-array-notation.c (expand_array_notations): Handling
2369 of DECL_EXPR added.
2370
f22a2cb7 23712014-07-31 Marc Glisse <marc.glisse@inria.fr>
2372
2373 PR c++/60517
2374 * c-typeck.c (c_finish_return): Return 0 instead of the address of
2375 a local variable.
2376
74691f46 23772014-07-30 Tom Tromey <tromey@redhat.com>
2378
2379 * c-typeck.c (struct constructor_stack) <designator_depth>: New
2380 field.
2381 (really_start_incremental_init, push_init_level): Initialize
2382 designator_depth.
2383 (pop_init_level): Set global designator_depth.
2384 (process_init_element): Check for designated_init attribute.
2385
f9767fb6 23862014-07-20 Marek Polacek <polacek@redhat.com>
2387
2388 PR c/61852
2389 * c-decl.c (implicit_decl_warning): Add location_t parameter. Use it.
2390 (implicitly_declare): Pass location to implicit_decl_warning.
2391
305d96bc 23922014-07-14 Jakub Jelinek <jakub@redhat.com>
2393
2394 PR middle-end/61294
2395 * c-parser.c (c_parser_expr_list): Add new argument literal_zero_mask.
2396 If non-NULL, call c_parser_check_literal_zero.
2397 (c_parser_check_literal_zero): New function.
2398 (c_parser_postfix_expression_after_primary): Adjust
2399 c_parser_expr_list caller, handle -Wmemset-transposed-args.
2400
87d59e72 24012014-07-06 Marek Polacek <polacek@redhat.com>
2402
2403 PR c/6940
2404 * c-decl.c (grokdeclarator): Set C_ARRAY_PARAMETER.
2405 * c-tree.h (C_ARRAY_PARAMETER): Define.
2406 * c-typeck.c (c_expr_sizeof_expr): Warn when using sizeof on an array
2407 function parameter.
2408
752098c8 24092014-07-02 Jan Hubicka <hubicka@ucw.cz>
2410 Chen Gang <gang.chen.5i5j@gmail.com>
2411
2412 * c-decl.c (duplicate_decls): CLear DECL_STRUCT_FUNCTION before
2413 releasing symbol.
2414
1207866e 24152014-07-01 Marek Polacek <polacek@redhat.com>
2416
2417 * c-typeck.c (convert_for_assignment): Pass OPT_Wint_conversion
2418 instead of 0 to WARN_FOR_ASSIGNMENT.
2419
7a6bbb76 24202014-07-01 Marek Polacek <polacek@redhat.com>
2421
2422 PR c/58286
2423 * c-typeck.c (convert_for_assignment): Pass
2424 OPT_Wincompatible_pointer_types instead of 0 to WARN_FOR_ASSIGNMENT.
2425
70575064 24262014-06-30 Marek Polacek <polacek@redhat.com>
2427
2428 * c-decl.c (grokdeclarator): Don't instrument VLAs if the function
2429 has no_sanitize_undefined attribute.
2430
4879e4cf 24312014-06-30 Igor Zamyatin <igor.zamyatin@intel.com>
2432
2433 PR middle-end/57541
2434 * c-array-notation.c (fix_builtin_array_notation_fn):
2435 Check for 0 arguments in builtin call. Check that bultin argument is
2436 correct.
2437 * c-parser.c (c_parser_array_notation): Check for incorrect initial
2438 index.
2439
45c5b823 24402014-06-27 Sebastian Huber <sebastian.huber@embedded-brains.de>
2441
2442 * c-parser.c (c_parser_declaration_or_fndef): Discard all type
2443 qualifiers in __auto_type for atomic types.
2444 (c_parser_typeof_specifier): Discard all type qualifiers in
2445 __typeof__ for atomic types.
2446
430b73ee 24472014-06-25 Marek Polacek <polacek@redhat.com>
2448
2449 PR c/61162
2450 * c-parser.c (c_parser_statement_after_labels): Pass the location of
2451 the return expression to c_finish_return.
2452
9580cb79 24532014-06-25 Jakub Jelinek <jakub@redhat.com>
2454
2455 * c-typeck.c (c_finish_omp_clauses): Make sure
2456 OMP_CLAUSE_LINEAR_STEP has correct type.
2457
c1f445d2 24582014-06-24 Trevor Saunders <tsaunders@mozilla.com>
2459
2460 * c-decl.c: Adjust.
2461
e471cc6f 24622014-06-24 Jakub Jelinek <jakub@redhat.com>
2463
2464 * c-parser.c (c_parser_omp_for_loop): For
2465 #pragma omp parallel for simd move lastprivate clause from parallel
2466 to for rather than simd.
2467
499b7390 24682014-06-23 Marek Polacek <polacek@redhat.com>
2469
2470 * c-typeck.c (parser_build_binary_op): Don't call
2471 warn_logical_not_parentheses if the RHS is TRUTH_NOT_EXPR.
2472
5e68df57 24732014-06-15 Jan Hubicka <hubicka@ucw.cz>
2474
2475 * c-parser.c (c_parser_omp_threadprivate): Likewise.
2476 * c-decl.c (merge_decls): Likewise.
2477
064b0d02 24782014-06-09 Marek Polacek <polacek@redhat.com>
2479
2480 PR c/36446
2481 * c-typeck.c (error_init): Call inform instead of error_at.
2482 (pedwarn_init): Call inform instead of pedwarn.
2483 (warning_init): Call inform instead of warning_at.
2484
71e19e54 24852014-06-07 Jan Hubicka <hubicka@ucw.cz>
2486
2487 * c-decl.c (merge_decls): Use set_decl_section_name.
2488 (duplicate_decls): Remove node if it exists.
2489
95cdf3fd 24902014-06-05 S. Gilles <sgilles@terpmail.umd.edu>
2491
2492 PR c/53119
2493 * c-typeck.c (push_init_level, process_init_element,
2494 pop_init_level): Correct check for zero initialization, move
2495 missing brace warning to respect zero initialization.
2496
a07f86a6 24972014-06-05 Marek Polacek <polacek@redhat.com>
2498
2499 PR c/56724
2500 * c-typeck.c (convert_for_assignment): Use expr_loc for ic_argpass.
2501
32dc1512 25022014-06-05 Marek Polacek <polacek@redhat.com>
2503
2504 PR c/49706
2505 * c-typeck.c (parser_build_binary_op): Warn when logical not is used
2506 on the left hand side operand of a comparison.
2507
64cf1262 25082014-06-05 Marek Polacek <polacek@redhat.com>
2509
2510 PR c/48062
2511 * c-decl.c (warn_if_shadowing): Call inform instead of warning_at.
2512 Print note only if the warning was printed.
2513
071f6d39 25142014-06-04 Igor Zamyatin <igor.zamyatin@intel.com>
2515
2516 PR c/58942
2517 * c-array-notation.c (fix_builtin_array_notation_fn): Handle the case
2518 with a pointer.
2519
c69ec07d 25202014-06-03 Marek Polacek <polacek@redhat.com>
2521
2522 PR c/60439
2523 * c-parser.c (c_parser_switch_statement): Pass explicit_cast_p to
2524 c_start_case.
2525 * c-tree.h (c_start_case): Update.
2526 * c-typeck.c (c_start_case): Add new boolean parameter. Warn if
2527 switch condition has boolean value.
2528
f7715905 25292014-06-02 Andrew MacLeod <amacleod@redhat.com>
2530
2531 * c-decl.c: Include builtins.h.
2532 * c-parser.c: Likewise.
2533
dcfff6f9 25342014-05-27 Marek Polacek <polacek@redhat.com>
2535
2536 PR c/56724
2537 * c-typeck.c (convert_arguments): Get location of a parameter. Change
2538 error and warning calls to error_at and warning_at. Pass location of
2539 a parameter to it. Call warning_at with OPT_Wtraditional_conversion.
2540 (convert_for_assignment): Add parameter to WARN_FOR_ASSIGNMENT and
2541 WARN_FOR_QUALIFIERS. Pass expr_loc to those.
2542
c048c42c 25432014-05-26 Igor Zamyatin <igor.zamyatin@intel.com>
2544
2545 PR c/61191
2546 * c-array-notation.c (fix_builtin_array_notation_fn): Check invalid
2547 function parameters.
2548
8c016392 25492014-05-23 Jan Hubicka <hubicka@ucw.cz>
2550
2551 * c-decl.c (merge_decls): Preserve symtab node pointers.
2552 (duplicate_decls): Free new decl.
2553
184a718f 25542014-05-23 Thomas Schwinge <thomas@codesourcery.com>
2555
6ce915ef 2556 * c-typeck.c (c_finish_omp_clauses): Remove duplicated variable
2557 initialization.
2558
184a718f 2559 * c-parser.c (c_parser_omp_target): Return bool values.
2560
22ac3f78 25612014-05-22 Thomas Schwinge <thomas@codesourcery.com>
2562
2563 * c-parser.c (c_parser_omp_clause_thread_limit): Rename
2564 num_teams_loc variable to num_thread_limit_loc.
2565
3ab4693e 25662014-05-21 Richard Sandiford <rsandifo@linux.vnet.ibm.com>
2567
2568 * c-array-notation.c (expand_array_notations): Use void_node
2569 instead of void_zero_node.
2570
25a27413 25712014-05-17 Trevor Saunders <tsaunders@mozilla.com>
2572
2573 * c-decl.c (finish_struct): Adjust.
2574 (finish_enum): Likewise.
2575 (bind): Adjust.
2576 (record_inline_static): Likewise.
2577 (push_scope): Likewise.
2578 (make_label): Likewise.
2579 (lookup_label_for_goto): Likewise.
2580 (finish_struct): Likewise.
2581 (finish_enum): Likewise.
2582 (store_parm_decls): Likewise.
2583 (c_push_function_context): Likewise.
2584 * c-lang.h: Remove usage of variable_size gty attribute.
2585 * c-parser.c (c_parse_init): Adjust.
2586 (c_parse_file): Likewise.
2587
172b8440 25882014-05-13 Marek Polacek <polacek@redhat.com>
2589
2590 PR c/61162
2591 * c-typeck.c (convert_for_assignment): Pass location to
2592 WARN_FOR_ASSIGNMENT instead of input_location.
2593
c9e51d25 25942014-05-10 Marek Polacek <polacek@redhat.com>
2595
2596 * c-parser.c (c_parser_declaration_or_fndef): Pass init_loc to
2597 maybe_warn_string_init.
2598 (c_parser_postfix_expression_after_paren_type): Pass type_loc to
2599 maybe_warn_string_init.
2600 * c-tree.h (maybe_warn_string_init): Update declaration.
2601 * c-typeck.c (maybe_warn_string_init): Add location parameter.
2602 Call pedwarn_init with loc instead of with input_location.
2603 (digest_init): Pass init_loc to maybe_warn_string_init.
2604 (pop_init_level): Call pedwarn_init with loc instead of with
2605 input_location.
2606 (set_init_index): Likewise.
2607 (process_init_element): Likewise.
2608
53de1631 26092014-05-09 Marek Polacek <polacek@redhat.com>
2610
2611 PR c/61096
2612 * c-parser.c (c_parser_braced_init): Pass brace_loc to push_init_level.
2613 (c_parser_initelt): Pass location to set_init_label. Pass array index
2614 location to set_init_index.
2615 * c-tree.h (push_init_level): Update declaration.
2616 (pop_init_level): Likewise.
2617 (set_init_index): Likewise.
2618 (set_init_label): Likewise.
2619 * c-typeck.c (error_init): Add location parameter. Call error_at
2620 instead of error.
2621 (digest_init): Pass init_loc to error_init.
2622 (really_start_incremental_init):
2623 (push_init_level): Add location parameter. Pass loc to pop_init_level
2624 and error_init.
2625 (pop_init_level): Likewise.
2626 (set_designator): Add location parameter. Pass loc to pop_init_level,
2627 push_init_level, and error_init.
2628 (set_init_index): Add location parameter. Pass loc to error_init and
2629 set_designator.
2630 (set_init_label): Likewise.
2631 (output_init_element): Pass loc to error_init.
2632 (process_init_element): Pass loc to error_init, pop_init_level,
2633 pedwarn_init, and push_init_level.
2634
3e5a8b00 26352014-05-09 Marek Polacek <polacek@redhat.com>
2636
2637 PR c/50459
2638 * c-parser.c (c_parser_attributes): Parse the arguments as an
2639 expression-list if the attribute takes identifier.
2640
c2c4ae8d 26412014-05-08 Marek Polacek <polacek@redhat.com>
2642
2643 PR c/61053
2644 * c-decl.c (grokdeclarator): Use min_align_of_type instead of
2645 TYPE_ALIGN_UNIT.
2646
2026249a 26472014-05-08 Marek Polacek <polacek@redhat.com>
2648
2649 PR c/61077
2650 * c-decl.c (start_function): Warn for _Atomic-qualified return type
2651 of main.
2652
960d5a55 26532014-05-06 Kenneth Zadeck <zadeck@naturalbridge.com>
2654 Mike Stump <mikestump@comcast.net>
2655 Richard Sandiford <rdsandiford@googlemail.com>
2656
2657 * c-decl.c (check_bitfield_type_and_width): Use TYPE_SIGN.
2658 (finish_enum): Use wide-int interfaces.
2659 * c-parser.c (c_parser_cilk_clause_vectorlength): Likewise.
2660 * c-typeck.c (build_c_cast): Likewise.
2661 (set_nonincremental_init_from_string): Likewise.
2662 (c_tree_equal): Likewise.
2663
e0e14cbd 26642014-05-02 Marek Polacek <polacek@redhat.com>
2665
2666 PR c/25801
2667 * c-typeck.c (c_size_in_bytes): Update comment. Don't call error.
2668 Return size_one_node when the type is not complete.
2669 (pointer_diff): Remove comment.
2670 (build_unary_op): Improve error messages.
2671
27ff10cb 26722014-05-02 Marek Polacek <polacek@redhat.com>
2673
2674 * c-typeck.c (c_finish_return): Separate warning_at calls.
2675
68410ce9 26762014-05-02 Marek Polacek <polacek@redhat.com>
2677
2678 * c-tree.h (error_init): Remove declaration.
2679 (pedwarn_init): Likewise.
2680 * c-typeck.c (error_init): Make static and move above.
2681 (pedwarn_init): Likewise.
2682 (warning_init): Move above.
2683 (maybe_warn_string_init): Likewise.
2684
e8e27117 26852014-05-01 Jeff Law <law@redhat.com>
2686
2687 Revert:
2688
2689 2014-04-24 Prathamesh Kulkarni <bilbotheelffriend@gmail.com>
2690 * c-parser.c (c_parser_sizeof_expression): Reorganize slightly to
2691 avoid goto.
2692
971df357 26932014-05-02 Marek Polacek <polacek@redhat.com>
2694
2695 PR c/60784
2696 * c-typeck.c (push_init_level): Set constructor_designated to
2697 p->designated for structures.
2698
de548fe5 26992014-05-01 Marek Polacek <polacek@redhat.com>
2700
2701 PR c/60915
2702 * c-parser.c (c_parser_declaration_or_fndef): Give better error if
2703 function-definition has an attribute after the declarator.
2704
053a0ded 27052014-05-01 Marek Polacek <polacek@redhat.com>
2706
2707 PR c/60257
2708 * c-typeck.c (warning_init): Add location_t parameter. Call
2709 warning_at instead of warning.
2710 (push_init_level): Pass input_location to warning_init.
2711 (add_pending_init): Add location_t parameter. Pass loc to
2712 warning_init.
2713 (set_nonincremental_init): Pass input_location to add_pending_init.
2714 (set_nonincremental_init_from_string): Likewise.
2715 (output_init_element): Pass loc to warning_init and to
2716 add_pending_init.
2717
694296f2 27182014-05-01 Marek Polacek <polacek@redhat.com>
2719
2720 PR c/43395
2721 * c-typeck.c (c_finish_return): Distinguish between label and variable
2722 when warning about returning local address.
2723
86bbd7f9 27242014-05-01 Marek Polacek <polacek@redhat.com>
2725
2726 PR c/29467
2727 * c-decl.c (declspecs_add_type): Pedwarn if boolean types are used
2728 in C89 mode.
2729
e4ab2ef3 27302014-05-01 Marek Polacek <polacek@redhat.com>
2731
2732 PR c/43245
2733 * c-typeck.c (convert_for_assignment): Pass OPT_Wdiscarded_qualifiers
2734 instead of 0 to WARN_FOR_QUALIFIERS.
2735
ca3999cb 27362014-05-01 Marek Polacek <polacek@redhat.com>
2737
2738 PR c/56989
2739 * c-typeck.c (default_conversion): Use better location for
2740 error call.
2741
52cc0072 27422014-04-30 Marek Polacek <polacek@redhat.com>
2743
2744 * c-typeck.c (build_binary_op): Call ubsan_instrument_division
2745 also when SANITIZE_FLOAT_DIVIDE is on.
2746
af379dd3 27472014-04-30 Marek Polacek <polacek@redhat.com>
2748
2749 PR c/60139
2750 * c-typeck.c (output_init_element): Pass OPT_Wpedantic to pedwarn
2751 and pedwarn_init. Use loc insted of input_location.
2752
b069c2a0 27532014-04-30 Marek Polacek <polacek@redhat.com>
2754
2755 PR c/60351
2756 * c-typeck.c (build_binary_op): Use location when warning about
2757 shift count.
2758
4a026b48 27592014-04-25 Marek Polacek <polacek@redhat.com>
2760
2761 PR c/18079
2762 * c-decl.c (diagnose_mismatched_decls): Warn for mismatched
2763 always_inline/noinline and hot/cold attributes.
2764
adc93f31 27652014-04-25 Marek Polacek <polacek@redhat.com>
2766
2767 PR c/60114
2768 * c-parser.c (c_parser_initelt): Pass input_location to
2769 process_init_element.
2770 (c_parser_initval): Pass loc to process_init_element.
2771 * c-tree.h (process_init_element): Adjust declaration.
2772 * c-typeck.c (push_init_level): Pass input_location to
2773 process_init_element.
2774 (pop_init_level): Likewise.
2775 (set_designator): Likewise.
2776 (output_init_element): Add location_t parameter. Pass loc to
2777 digest_init.
2778 (output_pending_init_elements): Pass input_location to
2779 output_init_element.
2780 (process_init_element): Add location_t parameter. Pass loc to
2781 output_init_element.
2782
e1029911 27832014-04-24 Jakub Jelinek <jakub@redhat.com>
2784
2785 * c-parser.c (c_parser_omp_atomic): Allow seq_cst before
2786 atomic-clause, allow comma in between atomic-clause and
2787 seq_cst.
2788
9f0a7bc6 27892014-04-22 Jakub Jelinek <jakub@redhat.com>
2790
2791 PR c/59073
2792 * c-parser.c (c_parser_omp_parallel): If c_parser_omp_for
2793 fails, don't set OM_PARALLEL_COMBINED and return NULL.
2794
094da06d 27952014-04-12 Igor Zamyatin <igor.zamyatin@intel.com>
2796
2797 PR middle-end/60469
2798 * c-array-notation.c (fix_builtin_array_notation_fn): Use
2799 create_tmp_var instead build_decl for creating temps.
2800 (build_array_notation_expr): Likewise.
2801 (fix_conditional_array_notations_1): Likewise.
2802 (fix_array_notation_expr): Likewise.
2803 (fix_array_notation_call_expr): Likewise.
2804
5a672e62 28052014-03-28 Jakub Jelinek <jakub@redhat.com>
2806
2807 PR c++/60689
2808 * c-tree.h (c_build_function_call_vec): New prototype.
2809 * c-typeck.c (build_function_call_vec): Don't call
2810 resolve_overloaded_builtin here.
2811 (c_build_function_call_vec): New wrapper function around
2812 build_function_call_vec. Call resolve_overloaded_builtin here.
2813 (convert_lvalue_to_rvalue, build_function_call, build_atomic_assign):
2814 Call c_build_function_call_vec instead of build_function_call_vec.
2815 * c-parser.c (c_parser_postfix_expression_after_primary): Likewise.
2816 * c-decl.c (finish_decl): Likewise.
2817
f40f5e0e 28182014-03-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
2819
2820 PR c/55383
2821 * c-typeck.c: Use correct format string in cast-qual warning
2822
9ec099a3 28232014-03-07 Thomas Schwinge <thomas@codesourcery.com>
2824
2825 * c-decl.c (c_decl_attributes): Use
2826 lang_hooks.types.omp_mappable_type.
2827 * c-typeck.c (c_finish_omp_clauses): Likewise.
2828
3bfdc94f 28292014-03-06 Marek Polacek <polacek@redhat.com>
2830
2831 PR c/60197
2832 * c-typeck.c (c_finish_return): Call contains_cilk_spawn_stmt instead
2833 of checking tree code.
2834
8f1128f8 28352014-02-19 Prathamesh Kulkarni <bilbotheelffriend@gmail.com>
2836
2837 * c-parser.c (c_parser_declspecs): Replace call to error by error_at.
2838 (c_parser_parameter_declaration): Likewise.
2839
977b1853 28402014-02-19 Marek Polacek <polacek@redhat.com>
2841
2842 PR c/60195
2843 * c-typeck.c (convert_lvalue_to_rvalue): Set TREE_NO_WARNING on tmp.
2844 Call mark_exp_read on exp.value.
2845 (build_atomic_assign): Set TREE_NO_WARNING on val and old. Set
2846 TREE_ADDRESSABLE on old instead of val.
2847 (emit_side_effect_warnings): Warn only if RHS has !TREE_NO_WARNING.
2848
825cd6ef 28492014-02-07 Prathamesh Kulkarni <bilbotheelffriend@gmail.com>
2850
2851 * c-parser.c (c_parser_get_builtin_args): Replace calls to
2852 C_EXPR_APPEND by vec_safe_push.
2853 * c-tree.h (C_EXPR_APPEND): Remove.
2854
ec761d5a 28552014-01-31 Marek Polacek <polacek@redhat.com>
2856
2857 PR c/59963
2858 * c-typeck.c (convert_lvalue_to_rvalue): Pass vNULL to
2859 build_function_call_vec.
2860 (build_function_call): Likewise.
2861 (build_atomic_assign): Likewise.
2862 (build_function_call_vec): Add arg_loc parameter. Use it.
2863 (convert_arguments): Likewise.
2864 (convert_for_assignment): Rename rhs_loc to expr_loc.
2865 * c-parser.c (c_parser_attributes): Pass NULL to c_parser_expr_list.
2866 (c_parser_objc_keywordexpr): Likewise.
2867 (c_parser_postfix_expression_after_primary): Call
2868 build_function_call_vec with expr_loc rather than op_loc.
2869 Call c_parser_expr_list to fill arg_loc. Pass arg_loc to
2870 build_function_call_vec.
2871 (c_parser_expr_list): Add locations parameter. Fill it with locations
2872 of function arguments.
2873 * c-decl.c (finish_decl): Pass vNULL to build_function_call_vec.
2874
22a75734 28752014-01-30 Marek Polacek <polacek@redhat.com>
2876
2877 PR c/59940
2878 * c-typeck.c (build_function_call_vec): Use loc parameter.
2879 (convert_arguments): Add location parameter. Use it.
2880 (ep_convert_and_check): Likewise.
2881 (build_atomic_assign): Adjust convert_for_assignment call.
2882 (build_modify_expr): Likewise.
2883 (digest_init): Likewise.
2884 (c_finish_return): Likewise.
2885 (build_conditional_expr): Adjust ep_convert_and_check calls.
2886 (convert_for_assignment): Add rhs_loc parameter. Use it.
2887 (build_binary_op): Adjust convert_and_check and ep_convert_and_check
2888 calls.
2889
29f580ac 28902014-01-30 Richard Biener <rguenther@suse.de>
2891
2892 PR c/59905
2893 * c-typeck.c (build_function_call_vec): Do not replace calls
2894 to a function via an incompatible type with a runtime abort.
2895
a89e6c15 28962014-01-24 Balaji V. Iyer <balaji.v.iyer@intel.com>
2897
2898 * c-parser.c (c_parser_declaration_or_fndef): Replaced
2899 flag_enable_cilkplus with flag_cilkplus.
2900 (c_parser_direct_declarator_inner): Likewise.
2901 (c_parser_attribute_any_word): Likewise.
2902 (c_parser_attributes): Likewise.
2903 (c_parser_compound_statement): Likewise.
2904 (c_parser_statement_after_labels): Likewise.
2905 (c_parser_if_statement): Likewise.
2906 (c_parser_switch_statement): Likewise.
2907 (c_parser_do_statement): Likewise.
2908 (c_parser_for_statement): Likewise.
2909 (c_parser_unary_expression): Likewise.
2910 (c_parser_postfix_expression): Likewise.
2911 (c_parser_postfix_expression_after_primary): Likewise.
2912 (c_parser_postfix_expression_after_primary): Likewise.
2913 (c_parser_omp_clause_name): Likewise.
2914 (c_finish_omp_declare_simd): Likewise.
2915 (c_parser_cilk_verify_simd): Likewise.
2916 * c-typeck.c (build_array_ref): Likewise.
2917 (build_function_call_vec): Likewise.
2918 (convert_arguments): Likewise.
2919 (build_compound_expr): Likewise.
2920 (c_finish_return): Likewise.
2921 (c_finish_if_stmt): Likewise.
2922 (c_finish_loop): Likewise.
2923 (build_binary_op): Likewise.
2924
2623625f 29252014-01-23 Marek Polacek <polacek@redhat.com>
2926
2927 PR c/59846
2928 * c-typeck.c (parser_build_binary_op): Use location instead of
2929 input_location.
2930 (build_binary_op): Pass location to shorten_compare.
2931
46da3601 29322014-01-23 Marek Polacek <polacek@redhat.com>
2933
2934 PR c/58346
2935 * c-typeck.c (pointer_diff): Give an error on arithmetic on pointer to
2936 an empty aggregate.
2937
9a9db3c1 29382014-01-23 Marek Polacek <polacek@redhat.com>
2939
2940 PR c/59871
2941 * c-typeck.c (build_compound_expr): Warn even for right-hand operand
2942 of a comma expression.
2943 (emit_side_effect_warnings): Likewise.
2944
69c9b607 29452014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com>
2946
2947 PR c/59825
2948 * c-array-notation.c (expand_array_notation_exprs): Rewrote this
2949 function to use walk_tree and moved a lot of its functionality to
2950 expand_array_notations.
2951 (expand_array_notations): New function.
2952
7e005ab5 29532014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com>
2954
2955 * c-parser.c (c_finish_omp_declare_simd): Made "cilk simd function"
2956 attribute an attribute without value.
2957
d6779b5f 29582014-01-23 Jakub Jelinek <jakub@redhat.com>
2959
2960 PR middle-end/58809
2961 * c-typeck.c (c_finish_omp_clause): Reject MIN_EXPR, MAX_EXPR,
2962 BIT_AND_EXPR, BIT_IOR_EXPR and BIT_XOR_EXPR on COMPLEX_TYPEs.
2963
ec431042 29642014-01-22 Marek Polacek <polacek@redhat.com>
2965
2966 PR c/59891
2967 * c-typeck.c (build_conditional_expr): Call c_fully_fold instead
2968 of remove_c_maybe_const_expr on op1 and op2.
2969
1248c663 29702014-01-15 Jakub Jelinek <jakub@redhat.com>
2971
2972 PR c/58943
2973 * c-typeck.c (build_modify_expr): For lhs op= rhs, if rhs has side
2974 effects, preevaluate rhs using SAVE_EXPR first.
2975
0bc789fc 29762014-01-09 Balaji V. Iyer <balaji.v.iyer@intel.com>
2977
2978 PR c++/59631
2979 * c-parser.c (c_parser_postfix_expression): Replaced consecutive if
2980 statements with if-elseif statements.
2981
6685d11c 29822014-01-06 Marek Polacek <polacek@redhat.com>
2983
2984 PR c/57773
2985 * c-decl.c (check_bitfield_type_and_width): Warn for implementation
2986 defined bit-field types only in ISO C.
2987
3aea1f79 29882014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
2989
2990 Update copyright years
2991
e4f22041 29922014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
2993
2994 * c-array-notation.c: Use the standard form for the copyright notice.
2995
74acc703 29962013-12-18 Balaji V. Iyer <balaji.v.iyer@intel.com>
2997
2998 * c-parser.c (struct c_parser::cilk_simd_fn_tokens): Added new field.
2999 (c_parser_declaration_or_fndef): Added a check if cilk_simd_fn_tokens
3000 field in parser is not empty. If not-empty, call the function
3001 c_parser_finish_omp_declare_simd.
3002 (c_parser_cilk_clause_vectorlength): Modified function to be shared
3003 between SIMD-enabled functions and #pragma simd. Added new parameter.
3004 (c_parser_cilk_all_clauses): Modified the usage of the function
3005 c_parser_cilk_clause_vectorlength as mentioned above.
3006 (c_parser_cilk_simd_fn_vector_attrs): New function.
3007 (c_finish_cilk_simd_fn_tokens): Likewise.
3008 (is_cilkplus_vector_p): Likewise.
3009 (c_parser_omp_clause_name): Added checking for "vectorlength,"
3010 "nomask," and "mask" strings in clause name.
3011 (c_parser_omp_all_clauses): Added 3 new case statements:
3012 PRAGMA_CILK_CLAUSE_VECTORLENGTH, PRAGMA_CILK_CLAUSE_MASK and
3013 PRAGMA_CILK_CLAUSE_NOMASK.
3014 (c_parser_attributes): Added a cilk_simd_fn_tokens parameter. Added a
3015 check for vector attribute and if so call the function
3016 c_parser_cilk_simd_fn_vector_attrs. Also, when Cilk plus is enabled,
3017 called the function c_finish_cilk_simd_fn_tokens.
3018 (c_finish_omp_declare_simd): Added a check if cilk_simd_fn_tokens in
3019 parser field is non-empty. If so, parse them as you would parse
3020 the omp declare simd pragma.
3021 (c_parser_omp_clause_linear): Added a new bool parm. is_cilk_simd_fn.
3022 Added a check when step is a parameter and flag it as error.
3023 (CILK_SIMD_FN_CLAUSE_MASK): New #define.
3024 (c_parser_cilk_clause_name): Changed pragma_cilk_clause to
3025 pragma_omp_clause.
3026
395dc01c 30272013-12-17 Thomas Schwinge <thomas@codesourcery.com>
3028
3029 * c-parser.c (c_parser_omp_parallel): Fix description.
3030
433e804e 30312013-12-11 Balaji V. Iyer <balaji.v.iyer@intel.com>
3032
3033 * c-objc-common.h (LANG_HOOKS_CILKPLUS_FRAME_CLEANUP): Remove.
3034 (LANG_HOOKS_CILKPLUS_DETECT_SPAWN_AND_UNWRAP): Likewise.
3035 (LANG_HOOKS_CILKPLUS_CILKPLUS_GIMPLIFY_SPAWN): Likewise.
3036 * c-typeck.c (cilk_install_body_with_frame_cleanup): New function.
3037
a179a7dc 30382013-12-04 Joseph Myers <joseph@codesourcery.com>
3039
3040 PR c/52023
3041 * c-parser.c (c_parser_alignas_specifier): Use
3042 c_sizeof_or_alignof_type instead of c_alignof.
3043 (c_parser_alignof_expression): Likewise, with min_alignof
3044 parameter depending on alignof spelling used.
3045
bdf1e3c7 30462013-12-04 Marek Polacek <polacek@redhat.com>
3047
3048 PR c/54113
3049 * c-decl.c (start_function): Don't warn for missing prototype for
3050 inline functions.
3051
05e8f674 30522013-12-03 Marek Polacek <polacek@redhat.com>
3053
3054 PR c/59351
3055 * c-decl.c (build_compound_literal): Allow compound literals with
3056 empty initial value.
3057
39f74d66 30582013-12-02 Joseph Myers <joseph@codesourcery.com>
3059
3060 PR c/58235
3061 * c-typeck.c (build_modify_expr): Diagnose assignment to
3062 expression with array type.
3063
f221adca 30642013-11-29 Joseph Myers <joseph@codesourcery.com>
3065
3066 PR c/42262
3067 * c-typeck.c (process_init_element): Do not treat a string as
3068 initializing a whole array when used with a designator for an
3069 individual element.
3070
75bce827 30712013-11-29 Joseph Myers <joseph@codesourcery.com>
3072
3073 PR c/57574
3074 * c-decl.c (merge_decls): Clear DECL_EXTERNAL for a definition of
3075 an inline function following a static declaration.
3076
dc133326 30772013-11-28 Jakub Jelinek <jakub@redhat.com>
3078
3079 PR c/59310
3080 * c-parser.c (c_parser_omp_target): Copy "#pragma omp target"
3081 to p_name before calling c_parser_omp_teams instead of after.
3082 (c_parser_cilk_simd): Remove wrong ATTRIBUTE_UNUSED from parser
3083 argument. Remove unused p_name variable.
3084
d09768a4 30852013-11-27 Aldy Hernandez <aldyh@redhat.com>
3086 Jakub Jelinek <jakub@redhat.com>
3087
3088 * c-decl.c (c_builtin_function_ext_scope): Avoid binding if
3089 external_scope is NULL.
3090
73fd9cbe 30912013-11-27 Tom de Vries <tom@codesourcery.com>
3092 Marc Glisse <marc.glisse@inria.fr>
3093
3094 PR c++/59032
3095 * c-typeck.c (build_unary_op): Allow vector increment and decrement.
3096
bc61cadb 30972013-11-22 Andrew MacLeod <amacleod@redhat.com>
3098
3099 * c-typeck.c: Add required include files from gimple.h.
3100
3df42822 31012013-11-22 David Malcolm <dmalcolm@redhat.com>
3102
3103 * c-decl.c (define_label, shadow_tag_warned)
3104 (check_bitfield_type_and_width, grokdeclarator, grokparms,
3105 store_parm_decls_newstyle, store_parm_decls_oldstyle)
3106 (declspecs_add_type): Remove use of in_system_header macro.
3107 * c-parser.c (c_parser_unary_expression): Likewise.
3108 * c-typeck.c (store_init_value, process_init_element)
3109 (c_start_case): Likewise.
3110
3111 * c-decl.c (build_enumerator): Remove use of EXPR_LOC_OR_HERE
3112 macro.
3113
3114 * c-parser.c (c_parser_set_source_position_from_token): Remove
3115 reference to in_system_header from comment.
3116
08f817b3 31172013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
3118
3119 * c-decl.c (grokdeclarator): Update comment to refer to
3120 tree_to_[su]hwi rather than tree_low_cst.
3121
6a0712d4 31222013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
3123
3124 * c-decl.c, c-typeck.c: Replace tree_low_cst (..., 1) with
3125 tree_to_uhwi throughout.
3126
fcb97e84 31272013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
3128
3129 * c-parser.c: Replace tree_low_cst (..., 0) with tree_to_shwi
3130 throughout.
3131
35ec552a 31322013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
3133
3134 * c-parser.c: Replace host_integerp (..., 0) with tree_fits_shwi_p
3135 throughout.
3136
f2697631 31372013-11-15 Aldy Hernandez <aldyh@redhat.com>
3138
3139 * c-parser.c (c_parser_cilk_simd): New.
3140 (c_parser_cilk_verify_simd): New.
3141 (c_parser_pragma): Add case for PRAGMA_CILK_SIMD.
3142 (c_parser_omp_for_loop): Add case for NE_EXPR.
3143 Set c_break_label for CILK_SIMD.
3144 (c_parser_cilk_clause_vectorlength): New.
3145 (c_parser_cilk_clause_linear): New.
3146 (c_parser_cilk_clause_name): New.
3147 (c_parser_cilk_all_clauses): New.
3148 * c-typeck.c (build_unary_op): Pass location argument to
3149 readonly_error.
3150 (build_modify_expr): Same.
3151 (build_asm_expr): Same.
3152 (c_finish_bc_stmt): Error on break/continue in loops.
3153
e795d6e1 31542013-11-14 Andrew MacLeod <amacleod@redhat.com>
3155
3156 * c-typeck.c: Include only gimplify.h and gimple.h as needed.
3157
9ed99284 31582013-11-14 Diego Novillo <dnovillo@google.com>
3159
3160 * c-decl.c: Include print-tree.h.
3161 Include stor-layout.h.
3162 Include varasm.h.
3163 Include attribs.h.
3164 Include stringpool.h.
3165 * c-lang.c: Include fold-const.h.
3166 * c-parser.c: Include stringpool.h.
3167 Include attribs.h.
3168 Include stor-layout.h.
3169 Include varasm.h.
3170 Include trans-mem.h.
3171 * c-typeck.c: Include stor-layout.h.
3172 Include trans-mem.h.
3173 Include varasm.h.
3174 Include stmt.h.
3175
4fba5eb9 31762013-11-13 Joseph Myers <joseph@codesourcery.com>
3177
3178 * c-tree.h (c_typespec_keyword): Add cts_auto_type.
3179 * c-decl.c (declspecs_add_type, finish_declspecs): Handle
3180 __auto_type.
3181 * c-parser.c (c_token_starts_typename, c_token_starts_declspecs)
3182 (c_parser_attribute_any_word, c_parser_objc_selector): Handle
3183 RID_AUTO_TYPE.
3184 (c_parser_declspecs): Take argument AUTO_TYPE_OK.
3185 (c_parser_declaration_or_fndef, c_parser_struct_declaration)
3186 (c_parser_declarator, c_parser_direct_declarator_inner)
3187 (c_parser_parameter_declaration, c_parser_type_name): All callers
3188 changed.
3189 (c_parser_declaration_or_fndef): Handle declarations with type
3190 determined from the initializer.
3191
a8783bee 31922013-11-12 Andrew MacLeod <amacleod@redhat.com>
3193
e795d6e1 3194 * c-typeck.c: Include gimplify.h.
a8783bee 3195
d184e0c0 31962013-11-12 Joseph Myers <joseph@codesourcery.com>
3197
3198 * c-tree.h (struct c_declspecs): Add thread_gnu_p field.
3199 * c-parser.c (c_parser_declspecs): Mention _Thread_local in
3200 comment.
3201 * c-decl.c (shadow_tag_warned, grokdeclarator): Mention __thread
3202 or _Thread_local as appropriate in diagnostics.
3203 (build_null_declspecs): Initialize ret->thread_gnu_p.
3204 (declspecs_add_scspec): Handle either __thread or _Thread_local
3205 for RID_THREAD. Diagnose _Thread_local for pre-C11 standards if
3206 pedantic. Do not disallow _Thread_local extern and _Thread_local
3207 static.
3208
b560fabd 32092013-11-07 Joseph Myers <joseph@codesourcery.com>
3210 Andrew MacLeod <amacleod@redhat.com>
3211
3212 * c-aux-info.c (gen_type): Handle atomic qualifier.
3213 * c-decl.c (validate_proto_after_old_defn): Do not remove atomic
3214 qualifiers when compating types.
3215 (shadow_tag_warned): Handle atomic_p in declspecs.
3216 (quals_from_declspecs): Likewise.
3217 (start_decl): Use c_type_promotes_to when promoting argument
3218 types.
3219 (grokdeclarator): Handle _Atomic.
3220 (get_parm_info): Diagnose any qualifier on "void" as only
3221 parameter.
3222 (store_parm_decls_oldstyle): Do not remove atomic qualifiers when
3223 comparing types. Use c_type_promotes_to when promoting argument
3224 types.
3225 (finish_function): Use c_type_promotes_to when promoting argument
3226 types.
3227 (build_null_declspecs): Handle atomic_p in declspecs.
3228 (declspecs_add_qual): Handle RID_ATOMIC.
3229 * c-parser.c (c_token_starts_typename, c_token_is_qualifier)
3230 (c_token_starts_declspecs): Handle RID_ATOMIC.
3231 (c_parser_declspecs): Handle atomic type specifiers and
3232 qualifiers.
3233 (c_parser_typeof_specifier): Remove const and _Atomic qualifiers
3234 from types of expressions with atomic type.
3235 (c_parser_direct_declarator_inner): Use convert_lvalue_to_rvalue.
3236 (c_parser_attribute_any_word): Handle RID_ATOMIC.
3237 (c_parser_initializer, c_parser_initelt, c_parser_initval)
3238 (c_parser_statement_after_labels, c_parser_switch_statement)
3239 (c_parser_for_statement, c_parser_expr_no_commas)
3240 (c_parser_conditional_expression, c_parser_binary_expression)
3241 (c_parser_cast_expression, c_parser_unary_expression)
3242 (c_parser_postfix_expression)
3243 (c_parser_postfix_expression_after_primary, c_parser_expression):
3244 Use convert_lvalue_to_rvalue.
3245 (c_parser_expression_conv, c_parser_expr_list): Document
3246 conversion of lvalues to rvalues. Use convert_lvalue_to_rvalue.
3247 (c_parser_objc_synchronized_statement): Use
3248 convert_lvalue_to_rvalue.
3249 (c_parser_objc_selector): Handle RID_ATOMIC.
3250 (c_parser_objc_receiver, c_parser_array_notation): Use
3251 convert_lvalue_to_rvalue.
3252 * c-tree.h (ctsk_typeof): Adjust comment to mention use for
3253 _Atomic (type-name).
3254 (struct c_declspecs): Add atomic_p field.
3255 (convert_lvalue_to_rvalue): Declare.
3256 * c-typeck.c (c_type_promotes_to): Promote atomic types to
3257 corresponding atomic types.
3258 (qualify_type): Don't add _Atomic qualifiers from second argument.
3259 (comp_target_types): Do not allow _Atomic mismatches.
3260 (type_lists_compatible_p): Do not remove atomic qualifiers when
3261 comparing types.
3262 (really_atomic_lvalue, convert_lvalue_to_rvalue)
3263 (build_atomic_assign): New functions.
3264 (build_unary_op): Use build_atomic_assign for atomic increment and
3265 decrement.
3266 (build_conditional_expr): Do not treat _Atomic void as a qualified
3267 version of void.
3268 (build_modify_expr): Use build_atomic_assign for atomic LHS.
3269 (find_anonymous_field_with_type, convert_to_anonymous_field)
3270 (convert_for_assignment): Do not remove atomic qualifiers when
3271 comparing types.
3272 (digest_init): Do not accept initialization of arrays of atomic
3273 elements by string constants.
3274 (build_asm_expr): Use convert_lvalue_to_rvalue.
3275 (build_binary_op): Do not treat _Atomic void as a qualified
3276 version of void.
3277
8b023e7c 32782013-11-06 DJ Delorie <dj@redhat.com>
3279
3280 * c-decl.c (locate_old_decl): If a previous conflicting decl is
3281 both explicit and builtin, print the location of the explicit one.
3282
c630ef93 32832013-11-05 Tobias Burnus <burnus@net-b.de>
3284
3285 * c-parser.c (c_parser_omp_for, c_parser_omp_parallel,
3286 c_parser_omp_distribute, c_parser_omp_teams,
3287 c_parser_omp_target, c_parser_omp_declare): Handle
3288 -fopenmp-simd.
3289
2c4c3477 32902013-11-03 Marek Polacek <polacek@redhat.com>
3291
3292 * c-decl.c (grokdeclarator): Add VLA instrumentation.
3293
df205251 32942013-11-01 Jakub Jelinek <jakub@redhat.com>
3295
3296 * c-typeck.c (c_finish_omp_clauses) <case OMP_CLAUSE_UNIFORM>: Go to
3297 check_dup_generic at the end, unless remove is true.
3298 (c_finish_omp_clauses) <case OMP_CLAUSE_REDUCTION>: Add break; after
3299 remove = true;.
3300 (c_finish_omp_clauses) <case OMP_CLAUSE_COPYIN>: Likewise.
3301
23871d0c 33022013-10-31 Jakub Jelinek <jakub@redhat.com>
3303
3304 * c-typeck.c (c_finish_omp_clauses): Diagnose aligned clause
3305 with decl that is not pointer nor array.
3306
d037099f 33072013-10-29 Balaji V. Iyer <balaji.v.iyer@intel.com>
3308
3309 * c-decl.c (finish_function): Added a call for insert_cilk_frame when
3310 a spawning function is found.
3311 * c-objc-common.h (LANG_HOOKS_CILKPLUS_GIMPLIFY_SPAWN): New #define.
3312 (LANG_HOOKS_CILKPLUS_FRAME_CLEANUP): Likewise.
3313 (LANG_HOOKS_CILKPLUS_DETECT_SPAWN_AND_UNWRAP): Likewise.
3314 * c-parser.c (c_parser_statement_after_labels): Added RID_CILK_SYNC
3315 case.
3316 (c_parser_postfix_expression): Added RID_CILK_SPAWN case.
3317 * c-typeck.c (build_compound_expr): Reject _Cilk_spawn in a comma
3318 expr.
3319 (c_finish_return): Added a check to reject _Cilk_spawn in return
3320 expression.
3321 (build_cilk_spawn): New function.
3322 (build_cilk_sync): Likewise.
3323 * Makefile.in (c-decl.o): Added cilk.h in dependency list.
3324
4c90c04c 33252013-10-27 Tobias Burnus <burnus@net-b.de>
3326
3327 PR other/33426
3328 * c-parser.c (c_parser_while_statement, c_parser_while_statement,
3329 c_parser_pragma): Add GCC ivdep support to 'do' and 'while'.
3330 (c_parser_statement_after_labels): Update calls.
3331
48a972c8 33322013-10-24 Tobias Burnus <burnus@net-b.de>
4644b593 3333
3334 PR other/33426
3335 * c-parser.c (c_parser_pragma, c_parser_for_statement):
3336 Handle PRAGMA_IVDEP.
3337 (c_parser_statement_after_labels): Update call.
3338
12f86df0 33392013-10-24 Marek Polacek <polacek@redhat.com>
3340
3341 * c-parser.c (c_parser_struct_declaration): Add a comment.
3342 (c_parser_declarator): Don't allow _Alignas here.
3343
7740abd8 33442013-10-17 Andrew MacLeod <amacleod@redhat.com>
3345
3346 * c-parser.c: Include omp-low.h.
3347 * c-typeck.c: Likewise.
3348
43d03c23 33492013-10-17 Marek Polacek <polacek@redhat.com>
3350
3351 PR c/58267
3352 * c-parser.c (c_parser_declspecs): Add alignspec_ok parameter.
3353 Document syntax of the array-declarator.
3354 (c_parser_declspecs) <RID_ALIGNAS>: Bail out if alignment specs
3355 are not permitted.
3356 (c_parser_declaration_or_fndef): Adjust c_parser_declspecs call.
3357 (c_parser_struct_declaration): Likewise.
3358 (c_parser_declarator): Likewise.
3359 (c_parser_direct_declarator_inner): Likewise.
3360 (c_parser_parameter_declaration): Likewise.
3361 (c_parser_type_name): Likewise.
3362
bc7bff74 33632013-10-11 Jakub Jelinek <jakub@redhat.com>
3364
3365 * c-lang.h (current_omp_declare_target_attribute): New extern
3366 decl.
3367 * c-parser.c: Include c-lang.h.
3368 (struct c_parser): Change tokens to c_token *.
3369 Add tokens_buf field. Change tokens_avail type to unsigned int.
3370 (c_parser_consume_token): If parser->tokens isn't
3371 &parser->tokens_buf[0], increment parser->tokens.
3372 (c_parser_consume_pragma): Likewise.
3373 (enum pragma_context): Add pragma_struct and pragma_param.
3374 (c_parser_external_declaration): Adjust
3375 c_parser_declaration_or_fndef caller.
3376 (c_parser_declaration_or_fndef): Add omp_declare_simd_clauses
3377 argument, if it is non-vNULL vector, call c_finish_omp_declare_simd.
3378 Adjust recursive call.
3379 (c_parser_struct_or_union_specifier): Use pragma_struct instead
3380 of pragma_external.
3381 (c_parser_parameter_declaration): Use pragma_param instead of
3382 pragma_external.
3383 (c_parser_compound_statement_nostart, c_parser_label,
3384 c_parser_for_statement): Adjust
3385 c_parser_declaration_or_fndef callers.
3386 (c_parser_expr_no_commas): Add omp_atomic_lhs argument, pass
3387 it through to c_parser_conditional_expression.
3388 (c_parser_conditional_expression): Add omp_atomic_lhs argument,
3389 pass it through to c_parser_binary_expression. Adjust recursive
3390 call.
3391 (c_parser_binary_expression): Remove prec argument, add
3392 omp_atomic_lhs argument instead. Always start from PREC_NONE, if
3393 omp_atomic_lhs is non-NULL and one of the arguments of toplevel
3394 binop matches it, use build2 instead of parser_build_binary_op.
3395 (c_parser_pragma): Handle PRAGMA_OMP_CANCEL,
3396 PRAGMA_OMP_CANCELLATION_POINT, PRAGMA_OMP_TARGET,
3397 PRAGMA_OMP_END_DECLARE_TARGET, PRAGMA_OMP_DECLARE_REDUCTION.
3398 Handle pragma_struct and pragma_param the same as pragma_external.
3399 (c_parser_omp_clause_name): Parse new OpenMP 4.0 clause names.
3400 (c_parser_omp_variable_list): Parse array sections for
3401 OMP_CLAUSE_{DEPEND,MAP,TO,FROM} clauses.
3402 (c_parser_omp_clause_collapse): Fully fold collapse expression.
3403 (c_parser_omp_clause_reduction): Handle user defined reductions.
3404 (c_parser_omp_clause_branch, c_parser_omp_clause_cancelkind,
3405 c_parser_omp_clause_num_teams, c_parser_omp_clause_thread_limit,
3406 c_parser_omp_clause_aligned, c_parser_omp_clause_linear,
3407 c_parser_omp_clause_safelen, c_parser_omp_clause_simdlen,
3408 c_parser_omp_clause_depend, c_parser_omp_clause_map,
3409 c_parser_omp_clause_device, c_parser_omp_clause_dist_schedule,
3410 c_parser_omp_clause_proc_bind, c_parser_omp_clause_to,
3411 c_parser_omp_clause_from, c_parser_omp_clause_uniform): New functions.
3412 (c_parser_omp_all_clauses): Add finish_p argument. Don't call
3413 c_finish_omp_clauses if it is false. Handle new OpenMP 4.0 clauses.
3414 (c_parser_omp_atomic): Parse seq_cst clause, pass true if it is
3415 present to c_finish_omp_atomic. Handle OpenMP 4.0 atomic forms.
3416 (c_parser_omp_for_loop): Add CODE argument, pass it through
3417 to c_finish_omp_for. Change last argument to cclauses,
3418 and adjust uses to grab parallel clauses from the array of all
3419 the split clauses. Adjust c_parser_binary_expression,
3420 c_parser_declaration_or_fndef and c_finish_omp_for callers.
3421 (omp_split_clauses): New function.
3422 (c_parser_omp_simd): New function.
3423 (c_parser_omp_for): Add p_name, mask and cclauses arguments.
3424 Allow the function to be called also when parsing combined constructs,
3425 and call c_parser_omp_simd when parsing for simd.
3426 (c_parser_omp_sections_scope): If section-sequence doesn't start with
3427 #pragma omp section, require exactly one structured-block instead of
3428 sequence of statements.
3429 (c_parser_omp_sections): Add p_name, mask and cclauses arguments.
3430 Allow the function to be called also when parsing combined constructs.
3431 (c_parser_omp_parallel): Add p_name, mask and cclauses arguments.
3432 Allow the function to be called also when parsing combined
3433 constructs.
3434 (c_parser_omp_taskgroup, c_parser_omp_cancel,
3435 c_parser_omp_cancellation_point, c_parser_omp_distribute,
3436 c_parser_omp_teams, c_parser_omp_target_data,
3437 c_parser_omp_target_update, c_parser_omp_target,
3438 c_parser_omp_declare_simd, c_finish_omp_declare_simd,
3439 c_parser_omp_declare_target, c_parser_omp_end_declare_target,
3440 c_parser_omp_declare_reduction, c_parser_omp_declare): New functions.
3441 (c_parser_omp_construct): Add p_name and mask vars. Handle
3442 PRAGMA_OMP_DISTRIBUTE, PRAGMA_OMP_SIMD, PRAGMA_OMP_TASKGROUP,
3443 PRAGMA_OMP_TEAMS. Adjust c_parser_omp_for, c_parser_omp_parallel
3444 and c_parser_omp_sections callers.
3445 (c_parse_file): Initialize tparser.tokens and the_parser->tokens here.
3446 (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK,
3447 OMP_SINGLE_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1.
3448 (OMP_PARALLEL_CLAUSE_MASK): Likewise. Add OMP_CLAUSE_PROC_BIND.
3449 (OMP_TASK_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1. Add
3450 OMP_CLAUSE_DEPEND.
3451 (OMP_SIMD_CLAUSE_MASK, OMP_CANCEL_CLAUSE_MASK,
3452 OMP_CANCELLATION_POINT_CLAUSE_MASK, OMP_DISTRIBUTE_CLAUSE_MASK,
3453 OMP_TEAMS_CLAUSE_MASK, OMP_TARGET_DATA_CLAUSE_MASK,
3454 OMP_TARGET_UPDATE_CLAUSE_MASK, OMP_TARGET_CLAUSE_MASK,
3455 OMP_DECLARE_SIMD_CLAUSE_MASK): Define.
3456 * c-typeck.c: Include tree-inline.h.
3457 (c_finish_omp_cancel, c_finish_omp_cancellation_point,
3458 handle_omp_array_sections_1, handle_omp_array_sections,
3459 c_clone_omp_udr, c_find_omp_placeholder_r): New functions.
3460 (c_finish_omp_clauses): Handle new OpenMP 4.0 clauses and
3461 user defined reductions.
3462 (c_tree_equal): New function.
3463 * c-tree.h (temp_store_parm_decls, temp_pop_parm_decls,
3464 c_finish_omp_cancel, c_finish_omp_cancellation_point, c_tree_equal,
3465 c_omp_reduction_id, c_omp_reduction_decl, c_omp_reduction_lookup,
3466 c_check_omp_declare_reduction_r): New prototypes.
3467 * c-decl.c (current_omp_declare_target_attribute): New variable.
3468 (c_decl_attributes): New function.
3469 (start_decl, start_function): Use it instead of decl_attributes.
3470 (temp_store_parm_decls, temp_pop_parm_decls, c_omp_reduction_id,
3471 c_omp_reduction_decl, c_omp_reduction_lookup,
3472 c_check_omp_declare_reduction_r): New functions.
3473
3ce7d1bd 34742013-09-25 Tom Tromey <tromey@redhat.com>
3475
3476 * Make-lang.in (c/gccspec.o): Remove.
3477 (CFLAGS-c/gccspec.o): New variable.
3478 (cc1-checksum.o, C_TREE_H, c/c-aux-info.o, c/c-convert.o)
3479 (c/c-decl.o, c/c-errors.o, c/c-lang.o, c/c-objc-common.o)
3480 (c/c-parser.o, c/c-typeck.o, c/c-array-notation.o): Remove.
3481
96da1c1d 34822013-09-25 Tom Tromey <tromey@redhat.com>
3483
3484 * Make-lang.in (c/gccspec.o): Don't use subshell.
3485
1b309377 34862013-09-18 Marek Polacek <polacek@redhat.com>
3487
3488 PR sanitize/58443
3489 * c-typeck.c (build_binary_op): Properly honor -fsanitize options.
3490 Remove unnecessary check.
3491
05f893e1 34922013-09-18 Marek Polacek <polacek@redhat.com>
3493
3494 PR sanitizer/58411
3495 * c-typeck.c (build_binary_op): Don't sanitize function if it has the
3496 no_sanitize_undefined attribute.
3497
bda0b9d2 34982013-09-13 Kai Tietz <ktietz@redhat.com>
3499
3500 PR target/57848
3501 * c-decl.c (c_builtin_function_ext_scope): Remove
3502 wrong assumption that it is never called on prexisting
3503 symbol.
3504
73437615 35052013-09-08 Joern Rennecke <joern.rennecke@embecosm.com>
3506
3507 * c-typeck.c (build_binary_op): Use vector_types_compatible_elements_p.
3508
eaab24b9 35092013-09-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
3510
3511 * c-objc-common.c (c_tree_printer): Tidy.
3512
9e46467d 35132013-08-30 Marek Polacek <polacek@redhat.com>
3514
3515 * c-typeck.c (build_binary_op): Add division by zero and shift
3516 instrumentation.
3517
f8234178 35182013-08-26 Joern Rennecke <joern.rennecke@embecosm.com>
f9086116 3519 Joseph Myers <joseph@codesourcery.com>
f8234178 3520
c90a7d10 3521 PR c/35649
f8234178 3522 * c-typeck.c (c_common_type): Prefer double_type_node over
3523 other REAL_TYPE types with the same precision.
3524 (convert_arguments): Likewise.
3525
6f07f480 35262013-08-23 Gabriel Dos Reis <gdr@integrable-solutions.net>
3527
3528 * c-objc-common.c (c_tree_printer): Document the nature of the cast.
3529 (c_initialize_diagnostics): Call a destructor for the early printer.
3530
eed6bc21 35312013-08-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
3532
3533 * c-objc-common.c (c_initialize_diagnostics): Simplify C pretty
3534 printer initialization.
3535
57717943 35362013-08-19 Balaji V. Iyer <balaji.v.iyer@intel.com>
eed6bc21 3537
57717943 3538 PR c/57490
3539 * c-array-notation.c (fix_conditional_array_notations_1): Added a
3540 check for truth values.
3541 (expand_array_notation_exprs): Added truth values case. Removed an
3542 unwanted else. Added for-loop to walk through subtrees in default
3543 case.
3544
a94db6b0 35452013-08-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
3546
3547 * c-objc-common.c (c_initialize_diagnostics): Don't call pp_base.
3548
e76163a9 35492013-07-23 Joseph Myers <joseph@codesourcery.com>
3550
3551 * c-parser.c (struct c_generic_association): Fix typo.
3552
7aa04c8d 35532013-07-23 Tom Tromey <tromey@redhat.com>
3554 Joseph Myers <joseph@codesourcery.com>
3555
3556 * c-parser.c (struct c_generic_association): New.
3557 (c_generic_association_d): New typedef.
3558 (c_parser_generic_selection): New function.
3559 (c_parser_postfix_expression): Handle RID_GENERIC.
3560
76bbe4ca 35612013-07-13 Jason Merrill <jason@redhat.com>
3562
3563 PR c++/57793
3564 * c-decl.c (finish_struct): Check for too-large class.
3565
21ebaa24 35662013-07-04 Joern Rennecke <joern.rennecke@embecosm.com>
f5298614 3567
3568 PR c/57821
3569 * c-typeck.c (set_init_index): When folding, check for index overflow.
3570
936c3081 35712013-06-28 Balaji V. Iyer <balaji.v.iyer@intel.com>
3572
3573 * c-parser.c (c_parser_array_notation): Removed rejection of array
3574 notations in an array of function pointers.
3575
50acebe0 35762013-06-21 Balaji V. Iyer <balaji.v.iyer@intel.com>
3577
3578 * c-array-notation.c (make_triplet_val_inv): New function.
3579 (create_cmp_incr): Likewise.
3580 (create_array_refs): Likewise.
3581 (fix_builtin_array_notation_fn): Replaced all mallocs with tree vec.
3582 Also modularized common parts between functions and called the function.
3583 (build_array_notation_expr): Likewise.
3584 (fix_conditional_array_notations_1): Likewise.
3585 (fix_array_notation_expr): Likewise.
3586 (fix_array_notation_call_expr): Likewise.
3587
01e6cdb4 35882013-06-18 Marek Polacek <polacek@redhat.com>
3589
3590 PR c/57630
3591 * c-decl.c (check_for_loop_decls): Improve diagnostics messages.
3592
6a3adac6 35932013-06-12 Balaji V. Iyer <balaji.v.iyer@intel.com>
3594
3595 * c-array-notation.c (build_array_notation_expr): Reject array notation
3596 mismatch between LHS and RHS even inside a call_expr. Also, removed
3597 a couple while statements that were dead code.
3598
62aab3f3 35992013-06-10 Balaji V. Iyer <balaji.v.iyer@intel.com>
3600
3601 * c-array-notation.c (fix_builtin_array_notation_fn): Fully folded
3602 excessive precision expressions in function parameters. Also removed
3603 couple unwanted while statements.
3604
bfc83720 36052013-06-07 Balaji V. Iyer <balaji.v.iyer@intel.com>
3606
3607 * c-array-notation.c (expand_array_notation_exprs): Added
3608 ARRAY_NOTATION_REF case.
3609
09970d67 36102013-06-07 Balaji V. Iyer <balaji.v.iyer@intel.com>
3611
3612 * c-array-notation.c (length_mismatch_in_expr_p): Moved this
3613 function to c-family/array-notation-common.c.
3614 (is_cilkplus_reduce_builtin): Likewise.
3615 (find_rank): Likewise.
3616 (extract_array_notation_exprs): Likewise.
3617 (replace_array_notations): Likewise.
3618 (find_inv_trees): Likewise.
3619 (replace_inv_trees): Likewise.
3620 (contains_array_notation_expr): Likewise.
3621 (find_correct_array_notation_type): Likewise.
3622 (replace_invariant_exprs): Initialized additional_tcodes to NULL.
3623 (struct inv_list): Moved this to c-family/array-notation-common.c.
3624 * c-tree.h (is_cilkplus_builtin_reduce): Remove prototype.
3625
6e13bc01 36262013-06-05 Balaji V. Iyer <balaji.v.iyer@intel.com>
3627
3628 * c-typeck.c (convert_arguments): Moved checking of builtin cilkplus
3629 reduction functions outside the for-loop. Added a check if the fundecl
3630 is non-NULL. Finally, removed an unwanted if-statement, and made the
3631 body unconditional.
3632
cc92dddc 36332013-06-03 Balaji V. Iyer <balaji.v.iyer@intel.com>
3634
3635 * c-typeck.c (c_finish_if_stmt): Added a check to see if the rank of the
3636 condition of the if-statement matches the rank of else-block and then-
3637 block when array notations are used.
3638 * c-parser.c (c_parser_declaration_or_fndef): Expanded array notation
3639 expression after the entire function body is parsed.
3640 (c_parser_expr_no_commas): Delayed creating array notation expressions
3641 to the end of function parsing.
3642 * c-array-notation.c (fix_conditional_array_notations_1): Expanded the
3643 whole if-statement instead of just the condition.
3644 (expand_array_notation_exprs): Added MODIFY_EXPR case.
3645
eddc63fd 36462013-06-03 Balaji V. Iyer <balaji.v.iyer@intel.com>
3647
3648 PR c/57474
3649 * c-array-notation.c (build_array_notation_expr): Initialized rhs_length
3650 array to NULL_TREE if they are unused. Also added a check for the
3651 field to be NULL before its fields are used in future.
3652
a2115a4a 36532013-05-29 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3654
3655 PR bootstrap/57450
3656 * c-array-notation.c (length_mismatch_in_expr_p): Use absu_hwi.
3657 (build_array_notation_expr): Likewise.
3658
3c6d4197 36592013-05-28 Balaji V. Iyer <balaji.v.iyer@intel.com>
3660
3661 * c-typeck.c (build_array_ref): Added a check to see if array's
3662 index is greater than one. If true, then emit an error.
3663 (build_function_call_vec): Exclude error reporting and checking
3664 for builtin array-notation functions.
3665 (convert_arguments): Likewise.
3666 (c_finish_return): Added a check for array notations as a return
3667 expression. If true, then emit an error.
3668 (c_finish_loop): Added a check for array notations in a loop
3669 condition. If true then emit an error.
3670 (lvalue_p): Added a ARRAY_NOTATION_REF case.
3671 (build_binary_op): Added a check for array notation expr inside
3672 op1 and op0. If present, we call another function to find correct
3673 type.
3674 * Make-lang.in (C_AND_OBJC_OBJS): Added c-array-notation.o.
3675 * c-parser.c (c_parser_compound_statement): Check if array
3676 notation code is used in tree, if so, then transform them into
3677 appropriate C code.
3678 (c_parser_expr_no_commas): Check if array notation is used in LHS
3679 or RHS, if so, then build array notation expression instead of
3680 regular modify.
3681 (c_parser_postfix_expression_after_primary): Added a check for
3682 colon(s) after square braces, if so then handle it like an array
3683 notation. Also, break up array notations in unary op if found.
3684 (c_parser_direct_declarator_inner): Added a check for array
3685 notation.
3686 (c_parser_compound_statement): Added a check for array notation in
3687 a stmt. If one is present, then expand array notation expr.
3688 (c_parser_if_statement): Likewise.
3689 (c_parser_switch_statement): Added a check for array notations in
3690 a switch statement's condition. If true, then output an error.
3691 (c_parser_while_statement): Similarly, but for a while.
3692 (c_parser_do_statement): Similarly, but for a do-while.
3693 (c_parser_for_statement): Similarly, but for a for-loop.
3694 (c_parser_unary_expression): Check if array notation is used in a
3695 pre-increment or pre-decrement expression. If true, then expand
3696 them.
3697 (c_parser_array_notation): New function.
3698 * c-array-notation.c: New file.
3699 * c-tree.h (is_cilkplus_reduce_builtin): Protoize.
3700
2c1c8a2c 37012013-05-23 Mike Stump <mikestump@comcast.net>
3702
3703 * c-typeck.c (convert_for_assignment): Handle references to memory
3704 spaces better.
3705
be5f9e46 37062013-05-16 Jason Merrill <jason@redhat.com>
3707
3708 * Make-lang.in (cc1$(exeext)): Use link mutex.
3709
9205a6cc 37102013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
3711
3712 * c-typeck.c (pointer_diff): Change -Wpointer-arith pedwarns
3713 to simply use OPT_Wpointer_arith.
3714 (build_unary_op): Likewise.
3715
0b049e15 37162013-04-03 Jakub Jelinek <jakub@redhat.com>
3717
3718 PR c/19449
3719 * c-parser.c (c_parser_get_builtin_args): Add choose_expr_p
3720 argument. If set, or it temporarily for parsing of the first
3721 argument into force_folding_builtin_constant_p.
3722 (c_parser_postfix_expression): Adjust callers.
3723
8e966116 37242013-03-21 Richard Biener <rguenther@suse.de>
3725
3726 * c-objc-common.c (c_tree_printer): Use DECL_HAS_DEBUG_EXPR_P
3727 instead of DECL_DEBUG_EXPR_IS_FROM. Guard properly.
3728
b862f263 37292013-02-12 Marek Polacek <polacek@redhat.com>
3730
3731 PR c/44938
3732 * c-parser.c (c_parser_postfix_expression_after_primary): Initialize
3733 origtypes to NULL.
3734
54550ecb 37352013-01-24 Jakub Jelinek <jakub@redhat.com>
3736
3737 PR c/56078
3738 * c-typeck.c (set_nonincremental_init_from_string): If
3739 constructor_max_index is NULL, treat it as if tree_int_cst_lt
3740 returned false.
3741 (process_init_element): Likewise.
3742
035b65e2 37432012-12-20 Jakub Jelinek <jakub@redhat.com>
3744
3745 PR c++/55619
3746 * c-parser.c (c_parser_asm_operands): Remove CONVERT_P
3747 argument, don't call default_function_array_conversion
3748 nor c_fully_fold here.
3749 (c_parser_asm_statement): Adjust callers.
3750 * c-typeck.c (build_asm_expr): Call c_fully_fold on inputs
3751 and outputs here, and call default_function_array_conversion
3752 on inputs that don't need to be addressable.
3753
7cbb7f1a 37542012-12-18 Jakub Jelinek <jakub@redhat.com>
3755
3756 PR c/39464
3757 * c-typeck.c (convert_for_assignment): For -Wpointer-sign
3758 warning require that both c_common_unsigned_type as well as
3759 c_common_signed_type is the same for both mvl and mvr types.
3760
f1f41a6c 37612012-11-16 Diego Novillo <dnovillo@google.com>
3762
3763 Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)
3764
3765 * c-common.c: Use new vec API in vec.h.
3766 * c-common.h: Likewise.
3767 * c-gimplify.c: Likewise.
3768 * c-pragma.c: Likewise.
3769 * c-pretty-print.c: Likewise.
3770 * c-pretty-print.h: Likewise.
3771 * c-semantics.c: Likewise.
3772 * c-decl.c: Likewise.
3773 * c-parser.c: Likewise.
3774 * c-tree.h: Likewise.
3775 * c-typeck.c: Likewise.
3776
8b447d3f 37772012-10-29 Jonathan Wakely <jwakely.gcc@gmail.com>
3778
3779 PR c++/54930
3780 * c-typeck.c (c_finish_return): Use OPT_Wreturn_local_addr.
3781
08fc5390 37822012-10-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
3783
3784 PR c/53066
3785 * c-decl.c (warn_if_shadowing): Do not warn if a variable
3786 shadows a function, unless the variable is a function or a
3787 pointer-to-function.
3788
57f872a2 37892012-10-12 Jakub Jelinek <jakub@redhat.com>
3790
3791 PR c/54381
3792 * c-parser.c (struct c_tree_loc_pair): Removed.
3793 (c_parser_expr_list): Remove struct c_tree_loc_pair * argument,
3794 add location_t * and tree * arguments, fill in array of 3
3795 sizeof_arg trees and corresponding locs.
3796 (c_parser_attributes, c_parser_objc_keywordexpr): Adjust
3797 c_parser_expr_list callers.
3798 (c_parser_postfix_expression_after_primary): Likewise. Pass
3799 array of 3 sizeof_arg trees and locs (corresponding to first
3800 3 arguments) to sizeof_pointer_memaccess_warning.
3801
d1455aa3 38022012-10-09 Lawrence Crowl <crowl@google.com>
3803
3804 * Make-lang.in (c-decl.o): Add dependence on hash-table.h.
3805 * c-decl.c (detect_field_duplicates_hash): Change to new type-safe
3806 hash table.
3807
b0e7825e 38082012-10-09 Paolo Carlini <paolo.carlini@oracle.com>
3809
3810 PR c++/54194
3811 * c-typeck.c (parser_build_binary_op): Update warn_about_parentheses
3812 call.
3813
41ed701a 38142012-10-09 Marc Glisse <marc.glisse@inria.fr>
3815
3816 PR c++/54427
3817 * c-typeck.c: Include c-common.h.
3818 (enum stv_conv): Moved to c-common.h.
3819 (scalar_to_vector): Moved to c-common.c.
3820 (build_binary_op): Adapt to scalar_to_vector's new prototype.
3821 * Make-lang.in: c-typeck.c depends on c-common.h.
3822
ef34afc1 38232012-10-04 Arnaud Charlet <charlet@adacore.com>
3824
3825 * c-decl.c (c_write_global_declarations): Fix handling of
3826 -fdump-ada-spec*.
3827
7bd765d4 38282012-09-30 Sharad Singhai <singhai@google.com>
3829
3830 * c-decl.c (c_write_global_declarations): Use a different method
3831 to determine if the dump has ben initialized.
3832
c4b1a13a 38332012-09-14 Joseph Myers <joseph@codesourcery.com>
3834
3835 PR c/54552
3836 * c-typeck.c (c_cast_expr): When casting to a type requiring
3837 C_MAYBE_CONST_EXPR to be created, pass the inner expression to
3838 c_fully_fold first.
3839
bb554051 38402012-09-14 Joseph Myers <joseph@codesourcery.com>
3841
3842 PR c/54103
3843 * c-typeck.c (build_unary_op): Pass original argument of
3844 TRUTH_NOT_EXPR to c_objc_common_truthvalue_conversion, then remove
3845 any C_MAYBE_CONST_EXPR, if it has integer operands.
3846 (build_binary_op): Pass original arguments of TRUTH_ANDIF_EXPR,
3847 TRUTH_ORIF_EXPR, TRUTH_AND_EXPR, TRUTH_OR_EXPR and TRUTH_XOR_EXPR
3848 to c_objc_common_truthvalue_conversion, then remove any
3849 C_MAYBE_CONST_EXPR, if they have integer operands. Use
3850 c_objc_common_truthvalue_conversion not
3851 c_common_truthvalue_conversion.
3852 (c_objc_common_truthvalue_conversion): Build NE_EXPR directly and
3853 call note_integer_operands for arguments with integer operands
3854 that are not integer constants.
3855
c708c6ef 38562012-09-13 Jakub Jelinek <jakub@redhat.com>
3857
3858 PR c/54559
3859 * c-typeck.c (c_finish_return): Do convert to BOOLEAN_TYPE or
3860 COMPLEX_TYPE with in_late_binary_op set temporarily to true.
3861
cce20430 38622012-08-31 Jakub Jelinek <jakub@redhat.com>
3863
3864 PR c/54428
3865 * c-convert.c (convert): Don't call fold_convert_loc if
3866 TYPE_MAIN_VARIANT of a COMPLEX_TYPE is the same, unless e
3867 is a COMPLEX_EXPR. Remove TYPE_MAIN_VARIANT check from
3868 COMPLEX_TYPE -> COMPLEX_TYPE conversion.
3869
a90d57ed 38702012-08-24 Jakub Jelinek <jakub@redhat.com>
3871
3872 PR c/54355
3873 * c-decl.c (c_parser_label): Pass true as nested and fix up comments
3874 for nested and empty_ok arguments in the call to
3875 c_parser_declaration_or_fndef.
3876
f003f5dc 38772012-08-17 Jakub Jelinek <jakub@redhat.com>
3878
3879 * c-tree.h (c_last_sizeof_arg): Declare.
3880 * c-parser.c (struct c_tree_loc_pair): New type.
3881 (c_parser_expr_list): Add sizeof_arg argument. Fill it in if
3882 non-NULL.
3883 (c_parser_attributes, c_parser_objc_keywordexpr): Adjust callers.
3884 (c_parser_postfix_expression_after_primary): Likewise. Call
3885 sizeof_pointer_memaccess_warning if needed.
3886 (sizeof_ptr_memacc_comptypes): New function.
3887 * c-typeck.c (c_last_sizeof_arg): New global variable.
3888 (c_expr_sizeof_expr, c_expr_sizeof_type): Initialize it.
3889
a5656b73 38902012-07-24 Uros Bizjak <ubizjak@gmail.com>
3891
3892 * c-lang.h (lang_decl): Add variable_size GTY option.
3893
b9ed1410 38942012-07-16 Steven Bosscher <steven@gcc.gnu.org>
3895
3896 * c-decl.c: Include dumpfile.h instead of tree-dump.h.
3897 * Make-lang.in: Fix dependencies.
3898
e53d55e7 38992012-06-29 Steven Bosscher <steven@gcc.gnu.org>
3900
3901 * Make-lang.in: New file, rules migrated from gcc/Makefile.in
3902 and add language Makefile hooks.
3903 * config-lang.in: New file.
3904 * c-config-lang.in: Moved from gcc/config-lang.in to here, and
3905 add the required "normal" config-lang.in rules.
3906 * c-lang.h: Moved from gcc/ to here.
3907 * c-tree.h: Likewise.
3908 * c-objc-common.c: Likewise.
3909 * c-objc-common.h: Likewise.
3910 * c-typeck.c: Likewise.
3911 * c-convert.c: Likewise.
3912 * c-lang.c: Likewise.
3913 * c-aux-info.c: Likewise.
3914 * c-errors.c: Likewise.
3915 * gccspec.c: Likewise.
3916 * c-decl.c: Likewise. Include gt-c-c-decl.h, not gt-c-decl.h.
3917 * c-parser.c: Likewise. Include gt-c-c-parser.h, not gt-c-parser.h.
3918\f
f1717362 3919Copyright (C) 2012-2016 Free Software Foundation, Inc.
e53d55e7 3920
3921Copying and distribution of this file, with or without modification,
3922are permitted in any medium without royalty provided the copyright
3923notice and this notice are preserved.