diff options
author | Martin Liska <mliska@suse.cz> | 2022-10-26 12:59:00 +0200 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2022-10-26 12:59:00 +0200 |
commit | 62e475bad0d668c432bb97113cbf73fa281b8b55 (patch) | |
tree | 1c8993afe363ddbf4ae80795e47042df1e33d181 /gcc/c | |
parent | 5776a5ffab3b92d6ccac87ccf32c580ee2742d5a (diff) | |
parent | d80b7744c6ae6f6d8ca1f56982a50d1888b8279f (diff) | |
download | gcc-62e475bad0d668c432bb97113cbf73fa281b8b55.zip gcc-62e475bad0d668c432bb97113cbf73fa281b8b55.tar.gz gcc-62e475bad0d668c432bb97113cbf73fa281b8b55.tar.bz2 |
Merge branch 'master' into devel/sphinx
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 14 | ||||
-rw-r--r-- | gcc/c/c-decl.cc | 2 | ||||
-rw-r--r-- | gcc/c/c-objc-common.cc | 9 | ||||
-rw-r--r-- | gcc/c/c-typeck.cc | 4 |
4 files changed, 23 insertions, 6 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 76fe5fe..2ac8eaa 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,17 @@ +2022-10-24 Jakub Jelinek <jakub@redhat.com> + + PR c++/107358 + * c-typeck.cc (build_binary_op): Pass operands before excess precision + promotions to scalar_to_vector call. + +2022-10-24 Arsen Arsenović <arsen@aarsen.me> + + * c-decl.cc (finish_function): Ignore hosted when deciding + whether to implicitly return zero, but check noreturn. + * c-objc-common.cc (c_missing_noreturn_ok_p): Loosen the + requirements to just MAIN_NAME_P when hosted, or `int main' + otherwise. + 2022-10-20 Richard Biener <rguenther@suse.de> PR c/107305 diff --git a/gcc/c/c-decl.cc b/gcc/c/c-decl.cc index 80f6e91..4746e31 100644 --- a/gcc/c/c-decl.cc +++ b/gcc/c/c-decl.cc @@ -10542,7 +10542,7 @@ finish_function (location_t end_loc) if (DECL_RESULT (fndecl) && DECL_RESULT (fndecl) != error_mark_node) DECL_CONTEXT (DECL_RESULT (fndecl)) = fndecl; - if (MAIN_NAME_P (DECL_NAME (fndecl)) && flag_hosted + if (MAIN_NAME_P (DECL_NAME (fndecl)) && !TREE_THIS_VOLATILE (fndecl) && TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (fndecl))) == integer_type_node && flag_isoc99) { diff --git a/gcc/c/c-objc-common.cc b/gcc/c/c-objc-common.cc index 70e10a9..b468091 100644 --- a/gcc/c/c-objc-common.cc +++ b/gcc/c/c-objc-common.cc @@ -37,9 +37,12 @@ static bool c_tree_printer (pretty_printer *, text_info *, const char *, bool c_missing_noreturn_ok_p (tree decl) { - /* A missing noreturn is not ok for freestanding implementations and - ok for the `main' function in hosted implementations. */ - return flag_hosted && MAIN_NAME_P (DECL_ASSEMBLER_NAME (decl)); + /* A missing noreturn is ok for the `main' function. */ + if (!MAIN_NAME_P (DECL_ASSEMBLER_NAME (decl))) + return false; + + return flag_hosted + || TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (decl))) == integer_type_node; } /* Called from check_global_declaration. */ diff --git a/gcc/c/c-typeck.cc b/gcc/c/c-typeck.cc index fdb96c2..92f3afc 100644 --- a/gcc/c/c-typeck.cc +++ b/gcc/c/c-typeck.cc @@ -11995,8 +11995,8 @@ build_binary_op (location_t location, enum tree_code code, if ((gnu_vector_type_p (type0) && code1 != VECTOR_TYPE) || (gnu_vector_type_p (type1) && code0 != VECTOR_TYPE)) { - enum stv_conv convert_flag = scalar_to_vector (location, code, op0, op1, - true); + enum stv_conv convert_flag = scalar_to_vector (location, code, orig_op0, + orig_op1, true); switch (convert_flag) { |