]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/c/ChangeLog
testsuite: Rename a test
[thirdparty/gcc.git] / gcc / c / ChangeLog
CommitLineData
d7a6b1cf
GA
12025-07-01 Qing Zhao <qing.zhao@oracle.com>
2
3 * c-decl.cc (verify_counted_by_attribute): Change the 2nd argument
4 to a vector of fields with counted_by attribute. Verify all fields
5 in this vector.
6 (finish_struct): Collect all the fields with counted_by attribute
7 to a vector and pass this vector to verify_counted_by_attribute.
8 * c-typeck.cc (build_counted_by_ref): Handle pointers with counted_by.
9 Add one more argument, issue error when the pointee type is a structure
10 or union including a flexible array member.
11 (build_access_with_size_for_counted_by): Handle pointers with counted_by.
12 (handle_counted_by_for_component_ref): Call build_counted_by_ref
13 with the new prototype.
14
c4f53082
GA
152025-06-23 Tobias Burnus <tburnus@baylibre.com>
16
17 * c-parser.cc (OACC_WAIT_CLAUSE_MASK): Add if clause.
18
d036322a
GA
192025-06-12 Jakub Jelinek <jakub@redhat.com>
20
21 * c-lang.h (union lang_type::maybe_objc_info): New type.
22 (struct lang_type): Use union maybe_objc_info info member
23 instead of tree objc_info.
24 * c-decl.cc (finish_struct): Allocate struct lang_type using
25 ggc_internal_cleared_alloc instead of ggc_cleared_alloc,
26 and use sizeof (struct lang_type) for ObjC and otherwise
27 offsetof (struct lang_type, info) as size.
28 (finish_enum): Likewise.
29
302025-06-11 Martin Uecker <uecker@tugraz.at>
31
32 PR c/120510
33 * c-typeck.cc (composite_type_internal): Activate checking
34 assertions for all types and also inputs.
35 (comptypes_for_composite_check): New helper function.
36 (function_types_compatible_p): Add exception.
37
382025-06-11 Martin Uecker <uecker@tugraz.at>
39
40 * c-typeck.cc (function_types_compatible_p): Remove unused
41 variables and return true/false instead of 1/0.
42 (type_lists_compatible_p): Return false instead of 0.
43
442025-06-11 Martin Uecker <uecker@tugraz.at>
45
46 PR c/120303
47 * c-parser.cc (c_parser_generic_selection): Handle error
48 condition.
49
1abdf82d
GA
502025-06-09 Martin Uecker <uecker@tugraz.at>
51
52 PR c/120510
53 * c-typeck.cc (remove_qualifiers): New function.
54 (composite_type_internal): Use it.
55 (comp_target_types): Use it.
56 (type_lists_compatible_p): Use it.
57 (find_anonymous_field_with_type): Use it.
58 (convert_to_anonymous_field): Use it.
59 (convert_for_assignment): Use it.
60
612025-06-09 Martin Uecker <uecker@tugraz.at>
62
63 PR c/120510
64 * c-typeck.cc (composite_type_internal): Activate checking
65 assertion for arrays.
66 (common_pointer_type): Remove qualifiers also from arrays.
67
682025-06-09 Martin Uecker <uecker@tugraz.at>
69
70 PR c/120510
71 * c-typeck.cc (composite_types_internal): Handle arrays
72 declared with atomic for function arguments.
73
5f737a61
GA
742025-06-03 Martin Uecker <uecker@tugraz.at>
75
76 * c-typeck.cc (composite_type_internal,composite_type): Move
77 checking assertions.
78
792025-06-03 Martin Uecker <uecker@tugraz.at>
80
81 PR c/116892
82 * c-decl.cc (finish_enum): Propagate TYPE_PACKED.
83
13699eb9
GA
842025-06-02 Sandra Loosemore <sloosemore@baylibre.com>
85
86 * c-parser.cc (c_parser_omp_context_selector): Call
87 convert_lvalue_to_rvalue and c_objc_common_truthvalue_conversion
88 on the expression for OMP_TRAIT_PROPERTY_BOOL_EXPR.
89
fa715626
GA
902025-06-01 Martin Uecker <uecker@tugraz.at>
91
92 PR c/120380
93 * c-objc-common.cc (get_aka_type): Ignore attributes for tagged types.
94
c7df2b7d
GA
952025-05-30 Qing Zhao <qing.zhao@oracle.com>
96
97 PR c/120354
98 * c-decl.cc (finish_struct): Or the results for TYPE_INCLUDES_FLEXARRAY.
99
1002025-05-30 Qing Zhao <qing.zhao@oracle.com>
101
102 PR c/120353
103 * c-decl.cc (finish_struct): Copy TYPE_INCLUDES_FLEXARRAY marking
104 to all the variant types of the current structure type.
105
1062025-05-30 Julian Brown <julian@codesourcery.com>
107
108 * c-decl.cc (c_omp_mapper_id, c_omp_mapper_decl, c_omp_mapper_lookup,
109 c_omp_extract_mapper_directive, c_omp_map_array_section,
110 c_omp_scan_mapper_bindings_r, c_omp_scan_mapper_bindings): New
111 functions.
112 * c-objc-common.h (LANG_HOOKS_OMP_FINISH_MAPPER_CLAUSES,
113 LANG_HOOKS_OMP_MAPPER_LOOKUP, LANG_HOOKS_OMP_EXTRACT_MAPPER_DIRECTIVE,
114 LANG_HOOKS_OMP_MAP_ARRAY_SECTION): Define langhooks for C.
115 * c-parser.cc (c_parser_omp_clause_map): Add declare_mapper_p
116 parameter; handle mapper modifier.
117 (c_parser_omp_all_clauses): Update call to c_parser_omp_clause_map.
118 (c_parser_omp_target): Instantiate explicit mappers and record bindings
119 for implicit mappers.
120 (c_parser_omp_declare_mapper): Parse "declare mapper" directives.
121 (c_parser_omp_declare): Support "declare mapper".
122 (c_parser_omp_declare_reduction): Use inform not error_at.
123 * c-tree.h (c_omp_finish_mapper_clauses, c_omp_mapper_lookup,
124 c_omp_extract_mapper_directive, c_omp_map_array_section,
125 c_omp_mapper_id, c_omp_mapper_decl, c_omp_scan_mapper_bindings,
126 c_omp_instantiate_mappers): Add prototypes.
127 * c-typeck.cc (c_finish_omp_clauses): Handle GOMP_MAP_PUSH_MAPPER_NAME
128 and GOMP_MAP_POP_MAPPER_NAME.
129 (c_omp_finish_mapper_clauses): New function (langhook).
130
1312025-05-30 Martin Uecker <uecker@tugraz.at>
132
133 PR c/120381
134 * c-typeck.cc (composite_type_internal): Stop recursion for
135 swapped pairs.
136
77fa15d1
GA
1372025-05-29 Sandra Loosemore <sloosemore@baylibre.com>
138
139 * c-parser.cc (c_parser_skip_to_closing_brace): New, copied from
140 the equivalent function in the C++ front end.
141 (c_parser_skip_to_end_of_block_or_statement): Pass false to
142 the error flag.
143 (c_parser_omp_context_selector): Immediately return error_mark_node
144 after giving an error that the integer trait property is invalid,
145 similarly to C++ front end.
146 (c_parser_omp_context_selector_specification): Likewise handle
147 error return from c_parser_omp_context_selector similarly to C++.
148 (c_parser_omp_metadirective): Do not call
149 c_parser_skip_to_end_of_block_or_statement after an error.
150
1512025-05-29 Sandra Loosemore <sloosemore@baylibre.com>
152
153 PR c/120180
154 * c-parser.cc (c_parser_omp_metadirective): Only consume the
155 token if it is the expected close paren.
156
905a156b
GA
1572025-05-27 Jakub Jelinek <jakub@redhat.com>
158
159 PR c/117025
160 * c-parser.cc (c_parser_sizeof_or_countof_expression): Use
161 C2Y rather than C23 in pedwarn_c23.
162
1632025-05-27 Alejandro Colomar <alx@kernel.org>
164
165 PR c/117025
166 * c-parser.cc (c_parser_sizeof_or_countof_expression):
167 Add -Wpedantic diagnostic for _Countof in <= C23 mode.
168
1692025-05-27 Alejandro Colomar <alx@kernel.org>
170 Martin Uecker <uecker@tugraz.at>
171
172 PR c/117025
173 * c-tree.h (in_countof): Add global variable declaration.
174 (c_expr_countof_expr): Add function prototype.
175 (c_expr_countof_type): Add function prototype.
176 * c-decl.cc (start_struct, finish_struct): Add support for
177 _Countof.
178 (start_enum, finish_enum): Add support for _Countof.
179 * c-parser.cc (c_parser_sizeof_expression): New macro.
180 (c_parser_countof_expression): New macro.
181 (c_parser_sizeof_or_countof_expression): Rename function and add
182 support for _Countof.
183 (c_parser_unary_expression): Add RID_COUNTOF entry.
184 * c-typeck.cc (in_countof): Add global variable.
185 (build_external_ref): Add support for _Countof.
186 (record_maybe_used_decl): Add support for _Countof.
187 (pop_maybe_used): Add support for _Countof.
188 (is_top_array_vla): New function.
189 (c_expr_countof_expr, c_expr_countof_type): New functions.
190
4beae371
GA
1912025-05-02 Jakub Jelinek <jakub@redhat.com>
192
193 PR c/120057
194 * c-typeck.cc (check_constexpr_init): Handle RAW_DATA_CST.
195
1962025-05-02 Florian Weimer <fweimer@redhat.com>
197
198 PR c/120055
199 * c-typeck.cc (convert_arguments): Check if fundecl is null
200 before checking for builtin function declaration.
201
fd013e3f
GA
2022025-05-01 Christopher Bazley <chris.bazley@arm.com>
203
204 PR c/119317
205 * c-decl.cc (c_get_loop_names): Do not prematurely
206 end the search for a label that names a loop or
207 switch statement upon encountering a DEBUG_BEGIN_STMT.
208 Instead, ignore any instances of DEBUG_BEGIN_STMT.
209
2102025-05-01 Florian Weimer <fweimer@redhat.com>
211
212 PR c/119950
213 * c-typeck.cc (convert_arguments): Check for built-in
214 function declaration before warning.
215
1c0cbc1b
GA
2162025-04-28 David Malcolm <dmalcolm@redhat.com>
217
218 * c-decl.cc: Drop include of "make-unique.h".
219 Replace uses of ::make_unique with std::make_unique.
220 * c-objc-common.cc: Likewise.
221 * c-parser.cc: Likewise.
222
2232025-04-28 David Malcolm <dmalcolm@redhat.com>
224
225 * c-decl.cc: Include "make-unique.h".
226 (lookup_name_fuzzy): Use ::make_unique rather than "new" when
227 making suggest_missing_header and suggest_missing_option.
228 * c-parser.cc: Include "make-unique.h"
229 (c_parser_error_richloc): Use ::make_unique rather than "new" when
230 making suggest_missing_header.
231
2322025-04-28 Andrew Pinski <quic_apinski@quicinc.com>
233
234 PR c/119432
235 * gimple-parser.cc (gimple_binary_identifier_code): Add
236 __ROTATE_LEFT and __ROTATE_RIGHT.
237
2382025-04-28 Andrew Pinski <quic_apinski@quicinc.com>
239
240 * gimple-parser.cc (gimple_binary_identifier_code): New variable.
241 (c_parser_gimple_binary_expression): Use gimple_binary_identifier_code
242 instead of doing if statements on the strings.
243
fb5bff34
GA
2442025-04-27 H.J. Lu <hjl.tools@gmail.com>
245
246 PR c/48274
247 PR middle-end/112877
248 PR middle-end/118288
249 * c-decl.cc (start_decl): Remove the
250 targetm.calls.promote_prototypes call.
251 (store_parm_decls_oldstyle): Likewise.
252 (finish_function): Likewise.
253 * c-typeck.cc (convert_argument): Likewise.
254 (c_safe_arg_type_equiv_p): Likewise.
255
60130b2d
GA
2562025-04-15 Qing Zhao <qing.zhao@oracle.com>
257
258 PR c/119717
259 * c-typeck.cc (build_access_with_size_for_counted_by): Fully fold the
260 parameters for call to .ACCESS_WITH_SIZE.
261
ca4e6e63
GA
2622025-04-08 Martin Uecker <uecker@tugraz.at>
263
264 PR c/119612
265 * c-tree.h (c_type_tag): Add prototype.
266 * c-typeck.cc (c_type_tag): New function.
267 (tagged_types_tu_compatible_p, composite_type_internal): Use
268 c_type_tag.
269 * c-decl.cc (c_struct_hasher::hash, previous_tag): Use c_type_tag.
270
93acd068
GA
2712025-04-02 Jakub Jelinek <jakub@redhat.com>
272
273 PR c/119582
274 * c-typeck.cc (pointer_diff, build_binary_op): Call c_fully_fold on
275 __sanitizer_ptr_sub or __sanitizer_ptr_cmp arguments.
276
2772025-04-02 Sandra Loosemore <sloosemore@baylibre.com>
278
279 PR middle-end/118965
280 * c-parser.cc (c_parser_omp_clause_init_modifiers): Adjust
281 error message.
282 (c_parser_omp_clause_init): Remove code for recognizing clauses
283 without modifiers. Diagnose missing target/targetsync modifier.
284 (c_finish_omp_declare_variant): Diagnose missing target/targetsync
285 modifier.
286
69a85f1f
GA
2872025-03-28 Jakub Jelinek <jakub@redhat.com>
288
289 * Make-lang.in (c.srcextra): Don't depend on anything and don't copy
290 anything.
291
debe66a1
GA
2922025-03-27 Martin Uecker <uecker@tugraz.at>
293
294 PR c/118765
295 * c-decl.cc (merge_decls): For TYPE_DECLS copy
296 DECL_ORIGINAL_TYPE from the old declaration.
297 * c-typeck.cc (tagged_types_tu_compatible_p): Add
298 checking assertions.
299
7a6bbab6
GA
3002025-03-21 Paul-Antoine Arras <parras@baylibre.com>
301 Tobias Burnus <tburnus@baylibre.com>
302
303 * c-parser.cc (c_parser_omp_clause_destroy): Make addressable.
304 (c_parser_omp_clause_init): Make addressable.
305
c675c9dc
GA
3062025-03-19 Jakub Jelinek <jakub@redhat.com>
307
308 PR c/119350
309 * c-typeck.cc (pop_init_level): Don't ignore empty brackets for
310 flag_isoc23, still set constructor_type to NULL in that case but
311 emit a pedwarn_init in that case.
312
3132025-03-19 Martin Uecker <uecker@tugraz.at>
314
315 PR c/118765
316 * c-decl.cc (finish_struct,finish_enum): Swap direction when
317 copying TYPE_STRUB_DECL in redefinitions.
318
3192025-03-19 Martin Uecker <uecker@tugraz.at>
320
321 PR c/118061
322 * c-typeck.cc (tagged_types_tu_compatible_p): Handle
323 errors in types of struct members.
324
a03e8639
GA
3252025-03-18 Jakub Jelinek <jakub@redhat.com>
326
327 PR c/119311
328 * c-parser.cc (c_parser_if_body): Pass result of c_parser_all_labels
329 as last argument to c_parser_statement_after_labels.
330 (c_parser_else_body): Likewise.
331
3322025-03-18 Jakub Jelinek <jakub@redhat.com>
333
334 PR c/116545
335 * c-parser.cc (c_parser_declaration_or_fndef): Parse
336 __attribute__((musttail)) return.
337 (c_parser_handle_musttail): Diagnose attribute arguments.
338 (c_parser_statement_after_labels): Parse
339 __attribute__((musttail)) return.
340
7efe3aa9
GA
3412025-03-11 Jakub Jelinek <jakub@redhat.com>
342
343 PR c/117178
344 * c-typeck.cc (output_init_element): Pass field to digest_init
345 only for record/union types, otherwise pass constructor_fields
346 if non-NULL and constructor_decl if constructor_fields is NULL.
347
3482025-03-11 Sandra Loosemore <sloosemore@baylibre.com>
349
350 PR c/118579
351 * c-parser.cc (c_parser_omp_variable_list): Capture location
352 information when KIND is OMP_CLAUSE_ERROR.
353 (c_parser_oacc_data_clause_deviceptr): Use the improved location
354 for diagnostics, and remove the FIXME.
355 (c_finish_omp_declare_variant): Likewise.
356 (c_parser_omp_threadprivate): Likewise.
357
e8c2f3a4
GA
3582025-03-07 Kees Cook <kees@kernel.org>
359 Jakub Jelinek <jakub@redhat.com>
360
361 PR c/117178
362 * c-typeck.cc (digest_init): Add DECL argument. Adjust wording of
363 pedwarn_init for too long strings and provide details on the lengths,
364 for string literals where just the trailing NULL doesn't fit warn for
365 warn_cxx_compat with OPT_Wc___compat, wording which mentions "for C++"
366 and provides details on lengths, otherwise for
367 warn_unterminated_string_initialization adjust the warning, provide
368 details on lengths and don't warn if get_attr_nonstring_decl (decl).
369 (build_c_cast, store_init_value, output_init_element): Adjust
370 digest_init callers.
371
3722025-03-07 Andrew Pinski <quic_apinski@quicinc.com>
373
374 PR c/60440
375 * c-typeck.cc (c_finish_return): Mark the current function
376 for supression of the -Wreturn-type if there was an error
377 on the return statement.
378
edd9ad2a
GA
3792025-02-26 Jakub Jelinek <jakub@redhat.com>
380
381 PR c/119001
382 * c-typeck.cc (pop_init_level): Don't clear constructor_type
383 if DECL_CHAIN of constructor_fields is NULL but p->type is UNION_TYPE.
384 Formatting fix.
385 (process_init_element): Diagnose non-static initialization of flexible
386 array member in union or FAM in union initialization in nested context.
387
7de2f64d
GA
3882025-02-25 Jakub Jelinek <jakub@redhat.com>
389
390 PR c/119000
391 * c-parser.cc (c_parser_omp_atomic): For omp write call
392 default_function_array_read_conversion on the rhs expression.
393 Merge the two adjacent if (code == NOP_EXPR) blocks.
394
1fb2146b
GA
3952025-02-11 Sandra Loosemore <sloosemore@baylibre.com>
396
397 * c-parser.cc (c_finish_omp_declare_variant): Update call to
398 omp_check_context_selector.
399 (c_parser_omp_metadirective): Likewise.
400
278bf572
GA
4012025-02-07 Jakub Jelinek <jakub@redhat.com>
402 Jason Merrill <jason@redhat.com>
403
404 PR c++/86769
405 * c-parser.cc (c_parser_while_statement): Add 2 further NULL_TREE
406 operands to build_stmt.
407 (c_parser_for_statement): Likewise.
408
432f988f
GA
4092025-02-04 Richard Biener <rguenther@suse.de>
410
411 PR c/118742
412 * gimple-parser.cc (gimple_parser_build_unary_op): New
413 wrapper around build_unary_op.
414 (c_parser_gimple_unary_expression): Use it.
415
c8cc6863
GA
4162025-01-30 Tobias Burnus <tburnus@baylibre.com>
417
418 * c-parser.cc (c_finish_omp_declare_variant): Modify how
419 append_args is saved internally.
420
2abc555a
GA
4212025-01-28 Jakub Jelinek <jakub@redhat.com>
422
423 PR c/116357
424 * c-decl.cc (grokdeclarator): Use c_build_qualified_type with
425 TYPE_UNQUALIFIED instead of TYPE_MAIN_VARIANT.
426
0710024b
GA
4272025-01-25 Jakub Jelinek <jakub@redhat.com>
428
429 PR c/118639
430 * c-parser.cc (c_parser_omp_variable_list): Remove first variable
431 and emit "expected identifier" error regardless of it.
432
35d5c4f9
GA
4332025-01-23 Jakub Jelinek <jakub@redhat.com>
434
435 PR c++/118604
436 * c-parser.cc (c_parser_omp_metadirective): Rewrite
437 condition for clauses other than when, default and otherwise.
438
e9bd9d42
GA
4392025-01-21 Jakub Jelinek <jakub@redhat.com>
440
441 * c-decl.cc (names_builtin_p): Return 1 for RID_C23_VA_START and
442 RID_VA_ARG.
443
29da6a64
GA
4442025-01-16 Sandra Loosemore <sloosemore@baylibre.com>
445
446 * c-parser.cc (c_parser_omp_assumption_clauses): Give a more specific
447 error message for invalid directives vs unknown names.
448
4492025-01-16 Sandra Loosemore <sloosemore@baylibre.com>
450
451 * c-decl.cc (c_decl_attributes): Don't add "omp declare target
452 block".
453
4542025-01-16 Sandra Loosemore <sloosemore@baylibre.com>
455 Kwok Cheung Yeung <kcy@codesourcery.com>
456 Sandra Loosemore <sandra@codesourcery.com>
457
458 PR middle-end/112779
459 PR middle-end/113904
460 * c-parser.cc (struct c_parser): Add omp_metadirective_state field.
461 (c_parser_skip_to_end_of_block_or_statement): Add metadirective_p
462 parameter and handle skipping over the parentheses in a "for"
463 statement.
464 (struct omp_metadirective_parse_data): New.
465 (mangle_metadirective_region_label): New.
466 (c_parser_label): Mangle label names in a metadirective body.
467 (c_parser_statement_after_labels): Likewise.
468 (c_parser_pragma): Handle PRAGMA_OMP_METADIRECTIVE.
469 (c_parser_omp_context_selector): Allow arbitrary expressions in
470 device_num and condition properties.
471 (c_parser_omp_assumption_clauses): Handle C_OMP_DIR_META.
472 (analyze_metadirective_body): New.
473 (c_parser_omp_metadirective): New.
474
3b3b3f88
GA
4752025-01-14 Sandra Loosemore <sloosemore@baylibre.com>
476 Kwok Cheung Yeung <kcy@codesourcery.com>
477 Sandra Loosemore <sandra@codesourcery.com>
478 Marcel Vollweiler <marcel@codesourcery.com>
479
480 PR middle-end/114596
481 PR middle-end/112779
482 PR middle-end/113904
483 * c-parser.cc (c_finish_omp_declare_variant): Update for changes
484 to omp-general.h interfaces.
485
4862025-01-14 David Malcolm <dmalcolm@redhat.com>
487
488 PR c/116871
489 * c-typeck.cc (pedwarn_permerror_init): Return bool for whether a
490 warning was emitted. Only call print_spelling if we warned.
491 (pedwarn_init): Return bool for whether a warning was emitted.
492 (permerror_init): Likewise.
493 (warning_init): Return bool for whether a
494 warning was emitted. Only call print_spelling if we warned.
495 (class pp_element_quoted_decl): New.
496 (maybe_inform_typedef_location): New.
497 (convert_for_assignment): For OPT_Wincompatible_pointer_types,
498 move auto_diagnostic_group to cover all cases. Use %e and
499 pp_element rather than %qT and tree to colorize the types.
500 Capture whether a warning was emitted, and, if it was,
501 show various notes: for a pointer to a function, show the
502 function decl, for typedef types, and show the decls.
503
422c5884
GA
5042025-01-12 David Malcolm <dmalcolm@redhat.com>
505
506 PR c/118112
507 * c-typeck.cc (inform_declaration): Add "function_expr" param and
508 use it for cases where we couldn't show the function decl to show
509 field decls for callbacks.
510 (build_function_call_vec): Add missing auto_diagnostic_group.
511 Update for new param of inform_declaration.
512 (convert_arguments): Likewise. For the "too many arguments" case
513 add the expected vs actual counts to the message, and if we have
514 it, add the location_t of the first surplus param as a secondary
515 location within the diagnostic. For the "too few arguments" case,
516 determine the minimum number of arguments required and add the
517 expected vs actual counts to the message, tweaking it to "at least"
518 for variadic functions.
519
4951a90e
GA
5202025-01-10 Jakub Jelinek <jakub@redhat.com>
521
522 PR c/118376
523 * c-parser.cc (c_parser_postfix_expression): Call
524 set_c_expr_source_range before break in the __builtin_stdc_rotate_*
525 case.
526
979ca3ba
GA
5272025-01-09 Martin Uecker <uecker@tugraz.at>
528
529 PR c/117866
530 * c-decl.cc (get_parm_info): Change condition for warning.
531
5322025-01-09 Jason Merrill <jason@redhat.com>
533 Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
534
535 PR c/116060
536 * c-typeck.cc (convert_for_assignment): Make sure left hand side and
537 right hand side has identical named types to aid diagnostic output.
538
afb656b0
GA
5392025-01-03 Sandra Loosemore <sloosemore@baylibre.com>
540
541 * c-parser.cc (struct c_parser): Change in_omp_attribute_pragma
542 field to be of type struct omp_attribute_pragma_state.
543 (struct omp_attribute_pragma_state): New.
544 (c_parser_skip_until_found): Use the new way to restore state
545 on EOF.
546 (c_parser_skip_to_pragma_eol): Likewise.
547 (c_parser_handle_statement_omp_attributes): Create an
548 omp_attribute_pragma_state to hold the restore state. Do not
549 store state in tok.flags.
550 (omp_maybe_parse_omp_decl): Likewise.
551
d4b6dfc0
GA
5522025-01-02 David Malcolm <dmalcolm@redhat.com>
553
554 PR c/117629
555 * c-decl.cc (declspecs_add_type): Special-case attempts to use
556 bool as a typedef name or declaration name.
557 * c-errors.cc (get_std_for_keyword): New.
558 (add_note_about_new_keyword): New.
559 * c-parser.cc (report_bad_enum_name): New, split out from...
560 (c_parser_enum_specifier): ...here, adding handling for RID_FALSE
561 and RID_TRUE.
562 * c-tree.h (add_note_about_new_keyword): New decl.
563
cabc4793
GA
5642024-12-18 Tobias Burnus <tburnus@baylibre.com>
565
566 * c-parser.cc (c_parser_omp_clause_init_modifiers): New;
567 split of from ...
568 (c_parser_omp_clause_init): ... here; call it.
569 (c_finish_omp_declare_variant): Parse 'append_args' clause.
570 (c_parser_omp_clause_interop): Set tree used/read.
571
5722024-12-18 Jakub Jelinek <jakub@redhat.com>
573
574 PR c/41045
575 * c-typeck.cc (build_asm_expr): Reject - constraint modifier inside
576 of a function.
577
5782024-12-18 Jakub Jelinek <jakub@redhat.com>
579
580 * c-typeck.cc (build_asm_expr): Diagnose invalid ":" constraint
581 uses.
582
9946ab84
GA
5832024-12-12 Tobias Burnus <tburnus@baylibre.com>
584
585 * c-parser.cc (OMP_DISPATCH_CLAUSE_MASK): Add has_device_addr clause.
586 (c_finish_omp_declare_variant): Add an 'inform' telling the user that
587 'need_device_addr' is invalid for C.
588
8aaff8a1
GA
5892024-12-09 Heiko Eißfeldt <heiko@hexco.de>
590
591 PR c/114541
592 * gimple-parser.cc (c_parser_gimple_parse_bb_spec):
593 Use strtoul with ERANGE check instead of atoi to avoid UB
594 and detect invalid __BB#.
595
2e02cdbc
GA
5962024-12-06 David Malcolm <dmalcolm@redhat.com>
597
598 * c-decl.cc: Include "gcc-urlifier.h".
599 (start_decl): Use auto_urlify_attributes with OPT_Wattributes.
600 (start_function): Likewise.
601 * c-parser.cc: Include "gcc-urlifier.h".
602 (c_parser_statement_after_labels): Use auto_urlify_attributes with
603 OPT_Wattributes.
604 * c-typeck.cc: Include "gcc-urlifier.h".
605 (maybe_warn_nodiscard): Use auto_urlify_attributes with
606 OPT_Wunused_result.
607
6082024-12-06 Jakub Jelinek <jakub@redhat.com>
609
610 * c-parser.cc (c_parser_get_builtin_args, c_parser_expression,
611 c_parser_expr_list): Use RAW_DATA_UCHAR_ELT macro.
612 * c-typeck.cc (digest_init): Use RAW_DATA_UCHAR_ELT and
613 RAW_DATA_SCHAR_ELT macros.
614 (add_pending_init, maybe_split_raw_data): Use RAW_DATA_UCHAR_ELT
615 macro.
616
76b462f2
GA
6172024-12-05 Jakub Jelinek <jakub@redhat.com>
618
619 PR c/107980
620 * c-parser.cc (c_parser_postfix_expression): Handle RID_C23_VA_START.
621
6222024-12-05 Jakub Jelinek <jakub@redhat.com>
623
624 PR c/41045
625 * c-parser.cc (c_parser_asm_string_literal): Add forward declaration.
626 (c_parser_asm_definition): Parse also extended asm without
627 clobbers/labels.
628 * c-typeck.cc (build_asm_expr): Allow extended asm outside of
629 functions and check extra restrictions.
630
f36cb8c7
GA
6312024-12-03 Tobias Burnus <tburnus@baylibre.com>
632
633 * c-parser.cc (c_parser_omp_allocate): Only check scope if
634 not in_omp_decl_attribute. Remove setting the alignment.
635
ff5e235e
GA
6362024-11-30 Martin Uecker <uecker@tugraz.at>
637
638 PR c/117806
639 * c-typeck.cc (composite_type_internal): Call decl_attributes.
640
6412024-11-30 Andrew Pinski <quic_apinski@quicinc.com>
642
643 PR c/117749
644 * gimple-parser.cc (c_parser_gimple_declaration): Check
645 declarator to be non-null.
646
20dcb792
GA
6472024-11-29 Martin Uecker <uecker@tugraz.at>
648
649 PR c/117828
650 * c-typeck.cc (tagged_types_tu_compatible_p): Add check.
651
6522024-11-29 Tejas Belagod <tejas.belagod@arm.com>
653
654 * c-typeck.cc (process_init_element): Add check to restrict
655 constructor length to the minimum vector length allowed.
656
52e56eef
GA
6572024-11-28 Jakub Jelinek <jakub@redhat.com>
658
659 PR c++/116416
660 * c-parser.cc (c_parser_braced_init): Set CONSTRUCTOR_ZERO_PADDING_BITS
661 for flag_isoc23 empty initializers.
662 * c-typeck.cc (constructor_zero_padding_bits): New variable.
663 (struct constructor_stack): Add zero_padding_bits member.
664 (really_start_incremental_init): Save and clear
665 constructor_zero_padding_bits.
666 (push_init_level): Save constructor_zero_padding_bits. Or into it
667 CONSTRUCTOR_ZERO_PADDING_BITS from previous value if implicit.
668 (pop_init_level): Set CONSTRUCTOR_ZERO_PADDING_BITS if
669 constructor_zero_padding_bits and restore
670 constructor_zero_padding_bits.
671
6722024-11-28 David Malcolm <dmalcolm@redhat.com>
673
674 PR c/82892
675 * c-decl.cc (lookup_name_fuzzy): Provide hints for missing
676 command-line options.
677
6782024-11-28 David Malcolm <dmalcolm@redhat.com>
679
680 PR c++/87850
681 * c-typeck.cc (compatible_types_for_indirection_note_p): New
682 function.
683 (convert_for_assignment): Call maybe_emit_indirection_note for
684 pointer vs non-pointer diagnostics.
685
7a656d74
GA
6862024-11-27 Joseph Myers <josmyers@redhat.com>
687
688 PR c/91193
689 * c-parser.cc (c_parser_maybe_reclassify_token): Define earlier.
690 (c_parser_declaration_or_fndef): Call
691 c_parser_maybe_reclassify_token before parsing old-style parameter
692 definitions.
693
6942024-11-27 Jakub Jelinek <jakub@redhat.com>
695
696 PR c/117745
697 * c-parser.cc (c_parser_sizeof_expression): If type_name is NULL,
698 just expr.set_error () and goto sizeof_expr instead of doing error
699 recovery manually.
700
7012024-11-27 Joseph Myers <josmyers@redhat.com>
702
703 PR c/117781
704 * c-parser.cc (c_parser_typeof_specifier): Do not remove _Atomic
705 from array element type for typeof_unqual.
706
7072024-11-27 Florian Weimer <fweimer@redhat.com>
708
709 * c-parser.cc (c_parser_compound_statement_nostart): Use
710 OPT_Wfree_labels for warning about labels on declarations.
711 (c_parser_compound_statement_nostart): Use OPT_Wfree_labels
712 for warning about labels at end of compound statements.
713
74cee438
GA
7142024-11-26 David Malcolm <dmalcolm@redhat.com>
715
716 PR c/94370
717 * c-typeck.cc (c_build_functype_attribute_variant): Reword
718 warning message to avoid double-negative.
719
7202024-11-26 Joseph Myers <josmyers@redhat.com>
721
722 PR c/98195
723 PR c/117755
724 * c-typeck.cc (build_atomic_assign): Always create a TARGET_EXPR
725 for newval even in case of error from binary operation.
726 (build_modify_expr): Check early for incomplete type of rhs.
727
97717af3
GA
7282024-11-24 Andrew Pinski <quic_apinski@quicinc.com>
729
730 PR c/117741
731 * gimple-parser.cc (c_parser_gimple_compound_statement): Handle
732 CPP_CLOSE_PAREN/CPP_CLOSE_SQUARE with an error and skipping the token.
733
8223841b
GA
7342024-11-22 Andrew Pinski <quic_apinski@quicinc.com>
735
736 PR bootstrap/117737
737 * c-aux-info.cc (INCLUDE_MEMORY): Remove.
738 * c-convert.cc (INCLUDE_MEMORY): Remove.
739 * c-decl.cc (INCLUDE_MEMORY): Remove.
740 * c-errors.cc (INCLUDE_MEMORY): Remove.
741 * c-fold.cc (INCLUDE_MEMORY): Remove.
742 * c-lang.cc (INCLUDE_MEMORY): Remove.
743 * c-objc-common.cc (INCLUDE_MEMORY): Remove.
744 * c-parser.cc (INCLUDE_MEMORY): Remove.
745 * c-typeck.cc (INCLUDE_MEMORY): Remove.
746 * gimple-parser.cc (INCLUDE_MEMORY): Remove.
747
7482024-11-22 Joseph Myers <josmyers@redhat.com>
749
750 PR c/112841
751 * c-parser.cc (c_parser_typeof_specifier): Call strip_array_types
752 when checking for type qualifiers for typeof_unqual.
753
7542024-11-22 Tobias Burnus <tburnus@baylibre.com>
755
756 * c-parser.cc (c_parser_omp_clause_interop): New.
757 (c_parser_omp_clause_name, c_parser_omp_all_clauses,
758 c_parser_omp_dispatch_body): Handle 'interop' clause.
759 * c-typeck.cc (c_finish_omp_clauses): Likewise.
760
7612024-11-22 Tobias Burnus <tburnus@baylibre.com>
762
763 * c-parser.cc (INCLUDE_STRING): Define.
764 (c_parser_pragma): Handle 'interop' directive.
765 (c_parser_omp_clause_name): Handle init, use, and destroy clauses.
766 (c_parser_omp_all_clauses): Likewise; use C_ORT_OMP_INTEROP, if
767 'use' is permitted, for c_finish_omp_clauses.
768 (c_parser_omp_clause_destroy, c_parser_omp_modifier_prefer_type,
769 c_parser_omp_clause_init, c_parser_omp_clause_use,
770 OMP_INTEROP_CLAUSE_MASK, c_parser_omp_interop): New.
771 * c-typeck.cc (c_finish_omp_clauses): Add missing OPT_Wopenmp to
772 a warning; handle new clauses.
773
8500a8c3
GA
7742024-11-21 Joseph Myers <josmyers@redhat.com>
775
776 PR c/114816
777 * c-decl.cc (grokparms): Do not warn for void parameter type here.
778 (get_parm_info): Give errors for void parameters even when named.
779
cf261dd5
GA
7802024-11-20 Joseph Myers <josmyers@redhat.com>
781
782 PR c/114266
783 * c-decl.cc (build_compound_literal): Diagnose array of unknown
784 size with empty initializer for C23.
785
7862024-11-20 Paul-Antoine Arras <parras@baylibre.com>
787
788 * c-parser.cc (c_parser_omp_dispatch): New function.
789 (c_parser_omp_clause_name): Handle nocontext and novariants clauses.
790 (c_parser_omp_clause_novariants): New function.
791 (c_parser_omp_clause_nocontext): Likewise.
792 (c_parser_omp_all_clauses): Handle nocontext and novariants clauses.
793 (c_parser_omp_dispatch_body): New function adapted from
794 c_parser_expr_no_commas.
795 (OMP_DISPATCH_CLAUSE_MASK): Define.
796 (c_parser_omp_dispatch): New function.
797 (c_finish_omp_declare_variant): Parse adjust_args.
798 (c_parser_omp_construct): Handle PRAGMA_OMP_DISPATCH.
799 * c-typeck.cc (c_finish_omp_clauses): Handle OMP_CLAUSE_NOVARIANTS and
800 OMP_CLAUSE_NOCONTEXT.
801
8022024-11-20 Joseph Myers <josmyers@redhat.com>
803
804 PR c/115515
805 * c-typeck.cc (check_constexpr_init): Do not call int_fits_type_p
806 for arguments that are not integer constant expressions.
807
b597edbd
GA
8082024-11-19 Joseph Myers <josmyers@redhat.com>
809
810 PR c/114869
811 * c-decl.cc (c_init_decl_processing): Register nullptr_type_node
812 as typeof (nullptr) not nullptr_t.
813
8142024-11-19 Jakub Jelinek <jakub@redhat.com>
815
816 PR c/117456
817 * c-parser.cc (c_parser_postfix_expression): Use LROTATE_EXPR
818 or RROTATE_EXPR only if type_has_mode_precision_p or if arg1
819 has BITINT_TYPE with precision larger than MAX_FIXED_MODE_SIZE.
820 Otherwise build BIT_IOR_EXPR of LSHIFT_EXPR and RSHIFT_EXPR
821 and wrap it into a COND_EXPR depending on if arg2 is 0 or not.
822 * c-fold.cc (c_fully_fold_internal): Check for suppression of
823 -Wshift-count-overflow warning.
824
8252024-11-19 Martin Uecker <uecker@tugraz.at>
826
827 PR c/117490
828 * c-typeck.cc (tagged_types_tu_compatible): Form equivalence
829 classed for tagless types in C23.
830
4958fe22
GA
8312024-11-18 Joseph Myers <josmyers@redhat.com>
832
833 PR c/112556
834 * c-typeck.cc (convert_for_assignment): Allow conversion of
835 ENUMERAL_TYPE and BOOLEAN_TYPE null pointer constants to pointers.
836
24da8634
GA
8372024-11-17 Florian Weimer <fweimer@redhat.com>
838
839 PR c/95445
840 * c-decl.cc (start_function): Warn about parameters
841 after parameter-less declaration.
842 * c-typeck.cc (build_function_call_vec): Pass fntype
843 to convert_arguments.
844 (convert_arguments): Change argument to fntype and
845 compute typelist. Warn about parameter list mismatches
846 on first parameter.
847
a649efea
GA
8482024-11-16 Martin Uecker <uecker@tugraz.at>
849
850 PR c/117548
851 * c-decl.cc (finish_struct): Add checking assertion.
852 * c-typeck.cc (c_type_original): New function.
853 (composite_types_internal): Get tag from original type.
854
349368ae
GA
8552024-11-15 Florian Weimer <fweimer@redhat.com>
856
857 * c-decl.cc (store_parm_decls_newstyle): Use
858 OPT_Wmissing_parameter_name for missing parameter name
859 warning.
860 * c-errors.cc (pedwarn_c11): Enable fine-grained warning
861 control via the option_id argument.
862
8632024-11-15 Jakub Jelinek <jakub@redhat.com>
864
865 * c-tree.h (enum c_typespec_keyword): Add cts_dfloat64x and adjust
866 comment.
867 * c-parser.cc (c_keyword_starts_typename, c_token_starts_declspecs,
868 c_parser_declspecs, c_parser_gnu_attribute_any_word): Handle
869 RID_DFLOAT64X.
870 (c_parser_postfix_expression): Handle _Decimal64x arguments in
871 __builtin_tgmath.
872 (warn_for_abs): Handle BUILT_IN_FABSD64X.
873 * c-decl.cc (declspecs_add_type): Handle cts_dfloat64x and
874 RID_DFLOAT64X.
875 (finish_declspecs): Handle cts_dfloat64x.
876 * c-typeck.cc (c_common_type): Handle dfloat64x_type_node.
877
5673fc0c
GA
8782024-11-13 Martin Uecker <uecker@tugraz.at>
879
880 PR c/117059
881 * c-typeck.cc (parse_build_binary_op): Add warning.
882 (build_conditional_expr): Add warning.
883 (convert_for_assignment): Add warning.
884
03cb3f60
GA
8852024-11-11 Jakub Jelinek <jakub@redhat.com>
886
887 * c-decl.cc (names_builtin_p): Change return type from
888 bool to int, adjust return statments.
889
3ff87b18
GA
8902024-11-09 Martin Uecker <uecker@tugraz.at>
891
892 PR c/116284
893 PR c/117391
894 * c-tree.h (c_type_unspecified_p): New inline function.
895 * c-typeck.cc (c_build_array_type_unspecified): New function.
896 (comptypes_interal): Remove useless code.
897 (composite_type_internal): Update.
898 * c-decl.cc (grokdeclarator): Revise.
899
9002024-11-08 Marek Polacek <polacek@redhat.com>
901
902 PR c/117019
903 * c-parser.cc (c_parser_declaration_or_fndef): Adjust declaration.
904 (c_parser_external_declaration): Adjust a call to
905 c_parser_declaration_or_fndef.
906 (c_parser_declaration_or_fndef): New bool parameter. Return a tree
907 instead of void. Adjust for N3356. Adjust a call to
908 c_parser_declaration_or_fndef.
909 (c_parser_compound_statement_nostart): Adjust calls to
910 c_parser_declaration_or_fndef.
911 (c_parser_selection_header): New.
912 (c_parser_paren_selection_header): New.
913 (c_parser_if_statement): Call c_parser_paren_selection_header
914 instead of c_parser_paren_condition.
915 (c_parser_switch_statement): Call c_parser_selection_header instead of
916 c_parser_expression.
917 (c_parser_for_statement): Adjust calls to c_parser_declaration_or_fndef.
918 (c_parser_objc_methodprotolist): Likewise.
919 (c_parser_oacc_routine): Likewise.
920 (c_parser_omp_loop_nest): Likewise.
921 (c_parser_omp_declare_simd): Likewise.
922
f0d34e8a
GA
9232024-11-05 Andrew Pinski <quic_apinski@quicinc.com>
924
925 PR c/117445
926 * gimple-parser.cc (c_parser_gimple_statement): Remove
927 support for comparisons before the querry (`?`) token.
928
441676b5
GA
9292024-11-01 David Malcolm <dmalcolm@redhat.com>
930
931 PR bootstrap/117361
932 * Make-lang.in (s-selftest-c): Use GCC_FOR_SELFTESTS.
933 (selftest-c-gdb): Likewise.
934 (selftest-c-valgrind): Likewise.
935
9362024-10-31 Martin Uecker <uecker@tugraz.at>
937
938 PR c/117145
939 PR c/117245
940 PR c/100420
941 * c-decl.cc (c_build_pointer_type): Move to c-typeck.cc
942 (grokdeclarator): Simplify logic.
943 (match_builtin_function_types): Adapt.
944 (push_decl): Adapt.
945 (implicitly_declare): Adapt.
946 (c_update_type_canonical): Adapt.
947 (c_make_fname_decl): Adapt.
948 (start_function): Adapt.
949 * c-objc-common.h: Add LANG_HOOKS_RECONSTRUCT_COMPLEX_TYPE.
950 * c-tree.h: Add prototypes.
951 * c-typeck.cc (c_verify_type): New function.
952 (c_set_type_bits). New function.
953 (c_build_pointer_type): Moved from c-decl.cc.
954 (c_build_pointer_type_for_mode): New function.
955 (c_build_function_type): New function.
956 (c_build_array_type): New function.
957 (c_build_type_attribute_variant): New function.
958 (c_reconstruct_complex_type): New function.
959 (c_build_functype_attribute_variant): Renamed.
960 (array_to_pointer_conversion): Simplify logic.
961 (composite_type_internal): Simplify logic..
962 (build_unary_op): Simplify logic..
963 (comptypes_verify): Add checking assertions.
964 (c_build_qualified_type): Add checking assertions.
965 (c_build_function_call_vec): Adapt.
966 (qualify_type): Adapt.
967 (build_functype_attribute_variant): Adapt.
968 (common_pointer_type): Adapt.
969 (c_common_type): Adapt.
970 (convert_for_assignment): Adapt.
971 (type_or_builtin_type): Adapt.
972 (build_access_with_size_for_counted_by): Adapt.
973 (build_conditional_expr): Adapt.
974 (build_modify_expr): Adapt.
975 (build_binary_op): Adapt.
976 (build_omp_array_section): Adapt.
977 (handle_omp_array_sections): Adapt.
978 (c_finish_omp_clauses): Adapt.
979 * c-parser.cc (c_parser_typeof_specifier): Adapt.
980 (c_parser_generic_selection): Adapt.
981
717051a6
GA
9822024-10-30 Jakub Jelinek <jakub@redhat.com>
983
984 * c-parser.cc (c_parser_postfix_expression): Diagnose if
985 first __builtin_stdc_* argument has char type even when
986 -funsigned-char.
987
17643e5a
GA
9882024-10-29 David Malcolm <dmalcolm@redhat.com>
989
990 PR other/116613
991 * c-objc-common.cc: Include "make-unique.h".
992 (c_initialize_diagnostics): Use unique_ptr for pretty_printer.
993 Use context->set_format_decoder.
994
9952024-10-29 Jakub Jelinek <jakub@redhat.com>
996
997 PR c/117030
998 * c-parser.cc: Include asan.h and c-family/c-ubsan.h.
999 (c_parser_postfix_expression): Handle __builtin_stdc_rotate_left
1000 and __builtin_stdc_rotate_right.
1001 * c-fold.cc (c_fully_fold_internal): Handle LROTATE_EXPR and
1002 RROTATE_EXPR.
1003
c232f921
GA
10042024-10-25 Jakub Jelinek <jakub@redhat.com>
1005
1006 * c-typeck.cc: Remove trailing whitespace.
1007 * gimple-parser.cc: Likewise.
1008 * c-parser.cc: Likewise.
1009 * c-decl.cc: Likewise.
1010
10112024-10-24 David Malcolm <dmalcolm@redhat.com>
1012 Gaius Mulley <gaiusmod2@gmail.com>
1013
1014 PR other/116613
1015 * c-aux-info.cc: Add #define INCLUDE_MEMORY.
1016 * c-convert.cc: Likewise.
1017 * c-errors.cc: Likewise.
1018 * c-fold.cc: Likewise.
1019 * c-lang.cc: Likewise.
1020 * c-objc-common.cc: Likewise.
1021 (pp_markup::element_quoted_type::print_type): Use unique_ptr.
1022 * c-typeck.cc: Add #define INCLUDE_MEMORY.
1023 * gimple-parser.cc: Likewise.
1024
01ed5c62
GA
10252024-10-23 Joseph Myers <josmyers@redhat.com>
1026
1027 * c-decl.cc (c_struct_parse_info): Add member refloc.
1028 (start_struct): Store refloc in struct_parse_info.
1029 (finish_struct): Give "originally defined" message for C23 struct
1030 redefinition errors.
1031
10322024-10-22 Jakub Jelinek <jakub@redhat.com>
1033
1034 PR c/117190
1035 * c-parser.cc (c_parser_initval): Revert 2024-10-17 changes.
1036 Instead peek the 4th token and if it is not CPP_NUMBER,
1037 handle it like 3rd token CPP_CLOSE_BRACE for orig_len == INT_MAX.
1038 Also, check (2 + 2 * i)th raw token for the orig_len == INT_MAX
1039 case and punt if it is not CPP_NUMBER.
1040
2553983e
GA
10412024-10-19 Joseph Myers <josmyers@redhat.com>
1042
1043 * c-tree.h (c_arg_info): Add c23_empty_parens.
1044 * c-decl.cc (grokparms): Set c23_empty_parens.
1045 (build_arg_info): Clear c23_empty_parens.
1046 (store_parm_decls_newstyle): Do not give -Wtraditional warning for
1047 ISO C function definition if c23_empty_parens.
1048
de14559e
GA
10492024-10-18 Alejandro Colomar <alx@kernel.org>
1050
1051 * c-decl.cc (one_element_array_type_p, get_parm_array_spec)
1052 * c-fold.cc (c_fold_array_ref):
1053 Rename array_type_nelts => array_type_nelts_minus_one
1054
10552024-10-17 Jakub Jelinek <jakub@redhat.com>
1056
1057 PR c/117177
1058 * c-parser.cc (c_parser_initval): Instead of doing
1059 orig_len == INT_MAX checks before consuming tokens to set
1060 last = 1, check it after consuming it and if not followed
1061 by CPP_COMMA CPP_NUMBER, call process_init_element once
1062 more with the last CPP_NUMBER.
1063
10642024-10-16 Jakub Jelinek <jakub@redhat.com>
1065
1066 * c-decl.cc (c_get_loop_names): Add checking assert that
1067 c is non-NULL in the loop.
1068 (c_finish_bc_name): Likewise.
1069
10702024-10-16 Jakub Jelinek <jakub@redhat.com>
1071
1072 * c-parser.cc (c_parser_expression): Initialize next.original_type
1073 to integer_type_node for the CPP_EMBED case.
1074
d9e02add
GA
10752024-10-16 Jakub Jelinek <jakub@redhat.com>
1076
1077 * c-tree.h (c_maybe_optimize_large_byte_initializer): Declare.
1078 * c-parser.cc (c_parser_initval): Attempt to optimize large char array
1079 initializers into RAW_DATA_CST.
1080 * c-typeck.cc (c_maybe_optimize_large_byte_initializer): New function.
1081
10822024-10-16 Jakub Jelinek <jakub@redhat.com>
1083
1084 * c-parser.cc (c_parser_braced_init): Handle CPP_EMBED.
1085 (c_parser_get_builtin_args): Likewise.
1086 (c_parser_expression): Likewise.
1087 (c_parser_expr_list): Likewise.
1088 * c-typeck.cc (digest_init): Handle RAW_DATA_CST. Formatting fix.
1089 (init_node_successor): New function.
1090 (add_pending_init): Handle RAW_DATA_CST.
1091 (set_nonincremental_init): Formatting fix.
1092 (output_init_element): Handle RAW_DATA_CST. Formatting fixes.
1093 (maybe_split_raw_data): New function.
1094 (process_init_element): Use maybe_split_raw_data. Handle
1095 RAW_DATA_CST.
1096
10972024-10-15 Qing Zhao <qing.zhao@oracle.com>
1098
1099 PR c/116016
1100 * c-decl.cc (names_builtin_p): Add RID_BUILTIN_COUNTED_BY_REF.
1101 * c-parser.cc (has_counted_by_object): New routine.
1102 (get_counted_by_ref): New routine.
1103 (c_parser_postfix_expression): Handle New RID_BUILTIN_COUNTED_BY_REF.
1104 * c-tree.h: New routine handle_counted_by_for_component_ref.
1105 * c-typeck.cc (handle_counted_by_for_component_ref): New routine.
1106 (build_component_ref): Call the new routine.
1107
11082024-10-15 Jakub Jelinek <jakub@redhat.com>
1109
1110 PR c/117022
1111 * c-tree.h: Implement C2Y N3355 - Named loops.
1112 (C_DECL_LOOP_NAME, C_DECL_SWITCH_NAME, C_DECL_LOOP_SWITCH_NAME_VALID,
1113 C_DECL_LOOP_SWITCH_NAME_USED, IN_NAMED_STMT): Define.
1114 (c_get_loop_names, c_release_loop_names, c_finish_bc_name): Declare.
1115 (c_start_switch): Add NAME argument.
1116 (c_finish_bc_stmt): Likewise.
1117 * c-lang.h (struct language_function): Add loop_names and
1118 loop_names_hash members.
1119 * c-parser.cc (c_parser_external_declaration,
1120 c_parser_declaration_or_fndef, c_parser_struct_or_union_specifier,
1121 c_parser_parameter_declaration): Adjust c_parser_pragma caller.
1122 (get_before_labels): New function.
1123 (c_parser_compound_statement_nostart): Call get_before_labels when
1124 needed, adjust c_parser_pragma and c_parser_statement_after_labels
1125 callers.
1126 (c_parser_statement): Call get_before_labels first and pass it to
1127 c_parser_statement_after_labels.
1128 (c_parser_bc_name): New function.
1129 (c_parser_statement_after_labels): Add BEFORE_LABELS argument. Pass
1130 it down to c_parser_switch_statement, c_parser_while_statement,
1131 c_parser_do_statement, c_parser_for_statement and c_parser_pragma.
1132 Call c_parser_bc_name for RID_BREAK and RID_CONTINUE and pass it as
1133 another argument to c_finish_bc_stmt.
1134 (c_parser_if_body, c_parser_else_body): Call get_before_labels
1135 early and pass it to c_parser_statement_after_labels.
1136 (c_parser_switch_statement): Add BEFORE_LABELS argument. Call
1137 c_get_loop_names, if named, pass switch_name to c_start_switch,
1138 mark it valid and set IN_NAMED_STMT bit in in_statement before
1139 parsing body, otherwise clear IN_NAMED_STMT bit before that parsing.
1140 Run c_release_loop_names at the end.
1141 (c_parser_while_statement, c_parser_do_statement,
1142 c_parser_for_statement): Add BEFORE_LABELS argument. Call
1143 c_get_loop_names, if named, mark it valid and set IN_NAMED_STMT bit
1144 in in_statement before parsing body, otherwise clear IN_NAMED_STMT
1145 before that parsing, arrange for the loop name if used to be
1146 another *_STMT argument.
1147 (c_parser_objc_class_instance_variables,
1148 c_parser_objc_methodprotolist): Adjust c_parser_pragma callers.
1149 (c_parser_pragma): Add BEFORE_LABELS argument. Pass it down to
1150 c_parser_for_statement, c_parser_while_statement or
1151 c_parser_do_statement.
1152 (c_parser_omp_loop_nest, c_maybe_parse_omp_decl): Adjust
1153 c_parser_pragma callers.
1154 * c-decl.cc (loop_names, loop_names_hash): New static variables.
1155 (add_stmt): Set STATEMENT_LIST_HAS_LABEL after push_stmt_list rather
1156 than before it.
1157 (c_push_function_context): Save and clear loop_names and
1158 loop_names_hash.
1159 (c_pop_function_context): Release or delete, restore and clear
1160 loop_names and loop_names_hash.
1161 (c_get_loop_names, c_release_loop_names, c_finish_bc_name): New
1162 functions.
1163 * c-typeck.cc (c_start_switch): Add SWITCH_NAME argument, pass it down
1164 to build_stmt.
1165 (c_finish_bc_stmt): Add NAME argument. Mark of IN_NAMED_STMT bit
1166 of in_statement in swtiches. Use label for IN_OBJC_FOREACH only if
1167 name is NULL. If name is non-NULL and C_DECL_LOOP_NAME and
1168 C_DECL_SWITCH_NAME are both set, assume outer ObjC foreach and
1169 dig labels from DECL_CHAIN of name. Pass NAME to build_stmt
1170 otherwise.
1171
14870c1f
GA
11722024-10-07 qing zhao <qing.zhao@oracle.com>
1173
1174 PR c/116735
1175 * c-decl.cc (verify_counted_by_attribute): Remove the attribute
1176 when error.
1177
11782024-10-07 Tobias Burnus <tburnus@baylibre.com>
1179
1180 * c-parser.cc (c_parser_omp_allocate): Set alignment for alignof;
1181 accept static variables and fix predef allocator check.
1182
9d76276b
GA
11832024-09-25 Tobias Burnus <tburnus@baylibre.com>
1184
1185 * c-parser.cc (c_parser_omp_declare_target): Set target-used bit
1186 in omp_requires_mask.
1187
2d8392c4
GA
11882024-09-24 Tobias Burnus <tburnus@baylibre.com>
1189
1190 * c-parser.cc (c_parser_omp_requires): Handle self_maps clause.
1191
c8f19fab
GA
11922024-09-20 Martin Uecker <uecker@tugraz.at>
1193
1194 PR c/116726
1195 * c-typeck.cc (tagged_types_tu_compatible_p): Restore value
1196 of the cache after recursing into comptypes_internal.
1197
852cff82
GA
11982024-09-09 David Malcolm <dmalcolm@redhat.com>
1199
1200 * c-errors.cc (pedwarn_c23): Use "diagnostic_option_id option_id"
1201 rather than "int opt". Update for renaming of diagnostic_info
1202 field.
1203 (pedwarn_c11): Likewise.
1204 (pedwarn_c99): Likewise.
1205 (pedwarn_c90): Likewise.
1206 * c-tree.h (pedwarn_c90): Likewise for decl.
1207 (pedwarn_c99): Likewise.
1208 (pedwarn_c11): Likewise.
1209 (pedwarn_c23): Likewise.
1210
12112024-09-09 David Malcolm <dmalcolm@redhat.com>
1212
1213 PR other/116613
1214 * c-objc-common.cc (c_initialize_diagnostics): Rename
1215 diagnostic_context's "printer" field to "m_printer".
1216
a523c2ba
GA
12172024-09-06 Jason Merrill <jason@redhat.com>
1218
1219 PR c++/46457
1220 PR c++/81665
1221 * c-objc-common.h (c_objc_attribute_table): Add
1222 c_common_clang_attribute_table.
1223
55024148
GA
12242024-09-03 David Malcolm <dmalcolm@redhat.com>
1225
1226 * c-objc-common.cc (print_type): Prefix all output_buffer fields
1227 with "m_".
1228
519ec1cf
GA
12292024-09-02 Richard Sandiford <richard.sandiford@arm.com>
1230
1231 * c-typeck.cc (build_asm_expr): Rename ASM_INPUT_P to ASM_BASIC_P.
1232
49fd9b33
GA
12332024-08-31 Jakub Jelinek <jakub@redhat.com>
1234
1235 PR c/116130
1236 * c-decl.cc (handle_std_unsequenced_attribute): New function.
1237 (handle_std_reproducible_attribute): Likewise.
1238 (std_attributes): Add entries for "unsequenced" and "reproducible"
1239 attributes.
1240 (c_warn_type_attributes): Add TYPE argument. Allow unsequenced
1241 or reproducible attributes if it is FUNCTION_TYPE.
1242 (groktypename): Adjust c_warn_type_attributes caller.
1243 (grokdeclarator): Likewise.
1244 (finish_declspecs): Likewise.
1245 * c-parser.cc (c_parser_declaration_or_fndef): Likewise.
1246 * c-tree.h (c_warn_type_attributes): Add TYPE argument.
1247
350d627d
GA
12482024-08-29 David Malcolm <dmalcolm@redhat.com>
1249
1250 * c-objc-common.cc (c_tree_printer): Convert final param from
1251 const char ** to pp_token_list &.
1252
db9834ae
GA
12532024-08-02 Martin Uecker <uecker@tugraz.at>
1254
1255 * c-decl.cc (grokdeclarator, finish_struct): Set and
1256 propagate TYPE_TYPELESS_STORAGE.
1257
daedc197
GA
12582024-07-23 Andi Kleen <ak@linux.intel.com>
1259
1260 PR c/83324
1261 * c-parser.cc (struct attr_state): Define with musttail_p.
1262 (c_parser_statement_after_labels): Handle [[musttail]].
1263 (c_parser_std_attribute): Dito.
1264 (c_parser_handle_musttail): Dito.
1265 (c_parser_compound_statement_nostart): Dito.
1266 (c_parser_all_labels): Dito.
1267 (c_parser_statement): Dito.
1268 * c-tree.h (c_finish_return): Add musttail_p flag.
1269 * c-typeck.cc (c_finish_return): Handle musttail_p flag.
1270
6d811c15
GA
12712024-07-20 Andi Kleen <ak@gcc.gnu.org>
1272
1273 Revert:
1274 2024-07-20 Andi Kleen <ak@linux.intel.com>
1275
1276 PR c/83324
1277 * c-parser.cc (struct attr_state): Define with musttail_p.
1278 (c_parser_statement_after_labels): Handle [[musttail]].
1279 (c_parser_std_attribute): Dito.
1280 (c_parser_handle_musttail): Dito.
1281 (c_parser_compound_statement_nostart): Dito.
1282 (c_parser_all_labels): Dito.
1283 (c_parser_statement): Dito.
1284 * c-tree.h (c_finish_return): Add musttail_p flag.
1285 * c-typeck.cc (c_finish_return): Handle musttail_p flag.
1286
12872024-07-20 Andi Kleen <ak@linux.intel.com>
1288
1289 PR c/83324
1290 * c-parser.cc (struct attr_state): Define with musttail_p.
1291 (c_parser_statement_after_labels): Handle [[musttail]].
1292 (c_parser_std_attribute): Dito.
1293 (c_parser_handle_musttail): Dito.
1294 (c_parser_compound_statement_nostart): Dito.
1295 (c_parser_all_labels): Dito.
1296 (c_parser_statement): Dito.
1297 * c-tree.h (c_finish_return): Add musttail_p flag.
1298 * c-typeck.cc (c_finish_return): Handle musttail_p flag.
1299
8ccfa571
GA
13002024-07-14 Alejandro Colomar <alx@kernel.org>
1301
1302 PR c/115185
1303 * c-typeck.cc (digest_init): Separate warnings about character
1304 arrays being initialized as unterminated character sequences
1305 with string literals, from -Wc++-compat, into a new warning,
1306 -Wunterminated-string-initialization.
1307
944e4251
GA
13082024-07-13 David Malcolm <dmalcolm@redhat.com>
1309
1310 * c-objc-common.cc: Include "tree-pretty-print-markup.h".
1311 (print_type): Add optional "highlight_color" param and use it
1312 to show highlight colors in "aka" text.
1313 (pp_markup::element_quoted_type::print_type): New.
1314 * c-typeck.cc: Include "tree-pretty-print-markup.h".
1315 (comp_parm_types): New.
1316 (build_function_call_vec): Pass it to check_function_arguments.
1317 (inform_for_arg): Use %e and highlight colors to contrast actual
1318 versus expected.
1319 (convert_for_assignment): Use highlight_colors::actual for the
1320 rhs_label.
1321 (build_binary_op): Use highlight_colors::lhs and highlight_colors::rhs
1322 for the ranges.
1323
f777ab31
GA
13242024-07-10 Marek Polacek <polacek@redhat.com>
1325
1326 PR c/115642
1327 * c-typeck.cc (c_cast_expr): Return error_mark_node if build_c_cast
1328 failed.
1329
13302024-07-10 Marek Polacek <polacek@redhat.com>
1331
1332 PR c/115549
1333 * c-decl.cc (c_decl_attributes): If lookup_last_decl returns
1334 error_mark_node, use NULL_TREE as last_decl.
1335
0dcfef42
GA
13362024-07-09 Martin Uecker <uecker@tugraz.at>
1337
1338 PR c/114727
1339 * c-typeck.cc (tagged_types_tu_compatible): Add test.
1340
13412024-07-09 Martin Uecker <uecker@tugraz.at>
1342
1343 PR c/115696
1344 * c-typeck.cc (comptypes_verify): Bail out for
1345 identical, empty, and erroneous input types.
1346
13472024-07-09 Jakub Jelinek <jakub@redhat.com>
1348
1349 * c-parser.cc (c_parser_omp_tile_sizes): Use c_parser_expr_list.
1350
4fda39e7
GA
13512024-06-27 Martin Uecker <uecker@tugraz.at>
1352
1353 * c-parser.cc (c_parser_direct_declarator_inner): Add
1354 error message.
1355
9c56dc7f
GA
13562024-06-26 David Malcolm <dmalcolm@redhat.com>
1357
1358 * c-parser.cc (c_parser_require): Pass *global_dc to
1359 gcc_rich_location::add_location_if_nearby.
1360
9fe669ce
GA
13612024-06-25 Sandra Loosemore <sloosemore@baylibre.com>
1362
1363 PR c/115587
1364 * c-parser.cc (c_parser_omp_loop_nest): Move initializations to
1365 point of declaration.
1366
13672024-06-25 Jakub Jelinek <jakub@redhat.com>
1368 Martin Uecker <uecker@tugraz.at>
1369
1370 PR c/114930
1371 PR c/115502
1372 * c-decl.cc (c_update_type_canonical): Assert t is main variant
1373 with 0 TYPE_QUALS. Simplify and don't use check_qualified_type.
1374 Deal with the case where build_qualified_type returns
1375 TYPE_STRUCTURAL_EQUALITY_P type.
1376
a008fa34
GA
13772024-06-18 Martin Uecker <uecker@tugraz.at>
1378
1379 PR c/115109
1380 * c-decl.cc (build_enumerator): When redeclaring an
1381 enumerator convert value to previous type. For redeclared
1382 enumerators use underlying type for computing the next value.
1383
028cd77d
GA
13842024-06-13 Joseph Myers <josmyers@redhat.com>
1385
1386 * c-typeck.cc (build_unary_op): Use pedwarn_c23 for complex
1387 increment and decrement.
1388
158ce8ad
GA
13892024-06-12 David Malcolm <dmalcolm@redhat.com>
1390
1391 * c-objc-common.cc (print_type): Update for fields of
1392 pretty_printer becoming private.
1393 (c_tree_printer): Likewise.
1394
7fa4b335
GA
13952024-06-11 Joseph Myers <josmyers@redhat.com>
1396
1397 * c-errors.cc (pedwarn_c23): New.
1398 * c-parser.cc (disable_extension_diagnostics)
1399 (restore_extension_diagnostics): Save and restore
1400 warn_c23_c2y_compat.
1401 (c_parser_generic_selection): Handle type name as controlling
1402 operand. Allow incomplete and function types subject to
1403 pedwarn_c23 calls.
1404 * c-tree.h (pedwarn_c23): New.
1405
6af18e8c
GA
14062024-06-06 Jakub Jelinek <jakub@redhat.com>
1407
1408 PR c/114493
1409 * c-decl.cc (c_fixup_may_alias): New function.
1410 (finish_struct): Call it if "may_alias" attribute is
1411 specified.
1412
10cb3336
GA
14132024-06-05 Jakub Jelinek <jakub@redhat.com>
1414 Frederik Harwath <frederik@codesourcery.com>
1415 Sandra Loosemore <sandra@codesourcery.com>
1416
1417 * c-parser.cc (c_parser_skip_std_attribute_spec_seq): New function.
1418 (check_omp_intervening_code): Reject imperfectly nested tile.
1419 (c_parser_compound_statement_nostart): If want_nested_loop, use
1420 c_parser_omp_next_tokens_can_be_canon_loop instead of just checking
1421 for RID_FOR keyword.
1422 (c_parser_omp_clause_name): Handle full and partial clause names.
1423 (c_parser_omp_clause_allocate): Remove spurious semicolon.
1424 (c_parser_omp_clause_full, c_parser_omp_clause_partial): New
1425 functions.
1426 (c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_FULL and
1427 PRAGMA_OMP_CLAUSE_PARTIAL.
1428 (c_parser_omp_next_tokens_can_be_canon_loop): New function.
1429 (c_parser_omp_loop_nest): Parse C23 attributes. Handle tile/unroll
1430 constructs. Use c_parser_omp_next_tokens_can_be_canon_loop instead
1431 of just checking for RID_FOR keyword. Only add_stmt (body) if it is
1432 non-NULL.
1433 (c_parser_omp_for_loop): Rename tiling variable to oacc_tiling. For
1434 OMP_CLAUSE_SIZES set collapse to list length of OMP_CLAUSE_SIZES_LIST.
1435 Use c_parser_omp_next_tokens_can_be_canon_loop instead of just
1436 checking for RID_FOR keyword. Remove spurious semicolon. Don't call
1437 c_omp_check_loop_binding_exprs if stmt is NULL. Skip generated loops.
1438 (c_parser_omp_tile_sizes, c_parser_omp_tile): New functions.
1439 (OMP_UNROLL_CLAUSE_MASK): Define.
1440 (c_parser_omp_unroll): New function.
1441 (c_parser_omp_construct): Handle PRAGMA_OMP_TILE and
1442 PRAGMA_OMP_UNROLL.
1443 * c-typeck.cc (c_finish_omp_clauses): Adjust wording of some of the
1444 conflicting clause diagnostic messages to include word clause.
1445 Handle OMP_CLAUSE_{FULL,PARTIAL,SIZES} and diagnose full vs. partial
1446 conflict.
1447
3c75a4c0
GA
14482024-05-31 Qing Zhao <qing.zhao@oracle.com>
1449
1450 * c-typeck.cc (build_access_with_size_for_counted_by): Add the 6th
1451 argument to .ACCESS_WITH_SIZE.
1452
14532024-05-31 Qing Zhao <qing.zhao@oracle.com>
1454
1455 * c-parser.cc (c_parser_postfix_expression): Ignore the counted-by
1456 attribute when build_component_ref inside offsetof operator.
1457 * c-tree.h (build_component_ref): Add one more parameter.
1458 * c-typeck.cc (build_counted_by_ref): New function.
1459 (build_access_with_size_for_counted_by): New function.
1460 (build_component_ref): Check the counted-by attribute and build
1461 call to .ACCESS_WITH_SIZE.
1462 (build_unary_op): When building ADDR_EXPR for
1463 .ACCESS_WITH_SIZE, use its first argument.
1464 (lvalue_p): Accept call to .ACCESS_WITH_SIZE.
1465 (digest_init): Fold call to .ACCESS_WITH_SIZE to its first
1466 argument when require_constant is TRUE.
1467
14682024-05-31 Qing Zhao <qing.zhao@oracle.com>
1469
1470 * c-decl.cc (flexible_array_member_type_p): Renamed and moved to...
1471 (add_flexible_array_elts_to_size): Use renamed function.
1472 (is_flexible_array_member_p): Use renamed function.
1473 (verify_counted_by_attribute): New function.
1474 (finish_struct): Use renamed function and verify counted_by
1475 attribute.
1476 * c-tree.h (lookup_field): New prototype.
1477 * c-typeck.cc (lookup_field): Expose as extern function.
1478 (tagged_types_tu_compatible_p): Check counted_by attribute for
1479 structure type.
1480
14812024-05-31 Martin Uecker <uecker@tugraz.at>
1482
1483 * c-decl.cc (finish_struct): Do not set TYPE_CANONICAL for
1484 structure or unions with variable size.
1485 * c-objc-common.cc (c_get_alias_set): Do not set alias set to zero.
1486 * c-typeck.cc (comptypes_verify): New function.
1487 (comptypes,comptypes_same_p,comptypes_check_enum_int): Add assertion.
1488 (comptypes_equiv_p): Add assertion that ensures that compatible
1489 types have the same equivalence class.
1490 (tagged_types_tu_compatible_p): Remove now unneeded special case.
1491
14922024-05-31 Martin Uecker <uecker@tugraz.at>
1493
1494 PR tree-optimization/115157
1495 PR tree-optimization/115177
1496 * c-decl.cc (shadow_tag-warned,parse_xref_tag,start_enum,
1497 finish_enum): Set SET_TYPE_STRUCTURAL_EQUALITY / TYPE_CANONICAL.
1498 * c-objc-common.cc (get_alias_set): Remove special case.
1499 (get_aka_type): Add special case.
1500
d815d9ad
GA
15012024-05-29 Martin Uecker <uecker@tugraz.at>
1502
1503 * c-typeck.cc (comptypes_internal): Add flag to track
1504 whether a struct is the target of a pointer.
1505 (tagged_types_tu_compatible): When forming equivalence
1506 classes, treat nested pointed-to structs as equivalent.
1507
2b841697
GA
15082024-05-28 David Malcolm <dmalcolm@redhat.com>
1509
1510 PR bootstrap/115167
1511 * c-objc-common.cc: Replace include of "gcc-rich-location.h" with
1512 "c-family/c-type-mismatch.h".
1513 * c-typeck.cc: Likewise.
1514
6c0b7e12
GA
15152024-05-24 Martin Uecker <uecker@tugraz.at>
1516
1517 PR c/114831
1518 * c-typeck.cc (array_to_pointer_conversion, build_unary_op):
1519 Propagate flag to pointer target.
1520
25456c0e
GA
15212024-05-15 Jakub Jelinek <jakub@redhat.com>
1522
1523 PR c/115103
1524 * c-typeck.cc (c_finish_omp_clauses): Diagnose grainsize
1525 used together with num_tasks.
1526
f56280d5
GA
15272024-05-06 Qing Zhao <qing.zhao@oracle.com>
1528
1529 PR c/53548
1530 * c-decl.cc (add_flexible_array_elts_to_size): Handle the cases
1531 when the DECL is union.
1532
15332024-05-06 Qing Zhao <qing.zhao@oracle.com>
1534
1535 PR c/53548
1536 * c-decl.cc (finish_struct): Change errors to pedwarns for the cases
1537 flexible array members in union or alone in structures.
1538
610415bb
GA
15392024-04-30 Richard Biener <rguenther@suse.de>
1540
1541 * gimple-parser.cc (c_parser_gimple_binary_expression):
1542 Parse __{CEIL,FLOOR,ROUND}_{DIV,MOD} and __EXACT_DIV.
1543
90ded751
GA
15442024-04-19 Martin Uecker <uecker@tugraz.at>
1545 Jakub Jelinek <jakub@redhat.com>
1546
1547 PR lto/114574
1548 PR c/114361
1549 * c-decl.cc (shadow_tag_warned): For flag_isoc23 and code not
1550 ENUMERAL_TYPE use SET_TYPE_STRUCTURAL_EQUALITY.
1551 (parser_xref_tag): Likewise.
1552 (start_struct): For flag_isoc23 use SET_TYPE_STRUCTURAL_EQUALITY.
1553 (c_update_type_canonical): New function.
1554 (finish_struct): Put NULL as second == operand rather than first.
1555 Assert TYPE_STRUCTURAL_EQUALITY_P. Call c_update_type_canonical.
1556 * c-typeck.cc (composite_type_internal): Use
1557 SET_TYPE_STRUCTURAL_EQUALITY. Formatting fix.
1558
0753ae15
GA
15592024-04-09 Jakub Jelinek <jakub@redhat.com>
1560
1561 * c-decl.cc (previous_tag): Fix duplicated words in comment; the the
1562 -> the.
1563 (diagnose_mismatched_decls): Fix duplicated words in comment;
1564 about about -> about.
1565
080cac15
JJ
15662024-04-05 Martin Uecker <uecker@tugraz.at>
1567
1568 Revert:
1569 2024-04-02 Martin Uecker <uecker@tugraz.at>
1570
1571 PR c/114361
1572 * c-decl.cc (finish_struct): Set TYPE_CANONICAL when completing
1573 strucute types.
1574
a1e6798a
GA
15752024-04-02 Martin Uecker <uecker@tugraz.at>
1576
1577 PR c/114361
1578 * c-decl.cc (finish_struct): Set TYPE_CANONICAL when completing
1579 strucute types.
1580
c1f6690b
GA
15812024-03-14 Chung-Lin Tang <cltang@baylibre.com>
1582
1583 * c-parser.cc (c_parser_oacc_data_clause): Add parsing support for
1584 'readonly' modifier, set OMP_CLAUSE_MAP_READONLY if readonly modifier
1585 found, update comments.
1586 (c_parser_oacc_cache): Add parsing support for 'readonly' modifier,
1587 set OMP_CLAUSE__CACHE__READONLY if readonly modifier found, update
1588 comments.
1589
c775a030
GA
15902024-03-08 Jakub Jelinek <jakub@redhat.com>
1591
1592 PR debug/113918
1593 * c-tree.h (c_type_dwarf_attribute): Declare.
1594 * c-objc-common.h (LANG_HOOKS_TYPE_DWARF_ATTRIBUTE): Redefine.
1595 * c-objc-common.cc: Include dwarf2.h.
1596 (c_type_dwarf_attribute): New function.
1597
1e2a3b27
GA
15982024-02-26 Jakub Jelinek <jakub@redhat.com>
1599
1600 PR c/114042
1601 * c-parser.cc (c_parser_postfix_expression): Diagnose
1602 __builtin_stdc_bit_* argument with ENUMERAL_TYPE or BOOLEAN_TYPE
1603 type or if signed here rather than on the replacement builtins
1604 in check_builtin_function_arguments.
1605
77de8b72
GA
16062024-02-22 Jakub Jelinek <jakub@redhat.com>
1607
1608 PR c/114007
1609 * c-parser.cc (c_parser_std_attribute): Remove loose_scope_p argument.
1610 Instead of checking it, parse 2 CPP_COLONs with the first one with
1611 COLON_SCOPE flag the same as CPP_SCOPE.
1612 (c_parser_std_attribute_list): Remove loose_scope_p argument, don't
1613 pass it to c_parser_std_attribute.
1614 (c_parser_std_attribute_specifier): Adjust c_parser_std_attribute_list
1615 caller.
1616
df6c57ce
GA
16172024-02-13 Tobias Burnus <tburnus@baylibre.com>
1618
1619 PR middle-end/113904
1620 * c-parser.cc (c_parser_omp_context_selector): Handle splitting of
1621 OMP_TRAIT_PROPERTY_EXPR into OMP_TRAIT_PROPERTY_{DEV_NUM,BOOL}_EXPR.
1622
67d5b10e
GA
16232024-02-10 Jakub Jelinek <jakub@redhat.com>
1624
1625 * c-decl.cc (get_parm_array_spec): Use HOST_WIDE_INT_PRINT_UNSIGNED
1626 instead of "%lu" and casts to unsigned long or unsigned long long.
1627
90586e27
GA
16282024-02-08 Joseph Myers <josmyers@redhat.com>
1629
1630 PR c/113776
1631 * c-typeck.cc (c_objc_common_truthvalue_conversion): Return an
1632 integer constant expression for boolean conversion of floating
1633 constant.
1634
1c9ddaae
GA
16352024-02-05 Jakub Jelinek <jakub@redhat.com>
1636
1637 PR c/113740
1638 * c-decl.cc (finish_struct): Only use build_bitint_type if
1639 bit-field has width larger or equal to minimum _BitInt
1640 precision.
1641
dd3455f6
GA
16422024-01-31 Joseph Myers <josmyers@redhat.com>
1643
1644 PR c/112571
1645 * c-decl.cc (start_enum): Clear ENUM_FIXED_UNDERLYING_TYPE_P when
1646 defining without a fixed underlying type an enumeration previously
1647 declared with a fixed underlying type.
1648
16492024-01-31 Martin Uecker <uecker@tugraz.at>
1650
1651 PR c/113438
1652 * c-typeck.cc (composite_type_internal): Set TYPE_STUB_DECL.
1653
16542024-01-31 Joseph Myers <josmyers@redhat.com>
1655
1656 PR c/111059
1657 PR c/111911
1658 * c-tree.h (c_objc_common_truthvalue_conversion): Add third
1659 argument.
1660 * c-convert.cc (c_convert): For conversions to boolean, pass third
1661 argument to c_objc_common_truthvalue_conversion rather than
1662 converting here.
1663 * c-typeck.cc (build_c_cast): Ensure arguments with integer
1664 operands are marked as such for conversion to boolean.
1665 (c_objc_common_truthvalue_conversion): Add third argument TYPE.
1666
d9ed3ac2
GA
16672024-01-21 Martin Uecker <uecker@tugraz.at>
1668
1669 PR c/113492
1670 * c-decl.cc (grokdeclarator): Use c_common_unsigned_type instead of
1671 unsigned_type_for to create the unsigned type for bitfields declared
1672 with int when using -funsigned-bitfields.
1673
444a31f3
GA
16742024-01-12 Jakub Jelinek <jakub@redhat.com>
1675
1676 PR c/113315
1677 * c-typeck.cc (build_array_ref): If index has BITINT_TYPE type with
1678 precision larger than sizetype precision, convert it to sizetype.
1679
1a80e955
GA
16802024-01-11 Julian Brown <julian@codesourcery.com>
1681
1682 * c-parser.cc (c_parser_braced_init, c_parser_conditional_expression):
1683 Don't allow OpenMP array section.
1684 (c_parser_postfix_expression): Don't allow array section in statement
1685 expression.
1686 (c_parser_postfix_expression_after_primary): Add support for OpenMP
1687 array section parsing.
1688 (c_parser_expr_list): Don't allow OpenMP array section here.
1689 (c_parser_omp_variable_list): Change ALLOW_DEREF parameter to
1690 MAP_LVALUE. Support parsing of general lvalues in "map", "to" and
1691 "from" clauses.
1692 (c_parser_omp_var_list_parens): Change ALLOW_DEREF parameter to
1693 MAP_LVALUE. Update call to c_parser_omp_variable_list.
1694 (c_parser_oacc_data_clause): Update calls to
1695 c_parser_omp_var_list_parens.
1696 (c_parser_omp_clause_reduction): Use OMP_ARRAY_SECTION tree node
1697 instead of TREE_LIST for array sections.
1698 (c_parser_omp_target): Allow GOMP_MAP_ATTACH.
1699 * c-tree.h (c_omp_array_section_p): Add extern declaration.
1700 (build_omp_array_section): Add prototype.
1701 * c-typeck.cc (c_omp_array_section_p): Add flag.
1702 (mark_exp_read): Support OMP_ARRAY_SECTION.
1703 (build_omp_array_section): Add function.
1704 (build_external_ref): Tweak error path for OpenMP array sections.
1705 (handle_omp_array_sections_1): Use OMP_ARRAY_SECTION tree code instead
1706 of TREE_LIST. Handle more kinds of expressions.
1707 (c_oacc_check_attachments): Use OMP_ARRAY_SECTION instead of TREE_LIST
1708 for array sections.
1709 (c_finish_omp_clauses): Use OMP_ARRAY_SECTION instead of TREE_LIST.
1710 Check for supported expression types.
1711
73ce73fc
GA
17122024-01-09 Tamar Christina <tamar.christina@arm.com>
1713
1714 PR c/113267
1715 * c-parser.cc (c_parser_for_statement): Skip the pragma is no cond.
1716
eb84e8d3
GA
17172024-01-03 Kwok Cheung Yeung <kcy@codesourcery.com>
1718
1719 * c-parser.cc (c_parser_omp_clause_name): Move handling of indirect
1720 clause to correspond to alphabetical order.
1721
03fb8f27
GA
17222023-12-30 Martin Uecker <uecker@tugraz.at>
1723
1724 * c-typeck.cc (tagged_types_tu_compatible_p): Revise.
1725
0a529d19
GA
17262023-12-22 Martin Uecker <uecker@tugraz.at>
1727
1728 * c-typeck.cc (composite_type_internal): Adapted from
1729 composite_type to support structs and unions.
1730 (composite_type): New wrapper function.
1731 (build_conditional_operator): Return composite type.
1732 * c-decl.cc (finish_struct): Allow NULL for
1733 enclosing_struct_parse_info.
1734
cdfaa4aa
GA
17352023-12-21 Martin Uecker <uecker@tugraz.at>
1736
1737 * c-decl.cc (c_struct_hasher): Hash stable for struct
1738 types.
1739 (c_struct_hasher::hash, c_struct_hasher::equal): New
1740 functions.
1741 (finish_struct): Set TYPE_CANONICAL to first struct in
1742 equivalence class.
1743 * c-objc-common.cc (c_get_alias_set): Let structs or
1744 unions with variable size alias anything.
1745 * c-tree.h (comptypes_equiv): New prototype.
1746 * c-typeck.cc (comptypes_equiv): New function.
1747 (comptypes_internal): Implement equivalence mode.
1748 (tagged_types_tu_compatible): Implement equivalence mode.
1749
17502023-12-21 Martin Uecker <uecker@tugraz.at>
1751
1752 * c-tree.h (c_parser_enum_specifier): Add parameter.
1753 * c-decl.cc (start_enum): Allow redefinition.
1754 (finish_enum): Diagnose conflicts.
1755 (build_enumerator): Set context.
1756 (diagnose_mismatched_decls): Diagnose conflicting enumerators.
1757 (push_decl): Preserve context for enumerators.
1758 * c-typeck.cc (tagged_types_tu_compatible_p): Adapt.
1759 * c-parser.cc (c_parser_enum_specifier): Remember when
1760 seen is from an enum type which is not yet defined.
1761
17622023-12-21 Martin Uecker <uecker@tugraz.at>
1763
1764 * c-decl.cc (previous_tag): New function.
1765 (parser_xref_tag): Find earlier definition.
1766 (get_parm_info): Turn off warning for C23.
1767 (start_struct): Allow redefinitons.
1768 (finish_struct): Diagnose conflicts.
1769 * c-tree.h (comptypes_same_p): Add prototype.
1770 * c-typeck.cc (comptypes_same_p): New function.
1771 (comptypes_internal): Activate comparison of tagged types.
1772 (convert_for_assignment): Ignore qualifiers.
1773 (digest_init): Add error.
1774 (initialized_elementwise_p): Allow compatible types.
1775
7ad9058c
GA
17762023-12-20 Jakub Jelinek <jakub@redhat.com>
1777
1778 * c-parser.cc (c_parser_postfix_expression_after_primary): Grow
1779 sizeof_arg and sizeof_arg_loc arrays to 6 elements. Call
1780 warn_for_calloc if warn_calloc_transposed_args for functions with
1781 alloc_size type attribute with 2 arguments.
1782 (c_parser_expr_list): Use 6 instead of 3.
1783 * c-typeck.cc (build_c_cast): Call warn_for_alloc_size for casts
1784 of calls to functions with alloc_size type attribute.
1785 (convert_for_assignment): Likewise.
1786
fa1158c5
GA
17872023-12-19 Sandra Loosemore <sandra@codesourcery.com>
1788
1789 * c-parser.cc (omp_construct_selectors): Delete.
1790 (omp_device_selectors): Delete.
1791 (omp_implementation_selectors): Delete.
1792 (omp_user_selectors): Delete.
1793 (c_parser_omp_context_selector): Adjust for new representations
1794 and simplify dispatch logic. Uniformly warn instead of sometimes
1795 error when an unknown selector is found. Adjust error messages
1796 for extraneous/incorrect score.
1797 (c_parser_omp_context_selector_specification): Likewise.
1798 (c_finish_omp_declare_variant): Adjust for new representations.
1799
18002023-12-19 Sandra Loosemore <sandra@codesourcery.com>
1801
1802 * c-parser.cc (c_parser_omp_context_selector): Adjust for new
1803 namelist property representation.
1804
18052023-12-19 Sandra Loosemore <sandra@codesourcery.com>
1806
1807 * c-parser.cc (c_parser_omp_context_selector): Use new constructors.
1808
08c5d26a
GA
18092023-12-18 Richard Biener <rguenther@suse.de>
1810
1811 PR c/111975
1812 * gimple-parser.cc (c_parser_gimple_postfix_expression):
1813 Parse TARGET_MEM_REF extended operands for __MEM.
1814
e8018ccf
GA
18152023-12-13 Jason Merrill <jason@redhat.com>
1816
1817 * c-typeck.cc (convert_for_assignment): Adjust call to
1818 warn_for_address_of_packed_member.
1819
18202023-12-13 Julian Brown <julian@codesourcery.com>
1821
1822 * c-parser.cc (c_parser_oacc_all_clauses): Add TARGET_P parameter. Use
1823 to select region type for c_finish_omp_clauses call.
1824 (c_parser_oacc_loop): Update calls to c_parser_oacc_all_clauses.
1825 (c_parser_oacc_compute): Likewise.
1826 (c_parser_omp_target_data, c_parser_omp_target_enter_data): Support
1827 ATTACH kind.
1828 (c_parser_omp_target_exit_data): Support DETACH kind.
1829 (check_clauses): Handle GOMP_MAP_POINTER and GOMP_MAP_ATTACH here.
1830 * c-typeck.cc (handle_omp_array_sections_1,
1831 handle_omp_array_sections, c_finish_omp_clauses): Use
1832 c_omp_address_inspector class and OMP address tokenizer to analyze and
1833 expand map clause expressions. Fix some diagnostics. Fix "is OpenACC"
1834 condition for C_ORT_ACC_TARGET addition.
1835
18362023-12-13 Julian Brown <julian@codesourcery.com>
1837
1838 * c-typeck.cc (c_finish_omp_clauses): Add braces and reindent
1839 OMP_CLAUSE_TO/OMP_CLAUSE_FROM/OMP_CLAUSE__CACHE_ stanza.
1840
d5c96225
GA
18412023-12-11 Martin Uecker <uecker@tugraz.at>
1842
1843 PR c/112488
1844 * c-decl.cc (add_decl_expr): Revise.
1845 (finish_struct): Create DECL_EXPR.
1846 * c-parser.cc (c_parser_struct_or_union_specifier): Call
1847 finish_struct with expression for VLA sizes.
1848 * c-tree.h (finish_struct): Add argument.
1849
18502023-12-11 Tobias Burnus <tobias@codesourcery.com>
1851
1852 * c-parser.cc (c_parser_omp_requires): Handle acquires/release
1853 in atomic_default_mem_order clause.
1854 (c_parser_omp_atomic): Update.
1855
3dd09cd9
GA
18562023-12-05 Richard Sandiford <richard.sandiford@arm.com>
1857
1858 * c-decl.cc (std_attribute_table): Add extra braces to work
1859 around PR 16333 in older compilers.
1860
18612023-12-05 Richard Biener <rguenther@suse.de>
1862
1863 PR c/86869
1864 * c-typeck.cc (c_build_qualified_type): Preserve address-space
1865 info for ARRAY_TYPE.
1866
04d4a494
GA
18672023-12-02 Richard Sandiford <richard.sandiford@arm.com>
1868
1869 * c-tree.h (std_attribute_table): Declare.
1870 * c-decl.cc (std_attribute_table): Change type to
1871 scoped_attribute_specs, using...
1872 (std_attributes): ...this as the underlying array.
1873 (c_init_decl_processing): Remove call to register_scoped_attributes.
1874 * c-objc-common.h (c_objc_attribute_table): New global.
1875 (LANG_HOOKS_ATTRIBUTE_TABLE): Use it.
1876 (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Delete.
1877 (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Delete.
1878
2e0f3f97
GA
18792023-12-01 Florian Weimer <fweimer@redhat.com>
1880
1881 PR other/44209
1882 * c-decl.cc (grokparms): Issue permerror for
1883 OPT_Wdeclaration_missing_parameter_type instead of a pedwarn.
1884
18852023-12-01 Florian Weimer <fweimer@redhat.com>
1886
1887 PR c/96284
1888 * c-typeck.cc (build_conditional_expr): Upgrade most pointer
1889 type mismatches to a permerror.
1890 (convert_for_assignment): Use permerror_opt and
1891 permerror_init for OPT_Wincompatible_pointer_types warnings.
1892
18932023-12-01 Florian Weimer <fweimer@redhat.com>
1894
1895 PR c/96284
1896 * c-typeck.cc (c_finish_return): Use permerrors
1897 for OPT_Wreturn_mismatch diagnostics.
1898
18992023-12-01 Florian Weimer <fweimer@redhat.com>
1900
1901 * c-decl.cc (grokdeclarator): Do not skip -Wimplicit-int
1902 warnings or errors in system headers.
1903
19042023-12-01 Florian Weimer <fweimer@redhat.com>
1905
1906 * c-decl.cc (warn_defaults_to): Remove.
1907 (grok_declarator, start_function): Call permerror_opt
1908 instead of warn_defaults_to.
1909 (store_parm_decls_oldstyle): Call permerror_opt for
1910 OPT_Wimplicit_int.
1911
19122023-12-01 Florian Weimer <fweimer@redhat.com>
1913
1914 PR c/91092
1915 PR c/96284
1916 * c-decl.cc (implicit_decl_permerror): Rename from
1917 implicit_decl_warning. Call permerror_opt instead of
1918 pedwarn and warning_at.
1919 (implicitly_declare): Adjust callers.
1920
19212023-12-01 Florian Weimer <fweimer@redhat.com>
1922
1923 PR c/96284
1924 PR c/106416
1925 * c-typeck.cc (build_conditional_expr): Use permerror_opt for
1926 pointer/integer type mismatches, based on -Wint-conversion.
1927 (pedwarn_permerror_init, permerror_init): New function.
1928 (pedwarn_init): Call pedwarn_permerror_init.
1929 (convert_for_assignment): Use permerror_opt and
1930 permerror_init for -Wint-conversion warnings.
1931
31d8cf17
GA
19322023-11-29 Alexandre Oliva <oliva@adacore.com>
1933
1934 * c-typeck.cc (convert_lvalue_to_rvalue): Decay hardbools.
1935 * c-convert.cc (convert): Convert to hardbool through
1936 truthvalue.
1937 * c-decl.cc (check_bitfield_type_and_width): Skip enumeral
1938 truncation warnings for hardbool.
1939 (finish_struct): Propagate hardbool attribute to bitfield
1940 types.
1941 (digest_init): Convert to hardbool.
1942
6c85b8a9
GA
19432023-11-28 Jason Merrill <jason@redhat.com>
1944
1945 PR c++/94264
1946 PR c++/53220
1947 * c-typeck.cc (array_to_pointer_conversion): Adjust -Wc++-compat
1948 diagnostic.
1949
19502023-11-28 Richard Biener <rguenther@suse.de>
1951
1952 PR middle-end/112741
1953 * gimple-parser.cc (c_parser_parse_gimple_body): Also
1954 set DECL_SEEN_IN_BIND_EXPR_Pfor locals.
1955
ad3e759c
GA
19562023-11-27 Alex Coplan <alex.coplan@arm.com>
1957 Iain Sandoe <iain@sandoe.co.uk>
1958
1959 PR c++/60512
1960 * c-lang.cc (c_family_register_lang_features): New.
1961 * c-objc-common.cc (struct c_feature_info): New.
1962 (c_register_features): New.
1963 * c-objc-common.h (c_register_features): New.
1964
77cf1dba
GA
19652023-11-24 Tobias Burnus <tobias@codesourcery.com>
1966
1967 * c-parser.cc (c_parser_omp_clause_num_threads,
1968 c_parser_omp_clause_num_tasks, c_parser_omp_clause_grainsize,
1969 c_parser_omp_clause_priority, c_parser_omp_clause_schedule,
1970 c_parser_omp_clause_num_teams, c_parser_omp_clause_thread_limit,
1971 c_parser_omp_clause_dist_schedule, c_parser_omp_depobj,
1972 c_parser_omp_scan_loop_body, c_parser_omp_assumption_clauses):
1973 Add OPT_Wopenmp to warning_at.
1974
19752023-11-24 Tobias Burnus <tobias@codesourcery.com>
1976
1977 * c-parser.cc (c_parser_omp_depobj): Accept optionally an argument
1978 to the destroy clause.
1979
6fb55db0
GA
19802023-11-23 Jakub Jelinek <jakub@redhat.com>
1981
1982 * c-parser.cc (c_parser_postfix_expression): Handle RID_BUILTIN_STDC.
1983 * c-decl.cc (names_builtin_p): Likewise.
1984
b9fd8399
GA
19852023-11-14 Jakub Jelinek <jakub@redhat.com>
1986
1987 PR c/111309
1988 * c-typeck.cc (convert_arguments): Don't promote first argument
1989 of BUILT_IN_{CLZ,CTZ,CLRSB,FFS,PARITY,POPCOUNT}G.
1990
19912023-11-10 Martin Uecker <uecker@tugraz.at>
1992
1993 * c-typeck.cc (struct comptypes_data): Add anon_field flag.
1994 (comptypes, comptypes_check_unum_int,
1995 comptypes_check_different_types): Remove old cache.
1996 (tagged_tu_types_compatible_p): Rewrite.
1997
19982023-11-09 Florian Weimer <fweimer@redhat.com>
1999
2000 * c-typeck.cc (c_finish_return): Use pedwarn with
2001 OPT_Wreturn_mismatch for missing/extra return expressions.
2002
c48f1056
GA
20032023-11-07 Kwok Cheung Yeung <kcy@codesourcery.com>
2004
2005 * c-decl.cc (c_decl_attributes): Add attribute for indirect
2006 functions.
2007 * c-lang.h (c_omp_declare_target_attr): Add indirect field.
2008 * c-parser.cc (c_parser_omp_clause_name): Handle indirect clause.
2009 (c_parser_omp_clause_indirect): New.
2010 (c_parser_omp_all_clauses): Handle indirect clause.
2011 (OMP_DECLARE_TARGET_CLAUSE_MASK): Add indirect clause to mask.
2012 (c_parser_omp_declare_target): Handle indirect clause. Emit error
2013 message if device_type or indirect clauses used alone. Emit error
2014 if indirect clause used with device_type that is not 'any'.
2015 (OMP_BEGIN_DECLARE_TARGET_CLAUSE_MASK): Add indirect clause to mask.
2016 (c_parser_omp_begin): Handle indirect clause.
2017 * c-typeck.cc (c_finish_omp_clauses): Handle indirect clause.
2018
20192023-11-07 Joseph Myers <joseph@codesourcery.com>
2020
2021 * c-decl.cc: Use flag_isoc23 instead of flag_isoc2x and c23_auto_p
2022 instead of c2x_auto_p. Refer to C23 instead of C2X in diagnostics
2023 and comments.
2024 * c-errors.cc: Use flag_isoc23 instead of flag_isoc2x and
2025 warn_c11_c23_compat instead of warn_c11_c2x_compat. Refer to C23
2026 instead of C2X in comments.
2027 * c-parser.cc: Use flag_isoc23 instead of flag_isoc2x,
2028 warn_c11_c23_compat instead of warn_c11_c2x_compat, c23_auto_p
2029 instead of c2x_auto_p and D_C23 instead of D_C2X. Refer to C23
2030 instead of C2X in diagnostics and comments.
2031 * c-tree.h: Refer to C23 instead of C2X in comments.
2032 (struct c_declspecs): Rename c2x_auto_p to c23_auto_p.
2033 * c-typeck.cc: Use flag_isoc23 instead of flag_isoc2x and
2034 warn_c11_c23_compat instead of warn_c11_c2x_compat. Refer to C23
2035 instead of C2X in diagnostics and comments.
2036
2cca6ae6
GA
20372023-11-06 Joseph Myers <joseph@codesourcery.com>
2038
2039 PR c/107954
2040 * c-errors.cc (pedwarn_c11): Use OPT_Wc11_c23_compat instead of
2041 OPT_Wc11_c2x_compat.
2042 * c-typeck.cc (build_conditional_expr, convert_for_assignment):
2043 Use OPT_Wc11_c23_compat instead of OPT_Wc11_c2x_compat.
2044
eb4e1b62
GA
20452023-11-04 Jakub Jelinek <jakub@redhat.com>
2046
2047 * c-parser.h (c_maybe_parse_omp_decl): Declare.
2048 * c-parser.cc (struct c_parser): Add in_omp_decl_attribute member.
2049 (c_parser_std_attribute): Uncoment omp::decl handling.
2050 (c_parser_omp_var_list_parens): If parser->in_omp_decl_attribute
2051 don't expect any arguments, instead create clause or TREE_LIST for
2052 that decl.
2053 (c_maybe_parse_omp_decl): New function.
2054 (c_parser_omp_declare_target): If parser->in_omp_decl_attribute and
2055 first token isn't name or comma invoke c_parser_omp_var_list_parens.
2056 * c-decl.cc (c_decl_attributes): Uncomment omp::decl handling and
2057 use *node rather than non-existing *decl.
2058
20592023-11-04 Jakub Jelinek <jakub@redhat.com>
2060
2061 * c-tree.def: New file.
2062 * c-tree.h (struct c_tree_token_vec): Forward declare.
2063 (c_tree_size): Declare.
2064 * c-lang.h (struct c_omp_declare_target_attr): Add attr_syntax member.
2065 (struct c_omp_begin_assumes_data): New type.
2066 (current_omp_begin_assumes): Change type from int to
2067 vec<c_omp_begin_assumes_data, va_gc> *.
2068 * c-lang.cc: Include c-family/c-pragma.h and c-parser.h.
2069 * c-parser.h (struct c_tree_token_vec_struct): New type.
2070 (C_TOKEN_VEC_TOKENS): New macro.
2071 * c-parser.cc (struct c_parser): Add omp_attrs_forbidden_p and
2072 in_omp_attribute_pragma members.
2073 (c_parser_skip_until_found): Handle CPP_PRAGMA_EOL when
2074 parser->in_omp_attribute_pragma.
2075 (c_parser_skip_to_pragma_eol): Likewise.
2076 (c_parser_translation_unit): Adjust for current_omp_begin_assumes
2077 being a vector rather than counter.
2078 (c_parser_declaration_or_fndef): Handle omp::directive and
2079 omp::sequence attributes on attribute declaration and declare simd
2080 or declare variant directives in those on function declarations.
2081 (c_parser_check_balanced_raw_token_sequence): Forward declare.
2082 (c_parser_omp_directive_args, c_parser_omp_sequence_args): New
2083 functions.
2084 (c_parser_std_attribute): Handle omp::directive and omp::sequence
2085 attributes.
2086 (struct c_omp_attribute_data): New type.
2087 (c_parser_handle_statement_omp_attributes,
2088 c_parser_handle_directive_omp_attributes): New functions.
2089 (c_parser_compound_statement_nostart): Handle omp::directive and
2090 omp::sequence attributes on statements. Formatting fix.
2091 (c_parser_all_labels): Handle omp::directive and omp::sequence
2092 attributes on statements.
2093 (c_parser_statement): Clear parser->omp_attrs_forbidden_p.
2094 (c_parser_omp_variable_list): Handle parser->tokens
2095 != &parser->tokens_buf[0] by saving/restoring it.
2096 (c_parser_omp_structured_block): Set parser->omp_attrs_forbidden_p.
2097 (c_parser_omp_section_scan): New function.
2098 (c_parser_omp_structured_block_sequence, c_parser_omp_sections_scope):
2099 Use it.
2100 (c_parser_omp_parallel): Set parser->omp_attrs_forbidden_p.
2101 (c_parser_omp_task): Likewise.
2102 (c_parser_omp_declare_simd): Handle function declaration after
2103 std attributes.
2104 (c_finish_omp_declare_simd): Don't assert all kinds are the same.
2105 (c_parser_omp_declare_target): Also push attr_syntax flag.
2106 (c_parser_omp_begin): Likewise. Adjust for current_omp_begin_assumes
2107 type change.
2108 (c_parser_omp_end): Adjust for current_omp_begin_assumes type
2109 change. Diagnose mixing of attribute vs. pragma syntax on end assumes
2110 or end declare target.
2111 (c_parser_omp_declare_reduction): Handle parser->tokens
2112 != &parser->tokens_buf[0] by saving/restoring it.
2113 * c-decl.cc: Include c-parser.h.
2114 (current_omp_begin_assumes): Change type from int to
2115 vec<c_omp_begin_assumes_data, va_gc> *.
2116 (struct c_tree_token_vec): New type. Add static assertions
2117 for sizeof and offsetof.
2118 (union lang_tree_node): Add c_token_vec member and adjust GTY
2119 desc for it.
2120 (c_tree_size): New function.
2121 (c_decl_attributes): Diagnose invalid omp::directive attribute
2122 uses.
2123 * c-objc-common.h (LANG_HOOKS_TREE_SIZE): Redefine.
2124
9daed0b5
GA
21252023-11-02 Martin Uecker <uecker@tugraz.at>
2126
2127 PR c/112347
2128 * c-typeck.cc (convert_for_assignment): Add missing check.
2129
c73d2d49
GA
21302023-11-01 Martin Uecker <uecker@tugraz.at>
2131
2132 PR c/71219
2133 * c-typeck.cc (convert_for_assignment): Add warning.
2134
ecca503b
GA
21352023-10-26 liuhongt <hongtao.liu@intel.com>
2136
2137 * c-typeck.cc (build_vec_cmp): Pass type of arg0 to
2138 truth_type_for.
2139
f75fc1f0
GA
21402023-10-25 Thomas Schwinge <thomas@codesourcery.com>
2141
2142 * c-parser.cc (c_parser_omp_clause_name): Return
2143 'PRAGMA_OACC_CLAUSE_SELF' for "self".
2144 (c_parser_oacc_data_clause, OACC_UPDATE_CLAUSE_MASK): Adjust.
2145 (c_parser_oacc_all_clauses): Remove 'bool compute_p' formal
2146 parameter, and instead locally determine whether we're called for
2147 an OpenACC compute construct or OpenACC 'update' directive.
2148 (c_parser_oacc_compute): Adjust.
2149
21502023-10-25 Chung-Lin Tang <cltang@codesourcery.com>
2151
2152 * c-parser.cc (c_parser_oacc_compute_clause_self): New function.
2153 (c_parser_oacc_all_clauses): Add new 'bool compute_p = false'
2154 parameter, add parsing of self clause when compute_p is true.
2155 (OACC_KERNELS_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_SELF.
2156 (OACC_PARALLEL_CLAUSE_MASK): Likewise,
2157 (OACC_SERIAL_CLAUSE_MASK): Likewise.
2158 (c_parser_oacc_compute): Adjust call to c_parser_oacc_all_clauses to
2159 set compute_p argument to true.
2160 * c-typeck.cc (c_finish_omp_clauses): Add OMP_CLAUSE_SELF case.
2161
6f684dd2
GA
21622023-10-20 Florian Weimer <fweimer@redhat.com>
2163
2164 PR c/109827
2165 PR other/44209
2166 * c-typeck.cc (build_conditional_expr): Use OPT_Wint_conversion
2167 for pointer/integer mismatch warnings.
2168
21692023-10-20 Florian Weimer <fweimer@redhat.com>
2170
2171 PR c/109826
2172 PR other/44209
2173 * c-typeck.cc (build_conditional_expr): Use
2174 OPT_Wincompatible_pointer_types for pointer mismatches.
2175 Emit location information for the operand.
2176
c85f7481
GA
21772023-10-19 Andrew Pinski <pinskia@gmail.com>
2178
2179 PR c/100532
2180 * c-typeck.cc (convert_argument): After erroring out
2181 about an incomplete type return error_mark_node.
2182
21832023-10-19 Andrew Pinski <pinskia@gmail.com>
2184
2185 PR c/104822
2186 * c-typeck.cc (convert_for_assignment): Check for null pointer
2187 before warning about an incompatible scalar storage order.
2188
0308461d
GA
21892023-10-18 Andrew Pinski <pinskia@gmail.com>
2190
2191 PR c/101364
2192 * c-decl.cc (diagnose_arglist_conflict): Test for
2193 error mark before calling of c_type_promotes_to.
2194
21952023-10-18 Andrew Pinski <pinskia@gmail.com>
2196
2197 PR c/101285
2198 * c-typeck.cc (c_safe_arg_type_equiv_p): Return true for error
2199 operands early.
2200
fb69acff
GA
22012023-10-17 Martin Uecker <uecker@tugraz.at>
2202
2203 PR c/111708
2204 * c-decl.cc (grokdeclarator): Add error.
2205
96557ee6
GA
22062023-10-03 David Malcolm <dmalcolm@redhat.com>
2207
2208 * c-objc-common.cc (c_tree_printer): Update for "m_" prefixes to
2209 text_info fields.
2210
125781fb
GA
22112023-09-30 Eugene Rozenfeld <erozen@microsoft.com>
2212
2213 * Make-lang.in: Make create_fdas_for_cc1 target not .PHONY
2214
4907d220
GA
22152023-09-20 Jakub Jelinek <jakub@redhat.com>
2216
2217 * c-parser.cc (c_parser_postfix_expression_after_primary): Parse
2218 __builtin_classify_type call with typename as argument.
2219
590a8bec
GA
22202023-09-19 Richard Biener <rguenther@suse.de>
2221
2222 PR c/111468
2223 * gimple-parser.cc (c_parser_gimple_binary_expression): Handle __LTGT.
2224
22252023-09-19 Richard Biener <rguenther@suse.de>
2226
2227 PR c/111468
2228 * gimple-parser.cc (c_parser_gimple_binary_expression): Add
2229 return type argument.
2230 (c_parser_gimple_statement): Adjust.
2231 (c_parser_gimple_paren_condition): Likewise.
2232 (c_parser_gimple_binary_expression): Use passed in return type,
2233 add support for - as POINTER_DIFF_EXPR, __UN{LT,LE,GT,GE,EQ},
2234 __UNORDERED and __ORDERED.
2235
a1c20158
GA
22362023-09-12 Tobias Burnus <tobias@codesourcery.com>
2237
2238 * c-parser.cc (struct c_omp_loc_tree): New.
2239 (c_check_omp_allocate_allocator_r): New; checking moved from ...
2240 (c_parser_omp_allocate): ... here. Call it via walk_tree. Avoid
2241 ICE with tree_to_shwi for invalid too-large value.
2242
22432023-09-12 Tobias Burnus <tobias@codesourcery.com>
2244
2245 * c-parser.cc (c_parser_omp_construct): Move call to
2246 c_parser_omp_allocate to ...
2247 (c_parser_pragma): ... here.
2248 (c_parser_omp_allocate): Avoid ICE is allocator could not be
2249 parsed; set 'omp allocate' attribute for stack/automatic variables
2250 and only reject static variables; add several additional
2251 restriction checks.
2252 * c-tree.h (c_mark_decl_jump_unsafe_in_current_scope): New prototype.
2253 * c-decl.cc (decl_jump_unsafe): Return true for omp-allocated decls.
2254 (c_mark_decl_jump_unsafe_in_current_scope): New.
2255 (warn_about_goto, c_check_switch_jump_warnings): Add error for
2256 omp-allocated decls.
2257
22582023-09-12 Martin Uecker <uecker@tugraz.at>
2259
2260 * c-typeck.cc (struct comptypes_data): Add structure.
2261 (tagged_types_tu_compatible_p,
2262 function_types_compatible_p, type_lists_compatible_p,
2263 comptypes_internal): Add structure to interface, change
2264 return type to bool, and adapt calls.
2265 (comptarget_types): Change return type too bool.
2266 (comptypes, comptypes_check_enum_int,
2267 comptypes_check_different_types): Adapt calls.
2268
a134b6ce
GA
22692023-09-06 Jakub Jelinek <jakub@redhat.com>
2270
2271 PR c/102989
2272 * c-decl.cc (finish_declspecs): Emit pedwarn_c11 on _BitInt.
2273 * c-typeck.cc (c_common_type): Emit sorry for common type between
2274 _Complex integer and larger _BitInt and return the _Complex integer.
2275
22762023-09-06 Jakub Jelinek <jakub@redhat.com>
2277
2278 PR c/102989
2279 * c-convert.cc (c_convert): Handle BITINT_TYPE like INTEGER_TYPE.
2280 * c-decl.cc (check_bitfield_type_and_width): Allow BITINT_TYPE
2281 bit-fields.
2282 (finish_struct): Prefer to use BITINT_TYPE for BITINT_TYPE bit-fields
2283 if possible.
2284 (declspecs_add_type): Formatting fixes. Handle cts_bitint. Adjust
2285 for added union in *specs. Handle RID_BITINT.
2286 (finish_declspecs): Handle cts_bitint. Adjust for added union
2287 in *specs.
2288 * c-parser.cc (c_keyword_starts_typename, c_token_starts_declspecs,
2289 c_parser_declspecs, c_parser_gnu_attribute_any_word): Handle
2290 RID_BITINT.
2291 (c_parser_omp_clause_schedule): Handle BITINT_TYPE like INTEGER_TYPE.
2292 * c-tree.h (enum c_typespec_keyword): Mention _BitInt in comment.
2293 Add cts_bitint enumerator.
2294 (struct c_declspecs): Move int_n_idx and floatn_nx_idx into a union
2295 and add bitint_prec there as well.
2296 * c-typeck.cc (c_common_type, comptypes_internal):
2297 Handle BITINT_TYPE.
2298 (perform_integral_promotions): Promote BITINT_TYPE bit-fields to
2299 their declared type.
2300 (build_array_ref, build_unary_op, build_conditional_expr,
2301 build_c_cast, convert_for_assignment, digest_init, build_binary_op):
2302 Handle BITINT_TYPE.
2303 * c-fold.cc (c_fully_fold_internal): Handle BITINT_TYPE like
2304 INTEGER_TYPE.
2305 * c-aux-info.cc (gen_type): Handle BITINT_TYPE.
2306
23072023-09-06 Jakub Jelinek <jakub@redhat.com>
2308
2309 * c-decl.cc (declspecs_add_type): Use pedwarn_c11 rather than pedwarn
2310 for _FloatN{,x} diagnostics and append " before C2X" to the diagnostic
2311 text.
2312
4388bc82
GA
23132023-09-05 Tobias Burnus <tobias@codesourcery.com>
2314
2315 * c-parser.cc (c_parser_omp_clause_allocate): Handle
2316 error_mark_node.
2317
b8863640
GA
23182023-08-25 Sandra Loosemore <sandra@codesourcery.com>
2319
2320 * c-parser.cc (struct c_parser): Add omp_for_parse_state field.
2321 (struct omp_for_parse_data): New.
2322 (check_omp_intervening_code): New.
2323 (add_structured_block_stmt): New.
2324 (c_parser_compound_statement_nostart): Recognize intervening code,
2325 nested loops, and other things that need special handling in
2326 OpenMP loop constructs.
2327 (c_parser_while_statement): Error on loop in intervening code.
2328 (c_parser_do_statement): Likewise.
2329 (c_parser_for_statement): Likewise.
2330 (c_parser_postfix_expression_after_primary): Error on calls to
2331 the OpenMP runtime in intervening code.
2332 (c_parser_pragma): Error on OpenMP pragmas in intervening code.
2333 (c_parser_omp_loop_nest): New.
2334 (c_parser_omp_for_loop): Rewrite to use recursive descent, calling
2335 c_parser_omp_loop_nest to do the heavy lifting.
2336
6d47c9b4
GA
23372023-08-24 Richard Sandiford <richard.sandiford@arm.com>
2338
2339 * c-parser.cc (c_parser_std_attribute): Conditionally allow
2340 two colons to be used in place of ::.
2341 (c_parser_std_attribute_list): New function, split out from...
2342 (c_parser_std_attribute_specifier): ...here. Allow the attribute-list
2343 to start with __extension__. When it does, also allow two colons
2344 to be used in place of ::.
2345
6cd85273
GA
23462023-08-22 Tobias Burnus <tobias@codesourcery.com>
2347
2348 * c-parser.cc (c_parser_omp_clause_defaultmap): Parse
2349 'all' as category.
2350
1eb2433f
GA
23512023-08-17 Jose E. Marchesi <jose.marchesi@oracle.com>
2352
2353 PR c/106537
2354 * c-typeck.cc (build_binary_op): Warning on comparing distinct
2355 pointer types only when -Wcompare-distinct-pointer-types.
2356
b01e96f8
GA
23572023-08-15 Chung-Lin Tang <cltang@codesourcery.com>
2358 Thomas Schwinge <thomas@codesourcery.com>
2359
2360 * c-parser.cc (OACC_DATA_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_DEFAULT.
2361
886afed6
GA
23622023-08-11 Jakub Jelinek <jakub@redhat.com>
2363
2364 * c-parser.cc (c_parser_typeof_specifier): Handle
2365 __typeof_unqual and __typeof_unqual__ as !is_std.
2366
23672023-08-11 Martin Uecker <uecker@tugraz.at>
2368
2369 PR c/84510
2370 * c-typeck.cc (build_c_cast): Add warning.
2371
87b0749c
GA
23722023-08-05 Martin Uecker <uecker@tugraz.at>
2373
2374 * c-parser.cc (c_parser_generic_selection): Inhibit evaluation
2375 warnings branches that are known not be taken during parsing.
2376
5b42ee2c
GA
23772023-08-04 Tamar Christina <tamar.christina@arm.com>
2378
2379 * c-parser.cc (c_parser_while_statement, c_parser_do_statement,
2380 c_parser_for_statement, c_parser_statement_after_labels,
2381 c_parse_pragma_novector, c_parser_pragma): Wire through novector and
2382 default to false.
2383
4297a08e
GA
23842023-08-02 Eric Feng <ef2648@columbia.edu>
2385
2386 PR analyzer/107646
2387 * c-parser.cc: New functions on stashing values for the
2388 analyzer.
2389
cf58b896
GA
23902023-08-01 Lewis Hyatt <lhyatt@gmail.com>
2391
2392 * c-parser.cc (pragma_lex_discard_to_eol): New function.
2393 (c_init_preprocess): New function.
2394
a2f31d79
GA
23952023-07-31 Hamza Mahfooz <someguy@effective-light.com>
2396
2397 PR c/65213
2398 * c-decl.cc (start_decl): Handle
2399 -Wmissing-variable-declarations.
2400
24012023-07-31 Chung-Lin Tang <cltang@codesourcery.com>
2402
2403 * c-parser.cc (c_parser_oacc_host_data): Add checking requiring OpenACC
2404 host_data construct to have an use_device clause.
2405
14bfda60
GA
24062023-06-29 Qing Zhao <qing.zhao@oracle.com>
2407
2408 PR c/77650
2409 * c-decl.cc (finish_struct): Issue warnings for new option.
2410
24112023-06-29 Qing Zhao <qing.zhao@oracle.com>
2412
2413 * c-decl.cc (finish_struct): Set TYPE_INCLUDES_FLEXARRAY for
2414 struct/union type.
2415
24162023-06-29 Richard Biener <rguenther@suse.de>
2417
2418 PR c/110454
2419 * c-typeck.cc (convert_argument): Sink formal_prec compute
2420 to where TYPE_PRECISION is valid to use.
2421
24222023-06-29 Eugene Rozenfeld <erozen@microsoft.com>
2423
2424 * Make-lang.in: Pass correct stage cc1 when processing
2425 profile data collected while building target libraries
2426
f10a4ce0
GA
24272023-06-16 David Malcolm <dmalcolm@redhat.com>
2428
2429 PR c/107583
2430 * c-parser.cc (c_parser_declspecs): Add hints to "unknown type
2431 name" error.
2432
9d250bdb
GA
24332023-06-12 Tobias Burnus <tobias@codesourcery.com>
2434
2435 * c-parser.cc (c_parser_omp_clause_map): Reword error message for
2436 clearness especially with 'omp target (enter/exit) data.'
2437
4f0d4825
GA
24382023-06-06 Kwok Cheung Yeung <kcy@codesourcery.com>
2439 Tobias Burnus <tobias@codesourcery.com>
2440
2441 * c-parser.cc (c_parser_omp_clause_defaultmap,
2442 c_parser_omp_clause_map): Parse 'present'.
2443 (c_parser_omp_clause_to, c_parser_omp_clause_from): Remove.
2444 (c_parser_omp_clause_from_to): New; parse to/from clauses with
2445 optional present modifer.
2446 (c_parser_omp_all_clauses): Update call.
2447 (c_parser_omp_target_data, c_parser_omp_target_enter_data,
2448 c_parser_omp_target_exit_data): Handle new map enum values
2449 for 'present' mapping.
2450
df2762ac
GA
24512023-05-30 Tobias Burnus <tobias@codesourcery.com>
2452
2453 PR c/109999
2454 * c-parser.cc (c_parser_oacc_all_clauses,
2455 c_parser_omp_all_clauses): Improve error wording.
2456
03c7c418
GA
24572023-05-23 Martin Uecker <uecker@tugraz.at>
2458
2459 PR c/109450
2460 * c-decl.cc (add_decl_expr): New function.
2461 (grokdeclarator): Add decl expr for size expression in
2462 types pointed to by parameters declared as arrays.
2463
24642023-05-23 Martin Uecker <uecker@tugraz.at>
2465
2466 PR c/70418
2467 PR c/106465
2468 PR c/107557
2469 PR c/108423
2470 * c-decl.cc (start_decl): Make sure size expression are
2471 evaluated only in correct context.
2472 (grokdeclarator): Size expression in fields may need a bind
2473 expression, make sure DECL_EXPR is always created.
2474 (grokfield, declspecs_add_type): Pass along size expressions.
2475 (finish_struct): Remove unneeded DECL_EXPR.
2476 (start_function): Evaluate size expressions for nested functions.
2477 * c-parser.cc (c_parser_struct_declarations,
2478 c_parser_struct_or_union_specifier): Pass along size expressions.
2479 (c_parser_declaration_or_fndef): Evaluate size expression.
2480 (c_parser_objc_at_property_declaration,
2481 c_parser_objc_class_instance_variables): Adapt.
2482 * c-tree.h (grokfield): Adapt declaration.
2483
5df01f89
GA
24842023-05-19 Martin Uecker <uecker@tugraz.at>
2485
2486 * c-decl.cc (set_type_context): Remove.
2487 (pop_scope, diagnose_mismatched_decls, pushdecl):
2488 Remove dead code.
2489 * c-typeck.cc (comptypes_internal): Remove dead code.
2490 (same_translation_unit_p): Remove.
2491 (tagged_types_tu_compatible_p): Some fixes.
2492
24932023-05-19 Joseph Myers <joseph@codesourcery.com>
2494
2495 * c-decl.cc (diagnose_mismatched_decls): Do not handle
2496 thread-local declarations as tentative definitions for C2x.
2497 (finish_decl): Do not allow thread-local definition with
2498 incomplete type for C2x.
2499
b2776076
GA
25002023-05-18 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
2501
2502 * c-convert.cc (c_convert): Ditto.
2503 * c-decl.cc (merge_decls): Ditto.
2504 * c-parser.cc (c_parser_omp_clause_reduction): Ditto.
2505 (c_parser_omp_declare_reduction): Ditto.
2506 * c-typeck.cc (build_component_ref): Ditto.
2507 (convert_argument): Ditto.
2508 (pointer_diff): Ditto.
2509 (build_unary_op): Ditto.
2510 (build_c_cast): Ditto.
2511 (build_modify_expr): Ditto.
2512 (store_init_value): Ditto.
2513 (constexpr_init_fits_real_type): Ditto.
2514 (check_constexpr_init): Ditto.
2515 (c_finish_return): Ditto.
2516 (handle_omp_array_sections_1): Ditto.
2517 (c_finish_omp_clauses): Ditto.
2518 * gimple-parser.cc (c_finish_gimple_return): Ditto.
2519
0d566057
GA
25202023-05-16 Joseph Myers <joseph@codesourcery.com>
2521
2522 * c-decl.cc (check_for_loop_decls): Use pedwarn_c11 for
2523 diagnostics.
2524
3427b51b
GA
25252023-05-15 Joseph Myers <joseph@codesourcery.com>
2526
2527 * c-decl.cc (grokdeclarator): Ignore _Atomic on function return
2528 type for C2x.
2529
4d68c7f7
GA
25302023-04-30 Andrew Pinski <apinski@marvell.com>
2531
2532 * c-typeck.cc (process_init_element): Print out array type
2533 for excessive elements.
2534
25352023-04-30 Andrew Pinski <apinski@marvell.com>
2536
2537 PR c/107926
2538 * c-typeck.cc (process_init_element): Move the check
2539 for string cst until after the error message.
2540
50205195
GA
25412023-04-28 Eugene Rozenfeld <erozen@microsoft.com>
2542
2543 * Make-lang.in: Merge perf data collected when compiling cc1 and runtime libraries
2544
32a98ccd
GA
25452023-04-27 Jakub Jelinek <jakub@redhat.com>
2546
2547 PR c/109409
2548 * c-parser.cc (c_parser_initializer): Move diagnostics about
2549 initialization of variable sized object with non-empty initializer
2550 after c_parser_expr_no_commas call and ret.set_error (); after it.
2551
25522023-04-27 Jakub Jelinek <jakub@redhat.com>
2553
2554 PR c/107682
2555 PR c/109412
2556 * c-typeck.cc (pop_init_level): If constructor_type is FUNCTION_TYPE,
2557 reject empty initializer as invalid.
2558
4a3dbcbd
GA
25592023-04-26 Richard Biener <rguenther@suse.de>
2560
2561 * gimple-parser.cc (c_parser_parse_gimple_body): Avoid
2562 last_stmt.
2563
49cea02d
GA
25642023-04-25 Tobias Burnus <tobias@codesourcery.com>
2565
2566 * c-parser.cc (c_parser_omp_scan_loop_body): Handle
2567 zero exec statements before/after 'omp scan'.
2568
ce4e4f37
GA
25692023-04-20 Jakub Jelinek <jakub@redhat.com>
2570
2571 PR c/107041
2572 * c-decl.cc (diagnose_mismatched_decls): Avoid -Wenum-int-mismatch
2573 warning on acc_on_device declaration.
2574
579cdc1e
GA
25752023-03-28 David Malcolm <dmalcolm@redhat.com>
2576
2577 PR c/107002
2578 * c-typeck.cc (parser_build_binary_op): Update for new param of
2579 check_for_xor_used_as_pow.
2580
c8065441
GA
25812023-03-10 Jakub Jelinek <jakub@redhat.com>
2582
2583 PR c/108079
2584 * c-decl.cc (pop_scope): Suppress OPT_Wunused_variable warning
2585 after diagnosing it.
2586
6f9e2f14
GA
25872023-02-28 Jakub Jelinek <jakub@redhat.com>
2588
2589 PR sanitizer/108894
2590 * c-decl.cc (strict_flex_array_level_of): Move to c-common.cc
2591 and rename to c_strict_flex_array_level_of.
2592 (is_flexible_array_member_p): Adjust caller.
2593
0263e9d5
GA
25942023-02-18 Martin Uecker <uecker@tugraz.at>
2595
2596 PR c/108375
2597 * c-decl.cc (decl_jump_unsafe): Use c_type_variably_modified_p.
2598 (diagnose_mismatched_decl): Dito.
2599 (warn_about_goto): Dito:
2600 (c_check_switch_jump_warnings): Dito.
2601 (finish_decl): Dito.
2602 (finish_struct): Dito.
2603 (grokdeclarator): Set C_TYPE_VARIABLY_MODIFIED.
2604 (finish_struct): Set C_TYPE_VARIABLY_MODIFIED.
2605 * c-objc-common.cc (c_var_mod_p): New function.
2606 (c_var_unspec_p): Remove.
2607 * c-objc-common.h: Set lang hook.
2608 * c-parser.cc (c_parser_declararion_or_fndef): Use c_type_variably_modified_p.
2609 (c_parser_typeof_specifier): Dito.
2610 (c_parser_has_attribute_expression): Dito.
2611 (c_parser_generic_selection): Dito.
2612 * c-tree.h: Define C_TYPE_VARIABLY_MODIFIED and define c_var_mode_p.
2613 * c-typeck.cc: Remove c_vla_mod_p and use C_TYPE_VARIABLY_MODIFIED.
2614
88cc4495
GA
26152023-02-16 Patrick Palka <ppalka@redhat.com>
2616
2617 * c-parser.h: Mechanically drop static from static inline
2618 functions via s/^static inline/inline/g.
2619
d7a47ed1
GA
26202023-02-10 Joseph Myers <joseph@codesourcery.com>
2621
2622 * c-convert.cc (c_convert): Allow conversion of a null pointer
2623 constant to nullptr_t.
2624 * c-typeck.cc (null_pointer_constant_p): Remove static.
2625 (convert_for_assignment): Allow conversion of a null pointer
2626 constant to nullptr_t.
2627 (digest_init): Handle NULLPTR_TYPE among scalar conversions.
2628 * c-tree.h (null_pointer_constant_p): Declare.
2629
e92e2c96
GA
26302023-02-09 Tobias Burnus <tobias@codesourcery.com>
2631
2632 * c-parser.cc (c_parser_omp_allocate): Parse align
2633 clause and check for restrictions.
2634
f6fc79d0
GA
26352023-02-08 Joseph Myers <joseph@codesourcery.com>
2636
2637 * c-typeck.cc (check_constexpr_init): Remove argument
2638 null_pointer_constant. Only check pointer initializers for being
2639 null.
2640 (digest_init): Update calls to check_constexpr_init.
2641
a37a0cb3
GA
26422023-02-02 Joseph Myers <joseph@codesourcery.com>
2643
2644 * c-typeck.cc (build_binary_op): Allow comparisons between
2645 pointers and nullptr_t values that are not null pointer constants.
2646
26472023-02-02 Joseph Myers <joseph@codesourcery.com>
2648
2649 * c-typeck.cc: Include "realmpfr.h".
2650 (constexpr_init_fits_real_type): Do not allow signaling NaN
2651 conversions to different types with the same mode. Handle
2652 conversions from binary to decimal types.
2653 (check_constexpr_init): Do not disallow real initializers for
2654 complex types. Do not disallow binary initializers for decimal
2655 floating types.
2656
317525b0
GA
26572023-01-31 Marek Polacek <polacek@redhat.com>
2658
2659 PR c++/107593
2660 PR c++/108597
2661 * c-objc-common.cc (instantiation_dependent_expression_p): New.
2662
338eb0f0
GA
26632023-01-27 Joseph Myers <joseph@codesourcery.com>
2664
2665 * c-parser.cc (c_parser_declaration_or_fndef): Do not allow braces
2666 around auto initializer.
2667
f457a62e
GA
26682023-01-16 Jakub Jelinek <jakub@redhat.com>
2669
2670 PR c++/105593
2671 * c-parser.cc (c_parser_initializer): Check warning_enabled_at
2672 at the DECL_SOURCE_LOCATION (decl) for OPT_Winit_self instead
2673 of warn_init_self.
2674
5013c3bb
GA
26752023-01-14 Jakub Jelinek <jakub@redhat.com>
2676
2677 PR c++/108365
2678 * c-typeck.cc (build_binary_op): Use may_shorten_divmod for integral
2679 division or modulo.
2680
26812023-01-13 Qing Zhao <qing.zhao@oracle.com>
2682
2683 * c-decl.cc (strict_flex_array_level_of): ... here.
2684
81ed98bc
GA
26852023-01-11 Jakub Jelinek <jakub@redhat.com>
2686
2687 PR c/105972
2688 * c-parser.cc (c_parser_declaration_or_fndef): Disable debug non-bind
2689 markers for K&R function parameter declarations of nested functions.
2690
84723aca
GA
26912023-01-09 Joseph Myers <joseph@codesourcery.com>
2692
2693 * c-decl.cc (build_compound_literal): Call record_inline_static.
2694
d808db1f
GA
26952023-01-06 Joseph Myers <joseph@codesourcery.com>
2696
2697 * c-parser.cc (c_parser_postfix_expression): Handle integer
2698 generic arguments to functions passed to __builtin_tgmath as
2699 _Float32x if any argument has _FloatNx or _Complex _FloatNx type.
2700 Do not handle integer arguments to some narrowing functions as
2701 _Float64.
2702
d2ef2327
GA
27032022-12-19 Jakub Jelinek <jakub@redhat.com>
2704
2705 PR c/108043
2706 * c-parser.cc (c_parser_postfix_expression_after_paren_type): Diagnose
2707 compound literals with function type.
2708
4bc2d9f6
GA
27092022-12-07 Joseph Myers <joseph@codesourcery.com>
2710
2711 * c-decl.cc (declspecs_add_type, declspecs_add_scspec): Check for
2712 auto, constexpr and a type used together.
2713
3fe66f7f
GA
27142022-12-06 Qing Zhao <qing.zhao@oracle.com>
2715
2716 * c-decl.cc (is_flexible_array_member_p): Call new function
2717 strict_flex_array_level_of.
2718
9a1b4f1d
GA
27192022-11-24 Florian Weimer <fweimer@redhat.com>
2720
2721 PR c/107805
2722 * c-decl.cc (declspecs_add_type): Propagate error_mark_bode
2723 from type to specs.
2724
add89840
GA
27252022-11-17 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
2726
2727 * c-decl.cc (start_function): Set the result decl source
2728 location to the location of the typespec.
2729
27302022-11-17 David Malcolm <dmalcolm@redhat.com>
2731
2732 PR analyzer/107711
2733 * c-parser.cc (ana::c_translation_unit::consider_macro): Pass NULL
2734 to cpp_create_reader, rather than ident_hash, so that the new
2735 reader gets its own hash table.
2736
cdc34229
GA
27372022-11-15 David Malcolm <dmalcolm@redhat.com>
2738
2739 PR analyzer/106302
2740 * c-parser.cc: Include "analyzer/analyzer-language.h" and "toplev.h".
2741 (class ana::c_translation_unit): New.
2742 (c_parser_translation_unit): Call ana::on_finish_translation_unit.
2743
30d77d49
GA
27442022-11-12 Joseph Myers <joseph@codesourcery.com>
2745
2746 * c-decl.cc (start_underspecified_init)
2747 (finish_underspecified_init): Handle name == NULL_TREE for
2748 compound literals.
2749 (merge_decls): Merge C_DECL_DECLARED_CONSTEXPR.
2750 (shadow_tag_warned): Check for constexpr.
2751 (start_decl): Add parameter do_push.
2752 (build_compound_literal): Set C_DECL_DECLARED_CONSTEXPR.
2753 (grokdeclarator): Handle constexpr.
2754 (finish_struct): Set C_TYPE_FIELDS_NON_CONSTEXPR.
2755 (declspecs_add_scspec): Handle constexpr.
2756 * c-parser.cc (c_token_starts_compound_literal)
2757 (c_token_starts_declspecs, c_parser_declaration_or_fndef)
2758 (c_parser_declspecs, c_parser_gnu_attribute_any_word)
2759 (c_parser_compound_literal_scspecs)
2760 (c_parser_postfix_expression_after_paren_type): Handle constexpr.
2761 Update calls to start_init.
2762 (c_parser_declaration_or_fndef, c_parser_initializer)
2763 (c_parser_initval): Pass true for new argument of
2764 convert_lvalue_to_rvalue. Call convert_lvalue_to_rvalue for
2765 constexpr compound literals.
2766 (c_parser_static_assert_declaration_no_semi)
2767 (c_parser_enum_specifier, c_parser_struct_declaration)
2768 (c_parser_alignas_specifier, c_parser_initelt, c_parser_label):
2769 Call convert_lvalue_to_rvalue on expressions required to be
2770 integer constant expressions.
2771 (c_parser_omp_declare_reduction): Update call to start_init.
2772 * c-tree.h (C_TYPE_FIELDS_NON_CONSTEXPR)
2773 (C_DECL_DECLARED_CONSTEXPR): New macros.
2774 (struct c_declspecs): Add constexpr_p.
2775 (start_decl, convert_lvalue_to_rvalue, start_init): Update
2776 prototypes.
2777 * c-typeck.cc (require_constant_value, require_constant_elements):
2778 Change to bool.
2779 (require_constexpr_value, maybe_get_constexpr_init)
2780 (constexpr_init_fits_real_type, check_constexpr_init): New.
2781 (convert_lvalue_to_rvalue): Add new parameter for_init. Call
2782 maybe_get_constexpr_init.
2783 (store_init_value): Update call to digest_init.
2784 (digest_init): Add parameters int_const_expr, arith_const_expr and
2785 require_constexpr. Check constexpr initializers.
2786 (constructor_top_level): Remove.
2787 (struct initializer_stack): Remove top_level. Add
2788 require_constexpr_value.
2789 (start_init): Remove parameter top_level. Add parameters
2790 init_require_constant and init_require_constexpr. Save
2791 require_constexpr_value on stack.
2792 (pop_init_level): Use a null pointer constant for zero initializer
2793 of pointer initialized with {}.
2794 (output_init_element): Update call to digest_init. Avoid passing
2795 null pointer constants of pointer type through digest_init a
2796 second time when initializing a constexpr object.
2797
d29260ce
GA
27982022-11-03 Joseph Myers <joseph@codesourcery.com>
2799
2800 * c-decl.cc (in_underspecified_init, start_underspecified_init)
2801 (finish_underspecified_init): New.
2802 (shadow_tag_warned, parser_xref_tag, start_struct, start_enum):
2803 Give errors inside initializers of underspecified declarations.
2804 (grokdeclarator): Handle (erroneous) case of C2X auto on a
2805 parameter.
2806 (declspecs_add_type): Handle c2x_auto_p case.
2807 (declspecs_add_scspec): Handle auto possibly setting c2x_auto_p in
2808 C2X mode.
2809 (finish_declspecs): Handle c2x_auto_p.
2810 * c-parser.cc (c_parser_declaration_or_fndef): Handle C2X auto.
2811 * c-tree.h (C_DECL_UNDERSPECIFIED): New macro.
2812 (struct c_declspecs): Add c2x_auto_p.
2813 (start_underspecified_init, finish_underspecified_init): New
2814 prototypes.
2815 * c-typeck.cc (build_external_ref): Give error for underspecified
2816 declaration referenced in its initializer.
2817
3055829a
GA
28182022-10-28 Joseph Myers <joseph@codesourcery.com>
2819
2820 * c-decl.cc (grokdeclarator): Pass
2821 arg_info->no_named_args_stdarg_p to build_function_type.
2822 (grokparms): Check arg_info->no_named_args_stdarg_p before
2823 converting () to (void).
2824 (build_arg_info): Initialize no_named_args_stdarg_p.
2825 (get_parm_info): Set no_named_args_stdarg_p.
2826 (start_function): Pass TYPE_NO_NAMED_ARGS_STDARG_P to
2827 build_function_type.
2828 (store_parm_decls): Count (...) functions as prototyped.
2829 * c-parser.cc (c_parser_direct_declarator): Allow '...' after open
2830 parenthesis to start parameter list.
2831 (c_parser_parms_list_declarator): Always allow '...' with no
2832 arguments, call pedwarn_c11 and set no_named_args_stdarg_p.
2833 * c-tree.h (struct c_arg_info): Add field no_named_args_stdarg_p.
2834 * c-typeck.cc (composite_type): Handle
2835 TYPE_NO_NAMED_ARGS_STDARG_P.
2836 (function_types_compatible_p): Compare
2837 TYPE_NO_NAMED_ARGS_STDARG_P.
2838
28392022-10-28 Jakub Jelinek <jakub@redhat.com>
2840
2841 * c-parser.cc (c_parser_omp_all_clauses): Allow optional
2842 comma before the first clause.
2843 (c_parser_omp_allocate, c_parser_omp_atomic, c_parser_omp_depobj,
2844 c_parser_omp_flush, c_parser_omp_scan_loop_body,
2845 c_parser_omp_ordered, c_finish_omp_declare_variant,
2846 c_parser_omp_declare_target, c_parser_omp_declare_reduction,
2847 c_parser_omp_requires, c_parser_omp_error,
2848 c_parser_omp_assumption_clauses): Likewise.
2849
28502022-10-28 Joseph Myers <joseph@codesourcery.com>
2851
2852 PR c/61469
2853 * c-convert.cc (c_convert): Handle enums with underlying boolean
2854 type like bool.
2855 * c-decl.cc (shadow_tag_warned): Allow shadowing declarations for
2856 enums with enum type specifier, but give errors for storage class
2857 specifiers, qualifiers or alignment specifiers in non-definition
2858 declarations of such enums.
2859 (grokdeclarator): Give error for non-definition use of type
2860 specifier with an enum type specifier.
2861 (parser_xref_tag): Add argument has_enum_type_specifier. Pass it
2862 to lookup_tag and use it to set ENUM_FIXED_UNDERLYING_TYPE_P.
2863 (xref_tag): Update call to parser_xref_tag.
2864 (start_enum): Add argument fixed_underlying_type. Complete enum
2865 type with a fixed underlying type given in the definition. Give
2866 error for defining without a fixed underlying type in the
2867 definition if one was given in a prior declaration. Do not mark
2868 enums with fixed underlying type as packed for -fshort-enums.
2869 Store the enum type in the_enum.
2870 (finish_enum): Do not adjust types of values or check their range
2871 for an enum with a fixed underlying type. Set underlying type of
2872 enum and variants.
2873 (build_enumerator): Check enumeration constants for enum with
2874 fixed underlying type against that type and convert to that type.
2875 Increment in the underlying integer type, with handling for bool.
2876 (c_simulate_enum_decl): Update call to start_enum.
2877 (declspecs_add_type): Set specs->enum_type_specifier_ref_p.
2878 * c-objc-common.cc (c_get_alias_set): Use ENUM_UNDERLYING_TYPE
2879 rather than recomputing an underlying type based on size.
2880 * c-parser.cc (c_parser_declspecs)
2881 (c_parser_struct_or_union_specifier, c_parser_typeof_specifier):
2882 Set has_enum_type_specifier for type specifiers.
2883 (c_parser_enum_specifier): Handle enum type specifiers.
2884 (c_parser_struct_or_union_specifier): Update call to
2885 parser_xref_tag.
2886 (c_parser_omp_atomic): Check for boolean increment or decrement
2887 using C_BOOLEAN_TYPE_P.
2888 * c-tree.h (C_BOOLEAN_TYPE_P): New.
2889 (struct c_typespec): Add has_enum_type_specifier.
2890 (struct c_declspecs): Add enum_type_specifier_ref_p.
2891 (struct c_enum_contents): Add enum_type.
2892 (start_enum, parser_xref_tag): Update prototypes.
2893 * c-typeck.cc (composite_type): Allow for enumerated types
2894 compatible with bool.
2895 (common_type, comptypes_internal, perform_integral_promotions):
2896 Use ENUM_UNDERLYING_TYPE.
2897 (parser_build_binary_op, build_unary_op, convert_for_assignment)
2898 (c_finish_return, c_start_switch, build_binary_op): Check for
2899 boolean types using C_BOOLEAN_TYPE_P.
2900
4e939ae1
GA
29012022-10-24 Jakub Jelinek <jakub@redhat.com>
2902
2903 PR c++/107358
2904 * c-typeck.cc (build_binary_op): Pass operands before excess precision
2905 promotions to scalar_to_vector call.
2906
29072022-10-24 Arsen Arsenović <arsen@aarsen.me>
2908
2909 * c-decl.cc (finish_function): Ignore hosted when deciding
2910 whether to implicitly return zero, but check noreturn.
2911 * c-objc-common.cc (c_missing_noreturn_ok_p): Loosen the
2912 requirements to just MAIN_NAME_P when hosted, or `int main'
2913 otherwise.
2914
47a6ae56
GA
29152022-10-20 Richard Biener <rguenther@suse.de>
2916
2917 PR c/107305
2918 PR c/107306
2919 * gimple-parser.cc (c_parser_parse_gimple_body): Verify
2920 the parsed IL and zap the body on error.
2921
21de009f
GA
29222022-10-18 Joseph Myers <joseph@codesourcery.com>
2923
2924 PR c/107164
2925 * c-decl.cc (shadow_tag_warned): If pedantic, diagnose "enum tag;"
2926 with previous declaration visible.
2927
29282022-10-18 Joseph Myers <joseph@codesourcery.com>
2929
2930 PR c/36113
2931 * c-decl.cc (finish_enum): If any enumerators do not fit in int,
2932 convert all to the type of the enumeration. pedwarn if no integer
2933 type fits all enumerators and default to
2934 widest_integer_literal_type_node in that case. Otherwise pedwarn
2935 for type wider than intmax_t.
2936 (build_enumerator): pedwarn for enumerators outside the range of
2937 uintmax_t or intmax_t, and otherwise use pedwarn_c11 for
2938 enumerators outside the range of int. On overflow, attempt to
2939 find a wider type that can hold the value of the next enumerator.
2940 Do not convert value to type determined with
2941 c_common_type_for_size.
2942
baeec7cc
GA
29432022-10-14 Jakub Jelinek <jakub@redhat.com>
2944
2945 * c-typeck.cc (convert_arguments): Don't promote __bf16 to
2946 double.
2947
29482022-10-14 Joseph Myers <joseph@codesourcery.com>
2949
2950 * c-decl.cc (build_compound_literal): Add parameter scspecs.
2951 Handle storage class specifiers.
2952 * c-parser.cc (c_token_starts_compound_literal)
2953 (c_parser_compound_literal_scspecs): New.
2954 (c_parser_postfix_expression_after_paren_type): Add parameter
2955 scspecs. Call pedwarn_c11 for use of storage class specifiers.
2956 Update call to build_compound_literal.
2957 (c_parser_cast_expression, c_parser_sizeof_expression)
2958 (c_parser_alignof_expression): Handle storage class specifiers for
2959 compound literals. Update calls to
2960 c_parser_postfix_expression_after_paren_type.
2961 (c_parser_postfix_expression): Update syntax comment.
2962 * c-tree.h (build_compound_literal): Update prototype.
2963 * c-typeck.cc (c_mark_addressable): Diagnose taking address of
2964 register compound literal.
2965
9ff6c33e
GA
29662022-10-07 Qing Zhao <qing.zhao@oracle.com>
2967
2968 * c-decl.cc (flexible_array_member_type_p): New function.
2969 (one_element_array_type_p): Likewise.
2970 (zero_length_array_type_p): Likewise.
2971 (add_flexible_array_elts_to_size): Call new utility
2972 routine flexible_array_member_type_p.
2973 (is_flexible_array_member_p): New function.
2974 (finish_struct): Set the new DECL_NOT_FLEXARRAY flag.
2975
629d04d3
GA
29762022-10-06 Joseph Myers <joseph@codesourcery.com>
2977
2978 * c-parser.cc (c_parse_init): Add D_EXT11 to mask if flag_no_asm
2979 and not C2x.
2980 (c_keyword_starts_typename, c_token_starts_declspecs)
2981 (c_parser_declspecs, c_parser_objc_selector): Handle
2982 RID_TYPEOF_UNQUAL.
2983 (c_parser_typeof_specifier): Handle RID_TYPEOF_UNQUAL.
2984 Distinguish typeof for C2x from __typeof__ for all standard
2985 versions and typeof before C2x.
2986 * c-typeck.cc (build_function_call_vec): Use unqualified version
2987 of non-void return type.
2988 (build_unary_op): Use unqualified type for increment and
2989 decrement.
2990
29912022-10-06 Jakub Jelinek <jakub@redhat.com>
2992
2993 * c-parser.cc (c_parser_omp_assumption_clauses): Emit IFN_ASSUME
2994 call for holds clause on assume construct.
2995
29962022-10-06 Jakub Jelinek <jakub@redhat.com>
2997
2998 PR c++/106654
2999 * c-parser.cc (handle_assume_attribute): New function.
3000 (c_parser_declaration_or_fndef): Handle assume attribute.
3001 (c_parser_attribute_arguments): Add assume_attr argument,
3002 if true, parse first argument as conditional expression.
3003 (c_parser_gnu_attribute, c_parser_std_attribute): Adjust
3004 c_parser_attribute_arguments callers.
3005 (c_parser_statement_after_labels) <case RID_ATTRIBUTE>: Handle
3006 assume attribute.
3007
85872a69
GA
30082022-10-04 Jakub Jelinek <jakub@redhat.com>
3009
3010 * c-lang.h (struct c_omp_declare_target_attr): New type.
3011 (current_omp_declare_target_attribute): Change type from
3012 int to vec<c_omp_declare_target_attr, va_gc> *.
3013 * c-parser.cc (c_parser_translation_unit): Adjust for that change.
3014 If last pushed directive was begin declare target, use different
3015 wording and simplify format strings for easier translations.
3016 (c_parser_omp_clause_device_type): Uncomment
3017 check_no_duplicate_clause call.
3018 (c_parser_omp_declare_target): Adjust for the
3019 current_omp_declare_target_attribute type change, push { -1 }.
3020 Use error_at rather than warning_at for declare target with
3021 only device_type clauses.
3022 (OMP_BEGIN_DECLARE_TARGET_CLAUSE_MASK): Define.
3023 (c_parser_omp_begin): Add begin declare target support.
3024 (c_parser_omp_end): Adjust for the
3025 current_omp_declare_target_attribute type change, adjust
3026 diagnostics wording and simplify format strings for easier
3027 translations.
3028 * c-decl.cc (current_omp_declare_target_attribute): Change type from
3029 int to vec<c_omp_declare_target_attr, va_gc> *.
3030 (c_decl_attributes): Adjust for the
3031 current_omp_declare_target_attribute type change. If device_type
3032 was present on begin declare target, add "omp declare target host"
3033 and/or "omp declare target nohost" attributes.
3034
bbdcdf5c
GA
30352022-09-29 Joseph Myers <joseph@codesourcery.com>
3036
3037 * c-decl.cc (handle_std_noreturn_attribute): New function.
3038 (std_attribute_table): Add _Noreturn and noreturn.
3039
1f16a020
GA
30402022-09-27 Jakub Jelinek <jakub@redhat.com>
3041
3042 * c-lang.h (current_omp_begin_assumes): Declare.
3043 * c-parser.cc: Include bitmap.h.
3044 (c_parser_omp_end_declare_target): Rename to ...
3045 (c_parser_omp_end): ... this. Handle also end assumes.
3046 (c_parser_omp_begin, c_parser_omp_assumption_clauses,
3047 c_parser_omp_assumes, c_parser_omp_assume): New functions.
3048 (c_parser_translation_unit): Also diagnose #pragma omp begin assumes
3049 without corresponding #pragma omp end assumes.
3050 (c_parser_pragma): Use %s in may only be used at file scope
3051 diagnostics to decrease number of translatable messages. Handle
3052 PRAGMA_OMP_BEGIN and PRAGMA_OMP_ASSUMES. Handle PRAGMA_OMP_END
3053 rather than PRAGMA_OMP_END_DECLARE_TARGET and call c_parser_omp_end
3054 for it rather than c_parser_omp_end_declare_target.
3055 (c_parser_omp_construct): Handle PRAGMA_OMP_ASSUME.
3056 * c-decl.cc (current_omp_begin_assumes): Define.
3057
28a61ecd
GA
30582022-09-24 Jakub Jelinek <jakub@redhat.com>
3059
3060 PR c/106981
3061 * c-typeck.cc (c_tree_equal): Only strip NON_LVALUE_EXPRs at the
3062 start. For CONSTANT_CLASS_P or CASE_CONVERT: return false if t1 and
3063 t2 have different types.
3064
279c6715
GA
30652022-09-22 David Malcolm <dmalcolm@redhat.com>
3066
3067 PR c/106830
3068 * c-parser.cc (c_parser_initelt): Initialize m_decimal.
3069 (c_parser_cast_expression): Likewise.
3070 (c_parser_alignof_expression): Likewise.
3071 (c_parser_postfix_expression_after_paren_type): Likewise.
3072 (c_parser_postfix_expression_after_primary): Likewise.
3073 (c_parser_expression): Likewise.
3074 (c_parser_omp_variable_list): Likewise.
3075 (c_parser_transaction_expression): Likewise.
3076 * c-tree.h (c_expr::set_error): Likewise.
3077 * c-typeck.cc (c_expr_sizeof_expr): Likewise.
3078 (parser_build_unary_op): Likewise.
3079 (parser_build_binary_op): Likewise.
3080 (digest_init): Likewise.
3081 (pop_init_level): Likewise.
3082 * gimple-parser.cc (c_parser_gimple_call_internal): Likewise.
3083
43be56c4
GA
30842022-09-19 Marek Polacek <polacek@redhat.com>
3085
3086 PR c/106947
3087 * c-typeck.cc (maybe_warn_for_null_address): Don't emit stray
3088 notes.
3089
d0fc05e8
GA
30902022-09-15 Richard Biener <rguenther@suse.de>
3091
3092 * c-decl.cc (build_void_list_node): Remove.
3093
ff822367
GA
30942022-09-14 Julian Brown <julian@codesourcery.com>
3095
3096 * c-typeck.cc (c_finish_omp_clauses): Remove whole mapping node group
3097 on error.
3098
fe2a8ce9
GA
30992022-09-07 Joseph Myers <joseph@codesourcery.com>
3100
3101 * c-parser.cc (c_parser_static_assert_declaration_no_semi)
3102 (c_parser_alignas_specifier, c_parser_alignof_expression): Allow
3103 for C2x spellings of keywords.
3104 (c_parser_postfix_expression): Handle RID_TRUE and RID_FALSE.
3105
25aeb922
GA
31062022-09-06 Jakub Jelinek <jakub@redhat.com>
3107
3108 * c-parser.cc (c_parser_omp_clause_doacross_sink): Don't verify val
3109 in omp_cur_iteration - 1 has integer_type_node type.
3110
83f2f228
GA
31112022-09-03 Jakub Jelinek <jakub@redhat.com>
3112
3113 * c-parser.cc (c_parser_omp_clause_name): Handle doacross.
3114 (c_parser_omp_clause_depend_sink): Renamed to ...
3115 (c_parser_omp_clause_doacross_sink): ... this. Add depend_p argument.
3116 Handle parsing of doacross(sink:omp_cur_iteration-1). Use
3117 OMP_CLAUSE_DOACROSS_SINK_NEGATIVE instead of
3118 OMP_CLAUSE_DEPEND_SINK_NEGATIVE, build OMP_CLAUSE_DOACROSS instead
3119 of OMP_CLAUSE_DEPEND and set OMP_CLAUSE_DOACROSS_DEPEND flag on it.
3120 (c_parser_omp_clause_depend): Use OMP_CLAUSE_DOACROSS_SINK and
3121 OMP_CLAUSE_DOACROSS_SOURCE instead of OMP_CLAUSE_DEPEND_SINK and
3122 OMP_CLAUSE_DEPEND_SOURCE, build OMP_CLAUSE_DOACROSS for depend(source)
3123 and set OMP_CLAUSE_DOACROSS_DEPEND on it.
3124 (c_parser_omp_clause_doacross): New function.
3125 (c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DOACROSS.
3126 (c_parser_omp_depobj): Use OMP_CLAUSE_DEPEND_INVALID instead of
3127 OMP_CLAUSE_DEPEND_SOURCE.
3128 (c_parser_omp_for_loop): Don't diagnose here linear clause together
3129 with ordered with argument.
3130 (c_parser_omp_simd): Don't diagnose ordered clause with argument on
3131 for simd.
3132 (OMP_ORDERED_DEPEND_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_DOACROSS.
3133 (c_parser_omp_ordered): Handle also doacross and adjust for it
3134 diagnostic wording.
3135 * c-typeck.cc (c_finish_omp_clauses): Handle OMP_CLAUSE_DOACROSS.
3136 Don't handle OMP_CLAUSE_DEPEND_SOURCE and OMP_CLAUSE_DEPEND_SINK.
3137
c64b0947
GA
31382022-09-02 David Malcolm <dmalcolm@redhat.com>
3139
3140 PR c/90885
3141 * c-parser.cc (c_parser_string_literal): Clear ret.m_decimal.
3142 (c_parser_expr_no_commas): Likewise.
3143 (c_parser_conditional_expression): Likewise.
3144 (c_parser_binary_expression): Clear m_decimal when popping the
3145 stack.
3146 (c_parser_unary_expression): Clear ret.m_decimal.
3147 (c_parser_has_attribute_expression): Likewise for result.
3148 (c_parser_predefined_identifier): Likewise for expr.
3149 (c_parser_postfix_expression): Likewise for expr.
3150 Set expr.m_decimal when handling a CPP_NUMBER that was a decimal
3151 token.
3152 * c-tree.h (c_expr::m_decimal): New bitfield.
3153 * c-typeck.cc (parser_build_binary_op): Clear result.m_decimal.
3154 (parser_build_binary_op): Call check_for_xor_used_as_pow.
3155
bb0a1556
GA
31562022-09-01 Joseph Myers <joseph@codesourcery.com>
3157
3158 * c-decl.cc (grokparms): Handle () in a function declaration the
3159 same as (void) for C2X.
3160
542c60c4
GA
31612022-08-31 Joseph Myers <joseph@codesourcery.com>
3162
3163 * c-parser.cc (c_parser_label): Pass attributes to do_case.
3164 * c-typeck.cc (do_case): Add argument ATTRS. Pass it to
3165 c_add_case_label.
3166
16f542d6
GA
31672022-08-26 Jakub Jelinek <jakub@redhat.com>
3168
3169 * c-typeck.cc (convert_arguments): Handle BUILT_IN_ISSIGNALING.
3170
5d4389dc
GA
31712022-08-25 Marek Polacek <polacek@redhat.com>
3172
3173 * c-convert.cc (c_convert) <case POINTER_TYPE>: Handle NULLPTR_TYPE.
3174 Give a better diagnostic when converting to nullptr_t.
3175 * c-decl.cc (c_init_decl_processing): Perform C-specific nullptr
3176 initialization.
3177 * c-parser.cc (c_parse_init): Maybe OR D_C2X into mask.
3178 (c_parser_postfix_expression): Handle RID_NULLPTR.
3179 * c-typeck.cc (null_pointer_constant_p): Return true when expr is
3180 nullptr_node.
3181 (build_unary_op) <case TRUTH_NOT_EXPR>: Handle NULLPTR_TYPE.
3182 (build_conditional_expr): Handle the case when the second/third operand
3183 is NULLPTR_TYPE and third/second operand is POINTER_TYPE.
3184 (convert_for_assignment): Handle converting an expression of type
3185 nullptr_t to pointer/bool.
3186 (build_binary_op) <case TRUTH_XOR_EXPR>: Handle NULLPTR_TYPE.
3187 <case EQ_EXPR>: Handle comparing operands of type nullptr_t.
3188
31892022-08-25 Joseph Myers <joseph@codesourcery.com>
3190
3191 * c-decl.cc (start_decl): Do not diagnose initialization of
3192 variable-sized objects here.
3193 * c-parser.cc (c_parser_braced_init): Add argument DECL. All
3194 callers changed.
3195 (c_parser_initializer): Diagnose initialization of variable-sized
3196 objects other than with braced initializer.
3197 (c_parser_braced_init): Use pedwarn_c11 for empty initializer
3198 braces and update diagnostic text. Diagnose initialization of
3199 variable-sized objects with nonempty braces.
3200 * c-typeck.cc (digest_init): Update diagnostic for initialization
3201 of variable-sized objects.
3202 (really_start_incremental_init, set_designator)
3203 (process_init_element): Update comments.
3204 (pop_init_level): Allow scalar empty initializers.
3205
0342f034
GA
32062022-08-17 Tobias Burnus <tobias@codesourcery.com>
3207 Chung-Lin Tang <cltang@codesourcery.com>
3208
3209 PR c++/104493
3210 * c-decl.cc (c_decl_attributes, finish_decl): Call omp_mappable_type
3211 instead of removed langhook.
3212 * c-typeck.cc (c_finish_omp_clauses): Likewise.
3213
5cd525f0
GA
32142022-08-11 Marek Polacek <polacek@redhat.com>
3215
3216 PR middle-end/102633
3217 * c-parser.cc (c_parser_initializer): Add new tree parameter. Use it.
3218 Call suppress_warning.
3219 (c_parser_declaration_or_fndef): Pass d down to c_parser_initializer.
3220 (c_parser_omp_declare_reduction): Pass omp_priv down to
3221 c_parser_initializer.
3222
5f17badb
GA
32232022-08-08 Tom Honermann <tom@honermann.net>
3224
3225 * c-parser.cc (c_parser_string_literal): Use char8_t as the type
3226 of CPP_UTF8STRING when char8_t support is enabled.
3227 * c-typeck.cc (digest_init): Allow initialization of an array
3228 of character type by a string literal with type array of
3229 char8_t.
3230
32510382
GA
32312022-08-01 David Malcolm <dmalcolm@redhat.com>
3232
3233 * c-typeck.cc (build_c_cast): Quote names of address spaces in
3234 diagnostics.
3235 (convert_for_assignment): Add a note to address space mismatch
3236 diagnostics, specifying the expected and actual types.
3237
b53ebbc5
GA
32382022-07-10 Lewis Hyatt <lhyatt@gmail.com>
3239
3240 PR preprocessor/97498
3241 * c-parser.cc (c_parser_pragma): Set input_location to the
3242 location of the pragma, rather than the start of the line.
3243
8467574d
GA
32442022-07-04 Tobias Burnus <tobias@codesourcery.com>
3245 Chung-Lin Tang <cltang@codesourcery.com>
3246 Thomas Schwinge <thomas@codesourcery.com>
3247
3248 * c-parser.cc (c_parser_omp_target_data, c_parser_omp_target_update,
3249 c_parser_omp_target_enter_data, c_parser_omp_target_exit_data): Set
3250 OMP_REQUIRES_TARGET_USED.
3251 (c_parser_omp_requires): Remove sorry.
3252
ed974488
GA
32532022-07-01 Tobias Burnus <tobias@codesourcery.com>
3254
3255 * c-parser.cc (c_parser_omp_target_enter_data,
3256 c_parser_omp_target_exit_data): Accept tofrom
3257 map-type modifier but use 'to' / 'from' internally.
3258
bc7e9f76
GA
32592022-06-16 David Malcolm <dmalcolm@redhat.com>
3260
3261 * c-decl.cc (implicitly_declare): Add auto_diagnostic_group to
3262 group the warning with any note.
3263 (warn_about_goto): Likewise to group error or warning with note.
3264 Bail out if the warning wasn't emitted, to avoid emitting orphan
3265 notes.
3266 (lookup_label_for_goto): Add auto_diagnostic_group to
3267 group the error with the note.
3268 (check_earlier_gotos): Likewise.
3269 (c_check_switch_jump_warnings): Likewise for any error/warning.
3270 Conditionalize emission of the notes.
3271 (diagnose_uninitialized_cst_member): Likewise for warning,
3272 conditionalizing emission of the note.
3273 (grokdeclarator): Add auto_diagnostic_group to group the "array
3274 type has incomplete element type" error with any note.
3275 (parser_xref_tag): Add auto_diagnostic_group to group warnings
3276 with their notes. Conditionalize emission of notes.
3277 (start_struct): Add auto_diagnostic_group to group the
3278 "redefinition of" errors with any note.
3279 (start_enum): Likewise for "redeclaration of %<enum %E%>" error.
3280 (check_for_loop_decls): Likewise for pre-C99 error.
3281
445ba599
GA
32822022-06-07 Jakub Jelinek <jakub@redhat.com>
3283
3284 * c-parser.cc (c_parser_omp_clause_linear): Parse OpenMP 5.2
3285 style linear clause modifiers. Set
3286 OMP_CLAUSE_LINEAR_OLD_LINEAR_MODIFIER flag on the clauses when
3287 old style modifiers are used.
3288 * c-typeck.cc (c_finish_omp_clauses): Only reject linear clause
3289 with val modifier on simd or for if the old style modifiers are
3290 used.
3291
b168441c
GA
32922022-06-02 David Malcolm <dmalcolm@redhat.com>
3293
3294 * c-lang.cc (LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE): Redefine.
3295 (c_get_sarif_source_language): New.
3296 * c-tree.h (c_get_sarif_source_language): New decl.
3297
820ead45
GA
32982022-05-31 Jason Merrill <jason@redhat.com>
3299
3300 * Make-lang.in (c.tags): Look at *.cc.
3301
33022022-05-31 Jakub Jelinek <jakub@redhat.com>
3303
3304 * c-parser.cc (OMP_SCOPE_CLAUSE_MASK): Add firstprivate and allocate
3305 clauses.
3306
37b3b5da
GA
33072022-05-28 Jakub Jelinek <jakub@redhat.com>
3308
3309 * c-parser.cc (c_parser_omp_declare_target): If OMP_CLAUSE_LINK was
3310 seen first, use "%<to%>" or "%<enter%>" depending on
3311 OMP_CLAUSE_ENTER_TO of the current clause, otherwise use
3312 "%<to%> or %<enter%>" wording.
3313
d9176e64
GA
33142022-05-27 Jakub Jelinek <jakub@redhat.com>
3315
3316 * c-parser.cc (c_parser_omp_clause_name): Parse enter clause.
3317 (c_parser_omp_all_clauses): For to clause on declare target, use
3318 OMP_CLAUSE_ENTER clause with OMP_CLAUSE_ENTER_TO instead of
3319 OMP_CLAUSE_TO_DECLARE clause. Handle PRAGMA_OMP_CLAUSE_ENTER.
3320 (OMP_DECLARE_TARGET_CLAUSE_MASK): Add enter clause.
3321 (c_parser_omp_declare_target): Use OMP_CLAUSE_ENTER instead of
3322 OMP_CLAUSE_TO_DECLARE.
3323 * c-typeck.cc (c_finish_omp_clauses): Handle OMP_CLAUSE_ENTER instead
3324 of OMP_CLAUSE_TO_DECLARE, to OMP_CLAUSE_ENTER_TO use "to" as clause
3325 name in diagnostics instead of
3326 omp_clause_code_name[OMP_CLAUSE_CODE (c)].
3327
3dff965c
GA
33282022-05-25 Jakub Jelinek <jakub@redhat.com>
3329
3330 PR c/91134
3331 * c-tree.h (build_component_ref): Add ARROW_LOC location_t argument.
3332 * c-typeck.cc (build_component_ref): Likewise. If DATUM is
3333 INDIRECT_REF and ARROW_LOC isn't UNKNOWN_LOCATION, print a different
3334 diagnostic and fixit hint if DATUM has pointer type.
3335 * c-parser.cc (c_parser_postfix_expression,
3336 c_parser_omp_variable_list): Adjust build_component_ref callers.
3337 * gimple-parser.cc (c_parser_gimple_postfix_expression_after_primary):
3338 Likewise.
3339
768f49a2
GA
33402022-05-24 Jakub Jelinek <jakub@redhat.com>
3341
3342 PR c/105378
3343 * c-parser.cc (OMP_TASKWAIT_CLAUSE_MASK): Add nowait clause.
3344
1cda629f
GA
33452022-05-18 Marek Polacek <polacek@redhat.com>
3346
3347 PR c/105131
3348 * c-decl.cc (diagnose_mismatched_decls): Warn about enum/integer type
3349 mismatches.
3350 * c-tree.h (comptypes_check_enum_int): Declare.
3351 * c-typeck.cc (comptypes): No longer static.
3352
3d9439b1
GA
33532022-05-17 Marek Polacek <polacek@redhat.com>
3354
3355 * c-decl.cc (finish_enum): Store the CONST_DECL into TREE_VALUE, not
3356 its value.
3357
33582022-05-17 Jakub Jelinek <jakub@redhat.com>
3359
3360 * c-parser.cc (c_parser_omp_clause_depend): Parse
3361 inoutset depend-kind.
3362 (c_parser_omp_depobj): Likewise.
3363
702bd11f
GA
33642022-05-16 Martin Liska <mliska@suse.cz>
3365
3366 * c-decl.cc (match_builtin_function_types): Use ARRAY_SIZE.
3367
49ace834
GA
33682022-05-12 Jakub Jelinek <jakub@redhat.com>
3369
3370 * c-parser.cc (c_parse_init): Register omp_all_memory as keyword
3371 if flag_openmp.
3372 (c_parser_postfix_expression): Diagnose uses of omp_all_memory
3373 in postfix expressions.
3374 (c_parser_omp_variable_list): Handle omp_all_memory in depend
3375 clause.
3376 * c-typeck.cc (c_finish_omp_clauses): Handle omp_all_memory
3377 keyword in depend clause as null_pointer_node, diagnose invalid
3378 uses.
3379
bd022ff9
GA
33802022-05-09 Martin Liska <mliska@suse.cz>
3381
3382 * c-parser.cc (c_parser_conditional_expression): Use {,UN}LIKELY
3383 macros.
3384 (c_parser_binary_expression): Likewise.
3385
a1947c92
GA
33862022-05-07 Marek Polacek <polacek@redhat.com>
3387
3388 PR c++/101833
3389 PR c++/47634
3390 * c-objc-common.cc (maybe_adjust_arg_pos_for_attribute): New.
3391
405eda0d
GA
33922022-04-08 Jakub Jelinek <jakub@redhat.com>
3393
3394 PR c/105149
3395 * c-typeck.cc (c_build_va_arg): Reject function types.
3396
a2287813
GA
33972022-03-22 Marek Polacek <polacek@redhat.com>
3398
3399 PR c/82283
3400 PR c/84685
3401 * c-typeck.cc (struct initializer_stack): Add 'designated' member.
3402 (start_init): Set it.
3403 (finish_init): Restore constructor_designated.
3404 (push_init_level): Set constructor_designated to the value of
3405 constructor_designated in the upper constructor_stack.
3406
57eeedda
GA
34072022-03-12 Thomas Schwinge <thomas@codesourcery.com>
3408
3409 PR other/65095
3410 * c-typeck.cc (handle_omp_array_sections_1)
3411 (c_oacc_check_attachments): Call 'user_omp_clause_code_name'
3412 instead of 'c_omp_map_clause_name'.
3413
8cc4f9cd
GA
34142022-03-09 Joseph Myers <joseph@codesourcery.com>
3415
3416 * c-typeck.cc (function_types_compatible_p): Do not handle C2X
3417 differently from earlier standards for unprototyped function type
3418 compatibility.
3419
34202022-03-09 Jakub Jelinek <jakub@redhat.com>
3421
3422 PR c/104711
3423 * c-fold.cc (c_fully_fold_internal): Don't emit
3424 -Wshift-negative-value warning if TYPE_OVERFLOW_WRAPS.
3425 * c-typeck.cc (build_binary_op): Likewise.
3426
e6533e2e
GA
34272022-03-07 Jakub Jelinek <jakub@redhat.com>
3428
3429 * c-parser.cc (c_parser_omp_clause_map): Add missing space in string
3430 literal.
3431
4bf3bac1
GA
34322022-02-23 Richard Biener <rguenther@suse.de>
3433
3434 * gimple-parser.cc (c_parser_parse_gimple_body): Diagnose
3435 SSA names without definition.
3436 (c_parser_gimple_declaration): Handle pointer typed SSA names.
3437
0bdb0498
GA
34382022-02-17 Jakub Jelinek <jakub@redhat.com>
3439
3440 PR c/104532
3441 * c-parser.cc (c_parser_omp_variable_list): For CPP_DEREF, use
3442 convert_lvalue_to_rvalue and build_indirect_ref instead of
3443 build_simple_mem_ref.
3444
e8d68f0a
GA
34452022-02-11 Richard Biener <rguenther@suse.de>
3446
3447 * gimple-parser.cc (c_parser_gimple_statement): Properly parse
3448 VEC_COND_EXPRs.
3449
a645583d
GA
34502022-02-10 Marcel Vollweiler <marcel@codesourcery.com>
3451
3452 * c-parser.cc (c_parser_omp_clause_name): Parse 'has_device_addr'
3453 clause.
3454 (c_parser_omp_variable_list): Handle array sections.
3455 (c_parser_omp_clause_has_device_addr): Added.
3456 (c_parser_omp_all_clauses): Added PRAGMA_OMP_CLAUSE_HAS_DEVICE_ADDR
3457 case.
3458 (c_parser_omp_target_exit_data): Added HAS_DEVICE_ADDR to
3459 OMP_CLAUSE_MASK.
3460 * c-typeck.cc (handle_omp_array_sections): Handle clause restrictions.
3461 (c_finish_omp_clauses): Handle array sections.
3462
3adf509f
GA
34632022-02-09 Jakub Jelinek <jakub@redhat.com>
3464
3465 PR c/104427
3466 * c-parser.cc (c_parser_postfix_expression)
3467 <case RID_BUILTIN_ASSOC_BARRIER>: Use parser_build_unary_op
3468 instead of build1_loc to build PAREN_EXPR.
3469 * c-typeck.cc (build_unary_op): Handle PAREN_EXPR.
3470 * c-fold.cc (c_fully_fold_internal): Likewise.
3471
fc829782
GA
34722022-01-17 Martin Liska <mliska@suse.cz>
3473
3474 * Make-lang.in: Rename .c names to .cc.
3475 * c-convert.cc: Likewise.
3476 * c-decl.cc (struct lang_identifier): Likewise.
3477 (pop_scope): Likewise.
3478 (finish_decl): Likewise.
3479 * c-objc-common.h (GCC_C_OBJC_COMMON): Likewise.
3480 * c-parser.cc (c_parser_skip_to_end_of_block_or_statement): Likewise.
3481 * c-parser.h (GCC_C_PARSER_H): Likewise.
3482 * c-tree.h (c_keyword_starts_typename): Likewise.
3483 (finish_declspecs): Likewise.
3484 (c_get_alias_set): Likewise.
3485 (enum c_oracle_request): Likewise.
3486 (tag_exists_p): Likewise.
3487 (set_c_expr_source_range): Likewise.
3488 * c-typeck.cc (c_common_type): Likewise.
3489 (c_finish_omp_clauses): Likewise.
3490 * config-lang.in: Likewise.
3491
34922022-01-17 Martin Liska <mliska@suse.cz>
3493
3494 * c-aux-info.c: Moved to...
3495 * c-aux-info.cc: ...here.
3496 * c-convert.c: Moved to...
3497 * c-convert.cc: ...here.
3498 * c-decl.c: Moved to...
3499 * c-decl.cc: ...here.
3500 * c-errors.c: Moved to...
3501 * c-errors.cc: ...here.
3502 * c-fold.c: Moved to...
3503 * c-fold.cc: ...here.
3504 * c-lang.c: Moved to...
3505 * c-lang.cc: ...here.
3506 * c-objc-common.c: Moved to...
3507 * c-objc-common.cc: ...here.
3508 * c-parser.c: Moved to...
3509 * c-parser.cc: ...here.
3510 * c-typeck.c: Moved to...
3511 * c-typeck.cc: ...here.
3512 * gccspec.c: Moved to...
3513 * gccspec.cc: ...here.
3514 * gimple-parser.c: Moved to...
3515 * gimple-parser.cc: ...here.
3516
35172022-01-17 Andrew Stubbs <ams@codesourcery.com>
3518
3519 * c-parser.c (c_parser_omp_requires): Don't "sorry" dynamic_allocators.
3520
617db51d
GA
35212022-01-14 Chung-Lin Tang <cltang@codesourcery.com>
3522
3523 PR c++/103705
3524 * c-typeck.c (c_finish_omp_clauses): Also continue peeling off of
3525 outer node for ARRAY_REFs.
3526
62eb5308
GA
35272022-01-01 Jakub Jelinek <jakub@redhat.com>
3528
3529 PR objc/103639
3530 * c-typeck.c (c_finish_bc_stmt): For break inside of switch inside of
3531 ObjC foreach, emit normal BREAK_STMT rather than goto to label.
3532
2554e2da
GA
35332021-12-17 Marek Polacek <polacek@redhat.com>
3534
3535 PR c/103649
3536 * c-decl.c (c_warn_unused_attributes): Don't warn for
3537 attribute_ignored_p.
3538 * c-parser.c (c_parser_std_attribute): Skip parsing of the attribute
3539 arguments when the attribute is ignored.
3540
9c6586bc
GA
35412021-12-14 Jakub Jelinek <jakub@redhat.com>
3542
3543 PR c/103587
3544 * c-parser.c (c_parser_balanced_token_sequence): For CPP_PRAGMA,
3545 consume the pragma and silently skip to the pragma eol.
3546
c8dcf64b
GA
35472021-12-12 Jonathan Wakely <jwakely@redhat.com>
3548
3549 * c-decl.c: Define INCLUDE_MEMORY instead of INCLUDE_UNIQUE_PTR.
3550 * c-parser.c: Likewise.
3551
4b4839e3
GA
35522021-12-09 Jakub Jelinek <jakub@redhat.com>
3553
3554 PR pch/71934
3555 * c-decl.c (resort_field_decl_cmp): Pass the same pointer twice
3556 to resort_data.new_value.
3557
641ff219
GA
35582021-12-08 Chung-Lin Tang <cltang@codesourcery.com>
3559
3560 * c-parser.c (struct omp_dim): New struct type for use inside
3561 c_parser_omp_variable_list.
3562 (c_parser_omp_variable_list): Allow multiple levels of array and
3563 component accesses in array section base-pointer expression.
3564 (c_parser_omp_clause_to): Set 'allow_deref' to true in call to
3565 c_parser_omp_var_list_parens.
3566 (c_parser_omp_clause_from): Likewise.
3567 * c-typeck.c (handle_omp_array_sections_1): Extend allowed range
3568 of base-pointer expressions involving INDIRECT/MEM/ARRAY_REF and
3569 POINTER_PLUS_EXPR.
3570 (c_finish_omp_clauses): Extend allowed ranged of expressions
3571 involving INDIRECT/MEM/ARRAY_REF and POINTER_PLUS_EXPR.
3572
35732021-12-08 Chung-Lin Tang <cltang@codesourcery.com>
3574
3575 PR middle-end/92120
3576 * c-parser.c (c_parser_omp_clause_map): Set 'allow_deref' argument in
3577 call to c_parser_omp_variable_list to 'true'.
3578 * c-typeck.c (handle_omp_array_sections_1): Add strip of MEM_REF in
3579 array base handling.
3580 (c_finish_omp_clauses): Handle 'A->member' case in map clauses.
3581
c177e806
GA
35822021-11-30 Thomas Schwinge <thomas@codesourcery.com>
3583
3584 * c-typeck.c (c_finish_omp_clauses): Remove "gang reduction on an
3585 orphan loop" checking.
3586
35872021-11-30 Cesar Philippidis <cesar@codesourcery.com>
3588 Thomas Schwinge <thomas@codesourcery.com>
3589
3590 * c-typeck.c (c_finish_omp_clauses): Emit an error on orphan
3591 OpenACC gang reductions.
3592
35932021-11-30 Richard Biener <rguenther@suse.de>
3594
3595 * gimple-parser.c (c_parser_gimple_postfix_expression):
3596 avoid unreachable code after break.
3597
87cd82c8
GA
35982021-11-29 Eric Gallager <egallager@gcc.gnu.org>
3599
3600 PR other/103021
3601 * Make-lang.in: Use ETAGS variable in TAGS target.
3602
36032021-11-29 Richard Biener <rguenther@suse.de>
3604
3605 * c-typeck.c (c_tree_equal): Remove unreachable return.
3606 * c-parser.c (get_matching_symbol): Likewise.
3607
e1d43592
GA
36082021-11-23 Jakub Jelinek <jakub@redhat.com>
3609
3610 * c-typeck.c (c_clone_omp_udr): Don't initialize
3611 id.transform_lang_insert_block.
3612
9c077398
GA
36132021-11-19 Martin Sebor <msebor@redhat.com>
3614
3615 PR c++/33925
3616 PR c/102867
3617 * c-typeck.c (maybe_warn_for_null_address): Suppress warnings for
3618 code resulting from macro expansion.
3619
36202021-11-19 Martin Liska <mliska@suse.cz>
3621
3622 Revert:
3623 2021-11-19 Martin Liska <mliska@suse.cz>
3624
3625 * c-parser.c (add_debug_begin_stmt): Use option directly.
3626
483092d3
GA
36272021-11-18 Matthias Kretz <m.kretz@gsi.de>
3628
3629 * c-decl.c (names_builtin_p): Handle RID_BUILTIN_ASSOC_BARRIER.
3630 * c-parser.c (c_parser_postfix_expression): Likewise.
3631
36322021-11-18 Martin Liska <mliska@suse.cz>
3633
3634 * c-parser.c (add_debug_begin_stmt): Use option directly.
3635
280d2838
GA
36362021-11-17 Martin Sebor <msebor@redhat.com>
3637
3638 PR c/101702
3639 * c-decl.c (get_parm_array_spec): Strip casts earlier and fold array
3640 bounds before deciding if they're constant.
3641
e2b57363
GA
36422021-11-15 Jakub Jelinek <jakub@redhat.com>
3643
3644 * c-parser.c (OMP_TARGET_CLAUSE_MASK): Add
3645 PRAGMA_OMP_CLAUSE_THREAD_LIMIT.
3646
b39265d4
GA
36472021-11-11 Jakub Jelinek <jakub@redhat.com>
3648
3649 * c-parser.c (c_parser_omp_clause_num_teams): Parse optional
3650 lower-bound and store it into OMP_CLAUSE_NUM_TEAMS_LOWER_EXPR.
3651 Use OMP_CLAUSE_NUM_TEAMS_UPPER_EXPR instead of
3652 OMP_CLAUSE_NUM_TEAMS_EXPR.
3653 (c_parser_omp_target): For OMP_CLAUSE_NUM_TEAMS evaluate before
3654 combined target teams even lower-bound expression.
3655
36562021-11-11 Richard Biener <rguenther@suse.de>
3657
3658 * gimple-parser.c: Shuffle bitmap.h include.
3659
18ae471f
GA
36602021-11-03 Joseph Myers <joseph@codesourcery.com>
3661
3662 PR c/103031
3663 * c-convert.c (c_convert): New function, based on convert.
3664 (convert): Make into wrapper of c_convert.
3665 (convert_init): New function.
3666 * c-typeck.c (enum impl_conv): Add ic_init_const.
3667 (convert_for_assignment): Handle ic_init_const like ic_init. Add
3668 new argument to convert_and_check call.
3669 (digest_init): Pass ic_init_const to convert_for_assignment for
3670 initializers required to be constant.
3671
b4df2dd3
GA
36722021-11-02 Richard Sandiford <richard.sandiford@arm.com>
3673
3674 * c-tree.h (c_simulate_record_decl): Declare.
3675 * c-objc-common.h (LANG_HOOKS_SIMULATE_RECORD_DECL): Override.
3676 * c-decl.c (c_simulate_record_decl): New function.
3677
c2bd5d8a
GA
36782021-10-22 Eric Gallager <egallager@gcc.gnu.org>
3679
3680 PR other/102663
3681 * Make-lang.in: Add dummy c.install-dvi target.
3682
93d183a5
GA
36832021-10-15 Richard Biener <rguenther@suse.de>
3684
3685 PR c/102763
3686 * gimple-parser.c
3687 (c_parser_gimple_postfix_expression_after_primary): Check
3688 for a pointer do be dereferenced by ->.
3689
5d5885c9
GA
36902021-10-14 Kwok Cheung Yeung <kcy@codesourcery.com>
3691
3692 * c-parser.c (c_finish_omp_declare_variant): Change call from
3693 c_omp_check_context_selector to omp_check_context_selector. Change
3694 call from c_omp_mark_declare_variant to omp_mark_declare_variant.
3695
c9db17b8
GA
36962021-10-09 Jakub Jelinek <jakub@redhat.com>
3697
3698 * c-parser.c (c_parser_omp_structured_block_sequence): New function.
3699 (c_parser_omp_scan_loop_body): Use it.
3700 (c_parser_omp_sections_scope): Likewise.
3701
50e20ee6
GA
37022021-10-07 Richard Biener <rguenther@suse.de>
3703
3704 * c-typeck.c (lvalue_p): Also allow MEM_REF and TARGET_MEM_REF.
3705
bb6194e0
GA
37062021-10-05 Richard Biener <rguenther@suse.de>
3707
3708 PR c/102605
3709 * gimple-parser.c (c_parser_gimple_postfix_expression):
3710 Accept more address _Literals.
3711
da9c5f78
GA
37122021-10-04 Marek Polacek <polacek@redhat.com>
3713
3714 PR c++/97573
3715 * c-typeck.c (parser_build_binary_op): Call do_warn_array_compare.
3716
9d116bcc
GA
37172021-10-01 Martin Sebor <msebor@redhat.com>
3718
3719 PR c/102103
3720 * c-typeck.c (maybe_warn_for_null_address): New function.
3721 (build_binary_op): Call it.
3722
37232021-10-01 Jakub Jelinek <jakub@redhat.com>
3724 Richard Biener <rguenther@suse.de>
3725
3726 PR sanitizer/102515
3727 * c-typeck.c (build_binary_op): Call ubsan_instrument_division
3728 for division even for SANITIZE_SI_OVERFLOW.
3729
37302021-10-01 Jakub Jelinek <jakub@redhat.com>
3731
3732 * c-parser.c (c_parser_omp_clause_order): Set
3733 OMP_CLAUSE_ORDER_REPRODUCIBLE for explicit reproducible: modifier.
3734
fd133479
GA
37352021-09-28 Andrew Pinski <apinski@marvell.com>
3736
3737 PR c/32122
3738 * c-parser.c (c_parser_statement_after_labels): Pass
3739 the c_expr instead of the tree to c_finish_goto_ptr.
3740 * c-typeck.c (c_finish_goto_ptr): Change the second
3741 argument type to c_expr.
3742 * c-tree.h (c_finish_goto_ptr): Likewise.
3743 Error out if the expression was not of a pointer type.
3744
e4777439
GA
37452021-09-22 Jakub Jelinek <jakub@redhat.com>
3746
3747 * c-parser.c (c_parser_omp_clause_allocate): Parse allocate clause
3748 modifiers.
3749
cf74e7b5
GA
37502021-09-18 Jakub Jelinek <jakub@redhat.com>
3751
3752 * c-parser.c (c_parser_omp_clause_order): Parse unconstrained
3753 and reproducible modifiers.
3754 (OMP_DISTRIBUTE_CLAUSE_MASK): Add order clause.
3755
37562021-09-18 Jakub Jelinek <jakub@redhat.com>
3757
3758 * c-parser.c (c_parser_omp_clause_default): Handle private and
3759 firstprivate arguments, adjust diagnostics on unknown argument.
3760
0a4cb439
GA
37612021-09-17 Jakub Jelinek <jakub@redhat.com>
3762
3763 * c-parser.c (c_parser_omp_atomic): Reject atomic swap if capture
3764 is true.
3765
a26206ec
GA
37662021-09-10 Jakub Jelinek <jakub@redhat.com>
3767
3768 * c-parser.c (c_parser_conditional_expression): If omp_atomic_lhs and
3769 cond.value is >, < or == with omp_atomic_lhs as one of the operands,
3770 don't call build_conditional_expr, instead build a COND_EXPR directly.
3771 (c_parser_binary_expression): Avoid calling parser_build_binary_op
3772 if omp_atomic_lhs even in more cases for >, < or ==.
3773 (c_parser_omp_atomic): Update function comment for OpenMP 5.1 atomics,
3774 parse OpenMP 5.1 atomics and fail, compare and weak clauses, allow
3775 acq_rel on atomic read/write and acq_rel/acquire clauses on update.
3776 * c-typeck.c (build_binary_op): For flag_openmp only handle
3777 MIN_EXPR/MAX_EXPR.
3778
b2748138
GA
37792021-09-07 Marcel Vollweiler <marcel@codesourcery.com>
3780
3781 * c-parser.c (c_parser_omp_flush): Parse 'seq_cst' clause on 'flush'
3782 directive.
3783
e11c6046
GA
37842021-09-01 Iain Sandoe <iain@sandoe.co.uk>
3785
3786 * c-decl.c (enum deprecated_states): Add unavailable state.
3787 (merge_decls): Copy unavailability.
3788 (quals_from_declspecs): Handle unavailable case.
3789 (start_decl): Amend the logic handling suppression of nested
3790 deprecation states to include unavailability.
3791 (smallest_type_quals_location): Amend comment.
3792 (grokdeclarator): Handle the unavailable deprecation state.
3793 (declspecs_add_type): Set TREE_UNAVAILABLE from the decl specs.
3794 * c-tree.h (struct c_declspecs): Add unavailable_p.
3795 * c-typeck.c (build_component_ref): Handle unavailability.
3796 (build_external_ref): Likewise.
3797
37982021-09-01 Roger Sayle <roger@nextmovesoftware.com>
3799 Joseph Myers <joseph@codesourcery.com>
3800
3801 PR c/79412
3802 * c-decl.c (duplicate_decls): On significant mismatches, mark the
3803 types of both (non-function) decls as error_mark_node, so that the
3804 middle-end can see the code is malformed.
3805 (free_attr_access_data): Don't process if the type has been set to
3806 error_mark_node.
3807
6d51ee43
GA
38082021-08-31 Marcel Vollweiler <marcel@codesourcery.com>
3809
3810 * c-parser.c (c_parser_omp_clause_device): Parse device-modifiers 'device_num'
3811 and 'ancestor' in 'target device' clauses.
3812
38b19c5b
GA
38132021-08-23 Jakub Jelinek <jakub@redhat.com>
3814
3815 * c-parser.c (c_parser_omp_clause_num_tasks,
3816 c_parser_omp_clause_grainsize): Parse the optional strict: modifier.
3817
5b2876f9
GA
38182021-08-22 Martin Uecker <muecker@gwdg.de>
3819
3820 PR c/98397
3821 * c-typeck.c (comp_target_types): Change pedwarn to pedwarn_c11
3822 for pointers to arrays with qualifiers.
3823 (build_conditional_expr): For C23 don't lose qualifiers for pointers
3824 to arrays when the other pointer is a void pointer. Update warnings.
3825 (convert_for_assignment): Update warnings for C2X when converting from
3826 void* with qualifiers to a pointer to array with the same qualifiers.
3827
7c9e1645
GA
38282021-08-20 Jakub Jelinek <jakub@redhat.com>
3829
3830 * c-parser.c (c_parser_omp_error): New function.
3831 (c_parser_pragma): Handle PRAGMA_OMP_ERROR.
3832
38332021-08-20 Jakub Jelinek <jakub@redhat.com>
3834
3835 * c-parser.c (c_parser_omp_clause_depend_sink): Reject spurious
3836 comma at the end of list.
3837 (c_parser_omp_requires): Likewise.
3838
b57fba5e
GA
38392021-08-19 Jakub Jelinek <jakub@redhat.com>
3840
3841 * c-parser.c (c_parser_omp_requires): Don't call
3842 c_parser_peek_2nd_token and optionally consume token if current
3843 token is CPP_EOF, CPP_PRAGMA_EOL or CPP_CLOSE_PAREN.
3844
6e529985
GA
38452021-08-18 Jakub Jelinek <jakub@redhat.com>
3846
3847 * c-parser.c (c_parser_omp_nothing): New function.
3848 (c_parser_pragma): Handle PRAGMA_OMP_NOTHING.
3849
38502021-08-18 Jakub Jelinek <jakub@redhat.com>
3851
3852 * c-parser.c (c_parser_statement_after_labels): Add restart label
3853 near the start of the function. If c_parser_pragma returns false,
3854 goto restart.
3855 (c_parser_pragma): For PRAGMA_OMP_CANCELLATION_POINT return what
3856 c_parser_omp_cancellation_point returned. For PRAGMA_OMP_DECLARE
3857 return what c_parser_omp_declare returned. Return true instead of
3858 false after emitting errors that the directive is not allowed in
3859 pragma_stmt context.
3860 (c_parser_omp_ordered): Return true instead of
3861 false after emitting errors that the directive is not allowed in
3862 pragma_stmt context.
3863 (c_parser_omp_target_update): Likewise.
3864 (c_parser_omp_target_enter_data, c_parser_omp_target_exit_data):
3865 Change return type from tree to bool, return false if the
3866 directive should be ignored in pragma_stmt contexts.
3867 (c_parser_omp_target): Adjust callers of c_parser_omp_target_*_data,
3868 return their result directly.
3869 (c_parser_omp_cancellation_point): Change return type from void to
3870 bool, return false if the directive should be ignored in pragma_stmt
3871 contexts.
3872 (c_parser_omp_declare): Likewise.
3873
2d14d64b
GA
38742021-08-17 Jakub Jelinek <jakub@redhat.com>
3875
3876 * c-parser.c (OMP_SCOPE_CLAUSE_MASK): Define.
3877 (c_parser_omp_scope): New function.
3878 (c_parser_omp_construct): Handle PRAGMA_OMP_SCOPE.
3879
72be20e2
GA
38802021-08-12 Jakub Jelinek <jakub@redhat.com>
3881
3882 * c-parser.c (c_parser_omp_clause_name): Parse filter clause name.
3883 (c_parser_omp_clause_filter): New function.
3884 (c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_FILTER.
3885 (OMP_MASKED_CLAUSE_MASK): Define.
3886 (c_parser_omp_masked): New function.
3887 (c_parser_omp_parallel): Handle parallel masked.
3888 (c_parser_omp_construct): Handle PRAGMA_OMP_MASKED.
3889 * c-typeck.c (c_finish_omp_clauses): Handle OMP_CLAUSE_FILTER.
3890
38912021-08-12 Martin Uecker <muecker@gwdg.de>
3892
3893 PR c/101838
3894 PR c/29970
3895 * c-typeck.c (c_expr_sizeof_type): Evaluate
3896 size expressions for structs of variable size.
3897
38982021-08-12 Tobias Burnus <tobias@codesourcery.com>
3899
3900 * c-parser.c (c_parser_omp_clause_proc_bind): Accept
3901 'primary' as alias for 'master'.
3902
3ae564ea
GA
39032021-08-10 Martin Uecker <muecker@gwdg.de>
3904
3905 PR c/29970
3906 * c-typeck.c (c_expr_sizeof_expr): Evaluate
3907 size expressions for structs of variable size.
3908
f92f4778
GA
39092021-08-06 Tamar Christina <tamar.christina@arm.com>
3910
3911 * c-decl.c (c_simulate_enum_decl): Pass vec<> by pointer.
3912 * c-tree.h (c_simulate_enum_decl): Likewise.
3913
39142021-08-06 Martin Sebor <msebor@redhat.com>
3915
3916 * c-parser.c (c_parser_declaration_or_fndef): Adjust by-value function
3917 vec arguments to by-reference.
3918 (c_finish_omp_declare_simd): Same.
3919 (c_parser_compound_statement_nostart): Same.
3920 (c_parser_for_statement): Same.
3921 (c_parser_objc_methodprotolist): Same.
3922 (c_parser_oacc_routine): Same.
3923 (c_parser_omp_for_loop): Same.
3924 (c_parser_omp_declare_simd): Same.
3925
419c6c68
GA
39262021-07-21 Thomas Schwinge <thomas@codesourcery.com>
3927 Joseph Myers <joseph@codesourcery.com>
3928 Cesar Philippidis <cesar@codesourcery.com>
3929
3930 * c-parser.c (c_parser_omp_clause_name): Handle 'nohost'.
3931 (c_parser_oacc_all_clauses): Handle 'PRAGMA_OACC_CLAUSE_NOHOST'.
3932 (OACC_ROUTINE_CLAUSE_MASK): Add 'PRAGMA_OACC_CLAUSE_NOHOST'.
3933 * c-typeck.c (c_finish_omp_clauses): Handle 'OMP_CLAUSE_NOHOST'.
3934
92d45509
GA
39352021-07-20 Martin Sebor <msebor@redhat.com>
3936
3937 * c-tree.h (c_build_function_call_vec): Adjust by-value argument to
3938 by-const-reference.
3939 * c-typeck.c (c_build_function_call_vec): Same.
3940
d97d71a1
GA
39412021-07-15 Martin Sebor <msebor@redhat.com>
3942
3943 PR c/101289
3944 PR c/97548
3945 * c-decl.c (get_parm_array_spec): Strip nops.
3946
6fba0eea
GA
39472021-07-06 Martin Sebor <msebor@redhat.com>
3948
3949 * c-objc-common.c (c_tree_printer): Remove support for %G and %K.
3950
7a60a6e8
GA
39512021-07-02 Jakub Jelinek <jakub@redhat.com>
3952
3953 PR c/101297
3954 * c-parser.c (c_parser_omp_atomic): Consume comma only if it
3955 appears before a CPP_NAME.
3956
90708f87
GA
39572021-06-25 Martin Sebor <msebor@redhat.com>
3958
3959 * c-decl.c (pop_scope): Replace direct uses of TREE_NO_WARNING with
3960 warning_suppressed_p, suppress_warning, and copy_no_warning.
3961 (diagnose_mismatched_decls): Same.
3962 (duplicate_decls): Same.
3963 (grokdeclarator): Same.
3964 (finish_function): Same.
3965 (c_write_global_declarations_1): Same.
3966 * c-fold.c (c_fully_fold_internal): Same.
3967 * c-parser.c (c_parser_expr_no_commas): Same.
3968 (c_parser_postfix_expression): Same.
3969 * c-typeck.c (array_to_pointer_conversion): Same.
3970 (function_to_pointer_conversion): Same.
3971 (default_function_array_conversion): Same.
3972 (convert_lvalue_to_rvalue): Same.
3973 (default_conversion): Same.
3974 (build_indirect_ref): Same.
3975 (build_function_call_vec): Same.
3976 (build_atomic_assign): Same.
3977 (build_unary_op): Same.
3978 (c_finish_return): Same.
3979 (emit_side_effect_warnings): Same.
3980 (c_finish_stmt_expr): Same.
3981 (c_omp_clause_copy_ctor): Same.
3982
9aa8327e
GA
39832021-06-24 Jakub Jelinek <jakub@redhat.com>
3984
3985 PR c/101176
3986 * c-parser.c (c_parser_has_attribute_expression): Set source range for
3987 the result.
3988
39892021-06-24 Jakub Jelinek <jakub@redhat.com>
3990
3991 PR c/101171
3992 * c-typeck.c (build_c_cast): Don't call note_integer_operands on
3993 error_mark_node.
3994
39952021-06-24 Jakub Jelinek <jakub@redhat.com>
3996
3997 * c-parser.c (omp_split_clauses): Pass C_ORT_OMP_TARGET instead of
3998 C_ORT_OMP for clauses on target construct.
3999 (OMP_TARGET_CLAUSE_MASK): Add in_reduction clause.
4000 (c_parser_omp_target): For non-combined target add
4001 map (always, tofrom:) clauses for OMP_CLAUSE_IN_REDUCTION. Pass
4002 C_ORT_OMP_TARGET to c_finish_omp_clauses.
4003 * c-typeck.c (handle_omp_array_sections): Adjust ort handling
4004 for addition of C_ORT_OMP_TARGET and simplify, mapping clauses are
4005 never present on C_ORT_*DECLARE_SIMD.
4006 (c_finish_omp_clauses): Likewise. Handle OMP_CLAUSE_IN_REDUCTION
4007 on C_ORT_OMP_TARGET, set OMP_CLAUSE_MAP_IN_REDUCTION on
4008 corresponding map clauses.
4009
2f080224
GA
40102021-06-21 Jakub Jelinek <jakub@redhat.com>
4011
4012 PR inline-asm/100785
4013 * c-typeck.c (c_mark_addressable): Diagnose trying to make
4014 bit-fields addressable.
4015
ede6c356
GA
40162021-06-15 Robin Dapp <rdapp@linux.ibm.com>
4017
4018 * c-decl.c (merge_decls): Copy DECL_USER_ALIGN if DECL_ALIGN is
4019 similar.
4020
8dc48181
GA
40212021-06-14 Tobias Burnus <tobias@codesourcery.com>
4022
4023 PR c/100913
4024 * c-parser.c (c_parser_omp_clause_affinity): No need to set iterator
4025 var in the error case.
4026
438aac59
GA
40272021-06-07 Eric Botcazou <ebotcazou@adacore.com>
4028
4029 PR c/100920
4030 * c-typeck.c (convert_for_assignment): Test fndecl_built_in_p to
4031 spot built-in functions.
4032
7d6987e9
GA
40332021-06-06 Jakub Jelinek <jakub@redhat.com>
4034
4035 PR c/100902
4036 * c-parser.c (c_parser_omp_target): Call c_omp_adjust_map_clauses
4037 even when target is combined with other constructs.
4038
40392021-06-06 Eric Botcazou <ebotcazou@adacore.com>
4040
4041 PR c/100920
4042 * c-decl.c (finish_struct): Fix thinko in previous change.
4043 * c-typeck.c (convert_for_assignment): Do not warn on pointer
4044 assignment and initialization for storage order purposes if the
4045 RHS is a call to a DECL_IS_MALLOC function.
4046
600f90cb
GA
40472021-06-04 Martin Sebor <msebor@redhat.com>
4048
4049 PR c/100783
4050 * c-objc-common.c (print_type): Handle erroneous types.
4051
440c8a0a
GA
40522021-06-03 Jakub Jelinek <jakub@redhat.com>
4053
4054 PR c++/100859
4055 * c-typeck.c (c_finish_omp_clauses): Move OMP_CLAUSE_AFFINITY
4056 after depend only cases.
4057
ee682192
GA
40582021-05-31 Richard Biener <rguenther@suse.de>
4059
4060 PR c++/88601
4061 * c-decl.c (names_builtin_p): Handle RID_BUILTIN_SHUFFLEVECTOR.
4062 * c-parser.c (c_parser_postfix_expression): Likewise.
4063
48166757
GA
40642021-05-28 Richard Biener <rguenther@suse.de>
4065
4066 PR c/100803
4067 * gimple-parser.c (c_parser_gimple_paren_condition): Diagnose
4068 invalid if conditions.
4069
40702021-05-28 Jakub Jelinek <jakub@redhat.com>
4071
4072 PR middle-end/99928
4073 * c-typeck.c (handle_omp_array_sections): Copy OMP_CLAUSE_MAP_IMPLICIT.
4074 (c_finish_omp_clauses): Move not just OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT
4075 marked clauses last, but also OMP_CLAUSE_MAP_IMPLICIT. Add
4076 map_firstprivate_head bitmap, set it for GOMP_MAP_FIRSTPRIVATE_POINTER
4077 maps and silently remove OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT if it is
4078 present too. For OMP_CLAUSE_MAP_IMPLICIT silently remove the clause
4079 if present in map_head, map_field_head or map_firstprivate_head
4080 bitmaps.
4081
40822021-05-28 Tobias Burnus <tobias@codesourcery.com>
4083
4084 * c-parser.c (c_parser_omp_clause_affinity): New.
4085 (c_parser_omp_clause_name, c_parser_omp_variable_list,
4086 c_parser_omp_all_clauses, OMP_TASK_CLAUSE_MASK): Handle affinity clause.
4087 * c-typeck.c (handle_omp_array_sections_1, handle_omp_array_sections,
4088 c_finish_omp_clauses): Likewise.
4089
01c59ef2
GA
40902021-05-26 Eric Botcazou <ebotcazou@adacore.com>
4091
4092 PR c/100653
4093 * c-decl.c (finish_struct): Warn for a union containing an aggregate
4094 field with a differing scalar storage order.
4095
2832d51b
GA
40962021-05-21 Jakub Jelinek <jakub@redhat.com>
4097
4098 PR middle-end/99928
4099 * c-typeck.c (c_finish_omp_clauses): Move firstprivate clauses with
4100 OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT to the end of the chain. Don't error
4101 if a decl is mentioned both in map clause and in such firstprivate
4102 clause unless OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET is also set.
4103
65f32e5d
GA
41042021-05-19 Jakub Jelinek <jakub@redhat.com>
4105
4106 PR middle-end/99928
4107 * c-parser.c (c_parser_omp_master): Set OMP_MASTER_COMBINED on
4108 master when combined with taskloop.
4109 (c_parser_omp_parallel): Don't set OMP_PARALLEL_COMBINED on
4110 parallel master when not combined with taskloop.
4111
a8daf9a1
GA
41122021-05-18 Richard Biener <rguenther@suse.de>
4113
4114 PR c/100522
4115 * gimple-parser.c (c_parser_gimple_postfix_expression_after_primary):
4116 Diagnose calls to non-functions.
4117 (c_parser_gimple_statement): Diagnose unexpected assignment RHS.
4118
a7ffc1ef
GA
41192021-05-17 Richard Biener <rguenther@suse.de>
4120
4121 PR c/100625
4122 * gimple-parser.c (c_parser_gimple_label): Avoid building
4123 a GIMPLE label with NULL label decl.
4124
f9af11c7
GA
41252021-05-13 Martin Sebor <msebor@redhat.com>
4126
4127 PR c/100550
4128 * c-decl.c (get_parm_array_spec): Avoid erroneous VLA bounds.
4129
0ff3a0f2
GA
41302021-05-12 Marcel Vollweiler <marcel@codesourcery.com>
4131
4132 * c-parser.c (c_parser_omp_clause_map): Support map-type-modifier
4133 'close'.
4134
aa891c56
GA
41352021-05-10 Martin Liska <mliska@suse.cz>
4136
4137 * c-aux-info.c (affix_data_type): Use startswith
4138 function instead of strncmp.
4139 * c-typeck.c (build_function_call_vec): Likewise.
4140 * gimple-parser.c (c_parser_gimple_parse_bb_spec): Likewise.
4141
62d87a32
GA
41422021-05-07 Eric Botcazou <ebotcazou@adacore.com>
4143
4144 * c-typeck.c (build_unary_op) <ADDR_EXPR>: Do not issue an error
4145 on the address of a pointer field in a record with reverse SSO.
4146
99e8df7a
GA
41472021-05-04 Tobias Burnus <tobias@codesourcery.com>
4148
4149 * c-typeck.c (c_finish_omp_clauses): Accept float + complex
4150 for || and && reductions.
4151
3c8e539d
GA
41522021-04-29 Joseph Myers <joseph@codesourcery.com>
4153
4154 * c-typeck.c (function_types_compatible_p): For C2X, treat
4155 unprototyped function as compatible with non-variadic prototyped
4156 function even if some argument types are changed by the default
4157 argument promotions.
4158
ee351f7f
GA
41592021-04-15 Martin Sebor <msebor@redhat.com>
4160
4161 PR c/99420
4162 PR c/99972
4163 * c-decl.c (pushdecl): Always propagate type attribute.
4164
41652021-04-15 Richard Sandiford <richard.sandiford@arm.com>
4166
4167 PR c/98852
4168 * c-typeck.c (c_common_type): Do not drop attributes that
4169 affect type identity.
4170
1d54b138
GA
41712021-04-10 Jakub Jelinek <jakub@redhat.com>
4172
4173 PR c/99990
4174 * c-decl.c (finish_decl): Don't overwrite TREE_TYPE of
4175 error_mark_node.
4176
4493b1c1
GA
41772021-03-25 Jakub Jelinek <jakub@redhat.com>
4178
4179 PR c++/99565
4180 * c-typeck.c (build_conditional_expr): Pass OEP_ADDRESS_OF_SAME_FIELD
4181 to operand_equal_p.
4182
5f256a70
GA
41832021-03-19 Jakub Jelinek <jakub@redhat.com>
4184
4185 PR c/99588
4186 * c-typeck.c (mark_exp_read): Recognize what build_atomic_assign
4187 with modifycode NOP_EXPR produces and mark the _Atomic var as read
4188 if found.
4189 (build_atomic_assign): For modifycode of NOP_EXPR, use COMPOUND_EXPRs
4190 rather than STATEMENT_LIST. Otherwise call mark_exp_read on lhs.
4191 Set TREE_SIDE_EFFECTS on the TARGET_EXPR.
4192
3c5b6d24
GA
41932021-03-15 Tobias Burnus <tobias@codesourcery.com>
4194
4195 PR c++/99509
4196 * c-decl.c (finish_decl): For 'omp declare target implicit' vars,
4197 ensure that the varpool node is marked as offloadable.
4198
ceae9533
GA
41992021-03-05 Tobias Burnus <tobias@codesourcery.com>
4200
4201 PR c/99137
4202 * c-parser.c (c_parser_oacc_clause_async): Reject comma expressions.
4203
4028d01a
GA
42042021-02-24 Martin Sebor <msebor@redhat.com>
4205
4206 PR middle-end/97172
4207 * c-decl.c (free_attr_access_data): Clear attribute arg spec.
4208
bf81237e
GA
42092021-02-18 Jakub Jelinek <jakub@redhat.com>
4210
4211 PR c/99136
4212 * c-typeck.c (c_finish_return): Don't wrap retval into
4213 EXCESS_PRECISION_EXPR in functions that return void.
4214
0c5cdb31
GA
42152021-02-11 Marek Polacek <polacek@redhat.com>
4216
4217 * c-parser.c (c_parser_if_statement): Use vec_free.
4218
a19dd5e6
GA
42192021-02-04 Martin Sebor <msebor@redhat.com>
4220
4221 PR c/97882
4222 * c-decl.c (locate_old_decl): Add type to diagnostic output.
4223 (diagnose_mismatched_decls): Same.
4224 (start_function): Introduce temporaries for better readability.
4225 * c-typeck.c (comptypes_internal): Only consider complete enum
4226 types in comparisons with integers.
4227
f7884fb1
GA
42282021-02-01 Martin Sebor <msebor@redhat.com>
4229
4230 PR middle-end/97172
4231 * c-decl.c (free_attr_access_data): New function.
4232 (c_parse_final_cleanups): Call free_attr_access_data.
4233
59cf67d1
GA
42342021-01-16 Kwok Cheung Yeung <kcy@codesourcery.com>
4235
4236 * c-parser.c (c_parser_omp_clause_detach): New.
4237 (c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH clause.
4238 (OMP_TASK_CLAUSE_MASK): Add mask for PRAGMA_OMP_CLAUSE_DETACH.
4239 * c-typeck.c (c_finish_omp_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH
4240 clause. Prevent use of detach with mergeable and overriding the
4241 data sharing mode of the event handle.
4242
2f7f0d32
GA
42432021-01-15 Jakub Jelinek <jakub@redhat.com>
4244
4245 * c-typeck.c (c_finish_omp_clauses): For reduction build array with
4246 unqualified element type and then call c_build_qualified_type on the
4247 ARRAY_TYPE.
4248
7d187e4f
GA
42492021-01-07 Richard Biener <rguenther@suse.de>
4250
4251 * gimple-parser.c (c_parser_gimple_compound_statement): Only
4252 reallocate loop array if it is too small.
4253
eefe499f
GA
42542020-12-16 Martin Uecker <muecker@gwdg.de>
4255
4256 PR c/98047
4257 * c-typeck.c (build_modify_expr): Drop qualifiers.
4258
42592020-12-16 Martin Uecker <muecker@gwdg.de>
4260
4261 PR c/98260
4262 * c-parser.c (c_parser_expression): Look into
4263 nop expression when marking expressions as read.
4264
d52945ce
GA
42652020-12-14 Martin Liska <mliska@suse.cz>
4266
4267 PR sanitizer/98204
4268 * c-typeck.c (pointer_diff): Do not emit a top-level
4269 sanitization.
4270 (build_binary_op): Likewise.
4271
ca2bd949
GA
42722020-12-09 Tobias Burnus <tobias@codesourcery.com>
4273
4274 * c-parser.c (c_parser_omp_allocate): New.
4275 (c_parser_omp_construct): Call it.
4276
42772020-12-09 Richard Biener <rguenther@suse.de>
4278
4279 PR c/98200
4280 * gimple-parser.c (c_parser_gimple_postfix_expression): Return
4281 early on error.
4282
bc8a7013
GA
42832020-12-07 Martin Uecker <muecker@gwdg.de>
4284
4285 PR c/97981
4286 * c-typeck.c (convert_lvalue_to_rvalue): Move the code
4287 that drops qualifiers to the end of the function.
4288
d48df6f2
GA
42892020-11-26 Martin Uecker <muecker@gwdg.de>
4290
4291 PR c/65455
4292 PR c/92935
4293 * c-parser.c (c_parser_declaration_or_fndef): Remove
4294 redundant code to drop qualifiers of _Atomic types for __auto_type.
4295 (c_parser_typeof_specifier): Do not drop qualifiers of _Atomic
4296 types for __typeof__.
4297
1e2c9a27
GA
42982020-11-24 Jakub Jelinek <jakub@redhat.com>
4299
4300 PR c/97958
4301 * c-parser.c (c_parser_binary_expression): For omp atomic binary
4302 expressions, use make_node instead of build2 to avoid checking build2
4303 performs.
4304
8e6198d0
GA
43052020-11-23 Joseph Myers <joseph@codesourcery.com>
4306
4307 PR c/95630
4308 * c-typeck.c (build_binary_op): Use pedwarn_c99 with OPT_Wpedantic
4309 for comparisons of complete and incomplete pointers.
4310
7a97e2fc
GA
43112020-11-21 Aaron Sawdey <acsawdey@linux.ibm.com>
4312
4313 * c-aux-info.c (gen_type): Support opaque types.
4314
82e5048e
GA
43152020-11-20 Martin Sebor <msebor@redhat.com>
4316
4317 PR middle-end/97879
4318 * c-decl.c (start_function): Set ATTR_FLAG_INTERNAL in flags.
4319
43202020-11-20 Jakub Jelinek <jakub@redhat.com>
4321
4322 PR other/97911
4323 * Make-lang.in (c.serial): Change from goal to a variable.
4324 (.PHONY): Drop c.serial.
4325
43262020-11-20 Martin Uecker <muecker@gwdg.de>
4327
4328 * c-typeck.c (convert_lvalue_to_rvalue): Drop qualifiers.
4329
d62586ee
GA
43302020-11-19 Jakub Jelinek <jakub@redhat.com>
4331
4332 PR c/97860
4333 * c-decl.c (get_parm_array_spec): Bail out of nelts is
4334 error_operand_p.
4335
25bb75f8
GA
43362020-11-18 Jakub Jelinek <jakub@redhat.com>
4337
4338 * Make-lang.in (c.serial): New goal.
4339 (.PHONY): Add c.serial c.prev.
4340 (cc1$(exeext)): Call LINK_PROGRESS.
4341
77f67db2
GA
43422020-11-13 Vladimir N. Makarov <vmakarov@redhat.com>
4343
4344 * c-parser.c (c_parser_asm_statement): Parse outputs for asm
4345 goto too.
4346 * c-typeck.c (build_asm_expr): Remove an assert checking output
4347 absence for asm goto.
4348
43492020-11-13 Jakub Jelinek <jakub@redhat.com>
4350
4351 * c-typeck.c (c_finish_omp_clauses): Don't clear
4352 OMP_CLAUSE_REDUCTION_INSCAN unless reduction_seen == -2.
4353
43542020-11-13 Iain Sandoe <iain@sandoe.co.uk>
4355
4356 PR objc/77404
4357 * c-parser.c (c_parser_objc_class_definition): Pass the
4358 location of the class name to the interface declaration.
4359
bb622641
GA
43602020-11-10 Strager Neds <strager.nds@gmail.com>
4361
4362 * c-decl.c (merge_decls): Use new overload of
4363 set_decl_section_name.
4364
43652020-11-10 Chung-Lin Tang <cltang@codesourcery.com>
4366
4367 * c-parser.c (c_parser_omp_target_data): Add use of
4368 new c_omp_adjust_map_clauses function. Add GOMP_MAP_ATTACH_DETACH as
4369 handled map clause kind.
4370 (c_parser_omp_target_enter_data): Likewise.
4371 (c_parser_omp_target_exit_data): Likewise.
4372 (c_parser_omp_target): Likewise.
4373 * c-typeck.c (handle_omp_array_sections): Adjust COMPONENT_REF case to
4374 use GOMP_MAP_ATTACH_DETACH map kind for C_ORT_OMP region type.
4375 (c_finish_omp_clauses): Adjust bitmap checks to allow struct decl and
4376 same struct field access to co-exist on OpenMP construct.
4377
2da7ee05
GA
43782020-11-07 Martin Uecker <muecker@gwdg.de>
4379
4380 * c-parser.c (c_parser_label): Implement mixing of labels and code.
4381 (c_parser_all_labels): Likewise.
4382
44cab2d8
GA
43832020-11-06 Iain Sandoe <iain@sandoe.co.uk>
4384
4385 * c-parser.c (c_parser_objc_at_property_declaration):
4386 Improve parsing fidelity. Associate better location info
4387 with @property attributes. Clean up the interface to
4388 objc_add_property_declaration ().
4389
43902020-11-06 Nathan Sidwell <nathan@acm.org>
4391
4392 * c-decl.c (diagnose_mismatched_decls): Rename
4393 DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN.
4394 (warn_if_shadowing, implicitly_declare, names_builtin_p)
4395 (collect_source_refs): Likewise.
4396 * c-typeck.c (inform_declaration, inform_for_arg)
4397 (convert_for_assignment): Likewise.
4398
43992020-11-06 Tobias Burnus <tobias@codesourcery.com>
4400
4401 * c-parser.c (c_parser_omp_atomic): Add openacc parameter and update
4402 OpenACC matching.
4403 (c_parser_omp_construct): Update call.
4404
35c125cb
GA
44052020-11-04 Jakub Jelinek <jakub@redhat.com>
4406
4407 PR c++/97670
4408 * c-typeck.c (c_finish_omp_clauses): Look through array reductions to
4409 find underlying decl to clear in the aligned_head bitmap.
4410
44112020-11-04 Joseph Myers <joseph@codesourcery.com>
4412
4413 * c-decl.c (handle_nodiscard_attribute): New.
4414 (std_attribute_table): Add nodiscard.
4415 * c-parser.c (c_parser_std_attribute): Expect argument to
4416 nodiscard attribute to be a string. Do not special-case ignoring
4417 nodiscard.
4418 * c-typeck.c (maybe_warn_nodiscard): New.
4419 (build_compound_expr, emit_side_effect_warnings): Call
4420 maybe_warn_nodiscard.
4421 (c_process_expr_stmt, c_finish_stmt_expr): Also call
4422 emit_side_effect_warnings if warn_unused_result.
4423
4f0606fe
GA
44242020-10-29 Asher Gordon <AsDaGo@posteo.net>
4425
4426 * c-typeck.c (free_all_tagged_tu_seen_up_to): Replace free
4427 with XDELETE.
4428 (finish_init): Likewise.
4429 (pop_init_level): Likewise.
4430
e93aae4a
GA
44312020-10-28 Joseph Myers <joseph@codesourcery.com>
4432
4433 * c-decl.c (store_parm_decls_newstyle): Use pedwarn_c11 not
4434 error_at for omitted parameter name.
4435
44362020-10-28 Jakub Jelinek <jakub@redhat.com>
4437
4438 * c-parser.c (c_parser_omp_clause_name): Handle allocate.
4439 (c_parser_omp_clause_allocate): New function.
4440 (c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_ALLOCATE.
4441 (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK,
4442 OMP_PARALLEL_CLAUSE_MASK, OMP_SINGLE_CLAUSE_MASK,
4443 OMP_TASK_CLAUSE_MASK, OMP_TASKGROUP_CLAUSE_MASK,
4444 OMP_DISTRIBUTE_CLAUSE_MASK, OMP_TEAMS_CLAUSE_MASK,
4445 OMP_TARGET_CLAUSE_MASK, OMP_TASKLOOP_CLAUSE_MASK): Add
4446 PRAGMA_OMP_CLAUSE_ALLOCATE.
4447 * c-typeck.c (c_finish_omp_clauses): Handle OMP_CLAUSE_ALLOCATE.
4448
89bb01e7
GA
44492020-10-27 Joseph Myers <joseph@codesourcery.com>
4450
4451 * c-parser.c (c_parser_std_attribute_specifier): Allow duplicate
4452 standard attributes.
4453
efe71fcc
GA
44542020-10-23 Marek Polacek <polacek@redhat.com>
4455
4456 PR c++/91741
4457 * c-parser.c (c_parser_binary_expression): Implement -Wsizeof-array-div.
4458 (c_parser_postfix_expression): Set PAREN_SIZEOF_EXPR.
4459 (c_parser_expr_list): Handle PAREN_SIZEOF_EXPR like SIZEOF_EXPR.
4460 * c-tree.h (char_type_p): Declare.
4461 * c-typeck.c (char_type_p): No longer static.
4462
44632020-10-23 Martin Sebor <msebor@redhat.com>
4464
4465 PR middle-end/97552
4466 * c-decl.c (get_parm_array_spec): Handle static VLA parameters.
4467
2fe5b7d1
GA
44682020-09-19 Martin Sebor <msebor@redhat.com>
4469
4470 PR c/50584
4471 * c-decl.c (lookup_last_decl): Define new function.
4472 (c_decl_attributes): Call it.
4473 (start_decl): Add argument and use it.
4474 (finish_decl): Call build_attr_access_from_parms and decl_attributes.
4475 (get_parm_array_spec): Define new function.
4476 (push_parm_decl): Call get_parm_array_spec.
4477 (start_function): Call warn_parm_array_mismatch. Build attribute
4478 access and add it to current function.
4479 * c-parser.c (c_parser_declaration_or_fndef): Diagnose mismatches
4480 in forms of array parameters.
4481 * c-tree.h (start_decl): Add argument.
4482
44832020-09-19 Sandra Loosemore <sandra@codesourcery.com>
4484
4485 * c-decl.c (c_break_label, c_cont_label): Delete, and replace
4486 with...
4487 (in_statement): New.
4488 (start_function): Adjust for above change.
4489 (c_push_function_context, c_pop_function_context): Likewise.
4490 * c-lang.h (struct language_function): Likewise.
4491 * c-objc-common.h (LANG_HOOKS_BLOCK_MAY_FALLTHRU): Define.
4492 * c-parser.c (objc_foreach_break_label, objc_foreach_continue_label):
4493 New.
4494 (c_parser_statement_after_labels): Adjust calls to c_finish_bc_stmt.
4495 (c_parser_switch_statement): Adjust break/switch context handling
4496 and calls to renamed functions.
4497 (c_parser_while_statement): Adjust break/switch context handling and
4498 build a WHILE_STMT.
4499 (c_parser_do_statement): Ditto, with DO_STMT respectively.
4500 (c_parser_for_statement): Ditto, with FOR_STMT respectively.
4501 (c_parser_omp_for_loop): Adjust break/switch context handling.
4502 * c-tree.h (c_break_label, c_cont_label): Delete.
4503 (IN_SWITCH_STMT, IN_ITERATION_STMT): Define.
4504 (IN_OMP_BLOCK, IN_OMP_FOR, IN_OBJC_FOREACH): Define.
4505 (in_statement, switch_statement_break_seen_p): Declare.
4506 (c_start_case, c_finish_case): Renamed to...
4507 (c_start_switch, c_finish_switch).
4508 (c_finish_bc_stmt): Adjust arguments.
4509 * c-typeck.c (build_function_call_vec): Don't try to print
4510 statements with %qE format.
4511 (struct c_switch): Rename switch_expr field to switch_stmt.
4512 Add break_stmt_seen_p field.
4513 (c_start_case): Rename to c_start_switch. Build a SWITCH_STMT
4514 instead of a SWITCH_EXPR. Update for changes to struct c_switch.
4515 (do_case): Update for changes to struct c_switch.
4516 (c_finish_case): Rename to c_finish_switch. Update for changes to
4517 struct c_switch and change of representation from SWITCH_EXPR to
4518 SWITCH_STMT.
4519 (c_finish_loop): Delete.
4520 (c_finish_bc_stmt): Update to reflect changes to break/continue
4521 state representation. Build a BREAK_STMT or CONTINUE_STMT instead
4522 of a GOTO_EXPR except for objc foreach loops.
4523
e1a4a8a0
GA
45242020-09-01 Jakub Jelinek <jakub@redhat.com>
4525
4526 PR c++/96867
4527 * c-typeck.c (handle_omp_array_sections_1): Test C_ARRAY_PARAMETER
4528 only on PARM_DECLs.
4529
8f7ea26a
GA
45302020-08-28 Martin Sebor <msebor@redhat.com>
4531
4532 PR c/96596
4533 * c-decl.c (match_builtin_function_types): Avoid dealing with erroneous
4534 argument type.
4535
8b394f01
GA
45362020-08-27 Martin Liska <mliska@suse.cz>
4537
4538 * gimple-parser.c (c_parser_gimple_compound_statement): Set exact argument of a vector
4539 growth function to true.
4540
db0f6efe
GA
45412020-08-25 Tobias Burnus <tobias@codesourcery.com>
4542
4543 PR c/96678
4544 * c-typeck.c (handle_omp_array_sections_1): Talk about
4545 array function parameter in the error message.
4546
5c265693
GA
45472020-08-18 Jakub Jelinek <jakub@redhat.com>
4548
4549 PR c/96571
4550 * c-parser.c (c_parser_generic_selection): Change match_found from bool
4551 to int, holding index of the match. Call mark_exp_read on the selector
4552 expression and on expressions other than the selected one.
4553
4967ca2f
GA
45542020-08-01 Richard Sandiford <richard.sandiford@arm.com>
4555
4556 PR c/96377
4557 * c-typeck.c (process_init_element): Split test for whether to
4558 recurse into a record, union or array into...
4559 (initialize_elementwise_p): ...this new function. Don't recurse
4560 into a vector type if the initialization value is also a vector.
4561
48cc2e46
GA
45622020-07-31 Richard Biener <rguenther@suse.de>
4563
4564 PR debug/96383
4565 * c-objc-common.h (LANG_HOOKS_FINALIZE_EARLY_DEBUG):
4566 Define to c_common_finalize_early_debug.
4567
3ea9abca
GA
45682020-07-22 Tobias Burnus <tobias@codesourcery.com>
4569
4570 * c-parser.c (c_parser_omp_clause_hint): Require nonnegative hint clause.
4571 (c_parser_omp_critical): Permit hint(0) clause without named critical.
4572 (c_parser_omp_construct): Don't assert if error_mark_node is returned.
4573
30430061
GA
45742020-07-21 Sunil K Pandey <skpgkp2@gmail.com>
4575
4576 PR target/95237
4577 * c-decl.c (finish_decl): Call target hook
4578 lower_local_decl_alignment to lower local decl alignment.
4579
3f8ca9cb
GA
45802020-07-09 Julian Brown <julian@codesourcery.com>
4581 Thomas Schwinge <thomas@codesourcery.com>
4582
4583 PR middle-end/95270
4584 * c-typeck.c (c_finish_omp_clauses): Set OMP_CLAUSE_SIZE (bias) to zero
4585 for standalone attach/detach clauses.
4586
a82c4c4c 45872020-07-08 Eric Botcazou <ebotcazou@adacore.com>
50873cc5
GA
4588
4589 * c-typeck.c (convert_for_assignment): If -Wscalar-storage-order is
4590 set, warn for conversion between pointers that point to incompatible
4591 scalar storage orders.
4592
f60ee68d
GA
45932020-07-07 Kaipeng Zhou <zhoukaipeng3@huawei.com>
4594
4595 * c-parser.c (c_parser_statement_after_labels): Pass correct
4596 parameters to c_parser_do_statement.
4597
56638b9b
GA
45982020-06-16 Jakub Jelinek <jakub@redhat.com>
4599
4600 * c-parser.c (c_parser_expr_no_commas): Save, clear and restore
4601 c_in_omp_for.
4602 (c_parser_omp_for_loop): Set c_in_omp_for around some calls to avoid
4603 premature c_fully_fold. Defer explicit c_fully_fold calls to after
4604 c_finish_omp_for.
4605 * c-tree.h (c_in_omp_for): Declare.
4606 * c-typeck.c (c_in_omp_for): Define.
4607 (build_modify_expr): Avoid c_fully_fold if c_in_omp_for.
4608 (digest_init): Likewise.
4609 (build_binary_op): Likewise.
4610
46112020-06-16 Jakub Jelinek <jakub@redhat.com>
4612
4613 * c-parser.c (c_parser_omp_clause_schedule): Reject modifier separated
4614 from kind by comma rather than colon.
4615
1a59f3db
GA
46162020-06-05 Mark Wielaard <mark@klomp.org>
4617
4618 * c-decl.c (implicit_decl_warning): When warned and olddecl is
4619 an undeclared builtin, then add a fixit header hint, if found.
4620 (implicitly_declare): Add OPT_Wbuiltin_declaration_mismatch to
4621 warning_at about implicit builtin declaration type mismatch.
4622
9a5b7438
GA
46232020-06-03 Mark Wielaard <mark@klomp.org>
4624
4625 * c-parser.c (struct c_parser): Add seen_string_literal
4626 bitfield.
4627 (c_parser_consume_token): Reset seen_string_literal.
4628 (c_parser_error_richloc): Add name_hint if seen_string_literal
4629 and next token is a CPP_NAME and we have a missing header
4630 suggestion for the name.
4631 (c_parser_string_literal): Set seen_string_literal.
4632
46332020-06-03 Mark Wielaard <mark@klomp.org>
4634
4635 * c-parser.c (c_parser_postfix_expression_after_primary): Add
4636 scope with matching_parens after CPP_OPEN_PAREN.
4637
46382020-06-03 Tobias Burnus <tobias@codesourcery.com>
4639
4640 * c-objc-common.h (LANG_HOOKS_OMP_PREDETERMINED_MAPPING): Redefine.
4641
53ffb43a
GA
46422020-05-28 Nicolas Bértolo <nicolasbertolo@gmail.com>
4643
4644 * Make-lang.in: Remove extra slash.
4645
8f66f175
ML
46462020-05-19 Martin Liska <mliska@suse.cz>
4647
4648 * c-parser.c: Fix typo.
4649
49ddde69
JJ
46502020-05-14 Jakub Jelinek <jakub@redhat.com>
4651
4652 * c-parser.c (c_parser_omp_target): Set cfun->has_omp_target.
4653
eb72dc66
RB
46542020-05-07 Richard Biener <rguenther@suse.de>
4655
4656 PR middle-end/94703
4657 * gimple-parser.c (c_parser_parse_ssa_name): Do not set
4658 DECL_GIMPLE_REG_P.
4659
bf915591
JJ
46602020-04-30 Jakub Jelinek <jakub@redhat.com>
4661
4662 PR c/94842
4663 * c-decl.c (set_labels_context_r): In addition to context-less
4664 LABEL_DECLs adjust also LABEL_DECLs with context equal to
4665 parent function if any.
4666 (store_parm_decls): Adjust comment.
4667
e1113ffb
JJ
46682020-04-19 Jakub Jelinek <jakub@redhat.com>
4669
4670 PR objc/94637
4671 * c-parser.c (c_parser_objc_selector_arg): Handle CPP_SCOPE like
4672 two CPP_COLON tokens.
4673
2e389749
JJ
46742020-04-17 Jakub Jelinek <jakub@redhat.com>
4675
4676 PR other/94629
4677 * c-parser.c (c_parser_oacc_routine): Remove redundant assignment
4678 to data.clauses.
4679
2dc9294c
JJ
46802020-04-15 Jakub Jelinek <jakub@redhat.com>
4681
4682 PR c/94593
4683 * c-parser.c (c_parser_pragma) <case PRAGMA_OMP_REQUIRES>: Reject
4684 requires directive when not at file scope.
4685
13e41d8b
TB
46862020-04-08 Tobias Burnus <tobias@codesourcery.com>
4687
4688 PR middle-end/94120
4689 * c-decl.c (c_check_in_current_scope): New function.
4690 * c-tree.h (c_check_in_current_scope): Declare it.
4691 * c-parser.c (c_parser_oacc_declare): Add check that variables
4692 are declared in the same scope as the directive. Fix handling
4693 of namespace vars.
4694
4df50a05
JJ
46952020-04-07 Jakub Jelinek <jakub@redhat.com>
4696
4697 PR c++/94512
4698 * c-parser.c (c_parser_omp_parallel): Set OMP_PARALLEL_COMBINED
4699 if c_parser_omp_master succeeded.
4700
5db9e893
JJ
47012020-03-23 Jakub Jelinek <jakub@redhat.com>
4702
4703 PR gcov-profile/94029
4704 PR c/94239
4705 * c-parser.c (c_parser_declaration_or_fndef): Initialize endloc to
4706 the function_start_locus location. Don't do that afterwards for the
4707 __GIMPLE body parsing.
4708
9def91e9
JJ
47092020-03-19 Jakub Jelinek <jakub@redhat.com>
4710
4711 PR gcov-profile/94029
4712 * c-tree.h (finish_function): Add location_t argument defaulted to
4713 input_location.
4714 * c-parser.c (c_parser_compound_statement): Add endlocp argument and
4715 set it to the locus of closing } if non-NULL.
4716 (c_parser_compound_statement_nostart): Return locus of closing }.
4717 (c_parser_parse_rtl_body): Likewise.
4718 (c_parser_declaration_or_fndef): Propagate locus of closing } to
4719 finish_function.
4720 * c-decl.c (finish_function): Add end_loc argument, use it instead of
4721 input_location to set function_end_locus.
4722
046c5890
JJ
47232020-03-17 Jakub Jelinek <jakub@redhat.com>
4724
4725 PR c/94172
4726 * c-tree.h (C_TYPE_INCOMPLETE_VARS): Define to TYPE_LANG_SLOT_1
4727 instead of TYPE_VFIELD, and support it on {RECORD,UNION,ENUMERAL}_TYPE.
4728 (TYPE_ACTUAL_ARG_TYPES): Check that it is only used on FUNCTION_TYPEs.
4729 * c-decl.c (pushdecl): Push C_TYPE_INCOMPLETE_VARS also to
4730 ENUMERAL_TYPEs.
4731 (finish_incomplete_vars): New function, moved from finish_struct. Use
4732 relayout_decl instead of layout_decl.
4733 (finish_struct): Remove obsolete comment about C_TYPE_INCOMPLETE_VARS
4734 being TYPE_VFIELD. Use finish_incomplete_vars.
4735 (finish_enum): Clear C_TYPE_INCOMPLETE_VARS. Call
4736 finish_incomplete_vars.
4737 * c-typeck.c (c_build_qualified_type): Clear C_TYPE_INCOMPLETE_VARS
4738 also on ENUMERAL_TYPEs.
4739
c015ff8c
JJ
47402020-03-16 Jakub Jelinek <jakub@redhat.com>
4741
4742 PR c/94179
4743 * c-fold.c (c_fully_fold_internal): Handle MEM_REF.
4744
f2e9fe5f
MS
47452020-03-13 Martin Sebor <msebor@redhat.com>
4746
4747 PR c/94040
4748 * c-decl.c (builtin_structptr_type_count): New constant.
4749 (match_builtin_function_types): Reject decls that are incompatible
4750 in types pointed to by pointers.
4751 (diagnose_mismatched_decls): Adjust comments.
4752
c9d70946
JM
47532020-03-05 Joseph Myers <joseph@codesourcery.com>
4754
4755 PR c/93577
4756 * c-typeck.c (pop_init_level): Do not diagnose initializers as
4757 empty when initialized type is error_mark_node.
4758 (set_designator, process_init_element): Ignore initializers for
4759 elements of a variable-size type or of error_mark_node.
4760
726e292d
MS
47612020-03-01 Martin Sebor <msebor@redhat.com>
4762
4763 PR middle-end/93926
4764 * c-decl.c (types_close_enough_to_match): New function.
4765 (match_builtin_function_types):
4766 (diagnose_mismatched_decls): Add missing inform call to a warning.
4767
a499c2f8
MS
47682020-03-01 Martin Sebor <msebor@redhat.com>
4769
4770 PR c/93812
4771 * c-typeck.c (build_functype_attribute_variant): New function.
4772 (composite_type): Call it.
4773
9c3da8cc
JJ
47742020-02-25 Jakub Jelinek <jakub@redhat.com>
4775
4776 PR other/93912
4777 * gimple-parser.c (c_parser_gimple_parse_bb_spec_edge_probability):
4778 Rename last argument from probablity to probability.
4779
bacdd5e9
JJ
47802020-02-13 Jakub Jelinek <jakub@redhat.com>
4781
4782 PR c/93576
4783 * c-decl.c (grokdeclarator): If this_size_varies, only push size into
4784 *expr if it has side effects.
4785
f9eb0973
JL
47862020-01-30 Jeff Law <law@redhat.com>
4787
4788 PR c/88660
4789 * c-parser.c (c_parser_switch_statement): Make sure to request
4790 marking the switch expr as used.
4791
ac68e287
JM
47922020-01-22 Joseph Myers <joseph@codesourcery.com>
4793
4794 PR c/93348
4795 * c-typeck.c (build_c_cast): Call remove_c_maybe_const_expr on
4796 argument with integer operands.
4797
852f0ae8
KK
47982020-01-16 Kerem Kat <keremkat@gmail.com>
4799
4800 PR c/92833
4801 * c-parser.c (c_parser_consume_token): Fix peeked token stack pop
4802 to support 4 available tokens.
4803
e2346a33
JM
48042020-01-15 Joseph Myers <joseph@codesourcery.com>
4805
4806 PR c/93072
4807 * c-decl.c (pushdecl): Use TREE_PUBLIC, not DECL_EXTERNAL, to
4808 determine whether to set DECL_CONTEXT.
4809
3d77686d
JM
48102020-01-13 Joseph Myers <joseph@codesourcery.com>
4811
4812 PR c/93241
4813 * c-typeck.c (build_c_cast): Check for expressions with integer
4814 operands that can occur in an unevaluated part of an integer
4815 constant expression and call note_integer_operands as needed.
4816
f74c4b2c
RB
48172019-01-08 Richard Biener <rguenther@suse.de>
4818
4819 PR middle-end/93199
4820 * gimple-parser.c (c_parser_parse_gimple_body): Remove __PHI IFN
4821 permanently.
4822
8d9254fc
JJ
48232020-01-01 Jakub Jelinek <jakub@redhat.com>
4824
4825 Update copyright years.
4826
39292e25
EB
48272019-12-20 Eric Botcazou <ebotcazou@adacore.com>
4828
4829 * c-decl.c (collect_source_ref_cb): Delete.
4830 (for_each_global_decl): Rename into...
4831 (collect_source_refs): ...this. Call collect_source_ref directly.
4832 (c_parse_final_cleanups): Always call collect_source_ref on the main
4833 input filename.
4834
519d7496
JB
48352019-12-19 Julian Brown <julian@codesourcery.com>
4836 Cesar Philippidis <cesar@codesourcery.com>
4837
4838 * c-parser.c (c_parser_omp_clause_name): Add parsing of attach and
4839 detach clauses.
4840 (c_parser_omp_variable_list): Add ALLOW_DEREF optional parameter.
4841 Allow deref (->) in variable lists if true.
4842 (c_parser_omp_var_list_parens): Add ALLOW_DEREF optional parameter.
4843 Pass to c_parser_omp_variable_list.
4844 (c_parser_oacc_data_clause): Support attach and detach clauses. Update
4845 call to c_parser_omp_variable_list.
4846 (c_parser_oacc_all_clauses): Support attach and detach clauses.
4847 (OACC_DATA_CLAUSE_MASK, OACC_ENTER_DATA_CLAUSE_MASK,
4848 OACC_KERNELS_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK,
4849 OACC_SERIAL_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_ATTACH.
4850 (OACC_EXIT_DATA_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_DETACH.
4851 * c-typeck.c (handle_omp_array_sections_1): Reject subarrays for attach
4852 and detach. Support deref.
4853 (handle_omp_array_sections): Use GOMP_MAP_ATTACH_DETACH instead of
4854 GOMP_MAP_ALWAYS_POINTER for OpenACC.
4855 (c_oacc_check_attachments): New function.
4856 (c_finish_omp_clauses): Check attach/detach arguments for being
4857 pointers using above. Support deref.
4858
a6163563
JB
48592019-12-19 Julian Brown <julian@codesourcery.com>
4860 Maciej W. Rozycki <macro@codesourcery.com>
4861 Tobias Burnus <tobias@codesourcery.com>
4862 Thomas Schwinge <thomas@codesourcery.com>
4863
4864 * c-parser.c (c_parser_omp_clause_name): Support no_create.
4865 (c_parser_oacc_data_clause): Likewise.
4866 (c_parser_oacc_all_clauses): Likewise.
4867 (OACC_DATA_CLAUSE_MASK, OACC_KERNELS_CLAUSE_MASK)
4868 (OACC_PARALLEL_CLAUSE_MASK, OACC_SERIAL_CLAUSE_MASK): Add
4869 PRAGMA_OACC_CLAUSE_NO_CREATE.
4870 * c-typeck.c (handle_omp_array_sections): Support
4871 GOMP_MAP_NO_ALLOC.
4872
d68f5d45
DM
48732019-12-09 David Malcolm <dmalcolm@redhat.com>
4874
4875 * c-objc-common.c (range_label_for_type_mismatch::get_text):
4876 Replace label_text ctor calls.
4877
4691bf46
JM
48782019-12-04 Joseph Myers <joseph@codesourcery.com>
4879
4880 PR c/36941
4881 PR c/88827
4882 * c-typeck.c (convert_lvalue_to_rvalue): Call
4883 require_complete_type for arguments not of void types.
4884 (build_indirect_ref): Do not diagnose dereferencing pointers to
4885 incomplete types.
4886 * c-tree.h (C_TYPE_ERROR_REPORTED): Remove.
4887
85d11957
JM
48882019-12-03 Joseph Myers <joseph@codesourcery.com>
4889
4890 PR c/88704
4891 * c-decl.c (store_parm_decls_oldstyle): Diagnose use of [*] in
4892 old-style parameter definitions.
4893
4569f8b3
SL
48942019-12-01 Sandra Loosemore <sandra@codesourcery.com>
4895
4896 PR target/92499
4897
4898 * c-decl.c (flexible_array_type_p): Move to common code.
4899
65ef05d0
RS
49002019-11-30 Richard Sandiford <richard.sandiford@arm.com>
4901
4902 * c-decl.c (start_decl): Allow initialization of variables whose
4903 size is a POLY_INT_CST.
4904 (finish_decl): Use verify_type_context to check whether the target
4905 allows variables with a particular type to have static or thread-local
4906 storage duration. Don't raise a second error if such variables do
4907 not have a constant size.
4908 (grokdeclarator): Use verify_type_context to check whether the
4909 target allows fields or array elements to have a particular type.
4910 * c-typeck.c (pointer_diff): Use verify_type_context to test whether
4911 the target allows pointer difference for the types involved.
4912 (build_unary_op): Likewise for pointer increment and decrement.
4913
34b43828
JM
49142019-11-29 Joseph Myers <joseph@codesourcery.com>
4915
4916 * c-parser.c (struct c_parser): Add members raw_tokens and
4917 raw_tokens_used.
4918 (c_lex_one_token): Add argument raw. Handle lexing raw tokens and
4919 using previously-lexed raw tokens.
4920 (c_parser_peek_nth_token_raw)
4921 (c_parser_check_balanced_raw_token_sequence): New functions.
4922 (c_parser_nth_token_starts_std_attributes): Use
4923 c_parser_check_balanced_raw_token_sequence for Objective-C.
4924
5b8d9367
JM
49252019-11-25 Joseph Myers <joseph@codesourcery.com>
4926
4927 PR c/91985
4928 * c-decl.c (finish_declspecs): Use int instead of decimal
4929 floating-point types if decimal floating-point not supported.
4930
1723e1be
JM
49312019-11-25 Joseph Myers <joseph@codesourcery.com>
4932
4933 * c-tree.h (struct c_declarator): Use a structure for id member.
4934 * c-decl.c (grokdeclarator): Extract attributes from cdk_id
4935 declarators at the start, not when handling individual declarators
4936 later. Use u.id.id instead of u.id.
4937 (grokfield): Use u.id.id instead of u.id.
4938 (build_id_declarator): Set u.id.id and u.id.attrs.
4939 (finish_declspecs): Handle postfix attributes in case of typedef
4940 name or typeof used.
4941 * c-parser.c (c_parser_direct_declarator)
4942 (c_parser_direct_declarator_inner): Place declarator for
4943 attributes inside that for function or array, not outside. Set
4944 u.id.attrs for identifiers.
4945 (c_parser_parameter_declaration): Use u.id.id instead of u.id.
4946 * gimple-parser.c (c_parser_gimple_declaration): Use u.id.id
4947 instead of u.id.
4948
bdaf8be1
JJ
49492019-11-22 Jakub Jelinek <jakub@redhat.com>
4950
4951 PR c/90677
4952 * c-decl.c (identifier_global_tag): Define.
4953
3e00ba47
RB
49542019-11-20 Richard Biener <rguenther@suse.de>
4955
4956 PR c/92088
4957 * c-decl.c (grokdeclarator): Prevent inlining of nested
4958 function with VLA arguments.
4959
8c5b727a
JM
49602019-11-20 Joseph Myers <joseph@codesourcery.com>
4961
4962 * c-decl.c (c_warn_type_attributes): New function.
4963 (groktypename, grokdeclarator, finish_declspecs): Call
4964 c_warn_type_attributes before applying attributes to types.
4965 * c-tree.h (c_warn_type_attributes): Declare.
4966
192961ff
JM
49672019-11-19 Joseph Myers <joseph@codesourcery.com>
4968
4969 * c-decl.c (c_warn_unused_attributes): Use pedwarn not warning for
4970 standard attributes.
4971 * c-parser.c (c_parser_std_attribute): Take argument for_tm. Use
4972 pedwarn for unknown standard attributes and return error_mark_node
4973 for them.
4974
20a38017
MM
49752019-11-18 Matthew Malcomson <matthew.malcomson@arm.com>
4976
4977 * c-parser.c (c_parser_parse_rtl_body): Always call
4978 run_rtl_passes, even if startwith pass is not provided.
4979
d5fbe5e0
JM
49802019-11-15 Joseph Myers <joseph@codesourcery.com>
4981
4982 * c-parser.c (c_parser_std_attribute_specifier): Diagnose
4983 duplicate standard attributes.
4984
97cc1187
JM
49852019-11-15 Joseph Myers <joseph@codesourcery.com>
4986
4987 * c-decl.c (std_attribute_table): Add maybe_unused.
4988
f8aea5e3
JM
49892019-11-15 Joseph Myers <joseph@codesourcery.com>
4990
4991 * c-decl.c (std_attribute_table): Add fallthrough.
4992 * c-parser.c (c_parser_declaration_or_fndef): Diagnose fallthrough
4993 attribute at top level.
4994
2cc94aa8
JM
49952019-11-15 Joseph Myers <joseph@codesourcery.com>
4996
4997 * c-decl.c (std_attribute_table): New.
4998 (c_init_decl_processing): Register attributes from
4999 std_attribute_table.
5000 * c-parser.c (c_parser_attribute_arguments): Add arguments
5001 require_string and allow_empty_args. All callers changed.
5002 (c_parser_std_attribute): Set require_string argument for
5003 "deprecated" attribute.
5004
7c5890cc
JM
50052019-11-14 Joseph Myers <joseph@codesourcery.com>
5006
5007 * c-parser.c (c_parser_postfix_expression)
5008 (c_parser_check_literal_zero): Handle CPP_UTF8CHAR.
5009 * gimple-parser.c (c_parser_gimple_postfix_expression): Likewise.
5010
e8738f4e
RS
50112019-11-14 Richard Sandiford <richard.sandiford@arm.com>
5012
5013 * c-typeck.c (build_conditional_expr): Use truth_type_for instead
5014 of build_same_sized_truth_vector_type.
5015 (build_vec_cmp): Likewise.
5016
b2417b59
JJ
50172019-11-14 Jakub Jelinek <jakub@redhat.com>
5018
bedb7f04
JJ
5019 * c-parser.c (c_parser_omp_context_selector): Don't require score
5020 argument to fit into shwi, just to be INTEGER_CST. Diagnose
5021 negative score.
5022
b2417b59
JJ
5023 * c-parser.c (c_parser_omp_context_selector): Rename
5024 CTX_PROPERTY_IDLIST to CTX_PROPERTY_NAME_LIST, add CTX_PROPERTY_ID.
5025 Use CTX_PROPERTY_ID for atomic_default_mem_order, only allow a single
5026 identifier in that. For CTX_PROPERTY_NAME_LIST, allow identifiers
5027 and string literals.
5028
4e03c3a7
JM
50292019-11-14 Joseph Myers <joseph@codesourcery.com>
5030
5031 * c-tree.h (enum c_typespec_kind): Add ctsk_tagref_attrs and
5032 ctsk_tagfirstref_attrs.
5033 (struct c_declspecs): Update description of attrs. Add
5034 postfix_attrs and non_std_attrs_seen_p. Increase size of
5035 typespec_kind bit-field.
5036 (c_warn_unused_attributes): New declaration.
5037 (parser_xref_tag): Update prototype.
5038 * c-decl.c (c_warn_unused_attributes): New function.
5039 (shadow_tag_warned): Handle ctsk_tagfirstref_attrs and
5040 ctsk_tagref_attrs. Handle attribute declarations.
5041 (check_compound_literal_type): Handle ctsk_tagfirstref_attrs.
5042 (grokdeclarator): Handle standard attributes.
5043 (parser_xref_tag): Add arguments have_std_attrs and attrs. Apply
5044 attributes to incomplete type reference.
5045 (xref_tag): Update call to parser_xref_tag.
5046 (declspecs_add_addrspace, declspecs_add_type)
5047 (declspecs_add_scspec, declspecs_add_attrs): Set
5048 non_std_attrs_seen_p.
5049 (finish_declspecs): Apply postfix standard attributes to type.
5050 * c-parser.c (c_token_starts_declspecs)
5051 (c_token_starts_declaration, c_parser_next_token_starts_declspecs)
5052 (c_parser_next_tokens_start_declaration): Update comments.
5053 (c_parser_consume_token, c_parser_consume_pragma): Handle moving
5054 parser->tokens[2] to parser->tokens[1].
5055 (c_parser_nth_token_starts_std_attributes)
5056 (c_parser_std_attribute_specifier_sequence): New functions.
5057 (c_parser_declaration_or_fndef): Add arguments have_attrs and
5058 attrs. All callers changed. Handle standard attributes.
5059 (c_parser_parms_declarator, c_parser_parms_list_declarator)
5060 (c_parser_parameter_declaration): Add argument have_gnu_attrs.
5061 All callers changed.
5062 (c_parser_declspecs): Add arguments start_std_attr_ok and
5063 end_std_attr_ok. All callers changed. Handle standard
5064 attributes.
5065 (c_parser_enum_specifier, c_parser_struct_or_union_specifier)
5066 (c_parser_direct_declarator, c_parser_direct_declarator_inner)
5067 (c_parser_compound_statement_nostart, c_parser_all_labels)
5068 (c_parser_label, c_parser_statement, c_parser_for_statement):
5069 Handle standard attributes.
5070 * c-parser.h (c_parser_declspecs): Update prototype.
5071 * gimple-parser.c (c_parser_gimple_declaration): Update call to
5072 c_parser_declspecs.
5073
0c29cac4
ML
50742019-11-12 Martin Liska <mliska@suse.cz>
5075
5076 * gimple-parser.c: Do not include params.h.
5077
028d4092
ML
50782019-11-12 Martin Liska <mliska@suse.cz>
5079
5080 * gimple-parser.c (c_parser_parse_gimple_body): Replace old parameter syntax
5081 with the new one, include opts.h if needed. Use SET_OPTION_IF_UNSET
5082 macro.
5083
62aee289
MR
50842019-11-12 Maciej W. Rozycki <macro@codesourcery.com>
5085 Frederik Harwath <frederik@codesourcery.com>
5086
5087 gcc/c/
5088 * c-parser.c (OACC_SERIAL_CLAUSE_MASK): New macro.
5089 (c_parser_oacc_kernels_parallel): Rename function to...
5090 (c_parser_oacc_compute): ... this. Handle PRAGMA_OACC_SERIAL.
5091 (c_parser_omp_construct): Update accordingly.
5092
5093
7cec9588
JJ
50942019-11-11 Jakub Jelinek <jakub@redhat.com>
5095
5096 * c-parser.c (c_parser_translation_unit): Diagnose declare target
5097 without corresponding end declare target.
5098
f486280c
RS
50992019-11-08 Richard Sandiford <richard.sandiford@arm.com>
5100
5101 * c-convert.c (convert): Only handle vector conversions if one of
5102 the types satisfies gnu_vector_type_p or if -flax-vector-conversions
5103 allows it.
5104 * c-typeck.c (build_array_ref): Only allow vector indexing if the
5105 vectors satisfy gnu_vector_type_p.
5106 (build_unary_op): Only allow unary operators to be applied to
5107 vectors if they satisfy gnu_vector_type_p.
5108 (digest_init): Only allow by-element initialization of vectors
5109 if they satisfy gnu_vector_type_p.
5110 (really_start_incremental_init): Likewise.
5111 (push_init_level): Likewise.
5112 (pop_init_level): Likewise.
5113 (process_init_element): Likewise.
5114 (build_binary_op): Only allow binary operators to be applied to
5115 vectors if they satisfy gnu_vector_type_p.
5116
017c6491
JM
51172019-11-08 Joseph Myers <joseph@codesourcery.com>
5118
5119 * c-decl.c (grokparms): Convert () in a function definition to
5120 (void) for C2x.
5121 (store_parm_decls_oldstyle): Pedwarn for C2x.
5122 (store_parm_decls): Update comment about () not generating a
5123 prototype.
5124
c01bd174
JM
51252019-11-07 Joseph Myers <joseph@codesourcery.com>
5126
5127 * c-parser.c (c_parser_attribute_arguments): New function.
5128 Factored out of c_parser_gnu_attribute.
5129 (c_parser_gnu_attribute): Use c_parser_attribute_arguments.
5130 (c_parser_balanced_token_sequence, c_parser_std_attribute)
5131 (c_parser_std_attribute_specifier): New functions.
5132 (c_parser_transaction_attributes): Use
5133 c_parser_std_attribute_specifier.
5134
471c5330
JM
51352019-11-07 Joseph Myers <joseph@codesourcery.com>
5136
5137 * c-parser.c (c_parser): Remove lex_untranslated_string. Add
5138 lex_joined_string and translate_strings_p.
5139 (c_lex_one_token): Pass 0 or C_LEX_STRING_NO_JOIN to
5140 c_lex_with_flags.
5141 (c_parser_string_literal): New function.
5142 (c_parser_static_assert_declaration_no_semi): Use
5143 c_parser_string_literal. Do not set lex_untranslated_string.
5144 (c_parser_asm_string_literal): Use c_parser_string_literal.
5145 (c_parser_simple_asm_expr): Do not set lex_untranslated_string.
5146 (c_parser_gnu_attributes): Set and restore translate_strings_p
5147 instead of lex_untranslated_string.
5148 (c_parser_asm_statement): Do not set lex_untranslated_string.
5149 (c_parser_asm_operands): Likewise.
5150 (c_parser_has_attribute_expression): Set and restore
5151 translate_strings_p instead of lex_untranslated_string.
5152 (c_parser_postfix_expression): Use c_parser_string_literal.
5153 (pragma_lex): Likewise.
5154 (c_parser_pragma_pch_preprocess): Set lex_joined_string.
5155 (c_parse_file): Set translate_strings_p.
5156 * gimple-parser.c (c_parser_gimple_postfix_expression)
5157 (c_parser_gimple_or_rtl_pass_list): Use c_parser_string_literal.
5158 * c-parser.c (c_parser_string_literal): Declare function.
5159
d0c464d2
JJ
51602019-11-02 Jakub Jelinek <jakub@redhat.com>
5161
5162 * c-parser.c (c_finish_omp_declare_variant): Use
5163 omp_get_context_selector instead of c_omp_get_context_selector.
5164
ac2cfa6c
RS
51652019-10-29 Richard Sandiford <richard.sandiford@arm.com>
5166
5167 * c-tree.h (c_simulate_enum_decl): Declare.
5168 * c-decl.c (c_simulate_enum_decl): New function.
5169 * c-objc-common.h (LANG_HOOKS_SIMULATE_ENUM_DECL): Define to the above.
5170
74078538
RS
51712019-10-29 Richard Sandiford <richard.sandiford@arm.com>
5172
5173 * c-tree.h (c_simulate_builtin_function_decl): Declare.
5174 * c-decl.c (c_simulate_builtin_function_decl): New function.
5175 * c-objc-common.h (LANG_HOOKS_SIMULATE_BUILTIN_FUNCTION_DECL): Define
5176 to the above.
5177
ad1539d5
MS
51782019-10-28 Martin Sebor <msebor@redhat.com>
5179
5180 PR c/66970
5181 * c-decl.c (names_builtin_p): Define a new function.
5182
cb73e4e7
RB
51832019-10-28 Richard Biener <rguenther@suse.de>
5184
5185 PR c/92249
5186 * gimple-parser.c (c_parser_parse_gimple_body): Make
5187 current_bb the entry block initially to easier recover
5188 from errors.
5189 (c_parser_gimple_compound_statement): Adjust.
5190
135df52c
JJ
51912019-10-24 Jakub Jelinek <jakub@redhat.com>
5192
5193 * c-parser.c (c_finish_omp_declare_variant): Use
5194 omp_context_selector_matches instead of
5195 c_omp_context_selector_matches.
5196 * c-decl.c (c_decl_attributes): Add "omp declare target block"
5197 attribute in between declare target and end declare target
5198 pragmas.
5199
783bfe5e
JM
52002019-10-15 Joseph Myers <joseph@codesourcery.com>
5201
5202 * c-parser.c (c_parser_attribute_any_word): Rename to
5203 c_parser_gnu_attribute_any_word. All callers changed.
5204 (c_parser_attribute): Rename to c_parser_gnu_attribute. All
5205 callers changed.
5206 (c_parser_attributes): Rename to c_parser_gnu_attributes. All
5207 callers changed.
5208 (c_parser_declaration_or_fndef, c_parser_declspecs)
5209 (c_parser_enum_specifier, c_parser_struct_or_union_specifier)
5210 (c_parser_struct_declaration, c_parser_declarator)
5211 (c_parser_gnu_attribute, c_parser_compound_statement)
5212 (c_parser_label, c_parser_statement, c_parser_objc_method_decl)
5213 (c_parser_transaction_attributes): Add "gnu-" prefix to names of
5214 attribute-related syntax productions.
5215
56898e43
RS
52162019-10-14 Richard Sandiford <richard.sandiford@arm.com>
5217
5218 * c-objc-common.c (useful_aka_type_p): Replace with...
5219 (get_aka_type): ...this new function. Given the original type,
5220 decide which aka type to print (if any). Only look through typedefs
5221 if user_facing_original_type_p.
5222 (print_type): Update accordingly.
5223
b9424661
JJ
52242019-10-14 Jakub Jelinek <jakub@redhat.com>
5225
5226 * c-parser.c (c_parser_omp_all_clauses): Change bool NESTED_P argument
5227 into int NESTED, if it is 2, diagnose missing commas in between
5228 clauses.
5229 (c_parser_omp_context_selector): Pass 2 as last argument to
5230 c_parser_omp_all_clauses.
5231
20de9568
JJ
52322019-10-12 Jakub Jelinek <jakub@redhat.com>
5233
5234 * c-parser.c (c_parser_omp_context_selector): Improve error recovery.
5235 For simd properties, put them directly into TREE_VALUE.
5236 (c_finish_omp_declare_variant): Call c_omp_mark_declare_variant.
5237 If c_omp_context_selector_matches is 0, don't add attribute, otherwise
5238 add "omp declare variant base" attribute rather than
5239 "omp declare variant".
5240
fe2bc27c
JM
52412019-10-11 Joseph Myers <joseph@codesourcery.com>
5242
5243 * c-decl.c (declspecs_add_type): Use pedwarn_c11 for DFP types.
5244
94e7f906
JJ
52452019-10-10 Jakub Jelinek <jakub@redhat.com>
5246
5247 * c-parser.c (c_parser_omp_all_clauses): Add NESTED_P argument, if
5248 true, terminate processing on closing paren and don't skip to end of
5249 pragma line.
5250 (c_parser_omp_declare_simd): Handle also declare variant.
5251 (omp_construct_selectors, omp_device_selectors,
5252 omp_implementation_selectors, omp_user_selectors): New variables.
5253 (c_parser_omp_context_selector,
5254 c_parser_omp_context_selector_specification,
5255 c_finish_omp_declare_variant): New functions.
5256 (c_finish_omp_declare_simd): Handle both declare simd and
5257 declare variant.
5258 (c_parser_omp_declare): Handle declare variant.
5259
93313b94
JM
52602019-10-02 Joseph Myers <joseph@codesourcery.com>
5261
5262 * c-parser.c (c_parser_asm_statement): Handle CPP_SCOPE like two
5263 CPP_COLON tokens.
5264
55879815
RS
52652019-10-01 Richard Sandiford <richard.sandiford@arm.com>
5266
5267 * c-objc-common.c (useful_aka_type_p): New function.
5268 (print_type): Use it to decide whether an aka type is worth printing.
5269
59bc434a
JJ
52702019-09-27 Jakub Jelinek <jakub@redhat.com>
5271
5272 PR c++/88203
5273 * c-parser.c (c_parser_predefined_identifier): New function.
5274 (c_parser_postfix_expression): Use it.
5275 (c_parser_omp_variable_list): Parse predefined identifiers.
5276 * c-typeck.c (c_finish_omp_clauses): Allow predefined variables
5277 in shared and firstprivate clauses, even when they are predetermined
5278 shared.
5279
c6447c20
RS
52802019-09-27 Richard Sandiford <richard.sandiford@arm.com>
5281
5282 * c-typeck.c (build_function_call_vec): Take the original function
5283 decl as an optional final parameter. Pass all built-in calls to
5284 check_builtin_function_arguments.
5285
522da4c2
EB
52862019-09-20 Eric Botcazou <ebotcazou@adacore.com>
5287
5288 PR c/91815
5289 * c-decl.c (pushdecl): In C detect duplicate declarations across scopes
5290 of identifiers in the external scope only for variables and functions.
5291
68e2c199
PK
52922019-09-04 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
5293
5294 PR c/78736
5295 * c-typeck.c (convert_for_assignment): Handle Wenum-conversion.
5296
22f8849d
IS
52972019-08-23 Iain Sandoe <iain@sandoe.co.uk>
5298
5299 PR pch/61250
5300 * c-parser.c (c_parse_file): Call c_common_no_more_pch ()
5301 after determining that the first token is not
5302 PRAGMA_GCC_PCH_PREPROCESS.
5303
db376f45
EB
53042019-08-22 Eric Botcazou <ebotcazou@adacore.com>
5305
5306 * c-parser.c (c_parser_declaration_or_fndef): Set DECL_ARGUMENTS of a
5307 FUNCTION_DECL to the right value in the presence of nested declarators.
5308
4d732405
RS
53092019-08-13 Richard Sandiford <richard.sandiford@arm.com>
5310
5311 PR middle-end/91421
5312 * c-decl.c (merge_decls): Use copy_decl_built_in_function.
5313
cb1180d5
RS
53142019-08-13 Richard Sandiford <richard.sandiford@arm.com>
5315
5316 PR middle-end/91421
5317 * c-decl.c (header_for_builtin_fn): Take a FUNCTION_DECL instead
5318 of a built_in_function.
5319 (diagnose_mismatched_decls, implicitly_declare): Update accordingly.
5320
77eb117f
JJ
53212019-08-10 Jakub Jelinek <jakub@redhat.com>
5322
5323 * c-parser.c (c_parser_omp_clause_name): Parse device_type.
5324 (c_parser_omp_clause_device_type): New function.
5325 (c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DEVICE_TYPE.
5326 (OMP_DECLARE_TARGET_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_DEVICE_TYPE.
5327 (c_parser_omp_declare_target): Handle device_type clauses. Remove
5328 diagnostics for declare target with clauses nested in clause-less
5329 declare target declaration-definition-seq.
5330 * c-typeck.c (c_finish_omp_clauses): Handle OMP_CLAUSE_DEVICE_TYPE.
5331
2c3b8bad
JJ
53322019-08-09 Jakub Jelinek <jakub@redhat.com>
5333
bb522e2e
JJ
5334 * c-parser.c (check_no_duplicate_clause): Simplify using
5335 omp_find_clause.
5336 (c_parser_omp_clause_if): Fix up printing of target {enter,exit} data
5337 directive name modifiers.
5338 (c_parser_omp_clause_proc_bind): Check for duplicate proc_bind clause.
5339
2c3b8bad
JJ
5340 PR c/91401
5341 * c-parser.c (c_parser_omp_clause_dist_schedule): Fix up typos in the
5342 check_no_duplicate_clause call. Comment it out, instead emit a
5343 warning for duplicate dist_schedule clauses.
5344
99769e7f
RS
53452019-08-08 Richard Sandiford <richard.sandiford@arm.com>
5346
5347 * c-decl.c (finish_enum): Clear C_TYPE_BEING_DEFINED.
5348
8860d270
JJ
53492019-08-08 Jakub Jelinek <jakub@redhat.com>
5350
5351 * c-typeck.c (c_finish_omp_clauses): For C_ORT_OMP
5352 OMP_CLAUSE_USE_DEVICE_* clauses use oacc_reduction_head bitmap
5353 instead of generic_head to track duplicates.
5354
398e3feb
JJ
53552019-08-07 Jakub Jelinek <jakub@redhat.com>
5356
5357 * c-parser.c (c_parser_omp_clause_name): Parse use_device_addr clause.
5358 (c_parser_omp_clause_use_device_addr): New function.
5359 (c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_USE_DEVICE_ADDR.
5360 (OMP_TARGET_DATA_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_USE_DEVICE_ADDR.
5361 (c_parser_omp_target_data): Handle PRAGMA_OMP_CLAUSE_USE_DEVICE_ADDR
5362 like PRAGMA_OMP_CLAUSE_USE_DEVICE_PTR, adjust diagnostics about no
5363 map or use_device_* clauses.
5364 * c-typeck.c (c_finish_omp_clauses): For OMP_CLAUSE_USE_DEVICE_PTR
5365 in OpenMP, require pointer type rather than pointer or array type.
5366 Handle OMP_CLAUSE_USE_DEVICE_ADDR.
5367
a28351e7
JJ
53682019-07-31 Jakub Jelinek <jakub@redhat.com>
5369
5370 PR c/91192
5371 * c-parser.c (c_parser_sizeof_expression): Call set_c_expr_source_range
5372 even if finish is UNKNOWN_LOCATION, just use start as finish in that
5373 case.
5374
6343b6bf
ML
53752019-07-25 Martin Liska <mliska@suse.cz>
5376 Dominik Infuhr <dominik.infuehr@theobroma-systems.com>
5377
5378 PR c++/23383
5379 * c-decl.c (merge_decls): Merge OPERATOR_DELETE flag.
5380
cb50701e
ML
53812019-07-25 Martin Liska <mliska@suse.cz>
5382
5383 * c-decl.c (merge_decls): Use new macros
5384 (e.g. DECL_SET_LAMBDA_FUNCTION and DECL_LAMBDA_FUNCTION_P).
5385
62e3e66f
RB
53862019-07-23 Richard Biener <rguenther@suse.de>
5387
5388 PR tree-optimization/83518
5389 * gimple-parser.c (c_parser_parse_gimple_body): When we have
5390 a CFG also rebuild cgraph edges.
5391
554a530f
JJ
53922019-07-20 Jakub Jelinek <jakub@redhat.com>
5393
5394 * c-parser.c (c_parser_omp_clause_name): Handle bind clause.
5395 (c_parser_omp_clause_bind): New function.
5396 (c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_BIND.
5397 (OMP_LOOP_CLAUSE_MASK): Define.
5398 (c_parser_omp_loop): New function.
5399 (c_parser_omp_parallel, c_parser_omp_teams): Handle parsing of
5400 loop combined with parallel or teams.
5401 (c_parser_omp_construct): Handle PRAGMA_OMP_LOOP.
5402 * c-typeck.c (c_finish_omp_clauses): Handle OMP_CLAUSE_BIND.
5403
d119bf79
RS
54042019-07-18 Richard Sandiford <richard.sandiford@arm.com>
5405
5406 PR c/53633
5407 * c-decl.c (finish_function): Check targetm.warn_func_return
5408 before issuing a -Wreturn-type warning.
5409
ab20d992 54102019-07-12 Alexandre Oliva <oliva@adacore.com>
fdc1f343
AO
5411
5412 * gimple-parser.c (c_parser_gimple_try_stmt): New.
5413 (c_parser_compound_statement): Call it.
5414
1fdd6f04
JJ
54152019-07-12 Jakub Jelinek <jakub@redhat.com>
5416
5417 * c-parser.c (c_parser_omp_clause_name): Handle order clause.
5418 (c_parser_omp_clause_order): New function.
5419 (c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_ORDER.
5420 (OMP_SIMD_CLAUSE_MASK, OMP_FOR_CLAUSE_MASK): Add
5421 PRAGMA_OMP_CLAUSE_ORDER.
5422 * c-typeck.c (c_finish_omp_clauses): Handle OMP_CLAUSE_ORDER.
5423
8389386c
RB
54242019-07-10 Richard Biener <rguenther@suse.de>
5425
5426 * gimple-parser.c (c_parser_gimple_postfix_expression): Support
5427 _Literal (int *) &x for address literals.
5428
99b1c316
MS
54292019-07-09 Martin Sebor <msebor@redhat.com>
5430
5431 PR c++/61339
5432 * c-decl.c (xref_tag): Change class-key of PODs to struct and others
5433 to class.
5434 (field_decl_cmp): Same.
5435 * c-parser.c (c_parser_struct_or_union_specifier): Same.
5436 * c-tree.h: Same.
5437 * gimple-parser.c (c_parser_gimple_compound_statement): Same.
5438
6c1dae73
MS
54392019-07-09 Martin Sebor <msebor@redhat.com>
5440
5441 PR c++/61339
5442 * c-decl.c: Change class-key from class to struct and vice versa
5443 to match convention and avoid -Wclass-is-pod and -Wstruct-no-pod.
5444 * gimple-parser.c: Same.
5445
69b5279e
RB
54462019-07-01 Richard Biener <rguenther@suse.de>
5447
5448 * gimple-parser.c (c_parser_gimple_postfix_expression): Handle
5449 _Literal (char *) &"foo" for address literals pointing to
5450 STRING_CSTs.
5451
ab20d992
JJ
54522019-06-25 Jozef Lawrynowicz <jozef.l@mittosystems.com>
5453
5454 * c-parser.c (c_parse_init): Create keyword for "__intN__" type.
5455 * c-decl.c (declspecs_add_type): Don't pedwarn about "__intN" ISO
5456 C incompatibility if alternate "__intN__" form is used.
5457
1e3d475e
MS
54582019-06-24 Martin Sebor <msebor@redhat.com>
5459
5460 * c-typeck.c (build_binary_op): Hyphenate floating-point.
5461
bf38f7e9
JJ
54622019-06-10 Jakub Jelinek <jakub@redhat.com>
5463
5464 * c-parser.c (c_parser_pragma): Reject PRAGMA_OMP_SCAN.
5465 (c_parser_omp_clause_reduction): Don't sorry_at on inscan reductions.
5466 (c_parser_omp_scan_loop_body): New function.
5467 (c_parser_omp_for_loop): Call c_parser_omp_scan_loop_body if there are
5468 inscan reduction clauses.
5469 * c-typeck.c (c_finish_omp_clauses): Reject mixing inscan with
5470 non-inscan reductions on the same construct, or inscan reductions with
5471 ordered or schedule clauses, or inscan array reductions.
5472
65985d78
MS
54732019-06-05 Martin Sebor <msebor@redhat.com>
5474
5475 PR c/90737
5476 * c-typeck.c (c_finish_return): Only consider functions returning
5477 pointers as candidates for -Wreturn-local-addr.
5478
0ecf545c
MS
54792019-06-05 Martin Sebor <msebor@redhat.com>
5480
5481 * c-decl.c (start_decl): Adjust quoting and hyphenation
5482 in diagnostics.
5483 (finish_decl): Same.
5484 (finish_enum): Same.
5485 (start_function): Same.
5486 (declspecs_add_type): Same.
5487 * c-parser.c (warn_for_abs): Same.
5488 * c-typeck.c (build_binary_op): Same.
5489
e03436e7
TS
54902019-05-17 Thomas Schwinge <thomas@codesourcery.com>
5491
b48f44bf
TS
5492 PR c/89433
5493 * c-parser.c (c_finish_oacc_routine): Rework checking if already
5494 marked with an OpenACC 'routine' directive.
5495
5bf04509
TS
5496 PR c/89433
5497 * c-parser.c (c_parser_oacc_routine): Normalize order of clauses.
5498 (c_finish_oacc_routine): Call oacc_verify_routine_clauses.
5499
e03436e7
TS
5500 PR c/89433
5501 * c-parser.c (c_finish_oacc_routine): Refer to OpenACC 'routine'
5502 clauses from "omp declare target" attribute.
5503
a9c697b8
MS
55042019-05-16 Martin Sebor <msebor@redhat.com>
5505
ab20d992
JJ
5506 * c-decl.c (start_decl): Quote keywords, operators, and
5507 types in diagnostics.
5508 (finish_decl): Same.
5509 * c-parser.c (c_parser_asm_statement): Same.
5510 (c_parser_conditional_expression): Same.
5511 (c_parser_transaction_cancel): Same.
5512 * c-typeck.c (c_common_type): Same.
5513 (build_conditional_expr): Same.
5514 (digest_init): Same.
5515 (process_init_element): Same.
5516 (build_binary_op): Same.
a9c697b8 5517
c4499192
RB
55182019-05-17 Richard Biener <rguenther@suse.de>
5519
5520 * gimple-parser.c (c_parser_gimple_statement): Handle __VEC_PERM.
5521 (c_parser_gimple_unary_expression): Likewise.
5522 (c_parser_gimple_parentized_ternary_expression): New function.
5523
adfe6e4b
RB
55242019-05-16 Richard Biener <rguenther@suse.de>
5525
5526 * gimple-parser.c (c_parser_gimple_statement): Handle __BIT_INSERT.
5527 (c_parser_gimple_unary_expression): Likewise.
5528
186dabf2
RB
55292019-05-15 Richard Biener <rguenther@suse.de>
5530
5531 * gimple-parser.c (c_parser_gimple_postfix_expression): Handle
5532 __BIT_FIELD_REF.
5533
1158c5b4
RB
55342019-05-14 Richard Biener <rguenther@suse.de>
5535
5536 * gimple-parser.c (c_parser_gimple_statement): Remove
5537 questionable auto-promotion to VIEW_CONVERT_EXPR.
5538 (c_parser_gimple_typespec): Split out from __MEM parsing.
5539 (c_parser_gimple_postfix_expression): Handle __VIEW_CONVERT.
5540 * tree-pretty-print.c (dump_generic_node): Dump VIEW_CONVERT_EXPR
5541 as __VIEW_CONVERT with -gimple.
5542
fd4485aa
ML
55432019-05-09 Martin Liska <mliska@suse.cz>
5544
5545 * gimple-parser.c (c_parser_gimple_statement): Support __MIN and
5546 __MAX.
5547 (c_parser_gimple_unary_expression): Parse also binary expression
5548 __MIN and __MAX.
5549 (c_parser_gimple_parentized_binary_expression): New function.
5550
d276406a
ML
55512019-05-09 Martin Liska <mliska@suse.cz>
5552
5553 * gimple-parser.c (struct gimple_parser): Add probability.
5554 for gimple_parser_edge.
5555 (gimple_parser::push_edge): Add new argument probability.
5556 (c_parser_gimple_parse_bb_spec): Parse also probability
5557 if present.
5558 (c_parser_parse_gimple_body): Set edge probability.
5559 (c_parser_gimple_compound_statement): Consume token
5560 before calling c_parser_gimple_goto_stmt.
5561 Parse BB counts.
5562 (c_parser_gimple_statement): Pass new argument.
5563 (c_parser_gimple_goto_stmt): Likewise.
5564 (c_parser_gimple_if_stmt): Likewise.
5565 (c_parser_gimple_or_rtl_pass_list): Parse hot_bb_threshold.
5566 * c-parser.c (c_parser_declaration_or_fndef): Pass
5567 hot_bb_threshold argument.
5568 * c-tree.h (struct c_declspecs): Add hot_bb_threshold
5569 field.
5570 (c_parser_gimple_parse_bb_spec_edge_probability): New.
5571
f179b64e
JJ
55722019-04-26 Jakub Jelinek <jakub@redhat.com>
5573
5574 PR debug/90197
5575 * c-tree.h (c_finish_loop): Add 2 further location_t arguments.
5576 * c-parser.c (c_parser_while_statement): Adjust c_finish_loop caller.
5577 (c_parser_do_statement): Likewise.
5578 (c_parser_for_statement): Likewise. Formatting fixes.
5579 * c-typeck.c (c_finish_loop): Add COND_LOCUS and INCR_LOCUS arguments,
5580 emit DEBUG_BEGIN_STMTs if needed.
5581
e7178413
JJ
55822019-04-19 Jakub Jelinek <jakub@redhat.com>
5583
c280b7ee
JJ
5584 PR c/89888
5585 * c-typeck.c (struct c_switch): Remove outside_range_p member.
5586 (c_start_case): Don't clear it.
5587 (do_case): Adjust c_add_case_label caller.
5588 (c_finish_case): Adjust c_do_switch_warnings caller.
5589
e7178413
JJ
5590 PR c++/90108
5591 * c-decl.c (merge_decls): If remove is main variant and
5592 DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE
5593 variant that has newdecl as TYPE_NAME if any.
5594
60a2c645
JJ
55952019-04-12 Jakub Jelinek <jakub@redhat.com>
5596
5597 PR c/89933
5598 * c-decl.c (merge_decls): When newdecl's type is its main variant,
5599 don't try to remove it from the variant list, but instead assert
5600 it has no variants.
5601
2a82beaa
RB
56022019-04-01 Richard Biener <rguenther@suse.de>
5603
5604 PR c/71598
5605 * c-tree.h (c_get_alias_set): Declare.
5606 * c-objc-common.h (LANG_HOOKS_GET_ALIAS_SET): Use c_get_alias_set.
5607 * c-objc-common.c (c_get_alias_set): Treat enumeral types
5608 as the underlying integer type.
5609
bec1da64
MS
56102019-03-19 Martin Sebor <msebor@redhat.com>
5611
5612 PR tree-optimization/89688
5613 * c-decl.c (finish_decl): Call braced_lists_to_string for more
5614 kinds of initializers.
5615
855cd9b1
JJ
56162019-03-19 Jakub Jelinek <jakub@redhat.com>
5617
5618 PR c/89734
5619 * c-decl.c (grokdeclarator): Call c_build_qualified_type on function
5620 return type even if quals_used is 0. Formatting fixes.
5621
baa09dc5
RB
56222019-03-14 Richard Biener <rguenther@suse.de>
5623
5624 * c-tree.h (enum c_declspec_il): New.
5625 (struct c_declspecs): Merge gimple_p and rtl_p into declspec_il
5626 enum bitfield.
5627 * c-parser.c (c_parser_declaration_or_fndef): Adjust accordingly.
5628 Pass start pass and declspec_il to c_parser_parse_gimple_body.
5629 (c_parser_declspecs): Adjust.
5630 * gimple-parser.c: Include cfg.h, cfghooks.h, cfganal.h, tree-cfg.h,
5631 gimple-iterator.h, cfgloop.h, tree-phinodes.h, tree-into-ssa.h
5632 and bitmap.h.
5633 (struct gimple_parser): New.
5634 (gimple_parser::push_edge): New method.
5635 (c_parser_gimple_parse_bb_spec): New helper.
5636 (c_parser_parse_gimple_body): Get start pass and IL specification.
5637 Initialize SSA and CFG.
5638 (c_parser_gimple_compound_statement): Handle CFG and SSA build.
5639 Build a gimple_parser parsing state and pass it along.
5640 (c_parser_gimple_statement): Change intermittend __PHI internal
5641 function argument for the edge.
5642 (c_parser_gimple_or_rtl_pass_list): Handle ssa, cfg flags.
5643 (c_parser_gimple_goto_stmt): Record edges to build.
5644 (c_parser_gimple_if_stmt): Likewise.
5645 * gimple-parser.h (c_parser_parse_gimple_body): Adjust.
5646 (c_parser_gimple_or_rtl_pass_list): Likewise.
5647
a3f9f006
ML
56482019-03-11 Martin Liska <mliska@suse.cz>
5649
5650 * c-decl.c (check_for_loop_decls): Wrap an option name
5651 in a string format message and fix GNU coding style.
5652 * c-parser.c (c_parser_declspecs): Likewise.
5653
1db01ff9
JJ
56542019-03-08 Jakub Jelinek <jakub@redhat.com>
5655
5656 PR tree-optimization/89550
5657 * c-decl.c (finish_function): Only set TREE_NO_WARNING if warning_at
5658 returned true.
5659 (c_write_global_declarations_1): Only set TREE_NO_WARNING if pedwarn
5660 or warning returned true.
5661
66dcb747
JJ
56622019-02-28 Jakub Jelinek <jakub@redhat.com>
5663
5664 PR c/89525
5665 * c-typeck.c (convert_arguments): Call inform_declaration only if
5666 the previous warning_at call returned true.
5667
2263c9f2
TS
56682019-02-22 Thomas Schwinge <thomas@codesourcery.com>
5669
5670 * c-parser.c (c_parser_oacc_shape_clause): Add loc formal
5671 parameter. Adjust all users.
5672 (c_parser_oacc_simple_clause): Replace parser with loc formal
5673 parameter. Adjust all users.
5674
ab20d992 56752019-02-19 Chung-Lin Tang <cltang@codesourcery.com>
19695f4d
CLT
5676
5677 PR c/87924
5678 * c-parser.c (c_parser_oacc_clause_wait): Add representation of wait
5679 clause without argument as 'wait (GOMP_ASYNC_NOVAL)', adjust comments.
5680
5f88ba10
JJ
56812019-02-15 Jakub Jelinek <jakub@redhat.com>
5682
5683 PR c/89340
5684 * c-decl.c (start_function): Clear TREE_PUBLIC on nested functions
5685 before c_decl_attributes rather than after it.
5686
cfc30fd1
JJ
56872019-02-06 Jakub Jelinek <jakub@redhat.com>
5688
5689 PR c/89211
5690 * c-parser.c (c_parser_declaration_or_fndef): Don't update
5691 DECL_ARGUMENTS of d if it has been defined already. Use a single if
5692 instead of 3 nested ifs.
5693
fbe83e6b
JM
56942019-02-06 Joseph Myers <joseph@codesourcery.com>
5695
5696 PR c/88584
5697 * c-decl.c (finish_decl): Do not complete array types for arrays
5698 with external linkage not at file scope.
5699
f461f938
RB
57002019-02-05 Richard Biener <rguenther@suse.de>
5701
5702 PR c/88606
5703 * c-decl.c (finish_struct): Reset TYPE_TRANSPARENT_AGGR on
5704 all type variants when not supported.
5705
fe509359
JJ
57062019-01-30 Jakub Jelinek <jakub@redhat.com>
5707
5708 PR c/89061
5709 * c-tree.h (C_DECL_COMPOUND_LITERAL_P): Define.
5710 * c-decl.c (decl_jump_unsafe): Return false for
5711 C_DECL_COMPOUND_LITERAL_P decls.
5712 (build_compound_literal): Set C_DECL_COMPOUND_LITERAL_P.
5713
6a335b96
JJ
57142019-01-29 Jakub Jelinek <jakub@redhat.com>
5715
f4b7e754
JJ
5716 PR c/89045
5717 * c-decl.c (build_compound_literal): Don't pushdecl if in parameter
5718 scope.
5719
6a335b96
JJ
5720 PR c/86125
5721 * c-decl.c (last_fileptr_type): Remove.
5722 (last_structptr_types): New variable.
5723 (match_builtin_function_types): Compare TYPE_MAIN_VARIANT of
5724 {old,new}rettype instead of the types themselves. Assert
5725 last_structptr_types array has the same number of elements
5726 as builtin_structptr_types array. Use TYPE_MAIN_VARIANT for
5727 argument oldtype and newtype. Instead of handling
5728 just fileptr_type_node specially, handle all builtin_structptr_types
5729 pointer nodes. Formatting fix.
5730
d8b5a1a0
MS
57312019-01-24 Martin Sebor <msebor@redhat.com>
5732
5733 PR c/86125
5734 PR c/88886
5735 PR middle-end/86308
5736 * c-decl.c (match_builtin_function_types): Add arguments.
5737 (diagnose_mismatched_decls): Diagnose mismatched declarations
5738 of built-ins more strictly.
5739
e21c4491
JJ
57402019-01-24 Jakub Jelinek <jakub@redhat.com>
5741
5742 PR c++/88976
5743 * c-typeck.c (c_finish_omp_cancel): Diagnose more than one if
5744 on #pragma omp cancel with different modifiers.
5745
420183d9
L
57462019-01-18 H.J. Lu <hongjiu.lu@intel.com>
5747
5748 PR c/51628
5749 PR c/88664
5750 * c-typeck.c (convert_for_assignment): Upate the
5751 warn_for_address_or_pointer_of_packed_member call.
5752
17ad43dd
TH
57532019-01-16 Tom Honermann <tom@honermann.net>
5754 Jason Merrill <jason@redhat.com>
5755
5756 * c-typeck.c (digest_init): Revised the error message produced for
5757 ill-formed cases of array initialization with a string literal.
5758 (error_init): Make variadic.
5759
5f07d78a
JJ
57602019-01-12 Jakub Jelinek <jakub@redhat.com>
5761
5762 * c-typeck.c (convert_for_assignment): Fix a comment typo.
5763
c4581bbf
JJ
57642019-01-07 Jakub Jelinek <jakub@redhat.com>
5765
5766 PR c/88701
5767 * c-decl.c (build_compound_literal): If not TREE_STATIC, only pushdecl
5768 if current_function_decl is non-NULL.
5769
65c5b1eb
JM
57702019-01-07 Joseph Myers <joseph@codesourcery.com>
5771
5772 PR c/88720
5773 PR c/88726
5774 * c-decl.c (pop_scope): Use TREE_PUBLIC and b->nested to determine
5775 whether a function is nested, not DECL_EXTERNAL. Diagnose inline
5776 functions declared but never defined only for external scope, not
5777 for other scopes.
5778
d8fcab68
JJ
57792019-01-07 Jakub Jelinek <jakub@redhat.com>
5780
5781 PR c++/85052
5782 * c-parser.c (c_parser_postfix_expression): Parse
5783 __builtin_convertvector.
5784
a5544970
JJ
57852019-01-01 Jakub Jelinek <jakub@redhat.com>
5786
5787 Update copyright years.
5788
da77eace
L
57892018-12-20 H.J. Lu <hongjiu.lu@intel.com>
5790
5791 PR c/51628
5792 * c-typeck.c (convert_for_assignment): Call
5793 warn_for_address_or_pointer_of_packed_member.
5794
1edf8866
SB
57952018-12-19 Segher Boessenkool <segher@kernel.crashing.org>
5796
5797 * c-parser.c (c_parser_asm_statement) <RID_CONST, RID_RESTRICT>: Give
5798 a more specific error message (instead of just falling through).
5799
db4fd626
SB
58002018-12-19 Segher Boessenkool <segher@kernel.crashing.org>
5801
5802 * c-parser.c (c_parser_asm_statement): Keep track of the location each
5803 asm qualifier is first seen; use that to give nicer "duplicate asm
5804 qualifier" messages. Delete 'quals" variable, instead pass the
5805 "is_volatile_ flag to build_asm_stmt directly.
5806 * c-tree.h (build_asm_stmt): Make the first arg bool instead of tree.
5807 * c-typeck.c (build_asm_stmt): Ditto; adjust.
5808
9c9cfcbb
SB
58092018-12-19 Segher Boessenkool <segher@kernel.crashing.org>
5810
5811 * c-parser.c (c_parser_asm_statement): Rewrite the loop to work without
5812 "done" boolean variable.
5813
a14feb3c
DM
58142018-12-19 David Malcolm <dmalcolm@redhat.com>
5815
5816 PR c++/87504
5817 * c-typeck.c (class maybe_range_label_for_tree_type_mismatch):
5818 Move from here to gcc-rich-location.h and gcc-rich-location.c.
5819 (build_binary_op): Use struct op_location_t and
5820 class binary_op_rich_location.
5821
6d939173
JJ
58222018-12-11 Jakub Jelinek <jakub@redhat.com>
5823
5824 PR sanitizer/88426
5825 * c-convert.c (convert): Call c_fully_fold before calling
5826 ubsan_instrument_float_cast.
5827
b7055028
SB
58282018-12-08 Segher Boessenkool <segher@kernel.crashing.org>
5829
5830 * c-parser (c_parser_asm_statement) [RID_INLINE]: Delete stray line
5831 setting "quals".
5832
5b76e75f
SB
58332018-12-06 Segher Boessenkool <segher@kernel.crashing.org>
5834
5835 * c-parser.c (c_parser_asm_statement): Detect the inline keyword
5836 after asm. Pass a flag for it to build_asm_expr.
5837 * c-tree.h (build_asm_expr): Update declaration.
5838 * c-typeck.c (build_asm_stmt): Add is_inline parameter. Use it to
5839 set ASM_INLINE_P.
5840
30bd42b9
SB
58412018-12-06 Segher Boessenkool <segher@kernel.crashing.org>
5842
5843 PR inline-asm/55681
5844 * c-parser.c (c_parser_asm_statement): Update grammar. Allow any
5845 combination of volatile and goto, in any order, without repetitions.
5846
9df6c0e4
JB
58472018-12-04 James Norris <jnorris@codesourcery.com>
5848 Cesar Philippidis <cesar@codesourcery.com>
5849 Julian Brown <julian@codesourcery.com>
5850
5851 * c-parser.c (c_parser_oacc_wait_list): Remove dead diagnostic
5852 code.
5853
f44697b7
RB
58542018-11-30 Richard Biener <rguenther@suse.de>
5855
5856 * gimple-parser.c (c_parser_gimple_postfix_expression): Parse
5857 _Literal (type) { ... } as empty aggregate or vector constructor.
5858
550dfbdc
MS
58592018-11-29 Martin Sebor <msebor@redhat.com>
5860
5861 PR c/88091
5862 * c-typeck.c (convert_argument): Add a parameter. Adjust indentation.
5863 (convert_arguments): Add comments. Pass additional argument to
5864 the function above.
5865
673670da
MS
58662018-11-29 Martin Sebor <msebor@redhat.com>
5867
5868 PR c/88172
5869 PR testsuite/88208
5870 * c-decl.c (declspec_add_alignas): Adjust call to check_user_alignment.
5871
db1d09b0
MS
58722018-11-23 Martin Sebor <msebor@redhat.com>
5873
5874 PR testsuite/88098
5875 * c-typeck.c (convert_arguments): Call builtin_decl_explicit instead.
5876 (maybe_warn_builtin_no_proto_arg): Handle short enum to int promotion.
5877
98f08eb8
MS
58782018-11-20 Martin Sebor <msebor@redhat.com>
5879
5880 * c-parser.c (c_parser_has_attribute_expression): New function.
5881 (c_parser_attribute): New function.
5882 (c_parser_attributes): Move code into c_parser_attribute.
5883 (c_parser_unary_expression): Handle RID_HAS_ATTRIBUTE_EXPRESSION.
5884
cd5da983
MS
58852018-11-15 Martin Sebor <msebor@redhat.com>
5886
5887 PR c/83656
5888 * c-decl.c (header_for_builtin_fn): Declare.
5889 (diagnose_mismatched_decls): Diagnose declarations of built-in
5890 functions without a prototype.
5891 * c-typeck.c (maybe_warn_builtin_no_proto_arg): New function.
5892 (convert_argument): Same.
5893 (convert_arguments): Factor code out into convert_argument.
5894 Detect mismatches between built-in formal arguments in calls
5895 to built-in without prototype.
5896 (build_conditional_expr): Same.
5897 (type_or_builtin_type): New function.
5898 (convert_for_assignment): Add argument. Conditionally issue
5899 warnings instead of errors for mismatches.
5900
620e594b
DM
59012018-11-13 David Malcolm <dmalcolm@redhat.com>
5902
5903 * c-decl.c: Replace "source_location" with "location_t".
5904 * c-tree.h: Likewise.
5905 * c-typeck.c: Likewise.
5906 * gimple-parser.c: Likewise.
5907
3179ebae
JJ
59082018-11-09 Jakub Jelinek <jakub@redhat.com>
5909
81a227c6
JJ
5910 * c-parser.c (c_parser_omp_clause_final): Use
5911 c_parser_expr_no_commas, convert_lvalue_to_rvalue,
5912 c_objc_common_truthvalue_conversion, c_fully_fold and parentheses
5913 parsing instead of c_parser_paren_condition.
5914 (c_parser_omp_clause_if): Use c_parser_expr_no_commas,
5915 convert_lvalue_to_rvalue, c_objc_common_truthvalue_conversion and
5916 c_fully_fold instead of c_parser_condition.
5917 (c_parser_omp_clause_num_threads, c_parser_omp_clause_num_tasks,
5918 c_parser_omp_clause_grainsize, c_parser_omp_clause_priority,
5919 c_parser_omp_clause_hint, c_parser_omp_clause_num_teams,
5920 c_parser_omp_clause_thread_limit, c_parser_omp_clause_linear): Use
5921 c_parser_expr_no_commas instead of c_parser_expression.
5922
98c91c56
JJ
5923 * c-parser.c (c_parser_omp_clause_reduction): Call sorry_at on
5924 reduction clause with inscan modifier.
5925
3179ebae
JJ
5926 * c-parser.c (c_parser_omp_requires): Call sorry_at on requires
5927 clauses other than atomic_default_mem_order.
5928
28567c40
JJ
59292018-11-08 Jakub Jelinek <jakub@redhat.com>
5930
5931 * c-parser.c: Include memmode.h.
5932 (c_parser_omp_depobj, c_parser_omp_requires): New functions.
5933 (c_parser_pragma): Handle PRAGMA_OMP_DEPOBJ and PRAGMA_OMP_REQUIRES.
5934 (c_parser_omp_clause_name): Handle nontemporal, in_reduction and
5935 task_reduction clauses.
5936 (c_parser_omp_variable_list): Handle OMP_CLAUSE_{IN,TASK}_REDUCTION.
5937 For OMP_CLAUSE_DEPEND, parse clause operands as either an array
5938 section, or lvalue assignment expression.
5939 (c_parser_omp_clause_if): Handle cancel and simd modifiers.
5940 (c_parser_omp_clause_lastprivate): Parse optional
5941 conditional: modifier.
5942 (c_parser_omp_clause_hint): Require constant integer expression rather
5943 than just integer expression.
5944 (c_parser_omp_clause_defaultmap): Parse new kinds of defaultmap
5945 clause.
5946 (c_parser_omp_clause_reduction): Add IS_OMP and KIND arguments.
5947 Parse reduction modifiers. Pass KIND to c_parser_omp_variable_list.
5948 (c_parser_omp_clause_nontemporal, c_parser_omp_iterators): New
5949 functions.
5950 (c_parser_omp_clause_depend): Parse iterator modifier and handle
5951 iterators. Parse mutexinoutset and depobj kinds.
5952 (c_parser_oacc_all_clauses): Adjust c_parser_omp_clause_reduction
5953 callers.
5954 (c_parser_omp_all_clauses): Likewise. Handle
5955 PRAGMA_OMP_CLAUSE_NONTEMPORAL and
5956 PRAGMA_OMP_CLAUSE_{IN,TASK}_REDUCTION.
5957 (c_parser_omp_atomic): Parse hint and memory order clauses. Handle
5958 default memory order from requires directive if any. Adjust
5959 c_finish_omp_atomic caller.
5960 (c_parser_omp_critical): Allow comma in between (name) and hint clause.
5961 (c_parser_omp_flush): Parse flush with memory-order-clause.
5962 (c_parser_omp_for_loop): Allow NE_EXPR even in
5963 OpenMP loops, adjust c_finish_omp_for caller.
5964 (OMP_SIMD_CLAUSE_MASK): Add if and nontemporal clauses.
5965 (c_parser_omp_master): Add p_name, mask and cclauses arguments.
5966 Allow to be called while parsing combined parallel master.
5967 Parse combined master taskloop{, simd}.
5968 (c_parser_omp_parallel): Parse combined
5969 parallel master{, taskloop{, simd}} constructs.
5970 (OMP_TASK_CLAUSE_MASK): Add in_reduction clause.
5971 (OMP_TASKGROUP_CLAUSE_MASK): Define.
5972 (c_parser_omp_taskgroup): Add LOC argument. Parse taskgroup clauses.
5973 (OMP_TASKWAIT_CLAUSE_MASK): Define.
5974 (c_parser_omp_taskwait): Handle taskwait with depend clauses.
5975 (c_parser_omp_teams): Force a BIND_EXPR with BLOCK
5976 around teams body. Use SET_EXPR_LOCATION.
5977 (c_parser_omp_target_data): Allow target data
5978 with only use_device_ptr clauses.
5979 (c_parser_omp_target): Use SET_EXPR_LOCATION. Set
5980 OMP_REQUIRES_TARGET_USED bit in omp_requires_mask.
5981 (c_parser_omp_requires): New function.
5982 (c_finish_taskloop_clauses): New function.
5983 (OMP_TASKLOOP_CLAUSE_MASK): Add reduction and in_reduction clauses.
5984 (c_parser_omp_taskloop): Use c_finish_taskloop_clauses. Add forward
5985 declaration. Disallow in_reduction clause when combined with parallel
5986 master.
5987 (c_parser_omp_construct): Adjust c_parser_omp_master and
5988 c_parser_omp_taskgroup callers.
5989 * c-typeck.c (c_finish_omp_cancel): Diagnose if clause with modifier
5990 other than cancel.
5991 (handle_omp_array_sections_1): Handle OMP_CLAUSE_{IN,TASK}_REDUCTION
5992 like OMP_CLAUSE_REDUCTION.
5993 (handle_omp_array_sections): Likewise. Call save_expr on array
5994 reductions before calling build_index_type. Handle depend clauses
5995 with iterators.
5996 (struct c_find_omp_var_s): New type.
5997 (c_find_omp_var_r, c_omp_finish_iterators): New functions.
5998 (c_finish_omp_clauses): Don't diagnose nonmonotonic clause
5999 with static, runtime or auto schedule kinds. Call save_expr for whole
6000 array reduction sizes. Diagnose reductions with zero sized elements
6001 or variable length structures. Diagnose nogroup clause used with
6002 reduction clause(s). Handle depend clause with
6003 OMP_CLAUSE_DEPEND_DEPOBJ. Diagnose bit-fields. Require
6004 omp_depend_t type for OMP_CLAUSE_DEPEND_DEPOBJ kinds and
6005 some different type for other kinds. Use build_unary_op with
6006 ADDR_EXPR and build_indirect_ref instead of c_mark_addressable.
6007 Handle depend clauses with iterators. Remove no longer needed special
6008 case that predetermined const qualified vars may be specified in
6009 firstprivate clause. Complain if const qualified vars are mentioned
6010 in data-sharing clauses other than firstprivate or shared. Use
6011 error_at with OMP_CLAUSE_LOCATION (c) as first argument instead of
6012 error. Formatting fix. Handle OMP_CLAUSE_NONTEMPORAL and
6013 OMP_CLAUSE_{IN,TASK}_REDUCTION. Allow any lvalue as
6014 OMP_CLAUSE_DEPEND operand (besides array section), adjust diagnostics.
6015
7e2de6df
DM
60162018-10-29 David Malcolm <dmalcolm@redhat.com>
6017
6018 * c-decl.c (implicit_decl_warning): Update "is there a suggestion"
6019 logic for change to name_hint::operator bool.
6020 (undeclared_variable): Likewise.
6021 * c-parser.c (c_parser_declaration_or_fndef): Likewise.
6022 (c_parser_parameter_declaration): Likewise.
6023
9f936c86
JM
60242018-10-17 Joseph Myers <joseph@codesourcery.com>
6025
6026 * c-errors.c (pedwarn_c11): New function.
6027 * c-parser.c (disable_extension_diagnostics): Save
6028 warn_c11_c2x_compat and set it to 0.
6029 (restore_extension_diagnostics): Restore warn_c11_c2x_compat.
6030 (c_parser_static_assert_declaration_no_semi): Handle
6031 _Static_assert without string constant.
6032 * c-tree.h (pedwarn_c11): New prototype.
6033
033eb567
DM
60342018-10-17 David Malcolm <dmalcolm@redhat.com>
6035
6036 * Make-lang.in (selftest-c): New.
6037 (C_SELFTEST_FLAGS, C_SELFTEST_DEPS, s-selftest-c, selftest-c-gdb)
6038 (selftest-gdb, selftest-c-valgrind, selftest-valgrind): Move here
6039 from gcc/Makefile.in.
6040
0edf3afe
RB
60412018-10-02 Richard Biener <rguenther@suse.de>
6042
6043 * c-decl.c (warn_if_shadowing): Do not test DECL_FROM_INLINE.
6044
8313a764
JM
60452018-09-26 Joseph Myers <joseph@codesourcery.com>
6046
6047 PR c/87390
6048 * c-typeck.c (build_binary_op): Use excess precision for
6049 comparisons of integers and floating-point for C11 and later.
6050
ce6f0888
MJ
60512018-09-26 Martin Jambor <mjambor@suse.cz>
6052
6053 PR c/87347
6054 * c-parser.c (warn_for_abs): Bail out if TYPE_ARG_TYPES is NULL. Fix
ab20d992 6055 comment.
ce6f0888 6056
9c4a4b3c
DM
60572018-09-17 David Malcolm <dmalcolm@redhat.com>
6058
6059 * c-objc-common.c (range_label_for_type_mismatch::get_text):
6060 Update for new param.
6061 * c-typeck.c (maybe_range_label_for_tree_type_mismatch::get_text):
6062 Likewise.
6063
80c6d1f4
MJ
60642018-09-17 Martin Jambor <mjambor@suse.cz>
6065
6066 PR c/63886
6067 * c-parser.c: (warn_for_abs): New function.
6068 (c_parser_postfix_expression_after_primary): Call it.
6069
4a426e36
BE
60702018-09-13 Bernd Edlinger <bernd.edlinger@hotmail.de>
6071
6072 * c-typeck.c (digest_init): Shorten overlength strings.
6073
6d900107
BE
60742018-09-06 Bernd Edlinger <bernd.edlinger@hotmail.de>
6075
6076 * c-decl.c (finish_decl): Call complete_flexible_array_elts.
6077
b5764229
BE
60782018-09-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
6079
6080 * c-decl.c (finish_decl): Call braced_list_to_string here ...
6081 * c-parser.c (c_parser_declaration_or_fndef): ... instead of here.
6082
22eea6b2
AM
60832018-08-30 Alexander Monakov <amonakov@ispras.ru>
6084
6085 * gimple-parser.c (c_parser_gimple_binary_expression): Accept infix
6086 "__MULT_HIGHPART" for MULT_HIGHPART_EXPR.
6087
85204e23
DM
60882018-08-27 David Malcolm <dmalcolm@redhat.com>
6089
6090 PR 87091
6091 * c-decl.c (implicitly_declare): Update call to
6092 maybe_add_include_fixit to suggest overriding the location, as it
6093 is for a note.
6094 * c-objc-common.c (c_tree_printer): Update for conversion of
6095 show_caret_p to a tri-state.
6096
3d78e008
ML
60972018-08-27 Martin Liska <mliska@suse.cz>
6098
6099 * c-decl.c (locate_old_decl): Use new function
92a285c1
ML
6100 fndecl_built_in_p and remove check for FUNCTION_DECL if
6101 possible.
3d78e008
ML
6102 (diagnose_mismatched_decls): Likewise.
6103 (merge_decls): Likewise.
6104 (warn_if_shadowing): Likewise.
6105 (pushdecl): Likewise.
6106 (implicitly_declare): Likewise.
6107 * c-parser.c (c_parser_postfix_expression_after_primary): Likewise.
6108 * c-tree.h (C_DECL_ISNT_PROTOTYPE): Likewise.
6109 * c-typeck.c (build_function_call_vec): Likewise.
6110 (convert_arguments): Likewise.
6111
097f82ec
DM
61122018-08-20 David Malcolm <dmalcolm@redhat.com>
6113
6114 PR other/84889
6115 * c-decl.c (pushtag): Add auto_diagnostic_group instance.
6116 (diagnose_mismatched_decls): Likewise, in various places.
6117 (warn_if_shadowing): Likewise.
6118 (implicit_decl_warning): Likewise.
6119 (implicitly_declare): Likewise.
6120 (undeclared_variable): Likewise.
6121 (declare_label): Likewise.
6122 (grokdeclarator): Likewise.
6123 (start_function): Likewise.
6124 * c-parser.c (c_parser_declaration_or_fndef): Likewise.
6125 (c_parser_parameter_declaration): Likewise.
6126 (c_parser_binary_expression): Likewise.
6127 * c-typeck.c (c_expr_sizeof_expr): Likewise.
6128 (parser_build_binary_op): Likewise.
6129 (build_unary_op): Likewise.
6130 (error_init): Likewise.
6131 (pedwarn_init): Likewise.
6132 (warning_init): Likewise.
6133 (convert_for_assignment): Likewise.
6134
96e6ae57
DM
61352018-08-15 David Malcolm <dmalcolm@redhat.com>
6136
6137 * c-objc-common.c: Include "gcc-rich-location.h".
6138 (c_tree_printer): Move implemenation of '%T' to...
6139 (print_type): ...this new function.
6140 (range_label_for_type_mismatch::get_text): New function.
6141 * c-typeck.c (convert_for_assignment): Add type labels to the rhs
6142 range for the various ic_argpass cases.
6143 (class maybe_range_label_for_tree_type_mismatch): New class.
6144 (build_binary_op): Use it when calling binary_op_error.
6145
0cd020ae 61462018-08-15 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
ab20d992 6147
0cd020ae
PK
6148 * c-decl.c (start_decl): Do not warn if variables is named as main
6149 and is a local variable.
6150
72733314
IS
61512018-08-15 Iain Sandoe <iain@sandoe.co.uk>
6152
6153 PR c/19315
6154 * c-decl.c (finish_decl): Don't add the 'extern' storage class to
6155 objects of unknown size.
6156
23aa9f7c
MS
61572018-08-13 Martin Sebor <msebor@redhat.com>
6158
6159 PR tree-optimization/71625
6160 * c-parser.c (c_parser_declaration_or_fndef): Call
6161 braced_list_to_string.
6162
e5e7e50d
BH
61632018-08-03 Bogdan Harjoc <harjoc@gmail.com>
6164
6165 PR c/86690
6166 * c-typeck.c (lookup_field): Do not use TYPE_LANG_SPECIFIC after
6167 errors.
6168
8a45b051
MS
61692018-08-01 Martin Sebor <msebor@redhat.com>
6170
6171 PR tree-optimization/86650
6172 * c-objc-common.c (c_tree_printer): Move usage of EXPR_LOCATION (t)
6173 and TREE_BLOCK (t) from within percent_K_format to this callsite.
6174
5922dcb5
JJ
61752018-08-01 Jakub Jelinek <jakub@redhat.com>
6176
6177 PR c/85704
6178 * c-typeck.c (init_field_decl_cmp): New function.
6179 (output_pending_init_elements): Use it for field comparisons
6180 instead of pure bit_position comparisons.
6181
9b452033
JJ
61822018-07-12 Jakub Jelinek <jakub@redhat.com>
6183
6184 * c-decl.c (c_decl_attributes): Don't diagnose vars without mappable
6185 type here, instead add "omp declare target implicit" attribute.
6186 (finish_decl): Diagnose vars without mappable type here.
6187
ab20d992
JJ
61882018-06-20 Chung-Lin Tang <cltang@codesourcery.com>
6189 Thomas Schwinge <thomas@codesourcery.com>
829c6349
CLT
6190 Cesar Philippidis <cesar@codesourcery.com>
6191
6192 * c-parser.c (c_parser_omp_clause_name): Add support for finalize
6193 and if_present. Make present_or_{copy,copyin,copyout,create} aliases
6194 to their non-present_or_* counterparts. Make 'self' an alias to
6195 PRAGMA_OACC_CLAUSE_HOST.
6196 (c_parser_oacc_data_clause): Update GOMP mappings for
6197 PRAGMA_OACC_CLAUSE_{COPY,COPYIN,COPYOUT,CREATE,DELETE}. Remove
6198 PRAGMA_OACC_CLAUSE_{SELF,PRESENT_OR_*}.
6199 (c_parser_oacc_all_clauses): Handle finalize and if_present clauses.
6200 Remove support for present_or_* clauses.
6201 (OACC_KERNELS_CLAUSE_MASK): Remove PRESENT_OR_* clauses.
6202 (OACC_PARALLEL_CLAUSE_MASK): Likewise.
6203 (OACC_DECLARE_CLAUSE_MASK): Likewise.
6204 (OACC_DATA_CLAUSE_MASK): Likewise.
6205 (OACC_ENTER_DATA_CLAUSE_MASK): Remove PRESENT_OR_* clauses.
6206 (OACC_EXIT_DATA_CLAUSE_MASK): Add FINALIZE clause.
6207 (OACC_UPDATE_CLAUSE_MASK): Remove SELF, add IF_PRESENT.
6208 (c_parser_oacc_declare): Remove PRESENT_OR_* clauses.
6209 * c-typeck.c (c_finish_omp_clauses): Handle IF_PRESENT and FINALIZE.
6210
e197e64e
KV
62112018-06-16 Kugan Vivekanandarajah <kuganv@linaro.org>
6212
6213 * c-typeck.c (build_unary_op): Handle ABSU_EXPR;
6214 * gimple-parser.c (c_parser_gimple_statement): Likewise.
6215 (c_parser_gimple_unary_expression): Likewise.
6216
487f2f61
JJ
62172018-06-15 Jakub Jelinek <jakub@redhat.com>
6218
6219 PR c/86093
6220 * c-typeck.c (pointer_diff): Cast both pointers to unqualified types
6221 before doing POINTER_DIFF_EXPR.
6222
e4d44a37
MP
62232018-06-07 Marek Polacek <polacek@redhat.com>
6224
6225 PR c/85318
6226 * c-decl.c (check_for_loop_decls): Add -Wc90-c99-compat warning about
6227 for loop initial declarations.
6228
b67b9225
DP
62292018-05-30 David Pagan <dave.pagan@oracle.com>
6230
6231 PR c/55976
6232 * c-decl.c (grokdeclarator): Update check for return type warnings.
6233 (start_function): Likewise.
6234 (finish_function): Likewise.
6235 * c-typeck.c (c_finish_return): Update check for return type warnings.
6236 Pass OPT_Wreturn_type to pedwarn when appropriate.
6237
c566cc9f
RS
62382018-05-18 Richard Sandiford <richard.sandiford@linaro.org>
6239
6240 * gimple-parser.c (c_parser_gimple_postfix_expression): Remove
6241 __FMA_EXPR handlng.
6242
e4f81565
RS
62432018-05-17 Richard Sandiford <richard.sandiford@linaro.org>
6244
6245 * gimple-parser.c: Include internal-fn.h.
6246 (c_parser_gimple_statement): Treat a leading CPP_DOT as a call.
6247 (c_parser_gimple_call_internal): New function.
6248 (c_parser_gimple_postfix_expression): Use it to handle CPP_DOT.
6249 Fix typos in comment.
6250
79e7b1fe
JJ
62512018-05-10 Jakub Jelinek <jakub@redhat.com>
6252
6253 PR c++/85662
6254 * c-fold.c (c_fully_fold_internal): Use fold_offsetof rather than
6255 fold_offsetof_1, pass TREE_TYPE (expr) as TYPE to it and drop the
6256 fold_convert_loc.
6257 * c-typeck.c (build_unary_op): Use fold_offsetof rather than
6258 fold_offsetof_1, pass argtype as TYPE to it and drop the
6259 fold_convert_loc.
6260
f7584c81
DP
62612018-05-02 David Pagan <dave.pagan@oracle.com>
6262
6263 PR c/30552
6264 * c-decl.c (old_style_parameter_scope): New function.
6265 * c-parser.c (c_parser_postfix_expression): Check for statement
6266 expressions in old-style function parameter list declarations.
6267 * c-parser.h (old_style_parameter_scope): New extern declaration.
6268
b33a0cb3
JJ
62692018-04-25 Jakub Jelinek <jakub@redhat.com>
6270
6271 PR sanitizer/84307
6272 * c-decl.c (build_compound_literal): Call pushdecl (decl) even when
6273 it is not TREE_STATIC.
6274 * c-typeck.c (c_mark_addressable) <case COMPOUND_LITERAL_EXPR>: Mark
6275 not just the COMPOUND_LITERAL_EXPR node itself addressable, but also
6276 its COMPOUND_LITERAL_EXPR_DECL.
6277
c5c5822a
JM
62782018-03-21 Joseph Myers <joseph@codesourcery.com>
6279
6280 * c-parser.c (c_parser_postfix_expression): For __builtin_tgmath
6281 where all functions return the same _FloatN or _FloatNx type,
6282 treat integer types as _Float64 instead of double.
6283
aa1c9429
JJ
62842018-03-21 Jakub Jelinek <jakub@redhat.com>
6285
6286 PR c/84999
6287 * c-typeck.c (build_binary_op): If c_common_type_for_size fails when
6288 building vector comparison, diagnose it and return error_mark_node.
6289
9bb45a95
JJ
62902018-03-15 Jakub Jelinek <jakub@redhat.com>
6291
6292 PR c/84853
6293 * c-typeck.c (build_binary_op) <case RSHIFT_EXPR, case LSHIFT_EXPR>:
6294 If code1 is INTEGER_TYPE, only allow code0 VECTOR_TYPE if it has
6295 INTEGER_TYPE element type.
6296
ada6bad9
DP
62972018-03-13 David Pagan <dave.pagan@oracle.com>
6298
6299 PR c/46921
6300 * c-typeck.c (output_init_element): Ensure field initializer
6301 expression is always evaluated if there are side effects.
6302
849bbdb9
JJ
63032018-03-06 Jakub Jelinek <jakub@redhat.com>
6304
6305 PR c/84721
6306 * c-parser.c (add_debug_begin_stmt): Don't add DEBUG_BEGIN_STMT if
6307 !building_stmt_list_p ().
6308
d74641bd
RS
63092018-02-13 Richard Sandiford <richard.sandiford@linaro.org>
6310
6311 PR c/84305
6312 * c-decl.c (grokdeclarator): Create an anonymous TYPE_DECL
6313 in PARM and TYPENAME contexts too, but attach it to a BIND_EXPR
6314 and include the BIND_EXPR in the list of things that need to be
6315 pre-evaluated.
6316
0444aa9c
NS
63172018-02-09 Nathan Sidwell <nathan@acm.org>
6318
6319 PR c/84293
6320 * c-typeck.c (build_indirect_ref, build_c_cast): Pass expr location
6321 to strict_aliasing_warning.
6322
7c30b12a
PC
63232018-02-02 Paolo Carlini <paolo.carlini@oracle.com>
6324
6325 * c-typeck.c (really_start_incremental_init, push_init_level,
6326 set_nonincremental_init, output_init_element, process_init_element):
6327 Use DECL_UNNAMED_BIT_FIELD.
6328
2be4dfcb
MP
63292018-01-31 Marek Polacek <polacek@redhat.com>
6330
6331 PR c/81779
6332 * c-parser.c (c_parser_compound_statement_nostart): Call
6333 expansion_point_location_if_in_system_header.
6334
bb9869d5
DM
63352018-01-17 David Malcolm <dmalcolm@redhat.com>
6336
6337 PR c++/83814
6338 * c-fold.c (fold_for_warn): Move from c-common.c, reducing to just
6339 the C part.
6340
b4923738
JJ
63412018-01-13 Jakub Jelinek <jakub@redhat.com>
6342
6343 PR c/83801
6344 * c-tree.h (decl_constant_value_1): Add a bool argument.
6345 * c-typeck.c (decl_constant_value_1): Add IN_INIT argument, allow
6346 returning a CONSTRUCTOR if it is true. Use error_operand_p.
6347 (decl_constant_value): Adjust caller.
6348 * c-fold.c (c_fully_fold_internal): If in_init, pass true to
6349 decl_constant_value_1 as IN_INIT. Otherwise, punt if
6350 decl_constant_value returns initializer that has BLKmode or
6351 array type.
6352 (c_fully_fold_internal) <case COMPONENT_REF>: Fold if !lval.
6353
928686b1
RS
63542018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
6355 Alan Hayward <alan.hayward@arm.com>
6356 David Sherwood <david.sherwood@arm.com>
6357
6358 * c-typeck.c (comptypes_internal, build_binary_op): Handle polynomial
6359 TYPE_VECTOR_SUBPARTS.
6360
85ec4feb
JJ
63612018-01-03 Jakub Jelinek <jakub@redhat.com>
6362
6363 Update copyright years.
6364
913884f7
JJ
63652018-01-01 Jakub Jelinek <jakub@redhat.com>
6366
6367 PR c/83595
6368 * c-parser.c (c_parser_braced_init, c_parser_initelt,
6369 c_parser_conditional_expression, c_parser_cast_expression,
6370 c_parser_sizeof_expression, c_parser_alignof_expression,
6371 c_parser_postfix_expression, c_parser_omp_declare_reduction,
6372 c_parser_transaction_expression): Use set_error () method instead
6373 of setting value member to error_mark_node.
6374
c6cfa2bf
MM
63752017-12-28 Michael Meissner <meissner@linux.vnet.ibm.com>
6376
6377 * c-decl.c (header_for_builtin_fn): Add integer rounding _Float<N>
6378 and _Float<N>X built-in functions.
6379
11d29d63
JJ
63802017-12-22 Jakub Jelinek <jakub@redhat.com>
6381
14ec014e
JJ
6382 PR debug/83550
6383 * c-decl.c (finish_struct): Set DECL_SOURCE_LOCATION on
6384 TYPE_STUB_DECL and call rest_of_type_compilation before processing
6385 incomplete vars rather than after it.
6386
11d29d63
JJ
6387 PR debug/83547
6388 * c-typeck.c (c_finish_stmt_expr): Ignore !TREE_SIDE_EFFECTS as
6389 indicator of ({ }), instead skip all trailing DEBUG_BEGIN_STMTs first,
6390 and consider empty ones if there are no other stmts. For
6391 -Wunused-value walk all statements before the one only followed by
6392 DEBUG_BEGIN_STMTs.
6393
170a8bd6 63942017-12-22 Mike Stump <mikestump@comcast.net>
92a285c1 6395 Eric Botcazou <ebotcazou@adacore.com>
170a8bd6
EB
6396
6397 * c-parser.c (c_parser_while_statement): Add unroll parameter and
6398 build ANNOTATE_EXPR if present. Add 3rd operand to ANNOTATE_EXPR.
6399 (c_parser_do_statement): Likewise.
6400 (c_parser_for_statement): Likewise.
6401 (c_parser_statement_after_labels): Adjust calls to above.
6402 (c_parse_pragma_ivdep): New static function.
6403 (c_parser_pragma_unroll): Likewise.
6404 (c_parser_pragma) <PRAGMA_IVDEP>: Add support for pragma Unroll.
6405 <PRAGMA_UNROLL>: New case.
6406
01512446
JJ
64072017-12-19 Jakub Jelinek <jakub@redhat.com>
6408
6409 * c-typeck.c (comptypes_internal, function_types_compatible_p,
6410 perform_integral_promotions, digest_init): Replace Yoda conditions
6411 with typical order conditions.
6412 * c-decl.c (check_bitfield_type_and_width): Likewise.
6413
c65e18d3
BE
64142017-12-14 Bernd Edlinger <bernd.edlinger@hotmail.de>
6415
6416 * c-typeck.c (c_safe_arg_type_equiv_p,
6417 c_safe_function_type_cast_p): New function.
6418 (build_c_cast): Implement -Wcast-function-type.
6419
b7280579
RB
64202017-12-14 Richard Biener <rguenther@suse.de>
6421
6422 PR c/83415
6423 * c-fold.c (c_fully_fold_internal): Treat VIEW_CONVERT_EXPR
6424 like REALPART_EXPR for the behavior of whether its operand
6425 is an lvalue.
6426
49e6a6c0
MP
64272017-12-12 Marek Polacek <polacek@redhat.com>
6428
6429 PR c/82679
6430 * c-decl.c (grokdeclarator): Check declspecs insted of atomicp.
6431
ab20d992 64322017-12-12 Alexandre Oliva <aoliva@redhat.com>
96a95ac1
AO
6433
6434 * c-objc-common.h (LANG_HOOKS_EMITS_BEGIN_STMT): Redefine as true.
6435 * c-parser.c (add_debug_begin_stmt): New.
6436 (c_parser_declaration_or_fndef): Call it.
6437 (c_parser_compound_statement_nostart): Likewise.
6438 (c_parser_statement_after_labels): Likewise.
6439 * c-typeck (c_finish_stmt_expr): Skip begin stmts markers.
6440
4b2b493f
JM
64412017-12-07 Joseph Myers <joseph@codesourcery.com>
6442
6443 * c-decl.c (build_compound_literal): Add parameter alignas_align
6444 and set alignment of decl if nonzero.
6445 * c-parser.c (c_keyword_starts_typename): Allow RID_ALIGNAS.
6446 (c_parser_declspecs): Allow RID_ALIGNAS to follow a type, like a
6447 qualifier.
6448 (c_parser_struct_declaration): Update syntax comment.
6449 (c_parser_type_name): Add alignas_ok argument and pass it to
6450 c_parser_declspecs.
6451 (c_parser_cast_expression): Pass true to c_parser_type_name and
6452 give error if a cast used an _Alignas specifier.
6453 (c_parser_sizeof_expression): Pass true to c_parser_type_name and
6454 give error if sizeof (type-name) used an _Alignas specifier.
6455 (c_parser_alignof_expression): Pass true to c_parser_type_name and
6456 give error if _Alignof (type-name) used an _Alignas specifier.
6457 (c_parser_postfix_expression_after_paren_type): Check specified
6458 alignment for a compound literal and pass it to
6459 build_compound_literal.
6460 * c-parser.h (c_parser_type_name): Update prototype.
6461 * c-tree.h (build_compound_literal): Update prototype.
6462
5d9ae53d
MS
64632017-12-07 Martin Sebor <msebor@redhat.com>
6464
6465 PR c/81544
6466 * c-decl.c (c_decl_attributes): Look up existing declaration and
6467 pass it to decl_attributes.
6468
c79144f8
DM
64692017-12-06 David Malcolm <dmalcolm@redhat.com>
6470
6471 PR c/83236
6472 * c-decl.c (lookup_name_fuzzy): Don't suggest names that are
6473 reserved for use by the implementation.
6474
613bc14f
DM
64752017-12-06 David Malcolm <dmalcolm@redhat.com>
6476
6477 * c-decl.c: Include "c-family/c-spellcheck.h".
6478
05abad4c
ML
64792017-12-05 Martin Liska <mliska@suse.cz>
6480 Jakub Jelinek <jakub@redhat.com>
6481
6482 * c-typeck.c (pointer_diff): Add new argument and instrument
6483 pointer subtraction.
6484 (build_binary_op): Similar for pointer comparison.
6485
cc6534d4
JJ
64862017-12-01 Jakub Jelinek <jakub@redhat.com>
6487
65791f42
JJ
6488 PR c/79153
6489 * c-parser.c: Include tree-iterator.h.
6490 (c_parser_switch_statement): Emit LABEL_EXPR for the break label
6491 into SWITCH_BODY instead of after it and set SWITCH_BREAK_LABEL_P
6492 on it.
6493
cc6534d4
JJ
6494 PR c/83222
6495 * c-tree.h (decl_constant_value_1): Declare.
6496 * c-typeck.c (decl_constant_value_1): New function.
6497 (decl_constant_value): Use it.
6498 * c-fold.c (c_fully_fold_internal): If in_init, use
6499 decl_constant_value_1 instead of decl_constant_value.
6500
5de73c05
JJ
65012017-11-30 Jakub Jelinek <jakub@redhat.com>
6502
6503 * c-parser.c (c_parser_postfix_expression): Use ; instead of ;;.
6504
058f0b9e
JJ
65052017-11-28 Jakub Jelinek <jakub@redhat.com>
6506
6507 PR sanitizer/81275
6508 * c-typeck.c (c_finish_case): Set SWITCH_ALL_CASES_P if
6509 c_switch_covers_all_cases_p returns true.
6510
5e9d6aa4 65112017-11-28 Julia Koval <julia.koval@intel.com>
92a285c1 6512 Sebastian Peryt <sebastian.peryt@intel.com>
5e9d6aa4
JK
6513
6514 * Make-lang.in (c/c-array-notation.o): Remove.
6515 * c-array-notation.c: Delete.
6516 * c-decl.c: Remove cilkplus condition.
6517 * c-parser.c (c_parser_cilk_simd, c_parser_cilk_for,
6518 c_parser_cilk_verify_simd, c_parser_array_notation,
6519 c_parser_cilk_clause_vectorlength, c_parser_cilk_grainsize,
6520 c_parser_cilk_simd_fn_vector_attrs,
6521 c_finish_cilk_simd_fn_tokens): Delete.
6522 (c_parser_declaration_or_fndef): Remove cilkplus condition.
6523 (c_parser_direct_declarator_inner): Ditto.
6524 (CILK_SIMD_FN_CLAUSE_MASK): Delete.
6525 (c_parser_attributes, c_parser_compound_statement,
6526 c_parser_statement_after_labels, c_parser_if_statement,
6527 c_parser_switch_statement, c_parser_while_statement,
6528 c_parser_do_statement, c_parser_for_statement,
6529 c_parser_unary_expression, c_parser_postfix_expression,
6530 c_parser_postfix_expression_after_primary,
6531 c_parser_pragma, c_parser_omp_clause_name, c_parser_omp_all_clauses,
6532 c_parser_omp_for_loop, c_finish_omp_declare_simd): Remove cilkplus
6533 support.
6534 * c-typeck.c (build_array_ref, build_function_call_vec,
6535 convert_arguments,
6536 lvalue_p, build_compound_expr, c_finish_return, c_finish_if_stmt,
6537 c_finish_loop, build_binary_op): Remove cilkplus support.
6538
9e851845
JJ
65392017-11-28 Jakub Jelinek <jakub@redhat.com>
6540
6541 * c-typeck.c (c_start_case): Build SWITCH_EXPR using build2 instead
6542 of build3.
6543
ab20d992 65442017-11-14 Boris Kolpackov <boris@codesynthesis.com>
8c7dbea9
BK
6545
6546 * Make-lang.in (c.install-plugin): Install backend import library.
6547
41521dee
JJ
65482017-11-23 Jakub Jelinek <jakub@redhat.com>
6549
6550 * c-parser.c (c_parser_omp_declare_simd): Reject declare simd in
6551 pragma_stmt context.
6552
ac9effed
EB
65532017-11-23 Mike Stump <mikestump@comcast.net>
6554 Eric Botcazou <ebotcazou@adacore.com>
6555
6556 * c-parser.c (c_parser_while_statement): Pass 3rd operand to
6557 ANNOTATE_EXPR.
6558 (c_parser_do_statement): Likewise.
6559 (c_parser_for_statement): Likewise.
6560
ce95abc4
DM
65612017-11-22 David Malcolm <dmalcolm@redhat.com>
6562
6563 PR c++/62170
6564 * c-objc-common.c (c_tree_printer): Convert penultimate param from
6565 bool to bool *. Within '%T' handling, if showing an "aka", use
6566 "quoted" param to add appropriate quoting.
6567
974aedcc
MP
65682017-11-22 Marek Polacek <polacek@redhat.com>
6569
6570 PR c++/60336
6571 PR middle-end/67239
6572 PR target/68355
6573 * c-decl.c (grokdeclarator): Set DECL_PADDING_P on unnamed bit-fields.
6574
d4300cc6
DM
65752017-11-21 David Malcolm <dmalcolm@redhat.com>
6576
6577 PR c/83056
6578 * c-decl.c (lookup_name_fuzzy): Don't suggest names that came from
6579 earlier failed lookups.
6580
1af4ebf5
MG
65812017-11-21 Marc Glisse <marc.glisse@inria.fr>
6582
6583 * c-fold.c (c_fully_fold_internal): Handle POINTER_DIFF_EXPR.
6584 * c-typeck.c (pointer_diff): Use POINTER_DIFF_EXPR.
6585
26edace6
DM
65862017-11-20 David Malcolm <dmalcolm@redhat.com>
6587
6588 PR c/81404
6589 * c-decl.c: Include "c-family/known-headers.h".
6590 (get_c_name_hint): Rename to get_stdlib_header_for_name and move
6591 to known-headers.cc.
6592 (class suggest_missing_header): Move to known-header.h.
6593 (lookup_name_fuzzy): Call get_c_stdlib_header_for_name rather
6594 than get_c_name_hint.
6595
b1212255
DM
65962017-11-20 David Malcolm <dmalcolm@redhat.com>
6597
6598 * c-decl.c (get_c_name_hint): New function.
6599 (class suggest_missing_header): New class.
6600 (lookup_name_fuzzy): Call get_c_name_hint and use it to
6601 suggest missing headers to the user.
6602
6c7a259b
DM
66032017-11-20 David Malcolm <dmalcolm@redhat.com>
6604
6605 * c-decl.c: Define INCLUDE_UNIQUE_PTR before including system.h.
6606 Include "c-family/name-hint.h"
6607 (implicit_decl_warning): Convert "hint" from
6608 const char * to name_hint. Pass location to
6609 lookup_name_fuzzy. Suppress any deferred diagnostic if the
6610 warning was not printed.
6611 (undeclared_variable): Likewise for "guessed_id".
6612 (lookup_name_fuzzy): Convert return type from const char *
6613 to name_hint. Add location_t param.
6614 * c-parser.c: Define INCLUDE_UNIQUE_PTR before including system.h.
6615 Include "c-family/name-hint.h"
6616 (c_parser_declaration_or_fndef): Convert "hint" from
6617 const char * to name_hint. Pass location to lookup_name_fuzzy.
6618 (c_parser_parameter_declaration): Likewise.
6619
f9c59f7e
JJ
66202017-11-19 Jakub Jelinek <jakub@redhat.com>
6621
6622 PR c/66618
6623 PR c/69960
6624 * c-parser.c (c_parser_omp_atomic): Pass true as LVAL to c_fully_fold
6625 where needed.
6626 * c-typeck.c (build_unary_op, build_modify_expr, build_asm_expr,
6627 handle_omp_array_sections): Likewise.
6628 (digest_init): Don't call decl_constant_value_for_optimization.
6629 * c-tree.h (decl_constant_value_for_optimization): Removed.
6630 * c-fold.c (c_fold_array_ref): New function.
6631 (c_fully_fold_internal): Add LVAL argument, propagate it through
6632 recursive calls. For VAR_P call decl_constant_value and
6633 unshare if not LVAL and either optimizing or IN_INIT. Remove
6634 decl_constant_value_for_optimization calls. If IN_INIT and not LVAL,
6635 fold ARRAY_REF with STRING_CST and INTEGER_CST operands.
6636 (c_fully_fold): Add LVAL argument, pass it through to
6637 c_fully_fold_internal.
6638 (decl_constant_value_for_optimization): Removed.
6639
3ca0dc60
JM
66402017-11-15 Joseph Myers <joseph@codesourcery.com>
6641
6642 PR c/81156
6643 * c-parser.c (check_tgmath_function): New function.
6644 (enum tgmath_parm_kind): New enum.
6645 (c_parser_postfix_expression): Handle __builtin_tgmath.
6646
64a5912c
DM
66472017-10-31 David Malcolm <dmalcolm@redhat.com>
6648
6649 * c-decl.c (implicit_decl_warning): Update for renaming of
6650 pedwarn_at_rich_loc and warning_at_rich_loc.
6651 (implicitly_declare): Likewise for renaming of inform_at_rich_loc.
6652 (undeclared_variable): Likewise for renaming of error_at_rich_loc.
6653 * c-parser.c (c_parser_declaration_or_fndef): Likewise.
6654 (c_parser_struct_or_union_specifier): Likewise for renaming of
6655 pedwarn_at_rich_loc.
6656 (c_parser_parameter_declaration): Likewise for renaming of
6657 error_at_rich_loc.
6658 * c-typeck.c (build_component_ref): Likewise.
6659 (build_unary_op): Likewise for renaming of inform_at_rich_loc.
6660 (pop_init_level): Likewise for renaming of warning_at_rich_loc.
6661 (set_init_label): Likewise for renaming of error_at_rich_loc.
6662
c1136864
RB
66632017-10-30 Richard Biener <rguenther@suse.de>
6664
6665 * gimple-parser.c (c_parser_gimple_statement): Parse conditional
6666 stmts.
6667
ee5fd23a
MM
66682017-10-27 Michael Meissner <meissner@linux.vnet.ibm.com>
6669
6670 * c-decl.c (header_for_builtin_fn): Add support for copysign, fma,
6671 fmax, fmin, and sqrt _Float<N> and _Float<N>X variants.
6672
1a59ccf2
DM
66732017-10-25 David Malcolm <dmalcolm@redhat.com>
6674
6675 PR c/7356
6676 * c-parser.c (c_parser_declaration_or_fndef): Detect missing
6677 semicolons.
6678
bc1a75dd
JJ
66792017-10-25 Jakub Jelinek <jakub@redhat.com>
6680
6681 PR libstdc++/81706
6682 * c-decl.c (merge_decls): Copy "omp declare simd" attributes from
6683 newdecl to corresponding __builtin_ if any.
6684
ff1ff960
PC
66852017-10-24 Paolo Carlini <paolo.carlini@oracle.com>
6686
6687 PR c++/82466
6688 * c-decl.c (diagnose_mismatched_decls): Use
6689 OPT_Wbuiltin_declaration_mismatch.
6690
62e1c678
DM
66912017-10-12 David Malcolm <dmalcolm@redhat.com>
6692
6693 * c-parser.c (c_parser_require): Add "type_is_unique" param and
6694 use it to guard calls to maybe_suggest_missing_token_insertion.
6695 (c_parser_parms_list_declarator): Override default value of new
6696 "type_is_unique" param to c_parser_require.
6697 (c_parser_asm_statement): Likewise.
6698 * c-parser.h (c_parser_require): Add "type_is_unique" param,
6699 defaulting to true.
6700
a92f6726
NS
67012017-10-11 Nathan Sidwell <nathan@acm.org>
6702
6703 * c-decl.c (grokdeclarator): Check HAS_DECL_ASSEMBLER_NAME_P too.
6704
8e6cdc90
RS
67052017-10-10 Richard Sandiford <richard.sandiford@linaro.org>
6706
6707 * c-parser.c (c_parser_cilk_clause_vectorlength): Use wi::to_wide when
6708 operating on trees as wide_ints.
6709 * c-typeck.c (build_c_cast, c_finish_omp_clauses): Likewise.
6710 (c_tree_equal): Likewise.
6711
8139a48e
DM
67122017-10-04 David Malcolm <dmalcolm@redhat.com>
6713
6714 * c-decl.c (push_parm_decl): Store c_parm's location into the
6715 PARAM_DECL.
6716 (build_c_parm): Add "loc" param and store it within the c_parm.
6717 * c-parser.c (struct c_parser): Add "last_token_location" field.
6718 (c_parser_consume_token): Store location of the token into the
6719 new field.
6720 (c_parser_declaration_or_fndef): Store params into DECL_ARGUMENTS
6721 when handling a FUNCTION_DECL, if it doesn't already have them.
6722 (c_parser_parameter_declaration): Generate a location for the
6723 parameter, and pass it to the call to build_c_parm.
6724 * c-tree.h (struct c_parm): Add field "loc".
6725 (build_c_parm): Add location_t param.
6726 * c-typeck.c (get_fndecl_argument_location): New function.
6727 (inform_for_arg): New function.
6728 (convert_for_assignment): Use inform_for_arg when dealing with
6729 ic_argpass.
6730
2a389958
JJ
67312017-09-29 Jakub Jelinek <jakub@redhat.com>
6732
7d386d45
JJ
6733 * c-decl.c (grokfield): Use SET_DECL_C_BIT_FIELD here if
6734 width is non-NULL.
6735 (finish_struct): Test DECL_C_BIT_FIELD instead of DECL_INITIAL,
6736 don't SET_DECL_C_BIT_FIELD here.
6737
2a389958
JJ
6738 PR c/82340
6739 * c-decl.c (build_compound_literal): Use c_apply_type_quals_to_decl
6740 instead of trying to set just TREE_READONLY manually.
6741
ebc6a85e
TV
67422017-09-16 Tom de Vries <tom@codesourcery.com>
6743
6744 PR c/81875
6745 * c-parser.c (c_parser_omp_for_loop): Fold only operands of cond, not
6746 cond itself.
6747
bb75facd
JM
67482017-09-15 Joseph Myers <joseph@codesourcery.com>
6749
6750 PR c/82071
6751 * c-typeck.c (ep_convert_and_check): Just call convert_and_check
6752 for C11.
6753 (build_conditional_expr): For C11, generate result with excess
6754 precision when one argument is an integer and the other is of a
6755 type using excess precision.
6756
1d933576
BE
67572017-09-15 Bernd Edlinger <bernd.edlinger@hotmail.de>
6758
6759 * c-typeck.c (build_c_cast): Implement -Wcast-align=strict.
6760
267bbb6f
MP
67612017-09-13 Marek Polacek <polacek@redhat.com>
6762
6763 PR c/82167
6764 * c-typeck.c (c_expr_sizeof_expr): Use the type of expr.value rather
6765 than expr.original_type.
6766
6836632e
NS
67672017-09-12 Nathan Sidwell <nathan@acm.org>
6768
6769 * c-decl.c (field_decl_cmp, resort_data, resort_field_decl_cmp,
6770 resort_sorted_fields): Moved from c-family/c-common.c.
6771 * c-lang.h (struct sorted_fields_type): Moved from c-family/c-common.h.
6772
e035be33
JM
67732017-09-01 Joseph Myers <joseph@codesourcery.com>
6774
6775 PR c/82071
6776 * c-typeck.c (build_atomic_assign): Handle argument with excess
6777 precision. Ensure any EXCESS_PRECISION_EXPR is present in
6778 argument passed to build_binary_op and convert_for_assignment but
6779 not for call to c_fully_fold.
6780 (build_modify_expr): Do not remove EXCESS_PRECISION_EXPR early.
6781 Ensure build_binary_op is called with argument with original
6782 semantic type. Avoid calling c_fully_fold with an
6783 EXCESS_PRECISION_EXPR from build_binary_op.
6784
d2e05fcb
JJ
67852017-09-01 Jakub Jelinek <jakub@redhat.com>
6786
6787 PR c/81887
6788 * c-parser.c (c_parser_omp_ordered): Handle -fopenmp-simd.
6789
b397965c
RS
67902017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
6791 Alan Hayward <alan.hayward@arm.com>
6792 David Sherwood <david.sherwood@arm.com>
6793
6794 * c-typeck.c (build_binary_op): Use SCALAR_TYPE_MODE.
6795 (c_common_type): Likewise. Use as_a <scalar_mode> when setting
6796 m1 and m2 to the signed equivalent of a fixed-point
6797 SCALAR_TYPE_MODE.
6798
14e18d71
DM
67992017-08-24 David Malcolm <dmalcolm@redhat.com>
6800
6801 * c-tree.h (c_expr::get_location) Use EXPR_HAS_LOCATION rather
6802 than CAN_HAVE_LOCATION_P when determining whether to use the
6803 location_t value within "value".
6804
7f204c0f
DM
68052017-08-21 David Malcolm <dmalcolm@redhat.com>
6806
6807 * c-parser.c (c_parser_expr_list): Use c_expr::get_location ()
6808 rather than peeking the location of the first token.
6809 * c-tree.h (c_expr::get_location): New method.
6810
2f687306
DM
68112017-08-21 David Malcolm <dmalcolm@redhat.com>
6812
6813 * c-typeck.c (build_function_call_vec): Pass arg_loc to call
6814 to check_function_arguments.
6815
3e7b80d7
MP
68162017-08-18 Marek Polacek <polacek@redhat.com>
6817
6818 * c-parser.c (c_parser_postfix_expression): Remove unused code. Update
6819 commentary.
6820
00aa1fa2
L
68212017-08-18 H.J. Lu <hongjiu.lu@intel.com>
6822
6823 PR c/53037
6824 * c-decl.c (merge_decls): Also merge DECL_WARN_IF_NOT_ALIGN.
6825 (check_bitfield_type_and_width): Don't allow bit-field with
6826 warn_if_not_aligned type.
6827
da67acb9
MS
68282017-08-14 Martin Sebor <msebor@redhat.com>
6829
6830 PR c/81117
6831 * c-objc-common.c (c_objc_common_init): Handle 'G'.
6832
bb85aa74
MP
68332017-08-11 Marek Polacek <polacek@redhat.com>
6834
6835 PR c/81795
6836 * c-decl.c (pushtag): Only print inform if the warning was printed.
6837 (grokdeclarator): Likewise.
6838
32129a17
DM
68392017-08-10 David Malcolm <dmalcolm@redhat.com>
6840
6841 * c-parser.c (c_parser_error): Rename to...
6842 (c_parser_error_richloc): ...this, making static, and adding
6843 "richloc" parameter, passing it to the c_parse_error call,
6844 rather than calling c_parser_set_source_position_from_token.
6845 (c_parser_error): Reintroduce, reimplementing in terms of the
6846 above, converting return type from void to bool.
6847 (class token_pair): New class.
6848 (struct matching_paren_traits): New struct.
6849 (matching_parens): New typedef.
6850 (struct matching_brace_traits): New struct.
6851 (matching_braces): New typedef.
6852 (get_matching_symbol): New function.
6853 (c_parser_require): Add param MATCHING_LOCATION, using it to
6854 highlight matching "opening" tokens for missing "closing" tokens.
6855 (c_parser_skip_until_found): Likewise.
6856 (c_parser_static_assert_declaration_no_semi): Convert explicit
6857 parsing of CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of
6858 class matching_parens, so that the pertinent open parenthesis is
6859 highlighted when there are problems locating the close
6860 parenthesis.
6861 (c_parser_struct_or_union_specifier): Likewise.
6862 (c_parser_typeof_specifier): Likewise.
6863 (c_parser_alignas_specifier): Likewise.
6864 (c_parser_simple_asm_expr): Likewise.
6865 (c_parser_braced_init): Likewise, for matching_braces.
6866 (c_parser_paren_condition): Likewise, for matching_parens.
6867 (c_parser_switch_statement): Likewise.
6868 (c_parser_for_statement): Likewise.
6869 (c_parser_asm_statement): Likewise.
6870 (c_parser_asm_operands): Likewise.
6871 (c_parser_cast_expression): Likewise.
6872 (c_parser_sizeof_expression): Likewise.
6873 (c_parser_alignof_expression): Likewise.
6874 (c_parser_generic_selection): Likewise.
6875 (c_parser_postfix_expression): Likewise for cases RID_VA_ARG,
6876 RID_OFFSETOF, RID_TYPES_COMPATIBLE_P, RID_AT_SELECTOR,
6877 RID_AT_PROTOCOL, RID_AT_ENCODE, reindenting as necessary.
6878 In case CPP_OPEN_PAREN, pass loc_open_paren to the
6879 c_parser_skip_until_found call.
6880 (c_parser_objc_class_definition): Use class matching_parens as
6881 above.
6882 (c_parser_objc_method_decl): Likewise.
6883 (c_parser_objc_try_catch_finally_statement): Likewise.
6884 (c_parser_objc_synchronized_statement): Likewise.
6885 (c_parser_objc_at_property_declaration): Likewise.
6886 (c_parser_oacc_wait_list): Likewise.
6887 (c_parser_omp_var_list_parens): Likewise.
6888 (c_parser_omp_clause_collapse): Likewise.
6889 (c_parser_omp_clause_default): Likewise.
6890 (c_parser_omp_clause_if): Likewise.
6891 (c_parser_omp_clause_num_threads): Likewise.
6892 (c_parser_omp_clause_num_tasks): Likewise.
6893 (c_parser_omp_clause_grainsize): Likewise.
6894 (c_parser_omp_clause_priority): Likewise.
6895 (c_parser_omp_clause_hint): Likewise.
6896 (c_parser_omp_clause_defaultmap): Likewise.
6897 (c_parser_oacc_single_int_clause): Likewise.
6898 (c_parser_omp_clause_ordered): Likewise.
6899 (c_parser_omp_clause_reduction): Likewise.
6900 (c_parser_omp_clause_schedule): Likewise.
6901 (c_parser_omp_clause_num_teams): Likewise.
6902 (c_parser_omp_clause_thread_limit): Likewise.
6903 (c_parser_omp_clause_aligned): Likewise.
6904 (c_parser_omp_clause_linear): Likewise.
6905 (c_parser_omp_clause_safelen): Likewise.
6906 (c_parser_omp_clause_simdlen): Likewise.
6907 (c_parser_omp_clause_depend): Likewise.
6908 (c_parser_omp_clause_map): Likewise.
6909 (c_parser_omp_clause_device): Likewise.
6910 (c_parser_omp_clause_dist_schedule): Likewise.
6911 (c_parser_omp_clause_proc_bind): Likewise.
6912 (c_parser_omp_clause_uniform): Likewise.
6913 (c_parser_omp_for_loop): Likewise.
6914 (c_parser_cilk_clause_vectorlength): Likewise.
6915 (c_parser_cilk_clause_linear): Likewise.
6916 (c_parser_transaction_expression): Likewise.
6917 * c-parser.h (c_parser_require): Add param matching_location with
6918 default UNKNOWN_LOCATION.
6919 (c_parser_error): Convert return type from void to bool.
6920 (c_parser_skip_until_found): Add param matching_location with
6921 default UNKNOWN_LOCATION.
6922
30af3a2b
MP
69232017-08-09 Marek Polacek <polacek@redhat.com>
6924
6925 * c-decl.c (build_enumerator): Use true/false instead of 1/0.
6926 * c-tree.h (build_external_ref): Update declaration.
6927 * c-typeck.c (build_array_ref): Use true/false instead of 1/0.
6928 (build_external_ref): Change the type of a parameter to bool.
6929 (parser_build_binary_op): Use true/false instead of 1/0.
6930 (pointer_diff): Likewise.
6931 (build_modify_expr): Likewise.
6932 (set_designator): Change the type of a parameter to bool.
6933 (set_init_index): Use true/false instead of 1/0.
6934 (set_init_label): Likewise.
6935 (output_init_element): Change the type of a parameter to bool.
6936 (output_pending_init_elements): Use true/false instead of 1/0.
6937 (process_init_element): Likewise.
6938 (build_binary_op): Change the type of a parameter to bool.
6939
296c53ac
MP
69402017-08-09 Marek Polacek <polacek@redhat.com>
6941
6942 PR c/81233
6943 * c-typeck.c (pedwarn_init): Make the function take a variable list.
6944 Call emit_diagnostic_valist instead of pedwarn.
6945 (convert_for_assignment): Unroll the PEDWARN_FOR_ASSIGNMENT macro.
6946 Print the relevant types in diagnostics.
6947
a32c8316
MP
69482017-08-09 Marek Polacek <polacek@redhat.com>
6949
6950 PR c/81417
6951 * c-array-notation.c (fix_builtin_array_notation_fn): Update calls to
ab20d992 6952 build_conditional_expr.
a32c8316
MP
6953 * c-parser.c (c_parser_conditional_expression): Create locations for
6954 EXP1 and EXP2 from their source ranges. Pass the locations down to
6955 build_conditional_expr.
6956 * c-tree.h (build_conditional_expr): Update declaration.
6957 * c-typeck.c (build_conditional_expr): Add location_t parameters.
6958 For -Wsign-compare, also print the types.
6959
314e6352
ML
69602017-08-08 Martin Liska <mliska@suse.cz>
6961
6962 * c-convert.c: Include header files.
6963 * c-typeck.c: Likewise.
6964
577eec56
ML
69652017-08-07 Martin Liska <mliska@suse.cz>
6966
6967 * c-parser.c (c_parser_attributes): Canonicalize name of an
6968 attribute.
6969
f7b6353a
MP
69702017-08-02 Marek Polacek <polacek@redhat.com>
6971
6972 PR c/81289
6973 * c-parser.c (c_parser_unary_expression): Use set_error.
6974
8a6eab34
MP
6975 PR c/81448
6976 PR c/81306
6977 * c-warn.c (warn_for_multistatement_macros): Prevent bogus
6978 warnings. Avoid walking MACRO_MAP_LOCATIONS.
6979
ab20d992 69802017-07-31 Jan Hubicka <hubicka@ucw.cz>
7fef86d3
JH
6981 Martin Liska <mliska@suse.cz>
6982
6983 * c-typeck.c (c_finish_goto_label): Build gimple predict
f7b6353a 6984 statement.
7fef86d3 6985
f34ebeb2
ML
69862017-07-31 Martin Liska <mliska@suse.cz>
6987
6988 PR sanitize/81530
6989 * c-convert.c (convert): Guard condition with flag_sanitize_p
6990 also with current_function_decl non-null equality.
6991 * c-decl.c (grokdeclarator): Likewise.
6992 * c-typeck.c (build_binary_op): Likewise.
6993
8595f67b
MP
69942017-07-25 Marek Polacek <polacek@redhat.com>
6995
6996 * c-decl.c (grokfield): Remove local variable.
6997
d49718d6
MP
69982017-07-25 Marek Polacek <polacek@redhat.com>
6999
7000 PR c/81364
7001 * c-parser.c (c_parser_else_body): Don't warn about multistatement
7002 macro expansion if the body is in { }.
7003 (c_parser_while_statement): Likewise.
7004 (c_parser_for_statement): Likewise.
7005
ff22eb12
NS
70062017-07-18 Nathan Sidwell <nathan@acm.org>
7007
7008 * c-parser.c (c_parser_array_notation): Use TYPE_{MIN,MAX}_VALUE.
7009
eea77d1f
DM
70102017-07-14 David Malcolm <dmalcolm@redhat.com>
7011
7012 * c-decl.c (implicitly_declare): When suggesting a missing
7013 #include, provide a fix-it hint.
7014
b6f43128
DM
70152017-07-06 David Malcolm <dmalcolm@redhat.com>
7016
7017 * c-lang.c (selftest::run_c_tests): Move body to c_family_tests,
7018 and call that instead.
7019 * c-tree.h (selftest::run_c_tests): New decl.
7020
3e2becc4
MP
70212017-06-26 Marek Polacek <polacek@redhat.com>
7022
7023 PR c/80116
7024 * c-parser.c (c_parser_if_body): Set the location of the
7025 body of the conditional after parsing all the labels. Call
7026 warn_for_multistatement_macros.
7027 (c_parser_else_body): Likewise.
7028 (c_parser_switch_statement): Likewise.
7029 (c_parser_while_statement): Likewise.
7030 (c_parser_for_statement): Likewise.
7031 (c_parser_statement): Add a default argument. Save the location
7032 after labels have been parsed.
7033 (c_parser_c99_block_statement): Likewise.
7034
343ae898
RB
70352017-06-19 Richard Biener <rguenther@suse.de>
7036
7037 * gimple-parser.c (c_parser_gimple_postfix_expression): Handle
7038 negated _Literals to parse _Literal (int) -1.
7039
45b2222a
ML
70402017-06-13 Martin Liska <mliska@suse.cz>
7041
7042 PR sanitize/78204
7043 * c-convert.c (convert): Use sanitize_flags_p.
7044 * c-decl.c (grokdeclarator): Likewise.
7045 * c-typeck.c (convert_for_assignment): Likewise.
7046 (c_finish_return): Likewise.
7047 (build_binary_op): Likewise.
7048
8ab7005b
JJ
70492017-06-08 Jakub Jelinek <jakub@redhat.com>
7050
7051 PR c/81006
7052 * c-typeck.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
7053 to sizetype before size_binop.
7054
363dc72c
JJ
70552017-06-07 Jakub Jelinek <jakub@redhat.com>
7056
7057 * gimple-parser.c (c_parser_parse_gimple_body): Use TDI_gimple instead
7058 of TDI_generic.
7059
dc949728
MP
70602017-06-06 Marek Polacek <polacek@redhat.com>
7061
7062 PR c/79983
7063 * c-decl.c (start_struct): Use the location of TYPE_STUB_DECL of
7064 ref.
7065 (start_enum): Use the location of TYPE_STUB_DECL of enumtype.
7066
40ffd95f
BE
70672017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
7068
7069 * c-parser.c (c_parser_binary_expression): Implement the
7070 -Wsizeof_pointer_div warning.
7071 (c_parser_postfix_expression): Allow SIZEOF_EXPR as expr.original_code
7072 from a parenthesized expression.
7073 (c_parser_expr_list): Use c_last_sizeof_loc.
7074 * c-tree.h (c_last_sizeof_loc): New external.
7075 * c-typeck.c (c_last_sizeof_loc): New variable.
7076 (c_expr_sizeof_expr, c_expr_sizeof_type): Assign c_last_sizeof_loc.
7077
9fc5e7a4
MM
70782017-05-31 Mikhail Maltsev <maltsevm@gmail.com>
7079
7080 PR testsuite/80580
7081 * gimple-parser.c (c_parser_gimple_if_stmt): Check for empty labels.
7082
f012c8ef
DM
70832017-05-30 David Malcolm <dmalcolm@redhat.com>
7084
7085 * c-objc-common.c (c_tree_printer): Gain bool and const char **
7086 parameters.
7087
3cd211af
MS
70882017-05-24 Martin Sebor <msebor@redhat.com>
7089
7090 PR c/80731
7091 * c-fold.c (c_fully_fold_internal): Adjust.
7092 * c-typeck.c (parser_build_unary_op): Adjust.
7093
fd71a9a2
TS
70942017-05-23 Thomas Schwinge <thomas@codesourcery.com>
7095
7096 * c-parser.c (OACC_KERNELS_CLAUSE_MASK): Add
7097 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
7098 "VECTOR_LENGTH".
7099
92fa0f9e
MP
71002017-05-23 Marek Polacek <polacek@redhat.com>
7101
7102 * c-parser.c (c_parser_compound_statement_nostart): Remove redundant
7103 quotes.
7104
d11c168a
JJ
71052017-05-22 Jakub Jelinek <jakub@redhat.com>
7106
7107 * c-fold.c (c_fully_fold_internal): Save the c_fully_fold_internal
7108 result for SAVE_EXPR operand and set SAVE_EXPR_FOLDED_P even if
7109 it returned invariant. Call tree_invariant_p unconditionally
7110 afterwards to decide whether to return expr or op0.
7111
58aca9d9
NS
71122017-05-22 Nathan Sidwell <nathan@acm.org>
7113
7114 * c-decl.c (c_parse_final_cleanups): Drop TDI_tu handling.
7115
7fd549d2
TS
71162017-05-19 Thomas Schwinge <thomas@codesourcery.com>
7117
7118 * c-parser.c (c_parser_omp_clause_default): Handle
7119 "OMP_CLAUSE_DEFAULT_PRESENT".
7120
6ecd2339
BE
71212017-05-18 Bernd Edlinger <bernd.edlinger@hotmail.de>
7122
7123 * config-lang.in (gtfiles): Add c-family/c-format.c.
7124
8a57ecff
NS
71252017-05-18 Nathan Sidwell <nathan@acm.org>
7126
7127 * c-decl.c (pushdecl_top_level): Delete unused function.
7128
6574d78e
MP
71292017-05-18 Marek Polacek <polacek@redhat.com>
7130
7131 * c-decl.c (match_builtin_function_types): Use NULL_TREE instead of 0.
7132 (check_earlier_gotos): Likewise.
7133 (define_label): Likewise.
7134 (pending_xref_error): Likewise.
7135 (smallest_type_quals_location): Likewise.
7136 (grokdeclarator): Likewise.
7137 (grokparms): Likewise.
7138 (identifier_global_value): Likewise.
7139 * c-typeck.c (set_nonincremental_init_from_string): Likewise.
7140 (find_init_member): Likewise.
7141
e3455240
MP
71422017-05-18 Marek Polacek <polacek@redhat.com>
7143
7144 * c-decl.c (start_decl): Use false/true instead of 0/1.
7145 (grokdeclarator): Likewise.
7146 (finish_struct): Likewise.
7147 (start_function): Change the return type to bool. Use false/true
7148 instead of 0/1.
7149 (declspecs_add_qual): Use UNKNOWN_LOCATION instead of 0.
7150 * c-tree.h (start_function): Update.
7151 * c-typeck.c (same_translation_unit_p): Change the return type to bool.
7152 (set_designator): Change the return type to bool. Use false/true
7153 instead of 0/1.
7154
3fa8871b
MP
71552017-05-17 Marek Polacek <polacek@redhat.com>
7156
7157 * c-decl.c: Use NULL_TREE instead of 0 where appropriate.
7158 * c-typeck.c: Likewise.
7159
142473df
MP
71602017-05-17 Marek Polacek <polacek@redhat.com>
7161
7162 PR sanitizer/80659
7163 * c-decl.c (build_compound_literal): Set DECL_ARTIFICIAL and
7164 DECL_IGNORED_P even for non-static compound literals.
7165
1a817418
ML
71662017-05-17 Martin Liska <mliska@suse.cz>
7167
7168 * c-decl.c (c_parse_final_cleanups): Introduce dump_flags_t type and
7169 use it instead of int type.
7170
b2fa0a8b
MP
71712017-05-17 Marek Polacek <polacek@redhat.com>
7172
7173 * c-convert.c (convert): Replace c_save_expr with save_expr. Don't
7174 call c_fully_fold.
7175 (convert) <case COMPLEX_TYPE>: Remove special handling of COMPLEX_TYPEs.
ab20d992 7176 * c-decl.c (grokdeclarator): Replace c_save_expr with save_expr.
b2fa0a8b
MP
7177 * c-fold.c (c_fully_fold_internal): Handle SAVE_EXPR.
7178 * c-parser.c (c_parser_declaration_or_fndef): Replace c_save_expr with
7179 save_expr.
7180 (c_parser_conditional_expression): Likewise.
7181 * c-tree.h (SAVE_EXPR_FOLDED_P): Define.
7182 * c-typeck.c (build_modify_expr): Replace c_save_expr with save_expr.
7183 (process_init_element): Likewise.
7184 (build_binary_op): Likewise.
7185 (handle_omp_array_sections_1): Likewise.
7186
1e47f02b
TS
71872017-05-12 Thomas Schwinge <thomas@codesourcery.com>
7188
7189 * c-parser.c (c_parser_omp_clause_num_gangs)
7190 (c_parser_omp_clause_num_workers)
7191 (c_parser_omp_clause_vector_length): Merge functions into...
7192 (c_parser_oacc_single_int_clause): ... this new function. Adjust
7193 all users.
7194
c24e924f
NS
71952017-05-11 Nathan Sidwell <nathan@acm.org>
7196
7197 * gimple-parser.c: Don't #include tree-dump.h.
7198
c587104e
MM
71992017-05-11 Mikhail Maltsev <maltsevm@gmail.com>
7200
7201 PR testsuite/80580
7202 * gimple-parser.c (c_parser_parse_ssa_name): Validate SSA name base.
7203
67ac9a9d
MM
72042017-05-11 Mikhail Maltsev <maltsevm@gmail.com>
7205
7206 PR testsuite/80580
7207 * gimple-parser.c (c_parser_gimple_postfix_expression): Handle
7208 incorrect __MEM syntax.
7209
ac4eb40f
MM
72102017-05-11 Mikhail Maltsev <maltsevm@gmail.com>
7211
7212 PR testsuite/80580
7213 * gimple-parser.c (c_parser_gimple_unary_expression): Check argument
7214 type of unary '*'.
7215
641da50a
NS
72162017-05-09 Nathan Sidwell <nathan@acm.org>
7217
7218 * c-tree.h (pushdecl): Declare.
7219
56d35585
DM
72202017-05-05 David Malcolm <dmalcolm@redhat.com>
7221
7222 * c-decl.c (warn_defaults_to): Replace report_diagnostic
7223 with diagnostic_report_diagnostic.
7224 * c-errors.c (pedwarn_c99): Likewise.
7225 (pedwarn_c90): Likewise.
7226
815d9cc6
XR
72272017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
7228
92a285c1 7229 PR c++/80038
815d9cc6
XR
7230 * c-gimplify.c (c_gimplify_expr): Remove calls to
7231 cilk_gimplifY_call_params_in_spawned_fn.
7232
1c4ea66f
DM
72332017-04-25 David Malcolm <dmalcolm@redhat.com>
7234
7235 * c-parser.c (c_parser_struct_or_union_specifier): Add fix-it
7236 hint for removing extra semicolon.
7237
666f7903
JJ
72382017-04-21 Jakub Jelinek <jakub@redhat.com>
7239
7240 PR c/80468
7241 * c-decl.c (finish_declspecs) <case cts_int_n>: If int_n_idx is not
7242 enabled, set specs->type to integer_type_node.
7243
5764ee3c
JW
72442017-04-03 Jonathan Wakely <jwakely@redhat.com>
7245
7246 * c-array-notation.c: Fix typo in comment.
7247
10fa8dfb
MP
72482017-03-29 Marek Polacek <polacek@redhat.com>
7249
7250 PR c/79730
7251 * c-decl.c (finish_decl): Check VAR_P.
7252
a9e4a1a5
JJ
72532017-03-27 Jakub Jelinek <jakub@redhat.com>
7254
7255 PR middle-end/80162
7256 * c-tree.h (c_mark_addressable): Add array_ref_p argument.
7257 * c-typeck.c (c_mark_addressable): Likewise. Look through
7258 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
7259 to ARRAY_TYPE.
7260 (build_array_ref): Pass true as array_ref_p to c_mark_addressable.
7261
ee3ff394
MP
72622017-03-23 Marek Polacek <polacek@redhat.com>
7263
7264 * c-tree.h: Remove a C_RID_YYCODE reference.
7265
4d1b8e70
JJ
72662017-03-21 Jakub Jelinek <jakub@redhat.com>
7267
7268 PR c/80097
7269 * c-typeck.c (build_binary_op): Add EXCESS_PRECISION_EXPR only around
7270 optional COMPOUND_EXPR with ubsan instrumentation.
7271
31dc71a8
MP
72722017-03-17 Marek Polacek <polacek@redhat.com>
7273
7274 * c-parser.c: Add C11 references.
7275
d579c385
MP
72762017-03-15 Marek Polacek <polacek@redhat.com>
7277
7278 * c-parser.c (c_parser_enum_specifier): Remove redundant line.
7279
85059a38
MP
72802017-03-11 Marek Polacek <polacek@redhat.com>
7281
7282 * c-decl.c (implicit_decl_warning): Add a comment. Fix formatting.
7283
2f6f187a
DM
72842017-03-10 David Malcolm <dmalcolm@redhat.com>
7285
7286 PR translation/79848
7287 * c-decl.c (declspecs_add_type): Simplify uses of "%<%s%>" to
7288 "%qs".
7289 * c-parser.c (c_parser_oacc_shape_clause): Likewise.
7290
36618428
MP
72912017-03-09 Marek Polacek <polacek@redhat.com>
7292
7293 PR sanitizer/79757
7294 * c-parser.c (c_parser_declaration_or_fndef): Don't sanitize old-style
7295 parameter declarations with initializers.
7296
01e5af5a
JJ
72972017-03-09 Jakub Jelinek <jakub@redhat.com>
7298
7299 PR c/79969
7300 * c-decl.c (start_enum): Adjust DECL_SOURCE_LOCATION of
7301 TYPE_STUB_DECL.
7302
a71dbc63
JJ
73032017-03-07 Jakub Jelinek <jakub@redhat.com>
7304
7305 PR c/79834
7306 * c-parser.c (c_parser_pragma): Use error_at instead of c_parser_error
7307 for "may only be used in compound statements" diagnostics, change it
7308 such that the same translatable string is used for all pragmas. For
7309 PRAGMA_OACC_WAIT use "acc wait" rather than "acc enter data" in the
7310 diagnostics.
7311 (c_parser_omp_cancellation_point, c_parser_omp_target_update,
7312 c_parser_omp_target_enter_data, c_parser_omp_target_exit_data): Change
7313 "may only be used in compound statements" diagnostics, such that the
7314 same translatable string is used for all pragmas.
7315
1ff4bae6
MP
73162017-03-04 Marek Polacek <polacek@redhat.com>
7317
7318 PR c/79847
7319 * c-decl.c (implicit_decl_warning): Add missing space.
7320
7f5a7d78
MP
73212017-03-03 Marek Polacek <polacek@redhat.com>
7322
7323 PR c/79758
7324 * c-decl.c (store_parm_decls_oldstyle): Check if the element of
7325 current_function_prototype_arg_types is error_mark_node. Fix
7326 formatting. Use TREE_VALUE instead of TREE_TYPE.
7327
883c8f06
JJ
73282017-03-03 Jakub Jelinek <jakub@redhat.com>
7329
79c9b7a8
JJ
7330 PR c/79837
7331 * c-parser.c (c_parser_omp_clause_reduction): Don't mention
7332 %<min%> or %<max%> in the diagnostics, instead mention identifier.
7333 (c_parser_omp_declare_reduction): Don't mention %<min%> in the
7334 diagnostics.
7335
883c8f06
JJ
7336 PR c/79836
7337 * c-parser.c (c_parser_generic_selection): Use %<_Generic%>
7338 instead of %<_Generic>.
7339 (c_parser_omp_ordered): Use %<depend%> instead of %<depend>.
7340 (c_parser_omp_target_exit_data): Use %<release%> instead of
7341 %<release>.
7342
324ff1a0
JJ
73432017-02-28 Jakub Jelinek <jakub@redhat.com>
7344
7345 * c-parser.c (c_parser_asm_statement): Use cond ? G_("...") : G_("...")
7346 instead of just cond ? "..." : "...".
7347 (c_parser_oacc_enter_exit_data): Use %s and ternary operator only
7348 for "enter"/"exit" keyword.
7349 (c_finish_oacc_routine): Don't use %s to supply portions of the
7350 message.
7351
4227c9ad
JJ
73522017-02-24 Jakub Jelinek <jakub@redhat.com>
7353
7354 PR c++/79588
7355 * c-parser.c (c_parser_postfix_expression_after_primary): Don't
7356 handle -Wrestrict here.
7357 * c-typeck.c (build_function_call_vec): Adjust
7358 check_function_arguments caller.
7359
5d972e66
RB
73602017-02-23 Richard Biener <rguenther@suse.de>
7361
7362 PR c/79684
7363 * gimple-parser.c (c_parser_gimple_statement): Use set_error
7364 to initialize c_exprs to return.
7365 (c_parser_gimple_binary_expression): Likewise.
7366 (c_parser_gimple_unary_expression): Likewise.
7367 (c_parser_gimple_postfix_expression): Likewise.
7368
61ac5ebe
MP
73692017-02-22 Marek Polacek <polacek@redhat.com>
7370
7371 PR c/79662
7372 * c-typeck.c (convert_arguments): Handle error_mark_node.
7373
41d1b0b1
PK
73742017-02-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
7375
7376 * gimple-parser.c (c_parser_gimple_postfix_expression): Check return
7377 value of c_parser_parse_ssa_name against error_mark_node and emit
7378 error if ssa name is anonymous and written as default definition.
7379
eab1f169
PK
73802017-02-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
7381
7382 * gimple-parser.c (c_parser_gimple_postfix_expression): Handle
7383 FMA_EXPR.
7384
bcac0b4d
JJ
73852017-02-16 Jakub Jelinek <jakub@redhat.com>
7386
7387 PR c++/79512
7388 * c-parser.c (c_parser_omp_target): For -fopenmp-simd
7389 ignore #pragma omp target even when not followed by identifier.
7390
1be33173
PK
73912017-02-14 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
7392
7393 * gimpler-parser.c (c_parser_gimple_statement): Handle ABS_EXPR.
7394 (c_parser_gimple_unary_expression): Likewise.
7395
aa326bfb
JJ
73962017-02-13 Jakub Jelinek <jakub@redhat.com>
7397
7398 * c-parser.c (c_parser_oacc_declare): Add missing space in
7399 diagnostics.
7400
8a398bc5
PK
74012017-02-13 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
7402
7403 PR c/79478
7404 * gimple-parser.c (c_parser_gimple_postfix_expression): Call
7405 set_c_expr_source_range when parsing ssa-name.
7406
3dcde5ef 74072017-02-10 Prasad Ghangal <prasad.ghangal@gmail.com>
ab20d992 7408 Richard Biener <rguenther@suse.de>
3dcde5ef
PG
7409
7410 * gimple-parser.c (c_parser_gimple_binary_expression): Avoid
7411 building IL when arguments are error_mark_node.
7412 (c_parser_gimple_unary_expression): Likewise.
7413 (c_parser_gimple_if_stmt): Likewise.
7414 (c_parser_gimple_switch_stmt): Likewise.
7415 (c_parser_gimple_return_stmt): Likewise.
7416 (c_parser_parse_ssa_name): When name lookup fails do not build
7417 an SSA name. Use undeclared rather than not declared in error
7418 reporting.
7419
192b048b
MP
74202017-02-09 Marek Polacek <polacek@redhat.com>
7421
7422 PR c/79428
7423 * c-parser.c (c_parser_omp_ordered): Call c_parser_skip_to_pragma_eol
7424 instead of c_parser_skip_until_found.
7425
56f71478
JJ
74262017-02-09 Jakub Jelinek <jakub@redhat.com>
7427
7428 PR c/79431
7429 * c-parser.c (c_parser_omp_declare_target): Don't invoke
7430 symtab_node::get on automatic variables.
7431
02889d23
CLT
74322016-02-09 Nathan Sidwell <nathan@codesourcery.com>
7433 Chung-Lin Tang <cltang@codesourcery.com>
7434
7435 * c-parser.c (c_parser_omp_clause_collapse): Disallow tile.
7436 (c_parser_oacc_clause_tile): Disallow collapse. Fix parsing and
7437 semantic checking.
7438 * c-parser.c (c_parser_omp_for_loop): Accept tiling constructs.
7439
7af4b20d
RB
74402017-02-07 Richard Biener <rguenther@suse.de>
7441
7442 * gimple-parser.c (c_parser_gimple_expr_list): Simplify.
7443 (c_parser_gimple_postfix_expression_after_primary):
7444 Do not use c_build_function_call_vec to avoid folding and promotion.
7445 Simplify.
7446
e5e391d6
MO
74472017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
7448
7449 PR lto/79061
7450 * c-decl.c (pop_scope): Pass main_input_filename to
7451 build_translation_unit_decl.
7452
c2e84327
DM
74532017-01-24 David Malcolm <dmalcolm@redhat.com>
7454
7455 * c-parser.c: Include "read-rtl-function.h" and
7456 "run-rtl-passes.h".
7457 (c_parser_declaration_or_fndef): Rename "gimple-pass-list" in
7458 grammar to gimple-or-rtl-pass-list. Add rtl-function-definition
7459 production. Update for renaming of field "gimple_pass" to
7460 "gimple_or_rtl_pass". If __RTL was seen, call
7461 c_parser_parse_rtl_body. Convert a timevar_push/pop pair
7462 to an auto_timevar, to cope with early exit.
7463 (c_parser_declspecs): Update RID_GIMPLE handling for renaming of
7464 field "gimple_pass" to "gimple_or_rtl_pass", and for renaming of
7465 c_parser_gimple_pass_list to c_parser_gimple_or_rtl_pass_list.
7466 Handle RID_RTL.
7467 (c_parser_parse_rtl_body): New function.
7468 * c-tree.h (enum c_declspec_word): Add cdw_rtl.
7469 (struct c_declspecs): Rename field "gimple_pass" to
7470 "gimple_or_rtl_pass". Add field "rtl_p".
7471 * gimple-parser.c (c_parser_gimple_pass_list): Rename to...
7472 (c_parser_gimple_or_rtl_pass_list): ...this, updating accordingly.
7473 * gimple-parser.h (c_parser_gimple_pass_list): Rename to...
7474 (c_parser_gimple_or_rtl_pass_list): ...this.
7475
2ebd93e1
MP
74762017-01-20 Marek Polacek <polacek@redhat.com>
7477
7478 PR c/64279
7479 * c-typeck.c (build_conditional_expr): Warn about duplicated branches.
7480
b1c95bb5
RB
74812017-01-13 Richard Biener <rguenther@suse.de>
7482
7483 * gimple-parser.c (c_parser_gimple_compound_statement): Handle
7484 nops.
7485
25329913
RB
74862017-01-13 Richard Biener <rguenther@suse.de>
7487
7488 * gimple-parser.c (c_parser_gimple_postfix_expression): Parse
7489 _Literal ( type-name ) number.
7490
6bb4ea5c
RB
74912017-01-12 Richard Biener <rguenther@suse.de>
7492
7493 * gimple-parser.c (c_parser_gimple_postfix_expression): Parse
7494 __MEM.
7495
6b5b4e9c
JJ
74962017-01-11 Jakub Jelinek <jakub@redhat.com>
7497
7498 PR c++/72813
7499 * c-decl.c (pop_file_scope): Set flag_syntax_only to 1 after writing
7500 PCH file.
7501
e3252775
RB
75022017-01-11 Richard Biener <rguenther@suse.de>
7503
7504 PR bootstrap/79052
7505 * gimple-parser.c (c_parser_gimple_switch_stmt): Add missing
7506 returns on parse errors.
7507
a9342885
MP
75082017-01-04 Marek Polacek <polacek@redhat.com>
7509
7510 PR c++/64767
7511 * c-parser.c (c_parser_postfix_expression): Mark zero character
7512 constants by setting original_type in c_expr.
7513 * c-typeck.c (parser_build_binary_op): Warn when a pointer is compared
7514 with a zero character constant.
7515 (char_type_p): New function.
7516
5dd9a9d0
DM
75172017-01-04 David Malcolm <dmalcolm@redhat.com>
7518
7519 * c-parser.c (c_parser_declaration_or_fndef): Create a
7520 rich_location at init_loc and parse it to start_init.
7521 (last_init_list_comma): New global.
7522 (c_parser_braced_init): Update last_init_list_comma when parsing
7523 commas. Pass it to pop_init_level. Pass location of closing
7524 brace to pop_init_level.
7525 (c_parser_postfix_expression_after_paren_type): Create a
7526 rich_location at type_loc and parse it to start_init.
7527 (c_parser_omp_declare_reduction): Likewise for loc.
7528 * c-tree.h (start_init): Add rich_location * param.
7529 (pop_init_level): Add location_t param.
7530 * c-typeck.c (struct initializer_stack): Add field
7531 "missing_brace_richloc".
7532 (start_init): Add richloc param, use it to initialize
7533 the stack node's missing_brace_richloc.
7534 (last_init_list_comma): New decl.
7535 (finish_implicit_inits): Pass last_init_list_comma to
7536 pop_init_level.
7537 (push_init_level): When finding missing open braces, add fix-it
7538 hints to the richloc.
7539 (pop_init_level): Add "insert_before" param and pass it
7540 when calling pop_init_level. Add fixits about missing
7541 close braces to any richloc. Use the richloc for the
7542 -Wmissing-braces warning.
7543 (set_designator): Pass last_init_list_comma to pop_init_level.
7544 (process_init_element): Likewise.
7545
cbe34bb5
JJ
75462017-01-01 Jakub Jelinek <jakub@redhat.com>
7547
7548 Update copyright years.
7549
d17680f3
JJ
75502016-12-21 Jakub Jelinek <jakub@redhat.com>
7551
0dba7960
JJ
7552 PR bootstrap/78817
7553 * c-typeck.c (build_function_call_vec): If check_function_arguments
7554 returns true, set TREE_NO_WARNING on CALL_EXPR.
7555
d17680f3
JJ
7556 PR c/77767
7557 * c-decl.c (grokdeclarator): If *expr is non-NULL, append expression
7558 to *expr instead of overwriting it.
7559
aa90531e
RB
75602016-12-20 Richard Biener <rguenther@suse.de>
7561
7562 * gimple-parser.c (c_parser_gimple_compound_statement): Improve
7563 error recovery.
7564 (c_parser_gimple_statement): Only build assigns for non-error
7565 stmts.
7566 (c_parser_gimple_postfix_expression_after): Improve error recovery.
7567
629b3d75
MJ
75682016-12-14 Martin Jambor <mjambor@suse.cz>
7569
7570 * c-parser.c: Include omp-general.h and omp-offload.h instead of
7571 omp-low.h.
7572 (c_finish_oacc_routine): Adjusted call to
7573 get_oacc_fn_attrib, build_oacc_routine_dims and replace_oacc_fn_attrib
7574 to use their new names.
7575 (c_parser_oacc_enter_exit_data): Adjusted call to find_omp_clause to
7576 use its new name.
7577 (c_parser_oacc_update): Likewise.
7578 (c_parser_omp_simd): Likewise.
7579 (c_parser_omp_target_update): Likewise.
7580 * c-typeck.c: Include omp-general.h instead of omp-low.h.
7581 (c_finish_omp_cancel): Adjusted call to find_omp_clause to use its new
7582 name.
7583 (c_finish_omp_cancellation_point): Likewise.
7584 * gimple-parser.c: Do not include omp-low.h
7585
c5af52eb
CP
75862016-12-02 Cesar Philippidis <cesar@codesourcery.com>
7587 James Norris <jnorris@codesourcery.com>
7588
7589 * c-parser.c (c_parser_pragma): Error when PRAGMA_OACC_{ENTER_DATA,
7590 EXIT_DATA,WAIT} are not used in compound statements.
7591 (c_parser_oacc_enter_exit_data): Update diagnostics.
7592
48330c93
BE
75932016-11-21 Bernd Edlinger <bernd.edlinger@hotmail.de>
7594
7595 PR c++/71973
7596 * c-decl.c (diagnose_mismatched_decls): Use
7597 OPT_Wbuiltin_declaration_mismatch here too.
7598
899ca90e 75992016-11-18 Richard Sandiford <richard.sandiford@arm.com>
48330c93
BE
7600 Alan Hayward <alan.hayward@arm.com>
7601 David Sherwood <david.sherwood@arm.com>
899ca90e
RS
7602
7603 * c-decl.c (merge_decls): Use SET_DECL_MODE.
7604 (make_label, finish_struct): Likewise.
7605
1ee62b92 76062016-11-14 Prasad Ghangal <prasad.ghangal@gmail.com>
8e745a17 7607 Richard Biener <rguenther@suse.de>
22b15758 7608
8e745a17
JJ
7609 * Make-lang.in (C_AND_OBJC_OBJS): Add gimple-parser.o.
7610 * config-lang.in (gtfiles): Add c/c-parser.h.
7611 * c-tree.h (enum c_declspec_word): Add cdw_gimple.
7612 (struct c_declspecs): Add gimple_pass member and gimple_p flag.
7613 * c-parser.c (enum c_id_kind, struct c_token,
7614 c_parser_next_token_is, c_parser_next_token_is_not,
7615 c_parser_next_token_is_keyword,
7616 enum c_lookahead_kind, enum c_dtr_syn, enum c_parser_prec):
7617 Split out to ...
7618 * c-parser.h: ... new header.
7619 * c-parser.c: Include c-parser.h and gimple-parser.h.
1ee62b92 7620 (c_parser_peek_token, c_parser_peek_2nd_token,
8e745a17
JJ
7621 c_token_starts_typename, c_parser_next_token_starts_declspecs,
7622 c_parser_next_tokens_start_declaration, c_parser_consume_token,
7623 c_parser_error, c_parser_require, c_parser_skip_until_found,
7624 c_parser_declspecs, c_parser_declarator, c_parser_peek_nth_token,
7625 c_parser_type_name): Export.
7626 (c_parser_tokens_buf): New function.
7627 (c_parser_error): Likewise.
7628 (c_parser_set_error): Likewise.
7629 (c_parser_declspecs): Handle RID_GIMPLE.
1ee62b92
PG
7630 (c_parser_declaration_or_fndef): Parse __GIMPLE marked body
7631 via c_parser_parse_gimple_body.
8e745a17
JJ
7632 * c-parser.h (c_parser_peek_token, c_parser_peek_2nd_token,
7633 c_token_starts_typename, c_parser_next_token_starts_declspecs,
7634 c_parser_next_tokens_start_declaration, c_parser_consume_token,
7635 c_parser_error, c_parser_require, c_parser_skip_until_found,
7636 c_parser_declspecs, c_parser_declarator, c_parser_peek_nth_token,
7637 c_parser_type_name): Declare.
1ee62b92
PG
7638 (struct c_parser): Declare forward.
7639 (c_parser_tokens_buf): Declare.
8e745a17
JJ
7640 (c_parser_error): Likewise.
7641 (c_parser_set_error): Likewise.
7642 * gimple-parser.c: New file.
7643 * gimple-parser.h: Likewise.
1ee62b92 7644
22b15758
UB
76452016-11-13 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
7646
7647 PR c/35503
7648 * c-parser.c (c_parser_postfix_expression_after_primary): Call
7649 warn_for_restrict.
7650
84ff4775
LCW
76512016-09-11 Le-Chun Wu <lcwu@google.com>
7652 Mark Wielaard <mjw@redhat.com>
7653
7654 * c-decl.c (warn_if_shadowing): Use the warning code corresponding
7655 to the given -Wshadow= variant.
7656
4d0cdd0c
TP
76572016-10-13 Thomas Preud'homme <thomas.preudhomme@arm.com>
7658
7659 * c-typeck.c: Include memmodel.h.
7660
1202f33e
JJ
76612016-10-13 Jakub Jelinek <jakub@redhat.com>
7662
7663 PR target/77957
7664 * c-objc-common.h (LANG_HOOKS_GETDECLS): Use hook_tree_void_null
7665 instead of lhd_return_null_tree_v.
7666
8a14afd0
BS
76672016-10-07 Bernd Schmidt <bschmidt@redhat.com>
7668
7669 PR c++/69733
7670 * c-decl.c (smallest_type_quals_location): New static function.
7671 (grokdeclarator): Try to find the correct location for an ignored
7672 qualifier.
7673
81fea426
MP
76742016-09-26 Marek Polacek <polacek@redhat.com>
7675
7676 PR c/7652
7677 * c-decl.c (pop_scope): Add gcc_fallthrough.
7678
76792016-09-26 Marek Polacek <polacek@redhat.com>
7680
7681 PR c/7652
7682 * c-parser.c (struct c_token): Add flags field.
7683 (c_lex_one_token): Pass it to c_lex_with_flags.
7684 (c_parser_declaration_or_fndef): Turn __attribute__((fallthrough));
7685 into IFN_FALLTHROUGH.
7686 (c_parser_label): Set FALLTHROUGH_LABEL_P on labels. Handle
7687 attribute fallthrough after a case label or default label.
7688 (c_parser_statement_after_labels): Handle RID_ATTRIBUTE.
7689
9a2300e9
MP
76902016-09-24 Marek Polacek <polacek@redhat.com>
7691
7692 PR c/77490
7693 * c-typeck.c (build_unary_op): Warn about bit not on expressions that
7694 have boolean value. Warn about ++/-- on booleans.
7695
7de76362
JJ
76962016-09-23 Jakub Jelinek <jakub@redhat.com>
7697
7698 * c-parser.c (incomplete_record_decls): Remove unnecessary
7699 = vNULL initialization of file scope vec.
7700
5b73d2ab
MP
77012016-09-16 Marek Polacek <polacek@redhat.com>
7702
7703 * c-typeck.c (lvalue_p): Use true and false instead of 1 and 0.
7704
e51fbec3
MP
77052016-09-14 Marek Polacek <polacek@redhat.com>
7706
7707 * c-array-notation.c (create_cmp_incr): Use false instead of 0.
7708 (fix_array_notation_expr): Likewise.
7709 * c-decl.c (finish_decl): Likewise.
7710 * c-parser.c (c_parser_postfix_expression_after_primary): Likewise.
7711 * c-typeck.c (array_to_pointer_conversion): Use true instead of 1.
7712 (function_to_pointer_conversion): Use false instead of 0.
7713 (convert_lvalue_to_rvalue): Likewise.
7714 (parser_build_unary_op): Likewise.
7715 (build_atomic_assign): Likewise.
7716 (build_unary_op): Change nonconvert parameter type to bool, use
7717 true/false instead of 1/0.
7718 (build_binary_op): Use true instead of 1.
7719
254830ba
DM
77202016-09-13 David Malcolm <dmalcolm@redhat.com>
7721
7722 * c-parser.c (c_parser_declaration_or_fndef): Update for renaming
7723 of add_fixit_insert to add_fixit_insert_before.
7724
4c13ba17
MP
77252016-09-13 Marek Polacek <polacek@redhat.com>
7726
7727 * c-typeck.c (build_unary_op): Rename FLAG parameter to NOCONVERT. Use
7728 it.
7729
54dcdb88
BE
77302016-09-12 Bernd Edlinger <bernd.edlinger@hotmail.de>
7731
7732 PR c++/77496
7733 * c-parser.c (c_parser_conditional_expression): Pass the rightmost
7734 COMPOUND_EXPR to warn_for_omitted_condop.
7735
e5106e27
DM
77362016-09-07 David Malcolm <dmalcolm@redhat.com>
7737
7738 * c-lang.c (LANG_HOOKS_GET_SUBSTRING_LOCATION): Use
7739 c_get_substring_location for this new langhook.
7740
9dc5773f
JJ
77412016-09-02 Jakub Jelinek <jakub@redhat.com>
7742
7743 PR c/65467
7744 * c-parser.c (c_parser_declspecs): Don't sorry about _Atomic if
7745 flag_openmp.
7746 (c_parser_omp_variable_list): Use convert_lvalue_to_rvalue
7747 instead of mark_exp_read on low_bound/length expression.
7748 (c_parser_omp_clause_num_gangs, c_parser_omp_clause_num_threads,
7749 c_parser_omp_clause_num_tasks, c_parser_omp_clause_grainsize,
7750 c_parser_omp_clause_priority, c_parser_omp_clause_hint,
7751 c_parser_omp_clause_num_workers, c_parser_oacc_shape_clause,
7752 c_parser_oacc_clause_tile, c_parser_omp_clause_schedule,
7753 c_parser_omp_clause_vector_length, c_parser_omp_clause_num_teams,
7754 c_parser_omp_clause_thread_limit, c_parser_omp_clause_aligned,
7755 c_parser_omp_clause_linear, c_parser_omp_clause_safelen,
7756 c_parser_omp_clause_simdlen, c_parser_omp_clause_device,
7757 c_parser_omp_clause_dist_schedule): Use convert_lvalue_to_rvalue
7758 instead of mark_expr_read.
7759 (c_parser_omp_declare_reduction): Reject _Atomic qualified types.
7760 * c-objc-common.h (LANG_HOOKS_OMP_CLAUSE_COPY_CTOR,
7761 LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP): Redefine.
7762 * c-tree.h (c_omp_clause_copy_ctor): New prototype.
7763 * c-typeck.c (handle_omp_array_sections_1): Diagnose _Atomic qualified
7764 array section bases outside of depend clause, for depend clause
7765 use convert_lvalue_to_rvalue on the base.
7766 (c_finish_omp_clauses): Reject _Atomic qualified vars in reduction,
7767 linear, aligned, map, to and from clauses.
7768 (c_omp_clause_copy_ctor): New function.
7769
295844f6
MP
77702016-09-01 Marek Polacek <polacek@redhat.com>
7771
7772 PR c/7652
7773 * c-typeck.c (composite_type): Add FALLTHRU comment.
7774
089af25c
DM
77752016-08-31 David Malcolm <dmalcolm@redhat.com>
7776
7777 * c-parser.c (c_parser_declaration_or_fndef): Add trailing space
7778 to the insertion fixits for "struct", "union", and "enum".
7779
f9087798
DM
77802016-08-30 David Malcolm <dmalcolm@redhat.com>
7781
7782 * c-decl.c (implicit_decl_warning): Use add_fixit_replace
7783 rather than add_fixit_misspelled_id.
7784 (undeclared_variable): Likewise.
7785 * c-parser.c (c_parser_declaration_or_fndef): Likewise. Remove
7786 now-redundant "here" params from add_fixit_insert method calls.
7787 (c_parser_parameter_declaration): Likewise.
7788 * c-typeck.c (build_component_ref): Remove now-redundant range
7789 param from add_fixit_replace method calls.
7790
ebef225f
MP
77912016-08-25 Marek Polacek <polacek@redhat.com>
7792
7793 * c-typeck.c (parser_build_binary_op): Pass LHS to
7794 warn_logical_not_parentheses.
7795
fe377a48
MP
77962016-08-25 Marek Polacek <polacek@redhat.com>
7797
7798 PR c/77323
7799 * c-decl.c (declspecs_add_type): Set typespec_word even when __intN
7800 or _FloatN or _FloatNx is not supported.
7801 (finish_declspecs): Set type to integer_type_node when _FloatN or
7802 _FloatNx is not supported.
7803
c65699ef
JM
78042016-08-19 Joseph Myers <joseph@codesourcery.com>
7805
7806 PR c/32187
7807 * c-tree.h (cts_floatn_nx): New enum c_typespec_keyword value.
7808 (struct c_declspecs): Add field floatn_nx_idx.
7809 * c-decl.c (declspecs_add_type, finish_declspecs): Handle _FloatN
7810 and _FloatNx type specifiers.
7811 * c-parser.c (c_keyword_starts_typename, c_token_starts_declspecs)
7812 (c_parser_declspecs, c_parser_attribute_any_word)
7813 (c_parser_objc_selector): Use CASE_RID_FLOATN_NX.
7814 * c-typeck.c (c_common_type): Handle _FloatN and _FloatNx types.
7815 (convert_arguments): Avoid promoting _FloatN and _FloatNx types
7816 narrower than double.
7817
2f1364c2
JJ
78182016-08-12 Jakub Jelinek <jakub@redhat.com>
7819 Martin Liska <mliska@suse.cz>
7820
7821 PR c/67410
7822 * c-typeck.c (set_nonincremental_init_from_string): Use / instead of
7823 % to determine val element to change. Assert that
7824 wchar_bytes * charwidth fits into val array.
7825
191816a3
MP
78262016-08-12 Marek Polacek <polacek@redhat.com>
7827
7828 PR c/7652
7829 * c-parser.c (c_parser_external_declaration): Add FALLTHRU.
7830 (c_parser_postfix_expression): Likewise.
7831 * c-typeck.c (build_unary_op): Adjust fall through comment.
7832 (c_mark_addressable): Likewise.
7833
b95a64bb
JJ
78342016-08-11 Jakub Jelinek <jakub@redhat.com>
7835
7836 PR c/72816
7837 * c-decl.c (grokdeclarator): When adding TYPE_DOMAIN for flexible
7838 array member through typedef, for orig_qual_indirect == 0 clear
7839 orig_qual_type.
7840
895aa8e1
DM
78412016-08-08 David Malcolm <dmalcolm@redhat.com>
7842
7843 PR c/64955
7844 * c-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): If CHECKING_P, wire
7845 this up to selftest::run_c_tests.
7846 (selftest::run_c_tests): New function.
7847
0b212d8c
TS
78482016-08-04 Thomas Schwinge <thomas@codesourcery.com>
7849
ae9281fc
TS
7850 * c-parser.c (struct oacc_routine_data): Add error_seen and
7851 fndecl_seen members.
7852 (c_finish_oacc_routine): Use these.
7853 (c_parser_declaration_or_fndef): Adjust.
7854 (c_parser_oacc_routine): Likewise. Support more C language
7855 constructs, and improve diagnostics. Move pragma context
7856 checking...
7857 (c_parser_pragma): ... here.
7858
0b212d8c
TS
7859 * c-parser.c (struct oacc_routine_data): New.
7860 (c_parser_declaration_or_fndef, c_parser_oacc_routine): Use it.
7861 Simplify code.
7862 (c_finish_oacc_routine): Likewise. Don't attach clauses to "omp
7863 declare target" attribute.
7864
76e2c821
JB
78652016-08-01 Jan Beulich <jbeulich@suse.com>
7866
7867 * c-fold.c (c_fully_fold_internal): Also emit shift count
7868 warnings for vector types.
7869 * c-typeck.c (build_binary_op): Likewise.
7870
f618a472
MP
78712016-07-29 Marek Polacek <polacek@redhat.com>
7872
7873 PR c/71742
7874 * c-decl.c (finish_struct): Rephrase an error message.
7875
efd0786f
MP
7876 PR c/71853
7877 * c-parser.c (c_parser_switch_statement): Initialize ce.original_type
7878 to error node for invalid code.
7879
e00dceaf
MP
7880 PR c/71573
7881 * c-decl.c (implicitly_declare): Return decl early not only for
7882 error_mark_nodes, but for anything that is not a FUNCTION_DECL.
7883
673a107a
JJ
78842016-07-29 Jakub Jelinek <jakub@redhat.com>
7885
7886 PR c/71969
7887 * c-decl.c (finish_function): Only set DECL_DISREGARD_INLINE_LIMITS
7888 on GNU extern inline functions.
7889
a5b5c8b6
MP
78902016-07-29 Marek Polacek <polacek@redhat.com>
7891
7892 PR c/71583
7893 * c-parser.c (c_parser_postfix_expression_after_paren_type): Also
7894 check expr.value.
7895
e3fe09c1
UB
78962016-07-22 Uros Bizjak <ubizjak@gmail.com>
7897
7898 * c-typeck.c: Use HOST_WIDE_INT_1 instead of (HOST_WIDE_INT) 1,
7899
7c8f7eaa
DM
79002016-07-20 David Malcolm <dmalcolm@redhat.com>
7901
7902 * c-decl.c (struct edit_distance_traits<cpp_hashnode *>): Move to
7903 spellcheck-tree.h
7904 (best_macro_match): Likewise, converting from a typedef to a
7905 subclass.
7906 (find_closest_macro_cpp_cb): Move to spellcheck-tree.c.
7907 (lookup_name_fuzzy): Update for change of best_macro_match to a
7908 subclass with a ctor that calls cpp_forall_identifiers.
7909
de6a69ee
DM
79102016-07-20 David Malcolm <dmalcolm@redhat.com>
7911
7912 * c-decl.c (implicit_decl_warning): Update for conversion of
7913 return type of lookup_name_fuzzy to const char *.
7914 (undeclared_variable): Likewise.
7915 (lookup_name_fuzzy): Convert return type from tree to
7916 const char *.
7917 * c-parser.c (c_parser_declaration_or_fndef): Update for
7918 conversion of return type of lookup_name_fuzzy to const char *.
7919 (c_parser_parameter_declaration): Likewise.
7920
b1c9c068
CP
79212016-07-15 Cesar Philippidis <cesar@codesourcery.com>
7922
7923 * c-parser.c (c_parser_oacc_declare): Don't scan for
7924 GOMP_MAP_POINTER.
7925 * c-typeck.c (handle_omp_array_sections): Mark data clauses with
7926 GOMP_MAP_FORCE_{PRESENT,TO,FROM,TOFROM} as potentially having
7927 zero-length subarrays.
7928
ddbbcb19
JJ
79292016-07-15 Jakub Jelinek <jakub@redhat.com>
7930
7931 PR c/71858
7932 * c-decl.c (implicit_decl_warning): Use FUZZY_LOOKUP_FUNCTION_NAME
7933 instead of FUZZY_LOOKUP_NAME.
7934 (lookup_name_fuzzy): For FUZZY_LOOKUP_FUNCTION_NAME consider
7935 FUNCTION_DECLs, {VAR,PARM}_DECLs function pointers and macros.
7936
dd36b877
JJ
79372016-07-14 Jakub Jelinek <jakub@redhat.com>
7938
7939 PR c/71858
7940 * c-decl.c (lookup_name_fuzzy): Ignore binding->invisible.
7941
8c681247
TS
79422016-07-12 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
7943
7944 * c-parser.c (c_parser_generic_selection): Make type of variable
7945 auto_vec.
7946 (c_parser_omp_declare_simd): Likewise.
7947
bf4fa671
TS
79482016-07-12 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
7949
7950 * c-decl.c (struct c_struct_parse_info): Change member types
7951 from vec to auto_vec.
7952 (start_struct): Adjust.
7953 (finish_struct): Likewise.
7954
557e8c49
JJ
79552016-07-02 Jakub Jelinek <jakub@redhat.com>
7956
7957 PR c/71719
7958 * c-typeck.c (mark_exp_read): Handle VIEW_CONVERT_EXPR.
7959
54d19c3b
TS
79602016-06-29 Thomas Schwinge <thomas@codesourcery.com>
7961
7962 * c-parser.c (c_parser_pragma) <PRAGMA_OMP_CANCELLATION_POINT>:
7963 Move pragma context checking into...
7964 (c_parser_omp_cancellation_point): ... here, and improve
7965 diagnostic messages.
7966 * c-typeck.c (c_finish_omp_cancel)
7967 (c_finish_omp_cancellation_point): Improve diagnostic messages.
7968
152ef731
JJ
79692016-06-29 Jakub Jelinek <jakub@redhat.com>
7970
7971 PR c/71685
7972 * c-typeck.c (c_build_qualified_type): Don't clear
7973 C_TYPE_INCOMPLETE_VARS for the main variant.
7974
79752016-06-28 Martin Sebor <msebor@redhat.com>
4378d117
MS
7976
7977 PR c/71552
7978 * c-typeck.c (output_init_element): Diagnose incompatible types
7979 before non-constant initializers.
7980
e9ac1f86
JJ
79812016-06-28 Jakub Jelinek <jakub@redhat.com>
7982
7983 * Make-lang.in: Don't cat ../stage_current if it does not exist.
7984
277d7ee0
AK
79852016-06-23 Andi Kleen <ak@linux.intel.com>
7986
7987 * Make-lang.in: Add support for autofdo.
7988
1a4f11c8
DM
79892016-06-22 David Malcolm <dmalcolm@redhat.com>
7990
7991 PR c/70339
7992 * c-decl.c: Include spellcheck-tree.h and gcc-rich-location.h.
7993 (implicit_decl_warning): When issuing warnings for implicit
7994 declarations, attempt to provide a suggestion via
7995 lookup_name_fuzzy.
7996 (undeclared_variable): Likewise when issuing errors.
7997 (lookup_name_in_scope): Likewise.
7998 (struct edit_distance_traits<cpp_hashnode *>): New struct.
7999 (best_macro_match): New typedef.
8000 (find_closest_macro_cpp_cb): New function.
8001 (lookup_name_fuzzy): New function.
8002 * c-parser.c: Include gcc-rich-location.h.
8003 (c_token_starts_typename): Split out case CPP_KEYWORD into...
8004 (c_keyword_starts_typename): ...this new function.
8005 (c_parser_declaration_or_fndef): When issuing errors about
8006 missing "struct" etc, add a fixit. For other kinds of errors,
8007 attempt to provide a suggestion via lookup_name_fuzzy.
8008 (c_parser_parms_declarator): When looking ahead to detect typos in
8009 type names, also reject CPP_KEYWORD.
8010 (c_parser_parameter_declaration): When issuing errors about
8011 unknown type names, attempt to provide a suggestion via
8012 lookup_name_fuzzy.
8013 * c-tree.h (c_keyword_starts_typename): New prototype.
8014
5a578671
JM
80152016-06-20 Joseph Myers <joseph@codesourcery.com>
8016
8017 PR c/71601
8018 * c-typeck.c (build_conditional_expr): Return error_mark_node if
8019 c_common_type returns error_mark_node.
8020
3f8257db 80212016-06-19 Martin Sebor <msebor@redhat.com>
aa0db437
MS
8022
8023 PR c/69507
8024 * c-parser.c (c_parser_alignof_expression): Avoid diagnosing
8025 __alignof__ (expression).
8026
6a3f203c
DM
80272016-06-14 David Malcolm <dmalcolm@redhat.com>
8028
8029 * c-typeck.c: Include spellcheck-tree.h rather than spellcheck.h.
8030
264757fb
DM
80312016-06-14 David Malcolm <dmalcolm@redhat.com>
8032
8033 * c-typeck.c (build_component_ref): Simplify fixit code by
8034 using gcc_rich_location::add_fixit_misspelled_id.
8035 (set_init_label): Likewise.
8036
f7e4f2e3
DM
80372016-06-13 David Malcolm <dmalcolm@redhat.com>
8038
8039 * c-parser.c (c_parser_initelt): Provide location of name for new
8040 location_t param of set_init_label.
8041 * c-tree.h (set_init_label): Add location_t param.
8042 * c-typeck.c (set_init_index): Add "fieldname_loc" location_t
8043 param and use it when issuing error messages about unrecognized
8044 field names. Attempt to provide a fixit hint if appropriate,
8045 otherwise update the error message to provide the type name.
8046
4b1ffdb1
TS
80472016-06-10 Thomas Schwinge <thomas@codesourcery.com>
8048
8049 PR c/71381
8050 * c-parser.c (c_parser_omp_variable_list) <OMP_CLAUSE__CACHE_>:
8051 Loosen checking.
8052
44a845ca
MS
80532016-06-08 Martin Sebor <msebor@redhat.com>
8054 Jakub Jelinek <jakub@redhat.com>
8055
8056 PR c++/70507
8057 PR c/68120
8058 * c-typeck.c (convert_arguments): Don't promote last argument
8059 of BUILT_IN_{ADD,SUB,MUL}_OVERFLOW_P.
8060
92a5f2ba
MP
80612016-06-08 Marek Polacek <polacek@redhat.com>
8062
8063 PR c/71418
8064 * c-decl.c (grokdeclarator): Check TYPE_P.
8065
08203f73
MP
8066 PR c/71426
8067 * c-decl.c (get_parm_info): Don't crash on an assert on invalid
8068 code.
8069
6ffd47b7
DM
80702016-06-07 David Malcolm <dmalcolm@redhat.com>
8071
8072 * c-parser.c (c_parser_postfix_expression): In __builtin_offsetof
8073 and structure element reference, capture the location of the
8074 element name token and pass it to build_component_ref.
8075 (c_parser_postfix_expression_after_primary): Likewise for
8076 structure element dereference.
8077 (c_parser_omp_variable_list): Likewise for
8078 OMP_CLAUSE_{_CACHE, MAP, FROM, TO},
8079 * c-tree.h (build_component_ref): Add location_t param.
8080 * c-typeck.c (build_component_ref): Add location_t param
8081 COMPONENT_LOC. Use it, if available, when issuing hints about
8082 mispelled member names to provide a fixit replacement hint.
8083
1f40cff3
MP
80842016-06-06 Marek Polacek <polacek@redhat.com>
8085
8086 PR c/71362
8087 * c-parser.c (c_parser_direct_declarator): Set location.
8088
5545a907
MP
80892016-06-06 Marek Polacek <polacek@redhat.com>
8090
8091 * c-typeck.c (comptypes_internal): Handle comparisons of
8092 INTEGER_TYPE, FIXED_POINT_TYPE, and REAL_TYPE nodes. Don't check
8093 TYPE_REF_CAN_ALIAS_ALL.
8094
b605f663
CLT
80952016-06-03 Chung-Lin Tang <cltang@codesourcery.com>
8096
8097 * c-typeck.c (c_finish_omp_clauses): Mark OpenACC reduction
8098 arguments as addressable when async clause exists.
8099
00631022
JJ
81002016-05-30 Jakub Jelinek <jakub@redhat.com>
8101
8102 PR c++/71349
8103 * c-parser.c (c_parser_omp_for): Don't disallow nowait clause
8104 when combined with target construct.
8105
7211a097
JJ
81062016-05-26 Jakub Jelinek <jakub@redhat.com>
8107
8108 * c-parser.c (c_parser_omp_clause_schedule): Warn if
8109 OMP_CLAUSE_SCHEDULE_CHUNK_EXPR is known not to be positive.
8110
95efe6b6
MP
81112016-05-25 Marek Polacek <polacek@redhat.com>
8112
8113 PR c/71265
8114 * c-decl.c (c_make_fname_decl): Don't check seen_error.
8115
a23faf7a
MP
8116 PR c/71266
8117 * c-decl.c (store_parm_decls_oldstyle): Skip non-PARM_DECLs.
8118
e46c7770
CP
81192016-05-24 Cesar Philippidis <cesar@codesourcery.com>
8120
8121 * c-parser.c (c_parser_oacc_declare): Add support for
8122 GOMP_MAP_FIRSTPRIVATE_POINTER.
8123 * c-typeck.c (handle_omp_array_sections_1): Replace bool is_omp
8124 argument with enum c_omp_region_type ort.
8125 (handle_omp_array_sections): Likewise. Update call to
8126 handle_omp_array_sections_1.
8127 (c_finish_omp_clauses): Add specific errors and warning messages for
8128 OpenACC. Use firsrtprivate pointers for OpenACC subarrays. Update
8129 call to handle_omp_array_sections.
8130
a04e69c0
TS
81312016-05-24 Thomas Schwinge <thomas@codesourcery.com>
8132
8133 * c-parser.c (c_parser_oacc_routine): Tighten syntax checks.
8134
f17a223d
RB
81352016-05-24 Richard Biener <rguenther@suse.de>
8136
8137 PR middle-end/70434
8138 PR c/69504
8139 * c-typeck.c (build_array_ref): Do not complain about indexing
8140 non-lvalue vectors. Adjust for function name change.
8141
79063edd
MS
81422016-05-20 Martin Sebor <msebor@redhat.com>
8143
8144 PR c/71115
8145 * c-typeck.c (error_init): Use
8146 expansion_point_location_if_in_system_header.
8147 (warning_init): Same.
8148
8a40fef3
DM
81492016-05-19 David Malcolm <dmalcolm@redhat.com>
8150
8151 PR c/71171
8152 * c-parser.c (c_parser_generic_selection): Use c_expr::set_error
8153 in error-handling.
8154 (c_parser_postfix_expression): Likewise.
8155 * c-tree.h (c_expr::set_error): New method.
8156 * c-typeck.c (parser_build_binary_op): In error-handling, ensure
8157 that result's range is initialized.
8158
e9892350
JG
81592016-05-17 James Greenhalgh <james.greenhalgh@arm.com>
8160
8161 * c-typeck.c (parser_build_unary_op): Fix formatting.
8162
8fad45f5
MW
81632016-05-16 Matthew Wahab <matthew.wahab@arm.com>
8164
8165 * c-decl.c (grokdeclarator): Remove errmsg and use of
8166 targetm.invalid_return_type.
8167 (grokparms): Remove errmsg and use of
8168 targetm.invalid_parameter_type.
8169
aa4b467b
JM
81702016-05-13 Joseph Myers <joseph@codesourcery.com>
8171
8172 * c-decl.c (grokdeclarator): For C11, discard qualifiers on
8173 function return type.
8174
4f2e1536
MP
81752016-05-12 Marek Polacek <polacek@redhat.com>
8176
8177 PR c/70756
8178 * c-decl.c (build_compound_literal): Pass LOC down to
8179 c_incomplete_type_error.
8180 * c-tree.h (require_complete_type): Adjust declaration.
8181 (c_incomplete_type_error): Likewise.
8182 * c-typeck.c (require_complete_type): Add location parameter, pass it
8183 down to c_incomplete_type_error.
8184 (c_incomplete_type_error): Add location parameter, pass it down to
8185 error_at.
8186 (build_component_ref): Pass location down to c_incomplete_type_error.
8187 (default_conversion): Pass location down to require_complete_type.
8188 (build_array_ref): Likewise.
8189 (build_function_call_vec): Likewise.
8190 (convert_arguments): Likewise.
8191 (build_unary_op): Likewise.
8192 (build_c_cast): Likewise.
8193 (build_modify_expr): Likewise.
8194 (convert_for_assignment): Likewise.
8195 (c_finish_omp_clauses): Likewise.
8196
d6e83a8d
MM
81972016-05-11 Mikhail Maltsev <maltsevm@gmail.com>
8198
8199 PR c/43651
8200 * c-decl.c (declspecs_add_qual): Warn when -Wduplicate-decl-specifier
8201 is enabled.
8202 * c-errors.c (pedwarn_c90): Return true if warned.
8203 * c-tree.h (pedwarn_c90): Change return type to bool.
8204 (enum c_declspec_word): Add new enumerator cdw_atomic.
8205
5c3a10fb
MP
82062016-05-11 Marek Polacek <polacek@redhat.com>
8207
8208 PR c++/71024
8209 * c-decl.c (diagnose_mismatched_decls): Factor out code to
8210 diagnose_mismatched_attributes and call it.
8211
cf68d92c
MP
82122016-05-10 Marek Polacek <polacek@redhat.com>
8213
8214 PR c/70255
8215 * c-decl.c (diagnose_mismatched_decls): Warn for optimize attribute
8216 on a declaration following the definition.
8217
351f85c5
JJ
82182016-05-05 Jakub Jelinek <jakub@redhat.com>
8219
8220 * c-parser.c (c_parser_switch_statement): Add IF_P argument,
8221 parse it through to c_parser_c99_block_statement.
8222 (c_parser_statement_after_labels): Adjust c_parser_switch_statement
8223 caller.
8224
deef7113
MP
82252016-05-04 Marek Polacek <polacek@redhat.com>
8226
8227 * c-parser.c (c_parser_if_statement): Replace OPT_Wparentheses with
8228 OPT_Wdangling_else.
8229
de55efd5
MP
82302016-05-04 Marek Polacek <polacek@redhat.com>
8231
8232 PR c/48778
8233 * c-typeck.c (build_binary_op): Don't issue -Waddress warnings
8234 for macro expansions.
8235
79ce98bc
MP
82362016-05-03 Marek Polacek <polacek@redhat.com>
8237
8238 PR c/70859
8239 * c-typeck.c (build_function_call_vec): Pass LOC and ARG_LOC down to
8240 check_builtin_function_arguments.
8241
fb2647aa
RB
82422016-05-03 Richard Biener <rguenther@suse.de>
8243
8244 * Make-lang.in (cc1-checksum.c): For stage-final re-use
8245 the checksum from the previous stage.
8246
77886428
CP
82472016-05-02 Cesar Philippidis <cesar@codesourcery.com>
8248
8249 * c-parser.c (c_parser_oacc_all_clauses): Update call to
8250 c_finish_omp_clauses.
8251 (c_parser_omp_all_clauses): Likewise.
8252 (c_parser_oacc_cache): Likewise.
8253 (c_parser_oacc_loop): Likewise.
8254 (omp_split_clauses): Likewise.
8255 (c_parser_omp_declare_target): Likewise.
8256 (c_parser_cilk_all_clauses): Likewise.
8257 (c_parser_cilk_for): Likewise.
8258 * c-typeck.c (c_finish_omp_clauses): Replace bool arguments
8259 is_omp, declare_simd, and is_cilk with enum c_omp_region_type ort.
8260
7176a4a0
MP
82612016-05-02 Marek Polacek <polacek@redhat.com>
8262
8263 PR c/70851
8264 * c-decl.c (grokdeclarator): Diagnose when array's size has an
8265 incomplete type.
8266
e7ff0319
CP
82672016-04-29 Cesar Philippidis <cesar@codesourcery.com>
8268
8269 PR middle-end/70626
8270 * c-parser.c (c_parser_oacc_loop): Don't augment mask with
8271 OACC_LOOP_CLAUSE_MASK.
8272 (c_parser_oacc_kernels_parallel): Update call to
8273 c_oacc_split_loop_clauses.
8274
9f405ce1
AM
82752016-04-28 Andrew MacLeod <amacleod@redhat.com>
8276
8277 * c-array-notation.c (fix_builtin_array_notation_fn): Fix final
8278 argument to build_modify_expr in two cases.
8279
c1e1f433
BS
82802016-04-27 Bernd Schmidt <bschmidt@redhat.com>
8281
8282 * c-parser.c (c_parser_postfix_expression_after_primary): Call
8283 warn_for_memset instead of warning directly here.
8284
2448a956
MP
82852016-04-26 Marek Polacek <polacek@redhat.com>
8286
8287 PR c/67784
8288 * c-parser.c (c_parser_maybe_reclassify_token): New function factored
8289 out of ...
8290 (c_parser_for_statement): ... here.
8291 (c_parser_if_statement): Use it.
8292 (c_parser_switch_statement): Use it.
8293 (c_parser_while_statement): Use it.
8294
b02a5e26
MP
8295 PR c/70791
8296 * c-decl.c (pushdecl): Pass LOCUS down to warning.
8297
477d4906
IV
82982016-04-20 Ilya Verbin <ilya.verbin@intel.com>
8299
8300 PR c++/69363
8301 * c-parser.c (c_parser_cilk_all_clauses): Use c_finish_omp_clauses
8302 instead of c_finish_cilk_clauses.
8303 * c-tree.h (c_finish_omp_clauses): Add new default argument.
8304 * c-typeck.c (c_finish_omp_clauses): Add new argument. Allow
8305 floating-point variables in the linear clause for Cilk Plus.
8306
fe37c7af
MM
83072016-04-18 Michael Matz <matz@suse.de>
8308
8309 * c-decl.c (merge_decls): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
8310 (grokdeclarator, parser_xref_tag, finish_enum): Use SET_TYPE_ALIGN.
8311
949505a9
MP
83122016-04-15 Marek Polacek <polacek@redhat.com>
8313
8314 PR c/70671
8315 * c-typeck.c (build_unary_op): Pass location down to error and
8316 warning call.
8317
dda1bf61
JJ
83182016-04-15 Jakub Jelinek <jakub@redhat.com>
8319
8320 PR c/70436
8321 * c-parser.c (c_parser_pragma): Add IF_P argument, pass it down
8322 where needed.
8323 (c_parser_external_declaration, c_parser_struct_or_union_specifier,
8324 c_parser_parameter_declaration, c_parser_compound_statement_nostart,
8325 c_parser_objc_class_instance_variables, c_parser_objc_methodprotolist):
8326 Adjust c_parser_pragma callers.
8327 (c_parser_statement_after_labels): Likewise. Adjust c_parser_cilk_for
8328 caller.
8329 (c_parser_omp_structured_block): Add IF_P argument, pass it down to
8330 c_parser_statement.
8331 (c_parser_oacc_data, c_parser_oacc_host_data, c_parser_oacc_loop,
8332 c_parser_oacc_kernels_parallel, c_parser_omp_critical,
8333 c_parser_omp_simd, c_parser_omp_for, c_parser_omp_master,
8334 c_parser_omp_ordered, c_parser_omp_parallel, c_parser_omp_single,
8335 c_parser_omp_task, c_parser_omp_taskgroup, c_parser_omp_distribute,
8336 c_parser_omp_teams, c_parser_omp_target_data, c_parser_omp_target,
8337 c_parser_omp_taskloop, c_parser_omp_construct, c_parser_cilk_grainsize,
8338 c_parser_cilk_simd, c_parser_cilk_for): Add IF_P argument, pass it
8339 down where needed.
8340 (c_parser_omp_for_loop): Likewise. Clear IF_P if nbraces.
8341 (c_parser_omp_sections_scope): Adjust c_parser_omp_structured_block
8342 calls.
8343
99cd9857
MP
83442016-04-13 Marek Polacek <polacek@redhat.com>
8345
8346 PR c/70436
8347 * c-parser.c (c_parser_statement_after_labels): Add IF_P argument and
8348 adjust callers.
8349 (c_parser_statement): Likewise.
8350 (c_parser_c99_block_statement): Likewise.
8351 (c_parser_while_statement): Likewise.
8352 (c_parser_for_statement): Likewise.
8353 (c_parser_if_body): Don't set IF_P here.
8354 (c_parser_if_statement): Add IF_P argument. Set IF_P here. Warn
8355 about dangling else here.
8356 * c-tree.h (c_finish_if_stmt): Adjust declaration.
8357 * c-typeck.c (c_finish_if_stmt): Remove NESTED_IF parameter. Don't
8358 warn about dangling else here.
8359
f13355da
MP
83602016-04-04 Marek Polacek <polacek@redhat.com>
8361
8362 PR c/70307
8363 * c-fold.c (c_fully_fold_internal): Handle VEC_COND_EXPR.
8364
5fde6a45
MP
83652016-03-31 Marek Polacek <polacek@redhat.com>
8366
8367 PR c/70297
8368 * c-decl.c (merge_decls): Also set TYPE_ALIGN and TYPE_USER_ALIGN.
8369
4bbf545b
DM
83702016-03-18 David Malcolm <dmalcolm@redhat.com>
8371
8372 PR c/70281
8373 * c-parser.c (c_parser_postfix_expression): Set the source range
8374 for uses of "__builtin_types_compatible_p".
8375
fcc2b74f
JJ
83762016-03-17 Jakub Jelinek <jakub@redhat.com>
8377
8378 PR c/70280
8379 * c-typeck.c (composite_type): Don't count void_list_node
8380 into len, if the list is terminated by void_list_node, start
8381 with void_list_node instead of NULL for newargs. Stop
8382 at void_list_node.
8383
ab4c578f
MP
83842016-03-16 Marek Polacek <polacek@redhat.com>
8385
8386 PR c/70093
8387 * c-typeck.c (build_function_call_vec): Create a TARGET_EXPR for
8388 nested functions returning VM types.
8389
96b3c82d
CP
83902016-03-09 Cesar Philippidis <cesar@codesourcery.com>
8391
8392 * c-parser.c (c_parser_oacc_loop): Update cclauses and clauses
8393 when calling c_finish_omp_clauses.
8394
29b9828f
BS
83952016-03-04 Bernd Schmidt <bschmidt@redhat.com>
8396
8397 PR c/69824
8398 * c-decl.c (get_parm_info): Don't queue implicit function declarations
8399 for later.
8400
7ff6ca38
MP
84012016-03-04 Marek Polacek <polacek@redhat.com>
8402
8403 PR c/69798
8404 * c-parser.c (c_parser_postfix_expression): Call
8405 c_parser_cast_expression rather than c_parser_postfix_expression.
8406
686e2237
JJ
84072016-03-01 Jakub Jelinek <jakub@redhat.com>
8408
8409 PR c/69796
8410 PR c/69974
8411 * c-parser.c (c_parser_translation_unit): Don't change TREE_TYPE
8412 of incomplete decls to error_mark_node.
8413
0b05329b
MP
84142016-02-24 Marek Polacek <polacek@redhat.com>
8415
8416 PR c/69819
8417 * c-decl.c (finish_decl): Don't update the copy of the type of a
8418 different decl type.
8419
067fbd8b
JJ
84202016-02-23 Jakub Jelinek <jakub@redhat.com>
8421
8422 PR objc/69844
8423 * c-parser.c (c_parser_for_statement): Properly handle ObjC classes
8424 in id_kind reclassification.
8425
bf14eba2
JJ
84262016-02-16 Jakub Jelinek <jakub@redhat.com>
8427
8428 PR c/69835
8429 * c-typeck.c (build_binary_op): Revert 2015-09-09 change.
8430
ba539195
JN
84312016-02-16 James Norris <jnorris@codesourcery.com>
8432
8433 PR c/64748
8434 * c-parser.c (c_parser_oacc_data_clause_deviceptr): Allow parms.
8435
16595a1f
BS
84362016-02-12 Bernd Schmidt <bschmidt@redhat.com>
8437
f48dfe98
BS
8438 * c-decl.c (build_null_declspecs): Zero the entire struct.
8439
16595a1f
BS
8440 PR c/69522
8441 * c-parser.c (c_parser_braced_init): New arg outer_obstack. All
8442 callers changed. If nested_p is true, use it to call
8443 finish_implicit_inits.
8444 * c-tree.h (finish_implicit_inits): Declare.
8445 * c-typeck.c (finish_implicit_inits): New function. Move code
8446 from ...
8447 (push_init_level): ... here.
8448 (set_designator, process_init_element): Call finish_implicit_inits.
8449
66756373
JJ
84502016-02-11 Jakub Jelinek <jakub@redhat.com>
8451
8452 PR c/69768
8453 * c-typeck.c (parser_build_binary_op): Strip nops from integer_zerop
8454 arguments for -Waddress warning.
8455
1066e9b5
JJ
84562016-02-04 Jakub Jelinek <jakub@redhat.com>
8457
8458 PR c/69669
8459 * c-decl.c (finish_enum): When honoring mode attribute,
8460 make sure to use proper TYPE_MIN_VALUE and TYPE_MAX_VALUE.
8461
3a5d2ba4
JJ
84622016-01-29 Jakub Jelinek <jakub@redhat.com>
8463
8464 PR debug/69518
8465 * c-decl.c (finish_struct): Clear C_TYPE_INCOMPLETE_VARS in
8466 all type variants, not just TYPE_MAIN_VARIANT.
8467
cbdd8ae0
JJ
84682016-01-27 Jakub Jelinek <jakub@redhat.com>
8469
8470 PR debug/66869
8471 * c-decl.c (c_write_global_declarations_1): Warn with
8472 warn_unused_function if static prototype without definition
8473 is not C_DECL_USED.
8474
fa74a4bc
MP
84752016-01-27 Marek Polacek <polacek@redhat.com>
8476
8477 PR c/68062
8478 * c-typeck.c (build_binary_op) [EQ_EXPR, GE_EXPR]: Promote operand
8479 to unsigned, if needed. Add -Wsign-compare warning.
8480
13f92e8d
JJ
84812016-01-26 Jakub Jelinek <jakub@redhat.com>
8482
8483 PR tree-optimization/69483
8484 * c-parser.c (c_parser_translation_unit): Use FOR_EACH_VEC_ELT.
8485
cd8e73dc 84862016-01-20 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
d25c7690
PK
8487
8488 PR c/24293
8489 * c-tree.h (incomplete_record_decls): Declare.
8490 * c-parser.c (incomplete_record_decls): Define.
8491 (c_parser_translation_unit): Iterate through incomplete_record_decls and
8492 report error if any decl has zero size.
8493 * c-decl.c (finish_decl): Append static decl with incomplete struct/union
8494 or enum type to incomplete_record_decls.
8495
e6d6ec9e
TV
84962016-01-14 Tom de Vries <tom@codesourcery.com>
8497
8498 PR tree-optimization/68773
8499 * c-parser.c (c_parser_oacc_declare, c_parser_omp_declare_target): Don't
8500 set force_output.
8501
00083992
MP
85022016-01-14 Marek Polacek <polacek@redhat.com>
8503
8504 PR c/69262
8505 * c-decl.c (grokdeclarator): Provide more information for invalid
8506 array declarations.
8507
7443cf13
DM
85082016-01-06 David Malcolm <dmalcolm@redhat.com>
8509
8510 * c-parser.c (c_parser_unary_expression): For dereferences, build
8511 a combined location before calling build_indirect_ref, so that
8512 error reports cover the full range, manually updating the c_expr
8513 src_range.
8514
6b131d5b
MP
85152016-01-06 Marek Polacek <polacek@redhat.com>
8516
8517 PR sanitizer/69099
8518 * c-convert.c (convert) [INTEGER_TYPE]: Drop ARG. Don't pass ARG to
8519 ubsan_instrument_float_cast. Fold EXPR. Use NULL_TREE instead of
8520 NULL.
8521
818ab71a
JJ
85222016-01-04 Jakub Jelinek <jakub@redhat.com>
8523
8524 Update copyright years.
8525
2fe0a208
MP
85262016-01-04 Marek Polacek <polacek@redhat.com>
8527
8528 PR c/68908
8529 * c-typeck.c (build_atomic_assign): Improve commentary. Add
8530 optimization to use __atomic_fetch_* built-in if possible.
8531
c7b48c8a
TS
85322015-12-23 Thomas Schwinge <thomas@codesourcery.com>
8533
8534 * c-parser.c (c_parser_oacc_clause_use_device): Merge function
8535 into...
8536 (c_parser_omp_clause_use_device_ptr): ... this function. Adjust
8537 all users.
8538
fda5652f
MP
85392015-12-22 Marek Polacek <polacek@redhat.com>
8540
8541 PR c/69002
8542 * c-typeck.c (build_component_ref): Warn when acessing elements of
8543 atomic structures or unions.
8544
745e411d
DM
85452015-12-21 David Malcolm <dmalcolm@redhat.com>
8546
8547 * c-typeck.c: Include "gcc-rich-location.h".
8548 (build_binary_op): In the two places that call binary_op_error,
8549 create a gcc_rich_location and populate it with the location of
8550 the binary op and its two operands.
8551
94c40e19
DM
85522015-12-16 David Malcolm <dmalcolm@redhat.com>
8553
8554 * c-parser.c (c_parser_statement_after_labels): When calling
8555 c_finish_return, Use the return expression's location if it has
8556 one, falling back to the location of the first token within it.
8557 * c-typeck.c (c_finish_return): When issuing warnings about
8558 the incorrect presence/absence of a return value, issue a note
8559 showing the declaration of the function.
8560
de67c4c3
DM
85612015-12-16 David Malcolm <dmalcolm@redhat.com>
8562
8563 * c-parser.c (struct c_parser): Expand array "tokens_buf" from 2
8564 to 4.
8565 (c_parser_peek_nth_token): New function.
8566 (c_parser_peek_conflict_marker): New function.
8567 (c_parser_error): Detect conflict markers and report them as such.
8568
a10704e1
DM
85692015-12-16 David Malcolm <dmalcolm@redhat.com>
8570
8571 * c-parser.c (c_parser_postfix_expression): Use EXPR_LOC_OR_LOC
8572 to preserve range information for the primary expression
8573 in the call to c_parser_postfix_expression_after_primary.
8574
8062bca6
DM
85752015-12-16 David Malcolm <dmalcolm@redhat.com>
8576
8577 * c-parser.c (c_parser_static_assert_declaration_no_semi): Use the
8578 expression location, falling back on the first token location,
8579 rather than always using the latter.
8580
d06f8b75
MP
85812015-12-16 Marek Polacek <polacek@redhat.com>
8582
8583 PR c/64637
8584 * c-typeck.c (c_process_expr_stmt): Use location of the expression if
8585 available.
8586
2994fb91
MP
85872015-12-15 Marek Polacek <polacek@redhat.com>
8588
8589 PR c/68907
8590 * c-typeck.c (build_atomic_assign): Set TREE_NO_WARNING on an
8591 artificial decl.
8592
a1b93f8d
DM
85932015-12-08 David Malcolm <dmalcolm@redhat.com>
8594
8595 * c-parser.c (c_parser_alignof_expression): Capture location of
8596 closing parenthesis (if any), or of end of unary expression, and
8597 use it to build a src_range for the expression.
8598
46c6e1e2
DM
85992015-12-08 David Malcolm <dmalcolm@redhat.com>
8600
8601 PR c/68757
8602 * c-parser.c (c_parser_get_builtin_args): Add
8603 "out_close_paren_loc" param, and write back to it.
8604 (c_parser_postfix_expression): Capture the closing
8605 parenthesis location for RID_CHOOSE_EXPR,
8606 RID_BUILTIN_CALL_WITH_STATIC_CHAIN, RID_BUILTIN_COMPLEX,
8607 RID_BUILTIN_SHUFFLE and use it to set the source range
8608 for such expressions; within RID_BUILTIN_COMPLEX set
8609 the underlying location.
8610
66189108
MP
86112015-12-07 Marek Polacek <polacek@redhat.com>
8612
8613 PR c/68668
8614 * c-decl.c (grokdeclarator): If ORIG_QUAL_INDIRECT is indirect, use
8615 TREE_TYPE of ORIG_QUAL_TYPE, otherwise decrement ORIG_QUAL_INDIRECT.
8616
f187980b
EB
86172015-12-04 Eric Botcazou <ebotcazou@adacore.com>
8618
8619 * c-tree.h (c_build_va_arg): Adjust prototype.
8620 * c-parser.c (c_parser_postfix_expression): Adjust call to above.
8621 * c-typeck.c (c_build_va_arg): Rename LOC parameter to LOC2, add LOC1
8622 parameter, adjust throughout and issue an error if EXPR is a component
8623 with reverse storage order.
8624
4250754e
JM
86252015-12-02 Jason Merrill <jason@redhat.com>
8626
8627 * c-fold.c (c_disable_warnings, c_enable_warnings, c_fully_fold)
8628 (c_fully_fold_internal, decl_constant_value_for_optimization):
8629 Move from c-common.c.
8630 * c-tree.h: Declare decl_constant_value_for_optimization.
8631 * Make-lang.in (C_AND_OBJC_OBJS): Add c-fold.o.
8632
e9e32ee6
JM
86332015-12-02 Joseph Myers <joseph@codesourcery.com>
8634
8635 PR c/68162
8636 * c-decl.c (grokdeclarator): Set first_non_attr_kind before
8637 following link from declarator to next declarator. Track original
8638 qualified type and pass it to c_build_qualified_type.
8639 * c-typeck.c (c_build_qualified_type): Add arguments
8640 orig_qual_type and orig_qual_indirect.
8641
ff7a55bf
TS
86422015-12-02 Thomas Schwinge <thomas@codesourcery.com>
8643
8644 * c-parser.c (c_parser_omp_clause_name)
8645 (c_parser_oacc_all_clauses): Alphabetical sorting.
8646
657e4e47
JJ
86472015-12-02 Jakub Jelinek <jakub@redhat.com>
8648
8649 PR c/68533
8650 * c-decl.c (get_parm_info): Use b->locus instead of input_location
8651 for diagnostics.
8652
37d5ad46
JB
86532015-12-01 Julian Brown <julian@codesourcery.com>
8654 Cesar Philippidis <cesar@codesourcery.com>
8655 James Norris <James_Norris@mentor.com>
8656
8657 * c-parser.c (c_parser_omp_clause_name): Add use_device support.
8658 (c_parser_oacc_clause_use_device): New function.
8659 (c_parser_oacc_all_clauses): Add use_device support.
8660 (OACC_HOST_DATA_CLAUSE_MASK): New macro.
8661 (c_parser_oacc_host_data): New function.
8662 (c_parser_omp_construct): Add host_data support.
8663 * c-tree.h (c_finish_oacc_host_data): Add prototype.
8664 * c-typeck.c (c_finish_oacc_host_data): New function.
8665 (c_finish_omp_clauses): Add use_device support.
8666
a4850ce9
JH
86672015-11-29 Jan Hubicka <hubicka@ucw.cz>
8668
8669 PR c/67106
8670 * c-decl.c: Set TYPE_PACKED in variants.
8671
b58d3df2
ML
86722015-11-27 Martin Liska <mliska@suse.cz>
8673
8674 PR c++/68312
8675 * c-array-notation.c (fix_builtin_array_notation_fn):
8676 Use release_vec_vec instead of vec::release.
8677 (build_array_notation_expr): Likewise.
8678 (fix_conditional_array_notations_1): Likewise.
8679 (fix_array_notation_expr): Likewise.
8680 (fix_array_notation_call_expr): Likewise.
8681
aec17bfe
JJ
86822015-11-27 Jakub Jelinek <jakub@redhat.com>
8683
8684 PR c/63326
8685 * c-parser.c (c_parser_compound_statement_nostart): If
8686 last_label is true, use pragma_stmt instead of pragma_compound
8687 as second c_parser_pragma argument.
8688 (c_parser_omp_ordered, c_parser_omp_target_update,
8689 c_parser_omp_target_enter_data, c_parser_omp_target_exit_data): Pass
8690 false as second argument to c_parser_skip_to_pragma_eol after
8691 diagnosing standalone directives used in pragma_stmt context.
8692
688c4de0
IV
86932015-11-24 Ilya Verbin <ilya.verbin@intel.com>
8694
8695 * c-parser.c (c_parser_oacc_declare): Replace "ifdef ENABLE_OFFLOADING"
8696 with "if (ENABLE_OFFLOADING)".
8697
cbd03aee
DM
86982015-11-23 David Malcolm <dmalcolm@redhat.com>
8699
8700 PR objc/68438
8701 * c-parser.c (c_parser_postfix_expression): Set up source ranges
8702 for various Objective-C constructs: Class.name syntax,
8703 @selector(), @protocol(), @encode(), and [] message syntax.
8704
a87a86e1
DM
87052015-11-20 David Malcolm <dmalcolm@redhat.com>
8706
8707 PR 62314
8708 * c-typeck.c (should_suggest_deref_p): New function.
8709 (build_component_ref): Special-case POINTER_TYPE when
8710 generating a "not a structure of union" error message, and
8711 suggest a "->" rather than a ".", providing a fix-it hint.
8712
8ece8dfb
DM
87132015-11-19 David Malcolm <dmalcolm@redhat.com>
8714
8715 * c-typeck.c (lookup_field_fuzzy): Move determination of closest
8716 candidate into a new function, find_closest_identifier.
8717
433068cc
MP
87182015-11-19 Marek Polacek <polacek@redhat.com>
8719
8720 PR c/68412
8721 * c-typeck.c (parser_build_binary_op): Properly handle
8722 C_MAYBE_CONST_EXPR before calling warn_tautological_cmp.
8723
bef08b71
DM
87242015-11-17 David Malcolm <dmalcolm@redhat.com>
8725
8726 * c-parser.c (set_c_expr_source_range): Bulletproof both
8727 overloaded implementations against NULL expr->value.
8728 (c_parser_braced_init): Set src_range for "ret" to a sane pair of
8729 values.
8730 (c_parser_unary_expression): Likewise when handling addresses of
8731 labels.
8732 (c_parser_postfix_expression): Likewise for statement expressions,
8733 for __FUNCTION__, __PRETTY_FUNCTION_ and __func__ keywords, for
8734 __builtin_va_arg, and for __builtin_offset_of.
8735 (c_parser_postfix_expression_after_paren_type): Initialize expr's
8736 src_range using the range of the braced initializer.
8737 (c_parser_transaction_expression): Set src_range for "ret" to a
8738 sane pair of values.
8739
fff77217
KY
87402015-11-16 Kirill Yukhin <kirill.yukhin@intel.com>
8741
8742 * c-parser.c (c_finish_omp_declare_simd): Look for
8743 "simd" attribute as well. Update error message.
8744
1d899da2
TS
87452015-11-14 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
8746
8747 * c-parser.c (c_parser_omp_declare_target): Adjust.
8748
e4606348
JJ
87492015-11-14 Jakub Jelinek <jakub@redhat.com>
8750
8751 * c-typeck.c (c_finish_omp_clauses): Don't mark
8752 GOMP_MAP_FIRSTPRIVATE_POINTER decls addressable.
8753
3e636daf
MP
87542015-11-14 Marek Polacek <polacek@redhat.com>
8755
8756 * c-decl.c: Use RECORD_OR_UNION_TYPE_P throughout.
8757 * c-typeck.c: Likewise.
8758
ebedc9a3
DM
87592015-11-13 David Malcolm <dmalcolm@redhat.com>
8760
8761 * c-decl.c (warn_defaults_to): Pass line_table to
8762 rich_location ctor.
8763 * c-errors.c (pedwarn_c99): Likewise.
8764 (pedwarn_c90): Likewise.
8765 * c-parser.c (set_c_expr_source_range): New functions.
8766 (c_token::get_range): New method.
8767 (c_token::get_finish): New method.
8768 (c_parser_expr_no_commas): Call set_c_expr_source_range on the ret
8769 based on the range from the start of the LHS to the end of the
8770 RHS.
8771 (c_parser_conditional_expression): Likewise, based on the range
8772 from the start of the cond.value to the end of exp2.value.
8773 (c_parser_binary_expression): Call set_c_expr_source_range on
8774 the stack values for TRUTH_ANDIF_EXPR and TRUTH_ORIF_EXPR.
8775 (c_parser_cast_expression): Call set_c_expr_source_range on ret
8776 based on the cast_loc through to the end of the expr.
8777 (c_parser_unary_expression): Likewise, based on the
8778 op_loc through to the end of op.
8779 (c_parser_sizeof_expression) Likewise, based on the start of the
8780 sizeof token through to either the closing paren or the end of
8781 expr.
8782 (c_parser_postfix_expression): Likewise, using the token range,
8783 or from the open paren through to the close paren for
8784 parenthesized expressions.
8785 (c_parser_postfix_expression_after_primary): Likewise, for
8786 various kinds of expression.
8787 * c-tree.h (struct c_expr): Add field "src_range".
8788 (c_expr::get_start): New method.
8789 (c_expr::get_finish): New method.
8790 (set_c_expr_source_range): New decls.
8791 * c-typeck.c (parser_build_unary_op): Call set_c_expr_source_range
8792 on ret for prefix unary ops.
8793 (parser_build_binary_op): Likewise, running from the start of
8794 arg1.value through to the end of arg2.value.
8795
ec8b536f
MP
87962015-11-13 Marek Polacek <polacek@redhat.com>
8797
8798 PR c/68320
8799 * c-parser.c (c_parser_for_statement): Treat unknown tokens as IDs.
8800
277fe616
DM
88012015-11-13 David Malcolm <dmalcolm@redhat.com>
8802
8803 * c-typeck.c: Include spellcheck.h.
8804 (lookup_field_fuzzy_find_candidates): New function.
8805 (lookup_field_fuzzy): New function.
8806 (build_component_ref): If the field was not found, try using
8807 lookup_field_fuzzy and potentially offer a suggestion.
8808
6e232ba4
JN
88092015-11-12 James Norris <jnorris@codesourcery.com>
8810 Joseph Myers <joseph@codesourcery.com>
8811
8812 * c-parser.c (c_parser_pragma): Handle PRAGMA_OACC_DECLARE.
8813 (c_parser_omp_clause_name): Handle 'device_resident' clause.
8814 (c_parser_oacc_data_clause): Handle PRAGMA_OACC_CLAUSE_DEVICE_RESIDENT
8815 and PRAGMA_OMP_CLAUSE_LINK.
8816 (c_parser_oacc_all_clauses): Handle PRAGMA_OACC_CLAUSE_DEVICE_RESIDENT
8817 and PRAGMA_OACC_CLAUSE_LINK.
8818 (OACC_DECLARE_CLAUSE_MASK): New definition.
8819 (c_parser_oacc_declare): New function.
8820
9be4f715
MP
88212015-11-12 Marek Polacek <polacek@redhat.com>
8822
8823 PR c/67784
8824 * c-parser.c (c_parser_for_statement): Reclassify the token in
8825 a correct scope.
8826
e78bede6
MP
88272015-11-11 Marek Polacek <polacek@redhat.com>
8828
8829 PR c/68107
8830 PR c++/68266
8831 * c-decl.c (grokdeclarator): Call valid_array_size_p. Remove code
8832 checking the size of an array.
8833
69f293c9
AM
88342015-11-11 Andrew MacLeod <amacleod@redhat.com>
8835
8836 * c-array-notation.c: Remove unused header files.
8837 * c-aux-info.c: Likewise.
8838 * c-convert.c: Likewise.
8839 * c-decl.c: Likewise.
8840 * c-errors.c: Likewise.
8841 * c-lang.c: Likewise.
8842 * c-objc-common.c: Likewise.
8843 * c-parser.c: Likewise.
8844 * c-typeck.c: Likewise.
8845 * gccspec.c: Likewise.
8846
3a40d81d
NS
88472015-11-09 Thomas Schwinge <thomas@codesourcery.com>
8848 Cesar Philippidis <cesar@codesourcery.com>
8849 James Norris <jnorris@codesourcery.com>
8850 Julian Brown <julian@codesourcery.com>
8851 Nathan Sidwell <nathan@codesourcery.com>
8852
3a40d81d
NS
8853 * c-parser.c (c_parser_declaration_or_fndef): Add OpenACC
8854 routine arg.
8855 (c_parser_declaration_or_fndef): Call c_finish_oacc_routine.
8856 (c_parser_pragma): Parse 'acc routine'.
8857 (OACC_ROUTINE_CLAUSE_MARK): Define.
8858 (c_parser_oacc_routine, (c_finish_oacc_routine): New.
8859
fc402eec
AA
88602015-11-09 Andreas Arnez <arnez@linux.vnet.ibm.com>
8861
8862 PR debug/67192
8863 * c-typeck.c (c_finish_loop): For unconditional loops, set the
8864 location of the backward-goto to the start of the loop body.
8865
f6b0b3db
AA
88662015-11-09 Andreas Arnez <arnez@linux.vnet.ibm.com>
8867
8868 PR debug/67192
8869 * c-parser.c (c_parser_while_statement): Finish the loop before
8870 parsing ahead for misleading indentation.
8871 (c_parser_for_statement): Likewise.
8872
ee45a32d
EB
88732015-11-08 Eric Botcazou <ebotcazou@adacore.com>
8874
8875 * c-decl.c (finish_struct): If the structure has reverse storage
8876 order, rewrite the type of array fields with scalar component. Call
8877 maybe_apply_pragma_scalar_storage_order on entry.
8878 * c-typeck.c (build_unary_op) <ADDR_EXPR>: Remove left-overs. Issue
8879 errors on bit-fields and reverse SSO here and not...
8880 (c_mark_addressable): ...here.
8881 (output_init_element): Adjust call to initializer_constant_valid_p.
8882 (c_build_qualified_type): Propagate TYPE_REVERSE_STORAGE_ORDER.
8883
8a645150
DM
88842015-11-06 David Malcolm <dmalcolm@redhat.com>
8885
8886 * c-decl.c (warn_defaults_to): Update for change in signature
8887 of diagnostic_set_info.
8888 * c-errors.c (pedwarn_c99): Likewise.
8889 (pedwarn_c90): Likewise.
8890 * c-objc-common.c (c_tree_printer): Update for new "caret_p" param
8891 for textinfo::set_location.
8892
7a5e4956
CP
88932015-11-05 Cesar Philippidis <cesar@codesourcery.com>
8894 Thomas Schwinge <thomas@codesourcery.com>
8895 James Norris <jnorris@codesourcery.com>
8896
8897 * c-parser.c (c_parser_omp_clause_name): Add support for
8898 PRAGMA_OACC_CLAUSE_INDEPENDENT and PRAGMA_OACC_CLAUSE_TILE.
8899 (c_parser_omp_clause_default): Add is_oacc argument. Handle
8900 default(none) in OpenACC.
8901 (c_parser_oacc_shape_clause): Allow pointer variables as gang static
8902 arguments.
8903 (c_parser_oacc_clause_tile): New function.
8904 (c_parser_oacc_all_clauses): Add support for OMP_CLAUSE_DEFAULT,
8905 OMP_CLAUSE_INDEPENDENT and OMP_CLAUSE_TILE.
8906 (OACC_LOOP_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_{PRIVATE,INDEPENDENT,
8907 TILE}.
8908 (OACC_KERNELS_MASK): Add PRAGMA_OACC_CLAUSE_DEFAULT.
8909 (OACC_PARALLEL_MASK): Add PRAGMA_OACC_CLAUSE_{DEFAULT,PRIVATE,
8910 FIRSTPRIVATE}.
8911 (c_parser_omp_all_clauses): Update call to c_parser_omp_clause_default.
8912 (c_parser_oacc_update): Update the error message for missing clauses.
8913 * c-typeck.c (c_finish_omp_clauses): Add support for OMP_CLAUSE_TILE
8914 and OMP_CLAUSE_INDEPENDENT.
8915
bfcfbfa0
MP
89162015-11-05 Marek Polacek <polacek@redhat.com>
8917
8918 PR c/68090
8919 * c-parser.c (c_parser_postfix_expression_after_paren_type): Don't
8920 deal with pre-evaluation on invalid types.
8921
e01d41e5
JJ
89222015-11-05 Jakub Jelinek <jakub@redhat.com>
8923 Ilya Verbin <ilya.verbin@intel.com>
8924
8925 * c-parser.c: Include context.h and gimple-expr.h.
8926 (c_parser_omp_clause_schedule): Parse schedule modifiers, diagnose
8927 monotonic together with nonmonotonic.
8928 (c_parser_omp_for_loop): Call c_omp_check_loop_iv. Call add_stmt here.
8929 (OMP_DISTRIBUTE_CLAUSE_MASK): Add lastprivate clause.
8930 (c_parser_omp_target_data, c_parser_omp_target_enter_data,
8931 c_parser_omp_target_exit_data): Allow GOMP_MAP_ALWAYS_POINTER.
8932 (c_parser_omp_target): Likewise. Evaluate num_teams and thread_limit
8933 expressions on combined target teams before the target.
8934 (c_parser_omp_declare_target): If decl has "omp declare target" or
8935 "omp declare target link" attribute, and cgraph or varpool node already
8936 exists, then set corresponding flags. Call c_finish_omp_clauses
8937 in the parenthesized extended-list syntax case.
8938 * c-decl.c (c_decl_attributes): Don't diagnose block scope vars inside
8939 declare target.
8940 * c-typeck.c (handle_omp_array_sections_1): Allow non-zero low-bound
8941 on OMP_CLAUSE_REDUCTION array sections.
8942 (handle_omp_array_sections): Encode low-bound into the MEM_REF, either
8943 into the constant offset, or for variable low-bound using
8944 POINTER_PLUS_EXPR. For structure element based array sections use
8945 GOMP_MAP_ALWAYS_POINTER instead of GOMP_MAP_FIRSTPRIVATE_POINTER.
8946 (c_finish_omp_clauses): Drop generic_field_head, structure
8947 elements are now always mapped even as array section bases,
8948 diagnose same var in data sharing and mapping clauses. Diagnose if
8949 linear step on declare simd is neither a constant nor a uniform
8950 parameter. Look through POINTER_PLUS_EXPR for array section
8951 reductions. Diagnose the same var or function appearing multiple
8952 times on the same directive. Fix up wording for the to clause if t
8953 is neither a FUNCTION_DECL nor a VAR_DECL. Diagnose nonmonotonic
8954 modifier on kinds other than dynamic or guided or nonmonotonic
8955 modifier together with ordered clause.
8956
4bf9e5a8
TS
89572015-11-03 Thomas Schwinge <thomas@codesourcery.com>
8958 Chung-Lin Tang <cltang@codesourcery.com>
8959
8960 * c-parser.c (c_parser_omp_construct): Handle PRAGMA_OACC_ATOMIC.
8961
2adfab87
AM
89622015-10-29 Andrew MacLeod <amacleod@redhat.com>
8963
8964 * c-array-notation.c: Reorder #include's and remove duplicates.
8965 * c-aux-info.c: Likewise.
8966 * c-convert.c: Likewise.
8967 * c-decl.c: Likewise.
8968 * c-errors.c: Likewise.
8969 * c-lang.c: Likewise.
8970 * c-objc-common.c: Likewise.
8971 * c-parser.c: Likewise.
8972 * c-typeck.c: Likewise.
8973
e922069e
JW
89742015-10-26 Jim Wilson <jim.wilson@linaro.org>
8975
8976 PR debug/66068
8977 * c-typeck.c (c_build_qualified_type): Clear C_TYPE_INCOMPLETE_VARS
8978 after calling build_qualified_type.
8979
765dd391
CP
89802015-10-27 Cesar Philippidis <cesar@codesourcery.com>
8981 Thomas Schwinge <thomas@codesourcery.com>
8982 James Norris <jnorris@codesourcery.com>
8983 Joseph Myers <joseph@codesourcery.com>
8984 Julian Brown <julian@codesourcery.com>
8985 Bernd Schmidt <bschmidt@redhat.com>
8986
8987 * c-parser.c (c_parser_oacc_shape_clause): New.
8988 (c_parser_oacc_simple_clause): New.
8989 (c_parser_oacc_all_clauses): Add auto, gang, seq, vector, worker.
8990 (OACC_LOOP_CLAUSE_MASK): Add gang, worker, vector, auto, seq.
8991
88bae6f4
TS
89922015-10-27 Thomas Schwinge <thomas@codesourcery.com>
8993 James Norris <jnorris@codesourcery.com>
8994 Cesar Philippidis <cesar@codesourcery.com>
8995
8996 PR c/64765
8997 PR c/64880
8998 * c-parser.c (c_parser_oacc_loop): Add mask, cclauses formal
8999 parameters, and handle these. Adjust all users.
9000 (c_parser_oacc_kernels, c_parser_oacc_parallel): Merge functions
9001 into...
9002 (c_parser_oacc_kernels_parallel): ... this new function. Adjust
9003 all users.
9004 * c-tree.h (c_finish_oacc_parallel, c_finish_oacc_kernels): Don't
9005 declare functions.
9006 (c_finish_omp_construct): Declare function.
9007 * c-typeck.c (c_finish_oacc_parallel, c_finish_oacc_kernels):
9008 Merge functions into...
9009 (c_finish_omp_construct): ... this new function.
9010
a8fc2579
RB
90112015-10-22 Richard Biener <rguenther@suse.de>
9012
9013 * c-typeck.c (c_finish_omp_clauses): Properly convert operands
9014 before folding a MINUS_EXPR.
9015
e9122ef6
MP
90162015-10-21 Marek Polacek <polacek@redhat.com>
9017
9018 PR c/68024
9019 * c-decl.c (start_function): Warn about vararg functions without
9020 a prototype.
9021
9f47c7e5
IE
90222015-10-21 Ilya Enkovich <enkovich.gnu@gmail.com>
9023
9024 * c-typeck.c (build_conditional_expr): Use boolean vector
9025 type for vector comparison.
9026 (build_vec_cmp): New.
9027 (build_binary_op): Use build_vec_cmp for comparison.
9028
fa60eeb9
MP
90292015-10-20 Marek Polacek <polacek@redhat.com>
9030
9031 * c-parser.c (is_cilkplus_vector_p): Don't define here.
9032
2c7020eb
MP
90332015-10-20 Marek Polacek <polacek@redhat.com>
9034
9035 PR c/67964
9036 * c-parser.c (c_parser_attributes): Break out of the loop if the
9037 token after an attribute isn't a comma.
9038
d9a6bd32
JJ
90392015-10-13 Jakub Jelinek <jakub@redhat.com>
9040 Aldy Hernandez <aldyh@redhat.com>
9041
9042 * c-parser.c (c_parser_pragma): Handle PRAGMA_OMP_ORDERED here.
9043 (c_parser_omp_clause_name): Handle OpenMP 4.5 clauses.
9044 (c_parser_omp_variable_list): Handle structure elements for
9045 map, to and from clauses. Handle array sections in reduction
9046 clause. Formatting fixes.
9047 (c_parser_omp_clause_if): Add IS_OMP argument, handle parsing of
9048 if clause modifiers.
9049 (c_parser_omp_clause_num_tasks, c_parser_omp_clause_grainsize,
9050 c_parser_omp_clause_priority, c_parser_omp_clause_hint,
9051 c_parser_omp_clause_defaultmap, c_parser_omp_clause_use_device_ptr,
9052 c_parser_omp_clause_is_device_ptr): New functions.
9053 (c_parser_omp_clause_ordered): Parse optional parameter.
9054 (c_parser_omp_clause_reduction): Handle array reductions.
9055 (c_parser_omp_clause_schedule): Parse optional simd modifier.
9056 (c_parser_omp_clause_nogroup, c_parser_omp_clause_orderedkind): New
9057 functions.
9058 (c_parser_omp_clause_linear): Parse linear clause modifiers.
9059 (c_parser_omp_clause_depend_sink): New function.
9060 (c_parser_omp_clause_depend): Parse source/sink depend kinds.
9061 (c_parser_omp_clause_map): Parse release/delete map kinds and
9062 optional always modifier.
9063 (c_parser_oacc_all_clauses): Adjust c_parser_omp_clause_if
9064 and c_finish_omp_clauses callers.
9065 (c_parser_omp_all_clauses): Likewise. Parse OpenMP 4.5 clauses.
9066 Parse "to" as OMP_CLAUSE_TO_DECLARE if on declare target directive.
9067 (c_parser_oacc_cache): Adjust c_finish_omp_clauses caller.
9068 (OMP_CRITICAL_CLAUSE_MASK): Define.
9069 (c_parser_omp_critical): Parse critical clauses.
9070 (c_parser_omp_for_loop): Handle doacross loops, adjust
9071 c_finish_omp_for and c_finish_omp_clauses callers.
9072 (OMP_SIMD_CLAUSE_MASK): Add simdlen clause.
9073 (c_parser_omp_simd): Allow ordered clause if it has no parameter.
9074 (OMP_FOR_CLAUSE_MASK): Add linear clause.
9075 (c_parser_omp_for): Disallow ordered clause when combined with
9076 distribute. Disallow linear clause when combined with distribute
9077 and not combined with simd.
9078 (OMP_ORDERED_CLAUSE_MASK, OMP_ORDERED_DEPEND_CLAUSE_MASK): Define.
9079 (c_parser_omp_ordered): Add CONTEXT argument, remove LOC argument,
9080 parse clauses and if depend clause is found, don't parse a body.
9081 (c_parser_omp_parallel): Disallow copyin clause on target parallel.
9082 Allow target parallel without for after it.
9083 (OMP_TASK_CLAUSE_MASK): Add priority clause.
9084 (OMP_TARGET_DATA_CLAUSE_MASK): Add use_device_ptr clause.
9085 (c_parser_omp_target_data): Diagnose no map clauses or clauses with
9086 invalid kinds.
9087 (OMP_TARGET_UPDATE_CLAUSE_MASK): Add depend and nowait clauses.
9088 (OMP_TARGET_ENTER_DATA_CLAUSE_MASK,
9089 OMP_TARGET_EXIT_DATA_CLAUSE_MASK): Define.
9090 (c_parser_omp_target_enter_data, c_parser_omp_target_exit_data): New
9091 functions.
9092 (OMP_TARGET_CLAUSE_MASK): Add depend, nowait, private, firstprivate,
9093 defaultmap and is_device_ptr clauses.
9094 (c_parser_omp_target): Parse target parallel and target simd. Set
9095 OMP_TARGET_COMBINED on combined constructs. Parse target enter data
9096 and target exit data. Diagnose invalid map kinds.
9097 (OMP_DECLARE_TARGET_CLAUSE_MASK): Define.
9098 (c_parser_omp_declare_target): Parse OpenMP 4.5 forms of this
9099 construct.
9100 (c_parser_omp_declare_reduction): Use STRIP_NOPS when checking for
9101 &omp_priv.
9102 (OMP_TASKLOOP_CLAUSE_MASK): Define.
9103 (c_parser_omp_taskloop): New function.
9104 (c_parser_omp_construct): Don't handle PRAGMA_OMP_ORDERED here,
9105 handle PRAGMA_OMP_TASKLOOP.
9106 (c_parser_cilk_for): Adjust c_finish_omp_clauses callers.
9107 * c-tree.h (c_finish_omp_clauses): Add two new arguments.
9108 * c-typeck.c (handle_omp_array_sections_1): Fix comment typo.
9109 Add IS_OMP argument, handle structure element bases, diagnose
9110 bitfields, pass IS_OMP recursively, diagnose known zero length
9111 array sections in depend clauses, handle array sections in reduction
9112 clause, diagnose negative length even for pointers.
9113 (handle_omp_array_sections): Add IS_OMP argument, use auto_vec for
9114 types, pass IS_OMP down to handle_omp_array_sections_1, handle
9115 array sections in reduction clause, set
9116 OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION if map could be zero
9117 length array section, use GOMP_MAP_FIRSTPRIVATE_POINTER for IS_OMP.
9118 (c_finish_omp_clauses): Add IS_OMP and DECLARE_SIMD arguments.
9119 Handle new OpenMP 4.5 clauses and new restrictions for the old ones.
9120
21ba0cea
MP
91212015-10-06 Marek Polacek <polacek@redhat.com>
9122
9123 * c-parser.c (c_parser_statement_after_labels): Use
9124 protected_set_expr_location.
9125 (c_parser_omp_clause_num_gangs): Likewise.
9126 (c_parser_omp_clause_num_threads): Likewise.
9127 (c_parser_omp_clause_num_workers): Likewise.
9128 (c_parser_omp_clause_vector_length): Likewise.
9129 (c_parser_omp_clause_num_teams): Likewise.
9130 (c_parser_omp_clause_thread_limit): Likewise.
9131 * c-typeck.c (build_c_cast): Likewise.
9132 (c_cast_expr): Likewise.
9133
624d31fe
RS
91342015-10-05 Richard Sandiford <richard.sandiford@arm.com>
9135
9136 * c-typeck.c (c_tree_equal): Use real_equal instead of
9137 REAL_VALUES_EQUAL.
9138
b8fd7909
JM
91392015-10-04 Jason Merrill <jason@redhat.com>
9140
9141 * c-parser.c (c_lex_one_token): Handle @synchronized.
9142 * c-decl.c (match_builtin_function_types): A declaration of a built-in
9143 can change whether the function is transaction_safe.
9144
1c7485af
MP
91452015-10-02 Marek Polacek <polacek@redhat.com>
9146
9147 PR c/67730
9148 * c-typeck.c (convert_for_assignment): Use the expansion point
9149 location throughout.
9150
3e3b8d63
MP
91512015-10-02 Marek Polacek <polacek@redhat.com>
9152
9153 PR c/64249
9154 * c-parser.c (c_parser_statement_after_labels): Add CHAIN parameter
9155 and pass it down to c_parser_if_statement.
9156 (c_parser_else_body): Add CHAIN parameter and pass it down to
9157 c_parser_statement_after_labels.
9158 (c_parser_if_statement): Add CHAIN parameter. Add code to warn about
9159 duplicated if-else-if conditions.
9160
aabef2de
MP
91612015-10-01 Marek Polacek <polacek@redhat.com>
9162
9163 * c-typeck.c (convert_for_assignment): Improve commentary.
9164
de8ddd5f
MP
91652015-09-30 Marek Polacek <polacek@redhat.com>
9166
9167 PR c/67730
9168 * c-typeck.c (c_finish_return): Use the expansion point location for
9169 certain "return with value" warnings.
9170
c4914de6
MLI
91712015-09-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
9172
9173 * c-parser.c (pragma_lex): Add loc argument.
9174
0e36f5c7
MP
91752015-09-15 Marek Polacek <polacek@redhat.com>
9176
9177 PR c/67580
9178 * c-decl.c (tag_exists_p): New function.
9179 * c-parser.c (c_parser_declaration_or_fndef): Give a hint when
9180 struct/union/enum keywords are missing.
9181 * c-tree.h (tag_exists_p): Declare.
9182
2f3bb934
MP
91832015-09-15 Marek Polacek <polacek@redhat.com>
9184
9185 * c-decl.c (lookup_label): Return NULL_TREE instead of 0.
9186 (lookup_tag): Change the type of THISLEVEL_ONLY to bool.
9187 Return NULL_TREE instead of 0.
9188 (lookup_name): Return NULL_TREE instead of 0.
9189 (lookup_name_in_scope): Likewise.
9190 (shadow_tag_warned): Use true instead of 1 and NULL_TREE instead of 0.
9191 (parser_xref_tag): Use false instead of 0.
9192 (start_struct): Use true instead of 1.
9193 (start_enum): Use true instead of 1 and NULL_TREE instead of 0.
9194
aa256c4a
MP
91952015-09-14 Marek Polacek <polacek@redhat.com>
9196
9197 * c-typeck.c (set_nonincremental_init_from_string): Use
9198 HOST_WIDE_INT_M1U when shifting a negative value.
9199
dbb68221
MW
92002015-09-09 Mark Wielaard <mjw@redhat.com>
9201
9202 * c-typeck.c (build_binary_op): Check and warn when nonnull arg
9203 parm against NULL.
9204
a8a098ac
JJ
92052015-09-10 Jakub Jelinek <jakub@redhat.com>
9206
9207 PR c/67502
9208 * c-parser.c (c_parser_omp_for_loop): Emit DECL_EXPR stmts
9209 into OMP_FOR_PRE_BODY rather than before the loop.
9210
f4b189d5
JJ
92112015-09-09 Jakub Jelinek <jakub@redhat.com>
9212
0bb99c11
JJ
9213 PR c/67501
9214 * c-parser.c (c_parser_oacc_all_clauses,
9215 c_parser_omp_all_clauses): Remove invalid clause from
9216 list of clauses even if parser->error is set.
9217
fce5e5e3
JJ
9218 PR c/67500
9219 * c-parser.c (c_parser_omp_clause_aligned,
9220 c_parser_omp_clause_safelen, c_parser_omp_clause_simdlen): Fix up
9221 test for errors.
9222 * c-decl.c (temp_pop_parm_decls): Allow b->decl equal to
9223 error_mark_node.
9224
f4b189d5
JJ
9225 PR c/67495
9226 * c-parser.c (c_parser_omp_atomic): Use c_parser_cast_expression
9227 instead of c_parser_unary_expression. If the result is !lvalue_p,
9228 wrap the result of c_fully_fold into NON_LVALUE_EXPR.
9229
b2aaf235
MP
92302015-09-04 Marek Polacek <polacek@redhat.com>
9231
9232 PR sanitizer/67279
9233 * c-typeck.c (build_binary_op): Don't instrument static initializers.
9234
1807ffc1
MS
92352015-09-03 Martin Sebor <msebor@redhat.com>
9236
9237 PR c/66516
8b652e65
JJ
9238 * c-typeck.c (convert_arguments, parser_build_unary_op,
9239 build_conditional_expr, c_cast_expr, convert_for_assignment,
9240 build_binary_op, _objc_common_truthvalue_conversion): Call
1807ffc1
MS
9241 reject_gcc_builtin.
9242 (c_decl_implicit): Define.
9243
d04ff417
MP
92442015-09-02 Marek Polacek <polacek@redhat.com>
9245
9246 PR c/67432
9247 * c-parser.c (c_parser_enum_specifier): Give a better error for
9248 an empty enum.
9249
a79683d5
TS
92502015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org>
9251
9252 * c-aux-info.c, c-parser.c, c-tree.h: Remove useless typedefs.
9253
191a6b94
MP
92542015-08-12 Marek Polacek <polacek@redhat.com>
9255
9256 * c-decl.c (grokdeclarator): Call error_at instead of error and pass
9257 LOC to it.
9258
420a9d9b
MP
92592015-08-03 Marek Polacek <polacek@redhat.com>
9260
9261 PR c/67088
9262 * c-decl.c (check_bitfield_type_and_width): Add location parameter.
9263 Use it.
9264 (grokdeclarator): Pass LOC down to check_bitfield_type_and_width.
9265
992118a1
PP
92662015-08-02 Patrick Palka <ppalka@gcc.gnu.org>
9267
9268 * c-parser.c (c_parser_if_body): Take token_indent_info
9269 argument. Call warn_for_misleading_indentation even when the
9270 body is a semicolon. Extract token_indent_infos corresponding
9271 to the guard, body and next tokens. Adjust call to
9272 warn_for_misleading_indentation accordingly.
9273 (c_parser_else_body): Likewise.
9274 (c_parser_if_statement): Likewise.
9275 (c_parser_while_statement): Likewise.
9276 (c_parser_for_statement): Likewise.
9277
46308474
LFSM
92782015-07-28 Luis Felipe Strano Moraes <luis.strano@gmail.com>
9279 Manuel López-Ibáñez <manu@gcc.gnu.org>
9280
9281 * c-decl.c (get_parm_info): Remove static var. Update warning
9282 message.
9283
05b28fd6
MP
92842015-07-27 Marek Polacek <polacek@redhat.com>
9285
9286 PR c++/66555
9287 PR c/54979
9288 * c-typeck.c (parser_build_binary_op): Call warn_tautological_cmp.
9289
451b5e48
MP
92902015-07-20 Marek Polacek <polacek@redhat.com>
9291
9292 PR c++/55095
9293 * c-typeck.c (digest_init): Pass OPT_Wpedantic to pedwarn_init.
9294 (build_binary_op): Warn about left shift overflows.
9295
1916bcb5
AM
92962015-07-09 Andrew MacLeod <amacleod@redhat.com>
9297
9298 * c-array-notation.c: Adjust includes for flags.h changes.
9299 * c-objc-common.c: Likewise.
9300
c7131fb2
AM
93012015-07-07 Andrew MacLeod <amacleod@redhat.com>
9302
9303 * c-array-notation.c: Adjust includes.
9304 * c-aux-info.c: Likewise.
9305 * c-convert.c: Likewise.
9306 * c-decl.c: Likewise.
9307 * c-errors.c: Likewise.
9308 * c-lang.c: Likewise.
9309 * c-objc-common.c: Likewise.
9310 * c-parser.c: Likewise.
9311 * c-typeck.c: Likewise.
9312
da2e71c9
MLI
93132015-06-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
9314
9315 PR fortran/66605
9316 * c-decl.c (finish_function): Call do_warn_unused_parameter.
9317
b155cfd9
MP
93182015-06-29 Marek Polacek <polacek@redhat.com>
9319
9320 PR c/66322
9321 * c-typeck.c (struct c_switch): Add BOOL_COND_P and OUTSIDE_RANGE_P.
9322 (c_start_case): Set BOOL_COND_P and OUTSIDE_RANGE_P. Don't warn
9323 about -Wswitch-bool here.
9324 (do_case): Update c_add_case_label call.
9325 (c_finish_case): Update c_do_switch_warnings call.
9326
31521951
MP
93272015-06-27 Marek Polacek <polacek@redhat.com>
9328
9329 * c-typeck.c: Use VECTOR_TYPE_P throughout.
9330
22d03525
MP
93312015-06-26 Marek Polacek <polacek@redhat.com>
9332
9333 * c-array-notation.c (fix_builtin_array_notation_fn): Use
9334 INDIRECT_REF_P.
9335 * c-typeck.c (array_to_pointer_conversion): Likewise.
9336 (build_unary_op): Likewise.
9337 (c_finish_return): Likewise.
9338
f0889939
AM
93392015-06-25 Andrew MacLeod <amacleod@redhat.com>
9340
9341 * c-decl.c: Remove ipa-ref.h and plugin-api.h from include list.
9342 * c-parser.c: Likewise.
9343
8d67ee55
RS
93442015-06-25 Richard Sandiford <richard.sandiford@arm.com>
9345
9346 * c-decl.c (detect_field_duplicates_hash): Use nofree_ptr_hash
9347 instead of pointer_hash.
9348 (detect_field_duplicates): Likewise.
9349
0ae9bd27
MP
93502015-06-25 Marek Polacek <polacek@redhat.com>
9351
9352 * c-array-notation.c: Use VAR_P throughout.
9353 * c-decl.c: Likewise.
9354 * c-objc-common.c: Likewise.
9355 * c-parser.c: Likewise.
9356 * c-typeck.c: Likewise.
9357
62f9079a
MP
93582015-06-25 Marek Polacek <polacek@redhat.com>
9359
9360 * c-decl.c: Use is_global_var throughout.
9361 * c-parser.c: Likewise.
9362 * c-typeck.c: Likewise.
9363
abb226c9
AM
93642015-06-17 Andrew MacLeod <amacleod@redhat.com>
9365
9366 * c-array-notation.c: Do not include input.h, line-map.h or is-a.h.
9367 * c-aux-info.c: Likewise.
9368 * c-convert.c: Likewise.
9369 * c-decl.c: Likewise.
9370 * c-errors.c: Likewise.
9371 * c-lang.c: Likewise.
9372 * c-objc-common.c: Likewise.
9373 * c-parser.c: Likewise.
9374 * c-typeck.c: Likewise.
9375
8cbababc
JH
93762015-06-11 Jan Hubicka <hubicka@ucw.cz>
9377
9378 PR middle-end/66325
9379 * c-decl.c (start_enum): Set TYPE_PACKED consistently among type
9380 variants.
9381
a0349665
PMR
93822015-06-11 Pierre-Marie de Rodat <derodat@adacore.com>
9383
9384 * c-decl.c (pop_scope): Register the main translation unit
9385 through the new debug hook.
9386
13fdf2e2
AM
93872015-06-08 Andrew MacLeod <amacleod@redhat.com>
9388
9389 * c-array-notation.c : Adjust include files.
9390 * c-aux-info.c : Likewise.
9391 * c-convert.c : Likewise.
9392 * c-decl.c : Likewise.
9393 * c-errors.c : Likewise.
9394 * c-lang.c : Likewise.
9395 * c-lang.h : Likewise.
9396 * c-objc-common.c : Likewise.
9397 * c-parser.c : Likewise.
9398 * c-typeck.c : Likewise.
9399
d7438551
AH
94002015-06-05 Aldy Hernandez <aldyh@redhat.com>
9401
9402 * c-decl.c (finish_struct): Save C_TYPE_INCOMPLETE_VARS and
9403 immediately clobber it.
9404 (c_write_global_declarations_1): Remove call to
9405 check_global_declaration_1.
9406 (c_write_global_declarations_2): Remove.
9407 (c_write_final_cleanups): Rename from c_write_global_declarations.
9408 Remove call to finalize_compilation_unit.
9409 Remove calls to debugging hooks.
9410 * c-objc-common.c: Adjust comment for c_warn_unused_global_decl.
9411 * c-objc-common.h: Remove LANG_HOOKS_WRITE_GLOBALS.
9412 * c-tree.h: Remove c_write_global_declarations.
9413
ecb9f223
AM
94142015-06-04 Andrew MacLeod <amacleod@redhat.com>
9415
9416 * c-array-notation.c: Adjust includes for restructured coretypes.h.
9417 * c-aux-info.c: Likewise.
9418 * c-convert.c: Likewise.
9419 * c-decl.c: Likewise.
9420 * c-errors.c: Likewise.
9421 * c-lang.c: Likewise.
9422 * c-objc-common.c: Likewise.
9423 * c-parser.c: Likewise.
9424 * c-typeck.c: Likewise.
9425
9482b620
MP
94262015-06-04 Marek Polacek <polacek@redhat.com>
9427
9428 PR c/66341
9429 * c-typeck.c (build_c_cast): Wrap VALUE into NON_LVALUE_EXPR if
9430 it is a lvalue.
9431
bc51ace3
PK
94322015-06-03 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
9433
9434 * c-decl.c (warn_cxx_compat_finish_struct): New parameters code, record_loc.
9435 Warn for empty struct.
9436 (finish_struct): Pass TREE_CODE(t) and loc to warn_cxx_compat_finish_struct.
9437
ea5b45b6
AT
94382015-06-02 Andres Tiraboschi <andres.tiraboschi@tallertechnologies.com>
9439
9440 * c-decl.c (start_function): Call plugin before parsing.
9441 (finish_function): Call plugin after parsing.
9442
c2d47482
PK
94432015-06-02 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
9444
9445 PR c/49551
9446 * c-decl.c (merge_decls): Merge DECL_COMMON.
9447
a95492ab
JW
94482015-05-22 Jim Wilson <jim.wilson@linaro.org>
9449
9450 * Make-lang.in (check_gcc_pallelize): Define.
9451
fd5c817a
MP
94522015-05-22 Marek Polacek <polacek@redhat.com>
9453
9454 PR c/47043
9455 * c-parser.c (c_parser_enum_specifier): Parse and apply enumerator
9456 attributes.
9457
c7b70a3c
MP
94582015-05-21 Marek Polacek <polacek@redhat.com>
9459
9460 * c-typeck.c (inform_declaration): Use DECL_IS_BUILTIN instead of
9461 DECL_BUILT_IN.
9462
21b634ae
MP
94632015-05-20 Marek Polacek <polacek@redhat.com>
9464
9465 * c-decl.c: Use VAR_OR_FUNCTION_DECL_P throughout.
9466 * c-typeck.c: Likewise.
9467
296a8c2f
MP
94682015-05-19 Marek Polacek <polacek@redhat.com>
9469
9470 * c-typeck.c (start_init): Use AGGREGATE_TYPE_P.
9471
41b37d5e
JJ
94722015-05-19 Jakub Jelinek <jakub@redhat.com>
9473
9474 PR middle-end/66199
9475 * c-parser.c (c_parser_omp_for_loop): Don't add
9476 OMP_CLAUSE_SHARED to OMP_PARALLEL_CLAUSES when moving
9477 OMP_CLAUSE_LASTPRIVATE clause to OMP_FOR_CLAUSES.
9478 (c_parser_omp_teams): Set OMP_TEAMS_COMBINED for combined
9479 constructs.
9480
fab27f52
MM
94812015-05-19 Mikhail Maltsev <maltsevm@gmail.com>
9482
9483 * c-typeck.c (build_array_ref): Use std::swap instead of explicit
296a8c2f 9484 swaps.
fab27f52 9485
40de31cf
MLI
94862015-05-16 Manuel López-Ibáñez <manu@gcc.gnu.org>
9487
9488 PR fortran/44054
9489 * c-objc-common.c (c_tree_printer): Replace locus pointer with
9490 accessor function.
9491
3aa3c9fc
MP
94922015-05-14 Marek Polacek <polacek@redhat.com>
9493
9494 PR c/66066
9495 PR c/66127
9496 * c-typeck.c (digest_init): Call pedwarn_init with OPT_Wpedantic
9497 rather than with 0.
9498
c3388e62
DM
94992015-05-12 David Malcolm <dmalcolm@redhat.com>
9500
9501 * c-parser.c (c_parser_if_body): Add param "if_loc", use it
9502 to add a call to warn_for_misleading_indentation.
9503 (c_parser_else_body): Likewise, adding param "else_loc".
9504 (c_parser_if_statement): Check for misleading indentation.
9505 (c_parser_while_statement): Likewise.
9506 (c_parser_for_statement): Likewise.
9507
755e528f
MP
95082015-05-08 Marek Polacek <polacek@redhat.com>
9509
9510 PR c/64918
9511 * c-typeck.c (add_pending_init): Use OPT_Woverride_init_side_effects.
9512 (output_init_element): Likewise.
9513
0173bd2a
MP
95142015-05-07 Marek Polacek <polacek@redhat.com>
9515
9516 PR c/65179
9517 * c-typeck.c (build_binary_op): Warn when left shifting a negative
9518 value.
9519
9babc352
MP
95202015-04-30 Marek Polacek <polacek@redhat.com>
9521
9522 * c-typeck.c (set_init_label): Call error_at instead of error and
9523 pass LOC to it.
9524
ac9f18db
MP
9525 * c-typeck.c (c_incomplete_type_error): Refactor to use %qT. Print
9526 the type of a decl.
9527
ec3fba51
MP
9528 * c-typeck.c (c_build_va_arg): Clarify the error message.
9529
b811915d
TS
95302015-04-29 Thomas Schwinge <thomas@codesourcery.com>
9531
9532 * c-parser.c (c_parser_oacc_enter_exit_data): Use
9533 OMP_STANDALONE_CLAUSES.
9534
f3075008
MP
95352015-04-28 Marek Polacek <polacek@redhat.com>
9536
9537 * c-parser.c (c_parser_binary_expression): Remove duplicate line.
9538
4e81b788
MP
95392015-04-28 Marek Polacek <polacek@redhat.com>
9540
9541 PR c/65901
9542 * c-typeck.c (c_build_va_arg): Require TYPE be a complete type.
9543
6c1db78e
MP
95442015-04-25 Marek Polacek <polacek@redhat.com>
9545
9546 PR c/52085
9547 * c-decl.c (finish_enum): Copy over TYPE_ALIGN. Also check for "mode"
9548 attribute.
9549
5c4abbb8
MP
95502015-04-23 Marek Polacek <polacek@redhat.com>
9551
9552 PR c/65345
9553 * c-decl.c (set_labels_context_r): New function.
9554 (store_parm_decls): Call it via walk_tree_without_duplicates.
9555 * c-typeck.c (convert_lvalue_to_rvalue): Use create_tmp_var_raw
9556 instead of create_tmp_var. Build TARGET_EXPR instead of
9557 COMPOUND_EXPR.
9558 (build_atomic_assign): Use create_tmp_var_raw instead of
9559 create_tmp_var. Build TARGET_EXPRs instead of MODIFY_EXPR.
9560
06aca1d5
IV
95612015-04-20 Ilya Verbin <ilya.verbin@intel.com>
9562
9563 * c-parser.c (c_parser_oacc_enter_exit_data): Remove excess semicolon.
9564 (c_parser_omp_target_update): Add missed %> to error_at ().
9565
8fba1830
BRF
95662015-04-10 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
9567
9568 PR target/55143
9569 * c-decl.c (c_default_pointer_mode): Remove definition.
9570 * c-tree.h (c_default_pointer_mode): Remove declaration.
9571
62021f64
TB
95722015-03-27 Tobias Burnus <burnus@net-b.de>
9573
9574 PR c/65586
9575 * c-parser.c (c_parser_skip_to_pragma_eol): Optionally, don't
9576 error out.
9577 (c_parser_omp_for, c_parser_omp_parallel, c_parser_omp_distribute,
9578 c_parser_omp_teams, c_parser_omp_target, c_parser_omp_declare):
9579 Update calls to not error for skipped omp pragmas with -fopenmp-simd.
9580
9b65e171
JJ
95812015-03-19 Jakub Jelinek <jakub@redhat.com>
9582
9583 * c-decl.c (c_decl_attributes): Also add "omp declare target"
9584 attribute for DECL_EXTERNAL VAR_DECLs.
9585
17958621
JJ
95862015-03-11 Jakub Jelinek <jakub@redhat.com>
9587
9588 * c-parser.c (c_parse_init): Don't call xstrdup on get_identifier
9589 argument.
9590
7ccb1a11
JJ
95912015-03-10 Jakub Jelinek <jakub@redhat.com>
9592
9593 PR c/65120
9594 * c-typeck.c (parser_build_binary_op): Check for tcc_comparison
9595 before preparing arguments to warn_logical_not_parentheses.
9596
01177669
JJ
95972015-03-09 Jakub Jelinek <jakub@redhat.com>
9598
9599 PR c/65120
9600 * c-typeck.c (parser_build_binary_op): Don't warn for
9601 !!x == y or !b == y where b is _Bool.
9602
802ac282
MP
96032015-03-09 Marek Polacek <polacek@redhat.com>
9604
9605 * c-convert.c (convert): Make use of do_ubsan_in_current_function.
9606 * c-decl.c (grokdeclarator): Likewise.
9607 * c-typeck.c (build_binary_op): Likewise.
9608
e5165b60
MP
96092015-02-27 Marek Polacek <polacek@redhat.com>
9610
9611 PR c/65228
9612 * c-decl.c (start_decl): Return NULL_TREE if decl is an error node.
9613
065d214c
MP
96142015-02-14 Marek Polacek <polacek@redhat.com>
9615
9616 PR c/64768
9617 * c-decl.c (grokdeclarator): Set the range of a flexible array member
9618 declared through a typedef name.
9619
e5d9235b
MP
96202015-02-13 Marek Polacek <polacek@redhat.com>
9621
9622 PR c/65050
9623 * c-decl.c (grokdeclarator): Print also the type when giving
9624 the error message about array's incomplete element type.
9625
fa01ffcc
JJ
96262015-02-11 Jakub Jelinek <jakub@redhat.com>
9627
9628 PR c/64824
9629 * c-parser.c (c_parser_binary_expression): Fix OpenMP stack[sp].prec
9630 check in the POP macro.
9631
c3e38a03
MP
96322015-02-09 Marek Polacek <polacek@redhat.com>
9633
9634 PR c/64856
9635 * c-typeck.c (process_init_element): Don't always wrap
9636 COMPOUND_LITERAL_EXPR in a SAVE_EXPR in C99 mode when
9637 initializing a range of elements.
9638
4886ec8e
JJ
96392015-02-04 Jakub Jelinek <jakub@redhat.com>
9640
9641 PR c/64824
9642 PR c/64868
9643 * c-parser.c (c_parser_omp_atomic): Handle RDIV_EXPR.
9644
c3e38a03 96452015-02-02 Bruno Loff <bruno.loff@gmail.com>
a4bb6959
BL
9646
9647 * c-parser.c (c_parser_declspecs): Call invoke_plugin_callbacks after
9648 processing enum declaration.
9649
7b33f0c8
MP
96502015-01-29 Marek Polacek <polacek@redhat.com>
9651
9652 PR c/64709
9653 * c-typeck.c (pop_init_level): If constructor_elements has
9654 exactly one element with integer_zerop value, set constructor_zeroinit
9655 to 1. Remove braces around warning_init call.
9656
dea63e49
JJ
96572015-01-27 Jakub Jelinek <jakub@redhat.com>
9658
9659 PR c/64766
9660 * c-typeck.c (store_init_value): Don't overwrite DECL_INITIAL
9661 of FUNCTION_DECLs with error_mark_node.
9662
d38f7dce
JJ
96632015-01-26 Jakub Jelinek <jakub@redhat.com>
9664
9665 PR c/64778
9666 * c-typeck.c (convert_arguments): Return -1 if there are
9667 error_args, even if we've diagnosed too many arguments.
9668
cbf5d0e7
RB
96692015-01-21 Richard Biener <rguenther@suse.de>
9670
9671 PR middle-end/64313
9672 * c-decl.c (merge_decls): Call set_builtin_decl_declared_p
9673 for builtins the user declared correctly.
9674
41dbbb37
TS
96752015-01-15 Thomas Schwinge <thomas@codesourcery.com>
9676 Bernd Schmidt <bernds@codesourcery.com>
9677 Cesar Philippidis <cesar@codesourcery.com>
9678 James Norris <jnorris@codesourcery.com>
9679 Jakub Jelinek <jakub@redhat.com>
9680 Ilmir Usmanov <i.usmanov@samsung.com>
9681
9682 * c-parser.c: Include "gomp-constants.h".
9683 (c_parser_omp_clause_map): Use enum gomp_map_kind instead of enum
9684 omp_clause_map_kind. Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
9685 Use OMP_CLAUSE_SET_MAP_KIND.
9686 (c_parser_pragma): Handle PRAGMA_OACC_ENTER_DATA,
9687 PRAGMA_OACC_EXIT_DATA, PRAGMA_OACC_UPDATE.
9688 (c_parser_omp_construct): Handle PRAGMA_OACC_CACHE,
9689 PRAGMA_OACC_DATA, PRAGMA_OACC_KERNELS, PRAGMA_OACC_LOOP,
9690 PRAGMA_OACC_PARALLEL, PRAGMA_OACC_WAIT.
9691 (c_parser_omp_clause_name): Handle "auto", "async", "copy",
9692 "copyout", "create", "delete", "deviceptr", "gang", "host",
9693 "num_gangs", "num_workers", "present", "present_or_copy", "pcopy",
9694 "present_or_copyin", "pcopyin", "present_or_copyout", "pcopyout",
9695 "present_or_create", "pcreate", "seq", "self", "vector",
9696 "vector_length", "wait", "worker".
9697 (OACC_DATA_CLAUSE_MASK, OACC_KERNELS_CLAUSE_MASK)
9698 (OACC_ENTER_DATA_CLAUSE_MASK, OACC_EXIT_DATA_CLAUSE_MASK)
9699 (OACC_LOOP_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK)
9700 (OACC_UPDATE_CLAUSE_MASK, OACC_WAIT_CLAUSE_MASK): New macros.
9701 (c_parser_omp_variable_list): Handle OMP_CLAUSE__CACHE_.
9702 (c_parser_oacc_wait_list, c_parser_oacc_data_clause)
9703 (c_parser_oacc_data_clause_deviceptr)
9704 (c_parser_omp_clause_num_gangs, c_parser_omp_clause_num_workers)
9705 (c_parser_oacc_clause_async, c_parser_oacc_clause_wait)
9706 (c_parser_omp_clause_vector_length, c_parser_oacc_all_clauses)
9707 (c_parser_oacc_cache, c_parser_oacc_data, c_parser_oacc_kernels)
9708 (c_parser_oacc_enter_exit_data, c_parser_oacc_loop)
9709 (c_parser_oacc_parallel, c_parser_oacc_update)
9710 (c_parser_oacc_wait): New functions.
9711 * c-tree.h (c_finish_oacc_parallel, c_finish_oacc_kernels)
9712 (c_finish_oacc_data): New prototypes.
9713 * c-typeck.c: Include "gomp-constants.h".
9714 (handle_omp_array_sections): Handle GOMP_MAP_FORCE_DEVICEPTR. Use
9715 GOMP_MAP_* instead of OMP_CLAUSE_MAP_*. Use
9716 OMP_CLAUSE_SET_MAP_KIND.
9717 (c_finish_oacc_parallel, c_finish_oacc_kernels)
9718 (c_finish_oacc_data): New functions.
9719 (c_finish_omp_clauses): Handle OMP_CLAUSE__CACHE_,
9720 OMP_CLAUSE_NUM_GANGS, OMP_CLAUSE_NUM_WORKERS,
9721 OMP_CLAUSE_VECTOR_LENGTH, OMP_CLAUSE_ASYNC, OMP_CLAUSE_WAIT,
9722 OMP_CLAUSE_AUTO, OMP_CLAUSE_SEQ, OMP_CLAUSE_GANG,
9723 OMP_CLAUSE_WORKER, OMP_CLAUSE_VECTOR, and OMP_CLAUSE_MAP's
9724 GOMP_MAP_FORCE_DEVICEPTR.
9725
adfac8df
JJ
97262015-01-09 Michael Collison <michael.collison@linaro.org>
9727
9728 * c-array-notation.c: Include hash-set.h, machmode.h,
9729 vec.h, double-int.h, input.h, alias.h, symtab.h, options.h
9730 fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h.
9731 * c-aux-info.c: Ditto.
9732 * c-convert.c: Ditto.
9733 * c-decl.c: Ditto.
9734 * c-errors.c: Ditto.
9735 * c-lang.c: Dittoxs.
9736 * c-objc-common.c: Ditto.
9737 * c-parser.c: Ditto.
9738 * c-typeck.c: Include hash-set.h, machmode.h,
9739 vec.h, double-int.h, input.h, alias.h, symtab.h, options.h
9740 fold-const.h, wide-int.h, inchash.h, real.h and
9741 fixed-value.h due to flattening of tree.h.
9742
2cc901dc
MP
97432015-01-07 Marek Polacek <polacek@redhat.com>
9744
9745 PR c/64417
9746 * c-typeck.c (process_init_element): Disallow initialization of
9747 a flexible array member with a string constant if the structure
9748 is in an array.
9749
5624e564
JJ
97502015-01-05 Jakub Jelinek <jakub@redhat.com>
9751
e5341100
JJ
9752 PR sanitizer/64344
9753 * c-typeck.c (convert_for_assignment, c_finish_return): For
9754 -fsanitize=float-cast-overflow casts from REAL_TYPE to integer/enum
9755 types also set in_late_binary_op around convert call.
9756 * c-convert.c (convert): For -fsanitize=float-cast-overflow REAL_TYPE
9757 to integral type casts, if not in_late_binary_op, pass c_fully_fold
9758 result on expr as last argument to ubsan_instrument_float_cast,
9759 if in_late_binary_op, don't use c_save_expr but save_expr.
9760
5624e564
JJ
9761 Update copyright years.
9762
5bd012f8
MP
97632015-01-05 Marek Polacek <polacek@redhat.com>
9764
9765 PR c/64423
9766 * c-typeck.c (build_array_ref): Pass loc down to
9767 warn_array_subscript_with_type_char.
9768
3f8257db 97692014-12-20 Martin Uecker <uecker@eecs.berkeley.edu>
768952be
MU
9770
9771 * c-typeck.c: New behavious for pointers to arrays with qualifiers
8e745a17 9772 (common-pointer-type): For pointers to arrays take qualifiers from
768952be 9773 element type.
8e745a17 9774 (build_conditional_expr): Add warnings for lost qualifiers.
768952be 9775 (comp-target-types): Allow pointers to arrays with different qualifiers.
8e745a17 9776 (convert-for-assignment): Adapt warnings for discarded qualifiers. Add
768952be 9777 WARNING_FOR_QUALIFIERS macro and rename WARN_FOR_QUALIFIERS
8e745a17 9778 to PEDWARN_FOR_QUALIFIERS.
768952be 9779
8f94a8c4
JJ
97802014-12-17 Jakub Jelinek <jakub@redhat.com>
9781
9782 PR sanitizer/64289
9783 * c-convert.c: Include ubsan.h.
9784 (convert): For real -> integral casts and
9785 -fsanitize=float-cast-overflow don't call convert_to_integer, but
9786 instead instrument the float cast directly.
9787
b731b390
JJ
97882014-11-29 Jakub Jelinek <jakub@redhat.com>
9789
9790 * c-typeck.c (convert_lvalue_to_rvalue, build_atomic_assign,
9791 c_finish_stmt_expr): Remove NULL last argument from
9792 create_tmp_var_raw and create_tmp_var calls.
9793 * c-array-notation.c (fix_builtin_array_notation_fn,
9794 build_array_notation_expr, fix_conditional_array_notations_1,
9795 fix_array_notation_expr, fix_array_notation_call_expr): Likewise.
9796
541e35a6
MP
97972014-11-28 Marek Polacek <polacek@redhat.com>
9798
9799 PR c/63862
9800 * c-typeck.c (build_binary_op) <RSHIFT_EXPR, LSHIFT_EXPR>: Don't
9801 convert the right operand to integer type.
9802
b286be94
MP
98032014-11-25 Marek Polacek <polacek@redhat.com>
9804
9805 PR c/63877
9806 * c-decl.c (start_function): Disable -Wmissing-declarations warning
9807 for inline functions.
9808
aa7da51a
JJ
98092014-11-21 Jakub Jelinek <jakub@redhat.com>
9810
9811 PR target/63764
9812 * c-typeck.c (build_array_ref): Adjust
9813 convert_vector_to_pointer_for_subscript caller. If it returns true,
9814 call non_lvalue_loc on the result.
9815
d876207f
RB
98162014-11-11 Richard Biener <rguenther@suse.de>
9817
9818 * c-decl.c (c_init_decl_processing): Do not set pedantic_lvalues
9819 to true.
9820
e5e44252
AK
98212014-11-10 Andi Kleen <ak@linux.intel.com>
9822
9823 PR c/60804
9824 * c-parser.c (c_parser_statement_after_labels): Call
9825 check_no_cilk.
9826 (c_parser_if_statement): Dito.
9827 (c_parser_switch_statement): Dito.
9828 (c_parser_while_statement): Dito.
9829 (c_parser_do_statement): Dito.
9830 (c_parser_for_statement): Dito.
9831 * c-typeck.c (c_finish_loop): Dito.
9832
13c21655
PC
98332014-11-10 Paolo Carlini <paolo.carlini@oracle.com>
9834
9835 * c-typeck.c (build_binary_op): Use OPT_Wshift_count_negative and
9836 OPT_Wshift_count_overflow in the warnings.
9837
2d51fcef
MP
98382014-10-30 Marek Polacek <polacek@redhat.com>
9839
9840 * c-objc-common.c (c_tree_printer) <case 'T'>: For a typedef name,
9841 print the stripped version as well, if they're not the same.
9842
ef4bddc2
RS
98432014-10-29 Richard Sandiford <richard.sandiford@arm.com>
9844
9845 * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from
9846 machine_mode.
9847
c582198b
AM
98482014-10-28 Andrew MacLeod <amacleod@redhat.com>
9849
9850 * c-decl.c: Adjust include files.
9851 * c-parser.c: Ditto.
9852
ddc8de03
PM
98532014-10-27 Phil Muldoon <pmuldoon@redhat.com>
9854 Tom Tromey <tromey@redhat.com>
9855
9856 * c-tree.h (enum c_oracle_request): New.
9857 (c_binding_oracle_function): New typedef.
9858 (c_binding_oracle, c_pushtag, c_bind): Declare.
9859 * c-decl.c (c_binding_oracle): New global.
9860 (I_SYMBOL_CHECKED): New macro.
9861 (i_symbol_binding): New function.
9862 (I_SYMBOL_BINDING, I_SYMBOL_DECL): Redefine.
9863 (I_TAG_CHECKED): New macro.
9864 (i_tag_binding): New function.
9865 (I_TAG_BINDING, I_TAG_DECL): Redefine.
9866 (I_LABEL_CHECKED): New macro.
9867 (i_label_binding): New function.
9868 (I_LABEL_BINDING, I_LABEL_DECL): Redefine.
9869 (c_print_identifier): Save and restore c_binding_oracle.
9870 (c_pushtag, c_bind): New functions.
9871
60393bbc
AM
98722014-10-27 Andrew MacLeod <amacleod@redhat.com>
9873
9874 * c-typeck.c: Adjust include files.
9875
d723bb7c
MLI
98762014-10-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
9877
9878 PR c++/53061
9879 * c-objc-common.c (c_objc_common_init): Do not do diagnostics
9880 initialization here...
9881 (c_initialize_diagnostics): ... but here. Set defaults after
9882 building pretty-printer.
9883
1bc5a451
MP
98842014-10-23 Marek Polacek <polacek@redhat.com>
9885
9886 PR c/63626
9887 * c-decl.c (pop_scope): Don't print warning in external_scope.
9888
4435bb92
MP
98892014-10-19 Marek Polacek <polacek@redhat.com>
9890
9891 PR c/63567
9892 * c-typeck.c (output_init_element): Allow initializing objects with
9893 static storage duration with compound literals even in C99 and add
9894 pedwarn for it.
9895
7278465e
MP
98962014-10-17 Marek Polacek <polacek@redhat.com>
9897
9898 PR c/63567
9899 * c-typeck.c (digest_init): Allow initializing objects with static
9900 storage duration with compound literals even in C99 and add pedwarn
9901 for it.
9902
d9b7be2e
MP
99032014-10-17 Marek Polacek <polacek@redhat.com>
9904
9905 PR c/63543
9906 * c-tree.h (C_TYPE_ERROR_REPORTED): Define.
9907 * c-typeck.c (build_indirect_ref): Don't print the "dereferencing..."
9908 error multiple times. Print the type.
9909
f406ae1f
MP
99102014-10-17 Marek Polacek <polacek@redhat.com>
9911
9912 PR c/63549
9913 * c-typeck.c (build_array_ref): Bail if the index in an incomplete
9914 type.
9915
92574c7c
MP
99162014-10-17 Marek Polacek <polacek@redhat.com>
9917
9918 * c-decl.c (grokdeclarator): Use OPT_Wimplicit_int unconditionally.
9919 (start_function): Use OPT_Wimplicit_int instead of 0.
9920 (store_parm_decls_oldstyle): Likewise.
9921
1bc4a978
MT
99222014-10-17 Alan Modra <amodra@gmail.com>
9923
9924 PR middle-end/61848
9925 * c-decl.c (merge_decls): Don't merge section name or tls model
9926 to newdecl symtab node, instead merge to olddecl. Override
9927 existing olddecl section name. Set tls_model for all thread-local
9928 vars, not just OMP thread-private ones. Remove incorrect comment.
9929
83685514
AM
99302014-10-16 Andrew MacLeod <amacleod@redhat.com>
9931
9932 * c-decl.c: Adjust include files.
9933
78a7c317
DD
99342014-10-14 DJ Delorie <dj@redhat.com>
9935
9936 * c-parser.c (c_parse_init): Add RID entries for each __intN.
9937 (c_token_starts_typename): Check all __intN, not just __int128.
9938 (c_token_starts_declspecs): Likewise.
9939 (c_parser_declspecs): Likewise.
9940 (c_parser_attribute_any_word): Likewise.
9941 (c_parser_objc_selector): Likewise.
9942 * c-tree.h (c_typespec_keyword): cts_int128 -> cts_int_n.
9943 (struct c_declspecs): Add int_n_idx field to record *which* __intN
9944 is specified.
9945 * c-decl.c (declspecs_add_type): Check for all __intN, not just
9946 __int128.
9947 (finish_declspecs): Likewise.
9948
74d98c1e
AB
99492014-10-13 Anthony Brandon <anthony.brandon@gmail.com>
9950
8e745a17 9951 * c-parser.c (c_parser_all_labels): New function to replace
74d98c1e 9952 the duplicate code.
8e745a17 9953 (c_parser_statement): Call the new function.
74d98c1e 9954
84937de2
MP
99552014-10-09 Marek Polacek <polacek@redhat.com>
9956
9957 PR c/63480
9958 * c-typeck.c (pop_init_level): Don't warn about initializing
9959 with { }.
9960
0382aaa0
MP
99612014-10-07 Marek Polacek <polacek@redhat.com>
9962
9963 PR c/59717
9964 * c-decl.c (header_for_builtin_fn): New function.
9965 (implicitly_declare): Suggest which header to include.
9966
7a0ca710
MP
99672014-10-07 Marek Polacek <polacek@redhat.com>
9968
9969 * c-convert.c (convert): Use error_operand_p.
9970 * c-typeck.c (require_complete_type): Likewise.
9971 (really_atomic_lvalue): Likewise.
9972 (digest_init): Likewise.
9973 (handle_omp_array_sections_1): Likewise.
9974
6bc8a126
MP
99752014-10-03 Marek Polacek <polacek@redhat.com>
9976
9977 PR c/63453
9978 * c-decl.c (pop_scope): Don't warn about "inline function declared
9979 but never defined" for functions marked with gnu_inline attribute.
9980
d90c0a59
JJ
99812014-09-25 Jakub Jelinek <jakub@redhat.com>
9982
9983 PR c++/63249
9984 * c-parser.c (c_parser_omp_variable_list): Call mark_exp_read
9985 on low_bound and length.
9986
083e891e
MP
99872014-09-24 Marek Polacek <polacek@redhat.com>
9988
9989 PR c/61405
9990 PR c/53874
9991 * c-parser.c: Don't define CPP_KEYWORD.
9992 (c_parser_switch_statement): Pass original type to c_finish_case.
9993 * c-tree.h (c_finish_case): Update declaration.
9994 * c-typeck.c (c_finish_case): Add TYPE parameter. Pass it
9995 conditionally to c_do_switch_warnings.
9996
8d95fe25
MP
99972014-09-03 Marek Polacek <polacek@redhat.com>
9998
9999 PR c/62024
10000 * c-parser.c (c_parser_static_assert_declaration_no_semi): Strip no-op
10001 conversions.
10002
9a771876
JJ
100032014-09-02 Jakub Jelinek <jakub@redhat.com>
10004 Balaji V. Iyer <balaji.v.iyer@intel.com>
10005 Igor Zamyatin <igor.zamyatin@intel.com>
10006
10007 * c-parser.c (c_parser_cilk_for): New function.
10008 (c_parser_cilk_grainsize): Likewise.
10009 (c_get_temp_regvar): Likewise.
10010 (c_parser_statement_after_labels): Added RID_CILK_FOR case.
10011 (c_parser_pragma): Added PRAGMA_CILK_GRAINSIZE case.
10012 (c_parser_omp_for_loop): Added CILK_FOR and CILK_SIMD checks.
10013 * c-typeck.c (c_finish_omp_clauses): Added OMP_CLAUSE__CILK_FOR_COUNT_
10014 case.
10015
b7679d96
CG
100162014-08-27 Chen Gang <gang.chen.5i5j@gmail.com>
10017
10018 * c-aux-info.c (gen_type): Resize 'buff' from 10 to 23 bytes,
10019 with using HOST_WIDE_INT without truncation to 'int'
10020
59ea0364
MP
100212014-08-22 Marek Polacek <polacek@redhat.com>
10022
10023 PR c++/62199
10024 * c-typeck.c (parser_build_binary_op): Adjust call to
10025 warn_logical_not_parentheses.
10026
671a475e
IZ
100272014-08-22 Igor Zamyatin <igor.zamyatin@intel.com>
10028
10029 PR other/62008
10030 * c-parser.c (c_parser_array_notation): Check for correct
10031 type of an array added.
10032
04159acf
MP
100332014-08-19 Marek Polacek <polacek@redhat.com>
10034
10035 PR c++/62153
10036 * c-typeck.c (build_binary_op): If either operand of a comparison
10037 is a boolean expression, call maybe_warn_bool_compare.
10038
c77935ee
PP
100392014-08-19 Patrick Palka <ppalka@gcc.gnu.org>
10040
10041 PR c/45584
10042 * c-typeck.c (build_c_cast): Do a conversion even when the
10043 TYPE_MAIN_VARIANTs are the same.
10044
35aff4fb
MP
100452014-08-19 Marek Polacek <polacek@redhat.com>
10046
10047 * c-decl.c (diagnose_mismatched_decls): Unconditionally call
10048 pedwarn_c99 instead of pedwarn.
10049 (grokfield): Likewise.
10050 (warn_defaults_to): New function.
10051 (grokdeclarator): Call warn_defaults_to instead of pedwarn_c99.
10052 Unconditionally call pedwarn_c99 instead of pedwarn.
10053 (start_function): Call warn_defaults_to instead of pedwarn_c99.
10054 (declspecs_add_scspec): Call pedwarn_c99 instead of pedwarn, don't
10055 check flag_isoc11 before.
10056 * c-errors.c (pedwarn_c99): Change the return type to bool.
10057 Handle -Wc99-c11-compat.
10058 * c-parser.c (disable_extension_diagnostics): Handle
10059 warn_c99_c11_compat.
10060 (restore_extension_diagnostics): Likewise.
10061 (c_parser_static_assert_declaration_no_semi): Call pedwarn_c99
10062 instead of pedwarn, don't check flag_isoc11 before.
10063 (c_parser_declspecs): Likewise.
10064 (c_parser_alignas_specifier): Likewise.
10065 (c_parser_alignof_expression): Likewise.
10066 (c_parser_generic_selection): Likewise.
10067 * c-tree.h (pedwarn_c99): Update declaration.
10068 * c-typeck.c (c_finish_return): Call pedwarn or warning_at instead
10069 of pedwarn_c99.
10070
177cce46
MP
100712014-08-19 Marek Polacek <polacek@redhat.com>
10072
10073 * c-decl.c (warn_variable_length_array): Pass OPT_Wvla unconditionally
10074 to pedwarn_c90.
10075 * c-errors.c: Include "opts.h".
10076 (pedwarn_c90): Rewrite to handle -Wno-c90-c99-compat better.
10077 * c-parser.c (disable_extension_diagnostics): Handle negative value
10078 of warn_c90_c99_compat, too.
10079 (restore_extension_diagnostics): Likewise.
10080 (c_parser_compound_statement_nostart): Pass
10081 OPT_Wdeclaration_after_statement unconditionally to pedwarn_c90.
10082
6dc99c33
MP
100832014-08-12 Marek Polacek <polacek@redhat.com>
10084
10085 * c-parser.c (c_parser_postfix_expression) <case RID_FUNCTION_NAME>:
10086 Add pedwarn.
10087 (c_parser_postfix_expression) <case RID_PRETTY_FUNCTION_NAME>:
10088 Likewise.
10089 (c_parser_postfix_expression) <case RID_C99_FUNCTION_NAME>: Likewise.
10090
3f8257db 100912014-08-10 Marek Polacek <polacek@redhat.com>
f3bede71
MP
10092
10093 PR c/51849
10094 * c-decl.c (build_array_declarator): Remove check for !flag_isoc99.
10095 Call pedwarn_c90 instead of pedwarn.
10096 (check_bitfield_type_and_width): Likewise.
10097 (declspecs_add_qual): Likewise.
10098 (declspecs_add_type): Likewise.
10099 (warn_variable_length_array): Unify function for -pedantic and -Wvla.
10100 Adjust to only call pedwarn_c90.
10101 (grokdeclarator): Remove pedantic && !flag_isoc99 check. Call
10102 pedwarn_c90 instead of pedwarn.
10103 * c-errors.c (pedwarn_c90): Handle -Wc90-c99-compat.
10104 * c-parser.c (disable_extension_diagnostics): Handle
10105 warn_c90_c99_compat.
10106 (restore_extension_diagnostics): Likewise.
10107 (c_parser_enum_specifier): Remove check for !flag_isoc99. Call
10108 pedwarn_c90 instead of pedwarn.
10109 (c_parser_initelt): Likewise.
10110 (c_parser_postfix_expression): Likewise.
10111 (c_parser_postfix_expression_after_paren_type): Likewise.
10112 (c_parser_compound_statement_nostart): Remove check for !flag_isoc99.
10113 * c-tree.h: Fix formatting.
10114 * c-typeck.c (build_array_ref): Remove check for !flag_isoc99. Call
10115 pedwarn_c90 instead of pedwarn.
10116
9f25a338
TS
101172014-08-07 Trevor Saunders <tsaunders@mozilla.com>
10118
10119 * c-typeck.c: Remove include of pointer-set.h.
10120
044331a8
MP
101212014-08-07 Marek Polacek <polacek@redhat.com>
10122
10123 * c-typeck.c (pointer_diff): Remove P - (P + CST) optimization.
10124
b787e7a2
TS
101252014-08-02 Trevor Saunders <tsaunders@mozilla.com>
10126
10127 * c-typeck.c: Use hash_map instead of pointer_map.
10128
6e2830c3
TS
101292014-08-02 Trevor Saunders <tsaunders@mozilla.com>
10130
10131 * c-decl.c: Use hash_set instead of pointer_set.
10132
a7ee52fb
IZ
101332014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
10134
10135 PR middle-end/61455
10136 * c-array-notation.c (expand_array_notations): Handling
10137 of DECL_EXPR added.
10138
b4dfdc11
MG
101392014-07-31 Marc Glisse <marc.glisse@inria.fr>
10140
10141 PR c++/60517
10142 * c-typeck.c (c_finish_return): Return 0 instead of the address of
10143 a local variable.
10144
976d5a22
TT
101452014-07-30 Tom Tromey <tromey@redhat.com>
10146
10147 * c-typeck.c (struct constructor_stack) <designator_depth>: New
10148 field.
10149 (really_start_incremental_init, push_init_level): Initialize
10150 designator_depth.
10151 (pop_init_level): Set global designator_depth.
10152 (process_init_element): Check for designated_init attribute.
10153
30281de2
MP
101542014-07-20 Marek Polacek <polacek@redhat.com>
10155
10156 PR c/61852
10157 * c-decl.c (implicit_decl_warning): Add location_t parameter. Use it.
10158 (implicitly_declare): Pass location to implicit_decl_warning.
10159
b108f48f
JJ
101602014-07-14 Jakub Jelinek <jakub@redhat.com>
10161
10162 PR middle-end/61294
10163 * c-parser.c (c_parser_expr_list): Add new argument literal_zero_mask.
10164 If non-NULL, call c_parser_check_literal_zero.
10165 (c_parser_check_literal_zero): New function.
10166 (c_parser_postfix_expression_after_primary): Adjust
10167 c_parser_expr_list caller, handle -Wmemset-transposed-args.
10168
773ec47f
MP
101692014-07-06 Marek Polacek <polacek@redhat.com>
10170
10171 PR c/6940
10172 * c-decl.c (grokdeclarator): Set C_ARRAY_PARAMETER.
10173 * c-tree.h (C_ARRAY_PARAMETER): Define.
10174 * c-typeck.c (c_expr_sizeof_expr): Warn when using sizeof on an array
10175 function parameter.
10176
22e1cf1c 101772014-07-02 Jan Hubicka <hubicka@ucw.cz>
3f8257db 10178 Chen Gang <gang.chen.5i5j@gmail.com>
22e1cf1c
JH
10179
10180 * c-decl.c (duplicate_decls): CLear DECL_STRUCT_FUNCTION before
10181 releasing symbol.
10182
52ec0ea3
MP
101832014-07-01 Marek Polacek <polacek@redhat.com>
10184
10185 * c-typeck.c (convert_for_assignment): Pass OPT_Wint_conversion
10186 instead of 0 to WARN_FOR_ASSIGNMENT.
10187
d5c3d343
MP
101882014-07-01 Marek Polacek <polacek@redhat.com>
10189
10190 PR c/58286
10191 * c-typeck.c (convert_for_assignment): Pass
10192 OPT_Wincompatible_pointer_types instead of 0 to WARN_FOR_ASSIGNMENT.
10193
6a7253a4
MP
101942014-06-30 Marek Polacek <polacek@redhat.com>
10195
10196 * c-decl.c (grokdeclarator): Don't instrument VLAs if the function
10197 has no_sanitize_undefined attribute.
10198
5e88a8f4
IZ
101992014-06-30 Igor Zamyatin <igor.zamyatin@intel.com>
10200
10201 PR middle-end/57541
10202 * c-array-notation.c (fix_builtin_array_notation_fn):
10203 Check for 0 arguments in builtin call. Check that bultin argument is
10204 correct.
10205 * c-parser.c (c_parser_array_notation): Check for incorrect initial
10206 index.
10207
9698b078
SH
102082014-06-27 Sebastian Huber <sebastian.huber@embedded-brains.de>
10209
10210 * c-parser.c (c_parser_declaration_or_fndef): Discard all type
10211 qualifiers in __auto_type for atomic types.
10212 (c_parser_typeof_specifier): Discard all type qualifiers in
10213 __typeof__ for atomic types.
10214
6e07c515
MP
102152014-06-25 Marek Polacek <polacek@redhat.com>
10216
10217 PR c/61162
10218 * c-parser.c (c_parser_statement_after_labels): Pass the location of
10219 the return expression to c_finish_return.
10220
da6f124d
JJ
102212014-06-25 Jakub Jelinek <jakub@redhat.com>
10222
10223 * c-typeck.c (c_finish_omp_clauses): Make sure
10224 OMP_CLAUSE_LINEAR_STEP has correct type.
10225
c203e8a7
TS
102262014-06-24 Trevor Saunders <tsaunders@mozilla.com>
10227
10228 * c-decl.c: Adjust.
10229
56ad0e38
JJ
102302014-06-24 Jakub Jelinek <jakub@redhat.com>
10231
10232 * c-parser.c (c_parser_omp_for_loop): For
10233 #pragma omp parallel for simd move lastprivate clause from parallel
10234 to for rather than simd.
10235
47c2554f
MP
102362014-06-23 Marek Polacek <polacek@redhat.com>
10237
10238 * c-typeck.c (parser_build_binary_op): Don't call
10239 warn_logical_not_parentheses if the RHS is TRUTH_NOT_EXPR.
10240
56363ffd
JH
102412014-06-15 Jan Hubicka <hubicka@ucw.cz>
10242
10243 * c-parser.c (c_parser_omp_threadprivate): Likewise.
10244 * c-decl.c (merge_decls): Likewise.
10245
d7ff7ae5
MP
102462014-06-09 Marek Polacek <polacek@redhat.com>
10247
10248 PR c/36446
10249 * c-typeck.c (error_init): Call inform instead of error_at.
10250 (pedwarn_init): Call inform instead of pedwarn.
10251 (warning_init): Call inform instead of warning_at.
10252
24d047a3
JH
102532014-06-07 Jan Hubicka <hubicka@ucw.cz>
10254
10255 * c-decl.c (merge_decls): Use set_decl_section_name.
10256 (duplicate_decls): Remove node if it exists.
10257
9bac5cbb
G
102582014-06-05 S. Gilles <sgilles@terpmail.umd.edu>
10259
10260 PR c/53119
10261 * c-typeck.c (push_init_level, process_init_element,
10262 pop_init_level): Correct check for zero initialization, move
10263 missing brace warning to respect zero initialization.
10264
8ffcdea8
MP
102652014-06-05 Marek Polacek <polacek@redhat.com>
10266
10267 PR c/56724
10268 * c-typeck.c (convert_for_assignment): Use expr_loc for ic_argpass.
10269
742938c9
MP
102702014-06-05 Marek Polacek <polacek@redhat.com>
10271
10272 PR c/49706
10273 * c-typeck.c (parser_build_binary_op): Warn when logical not is used
ab20d992 10274 on the left hand side operand of a comparison.
742938c9 10275
6447c55d
MP
102762014-06-05 Marek Polacek <polacek@redhat.com>
10277
10278 PR c/48062
10279 * c-decl.c (warn_if_shadowing): Call inform instead of warning_at.
10280 Print note only if the warning was printed.
10281
9dc7743c
IZ
102822014-06-04 Igor Zamyatin <igor.zamyatin@intel.com>
10283
10284 PR c/58942
10285 * c-array-notation.c (fix_builtin_array_notation_fn): Handle the case
10286 with a pointer.
10287
fedfecef
MP
102882014-06-03 Marek Polacek <polacek@redhat.com>
10289
10290 PR c/60439
10291 * c-parser.c (c_parser_switch_statement): Pass explicit_cast_p to
10292 c_start_case.
10293 * c-tree.h (c_start_case): Update.
10294 * c-typeck.c (c_start_case): Add new boolean parameter. Warn if
10295 switch condition has boolean value.
10296
9b2b7279
AM
102972014-06-02 Andrew MacLeod <amacleod@redhat.com>
10298
10299 * c-decl.c: Include builtins.h.
10300 * c-parser.c: Likewise.
10301
5c1bc275
MP
103022014-05-27 Marek Polacek <polacek@redhat.com>
10303
10304 PR c/56724
10305 * c-typeck.c (convert_arguments): Get location of a parameter. Change
10306 error and warning calls to error_at and warning_at. Pass location of
10307 a parameter to it. Call warning_at with OPT_Wtraditional_conversion.
10308 (convert_for_assignment): Add parameter to WARN_FOR_ASSIGNMENT and
10309 WARN_FOR_QUALIFIERS. Pass expr_loc to those.
10310
97563bc8
IZ
103112014-05-26 Igor Zamyatin <igor.zamyatin@intel.com>
10312
10313 PR c/61191
10314 * c-array-notation.c (fix_builtin_array_notation_fn): Check invalid
10315 function parameters.
10316
aede2c10
JH
103172014-05-23 Jan Hubicka <hubicka@ucw.cz>
10318
10319 * c-decl.c (merge_decls): Preserve symtab node pointers.
10320 (duplicate_decls): Free new decl.
10321
edbba2ce
TS
103222014-05-23 Thomas Schwinge <thomas@codesourcery.com>
10323
f3316c6d
TS
10324 * c-typeck.c (c_finish_omp_clauses): Remove duplicated variable
10325 initialization.
10326
edbba2ce
TS
10327 * c-parser.c (c_parser_omp_target): Return bool values.
10328
68c81f24
TS
103292014-05-22 Thomas Schwinge <thomas@codesourcery.com>
10330
10331 * c-parser.c (c_parser_omp_clause_thread_limit): Rename
10332 num_teams_loc variable to num_thread_limit_loc.
10333
632f2871
RS
103342014-05-21 Richard Sandiford <rsandifo@linux.vnet.ibm.com>
10335
10336 * c-array-notation.c (expand_array_notations): Use void_node
10337 instead of void_zero_node.
10338
766090c2
TS
103392014-05-17 Trevor Saunders <tsaunders@mozilla.com>
10340
10341 * c-decl.c (finish_struct): Adjust.
10342 (finish_enum): Likewise.
10343 (bind): Adjust.
10344 (record_inline_static): Likewise.
10345 (push_scope): Likewise.
10346 (make_label): Likewise.
10347 (lookup_label_for_goto): Likewise.
10348 (finish_struct): Likewise.
10349 (finish_enum): Likewise.
10350 (store_parm_decls): Likewise.
10351 (c_push_function_context): Likewise.
10352 * c-lang.h: Remove usage of variable_size gty attribute.
10353 * c-parser.c (c_parse_init): Adjust.
10354 (c_parse_file): Likewise.
10355
2b107f6b
MP
103562014-05-13 Marek Polacek <polacek@redhat.com>
10357
10358 PR c/61162
10359 * c-typeck.c (convert_for_assignment): Pass location to
10360 WARN_FOR_ASSIGNMENT instead of input_location.
10361
d033409e
MP
103622014-05-10 Marek Polacek <polacek@redhat.com>
10363
10364 * c-parser.c (c_parser_declaration_or_fndef): Pass init_loc to
10365 maybe_warn_string_init.
10366 (c_parser_postfix_expression_after_paren_type): Pass type_loc to
10367 maybe_warn_string_init.
10368 * c-tree.h (maybe_warn_string_init): Update declaration.
10369 * c-typeck.c (maybe_warn_string_init): Add location parameter.
10370 Call pedwarn_init with loc instead of with input_location.
10371 (digest_init): Pass init_loc to maybe_warn_string_init.
10372 (pop_init_level): Call pedwarn_init with loc instead of with
10373 input_location.
10374 (set_init_index): Likewise.
10375 (process_init_element): Likewise.
10376
ea58ef42
MP
103772014-05-09 Marek Polacek <polacek@redhat.com>
10378
10379 PR c/61096
10380 * c-parser.c (c_parser_braced_init): Pass brace_loc to push_init_level.
10381 (c_parser_initelt): Pass location to set_init_label. Pass array index
10382 location to set_init_index.
10383 * c-tree.h (push_init_level): Update declaration.
10384 (pop_init_level): Likewise.
10385 (set_init_index): Likewise.
10386 (set_init_label): Likewise.
10387 * c-typeck.c (error_init): Add location parameter. Call error_at
10388 instead of error.
10389 (digest_init): Pass init_loc to error_init.
10390 (really_start_incremental_init):
10391 (push_init_level): Add location parameter. Pass loc to pop_init_level
10392 and error_init.
10393 (pop_init_level): Likewise.
10394 (set_designator): Add location parameter. Pass loc to pop_init_level,
10395 push_init_level, and error_init.
10396 (set_init_index): Add location parameter. Pass loc to error_init and
10397 set_designator.
10398 (set_init_label): Likewise.
10399 (output_init_element): Pass loc to error_init.
10400 (process_init_element): Pass loc to error_init, pop_init_level,
10401 pedwarn_init, and push_init_level.
10402
661a0813
MP
104032014-05-09 Marek Polacek <polacek@redhat.com>
10404
10405 PR c/50459
10406 * c-parser.c (c_parser_attributes): Parse the arguments as an
10407 expression-list if the attribute takes identifier.
10408
2793eeab
MP
104092014-05-08 Marek Polacek <polacek@redhat.com>
10410
10411 PR c/61053
10412 * c-decl.c (grokdeclarator): Use min_align_of_type instead of
10413 TYPE_ALIGN_UNIT.
10414
f827930a
MP
104152014-05-08 Marek Polacek <polacek@redhat.com>
10416
10417 PR c/61077
10418 * c-decl.c (start_function): Warn for _Atomic-qualified return type
10419 of main.
10420
1d60af08
KZ
104212014-05-06 Kenneth Zadeck <zadeck@naturalbridge.com>
10422 Mike Stump <mikestump@comcast.net>
10423 Richard Sandiford <rdsandiford@googlemail.com>
10424
10425 * c-decl.c (check_bitfield_type_and_width): Use TYPE_SIGN.
10426 (finish_enum): Use wide-int interfaces.
10427 * c-parser.c (c_parser_cilk_clause_vectorlength): Likewise.
10428 * c-typeck.c (build_c_cast): Likewise.
10429 (set_nonincremental_init_from_string): Likewise.
10430 (c_tree_equal): Likewise.
10431
a0e24419
MP
104322014-05-02 Marek Polacek <polacek@redhat.com>
10433
10434 PR c/25801
10435 * c-typeck.c (c_size_in_bytes): Update comment. Don't call error.
10436 Return size_one_node when the type is not complete.
10437 (pointer_diff): Remove comment.
10438 (build_unary_op): Improve error messages.
10439
19fc9faa
MP
104402014-05-02 Marek Polacek <polacek@redhat.com>
10441
10442 * c-typeck.c (c_finish_return): Separate warning_at calls.
10443
63bc4e87
MP
104442014-05-02 Marek Polacek <polacek@redhat.com>
10445
10446 * c-tree.h (error_init): Remove declaration.
10447 (pedwarn_init): Likewise.
10448 * c-typeck.c (error_init): Make static and move above.
10449 (pedwarn_init): Likewise.
10450 (warning_init): Move above.
10451 (maybe_warn_string_init): Likewise.
10452
4bd2511b
JL
104532014-05-01 Jeff Law <law@redhat.com>
10454
10455 Revert:
10456
10457 2014-04-24 Prathamesh Kulkarni <bilbotheelffriend@gmail.com>
10458 * c-parser.c (c_parser_sizeof_expression): Reorganize slightly to
10459 avoid goto.
10460
6a358dcb
MP
104612014-05-02 Marek Polacek <polacek@redhat.com>
10462
10463 PR c/60784
10464 * c-typeck.c (push_init_level): Set constructor_designated to
10465 p->designated for structures.
10466
ae5ebda4
MP
104672014-05-01 Marek Polacek <polacek@redhat.com>
10468
10469 PR c/60915
10470 * c-parser.c (c_parser_declaration_or_fndef): Give better error if
10471 function-definition has an attribute after the declarator.
10472
96b40f8d
MP
104732014-05-01 Marek Polacek <polacek@redhat.com>
10474
10475 PR c/60257
10476 * c-typeck.c (warning_init): Add location_t parameter. Call
10477 warning_at instead of warning.
10478 (push_init_level): Pass input_location to warning_init.
10479 (add_pending_init): Add location_t parameter. Pass loc to
10480 warning_init.
10481 (set_nonincremental_init): Pass input_location to add_pending_init.
10482 (set_nonincremental_init_from_string): Likewise.
10483 (output_init_element): Pass loc to warning_init and to
10484 add_pending_init.
10485
32e00768
MP
104862014-05-01 Marek Polacek <polacek@redhat.com>
10487
10488 PR c/43395
10489 * c-typeck.c (c_finish_return): Distinguish between label and variable
10490 when warning about returning local address.
10491
c9379ce2
MP
104922014-05-01 Marek Polacek <polacek@redhat.com>
10493
10494 PR c/29467
10495 * c-decl.c (declspecs_add_type): Pedwarn if boolean types are used
10496 in C89 mode.
10497
d00887e8
MP
104982014-05-01 Marek Polacek <polacek@redhat.com>
10499
10500 PR c/43245
10501 * c-typeck.c (convert_for_assignment): Pass OPT_Wdiscarded_qualifiers
10502 instead of 0 to WARN_FOR_QUALIFIERS.
10503
5436fa2e
MP
105042014-05-01 Marek Polacek <polacek@redhat.com>
10505
10506 PR c/56989
10507 * c-typeck.c (default_conversion): Use better location for
10508 error call.
10509
f8ed5150
MP
105102014-04-30 Marek Polacek <polacek@redhat.com>
10511
10512 * c-typeck.c (build_binary_op): Call ubsan_instrument_division
10513 also when SANITIZE_FLOAT_DIVIDE is on.
10514
8337d1db
MP
105152014-04-30 Marek Polacek <polacek@redhat.com>
10516
10517 PR c/60139
10518 * c-typeck.c (output_init_element): Pass OPT_Wpedantic to pedwarn
10519 and pedwarn_init. Use loc insted of input_location.
10520
c4bdc42f
MP
105212014-04-30 Marek Polacek <polacek@redhat.com>
10522
10523 PR c/60351
10524 * c-typeck.c (build_binary_op): Use location when warning about
10525 shift count.
10526
45484dcf
MP
105272014-04-25 Marek Polacek <polacek@redhat.com>
10528
10529 PR c/18079
10530 * c-decl.c (diagnose_mismatched_decls): Warn for mismatched
10531 always_inline/noinline and hot/cold attributes.
10532
34cf811f
MP
105332014-04-25 Marek Polacek <polacek@redhat.com>
10534
10535 PR c/60114
10536 * c-parser.c (c_parser_initelt): Pass input_location to
10537 process_init_element.
10538 (c_parser_initval): Pass loc to process_init_element.
10539 * c-tree.h (process_init_element): Adjust declaration.
10540 * c-typeck.c (push_init_level): Pass input_location to
10541 process_init_element.
10542 (pop_init_level): Likewise.
10543 (set_designator): Likewise.
10544 (output_init_element): Add location_t parameter. Pass loc to
10545 digest_init.
10546 (output_pending_init_elements): Pass input_location to
10547 output_init_element.
10548 (process_init_element): Add location_t parameter. Pass loc to
10549 output_init_element.
10550
42056eac
JJ
105512014-04-24 Jakub Jelinek <jakub@redhat.com>
10552
10553 * c-parser.c (c_parser_omp_atomic): Allow seq_cst before
10554 atomic-clause, allow comma in between atomic-clause and
10555 seq_cst.
10556
e162a134
JJ
105572014-04-22 Jakub Jelinek <jakub@redhat.com>
10558
10559 PR c/59073
10560 * c-parser.c (c_parser_omp_parallel): If c_parser_omp_for
10561 fails, don't set OM_PARALLEL_COMBINED and return NULL.
10562
2f6babac
IZ
105632014-04-12 Igor Zamyatin <igor.zamyatin@intel.com>
10564
10565 PR middle-end/60469
10566 * c-array-notation.c (fix_builtin_array_notation_fn): Use
10567 create_tmp_var instead build_decl for creating temps.
10568 (build_array_notation_expr): Likewise.
10569 (fix_conditional_array_notations_1): Likewise.
10570 (fix_array_notation_expr): Likewise.
10571 (fix_array_notation_call_expr): Likewise.
10572
8edbfaa6
JJ
105732014-03-28 Jakub Jelinek <jakub@redhat.com>
10574
10575 PR c++/60689
10576 * c-tree.h (c_build_function_call_vec): New prototype.
10577 * c-typeck.c (build_function_call_vec): Don't call
10578 resolve_overloaded_builtin here.
10579 (c_build_function_call_vec): New wrapper function around
10580 build_function_call_vec. Call resolve_overloaded_builtin here.
10581 (convert_lvalue_to_rvalue, build_function_call, build_atomic_assign):
10582 Call c_build_function_call_vec instead of build_function_call_vec.
10583 * c-parser.c (c_parser_postfix_expression_after_primary): Likewise.
10584 * c-decl.c (finish_decl): Likewise.
10585
7485aeea
MLI
105862014-03-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
10587
10588 PR c/55383
10589 * c-typeck.c: Use correct format string in cast-qual warning
10590
b17a8b07
TS
105912014-03-07 Thomas Schwinge <thomas@codesourcery.com>
10592
10593 * c-decl.c (c_decl_attributes): Use
10594 lang_hooks.types.omp_mappable_type.
10595 * c-typeck.c (c_finish_omp_clauses): Likewise.
10596
3af9c5e9
MP
105972014-03-06 Marek Polacek <polacek@redhat.com>
10598
10599 PR c/60197
10600 * c-typeck.c (c_finish_return): Call contains_cilk_spawn_stmt instead
10601 of checking tree code.
10602
1c9f5f33
PK
106032014-02-19 Prathamesh Kulkarni <bilbotheelffriend@gmail.com>
10604
10605 * c-parser.c (c_parser_declspecs): Replace call to error by error_at.
10606 (c_parser_parameter_declaration): Likewise.
10607
cc28fc7f
MP
106082014-02-19 Marek Polacek <polacek@redhat.com>
10609
10610 PR c/60195
10611 * c-typeck.c (convert_lvalue_to_rvalue): Set TREE_NO_WARNING on tmp.
10612 Call mark_exp_read on exp.value.
10613 (build_atomic_assign): Set TREE_NO_WARNING on val and old. Set
10614 TREE_ADDRESSABLE on old instead of val.
10615 (emit_side_effect_warnings): Warn only if RHS has !TREE_NO_WARNING.
10616
b581c05c
PK
106172014-02-07 Prathamesh Kulkarni <bilbotheelffriend@gmail.com>
10618
10619 * c-parser.c (c_parser_get_builtin_args): Replace calls to
10620 C_EXPR_APPEND by vec_safe_push.
10621 * c-tree.h (C_EXPR_APPEND): Remove.
10622
81e5eca8
MP
106232014-01-31 Marek Polacek <polacek@redhat.com>
10624
10625 PR c/59963
10626 * c-typeck.c (convert_lvalue_to_rvalue): Pass vNULL to
10627 build_function_call_vec.
10628 (build_function_call): Likewise.
10629 (build_atomic_assign): Likewise.
10630 (build_function_call_vec): Add arg_loc parameter. Use it.
10631 (convert_arguments): Likewise.
10632 (convert_for_assignment): Rename rhs_loc to expr_loc.
10633 * c-parser.c (c_parser_attributes): Pass NULL to c_parser_expr_list.
10634 (c_parser_objc_keywordexpr): Likewise.
10635 (c_parser_postfix_expression_after_primary): Call
10636 build_function_call_vec with expr_loc rather than op_loc.
10637 Call c_parser_expr_list to fill arg_loc. Pass arg_loc to
10638 build_function_call_vec.
10639 (c_parser_expr_list): Add locations parameter. Fill it with locations
10640 of function arguments.
10641 * c-decl.c (finish_decl): Pass vNULL to build_function_call_vec.
10642
68fca595
MP
106432014-01-30 Marek Polacek <polacek@redhat.com>
10644
10645 PR c/59940
10646 * c-typeck.c (build_function_call_vec): Use loc parameter.
10647 (convert_arguments): Add location parameter. Use it.
10648 (ep_convert_and_check): Likewise.
10649 (build_atomic_assign): Adjust convert_for_assignment call.
10650 (build_modify_expr): Likewise.
10651 (digest_init): Likewise.
10652 (c_finish_return): Likewise.
10653 (build_conditional_expr): Adjust ep_convert_and_check calls.
10654 (convert_for_assignment): Add rhs_loc parameter. Use it.
10655 (build_binary_op): Adjust convert_and_check and ep_convert_and_check
10656 calls.
10657
fa337f3a
RB
106582014-01-30 Richard Biener <rguenther@suse.de>
10659
10660 PR c/59905
10661 * c-typeck.c (build_function_call_vec): Do not replace calls
10662 to a function via an incompatible type with a runtime abort.
10663
b72271b9
BI
106642014-01-24 Balaji V. Iyer <balaji.v.iyer@intel.com>
10665
10666 * c-parser.c (c_parser_declaration_or_fndef): Replaced
10667 flag_enable_cilkplus with flag_cilkplus.
10668 (c_parser_direct_declarator_inner): Likewise.
10669 (c_parser_attribute_any_word): Likewise.
10670 (c_parser_attributes): Likewise.
10671 (c_parser_compound_statement): Likewise.
10672 (c_parser_statement_after_labels): Likewise.
10673 (c_parser_if_statement): Likewise.
10674 (c_parser_switch_statement): Likewise.
10675 (c_parser_do_statement): Likewise.
10676 (c_parser_for_statement): Likewise.
10677 (c_parser_unary_expression): Likewise.
10678 (c_parser_postfix_expression): Likewise.
10679 (c_parser_postfix_expression_after_primary): Likewise.
10680 (c_parser_postfix_expression_after_primary): Likewise.
10681 (c_parser_omp_clause_name): Likewise.
10682 (c_finish_omp_declare_simd): Likewise.
10683 (c_parser_cilk_verify_simd): Likewise.
10684 * c-typeck.c (build_array_ref): Likewise.
10685 (build_function_call_vec): Likewise.
10686 (convert_arguments): Likewise.
10687 (build_compound_expr): Likewise.
10688 (c_finish_return): Likewise.
10689 (c_finish_if_stmt): Likewise.
10690 (c_finish_loop): Likewise.
10691 (build_binary_op): Likewise.
10692
393e8e8b
MP
106932014-01-23 Marek Polacek <polacek@redhat.com>
10694
10695 PR c/59846
10696 * c-typeck.c (parser_build_binary_op): Use location instead of
10697 input_location.
10698 (build_binary_op): Pass location to shorten_compare.
10699
f04dda30
MP
107002014-01-23 Marek Polacek <polacek@redhat.com>
10701
10702 PR c/58346
10703 * c-typeck.c (pointer_diff): Give an error on arithmetic on pointer to
10704 an empty aggregate.
10705
789eadcd
MP
107062014-01-23 Marek Polacek <polacek@redhat.com>
10707
10708 PR c/59871
10709 * c-typeck.c (build_compound_expr): Warn even for right-hand operand
10710 of a comma expression.
10711 (emit_side_effect_warnings): Likewise.
10712
40f14e9f
BI
107132014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com>
10714
10715 PR c/59825
10716 * c-array-notation.c (expand_array_notation_exprs): Rewrote this
10717 function to use walk_tree and moved a lot of its functionality to
10718 expand_array_notations.
10719 (expand_array_notations): New function.
10720
74558dd9
BI
107212014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com>
10722
10723 * c-parser.c (c_finish_omp_declare_simd): Made "cilk simd function"
10724 attribute an attribute without value.
10725
652fea39
JJ
107262014-01-23 Jakub Jelinek <jakub@redhat.com>
10727
10728 PR middle-end/58809
10729 * c-typeck.c (c_finish_omp_clause): Reject MIN_EXPR, MAX_EXPR,
10730 BIT_AND_EXPR, BIT_IOR_EXPR and BIT_XOR_EXPR on COMPLEX_TYPEs.
10731
f34f1c87
MP
107322014-01-22 Marek Polacek <polacek@redhat.com>
10733
10734 PR c/59891
10735 * c-typeck.c (build_conditional_expr): Call c_fully_fold instead
10736 of remove_c_maybe_const_expr on op1 and op2.
10737
241f845a
JJ
107382014-01-15 Jakub Jelinek <jakub@redhat.com>
10739
10740 PR c/58943
10741 * c-typeck.c (build_modify_expr): For lhs op= rhs, if rhs has side
10742 effects, preevaluate rhs using SAVE_EXPR first.
10743
9a74f20c
BI
107442014-01-09 Balaji V. Iyer <balaji.v.iyer@intel.com>
10745
10746 PR c++/59631
10747 * c-parser.c (c_parser_postfix_expression): Replaced consecutive if
10748 statements with if-elseif statements.
10749
96066ce1
MP
107502014-01-06 Marek Polacek <polacek@redhat.com>
10751
10752 PR c/57773
10753 * c-decl.c (check_bitfield_type_and_width): Warn for implementation
10754 defined bit-field types only in ISO C.
10755
23a5b65a
RS
107562014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
10757
10758 Update copyright years
10759
f9030485
RS
107602014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
10761
10762 * c-array-notation.c: Use the standard form for the copyright notice.
10763
41958c28
BI
107642013-12-18 Balaji V. Iyer <balaji.v.iyer@intel.com>
10765
10766 * c-parser.c (struct c_parser::cilk_simd_fn_tokens): Added new field.
10767 (c_parser_declaration_or_fndef): Added a check if cilk_simd_fn_tokens
10768 field in parser is not empty. If not-empty, call the function
10769 c_parser_finish_omp_declare_simd.
10770 (c_parser_cilk_clause_vectorlength): Modified function to be shared
10771 between SIMD-enabled functions and #pragma simd. Added new parameter.
10772 (c_parser_cilk_all_clauses): Modified the usage of the function
10773 c_parser_cilk_clause_vectorlength as mentioned above.
10774 (c_parser_cilk_simd_fn_vector_attrs): New function.
10775 (c_finish_cilk_simd_fn_tokens): Likewise.
10776 (is_cilkplus_vector_p): Likewise.
10777 (c_parser_omp_clause_name): Added checking for "vectorlength,"
10778 "nomask," and "mask" strings in clause name.
10779 (c_parser_omp_all_clauses): Added 3 new case statements:
10780 PRAGMA_CILK_CLAUSE_VECTORLENGTH, PRAGMA_CILK_CLAUSE_MASK and
10781 PRAGMA_CILK_CLAUSE_NOMASK.
10782 (c_parser_attributes): Added a cilk_simd_fn_tokens parameter. Added a
10783 check for vector attribute and if so call the function
10784 c_parser_cilk_simd_fn_vector_attrs. Also, when Cilk plus is enabled,
10785 called the function c_finish_cilk_simd_fn_tokens.
10786 (c_finish_omp_declare_simd): Added a check if cilk_simd_fn_tokens in
10787 parser field is non-empty. If so, parse them as you would parse
10788 the omp declare simd pragma.
10789 (c_parser_omp_clause_linear): Added a new bool parm. is_cilk_simd_fn.
10790 Added a check when step is a parameter and flag it as error.
10791 (CILK_SIMD_FN_CLAUSE_MASK): New #define.
10792 (c_parser_cilk_clause_name): Changed pragma_cilk_clause to
10793 pragma_omp_clause.
10794
cef0fd0e
TS
107952013-12-17 Thomas Schwinge <thomas@codesourcery.com>
10796
10797 * c-parser.c (c_parser_omp_parallel): Fix description.
10798
12893402
BI
107992013-12-11 Balaji V. Iyer <balaji.v.iyer@intel.com>
10800
10801 * c-objc-common.h (LANG_HOOKS_CILKPLUS_FRAME_CLEANUP): Remove.
10802 (LANG_HOOKS_CILKPLUS_DETECT_SPAWN_AND_UNWRAP): Likewise.
10803 (LANG_HOOKS_CILKPLUS_CILKPLUS_GIMPLIFY_SPAWN): Likewise.
10804 * c-typeck.c (cilk_install_body_with_frame_cleanup): New function.
10805
296674db
JM
108062013-12-04 Joseph Myers <joseph@codesourcery.com>
10807
10808 PR c/52023
10809 * c-parser.c (c_parser_alignas_specifier): Use
10810 c_sizeof_or_alignof_type instead of c_alignof.
10811 (c_parser_alignof_expression): Likewise, with min_alignof
10812 parameter depending on alignof spelling used.
10813
edd28054
MP
108142013-12-04 Marek Polacek <polacek@redhat.com>
10815
10816 PR c/54113
10817 * c-decl.c (start_function): Don't warn for missing prototype for
10818 inline functions.
10819
da0fc454
MP
108202013-12-03 Marek Polacek <polacek@redhat.com>
10821
10822 PR c/59351
10823 * c-decl.c (build_compound_literal): Allow compound literals with
10824 empty initial value.
10825
4c2ecab0
JM
108262013-12-02 Joseph Myers <joseph@codesourcery.com>
10827
10828 PR c/58235
10829 * c-typeck.c (build_modify_expr): Diagnose assignment to
10830 expression with array type.
10831
340baef7
JM
108322013-11-29 Joseph Myers <joseph@codesourcery.com>
10833
10834 PR c/42262
10835 * c-typeck.c (process_init_element): Do not treat a string as
10836 initializing a whole array when used with a designator for an
10837 individual element.
10838
6763b9f7
JM
108392013-11-29 Joseph Myers <joseph@codesourcery.com>
10840
10841 PR c/57574
10842 * c-decl.c (merge_decls): Clear DECL_EXTERNAL for a definition of
10843 an inline function following a static declaration.
10844
e7bd1de1
JJ
108452013-11-28 Jakub Jelinek <jakub@redhat.com>
10846
10847 PR c/59310
10848 * c-parser.c (c_parser_omp_target): Copy "#pragma omp target"
10849 to p_name before calling c_parser_omp_teams instead of after.
10850 (c_parser_cilk_simd): Remove wrong ATTRIBUTE_UNUSED from parser
10851 argument. Remove unused p_name variable.
10852
0136f8f0
AH
108532013-11-27 Aldy Hernandez <aldyh@redhat.com>
10854 Jakub Jelinek <jakub@redhat.com>
10855
10856 * c-decl.c (c_builtin_function_ext_scope): Avoid binding if
10857 external_scope is NULL.
10858
241b71bb
TV
108592013-11-27 Tom de Vries <tom@codesourcery.com>
10860 Marc Glisse <marc.glisse@inria.fr>
10861
10862 PR c++/59032
10863 * c-typeck.c (build_unary_op): Allow vector increment and decrement.
10864
2fb9a547
AM
108652013-11-22 Andrew MacLeod <amacleod@redhat.com>
10866
10867 * c-typeck.c: Add required include files from gimple.h.
10868
8400e75e
DM
108692013-11-22 David Malcolm <dmalcolm@redhat.com>
10870
10871 * c-decl.c (define_label, shadow_tag_warned)
10872 (check_bitfield_type_and_width, grokdeclarator, grokparms,
10873 store_parm_decls_newstyle, store_parm_decls_oldstyle)
10874 (declspecs_add_type): Remove use of in_system_header macro.
10875 * c-parser.c (c_parser_unary_expression): Likewise.
10876 * c-typeck.c (store_init_value, process_init_element)
10877 (c_start_case): Likewise.
10878
10879 * c-decl.c (build_enumerator): Remove use of EXPR_LOC_OR_HERE
10880 macro.
10881
10882 * c-parser.c (c_parser_set_source_position_from_token): Remove
10883 reference to in_system_header from comment.
10884
386b1f1f
RS
108852013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
10886
10887 * c-decl.c (grokdeclarator): Update comment to refer to
10888 tree_to_[su]hwi rather than tree_low_cst.
10889
ae7e9ddd
RS
108902013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
10891
10892 * c-decl.c, c-typeck.c: Replace tree_low_cst (..., 1) with
10893 tree_to_uhwi throughout.
10894
9439e9a1
RS
108952013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
10896
10897 * c-parser.c: Replace tree_low_cst (..., 0) with tree_to_shwi
10898 throughout.
10899
9541ffee
RS
109002013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
10901
10902 * c-parser.c: Replace host_integerp (..., 0) with tree_fits_shwi_p
10903 throughout.
10904
c02065fc
AH
109052013-11-15 Aldy Hernandez <aldyh@redhat.com>
10906
10907 * c-parser.c (c_parser_cilk_simd): New.
10908 (c_parser_cilk_verify_simd): New.
10909 (c_parser_pragma): Add case for PRAGMA_CILK_SIMD.
10910 (c_parser_omp_for_loop): Add case for NE_EXPR.
10911 Set c_break_label for CILK_SIMD.
10912 (c_parser_cilk_clause_vectorlength): New.
10913 (c_parser_cilk_clause_linear): New.
10914 (c_parser_cilk_clause_name): New.
10915 (c_parser_cilk_all_clauses): New.
10916 * c-typeck.c (build_unary_op): Pass location argument to
10917 readonly_error.
10918 (build_modify_expr): Same.
10919 (build_asm_expr): Same.
10920 (c_finish_bc_stmt): Error on break/continue in loops.
10921
18f429e2
AM
109222013-11-14 Andrew MacLeod <amacleod@redhat.com>
10923
10924 * c-typeck.c: Include only gimplify.h and gimple.h as needed.
10925
d8a2d370
DN
109262013-11-14 Diego Novillo <dnovillo@google.com>
10927
10928 * c-decl.c: Include print-tree.h.
10929 Include stor-layout.h.
10930 Include varasm.h.
10931 Include attribs.h.
10932 Include stringpool.h.
10933 * c-lang.c: Include fold-const.h.
10934 * c-parser.c: Include stringpool.h.
10935 Include attribs.h.
10936 Include stor-layout.h.
10937 Include varasm.h.
10938 Include trans-mem.h.
10939 * c-typeck.c: Include stor-layout.h.
10940 Include trans-mem.h.
10941 Include varasm.h.
10942 Include stmt.h.
10943
38b7bc7f
JM
109442013-11-13 Joseph Myers <joseph@codesourcery.com>
10945
10946 * c-tree.h (c_typespec_keyword): Add cts_auto_type.
10947 * c-decl.c (declspecs_add_type, finish_declspecs): Handle
10948 __auto_type.
10949 * c-parser.c (c_token_starts_typename, c_token_starts_declspecs)
10950 (c_parser_attribute_any_word, c_parser_objc_selector): Handle
10951 RID_AUTO_TYPE.
10952 (c_parser_declspecs): Take argument AUTO_TYPE_OK.
10953 (c_parser_declaration_or_fndef, c_parser_struct_declaration)
10954 (c_parser_declarator, c_parser_direct_declarator_inner)
10955 (c_parser_parameter_declaration, c_parser_type_name): All callers
10956 changed.
10957 (c_parser_declaration_or_fndef): Handle declarations with type
10958 determined from the initializer.
10959
45b0be94
AM
109602013-11-12 Andrew MacLeod <amacleod@redhat.com>
10961
18f429e2 10962 * c-typeck.c: Include gimplify.h.
45b0be94 10963
582d9b50
JM
109642013-11-12 Joseph Myers <joseph@codesourcery.com>
10965
10966 * c-tree.h (struct c_declspecs): Add thread_gnu_p field.
10967 * c-parser.c (c_parser_declspecs): Mention _Thread_local in
10968 comment.
10969 * c-decl.c (shadow_tag_warned, grokdeclarator): Mention __thread
10970 or _Thread_local as appropriate in diagnostics.
10971 (build_null_declspecs): Initialize ret->thread_gnu_p.
10972 (declspecs_add_scspec): Handle either __thread or _Thread_local
10973 for RID_THREAD. Diagnose _Thread_local for pre-C11 standards if
10974 pedantic. Do not disallow _Thread_local extern and _Thread_local
10975 static.
10976
267bac10
JM
109772013-11-07 Joseph Myers <joseph@codesourcery.com>
10978 Andrew MacLeod <amacleod@redhat.com>
10979
10980 * c-aux-info.c (gen_type): Handle atomic qualifier.
10981 * c-decl.c (validate_proto_after_old_defn): Do not remove atomic
10982 qualifiers when compating types.
10983 (shadow_tag_warned): Handle atomic_p in declspecs.
10984 (quals_from_declspecs): Likewise.
10985 (start_decl): Use c_type_promotes_to when promoting argument
10986 types.
10987 (grokdeclarator): Handle _Atomic.
10988 (get_parm_info): Diagnose any qualifier on "void" as only
10989 parameter.
10990 (store_parm_decls_oldstyle): Do not remove atomic qualifiers when
10991 comparing types. Use c_type_promotes_to when promoting argument
10992 types.
10993 (finish_function): Use c_type_promotes_to when promoting argument
10994 types.
10995 (build_null_declspecs): Handle atomic_p in declspecs.
10996 (declspecs_add_qual): Handle RID_ATOMIC.
10997 * c-parser.c (c_token_starts_typename, c_token_is_qualifier)
10998 (c_token_starts_declspecs): Handle RID_ATOMIC.
10999 (c_parser_declspecs): Handle atomic type specifiers and
11000 qualifiers.
11001 (c_parser_typeof_specifier): Remove const and _Atomic qualifiers
11002 from types of expressions with atomic type.
11003 (c_parser_direct_declarator_inner): Use convert_lvalue_to_rvalue.
11004 (c_parser_attribute_any_word): Handle RID_ATOMIC.
11005 (c_parser_initializer, c_parser_initelt, c_parser_initval)
11006 (c_parser_statement_after_labels, c_parser_switch_statement)
11007 (c_parser_for_statement, c_parser_expr_no_commas)
11008 (c_parser_conditional_expression, c_parser_binary_expression)
11009 (c_parser_cast_expression, c_parser_unary_expression)
11010 (c_parser_postfix_expression)
11011 (c_parser_postfix_expression_after_primary, c_parser_expression):
11012 Use convert_lvalue_to_rvalue.
11013 (c_parser_expression_conv, c_parser_expr_list): Document
11014 conversion of lvalues to rvalues. Use convert_lvalue_to_rvalue.
11015 (c_parser_objc_synchronized_statement): Use
11016 convert_lvalue_to_rvalue.
11017 (c_parser_objc_selector): Handle RID_ATOMIC.
11018 (c_parser_objc_receiver, c_parser_array_notation): Use
11019 convert_lvalue_to_rvalue.
11020 * c-tree.h (ctsk_typeof): Adjust comment to mention use for
11021 _Atomic (type-name).
11022 (struct c_declspecs): Add atomic_p field.
11023 (convert_lvalue_to_rvalue): Declare.
11024 * c-typeck.c (c_type_promotes_to): Promote atomic types to
11025 corresponding atomic types.
11026 (qualify_type): Don't add _Atomic qualifiers from second argument.
11027 (comp_target_types): Do not allow _Atomic mismatches.
11028 (type_lists_compatible_p): Do not remove atomic qualifiers when
11029 comparing types.
11030 (really_atomic_lvalue, convert_lvalue_to_rvalue)
11031 (build_atomic_assign): New functions.
11032 (build_unary_op): Use build_atomic_assign for atomic increment and
11033 decrement.
11034 (build_conditional_expr): Do not treat _Atomic void as a qualified
11035 version of void.
11036 (build_modify_expr): Use build_atomic_assign for atomic LHS.
11037 (find_anonymous_field_with_type, convert_to_anonymous_field)
11038 (convert_for_assignment): Do not remove atomic qualifiers when
11039 comparing types.
11040 (digest_init): Do not accept initialization of arrays of atomic
11041 elements by string constants.
11042 (build_asm_expr): Use convert_lvalue_to_rvalue.
11043 (build_binary_op): Do not treat _Atomic void as a qualified
11044 version of void.
11045
0c249d4b
DD
110462013-11-06 DJ Delorie <dj@redhat.com>
11047
11048 * c-decl.c (locate_old_decl): If a previous conflicting decl is
11049 both explicit and builtin, print the location of the explicit one.
11050
6d7f7e0a
TB
110512013-11-05 Tobias Burnus <burnus@net-b.de>
11052
11053 * c-parser.c (c_parser_omp_for, c_parser_omp_parallel,
11054 c_parser_omp_distribute, c_parser_omp_teams,
11055 c_parser_omp_target, c_parser_omp_declare): Handle
11056 -fopenmp-simd.
11057
b906f4ca
MP
110582013-11-03 Marek Polacek <polacek@redhat.com>
11059
11060 * c-decl.c (grokdeclarator): Add VLA instrumentation.
11061
ee1d5a02
JJ
110622013-11-01 Jakub Jelinek <jakub@redhat.com>
11063
11064 * c-typeck.c (c_finish_omp_clauses) <case OMP_CLAUSE_UNIFORM>: Go to
11065 check_dup_generic at the end, unless remove is true.
11066 (c_finish_omp_clauses) <case OMP_CLAUSE_REDUCTION>: Add break; after
11067 remove = true;.
11068 (c_finish_omp_clauses) <case OMP_CLAUSE_COPYIN>: Likewise.
11069
5a9785fb
JJ
110702013-10-31 Jakub Jelinek <jakub@redhat.com>
11071
11072 * c-typeck.c (c_finish_omp_clauses): Diagnose aligned clause
11073 with decl that is not pointer nor array.
11074
939b37da
BI
110752013-10-29 Balaji V. Iyer <balaji.v.iyer@intel.com>
11076
11077 * c-decl.c (finish_function): Added a call for insert_cilk_frame when
11078 a spawning function is found.
11079 * c-objc-common.h (LANG_HOOKS_CILKPLUS_GIMPLIFY_SPAWN): New #define.
11080 (LANG_HOOKS_CILKPLUS_FRAME_CLEANUP): Likewise.
11081 (LANG_HOOKS_CILKPLUS_DETECT_SPAWN_AND_UNWRAP): Likewise.
11082 * c-parser.c (c_parser_statement_after_labels): Added RID_CILK_SYNC
11083 case.
11084 (c_parser_postfix_expression): Added RID_CILK_SPAWN case.
11085 * c-typeck.c (build_compound_expr): Reject _Cilk_spawn in a comma
11086 expr.
11087 (c_finish_return): Added a check to reject _Cilk_spawn in return
11088 expression.
11089 (build_cilk_spawn): New function.
11090 (build_cilk_sync): Likewise.
11091 * Makefile.in (c-decl.o): Added cilk.h in dependency list.
ab20d992 11092
d4af74d4
TB
110932013-10-27 Tobias Burnus <burnus@net-b.de>
11094
11095 PR other/33426
11096 * c-parser.c (c_parser_while_statement, c_parser_while_statement,
11097 c_parser_pragma): Add GCC ivdep support to 'do' and 'while'.
11098 (c_parser_statement_after_labels): Update calls.
11099
d73749df 111002013-10-24 Tobias Burnus <burnus@net-b.de>
8170608b
TB
11101
11102 PR other/33426
11103 * c-parser.c (c_parser_pragma, c_parser_for_statement):
11104 Handle PRAGMA_IVDEP.
11105 (c_parser_statement_after_labels): Update call.
11106
f28aa681
MP
111072013-10-24 Marek Polacek <polacek@redhat.com>
11108
11109 * c-parser.c (c_parser_struct_declaration): Add a comment.
11110 (c_parser_declarator): Don't allow _Alignas here.
11111
0645c1a2
AM
111122013-10-17 Andrew MacLeod <amacleod@redhat.com>
11113
11114 * c-parser.c: Include omp-low.h.
11115 * c-typeck.c: Likewise.
11116
568a31f2
MP
111172013-10-17 Marek Polacek <polacek@redhat.com>
11118
11119 PR c/58267
11120 * c-parser.c (c_parser_declspecs): Add alignspec_ok parameter.
11121 Document syntax of the array-declarator.
11122 (c_parser_declspecs) <RID_ALIGNAS>: Bail out if alignment specs
11123 are not permitted.
11124 (c_parser_declaration_or_fndef): Adjust c_parser_declspecs call.
11125 (c_parser_struct_declaration): Likewise.
11126 (c_parser_declarator): Likewise.
11127 (c_parser_direct_declarator_inner): Likewise.
11128 (c_parser_parameter_declaration): Likewise.
11129 (c_parser_type_name): Likewise.
11130
acf0174b
JJ
111312013-10-11 Jakub Jelinek <jakub@redhat.com>
11132
11133 * c-lang.h (current_omp_declare_target_attribute): New extern
11134 decl.
11135 * c-parser.c: Include c-lang.h.
11136 (struct c_parser): Change tokens to c_token *.
11137 Add tokens_buf field. Change tokens_avail type to unsigned int.
11138 (c_parser_consume_token): If parser->tokens isn't
11139 &parser->tokens_buf[0], increment parser->tokens.
11140 (c_parser_consume_pragma): Likewise.
11141 (enum pragma_context): Add pragma_struct and pragma_param.
11142 (c_parser_external_declaration): Adjust
11143 c_parser_declaration_or_fndef caller.
11144 (c_parser_declaration_or_fndef): Add omp_declare_simd_clauses
11145 argument, if it is non-vNULL vector, call c_finish_omp_declare_simd.
11146 Adjust recursive call.
11147 (c_parser_struct_or_union_specifier): Use pragma_struct instead
11148 of pragma_external.
11149 (c_parser_parameter_declaration): Use pragma_param instead of
11150 pragma_external.
11151 (c_parser_compound_statement_nostart, c_parser_label,
11152 c_parser_for_statement): Adjust
11153 c_parser_declaration_or_fndef callers.
11154 (c_parser_expr_no_commas): Add omp_atomic_lhs argument, pass
11155 it through to c_parser_conditional_expression.
11156 (c_parser_conditional_expression): Add omp_atomic_lhs argument,
11157 pass it through to c_parser_binary_expression. Adjust recursive
11158 call.
11159 (c_parser_binary_expression): Remove prec argument, add
11160 omp_atomic_lhs argument instead. Always start from PREC_NONE, if
11161 omp_atomic_lhs is non-NULL and one of the arguments of toplevel
11162 binop matches it, use build2 instead of parser_build_binary_op.
11163 (c_parser_pragma): Handle PRAGMA_OMP_CANCEL,
11164 PRAGMA_OMP_CANCELLATION_POINT, PRAGMA_OMP_TARGET,
11165 PRAGMA_OMP_END_DECLARE_TARGET, PRAGMA_OMP_DECLARE_REDUCTION.
11166 Handle pragma_struct and pragma_param the same as pragma_external.
11167 (c_parser_omp_clause_name): Parse new OpenMP 4.0 clause names.
11168 (c_parser_omp_variable_list): Parse array sections for
11169 OMP_CLAUSE_{DEPEND,MAP,TO,FROM} clauses.
11170 (c_parser_omp_clause_collapse): Fully fold collapse expression.
11171 (c_parser_omp_clause_reduction): Handle user defined reductions.
11172 (c_parser_omp_clause_branch, c_parser_omp_clause_cancelkind,
11173 c_parser_omp_clause_num_teams, c_parser_omp_clause_thread_limit,
11174 c_parser_omp_clause_aligned, c_parser_omp_clause_linear,
11175 c_parser_omp_clause_safelen, c_parser_omp_clause_simdlen,
11176 c_parser_omp_clause_depend, c_parser_omp_clause_map,
11177 c_parser_omp_clause_device, c_parser_omp_clause_dist_schedule,
11178 c_parser_omp_clause_proc_bind, c_parser_omp_clause_to,
11179 c_parser_omp_clause_from, c_parser_omp_clause_uniform): New functions.
11180 (c_parser_omp_all_clauses): Add finish_p argument. Don't call
11181 c_finish_omp_clauses if it is false. Handle new OpenMP 4.0 clauses.
11182 (c_parser_omp_atomic): Parse seq_cst clause, pass true if it is
11183 present to c_finish_omp_atomic. Handle OpenMP 4.0 atomic forms.
11184 (c_parser_omp_for_loop): Add CODE argument, pass it through
11185 to c_finish_omp_for. Change last argument to cclauses,
11186 and adjust uses to grab parallel clauses from the array of all
11187 the split clauses. Adjust c_parser_binary_expression,
11188 c_parser_declaration_or_fndef and c_finish_omp_for callers.
11189 (omp_split_clauses): New function.
11190 (c_parser_omp_simd): New function.
11191 (c_parser_omp_for): Add p_name, mask and cclauses arguments.
11192 Allow the function to be called also when parsing combined constructs,
11193 and call c_parser_omp_simd when parsing for simd.
11194 (c_parser_omp_sections_scope): If section-sequence doesn't start with
11195 #pragma omp section, require exactly one structured-block instead of
11196 sequence of statements.
11197 (c_parser_omp_sections): Add p_name, mask and cclauses arguments.
11198 Allow the function to be called also when parsing combined constructs.
11199 (c_parser_omp_parallel): Add p_name, mask and cclauses arguments.
11200 Allow the function to be called also when parsing combined
11201 constructs.
11202 (c_parser_omp_taskgroup, c_parser_omp_cancel,
11203 c_parser_omp_cancellation_point, c_parser_omp_distribute,
11204 c_parser_omp_teams, c_parser_omp_target_data,
11205 c_parser_omp_target_update, c_parser_omp_target,
11206 c_parser_omp_declare_simd, c_finish_omp_declare_simd,
11207 c_parser_omp_declare_target, c_parser_omp_end_declare_target,
11208 c_parser_omp_declare_reduction, c_parser_omp_declare): New functions.
11209 (c_parser_omp_construct): Add p_name and mask vars. Handle
11210 PRAGMA_OMP_DISTRIBUTE, PRAGMA_OMP_SIMD, PRAGMA_OMP_TASKGROUP,
11211 PRAGMA_OMP_TEAMS. Adjust c_parser_omp_for, c_parser_omp_parallel
11212 and c_parser_omp_sections callers.
11213 (c_parse_file): Initialize tparser.tokens and the_parser->tokens here.
11214 (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK,
11215 OMP_SINGLE_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1.
11216 (OMP_PARALLEL_CLAUSE_MASK): Likewise. Add OMP_CLAUSE_PROC_BIND.
11217 (OMP_TASK_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1. Add
11218 OMP_CLAUSE_DEPEND.
11219 (OMP_SIMD_CLAUSE_MASK, OMP_CANCEL_CLAUSE_MASK,
11220 OMP_CANCELLATION_POINT_CLAUSE_MASK, OMP_DISTRIBUTE_CLAUSE_MASK,
11221 OMP_TEAMS_CLAUSE_MASK, OMP_TARGET_DATA_CLAUSE_MASK,
11222 OMP_TARGET_UPDATE_CLAUSE_MASK, OMP_TARGET_CLAUSE_MASK,
11223 OMP_DECLARE_SIMD_CLAUSE_MASK): Define.
11224 * c-typeck.c: Include tree-inline.h.
11225 (c_finish_omp_cancel, c_finish_omp_cancellation_point,
11226 handle_omp_array_sections_1, handle_omp_array_sections,
11227 c_clone_omp_udr, c_find_omp_placeholder_r): New functions.
11228 (c_finish_omp_clauses): Handle new OpenMP 4.0 clauses and
11229 user defined reductions.
11230 (c_tree_equal): New function.
11231 * c-tree.h (temp_store_parm_decls, temp_pop_parm_decls,
11232 c_finish_omp_cancel, c_finish_omp_cancellation_point, c_tree_equal,
11233 c_omp_reduction_id, c_omp_reduction_decl, c_omp_reduction_lookup,
11234 c_check_omp_declare_reduction_r): New prototypes.
11235 * c-decl.c (current_omp_declare_target_attribute): New variable.
11236 (c_decl_attributes): New function.
11237 (start_decl, start_function): Use it instead of decl_attributes.
11238 (temp_store_parm_decls, temp_pop_parm_decls, c_omp_reduction_id,
11239 c_omp_reduction_decl, c_omp_reduction_lookup,
11240 c_check_omp_declare_reduction_r): New functions.
11241
0a6c2227
TT
112422013-09-25 Tom Tromey <tromey@redhat.com>
11243
11244 * Make-lang.in (c/gccspec.o): Remove.
11245 (CFLAGS-c/gccspec.o): New variable.
11246 (cc1-checksum.o, C_TREE_H, c/c-aux-info.o, c/c-convert.o)
11247 (c/c-decl.o, c/c-errors.o, c/c-lang.o, c/c-objc-common.o)
11248 (c/c-parser.o, c/c-typeck.o, c/c-array-notation.o): Remove.
11249
f3bc55f0
TT
112502013-09-25 Tom Tromey <tromey@redhat.com>
11251
11252 * Make-lang.in (c/gccspec.o): Don't use subshell.
11253
a24d975c
MP
112542013-09-18 Marek Polacek <polacek@redhat.com>
11255
11256 PR sanitize/58443
11257 * c-typeck.c (build_binary_op): Properly honor -fsanitize options.
11258 Remove unnecessary check.
11259
ce6923c5
MP
112602013-09-18 Marek Polacek <polacek@redhat.com>
11261
11262 PR sanitizer/58411
11263 * c-typeck.c (build_binary_op): Don't sanitize function if it has the
11264 no_sanitize_undefined attribute.
11265
a1e51df9
KT
112662013-09-13 Kai Tietz <ktietz@redhat.com>
11267
11268 PR target/57848
11269 * c-decl.c (c_builtin_function_ext_scope): Remove
11270 wrong assumption that it is never called on prexisting
11271 symbol.
11272
0af94e6f
JR
112732013-09-08 Joern Rennecke <joern.rennecke@embecosm.com>
11274
11275 * c-typeck.c (build_binary_op): Use vector_types_compatible_elements_p.
11276
20059c8b
GDR
112772013-09-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
11278
11279 * c-objc-common.c (c_tree_printer): Tidy.
11280
de5a5fa1
MP
112812013-08-30 Marek Polacek <polacek@redhat.com>
11282
11283 * c-typeck.c (build_binary_op): Add division by zero and shift
11284 instrumentation.
11285
2531a1d9 112862013-08-26 Joern Rennecke <joern.rennecke@embecosm.com>
0fdd4508 11287 Joseph Myers <joseph@codesourcery.com>
2531a1d9 11288
6e2bcc98 11289 PR c/35649
2531a1d9
JR
11290 * c-typeck.c (c_common_type): Prefer double_type_node over
11291 other REAL_TYPE types with the same precision.
11292 (convert_arguments): Likewise.
11293
025311c4
GDR
112942013-08-23 Gabriel Dos Reis <gdr@integrable-solutions.net>
11295
11296 * c-objc-common.c (c_tree_printer): Document the nature of the cast.
11297 (c_initialize_diagnostics): Call a destructor for the early printer.
11298
da6ca2b5
GDR
112992013-08-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
11300
11301 * c-objc-common.c (c_initialize_diagnostics): Simplify C pretty
11302 printer initialization.
11303
318cda85 113042013-08-19 Balaji V. Iyer <balaji.v.iyer@intel.com>
da6ca2b5 11305
318cda85
BI
11306 PR c/57490
11307 * c-array-notation.c (fix_conditional_array_notations_1): Added a
11308 check for truth values.
11309 (expand_array_notation_exprs): Added truth values case. Removed an
11310 unwanted else. Added for-loop to walk through subtrees in default
11311 case.
11312
b066401f
GDR
113132013-08-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
11314
11315 * c-objc-common.c (c_initialize_diagnostics): Don't call pp_base.
11316
fb48aadc
JM
113172013-07-23 Joseph Myers <joseph@codesourcery.com>
11318
11319 * c-parser.c (struct c_generic_association): Fix typo.
11320
433cc7b0
TT
113212013-07-23 Tom Tromey <tromey@redhat.com>
11322 Joseph Myers <joseph@codesourcery.com>
11323
11324 * c-parser.c (struct c_generic_association): New.
11325 (c_generic_association_d): New typedef.
11326 (c_parser_generic_selection): New function.
11327 (c_parser_postfix_expression): Handle RID_GENERIC.
11328
26d40c3d
JM
113292013-07-13 Jason Merrill <jason@redhat.com>
11330
11331 PR c++/57793
11332 * c-decl.c (finish_struct): Check for too-large class.
11333
ecdbd01a 113342013-07-04 Joern Rennecke <joern.rennecke@embecosm.com>
40d3d530
JR
11335
11336 PR c/57821
11337 * c-typeck.c (set_init_index): When folding, check for index overflow.
11338
1141ed3f
BI
113392013-06-28 Balaji V. Iyer <balaji.v.iyer@intel.com>
11340
11341 * c-parser.c (c_parser_array_notation): Removed rejection of array
11342 notations in an array of function pointers.
11343
713b46fa
BI
113442013-06-21 Balaji V. Iyer <balaji.v.iyer@intel.com>
11345
11346 * c-array-notation.c (make_triplet_val_inv): New function.
11347 (create_cmp_incr): Likewise.
11348 (create_array_refs): Likewise.
11349 (fix_builtin_array_notation_fn): Replaced all mallocs with tree vec.
11350 Also modularized common parts between functions and called the function.
11351 (build_array_notation_expr): Likewise.
11352 (fix_conditional_array_notations_1): Likewise.
11353 (fix_array_notation_expr): Likewise.
11354 (fix_array_notation_call_expr): Likewise.
11355
92f20202
MP
113562013-06-18 Marek Polacek <polacek@redhat.com>
11357
11358 PR c/57630
11359 * c-decl.c (check_for_loop_decls): Improve diagnostics messages.
11360
73a23b06
BI
113612013-06-12 Balaji V. Iyer <balaji.v.iyer@intel.com>
11362
11363 * c-array-notation.c (build_array_notation_expr): Reject array notation
11364 mismatch between LHS and RHS even inside a call_expr. Also, removed
11365 a couple while statements that were dead code.
11366
00b8517d
BI
113672013-06-10 Balaji V. Iyer <balaji.v.iyer@intel.com>
11368
11369 * c-array-notation.c (fix_builtin_array_notation_fn): Fully folded
11370 excessive precision expressions in function parameters. Also removed
11371 couple unwanted while statements.
11372
1509bdda
BI
113732013-06-07 Balaji V. Iyer <balaji.v.iyer@intel.com>
11374
11375 * c-array-notation.c (expand_array_notation_exprs): Added
11376 ARRAY_NOTATION_REF case.
ab20d992 11377
d60f1706
BI
113782013-06-07 Balaji V. Iyer <balaji.v.iyer@intel.com>
11379
11380 * c-array-notation.c (length_mismatch_in_expr_p): Moved this
11381 function to c-family/array-notation-common.c.
11382 (is_cilkplus_reduce_builtin): Likewise.
11383 (find_rank): Likewise.
11384 (extract_array_notation_exprs): Likewise.
11385 (replace_array_notations): Likewise.
11386 (find_inv_trees): Likewise.
11387 (replace_inv_trees): Likewise.
11388 (contains_array_notation_expr): Likewise.
11389 (find_correct_array_notation_type): Likewise.
11390 (replace_invariant_exprs): Initialized additional_tcodes to NULL.
11391 (struct inv_list): Moved this to c-family/array-notation-common.c.
11392 * c-tree.h (is_cilkplus_builtin_reduce): Remove prototype.
ab20d992 11393
6d6efbb3
BI
113942013-06-05 Balaji V. Iyer <balaji.v.iyer@intel.com>
11395
11396 * c-typeck.c (convert_arguments): Moved checking of builtin cilkplus
11397 reduction functions outside the for-loop. Added a check if the fundecl
11398 is non-NULL. Finally, removed an unwanted if-statement, and made the
11399 body unconditional.
11400
25c22937
BI
114012013-06-03 Balaji V. Iyer <balaji.v.iyer@intel.com>
11402
11403 * c-typeck.c (c_finish_if_stmt): Added a check to see if the rank of the
11404 condition of the if-statement matches the rank of else-block and then-
11405 block when array notations are used.
11406 * c-parser.c (c_parser_declaration_or_fndef): Expanded array notation
11407 expression after the entire function body is parsed.
11408 (c_parser_expr_no_commas): Delayed creating array notation expressions
11409 to the end of function parsing.
11410 * c-array-notation.c (fix_conditional_array_notations_1): Expanded the
11411 whole if-statement instead of just the condition.
ab20d992 11412 (expand_array_notation_exprs): Added MODIFY_EXPR case.
25c22937 11413
edd25645
BI
114142013-06-03 Balaji V. Iyer <balaji.v.iyer@intel.com>
11415
11416 PR c/57474
11417 * c-array-notation.c (build_array_notation_expr): Initialized rhs_length
11418 array to NULL_TREE if they are unused. Also added a check for the
11419 field to be NULL before its fields are used in future.
ab20d992 11420
065ce7f1
RO
114212013-05-29 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
11422
11423 PR bootstrap/57450
11424 * c-array-notation.c (length_mismatch_in_expr_p): Use absu_hwi.
11425 (build_array_notation_expr): Likewise.
11426
36536d79
BI
114272013-05-28 Balaji V. Iyer <balaji.v.iyer@intel.com>
11428
11429 * c-typeck.c (build_array_ref): Added a check to see if array's
11430 index is greater than one. If true, then emit an error.
11431 (build_function_call_vec): Exclude error reporting and checking
11432 for builtin array-notation functions.
11433 (convert_arguments): Likewise.
11434 (c_finish_return): Added a check for array notations as a return
11435 expression. If true, then emit an error.
11436 (c_finish_loop): Added a check for array notations in a loop
11437 condition. If true then emit an error.
11438 (lvalue_p): Added a ARRAY_NOTATION_REF case.
11439 (build_binary_op): Added a check for array notation expr inside
11440 op1 and op0. If present, we call another function to find correct
11441 type.
11442 * Make-lang.in (C_AND_OBJC_OBJS): Added c-array-notation.o.
11443 * c-parser.c (c_parser_compound_statement): Check if array
11444 notation code is used in tree, if so, then transform them into
11445 appropriate C code.
11446 (c_parser_expr_no_commas): Check if array notation is used in LHS
11447 or RHS, if so, then build array notation expression instead of
11448 regular modify.
11449 (c_parser_postfix_expression_after_primary): Added a check for
11450 colon(s) after square braces, if so then handle it like an array
11451 notation. Also, break up array notations in unary op if found.
11452 (c_parser_direct_declarator_inner): Added a check for array
11453 notation.
11454 (c_parser_compound_statement): Added a check for array notation in
11455 a stmt. If one is present, then expand array notation expr.
11456 (c_parser_if_statement): Likewise.
11457 (c_parser_switch_statement): Added a check for array notations in
11458 a switch statement's condition. If true, then output an error.
11459 (c_parser_while_statement): Similarly, but for a while.
11460 (c_parser_do_statement): Similarly, but for a do-while.
11461 (c_parser_for_statement): Similarly, but for a for-loop.
11462 (c_parser_unary_expression): Check if array notation is used in a
11463 pre-increment or pre-decrement expression. If true, then expand
11464 them.
11465 (c_parser_array_notation): New function.
11466 * c-array-notation.c: New file.
11467 * c-tree.h (is_cilkplus_reduce_builtin): Protoize.
ab20d992 11468
cd192ccc
MS
114692013-05-23 Mike Stump <mikestump@comcast.net>
11470
11471 * c-typeck.c (convert_for_assignment): Handle references to memory
11472 spaces better.
11473
427b248d
JM
114742013-05-16 Jason Merrill <jason@redhat.com>
11475
11476 * Make-lang.in (cc1$(exeext)): Use link mutex.
11477
44d90fe1
PC
114782013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
11479
11480 * c-typeck.c (pointer_diff): Change -Wpointer-arith pedwarns
11481 to simply use OPT_Wpointer_arith.
11482 (build_unary_op): Likewise.
11483
4e7d7b3d
JJ
114842013-04-03 Jakub Jelinek <jakub@redhat.com>
11485
11486 PR c/19449
11487 * c-parser.c (c_parser_get_builtin_args): Add choose_expr_p
11488 argument. If set, or it temporarily for parsing of the first
11489 argument into force_folding_builtin_constant_p.
11490 (c_parser_postfix_expression): Adjust callers.
11491
839b422f
RB
114922013-03-21 Richard Biener <rguenther@suse.de>
11493
11494 * c-objc-common.c (c_tree_printer): Use DECL_HAS_DEBUG_EXPR_P
11495 instead of DECL_DEBUG_EXPR_IS_FROM. Guard properly.
11496
2ee028f1
MP
114972013-02-12 Marek Polacek <polacek@redhat.com>
11498
11499 PR c/44938
11500 * c-parser.c (c_parser_postfix_expression_after_primary): Initialize
11501 origtypes to NULL.
11502
8824edff
JJ
115032013-01-24 Jakub Jelinek <jakub@redhat.com>
11504
11505 PR c/56078
11506 * c-typeck.c (set_nonincremental_init_from_string): If
11507 constructor_max_index is NULL, treat it as if tree_int_cst_lt
11508 returned false.
11509 (process_init_element): Likewise.
11510
eadd3d0d
JJ
115112012-12-20 Jakub Jelinek <jakub@redhat.com>
11512
11513 PR c++/55619
11514 * c-parser.c (c_parser_asm_operands): Remove CONVERT_P
11515 argument, don't call default_function_array_conversion
11516 nor c_fully_fold here.
11517 (c_parser_asm_statement): Adjust callers.
11518 * c-typeck.c (build_asm_expr): Call c_fully_fold on inputs
11519 and outputs here, and call default_function_array_conversion
11520 on inputs that don't need to be addressable.
11521
f8a93a2e
JJ
115222012-12-18 Jakub Jelinek <jakub@redhat.com>
11523
11524 PR c/39464
11525 * c-typeck.c (convert_for_assignment): For -Wpointer-sign
11526 warning require that both c_common_unsigned_type as well as
11527 c_common_signed_type is the same for both mvl and mvr types.
11528
9771b263
DN
115292012-11-16 Diego Novillo <dnovillo@google.com>
11530
11531 Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)
11532
11533 * c-common.c: Use new vec API in vec.h.
11534 * c-common.h: Likewise.
11535 * c-gimplify.c: Likewise.
11536 * c-pragma.c: Likewise.
11537 * c-pretty-print.c: Likewise.
11538 * c-pretty-print.h: Likewise.
11539 * c-semantics.c: Likewise.
11540 * c-decl.c: Likewise.
11541 * c-parser.c: Likewise.
11542 * c-tree.h: Likewise.
11543 * c-typeck.c: Likewise.
11544
880661a4
JW
115452012-10-29 Jonathan Wakely <jwakely.gcc@gmail.com>
11546
11547 PR c++/54930
11548 * c-typeck.c (c_finish_return): Use OPT_Wreturn_local_addr.
11549
077d1abe
MLI
115502012-10-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
11551
11552 PR c/53066
11553 * c-decl.c (warn_if_shadowing): Do not warn if a variable
11554 shadows a function, unless the variable is a function or a
11555 pointer-to-function.
11556
3a785c97
JJ
115572012-10-12 Jakub Jelinek <jakub@redhat.com>
11558
11559 PR c/54381
11560 * c-parser.c (struct c_tree_loc_pair): Removed.
11561 (c_parser_expr_list): Remove struct c_tree_loc_pair * argument,
11562 add location_t * and tree * arguments, fill in array of 3
11563 sizeof_arg trees and corresponding locs.
11564 (c_parser_attributes, c_parser_objc_keywordexpr): Adjust
11565 c_parser_expr_list callers.
11566 (c_parser_postfix_expression_after_primary): Likewise. Pass
11567 array of 3 sizeof_arg trees and locs (corresponding to first
11568 3 arguments) to sizeof_pointer_memaccess_warning.
11569
703c8606
LC
115702012-10-09 Lawrence Crowl <crowl@google.com>
11571
11572 * Make-lang.in (c-decl.o): Add dependence on hash-table.h.
11573 * c-decl.c (detect_field_duplicates_hash): Change to new type-safe
11574 hash table.
11575
5d9de0d0
PC
115762012-10-09 Paolo Carlini <paolo.carlini@oracle.com>
11577
11578 PR c++/54194
11579 * c-typeck.c (parser_build_binary_op): Update warn_about_parentheses
11580 call.
11581
a212e43f
MG
115822012-10-09 Marc Glisse <marc.glisse@inria.fr>
11583
11584 PR c++/54427
11585 * c-typeck.c: Include c-common.h.
11586 (enum stv_conv): Moved to c-common.h.
11587 (scalar_to_vector): Moved to c-common.c.
11588 (build_binary_op): Adapt to scalar_to_vector's new prototype.
11589 * Make-lang.in: c-typeck.c depends on c-common.h.
11590
3b78de56
AC
115912012-10-04 Arnaud Charlet <charlet@adacore.com>
11592
11593 * c-decl.c (c_write_global_declarations): Fix handling of
11594 -fdump-ada-spec*.
11595
78c60e3d
SS
115962012-09-30 Sharad Singhai <singhai@google.com>
11597
11598 * c-decl.c (c_write_global_declarations): Use a different method
11599 to determine if the dump has ben initialized.
11600
9f33203d
JM
116012012-09-14 Joseph Myers <joseph@codesourcery.com>
11602
11603 PR c/54552
11604 * c-typeck.c (c_cast_expr): When casting to a type requiring
11605 C_MAYBE_CONST_EXPR to be created, pass the inner expression to
11606 c_fully_fold first.
11607
a27d595d
JM
116082012-09-14 Joseph Myers <joseph@codesourcery.com>
11609
11610 PR c/54103
11611 * c-typeck.c (build_unary_op): Pass original argument of
11612 TRUTH_NOT_EXPR to c_objc_common_truthvalue_conversion, then remove
11613 any C_MAYBE_CONST_EXPR, if it has integer operands.
11614 (build_binary_op): Pass original arguments of TRUTH_ANDIF_EXPR,
11615 TRUTH_ORIF_EXPR, TRUTH_AND_EXPR, TRUTH_OR_EXPR and TRUTH_XOR_EXPR
11616 to c_objc_common_truthvalue_conversion, then remove any
11617 C_MAYBE_CONST_EXPR, if they have integer operands. Use
11618 c_objc_common_truthvalue_conversion not
11619 c_common_truthvalue_conversion.
11620 (c_objc_common_truthvalue_conversion): Build NE_EXPR directly and
11621 call note_integer_operands for arguments with integer operands
11622 that are not integer constants.
11623
9feb29df
JJ
116242012-09-13 Jakub Jelinek <jakub@redhat.com>
11625
11626 PR c/54559
11627 * c-typeck.c (c_finish_return): Do convert to BOOLEAN_TYPE or
11628 COMPLEX_TYPE with in_late_binary_op set temporarily to true.
11629
d409320c
JJ
116302012-08-31 Jakub Jelinek <jakub@redhat.com>
11631
11632 PR c/54428
11633 * c-convert.c (convert): Don't call fold_convert_loc if
11634 TYPE_MAIN_VARIANT of a COMPLEX_TYPE is the same, unless e
11635 is a COMPLEX_EXPR. Remove TYPE_MAIN_VARIANT check from
11636 COMPLEX_TYPE -> COMPLEX_TYPE conversion.
11637
6265d07c
JJ
116382012-08-24 Jakub Jelinek <jakub@redhat.com>
11639
11640 PR c/54355
11641 * c-decl.c (c_parser_label): Pass true as nested and fix up comments
11642 for nested and empty_ok arguments in the call to
11643 c_parser_declaration_or_fndef.
11644
1a4049e7
JJ
116452012-08-17 Jakub Jelinek <jakub@redhat.com>
11646
11647 * c-tree.h (c_last_sizeof_arg): Declare.
11648 * c-parser.c (struct c_tree_loc_pair): New type.
11649 (c_parser_expr_list): Add sizeof_arg argument. Fill it in if
11650 non-NULL.
11651 (c_parser_attributes, c_parser_objc_keywordexpr): Adjust callers.
11652 (c_parser_postfix_expression_after_primary): Likewise. Call
11653 sizeof_pointer_memaccess_warning if needed.
11654 (sizeof_ptr_memacc_comptypes): New function.
11655 * c-typeck.c (c_last_sizeof_arg): New global variable.
11656 (c_expr_sizeof_expr, c_expr_sizeof_type): Initialize it.
11657
0229aee9
UB
116582012-07-24 Uros Bizjak <ubizjak@gmail.com>
11659
11660 * c-lang.h (lang_decl): Add variable_size GTY option.
11661
7ee2468b
SB
116622012-07-16 Steven Bosscher <steven@gcc.gnu.org>
11663
11664 * c-decl.c: Include dumpfile.h instead of tree-dump.h.
11665 * Make-lang.in: Fix dependencies.
11666
d4a10d0a
SB
116672012-06-29 Steven Bosscher <steven@gcc.gnu.org>
11668
11669 * Make-lang.in: New file, rules migrated from gcc/Makefile.in
11670 and add language Makefile hooks.
11671 * config-lang.in: New file.
11672 * c-config-lang.in: Moved from gcc/config-lang.in to here, and
11673 add the required "normal" config-lang.in rules.
11674 * c-lang.h: Moved from gcc/ to here.
11675 * c-tree.h: Likewise.
11676 * c-objc-common.c: Likewise.
11677 * c-objc-common.h: Likewise.
11678 * c-typeck.c: Likewise.
11679 * c-convert.c: Likewise.
11680 * c-lang.c: Likewise.
11681 * c-aux-info.c: Likewise.
11682 * c-errors.c: Likewise.
11683 * gccspec.c: Likewise.
11684 * c-decl.c: Likewise. Include gt-c-c-decl.h, not gt-c-decl.h.
11685 * c-parser.c: Likewise. Include gt-c-c-parser.h, not gt-c-parser.h.
11686\f
9cf2fb5d 11687Copyright (C) 2012-2025 Free Software Foundation, Inc.
d4a10d0a
SB
11688
11689Copying and distribution of this file, with or without modification,
11690are permitted in any medium without royalty provided the copyright
11691notice and this notice are preserved.