]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/c/ChangeLog
* config/abi/pre/gnu.ver: Use [jmy] for size_t.
[thirdparty/gcc.git] / gcc / c / ChangeLog
CommitLineData
3da97ff7 12016-09-07 David Malcolm <dmalcolm@redhat.com>
2
3 * c-lang.c (LANG_HOOKS_GET_SUBSTRING_LOCATION): Use
4 c_get_substring_location for this new langhook.
5
0b80c4b2 62016-09-02 Jakub Jelinek <jakub@redhat.com>
7
8 PR c/65467
9 * c-parser.c (c_parser_declspecs): Don't sorry about _Atomic if
10 flag_openmp.
11 (c_parser_omp_variable_list): Use convert_lvalue_to_rvalue
12 instead of mark_exp_read on low_bound/length expression.
13 (c_parser_omp_clause_num_gangs, c_parser_omp_clause_num_threads,
14 c_parser_omp_clause_num_tasks, c_parser_omp_clause_grainsize,
15 c_parser_omp_clause_priority, c_parser_omp_clause_hint,
16 c_parser_omp_clause_num_workers, c_parser_oacc_shape_clause,
17 c_parser_oacc_clause_tile, c_parser_omp_clause_schedule,
18 c_parser_omp_clause_vector_length, c_parser_omp_clause_num_teams,
19 c_parser_omp_clause_thread_limit, c_parser_omp_clause_aligned,
20 c_parser_omp_clause_linear, c_parser_omp_clause_safelen,
21 c_parser_omp_clause_simdlen, c_parser_omp_clause_device,
22 c_parser_omp_clause_dist_schedule): Use convert_lvalue_to_rvalue
23 instead of mark_expr_read.
24 (c_parser_omp_declare_reduction): Reject _Atomic qualified types.
25 * c-objc-common.h (LANG_HOOKS_OMP_CLAUSE_COPY_CTOR,
26 LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP): Redefine.
27 * c-tree.h (c_omp_clause_copy_ctor): New prototype.
28 * c-typeck.c (handle_omp_array_sections_1): Diagnose _Atomic qualified
29 array section bases outside of depend clause, for depend clause
30 use convert_lvalue_to_rvalue on the base.
31 (c_finish_omp_clauses): Reject _Atomic qualified vars in reduction,
32 linear, aligned, map, to and from clauses.
33 (c_omp_clause_copy_ctor): New function.
34
c7afb782 352016-09-01 Marek Polacek <polacek@redhat.com>
36
37 PR c/7652
38 * c-typeck.c (composite_type): Add FALLTHRU comment.
39
986530da 402016-08-31 David Malcolm <dmalcolm@redhat.com>
41
42 * c-parser.c (c_parser_declaration_or_fndef): Add trailing space
43 to the insertion fixits for "struct", "union", and "enum".
44
850c2009 452016-08-30 David Malcolm <dmalcolm@redhat.com>
46
47 * c-decl.c (implicit_decl_warning): Use add_fixit_replace
48 rather than add_fixit_misspelled_id.
49 (undeclared_variable): Likewise.
50 * c-parser.c (c_parser_declaration_or_fndef): Likewise. Remove
51 now-redundant "here" params from add_fixit_insert method calls.
52 (c_parser_parameter_declaration): Likewise.
53 * c-typeck.c (build_component_ref): Remove now-redundant range
54 param from add_fixit_replace method calls.
55
c4963714 562016-08-25 Marek Polacek <polacek@redhat.com>
57
58 * c-typeck.c (parser_build_binary_op): Pass LHS to
59 warn_logical_not_parentheses.
60
49e1f4eb 612016-08-25 Marek Polacek <polacek@redhat.com>
62
63 PR c/77323
64 * c-decl.c (declspecs_add_type): Set typespec_word even when __intN
65 or _FloatN or _FloatNx is not supported.
66 (finish_declspecs): Set type to integer_type_node when _FloatN or
67 _FloatNx is not supported.
68
82c85aba 692016-08-19 Joseph Myers <joseph@codesourcery.com>
70
71 PR c/32187
72 * c-tree.h (cts_floatn_nx): New enum c_typespec_keyword value.
73 (struct c_declspecs): Add field floatn_nx_idx.
74 * c-decl.c (declspecs_add_type, finish_declspecs): Handle _FloatN
75 and _FloatNx type specifiers.
76 * c-parser.c (c_keyword_starts_typename, c_token_starts_declspecs)
77 (c_parser_declspecs, c_parser_attribute_any_word)
78 (c_parser_objc_selector): Use CASE_RID_FLOATN_NX.
79 * c-typeck.c (c_common_type): Handle _FloatN and _FloatNx types.
80 (convert_arguments): Avoid promoting _FloatN and _FloatNx types
81 narrower than double.
82
7175bb2a 832016-08-12 Jakub Jelinek <jakub@redhat.com>
84 Martin Liska <mliska@suse.cz>
85
86 PR c/67410
87 * c-typeck.c (set_nonincremental_init_from_string): Use / instead of
88 % to determine val element to change. Assert that
89 wchar_bytes * charwidth fits into val array.
90
e3533433 912016-08-12 Marek Polacek <polacek@redhat.com>
92
93 PR c/7652
94 * c-parser.c (c_parser_external_declaration): Add FALLTHRU.
95 (c_parser_postfix_expression): Likewise.
96 * c-typeck.c (build_unary_op): Adjust fall through comment.
97 (c_mark_addressable): Likewise.
98
74be5bc1 992016-08-11 Jakub Jelinek <jakub@redhat.com>
100
101 PR c/72816
102 * c-decl.c (grokdeclarator): When adding TYPE_DOMAIN for flexible
103 array member through typedef, for orig_qual_indirect == 0 clear
104 orig_qual_type.
105
7af4d06b 1062016-08-08 David Malcolm <dmalcolm@redhat.com>
107
108 PR c/64955
109 * c-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): If CHECKING_P, wire
110 this up to selftest::run_c_tests.
111 (selftest::run_c_tests): New function.
112
5f429ee2 1132016-08-04 Thomas Schwinge <thomas@codesourcery.com>
114
1fa5d8ba 115 * c-parser.c (struct oacc_routine_data): Add error_seen and
116 fndecl_seen members.
117 (c_finish_oacc_routine): Use these.
118 (c_parser_declaration_or_fndef): Adjust.
119 (c_parser_oacc_routine): Likewise. Support more C language
120 constructs, and improve diagnostics. Move pragma context
121 checking...
122 (c_parser_pragma): ... here.
123
5f429ee2 124 * c-parser.c (struct oacc_routine_data): New.
125 (c_parser_declaration_or_fndef, c_parser_oacc_routine): Use it.
126 Simplify code.
127 (c_finish_oacc_routine): Likewise. Don't attach clauses to "omp
128 declare target" attribute.
129
f3c032a4 1302016-08-01 Jan Beulich <jbeulich@suse.com>
131
132 * c-fold.c (c_fully_fold_internal): Also emit shift count
133 warnings for vector types.
134 * c-typeck.c (build_binary_op): Likewise.
135
4ebf85be 1362016-07-29 Marek Polacek <polacek@redhat.com>
137
138 PR c/71742
139 * c-decl.c (finish_struct): Rephrase an error message.
140
9efe5be6 141 PR c/71853
142 * c-parser.c (c_parser_switch_statement): Initialize ce.original_type
143 to error node for invalid code.
144
4c4548bb 145 PR c/71573
146 * c-decl.c (implicitly_declare): Return decl early not only for
147 error_mark_nodes, but for anything that is not a FUNCTION_DECL.
148
322d4184 1492016-07-29 Jakub Jelinek <jakub@redhat.com>
150
151 PR c/71969
152 * c-decl.c (finish_function): Only set DECL_DISREGARD_INLINE_LIMITS
153 on GNU extern inline functions.
154
35fddbd6 1552016-07-29 Marek Polacek <polacek@redhat.com>
156
157 PR c/71583
158 * c-parser.c (c_parser_postfix_expression_after_paren_type): Also
159 check expr.value.
160
59c1507a 1612016-07-22 Uros Bizjak <ubizjak@gmail.com>
162
163 * c-typeck.c: Use HOST_WIDE_INT_1 instead of (HOST_WIDE_INT) 1,
164
d0f11d68 1652016-07-20 David Malcolm <dmalcolm@redhat.com>
166
167 * c-decl.c (struct edit_distance_traits<cpp_hashnode *>): Move to
168 spellcheck-tree.h
169 (best_macro_match): Likewise, converting from a typedef to a
170 subclass.
171 (find_closest_macro_cpp_cb): Move to spellcheck-tree.c.
172 (lookup_name_fuzzy): Update for change of best_macro_match to a
173 subclass with a ctor that calls cpp_forall_identifiers.
174
d208f6e6 1752016-07-20 David Malcolm <dmalcolm@redhat.com>
176
177 * c-decl.c (implicit_decl_warning): Update for conversion of
178 return type of lookup_name_fuzzy to const char *.
179 (undeclared_variable): Likewise.
180 (lookup_name_fuzzy): Convert return type from tree to
181 const char *.
182 * c-parser.c (c_parser_declaration_or_fndef): Update for
183 conversion of return type of lookup_name_fuzzy to const char *.
184 (c_parser_parameter_declaration): Likewise.
185
0ef9358d 1862016-07-15 Cesar Philippidis <cesar@codesourcery.com>
187
188 * c-parser.c (c_parser_oacc_declare): Don't scan for
189 GOMP_MAP_POINTER.
190 * c-typeck.c (handle_omp_array_sections): Mark data clauses with
191 GOMP_MAP_FORCE_{PRESENT,TO,FROM,TOFROM} as potentially having
192 zero-length subarrays.
193
0dd7db3b 1942016-07-15 Jakub Jelinek <jakub@redhat.com>
195
196 PR c/71858
197 * c-decl.c (implicit_decl_warning): Use FUZZY_LOOKUP_FUNCTION_NAME
198 instead of FUZZY_LOOKUP_NAME.
199 (lookup_name_fuzzy): For FUZZY_LOOKUP_FUNCTION_NAME consider
200 FUNCTION_DECLs, {VAR,PARM}_DECLs function pointers and macros.
201
28413b15 2022016-07-14 Jakub Jelinek <jakub@redhat.com>
203
204 PR c/71858
205 * c-decl.c (lookup_name_fuzzy): Ignore binding->invisible.
206
e9258aee 2072016-07-12 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
208
209 * c-parser.c (c_parser_generic_selection): Make type of variable
210 auto_vec.
211 (c_parser_omp_declare_simd): Likewise.
212
57f91a55 2132016-07-12 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
214
215 * c-decl.c (struct c_struct_parse_info): Change member types
216 from vec to auto_vec.
217 (start_struct): Adjust.
218 (finish_struct): Likewise.
219
c364d0f3 2202016-07-02 Jakub Jelinek <jakub@redhat.com>
221
222 PR c/71719
223 * c-typeck.c (mark_exp_read): Handle VIEW_CONVERT_EXPR.
224
44e775d8 2252016-06-29 Thomas Schwinge <thomas@codesourcery.com>
226
227 * c-parser.c (c_parser_pragma) <PRAGMA_OMP_CANCELLATION_POINT>:
228 Move pragma context checking into...
229 (c_parser_omp_cancellation_point): ... here, and improve
230 diagnostic messages.
231 * c-typeck.c (c_finish_omp_cancel)
232 (c_finish_omp_cancellation_point): Improve diagnostic messages.
233
1af10ce6 2342016-06-29 Jakub Jelinek <jakub@redhat.com>
235
236 PR c/71685
237 * c-typeck.c (c_build_qualified_type): Don't clear
238 C_TYPE_INCOMPLETE_VARS for the main variant.
239
2402016-06-28 Martin Sebor <msebor@redhat.com>
9c3ffbcb 241
242 PR c/71552
243 * c-typeck.c (output_init_element): Diagnose incompatible types
244 before non-constant initializers.
245
6eb2402f 2462016-06-28 Jakub Jelinek <jakub@redhat.com>
247
248 * Make-lang.in: Don't cat ../stage_current if it does not exist.
249
b4c71cbb 2502016-06-23 Andi Kleen <ak@linux.intel.com>
251
252 * Make-lang.in: Add support for autofdo.
253
8469aece 2542016-06-22 David Malcolm <dmalcolm@redhat.com>
255
256 PR c/70339
257 * c-decl.c: Include spellcheck-tree.h and gcc-rich-location.h.
258 (implicit_decl_warning): When issuing warnings for implicit
259 declarations, attempt to provide a suggestion via
260 lookup_name_fuzzy.
261 (undeclared_variable): Likewise when issuing errors.
262 (lookup_name_in_scope): Likewise.
263 (struct edit_distance_traits<cpp_hashnode *>): New struct.
264 (best_macro_match): New typedef.
265 (find_closest_macro_cpp_cb): New function.
266 (lookup_name_fuzzy): New function.
267 * c-parser.c: Include gcc-rich-location.h.
268 (c_token_starts_typename): Split out case CPP_KEYWORD into...
269 (c_keyword_starts_typename): ...this new function.
270 (c_parser_declaration_or_fndef): When issuing errors about
271 missing "struct" etc, add a fixit. For other kinds of errors,
272 attempt to provide a suggestion via lookup_name_fuzzy.
273 (c_parser_parms_declarator): When looking ahead to detect typos in
274 type names, also reject CPP_KEYWORD.
275 (c_parser_parameter_declaration): When issuing errors about
276 unknown type names, attempt to provide a suggestion via
277 lookup_name_fuzzy.
278 * c-tree.h (c_keyword_starts_typename): New prototype.
279
e218d07f 2802016-06-20 Joseph Myers <joseph@codesourcery.com>
281
282 PR c/71601
283 * c-typeck.c (build_conditional_expr): Return error_mark_node if
284 c_common_type returns error_mark_node.
285
92a44a68 2862016-06-19 Martin Sebor <msebor@redhat.com>
21897f47 287
288 PR c/69507
289 * c-parser.c (c_parser_alignof_expression): Avoid diagnosing
290 __alignof__ (expression).
291
f0d77991 2922016-06-14 David Malcolm <dmalcolm@redhat.com>
293
294 * c-typeck.c: Include spellcheck-tree.h rather than spellcheck.h.
295
2a990300 2962016-06-14 David Malcolm <dmalcolm@redhat.com>
297
298 * c-typeck.c (build_component_ref): Simplify fixit code by
299 using gcc_rich_location::add_fixit_misspelled_id.
300 (set_init_label): Likewise.
301
527790c1 3022016-06-13 David Malcolm <dmalcolm@redhat.com>
303
304 * c-parser.c (c_parser_initelt): Provide location of name for new
305 location_t param of set_init_label.
306 * c-tree.h (set_init_label): Add location_t param.
307 * c-typeck.c (set_init_index): Add "fieldname_loc" location_t
308 param and use it when issuing error messages about unrecognized
309 field names. Attempt to provide a fixit hint if appropriate,
310 otherwise update the error message to provide the type name.
311
ccfa030f 3122016-06-10 Thomas Schwinge <thomas@codesourcery.com>
313
314 PR c/71381
315 * c-parser.c (c_parser_omp_variable_list) <OMP_CLAUSE__CACHE_>:
316 Loosen checking.
317
732905bb 3182016-06-08 Martin Sebor <msebor@redhat.com>
319 Jakub Jelinek <jakub@redhat.com>
320
321 PR c++/70507
322 PR c/68120
323 * c-typeck.c (convert_arguments): Don't promote last argument
324 of BUILT_IN_{ADD,SUB,MUL}_OVERFLOW_P.
325
bafc7b1d 3262016-06-08 Marek Polacek <polacek@redhat.com>
327
328 PR c/71418
329 * c-decl.c (grokdeclarator): Check TYPE_P.
330
06e590e7 331 PR c/71426
332 * c-decl.c (get_parm_info): Don't crash on an assert on invalid
333 code.
334
7cfde92a 3352016-06-07 David Malcolm <dmalcolm@redhat.com>
336
337 * c-parser.c (c_parser_postfix_expression): In __builtin_offsetof
338 and structure element reference, capture the location of the
339 element name token and pass it to build_component_ref.
340 (c_parser_postfix_expression_after_primary): Likewise for
341 structure element dereference.
342 (c_parser_omp_variable_list): Likewise for
343 OMP_CLAUSE_{_CACHE, MAP, FROM, TO},
344 * c-tree.h (build_component_ref): Add location_t param.
345 * c-typeck.c (build_component_ref): Add location_t param
346 COMPONENT_LOC. Use it, if available, when issuing hints about
347 mispelled member names to provide a fixit replacement hint.
348
61f1f80c 3492016-06-06 Marek Polacek <polacek@redhat.com>
350
351 PR c/71362
352 * c-parser.c (c_parser_direct_declarator): Set location.
353
e4b92538 3542016-06-06 Marek Polacek <polacek@redhat.com>
355
356 * c-typeck.c (comptypes_internal): Handle comparisons of
357 INTEGER_TYPE, FIXED_POINT_TYPE, and REAL_TYPE nodes. Don't check
358 TYPE_REF_CAN_ALIAS_ALL.
359
2234363c 3602016-06-03 Chung-Lin Tang <cltang@codesourcery.com>
361
362 * c-typeck.c (c_finish_omp_clauses): Mark OpenACC reduction
363 arguments as addressable when async clause exists.
364
b6431756 3652016-05-30 Jakub Jelinek <jakub@redhat.com>
366
367 PR c++/71349
368 * c-parser.c (c_parser_omp_for): Don't disallow nowait clause
369 when combined with target construct.
370
6feab9ce 3712016-05-26 Jakub Jelinek <jakub@redhat.com>
372
373 * c-parser.c (c_parser_omp_clause_schedule): Warn if
374 OMP_CLAUSE_SCHEDULE_CHUNK_EXPR is known not to be positive.
375
2c995da9 3762016-05-25 Marek Polacek <polacek@redhat.com>
377
378 PR c/71265
379 * c-decl.c (c_make_fname_decl): Don't check seen_error.
380
abfbb5b5 381 PR c/71266
382 * c-decl.c (store_parm_decls_oldstyle): Skip non-PARM_DECLs.
383
6d6a3fc3 3842016-05-24 Cesar Philippidis <cesar@codesourcery.com>
385
386 * c-parser.c (c_parser_oacc_declare): Add support for
387 GOMP_MAP_FIRSTPRIVATE_POINTER.
388 * c-typeck.c (handle_omp_array_sections_1): Replace bool is_omp
389 argument with enum c_omp_region_type ort.
390 (handle_omp_array_sections): Likewise. Update call to
391 handle_omp_array_sections_1.
392 (c_finish_omp_clauses): Add specific errors and warning messages for
393 OpenACC. Use firsrtprivate pointers for OpenACC subarrays. Update
394 call to handle_omp_array_sections.
395
c9d624bd 3962016-05-24 Thomas Schwinge <thomas@codesourcery.com>
397
398 * c-parser.c (c_parser_oacc_routine): Tighten syntax checks.
399
7345b977 4002016-05-24 Richard Biener <rguenther@suse.de>
401
402 PR middle-end/70434
403 PR c/69504
404 * c-typeck.c (build_array_ref): Do not complain about indexing
405 non-lvalue vectors. Adjust for function name change.
406
8bdfbc08 4072016-05-20 Martin Sebor <msebor@redhat.com>
408
409 PR c/71115
410 * c-typeck.c (error_init): Use
411 expansion_point_location_if_in_system_header.
412 (warning_init): Same.
413
97c71d71 4142016-05-19 David Malcolm <dmalcolm@redhat.com>
415
416 PR c/71171
417 * c-parser.c (c_parser_generic_selection): Use c_expr::set_error
418 in error-handling.
419 (c_parser_postfix_expression): Likewise.
420 * c-tree.h (c_expr::set_error): New method.
421 * c-typeck.c (parser_build_binary_op): In error-handling, ensure
422 that result's range is initialized.
423
e68d7b49 4242016-05-17 James Greenhalgh <james.greenhalgh@arm.com>
425
426 * c-typeck.c (parser_build_unary_op): Fix formatting.
427
624115b4 4282016-05-16 Matthew Wahab <matthew.wahab@arm.com>
429
430 * c-decl.c (grokdeclarator): Remove errmsg and use of
431 targetm.invalid_return_type.
432 (grokparms): Remove errmsg and use of
433 targetm.invalid_parameter_type.
434
90c88567 4352016-05-13 Joseph Myers <joseph@codesourcery.com>
436
437 * c-decl.c (grokdeclarator): For C11, discard qualifiers on
438 function return type.
439
22a3f7bd 4402016-05-12 Marek Polacek <polacek@redhat.com>
441
442 PR c/70756
443 * c-decl.c (build_compound_literal): Pass LOC down to
444 c_incomplete_type_error.
445 * c-tree.h (require_complete_type): Adjust declaration.
446 (c_incomplete_type_error): Likewise.
447 * c-typeck.c (require_complete_type): Add location parameter, pass it
448 down to c_incomplete_type_error.
449 (c_incomplete_type_error): Add location parameter, pass it down to
450 error_at.
451 (build_component_ref): Pass location down to c_incomplete_type_error.
452 (default_conversion): Pass location down to require_complete_type.
453 (build_array_ref): Likewise.
454 (build_function_call_vec): Likewise.
455 (convert_arguments): Likewise.
456 (build_unary_op): Likewise.
457 (build_c_cast): Likewise.
458 (build_modify_expr): Likewise.
459 (convert_for_assignment): Likewise.
460 (c_finish_omp_clauses): Likewise.
461
54c4d22e 4622016-05-11 Mikhail Maltsev <maltsevm@gmail.com>
463
464 PR c/43651
465 * c-decl.c (declspecs_add_qual): Warn when -Wduplicate-decl-specifier
466 is enabled.
467 * c-errors.c (pedwarn_c90): Return true if warned.
468 * c-tree.h (pedwarn_c90): Change return type to bool.
469 (enum c_declspec_word): Add new enumerator cdw_atomic.
470
7f8012a5 4712016-05-11 Marek Polacek <polacek@redhat.com>
472
473 PR c++/71024
474 * c-decl.c (diagnose_mismatched_decls): Factor out code to
475 diagnose_mismatched_attributes and call it.
476
3fa82609 4772016-05-10 Marek Polacek <polacek@redhat.com>
478
479 PR c/70255
480 * c-decl.c (diagnose_mismatched_decls): Warn for optimize attribute
481 on a declaration following the definition.
482
871164c4 4832016-05-05 Jakub Jelinek <jakub@redhat.com>
484
485 * c-parser.c (c_parser_switch_statement): Add IF_P argument,
486 parse it through to c_parser_c99_block_statement.
487 (c_parser_statement_after_labels): Adjust c_parser_switch_statement
488 caller.
489
1d52c456 4902016-05-04 Marek Polacek <polacek@redhat.com>
491
492 * c-parser.c (c_parser_if_statement): Replace OPT_Wparentheses with
493 OPT_Wdangling_else.
494
a64030fe 4952016-05-04 Marek Polacek <polacek@redhat.com>
496
497 PR c/48778
498 * c-typeck.c (build_binary_op): Don't issue -Waddress warnings
499 for macro expansions.
500
5d4db8ef 5012016-05-03 Marek Polacek <polacek@redhat.com>
502
503 PR c/70859
504 * c-typeck.c (build_function_call_vec): Pass LOC and ARG_LOC down to
505 check_builtin_function_arguments.
506
0bd2fc6e 5072016-05-03 Richard Biener <rguenther@suse.de>
508
509 * Make-lang.in (cc1-checksum.c): For stage-final re-use
510 the checksum from the previous stage.
511
b5e88f74 5122016-05-02 Cesar Philippidis <cesar@codesourcery.com>
513
514 * c-parser.c (c_parser_oacc_all_clauses): Update call to
515 c_finish_omp_clauses.
516 (c_parser_omp_all_clauses): Likewise.
517 (c_parser_oacc_cache): Likewise.
518 (c_parser_oacc_loop): Likewise.
519 (omp_split_clauses): Likewise.
520 (c_parser_omp_declare_target): Likewise.
521 (c_parser_cilk_all_clauses): Likewise.
522 (c_parser_cilk_for): Likewise.
523 * c-typeck.c (c_finish_omp_clauses): Replace bool arguments
524 is_omp, declare_simd, and is_cilk with enum c_omp_region_type ort.
525
dd185f6e 5262016-05-02 Marek Polacek <polacek@redhat.com>
527
528 PR c/70851
529 * c-decl.c (grokdeclarator): Diagnose when array's size has an
530 incomplete type.
531
4d0a8bac 5322016-04-29 Cesar Philippidis <cesar@codesourcery.com>
533
534 PR middle-end/70626
535 * c-parser.c (c_parser_oacc_loop): Don't augment mask with
536 OACC_LOOP_CLAUSE_MASK.
537 (c_parser_oacc_kernels_parallel): Update call to
538 c_oacc_split_loop_clauses.
539
d215eeca 5402016-04-28 Andrew MacLeod <amacleod@redhat.com>
541
542 * c-array-notation.c (fix_builtin_array_notation_fn): Fix final
543 argument to build_modify_expr in two cases.
544
40385231 5452016-04-27 Bernd Schmidt <bschmidt@redhat.com>
546
547 * c-parser.c (c_parser_postfix_expression_after_primary): Call
548 warn_for_memset instead of warning directly here.
549
fa20ebd3 5502016-04-26 Marek Polacek <polacek@redhat.com>
551
552 PR c/67784
553 * c-parser.c (c_parser_maybe_reclassify_token): New function factored
554 out of ...
555 (c_parser_for_statement): ... here.
556 (c_parser_if_statement): Use it.
557 (c_parser_switch_statement): Use it.
558 (c_parser_while_statement): Use it.
559
9db47803 560 PR c/70791
561 * c-decl.c (pushdecl): Pass LOCUS down to warning.
562
70574e60 5632016-04-20 Ilya Verbin <ilya.verbin@intel.com>
564
565 PR c++/69363
566 * c-parser.c (c_parser_cilk_all_clauses): Use c_finish_omp_clauses
567 instead of c_finish_cilk_clauses.
568 * c-tree.h (c_finish_omp_clauses): Add new default argument.
569 * c-typeck.c (c_finish_omp_clauses): Add new argument. Allow
570 floating-point variables in the linear clause for Cilk Plus.
571
5d4b30ea 5722016-04-18 Michael Matz <matz@suse.de>
573
574 * c-decl.c (merge_decls): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
575 (grokdeclarator, parser_xref_tag, finish_enum): Use SET_TYPE_ALIGN.
576
eac243e7 5772016-04-15 Marek Polacek <polacek@redhat.com>
578
579 PR c/70671
580 * c-typeck.c (build_unary_op): Pass location down to error and
581 warning call.
582
b4ba8358 5832016-04-15 Jakub Jelinek <jakub@redhat.com>
584
585 PR c/70436
586 * c-parser.c (c_parser_pragma): Add IF_P argument, pass it down
587 where needed.
588 (c_parser_external_declaration, c_parser_struct_or_union_specifier,
589 c_parser_parameter_declaration, c_parser_compound_statement_nostart,
590 c_parser_objc_class_instance_variables, c_parser_objc_methodprotolist):
591 Adjust c_parser_pragma callers.
592 (c_parser_statement_after_labels): Likewise. Adjust c_parser_cilk_for
593 caller.
594 (c_parser_omp_structured_block): Add IF_P argument, pass it down to
595 c_parser_statement.
596 (c_parser_oacc_data, c_parser_oacc_host_data, c_parser_oacc_loop,
597 c_parser_oacc_kernels_parallel, c_parser_omp_critical,
598 c_parser_omp_simd, c_parser_omp_for, c_parser_omp_master,
599 c_parser_omp_ordered, c_parser_omp_parallel, c_parser_omp_single,
600 c_parser_omp_task, c_parser_omp_taskgroup, c_parser_omp_distribute,
601 c_parser_omp_teams, c_parser_omp_target_data, c_parser_omp_target,
602 c_parser_omp_taskloop, c_parser_omp_construct, c_parser_cilk_grainsize,
603 c_parser_cilk_simd, c_parser_cilk_for): Add IF_P argument, pass it
604 down where needed.
605 (c_parser_omp_for_loop): Likewise. Clear IF_P if nbraces.
606 (c_parser_omp_sections_scope): Adjust c_parser_omp_structured_block
607 calls.
608
0241e4dc 6092016-04-13 Marek Polacek <polacek@redhat.com>
610
611 PR c/70436
612 * c-parser.c (c_parser_statement_after_labels): Add IF_P argument and
613 adjust callers.
614 (c_parser_statement): Likewise.
615 (c_parser_c99_block_statement): Likewise.
616 (c_parser_while_statement): Likewise.
617 (c_parser_for_statement): Likewise.
618 (c_parser_if_body): Don't set IF_P here.
619 (c_parser_if_statement): Add IF_P argument. Set IF_P here. Warn
620 about dangling else here.
621 * c-tree.h (c_finish_if_stmt): Adjust declaration.
622 * c-typeck.c (c_finish_if_stmt): Remove NESTED_IF parameter. Don't
623 warn about dangling else here.
624
c4f5465d 6252016-04-04 Marek Polacek <polacek@redhat.com>
626
627 PR c/70307
628 * c-fold.c (c_fully_fold_internal): Handle VEC_COND_EXPR.
629
7952b661 6302016-03-31 Marek Polacek <polacek@redhat.com>
631
632 PR c/70297
633 * c-decl.c (merge_decls): Also set TYPE_ALIGN and TYPE_USER_ALIGN.
634
5539bc70 6352016-03-18 David Malcolm <dmalcolm@redhat.com>
636
637 PR c/70281
638 * c-parser.c (c_parser_postfix_expression): Set the source range
639 for uses of "__builtin_types_compatible_p".
640
29a514fa 6412016-03-17 Jakub Jelinek <jakub@redhat.com>
642
643 PR c/70280
644 * c-typeck.c (composite_type): Don't count void_list_node
645 into len, if the list is terminated by void_list_node, start
646 with void_list_node instead of NULL for newargs. Stop
647 at void_list_node.
648
462ca422 6492016-03-16 Marek Polacek <polacek@redhat.com>
650
651 PR c/70093
652 * c-typeck.c (build_function_call_vec): Create a TARGET_EXPR for
653 nested functions returning VM types.
654
27dcb7a8 6552016-03-09 Cesar Philippidis <cesar@codesourcery.com>
656
657 * c-parser.c (c_parser_oacc_loop): Update cclauses and clauses
658 when calling c_finish_omp_clauses.
659
2d1d2e55 6602016-03-04 Bernd Schmidt <bschmidt@redhat.com>
661
662 PR c/69824
663 * c-decl.c (get_parm_info): Don't queue implicit function declarations
664 for later.
665
6560d1ad 6662016-03-04 Marek Polacek <polacek@redhat.com>
667
668 PR c/69798
669 * c-parser.c (c_parser_postfix_expression): Call
670 c_parser_cast_expression rather than c_parser_postfix_expression.
671
40e9ce2d 6722016-03-01 Jakub Jelinek <jakub@redhat.com>
673
674 PR c/69796
675 PR c/69974
676 * c-parser.c (c_parser_translation_unit): Don't change TREE_TYPE
677 of incomplete decls to error_mark_node.
678
f0ea75d1 6792016-02-24 Marek Polacek <polacek@redhat.com>
680
681 PR c/69819
682 * c-decl.c (finish_decl): Don't update the copy of the type of a
683 different decl type.
684
d41ab738 6852016-02-23 Jakub Jelinek <jakub@redhat.com>
686
687 PR objc/69844
688 * c-parser.c (c_parser_for_statement): Properly handle ObjC classes
689 in id_kind reclassification.
690
7675e968 6912016-02-16 Jakub Jelinek <jakub@redhat.com>
692
693 PR c/69835
694 * c-typeck.c (build_binary_op): Revert 2015-09-09 change.
695
28072426 6962016-02-16 James Norris <jnorris@codesourcery.com>
697
698 PR c/64748
699 * c-parser.c (c_parser_oacc_data_clause_deviceptr): Allow parms.
700
74a4140f 7012016-02-12 Bernd Schmidt <bschmidt@redhat.com>
702
7c25ed5c 703 * c-decl.c (build_null_declspecs): Zero the entire struct.
704
74a4140f 705 PR c/69522
706 * c-parser.c (c_parser_braced_init): New arg outer_obstack. All
707 callers changed. If nested_p is true, use it to call
708 finish_implicit_inits.
709 * c-tree.h (finish_implicit_inits): Declare.
710 * c-typeck.c (finish_implicit_inits): New function. Move code
711 from ...
712 (push_init_level): ... here.
713 (set_designator, process_init_element): Call finish_implicit_inits.
714
40b38ace 7152016-02-11 Jakub Jelinek <jakub@redhat.com>
716
717 PR c/69768
718 * c-typeck.c (parser_build_binary_op): Strip nops from integer_zerop
719 arguments for -Waddress warning.
720
6b098e91 7212016-02-04 Jakub Jelinek <jakub@redhat.com>
722
723 PR c/69669
724 * c-decl.c (finish_enum): When honoring mode attribute,
725 make sure to use proper TYPE_MIN_VALUE and TYPE_MAX_VALUE.
726
ff5e28e9 7272016-01-29 Jakub Jelinek <jakub@redhat.com>
728
729 PR debug/69518
730 * c-decl.c (finish_struct): Clear C_TYPE_INCOMPLETE_VARS in
731 all type variants, not just TYPE_MAIN_VARIANT.
732
78e516eb 7332016-01-27 Jakub Jelinek <jakub@redhat.com>
734
735 PR debug/66869
736 * c-decl.c (c_write_global_declarations_1): Warn with
737 warn_unused_function if static prototype without definition
738 is not C_DECL_USED.
739
fee5e491 7402016-01-27 Marek Polacek <polacek@redhat.com>
741
742 PR c/68062
743 * c-typeck.c (build_binary_op) [EQ_EXPR, GE_EXPR]: Promote operand
744 to unsigned, if needed. Add -Wsign-compare warning.
745
9bbfd060 7462016-01-26 Jakub Jelinek <jakub@redhat.com>
747
748 PR tree-optimization/69483
749 * c-parser.c (c_parser_translation_unit): Use FOR_EACH_VEC_ELT.
750
6ebc6587 7512016-01-20 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
16d4186f 752
753 PR c/24293
754 * c-tree.h (incomplete_record_decls): Declare.
755 * c-parser.c (incomplete_record_decls): Define.
756 (c_parser_translation_unit): Iterate through incomplete_record_decls and
757 report error if any decl has zero size.
758 * c-decl.c (finish_decl): Append static decl with incomplete struct/union
759 or enum type to incomplete_record_decls.
760
4c39e3a5 7612016-01-14 Tom de Vries <tom@codesourcery.com>
762
763 PR tree-optimization/68773
764 * c-parser.c (c_parser_oacc_declare, c_parser_omp_declare_target): Don't
765 set force_output.
766
77f35cec 7672016-01-14 Marek Polacek <polacek@redhat.com>
768
769 PR c/69262
770 * c-decl.c (grokdeclarator): Provide more information for invalid
771 array declarations.
772
d74214f3 7732016-01-06 David Malcolm <dmalcolm@redhat.com>
774
775 * c-parser.c (c_parser_unary_expression): For dereferences, build
776 a combined location before calling build_indirect_ref, so that
777 error reports cover the full range, manually updating the c_expr
778 src_range.
779
be3c9981 7802016-01-06 Marek Polacek <polacek@redhat.com>
781
782 PR sanitizer/69099
783 * c-convert.c (convert) [INTEGER_TYPE]: Drop ARG. Don't pass ARG to
784 ubsan_instrument_float_cast. Fold EXPR. Use NULL_TREE instead of
785 NULL.
786
f1717362 7872016-01-04 Jakub Jelinek <jakub@redhat.com>
788
789 Update copyright years.
790
d7d6a3ab 7912016-01-04 Marek Polacek <polacek@redhat.com>
792
793 PR c/68908
794 * c-typeck.c (build_atomic_assign): Improve commentary. Add
795 optimization to use __atomic_fetch_* built-in if possible.
796
9d5fd7c6 7972015-12-23 Thomas Schwinge <thomas@codesourcery.com>
798
799 * c-parser.c (c_parser_oacc_clause_use_device): Merge function
800 into...
801 (c_parser_omp_clause_use_device_ptr): ... this function. Adjust
802 all users.
803
37e2d32f 8042015-12-22 Marek Polacek <polacek@redhat.com>
805
806 PR c/69002
807 * c-typeck.c (build_component_ref): Warn when acessing elements of
808 atomic structures or unions.
809
c0bf500c 8102015-12-21 David Malcolm <dmalcolm@redhat.com>
811
812 * c-typeck.c: Include "gcc-rich-location.h".
813 (build_binary_op): In the two places that call binary_op_error,
814 create a gcc_rich_location and populate it with the location of
815 the binary op and its two operands.
816
b9f9586a 8172015-12-16 David Malcolm <dmalcolm@redhat.com>
818
819 * c-parser.c (c_parser_statement_after_labels): When calling
820 c_finish_return, Use the return expression's location if it has
821 one, falling back to the location of the first token within it.
822 * c-typeck.c (c_finish_return): When issuing warnings about
823 the incorrect presence/absence of a return value, issue a note
824 showing the declaration of the function.
825
dbd79382 8262015-12-16 David Malcolm <dmalcolm@redhat.com>
827
828 * c-parser.c (struct c_parser): Expand array "tokens_buf" from 2
829 to 4.
830 (c_parser_peek_nth_token): New function.
831 (c_parser_peek_conflict_marker): New function.
832 (c_parser_error): Detect conflict markers and report them as such.
833
e2093e02 8342015-12-16 David Malcolm <dmalcolm@redhat.com>
835
836 * c-parser.c (c_parser_postfix_expression): Use EXPR_LOC_OR_LOC
837 to preserve range information for the primary expression
838 in the call to c_parser_postfix_expression_after_primary.
839
b49f1fbb 8402015-12-16 David Malcolm <dmalcolm@redhat.com>
841
842 * c-parser.c (c_parser_static_assert_declaration_no_semi): Use the
843 expression location, falling back on the first token location,
844 rather than always using the latter.
845
1d65bac2 8462015-12-16 Marek Polacek <polacek@redhat.com>
847
848 PR c/64637
849 * c-typeck.c (c_process_expr_stmt): Use location of the expression if
850 available.
851
75e722a6 8522015-12-15 Marek Polacek <polacek@redhat.com>
853
854 PR c/68907
855 * c-typeck.c (build_atomic_assign): Set TREE_NO_WARNING on an
856 artificial decl.
857
7063d45b 8582015-12-08 David Malcolm <dmalcolm@redhat.com>
859
860 * c-parser.c (c_parser_alignof_expression): Capture location of
861 closing parenthesis (if any), or of end of unary expression, and
862 use it to build a src_range for the expression.
863
f73b4782 8642015-12-08 David Malcolm <dmalcolm@redhat.com>
865
866 PR c/68757
867 * c-parser.c (c_parser_get_builtin_args): Add
868 "out_close_paren_loc" param, and write back to it.
869 (c_parser_postfix_expression): Capture the closing
870 parenthesis location for RID_CHOOSE_EXPR,
871 RID_BUILTIN_CALL_WITH_STATIC_CHAIN, RID_BUILTIN_COMPLEX,
872 RID_BUILTIN_SHUFFLE and use it to set the source range
873 for such expressions; within RID_BUILTIN_COMPLEX set
874 the underlying location.
875
1b062945 8762015-12-07 Marek Polacek <polacek@redhat.com>
877
878 PR c/68668
879 * c-decl.c (grokdeclarator): If ORIG_QUAL_INDIRECT is indirect, use
880 TREE_TYPE of ORIG_QUAL_TYPE, otherwise decrement ORIG_QUAL_INDIRECT.
881
a4ab54ac 8822015-12-04 Eric Botcazou <ebotcazou@adacore.com>
883
884 * c-tree.h (c_build_va_arg): Adjust prototype.
885 * c-parser.c (c_parser_postfix_expression): Adjust call to above.
886 * c-typeck.c (c_build_va_arg): Rename LOC parameter to LOC2, add LOC1
887 parameter, adjust throughout and issue an error if EXPR is a component
888 with reverse storage order.
889
da562e32 8902015-12-02 Jason Merrill <jason@redhat.com>
891
892 * c-fold.c (c_disable_warnings, c_enable_warnings, c_fully_fold)
893 (c_fully_fold_internal, decl_constant_value_for_optimization):
894 Move from c-common.c.
895 * c-tree.h: Declare decl_constant_value_for_optimization.
896 * Make-lang.in (C_AND_OBJC_OBJS): Add c-fold.o.
897
89f16034 8982015-12-02 Joseph Myers <joseph@codesourcery.com>
899
900 PR c/68162
901 * c-decl.c (grokdeclarator): Set first_non_attr_kind before
902 following link from declarator to next declarator. Track original
903 qualified type and pass it to c_build_qualified_type.
904 * c-typeck.c (c_build_qualified_type): Add arguments
905 orig_qual_type and orig_qual_indirect.
906
2a7545d5 9072015-12-02 Thomas Schwinge <thomas@codesourcery.com>
908
909 * c-parser.c (c_parser_omp_clause_name)
910 (c_parser_oacc_all_clauses): Alphabetical sorting.
911
ad80582d 9122015-12-02 Jakub Jelinek <jakub@redhat.com>
913
914 PR c/68533
915 * c-decl.c (get_parm_info): Use b->locus instead of input_location
916 for diagnostics.
917
571b3486 9182015-12-01 Julian Brown <julian@codesourcery.com>
919 Cesar Philippidis <cesar@codesourcery.com>
920 James Norris <James_Norris@mentor.com>
921
922 * c-parser.c (c_parser_omp_clause_name): Add use_device support.
923 (c_parser_oacc_clause_use_device): New function.
924 (c_parser_oacc_all_clauses): Add use_device support.
925 (OACC_HOST_DATA_CLAUSE_MASK): New macro.
926 (c_parser_oacc_host_data): New function.
927 (c_parser_omp_construct): Add host_data support.
928 * c-tree.h (c_finish_oacc_host_data): Add prototype.
929 * c-typeck.c (c_finish_oacc_host_data): New function.
930 (c_finish_omp_clauses): Add use_device support.
931
c4848393 9322015-11-29 Jan Hubicka <hubicka@ucw.cz>
933
934 PR c/67106
935 * c-decl.c: Set TYPE_PACKED in variants.
936
d4e328e9 9372015-11-27 Martin Liska <mliska@suse.cz>
938
939 PR c++/68312
940 * c-array-notation.c (fix_builtin_array_notation_fn):
941 Use release_vec_vec instead of vec::release.
942 (build_array_notation_expr): Likewise.
943 (fix_conditional_array_notations_1): Likewise.
944 (fix_array_notation_expr): Likewise.
945 (fix_array_notation_call_expr): Likewise.
946
c5e4f591 9472015-11-27 Jakub Jelinek <jakub@redhat.com>
948
949 PR c/63326
950 * c-parser.c (c_parser_compound_statement_nostart): If
951 last_label is true, use pragma_stmt instead of pragma_compound
952 as second c_parser_pragma argument.
953 (c_parser_omp_ordered, c_parser_omp_target_update,
954 c_parser_omp_target_enter_data, c_parser_omp_target_exit_data): Pass
955 false as second argument to c_parser_skip_to_pragma_eol after
956 diagnosing standalone directives used in pragma_stmt context.
957
c954a5bd 9582015-11-24 Ilya Verbin <ilya.verbin@intel.com>
959
960 * c-parser.c (c_parser_oacc_declare): Replace "ifdef ENABLE_OFFLOADING"
961 with "if (ENABLE_OFFLOADING)".
962
daebf4f3 9632015-11-23 David Malcolm <dmalcolm@redhat.com>
964
965 PR objc/68438
966 * c-parser.c (c_parser_postfix_expression): Set up source ranges
967 for various Objective-C constructs: Class.name syntax,
968 @selector(), @protocol(), @encode(), and [] message syntax.
969
734caf84 9702015-11-20 David Malcolm <dmalcolm@redhat.com>
971
972 PR 62314
973 * c-typeck.c (should_suggest_deref_p): New function.
974 (build_component_ref): Special-case POINTER_TYPE when
975 generating a "not a structure of union" error message, and
976 suggest a "->" rather than a ".", providing a fix-it hint.
977
11d8dd6f 9782015-11-19 David Malcolm <dmalcolm@redhat.com>
979
980 * c-typeck.c (lookup_field_fuzzy): Move determination of closest
981 candidate into a new function, find_closest_identifier.
982
62efaf6b 9832015-11-19 Marek Polacek <polacek@redhat.com>
984
985 PR c/68412
986 * c-typeck.c (parser_build_binary_op): Properly handle
987 C_MAYBE_CONST_EXPR before calling warn_tautological_cmp.
988
9dfffd6d 9892015-11-17 David Malcolm <dmalcolm@redhat.com>
990
991 * c-parser.c (set_c_expr_source_range): Bulletproof both
992 overloaded implementations against NULL expr->value.
993 (c_parser_braced_init): Set src_range for "ret" to a sane pair of
994 values.
995 (c_parser_unary_expression): Likewise when handling addresses of
996 labels.
997 (c_parser_postfix_expression): Likewise for statement expressions,
998 for __FUNCTION__, __PRETTY_FUNCTION_ and __func__ keywords, for
999 __builtin_va_arg, and for __builtin_offset_of.
1000 (c_parser_postfix_expression_after_paren_type): Initialize expr's
1001 src_range using the range of the braced initializer.
1002 (c_parser_transaction_expression): Set src_range for "ret" to a
1003 sane pair of values.
1004
c58a4cfd 10052015-11-16 Kirill Yukhin <kirill.yukhin@intel.com>
1006
1007 * c-parser.c (c_finish_omp_declare_simd): Look for
1008 "simd" attribute as well. Update error message.
1009
5f3001a9 10102015-11-14 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
1011
1012 * c-parser.c (c_parser_omp_declare_target): Adjust.
1013
a9833286 10142015-11-14 Jakub Jelinek <jakub@redhat.com>
1015
1016 * c-typeck.c (c_finish_omp_clauses): Don't mark
1017 GOMP_MAP_FIRSTPRIVATE_POINTER decls addressable.
1018
ef61516b 10192015-11-14 Marek Polacek <polacek@redhat.com>
1020
1021 * c-decl.c: Use RECORD_OR_UNION_TYPE_P throughout.
1022 * c-typeck.c: Likewise.
1023
a96cefb2 10242015-11-13 David Malcolm <dmalcolm@redhat.com>
1025
1026 * c-decl.c (warn_defaults_to): Pass line_table to
1027 rich_location ctor.
1028 * c-errors.c (pedwarn_c99): Likewise.
1029 (pedwarn_c90): Likewise.
1030 * c-parser.c (set_c_expr_source_range): New functions.
1031 (c_token::get_range): New method.
1032 (c_token::get_finish): New method.
1033 (c_parser_expr_no_commas): Call set_c_expr_source_range on the ret
1034 based on the range from the start of the LHS to the end of the
1035 RHS.
1036 (c_parser_conditional_expression): Likewise, based on the range
1037 from the start of the cond.value to the end of exp2.value.
1038 (c_parser_binary_expression): Call set_c_expr_source_range on
1039 the stack values for TRUTH_ANDIF_EXPR and TRUTH_ORIF_EXPR.
1040 (c_parser_cast_expression): Call set_c_expr_source_range on ret
1041 based on the cast_loc through to the end of the expr.
1042 (c_parser_unary_expression): Likewise, based on the
1043 op_loc through to the end of op.
1044 (c_parser_sizeof_expression) Likewise, based on the start of the
1045 sizeof token through to either the closing paren or the end of
1046 expr.
1047 (c_parser_postfix_expression): Likewise, using the token range,
1048 or from the open paren through to the close paren for
1049 parenthesized expressions.
1050 (c_parser_postfix_expression_after_primary): Likewise, for
1051 various kinds of expression.
1052 * c-tree.h (struct c_expr): Add field "src_range".
1053 (c_expr::get_start): New method.
1054 (c_expr::get_finish): New method.
1055 (set_c_expr_source_range): New decls.
1056 * c-typeck.c (parser_build_unary_op): Call set_c_expr_source_range
1057 on ret for prefix unary ops.
1058 (parser_build_binary_op): Likewise, running from the start of
1059 arg1.value through to the end of arg2.value.
1060
7a810b2f 10612015-11-13 Marek Polacek <polacek@redhat.com>
1062
1063 PR c/68320
1064 * c-parser.c (c_parser_for_statement): Treat unknown tokens as IDs.
1065
b67f0560 10662015-11-13 David Malcolm <dmalcolm@redhat.com>
1067
1068 * c-typeck.c: Include spellcheck.h.
1069 (lookup_field_fuzzy_find_candidates): New function.
1070 (lookup_field_fuzzy): New function.
1071 (build_component_ref): If the field was not found, try using
1072 lookup_field_fuzzy and potentially offer a suggestion.
1073
2fc5e987 10742015-11-12 James Norris <jnorris@codesourcery.com>
1075 Joseph Myers <joseph@codesourcery.com>
1076
1077 * c-parser.c (c_parser_pragma): Handle PRAGMA_OACC_DECLARE.
1078 (c_parser_omp_clause_name): Handle 'device_resident' clause.
1079 (c_parser_oacc_data_clause): Handle PRAGMA_OACC_CLAUSE_DEVICE_RESIDENT
1080 and PRAGMA_OMP_CLAUSE_LINK.
1081 (c_parser_oacc_all_clauses): Handle PRAGMA_OACC_CLAUSE_DEVICE_RESIDENT
1082 and PRAGMA_OACC_CLAUSE_LINK.
1083 (OACC_DECLARE_CLAUSE_MASK): New definition.
1084 (c_parser_oacc_declare): New function.
1085
28a70e29 10862015-11-12 Marek Polacek <polacek@redhat.com>
1087
1088 PR c/67784
1089 * c-parser.c (c_parser_for_statement): Reclassify the token in
1090 a correct scope.
1091
81b1b2a8 10922015-11-11 Marek Polacek <polacek@redhat.com>
1093
1094 PR c/68107
1095 PR c++/68266
1096 * c-decl.c (grokdeclarator): Call valid_array_size_p. Remove code
1097 checking the size of an array.
1098
6e803544 10992015-11-11 Andrew MacLeod <amacleod@redhat.com>
1100
1101 * c-array-notation.c: Remove unused header files.
1102 * c-aux-info.c: Likewise.
1103 * c-convert.c: Likewise.
1104 * c-decl.c: Likewise.
1105 * c-errors.c: Likewise.
1106 * c-lang.c: Likewise.
1107 * c-objc-common.c: Likewise.
1108 * c-parser.c: Likewise.
1109 * c-typeck.c: Likewise.
1110 * gccspec.c: Likewise.
1111
a1b7fe4b 11122015-11-09 Thomas Schwinge <thomas@codesourcery.com>
1113 Cesar Philippidis <cesar@codesourcery.com>
1114 James Norris <jnorris@codesourcery.com>
1115 Julian Brown <julian@codesourcery.com>
1116 Nathan Sidwell <nathan@codesourcery.com>
1117
1118 c/
1119 * c-parser.c (c_parser_declaration_or_fndef): Add OpenACC
1120 routine arg.
1121 (c_parser_declaration_or_fndef): Call c_finish_oacc_routine.
1122 (c_parser_pragma): Parse 'acc routine'.
1123 (OACC_ROUTINE_CLAUSE_MARK): Define.
1124 (c_parser_oacc_routine, (c_finish_oacc_routine): New.
1125
7758d608 11262015-11-09 Andreas Arnez <arnez@linux.vnet.ibm.com>
1127
1128 PR debug/67192
1129 * c-typeck.c (c_finish_loop): For unconditional loops, set the
1130 location of the backward-goto to the start of the loop body.
1131
c2bf2fb2 11322015-11-09 Andreas Arnez <arnez@linux.vnet.ibm.com>
1133
1134 PR debug/67192
1135 * c-parser.c (c_parser_while_statement): Finish the loop before
1136 parsing ahead for misleading indentation.
1137 (c_parser_for_statement): Likewise.
1138
292237f3 11392015-11-08 Eric Botcazou <ebotcazou@adacore.com>
1140
1141 * c-decl.c (finish_struct): If the structure has reverse storage
1142 order, rewrite the type of array fields with scalar component. Call
1143 maybe_apply_pragma_scalar_storage_order on entry.
1144 * c-typeck.c (build_unary_op) <ADDR_EXPR>: Remove left-overs. Issue
1145 errors on bit-fields and reverse SSO here and not...
1146 (c_mark_addressable): ...here.
1147 (output_init_element): Adjust call to initializer_constant_valid_p.
1148 (c_build_qualified_type): Propagate TYPE_REVERSE_STORAGE_ORDER.
1149
f0479000 11502015-11-06 David Malcolm <dmalcolm@redhat.com>
1151
1152 * c-decl.c (warn_defaults_to): Update for change in signature
1153 of diagnostic_set_info.
1154 * c-errors.c (pedwarn_c99): Likewise.
1155 (pedwarn_c90): Likewise.
1156 * c-objc-common.c (c_tree_printer): Update for new "caret_p" param
1157 for textinfo::set_location.
1158
ef014f95 11592015-11-05 Cesar Philippidis <cesar@codesourcery.com>
1160 Thomas Schwinge <thomas@codesourcery.com>
1161 James Norris <jnorris@codesourcery.com>
1162
1163 * c-parser.c (c_parser_omp_clause_name): Add support for
1164 PRAGMA_OACC_CLAUSE_INDEPENDENT and PRAGMA_OACC_CLAUSE_TILE.
1165 (c_parser_omp_clause_default): Add is_oacc argument. Handle
1166 default(none) in OpenACC.
1167 (c_parser_oacc_shape_clause): Allow pointer variables as gang static
1168 arguments.
1169 (c_parser_oacc_clause_tile): New function.
1170 (c_parser_oacc_all_clauses): Add support for OMP_CLAUSE_DEFAULT,
1171 OMP_CLAUSE_INDEPENDENT and OMP_CLAUSE_TILE.
1172 (OACC_LOOP_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_{PRIVATE,INDEPENDENT,
1173 TILE}.
1174 (OACC_KERNELS_MASK): Add PRAGMA_OACC_CLAUSE_DEFAULT.
1175 (OACC_PARALLEL_MASK): Add PRAGMA_OACC_CLAUSE_{DEFAULT,PRIVATE,
1176 FIRSTPRIVATE}.
1177 (c_parser_omp_all_clauses): Update call to c_parser_omp_clause_default.
1178 (c_parser_oacc_update): Update the error message for missing clauses.
1179 * c-typeck.c (c_finish_omp_clauses): Add support for OMP_CLAUSE_TILE
1180 and OMP_CLAUSE_INDEPENDENT.
1181
f480ca9a 11822015-11-05 Marek Polacek <polacek@redhat.com>
1183
1184 PR c/68090
1185 * c-parser.c (c_parser_postfix_expression_after_paren_type): Don't
1186 deal with pre-evaluation on invalid types.
1187
9561765e 11882015-11-05 Jakub Jelinek <jakub@redhat.com>
1189 Ilya Verbin <ilya.verbin@intel.com>
1190
1191 * c-parser.c: Include context.h and gimple-expr.h.
1192 (c_parser_omp_clause_schedule): Parse schedule modifiers, diagnose
1193 monotonic together with nonmonotonic.
1194 (c_parser_omp_for_loop): Call c_omp_check_loop_iv. Call add_stmt here.
1195 (OMP_DISTRIBUTE_CLAUSE_MASK): Add lastprivate clause.
1196 (c_parser_omp_target_data, c_parser_omp_target_enter_data,
1197 c_parser_omp_target_exit_data): Allow GOMP_MAP_ALWAYS_POINTER.
1198 (c_parser_omp_target): Likewise. Evaluate num_teams and thread_limit
1199 expressions on combined target teams before the target.
1200 (c_parser_omp_declare_target): If decl has "omp declare target" or
1201 "omp declare target link" attribute, and cgraph or varpool node already
1202 exists, then set corresponding flags. Call c_finish_omp_clauses
1203 in the parenthesized extended-list syntax case.
1204 * c-decl.c (c_decl_attributes): Don't diagnose block scope vars inside
1205 declare target.
1206 * c-typeck.c (handle_omp_array_sections_1): Allow non-zero low-bound
1207 on OMP_CLAUSE_REDUCTION array sections.
1208 (handle_omp_array_sections): Encode low-bound into the MEM_REF, either
1209 into the constant offset, or for variable low-bound using
1210 POINTER_PLUS_EXPR. For structure element based array sections use
1211 GOMP_MAP_ALWAYS_POINTER instead of GOMP_MAP_FIRSTPRIVATE_POINTER.
1212 (c_finish_omp_clauses): Drop generic_field_head, structure
1213 elements are now always mapped even as array section bases,
1214 diagnose same var in data sharing and mapping clauses. Diagnose if
1215 linear step on declare simd is neither a constant nor a uniform
1216 parameter. Look through POINTER_PLUS_EXPR for array section
1217 reductions. Diagnose the same var or function appearing multiple
1218 times on the same directive. Fix up wording for the to clause if t
1219 is neither a FUNCTION_DECL nor a VAR_DECL. Diagnose nonmonotonic
1220 modifier on kinds other than dynamic or guided or nonmonotonic
1221 modifier together with ordered clause.
1222
9e10bfb7 12232015-11-03 Thomas Schwinge <thomas@codesourcery.com>
1224 Chung-Lin Tang <cltang@codesourcery.com>
1225
1226 * c-parser.c (c_parser_omp_construct): Handle PRAGMA_OACC_ATOMIC.
1227
4cba6f60 12282015-10-29 Andrew MacLeod <amacleod@redhat.com>
1229
1230 * c-array-notation.c: Reorder #include's and remove duplicates.
1231 * c-aux-info.c: Likewise.
1232 * c-convert.c: Likewise.
1233 * c-decl.c: Likewise.
1234 * c-errors.c: Likewise.
1235 * c-lang.c: Likewise.
1236 * c-objc-common.c: Likewise.
1237 * c-parser.c: Likewise.
1238 * c-typeck.c: Likewise.
1239
7b15d957 12402015-10-26 Jim Wilson <jim.wilson@linaro.org>
1241
1242 PR debug/66068
1243 * c-typeck.c (c_build_qualified_type): Clear C_TYPE_INCOMPLETE_VARS
1244 after calling build_qualified_type.
1245
62c48328 12462015-10-27 Cesar Philippidis <cesar@codesourcery.com>
1247 Thomas Schwinge <thomas@codesourcery.com>
1248 James Norris <jnorris@codesourcery.com>
1249 Joseph Myers <joseph@codesourcery.com>
1250 Julian Brown <julian@codesourcery.com>
1251 Bernd Schmidt <bschmidt@redhat.com>
1252
1253 * c-parser.c (c_parser_oacc_shape_clause): New.
1254 (c_parser_oacc_simple_clause): New.
1255 (c_parser_oacc_all_clauses): Add auto, gang, seq, vector, worker.
1256 (OACC_LOOP_CLAUSE_MASK): Add gang, worker, vector, auto, seq.
1257
2c4c8725 12582015-10-27 Thomas Schwinge <thomas@codesourcery.com>
1259 James Norris <jnorris@codesourcery.com>
1260 Cesar Philippidis <cesar@codesourcery.com>
1261
1262 PR c/64765
1263 PR c/64880
1264 * c-parser.c (c_parser_oacc_loop): Add mask, cclauses formal
1265 parameters, and handle these. Adjust all users.
1266 (c_parser_oacc_kernels, c_parser_oacc_parallel): Merge functions
1267 into...
1268 (c_parser_oacc_kernels_parallel): ... this new function. Adjust
1269 all users.
1270 * c-tree.h (c_finish_oacc_parallel, c_finish_oacc_kernels): Don't
1271 declare functions.
1272 (c_finish_omp_construct): Declare function.
1273 * c-typeck.c (c_finish_oacc_parallel, c_finish_oacc_kernels):
1274 Merge functions into...
1275 (c_finish_omp_construct): ... this new function.
1276
844cece0 12772015-10-22 Richard Biener <rguenther@suse.de>
1278
1279 * c-typeck.c (c_finish_omp_clauses): Properly convert operands
1280 before folding a MINUS_EXPR.
1281
5ce1b137 12822015-10-21 Marek Polacek <polacek@redhat.com>
1283
1284 PR c/68024
1285 * c-decl.c (start_function): Warn about vararg functions without
1286 a prototype.
1287
1f137e6d 12882015-10-21 Ilya Enkovich <enkovich.gnu@gmail.com>
1289
1290 * c-typeck.c (build_conditional_expr): Use boolean vector
1291 type for vector comparison.
1292 (build_vec_cmp): New.
1293 (build_binary_op): Use build_vec_cmp for comparison.
1294
8523243e 12952015-10-20 Marek Polacek <polacek@redhat.com>
1296
1297 * c-parser.c (is_cilkplus_vector_p): Don't define here.
1298
3f73be3e 12992015-10-20 Marek Polacek <polacek@redhat.com>
1300
1301 PR c/67964
1302 * c-parser.c (c_parser_attributes): Break out of the loop if the
1303 token after an attribute isn't a comma.
1304
43895be5 13052015-10-13 Jakub Jelinek <jakub@redhat.com>
1306 Aldy Hernandez <aldyh@redhat.com>
1307
1308 * c-parser.c (c_parser_pragma): Handle PRAGMA_OMP_ORDERED here.
1309 (c_parser_omp_clause_name): Handle OpenMP 4.5 clauses.
1310 (c_parser_omp_variable_list): Handle structure elements for
1311 map, to and from clauses. Handle array sections in reduction
1312 clause. Formatting fixes.
1313 (c_parser_omp_clause_if): Add IS_OMP argument, handle parsing of
1314 if clause modifiers.
1315 (c_parser_omp_clause_num_tasks, c_parser_omp_clause_grainsize,
1316 c_parser_omp_clause_priority, c_parser_omp_clause_hint,
1317 c_parser_omp_clause_defaultmap, c_parser_omp_clause_use_device_ptr,
1318 c_parser_omp_clause_is_device_ptr): New functions.
1319 (c_parser_omp_clause_ordered): Parse optional parameter.
1320 (c_parser_omp_clause_reduction): Handle array reductions.
1321 (c_parser_omp_clause_schedule): Parse optional simd modifier.
1322 (c_parser_omp_clause_nogroup, c_parser_omp_clause_orderedkind): New
1323 functions.
1324 (c_parser_omp_clause_linear): Parse linear clause modifiers.
1325 (c_parser_omp_clause_depend_sink): New function.
1326 (c_parser_omp_clause_depend): Parse source/sink depend kinds.
1327 (c_parser_omp_clause_map): Parse release/delete map kinds and
1328 optional always modifier.
1329 (c_parser_oacc_all_clauses): Adjust c_parser_omp_clause_if
1330 and c_finish_omp_clauses callers.
1331 (c_parser_omp_all_clauses): Likewise. Parse OpenMP 4.5 clauses.
1332 Parse "to" as OMP_CLAUSE_TO_DECLARE if on declare target directive.
1333 (c_parser_oacc_cache): Adjust c_finish_omp_clauses caller.
1334 (OMP_CRITICAL_CLAUSE_MASK): Define.
1335 (c_parser_omp_critical): Parse critical clauses.
1336 (c_parser_omp_for_loop): Handle doacross loops, adjust
1337 c_finish_omp_for and c_finish_omp_clauses callers.
1338 (OMP_SIMD_CLAUSE_MASK): Add simdlen clause.
1339 (c_parser_omp_simd): Allow ordered clause if it has no parameter.
1340 (OMP_FOR_CLAUSE_MASK): Add linear clause.
1341 (c_parser_omp_for): Disallow ordered clause when combined with
1342 distribute. Disallow linear clause when combined with distribute
1343 and not combined with simd.
1344 (OMP_ORDERED_CLAUSE_MASK, OMP_ORDERED_DEPEND_CLAUSE_MASK): Define.
1345 (c_parser_omp_ordered): Add CONTEXT argument, remove LOC argument,
1346 parse clauses and if depend clause is found, don't parse a body.
1347 (c_parser_omp_parallel): Disallow copyin clause on target parallel.
1348 Allow target parallel without for after it.
1349 (OMP_TASK_CLAUSE_MASK): Add priority clause.
1350 (OMP_TARGET_DATA_CLAUSE_MASK): Add use_device_ptr clause.
1351 (c_parser_omp_target_data): Diagnose no map clauses or clauses with
1352 invalid kinds.
1353 (OMP_TARGET_UPDATE_CLAUSE_MASK): Add depend and nowait clauses.
1354 (OMP_TARGET_ENTER_DATA_CLAUSE_MASK,
1355 OMP_TARGET_EXIT_DATA_CLAUSE_MASK): Define.
1356 (c_parser_omp_target_enter_data, c_parser_omp_target_exit_data): New
1357 functions.
1358 (OMP_TARGET_CLAUSE_MASK): Add depend, nowait, private, firstprivate,
1359 defaultmap and is_device_ptr clauses.
1360 (c_parser_omp_target): Parse target parallel and target simd. Set
1361 OMP_TARGET_COMBINED on combined constructs. Parse target enter data
1362 and target exit data. Diagnose invalid map kinds.
1363 (OMP_DECLARE_TARGET_CLAUSE_MASK): Define.
1364 (c_parser_omp_declare_target): Parse OpenMP 4.5 forms of this
1365 construct.
1366 (c_parser_omp_declare_reduction): Use STRIP_NOPS when checking for
1367 &omp_priv.
1368 (OMP_TASKLOOP_CLAUSE_MASK): Define.
1369 (c_parser_omp_taskloop): New function.
1370 (c_parser_omp_construct): Don't handle PRAGMA_OMP_ORDERED here,
1371 handle PRAGMA_OMP_TASKLOOP.
1372 (c_parser_cilk_for): Adjust c_finish_omp_clauses callers.
1373 * c-tree.h (c_finish_omp_clauses): Add two new arguments.
1374 * c-typeck.c (handle_omp_array_sections_1): Fix comment typo.
1375 Add IS_OMP argument, handle structure element bases, diagnose
1376 bitfields, pass IS_OMP recursively, diagnose known zero length
1377 array sections in depend clauses, handle array sections in reduction
1378 clause, diagnose negative length even for pointers.
1379 (handle_omp_array_sections): Add IS_OMP argument, use auto_vec for
1380 types, pass IS_OMP down to handle_omp_array_sections_1, handle
1381 array sections in reduction clause, set
1382 OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION if map could be zero
1383 length array section, use GOMP_MAP_FIRSTPRIVATE_POINTER for IS_OMP.
1384 (c_finish_omp_clauses): Add IS_OMP and DECLARE_SIMD arguments.
1385 Handle new OpenMP 4.5 clauses and new restrictions for the old ones.
1386
789fbb51 13872015-10-06 Marek Polacek <polacek@redhat.com>
1388
1389 * c-parser.c (c_parser_statement_after_labels): Use
1390 protected_set_expr_location.
1391 (c_parser_omp_clause_num_gangs): Likewise.
1392 (c_parser_omp_clause_num_threads): Likewise.
1393 (c_parser_omp_clause_num_workers): Likewise.
1394 (c_parser_omp_clause_vector_length): Likewise.
1395 (c_parser_omp_clause_num_teams): Likewise.
1396 (c_parser_omp_clause_thread_limit): Likewise.
1397 * c-typeck.c (build_c_cast): Likewise.
1398 (c_cast_expr): Likewise.
1399
20cb53c9 14002015-10-05 Richard Sandiford <richard.sandiford@arm.com>
1401
1402 * c-typeck.c (c_tree_equal): Use real_equal instead of
1403 REAL_VALUES_EQUAL.
1404
6d02e6b2 14052015-10-04 Jason Merrill <jason@redhat.com>
1406
1407 * c-parser.c (c_lex_one_token): Handle @synchronized.
1408 * c-decl.c (match_builtin_function_types): A declaration of a built-in
1409 can change whether the function is transaction_safe.
1410
802c32cd 14112015-10-02 Marek Polacek <polacek@redhat.com>
1412
1413 PR c/67730
1414 * c-typeck.c (convert_for_assignment): Use the expansion point
1415 location throughout.
1416
ef17a71a 14172015-10-02 Marek Polacek <polacek@redhat.com>
1418
1419 PR c/64249
1420 * c-parser.c (c_parser_statement_after_labels): Add CHAIN parameter
1421 and pass it down to c_parser_if_statement.
1422 (c_parser_else_body): Add CHAIN parameter and pass it down to
1423 c_parser_statement_after_labels.
1424 (c_parser_if_statement): Add CHAIN parameter. Add code to warn about
1425 duplicated if-else-if conditions.
1426
7e93eb1a 14272015-10-01 Marek Polacek <polacek@redhat.com>
1428
1429 * c-typeck.c (convert_for_assignment): Improve commentary.
1430
ab4c803c 14312015-09-30 Marek Polacek <polacek@redhat.com>
1432
1433 PR c/67730
1434 * c-typeck.c (c_finish_return): Use the expansion point location for
1435 certain "return with value" warnings.
1436
ed536208 14372015-09-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
1438
1439 * c-parser.c (pragma_lex): Add loc argument.
1440
03e8b174 14412015-09-15 Marek Polacek <polacek@redhat.com>
1442
1443 PR c/67580
1444 * c-decl.c (tag_exists_p): New function.
1445 * c-parser.c (c_parser_declaration_or_fndef): Give a hint when
1446 struct/union/enum keywords are missing.
1447 * c-tree.h (tag_exists_p): Declare.
1448
a39b4dc0 14492015-09-15 Marek Polacek <polacek@redhat.com>
1450
1451 * c-decl.c (lookup_label): Return NULL_TREE instead of 0.
1452 (lookup_tag): Change the type of THISLEVEL_ONLY to bool.
1453 Return NULL_TREE instead of 0.
1454 (lookup_name): Return NULL_TREE instead of 0.
1455 (lookup_name_in_scope): Likewise.
1456 (shadow_tag_warned): Use true instead of 1 and NULL_TREE instead of 0.
1457 (parser_xref_tag): Use false instead of 0.
1458 (start_struct): Use true instead of 1.
1459 (start_enum): Use true instead of 1 and NULL_TREE instead of 0.
1460
85f5e2ee 14612015-09-14 Marek Polacek <polacek@redhat.com>
1462
1463 * c-typeck.c (set_nonincremental_init_from_string): Use
1464 HOST_WIDE_INT_M1U when shifting a negative value.
1465
739237d5 14662015-09-09 Mark Wielaard <mjw@redhat.com>
1467
1468 * c-typeck.c (build_binary_op): Check and warn when nonnull arg
1469 parm against NULL.
1470
d2b2788c 14712015-09-10 Jakub Jelinek <jakub@redhat.com>
1472
1473 PR c/67502
1474 * c-parser.c (c_parser_omp_for_loop): Emit DECL_EXPR stmts
1475 into OMP_FOR_PRE_BODY rather than before the loop.
1476
deef87db 14772015-09-09 Jakub Jelinek <jakub@redhat.com>
1478
c43f93d7 1479 PR c/67501
1480 * c-parser.c (c_parser_oacc_all_clauses,
1481 c_parser_omp_all_clauses): Remove invalid clause from
1482 list of clauses even if parser->error is set.
1483
0fdcfb93 1484 PR c/67500
1485 * c-parser.c (c_parser_omp_clause_aligned,
1486 c_parser_omp_clause_safelen, c_parser_omp_clause_simdlen): Fix up
1487 test for errors.
1488 * c-decl.c (temp_pop_parm_decls): Allow b->decl equal to
1489 error_mark_node.
1490
deef87db 1491 PR c/67495
1492 * c-parser.c (c_parser_omp_atomic): Use c_parser_cast_expression
1493 instead of c_parser_unary_expression. If the result is !lvalue_p,
1494 wrap the result of c_fully_fold into NON_LVALUE_EXPR.
1495
e96292e9 14962015-09-04 Marek Polacek <polacek@redhat.com>
1497
1498 PR sanitizer/67279
1499 * c-typeck.c (build_binary_op): Don't instrument static initializers.
1500
547c6b1f 15012015-09-03 Martin Sebor <msebor@redhat.com>
1502
1503 PR c/66516
6ccd7236 1504 * c-typeck.c (convert_arguments, parser_build_unary_op,
1505 build_conditional_expr, c_cast_expr, convert_for_assignment,
1506 build_binary_op, _objc_common_truthvalue_conversion): Call
547c6b1f 1507 reject_gcc_builtin.
1508 (c_decl_implicit): Define.
1509
bd66724c 15102015-09-02 Marek Polacek <polacek@redhat.com>
1511
1512 PR c/67432
1513 * c-parser.c (c_parser_enum_specifier): Give a better error for
1514 an empty enum.
1515
6dc50383 15162015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org>
1517
1518 * c-aux-info.c, c-parser.c, c-tree.h: Remove useless typedefs.
1519
7ad1d78d 15202015-08-12 Marek Polacek <polacek@redhat.com>
1521
1522 * c-decl.c (grokdeclarator): Call error_at instead of error and pass
1523 LOC to it.
1524
c9099388 15252015-08-03 Marek Polacek <polacek@redhat.com>
1526
1527 PR c/67088
1528 * c-decl.c (check_bitfield_type_and_width): Add location parameter.
1529 Use it.
1530 (grokdeclarator): Pass LOC down to check_bitfield_type_and_width.
1531
9255be07 15322015-08-02 Patrick Palka <ppalka@gcc.gnu.org>
1533
1534 * c-parser.c (c_parser_if_body): Take token_indent_info
1535 argument. Call warn_for_misleading_indentation even when the
1536 body is a semicolon. Extract token_indent_infos corresponding
1537 to the guard, body and next tokens. Adjust call to
1538 warn_for_misleading_indentation accordingly.
1539 (c_parser_else_body): Likewise.
1540 (c_parser_if_statement): Likewise.
1541 (c_parser_while_statement): Likewise.
1542 (c_parser_for_statement): Likewise.
1543
dbbd4c6d 15442015-07-28 Luis Felipe Strano Moraes <luis.strano@gmail.com>
1545 Manuel López-Ibáñez <manu@gcc.gnu.org>
1546
1547 * c-decl.c (get_parm_info): Remove static var. Update warning
1548 message.
1549
6784a472 15502015-07-27 Marek Polacek <polacek@redhat.com>
1551
1552 PR c++/66555
1553 PR c/54979
1554 * c-typeck.c (parser_build_binary_op): Call warn_tautological_cmp.
1555
8d669e79 15562015-07-20 Marek Polacek <polacek@redhat.com>
1557
1558 PR c++/55095
1559 * c-typeck.c (digest_init): Pass OPT_Wpedantic to pedwarn_init.
1560 (build_binary_op): Warn about left shift overflows.
1561
1eacc14a 15622015-07-09 Andrew MacLeod <amacleod@redhat.com>
1563
1564 * c-array-notation.c: Adjust includes for flags.h changes.
1565 * c-objc-common.c: Likewise.
1566
9ef16211 15672015-07-07 Andrew MacLeod <amacleod@redhat.com>
1568
1569 * c-array-notation.c: Adjust includes.
1570 * c-aux-info.c: Likewise.
1571 * c-convert.c: Likewise.
1572 * c-decl.c: Likewise.
1573 * c-errors.c: Likewise.
1574 * c-lang.c: Likewise.
1575 * c-objc-common.c: Likewise.
1576 * c-parser.c: Likewise.
1577 * c-typeck.c: Likewise.
1578
0949f227 15792015-06-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
1580
1581 PR fortran/66605
1582 * c-decl.c (finish_function): Call do_warn_unused_parameter.
1583
be23b16f 15842015-06-29 Marek Polacek <polacek@redhat.com>
1585
1586 PR c/66322
1587 * c-typeck.c (struct c_switch): Add BOOL_COND_P and OUTSIDE_RANGE_P.
1588 (c_start_case): Set BOOL_COND_P and OUTSIDE_RANGE_P. Don't warn
1589 about -Wswitch-bool here.
1590 (do_case): Update c_add_case_label call.
1591 (c_finish_case): Update c_do_switch_warnings call.
1592
6290f0db 15932015-06-27 Marek Polacek <polacek@redhat.com>
1594
1595 * c-typeck.c: Use VECTOR_TYPE_P throughout.
1596
aa3e402e 15972015-06-26 Marek Polacek <polacek@redhat.com>
1598
1599 * c-array-notation.c (fix_builtin_array_notation_fn): Use
1600 INDIRECT_REF_P.
1601 * c-typeck.c (array_to_pointer_conversion): Likewise.
1602 (build_unary_op): Likewise.
1603 (c_finish_return): Likewise.
1604
ec2e0095 16052015-06-25 Andrew MacLeod <amacleod@redhat.com>
1606
1607 * c-decl.c: Remove ipa-ref.h and plugin-api.h from include list.
1608 * c-parser.c: Likewise.
1609
770ff93b 16102015-06-25 Richard Sandiford <richard.sandiford@arm.com>
1611
1612 * c-decl.c (detect_field_duplicates_hash): Use nofree_ptr_hash
1613 instead of pointer_hash.
1614 (detect_field_duplicates): Likewise.
1615
f48c7f4a 16162015-06-25 Marek Polacek <polacek@redhat.com>
1617
1618 * c-array-notation.c: Use VAR_P throughout.
1619 * c-decl.c: Likewise.
1620 * c-objc-common.c: Likewise.
1621 * c-parser.c: Likewise.
1622 * c-typeck.c: Likewise.
1623
ce41e81a 16242015-06-25 Marek Polacek <polacek@redhat.com>
1625
1626 * c-decl.c: Use is_global_var throughout.
1627 * c-parser.c: Likewise.
1628 * c-typeck.c: Likewise.
1629
f2ab3bac 16302015-06-17 Andrew MacLeod <amacleod@redhat.com>
1631
1632 * c-array-notation.c: Do not include input.h, line-map.h or is-a.h.
1633 * c-aux-info.c: Likewise.
1634 * c-convert.c: Likewise.
1635 * c-decl.c: Likewise.
1636 * c-errors.c: Likewise.
1637 * c-lang.c: Likewise.
1638 * c-objc-common.c: Likewise.
1639 * c-parser.c: Likewise.
1640 * c-typeck.c: Likewise.
1641
647730ab 16422015-06-11 Jan Hubicka <hubicka@ucw.cz>
1643
1644 PR middle-end/66325
1645 * c-decl.c (start_enum): Set TYPE_PACKED consistently among type
1646 variants.
1647
dd4b0a0d 16482015-06-11 Pierre-Marie de Rodat <derodat@adacore.com>
1649
1650 * c-decl.c (pop_scope): Register the main translation unit
1651 through the new debug hook.
1652
64486212 16532015-06-08 Andrew MacLeod <amacleod@redhat.com>
1654
1655 * c-array-notation.c : Adjust include files.
1656 * c-aux-info.c : Likewise.
1657 * c-convert.c : Likewise.
1658 * c-decl.c : Likewise.
1659 * c-errors.c : Likewise.
1660 * c-lang.c : Likewise.
1661 * c-lang.h : Likewise.
1662 * c-objc-common.c : Likewise.
1663 * c-parser.c : Likewise.
1664 * c-typeck.c : Likewise.
1665
3a1c9df2 16662015-06-05 Aldy Hernandez <aldyh@redhat.com>
1667
1668 * c-decl.c (finish_struct): Save C_TYPE_INCOMPLETE_VARS and
1669 immediately clobber it.
1670 (c_write_global_declarations_1): Remove call to
1671 check_global_declaration_1.
1672 (c_write_global_declarations_2): Remove.
1673 (c_write_final_cleanups): Rename from c_write_global_declarations.
1674 Remove call to finalize_compilation_unit.
1675 Remove calls to debugging hooks.
1676 * c-objc-common.c: Adjust comment for c_warn_unused_global_decl.
1677 * c-objc-common.h: Remove LANG_HOOKS_WRITE_GLOBALS.
1678 * c-tree.h: Remove c_write_global_declarations.
1679
f77c0292 16802015-06-04 Andrew MacLeod <amacleod@redhat.com>
1681
1682 * c-array-notation.c: Adjust includes for restructured coretypes.h.
1683 * c-aux-info.c: Likewise.
1684 * c-convert.c: Likewise.
1685 * c-decl.c: Likewise.
1686 * c-errors.c: Likewise.
1687 * c-lang.c: Likewise.
1688 * c-objc-common.c: Likewise.
1689 * c-parser.c: Likewise.
1690 * c-typeck.c: Likewise.
1691
b44134dc 16922015-06-04 Marek Polacek <polacek@redhat.com>
1693
1694 PR c/66341
1695 * c-typeck.c (build_c_cast): Wrap VALUE into NON_LVALUE_EXPR if
1696 it is a lvalue.
1697
d1df0bfc 16982015-06-03 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
1699
1700 * c-decl.c (warn_cxx_compat_finish_struct): New parameters code, record_loc.
1701 Warn for empty struct.
1702 (finish_struct): Pass TREE_CODE(t) and loc to warn_cxx_compat_finish_struct.
1703
f8363c5d 17042015-06-02 Andres Tiraboschi <andres.tiraboschi@tallertechnologies.com>
1705
1706 * c-decl.c (start_function): Call plugin before parsing.
1707 (finish_function): Call plugin after parsing.
1708
5b9761f5 17092015-06-02 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
1710
1711 PR c/49551
1712 * c-decl.c (merge_decls): Merge DECL_COMMON.
1713
eeec71b4 17142015-05-22 Jim Wilson <jim.wilson@linaro.org>
1715
1716 * Make-lang.in (check_gcc_pallelize): Define.
1717
5a4c69dd 17182015-05-22 Marek Polacek <polacek@redhat.com>
1719
1720 PR c/47043
1721 * c-parser.c (c_parser_enum_specifier): Parse and apply enumerator
1722 attributes.
1723
5650b4ff 17242015-05-21 Marek Polacek <polacek@redhat.com>
1725
1726 * c-typeck.c (inform_declaration): Use DECL_IS_BUILTIN instead of
1727 DECL_BUILT_IN.
1728
b443c459 17292015-05-20 Marek Polacek <polacek@redhat.com>
1730
1731 * c-decl.c: Use VAR_OR_FUNCTION_DECL_P throughout.
1732 * c-typeck.c: Likewise.
1733
9e73638f 17342015-05-19 Marek Polacek <polacek@redhat.com>
1735
1736 * c-typeck.c (start_init): Use AGGREGATE_TYPE_P.
1737
d7729e26 17382015-05-19 Jakub Jelinek <jakub@redhat.com>
1739
1740 PR middle-end/66199
1741 * c-parser.c (c_parser_omp_for_loop): Don't add
1742 OMP_CLAUSE_SHARED to OMP_PARALLEL_CLAUSES when moving
1743 OMP_CLAUSE_LASTPRIVATE clause to OMP_FOR_CLAUSES.
1744 (c_parser_omp_teams): Set OMP_TEAMS_COMBINED for combined
1745 constructs.
1746
dfcf26a5 17472015-05-19 Mikhail Maltsev <maltsevm@gmail.com>
1748
1749 * c-typeck.c (build_array_ref): Use std::swap instead of explicit
9e73638f 1750 swaps.
dfcf26a5 1751
09172322 17522015-05-16 Manuel López-Ibáñez <manu@gcc.gnu.org>
1753
1754 PR fortran/44054
1755 * c-objc-common.c (c_tree_printer): Replace locus pointer with
1756 accessor function.
1757
aac24642 17582015-05-14 Marek Polacek <polacek@redhat.com>
1759
1760 PR c/66066
1761 PR c/66127
1762 * c-typeck.c (digest_init): Call pedwarn_init with OPT_Wpedantic
1763 rather than with 0.
1764
e5f01cba 17652015-05-12 David Malcolm <dmalcolm@redhat.com>
1766
1767 * c-parser.c (c_parser_if_body): Add param "if_loc", use it
1768 to add a call to warn_for_misleading_indentation.
1769 (c_parser_else_body): Likewise, adding param "else_loc".
1770 (c_parser_if_statement): Check for misleading indentation.
1771 (c_parser_while_statement): Likewise.
1772 (c_parser_for_statement): Likewise.
1773
dc5945dc 17742015-05-08 Marek Polacek <polacek@redhat.com>
1775
1776 PR c/64918
1777 * c-typeck.c (add_pending_init): Use OPT_Woverride_init_side_effects.
1778 (output_init_element): Likewise.
1779
cdc64059 17802015-05-07 Marek Polacek <polacek@redhat.com>
1781
1782 PR c/65179
1783 * c-typeck.c (build_binary_op): Warn when left shifting a negative
1784 value.
1785
6fa7118e 17862015-04-30 Marek Polacek <polacek@redhat.com>
1787
1788 * c-typeck.c (set_init_label): Call error_at instead of error and
1789 pass LOC to it.
1790
98f44804 1791 * c-typeck.c (c_incomplete_type_error): Refactor to use %qT. Print
1792 the type of a decl.
1793
2cd7caae 1794 * c-typeck.c (c_build_va_arg): Clarify the error message.
1795
95cfd391 17962015-04-29 Thomas Schwinge <thomas@codesourcery.com>
1797
1798 * c-parser.c (c_parser_oacc_enter_exit_data): Use
1799 OMP_STANDALONE_CLAUSES.
1800
e65e39f8 18012015-04-28 Marek Polacek <polacek@redhat.com>
1802
1803 * c-parser.c (c_parser_binary_expression): Remove duplicate line.
1804
5580bf42 18052015-04-28 Marek Polacek <polacek@redhat.com>
1806
1807 PR c/65901
1808 * c-typeck.c (c_build_va_arg): Require TYPE be a complete type.
1809
c3468fc2 18102015-04-25 Marek Polacek <polacek@redhat.com>
1811
1812 PR c/52085
1813 * c-decl.c (finish_enum): Copy over TYPE_ALIGN. Also check for "mode"
1814 attribute.
1815
0cd6b1b4 18162015-04-23 Marek Polacek <polacek@redhat.com>
1817
1818 PR c/65345
1819 * c-decl.c (set_labels_context_r): New function.
1820 (store_parm_decls): Call it via walk_tree_without_duplicates.
1821 * c-typeck.c (convert_lvalue_to_rvalue): Use create_tmp_var_raw
1822 instead of create_tmp_var. Build TARGET_EXPR instead of
1823 COMPOUND_EXPR.
1824 (build_atomic_assign): Use create_tmp_var_raw instead of
1825 create_tmp_var. Build TARGET_EXPRs instead of MODIFY_EXPR.
1826
05a827ce 18272015-04-20 Ilya Verbin <ilya.verbin@intel.com>
1828
1829 * c-parser.c (c_parser_oacc_enter_exit_data): Remove excess semicolon.
1830 (c_parser_omp_target_update): Add missed %> to error_at ().
1831
de801c28 18322015-04-10 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
1833
1834 PR target/55143
1835 * c-decl.c (c_default_pointer_mode): Remove definition.
1836 * c-tree.h (c_default_pointer_mode): Remove declaration.
1837
c3b1dca4 18382015-03-27 Tobias Burnus <burnus@net-b.de>
1839
1840 PR c/65586
1841 * c-parser.c (c_parser_skip_to_pragma_eol): Optionally, don't
1842 error out.
1843 (c_parser_omp_for, c_parser_omp_parallel, c_parser_omp_distribute,
1844 c_parser_omp_teams, c_parser_omp_target, c_parser_omp_declare):
1845 Update calls to not error for skipped omp pragmas with -fopenmp-simd.
1846
1443772f 18472015-03-19 Jakub Jelinek <jakub@redhat.com>
1848
1849 * c-decl.c (c_decl_attributes): Also add "omp declare target"
1850 attribute for DECL_EXTERNAL VAR_DECLs.
1851
76738f56 18522015-03-11 Jakub Jelinek <jakub@redhat.com>
1853
1854 * c-parser.c (c_parse_init): Don't call xstrdup on get_identifier
1855 argument.
1856
16f958b3 18572015-03-10 Jakub Jelinek <jakub@redhat.com>
1858
1859 PR c/65120
1860 * c-typeck.c (parser_build_binary_op): Check for tcc_comparison
1861 before preparing arguments to warn_logical_not_parentheses.
1862
6054103a 18632015-03-09 Jakub Jelinek <jakub@redhat.com>
1864
1865 PR c/65120
1866 * c-typeck.c (parser_build_binary_op): Don't warn for
1867 !!x == y or !b == y where b is _Bool.
1868
de3a1e03 18692015-03-09 Marek Polacek <polacek@redhat.com>
1870
1871 * c-convert.c (convert): Make use of do_ubsan_in_current_function.
1872 * c-decl.c (grokdeclarator): Likewise.
1873 * c-typeck.c (build_binary_op): Likewise.
1874
084e6bf0 18752015-02-27 Marek Polacek <polacek@redhat.com>
1876
1877 PR c/65228
1878 * c-decl.c (start_decl): Return NULL_TREE if decl is an error node.
1879
4d7c4134 18802015-02-14 Marek Polacek <polacek@redhat.com>
1881
1882 PR c/64768
1883 * c-decl.c (grokdeclarator): Set the range of a flexible array member
1884 declared through a typedef name.
1885
b1380826 18862015-02-13 Marek Polacek <polacek@redhat.com>
1887
1888 PR c/65050
1889 * c-decl.c (grokdeclarator): Print also the type when giving
1890 the error message about array's incomplete element type.
1891
35ff54b5 18922015-02-11 Jakub Jelinek <jakub@redhat.com>
1893
1894 PR c/64824
1895 * c-parser.c (c_parser_binary_expression): Fix OpenMP stack[sp].prec
1896 check in the POP macro.
1897
46861609 18982015-02-09 Marek Polacek <polacek@redhat.com>
1899
1900 PR c/64856
1901 * c-typeck.c (process_init_element): Don't always wrap
1902 COMPOUND_LITERAL_EXPR in a SAVE_EXPR in C99 mode when
1903 initializing a range of elements.
1904
bbf8fbec 19052015-02-04 Jakub Jelinek <jakub@redhat.com>
1906
1907 PR c/64824
1908 PR c/64868
1909 * c-parser.c (c_parser_omp_atomic): Handle RDIV_EXPR.
1910
46861609 19112015-02-02 Bruno Loff <bruno.loff@gmail.com>
1f0ce3ac 1912
1913 * c-parser.c (c_parser_declspecs): Call invoke_plugin_callbacks after
1914 processing enum declaration.
1915
70279be9 19162015-01-29 Marek Polacek <polacek@redhat.com>
1917
1918 PR c/64709
1919 * c-typeck.c (pop_init_level): If constructor_elements has
1920 exactly one element with integer_zerop value, set constructor_zeroinit
1921 to 1. Remove braces around warning_init call.
1922
591970b4 19232015-01-27 Jakub Jelinek <jakub@redhat.com>
1924
1925 PR c/64766
1926 * c-typeck.c (store_init_value): Don't overwrite DECL_INITIAL
1927 of FUNCTION_DECLs with error_mark_node.
1928
87778dc4 19292015-01-26 Jakub Jelinek <jakub@redhat.com>
1930
1931 PR c/64778
1932 * c-typeck.c (convert_arguments): Return -1 if there are
1933 error_args, even if we've diagnosed too many arguments.
1934
cffdfb3d 19352015-01-21 Richard Biener <rguenther@suse.de>
1936
1937 PR middle-end/64313
1938 * c-decl.c (merge_decls): Call set_builtin_decl_declared_p
1939 for builtins the user declared correctly.
1940
ca4c3545 19412015-01-15 Thomas Schwinge <thomas@codesourcery.com>
1942 Bernd Schmidt <bernds@codesourcery.com>
1943 Cesar Philippidis <cesar@codesourcery.com>
1944 James Norris <jnorris@codesourcery.com>
1945 Jakub Jelinek <jakub@redhat.com>
1946 Ilmir Usmanov <i.usmanov@samsung.com>
1947
1948 * c-parser.c: Include "gomp-constants.h".
1949 (c_parser_omp_clause_map): Use enum gomp_map_kind instead of enum
1950 omp_clause_map_kind. Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
1951 Use OMP_CLAUSE_SET_MAP_KIND.
1952 (c_parser_pragma): Handle PRAGMA_OACC_ENTER_DATA,
1953 PRAGMA_OACC_EXIT_DATA, PRAGMA_OACC_UPDATE.
1954 (c_parser_omp_construct): Handle PRAGMA_OACC_CACHE,
1955 PRAGMA_OACC_DATA, PRAGMA_OACC_KERNELS, PRAGMA_OACC_LOOP,
1956 PRAGMA_OACC_PARALLEL, PRAGMA_OACC_WAIT.
1957 (c_parser_omp_clause_name): Handle "auto", "async", "copy",
1958 "copyout", "create", "delete", "deviceptr", "gang", "host",
1959 "num_gangs", "num_workers", "present", "present_or_copy", "pcopy",
1960 "present_or_copyin", "pcopyin", "present_or_copyout", "pcopyout",
1961 "present_or_create", "pcreate", "seq", "self", "vector",
1962 "vector_length", "wait", "worker".
1963 (OACC_DATA_CLAUSE_MASK, OACC_KERNELS_CLAUSE_MASK)
1964 (OACC_ENTER_DATA_CLAUSE_MASK, OACC_EXIT_DATA_CLAUSE_MASK)
1965 (OACC_LOOP_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK)
1966 (OACC_UPDATE_CLAUSE_MASK, OACC_WAIT_CLAUSE_MASK): New macros.
1967 (c_parser_omp_variable_list): Handle OMP_CLAUSE__CACHE_.
1968 (c_parser_oacc_wait_list, c_parser_oacc_data_clause)
1969 (c_parser_oacc_data_clause_deviceptr)
1970 (c_parser_omp_clause_num_gangs, c_parser_omp_clause_num_workers)
1971 (c_parser_oacc_clause_async, c_parser_oacc_clause_wait)
1972 (c_parser_omp_clause_vector_length, c_parser_oacc_all_clauses)
1973 (c_parser_oacc_cache, c_parser_oacc_data, c_parser_oacc_kernels)
1974 (c_parser_oacc_enter_exit_data, c_parser_oacc_loop)
1975 (c_parser_oacc_parallel, c_parser_oacc_update)
1976 (c_parser_oacc_wait): New functions.
1977 * c-tree.h (c_finish_oacc_parallel, c_finish_oacc_kernels)
1978 (c_finish_oacc_data): New prototypes.
1979 * c-typeck.c: Include "gomp-constants.h".
1980 (handle_omp_array_sections): Handle GOMP_MAP_FORCE_DEVICEPTR. Use
1981 GOMP_MAP_* instead of OMP_CLAUSE_MAP_*. Use
1982 OMP_CLAUSE_SET_MAP_KIND.
1983 (c_finish_oacc_parallel, c_finish_oacc_kernels)
1984 (c_finish_oacc_data): New functions.
1985 (c_finish_omp_clauses): Handle OMP_CLAUSE__CACHE_,
1986 OMP_CLAUSE_NUM_GANGS, OMP_CLAUSE_NUM_WORKERS,
1987 OMP_CLAUSE_VECTOR_LENGTH, OMP_CLAUSE_ASYNC, OMP_CLAUSE_WAIT,
1988 OMP_CLAUSE_AUTO, OMP_CLAUSE_SEQ, OMP_CLAUSE_GANG,
1989 OMP_CLAUSE_WORKER, OMP_CLAUSE_VECTOR, and OMP_CLAUSE_MAP's
1990 GOMP_MAP_FORCE_DEVICEPTR.
1991
1f78217c 19922015-01-09 Michael Collison <michael.collison@linaro.org>
1993
1994 * c-array-notation.c: Include hash-set.h, machmode.h,
1995 vec.h, double-int.h, input.h, alias.h, symtab.h, options.h
1996 fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h.
1997 * c-aux-info.c: Ditto.
1998 * c-convert.c: Ditto.
1999 * c-decl.c: Ditto.
2000 * c-errors.c: Ditto.
2001 * c-lang.c: Dittoxs.
2002 * c-objc-common.c: Ditto.
2003 * c-parser.c: Ditto.
2004 * c-typeck.c: Include hash-set.h, machmode.h,
2005 vec.h, double-int.h, input.h, alias.h, symtab.h, options.h
2006 fold-const.h, wide-int.h, inchash.h, real.h and
2007 fixed-value.h due to flattening of tree.h.
2008
15e18a8c 20092015-01-07 Marek Polacek <polacek@redhat.com>
2010
2011 PR c/64417
2012 * c-typeck.c (process_init_element): Disallow initialization of
2013 a flexible array member with a string constant if the structure
2014 is in an array.
2015
d353bf18 20162015-01-05 Jakub Jelinek <jakub@redhat.com>
2017
823a9dd4 2018 PR sanitizer/64344
2019 * c-typeck.c (convert_for_assignment, c_finish_return): For
2020 -fsanitize=float-cast-overflow casts from REAL_TYPE to integer/enum
2021 types also set in_late_binary_op around convert call.
2022 * c-convert.c (convert): For -fsanitize=float-cast-overflow REAL_TYPE
2023 to integral type casts, if not in_late_binary_op, pass c_fully_fold
2024 result on expr as last argument to ubsan_instrument_float_cast,
2025 if in_late_binary_op, don't use c_save_expr but save_expr.
2026
d353bf18 2027 Update copyright years.
2028
92b63884 20292015-01-05 Marek Polacek <polacek@redhat.com>
2030
2031 PR c/64423
2032 * c-typeck.c (build_array_ref): Pass loc down to
2033 warn_array_subscript_with_type_char.
2034
92a44a68 20352014-12-20 Martin Uecker <uecker@eecs.berkeley.edu>
8a8211df 2036
2037 * c-typeck.c: New behavious for pointers to arrays with qualifiers
2038 (common-pointer-type): For pointers to arrays take qualifiers from
2039 element type.
2040 (build_conditional_expr): Add warnings for lost qualifiers.
2041 (comp-target-types): Allow pointers to arrays with different qualifiers.
2042 (convert-for-assignment): Adapt warnings for discarded qualifiers. Add
2043 WARNING_FOR_QUALIFIERS macro and rename WARN_FOR_QUALIFIERS
2044 to PEDWARN_FOR_QUALIFIERS.
2045
35ea0139 20462014-12-17 Jakub Jelinek <jakub@redhat.com>
2047
2048 PR sanitizer/64289
2049 * c-convert.c: Include ubsan.h.
2050 (convert): For real -> integral casts and
2051 -fsanitize=float-cast-overflow don't call convert_to_integer, but
2052 instead instrument the float cast directly.
2053
f9e245b2 20542014-11-29 Jakub Jelinek <jakub@redhat.com>
2055
2056 * c-typeck.c (convert_lvalue_to_rvalue, build_atomic_assign,
2057 c_finish_stmt_expr): Remove NULL last argument from
2058 create_tmp_var_raw and create_tmp_var calls.
2059 * c-array-notation.c (fix_builtin_array_notation_fn,
2060 build_array_notation_expr, fix_conditional_array_notations_1,
2061 fix_array_notation_expr, fix_array_notation_call_expr): Likewise.
2062
fce2dbd1 20632014-11-28 Marek Polacek <polacek@redhat.com>
2064
2065 PR c/63862
2066 * c-typeck.c (build_binary_op) <RSHIFT_EXPR, LSHIFT_EXPR>: Don't
2067 convert the right operand to integer type.
2068
396c36b7 20692014-11-25 Marek Polacek <polacek@redhat.com>
2070
2071 PR c/63877
2072 * c-decl.c (start_function): Disable -Wmissing-declarations warning
2073 for inline functions.
2074
c61ef207 20752014-11-21 Jakub Jelinek <jakub@redhat.com>
2076
2077 PR target/63764
2078 * c-typeck.c (build_array_ref): Adjust
2079 convert_vector_to_pointer_for_subscript caller. If it returns true,
2080 call non_lvalue_loc on the result.
2081
565353e8 20822014-11-11 Richard Biener <rguenther@suse.de>
2083
2084 * c-decl.c (c_init_decl_processing): Do not set pedantic_lvalues
2085 to true.
2086
fdd735a7 20872014-11-10 Andi Kleen <ak@linux.intel.com>
2088
2089 PR c/60804
2090 * c-parser.c (c_parser_statement_after_labels): Call
2091 check_no_cilk.
2092 (c_parser_if_statement): Dito.
2093 (c_parser_switch_statement): Dito.
2094 (c_parser_while_statement): Dito.
2095 (c_parser_do_statement): Dito.
2096 (c_parser_for_statement): Dito.
2097 * c-typeck.c (c_finish_loop): Dito.
2098
0feb4de1 20992014-11-10 Paolo Carlini <paolo.carlini@oracle.com>
2100
2101 * c-typeck.c (build_binary_op): Use OPT_Wshift_count_negative and
2102 OPT_Wshift_count_overflow in the warnings.
2103
a3fec48a 21042014-10-30 Marek Polacek <polacek@redhat.com>
2105
2106 * c-objc-common.c (c_tree_printer) <case 'T'>: For a typedef name,
2107 print the stripped version as well, if they're not the same.
2108
3754d046 21092014-10-29 Richard Sandiford <richard.sandiford@arm.com>
2110
2111 * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from
2112 machine_mode.
2113
1140c305 21142014-10-28 Andrew MacLeod <amacleod@redhat.com>
2115
2116 * c-decl.c: Adjust include files.
2117 * c-parser.c: Ditto.
2118
ab103e33 21192014-10-27 Phil Muldoon <pmuldoon@redhat.com>
2120 Tom Tromey <tromey@redhat.com>
2121
2122 * c-tree.h (enum c_oracle_request): New.
2123 (c_binding_oracle_function): New typedef.
2124 (c_binding_oracle, c_pushtag, c_bind): Declare.
2125 * c-decl.c (c_binding_oracle): New global.
2126 (I_SYMBOL_CHECKED): New macro.
2127 (i_symbol_binding): New function.
2128 (I_SYMBOL_BINDING, I_SYMBOL_DECL): Redefine.
2129 (I_TAG_CHECKED): New macro.
2130 (i_tag_binding): New function.
2131 (I_TAG_BINDING, I_TAG_DECL): Redefine.
2132 (I_LABEL_CHECKED): New macro.
2133 (i_label_binding): New function.
2134 (I_LABEL_BINDING, I_LABEL_DECL): Redefine.
2135 (c_print_identifier): Save and restore c_binding_oracle.
2136 (c_pushtag, c_bind): New functions.
2137
94ea8568 21382014-10-27 Andrew MacLeod <amacleod@redhat.com>
2139
2140 * c-typeck.c: Adjust include files.
2141
32ecf960 21422014-10-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
2143
2144 PR c++/53061
2145 * c-objc-common.c (c_objc_common_init): Do not do diagnostics
2146 initialization here...
2147 (c_initialize_diagnostics): ... but here. Set defaults after
2148 building pretty-printer.
2149
2981340f 21502014-10-23 Marek Polacek <polacek@redhat.com>
2151
2152 PR c/63626
2153 * c-decl.c (pop_scope): Don't print warning in external_scope.
2154
d303aeaf 21552014-10-19 Marek Polacek <polacek@redhat.com>
2156
2157 PR c/63567
2158 * c-typeck.c (output_init_element): Allow initializing objects with
2159 static storage duration with compound literals even in C99 and add
2160 pedwarn for it.
2161
bccf97da 21622014-10-17 Marek Polacek <polacek@redhat.com>
2163
2164 PR c/63567
2165 * c-typeck.c (digest_init): Allow initializing objects with static
2166 storage duration with compound literals even in C99 and add pedwarn
2167 for it.
2168
d9c77450 21692014-10-17 Marek Polacek <polacek@redhat.com>
2170
2171 PR c/63543
2172 * c-tree.h (C_TYPE_ERROR_REPORTED): Define.
2173 * c-typeck.c (build_indirect_ref): Don't print the "dereferencing..."
2174 error multiple times. Print the type.
2175
a2bbd0a7 21762014-10-17 Marek Polacek <polacek@redhat.com>
2177
2178 PR c/63549
2179 * c-typeck.c (build_array_ref): Bail if the index in an incomplete
2180 type.
2181
e610d2b2 21822014-10-17 Marek Polacek <polacek@redhat.com>
2183
2184 * c-decl.c (grokdeclarator): Use OPT_Wimplicit_int unconditionally.
2185 (start_function): Use OPT_Wimplicit_int instead of 0.
2186 (store_parm_decls_oldstyle): Likewise.
2187
6b6e56b6 21882014-10-17 Alan Modra <amodra@gmail.com>
2189
2190 PR middle-end/61848
2191 * c-decl.c (merge_decls): Don't merge section name or tls model
2192 to newdecl symtab node, instead merge to olddecl. Override
2193 existing olddecl section name. Set tls_model for all thread-local
2194 vars, not just OMP thread-private ones. Remove incorrect comment.
2195
a3020f2f 21962014-10-16 Andrew MacLeod <amacleod@redhat.com>
2197
2198 * c-decl.c: Adjust include files.
2199
9f75f026 22002014-10-14 DJ Delorie <dj@redhat.com>
2201
2202 * c-parser.c (c_parse_init): Add RID entries for each __intN.
2203 (c_token_starts_typename): Check all __intN, not just __int128.
2204 (c_token_starts_declspecs): Likewise.
2205 (c_parser_declspecs): Likewise.
2206 (c_parser_attribute_any_word): Likewise.
2207 (c_parser_objc_selector): Likewise.
2208 * c-tree.h (c_typespec_keyword): cts_int128 -> cts_int_n.
2209 (struct c_declspecs): Add int_n_idx field to record *which* __intN
2210 is specified.
2211 * c-decl.c (declspecs_add_type): Check for all __intN, not just
2212 __int128.
2213 (finish_declspecs): Likewise.
2214
4f284d4a 22152014-10-13 Anthony Brandon <anthony.brandon@gmail.com>
2216
2217 * c-parser.c (c_parser_all_labels): New function to replace
2218 the duplicate code.
2219 (c_parser_statement): Call the new function.
2220
61a892dc 22212014-10-09 Marek Polacek <polacek@redhat.com>
2222
2223 PR c/63480
2224 * c-typeck.c (pop_init_level): Don't warn about initializing
2225 with { }.
2226
4e888fd9 22272014-10-07 Marek Polacek <polacek@redhat.com>
2228
2229 PR c/59717
2230 * c-decl.c (header_for_builtin_fn): New function.
2231 (implicitly_declare): Suggest which header to include.
2232
224bdd51 22332014-10-07 Marek Polacek <polacek@redhat.com>
2234
2235 * c-convert.c (convert): Use error_operand_p.
2236 * c-typeck.c (require_complete_type): Likewise.
2237 (really_atomic_lvalue): Likewise.
2238 (digest_init): Likewise.
2239 (handle_omp_array_sections_1): Likewise.
2240
a2bc79db 22412014-10-03 Marek Polacek <polacek@redhat.com>
2242
2243 PR c/63453
2244 * c-decl.c (pop_scope): Don't warn about "inline function declared
2245 but never defined" for functions marked with gnu_inline attribute.
2246
4fc4088b 22472014-09-25 Jakub Jelinek <jakub@redhat.com>
2248
2249 PR c++/63249
2250 * c-parser.c (c_parser_omp_variable_list): Call mark_exp_read
2251 on low_bound and length.
2252
5213d6c9 22532014-09-24 Marek Polacek <polacek@redhat.com>
2254
2255 PR c/61405
2256 PR c/53874
2257 * c-parser.c: Don't define CPP_KEYWORD.
2258 (c_parser_switch_statement): Pass original type to c_finish_case.
2259 * c-tree.h (c_finish_case): Update declaration.
2260 * c-typeck.c (c_finish_case): Add TYPE parameter. Pass it
2261 conditionally to c_do_switch_warnings.
2262
6ea2b1bc 22632014-09-03 Marek Polacek <polacek@redhat.com>
2264
2265 PR c/62024
2266 * c-parser.c (c_parser_static_assert_declaration_no_semi): Strip no-op
2267 conversions.
2268
40750995 22692014-09-02 Jakub Jelinek <jakub@redhat.com>
2270 Balaji V. Iyer <balaji.v.iyer@intel.com>
2271 Igor Zamyatin <igor.zamyatin@intel.com>
2272
2273 * c-parser.c (c_parser_cilk_for): New function.
2274 (c_parser_cilk_grainsize): Likewise.
2275 (c_get_temp_regvar): Likewise.
2276 (c_parser_statement_after_labels): Added RID_CILK_FOR case.
2277 (c_parser_pragma): Added PRAGMA_CILK_GRAINSIZE case.
2278 (c_parser_omp_for_loop): Added CILK_FOR and CILK_SIMD checks.
2279 * c-typeck.c (c_finish_omp_clauses): Added OMP_CLAUSE__CILK_FOR_COUNT_
2280 case.
2281
8c583613 22822014-08-27 Chen Gang <gang.chen.5i5j@gmail.com>
2283
2284 * c-aux-info.c (gen_type): Resize 'buff' from 10 to 23 bytes,
2285 with using HOST_WIDE_INT without truncation to 'int'
2286
dc6229e8 22872014-08-22 Marek Polacek <polacek@redhat.com>
2288
2289 PR c++/62199
2290 * c-typeck.c (parser_build_binary_op): Adjust call to
2291 warn_logical_not_parentheses.
2292
5fdda74b 22932014-08-22 Igor Zamyatin <igor.zamyatin@intel.com>
2294
2295 PR other/62008
2296 * c-parser.c (c_parser_array_notation): Check for correct
2297 type of an array added.
2298
78bf4156 22992014-08-19 Marek Polacek <polacek@redhat.com>
2300
2301 PR c++/62153
2302 * c-typeck.c (build_binary_op): If either operand of a comparison
2303 is a boolean expression, call maybe_warn_bool_compare.
2304
005b8fe7 23052014-08-19 Patrick Palka <ppalka@gcc.gnu.org>
2306
2307 PR c/45584
2308 * c-typeck.c (build_c_cast): Do a conversion even when the
2309 TYPE_MAIN_VARIANTs are the same.
2310
508ea33a 23112014-08-19 Marek Polacek <polacek@redhat.com>
2312
2313 * c-decl.c (diagnose_mismatched_decls): Unconditionally call
2314 pedwarn_c99 instead of pedwarn.
2315 (grokfield): Likewise.
2316 (warn_defaults_to): New function.
2317 (grokdeclarator): Call warn_defaults_to instead of pedwarn_c99.
2318 Unconditionally call pedwarn_c99 instead of pedwarn.
2319 (start_function): Call warn_defaults_to instead of pedwarn_c99.
2320 (declspecs_add_scspec): Call pedwarn_c99 instead of pedwarn, don't
2321 check flag_isoc11 before.
2322 * c-errors.c (pedwarn_c99): Change the return type to bool.
2323 Handle -Wc99-c11-compat.
2324 * c-parser.c (disable_extension_diagnostics): Handle
2325 warn_c99_c11_compat.
2326 (restore_extension_diagnostics): Likewise.
2327 (c_parser_static_assert_declaration_no_semi): Call pedwarn_c99
2328 instead of pedwarn, don't check flag_isoc11 before.
2329 (c_parser_declspecs): Likewise.
2330 (c_parser_alignas_specifier): Likewise.
2331 (c_parser_alignof_expression): Likewise.
2332 (c_parser_generic_selection): Likewise.
2333 * c-tree.h (pedwarn_c99): Update declaration.
2334 * c-typeck.c (c_finish_return): Call pedwarn or warning_at instead
2335 of pedwarn_c99.
2336
806fe15e 23372014-08-19 Marek Polacek <polacek@redhat.com>
2338
2339 * c-decl.c (warn_variable_length_array): Pass OPT_Wvla unconditionally
2340 to pedwarn_c90.
2341 * c-errors.c: Include "opts.h".
2342 (pedwarn_c90): Rewrite to handle -Wno-c90-c99-compat better.
2343 * c-parser.c (disable_extension_diagnostics): Handle negative value
2344 of warn_c90_c99_compat, too.
2345 (restore_extension_diagnostics): Likewise.
2346 (c_parser_compound_statement_nostart): Pass
2347 OPT_Wdeclaration_after_statement unconditionally to pedwarn_c90.
2348
89868e45 23492014-08-12 Marek Polacek <polacek@redhat.com>
2350
2351 * c-parser.c (c_parser_postfix_expression) <case RID_FUNCTION_NAME>:
2352 Add pedwarn.
2353 (c_parser_postfix_expression) <case RID_PRETTY_FUNCTION_NAME>:
2354 Likewise.
2355 (c_parser_postfix_expression) <case RID_C99_FUNCTION_NAME>: Likewise.
2356
92a44a68 23572014-08-10 Marek Polacek <polacek@redhat.com>
890c2e2f 2358
2359 PR c/51849
2360 * c-decl.c (build_array_declarator): Remove check for !flag_isoc99.
2361 Call pedwarn_c90 instead of pedwarn.
2362 (check_bitfield_type_and_width): Likewise.
2363 (declspecs_add_qual): Likewise.
2364 (declspecs_add_type): Likewise.
2365 (warn_variable_length_array): Unify function for -pedantic and -Wvla.
2366 Adjust to only call pedwarn_c90.
2367 (grokdeclarator): Remove pedantic && !flag_isoc99 check. Call
2368 pedwarn_c90 instead of pedwarn.
2369 * c-errors.c (pedwarn_c90): Handle -Wc90-c99-compat.
2370 * c-parser.c (disable_extension_diagnostics): Handle
2371 warn_c90_c99_compat.
2372 (restore_extension_diagnostics): Likewise.
2373 (c_parser_enum_specifier): Remove check for !flag_isoc99. Call
2374 pedwarn_c90 instead of pedwarn.
2375 (c_parser_initelt): Likewise.
2376 (c_parser_postfix_expression): Likewise.
2377 (c_parser_postfix_expression_after_paren_type): Likewise.
2378 (c_parser_compound_statement_nostart): Remove check for !flag_isoc99.
2379 * c-tree.h: Fix formatting.
2380 * c-typeck.c (build_array_ref): Remove check for !flag_isoc99. Call
2381 pedwarn_c90 instead of pedwarn.
2382
7149db5f 23832014-08-07 Trevor Saunders <tsaunders@mozilla.com>
2384
2385 * c-typeck.c: Remove include of pointer-set.h.
2386
1c75251e 23872014-08-07 Marek Polacek <polacek@redhat.com>
2388
2389 * c-typeck.c (pointer_diff): Remove P - (P + CST) optimization.
2390
06ecf488 23912014-08-02 Trevor Saunders <tsaunders@mozilla.com>
2392
2393 * c-typeck.c: Use hash_map instead of pointer_map.
2394
431205b7 23952014-08-02 Trevor Saunders <tsaunders@mozilla.com>
2396
2397 * c-decl.c: Use hash_set instead of pointer_set.
2398
3394c80c 23992014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
2400
2401 PR middle-end/61455
2402 * c-array-notation.c (expand_array_notations): Handling
2403 of DECL_EXPR added.
2404
f22a2cb7 24052014-07-31 Marc Glisse <marc.glisse@inria.fr>
2406
2407 PR c++/60517
2408 * c-typeck.c (c_finish_return): Return 0 instead of the address of
2409 a local variable.
2410
74691f46 24112014-07-30 Tom Tromey <tromey@redhat.com>
2412
2413 * c-typeck.c (struct constructor_stack) <designator_depth>: New
2414 field.
2415 (really_start_incremental_init, push_init_level): Initialize
2416 designator_depth.
2417 (pop_init_level): Set global designator_depth.
2418 (process_init_element): Check for designated_init attribute.
2419
f9767fb6 24202014-07-20 Marek Polacek <polacek@redhat.com>
2421
2422 PR c/61852
2423 * c-decl.c (implicit_decl_warning): Add location_t parameter. Use it.
2424 (implicitly_declare): Pass location to implicit_decl_warning.
2425
305d96bc 24262014-07-14 Jakub Jelinek <jakub@redhat.com>
2427
2428 PR middle-end/61294
2429 * c-parser.c (c_parser_expr_list): Add new argument literal_zero_mask.
2430 If non-NULL, call c_parser_check_literal_zero.
2431 (c_parser_check_literal_zero): New function.
2432 (c_parser_postfix_expression_after_primary): Adjust
2433 c_parser_expr_list caller, handle -Wmemset-transposed-args.
2434
87d59e72 24352014-07-06 Marek Polacek <polacek@redhat.com>
2436
2437 PR c/6940
2438 * c-decl.c (grokdeclarator): Set C_ARRAY_PARAMETER.
2439 * c-tree.h (C_ARRAY_PARAMETER): Define.
2440 * c-typeck.c (c_expr_sizeof_expr): Warn when using sizeof on an array
2441 function parameter.
2442
752098c8 24432014-07-02 Jan Hubicka <hubicka@ucw.cz>
92a44a68 2444 Chen Gang <gang.chen.5i5j@gmail.com>
752098c8 2445
2446 * c-decl.c (duplicate_decls): CLear DECL_STRUCT_FUNCTION before
2447 releasing symbol.
2448
1207866e 24492014-07-01 Marek Polacek <polacek@redhat.com>
2450
2451 * c-typeck.c (convert_for_assignment): Pass OPT_Wint_conversion
2452 instead of 0 to WARN_FOR_ASSIGNMENT.
2453
7a6bbb76 24542014-07-01 Marek Polacek <polacek@redhat.com>
2455
2456 PR c/58286
2457 * c-typeck.c (convert_for_assignment): Pass
2458 OPT_Wincompatible_pointer_types instead of 0 to WARN_FOR_ASSIGNMENT.
2459
70575064 24602014-06-30 Marek Polacek <polacek@redhat.com>
2461
2462 * c-decl.c (grokdeclarator): Don't instrument VLAs if the function
2463 has no_sanitize_undefined attribute.
2464
4879e4cf 24652014-06-30 Igor Zamyatin <igor.zamyatin@intel.com>
2466
2467 PR middle-end/57541
2468 * c-array-notation.c (fix_builtin_array_notation_fn):
2469 Check for 0 arguments in builtin call. Check that bultin argument is
2470 correct.
2471 * c-parser.c (c_parser_array_notation): Check for incorrect initial
2472 index.
2473
45c5b823 24742014-06-27 Sebastian Huber <sebastian.huber@embedded-brains.de>
2475
2476 * c-parser.c (c_parser_declaration_or_fndef): Discard all type
2477 qualifiers in __auto_type for atomic types.
2478 (c_parser_typeof_specifier): Discard all type qualifiers in
2479 __typeof__ for atomic types.
2480
430b73ee 24812014-06-25 Marek Polacek <polacek@redhat.com>
2482
2483 PR c/61162
2484 * c-parser.c (c_parser_statement_after_labels): Pass the location of
2485 the return expression to c_finish_return.
2486
9580cb79 24872014-06-25 Jakub Jelinek <jakub@redhat.com>
2488
2489 * c-typeck.c (c_finish_omp_clauses): Make sure
2490 OMP_CLAUSE_LINEAR_STEP has correct type.
2491
c1f445d2 24922014-06-24 Trevor Saunders <tsaunders@mozilla.com>
2493
2494 * c-decl.c: Adjust.
2495
e471cc6f 24962014-06-24 Jakub Jelinek <jakub@redhat.com>
2497
2498 * c-parser.c (c_parser_omp_for_loop): For
2499 #pragma omp parallel for simd move lastprivate clause from parallel
2500 to for rather than simd.
2501
499b7390 25022014-06-23 Marek Polacek <polacek@redhat.com>
2503
2504 * c-typeck.c (parser_build_binary_op): Don't call
2505 warn_logical_not_parentheses if the RHS is TRUTH_NOT_EXPR.
2506
5e68df57 25072014-06-15 Jan Hubicka <hubicka@ucw.cz>
2508
2509 * c-parser.c (c_parser_omp_threadprivate): Likewise.
2510 * c-decl.c (merge_decls): Likewise.
2511
064b0d02 25122014-06-09 Marek Polacek <polacek@redhat.com>
2513
2514 PR c/36446
2515 * c-typeck.c (error_init): Call inform instead of error_at.
2516 (pedwarn_init): Call inform instead of pedwarn.
2517 (warning_init): Call inform instead of warning_at.
2518
71e19e54 25192014-06-07 Jan Hubicka <hubicka@ucw.cz>
2520
2521 * c-decl.c (merge_decls): Use set_decl_section_name.
2522 (duplicate_decls): Remove node if it exists.
2523
95cdf3fd 25242014-06-05 S. Gilles <sgilles@terpmail.umd.edu>
2525
2526 PR c/53119
2527 * c-typeck.c (push_init_level, process_init_element,
2528 pop_init_level): Correct check for zero initialization, move
2529 missing brace warning to respect zero initialization.
2530
a07f86a6 25312014-06-05 Marek Polacek <polacek@redhat.com>
2532
2533 PR c/56724
2534 * c-typeck.c (convert_for_assignment): Use expr_loc for ic_argpass.
2535
32dc1512 25362014-06-05 Marek Polacek <polacek@redhat.com>
2537
2538 PR c/49706
2539 * c-typeck.c (parser_build_binary_op): Warn when logical not is used
2540 on the left hand side operand of a comparison.
2541
64cf1262 25422014-06-05 Marek Polacek <polacek@redhat.com>
2543
2544 PR c/48062
2545 * c-decl.c (warn_if_shadowing): Call inform instead of warning_at.
2546 Print note only if the warning was printed.
2547
071f6d39 25482014-06-04 Igor Zamyatin <igor.zamyatin@intel.com>
2549
2550 PR c/58942
2551 * c-array-notation.c (fix_builtin_array_notation_fn): Handle the case
2552 with a pointer.
2553
c69ec07d 25542014-06-03 Marek Polacek <polacek@redhat.com>
2555
2556 PR c/60439
2557 * c-parser.c (c_parser_switch_statement): Pass explicit_cast_p to
2558 c_start_case.
2559 * c-tree.h (c_start_case): Update.
2560 * c-typeck.c (c_start_case): Add new boolean parameter. Warn if
2561 switch condition has boolean value.
2562
f7715905 25632014-06-02 Andrew MacLeod <amacleod@redhat.com>
2564
2565 * c-decl.c: Include builtins.h.
2566 * c-parser.c: Likewise.
2567
dcfff6f9 25682014-05-27 Marek Polacek <polacek@redhat.com>
2569
2570 PR c/56724
2571 * c-typeck.c (convert_arguments): Get location of a parameter. Change
2572 error and warning calls to error_at and warning_at. Pass location of
2573 a parameter to it. Call warning_at with OPT_Wtraditional_conversion.
2574 (convert_for_assignment): Add parameter to WARN_FOR_ASSIGNMENT and
2575 WARN_FOR_QUALIFIERS. Pass expr_loc to those.
2576
c048c42c 25772014-05-26 Igor Zamyatin <igor.zamyatin@intel.com>
2578
2579 PR c/61191
2580 * c-array-notation.c (fix_builtin_array_notation_fn): Check invalid
2581 function parameters.
2582
8c016392 25832014-05-23 Jan Hubicka <hubicka@ucw.cz>
2584
2585 * c-decl.c (merge_decls): Preserve symtab node pointers.
2586 (duplicate_decls): Free new decl.
2587
184a718f 25882014-05-23 Thomas Schwinge <thomas@codesourcery.com>
2589
6ce915ef 2590 * c-typeck.c (c_finish_omp_clauses): Remove duplicated variable
2591 initialization.
2592
184a718f 2593 * c-parser.c (c_parser_omp_target): Return bool values.
2594
22ac3f78 25952014-05-22 Thomas Schwinge <thomas@codesourcery.com>
2596
2597 * c-parser.c (c_parser_omp_clause_thread_limit): Rename
2598 num_teams_loc variable to num_thread_limit_loc.
2599
3ab4693e 26002014-05-21 Richard Sandiford <rsandifo@linux.vnet.ibm.com>
2601
2602 * c-array-notation.c (expand_array_notations): Use void_node
2603 instead of void_zero_node.
2604
25a27413 26052014-05-17 Trevor Saunders <tsaunders@mozilla.com>
2606
2607 * c-decl.c (finish_struct): Adjust.
2608 (finish_enum): Likewise.
2609 (bind): Adjust.
2610 (record_inline_static): Likewise.
2611 (push_scope): Likewise.
2612 (make_label): Likewise.
2613 (lookup_label_for_goto): Likewise.
2614 (finish_struct): Likewise.
2615 (finish_enum): Likewise.
2616 (store_parm_decls): Likewise.
2617 (c_push_function_context): Likewise.
2618 * c-lang.h: Remove usage of variable_size gty attribute.
2619 * c-parser.c (c_parse_init): Adjust.
2620 (c_parse_file): Likewise.
2621
172b8440 26222014-05-13 Marek Polacek <polacek@redhat.com>
2623
2624 PR c/61162
2625 * c-typeck.c (convert_for_assignment): Pass location to
2626 WARN_FOR_ASSIGNMENT instead of input_location.
2627
c9e51d25 26282014-05-10 Marek Polacek <polacek@redhat.com>
2629
2630 * c-parser.c (c_parser_declaration_or_fndef): Pass init_loc to
2631 maybe_warn_string_init.
2632 (c_parser_postfix_expression_after_paren_type): Pass type_loc to
2633 maybe_warn_string_init.
2634 * c-tree.h (maybe_warn_string_init): Update declaration.
2635 * c-typeck.c (maybe_warn_string_init): Add location parameter.
2636 Call pedwarn_init with loc instead of with input_location.
2637 (digest_init): Pass init_loc to maybe_warn_string_init.
2638 (pop_init_level): Call pedwarn_init with loc instead of with
2639 input_location.
2640 (set_init_index): Likewise.
2641 (process_init_element): Likewise.
2642
53de1631 26432014-05-09 Marek Polacek <polacek@redhat.com>
2644
2645 PR c/61096
2646 * c-parser.c (c_parser_braced_init): Pass brace_loc to push_init_level.
2647 (c_parser_initelt): Pass location to set_init_label. Pass array index
2648 location to set_init_index.
2649 * c-tree.h (push_init_level): Update declaration.
2650 (pop_init_level): Likewise.
2651 (set_init_index): Likewise.
2652 (set_init_label): Likewise.
2653 * c-typeck.c (error_init): Add location parameter. Call error_at
2654 instead of error.
2655 (digest_init): Pass init_loc to error_init.
2656 (really_start_incremental_init):
2657 (push_init_level): Add location parameter. Pass loc to pop_init_level
2658 and error_init.
2659 (pop_init_level): Likewise.
2660 (set_designator): Add location parameter. Pass loc to pop_init_level,
2661 push_init_level, and error_init.
2662 (set_init_index): Add location parameter. Pass loc to error_init and
2663 set_designator.
2664 (set_init_label): Likewise.
2665 (output_init_element): Pass loc to error_init.
2666 (process_init_element): Pass loc to error_init, pop_init_level,
2667 pedwarn_init, and push_init_level.
2668
3e5a8b00 26692014-05-09 Marek Polacek <polacek@redhat.com>
2670
2671 PR c/50459
2672 * c-parser.c (c_parser_attributes): Parse the arguments as an
2673 expression-list if the attribute takes identifier.
2674
c2c4ae8d 26752014-05-08 Marek Polacek <polacek@redhat.com>
2676
2677 PR c/61053
2678 * c-decl.c (grokdeclarator): Use min_align_of_type instead of
2679 TYPE_ALIGN_UNIT.
2680
2026249a 26812014-05-08 Marek Polacek <polacek@redhat.com>
2682
2683 PR c/61077
2684 * c-decl.c (start_function): Warn for _Atomic-qualified return type
2685 of main.
2686
960d5a55 26872014-05-06 Kenneth Zadeck <zadeck@naturalbridge.com>
2688 Mike Stump <mikestump@comcast.net>
2689 Richard Sandiford <rdsandiford@googlemail.com>
2690
2691 * c-decl.c (check_bitfield_type_and_width): Use TYPE_SIGN.
2692 (finish_enum): Use wide-int interfaces.
2693 * c-parser.c (c_parser_cilk_clause_vectorlength): Likewise.
2694 * c-typeck.c (build_c_cast): Likewise.
2695 (set_nonincremental_init_from_string): Likewise.
2696 (c_tree_equal): Likewise.
2697
e0e14cbd 26982014-05-02 Marek Polacek <polacek@redhat.com>
2699
2700 PR c/25801
2701 * c-typeck.c (c_size_in_bytes): Update comment. Don't call error.
2702 Return size_one_node when the type is not complete.
2703 (pointer_diff): Remove comment.
2704 (build_unary_op): Improve error messages.
2705
27ff10cb 27062014-05-02 Marek Polacek <polacek@redhat.com>
2707
2708 * c-typeck.c (c_finish_return): Separate warning_at calls.
2709
68410ce9 27102014-05-02 Marek Polacek <polacek@redhat.com>
2711
2712 * c-tree.h (error_init): Remove declaration.
2713 (pedwarn_init): Likewise.
2714 * c-typeck.c (error_init): Make static and move above.
2715 (pedwarn_init): Likewise.
2716 (warning_init): Move above.
2717 (maybe_warn_string_init): Likewise.
2718
e8e27117 27192014-05-01 Jeff Law <law@redhat.com>
2720
2721 Revert:
2722
2723 2014-04-24 Prathamesh Kulkarni <bilbotheelffriend@gmail.com>
2724 * c-parser.c (c_parser_sizeof_expression): Reorganize slightly to
2725 avoid goto.
2726
971df357 27272014-05-02 Marek Polacek <polacek@redhat.com>
2728
2729 PR c/60784
2730 * c-typeck.c (push_init_level): Set constructor_designated to
2731 p->designated for structures.
2732
de548fe5 27332014-05-01 Marek Polacek <polacek@redhat.com>
2734
2735 PR c/60915
2736 * c-parser.c (c_parser_declaration_or_fndef): Give better error if
2737 function-definition has an attribute after the declarator.
2738
053a0ded 27392014-05-01 Marek Polacek <polacek@redhat.com>
2740
2741 PR c/60257
2742 * c-typeck.c (warning_init): Add location_t parameter. Call
2743 warning_at instead of warning.
2744 (push_init_level): Pass input_location to warning_init.
2745 (add_pending_init): Add location_t parameter. Pass loc to
2746 warning_init.
2747 (set_nonincremental_init): Pass input_location to add_pending_init.
2748 (set_nonincremental_init_from_string): Likewise.
2749 (output_init_element): Pass loc to warning_init and to
2750 add_pending_init.
2751
694296f2 27522014-05-01 Marek Polacek <polacek@redhat.com>
2753
2754 PR c/43395
2755 * c-typeck.c (c_finish_return): Distinguish between label and variable
2756 when warning about returning local address.
2757
86bbd7f9 27582014-05-01 Marek Polacek <polacek@redhat.com>
2759
2760 PR c/29467
2761 * c-decl.c (declspecs_add_type): Pedwarn if boolean types are used
2762 in C89 mode.
2763
e4ab2ef3 27642014-05-01 Marek Polacek <polacek@redhat.com>
2765
2766 PR c/43245
2767 * c-typeck.c (convert_for_assignment): Pass OPT_Wdiscarded_qualifiers
2768 instead of 0 to WARN_FOR_QUALIFIERS.
2769
ca3999cb 27702014-05-01 Marek Polacek <polacek@redhat.com>
2771
2772 PR c/56989
2773 * c-typeck.c (default_conversion): Use better location for
2774 error call.
2775
52cc0072 27762014-04-30 Marek Polacek <polacek@redhat.com>
2777
2778 * c-typeck.c (build_binary_op): Call ubsan_instrument_division
2779 also when SANITIZE_FLOAT_DIVIDE is on.
2780
af379dd3 27812014-04-30 Marek Polacek <polacek@redhat.com>
2782
2783 PR c/60139
2784 * c-typeck.c (output_init_element): Pass OPT_Wpedantic to pedwarn
2785 and pedwarn_init. Use loc insted of input_location.
2786
b069c2a0 27872014-04-30 Marek Polacek <polacek@redhat.com>
2788
2789 PR c/60351
2790 * c-typeck.c (build_binary_op): Use location when warning about
2791 shift count.
2792
4a026b48 27932014-04-25 Marek Polacek <polacek@redhat.com>
2794
2795 PR c/18079
2796 * c-decl.c (diagnose_mismatched_decls): Warn for mismatched
2797 always_inline/noinline and hot/cold attributes.
2798
adc93f31 27992014-04-25 Marek Polacek <polacek@redhat.com>
2800
2801 PR c/60114
2802 * c-parser.c (c_parser_initelt): Pass input_location to
2803 process_init_element.
2804 (c_parser_initval): Pass loc to process_init_element.
2805 * c-tree.h (process_init_element): Adjust declaration.
2806 * c-typeck.c (push_init_level): Pass input_location to
2807 process_init_element.
2808 (pop_init_level): Likewise.
2809 (set_designator): Likewise.
2810 (output_init_element): Add location_t parameter. Pass loc to
2811 digest_init.
2812 (output_pending_init_elements): Pass input_location to
2813 output_init_element.
2814 (process_init_element): Add location_t parameter. Pass loc to
2815 output_init_element.
2816
e1029911 28172014-04-24 Jakub Jelinek <jakub@redhat.com>
2818
2819 * c-parser.c (c_parser_omp_atomic): Allow seq_cst before
2820 atomic-clause, allow comma in between atomic-clause and
2821 seq_cst.
2822
9f0a7bc6 28232014-04-22 Jakub Jelinek <jakub@redhat.com>
2824
2825 PR c/59073
2826 * c-parser.c (c_parser_omp_parallel): If c_parser_omp_for
2827 fails, don't set OM_PARALLEL_COMBINED and return NULL.
2828
094da06d 28292014-04-12 Igor Zamyatin <igor.zamyatin@intel.com>
2830
2831 PR middle-end/60469
2832 * c-array-notation.c (fix_builtin_array_notation_fn): Use
2833 create_tmp_var instead build_decl for creating temps.
2834 (build_array_notation_expr): Likewise.
2835 (fix_conditional_array_notations_1): Likewise.
2836 (fix_array_notation_expr): Likewise.
2837 (fix_array_notation_call_expr): Likewise.
2838
5a672e62 28392014-03-28 Jakub Jelinek <jakub@redhat.com>
2840
2841 PR c++/60689
2842 * c-tree.h (c_build_function_call_vec): New prototype.
2843 * c-typeck.c (build_function_call_vec): Don't call
2844 resolve_overloaded_builtin here.
2845 (c_build_function_call_vec): New wrapper function around
2846 build_function_call_vec. Call resolve_overloaded_builtin here.
2847 (convert_lvalue_to_rvalue, build_function_call, build_atomic_assign):
2848 Call c_build_function_call_vec instead of build_function_call_vec.
2849 * c-parser.c (c_parser_postfix_expression_after_primary): Likewise.
2850 * c-decl.c (finish_decl): Likewise.
2851
f40f5e0e 28522014-03-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
2853
2854 PR c/55383
2855 * c-typeck.c: Use correct format string in cast-qual warning
2856
9ec099a3 28572014-03-07 Thomas Schwinge <thomas@codesourcery.com>
2858
2859 * c-decl.c (c_decl_attributes): Use
2860 lang_hooks.types.omp_mappable_type.
2861 * c-typeck.c (c_finish_omp_clauses): Likewise.
2862
3bfdc94f 28632014-03-06 Marek Polacek <polacek@redhat.com>
2864
2865 PR c/60197
2866 * c-typeck.c (c_finish_return): Call contains_cilk_spawn_stmt instead
2867 of checking tree code.
2868
8f1128f8 28692014-02-19 Prathamesh Kulkarni <bilbotheelffriend@gmail.com>
2870
2871 * c-parser.c (c_parser_declspecs): Replace call to error by error_at.
2872 (c_parser_parameter_declaration): Likewise.
2873
977b1853 28742014-02-19 Marek Polacek <polacek@redhat.com>
2875
2876 PR c/60195
2877 * c-typeck.c (convert_lvalue_to_rvalue): Set TREE_NO_WARNING on tmp.
2878 Call mark_exp_read on exp.value.
2879 (build_atomic_assign): Set TREE_NO_WARNING on val and old. Set
2880 TREE_ADDRESSABLE on old instead of val.
2881 (emit_side_effect_warnings): Warn only if RHS has !TREE_NO_WARNING.
2882
825cd6ef 28832014-02-07 Prathamesh Kulkarni <bilbotheelffriend@gmail.com>
2884
2885 * c-parser.c (c_parser_get_builtin_args): Replace calls to
2886 C_EXPR_APPEND by vec_safe_push.
2887 * c-tree.h (C_EXPR_APPEND): Remove.
2888
ec761d5a 28892014-01-31 Marek Polacek <polacek@redhat.com>
2890
2891 PR c/59963
2892 * c-typeck.c (convert_lvalue_to_rvalue): Pass vNULL to
2893 build_function_call_vec.
2894 (build_function_call): Likewise.
2895 (build_atomic_assign): Likewise.
2896 (build_function_call_vec): Add arg_loc parameter. Use it.
2897 (convert_arguments): Likewise.
2898 (convert_for_assignment): Rename rhs_loc to expr_loc.
2899 * c-parser.c (c_parser_attributes): Pass NULL to c_parser_expr_list.
2900 (c_parser_objc_keywordexpr): Likewise.
2901 (c_parser_postfix_expression_after_primary): Call
2902 build_function_call_vec with expr_loc rather than op_loc.
2903 Call c_parser_expr_list to fill arg_loc. Pass arg_loc to
2904 build_function_call_vec.
2905 (c_parser_expr_list): Add locations parameter. Fill it with locations
2906 of function arguments.
2907 * c-decl.c (finish_decl): Pass vNULL to build_function_call_vec.
2908
22a75734 29092014-01-30 Marek Polacek <polacek@redhat.com>
2910
2911 PR c/59940
2912 * c-typeck.c (build_function_call_vec): Use loc parameter.
2913 (convert_arguments): Add location parameter. Use it.
2914 (ep_convert_and_check): Likewise.
2915 (build_atomic_assign): Adjust convert_for_assignment call.
2916 (build_modify_expr): Likewise.
2917 (digest_init): Likewise.
2918 (c_finish_return): Likewise.
2919 (build_conditional_expr): Adjust ep_convert_and_check calls.
2920 (convert_for_assignment): Add rhs_loc parameter. Use it.
2921 (build_binary_op): Adjust convert_and_check and ep_convert_and_check
2922 calls.
2923
29f580ac 29242014-01-30 Richard Biener <rguenther@suse.de>
2925
2926 PR c/59905
2927 * c-typeck.c (build_function_call_vec): Do not replace calls
2928 to a function via an incompatible type with a runtime abort.
2929
a89e6c15 29302014-01-24 Balaji V. Iyer <balaji.v.iyer@intel.com>
2931
2932 * c-parser.c (c_parser_declaration_or_fndef): Replaced
2933 flag_enable_cilkplus with flag_cilkplus.
2934 (c_parser_direct_declarator_inner): Likewise.
2935 (c_parser_attribute_any_word): Likewise.
2936 (c_parser_attributes): Likewise.
2937 (c_parser_compound_statement): Likewise.
2938 (c_parser_statement_after_labels): Likewise.
2939 (c_parser_if_statement): Likewise.
2940 (c_parser_switch_statement): Likewise.
2941 (c_parser_do_statement): Likewise.
2942 (c_parser_for_statement): Likewise.
2943 (c_parser_unary_expression): Likewise.
2944 (c_parser_postfix_expression): Likewise.
2945 (c_parser_postfix_expression_after_primary): Likewise.
2946 (c_parser_postfix_expression_after_primary): Likewise.
2947 (c_parser_omp_clause_name): Likewise.
2948 (c_finish_omp_declare_simd): Likewise.
2949 (c_parser_cilk_verify_simd): Likewise.
2950 * c-typeck.c (build_array_ref): Likewise.
2951 (build_function_call_vec): Likewise.
2952 (convert_arguments): Likewise.
2953 (build_compound_expr): Likewise.
2954 (c_finish_return): Likewise.
2955 (c_finish_if_stmt): Likewise.
2956 (c_finish_loop): Likewise.
2957 (build_binary_op): Likewise.
2958
2623625f 29592014-01-23 Marek Polacek <polacek@redhat.com>
2960
2961 PR c/59846
2962 * c-typeck.c (parser_build_binary_op): Use location instead of
2963 input_location.
2964 (build_binary_op): Pass location to shorten_compare.
2965
46da3601 29662014-01-23 Marek Polacek <polacek@redhat.com>
2967
2968 PR c/58346
2969 * c-typeck.c (pointer_diff): Give an error on arithmetic on pointer to
2970 an empty aggregate.
2971
9a9db3c1 29722014-01-23 Marek Polacek <polacek@redhat.com>
2973
2974 PR c/59871
2975 * c-typeck.c (build_compound_expr): Warn even for right-hand operand
2976 of a comma expression.
2977 (emit_side_effect_warnings): Likewise.
2978
69c9b607 29792014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com>
2980
2981 PR c/59825
2982 * c-array-notation.c (expand_array_notation_exprs): Rewrote this
2983 function to use walk_tree and moved a lot of its functionality to
2984 expand_array_notations.
2985 (expand_array_notations): New function.
2986
7e005ab5 29872014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com>
2988
2989 * c-parser.c (c_finish_omp_declare_simd): Made "cilk simd function"
2990 attribute an attribute without value.
2991
d6779b5f 29922014-01-23 Jakub Jelinek <jakub@redhat.com>
2993
2994 PR middle-end/58809
2995 * c-typeck.c (c_finish_omp_clause): Reject MIN_EXPR, MAX_EXPR,
2996 BIT_AND_EXPR, BIT_IOR_EXPR and BIT_XOR_EXPR on COMPLEX_TYPEs.
2997
ec431042 29982014-01-22 Marek Polacek <polacek@redhat.com>
2999
3000 PR c/59891
3001 * c-typeck.c (build_conditional_expr): Call c_fully_fold instead
3002 of remove_c_maybe_const_expr on op1 and op2.
3003
1248c663 30042014-01-15 Jakub Jelinek <jakub@redhat.com>
3005
3006 PR c/58943
3007 * c-typeck.c (build_modify_expr): For lhs op= rhs, if rhs has side
3008 effects, preevaluate rhs using SAVE_EXPR first.
3009
0bc789fc 30102014-01-09 Balaji V. Iyer <balaji.v.iyer@intel.com>
3011
3012 PR c++/59631
3013 * c-parser.c (c_parser_postfix_expression): Replaced consecutive if
3014 statements with if-elseif statements.
3015
6685d11c 30162014-01-06 Marek Polacek <polacek@redhat.com>
3017
3018 PR c/57773
3019 * c-decl.c (check_bitfield_type_and_width): Warn for implementation
3020 defined bit-field types only in ISO C.
3021
3aea1f79 30222014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
3023
3024 Update copyright years
3025
e4f22041 30262014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
3027
3028 * c-array-notation.c: Use the standard form for the copyright notice.
3029
74acc703 30302013-12-18 Balaji V. Iyer <balaji.v.iyer@intel.com>
3031
3032 * c-parser.c (struct c_parser::cilk_simd_fn_tokens): Added new field.
3033 (c_parser_declaration_or_fndef): Added a check if cilk_simd_fn_tokens
3034 field in parser is not empty. If not-empty, call the function
3035 c_parser_finish_omp_declare_simd.
3036 (c_parser_cilk_clause_vectorlength): Modified function to be shared
3037 between SIMD-enabled functions and #pragma simd. Added new parameter.
3038 (c_parser_cilk_all_clauses): Modified the usage of the function
3039 c_parser_cilk_clause_vectorlength as mentioned above.
3040 (c_parser_cilk_simd_fn_vector_attrs): New function.
3041 (c_finish_cilk_simd_fn_tokens): Likewise.
3042 (is_cilkplus_vector_p): Likewise.
3043 (c_parser_omp_clause_name): Added checking for "vectorlength,"
3044 "nomask," and "mask" strings in clause name.
3045 (c_parser_omp_all_clauses): Added 3 new case statements:
3046 PRAGMA_CILK_CLAUSE_VECTORLENGTH, PRAGMA_CILK_CLAUSE_MASK and
3047 PRAGMA_CILK_CLAUSE_NOMASK.
3048 (c_parser_attributes): Added a cilk_simd_fn_tokens parameter. Added a
3049 check for vector attribute and if so call the function
3050 c_parser_cilk_simd_fn_vector_attrs. Also, when Cilk plus is enabled,
3051 called the function c_finish_cilk_simd_fn_tokens.
3052 (c_finish_omp_declare_simd): Added a check if cilk_simd_fn_tokens in
3053 parser field is non-empty. If so, parse them as you would parse
3054 the omp declare simd pragma.
3055 (c_parser_omp_clause_linear): Added a new bool parm. is_cilk_simd_fn.
3056 Added a check when step is a parameter and flag it as error.
3057 (CILK_SIMD_FN_CLAUSE_MASK): New #define.
3058 (c_parser_cilk_clause_name): Changed pragma_cilk_clause to
3059 pragma_omp_clause.
3060
395dc01c 30612013-12-17 Thomas Schwinge <thomas@codesourcery.com>
3062
3063 * c-parser.c (c_parser_omp_parallel): Fix description.
3064
433e804e 30652013-12-11 Balaji V. Iyer <balaji.v.iyer@intel.com>
3066
3067 * c-objc-common.h (LANG_HOOKS_CILKPLUS_FRAME_CLEANUP): Remove.
3068 (LANG_HOOKS_CILKPLUS_DETECT_SPAWN_AND_UNWRAP): Likewise.
3069 (LANG_HOOKS_CILKPLUS_CILKPLUS_GIMPLIFY_SPAWN): Likewise.
3070 * c-typeck.c (cilk_install_body_with_frame_cleanup): New function.
3071
a179a7dc 30722013-12-04 Joseph Myers <joseph@codesourcery.com>
3073
3074 PR c/52023
3075 * c-parser.c (c_parser_alignas_specifier): Use
3076 c_sizeof_or_alignof_type instead of c_alignof.
3077 (c_parser_alignof_expression): Likewise, with min_alignof
3078 parameter depending on alignof spelling used.
3079
bdf1e3c7 30802013-12-04 Marek Polacek <polacek@redhat.com>
3081
3082 PR c/54113
3083 * c-decl.c (start_function): Don't warn for missing prototype for
3084 inline functions.
3085
05e8f674 30862013-12-03 Marek Polacek <polacek@redhat.com>
3087
3088 PR c/59351
3089 * c-decl.c (build_compound_literal): Allow compound literals with
3090 empty initial value.
3091
39f74d66 30922013-12-02 Joseph Myers <joseph@codesourcery.com>
3093
3094 PR c/58235
3095 * c-typeck.c (build_modify_expr): Diagnose assignment to
3096 expression with array type.
3097
f221adca 30982013-11-29 Joseph Myers <joseph@codesourcery.com>
3099
3100 PR c/42262
3101 * c-typeck.c (process_init_element): Do not treat a string as
3102 initializing a whole array when used with a designator for an
3103 individual element.
3104
75bce827 31052013-11-29 Joseph Myers <joseph@codesourcery.com>
3106
3107 PR c/57574
3108 * c-decl.c (merge_decls): Clear DECL_EXTERNAL for a definition of
3109 an inline function following a static declaration.
3110
dc133326 31112013-11-28 Jakub Jelinek <jakub@redhat.com>
3112
3113 PR c/59310
3114 * c-parser.c (c_parser_omp_target): Copy "#pragma omp target"
3115 to p_name before calling c_parser_omp_teams instead of after.
3116 (c_parser_cilk_simd): Remove wrong ATTRIBUTE_UNUSED from parser
3117 argument. Remove unused p_name variable.
3118
d09768a4 31192013-11-27 Aldy Hernandez <aldyh@redhat.com>
3120 Jakub Jelinek <jakub@redhat.com>
3121
3122 * c-decl.c (c_builtin_function_ext_scope): Avoid binding if
3123 external_scope is NULL.
3124
73fd9cbe 31252013-11-27 Tom de Vries <tom@codesourcery.com>
3126 Marc Glisse <marc.glisse@inria.fr>
3127
3128 PR c++/59032
3129 * c-typeck.c (build_unary_op): Allow vector increment and decrement.
3130
bc61cadb 31312013-11-22 Andrew MacLeod <amacleod@redhat.com>
3132
3133 * c-typeck.c: Add required include files from gimple.h.
3134
3df42822 31352013-11-22 David Malcolm <dmalcolm@redhat.com>
3136
3137 * c-decl.c (define_label, shadow_tag_warned)
3138 (check_bitfield_type_and_width, grokdeclarator, grokparms,
3139 store_parm_decls_newstyle, store_parm_decls_oldstyle)
3140 (declspecs_add_type): Remove use of in_system_header macro.
3141 * c-parser.c (c_parser_unary_expression): Likewise.
3142 * c-typeck.c (store_init_value, process_init_element)
3143 (c_start_case): Likewise.
3144
3145 * c-decl.c (build_enumerator): Remove use of EXPR_LOC_OR_HERE
3146 macro.
3147
3148 * c-parser.c (c_parser_set_source_position_from_token): Remove
3149 reference to in_system_header from comment.
3150
08f817b3 31512013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
3152
3153 * c-decl.c (grokdeclarator): Update comment to refer to
3154 tree_to_[su]hwi rather than tree_low_cst.
3155
6a0712d4 31562013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
3157
3158 * c-decl.c, c-typeck.c: Replace tree_low_cst (..., 1) with
3159 tree_to_uhwi throughout.
3160
fcb97e84 31612013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
3162
3163 * c-parser.c: Replace tree_low_cst (..., 0) with tree_to_shwi
3164 throughout.
3165
35ec552a 31662013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
3167
3168 * c-parser.c: Replace host_integerp (..., 0) with tree_fits_shwi_p
3169 throughout.
3170
f2697631 31712013-11-15 Aldy Hernandez <aldyh@redhat.com>
3172
3173 * c-parser.c (c_parser_cilk_simd): New.
3174 (c_parser_cilk_verify_simd): New.
3175 (c_parser_pragma): Add case for PRAGMA_CILK_SIMD.
3176 (c_parser_omp_for_loop): Add case for NE_EXPR.
3177 Set c_break_label for CILK_SIMD.
3178 (c_parser_cilk_clause_vectorlength): New.
3179 (c_parser_cilk_clause_linear): New.
3180 (c_parser_cilk_clause_name): New.
3181 (c_parser_cilk_all_clauses): New.
3182 * c-typeck.c (build_unary_op): Pass location argument to
3183 readonly_error.
3184 (build_modify_expr): Same.
3185 (build_asm_expr): Same.
3186 (c_finish_bc_stmt): Error on break/continue in loops.
3187
e795d6e1 31882013-11-14 Andrew MacLeod <amacleod@redhat.com>
3189
3190 * c-typeck.c: Include only gimplify.h and gimple.h as needed.
3191
9ed99284 31922013-11-14 Diego Novillo <dnovillo@google.com>
3193
3194 * c-decl.c: Include print-tree.h.
3195 Include stor-layout.h.
3196 Include varasm.h.
3197 Include attribs.h.
3198 Include stringpool.h.
3199 * c-lang.c: Include fold-const.h.
3200 * c-parser.c: Include stringpool.h.
3201 Include attribs.h.
3202 Include stor-layout.h.
3203 Include varasm.h.
3204 Include trans-mem.h.
3205 * c-typeck.c: Include stor-layout.h.
3206 Include trans-mem.h.
3207 Include varasm.h.
3208 Include stmt.h.
3209
4fba5eb9 32102013-11-13 Joseph Myers <joseph@codesourcery.com>
3211
3212 * c-tree.h (c_typespec_keyword): Add cts_auto_type.
3213 * c-decl.c (declspecs_add_type, finish_declspecs): Handle
3214 __auto_type.
3215 * c-parser.c (c_token_starts_typename, c_token_starts_declspecs)
3216 (c_parser_attribute_any_word, c_parser_objc_selector): Handle
3217 RID_AUTO_TYPE.
3218 (c_parser_declspecs): Take argument AUTO_TYPE_OK.
3219 (c_parser_declaration_or_fndef, c_parser_struct_declaration)
3220 (c_parser_declarator, c_parser_direct_declarator_inner)
3221 (c_parser_parameter_declaration, c_parser_type_name): All callers
3222 changed.
3223 (c_parser_declaration_or_fndef): Handle declarations with type
3224 determined from the initializer.
3225
a8783bee 32262013-11-12 Andrew MacLeod <amacleod@redhat.com>
3227
e795d6e1 3228 * c-typeck.c: Include gimplify.h.
a8783bee 3229
d184e0c0 32302013-11-12 Joseph Myers <joseph@codesourcery.com>
3231
3232 * c-tree.h (struct c_declspecs): Add thread_gnu_p field.
3233 * c-parser.c (c_parser_declspecs): Mention _Thread_local in
3234 comment.
3235 * c-decl.c (shadow_tag_warned, grokdeclarator): Mention __thread
3236 or _Thread_local as appropriate in diagnostics.
3237 (build_null_declspecs): Initialize ret->thread_gnu_p.
3238 (declspecs_add_scspec): Handle either __thread or _Thread_local
3239 for RID_THREAD. Diagnose _Thread_local for pre-C11 standards if
3240 pedantic. Do not disallow _Thread_local extern and _Thread_local
3241 static.
3242
b560fabd 32432013-11-07 Joseph Myers <joseph@codesourcery.com>
3244 Andrew MacLeod <amacleod@redhat.com>
3245
3246 * c-aux-info.c (gen_type): Handle atomic qualifier.
3247 * c-decl.c (validate_proto_after_old_defn): Do not remove atomic
3248 qualifiers when compating types.
3249 (shadow_tag_warned): Handle atomic_p in declspecs.
3250 (quals_from_declspecs): Likewise.
3251 (start_decl): Use c_type_promotes_to when promoting argument
3252 types.
3253 (grokdeclarator): Handle _Atomic.
3254 (get_parm_info): Diagnose any qualifier on "void" as only
3255 parameter.
3256 (store_parm_decls_oldstyle): Do not remove atomic qualifiers when
3257 comparing types. Use c_type_promotes_to when promoting argument
3258 types.
3259 (finish_function): Use c_type_promotes_to when promoting argument
3260 types.
3261 (build_null_declspecs): Handle atomic_p in declspecs.
3262 (declspecs_add_qual): Handle RID_ATOMIC.
3263 * c-parser.c (c_token_starts_typename, c_token_is_qualifier)
3264 (c_token_starts_declspecs): Handle RID_ATOMIC.
3265 (c_parser_declspecs): Handle atomic type specifiers and
3266 qualifiers.
3267 (c_parser_typeof_specifier): Remove const and _Atomic qualifiers
3268 from types of expressions with atomic type.
3269 (c_parser_direct_declarator_inner): Use convert_lvalue_to_rvalue.
3270 (c_parser_attribute_any_word): Handle RID_ATOMIC.
3271 (c_parser_initializer, c_parser_initelt, c_parser_initval)
3272 (c_parser_statement_after_labels, c_parser_switch_statement)
3273 (c_parser_for_statement, c_parser_expr_no_commas)
3274 (c_parser_conditional_expression, c_parser_binary_expression)
3275 (c_parser_cast_expression, c_parser_unary_expression)
3276 (c_parser_postfix_expression)
3277 (c_parser_postfix_expression_after_primary, c_parser_expression):
3278 Use convert_lvalue_to_rvalue.
3279 (c_parser_expression_conv, c_parser_expr_list): Document
3280 conversion of lvalues to rvalues. Use convert_lvalue_to_rvalue.
3281 (c_parser_objc_synchronized_statement): Use
3282 convert_lvalue_to_rvalue.
3283 (c_parser_objc_selector): Handle RID_ATOMIC.
3284 (c_parser_objc_receiver, c_parser_array_notation): Use
3285 convert_lvalue_to_rvalue.
3286 * c-tree.h (ctsk_typeof): Adjust comment to mention use for
3287 _Atomic (type-name).
3288 (struct c_declspecs): Add atomic_p field.
3289 (convert_lvalue_to_rvalue): Declare.
3290 * c-typeck.c (c_type_promotes_to): Promote atomic types to
3291 corresponding atomic types.
3292 (qualify_type): Don't add _Atomic qualifiers from second argument.
3293 (comp_target_types): Do not allow _Atomic mismatches.
3294 (type_lists_compatible_p): Do not remove atomic qualifiers when
3295 comparing types.
3296 (really_atomic_lvalue, convert_lvalue_to_rvalue)
3297 (build_atomic_assign): New functions.
3298 (build_unary_op): Use build_atomic_assign for atomic increment and
3299 decrement.
3300 (build_conditional_expr): Do not treat _Atomic void as a qualified
3301 version of void.
3302 (build_modify_expr): Use build_atomic_assign for atomic LHS.
3303 (find_anonymous_field_with_type, convert_to_anonymous_field)
3304 (convert_for_assignment): Do not remove atomic qualifiers when
3305 comparing types.
3306 (digest_init): Do not accept initialization of arrays of atomic
3307 elements by string constants.
3308 (build_asm_expr): Use convert_lvalue_to_rvalue.
3309 (build_binary_op): Do not treat _Atomic void as a qualified
3310 version of void.
3311
8b023e7c 33122013-11-06 DJ Delorie <dj@redhat.com>
3313
3314 * c-decl.c (locate_old_decl): If a previous conflicting decl is
3315 both explicit and builtin, print the location of the explicit one.
3316
c630ef93 33172013-11-05 Tobias Burnus <burnus@net-b.de>
3318
3319 * c-parser.c (c_parser_omp_for, c_parser_omp_parallel,
3320 c_parser_omp_distribute, c_parser_omp_teams,
3321 c_parser_omp_target, c_parser_omp_declare): Handle
3322 -fopenmp-simd.
3323
2c4c3477 33242013-11-03 Marek Polacek <polacek@redhat.com>
3325
3326 * c-decl.c (grokdeclarator): Add VLA instrumentation.
3327
df205251 33282013-11-01 Jakub Jelinek <jakub@redhat.com>
3329
3330 * c-typeck.c (c_finish_omp_clauses) <case OMP_CLAUSE_UNIFORM>: Go to
3331 check_dup_generic at the end, unless remove is true.
3332 (c_finish_omp_clauses) <case OMP_CLAUSE_REDUCTION>: Add break; after
3333 remove = true;.
3334 (c_finish_omp_clauses) <case OMP_CLAUSE_COPYIN>: Likewise.
3335
23871d0c 33362013-10-31 Jakub Jelinek <jakub@redhat.com>
3337
3338 * c-typeck.c (c_finish_omp_clauses): Diagnose aligned clause
3339 with decl that is not pointer nor array.
3340
d037099f 33412013-10-29 Balaji V. Iyer <balaji.v.iyer@intel.com>
3342
3343 * c-decl.c (finish_function): Added a call for insert_cilk_frame when
3344 a spawning function is found.
3345 * c-objc-common.h (LANG_HOOKS_CILKPLUS_GIMPLIFY_SPAWN): New #define.
3346 (LANG_HOOKS_CILKPLUS_FRAME_CLEANUP): Likewise.
3347 (LANG_HOOKS_CILKPLUS_DETECT_SPAWN_AND_UNWRAP): Likewise.
3348 * c-parser.c (c_parser_statement_after_labels): Added RID_CILK_SYNC
3349 case.
3350 (c_parser_postfix_expression): Added RID_CILK_SPAWN case.
3351 * c-typeck.c (build_compound_expr): Reject _Cilk_spawn in a comma
3352 expr.
3353 (c_finish_return): Added a check to reject _Cilk_spawn in return
3354 expression.
3355 (build_cilk_spawn): New function.
3356 (build_cilk_sync): Likewise.
3357 * Makefile.in (c-decl.o): Added cilk.h in dependency list.
3358
4c90c04c 33592013-10-27 Tobias Burnus <burnus@net-b.de>
3360
3361 PR other/33426
3362 * c-parser.c (c_parser_while_statement, c_parser_while_statement,
3363 c_parser_pragma): Add GCC ivdep support to 'do' and 'while'.
3364 (c_parser_statement_after_labels): Update calls.
3365
48a972c8 33662013-10-24 Tobias Burnus <burnus@net-b.de>
4644b593 3367
3368 PR other/33426
3369 * c-parser.c (c_parser_pragma, c_parser_for_statement):
3370 Handle PRAGMA_IVDEP.
3371 (c_parser_statement_after_labels): Update call.
3372
12f86df0 33732013-10-24 Marek Polacek <polacek@redhat.com>
3374
3375 * c-parser.c (c_parser_struct_declaration): Add a comment.
3376 (c_parser_declarator): Don't allow _Alignas here.
3377
7740abd8 33782013-10-17 Andrew MacLeod <amacleod@redhat.com>
3379
3380 * c-parser.c: Include omp-low.h.
3381 * c-typeck.c: Likewise.
3382
43d03c23 33832013-10-17 Marek Polacek <polacek@redhat.com>
3384
3385 PR c/58267
3386 * c-parser.c (c_parser_declspecs): Add alignspec_ok parameter.
3387 Document syntax of the array-declarator.
3388 (c_parser_declspecs) <RID_ALIGNAS>: Bail out if alignment specs
3389 are not permitted.
3390 (c_parser_declaration_or_fndef): Adjust c_parser_declspecs call.
3391 (c_parser_struct_declaration): Likewise.
3392 (c_parser_declarator): Likewise.
3393 (c_parser_direct_declarator_inner): Likewise.
3394 (c_parser_parameter_declaration): Likewise.
3395 (c_parser_type_name): Likewise.
3396
bc7bff74 33972013-10-11 Jakub Jelinek <jakub@redhat.com>
3398
3399 * c-lang.h (current_omp_declare_target_attribute): New extern
3400 decl.
3401 * c-parser.c: Include c-lang.h.
3402 (struct c_parser): Change tokens to c_token *.
3403 Add tokens_buf field. Change tokens_avail type to unsigned int.
3404 (c_parser_consume_token): If parser->tokens isn't
3405 &parser->tokens_buf[0], increment parser->tokens.
3406 (c_parser_consume_pragma): Likewise.
3407 (enum pragma_context): Add pragma_struct and pragma_param.
3408 (c_parser_external_declaration): Adjust
3409 c_parser_declaration_or_fndef caller.
3410 (c_parser_declaration_or_fndef): Add omp_declare_simd_clauses
3411 argument, if it is non-vNULL vector, call c_finish_omp_declare_simd.
3412 Adjust recursive call.
3413 (c_parser_struct_or_union_specifier): Use pragma_struct instead
3414 of pragma_external.
3415 (c_parser_parameter_declaration): Use pragma_param instead of
3416 pragma_external.
3417 (c_parser_compound_statement_nostart, c_parser_label,
3418 c_parser_for_statement): Adjust
3419 c_parser_declaration_or_fndef callers.
3420 (c_parser_expr_no_commas): Add omp_atomic_lhs argument, pass
3421 it through to c_parser_conditional_expression.
3422 (c_parser_conditional_expression): Add omp_atomic_lhs argument,
3423 pass it through to c_parser_binary_expression. Adjust recursive
3424 call.
3425 (c_parser_binary_expression): Remove prec argument, add
3426 omp_atomic_lhs argument instead. Always start from PREC_NONE, if
3427 omp_atomic_lhs is non-NULL and one of the arguments of toplevel
3428 binop matches it, use build2 instead of parser_build_binary_op.
3429 (c_parser_pragma): Handle PRAGMA_OMP_CANCEL,
3430 PRAGMA_OMP_CANCELLATION_POINT, PRAGMA_OMP_TARGET,
3431 PRAGMA_OMP_END_DECLARE_TARGET, PRAGMA_OMP_DECLARE_REDUCTION.
3432 Handle pragma_struct and pragma_param the same as pragma_external.
3433 (c_parser_omp_clause_name): Parse new OpenMP 4.0 clause names.
3434 (c_parser_omp_variable_list): Parse array sections for
3435 OMP_CLAUSE_{DEPEND,MAP,TO,FROM} clauses.
3436 (c_parser_omp_clause_collapse): Fully fold collapse expression.
3437 (c_parser_omp_clause_reduction): Handle user defined reductions.
3438 (c_parser_omp_clause_branch, c_parser_omp_clause_cancelkind,
3439 c_parser_omp_clause_num_teams, c_parser_omp_clause_thread_limit,
3440 c_parser_omp_clause_aligned, c_parser_omp_clause_linear,
3441 c_parser_omp_clause_safelen, c_parser_omp_clause_simdlen,
3442 c_parser_omp_clause_depend, c_parser_omp_clause_map,
3443 c_parser_omp_clause_device, c_parser_omp_clause_dist_schedule,
3444 c_parser_omp_clause_proc_bind, c_parser_omp_clause_to,
3445 c_parser_omp_clause_from, c_parser_omp_clause_uniform): New functions.
3446 (c_parser_omp_all_clauses): Add finish_p argument. Don't call
3447 c_finish_omp_clauses if it is false. Handle new OpenMP 4.0 clauses.
3448 (c_parser_omp_atomic): Parse seq_cst clause, pass true if it is
3449 present to c_finish_omp_atomic. Handle OpenMP 4.0 atomic forms.
3450 (c_parser_omp_for_loop): Add CODE argument, pass it through
3451 to c_finish_omp_for. Change last argument to cclauses,
3452 and adjust uses to grab parallel clauses from the array of all
3453 the split clauses. Adjust c_parser_binary_expression,
3454 c_parser_declaration_or_fndef and c_finish_omp_for callers.
3455 (omp_split_clauses): New function.
3456 (c_parser_omp_simd): New function.
3457 (c_parser_omp_for): Add p_name, mask and cclauses arguments.
3458 Allow the function to be called also when parsing combined constructs,
3459 and call c_parser_omp_simd when parsing for simd.
3460 (c_parser_omp_sections_scope): If section-sequence doesn't start with
3461 #pragma omp section, require exactly one structured-block instead of
3462 sequence of statements.
3463 (c_parser_omp_sections): Add p_name, mask and cclauses arguments.
3464 Allow the function to be called also when parsing combined constructs.
3465 (c_parser_omp_parallel): Add p_name, mask and cclauses arguments.
3466 Allow the function to be called also when parsing combined
3467 constructs.
3468 (c_parser_omp_taskgroup, c_parser_omp_cancel,
3469 c_parser_omp_cancellation_point, c_parser_omp_distribute,
3470 c_parser_omp_teams, c_parser_omp_target_data,
3471 c_parser_omp_target_update, c_parser_omp_target,
3472 c_parser_omp_declare_simd, c_finish_omp_declare_simd,
3473 c_parser_omp_declare_target, c_parser_omp_end_declare_target,
3474 c_parser_omp_declare_reduction, c_parser_omp_declare): New functions.
3475 (c_parser_omp_construct): Add p_name and mask vars. Handle
3476 PRAGMA_OMP_DISTRIBUTE, PRAGMA_OMP_SIMD, PRAGMA_OMP_TASKGROUP,
3477 PRAGMA_OMP_TEAMS. Adjust c_parser_omp_for, c_parser_omp_parallel
3478 and c_parser_omp_sections callers.
3479 (c_parse_file): Initialize tparser.tokens and the_parser->tokens here.
3480 (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK,
3481 OMP_SINGLE_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1.
3482 (OMP_PARALLEL_CLAUSE_MASK): Likewise. Add OMP_CLAUSE_PROC_BIND.
3483 (OMP_TASK_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1. Add
3484 OMP_CLAUSE_DEPEND.
3485 (OMP_SIMD_CLAUSE_MASK, OMP_CANCEL_CLAUSE_MASK,
3486 OMP_CANCELLATION_POINT_CLAUSE_MASK, OMP_DISTRIBUTE_CLAUSE_MASK,
3487 OMP_TEAMS_CLAUSE_MASK, OMP_TARGET_DATA_CLAUSE_MASK,
3488 OMP_TARGET_UPDATE_CLAUSE_MASK, OMP_TARGET_CLAUSE_MASK,
3489 OMP_DECLARE_SIMD_CLAUSE_MASK): Define.
3490 * c-typeck.c: Include tree-inline.h.
3491 (c_finish_omp_cancel, c_finish_omp_cancellation_point,
3492 handle_omp_array_sections_1, handle_omp_array_sections,
3493 c_clone_omp_udr, c_find_omp_placeholder_r): New functions.
3494 (c_finish_omp_clauses): Handle new OpenMP 4.0 clauses and
3495 user defined reductions.
3496 (c_tree_equal): New function.
3497 * c-tree.h (temp_store_parm_decls, temp_pop_parm_decls,
3498 c_finish_omp_cancel, c_finish_omp_cancellation_point, c_tree_equal,
3499 c_omp_reduction_id, c_omp_reduction_decl, c_omp_reduction_lookup,
3500 c_check_omp_declare_reduction_r): New prototypes.
3501 * c-decl.c (current_omp_declare_target_attribute): New variable.
3502 (c_decl_attributes): New function.
3503 (start_decl, start_function): Use it instead of decl_attributes.
3504 (temp_store_parm_decls, temp_pop_parm_decls, c_omp_reduction_id,
3505 c_omp_reduction_decl, c_omp_reduction_lookup,
3506 c_check_omp_declare_reduction_r): New functions.
3507
3ce7d1bd 35082013-09-25 Tom Tromey <tromey@redhat.com>
3509
3510 * Make-lang.in (c/gccspec.o): Remove.
3511 (CFLAGS-c/gccspec.o): New variable.
3512 (cc1-checksum.o, C_TREE_H, c/c-aux-info.o, c/c-convert.o)
3513 (c/c-decl.o, c/c-errors.o, c/c-lang.o, c/c-objc-common.o)
3514 (c/c-parser.o, c/c-typeck.o, c/c-array-notation.o): Remove.
3515
96da1c1d 35162013-09-25 Tom Tromey <tromey@redhat.com>
3517
3518 * Make-lang.in (c/gccspec.o): Don't use subshell.
3519
1b309377 35202013-09-18 Marek Polacek <polacek@redhat.com>
3521
3522 PR sanitize/58443
3523 * c-typeck.c (build_binary_op): Properly honor -fsanitize options.
3524 Remove unnecessary check.
3525
05f893e1 35262013-09-18 Marek Polacek <polacek@redhat.com>
3527
3528 PR sanitizer/58411
3529 * c-typeck.c (build_binary_op): Don't sanitize function if it has the
3530 no_sanitize_undefined attribute.
3531
bda0b9d2 35322013-09-13 Kai Tietz <ktietz@redhat.com>
3533
3534 PR target/57848
3535 * c-decl.c (c_builtin_function_ext_scope): Remove
3536 wrong assumption that it is never called on prexisting
3537 symbol.
3538
73437615 35392013-09-08 Joern Rennecke <joern.rennecke@embecosm.com>
3540
3541 * c-typeck.c (build_binary_op): Use vector_types_compatible_elements_p.
3542
eaab24b9 35432013-09-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
3544
3545 * c-objc-common.c (c_tree_printer): Tidy.
3546
9e46467d 35472013-08-30 Marek Polacek <polacek@redhat.com>
3548
3549 * c-typeck.c (build_binary_op): Add division by zero and shift
3550 instrumentation.
3551
f8234178 35522013-08-26 Joern Rennecke <joern.rennecke@embecosm.com>
f9086116 3553 Joseph Myers <joseph@codesourcery.com>
f8234178 3554
c90a7d10 3555 PR c/35649
f8234178 3556 * c-typeck.c (c_common_type): Prefer double_type_node over
3557 other REAL_TYPE types with the same precision.
3558 (convert_arguments): Likewise.
3559
6f07f480 35602013-08-23 Gabriel Dos Reis <gdr@integrable-solutions.net>
3561
3562 * c-objc-common.c (c_tree_printer): Document the nature of the cast.
3563 (c_initialize_diagnostics): Call a destructor for the early printer.
3564
eed6bc21 35652013-08-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
3566
3567 * c-objc-common.c (c_initialize_diagnostics): Simplify C pretty
3568 printer initialization.
3569
57717943 35702013-08-19 Balaji V. Iyer <balaji.v.iyer@intel.com>
eed6bc21 3571
57717943 3572 PR c/57490
3573 * c-array-notation.c (fix_conditional_array_notations_1): Added a
3574 check for truth values.
3575 (expand_array_notation_exprs): Added truth values case. Removed an
3576 unwanted else. Added for-loop to walk through subtrees in default
3577 case.
3578
a94db6b0 35792013-08-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
3580
3581 * c-objc-common.c (c_initialize_diagnostics): Don't call pp_base.
3582
e76163a9 35832013-07-23 Joseph Myers <joseph@codesourcery.com>
3584
3585 * c-parser.c (struct c_generic_association): Fix typo.
3586
7aa04c8d 35872013-07-23 Tom Tromey <tromey@redhat.com>
3588 Joseph Myers <joseph@codesourcery.com>
3589
3590 * c-parser.c (struct c_generic_association): New.
3591 (c_generic_association_d): New typedef.
3592 (c_parser_generic_selection): New function.
3593 (c_parser_postfix_expression): Handle RID_GENERIC.
3594
76bbe4ca 35952013-07-13 Jason Merrill <jason@redhat.com>
3596
3597 PR c++/57793
3598 * c-decl.c (finish_struct): Check for too-large class.
3599
21ebaa24 36002013-07-04 Joern Rennecke <joern.rennecke@embecosm.com>
f5298614 3601
3602 PR c/57821
3603 * c-typeck.c (set_init_index): When folding, check for index overflow.
3604
936c3081 36052013-06-28 Balaji V. Iyer <balaji.v.iyer@intel.com>
3606
3607 * c-parser.c (c_parser_array_notation): Removed rejection of array
3608 notations in an array of function pointers.
3609
50acebe0 36102013-06-21 Balaji V. Iyer <balaji.v.iyer@intel.com>
3611
3612 * c-array-notation.c (make_triplet_val_inv): New function.
3613 (create_cmp_incr): Likewise.
3614 (create_array_refs): Likewise.
3615 (fix_builtin_array_notation_fn): Replaced all mallocs with tree vec.
3616 Also modularized common parts between functions and called the function.
3617 (build_array_notation_expr): Likewise.
3618 (fix_conditional_array_notations_1): Likewise.
3619 (fix_array_notation_expr): Likewise.
3620 (fix_array_notation_call_expr): Likewise.
3621
01e6cdb4 36222013-06-18 Marek Polacek <polacek@redhat.com>
3623
3624 PR c/57630
3625 * c-decl.c (check_for_loop_decls): Improve diagnostics messages.
3626
6a3adac6 36272013-06-12 Balaji V. Iyer <balaji.v.iyer@intel.com>
3628
3629 * c-array-notation.c (build_array_notation_expr): Reject array notation
3630 mismatch between LHS and RHS even inside a call_expr. Also, removed
3631 a couple while statements that were dead code.
3632
62aab3f3 36332013-06-10 Balaji V. Iyer <balaji.v.iyer@intel.com>
3634
3635 * c-array-notation.c (fix_builtin_array_notation_fn): Fully folded
3636 excessive precision expressions in function parameters. Also removed
3637 couple unwanted while statements.
3638
bfc83720 36392013-06-07 Balaji V. Iyer <balaji.v.iyer@intel.com>
3640
3641 * c-array-notation.c (expand_array_notation_exprs): Added
3642 ARRAY_NOTATION_REF case.
3643
09970d67 36442013-06-07 Balaji V. Iyer <balaji.v.iyer@intel.com>
3645
3646 * c-array-notation.c (length_mismatch_in_expr_p): Moved this
3647 function to c-family/array-notation-common.c.
3648 (is_cilkplus_reduce_builtin): Likewise.
3649 (find_rank): Likewise.
3650 (extract_array_notation_exprs): Likewise.
3651 (replace_array_notations): Likewise.
3652 (find_inv_trees): Likewise.
3653 (replace_inv_trees): Likewise.
3654 (contains_array_notation_expr): Likewise.
3655 (find_correct_array_notation_type): Likewise.
3656 (replace_invariant_exprs): Initialized additional_tcodes to NULL.
3657 (struct inv_list): Moved this to c-family/array-notation-common.c.
3658 * c-tree.h (is_cilkplus_builtin_reduce): Remove prototype.
3659
6e13bc01 36602013-06-05 Balaji V. Iyer <balaji.v.iyer@intel.com>
3661
3662 * c-typeck.c (convert_arguments): Moved checking of builtin cilkplus
3663 reduction functions outside the for-loop. Added a check if the fundecl
3664 is non-NULL. Finally, removed an unwanted if-statement, and made the
3665 body unconditional.
3666
cc92dddc 36672013-06-03 Balaji V. Iyer <balaji.v.iyer@intel.com>
3668
3669 * c-typeck.c (c_finish_if_stmt): Added a check to see if the rank of the
3670 condition of the if-statement matches the rank of else-block and then-
3671 block when array notations are used.
3672 * c-parser.c (c_parser_declaration_or_fndef): Expanded array notation
3673 expression after the entire function body is parsed.
3674 (c_parser_expr_no_commas): Delayed creating array notation expressions
3675 to the end of function parsing.
3676 * c-array-notation.c (fix_conditional_array_notations_1): Expanded the
3677 whole if-statement instead of just the condition.
3678 (expand_array_notation_exprs): Added MODIFY_EXPR case.
3679
eddc63fd 36802013-06-03 Balaji V. Iyer <balaji.v.iyer@intel.com>
3681
3682 PR c/57474
3683 * c-array-notation.c (build_array_notation_expr): Initialized rhs_length
3684 array to NULL_TREE if they are unused. Also added a check for the
3685 field to be NULL before its fields are used in future.
3686
a2115a4a 36872013-05-29 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3688
3689 PR bootstrap/57450
3690 * c-array-notation.c (length_mismatch_in_expr_p): Use absu_hwi.
3691 (build_array_notation_expr): Likewise.
3692
3c6d4197 36932013-05-28 Balaji V. Iyer <balaji.v.iyer@intel.com>
3694
3695 * c-typeck.c (build_array_ref): Added a check to see if array's
3696 index is greater than one. If true, then emit an error.
3697 (build_function_call_vec): Exclude error reporting and checking
3698 for builtin array-notation functions.
3699 (convert_arguments): Likewise.
3700 (c_finish_return): Added a check for array notations as a return
3701 expression. If true, then emit an error.
3702 (c_finish_loop): Added a check for array notations in a loop
3703 condition. If true then emit an error.
3704 (lvalue_p): Added a ARRAY_NOTATION_REF case.
3705 (build_binary_op): Added a check for array notation expr inside
3706 op1 and op0. If present, we call another function to find correct
3707 type.
3708 * Make-lang.in (C_AND_OBJC_OBJS): Added c-array-notation.o.
3709 * c-parser.c (c_parser_compound_statement): Check if array
3710 notation code is used in tree, if so, then transform them into
3711 appropriate C code.
3712 (c_parser_expr_no_commas): Check if array notation is used in LHS
3713 or RHS, if so, then build array notation expression instead of
3714 regular modify.
3715 (c_parser_postfix_expression_after_primary): Added a check for
3716 colon(s) after square braces, if so then handle it like an array
3717 notation. Also, break up array notations in unary op if found.
3718 (c_parser_direct_declarator_inner): Added a check for array
3719 notation.
3720 (c_parser_compound_statement): Added a check for array notation in
3721 a stmt. If one is present, then expand array notation expr.
3722 (c_parser_if_statement): Likewise.
3723 (c_parser_switch_statement): Added a check for array notations in
3724 a switch statement's condition. If true, then output an error.
3725 (c_parser_while_statement): Similarly, but for a while.
3726 (c_parser_do_statement): Similarly, but for a do-while.
3727 (c_parser_for_statement): Similarly, but for a for-loop.
3728 (c_parser_unary_expression): Check if array notation is used in a
3729 pre-increment or pre-decrement expression. If true, then expand
3730 them.
3731 (c_parser_array_notation): New function.
3732 * c-array-notation.c: New file.
3733 * c-tree.h (is_cilkplus_reduce_builtin): Protoize.
3734
2c1c8a2c 37352013-05-23 Mike Stump <mikestump@comcast.net>
3736
3737 * c-typeck.c (convert_for_assignment): Handle references to memory
3738 spaces better.
3739
be5f9e46 37402013-05-16 Jason Merrill <jason@redhat.com>
3741
3742 * Make-lang.in (cc1$(exeext)): Use link mutex.
3743
9205a6cc 37442013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
3745
3746 * c-typeck.c (pointer_diff): Change -Wpointer-arith pedwarns
3747 to simply use OPT_Wpointer_arith.
3748 (build_unary_op): Likewise.
3749
0b049e15 37502013-04-03 Jakub Jelinek <jakub@redhat.com>
3751
3752 PR c/19449
3753 * c-parser.c (c_parser_get_builtin_args): Add choose_expr_p
3754 argument. If set, or it temporarily for parsing of the first
3755 argument into force_folding_builtin_constant_p.
3756 (c_parser_postfix_expression): Adjust callers.
3757
8e966116 37582013-03-21 Richard Biener <rguenther@suse.de>
3759
3760 * c-objc-common.c (c_tree_printer): Use DECL_HAS_DEBUG_EXPR_P
3761 instead of DECL_DEBUG_EXPR_IS_FROM. Guard properly.
3762
b862f263 37632013-02-12 Marek Polacek <polacek@redhat.com>
3764
3765 PR c/44938
3766 * c-parser.c (c_parser_postfix_expression_after_primary): Initialize
3767 origtypes to NULL.
3768
54550ecb 37692013-01-24 Jakub Jelinek <jakub@redhat.com>
3770
3771 PR c/56078
3772 * c-typeck.c (set_nonincremental_init_from_string): If
3773 constructor_max_index is NULL, treat it as if tree_int_cst_lt
3774 returned false.
3775 (process_init_element): Likewise.
3776
035b65e2 37772012-12-20 Jakub Jelinek <jakub@redhat.com>
3778
3779 PR c++/55619
3780 * c-parser.c (c_parser_asm_operands): Remove CONVERT_P
3781 argument, don't call default_function_array_conversion
3782 nor c_fully_fold here.
3783 (c_parser_asm_statement): Adjust callers.
3784 * c-typeck.c (build_asm_expr): Call c_fully_fold on inputs
3785 and outputs here, and call default_function_array_conversion
3786 on inputs that don't need to be addressable.
3787
7cbb7f1a 37882012-12-18 Jakub Jelinek <jakub@redhat.com>
3789
3790 PR c/39464
3791 * c-typeck.c (convert_for_assignment): For -Wpointer-sign
3792 warning require that both c_common_unsigned_type as well as
3793 c_common_signed_type is the same for both mvl and mvr types.
3794
f1f41a6c 37952012-11-16 Diego Novillo <dnovillo@google.com>
3796
3797 Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)
3798
3799 * c-common.c: Use new vec API in vec.h.
3800 * c-common.h: Likewise.
3801 * c-gimplify.c: Likewise.
3802 * c-pragma.c: Likewise.
3803 * c-pretty-print.c: Likewise.
3804 * c-pretty-print.h: Likewise.
3805 * c-semantics.c: Likewise.
3806 * c-decl.c: Likewise.
3807 * c-parser.c: Likewise.
3808 * c-tree.h: Likewise.
3809 * c-typeck.c: Likewise.
3810
8b447d3f 38112012-10-29 Jonathan Wakely <jwakely.gcc@gmail.com>
3812
3813 PR c++/54930
3814 * c-typeck.c (c_finish_return): Use OPT_Wreturn_local_addr.
3815
08fc5390 38162012-10-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
3817
3818 PR c/53066
3819 * c-decl.c (warn_if_shadowing): Do not warn if a variable
3820 shadows a function, unless the variable is a function or a
3821 pointer-to-function.
3822
57f872a2 38232012-10-12 Jakub Jelinek <jakub@redhat.com>
3824
3825 PR c/54381
3826 * c-parser.c (struct c_tree_loc_pair): Removed.
3827 (c_parser_expr_list): Remove struct c_tree_loc_pair * argument,
3828 add location_t * and tree * arguments, fill in array of 3
3829 sizeof_arg trees and corresponding locs.
3830 (c_parser_attributes, c_parser_objc_keywordexpr): Adjust
3831 c_parser_expr_list callers.
3832 (c_parser_postfix_expression_after_primary): Likewise. Pass
3833 array of 3 sizeof_arg trees and locs (corresponding to first
3834 3 arguments) to sizeof_pointer_memaccess_warning.
3835
d1455aa3 38362012-10-09 Lawrence Crowl <crowl@google.com>
3837
3838 * Make-lang.in (c-decl.o): Add dependence on hash-table.h.
3839 * c-decl.c (detect_field_duplicates_hash): Change to new type-safe
3840 hash table.
3841
b0e7825e 38422012-10-09 Paolo Carlini <paolo.carlini@oracle.com>
3843
3844 PR c++/54194
3845 * c-typeck.c (parser_build_binary_op): Update warn_about_parentheses
3846 call.
3847
41ed701a 38482012-10-09 Marc Glisse <marc.glisse@inria.fr>
3849
3850 PR c++/54427
3851 * c-typeck.c: Include c-common.h.
3852 (enum stv_conv): Moved to c-common.h.
3853 (scalar_to_vector): Moved to c-common.c.
3854 (build_binary_op): Adapt to scalar_to_vector's new prototype.
3855 * Make-lang.in: c-typeck.c depends on c-common.h.
3856
ef34afc1 38572012-10-04 Arnaud Charlet <charlet@adacore.com>
3858
3859 * c-decl.c (c_write_global_declarations): Fix handling of
3860 -fdump-ada-spec*.
3861
7bd765d4 38622012-09-30 Sharad Singhai <singhai@google.com>
3863
3864 * c-decl.c (c_write_global_declarations): Use a different method
3865 to determine if the dump has ben initialized.
3866
c4b1a13a 38672012-09-14 Joseph Myers <joseph@codesourcery.com>
3868
3869 PR c/54552
3870 * c-typeck.c (c_cast_expr): When casting to a type requiring
3871 C_MAYBE_CONST_EXPR to be created, pass the inner expression to
3872 c_fully_fold first.
3873
bb554051 38742012-09-14 Joseph Myers <joseph@codesourcery.com>
3875
3876 PR c/54103
3877 * c-typeck.c (build_unary_op): Pass original argument of
3878 TRUTH_NOT_EXPR to c_objc_common_truthvalue_conversion, then remove
3879 any C_MAYBE_CONST_EXPR, if it has integer operands.
3880 (build_binary_op): Pass original arguments of TRUTH_ANDIF_EXPR,
3881 TRUTH_ORIF_EXPR, TRUTH_AND_EXPR, TRUTH_OR_EXPR and TRUTH_XOR_EXPR
3882 to c_objc_common_truthvalue_conversion, then remove any
3883 C_MAYBE_CONST_EXPR, if they have integer operands. Use
3884 c_objc_common_truthvalue_conversion not
3885 c_common_truthvalue_conversion.
3886 (c_objc_common_truthvalue_conversion): Build NE_EXPR directly and
3887 call note_integer_operands for arguments with integer operands
3888 that are not integer constants.
3889
c708c6ef 38902012-09-13 Jakub Jelinek <jakub@redhat.com>
3891
3892 PR c/54559
3893 * c-typeck.c (c_finish_return): Do convert to BOOLEAN_TYPE or
3894 COMPLEX_TYPE with in_late_binary_op set temporarily to true.
3895
cce20430 38962012-08-31 Jakub Jelinek <jakub@redhat.com>
3897
3898 PR c/54428
3899 * c-convert.c (convert): Don't call fold_convert_loc if
3900 TYPE_MAIN_VARIANT of a COMPLEX_TYPE is the same, unless e
3901 is a COMPLEX_EXPR. Remove TYPE_MAIN_VARIANT check from
3902 COMPLEX_TYPE -> COMPLEX_TYPE conversion.
3903
a90d57ed 39042012-08-24 Jakub Jelinek <jakub@redhat.com>
3905
3906 PR c/54355
3907 * c-decl.c (c_parser_label): Pass true as nested and fix up comments
3908 for nested and empty_ok arguments in the call to
3909 c_parser_declaration_or_fndef.
3910
f003f5dc 39112012-08-17 Jakub Jelinek <jakub@redhat.com>
3912
3913 * c-tree.h (c_last_sizeof_arg): Declare.
3914 * c-parser.c (struct c_tree_loc_pair): New type.
3915 (c_parser_expr_list): Add sizeof_arg argument. Fill it in if
3916 non-NULL.
3917 (c_parser_attributes, c_parser_objc_keywordexpr): Adjust callers.
3918 (c_parser_postfix_expression_after_primary): Likewise. Call
3919 sizeof_pointer_memaccess_warning if needed.
3920 (sizeof_ptr_memacc_comptypes): New function.
3921 * c-typeck.c (c_last_sizeof_arg): New global variable.
3922 (c_expr_sizeof_expr, c_expr_sizeof_type): Initialize it.
3923
a5656b73 39242012-07-24 Uros Bizjak <ubizjak@gmail.com>
3925
3926 * c-lang.h (lang_decl): Add variable_size GTY option.
3927
b9ed1410 39282012-07-16 Steven Bosscher <steven@gcc.gnu.org>
3929
3930 * c-decl.c: Include dumpfile.h instead of tree-dump.h.
3931 * Make-lang.in: Fix dependencies.
3932
e53d55e7 39332012-06-29 Steven Bosscher <steven@gcc.gnu.org>
3934
3935 * Make-lang.in: New file, rules migrated from gcc/Makefile.in
3936 and add language Makefile hooks.
3937 * config-lang.in: New file.
3938 * c-config-lang.in: Moved from gcc/config-lang.in to here, and
3939 add the required "normal" config-lang.in rules.
3940 * c-lang.h: Moved from gcc/ to here.
3941 * c-tree.h: Likewise.
3942 * c-objc-common.c: Likewise.
3943 * c-objc-common.h: Likewise.
3944 * c-typeck.c: Likewise.
3945 * c-convert.c: Likewise.
3946 * c-lang.c: Likewise.
3947 * c-aux-info.c: Likewise.
3948 * c-errors.c: Likewise.
3949 * gccspec.c: Likewise.
3950 * c-decl.c: Likewise. Include gt-c-c-decl.h, not gt-c-decl.h.
3951 * c-parser.c: Likewise. Include gt-c-c-parser.h, not gt-c-parser.h.
3952\f
f1717362 3953Copyright (C) 2012-2016 Free Software Foundation, Inc.
e53d55e7 3954
3955Copying and distribution of this file, with or without modification,
3956are permitted in any medium without royalty provided the copyright
3957notice and this notice are preserved.