[mid-end] Fix declared type of personality functions
authorMatthew Malcomson <matthew.malcomson@arm.com>
Tue, 5 Nov 2019 15:36:20 +0000 (15:36 +0000)
committerMatthew Malcomson <matmal01@gcc.gnu.org>
Tue, 5 Nov 2019 15:36:20 +0000 (15:36 +0000)
`build_personality_function` generates a declaration for a personality
function.  The type it declares for these functions doesn't match the
type of the actual personality functions that are defined by the C++
unwinding ABI.

This doesn't cause any crashes since the compiler never generates a call
to these decl's, and hence the type of the function is never used.
Nonetheless, for the sake of consistency and readability we update the
type of this declaration.

gcc/ChangeLog:

2019-11-05  Matthew Malcomson  <matthew.malcomson@arm.com>

* expr.c (build_personality_function): Fix generated type to
match actual personality functions.

From-SVN: r277846

gcc/ChangeLog
gcc/expr.c

index 320b4923db953bc8c4953bfd4f7b7ca84430f211..2bb973f83aea88c24c9aae05d2949bb50b48e28f 100644 (file)
@@ -1,3 +1,8 @@
+2019-11-05  Matthew Malcomson  <matthew.malcomson@arm.com>
+
+       * expr.c (build_personality_function): Fix generated type to
+       match actual personality functions.
+
 2019-11-05  Matthew Malcomson  <matthew.malcomson@arm.com>
 
        * config/aarch64/aarch64.c (aarch64_handle_attr_cpu): Allocate
index 12165af21cb0ded943b63e9e503e42e267de8ce5..06e934e5be6e1d500460bba3779057455c85ba7a 100644 (file)
@@ -12554,7 +12554,8 @@ build_personality_function (const char *lang)
 
   name = ACONCAT (("__", lang, "_personality", unwind_and_version, NULL));
 
-  type = build_function_type_list (integer_type_node, integer_type_node,
+  type = build_function_type_list (unsigned_type_node,
+                                  integer_type_node, integer_type_node,
                                   long_long_unsigned_type_node,
                                   ptr_type_node, ptr_type_node, NULL_TREE);
   decl = build_decl (UNKNOWN_LOCATION, FUNCTION_DECL,