blob: 1bf256daa350b0e367541d7fdc6ea1dd5617a846 [file] [log] [blame]
2024-04-19 Martin Uecker <>
Jakub Jelinek <>
PR lto/114574
PR c/114361
* (shadow_tag_warned): For flag_isoc23 and code not
(parser_xref_tag): Likewise.
(start_struct): For flag_isoc23 use SET_TYPE_STRUCTURAL_EQUALITY.
(c_update_type_canonical): New function.
(finish_struct): Put NULL as second == operand rather than first.
Assert TYPE_STRUCTURAL_EQUALITY_P. Call c_update_type_canonical.
* (composite_type_internal): Use
2024-04-09 Jakub Jelinek <>
* (previous_tag): Fix duplicated words in comment; the the
-> the.
(diagnose_mismatched_decls): Fix duplicated words in comment;
about about -> about.
2024-04-05 Martin Uecker <>
2024-04-02 Martin Uecker <>
PR c/114361
* (finish_struct): Set TYPE_CANONICAL when completing
strucute types.
2024-04-02 Martin Uecker <>
PR c/114361
* (finish_struct): Set TYPE_CANONICAL when completing
strucute types.
2024-03-14 Chung-Lin Tang <>
* (c_parser_oacc_data_clause): Add parsing support for
'readonly' modifier, set OMP_CLAUSE_MAP_READONLY if readonly modifier
found, update comments.
(c_parser_oacc_cache): Add parsing support for 'readonly' modifier,
set OMP_CLAUSE__CACHE__READONLY if readonly modifier found, update
2024-03-08 Jakub Jelinek <>
PR debug/113918
* c-tree.h (c_type_dwarf_attribute): Declare.
* c-objc-common.h (LANG_HOOKS_TYPE_DWARF_ATTRIBUTE): Redefine.
* Include dwarf2.h.
(c_type_dwarf_attribute): New function.
2024-02-26 Jakub Jelinek <>
PR c/114042
* (c_parser_postfix_expression): Diagnose
__builtin_stdc_bit_* argument with ENUMERAL_TYPE or BOOLEAN_TYPE
type or if signed here rather than on the replacement builtins
in check_builtin_function_arguments.
2024-02-22 Jakub Jelinek <>
PR c/114007
* (c_parser_std_attribute): Remove loose_scope_p argument.
Instead of checking it, parse 2 CPP_COLONs with the first one with
COLON_SCOPE flag the same as CPP_SCOPE.
(c_parser_std_attribute_list): Remove loose_scope_p argument, don't
pass it to c_parser_std_attribute.
(c_parser_std_attribute_specifier): Adjust c_parser_std_attribute_list
2024-02-13 Tobias Burnus <>
PR middle-end/113904
* (c_parser_omp_context_selector): Handle splitting of
2024-02-10 Jakub Jelinek <>
* (get_parm_array_spec): Use HOST_WIDE_INT_PRINT_UNSIGNED
instead of "%lu" and casts to unsigned long or unsigned long long.
2024-02-08 Joseph Myers <>
PR c/113776
* (c_objc_common_truthvalue_conversion): Return an
integer constant expression for boolean conversion of floating
2024-02-05 Jakub Jelinek <>
PR c/113740
* (finish_struct): Only use build_bitint_type if
bit-field has width larger or equal to minimum _BitInt
2024-01-31 Joseph Myers <>
PR c/112571
* (start_enum): Clear ENUM_FIXED_UNDERLYING_TYPE_P when
defining without a fixed underlying type an enumeration previously
declared with a fixed underlying type.
2024-01-31 Martin Uecker <>
PR c/113438
* (composite_type_internal): Set TYPE_STUB_DECL.
2024-01-31 Joseph Myers <>
PR c/111059
PR c/111911
* c-tree.h (c_objc_common_truthvalue_conversion): Add third
* (c_convert): For conversions to boolean, pass third
argument to c_objc_common_truthvalue_conversion rather than
converting here.
* (build_c_cast): Ensure arguments with integer
operands are marked as such for conversion to boolean.
(c_objc_common_truthvalue_conversion): Add third argument TYPE.
2024-01-21 Martin Uecker <>
PR c/113492
* (grokdeclarator): Use c_common_unsigned_type instead of
unsigned_type_for to create the unsigned type for bitfields declared
with int when using -funsigned-bitfields.
2024-01-12 Jakub Jelinek <>
PR c/113315
* (build_array_ref): If index has BITINT_TYPE type with
precision larger than sizetype precision, convert it to sizetype.
2024-01-11 Julian Brown <>
* (c_parser_braced_init, c_parser_conditional_expression):
Don't allow OpenMP array section.
(c_parser_postfix_expression): Don't allow array section in statement
(c_parser_postfix_expression_after_primary): Add support for OpenMP
array section parsing.
(c_parser_expr_list): Don't allow OpenMP array section here.
(c_parser_omp_variable_list): Change ALLOW_DEREF parameter to
MAP_LVALUE. Support parsing of general lvalues in "map", "to" and
"from" clauses.
(c_parser_omp_var_list_parens): Change ALLOW_DEREF parameter to
MAP_LVALUE. Update call to c_parser_omp_variable_list.
(c_parser_oacc_data_clause): Update calls to
(c_parser_omp_clause_reduction): Use OMP_ARRAY_SECTION tree node
instead of TREE_LIST for array sections.
(c_parser_omp_target): Allow GOMP_MAP_ATTACH.
* c-tree.h (c_omp_array_section_p): Add extern declaration.
(build_omp_array_section): Add prototype.
* (c_omp_array_section_p): Add flag.
(mark_exp_read): Support OMP_ARRAY_SECTION.
(build_omp_array_section): Add function.
(build_external_ref): Tweak error path for OpenMP array sections.
(handle_omp_array_sections_1): Use OMP_ARRAY_SECTION tree code instead
of TREE_LIST. Handle more kinds of expressions.
(c_oacc_check_attachments): Use OMP_ARRAY_SECTION instead of TREE_LIST
for array sections.
(c_finish_omp_clauses): Use OMP_ARRAY_SECTION instead of TREE_LIST.
Check for supported expression types.
2024-01-09 Tamar Christina <>
PR c/113267
* (c_parser_for_statement): Skip the pragma is no cond.
2024-01-03 Kwok Cheung Yeung <>
* (c_parser_omp_clause_name): Move handling of indirect
clause to correspond to alphabetical order.
2023-12-30 Martin Uecker <>
* (tagged_types_tu_compatible_p): Revise.
2023-12-22 Martin Uecker <>
* (composite_type_internal): Adapted from
composite_type to support structs and unions.
(composite_type): New wrapper function.
(build_conditional_operator): Return composite type.
* (finish_struct): Allow NULL for
2023-12-21 Martin Uecker <>
* (c_struct_hasher): Hash stable for struct
(c_struct_hasher::hash, c_struct_hasher::equal): New
(finish_struct): Set TYPE_CANONICAL to first struct in
equivalence class.
* (c_get_alias_set): Let structs or
unions with variable size alias anything.
* c-tree.h (comptypes_equiv): New prototype.
* (comptypes_equiv): New function.
(comptypes_internal): Implement equivalence mode.
(tagged_types_tu_compatible): Implement equivalence mode.
2023-12-21 Martin Uecker <>
* c-tree.h (c_parser_enum_specifier): Add parameter.
* (start_enum): Allow redefinition.
(finish_enum): Diagnose conflicts.
(build_enumerator): Set context.
(diagnose_mismatched_decls): Diagnose conflicting enumerators.
(push_decl): Preserve context for enumerators.
* (tagged_types_tu_compatible_p): Adapt.
* (c_parser_enum_specifier): Remember when
seen is from an enum type which is not yet defined.
2023-12-21 Martin Uecker <>
* (previous_tag): New function.
(parser_xref_tag): Find earlier definition.
(get_parm_info): Turn off warning for C23.
(start_struct): Allow redefinitons.
(finish_struct): Diagnose conflicts.
* c-tree.h (comptypes_same_p): Add prototype.
* (comptypes_same_p): New function.
(comptypes_internal): Activate comparison of tagged types.
(convert_for_assignment): Ignore qualifiers.
(digest_init): Add error.
(initialized_elementwise_p): Allow compatible types.
2023-12-20 Jakub Jelinek <>
* (c_parser_postfix_expression_after_primary): Grow
sizeof_arg and sizeof_arg_loc arrays to 6 elements. Call
warn_for_calloc if warn_calloc_transposed_args for functions with
alloc_size type attribute with 2 arguments.
(c_parser_expr_list): Use 6 instead of 3.
* (build_c_cast): Call warn_for_alloc_size for casts
of calls to functions with alloc_size type attribute.
(convert_for_assignment): Likewise.
2023-12-19 Sandra Loosemore <>
* (omp_construct_selectors): Delete.
(omp_device_selectors): Delete.
(omp_implementation_selectors): Delete.
(omp_user_selectors): Delete.
(c_parser_omp_context_selector): Adjust for new representations
and simplify dispatch logic. Uniformly warn instead of sometimes
error when an unknown selector is found. Adjust error messages
for extraneous/incorrect score.
(c_parser_omp_context_selector_specification): Likewise.
(c_finish_omp_declare_variant): Adjust for new representations.
2023-12-19 Sandra Loosemore <>
* (c_parser_omp_context_selector): Adjust for new
namelist property representation.
2023-12-19 Sandra Loosemore <>
* (c_parser_omp_context_selector): Use new constructors.
2023-12-18 Richard Biener <>
PR c/111975
* (c_parser_gimple_postfix_expression):
Parse TARGET_MEM_REF extended operands for __MEM.
2023-12-13 Jason Merrill <>
* (convert_for_assignment): Adjust call to
2023-12-13 Julian Brown <>
* (c_parser_oacc_all_clauses): Add TARGET_P parameter. Use
to select region type for c_finish_omp_clauses call.
(c_parser_oacc_loop): Update calls to c_parser_oacc_all_clauses.
(c_parser_oacc_compute): Likewise.
(c_parser_omp_target_data, c_parser_omp_target_enter_data): Support
ATTACH kind.
(c_parser_omp_target_exit_data): Support DETACH kind.
(check_clauses): Handle GOMP_MAP_POINTER and GOMP_MAP_ATTACH here.
* (handle_omp_array_sections_1,
handle_omp_array_sections, c_finish_omp_clauses): Use
c_omp_address_inspector class and OMP address tokenizer to analyze and
expand map clause expressions. Fix some diagnostics. Fix "is OpenACC"
condition for C_ORT_ACC_TARGET addition.
2023-12-13 Julian Brown <>
* (c_finish_omp_clauses): Add braces and reindent
2023-12-11 Martin Uecker <>
PR c/112488
* (add_decl_expr): Revise.
(finish_struct): Create DECL_EXPR.
* (c_parser_struct_or_union_specifier): Call
finish_struct with expression for VLA sizes.
* c-tree.h (finish_struct): Add argument.
2023-12-11 Tobias Burnus <>
* (c_parser_omp_requires): Handle acquires/release
in atomic_default_mem_order clause.
(c_parser_omp_atomic): Update.
2023-12-05 Richard Sandiford <>
* (std_attribute_table): Add extra braces to work
around PR 16333 in older compilers.
2023-12-05 Richard Biener <>
PR c/86869
* (c_build_qualified_type): Preserve address-space
info for ARRAY_TYPE.
2023-12-02 Richard Sandiford <>
* c-tree.h (std_attribute_table): Declare.
* (std_attribute_table): Change type to
scoped_attribute_specs, using...
(std_attributes): ...this as the underlying array.
(c_init_decl_processing): Remove call to register_scoped_attributes.
* c-objc-common.h (c_objc_attribute_table): New global.
2023-12-01 Florian Weimer <>
PR other/44209
* (grokparms): Issue permerror for
OPT_Wdeclaration_missing_parameter_type instead of a pedwarn.
2023-12-01 Florian Weimer <>
PR c/96284
* (build_conditional_expr): Upgrade most pointer
type mismatches to a permerror.
(convert_for_assignment): Use permerror_opt and
permerror_init for OPT_Wincompatible_pointer_types warnings.
2023-12-01 Florian Weimer <>
PR c/96284
* (c_finish_return): Use permerrors
for OPT_Wreturn_mismatch diagnostics.
2023-12-01 Florian Weimer <>
* (grokdeclarator): Do not skip -Wimplicit-int
warnings or errors in system headers.
2023-12-01 Florian Weimer <>
* (warn_defaults_to): Remove.
(grok_declarator, start_function): Call permerror_opt
instead of warn_defaults_to.
(store_parm_decls_oldstyle): Call permerror_opt for
2023-12-01 Florian Weimer <>
PR c/91092
PR c/96284
* (implicit_decl_permerror): Rename from
implicit_decl_warning. Call permerror_opt instead of
pedwarn and warning_at.
(implicitly_declare): Adjust callers.
2023-12-01 Florian Weimer <>
PR c/96284
PR c/106416
* (build_conditional_expr): Use permerror_opt for
pointer/integer type mismatches, based on -Wint-conversion.
(pedwarn_permerror_init, permerror_init): New function.
(pedwarn_init): Call pedwarn_permerror_init.
(convert_for_assignment): Use permerror_opt and
permerror_init for -Wint-conversion warnings.
2023-11-29 Alexandre Oliva <>
* (convert_lvalue_to_rvalue): Decay hardbools.
* (convert): Convert to hardbool through
* (check_bitfield_type_and_width): Skip enumeral
truncation warnings for hardbool.
(finish_struct): Propagate hardbool attribute to bitfield
(digest_init): Convert to hardbool.
2023-11-28 Jason Merrill <>
PR c++/94264
PR c++/53220
* (array_to_pointer_conversion): Adjust -Wc++-compat
2023-11-28 Richard Biener <>
PR middle-end/112741
* (c_parser_parse_gimple_body): Also
set DECL_SEEN_IN_BIND_EXPR_Pfor locals.
2023-11-27 Alex Coplan <>
Iain Sandoe <>
PR c++/60512
* (c_family_register_lang_features): New.
* (struct c_feature_info): New.
(c_register_features): New.
* c-objc-common.h (c_register_features): New.
2023-11-24 Tobias Burnus <>
* (c_parser_omp_clause_num_threads,
c_parser_omp_clause_num_tasks, c_parser_omp_clause_grainsize,
c_parser_omp_clause_priority, c_parser_omp_clause_schedule,
c_parser_omp_clause_num_teams, c_parser_omp_clause_thread_limit,
c_parser_omp_clause_dist_schedule, c_parser_omp_depobj,
c_parser_omp_scan_loop_body, c_parser_omp_assumption_clauses):
Add OPT_Wopenmp to warning_at.
2023-11-24 Tobias Burnus <>
* (c_parser_omp_depobj): Accept optionally an argument
to the destroy clause.
2023-11-23 Jakub Jelinek <>
* (c_parser_postfix_expression): Handle RID_BUILTIN_STDC.
* (names_builtin_p): Likewise.
2023-11-14 Jakub Jelinek <>
PR c/111309
* (convert_arguments): Don't promote first argument
2023-11-10 Martin Uecker <>
* (struct comptypes_data): Add anon_field flag.
(comptypes, comptypes_check_unum_int,
comptypes_check_different_types): Remove old cache.
(tagged_tu_types_compatible_p): Rewrite.
2023-11-09 Florian Weimer <>
* (c_finish_return): Use pedwarn with
OPT_Wreturn_mismatch for missing/extra return expressions.
2023-11-07 Kwok Cheung Yeung <>
* (c_decl_attributes): Add attribute for indirect
* c-lang.h (c_omp_declare_target_attr): Add indirect field.
* (c_parser_omp_clause_name): Handle indirect clause.
(c_parser_omp_clause_indirect): New.
(c_parser_omp_all_clauses): Handle indirect clause.
(OMP_DECLARE_TARGET_CLAUSE_MASK): Add indirect clause to mask.
(c_parser_omp_declare_target): Handle indirect clause. Emit error
message if device_type or indirect clauses used alone. Emit error
if indirect clause used with device_type that is not 'any'.
(OMP_BEGIN_DECLARE_TARGET_CLAUSE_MASK): Add indirect clause to mask.
(c_parser_omp_begin): Handle indirect clause.
* (c_finish_omp_clauses): Handle indirect clause.
2023-11-07 Joseph Myers <>
* Use flag_isoc23 instead of flag_isoc2x and c23_auto_p
instead of c2x_auto_p. Refer to C23 instead of C2X in diagnostics
and comments.
* Use flag_isoc23 instead of flag_isoc2x and
warn_c11_c23_compat instead of warn_c11_c2x_compat. Refer to C23
instead of C2X in comments.
* Use flag_isoc23 instead of flag_isoc2x,
warn_c11_c23_compat instead of warn_c11_c2x_compat, c23_auto_p
instead of c2x_auto_p and D_C23 instead of D_C2X. Refer to C23
instead of C2X in diagnostics and comments.
* c-tree.h: Refer to C23 instead of C2X in comments.
(struct c_declspecs): Rename c2x_auto_p to c23_auto_p.
* Use flag_isoc23 instead of flag_isoc2x and
warn_c11_c23_compat instead of warn_c11_c2x_compat. Refer to C23
instead of C2X in diagnostics and comments.
2023-11-06 Joseph Myers <>
PR c/107954
* (pedwarn_c11): Use OPT_Wc11_c23_compat instead of
* (build_conditional_expr, convert_for_assignment):
Use OPT_Wc11_c23_compat instead of OPT_Wc11_c2x_compat.
2023-11-04 Jakub Jelinek <>
* c-parser.h (c_maybe_parse_omp_decl): Declare.
* (struct c_parser): Add in_omp_decl_attribute member.
(c_parser_std_attribute): Uncoment omp::decl handling.
(c_parser_omp_var_list_parens): If parser->in_omp_decl_attribute
don't expect any arguments, instead create clause or TREE_LIST for
that decl.
(c_maybe_parse_omp_decl): New function.
(c_parser_omp_declare_target): If parser->in_omp_decl_attribute and
first token isn't name or comma invoke c_parser_omp_var_list_parens.
* (c_decl_attributes): Uncomment omp::decl handling and
use *node rather than non-existing *decl.
2023-11-04 Jakub Jelinek <>
* c-tree.def: New file.
* c-tree.h (struct c_tree_token_vec): Forward declare.
(c_tree_size): Declare.
* c-lang.h (struct c_omp_declare_target_attr): Add attr_syntax member.
(struct c_omp_begin_assumes_data): New type.
(current_omp_begin_assumes): Change type from int to
vec<c_omp_begin_assumes_data, va_gc> *.
* Include c-family/c-pragma.h and c-parser.h.
* c-parser.h (struct c_tree_token_vec_struct): New type.
(C_TOKEN_VEC_TOKENS): New macro.
* (struct c_parser): Add omp_attrs_forbidden_p and
in_omp_attribute_pragma members.
(c_parser_skip_until_found): Handle CPP_PRAGMA_EOL when
(c_parser_skip_to_pragma_eol): Likewise.
(c_parser_translation_unit): Adjust for current_omp_begin_assumes
being a vector rather than counter.
(c_parser_declaration_or_fndef): Handle omp::directive and
omp::sequence attributes on attribute declaration and declare simd
or declare variant directives in those on function declarations.
(c_parser_check_balanced_raw_token_sequence): Forward declare.
(c_parser_omp_directive_args, c_parser_omp_sequence_args): New
(c_parser_std_attribute): Handle omp::directive and omp::sequence
(struct c_omp_attribute_data): New type.
c_parser_handle_directive_omp_attributes): New functions.
(c_parser_compound_statement_nostart): Handle omp::directive and
omp::sequence attributes on statements. Formatting fix.
(c_parser_all_labels): Handle omp::directive and omp::sequence
attributes on statements.
(c_parser_statement): Clear parser->omp_attrs_forbidden_p.
(c_parser_omp_variable_list): Handle parser->tokens
!= &parser->tokens_buf[0] by saving/restoring it.
(c_parser_omp_structured_block): Set parser->omp_attrs_forbidden_p.
(c_parser_omp_section_scan): New function.
(c_parser_omp_structured_block_sequence, c_parser_omp_sections_scope):
Use it.
(c_parser_omp_parallel): Set parser->omp_attrs_forbidden_p.
(c_parser_omp_task): Likewise.
(c_parser_omp_declare_simd): Handle function declaration after
std attributes.
(c_finish_omp_declare_simd): Don't assert all kinds are the same.
(c_parser_omp_declare_target): Also push attr_syntax flag.
(c_parser_omp_begin): Likewise. Adjust for current_omp_begin_assumes
type change.
(c_parser_omp_end): Adjust for current_omp_begin_assumes type
change. Diagnose mixing of attribute vs. pragma syntax on end assumes
or end declare target.
(c_parser_omp_declare_reduction): Handle parser->tokens
!= &parser->tokens_buf[0] by saving/restoring it.
* Include c-parser.h.
(current_omp_begin_assumes): Change type from int to
vec<c_omp_begin_assumes_data, va_gc> *.
(struct c_tree_token_vec): New type. Add static assertions
for sizeof and offsetof.
(union lang_tree_node): Add c_token_vec member and adjust GTY
desc for it.
(c_tree_size): New function.
(c_decl_attributes): Diagnose invalid omp::directive attribute
* c-objc-common.h (LANG_HOOKS_TREE_SIZE): Redefine.
2023-11-02 Martin Uecker <>
PR c/112347
* (convert_for_assignment): Add missing check.
2023-11-01 Martin Uecker <>
PR c/71219
* (convert_for_assignment): Add warning.
2023-10-26 liuhongt <>
* (build_vec_cmp): Pass type of arg0 to
2023-10-25 Thomas Schwinge <>
* (c_parser_omp_clause_name): Return
(c_parser_oacc_data_clause, OACC_UPDATE_CLAUSE_MASK): Adjust.
(c_parser_oacc_all_clauses): Remove 'bool compute_p' formal
parameter, and instead locally determine whether we're called for
an OpenACC compute construct or OpenACC 'update' directive.
(c_parser_oacc_compute): Adjust.
2023-10-25 Chung-Lin Tang <>
* (c_parser_oacc_compute_clause_self): New function.
(c_parser_oacc_all_clauses): Add new 'bool compute_p = false'
parameter, add parsing of self clause when compute_p is true.
(c_parser_oacc_compute): Adjust call to c_parser_oacc_all_clauses to
set compute_p argument to true.
* (c_finish_omp_clauses): Add OMP_CLAUSE_SELF case.
2023-10-20 Florian Weimer <>
PR c/109827
PR other/44209
* (build_conditional_expr): Use OPT_Wint_conversion
for pointer/integer mismatch warnings.
2023-10-20 Florian Weimer <>
PR c/109826
PR other/44209
* (build_conditional_expr): Use
OPT_Wincompatible_pointer_types for pointer mismatches.
Emit location information for the operand.
2023-10-19 Andrew Pinski <>
PR c/100532
* (convert_argument): After erroring out
about an incomplete type return error_mark_node.
2023-10-19 Andrew Pinski <>
PR c/104822
* (convert_for_assignment): Check for null pointer
before warning about an incompatible scalar storage order.
2023-10-18 Andrew Pinski <>
PR c/101364
* (diagnose_arglist_conflict): Test for
error mark before calling of c_type_promotes_to.
2023-10-18 Andrew Pinski <>
PR c/101285
* (c_safe_arg_type_equiv_p): Return true for error
operands early.
2023-10-17 Martin Uecker <>
PR c/111708
* (grokdeclarator): Add error.
2023-10-03 David Malcolm <>
* (c_tree_printer): Update for "m_" prefixes to
text_info fields.
2023-09-30 Eugene Rozenfeld <>
* Make create_fdas_for_cc1 target not .PHONY
2023-09-20 Jakub Jelinek <>
* (c_parser_postfix_expression_after_primary): Parse
__builtin_classify_type call with typename as argument.
2023-09-19 Richard Biener <>
PR c/111468
* (c_parser_gimple_binary_expression): Handle __LTGT.
2023-09-19 Richard Biener <>
PR c/111468
* (c_parser_gimple_binary_expression): Add
return type argument.
(c_parser_gimple_statement): Adjust.
(c_parser_gimple_paren_condition): Likewise.
(c_parser_gimple_binary_expression): Use passed in return type,
add support for - as POINTER_DIFF_EXPR, __UN{LT,LE,GT,GE,EQ},
2023-09-12 Tobias Burnus <>
* (struct c_omp_loc_tree): New.
(c_check_omp_allocate_allocator_r): New; checking moved from ...
(c_parser_omp_allocate): ... here. Call it via walk_tree. Avoid
ICE with tree_to_shwi for invalid too-large value.
2023-09-12 Tobias Burnus <>
* (c_parser_omp_construct): Move call to
c_parser_omp_allocate to ...
(c_parser_pragma): ... here.
(c_parser_omp_allocate): Avoid ICE is allocator could not be
parsed; set 'omp allocate' attribute for stack/automatic variables
and only reject static variables; add several additional
restriction checks.
* c-tree.h (c_mark_decl_jump_unsafe_in_current_scope): New prototype.
* (decl_jump_unsafe): Return true for omp-allocated decls.
(c_mark_decl_jump_unsafe_in_current_scope): New.
(warn_about_goto, c_check_switch_jump_warnings): Add error for
omp-allocated decls.
2023-09-12 Martin Uecker <>
* (struct comptypes_data): Add structure.
function_types_compatible_p, type_lists_compatible_p,
comptypes_internal): Add structure to interface, change
return type to bool, and adapt calls.
(comptarget_types): Change return type too bool.
(comptypes, comptypes_check_enum_int,
comptypes_check_different_types): Adapt calls.
2023-09-06 Jakub Jelinek <>
PR c/102989
* (finish_declspecs): Emit pedwarn_c11 on _BitInt.
* (c_common_type): Emit sorry for common type between
_Complex integer and larger _BitInt and return the _Complex integer.
2023-09-06 Jakub Jelinek <>
PR c/102989
* (c_convert): Handle BITINT_TYPE like INTEGER_TYPE.
* (check_bitfield_type_and_width): Allow BITINT_TYPE
(finish_struct): Prefer to use BITINT_TYPE for BITINT_TYPE bit-fields
if possible.
(declspecs_add_type): Formatting fixes. Handle cts_bitint. Adjust
for added union in *specs. Handle RID_BITINT.
(finish_declspecs): Handle cts_bitint. Adjust for added union
in *specs.
* (c_keyword_starts_typename, c_token_starts_declspecs,
c_parser_declspecs, c_parser_gnu_attribute_any_word): Handle
(c_parser_omp_clause_schedule): Handle BITINT_TYPE like INTEGER_TYPE.
* c-tree.h (enum c_typespec_keyword): Mention _BitInt in comment.
Add cts_bitint enumerator.
(struct c_declspecs): Move int_n_idx and floatn_nx_idx into a union
and add bitint_prec there as well.
* (c_common_type, comptypes_internal):
(perform_integral_promotions): Promote BITINT_TYPE bit-fields to
their declared type.
(build_array_ref, build_unary_op, build_conditional_expr,
build_c_cast, convert_for_assignment, digest_init, build_binary_op):
* (c_fully_fold_internal): Handle BITINT_TYPE like
* (gen_type): Handle BITINT_TYPE.
2023-09-06 Jakub Jelinek <>
* (declspecs_add_type): Use pedwarn_c11 rather than pedwarn
for _FloatN{,x} diagnostics and append " before C2X" to the diagnostic
2023-09-05 Tobias Burnus <>
* (c_parser_omp_clause_allocate): Handle
2023-08-25 Sandra Loosemore <>
* (struct c_parser): Add omp_for_parse_state field.
(struct omp_for_parse_data): New.
(check_omp_intervening_code): New.
(add_structured_block_stmt): New.
(c_parser_compound_statement_nostart): Recognize intervening code,
nested loops, and other things that need special handling in
OpenMP loop constructs.
(c_parser_while_statement): Error on loop in intervening code.
(c_parser_do_statement): Likewise.
(c_parser_for_statement): Likewise.
(c_parser_postfix_expression_after_primary): Error on calls to
the OpenMP runtime in intervening code.
(c_parser_pragma): Error on OpenMP pragmas in intervening code.
(c_parser_omp_loop_nest): New.
(c_parser_omp_for_loop): Rewrite to use recursive descent, calling
c_parser_omp_loop_nest to do the heavy lifting.
2023-08-24 Richard Sandiford <>
* (c_parser_std_attribute): Conditionally allow
two colons to be used in place of ::.
(c_parser_std_attribute_list): New function, split out from...
(c_parser_std_attribute_specifier): Allow the attribute-list
to start with __extension__. When it does, also allow two colons
to be used in place of ::.
2023-08-22 Tobias Burnus <>
* (c_parser_omp_clause_defaultmap): Parse
'all' as category.
2023-08-17 Jose E. Marchesi <>
PR c/106537
* (build_binary_op): Warning on comparing distinct
pointer types only when -Wcompare-distinct-pointer-types.
2023-08-15 Chung-Lin Tang <>
Thomas Schwinge <>
2023-08-11 Jakub Jelinek <>
* (c_parser_typeof_specifier): Handle
__typeof_unqual and __typeof_unqual__ as !is_std.
2023-08-11 Martin Uecker <>
PR c/84510
* (build_c_cast): Add warning.
2023-08-05 Martin Uecker <>
* (c_parser_generic_selection): Inhibit evaluation
warnings branches that are known not be taken during parsing.
2023-08-04 Tamar Christina <>
* (c_parser_while_statement, c_parser_do_statement,
c_parser_for_statement, c_parser_statement_after_labels,
c_parse_pragma_novector, c_parser_pragma): Wire through novector and
default to false.
2023-08-02 Eric Feng <>
PR analyzer/107646
* New functions on stashing values for the
2023-08-01 Lewis Hyatt <>
* (pragma_lex_discard_to_eol): New function.
(c_init_preprocess): New function.
2023-07-31 Hamza Mahfooz <>
PR c/65213
* (start_decl): Handle
2023-07-31 Chung-Lin Tang <>
* (c_parser_oacc_host_data): Add checking requiring OpenACC
host_data construct to have an use_device clause.
2023-06-29 Qing Zhao <>
PR c/77650
* (finish_struct): Issue warnings for new option.
2023-06-29 Qing Zhao <>
* (finish_struct): Set TYPE_INCLUDES_FLEXARRAY for
struct/union type.
2023-06-29 Richard Biener <>
PR c/110454
* (convert_argument): Sink formal_prec compute
to where TYPE_PRECISION is valid to use.
2023-06-29 Eugene Rozenfeld <>
* Pass correct stage cc1 when processing
profile data collected while building target libraries
2023-06-16 David Malcolm <>
PR c/107583
* (c_parser_declspecs): Add hints to "unknown type
name" error.
2023-06-12 Tobias Burnus <>
* (c_parser_omp_clause_map): Reword error message for
clearness especially with 'omp target (enter/exit) data.'
2023-06-06 Kwok Cheung Yeung <>
Tobias Burnus <>
* (c_parser_omp_clause_defaultmap,
c_parser_omp_clause_map): Parse 'present'.
(c_parser_omp_clause_to, c_parser_omp_clause_from): Remove.
(c_parser_omp_clause_from_to): New; parse to/from clauses with
optional present modifer.
(c_parser_omp_all_clauses): Update call.
(c_parser_omp_target_data, c_parser_omp_target_enter_data,
c_parser_omp_target_exit_data): Handle new map enum values
for 'present' mapping.
2023-05-30 Tobias Burnus <>
PR c/109999
* (c_parser_oacc_all_clauses,
c_parser_omp_all_clauses): Improve error wording.
2023-05-23 Martin Uecker <>
PR c/109450
* (add_decl_expr): New function.
(grokdeclarator): Add decl expr for size expression in
types pointed to by parameters declared as arrays.
2023-05-23 Martin Uecker <>
PR c/70418
PR c/106465
PR c/107557
PR c/108423
* (start_decl): Make sure size expression are
evaluated only in correct context.
(grokdeclarator): Size expression in fields may need a bind
expression, make sure DECL_EXPR is always created.
(grokfield, declspecs_add_type): Pass along size expressions.
(finish_struct): Remove unneeded DECL_EXPR.
(start_function): Evaluate size expressions for nested functions.
* (c_parser_struct_declarations,
c_parser_struct_or_union_specifier): Pass along size expressions.
(c_parser_declaration_or_fndef): Evaluate size expression.
c_parser_objc_class_instance_variables): Adapt.
* c-tree.h (grokfield): Adapt declaration.
2023-05-19 Martin Uecker <>
* (set_type_context): Remove.
(pop_scope, diagnose_mismatched_decls, pushdecl):
Remove dead code.
* (comptypes_internal): Remove dead code.
(same_translation_unit_p): Remove.
(tagged_types_tu_compatible_p): Some fixes.
2023-05-19 Joseph Myers <>
* (diagnose_mismatched_decls): Do not handle
thread-local declarations as tentative definitions for C2x.
(finish_decl): Do not allow thread-local definition with
incomplete type for C2x.
2023-05-18 Bernhard Reutner-Fischer <>
* (c_convert): Ditto.
* (merge_decls): Ditto.
* (c_parser_omp_clause_reduction): Ditto.
(c_parser_omp_declare_reduction): Ditto.
* (build_component_ref): Ditto.
(convert_argument): Ditto.
(pointer_diff): Ditto.
(build_unary_op): Ditto.
(build_c_cast): Ditto.
(build_modify_expr): Ditto.
(store_init_value): Ditto.
(constexpr_init_fits_real_type): Ditto.
(check_constexpr_init): Ditto.
(c_finish_return): Ditto.
(handle_omp_array_sections_1): Ditto.
(c_finish_omp_clauses): Ditto.
* (c_finish_gimple_return): Ditto.
2023-05-16 Joseph Myers <>
* (check_for_loop_decls): Use pedwarn_c11 for
2023-05-15 Joseph Myers <>
* (grokdeclarator): Ignore _Atomic on function return
type for C2x.
2023-04-30 Andrew Pinski <>
* (process_init_element): Print out array type
for excessive elements.
2023-04-30 Andrew Pinski <>
PR c/107926
* (process_init_element): Move the check
for string cst until after the error message.
2023-04-28 Eugene Rozenfeld <>
* Merge perf data collected when compiling cc1 and runtime libraries
2023-04-27 Jakub Jelinek <>
PR c/109409
* (c_parser_initializer): Move diagnostics about
initialization of variable sized object with non-empty initializer
after c_parser_expr_no_commas call and ret.set_error (); after it.
2023-04-27 Jakub Jelinek <>
PR c/107682
PR c/109412
* (pop_init_level): If constructor_type is FUNCTION_TYPE,
reject empty initializer as invalid.
2023-04-26 Richard Biener <>
* (c_parser_parse_gimple_body): Avoid
2023-04-25 Tobias Burnus <>
* (c_parser_omp_scan_loop_body): Handle
zero exec statements before/after 'omp scan'.
2023-04-20 Jakub Jelinek <>
PR c/107041
* (diagnose_mismatched_decls): Avoid -Wenum-int-mismatch
warning on acc_on_device declaration.
2023-03-28 David Malcolm <>
PR c/107002
* (parser_build_binary_op): Update for new param of
2023-03-10 Jakub Jelinek <>
PR c/108079
* (pop_scope): Suppress OPT_Wunused_variable warning
after diagnosing it.
2023-02-28 Jakub Jelinek <>
PR sanitizer/108894
* (strict_flex_array_level_of): Move to
and rename to c_strict_flex_array_level_of.
(is_flexible_array_member_p): Adjust caller.
2023-02-18 Martin Uecker <>
PR c/108375
* (decl_jump_unsafe): Use c_type_variably_modified_p.
(diagnose_mismatched_decl): Dito.
(warn_about_goto): Dito:
(c_check_switch_jump_warnings): Dito.
(finish_decl): Dito.
(finish_struct): Dito.
(grokdeclarator): Set C_TYPE_VARIABLY_MODIFIED.
(finish_struct): Set C_TYPE_VARIABLY_MODIFIED.
* (c_var_mod_p): New function.
(c_var_unspec_p): Remove.
* c-objc-common.h: Set lang hook.
* (c_parser_declararion_or_fndef): Use c_type_variably_modified_p.
(c_parser_typeof_specifier): Dito.
(c_parser_has_attribute_expression): Dito.
(c_parser_generic_selection): Dito.
* c-tree.h: Define C_TYPE_VARIABLY_MODIFIED and define c_var_mode_p.
* Remove c_vla_mod_p and use C_TYPE_VARIABLY_MODIFIED.
2023-02-16 Patrick Palka <>
* c-parser.h: Mechanically drop static from static inline
functions via s/^static inline/inline/g.
2023-02-10 Joseph Myers <>
* (c_convert): Allow conversion of a null pointer
constant to nullptr_t.
* (null_pointer_constant_p): Remove static.
(convert_for_assignment): Allow conversion of a null pointer
constant to nullptr_t.
(digest_init): Handle NULLPTR_TYPE among scalar conversions.
* c-tree.h (null_pointer_constant_p): Declare.
2023-02-09 Tobias Burnus <>
* (c_parser_omp_allocate): Parse align
clause and check for restrictions.
2023-02-08 Joseph Myers <>
* (check_constexpr_init): Remove argument
null_pointer_constant. Only check pointer initializers for being
(digest_init): Update calls to check_constexpr_init.
2023-02-02 Joseph Myers <>
* (build_binary_op): Allow comparisons between
pointers and nullptr_t values that are not null pointer constants.
2023-02-02 Joseph Myers <>
* Include "realmpfr.h".
(constexpr_init_fits_real_type): Do not allow signaling NaN
conversions to different types with the same mode. Handle
conversions from binary to decimal types.
(check_constexpr_init): Do not disallow real initializers for
complex types. Do not disallow binary initializers for decimal
floating types.
2023-01-31 Marek Polacek <>
PR c++/107593
PR c++/108597
* (instantiation_dependent_expression_p): New.
2023-01-27 Joseph Myers <>
* (c_parser_declaration_or_fndef): Do not allow braces
around auto initializer.
2023-01-16 Jakub Jelinek <>
PR c++/105593
* (c_parser_initializer): Check warning_enabled_at
at the DECL_SOURCE_LOCATION (decl) for OPT_Winit_self instead
of warn_init_self.
2023-01-14 Jakub Jelinek <>
PR c++/108365
* (build_binary_op): Use may_shorten_divmod for integral
division or modulo.
2023-01-13 Qing Zhao <>
* (strict_flex_array_level_of): ... here.
2023-01-11 Jakub Jelinek <>
PR c/105972
* (c_parser_declaration_or_fndef): Disable debug non-bind
markers for K&R function parameter declarations of nested functions.
2023-01-09 Joseph Myers <>
* (build_compound_literal): Call record_inline_static.
2023-01-06 Joseph Myers <>
* (c_parser_postfix_expression): Handle integer
generic arguments to functions passed to __builtin_tgmath as
_Float32x if any argument has _FloatNx or _Complex _FloatNx type.
Do not handle integer arguments to some narrowing functions as
2022-12-19 Jakub Jelinek <>
PR c/108043
* (c_parser_postfix_expression_after_paren_type): Diagnose
compound literals with function type.
2022-12-07 Joseph Myers <>
* (declspecs_add_type, declspecs_add_scspec): Check for
auto, constexpr and a type used together.
2022-12-06 Qing Zhao <>
* (is_flexible_array_member_p): Call new function
2022-11-24 Florian Weimer <>
PR c/107805
* (declspecs_add_type): Propagate error_mark_bode
from type to specs.
2022-11-17 Bernhard Reutner-Fischer <>
* (start_function): Set the result decl source
location to the location of the typespec.
2022-11-17 David Malcolm <>
PR analyzer/107711
* (ana::c_translation_unit::consider_macro): Pass NULL
to cpp_create_reader, rather than ident_hash, so that the new
reader gets its own hash table.
2022-11-15 David Malcolm <>
PR analyzer/106302
* Include "analyzer/analyzer-language.h" and "toplev.h".
(class ana::c_translation_unit): New.
(c_parser_translation_unit): Call ana::on_finish_translation_unit.
2022-11-12 Joseph Myers <>
* (start_underspecified_init)
(finish_underspecified_init): Handle name == NULL_TREE for
compound literals.
(merge_decls): Merge C_DECL_DECLARED_CONSTEXPR.
(shadow_tag_warned): Check for constexpr.
(start_decl): Add parameter do_push.
(build_compound_literal): Set C_DECL_DECLARED_CONSTEXPR.
(grokdeclarator): Handle constexpr.
(finish_struct): Set C_TYPE_FIELDS_NON_CONSTEXPR.
(declspecs_add_scspec): Handle constexpr.
* (c_token_starts_compound_literal)
(c_token_starts_declspecs, c_parser_declaration_or_fndef)
(c_parser_declspecs, c_parser_gnu_attribute_any_word)
(c_parser_postfix_expression_after_paren_type): Handle constexpr.
Update calls to start_init.
(c_parser_declaration_or_fndef, c_parser_initializer)
(c_parser_initval): Pass true for new argument of
convert_lvalue_to_rvalue. Call convert_lvalue_to_rvalue for
constexpr compound literals.
(c_parser_enum_specifier, c_parser_struct_declaration)
(c_parser_alignas_specifier, c_parser_initelt, c_parser_label):
Call convert_lvalue_to_rvalue on expressions required to be
integer constant expressions.
(c_parser_omp_declare_reduction): Update call to start_init.
(struct c_declspecs): Add constexpr_p.
(start_decl, convert_lvalue_to_rvalue, start_init): Update
* (require_constant_value, require_constant_elements):
Change to bool.
(require_constexpr_value, maybe_get_constexpr_init)
(constexpr_init_fits_real_type, check_constexpr_init): New.
(convert_lvalue_to_rvalue): Add new parameter for_init. Call
(store_init_value): Update call to digest_init.
(digest_init): Add parameters int_const_expr, arith_const_expr and
require_constexpr. Check constexpr initializers.
(constructor_top_level): Remove.
(struct initializer_stack): Remove top_level. Add
(start_init): Remove parameter top_level. Add parameters
init_require_constant and init_require_constexpr. Save
require_constexpr_value on stack.
(pop_init_level): Use a null pointer constant for zero initializer
of pointer initialized with {}.
(output_init_element): Update call to digest_init. Avoid passing
null pointer constants of pointer type through digest_init a
second time when initializing a constexpr object.
2022-11-03 Joseph Myers <>
* (in_underspecified_init, start_underspecified_init)
(finish_underspecified_init): New.
(shadow_tag_warned, parser_xref_tag, start_struct, start_enum):
Give errors inside initializers of underspecified declarations.
(grokdeclarator): Handle (erroneous) case of C2X auto on a
(declspecs_add_type): Handle c2x_auto_p case.
(declspecs_add_scspec): Handle auto possibly setting c2x_auto_p in
C2X mode.
(finish_declspecs): Handle c2x_auto_p.
* (c_parser_declaration_or_fndef): Handle C2X auto.
* c-tree.h (C_DECL_UNDERSPECIFIED): New macro.
(struct c_declspecs): Add c2x_auto_p.
(start_underspecified_init, finish_underspecified_init): New
* (build_external_ref): Give error for underspecified
declaration referenced in its initializer.
2022-10-28 Joseph Myers <>
* (grokdeclarator): Pass
arg_info->no_named_args_stdarg_p to build_function_type.
(grokparms): Check arg_info->no_named_args_stdarg_p before
converting () to (void).
(build_arg_info): Initialize no_named_args_stdarg_p.
(get_parm_info): Set no_named_args_stdarg_p.
(start_function): Pass TYPE_NO_NAMED_ARGS_STDARG_P to
(store_parm_decls): Count (...) functions as prototyped.
* (c_parser_direct_declarator): Allow '...' after open
parenthesis to start parameter list.
(c_parser_parms_list_declarator): Always allow '...' with no
arguments, call pedwarn_c11 and set no_named_args_stdarg_p.
* c-tree.h (struct c_arg_info): Add field no_named_args_stdarg_p.
* (composite_type): Handle
(function_types_compatible_p): Compare
2022-10-28 Jakub Jelinek <>
* (c_parser_omp_all_clauses): Allow optional
comma before the first clause.
(c_parser_omp_allocate, c_parser_omp_atomic, c_parser_omp_depobj,
c_parser_omp_flush, c_parser_omp_scan_loop_body,
c_parser_omp_ordered, c_finish_omp_declare_variant,
c_parser_omp_declare_target, c_parser_omp_declare_reduction,
c_parser_omp_requires, c_parser_omp_error,
c_parser_omp_assumption_clauses): Likewise.
2022-10-28 Joseph Myers <>
PR c/61469
* (c_convert): Handle enums with underlying boolean
type like bool.
* (shadow_tag_warned): Allow shadowing declarations for
enums with enum type specifier, but give errors for storage class
specifiers, qualifiers or alignment specifiers in non-definition
declarations of such enums.
(grokdeclarator): Give error for non-definition use of type
specifier with an enum type specifier.
(parser_xref_tag): Add argument has_enum_type_specifier. Pass it
to lookup_tag and use it to set ENUM_FIXED_UNDERLYING_TYPE_P.
(xref_tag): Update call to parser_xref_tag.
(start_enum): Add argument fixed_underlying_type. Complete enum
type with a fixed underlying type given in the definition. Give
error for defining without a fixed underlying type in the
definition if one was given in a prior declaration. Do not mark
enums with fixed underlying type as packed for -fshort-enums.
Store the enum type in the_enum.
(finish_enum): Do not adjust types of values or check their range
for an enum with a fixed underlying type. Set underlying type of
enum and variants.
(build_enumerator): Check enumeration constants for enum with
fixed underlying type against that type and convert to that type.
Increment in the underlying integer type, with handling for bool.
(c_simulate_enum_decl): Update call to start_enum.
(declspecs_add_type): Set specs->enum_type_specifier_ref_p.
* (c_get_alias_set): Use ENUM_UNDERLYING_TYPE
rather than recomputing an underlying type based on size.
* (c_parser_declspecs)
(c_parser_struct_or_union_specifier, c_parser_typeof_specifier):
Set has_enum_type_specifier for type specifiers.
(c_parser_enum_specifier): Handle enum type specifiers.
(c_parser_struct_or_union_specifier): Update call to
(c_parser_omp_atomic): Check for boolean increment or decrement
* c-tree.h (C_BOOLEAN_TYPE_P): New.
(struct c_typespec): Add has_enum_type_specifier.
(struct c_declspecs): Add enum_type_specifier_ref_p.
(struct c_enum_contents): Add enum_type.
(start_enum, parser_xref_tag): Update prototypes.
* (composite_type): Allow for enumerated types
compatible with bool.
(common_type, comptypes_internal, perform_integral_promotions):
(parser_build_binary_op, build_unary_op, convert_for_assignment)
(c_finish_return, c_start_switch, build_binary_op): Check for
boolean types using C_BOOLEAN_TYPE_P.
2022-10-24 Jakub Jelinek <>
PR c++/107358
* (build_binary_op): Pass operands before excess precision
promotions to scalar_to_vector call.
2022-10-24 Arsen Arsenović <>
* (finish_function): Ignore hosted when deciding
whether to implicitly return zero, but check noreturn.
* (c_missing_noreturn_ok_p): Loosen the
requirements to just MAIN_NAME_P when hosted, or `int main'
2022-10-20 Richard Biener <>
PR c/107305
PR c/107306
* (c_parser_parse_gimple_body): Verify
the parsed IL and zap the body on error.
2022-10-18 Joseph Myers <>
PR c/107164
* (shadow_tag_warned): If pedantic, diagnose "enum tag;"
with previous declaration visible.
2022-10-18 Joseph Myers <>
PR c/36113
* (finish_enum): If any enumerators do not fit in int,
convert all to the type of the enumeration. pedwarn if no integer
type fits all enumerators and default to
widest_integer_literal_type_node in that case. Otherwise pedwarn
for type wider than intmax_t.
(build_enumerator): pedwarn for enumerators outside the range of
uintmax_t or intmax_t, and otherwise use pedwarn_c11 for
enumerators outside the range of int. On overflow, attempt to
find a wider type that can hold the value of the next enumerator.
Do not convert value to type determined with
2022-10-14 Jakub Jelinek <>
* (convert_arguments): Don't promote __bf16 to
2022-10-14 Joseph Myers <>
* (build_compound_literal): Add parameter scspecs.
Handle storage class specifiers.
* (c_token_starts_compound_literal)
(c_parser_compound_literal_scspecs): New.
(c_parser_postfix_expression_after_paren_type): Add parameter
scspecs. Call pedwarn_c11 for use of storage class specifiers.
Update call to build_compound_literal.
(c_parser_cast_expression, c_parser_sizeof_expression)
(c_parser_alignof_expression): Handle storage class specifiers for
compound literals. Update calls to
(c_parser_postfix_expression): Update syntax comment.
* c-tree.h (build_compound_literal): Update prototype.
* (c_mark_addressable): Diagnose taking address of
register compound literal.
2022-10-07 Qing Zhao <>
* (flexible_array_member_type_p): New function.
(one_element_array_type_p): Likewise.
(zero_length_array_type_p): Likewise.
(add_flexible_array_elts_to_size): Call new utility
routine flexible_array_member_type_p.
(is_flexible_array_member_p): New function.
(finish_struct): Set the new DECL_NOT_FLEXARRAY flag.
2022-10-06 Joseph Myers <>
* (c_parse_init): Add D_EXT11 to mask if flag_no_asm
and not C2x.
(c_keyword_starts_typename, c_token_starts_declspecs)
(c_parser_declspecs, c_parser_objc_selector): Handle
(c_parser_typeof_specifier): Handle RID_TYPEOF_UNQUAL.
Distinguish typeof for C2x from __typeof__ for all standard
versions and typeof before C2x.
* (build_function_call_vec): Use unqualified version
of non-void return type.
(build_unary_op): Use unqualified type for increment and
2022-10-06 Jakub Jelinek <>
* (c_parser_omp_assumption_clauses): Emit IFN_ASSUME
call for holds clause on assume construct.
2022-10-06 Jakub Jelinek <>
PR c++/106654
* (handle_assume_attribute): New function.
(c_parser_declaration_or_fndef): Handle assume attribute.
(c_parser_attribute_arguments): Add assume_attr argument,
if true, parse first argument as conditional expression.
(c_parser_gnu_attribute, c_parser_std_attribute): Adjust
c_parser_attribute_arguments callers.
(c_parser_statement_after_labels) <case RID_ATTRIBUTE>: Handle
assume attribute.
2022-10-04 Jakub Jelinek <>
* c-lang.h (struct c_omp_declare_target_attr): New type.
(current_omp_declare_target_attribute): Change type from
int to vec<c_omp_declare_target_attr, va_gc> *.
* (c_parser_translation_unit): Adjust for that change.
If last pushed directive was begin declare target, use different
wording and simplify format strings for easier translations.
(c_parser_omp_clause_device_type): Uncomment
check_no_duplicate_clause call.
(c_parser_omp_declare_target): Adjust for the
current_omp_declare_target_attribute type change, push { -1 }.
Use error_at rather than warning_at for declare target with
only device_type clauses.
(c_parser_omp_begin): Add begin declare target support.
(c_parser_omp_end): Adjust for the
current_omp_declare_target_attribute type change, adjust
diagnostics wording and simplify format strings for easier
* (current_omp_declare_target_attribute): Change type from
int to vec<c_omp_declare_target_attr, va_gc> *.
(c_decl_attributes): Adjust for the
current_omp_declare_target_attribute type change. If device_type
was present on begin declare target, add "omp declare target host"
and/or "omp declare target nohost" attributes.
2022-09-29 Joseph Myers <>
* (handle_std_noreturn_attribute): New function.
(std_attribute_table): Add _Noreturn and noreturn.
2022-09-27 Jakub Jelinek <>
* c-lang.h (current_omp_begin_assumes): Declare.
* Include bitmap.h.
(c_parser_omp_end_declare_target): Rename to ...
(c_parser_omp_end): ... this. Handle also end assumes.
(c_parser_omp_begin, c_parser_omp_assumption_clauses,
c_parser_omp_assumes, c_parser_omp_assume): New functions.
(c_parser_translation_unit): Also diagnose #pragma omp begin assumes
without corresponding #pragma omp end assumes.
(c_parser_pragma): Use %s in may only be used at file scope
diagnostics to decrease number of translatable messages. Handle
rather than PRAGMA_OMP_END_DECLARE_TARGET and call c_parser_omp_end
for it rather than c_parser_omp_end_declare_target.
(c_parser_omp_construct): Handle PRAGMA_OMP_ASSUME.
* (current_omp_begin_assumes): Define.
2022-09-24 Jakub Jelinek <>
PR c/106981
* (c_tree_equal): Only strip NON_LVALUE_EXPRs at the
start. For CONSTANT_CLASS_P or CASE_CONVERT: return false if t1 and
t2 have different types.
2022-09-22 David Malcolm <>
PR c/106830
* (c_parser_initelt): Initialize m_decimal.
(c_parser_cast_expression): Likewise.
(c_parser_alignof_expression): Likewise.
(c_parser_postfix_expression_after_paren_type): Likewise.
(c_parser_postfix_expression_after_primary): Likewise.
(c_parser_expression): Likewise.
(c_parser_omp_variable_list): Likewise.
(c_parser_transaction_expression): Likewise.
* c-tree.h (c_expr::set_error): Likewise.
* (c_expr_sizeof_expr): Likewise.
(parser_build_unary_op): Likewise.
(parser_build_binary_op): Likewise.
(digest_init): Likewise.
(pop_init_level): Likewise.
* (c_parser_gimple_call_internal): Likewise.
2022-09-19 Marek Polacek <>
PR c/106947
* (maybe_warn_for_null_address): Don't emit stray
2022-09-15 Richard Biener <>
* (build_void_list_node): Remove.
2022-09-14 Julian Brown <>
* (c_finish_omp_clauses): Remove whole mapping node group
on error.
2022-09-07 Joseph Myers <>
* (c_parser_static_assert_declaration_no_semi)
(c_parser_alignas_specifier, c_parser_alignof_expression): Allow
for C2x spellings of keywords.
(c_parser_postfix_expression): Handle RID_TRUE and RID_FALSE.
2022-09-06 Jakub Jelinek <>
* (c_parser_omp_clause_doacross_sink): Don't verify val
in omp_cur_iteration - 1 has integer_type_node type.
2022-09-03 Jakub Jelinek <>
* (c_parser_omp_clause_name): Handle doacross.
(c_parser_omp_clause_depend_sink): Renamed to ...
(c_parser_omp_clause_doacross_sink): ... this. Add depend_p argument.
Handle parsing of doacross(sink:omp_cur_iteration-1). Use
(c_parser_omp_clause_depend): Use OMP_CLAUSE_DOACROSS_SINK and
(c_parser_omp_clause_doacross): New function.
(c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DOACROSS.
(c_parser_omp_depobj): Use OMP_CLAUSE_DEPEND_INVALID instead of
(c_parser_omp_for_loop): Don't diagnose here linear clause together
with ordered with argument.
(c_parser_omp_simd): Don't diagnose ordered clause with argument on
for simd.
(c_parser_omp_ordered): Handle also doacross and adjust for it
diagnostic wording.
* (c_finish_omp_clauses): Handle OMP_CLAUSE_DOACROSS.
2022-09-02 David Malcolm <>
PR c/90885
* (c_parser_string_literal): Clear ret.m_decimal.
(c_parser_expr_no_commas): Likewise.
(c_parser_conditional_expression): Likewise.
(c_parser_binary_expression): Clear m_decimal when popping the
(c_parser_unary_expression): Clear ret.m_decimal.
(c_parser_has_attribute_expression): Likewise for result.
(c_parser_predefined_identifier): Likewise for expr.
(c_parser_postfix_expression): Likewise for expr.
Set expr.m_decimal when handling a CPP_NUMBER that was a decimal
* c-tree.h (c_expr::m_decimal): New bitfield.
* (parser_build_binary_op): Clear result.m_decimal.
(parser_build_binary_op): Call check_for_xor_used_as_pow.
2022-09-01 Joseph Myers <>
* (grokparms): Handle () in a function declaration the
same as (void) for C2X.
2022-08-31 Joseph Myers <>
* (c_parser_label): Pass attributes to do_case.
* (do_case): Add argument ATTRS. Pass it to
2022-08-26 Jakub Jelinek <>
* (convert_arguments): Handle BUILT_IN_ISSIGNALING.
2022-08-25 Marek Polacek <>
* (c_convert) <case POINTER_TYPE>: Handle NULLPTR_TYPE.
Give a better diagnostic when converting to nullptr_t.
* (c_init_decl_processing): Perform C-specific nullptr
* (c_parse_init): Maybe OR D_C2X into mask.
(c_parser_postfix_expression): Handle RID_NULLPTR.
* (null_pointer_constant_p): Return true when expr is
(build_unary_op) <case TRUTH_NOT_EXPR>: Handle NULLPTR_TYPE.
(build_conditional_expr): Handle the case when the second/third operand
is NULLPTR_TYPE and third/second operand is POINTER_TYPE.
(convert_for_assignment): Handle converting an expression of type
nullptr_t to pointer/bool.
(build_binary_op) <case TRUTH_XOR_EXPR>: Handle NULLPTR_TYPE.
<case EQ_EXPR>: Handle comparing operands of type nullptr_t.
2022-08-25 Joseph Myers <>
* (start_decl): Do not diagnose initialization of
variable-sized objects here.
* (c_parser_braced_init): Add argument DECL. All
callers changed.
(c_parser_initializer): Diagnose initialization of variable-sized
objects other than with braced initializer.
(c_parser_braced_init): Use pedwarn_c11 for empty initializer
braces and update diagnostic text. Diagnose initialization of
variable-sized objects with nonempty braces.
* (digest_init): Update diagnostic for initialization
of variable-sized objects.
(really_start_incremental_init, set_designator)
(process_init_element): Update comments.
(pop_init_level): Allow scalar empty initializers.
2022-08-17 Tobias Burnus <>
Chung-Lin Tang <>
PR c++/104493
* (c_decl_attributes, finish_decl): Call omp_mappable_type
instead of removed langhook.
* (c_finish_omp_clauses): Likewise.
2022-08-11 Marek Polacek <>
PR middle-end/102633
* (c_parser_initializer): Add new tree parameter. Use it.
Call suppress_warning.
(c_parser_declaration_or_fndef): Pass d down to c_parser_initializer.
(c_parser_omp_declare_reduction): Pass omp_priv down to
2022-08-08 Tom Honermann <>
* (c_parser_string_literal): Use char8_t as the type
of CPP_UTF8STRING when char8_t support is enabled.
* (digest_init): Allow initialization of an array
of character type by a string literal with type array of
2022-08-01 David Malcolm <>
* (build_c_cast): Quote names of address spaces in
(convert_for_assignment): Add a note to address space mismatch
diagnostics, specifying the expected and actual types.
2022-07-10 Lewis Hyatt <>
PR preprocessor/97498
* (c_parser_pragma): Set input_location to the
location of the pragma, rather than the start of the line.
2022-07-04 Tobias Burnus <>
Chung-Lin Tang <>
Thomas Schwinge <>
* (c_parser_omp_target_data, c_parser_omp_target_update,
c_parser_omp_target_enter_data, c_parser_omp_target_exit_data): Set
(c_parser_omp_requires): Remove sorry.
2022-07-01 Tobias Burnus <>
* (c_parser_omp_target_enter_data,
c_parser_omp_target_exit_data): Accept tofrom
map-type modifier but use 'to' / 'from' internally.
2022-06-16 David Malcolm <>
* (implicitly_declare): Add auto_diagnostic_group to
group the warning with any note.
(warn_about_goto): Likewise to group error or warning with note.
Bail out if the warning wasn't emitted, to avoid emitting orphan
(lookup_label_for_goto): Add auto_diagnostic_group to
group the error with the note.
(check_earlier_gotos): Likewise.
(c_check_switch_jump_warnings): Likewise for any error/warning.
Conditionalize emission of the notes.
(diagnose_uninitialized_cst_member): Likewise for warning,
conditionalizing emission of the note.
(grokdeclarator): Add auto_diagnostic_group to group the "array
type has incomplete element type" error with any note.
(parser_xref_tag): Add auto_diagnostic_group to group warnings
with their notes. Conditionalize emission of notes.
(start_struct): Add auto_diagnostic_group to group the
"redefinition of" errors with any note.
(start_enum): Likewise for "redeclaration of %<enum %E%>" error.
(check_for_loop_decls): Likewise for pre-C99 error.
2022-06-07 Jakub Jelinek <>
* (c_parser_omp_clause_linear): Parse OpenMP 5.2
style linear clause modifiers. Set
old style modifiers are used.
* (c_finish_omp_clauses): Only reject linear clause
with val modifier on simd or for if the old style modifiers are
2022-06-02 David Malcolm <>
(c_get_sarif_source_language): New.
* c-tree.h (c_get_sarif_source_language): New decl.
2022-05-31 Jason Merrill <>
* (c.tags): Look at *.cc.
2022-05-31 Jakub Jelinek <>
* (OMP_SCOPE_CLAUSE_MASK): Add firstprivate and allocate
2022-05-28 Jakub Jelinek <>
* (c_parser_omp_declare_target): If OMP_CLAUSE_LINK was
seen first, use "%<to%>" or "%<enter%>" depending on
OMP_CLAUSE_ENTER_TO of the current clause, otherwise use
"%<to%> or %<enter%>" wording.
2022-05-27 Jakub Jelinek <>
* (c_parser_omp_clause_name): Parse enter clause.
(c_parser_omp_all_clauses): For to clause on declare target, use
(c_parser_omp_declare_target): Use OMP_CLAUSE_ENTER instead of
* (c_finish_omp_clauses): Handle OMP_CLAUSE_ENTER instead
name in diagnostics instead of
omp_clause_code_name[OMP_CLAUSE_CODE (c)].
2022-05-25 Jakub Jelinek <>
PR c/91134
* c-tree.h (build_component_ref): Add ARROW_LOC location_t argument.
* (build_component_ref): Likewise. If DATUM is
INDIRECT_REF and ARROW_LOC isn't UNKNOWN_LOCATION, print a different
diagnostic and fixit hint if DATUM has pointer type.
* (c_parser_postfix_expression,
c_parser_omp_variable_list): Adjust build_component_ref callers.
* (c_parser_gimple_postfix_expression_after_primary):
2022-05-24 Jakub Jelinek <>
PR c/105378
* (OMP_TASKWAIT_CLAUSE_MASK): Add nowait clause.
2022-05-18 Marek Polacek <>
PR c/105131
* (diagnose_mismatched_decls): Warn about enum/integer type
* c-tree.h (comptypes_check_enum_int): Declare.
* (comptypes): No longer static.
2022-05-17 Marek Polacek <>
* (finish_enum): Store the CONST_DECL into TREE_VALUE, not
its value.
2022-05-17 Jakub Jelinek <>
* (c_parser_omp_clause_depend): Parse
inoutset depend-kind.
(c_parser_omp_depobj): Likewise.
2022-05-16 Martin Liska <>
* (match_builtin_function_types): Use ARRAY_SIZE.
2022-05-12 Jakub Jelinek <>
* (c_parse_init): Register omp_all_memory as keyword
if flag_openmp.
(c_parser_postfix_expression): Diagnose uses of omp_all_memory
in postfix expressions.
(c_parser_omp_variable_list): Handle omp_all_memory in depend
* (c_finish_omp_clauses): Handle omp_all_memory
keyword in depend clause as null_pointer_node, diagnose invalid
2022-05-09 Martin Liska <>
* (c_parser_conditional_expression): Use {,UN}LIKELY
(c_parser_binary_expression): Likewise.
2022-05-07 Marek Polacek <>
PR c++/101833
PR c++/47634
* (maybe_adjust_arg_pos_for_attribute): New.
2022-04-08 Jakub Jelinek <>
PR c/105149
* (c_build_va_arg): Reject function types.
2022-03-22 Marek Polacek <>
PR c/82283
PR c/84685
* (struct initializer_stack): Add 'designated' member.
(start_init): Set it.
(finish_init): Restore constructor_designated.
(push_init_level): Set constructor_designated to the value of
constructor_designated in the upper constructor_stack.
2022-03-12 Thomas Schwinge <>
PR other/65095
* (handle_omp_array_sections_1)
(c_oacc_check_attachments): Call 'user_omp_clause_code_name'
instead of 'c_omp_map_clause_name'.
2022-03-09 Joseph Myers <>
* (function_types_compatible_p): Do not handle C2X
differently from earlier standards for unprototyped function type
2022-03-09 Jakub Jelinek <>
PR c/104711
* (c_fully_fold_internal): Don't emit
-Wshift-negative-value warning if TYPE_OVERFLOW_WRAPS.
* (build_binary_op): Likewise.
2022-03-07 Jakub Jelinek <>
* (c_parser_omp_clause_map): Add missing space in string
2022-02-23 Richard Biener <>
* (c_parser_parse_gimple_body): Diagnose
SSA names without definition.
(c_parser_gimple_declaration): Handle pointer typed SSA names.
2022-02-17 Jakub Jelinek <>
PR c/104532
* (c_parser_omp_variable_list): For CPP_DEREF, use
convert_lvalue_to_rvalue and build_indirect_ref instead of
2022-02-11 Richard Biener <>
* (c_parser_gimple_statement): Properly parse
2022-02-10 Marcel Vollweiler <>
* (c_parser_omp_clause_name): Parse 'has_device_addr'
(c_parser_omp_variable_list): Handle array sections.
(c_parser_omp_clause_has_device_addr): Added.
(c_parser_omp_all_clauses): Added PRAGMA_OMP_CLAUSE_HAS_DEVICE_ADDR
(c_parser_omp_target_exit_data): Added HAS_DEVICE_ADDR to
* (handle_omp_array_sections): Handle clause restrictions.
(c_finish_omp_clauses): Handle array sections.
2022-02-09 Jakub Jelinek <>
PR c/104427
* (c_parser_postfix_expression)
<case RID_BUILTIN_ASSOC_BARRIER>: Use parser_build_unary_op
instead of build1_loc to build PAREN_EXPR.
* (build_unary_op): Handle PAREN_EXPR.
* (c_fully_fold_internal): Likewise.
2022-01-17 Martin Liska <>
* Rename .c names to .cc.
* Likewise.
* (struct lang_identifier): Likewise.
(pop_scope): Likewise.
(finish_decl): Likewise.
* c-objc-common.h (GCC_C_OBJC_COMMON): Likewise.
* (c_parser_skip_to_end_of_block_or_statement): Likewise.
* c-parser.h (GCC_C_PARSER_H): Likewise.
* c-tree.h (c_keyword_starts_typename): Likewise.
(finish_declspecs): Likewise.
(c_get_alias_set): Likewise.
(enum c_oracle_request): Likewise.
(tag_exists_p): Likewise.
(set_c_expr_source_range): Likewise.
* (c_common_type): Likewise.
(c_finish_omp_clauses): Likewise.
* Likewise.
2022-01-17 Martin Liska <>
* c-aux-info.c: Moved to...
* c-convert.c: Moved to...
* c-decl.c: Moved to...
* c-errors.c: Moved to...
* c-fold.c: Moved to...
* c-lang.c: Moved to...
* c-objc-common.c: Moved to...
* c-parser.c: Moved to...
* c-typeck.c: Moved to...
* gccspec.c: Moved to...
* gimple-parser.c: Moved to...
2022-01-17 Andrew Stubbs <>
* c-parser.c (c_parser_omp_requires): Don't "sorry" dynamic_allocators.
2022-01-14 Chung-Lin Tang <>
PR c++/103705
* c-typeck.c (c_finish_omp_clauses): Also continue peeling off of
outer node for ARRAY_REFs.
2022-01-01 Jakub Jelinek <>
PR objc/103639
* c-typeck.c (c_finish_bc_stmt): For break inside of switch inside of
ObjC foreach, emit normal BREAK_STMT rather than goto to label.
2021-12-17 Marek Polacek <>
PR c/103649
* c-decl.c (c_warn_unused_attributes): Don't warn for
* c-parser.c (c_parser_std_attribute): Skip parsing of the attribute
arguments when the attribute is ignored.
2021-12-14 Jakub Jelinek <>
PR c/103587
* c-parser.c (c_parser_balanced_token_sequence): For CPP_PRAGMA,
consume the pragma and silently skip to the pragma eol.
2021-12-12 Jonathan Wakely <>
* c-decl.c: Define INCLUDE_MEMORY instead of INCLUDE_UNIQUE_PTR.
* c-parser.c: Likewise.
2021-12-09 Jakub Jelinek <>
PR pch/71934
* c-decl.c (resort_field_decl_cmp): Pass the same pointer twice
to resort_data.new_value.
2021-12-08 Chung-Lin Tang <>
* c-parser.c (struct omp_dim): New struct type for use inside
(c_parser_omp_variable_list): Allow multiple levels of array and
component accesses in array section base-pointer expression.
(c_parser_omp_clause_to): Set 'allow_deref' to true in call to
(c_parser_omp_clause_from): Likewise.
* c-typeck.c (handle_omp_array_sections_1): Extend allowed range
of base-pointer expressions involving INDIRECT/MEM/ARRAY_REF and
(c_finish_omp_clauses): Extend allowed ranged of expressions
2021-12-08 Chung-Lin Tang <>
PR middle-end/92120
* c-parser.c (c_parser_omp_clause_map): Set 'allow_deref' argument in
call to c_parser_omp_variable_list to 'true'.
* c-typeck.c (handle_omp_array_sections_1): Add strip of MEM_REF in
array base handling.
(c_finish_omp_clauses): Handle 'A->member' case in map clauses.
2021-11-30 Thomas Schwinge <>
* c-typeck.c (c_finish_omp_clauses): Remove "gang reduction on an
orphan loop" checking.
2021-11-30 Cesar Philippidis <>
Thomas Schwinge <>
* c-typeck.c (c_finish_omp_clauses): Emit an error on orphan
OpenACC gang reductions.
2021-11-30 Richard Biener <>
* gimple-parser.c (c_parser_gimple_postfix_expression):
avoid unreachable code after break.
2021-11-29 Eric Gallager <>
PR other/103021
* Use ETAGS variable in TAGS target.
2021-11-29 Richard Biener <>
* c-typeck.c (c_tree_equal): Remove unreachable return.
* c-parser.c (get_matching_symbol): Likewise.
2021-11-23 Jakub Jelinek <>
* c-typeck.c (c_clone_omp_udr): Don't initialize
2021-11-19 Martin Sebor <>
PR c++/33925
PR c/102867
* c-typeck.c (maybe_warn_for_null_address): Suppress warnings for
code resulting from macro expansion.
2021-11-19 Martin Liska <>
2021-11-19 Martin Liska <>
* c-parser.c (add_debug_begin_stmt): Use option directly.
2021-11-18 Matthias Kretz <>
* c-decl.c (names_builtin_p): Handle RID_BUILTIN_ASSOC_BARRIER.
* c-parser.c (c_parser_postfix_expression): Likewise.
2021-11-18 Martin Liska <>
* c-parser.c (add_debug_begin_stmt): Use option directly.
2021-11-17 Martin Sebor <>
PR c/101702
* c-decl.c (get_parm_array_spec): Strip casts earlier and fold array
bounds before deciding if they're constant.
2021-11-15 Jakub Jelinek <>
* c-parser.c (OMP_TARGET_CLAUSE_MASK): Add
2021-11-11 Jakub Jelinek <>
* c-parser.c (c_parser_omp_clause_num_teams): Parse optional
lower-bound and store it into OMP_CLAUSE_NUM_TEAMS_LOWER_EXPR.
(c_parser_omp_target): For OMP_CLAUSE_NUM_TEAMS evaluate before
combined target teams even lower-bound expression.
2021-11-11 Richard Biener <>
* gimple-parser.c: Shuffle bitmap.h include.
2021-11-03 Joseph Myers <>
PR c/103031
* c-convert.c (c_convert): New function, based on convert.
(convert): Make into wrapper of c_convert.
(convert_init): New function.
* c-typeck.c (enum impl_conv): Add ic_init_const.
(convert_for_assignment): Handle ic_init_const like ic_init. Add
new argument to convert_and_check call.
(digest_init): Pass ic_init_const to convert_for_assignment for
initializers required to be constant.
2021-11-02 Richard Sandiford <>
* c-tree.h (c_simulate_record_decl): Declare.
* c-objc-common.h (LANG_HOOKS_SIMULATE_RECORD_DECL): Override.
* c-decl.c (c_simulate_record_decl): New function.
2021-10-22 Eric Gallager <>
PR other/102663
* Add dummy c.install-dvi target.
2021-10-15 Richard Biener <>
PR c/102763
* gimple-parser.c
(c_parser_gimple_postfix_expression_after_primary): Check
for a pointer do be dereferenced by ->.
2021-10-14 Kwok Cheung Yeung <>
* c-parser.c (c_finish_omp_declare_variant): Change call from
c_omp_check_context_selector to omp_check_context_selector. Change
call from c_omp_mark_declare_variant to omp_mark_declare_variant.
2021-10-09 Jakub Jelinek <>
* c-parser.c (c_parser_omp_structured_block_sequence): New function.
(c_parser_omp_scan_loop_body): Use it.
(c_parser_omp_sections_scope): Likewise.
2021-10-07 Richard Biener <>
* c-typeck.c (lvalue_p): Also allow MEM_REF and TARGET_MEM_REF.
2021-10-05 Richard Biener <>
PR c/102605
* gimple-parser.c (c_parser_gimple_postfix_expression):
Accept more address _Literals.
2021-10-04 Marek Polacek <>
PR c++/97573
* c-typeck.c (parser_build_binary_op): Call do_warn_array_compare.
2021-10-01 Martin Sebor <>
PR c/102103
* c-typeck.c (maybe_warn_for_null_address): New function.
(build_binary_op): Call it.
2021-10-01 Jakub Jelinek <>
Richard Biener <>
PR sanitizer/102515
* c-typeck.c (build_binary_op): Call ubsan_instrument_division
for division even for SANITIZE_SI_OVERFLOW.
2021-10-01 Jakub Jelinek <>
* c-parser.c (c_parser_omp_clause_order): Set
OMP_CLAUSE_ORDER_REPRODUCIBLE for explicit reproducible: modifier.
2021-09-28 Andrew Pinski <>
PR c/32122
* c-parser.c (c_parser_statement_after_labels): Pass
the c_expr instead of the tree to c_finish_goto_ptr.
* c-typeck.c (c_finish_goto_ptr): Change the second
argument type to c_expr.
* c-tree.h (c_finish_goto_ptr): Likewise.
Error out if the expression was not of a pointer type.
2021-09-22 Jakub Jelinek <>
* c-parser.c (c_parser_omp_clause_allocate): Parse allocate clause
2021-09-18 Jakub Jelinek <>
* c-parser.c (c_parser_omp_clause_order): Parse unconstrained
and reproducible modifiers.
2021-09-18 Jakub Jelinek <>
* c-parser.c (c_parser_omp_clause_default): Handle private and
firstprivate arguments, adjust diagnostics on unknown argument.
2021-09-17 Jakub Jelinek <>
* c-parser.c (c_parser_omp_atomic): Reject atomic swap if capture
is true.
2021-09-10 Jakub Jelinek <>
* c-parser.c (c_parser_conditional_expression): If omp_atomic_lhs and
cond.value is >, < or == with omp_atomic_lhs as one of the operands,
don't call build_conditional_expr, instead build a COND_EXPR directly.
(c_parser_binary_expression): Avoid calling parser_build_binary_op
if omp_atomic_lhs even in more cases for >, < or ==.
(c_parser_omp_atomic): Update function comment for OpenMP 5.1 atomics,
parse OpenMP 5.1 atomics and fail, compare and weak clauses, allow
acq_rel on atomic read/write and acq_rel/acquire clauses on update.
* c-typeck.c (build_binary_op): For flag_openmp only handle
2021-09-07 Marcel Vollweiler <>
* c-parser.c (c_parser_omp_flush): Parse 'seq_cst' clause on 'flush'
2021-09-01 Iain Sandoe <>
* c-decl.c (enum deprecated_states): Add unavailable state.
(merge_decls): Copy unavailability.
(quals_from_declspecs): Handle unavailable case.
(start_decl): Amend the logic handling suppression of nested
deprecation states to include unavailability.
(smallest_type_quals_location): Amend comment.
(grokdeclarator): Handle the unavailable deprecation state.
(declspecs_add_type): Set TREE_UNAVAILABLE from the decl specs.
* c-tree.h (struct c_declspecs): Add unavailable_p.
* c-typeck.c (build_component_ref): Handle unavailability.
(build_external_ref): Likewise.
2021-09-01 Roger Sayle <>
Joseph Myers <>
PR c/79412
* c-decl.c (duplicate_decls): On significant mismatches, mark the
types of both (non-function) decls as error_mark_node, so that the
middle-end can see the code is malformed.
(free_attr_access_data): Don't process if the type has been set to
2021-08-31 Marcel Vollweiler <>
* c-parser.c (c_parser_omp_clause_device): Parse device-modifiers 'device_num'
and 'ancestor' in 'target device' clauses.
2021-08-23 Jakub Jelinek <>
* c-parser.c (c_parser_omp_clause_num_tasks,
c_parser_omp_clause_grainsize): Parse the optional strict: modifier.
2021-08-22 Martin Uecker <>
PR c/98397
* c-typeck.c (comp_target_types): Change pedwarn to pedwarn_c11
for pointers to arrays with qualifiers.
(build_conditional_expr): For C23 don't lose qualifiers for pointers
to arrays when the other pointer is a void pointer. Update warnings.
(convert_for_assignment): Update warnings for C2X when converting from
void* with qualifiers to a pointer to array with the same qualifiers.
2021-08-20 Jakub Jelinek <>
* c-parser.c (c_parser_omp_error): New function.
(c_parser_pragma): Handle PRAGMA_OMP_ERROR.
2021-08-20 Jakub Jelinek <>
* c-parser.c (c_parser_omp_clause_depend_sink): Reject spurious
comma at the end of list.
(c_parser_omp_requires): Likewise.
2021-08-19 Jakub Jelinek <>
* c-parser.c (c_parser_omp_requires): Don't call
c_parser_peek_2nd_token and optionally consume token if current
2021-08-18 Jakub Jelinek <>
* c-parser.c (c_parser_omp_nothing): New function.
(c_parser_pragma): Handle PRAGMA_OMP_NOTHING.
2021-08-18 Jakub Jelinek <>
* c-parser.c (c_parser_statement_after_labels): Add restart label
near the start of the function. If c_parser_pragma returns false,
goto restart.
(c_parser_pragma): For PRAGMA_OMP_CANCELLATION_POINT return what
c_parser_omp_cancellation_point returned. For PRAGMA_OMP_DECLARE
return what c_parser_omp_declare returned. Return true instead of
false after emitting errors that the directive is not allowed in
pragma_stmt context.
(c_parser_omp_ordered): Return true instead of
false after emitting errors that the directive is not allowed in
pragma_stmt context.
(c_parser_omp_target_update): Likewise.
(c_parser_omp_target_enter_data, c_parser_omp_target_exit_data):
Change return type from tree to bool, return false if the
directive should be ignored in pragma_stmt contexts.
(c_parser_omp_target): Adjust callers of c_parser_omp_target_*_data,
return their result directly.
(c_parser_omp_cancellation_point): Change return type from void to
bool, return false if the directive should be ignored in pragma_stmt
(c_parser_omp_declare): Likewise.
2021-08-17 Jakub Jelinek <>
* c-parser.c (OMP_SCOPE_CLAUSE_MASK): Define.
(c_parser_omp_scope): New function.
(c_parser_omp_construct): Handle PRAGMA_OMP_SCOPE.
2021-08-12 Jakub Jelinek <>
* c-parser.c (c_parser_omp_clause_name): Parse filter clause name.
(c_parser_omp_clause_filter): New function.
(c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_FILTER.
(c_parser_omp_masked): New function.
(c_parser_omp_parallel): Handle parallel masked.
(c_parser_omp_construct): Handle PRAGMA_OMP_MASKED.
* c-typeck.c (c_finish_omp_clauses): Handle OMP_CLAUSE_FILTER.
2021-08-12 Martin Uecker <>
PR c/101838
PR c/29970
* c-typeck.c (c_expr_sizeof_type): Evaluate
size expressions for structs of variable size.
2021-08-12 Tobias Burnus <>
* c-parser.c (c_parser_omp_clause_proc_bind): Accept
'primary' as alias for 'master'.
2021-08-10 Martin Uecker <>
PR c/29970
* c-typeck.c (c_expr_sizeof_expr): Evaluate
size expressions for structs of variable size.
2021-08-06 Tamar Christina <>
* c-decl.c (c_simulate_enum_decl): Pass vec<> by pointer.
* c-tree.h (c_simulate_enum_decl): Likewise.
2021-08-06 Martin Sebor <>
* c-parser.c (c_parser_declaration_or_fndef): Adjust by-value function
vec arguments to by-reference.
(c_finish_omp_declare_simd): Same.
(c_parser_compound_statement_nostart): Same.
(c_parser_for_statement): Same.
(c_parser_objc_methodprotolist): Same.
(c_parser_oacc_routine): Same.
(c_parser_omp_for_loop): Same.
(c_parser_omp_declare_simd): Same.
2021-07-21 Thomas Schwinge <>
Joseph Myers <>
Cesar Philippidis <>
* c-parser.c (c_parser_omp_clause_name): Handle 'nohost'.
(c_parser_oacc_all_clauses): Handle 'PRAGMA_OACC_CLAUSE_NOHOST'.
* c-typeck.c (c_finish_omp_clauses): Handle 'OMP_CLAUSE_NOHOST'.
2021-07-20 Martin Sebor <>
* c-tree.h (c_build_function_call_vec): Adjust by-value argument to
* c-typeck.c (c_build_function_call_vec): Same.
2021-07-15 Martin Sebor <>
PR c/101289
PR c/97548
* c-decl.c (get_parm_array_spec): Strip nops.
2021-07-06 Martin Sebor <>
* c-objc-common.c (c_tree_printer): Remove support for %G and %K.
2021-07-02 Jakub Jelinek <>
PR c/101297
* c-parser.c (c_parser_omp_atomic): Consume comma only if it
appears before a CPP_NAME.
2021-06-25 Martin Sebor <>
* c-decl.c (pop_scope): Replace direct uses of TREE_NO_WARNING with
warning_suppressed_p, suppress_warning, and copy_no_warning.
(diagnose_mismatched_decls): Same.
(duplicate_decls): Same.
(grokdeclarator): Same.
(finish_function): Same.
(c_write_global_declarations_1): Same.
* c-fold.c (c_fully_fold_internal): Same.
* c-parser.c (c_parser_expr_no_commas): Same.
(c_parser_postfix_expression): Same.
* c-typeck.c (array_to_pointer_conversion): Same.
(function_to_pointer_conversion): Same.
(default_function_array_conversion): Same.
(convert_lvalue_to_rvalue): Same.
(default_conversion): Same.
(build_indirect_ref): Same.
(build_function_call_vec): Same.
(build_atomic_assign): Same.
(build_unary_op): Same.
(c_finish_return): Same.
(emit_side_effect_warnings): Same.
(c_finish_stmt_expr): Same.
(c_omp_clause_copy_ctor): Same.
2021-06-24 Jakub Jelinek <>
PR c/101176
* c-parser.c (c_parser_has_attribute_expression): Set source range for
the result.
2021-06-24 Jakub Jelinek <>
PR c/101171
* c-typeck.c (build_c_cast): Don't call note_integer_operands on
2021-06-24 Jakub Jelinek <>
* c-parser.c (omp_split_clauses): Pass C_ORT_OMP_TARGET instead of
C_ORT_OMP for clauses on target construct.
(OMP_TARGET_CLAUSE_MASK): Add in_reduction clause.
(c_parser_omp_target): For non-combined target add
map (always, tofrom:) clauses for OMP_CLAUSE_IN_REDUCTION. Pass
C_ORT_OMP_TARGET to c_finish_omp_clauses.
* c-typeck.c (handle_omp_array_sections): Adjust ort handling
for addition of C_ORT_OMP_TARGET and simplify, mapping clauses are
never present on C_ORT_*DECLARE_SIMD.
(c_finish_omp_clauses): Likewise. Handle OMP_CLAUSE_IN_REDUCTION
corresponding map clauses.
2021-06-21 Jakub Jelinek <>
PR inline-asm/100785
* c-typeck.c (c_mark_addressable): Diagnose trying to make
bit-fields addressable.
2021-06-15 Robin Dapp <>
* c-decl.c (merge_decls): Copy DECL_USER_ALIGN if DECL_ALIGN is
2021-06-14 Tobias Burnus <>
PR c/100913
* c-parser.c (c_parser_omp_clause_affinity): No need to set iterator
var in the error case.
2021-06-07 Eric Botcazou <>
PR c/100920
* c-typeck.c (convert_for_assignment): Test fndecl_built_in_p to
spot built-in functions.
2021-06-06 Jakub Jelinek <>
PR c/100902
* c-parser.c (c_parser_omp_target): Call c_omp_adjust_map_clauses
even when target is combined with other constructs.
2021-06-06 Eric Botcazou <>
PR c/100920
* c-decl.c (finish_struct): Fix thinko in previous change.
* c-typeck.c (convert_for_assignment): Do not warn on pointer
assignment and initialization for storage order purposes if the
RHS is a call to a DECL_IS_MALLOC function.
2021-06-04 Martin Sebor <>
PR c/100783
* c-objc-common.c (print_type): Handle erroneous types.
2021-06-03 Jakub Jelinek <>
PR c++/100859
* c-typeck.c (c_finish_omp_clauses): Move OMP_CLAUSE_AFFINITY
after depend only cases.
2021-05-31 Richard Biener <>
PR c++/88601
* c-decl.c (names_builtin_p): Handle RID_BUILTIN_SHUFFLEVECTOR.
* c-parser.c (c_parser_postfix_expression): Likewise.
2021-05-28 Richard Biener <>
PR c/100803
* gimple-parser.c (c_parser_gimple_paren_condition): Diagnose
invalid if conditions.
2021-05-28 Jakub Jelinek <>
PR middle-end/99928
* c-typeck.c (handle_omp_array_sections): Copy OMP_CLAUSE_MAP_IMPLICIT.
(c_finish_omp_clauses): Move not just OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT
marked clauses last, but also OMP_CLAUSE_MAP_IMPLICIT. Add
map_firstprivate_head bitmap, set it for GOMP_MAP_FIRSTPRIVATE_POINTER
maps and silently remove OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT if it is
present too. For OMP_CLAUSE_MAP_IMPLICIT silently remove the clause
if present in map_head, map_field_head or map_firstprivate_head
2021-05-28 Tobias Burnus <>
* c-parser.c (c_parser_omp_clause_affinity): New.
(c_parser_omp_clause_name, c_parser_omp_variable_list,
c_parser_omp_all_clauses, OMP_TASK_CLAUSE_MASK): Handle affinity clause.
* c-typeck.c (handle_omp_array_sections_1, handle_omp_array_sections,
c_finish_omp_clauses): Likewise.
2021-05-26 Eric Botcazou <>
PR c/100653
* c-decl.c (finish_struct): Warn for a union containing an aggregate
field with a differing scalar storage order.
2021-05-21 Jakub Jelinek <>
PR middle-end/99928
* c-typeck.c (c_finish_omp_clauses): Move firstprivate clauses with
OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT to the end of the chain. Don't error
if a decl is mentioned both in map clause and in such firstprivate
2021-05-19 Jakub Jelinek <>
PR middle-end/99928
* c-parser.c (c_parser_omp_master): Set OMP_MASTER_COMBINED on
master when combined with taskloop.
(c_parser_omp_parallel): Don't set OMP_PARALLEL_COMBINED on
parallel master when not combined with taskloop.
2021-05-18 Richard Biener <>
PR c/100522
* gimple-parser.c (c_parser_gimple_postfix_expression_after_primary):
Diagnose calls to non-functions.
(c_parser_gimple_statement): Diagnose unexpected assignment RHS.
2021-05-17 Richard Biener <>
PR c/100625
* gimple-parser.c (c_parser_gimple_label): Avoid building
a GIMPLE label with NULL label decl.
2021-05-13 Martin Sebor <>
PR c/100550
* c-decl.c (get_parm_array_spec): Avoid erroneous VLA bounds.
2021-05-12 Marcel Vollweiler <>
* c-parser.c (c_parser_omp_clause_map): Support map-type-modifier
2021-05-10 Martin Liska <>
* c-aux-info.c (affix_data_type): Use startswith
function instead of strncmp.
* c-typeck.c (build_function_call_vec): Likewise.
* gimple-parser.c (c_parser_gimple_parse_bb_spec): Likewise.
2021-05-07 Eric Botcazou <>
* c-typeck.c (build_unary_op) <ADDR_EXPR>: Do not issue an error
on the address of a pointer field in a record with reverse SSO.
2021-05-04 Tobias Burnus <>
* c-typeck.c (c_finish_omp_clauses): Accept float + complex
for || and && reductions.
2021-04-29 Joseph Myers <>
* c-typeck.c (function_types_compatible_p): For C2X, treat
unprototyped function as compatible with non-variadic prototyped
function even if some argument types are changed by the default
argument promotions.
2021-04-15 Martin Sebor <>
PR c/99420
PR c/99972
* c-decl.c (pushdecl): Always propagate type attribute.
2021-04-15 Richard Sandiford <>
PR c/98852
* c-typeck.c (c_common_type): Do not drop attributes that
affect type identity.
2021-04-10 Jakub Jelinek <>
PR c/99990
* c-decl.c (finish_decl): Don't overwrite TREE_TYPE of
2021-03-25 Jakub Jelinek <>
PR c++/99565
* c-typeck.c (build_conditional_expr): Pass OEP_ADDRESS_OF_SAME_FIELD
to operand_equal_p.
2021-03-19 Jakub Jelinek <>
PR c/99588
* c-typeck.c (mark_exp_read): Recognize what build_atomic_assign
with modifycode NOP_EXPR produces and mark the _Atomic var as read
if found.
(build_atomic_assign): For modifycode of NOP_EXPR, use COMPOUND_EXPRs
rather than STATEMENT_LIST. Otherwise call mark_exp_read on lhs.
2021-03-15 Tobias Burnus <>
PR c++/99509
* c-decl.c (finish_decl): For 'omp declare target implicit' vars,
ensure that the varpool node is marked as offloadable.
2021-03-05 Tobias Burnus <>
PR c/99137
* c-parser.c (c_parser_oacc_clause_async): Reject comma expressions.
2021-02-24 Martin Sebor <>
PR middle-end/97172
* c-decl.c (free_attr_access_data): Clear attribute arg spec.
2021-02-18 Jakub Jelinek <>
PR c/99136
* c-typeck.c (c_finish_return): Don't wrap retval into
EXCESS_PRECISION_EXPR in functions that return void.
2021-02-11 Marek Polacek <>
* c-parser.c (c_parser_if_statement): Use vec_free.
2021-02-04 Martin Sebor <>
PR c/97882
* c-decl.c (locate_old_decl): Add type to diagnostic output.
(diagnose_mismatched_decls): Same.
(start_function): Introduce temporaries for better readability.
* c-typeck.c (comptypes_internal): Only consider complete enum
types in comparisons with integers.
2021-02-01 Martin Sebor <>
PR middle-end/97172
* c-decl.c (free_attr_access_data): New function.
(c_parse_final_cleanups): Call free_attr_access_data.
2021-01-16 Kwok Cheung Yeung <>
* c-parser.c (c_parser_omp_clause_detach): New.
(c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH clause.
* c-typeck.c (c_finish_omp_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH
clause. Prevent use of detach with mergeable and overriding the
data sharing mode of the event handle.
2021-01-15 Jakub Jelinek <>
* c-typeck.c (c_finish_omp_clauses): For reduction build array with
unqualified element type and then call c_build_qualified_type on the
2021-01-07 Richard Biener <>
* gimple-parser.c (c_parser_gimple_compound_statement): Only
reallocate loop array if it is too small.
2020-12-16 Martin Uecker <>
PR c/98047
* c-typeck.c (build_modify_expr): Drop qualifiers.
2020-12-16 Martin Uecker <>
PR c/98260
* c-parser.c (c_parser_expression): Look into
nop expression when marking expressions as read.
2020-12-14 Martin Liska <>
PR sanitizer/98204
* c-typeck.c (pointer_diff): Do not emit a top-level
(build_binary_op): Likewise.
2020-12-09 Tobias Burnus <>
* c-parser.c (c_parser_omp_allocate): New.
(c_parser_omp_construct): Call it.
2020-12-09 Richard Biener <>
PR c/98200
* gimple-parser.c (c_parser_gimple_postfix_expression): Return
early on error.
2020-12-07 Martin Uecker <>
PR c/97981
* c-typeck.c (convert_lvalue_to_rvalue): Move the code
that drops qualifiers to the end of the function.
2020-11-26 Martin Uecker <>
PR c/65455
PR c/92935
* c-parser.c (c_parser_declaration_or_fndef): Remove
redundant code to drop qualifiers of _Atomic types for __auto_type.
(c_parser_typeof_specifier): Do not drop qualifiers of _Atomic
types for __typeof__.
2020-11-24 Jakub Jelinek <>
PR c/97958
* c-parser.c (c_parser_binary_expression): For omp atomic binary
expressions, use make_node instead of build2 to avoid checking build2
2020-11-23 Joseph Myers <>
PR c/95630
* c-typeck.c (build_binary_op): Use pedwarn_c99 with OPT_Wpedantic
for comparisons of complete and incomplete pointers.
2020-11-21 Aaron Sawdey <>
* c-aux-info.c (gen_type): Support opaque types.
2020-11-20 Martin Sebor <>
PR middle-end/97879
* c-decl.c (start_function): Set ATTR_FLAG_INTERNAL in flags.
2020-11-20 Jakub Jelinek <>
PR other/97911
* (c.serial): Change from goal to a variable.
(.PHONY): Drop c.serial.
2020-11-20 Martin Uecker <>
* c-typeck.c (convert_lvalue_to_rvalue): Drop qualifiers.
2020-11-19 Jakub Jelinek <>
PR c/97860
* c-decl.c (get_parm_array_spec): Bail out of nelts is
2020-11-18 Jakub Jelinek <>
* (c.serial): New goal.
(.PHONY): Add c.serial c.prev.
(cc1$(exeext)): Call LINK_PROGRESS.
2020-11-13 Vladimir N. Makarov <>
* c-parser.c (c_parser_asm_statement): Parse outputs for asm
goto too.
* c-typeck.c (build_asm_expr): Remove an assert checking output
absence for asm goto.
2020-11-13 Jakub Jelinek <>
* c-typeck.c (c_finish_omp_clauses): Don't clear
OMP_CLAUSE_REDUCTION_INSCAN unless reduction_seen == -2.
2020-11-13 Iain Sandoe <>
PR objc/77404
* c-parser.c (c_parser_objc_class_definition): Pass the
location of the class name to the interface declaration.
2020-11-10 Strager Neds <>
* c-decl.c (merge_decls): Use new overload of
2020-11-10 Chung-Lin Tang <>
* c-parser.c (c_parser_omp_target_data): Add use of
new c_omp_adjust_map_clauses function. Add GOMP_MAP_ATTACH_DETACH as
handled map clause kind.
(c_parser_omp_target_enter_data): Likewise.
(c_parser_omp_target_exit_data): Likewise.
(c_parser_omp_target): Likewise.
* c-typeck.c (handle_omp_array_sections): Adjust COMPONENT_REF case to
use GOMP_MAP_ATTACH_DETACH map kind for C_ORT_OMP region type.
(c_finish_omp_clauses): Adjust bitmap checks to allow struct decl and
same struct field access to co-exist on OpenMP construct.
2020-11-07 Martin Uecker <>
* c-parser.c (c_parser_label): Implement mixing of labels and code.
(c_parser_all_labels): Likewise.
2020-11-06 Iain Sandoe <>
* c-parser.c (c_parser_objc_at_property_declaration):
Improve parsing fidelity. Associate better location info
with @property attributes. Clean up the interface to
objc_add_property_declaration ().
2020-11-06 Nathan Sidwell <>
* c-decl.c (diagnose_mismatched_decls): Rename
(warn_if_shadowing, implicitly_declare, names_builtin_p)
(collect_source_refs): Likewise.
* c-typeck.c (inform_declaration, inform_for_arg)
(convert_for_assignment): Likewise.
2020-11-06 Tobias Burnus <>
* c-parser.c (c_parser_omp_atomic): Add openacc parameter and update
OpenACC matching.
(c_parser_omp_construct): Update call.
2020-11-04 Jakub Jelinek <>
PR c++/97670
* c-typeck.c (c_finish_omp_clauses): Look through array reductions to
find underlying decl to clear in the aligned_head bitmap.
2020-11-04 Joseph Myers <>
* c-decl.c (handle_nodiscard_attribute): New.
(std_attribute_table): Add nodiscard.
* c-parser.c (c_parser_std_attribute): Expect argument to
nodiscard attribute to be a string. Do not special-case ignoring
* c-typeck.c (maybe_warn_nodiscard): New.
(build_compound_expr, emit_side_effect_warnings): Call
(c_process_expr_stmt, c_finish_stmt_expr): Also call
emit_side_effect_warnings if warn_unused_result.
2020-10-29 Asher Gordon <>
* c-typeck.c (free_all_tagged_tu_seen_up_to): Replace free
(finish_init): Likewise.
(pop_init_level): Likewise.
2020-10-28 Joseph Myers <>
* c-decl.c (store_parm_decls_newstyle): Use pedwarn_c11 not
error_at for omitted parameter name.
2020-10-28 Jakub Jelinek <>
* c-parser.c (c_parser_omp_clause_name): Handle allocate.
(c_parser_omp_clause_allocate): New function.
(c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_ALLOCATE.
* c-typeck.c (c_finish_omp_clauses): Handle OMP_CLAUSE_ALLOCATE.
2020-10-27 Joseph Myers <>
* c-parser.c (c_parser_std_attribute_specifier): Allow duplicate
standard attributes.
2020-10-23 Marek Polacek <>
PR c++/91741
* c-parser.c (c_parser_binary_expression): Implement -Wsizeof-array-div.
(c_parser_postfix_expression): Set PAREN_SIZEOF_EXPR.
(c_parser_expr_list): Handle PAREN_SIZEOF_EXPR like SIZEOF_EXPR.
* c-tree.h (char_type_p): Declare.
* c-typeck.c (char_type_p): No longer static.
2020-10-23 Martin Sebor <>
PR middle-end/97552
* c-decl.c (get_parm_array_spec): Handle static VLA parameters.
2020-09-19 Martin Sebor <>
PR c/50584
* c-decl.c (lookup_last_decl): Define new function.
(c_decl_attributes): Call it.
(start_decl): Add argument and use it.
(finish_decl): Call build_attr_access_from_parms and decl_attributes.
(get_parm_array_spec): Define new function.
(push_parm_decl): Call get_parm_array_spec.
(start_function): Call warn_parm_array_mismatch. Build attribute
access and add it to current function.
* c-parser.c (c_parser_declaration_or_fndef): Diagnose mismatches
in forms of array parameters.
* c-tree.h (start_decl): Add argument.
2020-09-19 Sandra Loosemore <>
* c-decl.c (c_break_label, c_cont_label): Delete, and replace
(in_statement): New.
(start_function): Adjust for above change.
(c_push_function_context, c_pop_function_context): Likewise.
* c-lang.h (struct language_function): Likewise.
* c-objc-common.h (LANG_HOOKS_BLOCK_MAY_FALLTHRU): Define.
* c-parser.c (objc_foreach_break_label, objc_foreach_continue_label):
(c_parser_statement_after_labels): Adjust calls to c_finish_bc_stmt.
(c_parser_switch_statement): Adjust break/switch context handling
and calls to renamed functions.
(c_parser_while_statement): Adjust break/switch context handling and
build a WHILE_STMT.
(c_parser_do_statement): Ditto, with DO_STMT respectively.
(c_parser_for_statement): Ditto, with FOR_STMT respectively.
(c_parser_omp_for_loop): Adjust break/switch context handling.
* c-tree.h (c_break_label, c_cont_label): Delete.
(in_statement, switch_statement_break_seen_p): Declare.
(c_start_case, c_finish_case): Renamed to...
(c_start_switch, c_finish_switch).
(c_finish_bc_stmt): Adjust arguments.
* c-typeck.c (build_function_call_vec): Don't try to print
statements with %qE format.
(struct c_switch): Rename switch_expr field to switch_stmt.
Add break_stmt_seen_p field.
(c_start_case): Rename to c_start_switch. Build a SWITCH_STMT
instead of a SWITCH_EXPR. Update for changes to struct c_switch.
(do_case): Update for changes to struct c_switch.
(c_finish_case): Rename to c_finish_switch. Update for changes to
struct c_switch and change of representation from SWITCH_EXPR to
(c_finish_loop): Delete.
(c_finish_bc_stmt): Update to reflect changes to break/continue
state representation. Build a BREAK_STMT or CONTINUE_STMT instead
of a GOTO_EXPR except for objc foreach loops.
2020-09-01 Jakub Jelinek <>
PR c++/96867
* c-typeck.c (handle_omp_array_sections_1): Test C_ARRAY_PARAMETER
only on PARM_DECLs.
2020-08-28 Martin Sebor <>
PR c/96596
* c-decl.c (match_builtin_function_types): Avoid dealing with erroneous
argument type.
2020-08-27 Martin Liska <>
* gimple-parser.c (c_parser_gimple_compound_statement): Set exact argument of a vector
growth function to true.
2020-08-25 Tobias Burnus <>
PR c/96678
* c-typeck.c (handle_omp_array_sections_1): Talk about
array function parameter in the error message.
2020-08-18 Jakub Jelinek <>
PR c/96571
* c-parser.c (c_parser_generic_selection): Change match_found from bool
to int, holding index of the match. Call mark_exp_read on the selector
expression and on expressions other than the selected one.
2020-08-01 Richard Sandiford <>
PR c/96377
* c-typeck.c (process_init_element): Split test for whether to
recurse into a record, union or array into...
(initialize_elementwise_p): ...this new function. Don't recurse
into a vector type if the initialization value is also a vector.
2020-07-31 Richard Biener <>
PR debug/96383
Define to c_common_finalize_early_debug.
2020-07-22 Tobias Burnus <>
* c-parser.c (c_parser_omp_clause_hint): Require nonnegative hint clause.
(c_parser_omp_critical): Permit hint(0) clause without named critical.
(c_parser_omp_construct): Don't assert if error_mark_node is returned.
2020-07-21 Sunil K Pandey <>
PR target/95237
* c-decl.c (finish_decl): Call target hook
lower_local_decl_alignment to lower local decl alignment.
2020-07-09 Julian Brown <>
Thomas Schwinge <>
PR middle-end/95270
* c-typeck.c (c_finish_omp_clauses): Set OMP_CLAUSE_SIZE (bias) to zero
for standalone attach/detach clauses.
2020-07-08 Eric Botcazou <>
* c-typeck.c (convert_for_assignment): If -Wscalar-storage-order is
set, warn for conversion between pointers that point to incompatible
scalar storage orders.
2020-07-07 Kaipeng Zhou <>
* c-parser.c (c_parser_statement_after_labels): Pass correct
parameters to c_parser_do_statement.
2020-06-16 Jakub Jelinek <>
* c-parser.c (c_parser_expr_no_commas): Save, clear and restore
(c_parser_omp_for_loop): Set c_in_omp_for around some calls to avoid
premature c_fully_fold. Defer explicit c_fully_fold calls to after
* c-tree.h (c_in_omp_for): Declare.
* c-typeck.c (c_in_omp_for): Define.
(build_modify_expr): Avoid c_fully_fold if c_in_omp_for.
(digest_init): Likewise.
(build_binary_op): Likewise.
2020-06-16 Jakub Jelinek <>
* c-parser.c (c_parser_omp_clause_schedule): Reject modifier separated
from kind by comma rather than colon.
2020-06-05 Mark Wielaard <>
* c-decl.c (implicit_decl_warning): When warned and olddecl is
an undeclared builtin, then add a fixit header hint, if found.
(implicitly_declare): Add OPT_Wbuiltin_declaration_mismatch to
warning_at about implicit builtin declaration type mismatch.
2020-06-03 Mark Wielaard <>
* c-parser.c (struct c_parser): Add seen_string_literal
(c_parser_consume_token): Reset seen_string_literal.
(c_parser_error_richloc): Add name_hint if seen_string_literal
and next token is a CPP_NAME and we have a missing header
suggestion for the name.
(c_parser_string_literal): Set seen_string_literal.
2020-06-03 Mark Wielaard <>
* c-parser.c (c_parser_postfix_expression_after_primary): Add
scope with matching_parens after CPP_OPEN_PAREN.
2020-06-03 Tobias Burnus <>
* c-objc-common.h (LANG_HOOKS_OMP_PREDETERMINED_MAPPING): Redefine.
2020-05-28 Nicolas Bértolo <>
* Remove extra slash.
2020-05-19 Martin Liska <>
* c-parser.c: Fix typo.
2020-05-14 Jakub Jelinek <>
* c-parser.c (c_parser_omp_target): Set cfun->has_omp_target.
2020-05-07 Richard Biener <>
PR middle-end/94703
* gimple-parser.c (c_parser_parse_ssa_name): Do not set
2020-04-30 Jakub Jelinek <>
PR c/94842
* c-decl.c (set_labels_context_r): In addition to context-less
LABEL_DECLs adjust also LABEL_DECLs with context equal to
parent function if any.
(store_parm_decls): Adjust comment.
2020-04-19 Jakub Jelinek <>
PR objc/94637
* c-parser.c (c_parser_objc_selector_arg): Handle CPP_SCOPE like
two CPP_COLON tokens.
2020-04-17 Jakub Jelinek <>
PR other/94629
* c-parser.c (c_parser_oacc_routine): Remove redundant assignment
to data.clauses.
2020-04-15 Jakub Jelinek <>
PR c/94593
* c-parser.c (c_parser_pragma) <case PRAGMA_OMP_REQUIRES>: Reject
requires directive when not at file scope.
2020-04-08 Tobias Burnus <>
PR middle-end/94120
* c-decl.c (c_check_in_current_scope): New function.
* c-tree.h (c_check_in_current_scope): Declare it.
* c-parser.c (c_parser_oacc_declare): Add check that variables
are declared in the same scope as the directive. Fix handling
of namespace vars.
2020-04-07 Jakub Jelinek <>
PR c++/94512
* c-parser.c (c_parser_omp_parallel): Set OMP_PARALLEL_COMBINED
if c_parser_omp_master succeeded.
2020-03-23 Jakub Jelinek <>
PR gcov-profile/94029
PR c/94239
* c-parser.c (c_parser_declaration_or_fndef): Initialize endloc to
the function_start_locus location. Don't do that afterwards for the
__GIMPLE body parsing.
2020-03-19 Jakub Jelinek <>
PR gcov-profile/94029
* c-tree.h (finish_function): Add location_t argument defaulted to
* c-parser.c (c_parser_compound_statement): Add endlocp argument and
set it to the locus of closing } if non-NULL.
(c_parser_compound_statement_nostart): Return locus of closing }.
(c_parser_parse_rtl_body): Likewise.
(c_parser_declaration_or_fndef): Propagate locus of closing } to
* c-decl.c (finish_function): Add end_loc argument, use it instead of
input_location to set function_end_locus.
2020-03-17 Jakub Jelinek <>
PR c/94172
instead of TYPE_VFIELD, and support it on {RECORD,UNION,ENUMERAL}_TYPE.
(TYPE_ACTUAL_ARG_TYPES): Check that it is only used on FUNCTION_TYPEs.
* c-decl.c (pushdecl): Push C_TYPE_INCOMPLETE_VARS also to
(finish_incomplete_vars): New function, moved from finish_struct. Use
relayout_decl instead of layout_decl.
(finish_struct): Remove obsolete comment about C_TYPE_INCOMPLETE_VARS
being TYPE_VFIELD. Use finish_incomplete_vars.
(finish_enum): Clear C_TYPE_INCOMPLETE_VARS. Call
* c-typeck.c (c_build_qualified_type): Clear C_TYPE_INCOMPLETE_VARS
2020-03-16 Jakub Jelinek <>
PR c/94179
* c-fold.c (c_fully_fold_internal): Handle MEM_REF.
2020-03-13 Martin Sebor <>
PR c/94040
* c-decl.c (builtin_structptr_type_count): New constant.
(match_builtin_function_types): Reject decls that are incompatible
in types pointed to by pointers.
(diagnose_mismatched_decls): Adjust comments.
2020-03-05 Joseph Myers <>
PR c/93577
* c-typeck.c (pop_init_level): Do not diagnose initializers as
empty when initialized type is error_mark_node.
(set_designator, process_init_element): Ignore initializers for
elements of a variable-size type or of error_mark_node.
2020-03-01 Martin Sebor <>
PR middle-end/93926
* c-decl.c (types_close_enough_to_match): New function.
(diagnose_mismatched_decls): Add missing inform call to a warning.
2020-03-01 Martin Sebor <>
PR c/93812
* c-typeck.c (build_functype_attribute_variant): New function.
(composite_type): Call it.
2020-02-25 Jakub Jelinek <>
PR other/93912
* gimple-parser.c (c_parser_gimple_parse_bb_spec_edge_probability):
Rename last argument from probablity to probability.
2020-02-13 Jakub Jelinek <>
PR c/93576
* c-decl.c (grokdeclarator): If this_size_varies, only push size into
*expr if it has side effects.
2020-01-30 Jeff Law <>
PR c/88660
* c-parser.c (c_parser_switch_statement): Make sure to request
marking the switch expr as used.
2020-01-22 Joseph Myers <>
PR c/93348
* c-typeck.c (build_c_cast): Call remove_c_maybe_const_expr on
argument with integer operands.
2020-01-16 Kerem Kat <>
PR c/92833
* c-parser.c (c_parser_consume_token): Fix peeked token stack pop
to support 4 available tokens.
2020-01-15 Joseph Myers <>
PR c/93072
* c-decl.c (pushdecl): Use TREE_PUBLIC, not DECL_EXTERNAL, to
determine whether to set DECL_CONTEXT.
2020-01-13 Joseph Myers <>
PR c/93241
* c-typeck.c (build_c_cast): Check for expressions with integer
operands that can occur in an unevaluated part of an integer
constant expression and call note_integer_operands as needed.
2019-01-08 Richard Biener <>
PR middle-end/93199
* gimple-parser.c (c_parser_parse_gimple_body): Remove __PHI IFN
2020-01-01 Jakub Jelinek <>
Update copyright years.
2019-12-20 Eric Botcazou <>
* c-decl.c (collect_source_ref_cb): Delete.
(for_each_global_decl): Rename into...
(collect_source_refs): ...this. Call collect_source_ref directly.
(c_parse_final_cleanups): Always call collect_source_ref on the main
input filename.
2019-12-19 Julian Brown <>
Cesar Philippidis <>
* c-parser.c (c_parser_omp_clause_name): Add parsing of attach and
detach clauses.
(c_parser_omp_variable_list): Add ALLOW_DEREF optional parameter.
Allow deref (->) in variable lists if true.
(c_parser_omp_var_list_parens): Add ALLOW_DEREF optional parameter.
Pass to c_parser_omp_variable_list.
(c_parser_oacc_data_clause): Support attach and detach clauses. Update
call to c_parser_omp_variable_list.
(c_parser_oacc_all_clauses): Support attach and detach clauses.
* c-typeck.c (handle_omp_array_sections_1): Reject subarrays for attach
and detach. Support deref.
(handle_omp_array_sections): Use GOMP_MAP_ATTACH_DETACH instead of
(c_oacc_check_attachments): New function.
(c_finish_omp_clauses): Check attach/detach arguments for being
pointers using above. Support deref.
2019-12-19 Julian Brown <>
Maciej W. Rozycki <>
Tobias Burnus <>
Thomas Schwinge <>
* c-parser.c (c_parser_omp_clause_name): Support no_create.
(c_parser_oacc_data_clause): Likewise.
(c_parser_oacc_all_clauses): Likewise.
* c-typeck.c (handle_omp_array_sections): Support
2019-12-09 David Malcolm <>
* c-objc-common.c (range_label_for_type_mismatch::get_text):
Replace label_text ctor calls.
2019-12-04 Joseph Myers <>
PR c/36941
PR c/88827
* c-typeck.c (convert_lvalue_to_rvalue): Call
require_complete_type for arguments not of void types.
(build_indirect_ref): Do not diagnose dereferencing pointers to
incomplete types.
* c-tree.h (C_TYPE_ERROR_REPORTED): Remove.
2019-12-03 Joseph Myers <>
PR c/88704
* c-decl.c (store_parm_decls_oldstyle): Diagnose use of [*] in
old-style parameter definitions.
2019-12-01 Sandra Loosemore <>
PR target/92499
* c-decl.c (flexible_array_type_p): Move to common code.
2019-11-30 Richard Sandiford <>
* c-decl.c (start_decl): Allow initialization of variables whose
size is a POLY_INT_CST.
(finish_decl): Use verify_type_context to check whether the target
allows variables with a particular type to have static or thread-local
storage duration. Don't raise a second error if such variables do
not have a constant size.
(grokdeclarator): Use verify_type_context to check whether the
target allows fields or array elements to have a particular type.
* c-typeck.c (pointer_diff): Use verify_type_context to test whether
the target allows pointer difference for the types involved.
(build_unary_op): Likewise for pointer increment and decrement.
2019-11-29 Joseph Myers <>
* c-parser.c (struct c_parser): Add members raw_tokens and
(c_lex_one_token): Add argument raw. Handle lexing raw tokens and
using previously-lexed raw tokens.
(c_parser_check_balanced_raw_token_sequence): New functions.
(c_parser_nth_token_starts_std_attributes): Use
c_parser_check_balanced_raw_token_sequence for Objective-C.
2019-11-25 Joseph Myers <>
PR c/91985
* c-decl.c (finish_declspecs): Use int instead of decimal
floating-point types if decimal floating-point not supported.
2019-11-25 Joseph Myers <>
* c-tree.h (struct c_declarator): Use a structure for id member.
* c-decl.c (grokdeclarator): Extract attributes from cdk_id
declarators at the start, not when handling individual declarators
later. Use instead of
(grokfield): Use instead of
(build_id_declarator): Set and
(finish_declspecs): Handle postfix attributes in case of typedef
name or typeof used.
* c-parser.c (c_parser_direct_declarator)
(c_parser_direct_declarator_inner): Place declarator for
attributes inside that for function or array, not outside. Set for identifiers.
(c_parser_parameter_declaration): Use instead of
* gimple-parser.c (c_parser_gimple_declaration): Use
instead of
2019-11-22 Jakub Jelinek <>
PR c/90677
* c-decl.c (identifier_global_tag): Define.
2019-11-20 Richard Biener <>
PR c/92088
* c-decl.c (grokdeclarator): Prevent inlining of nested
function with VLA arguments.
2019-11-20 Joseph Myers <>
* c-decl.c (c_warn_type_attributes): New function.
(groktypename, grokdeclarator, finish_declspecs): Call
c_warn_type_attributes before applying attributes to types.
* c-tree.h (c_warn_type_attributes): Declare.
2019-11-19 Joseph Myers <>
* c-decl.c (c_warn_unused_attributes): Use pedwarn not warning for
standard attributes.
* c-parser.c (c_parser_std_attribute): Take argument for_tm. Use
pedwarn for unknown standard attributes and return error_mark_node
for them.
2019-11-18 Matthew Malcomson <>
* c-parser.c (c_parser_parse_rtl_body): Always call
run_rtl_passes, even if startwith pass is not provided.
2019-11-15 Joseph Myers <>
* c-parser.c (c_parser_std_attribute_specifier): Diagnose
duplicate standard attributes.
2019-11-15 Joseph Myers <>
* c-decl.c (std_attribute_table): Add maybe_unused.
2019-11-15 Joseph Myers <>
* c-decl.c (std_attribute_table): Add fallthrough.
* c-parser.c (c_parser_declaration_or_fndef): Diagnose fallthrough
attribute at top level.
2019-11-15 Joseph Myers <>
* c-decl.c (std_attribute_table): New.
(c_init_decl_processing): Register attributes from
* c-parser.c (c_parser_attribute_arguments): Add arguments
require_string and allow_empty_args. All callers changed.
(c_parser_std_attribute): Set require_string argument for
"deprecated" attribute.
2019-11-14 Joseph Myers <>
* c-parser.c (c_parser_postfix_expression)
(c_parser_check_literal_zero): Handle CPP_UTF8CHAR.
* gimple-parser.c (c_parser_gimple_postfix_expression): Likewise.
2019-11-14 Richard Sandiford <>
* c-typeck.c (build_conditional_expr): Use truth_type_for instead
of build_same_sized_truth_vector_type.
(build_vec_cmp): Likewise.
2019-11-14 Jakub Jelinek <>
* c-parser.c (c_parser_omp_context_selector): Don't require score
argument to fit into shwi, just to be INTEGER_CST. Diagnose
negative score.
* c-parser.c (c_parser_omp_context_selector): Rename
Use CTX_PROPERTY_ID for atomic_default_mem_order, only allow a single
identifier in that. For CTX_PROPERTY_NAME_LIST, allow identifiers
and string literals.
2019-11-14 Joseph Myers <>
* c-tree.h (enum c_typespec_kind): Add ctsk_tagref_attrs and
(struct c_declspecs): Update description of attrs. Add
postfix_attrs and non_std_attrs_seen_p. Increase size of
typespec_kind bit-field.
(c_warn_unused_attributes): New declaration.
(parser_xref_tag): Update prototype.
* c-decl.c (c_warn_unused_attributes): New function.
(shadow_tag_warned): Handle ctsk_tagfirstref_attrs and
ctsk_tagref_attrs. Handle attribute declarations.
(check_compound_literal_type): Handle ctsk_tagfirstref_attrs.
(grokdeclarator): Handle standard attributes.
(parser_xref_tag): Add arguments have_std_attrs and attrs. Apply
attributes to incomplete type reference.
(xref_tag): Update call to parser_xref_tag.
(declspecs_add_addrspace, declspecs_add_type)
(declspecs_add_scspec, declspecs_add_attrs): Set
(finish_declspecs): Apply postfix standard attributes to type.
* c-parser.c (c_token_starts_declspecs)
(c_token_starts_declaration, c_parser_next_token_starts_declspecs)
(c_parser_next_tokens_start_declaration): Update comments.
(c_parser_consume_token, c_parser_consume_pragma): Handle moving
parser->tokens[2] to parser->tokens[1].
(c_parser_std_attribute_specifier_sequence): New functions.
(c_parser_declaration_or_fndef): Add arguments have_attrs and
attrs. All callers changed. Handle standard attributes.
(c_parser_parms_declarator, c_parser_parms_list_declarator)
(c_parser_parameter_declaration): Add argument have_gnu_attrs.
All callers changed.
(c_parser_declspecs): Add arguments start_std_attr_ok and
end_std_attr_ok. All callers changed. Handle standard
(c_parser_enum_specifier, c_parser_struct_or_union_specifier)
(c_parser_direct_declarator, c_parser_direct_declarator_inner)
(c_parser_compound_statement_nostart, c_parser_all_labels)
(c_parser_label, c_parser_statement, c_parser_for_statement):
Handle standard attributes.
* c-parser.h (c_parser_declspecs): Update prototype.
* gimple-parser.c (c_parser_gimple_declaration): Update call to
2019-11-12 Martin Liska <>
* gimple-parser.c: Do not include params.h.
2019-11-12 Martin Liska <>
* gimple-parser.c (c_parser_parse_gimple_body): Replace old parameter syntax
with the new one, include opts.h if needed. Use SET_OPTION_IF_UNSET
2019-11-12 Maciej W. Rozycki <>
Frederik Harwath <>
* c-parser.c (OACC_SERIAL_CLAUSE_MASK): New macro.
(c_parser_oacc_kernels_parallel): Rename function to...
(c_parser_oacc_compute): ... this. Handle PRAGMA_OACC_SERIAL.
(c_parser_omp_construct): Update accordingly.
2019-11-11 Jakub Jelinek <>
* c-parser.c (c_parser_translation_unit): Diagnose declare target
without corresponding end declare target.
2019-11-08 Richard Sandiford <>
* c-convert.c (convert): Only handle vector conversions if one of
the types satisfies gnu_vector_type_p or if -flax-vector-conversions
allows it.
* c-typeck.c (build_array_ref): Only allow vector indexing if the
vectors satisfy gnu_vector_type_p.
(build_unary_op): Only allow unary operators to be applied to
vectors if they satisfy gnu_vector_type_p.
(digest_init): Only allow by-element initialization of vectors
if they satisfy gnu_vector_type_p.
(really_start_incremental_init): Likewise.
(push_init_level): Likewise.
(pop_init_level): Likewise.
(process_init_element): Likewise.
(build_binary_op): Only allow binary operators to be applied to
vectors if they satisfy gnu_vector_type_p.
2019-11-08 Joseph Myers <>
* c-decl.c (grokparms): Convert () in a function definition to
(void) for C2x.
(store_parm_decls_oldstyle): Pedwarn for C2x.
(store_parm_decls): Update comment about () not generating a
2019-11-07 Joseph Myers <>
* c-parser.c (c_parser_attribute_arguments): New function.
Factored out of c_parser_gnu_attribute.
(c_parser_gnu_attribute): Use c_parser_attribute_arguments.
(c_parser_balanced_token_sequence, c_parser_std_attribute)
(c_parser_std_attribute_specifier): New functions.
(c_parser_transaction_attributes): Use
2019-11-07 Joseph Myers <>
* c-parser.c (c_parser): Remove lex_untranslated_string. Add
lex_joined_string and translate_strings_p.
(c_lex_one_token): Pass 0 or C_LEX_STRING_NO_JOIN to
(c_parser_string_literal): New function.
(c_parser_static_assert_declaration_no_semi): Use
c_parser_string_literal. Do not set lex_untranslated_string.
(c_parser_asm_string_literal): Use c_parser_string_literal.
(c_parser_simple_asm_expr): Do not set lex_untranslated_string.
(c_parser_gnu_attributes): Set and restore translate_strings_p
instead of lex_untranslated_string.
(c_parser_asm_statement): Do not set lex_untranslated_string.
(c_parser_asm_operands): Likewise.
(c_parser_has_attribute_expression): Set and restore
translate_strings_p instead of lex_untranslated_string.
(c_parser_postfix_expression): Use c_parser_string_literal.
(pragma_lex): Likewise.
(c_parser_pragma_pch_preprocess): Set lex_joined_string.
(c_parse_file): Set translate_strings_p.
* gimple-parser.c (c_parser_gimple_postfix_expression)
(c_parser_gimple_or_rtl_pass_list): Use c_parser_string_literal.
* c-parser.c (c_parser_string_literal): Declare function.
2019-11-02 Jakub Jelinek <>
* c-parser.c (c_finish_omp_declare_variant): Use
omp_get_context_selector instead of c_omp_get_context_selector.
2019-10-29 Richard Sandiford <>
* c-tree.h (c_simulate_enum_decl): Declare.
* c-decl.c (c_simulate_enum_decl): New function.
* c-objc-common.h (LANG_HOOKS_SIMULATE_ENUM_DECL): Define to the above.
2019-10-29 Richard Sandiford <>
* c-tree.h (c_simulate_builtin_function_decl): Declare.
* c-decl.c (c_simulate_builtin_function_decl): New function.
to the above.
2019-10-28 Martin Sebor <>
PR c/66970
* c-decl.c (names_builtin_p): Define a new function.
2019-10-28 Richard Biener <>
PR c/92249
* gimple-parser.c (c_parser_parse_gimple_body): Make
current_bb the entry block initially to easier recover
from errors.
(c_parser_gimple_compound_statement): Adjust.
2019-10-24 Jakub Jelinek <>
* c-parser.c (c_finish_omp_declare_variant): Use
omp_context_selector_matches instead of
* c-decl.c (c_decl_attributes): Add "omp declare target block"
attribute in between declare target and end declare target
2019-10-15 Joseph Myers <>
* c-parser.c (c_parser_attribute_any_word): Rename to
c_parser_gnu_attribute_any_word. All callers changed.
(c_parser_attribute): Rename to c_parser_gnu_attribute. All
callers changed.
(c_parser_attributes): Rename to c_parser_gnu_attributes. All
callers changed.
(c_parser_declaration_or_fndef, c_parser_declspecs)
(c_parser_enum_specifier, c_parser_struct_or_union_specifier)
(c_parser_struct_declaration, c_parser_declarator)
(c_parser_gnu_attribute, c_parser_compound_statement)
(c_parser_label, c_parser_statement, c_parser_objc_method_decl)
(c_parser_transaction_attributes): Add "gnu-" prefix to names of
attribute-related syntax productions.
2019-10-14 Richard Sandiford <>
* c-objc-common.c (useful_aka_type_p): Replace with...
(get_aka_type): ...this new function. Given the original type,
decide which aka type to print (if any). Only look through typedefs
if user_facing_original_type_p.
(print_type): Update accordingly.
2019-10-14 Jakub Jelinek <>
* c-parser.c (c_parser_omp_all_clauses): Change bool NESTED_P argument
into int NESTED, if it is 2, diagnose missing commas in between
(c_parser_omp_context_selector): Pass 2 as last argument to
2019-10-12 Jakub Jelinek <>
* c-parser.c (c_parser_omp_context_selector): Improve error recovery.
For simd properties, put them directly into TREE_VALUE.
(c_finish_omp_declare_variant): Call c_omp_mark_declare_variant.
If c_omp_context_selector_matches is 0, don't add attribute, otherwise
add "omp declare variant base" attribute rather than
"omp declare variant".
2019-10-11 Joseph Myers <>
* c-decl.c (declspecs_add_type): Use pedwarn_c11 for DFP types.
2019-10-10 Jakub Jelinek <>
* c-parser.c (c_parser_omp_all_clauses): Add NESTED_P argument, if
true, terminate processing on closing paren and don't skip to end of
pragma line.
(c_parser_omp_declare_simd): Handle also declare variant.
(omp_construct_selectors, omp_device_selectors,
omp_implementation_selectors, omp_user_selectors): New variables.
c_finish_omp_declare_variant): New functions.
(c_finish_omp_declare_simd): Handle both declare simd and
declare variant.
(c_parser_omp_declare): Handle declare variant.
2019-10-02 Joseph Myers <>
* c-parser.c (c_parser_asm_statement): Handle CPP_SCOPE like two
CPP_COLON tokens.
2019-10-01 Richard Sandiford <>
* c-objc-common.c (useful_aka_type_p): New function.
(print_type): Use it to decide whether an aka type is worth printing.
2019-09-27 Jakub Jelinek <>
PR c++/88203
* c-parser.c (c_parser_predefined_identifier): New function.
(c_parser_postfix_expression): Use it.
(c_parser_omp_variable_list): Parse predefined identifiers.
* c-typeck.c (c_finish_omp_clauses): Allow predefined variables
in shared and firstprivate clauses, even when they are predetermined
2019-09-27 Richard Sandiford <>
* c-typeck.c (build_function_call_vec): Take the original function
decl as an optional final parameter. Pass all built-in calls to
2019-09-20 Eric Botcazou <>
PR c/91815
* c-decl.c (pushdecl): In C detect duplicate declarations across scopes
of identifiers in the external scope only for variables and functions.
2019-09-04 Prathamesh Kulkarni <>
PR c/78736
* c-typeck.c (convert_for_assignment): Handle Wenum-conversion.
2019-08-23 Iain Sandoe <>
PR pch/61250
* c-parser.c (c_parse_file): Call c_common_no_more_pch ()
after determining that the first token is not
2019-08-22 Eric Botcazou <>
* c-parser.c (c_parser_declaration_or_fndef): Set DECL_ARGUMENTS of a
FUNCTION_DECL to the right value in the presence of nested declarators.
2019-08-13 Richard Sandiford <>
PR middle-end/91421
* c-decl.c (merge_decls): Use copy_decl_built_in_function.
2019-08-13 Richard Sandiford <>
PR middle-end/91421
* c-decl.c (header_for_builtin_fn): Take a FUNCTION_DECL instead
of a built_in_function.
(diagnose_mismatched_decls, implicitly_declare): Update accordingly.
2019-08-10 Jakub Jelinek <>
* c-parser.c (c_parser_omp_clause_name): Parse device_type.
(c_parser_omp_clause_device_type): New function.
(c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DEVICE_TYPE.
(c_parser_omp_declare_target): Handle device_type clauses. Remove
diagnostics for declare target with clauses nested in clause-less
declare target declaration-definition-seq.
* c-typeck.c (c_finish_omp_clauses): Handle OMP_CLAUSE_DEVICE_TYPE.
2019-08-09 Jakub Jelinek <>
* c-parser.c (check_no_duplicate_clause): Simplify using
(c_parser_omp_clause_if): Fix up printing of target {enter,exit} data
directive name modifiers.
(c_parser_omp_clause_proc_bind): Check for duplicate proc_bind clause.
PR c/91401
* c-parser.c (c_parser_omp_clause_dist_schedule): Fix up typos in the
check_no_duplicate_clause call. Comment it out, instead emit a
warning for duplicate dist_schedule clauses.
2019-08-08 Richard Sandiford <>
* c-decl.c (finish_enum): Clear C_TYPE_BEING_DEFINED.
2019-08-08 Jakub Jelinek <>
* c-typeck.c (c_finish_omp_clauses): For C_ORT_OMP
OMP_CLAUSE_USE_DEVICE_* clauses use oacc_reduction_head bitmap
instead of generic_head to track duplicates.
2019-08-07 Jakub Jelinek <>
* c-parser.c (c_parser_omp_clause_name): Parse use_device_addr clause.
(c_parser_omp_clause_use_device_addr): New function.
(c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_USE_DEVICE_ADDR.
(c_parser_omp_target_data): Handle PRAGMA_OMP_CLAUSE_USE_DEVICE_ADDR
like PRAGMA_OMP_CLAUSE_USE_DEVICE_PTR, adjust diagnostics about no
map or use_device_* clauses.
* c-typeck.c (c_finish_omp_clauses): For OMP_CLAUSE_USE_DEVICE_PTR
in OpenMP, require pointer type rather than pointer or array type.
2019-07-31 Jakub Jelinek <>
PR c/91192
* c-parser.c (c_parser_sizeof_expression): Call set_c_expr_source_range
even if finish is UNKNOWN_LOCATION, just use start as finish in that
2019-07-25 Martin Liska <>
Dominik Infuhr <>
PR c++/23383
* c-decl.c (merge_decls): Merge OPERATOR_DELETE flag.
2019-07-25 Martin Liska <>
* c-decl.c (merge_decls): Use new macros
2019-07-23 Richard Biener <>
PR tree-optimization/83518
* gimple-parser.c (c_parser_parse_gimple_body): When we have
a CFG also rebuild cgraph edges.
2019-07-20 Jakub Jelinek <>
* c-parser.c (c_parser_omp_clause_name): Handle bind clause.
(c_parser_omp_clause_bind): New function.
(c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_BIND.
(c_parser_omp_loop): New function.
(c_parser_omp_parallel, c_parser_omp_teams): Handle parsing of
loop combined with parallel or teams.
(c_parser_omp_construct): Handle PRAGMA_OMP_LOOP.
* c-typeck.c (c_finish_omp_clauses): Handle OMP_CLAUSE_BIND.
2019-07-18 Richard Sandiford <>
PR c/53633
* c-decl.c (finish_function): Check targetm.warn_func_return
before issuing a -Wreturn-type warning.
2019-07-12 Alexandre Oliva <>
* gimple-parser.c (c_parser_gimple_try_stmt): New.
(c_parser_compound_statement): Call it.
2019-07-12 Jakub Jelinek <>
* c-parser.c (c_parser_omp_clause_name): Handle order clause.
(c_parser_omp_clause_order): New function.
(c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_ORDER.
* c-typeck.c (c_finish_omp_clauses): Handle OMP_CLAUSE_ORDER.
2019-07-10 Richard Biener <>
* gimple-parser.c (c_parser_gimple_postfix_expression): Support
_Literal (int *) &x for address literals.
2019-07-09 Martin Sebor <>
PR c++/61339
* c-decl.c (xref_tag): Change class-key of PODs to struct and others
to class.
(field_decl_cmp): Same.
* c-parser.c (c_parser_struct_or_union_specifier): Same.
* c-tree.h: Same.
* gimple-parser.c (c_parser_gimple_compound_statement): Same.
2019-07-09 Martin Sebor <>
PR c++/61339
* c-decl.c: Change class-key from class to struct and vice versa
to match convention and avoid -Wclass-is-pod and -Wstruct-no-pod.
* gimple-parser.c: Same.
2019-07-01 Richard Biener <>
* gimple-parser.c (c_parser_gimple_postfix_expression): Handle
_Literal (char *) &"foo" for address literals pointing to
2019-06-25 Jozef Lawrynowicz <>
* c-parser.c (c_parse_init): Create keyword for "__intN__" type.
* c-decl.c (declspecs_add_type): Don't pedwarn about "__intN" ISO
C incompatibility if alternate "__intN__" form is used.
2019-06-24 Martin Sebor <>
* c-typeck.c (build_binary_op): Hyphenate floating-point.
2019-06-10 Jakub Jelinek <>
* c-parser.c (c_parser_pragma): Reject PRAGMA_OMP_SCAN.
(c_parser_omp_clause_reduction): Don't sorry_at on inscan reductions.
(c_parser_omp_scan_loop_body): New function.
(c_parser_omp_for_loop): Call c_parser_omp_scan_loop_body if there are
inscan reduction clauses.
* c-typeck.c (c_finish_omp_clauses): Reject mixing inscan with
non-inscan reductions on the same construct, or inscan reductions with
ordered or schedule clauses, or inscan array reductions.
2019-06-05 Martin Sebor <>
PR c/90737
* c-typeck.c (c_finish_return): Only consider functions returning
pointers as candidates for -Wreturn-local-addr.
2019-06-05 Martin Sebor <>
* c-decl.c (start_decl): Adjust quoting and hyphenation
in diagnostics.
(finish_decl): Same.
(finish_enum): Same.
(start_function): Same.
(declspecs_add_type): Same.
* c-parser.c (warn_for_abs): Same.
* c-typeck.c (build_binary_op): Same.
2019-05-17 Thomas Schwinge <>
PR c/89433
* c-parser.c (c_finish_oacc_routine): Rework checking if already
marked with an OpenACC 'routine' directive.
PR c/89433
* c-parser.c (c_parser_oacc_routine): Normalize order of clauses.
(c_finish_oacc_routine): Call oacc_verify_routine_clauses.
PR c/89433
* c-parser.c (c_finish_oacc_routine): Refer to OpenACC 'routine'
clauses from "omp declare target" attribute.
2019-05-16 Martin Sebor <>
* c-decl.c (start_decl): Quote keywords, operators, and
types in diagnostics.
(finish_decl): Same.
* c-parser.c (c_parser_asm_statement): Same.
(c_parser_conditional_expression): Same.
(c_parser_transaction_cancel): Same.
* c-typeck.c (c_common_type): Same.
(build_conditional_expr): Same.
(digest_init): Same.
(process_init_element): Same.
(build_binary_op): Same.
2019-05-17 Richard Biener <>
* gimple-parser.c (c_parser_gimple_statement): Handle __VEC_PERM.
(c_parser_gimple_unary_expression): Likewise.
(c_parser_gimple_parentized_ternary_expression): New function.
2019-05-16 Richard Biener <>
* gimple-parser.c (c_parser_gimple_statement): Handle __BIT_INSERT.
(c_parser_gimple_unary_expression): Likewise.
2019-05-15 Richard Biener <>
* gimple-parser.c (c_parser_gimple_postfix_expression): Handle
2019-05-14 Richard Biener <>
* gimple-parser.c (c_parser_gimple_statement): Remove
questionable auto-promotion to VIEW_CONVERT_EXPR.
(c_parser_gimple_typespec): Split out from __MEM parsing.
(c_parser_gimple_postfix_expression): Handle __VIEW_CONVERT.
* tree-pretty-print.c (dump_generic_node): Dump VIEW_CONVERT_EXPR
as __VIEW_CONVERT with -gimple.
2019-05-09 Martin Liska <>
* gimple-parser.c (c_parser_gimple_statement): Support __MIN and
(c_parser_gimple_unary_expression): Parse also binary expression
__MIN and __MAX.
(c_parser_gimple_parentized_binary_expression): New function.
2019-05-09 Martin Liska <>
* gimple-parser.c (struct gimple_parser): Add probability.
for gimple_parser_edge.
(gimple_parser::push_edge): Add new argument probability.
(c_parser_gimple_parse_bb_spec): Parse also probability
if present.
(c_parser_parse_gimple_body): Set edge probability.
(c_parser_gimple_compound_statement): Consume token
before calling c_parser_gimple_goto_stmt.
Parse BB counts.
(c_parser_gimple_statement): Pass new argument.
(c_parser_gimple_goto_stmt): Likewise.
(c_parser_gimple_if_stmt): Likewise.
(c_parser_gimple_or_rtl_pass_list): Parse hot_bb_threshold.
* c-parser.c (c_parser_declaration_or_fndef): Pass
hot_bb_threshold argument.
* c-tree.h (struct c_declspecs): Add hot_bb_threshold
(c_parser_gimple_parse_bb_spec_edge_probability): New.
2019-04-26 Jakub Jelinek <>
PR debug/90197
* c-tree.h (c_finish_loop): Add 2 further location_t arguments.
* c-parser.c (c_parser_while_statement): Adjust c_finish_loop caller.
(c_parser_do_statement): Likewise.
(c_parser_for_statement): Likewise. Formatting fixes.
* c-typeck.c (c_finish_loop): Add COND_LOCUS and INCR_LOCUS arguments,
emit DEBUG_BEGIN_STMTs if needed.
2019-04-19 Jakub Jelinek <>
PR c/89888
* c-typeck.c (struct c_switch): Remove outside_range_p member.
(c_start_case): Don't clear it.
(do_case): Adjust c_add_case_label caller.
(c_finish_case): Adjust c_do_switch_warnings caller.
PR c++/90108
* c-decl.c (merge_decls): If remove is main variant and
DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE
variant that has newdecl as TYPE_NAME if any.
2019-04-12 Jakub Jelinek <>
PR c/89933
* c-decl.c (merge_decls): When newdecl's type is its main variant,
don't try to remove it from the variant list, but instead assert
it has no variants.
2019-04-01 Richard Biener <>
PR c/71598
* c-tree.h (c_get_alias_set): Declare.
* c-objc-common.h (LANG_HOOKS_GET_ALIAS_SET): Use c_get_alias_set.
* c-objc-common.c (c_get_alias_set): Treat enumeral types
as the underlying integer type.
2019-03-19 Martin Sebor <>
PR tree-optimization/89688
* c-decl.c (finish_decl): Call braced_lists_to_string for more
kinds of initializers.
2019-03-19 Jakub Jelinek <>
PR c/89734
* c-decl.c (grokdeclarator): Call c_build_qualified_type on function
return type even if quals_used is 0. Formatting fixes.
2019-03-14 Richard Biener <>
* c-tree.h (enum c_declspec_il): New.
(struct c_declspecs): Merge gimple_p and rtl_p into declspec_il
enum bitfield.
* c-parser.c (c_parser_declaration_or_fndef): Adjust accordingly.
Pass start pass and declspec_il to c_parser_parse_gimple_body.
(c_parser_declspecs): Adjust.
* gimple-parser.c: Include cfg.h, cfghooks.h, cfganal.h, tree-cfg.h,
gimple-iterator.h, cfgloop.h, tree-phinodes.h, tree-into-ssa.h
and bitmap.h.
(struct gimple_parser): New.
(gimple_parser::push_edge): New method.
(c_parser_gimple_parse_bb_spec): New helper.
(c_parser_parse_gimple_body): Get start pass and IL specification.
Initialize SSA and CFG.
(c_parser_gimple_compound_statement): Handle CFG and SSA build.
Build a gimple_parser parsing state and pass it along.
(c_parser_gimple_statement): Change intermittend __PHI internal
function argument for the edge.
(c_parser_gimple_or_rtl_pass_list): Handle ssa, cfg flags.
(c_parser_gimple_goto_stmt): Record edges to build.
(c_parser_gimple_if_stmt): Likewise.
* gimple-parser.h (c_parser_parse_gimple_body): Adjust.
(c_parser_gimple_or_rtl_pass_list): Likewise.
2019-03-11 Martin Liska <>
* c-decl.c (check_for_loop_decls): Wrap an option name
in a string format message and fix GNU coding style.
* c-parser.c (c_parser_declspecs): Likewise.
2019-03-08 Jakub Jelinek <>
PR tree-optimization/89550
* c-decl.c (finish_function): Only set TREE_NO_WARNING if warning_at
returned true.
(c_write_global_declarations_1): Only set TREE_NO_WARNING if pedwarn
or warning returned true.
2019-02-28 Jakub Jelinek <>
PR c/89525
* c-typeck.c (convert_arguments): Call inform_declaration only if
the previous warning_at call returned true.
2019-02-22 Thomas Schwinge <>
* c-parser.c (c_parser_oacc_shape_clause): Add loc formal
parameter. Adjust all users.
(c_parser_oacc_simple_clause): Replace parser with loc formal
parameter. Adjust all users.
2019-02-19 Chung-Lin Tang <>
PR c/87924
* c-parser.c (c_parser_oacc_clause_wait): Add representation of wait
clause without argument as 'wait (GOMP_ASYNC_NOVAL)', adjust comments.
2019-02-15 Jakub Jelinek <>
PR c/89340
* c-decl.c (start_function): Clear TREE_PUBLIC on nested functions
before c_decl_attributes rather than after it.
2019-02-06 Jakub Jelinek <>
PR c/89211
* c-parser.c (c_parser_declaration_or_fndef): Don't update
DECL_ARGUMENTS of d if it has been defined already. Use a single if
instead of 3 nested ifs.
2019-02-06 Joseph Myers <>
PR c/88584
* c-decl.c (finish_decl): Do not complete array types for arrays
with external linkage not at file scope.
2019-02-05 Richard Biener <>
PR c/88606
* c-decl.c (finish_struct): Reset TYPE_TRANSPARENT_AGGR on
all type variants when not supported.
2019-01-30 Jakub Jelinek <>
PR c/89061
* c-tree.h (C_DECL_COMPOUND_LITERAL_P): Define.
* c-decl.c (decl_jump_unsafe): Return false for
(build_compound_literal): Set C_DECL_COMPOUND_LITERAL_P.
2019-01-29 Jakub Jelinek <>
PR c/89045
* c-decl.c (build_compound_literal): Don't pushdecl if in parameter
PR c/86125
* c-decl.c (last_fileptr_type): Remove.
(last_structptr_types): New variable.
(match_builtin_function_types): Compare TYPE_MAIN_VARIANT of
{old,new}rettype instead of the types themselves. Assert
last_structptr_types array has the same number of elements
as builtin_structptr_types array. Use TYPE_MAIN_VARIANT for
argument oldtype and newtype. Instead of handling
just fileptr_type_node specially, handle all builtin_structptr_types
pointer nodes. Formatting fix.
2019-01-24 Martin Sebor <>
PR c/86125
PR c/88886
PR middle-end/86308
* c-decl.c (match_builtin_function_types): Add arguments.
(diagnose_mismatched_decls): Diagnose mismatched declarations
of built-ins more strictly.
2019-01-24 Jakub Jelinek <>
PR c++/88976
* c-typeck.c (c_finish_omp_cancel): Diagnose more than one if
on #pragma omp cancel with different modifiers.
2019-01-18 H.J. Lu <>
PR c/51628
PR c/88664
* c-typeck.c (convert_for_assignment): Upate the
warn_for_address_or_pointer_of_packed_member call.
2019-01-16 Tom Honermann <>
Jason Merrill <>
* c-typeck.c (digest_init): Revised the error message produced for
ill-formed cases of array initialization with a string literal.
(error_init): Make variadic.
2019-01-12 Jakub Jelinek <>
* c-typeck.c (convert_for_assignment): Fix a comment typo.
2019-01-07 Jakub Jelinek <>
PR c/88701
* c-decl.c (build_compound_literal): If not TREE_STATIC, only pushdecl
if current_function_decl is non-NULL.
2019-01-07 Joseph Myers <>
PR c/88720
PR c/88726
* c-decl.c (pop_scope): Use TREE_PUBLIC and b->nested to determine
whether a function is nested, not DECL_EXTERNAL. Diagnose inline
functions declared but never defined only for external scope, not
for other scopes.
2019-01-07 Jakub Jelinek <>
PR c++/85052
* c-parser.c (c_parser_postfix_expression): Parse
2019-01-01 Jakub Jelinek <>
Update copyright years.
2018-12-20 H.J. Lu <>
PR c/51628
* c-typeck.c (convert_for_assignment): Call
2018-12-19 Segher Boessenkool <>
* c-parser.c (c_parser_asm_statement) <RID_CONST, RID_RESTRICT>: Give
a more specific error message (instead of just falling through).
2018-12-19 Segher Boessenkool <>
* c-parser.c (c_parser_asm_statement): Keep track of the location each
asm qualifier is first seen; use that to give nicer "duplicate asm
qualifier" messages. Delete 'quals" variable, instead pass the
"is_volatile_ flag to build_asm_stmt directly.
* c-tree.h (build_asm_stmt): Make the first arg bool instead of tree.
* c-typeck.c (build_asm_stmt): Ditto; adjust.
2018-12-19 Segher Boessenkool <>
* c-parser.c (c_parser_asm_statement): Rewrite the loop to work without
"done" boolean variable.
2018-12-19 David Malcolm <>
PR c++/87504
* c-typeck.c (class maybe_range_label_for_tree_type_mismatch):
Move from here to gcc-rich-location.h and gcc-rich-location.c.
(build_binary_op): Use struct op_location_t and
class binary_op_rich_location.
2018-12-11 Jakub Jelinek <>
PR sanitizer/88426
* c-convert.c (convert): Call c_fully_fold before calling
2018-12-08 Segher Boessenkool <>
* c-parser (c_parser_asm_statement) [RID_INLINE]: Delete stray line
setting "quals".
2018-12-06 Segher Boessenkool <>
* c-parser.c (c_parser_asm_statement): Detect the inline keyword
after asm. Pass a flag for it to build_asm_expr.
* c-tree.h (build_asm_expr): Update declaration.
* c-typeck.c (build_asm_stmt): Add is_inline parameter. Use it to
2018-12-06 Segher Boessenkool <>
PR inline-asm/55681
* c-parser.c (c_parser_asm_statement): Update grammar. Allow any
combination of volatile and goto, in any order, without repetitions.
2018-12-04 James Norris <>
Cesar Philippidis <>
Julian Brown <>