diff options
author | Martin Liska <mliska@suse.cz> | 2022-03-10 10:42:24 +0100 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2022-03-10 10:42:24 +0100 |
commit | 604bf5da51533a218c0393cb5115bae7c8d95282 (patch) | |
tree | 7c1d3405dde7cc6efe0fbd24566cdf8bb690fbfe /gcc/c | |
parent | 1a576b7ac609d4225a3833e3a9c84a9439d0e45e (diff) | |
parent | 6f8abf2b9ff4f165a61295cdb3525ce1da2a77c6 (diff) | |
download | gcc-604bf5da51533a218c0393cb5115bae7c8d95282.zip gcc-604bf5da51533a218c0393cb5115bae7c8d95282.tar.gz gcc-604bf5da51533a218c0393cb5115bae7c8d95282.tar.bz2 |
Merge branch 'master' into devel/sphinx
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 18 | ||||
-rw-r--r-- | gcc/c/c-fold.cc | 1 | ||||
-rw-r--r-- | gcc/c/c-parser.cc | 4 | ||||
-rw-r--r-- | gcc/c/c-typeck.cc | 7 |
4 files changed, 25 insertions, 5 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index b177355..e97a42b 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,21 @@ +2022-03-09 Joseph Myers <joseph@codesourcery.com> + + * c-typeck.cc (function_types_compatible_p): Do not handle C2X + differently from earlier standards for unprototyped function type + compatibility. + +2022-03-09 Jakub Jelinek <jakub@redhat.com> + + PR c/104711 + * c-fold.cc (c_fully_fold_internal): Don't emit + -Wshift-negative-value warning if TYPE_OVERFLOW_WRAPS. + * c-typeck.cc (build_binary_op): Likewise. + +2022-03-07 Jakub Jelinek <jakub@redhat.com> + + * c-parser.cc (c_parser_omp_clause_map): Add missing space in string + literal. + 2022-02-23 Richard Biener <rguenther@suse.de> * gimple-parser.cc (c_parser_parse_gimple_body): Diagnose diff --git a/gcc/c/c-fold.cc b/gcc/c/c-fold.cc index 76ea25b..ac4ceaa 100644 --- a/gcc/c/c-fold.cc +++ b/gcc/c/c-fold.cc @@ -382,6 +382,7 @@ c_fully_fold_internal (tree expr, bool in_init, bool *maybe_const_operands, && TREE_CODE (TREE_TYPE (orig_op0)) == INTEGER_TYPE && TREE_CODE (op0) == INTEGER_CST && c_inhibit_evaluation_warnings == 0 + && !TYPE_OVERFLOW_WRAPS (TREE_TYPE (orig_op0)) && tree_int_cst_sgn (op0) < 0) warning_at (loc, OPT_Wshift_negative_value, "left shift of negative value"); diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc index 84deac0..129dd72 100644 --- a/gcc/c/c-parser.cc +++ b/gcc/c/c-parser.cc @@ -16230,8 +16230,8 @@ c_parser_omp_clause_map (c_parser *parser, tree list) else { c_parser_error (parser, "%<#pragma omp target%> with " - "modifier other than %<always%> or %<close%>" - "on %<map%> clause"); + "modifier other than %<always%> or " + "%<close%> on %<map%> clause"); parens.skip_until_found_close (parser); return list; } diff --git a/gcc/c/c-typeck.cc b/gcc/c/c-typeck.cc index 3075c88..54b0b0d 100644 --- a/gcc/c/c-typeck.cc +++ b/gcc/c/c-typeck.cc @@ -1693,7 +1693,7 @@ function_types_compatible_p (const_tree f1, const_tree f2, if (args1 == NULL_TREE) { - if (flag_isoc2x ? stdarg_p (f2) : !self_promoting_args_p (args2)) + if (!self_promoting_args_p (args2)) return 0; /* If one of these types comes from a non-prototype fn definition, compare that with the other type's arglist. @@ -1706,7 +1706,7 @@ function_types_compatible_p (const_tree f1, const_tree f2, } if (args2 == NULL_TREE) { - if (flag_isoc2x ? stdarg_p (f1) : !self_promoting_args_p (args1)) + if (!self_promoting_args_p (args1)) return 0; if (TYPE_ACTUAL_ARG_TYPES (f2) && type_lists_compatible_p (args1, TYPE_ACTUAL_ARG_TYPES (f2), @@ -12213,7 +12213,8 @@ build_binary_op (location_t location, enum tree_code code, { doing_shift = true; if (TREE_CODE (op0) == INTEGER_CST - && tree_int_cst_sgn (op0) < 0) + && tree_int_cst_sgn (op0) < 0 + && !TYPE_OVERFLOW_WRAPS (type0)) { /* Don't reject a left shift of a negative value in a context where a constant expression is needed in C90. */ |