blob: 9044f662c28f642d47a36533061ebf9f181f673d [file] [log] [blame]
2021-10-21 Jakub Jelinek <>
PR middle-end/64888
* c-omp.c (c_omp_predefined_variable): Return true also for
ubsan_create_data created artificial variables.
2021-10-14 Joseph Myers <>
* c-format.c (printf_length_specs, scanf_length_specs)
(print_char_table, scan_char_table): Support DFP formats for C2X.
* c-format.h (TEX_D32, TEX_D64, TEX_D128): Remove.
(T2X_D32, T2X_D64, T2X_D128): New macros.
2021-10-14 Kwok Cheung Yeung <>
* c-omp.c (c_omp_check_context_selector): Rename to
omp_check_context_selector and move to omp-general.c.
(c_omp_mark_declare_variant): Rename to omp_mark_declare_variant and
move to omp-general.c.
2021-10-12 Joseph Myers <>
* c-format.c (print_char_table): Add %b and %B formats.
(scan_char_table): Add %b format.
* c-format.h (T2X_UI, T2X_UL, T2X_ULL, T2X_US, T2X_UC, T2X_ST)
(T2X_UPD, T2X_UIM): New macros.
2021-10-12 Jakub Jelinek <>
* c-omp.c (c_finish_omp_atomic): Use
2021-10-08 Martin Liska <>
* c-opts.c (c_common_post_options): Use new macro
2021-10-07 Martin Liska <>
* c-common.c (parse_optimize_options): Make
save_opt_decoded_options a pointer type.
2021-10-06 Jakub Jelinek <>
PR tree-optimization/102571
* c-omp.c (c_finish_omp_atomic): Optimize the case where type has
padding, but the non-padding bits are contiguous set of bytes
by adjusting the memcmp call arguments instead of emitting
__builtin_clear_padding and then comparing all the type's bytes.
2021-10-06 Jakub Jelinek <>
PR c++/102612
* c-cppbuiltin.c (c_cpp_builtins): For -std=c++23 predefine
__cpp_constexpr to 202110L rather than 201907L.
2021-10-04 Marek Polacek <>
PR c++/97573
* c-common.h (do_warn_array_compare): Declare.
* c-warn.c (do_warn_array_compare): New.
* c.opt (Warray-compare): New option.
2021-10-02 Iain Sandoe <>
* c-format.c: Remove a test of TARGET_FORMAT_TYPES with
NULL, this is not needed.
2021-10-01 Martin Sebor <>
PR c/102103
* c-common.c (decl_with_nonnull_addr_p): Handle members.
Check and perform warning suppression.
(c_common_truthvalue_conversion): Enhance warning suppression.
2021-10-01 Martin Liska <>
PR target/102552
* c-common.c (parse_optimize_options): decoded_options[0] is
used for program name, so merged_decoded_options should also
respect that.
2021-10-01 Jakub Jelinek <>
Richard Biener <>
PR sanitizer/102515
* c-ubsan.c (ubsan_instrument_division): Check the right
flag_sanitize_recover bit, depending on which sanitization
is done. Sanitize INT_MIN / -1 under SANITIZE_SI_OVERFLOW
and SANITIZE_DIVIDE is enabled, neither check is known
to be false and flag_sanitize_recover bits for those two
aren't the same, emit both __ubsan_handle_divrem_overflow
and __ubsan_handle_divrem_overflow_abort calls.
2021-10-01 Martin Liska <>
* c-common.c (parse_optimize_options): Combine optimize
options with what was provided on the command line.
2021-10-01 Jakub Jelinek <>
* c-omp.c (c_omp_split_clauses): Also copy
2021-09-27 Martin Liska <>
* c-opts.c (c_common_init_options_struct): Set also
2021-09-22 Jakub Jelinek <>
* c-omp.c (c_omp_split_clauses): Copy over OMP_CLAUSE_ALLOCATE_ALIGN.
2021-09-20 Matthias Kretz <>
* c-cppbuiltin.c (c_cpp_builtins_optimize_pragma): Define or
__ROUNDING_MATH__ according to the new optimization flags.
2021-09-18 Jakub Jelinek <>
* c-omp.c (c_omp_split_clauses): Split order clause also to
distribute construct. Copy over OMP_CLAUSE_ORDER_UNCONSTRAINED.
2021-09-17 Jakub Jelinek <>
* c-omp.c (c_finish_omp_atomic): Avoid creating
TARGET_EXPR if test is true, use create_tmp_var_raw instead of
create_tmp_var and add a zero initializer to TARGET_EXPRs that
had NULL initializer. When omitting operands after v = x,
use type of v rather than type of x. Fix type of vtmp
2021-09-13 Jason Merrill <>
* c.opt: Add -Winterference-size.
* c-cppbuiltin.c (cpp_atomic_builtins): Add __GCC_DESTRUCTIVE_SIZE
2021-09-10 Jakub Jelinek <>
* c-common.h (c_finish_omp_atomic): Add r and weak arguments.
* c-omp.c: Include gimple-fold.h.
(c_finish_omp_atomic): Add r and weak arguments. Add support for
OpenMP 5.1 atomics.
2021-09-09 qing zhao <>
* c-attribs.c (handle_uninitialized_attribute): New function.
(c_common_attribute_table): Add "uninitialized" attribute.
2021-09-08 liuhongt <>
* c-common.c (excess_precision_mode_join): Update below comments.
(c_ts18661_flt_eval_method): Set excess_precision_type to
EXCESS_PRECISION_TYPE_FLOAT16 when -fexcess-precision=16.
* c-cppbuiltin.c (cpp_atomic_builtins): Update below comments.
(c_cpp_flt_eval_method_iec_559): Set excess_precision_type to
EXCESS_PRECISION_TYPE_FLOAT16 when -fexcess-precision=16.
2021-09-07 Marcel Vollweiler <>
* c-omp.c (c_finish_omp_flush): Handle MEMMODEL_SEQ_CST.
2021-09-03 Eric Botcazou <>
* c-ada-spec.c (dump_ads): Generate pragmas to disable style checks
and -gnatwu warning for the package specification.
2021-09-01 Iain Sandoe <>
* c-attribs.c (handle_unavailable_attribute): New.
2021-08-30 Jason Merrill <>
* c.opt: Add -Wmissing-requires.
2021-08-25 Lewis Hyatt <>
PR other/93067
* c-opts.c (c_common_input_charset_cb): New function.
(c_common_post_options): Call new function
2021-08-20 Tobias Burnus <>
* c-format.c (gcc_gfc_length_specs): Add 'll' and 'w'.
(gcc_gfc_char_table): Add T9L_LL and T9L_ULL to
"di" and "u", respecitively; fill with BADLEN to match
size of 'types'.
(get_init_dynamic_hwi): Split off from ...
(init_dynamic_diag_info): ... here. Call it.
(init_dynamic_gfc_info): Call it.
2021-08-20 Jakub Jelinek <>
* c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_ERROR.
* c-pragma.c (omp_pragmas): Add error directive.
* c-omp.c (omp_directives): Uncomment error directive entry.
2021-08-18 Jakub Jelinek <>
* c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_NOTHING.
* c-pragma.c (omp_pragmas): Add nothing directive.
* c-omp.c (omp_directives): Uncomment nothing directive entry.
2021-08-17 Jakub Jelinek <>
PR c++/101539
* c-common.h (enum rid): Add RID_IS_LAYOUT_COMPATIBLE.
* c-common.c (c_common_reswords): Add __is_layout_compatible.
2021-08-17 Matt Jacobson <>
* c-opts.c (c_common_post_options): Default to
flag_objc_sjlj_exceptions = 1 only when flag_objc_abi < 2.
2021-08-17 Jakub Jelinek <>
* c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_SCOPE.
* c-pragma.c (omp_pragmas): Add scope construct.
* c-omp.c (omp_directives): Uncomment scope directive entry.
2021-08-16 Sebastian Huber <>
* c-cppbuiltin.c (c_cpp_builtins): Define
__LIBGCC_GCOV_TYPE_SIZE if flag_building_libgcc is true.
2021-08-12 Jakub Jelinek <>
* c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_MASKED.
(enum pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_FILTER.
* c-pragma.c (omp_pragmas_simd): Add masked construct.
* c-common.h (enum c_omp_clause_split): Add C_OMP_CLAUSE_SPLIT_MASKED
(c_finish_omp_masked): Declare.
* c-omp.c (c_finish_omp_masked): New function.
(c_omp_split_clauses): Handle combined masked constructs.
2021-07-30 Jakub Jelinek <>
PR c++/101539
* c-common.c (c_common_reswords): Add
2021-07-29 Richard Biener <>
PR c/101512
* c-common.c (c_common_mark_addressable_vec): Look through
C_MAYBE_CONST_EXPR even if not at the toplevel.
2021-07-27 Martin Sebor <>
PR c/101585
* c-warn.c (warn_parm_ptrarray_mismatch): Use OEP_DECL_NAME.
2021-07-23 Jakub Jelinek <>
* c-lex.c (c_common_has_attribute): Call canonicalize_attr_name also
on attr_id. Return 1 for omp::directive or omp::sequence in C++11
and later.
2021-07-23 Jakub Jelinek <>
* c-pragma.h (enum pragma_kind): Add PRAGMA_OMP__START_ and
PRAGMA_OMP__LAST_ enumerators.
2021-07-21 Thomas Schwinge <>
Joseph Myers <>
Cesar Philippidis <>
* c-pragma.h (pragma_omp_clause): Add 'PRAGMA_OACC_CLAUSE_NOHOST'.
2021-07-20 Martin Sebor <>
* c-common.c (c_build_shufflevector): Adjust by-value argument to
* c-common.h (c_build_shufflevector): Same.
2021-07-16 Andrew Pinski <>
PR c/101453
* c-common.c (parse_optimize_options): Use the correct
size for buffer.
2021-07-15 Martin Sebor <>
PR c/101289
PR c/97548
* c-warn.c (warn_parm_array_mismatch): Use OEP_DECL_NAME.
2021-07-14 Jason Merrill <>
* c-opts.c (c_common_post_options): Set -fdelete-dead-exceptions.
2021-07-06 Martin Sebor <>
* c-format.c (gcc_tdiag_char_table): Remove support for %G and %K.
(gcc_cdiag_char_table): Same.
(gcc_cxxdiag_char_table): Same.
2021-07-02 Jakub Jelinek <>
* c-common.h (enum c_omp_directive_kind): New enum.
(struct c_omp_directive): New type.
(c_omp_categorize_directive): Declare.
* c-omp.c (omp_directives): New variable.
(c_omp_categorize_directive): New function.
2021-07-01 Eric Botcazou <>
* c-ada-spec.c (packed_layout): New global variable.
(dump_ada_declaration): Set it upon seeing a packed record type.
Do not put the "aliased" keyword if it is set.
(dump_ada_structure): Add Pack aspect if it is set and clear it.
2021-07-01 Eric Botcazou <>
* c-ada-spec.c (check_name): Rename into...
(check_type_name_conflict): ...this. Minor tweak.
(dump_ada_function_declaration): Adjust to above renaming.
(dump_ada_array_domains): Fix oversight.
(dump_ada_declaration): Call check_type_name_conflict for variables.
2021-06-25 Martin Sebor <>
* c-common.c (c_wrap_maybe_const): Remove TREE_NO_WARNING.
(c_common_truthvalue_conversion): Replace direct uses of
TREE_NO_WARNING with warning_suppressed_p, suppress_warning, and
(check_function_arguments_recurse): Same.
* c-gimplify.c (c_gimplify_expr): Same.
* c-warn.c (overflow_warning): Same.
(warn_logical_operator): Same.
(warn_if_unused_value): Same.
(do_warn_unused_parameter): Same.
2021-06-24 Jakub Jelinek <>
* c-common.h (enum c_omp_region_type): Add C_ORT_TARGET and
* c-omp.c (c_omp_split_clauses): For OMP_CLAUSE_IN_REDUCTION on
combined target constructs also add map (always, tofrom:) clause.
2021-06-15 Robin Dapp <>
* c-attribs.c (common_handle_aligned_attribute): Remove short
circuit and dead code.
2021-06-14 Jonathan Wakely <>
PR c++/101052
* (get_stdlib_header_for_name): Add known
headers for EXIT_FAILURE, EXIT_SUCCESS, abort, atexit, calloc,
exit, and getenv.
2021-06-12 Jason Merrill <>
* c-attribs.c (handle_unused_attribute): Handle FIELD_DECL.
2021-06-11 Jakub Jelinek <>
PR c++/100974
* c-cppbuiltin.c (c_cpp_builtins): Predefine __cpp_if_consteval for
-std=c++2b for P1938R3 consteval if support.
2021-06-09 Jason Merrill <>
PR c++/100879
* c-warn.c (warn_for_sign_compare): Remove C++ enum mismatch
2021-06-07 Martin Liska <>
* c-target.def: Split long lines and replace them
with '\n\'.
2021-06-04 Martin Sebor <>
PR c/100783
* c-attribs.c (positional_argument): Bail on erroneous types.
2021-06-04 Martin Sebor <>
* c-warn.c (warn_parm_array_mismatch): Check TREE_PURPOSE to test
for element presence.
2021-06-03 Eric Botcazou <>
* c-ada-spec.c (dump_ada_macros): Minor tweaks.
(dump_ada_decl_name): Likewise.
(dump_anonymous_type_name): Remove parent parameter and adjust.
(dump_sloc): Minor tweak.
(dump_ada_array_type): Remove type parameter and adjust.
(dump_ada_enum_type): Remove parent parameter and adjust.
(dump_ada_node): Adjust calls to above functions.
(dumped_anonymous_types): New global variable.
(dump_nested_types_1): Rename into...
(dump_nested_types): ...this.
(dump_nested_type): Remove parent and dumped_types parameters.
<ARRAY_TYPE>: Replace dumped_types with dumped_anonymous_types.
Adjust calls to dump_anonymous_type_name and dump_ada_array_type.
(dump_ada_specs): Initialize and free dumped_anonymous_types.
2021-06-03 Eric Botcazou <>
* c-ada-spec.c (pp_ada_tree_identifier): Tidy up.
(dump_ada_node) <POINTER_TYPE>: Deal specially with external subtypes.
2021-06-03 Eric Botcazou <>
* c-ada-spec.c (dump_ada_enum_type): Dump a prefix for constants.
(htable_t): New typedef.
(overloaded_names): Use it.
(add_name): New function.
(init_overloaded_names): Use add_name to populate the table and add
special cases for sigaction and stat.
(overloaded_name_p): Rename into...
(overloading_index): ...this. Do not initialize overloaded_names table
here. Return the index or zero.
(dump_ada_declaration): Minor tweaks. Do not skip overloaded functions
but add an overloading suffix instead.
(dump_ada_specs): Initialize overloaded_names tables here.
2021-06-01 Martin Liska <>
PR other/100759
* c-attribs.c (handle_optimize_attribute): Limit sanity check
to a situation where we are not in processing of an optimize
* c-pragma.c (handle_pragma_pop_options): Restore target
2021-05-31 Indu Bhagat <>
PR testsuite/100749
* c-pch.c (c_common_valid_pch): Use xstrdup for debug format set names.
2021-05-31 Richard Biener <>
PR c++/88601
* c-common.c: Include tree-vector-builder.h and
(c_common_reswords): Add __builtin_shufflevector.
(c_build_shufflevector): New funtion.
* c-common.h (enum rid): Add RID_BUILTIN_SHUFFLEVECTOR.
(c_build_shufflevector): Declare.
2021-05-28 Jakub Jelinek <>
PR middle-end/99928
* c-omp.c (c_omp_split_clauses): For reduction clause if combined with
target add a map tofrom clause with OMP_CLAUSE_MAP_IMPLICIT.
2021-05-28 Tobias Burnus <>
* c-pragma.h (enum pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_AFFINITY.
2021-05-25 Martin Liska <>
PR tree-optimization/92860
PR target/99592
* c-attribs.c (handle_optimize_attribute): Save target node
before calling parse_optimize_options and save it in case
it changes.
* c-pragma.c (handle_pragma_target): Similarly for pragma.
(handle_pragma_pop_options): Likewise here.
2021-05-25 Martin Liska <>
* c-attribs.c (handle_no_sanitize_coverage_attribute): New.
2021-05-25 Jakub Jelinek <>
PR middle-end/99928
* c-omp.c (c_omp_split_clauses): Copy reduction to teams when teams is
combined with simd and not with taskloop or for.
2021-05-21 Jakub Jelinek <>
PR middle-end/99928
* c-omp.c (c_omp_split_clauses): Set OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT
on firstprivate clause copy going to target construct, and for
2021-05-20 Jonathan Wakely <>
* c.opt (Wc++11-extensions, Wc++14-extensions)
(Wc++17-extensions, Wc++20-extensions, Wc++23-extensions): New
2021-05-20 Indu Bhagat <>
* c-lex.c (init_c_lex): Use dwarf_debuginfo_p.
2021-05-20 Indu Bhagat <>
* c-opts.c (c_common_post_options): Adjust access to debug_type_names.
* c-pch.c (struct c_pch_validity): Use type uint32_t.
(pch_init): Renamed member.
(c_common_valid_pch): Adjust access to debug_type_names.
2021-05-19 Martin Sebor <>
PR c/100619
* c-attribs.c (build_attr_access_from_parms): Handle arbitrarily many
2021-05-18 Richard Biener <>
PR c/100547
* c-attribs.c (type_valid_for_vector_size): Reject too large nunits.
Reword existing nunit diagnostic.
2021-05-17 Joern Rennecke <>
* c-common.c (braced_list_to_string): Return CTOR unchanged
if host and target character sizes don't match.
2021-05-14 Martin Liska <>
* c.opt: Add Warning keyword for 2 options.
2021-05-13 Martin Liska <>
PR middle-end/100504
* c-attribs.c (handle_target_clones_attribute): Expect a string
argument to target_clone argument.
2021-05-11 Joseph Myers <>
* c-lex.c (interpret_float): Handle digit separators for C2X.
2021-05-10 Martin Liska <>
* c-ada-spec.c (print_destructor): Use startswith
function instead of strncmp.
(dump_ada_declaration): Likewise.
* c-common.c (disable_builtin_function): Likewise.
(def_builtin_1): Likewise.
* c-format.c (check_tokens): Likewise.
(check_plain): Likewise.
(convert_format_name_to_system_name): Likewise.
2021-04-28 Patrick McGehearty <>
* c-cppbuiltin.c (c_cpp_builtins): Add supporting macros for new
complex divide
2021-04-26 Thomas Schwinge <>
Nathan Sidwell <>
Tom de Vries <>
Julian Brown <>
Kwok Cheung Yeung <>
* c.opt (Wopenacc-parallelism): New.
2021-04-19 Thomas Schwinge <>
* c.opt (fopenacc-kernels=): Remove.
2021-04-08 Jakub Jelinek <>
* c-warn.c (do_warn_double_promotion): Fix comment typo,
occured -> occurred.
(check_alignment_of_packed_member): Fix a comment typo,
memeber -> member.
(warn_parm_ptrarray_mismatch): Fix comment typos, os -> of
and onless -> unless.
(warn_parm_array_mismatch): Fix comment typos, declaratation
-> declaration and woud -> would. Fix up comment indentation.
2021-04-08 Martin Sebor <>
PR middle-end/99883
* c.opt (Wmismatched-new-delete): Correct spelling.
2021-04-05 Eric Botcazou <>
* c-ada-spec.c (is_simple_enum): Minor tweaks.
(dump_ada_enum_type): Add TYPE and PARENT parameters. For non-simple
enumeral types use again the type name for the enumeration constants.
(dump_ada_node): Adjust call to dump_ada_enum_type.
(dump_nested_type): Likewise.
2021-04-01 Jason Merrill <>
PR c++/98481
* c-opts.c (c_common_post_options): Bump latest_abi_version.
2021-03-25 Jakub Jelinek <>
PR c++/99565
* c-warn.c (do_warn_duplicated_branches): Pass also
OEP_ADDRESS_OF_SAME_FIELD to operand_equal_p.
2021-03-20 Jakub Jelinek <>
PR debug/99230
* c-gimplify.c (c_genericize_control_stmt): Handle STATEMENT_LIST.
2021-03-05 Eric Botcazou <>
* c-ada-spec.c (dump_ada_declaration) <TYPE_DECL>: Dump nested types
after entering the separate class package, if any.
2021-03-04 Richard Biener <>
* c-pretty-print.c (c_pretty_printer::direct_abstract_declarator):
2021-03-04 Jakub Jelinek <>
PR c/99325
* c-ppoutput.c (print): Change src_line type from int to unsigned.
(token_streamer::stream) Likewise.
(maybe_print_line_1): Likewise. Don't strcmp src_file if src_loc is
2021-03-03 Jakub Jelinek <>
PR c/99324
* c-common.c (build_va_arg): Call c_common_mark_addressable_vec
instead of mark_addressable. Fix a comment typo -
neutrallly -> neutrally.
2021-02-28 Jakub Jelinek <>
PR c/99304
* c-attribs.c (handle_malloc_attribute): Fix a typo in inform
message - refernced -> referenced. Remove superfluous space before
closing paren of function calls.
2021-02-25 Nathan Sidwell <>
PR c++/99166
* c.opt (-flang-info-module-cmi): Renamed option.
2021-02-19 Nathan Sidwell <>
* c.opt (flang-info-module-read, flang-info-module-read=): New.
2021-02-18 H.J. Lu <>
PR target/99113
* c-attribs.c (c_common_attribute_table): Add the "retain"
(handle_retain_attribute): New function.
2021-02-16 Marek Polacek <>
PR c++/99062
* c-attribs.c (handle_assume_aligned_attribute): Check that the
alignment argument is non-negative. Tweak a warning message.
2021-02-12 Martin Sebor <>
PR c/99055
* c-warn.c (warn_parm_array_mismatch): Free strings returned from
2021-02-10 Richard Biener <>
* c-common.c (parse_optimize_options): Free decoded_options.
2021-02-04 emsr <>
* c-cppbuiltin.c (c_cpp_builtins): __cpp_size_t_suffix=202011L.
2021-02-03 Ed Smith-Rowland <>
* c-cppbuiltin.c (c_cpp_builtins): Define __cpp_size_t_suffix.
* c-lex.c (interpret_integer): Set node type for size literal.
2021-01-28 Jakub Jelinek <>
* c.opt (-std=c++2a, -std=c++20, -std=gnu++2a, -std=gnu++20): Remove
draft from description.
(-std=c++2b): Fix a pasto, 2020 -> 2023.
2021-01-26 Paul Fee <>
* c-common.h (cxx_dialect): Add cxx23 as a dialect.
* c.opt: Add options for -std=c++23, std=c++2b, -std=gnu++23
and -std=gnu++2b
* c-opts.c (set_std_cxx23): New.
(c_common_handle_option): Set options when -std=c++23 is enabled.
(c_common_post_options): Adjust comments.
(set_std_cxx20): Likewise.
2021-01-25 Martin Sebor <>
PR c++/98646
* c-common.c (check_nonnull_arg): Adjust warning text.
2021-01-17 Martin Sebor <>
* c-pretty-print.c (c_pretty_printer::primary_expression): Don't
assume SSA_NAME_IDENTIFIER evaluates to nonzero.
2021-01-16 Kwok Cheung Yeung <>
* c-pragma.h (pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_DETACH.
2021-01-15 Jakub Jelinek <>
PR tree-optimization/98597
* c-pretty-print.c: Include options.h.
(c_fold_indirect_ref_for_warn): New function.
(print_mem_ref): Use it. If it returns something that has compatible
type and is TBAA compatible with zero offset, print it and return,
otherwise print it using offsetof syntax or array ref syntax. Fix up
printing if MEM_REFs first operand is ADDR_EXPR, or when the first
argument has pointer to array type. Print pointers using the standard
2021-01-12 Martin Sebor <>
PR c/98597
PR c/98592
* c-pretty-print.c (print_mem_ref): Avoid assuming MEM_REF operand
has pointer type. Remove redundant code. Avoid calling
2021-01-07 Martin Sebor <>
PR middle-end/98578
* c-pretty-print.c (print_mem_ref): Strip array from access type.
Avoid assuming acces type's size is constant. Correct condition
guarding the printing of a parenthesis.
2021-01-06 Martin Sebor <>
PR c++/95768
* c-pretty-print.c (c_pretty_printer::primary_expression): For
SSA_NAMEs print VLA names and GIMPLE defining statements.
(print_mem_ref): New function.
(c_pretty_printer::unary_expression): Call it.
2021-01-06 Richard Biener <>
PR tree-optimization/95582
* c-attribs.c (c_common_attribute_table): Add entry for
(handle_signed_bool_precision_attribute): New.
2020-12-24 Iain Sandoe <>
* c.opt: Add -stdlib= option and enumerations for
libstdc++ and libc++.
2020-12-16 Martin Liska <>
* c.opt: Remove usage of Report.
2020-12-14 Martin Sebor <>
PR middle-end/98166
PR c++/57111
PR middle-end/98160
* c-attribs.c (maybe_add_noinline): New function.
(handle_malloc_attribute): Call it. Use ATTR_FLAG_INTERNAL.
Implicitly add attribute noinline to functions not declared inline
and warn on those.
2020-12-09 Tobias Burnus <>
* c-pragma.c (omp_pragmas): Add 'allocate'.
* c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_ALLOCATE.
2020-12-08 Jakub Jelinek <>
PR c++/98187
* c-pragma.c (omp_pragmas): Remove "master".
(omp_pragmas_simd): Add "master".
2020-12-07 Marek Polacek <>
PR c++/98126
* c-common.c (verify_tree_lim_r): New function.
(verify_sequence_points): Use it. Use nullptr instead of 0.
2020-12-03 Martin Sebor <>
PR c++/90629
PR middle-end/94527
* c-attribs.c (handle_dealloc_attribute): New function.
(handle_malloc_attribute): Handle argument forms of attribute.
* c.opt (-Wmismatched-dealloc): New option.
(-Wmismatched-new-delete): New option.
2020-12-03 Jakub Jelinek <>
PR libstdc++/93121
* c-common.h (enum rid): Add RID_BUILTIN_BIT_CAST.
* c-common.c (c_common_reswords): Add __builtin_bit_cast.
2020-12-01 JeanHeyd Meneide <>
* c-cppbuiltin.c (c_cpp_builtins): Add predefined
2020-12-01 Nathan Sidwell <>
* c-common.c (module, import, export): New internal tokens (with
trailing space).
* c-common.h (RID__MODULE, RID__IMPORT & RID__EXPORT): Enumerate
* c-cppbuiltin.c (c_cpp_builtins): Feature macro.
2020-12-01 Nathan Sidwell <>
* c-opts.c (c_common_init_options): Ask for module dependencies.
(c_common_handle_option): Handle -Mmodules -Mno-modules.
* c-pch.c (c_common_valid_pch): ... does not play with C++
* c.opt (Mmodules, Mno-modules): New preprocessor dependency
(fmodules-ts, fmodule-header, fmodule-implicit-inline)
(fmodule-only, fmodule-mapper, fmodule-lazy)
(fmodule-version-ignore, Winvalid-imported-macros)
(flang-info-include-translate, flang-info-include-translate-not):
New options
2020-11-28 Eric Botcazou <>
* c-ada-spec.c (dump_nested_type) <RECORD_TYPE>: Remove obsolete code.
(dump_ada_structure): Also deal with convention, unchecked union and
bit-field for nested types. In the latter case, print an Alignment
aspect along with the Pack aspect.
2020-11-25 Martin Sebor <>
PR bootstrap/94982
* c-attribs.c (handle_patchable_function_entry_attribute): Avoid
2020-11-24 Martin Sebor <>
* c-warn.c (warn_parm_array_mismatch): Avoid invalid redeclarations.
2020-11-23 Jozef Lawrynowicz <>
* c-attribs.c (handle_special_var_sec_attribute): New.
(handle_noinit_attribute): Remove.
(attr_noinit_exclusions): Rename to...
(attr_section_exclusions): ...this, and add "persistent" attribute
(c_common_attribute_table): Add "persistent" attribute.
2020-11-21 Aaron Sawdey <>
* c-pretty-print.c (c_pretty_printer::simple_type_specifier):
Treat opaque types like other types.
(c_pretty_printer::direct_abstract_declarator): Opaque types are
supported types.
2020-11-20 Martin Sebor <>
* c-warn.c (warn_parm_array_mismatch): Bail on invalid redeclarations
with fewer arguments.
2020-11-20 Martin Sebor <>
PR middle-end/97879
* c-attribs.c (handle_access_attribute): Handle ATTR_FLAG_INTERNAL.
Error out on invalid modes.
2020-11-20 Jakub Jelinek <>
PR libstdc++/88101
* c-common.c (check_builtin_function_arguments): Handle
2020-11-18 Nathan Sidwell <>
* c-lex.c (c_lex_with_flags): CPP_HEADER_NAMEs can now be seen.
2020-11-17 Nathan Sidwell <>
* c-common.h (enum c_tree_index): Reorder to place lazy fields
after newly-added CTI_MODULE_HWM.
2020-11-17 Joseph Myers <>
* c-cppbuiltin.c (builtin_define_float_constants): Define
"*_IS_IEC_60559__" macros.
2020-11-17 Nathan Sidwell <>
* c-lex.c: #include "langhooks.h".
(cb_undef): Maybe call preprocess_undef lang hook.
* c-opts.c (c_common_post_options): Maybe call preprocess_options
lang hook.
(push_command_line_include): Maybe call preprocess_main_file lang
(cb_file_change): Likewise.
* c-ppoutput.c: #include "langhooks.h.
(scan_translation_unit): Maybe call preprocess_token lang hook.
(class do_streamer): New, derive from token_streamer.
(directives_only_cb): Data pointer is do_streamer, call
preprocess_token lang hook.
(scan_translation_unit_directives_only): Use do_streamer.
(print_line_1): Move src_line recording to after string output.
(cb_undef): Maybe call preprocess_undef lang hook.
2020-11-17 Nathan Sidwell <>
* c-ppoutput.c (scan_translation_unit): Use token_streamer, remove
code duplicating that functionality.
2020-11-17 Jakub Jelinek <>
PR c/90628
* c-common.c (check_builtin_function_arguments)
<case BUILT_IN_ADD_OVERFLOW>: Diagnose when last argument is pointer
to _Atomic. For the TYPE_READONLY case, adjust message to be usable
for more builtins and argument positions.
2020-11-16 Iain Sandoe <>
PR objc/97854
* stub-objc.c: Include c-common.h to declare enum rid.
2020-11-13 Jakub Jelinek <>
PR c++/63287
* c-cppbuiltin.c: Include configargs.h.
(c_cpp_builtins): For C++11 and later if THREAD_MODEL_SPEC is not
defined, predefine __STDCPP_THREADS__ to 1 unless thread_model is
2020-11-13 Gergö Barany <>
Thomas Schwinge <>
* c.opt (fopenacc-kernels): Add.
2020-11-13 Jason Merrill <>
* c-cppbuiltin.c (c_cpp_builtins): Define __cpp_using_enum.
2020-11-13 Piotr H. Dabrowski <>
PR c++/91318
* c-cppbuiltin.c: c_cpp_builtins_optimize_pragma(): use cpp_define_unused()
2020-11-13 Martin Liska <>
* c-attribs.c (build_attr_access_from_parms): Format properly.
2020-11-13 Iain Sandoe <>
PR objc/90707
* c-common.c (c_common_reswords): null_unspecified, nullable,
nonnull, null_resettable: New keywords.
* c-common.h (enum rid): RID_NULL_UNSPECIFIED, RID_NULLABLE,
(OBJC_IS_PATTR_KEYWORD): Include nullability keywords in the
ranges accepted for property attributes.
* c-attribs.c (handle_objc_nullability_attribute): New.
* c-objc.h (enum objc_property_attribute_group): Add
(enum objc_property_attribute_kind):Add
2020-11-13 Iain Sandoe <>
PR objc/77404
* c-attribs.c (handle_objc_root_class_attribute): New
* c-objc.h (objc_start_class_interface): Add a location
value for the position of the class name.
* c.opt: Add Wobjc-root-class.
* stub-objc.c (objc_start_class_interface): Add a location
value for the position of the class name.
2020-11-12 Joseph Myers <>
* c-lex.c (c_common_has_attribute): Take argument std_syntax.
Allow scope for C. Handle standard attributes for C. Do not
accept unscoped attributes if std_syntax and not handled as
standard attributes.
* c-common.h (c_common_has_attribute): Update prototype.
2020-11-12 Nicholas Guriev <>
PR pch/86674
* c-pch.c (c_common_valid_pch): Use cpp_warning with CPP_W_INVALID_PCH
reason to fix -Werror=invalid-pch and -Wno-error=invalid-pch switches.
2020-11-11 Patrick Palka <>
PR c++/88115
* c-opts.c (c_common_post_options): Update latest_abi_version.
2020-11-10 Jakub Jelinek <>
PR c/97748
* c-common.h (warn_if_unused_value): Add quiet argument defaulted
to false.
* c-warn.c (warn_if_unused_value): Likewise. Pass it down
recursively and just return true instead of warning if it is true.
2020-11-10 Chung-Lin Tang <>
* c-common.h (c_omp_adjust_map_clauses): New declaration.
* c-omp.c (struct map_clause): Helper type for c_omp_adjust_map_clauses.
(c_omp_adjust_map_clauses): New function.
2020-11-09 Marek Polacek <>
DR 1914
* c-common.c (attribute_fallthrough_p): Tweak the warning
2020-11-09 Patrick Palka <>
* c-pragma.c (handle_pragma_diagnostic): Split the
unknown-option -Wpragmas diagnostic into a warning and a
subsequent note containing a spelling suggestion. Avoid
computing the suggestion if -Wpragmas warnings are being
2020-11-09 Patrick Palka <>
PR testsuite/97117
* c-indentation.c (get_visual_column): Remove location_t
parameter. Move the column-tracking diagnostic code from here
to ...
(should_warn_for_misleading_indentation): ... here, before the
early exit for when the loci are not all distinct. Don't pass a
location_t argument to get_visual_column.
(assert_get_visual_column_succeeds): Don't pass a location_t
argument to get_visual_column.
(assert_get_visual_column_fails): Likewise.
2020-11-08 Iain Sandoe <>
* c-common.h (OBJC_IS_PATTR_KEYWORD): Add class to the list
of keywords accepted in @property attribute contexts.
* c-objc.h (enum objc_property_attribute_group): Add
(enum objc_property_attribute_kind): Add
2020-11-07 Iain Sandoe <>
* c-common.c (c_common_reswords): Add 'atomic' property
* c-common.h (enum rid): Add RID_PROPATOMIC for atomic
property attributes.
2020-11-07 Iain Sandoe <>
* c-attribs.c (handle_nsobject_attribute): New.
* c.opt: Add WNSObject-attribute.
2020-11-06 Iain Sandoe <>
* c-objc.h (enum objc_property_attribute_group): New
(enum objc_property_attribute_kind): New.
(struct property_attribute_info): Small class encapsulating
parser output from property attributes.
(objc_prop_attr_kind_for_rid): New
(objc_add_property_declaration): Simplify interface.
* stub-objc.c (enum rid): Dummy type.
(objc_add_property_declaration): Simplify interface.
(objc_prop_attr_kind_for_rid): New.
2020-11-06 Nathan Sidwell <>
* c-ada-spec.c (collect_ada_nodes): Rename
(collect_ada_node): Likewise.
(dump_forward_type): Likewise.
* c-common.c (set_underlying_type): Rename
(user_facing_original_type, c_common_finalize_early_debug): Likewise.
2020-11-06 Jakub Jelinek <>
* c-common.c (verify_sequence_points): Remove DEBUG_FUNCTION.
2020-11-05 Marek Polacek <>
PR c++/97675
* c.opt (Wexceptions): New option.
2020-11-05 Marek Polacek <>
PR c++/25814
* c.opt (Wvexing-parse): New option.
2020-11-04 Jakub Jelinek <>
PR c++/97670
* c-omp.c (c_omp_split_clauses): Look through array reductions to find
underlying decl to clear in the allocate_head bitmap.
2020-11-04 Iain Sandoe <>
* c-objc.h (objc_non_constant_expr_p): New.
* stub-objc.c (objc_non_constant_expr_p): New.
2020-11-03 Nathan Sidwell <>
* c.opt (MQ,MT): Reword description to be make-agnostic.
2020-11-02 Nathan Sidwell <>
* c-opts.c (c_common_post_options): Move var decl to its
initialization point.
2020-11-01 Iain Sandoe <>
* c-lex.c (c_lex_with_flags): When combining '@' with a
keyword for Objective-C, combine the location ranges too.
2020-10-30 Qing Zhao <>
H.J.Lu <>
* c-attribs.c (c_common_attribute_table): Add new attribute
(handle_zero_call_used_regs_attribute): New function.
2020-10-28 Marek Polacek <>
PR c++/97573
* c-opts.c (c_common_post_options): In C++20, turn on
-Wdeprecated-enum-enum-conversion and
* c.opt (Wdeprecated-enum-enum-conversion,
Wdeprecated-enum-float-conversion): New options.
(Wenum-conversion): Allow for C++ too.
2020-10-28 Jakub Jelinek <>
* c-pragma.h (enum pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_ALLOCATE.
* c-omp.c: Include bitmap.h.
(c_omp_split_clauses): Handle OMP_CLAUSE_ALLOCATE.
2020-10-26 Ville Voutilainen <>
* c-common.c (__is_nothrow_assignable): New.
(__is_nothrow_constructible): Likewise.
* c-common.h (RID_IS_NOTHROW_ASSIGNABLE): New.
2020-10-23 Jan Hubicka <>
* c-common.c (c_common_finalize_early_debug): Update for new thunk api.
2020-10-23 Marek Polacek <>
PR c++/91741
* c-common.c (verify_tree): Handle PAREN_SIZEOF_EXPR.
(c_common_init_ts): Likewise.
* c-common.def (PAREN_SIZEOF_EXPR): New tree code.
* c-common.h (maybe_warn_sizeof_array_div): Declare.
* c-warn.c (sizeof_pointer_memaccess_warning): Unwrap NOP_EXPRs.
(maybe_warn_sizeof_array_div): New function.
* c.opt (Wsizeof-array-div): New option.
2020-10-23 Martin Sebor <>
PR c/97463
* c-warn.c (warn_parm_ptrarray_mismatch): Move null test earlier.
2020-10-22 Martin Liska <>
PR c/94722
* c-attribs.c (handle_no_stack_protect_function_attribute): New.
(handle_stack_protect_attribute): Add error message for a
no_stack_protector function.
2020-10-22 Martin Liska <>
* c-cppbuiltin.c (c_cpp_builtins): Use the stack_protector enum.
2020-10-22 Jan Hubicka <>
* c-gimplify.c: Include tree-nested.h
(c_genericize): Update for new nested function info.
2020-10-14 Martin Sebor <>
PR c/97413
* c-attribs.c (build_attr_access_from_parms): Wrap chain of VLA
bounds in an extra list.
2020-10-05 Richard Biener <>
Jakub Jelinek <>
PR c++/97197
* c-pretty-print.c: Include langhooks.h.
(c_pretty_printer::postfix_expression): Handle TARGET_MEM_REF as
(c_pretty_printer::expression): Handle TARGET_MEM_REF as
(c_pretty_printer::unary_expression): Handle TARGET_MEM_REF.
2020-09-30 Martin Sebor <>
PR middle-end/97189
* c-attribs.c (append_access_attr): Use the function declaration
location for a warning about an attribute access argument.
2020-09-29 Marek Polacek <>
PR c++/94695
* c.opt (Wrange-loop-construct): New option.
2020-09-23 Martin Sebor <>
PR c/97131
* c-warn.c (warn_parm_ptrarray_mismatch): Handle more invalid input.
2020-09-23 Marek Polacek <>
PR c/97125
* c-gimplify.c (c_genericize): Only call do_warn_duplicated_branches_r
after loops and other structured control constructs have been lowered.
2020-09-22 Jakub Jelinek <>
* c.opt (Wbuiltin-declaration-mismatch): Fix typo in variable name:
warn_builtin_declaraion_mismatch -> warn_builtin_declaration_mismatch.
2020-09-21 Marek Polacek <>
* c.opt (Wctad-maybe-unsupported): New option.
2020-09-19 Martin Sebor <>
PR c/50584
* c-common.h (warn_parm_array_mismatch): Declare new function.
(has_attribute): Move declaration of an existing function.
(build_attr_access_from_parms): Declare new function.
* c-warn.c (parm_array_as_string): Define new function.
(plus_one): Define new function.
(warn_parm_ptrarray_mismatch): Define new function.
(warn_parm_array_mismatch): Define new function.
(vla_bound_parm_decl): New function.
* c.opt (-Warray-parameter, -Wvla-parameter): New options.
* c-pretty-print.c (pp_c_type_qualifier_list): Don't print array type
qualifiers here...
(c_pretty_printer::direct_abstract_declarator): ...but instead print
them in brackets here. Also print [static]. Strip extraneous
expressions from VLA bounds.
2020-09-19 Martin Sebor <>
PR c/50584
* c-attribs.c (c_common_attribute_table): Add "arg spec" attribute.
(handle_argspec_attribute): New function.
(get_argument, get_argument_type): New functions.
(append_access_attrs): Add overload. Handle internal attribute
representation in addition to external.
(handle_access_attribute): Handle internal attribute representation
in addition to external.
(build_attr_access_from_parms): New function.
2020-09-19 Sandra Loosemore <>
* c-gimplify.c (genericize_c_loop): Rewrite to match
c_finish_loop in c-typeck.c.
2020-09-19 Sandra Loosemore <>
* c-common.c (c_block_may_fallthrough): New, split from
cxx_block_may_fallthrough in the cp front end.
(c_common_init_ts): Move handling of loop and switch-related
statements here from the cp front end.
* c-common.def (FOR_STMT, WHILE_STMT, DO_STMT): Move here from
cp front end.
* c-common.h (c_block_may_fallthru): Declare.
(bc_state_t): Move here from cp front end.
(save_bc_state, restore_bc_state): Declare.
(c_genericize_control_stmt): Declare.
(DO_COND, DO_BODY): Likewise.
* c-dump.c (dump_stmt): Copy from cp front end.
(c_dump_tree): Move code to handle structured loop and switch
tree nodes here from cp front end.
* c-gimplify.c: Adjust includes.
(enum bc_t, bc_label, begin_bc_block, finish_bc_block): Move from
cp front end.
(save_bc_state, restore_bc_state): New functions using old code
from cp front end.
(get_bc_label, expr_loc_or_loc): Move from cp front end.
(genericize_c_loop): Move from cp front end.
(genericize_for_stmt, genericize_while_stmt): Likewise.
(genericize_do_stmt, genericize_switch_stmt): Likewise.
(genericize_continue_stmt, genericize_break_stmt): Likewise.
(genericize_omp_for_stmt): Likewise.
(c_genericize_control_stmt): New function using code split from
cp front end.
(c_genericize_control_r): New.
(c_genericize): Call walk_tree with c_genericize_control_r.
* c-pretty-print.c (c_pretty_printer::statement): Move code to handle
structured loop and switch tree nodes here from cp front end.
2020-09-17 Patrick Palka <>
PR c/80076
* c-indentation.c (should_warn_for_misleading_indentation): Move
declarations of local variables closer to their first use.
Handle virtual token locations by resolving them to their
respective macro expansion points. If all three tokens are
produced from the same macro expansion, then instead use their
loci within the macro definition.
2020-09-16 Martin Sebor <>
PR c/78666
PR c/96126
* c-attribs.c (validate_attr_args): New function.
(validate_attr_arg): Same.
(handle_section_attribute): Call it. Introduce a local variable.
(handle_alloc_size_attribute): Same.
(handle_alloc_align_attribute): Same.
2020-09-14 Jakub Jelinek <>
* c-attribs.c (handle_optimize_attribute): Adjust
cl_optimization_save, cl_optimization_restore and
build_optimization_node callers.
* c-pragma.c (handle_pragma_optimize): Adjust
build_optimization_node caller.
(handle_pragma_push_options): Adjust
build_optimization_node and build_target_option_node callers.
(handle_pragma_pop_options, handle_pragma_reset_options):
Adjust cl_optimization_restore callers.
2020-08-28 Martin Sebor <>
* c.opt (Wstringop-overread): New option.
2020-08-11 Jakub Jelinek <>
PR c/96545
* c-common.c (get_atomic_generic_size): Require that first argument's
type points to a complete type and use tree_fits_uhwi_p instead of
2020-07-31 Martin Sebor <>
PR c++/96003
* c-common.c (check_function_arguments_recurse): Return early when
no-warning bit is set.
2020-07-31 Richard Biener <>
PR debug/96383
* c-common.h (c_common_finalize_early_debug): Declare.
* c-common.c: Include debug.h.
(c_common_finalize_early_debug): finalize_early_debug langhook
implementation generating debug for extern declarations.
2020-07-27 Nathan Sidwell <>
* c-common.c (try_to_locate_new_include_insertion_point): Use
strcmp, not pointer equality.
2020-07-25 Martin Sebor <>
PR c++/96310
* c-common.c (check_nonnull_arg): Print note only when warning was
2020-07-22 Tobias Burnus <>
* c-omp.c (c_finish_omp_critical): Check for no name but
nonzero hint provided.
2020-07-20 Jason Merrill <>
* c-cppbuiltin.c (c_cpp_builtins): Update
__cpp_nontype_template_args for C++20.
2020-07-20 Martin Sebor <>
PR c/96249
* c.opt: Remove stray text.
2020-07-14 Lewis Hyatt <>
PR other/86904
* c-indentation.c (should_warn_for_misleading_indentation): Get
global tabstop from the new source.
* c-opts.c (c_common_handle_option): Remove handling of -ftabstop, which
is now a common option.
* c.opt: Likewise.
2020-07-08 Eric Botcazou <>
* c.opt (Wscalar-storage-order): Add explicit variable.
2020-07-07 Nathan Sidwell <>
* c-opts.c (c_common_post_options): Add 'injecting' arg to
(c_finish_options): Add linemap_line_start calls for builtin and cmd
maps. Force token position to line_table's highest line.
* c-ppoutput.c (print_line_1): Refactor, print line zero.
(cb_define): Always increment source line.
2020-07-06 Martin Sebor <>
PR c++/95984
* c-common.c (check_function_nonnull): Avoid checking syntesized calls
to stub lambda objects with null this pointer.
(check_nonnull_arg): Handle C++ nullptr.
2020-07-02 Jason Merrill <>
Jakub Jelinek <>
* c-cppbuiltin.c (c_cpp_builtins): Define __cpp_consteval.
2020-06-30 Jakub Jelinek <>
PR c++/95963
* c-common.c (check_function_arguments_recurse): Don't crash on
calls to internal functions.
2020-06-28 Martin Sebor <>
PR c++/86568
* c-common.c (struct nonnull_arg_ctx): Add members.
(check_function_nonnull): Use nonnull_arg_ctx as argument. Handle
C++ member functions specially. Consider the this pointer implicitly
(check_nonnull_arg): Use location of argument when available.
(check_function_arguments): Use nonnull_arg_ctx as argument.
2020-06-27 Jakub Jelinek <>
PR middle-end/95903
* c-common.c (pointer_int_sum): Use TYPE_OVERFLOW_UNDEFINED instead of
!TYPE_UNSIGNED check to see if we can apply distributive law and handle
smaller precision intop operands separately.
2020-06-26 Marek Polacek <>
* c-opts.c (c_common_init_options): Default to gnu++17.
2020-06-17 Jonathan Wakely <>
PR c/95378
* c-common.c (get_atomic_generic_size): Check cv-qualifiers in
pointer arguments.
2020-06-16 Jakub Jelinek <>
* c-common.h (c_omp_check_loop_iv_exprs): Add an int argument.
* c-omp.c (struct c_omp_check_loop_iv_data): Add maybe_nonrect and
idx members.
(c_omp_is_loop_iterator): New function.
(c_omp_check_loop_iv_r): Use it. Add support for silent scanning
if outer loop iterator is present. Perform duplicate checking through
hash_set in the function rather than expecting caller to do that.
Pass NULL instead of d->ppset to walk_tree_1.
(c_omp_check_nonrect_loop_iv): New function.
(c_omp_check_loop_iv): Use it. Fill in new members, allow
non-rectangular loop forms, diagnose multiple associated loops with
the same iterator. Pass NULL instead of &pset to walk_tree_1.
(c_omp_check_loop_iv_exprs): Likewise.
2020-06-10 Martin Liska <>
PR tree-optimization/92860
* c-attribs.c (handle_optimize_attribute):
Save global options and compare it after parsing of function
* c-pragma.c (opt_stack::saved_global_options): New field.
(handle_pragma_push_options): Save global_options.
(handle_pragma_pop_options): Compare them after pop.
2020-06-09 Jakub Jelinek <>
PR c/95580
* c-pretty-print.c (c_pretty_printer::unary_expression): Handle the
case when MEM_REF's first argument has type pointer to incomplete type.
2020-06-05 Jason Merrill <>
* c-pretty-print.c (pp_c_additive_expression): Handle negative
2020-06-04 Martin Sebor <>
PR middle-end/10138
PR middle-end/95136
* c-attribs.c (append_access_attrs): Handle attr_access::none.
(handle_access_attribute): Same.
2020-06-03 Mark Wielaard <>
* (get_cp_stdlib_header_for_string_macro_name):
New function.
* known-headers.h (get_cp_stdlib_header_for_string_macro_name):
New function declaration.
2020-06-03 Mark Wielaard <>
* (get_string_macro_hint): New function.
(get_stdlib_header_for_name): Use get_string_macro_hint.
(get_c_stdlib_header_for_string_macro_name): New function.
* known-headers.h (get_c_stdlib_header_for_string_macro_name):
New function declaration.
2020-06-03 Tobias Burnus <>
* c-common.h (c_omp_predetermined_mapping): Declare.
* c-omp.c (c_omp_predetermined_mapping): New.
2020-05-22 Mark Wielaard <>
* (get_stdlib_header_for_name): Add a new
stdlib_hint array for stdbool and stdint.
2020-05-22 Mark Wielaard <>
* (get_stdlib_header_for_name): Return
"<stdbool.h>" for "bool", "true" or "false" when STDLIB_C and
2020-05-20 Nathan Sidwell <>
* c-common.c (try_to_locate_new_include_insertion_point): Revert change.
* c-common.c (try_to_locate_new_include_insertion_point): Use
strcmp to compare filenames.
* c-lex.c (init_c_lex): Move declaration to initialization.
* c-opts.c (handle_deferred_opts): Move cpp_get_deps call into
deferred count loop.
2020-05-15 Jason Merrill <>
* c-opts.c (set_std_cxx20): Set flag_coroutines.
2020-05-13 Jason Merrill <>
* c.opt (std=c++20): Make c++2a the alias.
(std=gnu++20): Likewise.
* c-common.h (cxx_dialect): Change cxx2a to cxx20.
* c-opts.c: Adjust.
* c-cppbuiltin.c: Adjust.
* c-ubsan.c: Adjust.
* c-warn.c: Adjust.
2020-05-12 Eric Botcazou <>
* c-ada-spec.c (dump_ads): Output pragma Warnings ("U"); on entry.
2020-05-08 Nathan Sidwell <>
Reimplement directives only processing.
* c-ppoutput.c (token_streamer): Ne.
(directives_only_cb): New. Swallow ...
(print_lines_directives_only): ... this.
(scan_translation_unit_directives_only): Reimplment using the
published interface.
2020-05-07 Marek Polacek <>
* c-format.c (badwords): Add "nonstatic".
202-05-07 Jakub Jelinek <>
PR c/94968
* c-common.c (speculation_safe_value_resolve_params): Return false if
error_operand_p (val2).
(resolve_overloaded_builtin) <case BUILT_IN_SPECULATION_SAFE_VALUE_N>:
Remove extraneous semicolon.
2020-05-06 qing zhao <>
PR c/94230
* c-indentation.c (get_visual_column): Add a hint to use the new
-flarge-source-files option.
2020-05-05 Stefan Schulze Frielinghaus <>
* c-attribs.c (handle_vector_size_attribute): Add attribute
nonnull for argument args in order to silence warning of
uninitialized variable usage. Since this is local to the
compilation unit and thus cannot be checked at call sides by the
compiler, added an assert statement in order to verify this.
2020-05-01 H.J. Lu <>
PR target/93492
* c-attribs.c (handle_patchable_function_entry_attribute): Limit
value to USHRT_MAX (65535).
2020-04-29 Jakub Jelinek <>
* c-format.c (PP_FORMAT_CHAR_TABLE): Add %{ and %}.
2020-04-27 Jakub Jelinek <>
PR c/94755
* c-common.c (resolve_overloaded_builtin): Return error_mark_node for
fncode == BUILT_IN_NONE before initialization of first_param.
2020-04-23 Marek Polacek <>
PR c++/94733
* c-attribs.c (find_tm_attribute): Use get_attribute_name instead of
2020-04-14 Patrick Palka <>
PR c++/85278
* c-pretty-print.c (pp_c_pointer) <case REFERENCE_TYPE>: Print a double
ampersand if it's an rvalue reference type.
2020-04-13 Martin Sebor <>
PR c/92326
* c-pretty-print.c (c_pretty_printer::direct_abstract_declarator): Avoid
printing array bound for flexible array members.
2020-04-13 Iain Sandoe <>
* c-cppbuiltin.c (c_cpp_builtins): Update coroutines builtin
define, per n4861.
2020-04-02 Richard Biener <>
PR c/94392
* c-opts.c (c_common_post_options): Enable -ffinite-loops
for -O2 and C++11 or newer.
2020-03-28 Patrick Palka <>
* c.opt: Add -fconcepts-diagnostics-depth.
2020-03-27 Martin Sebor <>
PR c++/94346
* c-attribs.c (handle_copy_attribute): Avoid passing expressions
to decl_attributes. Make handling of different kinds of entities
more robust.
2020-03-27 Martin Sebor <>
PR c++/94098
* c-attribs.c (handle_access_attribute): Avoid setting TYPE_ATTRIBUTES
2020-03-23 Jakub Jelinek <>
PR c++/91993
* c-warn.c (warnings_for_convert_and_check): For expr and/or
result being COMPOUND_EXPRs, skip to ultimate rhs.
2020-03-20 Richard Sandiford <>
PR middle-end/94072
* c-common.c (c_common_type_for_mode): Before using a registered
built-in type, check that the vectorness of the type matches
the vectorness of the mode.
2020-03-17 Jakub Jelinek <>
* c-common.c (resolve_overloaded_builtin): Fix up duplicated word
issue in a diagnostic message.
2020-03-15 Lewis Hyatt <>
* c.opt: Avoid redundancy in the help text.
2020-03-02 Marek Polacek <>
PR c++/93958 - add missing -std=gnu++20.
* c.opt: Add -std=gnu++20.
2020-03-01 Martin Sebor <>
PR c++/92721
* c-attribs.c (append_access_attrs): Correctly handle attribute.
(handle_access_attribute): Same.
2020-02-25 Jakub Jelinek <>
PR c/93858
* c-pragma.c (handle_pragma_diagnostic): Add missing ? after
"did you mean" hint in diagnostics.
2020-02-15 Jason Merrill <>
* c.opt: Add -std=c++20.
2020-02-14 Eric Botcazou <>
* c-ada-spec.c: Include bitmap.h.
(dump_ada_double_name): Rename into...
(dump_anonymous_type_name): ...this. Always use the TYPE_UID.
(dump_ada_array_type): Adjust to above renaming. Robustify.
(dump_nested_types_1): New function copied from... Add dumped_types
parameter and pass it down to dump_nested_type.
(dump_nested_types): ...this. Remove parent parameter. Just call
dump_nested_types_1 on an automatic bitmap.
(dump_nested_type): Add dumped_types parameter.
<ARRAY_TYPE>: Do not dump it if already present in dumped_types.
Adjust recursive calls and adjust to above renaming.
(dump_ada_declaration): Adjust call to dump_nested_types.
Tidy up and adjust to above renaming.
(dump_ada_specs): Initialize and release bitmap obstack.
2020-02-10 Martin Sebor <>
PR c/93640
* c-attribs.c (handle_access_attribute): Correct off-by-one mistakes.
2020-02-10 Jakub Jelinek <>
PR other/93641
* c-format.c (check_plain): Fix up last argument of strncasecmp.
Remove useless extra test.
2020-02-03 Julian Brown <>
Tobias Burnus <>
* c-cppbuiltin.c (c_cpp_builtins): Update _OPENACC define to 201711.
2020-01-29 Jason Merrill <>
PR c++/89357
* c-attribs.c (check_cxx_fundamental_alignment_constraints): Remove.
2020-01-23 Jason Merrill <>
* c-warn.c (conversion_warning): Change -Wsign-conversion handling.
2020-01-23 Martin Sebor <>
PR c/84919
* c-common.c (check_function_arguments): Avoid overlap checking
of sprintf functions.
2020-01-22 Jason Merrill <>
PR testsuite/93391 - PR 40752 test fails with unsigned plain char.
PR c++/40752
* c-warn.c (conversion_warning): Check operands only after checking
the whole expression. Don't check second operand of + for sign.
2020-01-21 Jason Merrill <>
Manuel López-Ibáñez <>
PR c++/40752 - useless -Wconversion with short +=.
* c.opt (-Warith-conversion): New.
* c-warn.c (conversion_warning): Recurse for operands of
operators. Only warn about the whole expression with
2020-01-21 Jason Merrill <>
* c-common.c (unsafe_conversion_p): Don't warn, return UNSAFE_SIGN.
* c-warn.c (conversion_warning): Warn about UNSAFE_SIGN.
2020-01-20 Nathan Sidwell <>
PR preprocessor/80005
* c-cppbuiltins.c (c_cpp_builtins): Don't define __has_include{,_next}.
2020-01-18 Iain Sandoe <>
* c-common.c (co_await, co_yield, co_return): New.
* c-common.h (RID_CO_AWAIT, RID_CO_YIELD,
RID_CO_RETURN): New enumeration values.
(D_CXX_COROUTINES): Bit to identify coroutines are active.
(D_CXX_COROUTINES_FLAGS): Guard for coroutine keywords.
* c-cppbuiltin.c (__cpp_coroutines): New cpp define.
* c.opt (fcoroutines): New command-line switch.
2020-01-10 David Malcolm <>
* c-format.c (local_event_ptr_node): New.
(PP_FORMAT_CHAR_TABLE): Add entry for "%@".
(init_dynamic_diag_info): Initialize local_event_ptr_node.
* c-format.h (T_EVENT_PTR): New define.
2020-01-10 Martin Sebor <>
PR c/93132
* c-attribs.c (append_access_attrs): Validate against the translated
access string rather than the human-readable representation.
2020-01-01 Jakub Jelinek <>
Update copyright years.
2019-12-20 Eric Botcazou <>
* c-ada-spec.h (decl_sloc): Delete.
* c-ada-spec.c (decl_sloc): Make static.
2019-12-19 Julian Brown <>
* c-common.h (c_omp_map_clause_name): Add prototype.
* c-omp.c (c_omp_map_clause_name): New function.
* c-pragma.h (pragma_omp_clause): Add PRAGMA_OACC_CLAUSE_ATTACH and
2019-12-19 Julian Brown <>
Maciej W. Rozycki <>
Tobias Burnus <>
Thomas Schwinge <>
* c-pragma.h (pragma_omp_clause): Add
2019-12-17 Martin Sebor <>
PR c++/61339
* c.opt (-Wmismatched-tags, -Wredundant-tags): New options.
2019-12-11 David Malcolm <>
* c-pretty-print.c (c_pretty_printer::clone): New vfunc
* c-pretty-print.h (c_pretty_printer::clone): New vfunc decl.
2019-12-09 David Malcolm <>
* c-format.c (range_label_for_format_type_mismatch::get_text):
Replace label_text ctor called with true with label_text::take.
2019-12-09 David Malcolm <>
* c-format.c (selftest::test_type_mismatch_range_labels): Remove
initial newline from expected outputs.
* c-opts.c (c_diagnostic_finalizer): Add pp_newline call before
call to diagnostic_show_locus.
2019-12-06 Jakub Jelinek <>
* c-cppbuiltin.c (c_cpp_builtins): Don't define __cpp_consteval for
2019-12-05 Marek Polacek <>
Jakub Jelinek <>
PR c++/91353 - P1331R2: Allow trivial default init in constexpr contexts.
* c-cppbuiltin.c (c_cpp_builtins): Adjust the value of __cpp_constexpr.
2019-12-05 Marek Polacek <>
PR c++/92271 - make __is_same alias for __is_same_as.
* c-common.c: Add __is_same, an alias for __is_same_as.
2019-12-03 Marek Polacek <>
PR c++/91363 - P0960R3: Parenthesized initialization of aggregates.
* c-cppbuiltin.c (c_cpp_builtins): Predefine
__cpp_aggregate_paren_init=201902 for -std=c++2a.
2019-11-30 Jan Hubicka <>
* c-attribs.c (handle_symver_attribute): New function
(c_common_attributes): Add symver.
2019-11-30 Richard Sandiford <>
* c-common.c (pointer_int_sum): Use verify_type_context to check
whether the target allows pointer arithmetic for the types involved.
(c_sizeof_or_alignof_type, c_alignof_expr): Use verify_type_context
to check whether the target allows sizeof and alignof operations
for the types involved.
2019-11-27 Jason Merrill <>
* c-cppbuiltin.c (c_cpp_builtins): Update __cpp_deduction_guides.
2019-11-26 Jakub Jelinek <>
PR c++/61414
* c-attribs.c (handle_mode_attribute): Add mode attribute to
2019-11-25 Joseph Myers <>
PR c/91985
* c-common.c (c_common_type_for_mode): Handle decimal
floating-point types being NULL_TREE.
* c-format.c (get_format_for_type_1): Handle specified types being
* c-lex.c (interpret_float): Give an error for decimal
floating-point constants when decimal floating-point not
2019-11-23 Jakub Jelinek <>
PR middle-end/83859
* c-attribs.c (append_access_attrs): Avoid buffer overflow. Avoid
memory leak. Use XNEWVEC macro. Use auto_diagnostic_group to
group warning with inform together.
(handle_access_attribute): Formatting fix.
2019-11-22 Jakub Jelinek <>
PR c/90677
* c-common.h (identifier_global_tag): Declare.
* c-format.c (get_pointer_to_named_type): Renamed to ...
(get_named_type): ... this. Use identifier_global_tag instead of
identifier_global_value, handle the return value being a TYPE_P.
(init_dynamic_diag_info): Adjust get_pointer_to_named_type callers
to call get_named_type instead. Formatting fixes.
Implement P1902R1, Missing feature-test macros 2017-2019.
* c-cppbuiltin.c (c_cpp_builtins): Bump __cpp_init_captures
and __cpp_generic_lambdas for -std=c++2a. Define
__cpp_designated_initializers, __cpp_constexpr_in_decltype and
__cpp_consteval for -std=c++2a. Remove a FIXME comment about
__cpp_concepts for -std=c++2a.
2019-11-22 Martin Sebor <>
PR middle-end/83859
* c-attribs.c (handle_access_attribute): New function.
(c_common_attribute_table): Add new attribute.
(get_argument_type): New function.
(append_access_attrs): New function.
(get_nonnull_operand): Rename...
(get_attribute_operand): this.
* c-common.c (get_nonnull_operand): Rename...
(get_attribute_operand): this.
2019-11-21 Joseph Myers <>
* c-attribs.c (handle_fallthrough_attribute): Use pedwarn instead
of warning.
2019-11-19 Joseph Myers <>
* c-common.c (attribute_fallthrough_p): In C, use pedwarn not
warning for standard attributes mixed with fallthrough attributes.
2019-11-15 Joseph Myers <>
* c-attribs.c (handle_fallthrough_attribute): Remove static.
* c-common.h (handle_fallthrough_attribute): Declare.
2019-11-15 Joseph Myers <>
* c-attribs.c (handle_deprecated_attribute): Remove static.
* c-common.h (handle_deprecated_attribute): Declare.
2019-11-14 Joseph Myers <>
* c-lex.c (lex_charconst): Make CPP_UTF8CHAR constants unsigned
char for C.
2019-11-14 Jakub Jelinek <>
* c-omp.c (c_omp_check_context_selector): Add nvidia to the list of
valid vendors.
* c-omp.c (c_omp_check_context_selector): Handle name lists
containing string literals. Don't diagnose atomic_default_mem_order
with multiple props.
2019-11-13 Joseph Myers <>
* c-cppbuiltin.c (builtin_define_float_constants): Also define
NORM_MAX constants. Update call to get_max_float.
(LAZY_HEX_FP_VALUES_CNT): Update value to include NORM_MAX
2019-11-13 Eric Botcazou <>
* c-ada-spec.c (get_underlying_decl): Do not look through typedefs.
(dump_forward_type): Do not generate a declaration for function types.
(dump_nested_type) <ARRAY_TYPE>: Do not generate a nested declaration
of the component type if it is declared in another file.
2019-11-12 Martin Liska <>
* c-opts.c (c_common_post_options):
2019-11-12 Maciej W. Rozycki <>
Frederik Harwath <>
* c-pragma.h (pragma_kind): Add PRAGMA_OACC_SERIAL enumeration
* c-pragma.c (oacc_pragmas): Add "serial" entry.
2019-11-08 Richard Sandiford <>
* c-common.h (gnu_vector_type_p): New function.
* c-common.c (c_build_vec_perm_expr): Require __builtin_shuffle
vectors to satisfy gnu_vector_type_p.
(c_build_vec_convert): Likewise __builtin_convertvector.
(convert_vector_to_array_for_subscript): Likewise when applying
implicit vector to array conversion.
(scalar_to_vector): Likewise when converting vector-scalar
operations to vector-vector operations.
2019-11-08 Joseph Myers <>
* c.opt (Wold-style-definition): Initialize to -1.
* c-opts.c (c_common_post_options): Set warn_old_style_definition
to flag_isoc2x if not set explicitly.
2019-11-07 Joseph Myers <>
* c-attribs.c (parse_tm_stmt_attr): Handle scoped attributes.
2019-11-05 Jason Merrill <>
* c-opts.c (c_common_post_options): -fconcepts-ts implies
2019-11-04 Kamlesh Kumar <>
* c-opts.c (c_common_post_options): Update
2019-11-02 Jakub Jelinek <>
* c-common.h (c_omp_get_context_selector): Remove.
* c-omp.c (c_omp_get_context_selector): Moved to omp-general.c
and renamed to omp_get_context_selector.
* c-omp.c (c_omp_mark_declare_variant): Use
PR c++/88335 - Implement P1073R3: Immediate functions
* c-common.h (enum rid): Add RID_CONSTEVAL.
* c-common.c (c_common_reswords): Add consteval.
2019-11-01 Martin Sebor <>
PR middle-end/91679
PR middle-end/91647
PR middle-end/91463
PR middle-end/92312
* c-pretty-print.c (direct_abstract_declarator): Print
bound in zero-length arrays.
* c.opt (-Wzero-length-bounds): New option.
2019-10-30 Nathan Sidwell <>
* c-cppbuiltin.c (c_cpp_builtins): Add 'L' suffix to feature
2019-10-28 Martin Sebor <>
PR c/66970
* c-common.c (c_common_nodes_and_builtins): Call c_define_builtins
even when only preprocessing.
* c-common.h (names_builtin_p): Declare new function.
* c-lex.c (init_c_lex): Set has_builtin.
(c_common_has_builtin): Define a new function.
* c-ppoutput.c (init_pp_output): Set has_builtin.
2019-10-24 Jakub Jelinek <>
* c-common.h (c_omp_context_selector_matches): Remove.
* c-omp.c (c_omp_context_selector_matches): Remove.
* c-attribs.c (c_common_attribute_table): Add
"omp declare target {host,nohost,block}" attributes.
2019-10-17 JeanHeyd Meneide <>
* c-lex.c (c_common_has_attribute): Update nodiscard value.
2019-10-14 Richard Sandiford <>
* c-common.h (user_facing_original_type_p): Declare.
* c-common.c: Include c-spellcheck.h.
(user_facing_original_type_p): New function.
2019-10-12 Jakub Jelinek <>
* c-common.h (c_omp_mark_declare_variant,
c_omp_context_selector_matches): Declare.
* c-omp.c: Include attribs.h, gimplify.h, cgraph.h, symbol-summary.h
and hsa-common.h.
(c_omp_get_context_selector): Support second argument NULL.
(c_omp_mark_declare_variant, c_omp_context_selector_matches): New
* c-attribs.c (c_common_attribute_table): Remove "omp declare variant"
attribute, add "omp declare variant base" and
"omp declare variant variant" attributes.
2019-10-11 Joseph Myers <>
* c.opt (Wc11-c2x-compat): Add CPP(cpp_warn_c11_c2x_compat)
2019-10-11 Joseph Myers <>
* c-common.c (c_common_reswords): Do not use D_EXT for _Decimal32,
_Decimal64 and _Decimal128.
2019-10-10 Joseph Myers <>
* c-cppbuiltin.c (c_cpp_builtins): Do not define macros for DFP
types if DFP not supported.
2019-10-10 Jakub Jelinek <>
* c-common.h (c_omp_check_context_selector,
c_omp_get_context_selector): Declare.
* c-omp.c (c_omp_declare_simd_clauses_to_numbers): Fix spelling
in diagnostic message.
(c_omp_check_context_selector, c_omp_get_context_selector): New
* c-attribs.c (c_common_attribute_table): Add "omp declare variant"
(handle_omp_declare_variant_attribute): New function.
2019-10-09 Martin Sebor <>
PR tree-optimization/90879
* c.opt (-Wstring-compare): New option.
2019-10-08 Andrew Sutton <>
Jason Merrill <>
Update the concepts implementation to conform to the C++20
specification, improve compile times, and generally clean up
the implementation.
* c-cppbuiltin.c (c_cpp_builtins): Use new feature test values for
concepts when -std=c++2a. Bump __cpp_concepts to 201907.
* c.opt: Add -Wconcepts-ts.
* c-opts.c (c_common_post_options): Warn when -fconcepts is used
with -std=c++2a. Disable warning for -fconcepts in C++20 mode.
(set_std_cxx2a): Enable concepts by default.
2019-10-08 Joseph Myers <>
* c-opts.c (c_common_post_options): Set
-fno-fp-int-builtin-inexact for C2X.
2019-10-05 Jakub Jelinek <>
PR c++/91369 - Implement P0784R7: constexpr new
* c-cppbuiltin.c (c_cpp_builtins): Predefine
__cpp_constexpr_dynamic_alloc=201907 for -std=c++2a.
2019-10-04 Joseph Myers <>
PR c/82752
* c-format.c (C_STD_VER): Handle C2x.
(C_STD_NAME): Likewise.
(strftime_flag_specs): Add 'O' modifier with 'p' flag.
(time_char_table): Use separate entry for 'B' and 'b', with 'O'
modifier allowed and 'p' flag.
* c-format.h (enum format_std_version): Add STD_C2X.
(struct format_char_info): Mention 'p' in comment on flags2.
2019-10-01 David Malcolm <>
* c-opts.c (c_diagnostic_finalizer): Temporarily clear prefix when
calling diagnostic_show_locus, rather than destroying it afterwards.
2019-10-01 Jakub Jelinek <>
PR c++/91925
* c-warn.c (check_alignment_of_packed_member): Ignore FIELD_DECLs
2019-10-01 Richard Sandiford <>
* c-pretty-print.c (pp_c_specifier_qualifier_list): If a vector type
has a type name, use it in preference to the __vector syntax.
2019-09-30 Richard Sandiford <>
* c-pretty-print.c (pp_c_parameter_type_list): Avoid printing
two spaces between a comma and "...".
2019-09-27 Jakub Jelinek <>
PR c++/88203
* c-common.h (c_omp_predefined_variable): Declare.
* c-omp.c (c_omp_predefined_variable): New function.
(c_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED
for predefined variables.
2019-09-27 Richard Sandiford <>
* c-common.h (build_function_call_vec): Take the original
function decl as an optional final parameter.
(check_builtin_function_arguments): Take the original function decl.
* c-common.c (check_builtin_function_arguments): Likewise.
Handle all built-in functions, not just BUILT_IN_NORMAL ones.
Use targetm.check_builtin_call to check BUILT_IN_MD functions.
2019-09-15 Jason Merrill <>
* c-warn.c (warn_logical_operator): Strip location wrappers. Don't
fold_for_warn in "|| mask" warning.
2019-09-10 Martin Liska <>
* c.opt: Use newly added WarnRemoved.
2019-09-09 Martin Liska <>
* c.opt: Update comment of removed
options that are preserved only for backward
2019-09-06 Martin Liska <>
PR c++/91125
* c-common.c: Remove definition of flag_use_repository.
* c-common.h: Likewise.
* c-opts.c (c_common_handle_option):
Do not handle OPT_frepo option.
* c.opt: Mark the option with Deprecated.
2019-09-04 Marek Polacek <>
* c.opt (fdeduce-init-list): Ignored.
2019-09-04 Prathamesh Kulkarni <>
PR c/78736
* c.opt (Wenum-conversion): New option.
2019-09-03 Jozef Lawrynowicz <>
* c-attribs.c (handle_section_attribute): Call the
handle_generic_attribute target hook after performing target
independent processing.
(handle_noinit_attribute): Likewise.
2019-09-03 Ian Lance Taylor <>
* c-cppbuiltin.c (builtin_define_with_hex_fp_value): Always expand
when using -fgo-dump-spec.
2019-09-02 Martin Liska <>
PR c++/91155
* c-common.c (fname_as_string): Use cxx_printable_name for
__PRETTY_FUNCTION__ same as was used before r265711.
2019-08-28 Marek Polacek <>
Implement P1152R4: Deprecating some uses of volatile.
PR c++/91361
* c-opts.c (c_common_post_options): Enable -Wvolatile by
default for C++2a, unless -Wno-deprecated.
* c.opt (Wvolatile): New warning.
2019-08-28 Marek Polacek <>
PR c++/91360 - Implement C++20 P1143R2: constinit.
* c-common.c (c_common_reswords): Add constinit and __constinit.
(keyword_is_decl_specifier): Handle RID_CONSTINIT.
* c-common.h (enum rid): Add RID_CONSTINIT, RID_FIRST_CXX20, and
(D_CXX20): Define.
* c-cppbuiltin.c (c_cpp_builtins): Define __cpp_constinit.
* c-format.c (cxx_keywords): Add "constinit".
* c.opt (Wc++2a-compat, Wc++20-compat): New options.
2019-08-27 Jakub Jelinek <>
PR c++/91415
* c-common.c (verify_tree): For LSHIFT_EXPR, RSHIFT_EXPR,
COMPONENT_REF and ARRAY_REF in cxx_dialect >= cxx17 mode handle it
like COMPOUND_EXPR rather than normal expression.
2019-08-23 Iain Sandoe <>
PR pch/61250
* c-lex.c (c_lex_with_flags): Don't call
c_common_no_more_pch () from here.
2019-08-23 Jakub Jelinek <>
PR middle-end/91283
* c-common.c (c_ts18661_flt_eval_method): Use flag_excess_precision
instead of flag_excess_precision_cmdline.
* c-cppbuiltin.c (c_cpp_flt_eval_method_iec_559): Likewise.
* c-opts.c (c_common_post_options): Likewise.
2019-08-22 Martin Sebor <>
PR middle-end/91490
* c-common.c (braced_list_to_string): Add argument and overload.
Handle flexible length arrays and unions.
2019-08-21 Eric Botcazou <>
* c-ada-spec.c (dump_ada_function_declaration): Be prepared for broken
function declarations where arguments are missing. Rename variables.
2019-08-15 Richard Biener <>
* c-common.c (c_stddef_cpp_builtins): When the GIMPLE FE is
enabled, define __SIZETYPE__.
2019-08-14 Christophe Lyon <>
* c-attribs.c (c_common_attribute_table): Add "noinit" entry. Add
exclusion with "section" attribute.
(attr_noinit_exclusions): New table.
(handle_noinit_attribute): New function.
2019-08-13 Richard Sandiford <>
PR middle-end/91421
* c-common.c (resolve_overloaded_builtin): Use
2019-08-13 Martin Sebor <>
PR c/80619
* c-format.c (printf_length_specs): Set FMT_LEN_w for "w".
(asm_fprintf_length_spec): Same.
* c-format.h (format_lengths): Add FMT_LEN_w.
2019-08-10 Jakub Jelinek <>
* c-pragma.h (enum pragma_omp_clause): Add
2019-08-07 Jakub Jelinek <>
* c-pragma.h (enum pragma_omp_clause): Add
equal to PRAGMA_OMP_CLAUSE_USE_DEVICE_PTR instead of being a separate
enumeration value.
2019-08-05 Marek Polacek <>
PR c++/91338 - Implement P1161R3: Deprecate a[b,c].
* c-opts.c (c_common_post_options): Enable -Wcomma-subscript by
default for C++2a, unless -Wno-deprecated.
* c.opt (Wcomma-subscript): New warning.
2019-07-20 Jakub Jelinek <>
* c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_LOOP.
(enum pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_BIND.
* c-pragma.c (omp_pragmas_simd): Add PRAGMA_OMP_LOOP entry.
* c-common.h (enum c_omp_clause_split): Add C_OMP_CLAUSE_SPLIT_LOOP.
* c-omp.c (c_omp_split_clauses): Add support for 4 new combined
constructs with the loop construct.
2019-07-13 Jakub Jelinek <>
PR c/91149
* c-omp.c (c_omp_split_clauses): Fix a pasto in
2019-07-12 Jakub Jelinek <>
* c-pragma.h (enum pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_ORDER.
* c-omp.c (c_omp_split_clauses): Handle splitting of OMP_CLAUSE_ORDER.
2019-07-09 Martin Sebor <>
PR c++/61339
* c-opts.c (handle_deferred_opts): Change class-key of PODs to struct
and others to class.
* c-pretty-print.h: Same.
2019-07-09 Martin Sebor <>
PR c++/61339
* c-format.c (check_argument_type): Change class-key from class to
struct and vice versa to match convention and avoid -Wclass-is-pod
and -Wstruct-no-pod.
* c-pretty-print.h: Same.
2019-07-03 Martin Liska <>
* c-common.c (try_to_locate_new_include_insertion_point): Remove
dead assignemts.
2019-07-03 Jakub Jelinek <>
* c-omp.c (c_omp_split_clauses): Put OMP_CLAUSE_REDUCTION_INSCAN
clauses on OMP_FOR rather than OMP_PARALLEL when OMP_FOR is combined
2019-07-02 qing zhao <>
PR preprocessor/90581
* c-opts.c (c_common_handle_option): Handle -fmax-include-depth.
* c.opt: Add new option -fmax-include-depth.
2019-06-26 Jason Merrill <>
PR c++/55442 - memory-hog with highly recursive constexpr.
* c.opt (fconstexpr-loop-limit): New.
2019-06-25 Jakub Jelinek <>
PR sanitizer/90954
* c-omp.c (c_finish_omp_atomic): Allow tree_invariant_p in addition
to SAVE_EXPR in first operand of a COMPOUND_EXPR.
2019-06-25 Jozef Lawrynowicz <>
* c-common.c (c_common_nodes_and_builtins): Define
alternate "__intN__" name for "__intN" types.
2019-06-24 Jan Hubicka <>
* c-common.c (braced_lists_to_strings): Check that
type is array or integer prior checking string flag.
2019-06-21 Matthew Beliveau <>
PR c++/90875 - added -Wswitch-outside-range option
* c.opt (Wswitch-outside-range): Added new option.
* c-warn.c (c_do_switch_warnings): Use OPT_Wswitch-outside-range.
2019-06-21 Marek Polacek <>
PR c++/90953 - ICE with -Wmissing-format-attribute.
* c-common.c (check_function_arguments_recurse): Use
(check_missing_format_attribute): Likewise.
2019-06-19 Marek Polacek <>
PR c++/60364 - noreturn after first decl not diagnosed.
* c-attribs.c (handle_noreturn_attribute): No longer static.
* c-common.h (handle_noreturn_attribute, attr_noreturn_exclusions):
* c-format.c (check_function_format): Use get_attribute_name.
2019-06-19 Martin Sebor <>
PR translation/90156
* c-format.c (function_format_info::format_type): Adjust type.
(function_format_info::is_raw): New member.
(decode_format_type): Adjust signature. Handle "raw" diag attributes.
(decode_format_attr): Adjust call to decode_format_type.
Avoid a redundant call to convert_format_name_to_system_name.
Avoid abbreviating the word "arguments" in a diagnostic.
(format_warning_substr): New function.
(avoid_dollar_number): Quote dollar sign in a diagnostic.
(finish_dollar_format_checking): Same.
(check_format_info): Same.
(struct baltoks_t): New.
(c_opers, c_keywords, cxx_keywords, badwords, contrs): New arrays.
(maybe_diag_unbalanced_tokens, check_tokens, check_plain): New
(check_format_info_main): Call check_plain. Use baltoks_t. Call
(handle_format_attribute): Spell out the word "arguments" in
a diagnostic.
2019-06-11 Matthew Beliveau <>
PR c++/90449 - add -Winaccessible-base option.
* c.opt (Winaccessible-base): New option.
2019-06-10 Jakub Jelinek <>
* c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_SCAN.
* c-pragma.c (omp_pragmas_simd): Add #pragma omp scan.
* c-omp.c (c_omp_split_clauses): Diagnose inscan reductions on
combined/composite constructs where it is not allowed. Copy over
2019-06-05 Martin Sebor <>
* c-attribs.c (handle_mode_attribute): Adjust quoting and hyphenation.
(handle_alias_ifunc_attribute): Same.
(handle_copy_attribute): Same.
(handle_weakref_attribute): Same.
(handle_nonnull_attribute): Same.
* c-warn.c (warn_for_sign_compare): Same.
(warn_for_restrict): Same.
* c.opt: Same.
2019-06-05 Martin Sebor <>
* c-pragma.c (handle_pragma_weak): Adjust quoting in a diagnostic.
* c.opt (-Wformat-diag): Remove a spurious period.
2019-05-29 Jakub Jelinek <>
PR c/90628
* c-common.c (check_builtin_function_arguments)
<case BUILTIN_*_OVERFLOW>: Diagnose pointer to const qualified integer
as last argument.
2019-05-23 Eric Botcazou <>
* c-ada-spec.c (compare_node): Compare the DECL_UIDs as a last resort.
2019-05-22 Martin Liska <>
PR lto/90500
* c-attribs.c (handle_copy_attribute): Do not copy
target_clones attribute.
2019-05-21 Eric Botcazou <>
* c-ada-spec.h (enum cpp_operation): Add IS_ASSIGNMENT_OPERATOR.
* c-ada-spec.c (print_assignment_operator): New function.
(dump_ada_declaration) <FUNCTION_DECL>: Call it do dump explicit copy
assignment operators declared as methods and filter out the others.
2019-05-17 Thomas Schwinge <>
PR c/89433
* c-attribs.c (c_common_attribute_table): Set min_len to -1 for
"omp declare target".
2019-05-16 Martin Sebor <>
* c-attribs.c (handle_no_sanitize_attribute): Quote identifiers,
keywords, operators, and types in diagnostics.
(handle_scalar_storage_order_attribute): Same.
(handle_mode_attribute): Same.
(handle_visibility_attribute): Same.
(handle_assume_aligned_attribute): Same.
(handle_no_split_stack_attribute): Same.
* c-common.c (shorten_compare): Same.
(c_common_truthvalue_conversion): Same.
(cb_get_source_date_epoch): Same.
* c-lex.c (cb_def_pragma): Quote keywords, operators, and types
in diagnostics.
(interpret_float): Same.
* c-omp.c (c_finish_omp_for): Same.
* c-opts.c (c_common_post_options): Same.
* c-pch.c (c_common_pch_pragma): Same.
* c-pragma.c (pop_alignment): Same.
(handle_pragma_pack): Same.
(apply_pragma_weak): Same.
(handle_pragma_weak): Same.
(handle_pragma_scalar_storage_order): Same.
(handle_pragma_redefine_extname): Same.
(add_to_renaming_pragma_list): Same.
(maybe_apply_renaming_pragma): Same.
(push_visibility): Same.
(handle_pragma_visibility): Same.
(handle_pragma_optimize): Same.
(handle_pragma_message): Same.
* c-warn.c (warn_for_omitted_condop): Same.
(lvalue_error): Same.
2019-05-15 Richard Biener <>
PR c/90474
* c-common.c (c_common_mark_addressable_vec): Also mark
a COMPOUND_LITERAL_EXPR_DECL addressable similar to
2019-05-06 Nathan Sidwell <>
* c-opts.c (handle_defered_opts): Rename struct deps to struc mkdeps.
2019-04-30 Nathan Sidwell <>
* c-common.c (c_common_init_ts): Use MARK_TS_EXP. Mark SIZEOF_EXPR.
2019-04-30 Martin Liska <>
* c-pragma.c (handle_pragma_diagnostic): Provide hints
for unknown options.
2019-04-26 Richard Sandiford <>
* c-warn.c (strict_aliasing_warning): Apply COMPLETE_TYPE_P to
the pointer target rather than the pointer itself.
2019-04-19 Jakub Jelinek <>
PR c/89888
* c-common.h (c_add_case_label): Remove orig_type and outside_range_p
(c_do_switch_warnings): Remove outside_range_p argument.
* c-common.c (check_case_bounds): Removed.
(c_add_case_label): Remove orig_type and outside_range_p arguments.
Don't call check_case_bounds. Fold low_value as well as high_value.
* c-warn.c (c_do_switch_warnings): Remove outside_range_p argument.
Check for case labels outside of range of original type here and
adjust them.
2019-04-12 Jakub Jelinek <>
PR translation/90041
* c.opt (-fhandle-exceptions): Use %< and %> around option names
in the Warn diagnostics.
PR c/89946
* c-attribs.c (handle_patchable_function_entry_attribute): Add
function comment. Warn if arguments of the attribute are not positive
integer constants.
2019-04-09 Eric Botcazou <>
* c-ada-spec.c (print_destructor): Deal with deleting destructors.
(dump_ada_declaration) <FUNCTION_DECL>: Likewise.
2019-04-07 Eric Botcazou <>
* c-ada-spec.c (is_float128): New predicate extracted from...
(dump_ada_node) <COMPLEX_TYPE>: Use it to recognize __cfloat128.
<REAL_TYPE>: Call it.
2019-04-05 David Malcolm <>
PR c/89985
* c-warn.c (check_address_or_pointer_of_packed_member): Add
auto_diagnostic_group. Guard inform calls by result of
warning_at call.
2019-04-05 Marek Polacek <>
PR c++/89973 - -Waddress-of-packed-member ICE with invalid conversion.
* c-warn.c (check_address_or_pointer_of_packed_member): Check the type
of RHS.
2019-04-03 Jason Merrill <>
PR c++/86586 - -fcompare-debug=-Wsign-compare.
* c-warn.c (warn_for_sign_compare): Call fold_for_warn.
2019-04-01 Martin Sebor <>
PR c/89685
* c-attribs.c (handle_copy_attribute): Handle references and
non-constant expressions.
2019-03-22 Jakub Jelinek <>
PR c++/87481
* c.opt (-fconstexpr-ops-limit=): New option.
2019-03-21 Jakub Jelinek <>
* c-common.c (per_file_includes_t): Use false as Lazy in hash_set
template param.
2019-03-19 Martin Sebor <>
PR tree-optimization/89688
* c-common.c (braced_list_to_string): Make static.
(braced_lists_to_strings): Define new function.
* c-common.h (braced_list_to_string): Remove.
(braced_lists_to_strings): Declare.
2019-03-12 Martin Liska <>
* c-opts.c (c_common_handle_option): Wrap option with %< and %>.
2019-03-11 Martin Liska <>
* c-opts.c (c_common_post_options): Wrap apostrophes
in gcc internal format with %'.
2019-03-11 Martin Liska <>
* c-attribs.c (handle_nocf_check_attribute): Wrap an option name
in a string format message and fix GNU coding style.
* c-common.c (vector_types_convertible_p): Likewise.
(c_build_vec_perm_expr): Likewise.
* c-indentation.c (get_visual_column): Likewise.
* c-opts.c (c_common_handle_option): Likewise.
(c_common_post_options): Likewise.
(sanitize_cpp_opts): Likewise.
* c-pch.c (c_common_pch_pragma): Likewise.
* c-pragma.c (handle_pragma_pack): Likewise.
2019-03-08 Jakub Jelinek <>
PR tree-optimization/89550
* c-common.c (c_common_truthvalue_conversion): Only set
TREE_NO_WARNING if warning_at returned true.
* c-warn.c (overflow_warning, warn_logical_operator): Likewise.
2019-02-25 Sandra Loosemore <>
Martin Sebor <>
* c.opt (Wmissing-attributes): Clean up doc string.
2019-02-25 Jakub Jelinek <>
PR c/89495
* c-format.c (maybe_read_dollar_number): Compute nargnum in
HOST_WIDE_INT type to avoid overflows and change overflow_flag
2019-02-22 Richard Biener <>
* c-pch.c (no_checksum): Remove.
(pch_init): Remove assertion that executable_checksum is not
all zero.
(c_common_valid_pch): Likewise.
2019-02-18 Martin Sebor <>
PR middle-end/89294
* c-common.c (invalid_array_size_error): Handle cst_size_not_constant.
2019-02-16 David Malcolm <>
PR c++/88680
* c-common.c (shorten_compare): Call fold_for_warn on op0 when
implementing -Wtype-limits.
2019-02-11 Martin Sebor <>
PR c++/87996
* c-common.c (invalid_array_size_error): New function.
(valid_array_size_p): Call it. Handle size as well as type.
* c-common.h (valid_constant_size_p): New function.
(enum cst_size_error): New type.
2019-01-31 David Malcolm <>
PR c/89122
* (get_stdlib_header_for_name): Add
{FLT|DBL|LDBL}_{MAX|MIN} to "hints" array.
2019-01-31 Jakub Jelinek <>
PR libstdc++/88170
* c-pretty-print.c (pp_c_enumeration_constant): Print always as
a C cast in pp_c_flag_gnu_v3 mode.
2019-01-29 Jakub Jelinek <>
PR c/86125
* c-common.c (c_common_nodes_and_builtins): Build type variants for
builtin_structptr_types types even for C.
2019-01-28 Bernd Edlinger <>
* c-warn.c (check_address_or_pointer_of_packed_member): Handle the case
when rhs is of array type correctly. Fix handling of nested structures.
Fix handling of indirect_ref together with nop_expr and/or addr_expr.
(check_and_warn_address_or_pointer_of_packed_member): Fix handling of
type casts within nested compound expressions.
2019-01-22 Jakub Jelinek <>
PR middle-end/88968
* c-omp.c (c_finish_omp_atomic): For bitfield atomics, update type
variable after using BIT_FIELD_REF.
2019-01-18 H.J. Lu <>
PR c/51628
PR c/88664
* c-common.h (warn_for_address_or_pointer_of_packed_member):
Remove the boolean argument.
* c-warn.c (check_address_of_packed_member): Renamed to ...
(check_address_or_pointer_of_packed_member): This. Also
warn pointer conversion.
(check_and_warn_address_of_packed_member): Renamed to ...
(check_and_warn_address_or_pointer_of_packed_member): This.
Also warn pointer conversion.
(warn_for_address_or_pointer_of_packed_member): Remove the
boolean argument. Don't check pointer conversion here.
2019-01-15 Richard Sandiford <>
PR inline-asm/52813
* c.opt (Wdeprecated): Move documentation and variable to common.opt.
2019-01-14 Jakub Jelinek <>
* c-cppbuiltin.c (c_cpp_builtin): Define __cpp_guaranteed_copy_elision
and __cpp_nontype_template_parameter_auto. Add a comment that
__cpp_template_auto is deprecated.
2019-01-14 Tom Honermann <>
Implement P0482R5, char8_t: A type for UTF-8 characters and strings
* c-common.c (c_common_reswords): Add char8_t.
(fix_string_type): Use char8_t for the type of u8 string literals.
(c_common_get_alias_set): char8_t doesn't alias.
(c_common_nodes_and_builtins): Define char8_t as a builtin type in
(c_stddef_cpp_builtins): Add __CHAR8_TYPE__.
(keyword_begins_type_specifier): Add RID_CHAR8.
* c-common.h (rid): Add RID_CHAR8.
(c_tree_index): Add CTI_CHAR8_TYPE and CTI_CHAR8_ARRAY_TYPE.
Define char8_type_node and char8_array_type_node.
* c-cppbuiltin.c (cpp_atomic_builtins): Predefine
(c_cpp_builtins): Predefine __cpp_char8_t.
* c-lex.c (lex_string): Use char8_array_type_node as the type of
(lex_charconst): Use char8_type_node as the type of CPP_UTF8CHAR.
* c-opts.c: If not otherwise specified, enable -fchar8_t when
targeting C++2a.
* c.opt: Add the -fchar8_t command line option.
2019-01-14 Martin Sebor <>
PR target/88638
* c-attribs.c (positional_argument): Call valid_format_string_type_p
and issue errors if it fails.
* c-common.h (valid_format_string_type_p): Declare.
* c-format.c (valid_stringptr_type_p): Rename...
(valid_format_string_type_p): this and make extern.
(handle_format_arg_attribute): Adjust to new name.
(check_format_string): Same.
2019-01-13 H.J. Lu <>
* c-warn.c (warn_for_address_or_pointer_of_packed_member):
Replace "may may" with "may" in warning message.
2019-01-07 Jakub Jelinek <>
PR c++/85052
* c-common.h (enum rid): Add RID_BUILTIN_CONVERTVECTOR.
(c_build_vec_convert): Declare.
* c-common.c (c_build_vec_convert): New function.
2019-01-04 Martin Sebor <>
PR c/88546
* c-attribs.c (handle_copy_attribute): Avoid copying attribute leaf.
Handle C++ empty throw specification and C11 _Noreturn.
(has_attribute): Also handle C11 _Noreturn.
2019-01-04 Martin Sebor <>
PR c/88363
* c-attribs.c (positional_argument): Also accept enumerated types.
2019-01-01 Jakub Jelinek <>
Update copyright years.
2018-12-20 H.J. Lu <>
PR c/51628
* c-common.h (warn_for_address_or_pointer_of_packed_member): New.
* c-warn.c (check_alignment_of_packed_member): New function.
(check_address_of_packed_member): Likewise.
(check_and_warn_address_of_packed_member): Likewise.
(warn_for_address_or_pointer_of_packed_member): Likewise.
* c.opt: Add -Wno-address-of-packed-member.
2018-12-20 David Malcolm <>
PR c++/87504
* c-warn.c (get_outermost_macro_expansion): New function.
(spelled_the_same_p): Use it to unwind the macro expansions, and
compare the outermost macro in each nested expansion, rather than
the innermost.
2018-12-19 David Malcolm <>
PR c++/87504
* c-common.h (warn_tautological_cmp): Convert 1st param from
location_t to const op_location_t &.
* c-warn.c (find_array_ref_with_const_idx_r): Call fold_for_warn
when testing for INTEGER_CST.
(warn_tautological_bitwise_comparison): Convert 1st param from
location_t to const op_location_t &; use it to build a
binary_op_rich_location, and use this.
(spelled_the_same_p): New function.
(warn_tautological_cmp): Convert 1st param from location_t to
const op_location_t &. Warn for macro expansions if
spelled_the_same_p. Use binary_op_rich_location.
2018-12-19 David Malcolm <>
PR c++/43064
PR c++/43486
* c-common.c (unsafe_conversion_p): Fold any location wrapper.
(verify_tree): Handle location wrappers.
(c_common_truthvalue_conversion): Strip any location wrapper.
(fold_offsetof): Strip any location wrapper.
(complete_array_type): Likewise for initial_value.
(convert_vector_to_array_for_subscript): Call fold_for_warn on the
index before checking for INTEGER_CST.
* c-pretty-print.c (c_pretty_printer::primary_expression): Don't
print parentheses around location wrappers.
* c-warn.c (warn_logical_operator): Call fold_for_warn on op_right
before checking for INTEGER_CST.
(warn_tautological_bitwise_comparison): Call
tree_strip_any_location_wrapper on lhs, rhs, and bitop's operand
before checking for INTEGER_CST.
(readonly_error): Strip any location wrapper.
(warn_array_subscript_with_type_char): Strip location wrappers
before checking for INTEGER_CST. Use the location of the index if
2018-12-06 Jason Merrill <>
PR c++/88136 - -Wdeprecated-copy false positives
* c.opt (Wdeprecated-copy-dtor): New.
(Wdeprecated-copy): Move to -Wextra.
2018-11-29 Martin Sebor <>
PR c/88172
PR testsuite/88208
* c-attribs.c (common_handle_aligned_attribute): Silently avoid setting
alignments to values less than the target requires.
(has_attribute): For attribute aligned consider both the attribute
and the alignment bits.
* c-common.c (c_init_attributes): Optionally issue a warning for
zero alignment.
2018-11-28 Martin Sebor <>
PR c/88065
PR c/87297
* c-warn.c (sizeof_pointer_memaccess_warning): Bail if source
or destination is an error.
2018-11-28 Jakub Jelinek <>
PR c++/88215
* c-ubsan.c: Include langhooks.h.
(ubsan_instrument_division): Change gcc_assert that main variants
of op0 and op1 types are equal to gcc_checking_assert that the
main variants are compatible types.
2018-11-27 Eric Botcazou <>
* c-ada-spec.c: Include stringpool.h.
(has_static_fields): Return false for incomplete types.
(is_tagged_type): Likewise.
(has_nontrivial_methods): Likewise.
(dump_ada_node) <INTEGER_TYPE>: Deal specifically with __int128.
(struct overloaded_name_hash): New structure.
(struct overloaded_name_hasher): Likewise.
(overloaded_names): New global variable.
(init_overloaded_names): New static function.
(overloaded_name_p): New predicate.
(dump_ada_declaration) <TYPE_DECL>: Tidy up and set TREE_VISITED
on the TYPE_STUB_DECL of the original type of a typedef, if any.
<FUNCTION_DECL>: Bail out for an unsupported overloaded name.
Remove always-true condition and dump forward types.
(dump_ada_specs): Delete overloaded_names.
2018-11-20 Martin Sebor <>
* c-attribs.c (type_for_vector_size): New function.
(type_valid_for_vector_size): Same.
(handle_vector_size_attribute): Move code to the functions above
and call them.
(validate_attribute, has_attribute): New functions.
* c-common.h (has_attribute): Declare.
* c-common.c (c_common_resword): Same.
2018-11-16 Jason Merrill <>
* c-lex.c (c_common_has_attribute): Handle likely/unlikely.
* c-attribs.c (attr_cold_hot_exclusions): Make public.
2018-11-16 Jakub Jelinek <>
PR middle-end/87854
* c-common.c (fix_string_type): Reject string literals larger than
TYPE_MAX_VALUE (ssizetype) bytes.
2018-11-15 Martin Sebor <>
PR c++/87541
PR c++/87542
* c-attribs.c (positional_argument): New function.
(handle_alloc_size_attribute): Use it and simplify.
(handle_alloc_align_attribute): Same.
(handle_assume_aligned_attribute): Same.
(handle_nonnull_attribute): Same.
* c-common.c (check_function_arguments): Pass fntype to
* c-common.h (check_function_format): Add an argument.
(PosArgFlags, positional_argument): Declare new type and function.
* c-format.c (decode_format_attr): Add arguments.
(check_format_string, get_constant): Same.
(convert_format_name_to_system_name): Adjust.
2018-11-15 David Malcolm <>
PR other/19165
* c-opts.c (c_diagnostic_finalizer): Add diagnostic_t param.
2018-11-14 Jakub Jelinek <>
P1236R1 - Signed integers are two's complement
* c-warn.c (maybe_warn_shift_overflow): Don't warn for c++2a.
* c-ubsan.c (ubsan_instrument_shift): Make signed shifts
with in-range second operand well defined for -std=c++2a.
PR other/88007
* c-common.c (parse_optimize_options): Allocate option string from
opts_obstack rather than as GC memory. Move the allocation after
warning for invalid option.
2018-11-13 David Malcolm <>
* c-common.c (c_get_substring_location): Update for renaming of
get_source_location_for_substring to get_location_within_string.
* c-lex.c: Replace "source_location" with "location_t".
* c-opts.c: Likewise.
* c-ppoutput.c: Likewise.
2018-11-13 Martin Sebor <>
PR middle-end/81824
* c-attribs.c (handle_copy_attribute): Exclude inlining attributes.
(handle_tls_model_attribute): Improve diagnostics.
2018-11-12 Jason Merrill <>
* c-cppbuiltin.c (c_cpp_builtins): Define
* c-cppbuiltin.c (c_cpp_builtins): Change __cpp_explicit_bool to
2018-11-09 Martin Sebor <>
PR middle-end/81824
* c-attribs.c (handle_copy_attribute): New function.
2018-11-09 Martin Sebor <>
PR c/87795
* c-common.c (check_user_alignment): Use MAX_OFILE_ALIGNMENT.
2018-11-08 Jakub Jelinek <>
* c-common.h (c_finish_omp_taskgroup): Add CLAUSES argument.
(c_finish_omp_atomic): Replace bool SEQ_CST argument with
enum omp_memory_order MEMORY_ORDER.
(c_finish_omp_flush): Add MO argument.
(c_omp_depend_t_p, c_finish_omp_depobj): Declare.
(c_finish_omp_for): Add FINAL_P argument.
* c-omp.c: Include memmodel.h.
(c_finish_omp_taskgroup): Add CLAUSES argument. Set
(c_finish_omp_atomic): Replace bool SEQ_CST argument with
instead of OMP_ATOMIC_SEQ_CST.
(c_omp_depend_t_p, c_finish_omp_depobj): New functions.
(c_finish_omp_flush): Add MO argument, if not MEMMODEL_LAST, emit
__atomic_thread_fence call with the given value.
(check_omp_for_incr_expr): Formatting fixes.
(c_finish_omp_for): Add FINAL_P argument. Allow NE_EXPR
even in OpenMP loops, diagnose if NE_EXPR and incr expression
is not constant expression 1 or -1. Transform NE_EXPR loops
with iterators pointers to VLA into LT_EXPR or GT_EXPR loops.
(c_omp_check_loop_iv_r): Look for orig decl of C++ range for
loops too.
(c_omp_split_clauses): Add support for combined
#pragma omp parallel master and
#pragma omp {,parallel }master taskloop{, simd} constructs.
(c_omp_predetermined_sharing): Don't return
OMP_CLAUSE_DEFAULT_SHARED for const qualified decls.
* c-pragma.c (omp_pragmas): Add PRAGMA_OMP_DEPOBJ and
* c-pragma.h (enum pragma_kind): Likewise.
(enum pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_NONTEMPORAL
2018-11-08 David Malcolm <>
* c-format.c (gcc_dump_printf_char_table): Add entry for %f.
2018-11-08 David Malcolm <>
* c-format.c (local_cgraph_node_ptr_node): New variable.
(gcc_dump_printf_char_table): Add entry for %C.
(get_pointer_to_named_type): New function, taken from the handling
code for "gimple *" from...
(init_dynamic_diag_info): Add handling for
"cgraph_node *".
* c-format.h (T_CGRAPH_NODE): New.
2018-10-19 Jason Merrill <>
* c-cppbuiltin.c (c_cpp_builtins): Add
2018-10-31 Nathan Sidwell <>
* c-opts.c (c_finish_options): Force command line macro
location. Refactor to avoid repeating main debug hook.
(push_command_line_include): Clarify comment.
* c-opts.c (c_finish_options): Adjust cpp_force_token_locations call.
2018-10-30 Martin Sebor <>
PR middle-end/87041
* c-format.c (check_format_types): Avoid diagnosing null pointer
arguments to printf-family of functions.
2018-10-30 Marek Polacek <>
Implement P0892R2, explicit(bool).
* c-cppbuiltin.c (c_cpp_builtins): Define __cpp_explicit_bool.
2018-10-29 David Malcolm <>
* name-hint.h (name_hint::take_deferred): New member function.
2018-10-29 David Malcolm <>
PR c++/56856
* c-common.c (check_function_sentinel): Call fold_for_warn on the
(check_function_restrict): Rename param "argarray" to
"unfolded_argarray", and make a copy named "argarray", calling
fold_for_warn on each argument.
(check_function_arguments): Add note about responsibility for
folding the arguments.
2018-10-17 Joseph Myers <>
* c-common.c (flag_isoc2x): New variable.
* c-common.h (clk_c): Update comment to reference C2X.
(flag_isoc99, flag_isoc11): Update comments to reference future
standard versions in general.
(flag_isoc2x): Declare.
* c-opts.c (set_std_c2x): New function.
(c_common_handle_option): Handle -std=c2x and -std=gnu2x.
(set_std_c89, set_std_c99, set_std_c11, set_std_c17): Set
flag_isoc2x to 0.
* c.opt (Wc11-c2x-compat, std=c2x, std=gnu2x): New options.
2018-10-17 Joseph Myers <>
* c.opt (std=c17, std=c18, std=gnu17, std=gnu18, std=iso9899:2017)
(std=iso9899:2018): Document C17 as published in 2018.
2018-10-12 Christophe Lyon <>
PR c++/87364
* c-pretty-print.c (c_pretty_printer::constant): Fix typo.
2018-10-11 Will Wray <>
PR c++/87364
* c-pretty-print.h (pp_c_type_cast): Prototype.
(pp_c_integer_constant): Likewise.
* c-pretty-print.c (pp_c_type_cast): No longer static.
(pp_c_integer_constant): Likewise.
(pp_c_enumeration_constant): Fix loop termination when finding
name of constant. No longer returns a value. Call
(c_pretty_printer::constant): Update for changes to
2018-10-11 Jakub Jelinek <>
* c-lex.c (c_common_has_attribute): Return 201803 instead of 20180312
for no_unique_address.
2018-10-09 David Malcolm <>
* c-common.c (c_option_controlling_cpp_error): Rename to...
(c_option_controlling_cpp_diagnostic): ...this, and convert
"reason" from int to enum.
(c_cpp_error): Rename to...
(c_cpp_diagnostic): ...this, converting level and reason to enums.
* c-common.h (c_cpp_error): Rename to...
(c_cpp_diagnostic): ...this, converting level and reason to enums.
* c-opts.c (c_common_init_options): Update for renaming.
2018-10-08 Richard Sandiford <>
PR c/87286
* c-common.c (vector_types_compatible_elements_p): Use
INTEGRAL_TYPE_P instead of checking only for INTEGER_TYPE.
2018-10-04 Vinay Kumar <>
* c-attribs.c (get_priority): Add a warning flag warn_prio_ctor_dtor
to generate constructor destructor priority warning.
* c.opt (-Wprio-ctor-dtor): New option.
2018-10-01 Jason Merrill <>
* c-lex.c (c_common_has_attribute): Add no_unique_address.
2018-10-01 Eric Botcazou <>
* c-ada-spec.c (get_underlying_decl): Get to the main type variant.
(dump_ada_node): Add const keyword.
2018-09-25 Martin Liska <>
* c-common.c (c_common_truthvalue_conversion):
Remove Pascal from documentation.
2018-09-21 Eric Botcazou <>
* c-ada-spec.c: Include diagnostic.h.
(dump_ada_declaration) <RECORD_TYPE>: Issue a warning on packed layout.
2018-09-19 Marek Polacek <>
* c.opt (Wclass-conversion): New.
2018-09-17 David Malcolm <>
* c-format.c (range_label_for_format_type_mismatch::get_text):
Update for new param.
2018-09-17 David Malcolm <>
* c-format.c (format_warning_at_char): Update for introduction of
(format_type_warning): Likewise.
2018-09-17 Martin Jambor <>
PR c/63886
* c.opt (Wabsolute-value): New.
2018-09-06 Bernd Edlinger <>
* c-common.c (complete_flexible_array_elts): New helper function.
* c-common.h (complete_flexible_array_elts): Declare.
2018-09-02 Bernd Edlinger <>
* c-common.c (braced_list_to_string): Remove eval parameter.
Add some more checks. Always create zero-terminated STRING_CST.
* c-common.h (braced_list_to_string): Adjust prototype.
2018-08-27 David Malcolm <>
PR 87091
* c-common.c (c_cpp_error): Update for conversion of show_caret_p
to a tri-state.
(maybe_suggest_missing_token_insertion): Likewise.
(maybe_add_include_fixit): Add param "override_location". If set,
and source-printing is enabled, then override the rich_location's
primary location with that of the insertion point for the fix-it
hint, marking it with SHOW_LINES_WITHOUT_RANGE.
* c-common.h (extern void maybe_add_include_fixit): Add bool
* c-format.c (selftest::test_type_mismatch_range_labels): Update
for conversion of show_caret_p to a tri-state.
* c-warn.c (warn_for_restrict): Likewise.
(suggest_missing_header::~suggest_missing_header): Update call to
maybe_add_include_fixit to suggest overriding the location, as it
is for a note.
2018-08-27 Martin Liska <>
* c-common.c (check_function_restrict): Use new function
fndecl_built_in_p and remove check for FUNCTION_DECL if
(check_builtin_function_arguments): Likewise.
(reject_gcc_builtin): Likewise.
* c-warn.c (sizeof_pointer_memaccess_warning): Likewise.
2018-08-26 Marek Polacek <>
PR c++/87029, Implement -Wredundant-move.
* c.opt (Wredundant-move): New option.
2018-08-21 Marek Polacek <>
PR c++/86981, Implement -Wpessimizing-move.
* c.opt (Wpessimizing-move): New option.
2018-08-20 David Malcolm <>
PR other/84889
* c-attribs.c (common_handle_aligned_attribute): Add
auto_diagnostic_group instance.
* c-indentation.c (warn_for_misleading_indentation): Likewise.
* c-opts.c (c_common_post_options): Likewise.
* c-warn.c (warn_logical_not_parentheses): Likewise.
(warn_duplicated_cond_add_or_warn): Likewise.
(warn_for_multistatement_macros): Likewise.
2018-08-20 Nathan Sidwell <>
* c-ada-spec.c (macro_length, dump_ada_macros): Adjust macro parm
2018-08-17 Nathan Sidwell <>
* c-cppbuiltin.c (struct lazy_hex_fp_value_struct): Remove macro
(laxy_hex_fp_value_count): Make unsigned.
(lazy_hex_fp_value): Provided with macro & lazy number. Directly
manipulate the macro.
(builtin_defin_with_hex_fp_value): Adjust callback name, use
2018-08-17 David Malcolm <>
* c-format.c (enum format_type): Add gcc_dump_printf_format_type.
(gcc_dump_printf_length_specs): New.
(gcc_dump_printf_flag_pairs): New.
(gcc_dump_printf_flag_specs): New.
(gcc_dump_printf_char_table): New.
(format_types_orig): Add entry for "gcc_dump_printf".
(init_dynamic_diag_info): Set up length_char_specs and
conversion_specs for gcc_dump_printf_format_type.
(handle_format_attribute): Handle gcc_dump_printf_format_type.
2018-08-17 Nathan Sidwell <>
* c-ada-spec.c (macro_length, dump_ada_macros): Constify.
* c-ada-spec.c: Don't #include "cpp-id-data.h"
* c-cppbuiltin.c: Likewise.
2018-08-17 Martin Liska <>
* c.opt: Remove Warn, Init and Report for options with
Ignore/Deprecated flag. Warning is done automatically for
Deprecated flags.
2018-08-16 David Malcolm <>
PR c++/70693
* c-common.c (selftest::c_family_tests): Call
* c-common.h (selftest::c_indentation_c_tests): New decl.
* c-indentation.c: Include "selftest.h".
(next_tab_stop): Add "tab_width" param, rather than accessing
(get_visual_column): Likewise. Clarify comment. Bulletproof
against reading past the end of the line.
(get_first_nws_vis_column): Add "tab_width" param.
(detect_intervening_unindent): Likewise.
(should_warn_for_misleading_indentation): Read tab width from
cpp_opts and pass around.
(selftest::test_next_tab_stop): New test.
(selftest::assert_get_visual_column_succeeds): New function.
(selftest::assert_get_visual_column_fails): New function.
(selftest::test_get_visual_column): New test.
(selftest::c_indentation_c_tests): New function.
2018-08-16 Nathan Sidwell <>
* c-ada-spec.c (count_ada_macro): Use cpp_user_macro_p.
(store_ada_macro): Likewise.
* c-ppoutput.c (cb_used_define, dump_macro): Likewise.
* (should-suggest_as_macro_p): Likewise,
2018-08-15 David Malcolm <>
* c-format.c: Include "selftest-diagnostic.h" and
(format_warning_at_char): Pass NULL for new label params of
(class indirection_suffix): New class.
(class range_label_for_format_type_mismatch): New class.
(format_type_warning): Move logic for generating "*" suffix to
class indirection_suffix. Create "fmt_label" and "param_label"
to show their types, and pass them to the
format_warning_at_substring calls.
(selftest::test_type_mismatch_range_labels): New test.
(selftest::c_format_c_tests): Call it.
2018-08-13 Martin Sebor <>
PR tree-optimization/71625
* c-common.c (braced_list_to_string): New function.
* c-common.h (braced_list_to_string): Declare it.
2018-08-08 Nathan Sidwell <>
* c-common.c (try_to_locate_new_include_inertion_point): Use
* c-lex.c (fe_file_change): Use linemap_included_from.
* c-ppoutput.c (pp_file_change): Likewise.
2018-08-01 Martin Sebor <>
PR tree-optimization/86650
* c-format.c (gcc_tdiag_char_table): Update comment for "%G".
(gcc_cdiag_char_table, gcc_cxxdiag_char_table): Same.
(init_dynamic_diag_info): Update from "gcall *" to "gimple *".
* c-format.h (T89_G): Update to be "gimple *" rather than
"gcall *".
(local_gcall_ptr_node): Rename...
(local_gimple_ptr_node): this.
2018-07-31 David Malcolm <>
* c-format.c (PP_FORMAT_CHAR_TABLE): New macro, based on existing
table entries for gcc_diag_char_table, and the 'Z' entry from
gcc_tdiag_char_table, changing the "chain" entry for 'Z' from
&gcc_tdiag_char_table[0] to &gcc_diag_char_table[0].
(gcc_diag_char_table): Use PP_FORMAT_CHAR_TABLE, implicitly
adding missing "Z" for this table. Remove erroneous "G" and "K"
(gcc_tdiag_char_table): Use PP_FORMAT_CHAR_TABLE. Remove "v".
(gcc_cdiag_char_table): Use PP_FORMAT_CHAR_TABLE.
(gcc_cxxdiag_char_table): Use PP_FORMAT_CHAR_TABLE. Remove "v".
2018-07-31 Richard Earnshaw <>
* c-common.c (speculation_safe_resolve_call): New function.
(speculation_safe_resolve_params): New function.
(speculation_safe_resolve_return): New function.
(resolve_overloaded_builtin): Handle __builtin_speculation_safe_value.
* c-cppbuiltin.c (c_cpp_builtins): Add pre-define for
2018-07-20 David Malcolm <>
* c-common.c (c_cpp_error): Remove redundant "line_table"
parameter from call to rich_location::set_range.
(maybe_suggest_missing_token_insertion): Likewise.
2018-07-20 Martin Sebor <>
PR middle-end/82063
* c.opt (-Warray-bounds): Remove redundant -Wall.
2018-07-20 Martin Sebor <>
PR middle-end/82063
* c-common.h (c_common_handle_option): Change function argument
* c-opts.c (c_common_init_options): Same.
(c_common_handle_option): Same. Remove special handling of
OPT_Walloca_larger_than_ and OPT_Wvla_larger_than_.
* c.opt (-Walloc-size-larger-than, -Walloca-larger-than): Change
options to take a HOST_WIDE_INT argument and accept a byte-size
suffix. Initialize.
(-Wvla-larger-than): Same.
(-Wno-alloc-size-larger-than, -Wno-alloca-larger-than): New.
(-Wno-vla-larger-than): Same.
2018-07-12 Jakub Jelinek <>
* c-attribs.c (c_common_attribute_table): Add
"omp declare target implicit" attribute.
2018-07-12 Richard Biener <>
PR c/86453
* c-attribs.c (handle_packed_attribute): Do not build a variant
type with TYPE_PACKED, instead ignore the attribute if we may
not apply to the original type.
2018-07-10 Jakub Jelinek <>
PR c++/86443
* c-omp.c (c_omp_check_loop_iv_r, c_omp_check_loop_iv): Allow declv
to contain TREE_LIST for both the original class iterator and the
"last" helper var.
2018-07-07 Eric Botcazou <>
* c-ada-spec.c (to_ada_name): Remove index parameter.
(pp_ada_tree_identifier): Likewise.
(dump_ada_macros): Adjust call to to_ada_name.
(struct overloaded_name_hash): Delete.
(struct overloaded_name_hasher): Likewise.
(overloaded_names): Likewise.
(compute_overloading_index): Likewise.
(dump_ada_decl_name): Do not call compute_overloading_index and
adjust calls to pp_ada_tree_identifier.
(dump_ada_double_name): Adjust calls to pp_ada_tree_identifier.
(dump_ada_import): Add spc parameter and switch to aspect syntax.
(dump_ada_function_declaration): Adjust call to pp_ada_tree_identifier.
(dump_ada_enum_type): Remove type and display_convention parameters.
Adjust calls to pp_ada_tree_identifier.
(dump_ada_node): Likewise and for dump_ada_structure.
(dump_nested_type) <ENUMERAL_TYPE>: Adjust call to dump_ada_enum_type
and tidy up.
<RECORD_TYPE>: Adjust call to dump_ada_structure and switch to aspect
(print_constructor): Adjust call to pp_ada_tree_identifier.
(print_destructor): Likewise.
(dump_ada_declaration): Switch to aspect syntax.
(dump_ada_structure): Likewise and tidy up. Replace display_convention
parameter with nested parameter.
(dump_ads): Emit pragma Ada_2012 in lieu of pragma Ada_2005.
(dump_ada_specs): Do not delete overloaded_names table.
2018-07-06 Peter Bergner <>
PR target/86324
* c-attribs.c (handle_mode_attribute): Call translate_mode_attribute
target hook.
2018-07-05 Nathan Sidwell <>
* c-lex.c (fe_file_change): Check SYSTEM_IMPLICIT_EXTERN_C not
2018-06-28 Martin Liska <>
* cppspec.c: Include opt-suggestions.h.
2018-06-20 Chung-Lin Tang <>
Thomas Schwinge <>
Cesar Philippidis <>
* c-pragma.h (enum pragma_omp_clause): Add
2018-06-20 Jakub Jelinek <>
PR c++/86210
* c-common.c (check_nonnull_arg): Use fold_for_warn. Adjust obsolete
2018-06-18 Martin Sebor <>
PR middle-end/85602
* c-warn.c (sizeof_pointer_memaccess_warning): Check for attribute
2018-06-16 Kugan Vivekanandarajah <>
* c-common.c (c_common_truthvalue_conversion): Handle ABSU_EXPR.
2018-06-13 Jason Merrill <>
* c-opts.c (c_common_post_options): Warn about useless -Wabi.
(c_common_handle_option) [OPT_Wabi_]: Remove flag_abi_compat_version
PR c++/86094 - wrong code with defaulted move ctor.
* c-opts.c (c_common_post_options): Bump the current ABI version to
13. Set warn_abi_version and flag_abi_compat_version to the current
version rather than 0. Fix defaulting flag_abi_compat_version from
2018-06-12 Martin Sebor <>
PR c/85931
* c-warn.c (sizeof_pointer_memaccess_warning): Avoid warning when
sizeof source and destination yields the same value.
2018-06-12 Martin Liska <>
* c.opt: Make MPX-related options as Deprecated.
2018-06-08 David Malcolm <>
* c-pretty-print.c (c_pretty_printer::statement): Use TDF_NONE
rather than 0.
2018-06-08 Martin Liska <>
* c-attribs.c (handle_bnd_variable_size_attribute): Remove support
for MPX (macros, related functions, fields in cgraph_node, ...).
(handle_bnd_legacy): Likewise.
(handle_bnd_instrument): Likewise.
* c.opt: Likewise.
2018-06-06 Jakub Jelinek <>
PR c++/86068
* c-cppbuiltin.c (c_cpp_builtins): Fix a typo, set
__cpp_transactional_memory to 201500 instead of 210500.
2018-06-06 Jason Merrill <>
PR c++/85710 - ICE with -Wmemset-elt-size.
* c-warn.c (warn_for_memset): Don't crash on incomplete element type.
2018-06-01 Jason Merrill <>
* c-cppbuiltin.c (c_cpp_builtins): Bump __cpp_deduction_guides to
2018-06-01 Eric Botcazou <>
* c-ada-spec.c (dump_ada_declaration) <TYPE_DECL>: Generate a forward
declaration for a typedef independently of whether the declaration of
the subtype is generated.
2018-05-31 Martin Sebor <>
PR c/82063
* c.opt (-Wno-alloc-size-larger-than): New option.
2018-04-22 David Pagan <>
PR c/55976
* c-opts.c (c_common_post_options): Set default for warn_return_type
for C++/C++ with ObjC extensions only. For C, makes it possible to
differentiate between default (no option), -Wreturn-type, and
2018-05-29 Jason Merrill <>
* c.opt (Winit-list-lifetime): New flag.
2018-05-28 Bernd Edlinger <>
* c-lex.c (get_fileinfo): Use splay_tree_compare_strings and
2018-05-26 Jakub Jelinek <>
PR bootstrap/85921
* c-warn.c (diagnose_mismatched_attributes): Remove unnecessary
noinline variable to workaround broken kernel headers.
2018-05-18 Jason Merrill <>
* c.opt (Wdeprecated-copy): New flag.
2018-05-17 Martin Liska <>
* c-warn.c (overflow_warning): Do not use
space in between 'G_' and '('.
2018-05-09 Jason Merrill <>
* c-common.c (valid_array_size_p): Add complain parameter.
* c-common.h: ...which defaults to true.
2018-05-11 Jakub Jelinek <>
PR c/85696
* c-omp.c (c_omp_predetermined_sharing): Return
OMP_CLAUSE_DEFAULT_SHARED for artificial vars with integral type.
2018-05-11 Martin Liska <>
PR sanitizer/85556
* c-attribs.c (handle_no_sanitize_attribute): Iterate all
TREE_LIST values.
2018-05-10 Jakub Jelinek <>
PR c++/85662
* c-common.h (fold_offsetof_1): Removed.
(fold_offsetof): Add TYPE argument defaulted to size_type_node and
CTX argument defaulted to ERROR_MARK.
* c-common.c (fold_offsetof_1): Renamed to ...
(fold_offsetof): ... this. Remove wrapper function. Add TYPE
argument, convert the pointer constant to TYPE and use size_binop
with PLUS_EXPR instead of fold_build_pointer_plus if type is not
a pointer type. Adjust recursive calls.
2018-05-10 Eric Botcazou <>
PR c++/85400
* c-attribs.c (handle_visibility_attribute): Do not set no_add_attrs.
2018-05-07 Nathan Sidwell <>
* c.opt (ffor-scope): Remove functionality, issue warning.
2018-05-03 Nathan Sidwell <>
* c.opt (ffriend-injection): Remove functionality, issue warning.
2018-05-01 David Malcolm <>
PR c/84258
* c-format.c (struct format_check_results): Add field
(check_format_info): Initialize it, and warn if encountered.
(check_format_arg): Distinguish between wide char and
everything else when detecting arrays of non-char.
2018-04-30 David Malcolm <>
* c-format.c (get_corrected_substring): Update for
location_get_source_line returning a char_span. Use a char_span
when handling the prefix of the correction.
* c-indentation.c (get_visual_column): Update for
location_get_source_line returning a char_span.
(get_first_nws_vis_column): Likewise.
2018-03-29 David Malcolm <>
PR c++/84269
* (get_stdlib_header_for_name): Add various names
from <assert.h>, <string.h>, and <memory.h>; add more names from
2018-03-27 Jakub Jelinek <>
PR c++/85061
* c-common.c (fold_offsetof_1) <case COMPOUND_EXPR>: Assert that
get_base_address of the second operand is a VAR_P, rather than the
operand itself, and use gcc_checking_assert instead of gcc_assert.
2018-03-23 Marek Polacek <>
PR c++/85045
* c-pretty-print.c (c_pretty_printer::multiplicative_expression)
<case RDIV_EXPR>: Tweak condition.
2018-03-20 Eric Botcazou <>
* c-ada-spec.c (pp_ada_tree_identifier): Deal specifically with _Bool.
2018-03-16 Jakub Jelinek <>
PR c/84909
* c-warn.c (conversion_warning): Replace "to to" with "to" in
PR c/84910
* c-warn.c (diagnose_mismatched_attributes): Remove trailing space from
2018-03-16 Richard Biener <>
PR c/84873
* c-gimplify.c (c_gimplify_expr): Revert previous change. Instead
unshare the possibly folded expression.
2018-03-15 Richard Biener <>
PR c/84873
* c-gimplify.c (c_gimplify_expr): Do not fold expressions.
2018-03-13 Martin Sebor <>
PR tree-optimization/84725
* c-attribs.c (handle_nonstring_attribute): Allow attribute nonstring
with all three narrow character types, including their qualified forms.
2018-03-12 Martin Sebor <>
PR tree-optimization/83456
* c-common.c (check_function_restrict): Return bool.
Restore checking of bounded built-in functions.
(check_function_arguments): Also return the result
of warn_for_restrict.
* c-common.c (check_function_restrict): Return bool.
* c-warn.c (warn_for_restrict): Return bool.
2018-03-02 Marek Polacek <>
PR c++/84171
* c-warn.c (warn_for_sign_compare): Bail out if any of the operands
is erroneous.
2018-03-02 Thomas Schwinge <>
* c-attribs.c (c_common_attribute_table): Remove "cilk simd
2018-03-01 Marek Polacek <>
PR c++/84639
* c-attribs.c (common_handle_aligned_attribute): Don't use invalid
alignment in computation.
2018-02-28 Eric Botcazou <>
* c-ada-spec.c (dump_ada_node) <NULLPTR_TYPE>: New case.
<REAL_TYPE>: Deal specifically with _Float128/__float128.
2018-02-28 Eric Botcazou <>
* c-ada-spec.c (dump_ada_double_name) <ENUMERAL_TYPE>: New case.
(is_char_array): Take a type instead of a declaration.
(dump_ada_array_type): Likewise.
(is_simple_enum): Minor tweak.
(dump_ada_enum_type): New function extracted from...
(dump_ada_node) <ENUMERAL_TYPE>: Invoke it.
<INTEGER_TYPE>: Remove unreachable code.
<RECORD_TYPE>: Likewise. Minor tweaks.
(dump_nested_type) <ARRAY_TYPE>: Adjust to above changes.
<ENUMERAL_TYPE>: New case.
<RECORD_TYPE>: Factor out common code.
(dump_ada_declaration) <ARRAY_TYPE>: Adjust to above changes.
Minor tweaks. Deal with enumeral types.
(dump_ada_structure): Minor tweaks.
2018-02-28 Eric Botcazou <>
* c-ada-spec.c (dump_ada_node) <POINTER_TYPE>: Do not use generic
address for incomplete structures.
(dump_forward_type): Do not bail out for incomplete structures.
(dump_ada_declaration): Do not special-case incomplete structures
for subtypes. Dump them as null records for types.
2018-02-28 Eric Botcazou <>
* c-ada-spec.c (dump_ada_import): Use boolean and fix formatting.
(is_char_array): Fix formatting.
(dump_template_types): Likewise.
(dump_generic_ada_node): Rename into...
(dump_ada_node): ...this.
<POINTER_TYPE>: Remove superfluous space. Use generic address for
incomplete structures and not for empty structures. Do not use it
when forward declarations are needed.
(dump_forward_type): New function.
(dump_nested_types): Remove FORWARD parameter. Do not consider
TREE_VISITED and do not generate a forward declaration. Only dump
original nested types for nested declaration.
(dump_nested_type) <POINTER_TYPE>: Call dump_forward_type.
<ARRAY_TYPE>: Likewise if the component type is an anonymous pointer.
<RECORD_TYPE>: Do not consider TREE_VISITED.
(dump_ada_declaration): Use booleans and fix formatting throughout.
<TYPE_DECL>: Skip incomplete structures and not empty structures.
Call dump_forward_type instead of dump_nested_types for a typedef.
Remove superfluous check and adjust call to dump_nested_types.
<POINTER_TYPE>: Call dump_forward_type and fall through.
(dump_ada_struct_decl): Rename into...
(dump_ada_structure): ...this. Do not special-case empty structures.
2018-02-27 Martin Sebor <>
PR c++/83871
* c.opt (-Wmissing-attributes): New option.
2018-02-21 Martin Liska <>
* c.opt (Wcatch-value=): Add IntegerRange.
2018-02-15 Jason Merrill <>
* c-cppbuiltin.c (c_cpp_builtins): Update __cpp_deduction_guides.
2018-02-09 Nathan Sidwell <>
PR c/84293
* c-common.h (strict_aliasing_warning): Drop OTYPE arg, insert LOC
* c-warn.c (strict_aliasing_warning): Drop OTYPE arg, require LOC
arg. Adjust.
2018-02-09 Martin Sebor <>
PR lto/84212
* c.opt (-Wstringop-overflow, -Warray-bounds): Add LTO.
(-Walloc-size-larger-than, -Wformat-truncation=): Same.
(-Wmaybe-uninitialized, -Wnonnull, -Wrestrict): Same.
(-Wstrict-overflow, -Wsuggest-attribute): Same.
(-Wuninitialized): Same.
2018-02-09 Eric Botcazou <>
* c-ada-spec.c (dump_ada_declaration): Do not generate the 'constant'
keyword for components.
2018-02-02 Paolo Carlini <>
* c-common.h (DECL_UNNAMED_BIT_FIELD): New.
2018-02-02 Julia Koval <>
* c-common.h (omp_clause_mask): Move to wide_int_bitmask.h.
2018-01-29 Marek Polacek <>
PR c/83966
* c-format.c (check_function_format): Check current_function_decl.
2018-01-27 Jakub Jelinek <>
* c-cppbuiltin.c (c_cpp_builtins): Use ggc_strdup for the fp_suffix
(lazy_hex_fp_values): Allow up to LAZY_HEX_FP_VALUES_CNT lazy hex fp
values rather than just 12.
(builtin_define_with_hex_fp_value): Likewise.
2018-01-18 Boris Kolpackov <>
PR other/70268
* c.opt (-fmacro-prefix-map): New option.
* c-opts.c (c_common_handle_option): Handle it.
* c-lex.c (init_c_lex): Set remap_filename cpp callback.
* c-ppoutput.c (init_pp_output): Likewise.
2018-01-17 David Malcolm <>
PR c++/83814
* c-common.c (fold_for_warn): Move to c/c-fold.c and cp/expr.c.
2018-01-10 Eric Botcazou <>
* c-ada-spec.c (dump_number): Add FLOAT_P parameter.
Skip 'f' and 'F' characters if it is true.
(store_ada_macro): Minor tweak.
(dump_ada_macros) <CPP_COMMENT>: Likewise.
<CPP_WSTRING>: Likewise.
<CPP_STRING>: Output '&' in the buffer if not the first string.
<CPP_NUMBER>: Adjust calls to dump_number.
2018-01-10 David Malcolm <>
PR c++/43486
* c-common.c: Include "selftest.h".
(get_atomic_generic_size): Perform the test for integral type
before the range test for any integer constant, fixing indentation
of braces. Call fold_for_warn before testing for an INTEGER_CST.
(reject_gcc_builtin): Strip any location wrapper from EXPR.
(selftest::test_fold_for_warn): New function.
(selftest::c_common_c_tests): New function.
(selftest::c_family_tests): Call it, and
* c-common.h (selftest::c_pretty_print_c_tests): New decl.
* c-format.c (check_format_arg): Convert VAR_P check to a
* c-pretty-print.c: Include "selftest.h".
(pp_c_cast_expression): Don't print casts for location wrappers.
(selftest::assert_c_pretty_printer_output): New function.
(selftest::test_location_wrappers): New function.
(selftest::c_pretty_print_c_tests): New function.
* c-warn.c (warn_for_memset): Call fold_for_warn on the arguments.
2018-01-03 Richard Sandiford <>
Alan Hayward <>
David Sherwood <>
* c-common.c (c_common_type_for_mode): Handle MODE_VECTOR_BOOL.
2018-01-03 Richard Sandiford <>
Alan Hayward <>
David Sherwood <>
* c-ubsan.c (ubsan_instrument_shift): Treat GET_MODE_BITSIZE
as polynomial.
2018-01-03 Richard Sandiford <>
Alan Hayward <>
David Sherwood <>
* c-common.c (vector_types_convertible_p, c_build_vec_perm_expr)
(convert_vector_to_array_for_subscript): Handle polynomial
(c_common_type_for_mode): Check valid_vector_subparts_p.
* c-pretty-print.c (pp_c_initializer_list): Handle polynomial
2018-01-03 Jakub Jelinek <>
Update copyright years.
2017-12-22 Mike Stump <>
Eric Botcazou <>
* c-pragma.c (init_pragma): Register pragma GCC unroll.
* c-pragma.h (enum pragma_kind): Add PRAGMA_UNROLL.
2017-12-22 Alexandre Oliva <>
PR debug/83527
PR debug/83419
* c-semantics.c (only_debug_stmts_after_p): New.
(pop_stmt_list): Clear side effects in debug-only stmt list.
Check for single nondebug stmt followed by debug stmts only.
2017-12-21 Alexandre Oliva <>
PR debug/83419
* c-semantics.c (pop_stmt_list): Propagate side effects from
single nondebug stmt to container list.
2017-12-19 Jakub Jelinek <>
* (get_stdlib_header_for_name): Replace Yoda
conditions with typical order conditions.
2017-12-18 Marek Polacek <>
* c-warn.c (warn_logical_operator): Return early if -Wlogical-op is
not in effect.
2017-12-17 Martin Sebor <>
* c-attribs.c (common_handle_aligned_attribute): Avoid issuing
an error for attribute warn_if_not_aligned.
2017-12-16 Martin Sebor <>
PR tree-optimization/78918
* c-common.c (check_function_restrict): Avoid checking built-ins.
* c.opt (-Wrestrict): Include in -Wall.
2017-12-15 Jakub Jelinek <>
* c-attribs.c (c_common_attribute_table,
c_common_format_attribute_table): Swap affects_type_identity
and handler fields, adjust comments.
2017-12-14 Bernd Edlinger <>
* c.opt (Wcast-function-type): New warning option.
* c-lex.c (get_fileinfo): Avoid warning.
* c-ppoutput.c (scan_translation_unit_directives_only): Remove cast.
2017-12-14 Qing Zhao <>
PR middle_end/79538
* c-cppbuiltin.c (builtin_define_with_hex_fp_value):
Adjust the size of buf1 and buf2, add a new buf to avoid
format-overflow warning.
2017-12-12 Alexandre Oliva <>
* c-semantics.c (pop_stmt_list): Move begin stmt marker into
subsequent statement list.
2017-12-07 Martin Sebor <>
PR c/81544
PR c/81566
* c-attribs.c (attr_aligned_exclusions): New array.
(attr_alloc_exclusions, attr_cold_hot_exclusions): Same.
(attr_common_exclusions, attr_const_pure_exclusions): Same.
(attr_gnu_inline_exclusions, attr_inline_exclusions): Same.
(attr_noreturn_exclusions, attr_returns_twice_exclusions): Same.
(attr_warn_unused_result_exclusions): Same.
(handle_hot_attribute, handle_cold_attribute): Simplify.
(handle_const_attribute): Warn on function returning void.
(handle_pure_attribute): Same.
(handle_aligned_attribute): Diagnose conflicting attribute
* c-warn.c (diagnose_mismatched_attributes): Simplify.
2017-12-06 David Malcolm <>
PR c/83236
* c-common.c (selftest::c_family_tests): Call
* c-common.h (selftest::c_spellcheck_cc_tests): New decl.
* Include "selftest.h".
(name_reserved_for_implementation_p): New function.
(should_suggest_as_macro_p): New function.
(find_closest_macro_cpp_cb): Move the check for NT_MACRO to
should_suggest_as_macro_p and call it.
(selftest::test_name_reserved_for_implementation_p): New function.
(selftest::c_spellcheck_cc_tests): New function.
* c-spellcheck.h (name_reserved_for_implementation_p): New decl.
2017-12-06 David Malcolm <>
* New file, taken from macro-handling code in
* c-spellcheck.h: New file, taken from macro-handling code in
2017-12-01 Jakub Jelinek <>
* c-attribs.c (c_common_attribute_table): Remove "cilk simd function"
(handle_simd_attribute): Don't check for "cilk simd function"
attribute. Reindent, formatting changes.
2017-11-30 Julia Koval <>
* c-common.h (inv_list): Remove.
2017-11-28 Jakub Jelinek <>
PR sanitizer/81275
* c-common.c (c_switch_covers_all_cases_p_1,
c_switch_covers_all_cases_p): New functions.
* c-common.h (c_switch_covers_all_cases_p): Declare.
2017-11-28 Julia Koval <>
Sebastian Peryt <>
* array-notation-common.c: Delete.
* c-cilkplus.c: Ditto.
* c-common.c (_Cilk_spawn, _Cilk_sync, _Cilk_for): Remove.
* c-common.def (ARRAY_NOTATION_REF): Remove.
* c-common.h (RID_CILK_SPAWN, build_array_notation_expr,
build_array_notation_ref, C_ORT_CILK, c_check_cilk_loop,
c_validate_cilk_plus_loop, cilkplus_an_parts,
cilk_recognize_spawn): Remove.
* c-gimplify.c (CILK_SPAWN_STMT): Remove.
* c-omp.c: Remove CILK_SIMD check.
* c-pragma.c: Ditto.
* c-pragma.h: Remove CILK related pragmas.
* c-pretty-print.c (c_pretty_printer::postfix_expression): Remove
(c_pretty_printer::expression): Ditto.
* c.opt (fcilkplus): Remove.
* cilk.c: Delete.
2017-11-21 Marc Glisse <>
* c-pretty-print.c (pp_c_additive_expression,
c_pretty_printer::expression): Handle POINTER_DIFF_EXPR.
2017-11-21 Jakub Jelinek <>
* c-common.c (get_nonnull_operand): Use tree_to_uhwi.
PR c++/83059
* c-common.c (get_atomic_generic_size): Use TREE_INT_CST_LOW
instead of tree_to_uhwi, formatting fix.
2017-11-20 David Malcolm <>
PR c/81404
* New file, based on material from c/c-decl.c.
(suggest_missing_header): Copied as-is.
(get_stdlib_header_for_name): New, based on get_c_name_hint but
heavily edited to add C++ support. Add some knowledge about
<limits.h>, <stdint.h>, and <wchar.h>.
* known-headers.h: Likewise.
2017-11-20 David Malcolm <>
* c-common.h (enum lookup_name_fuzzy_kind): Move to name-hint.h.
(lookup_name_fuzzy): Likewise. Convert return type from
const char * to name_hint. Add location_t param.
* name-hint.h: New header.
2017-11-19 Jakub Jelinek <>
PR c/66618
PR c/69960
* c-common.h (c_fully_fold): Add LVAL argument defaulted to false.
2017-11-16 Joseph Myers <>
* c.opt (-std=c17, std=gnu17, -std=iso9899:2017): Refer to 2018
expected publication date of C17.
(-std=c18, -std=gnu18, -std=iso9899:2018): New option aliases.
2017-11-15 Joseph Myers <>
PR c/81156
* c-common.c (c_common_reswords): Add __builtin_tgmath.
* c-common.h (enum rid): Add RID_BUILTIN_TGMATH.
2017-11-10 Martin Sebor <>
PR c/81117
* c-common.c (catenate_strings): Use memcpy instead of strncpy.
* c-warn.c (sizeof_pointer_memaccess_warning): Handle arrays.
* c.opt (-Wstringop-truncation): New option.
2017-11-06 Martin Liska <>
PR middle-end/82404
* c-opts.c (c_common_post_options): Set -Wreturn-type for C++
* c.opt: Set default value of warn_return_type.
2017-10-31 David Malcolm <>
* c-common.c (binary_op_error): Update for renaming of
(c_parse_error): Likewise.
* c-warn.c (warn_logical_not_parentheses): Likewise for
renaming of inform_at_rich_loc.
(warn_for_restrict): Likewise for renaming of
2017-10-30 Joseph Myers <>
* c.opt (std=c17, std=gnu17, std=iso9899:2017): New options.
* c-opts.c (set_std_c17): New function.
(c_common_init_options): Use gnu17 as default C version.
(c_common_handle_option): Handle -std=c17 and -std=gnu17.
2017-10-27 Michael Meissner <>
* c-cppbuiltin.c (mode_has_fma): Add support for PowerPC KFmode.
(c_cpp_builtins): If a machine has a fast fma _Float<N> and
_Float<N>X variant, define __FP_FAST_FMA<N> and/or
2017-10-23 Marek Polacek <>
PR c/82681
* c-warn.c (warnings_for_convert_and_check): Fix typos.
2017-10-19 Eric Botcazou <>
* c-common.c (check_builtin_function_arguments): Also check arguments
of __builtin_alloca_with_align_and_max.
2017-10-17 David Malcolm <>
* c-format.c (format_warning_at_char): Pass UNKNOWN_LOCATION
rather than NULL to format_warning_va.
(check_format_types): Likewise when calling format_type_warning.
Remove code to extract source_ranges and source_range * in favor
of just a location_t.
(format_type_warning): Convert source_range * param to a
2017-10-13 Jakub Jelinek <>
* c-gimplify.c (c_gimplify_expr): Handle [LR]ROTATE_EXPR like
2017-10-12 David Malcolm <>
* c-common.c (enum missing_token_insertion_kind): New enum.
(get_missing_token_insertion_kind): New function.
(maybe_suggest_missing_token_insertion): New function.
* c-common.h (maybe_suggest_missing_token_insertion): New decl.
2017-10-11 Nathan Sidwell <>
* c-opts.c (add_prefixed_path): Change chain to incpath_kind.
(c_common_handle_option): Update incpath_kind names.
2017-10-11 Martin Liska <>
PR sanitizer/82490
* c-attribs.c (handle_no_sanitize_attribute): Report directly
Wattributes warning.
2017-10-10 Richard Sandiford <>
* c-ada-spec.c (dump_generic_ada_node): Use wi::to_wide when
operating on trees as wide_ints.
* c-common.c (pointer_int_sum): Likewise.
* c-pretty-print.c (pp_c_integer_constant): Likewise.
* c-warn.c (match_case_to_enum_1): Likewise.
(c_do_switch_warnings): Likewise.
(maybe_warn_shift_overflow): Likewise.
2017-10-10 Jakub Jelinek <>
PR c/82437
* c-warn.c (warn_tautological_bitwise_comparison): Use wi::to_wide
instead of wide_int::from.
2017-10-06 Jakub Jelinek <>
PR c/82437
* c-warn.c (warn_tautological_bitwise_comparison): Instead of
using to_widest use wide_int with the larger of the two precisions.
2017-10-05 Bernd Edlinger <>
* c-pretty-print.c (pp_c_parameter_type_list): Print ... for variadic
2017-10-02 Richard Sandiford <>
* c-warn.c (warn_tautological_bitwise_comparison): Use wi::to_widest
when combining the original unconverted comparison operands.
2017-09-29 Jakub Jelinek <>
* c-attribs.c (handle_noipa_attribute): Don't add "stack_protect"
2017-09-29 Eric Botcazou <>
* c-ada-spec.c (to_ada_name): Add index parameter.
(pp_ada_tree_identifier): Likewise.
(dump_ada_macros): Adjust call to to_ada_name.
(struct overloaded_name_hash): New type.
(struct overloaded_name_hasher): Likewise.
(overloaded_names): New hash table.
(compute_overloading_index): New function.
(dump_ada_decl_name): Call it and pass the result to
(dump_ada_double_name): Adjust calls to pp_ada_tree_identifier.
(dump_ada_function_declaration): Likewise.
(dump_generic_ada_node): Likewise.
(print_constructor): Likewise.
(print_destructor): Likewise.
(dump_ada_specs): Delete overloaded_names table.
2017-09-29 Eric Botcazou <>
* c-ada-spec.c (max_ada_macros): Move around.
(store_ada_macro_index): Likewise.
(source_file): Rename into...
(macro_source_file): ...this.
(count_ada_macro): Move around.
(store_ada_macro): Likewise.
(compare_macro): Likewise.
(print_ada_macros): Merge in...
(dump_ada_macros): ...this.
(source_file_base): Rename into...
(current_source_file): ...this.
(print_comment): Move around.
(dump_ada_nodes): Call dump_ada_declaration directly.
(struct with): Change type of limited field to bool.
(append_withs): Change type of limited_access parameter to bool.
(pp_ada_tree_identifie): Likewise.
(dump_ada_decl_nam): Likewise.
(dump_generic_ada_node): Likewise. Do not print the return type.
(to_ada_name): Change type of space_found parameter to bool.
(dump_ada_function_declaration): Return void and change type of
parameters to bool. Also print the return type for a function.
(print_ada_methods): Rename into...
(dump_ada_methods): ...this.
(print_ada_declaration): Rename into ...
(dump_ada_declaration): ...this. Do not print the return type.
(print_ada_struct_decl): Rename into...
(dump_ada_struct_decl): ...this.
2017-09-29 Jakub Jelinek <>
* c-attribs.c (handle_packed_attribute): Test DECL_C_BIT_FIELD
rather than DECL_INITIAL.
(common_handle_aligned_attribute): Likewise.
2017-09-20 Alexandre Oliva <>
* c.opt (gen-decls): Add RejectNegative.
2017-09-15 Andrew Sutton <>
Jakub Jelinek <>
Add support for -std=c++2a.
* c-common.h (cxx_dialect): Add cxx2a as a dialect.
* opt.c: Add options for -std=c++2a and -std=gnu++2a.
* c-opts.c (set_std_cxx2a): New.
(c_common_handle_option): Set options when -std=c++2a is enabled.
(c_common_post_options): Adjust comments.
(set_std_cxx14, set_std_cxx17): Likewise.
2017-09-15 Eric Botcazou <>
* c-pragma.c (handle_pragma_scalar_storage_order): Expand on error
message for non-uniform endianness and issue a warning in C++.
2017-09-15 Jakub Jelinek <>