Consider size_t mangling as unsigned int and long [PR100876].
authorMartin Sebor <msebor@redhat.com>
Tue, 15 Jun 2021 18:42:06 +0000 (12:42 -0600)
committerMartin Sebor <msebor@redhat.com>
Tue, 15 Jun 2021 18:46:54 +0000 (12:46 -0600)
gcc/ChangeLog:

PR middle-end/100876
* builtins.c: (gimple_call_return_array): Account for size_t
mangling as either unsigned int or unsigned long

gcc/builtins.c

index 75419cc..855ad1e 100644 (file)
@@ -5183,8 +5183,12 @@ gimple_call_return_array (gimple *stmt, offset_int offrng[2],
          || DECL_IS_REPLACEABLE_OPERATOR_NEW_P (fn))
        return NULL_TREE;
 
+      /* Check the mangling, keeping in mind that operator new takes
+        a size_t which could be unsigned int or unsigned long.  */
       tree fname = DECL_ASSEMBLER_NAME (fn);
-      if (!id_equal (fname, "_ZnwmPv")       // ordinary form
+      if (!id_equal (fname, "_ZnwjPv")       // ordinary form
+         && !id_equal (fname, "_ZnwmPv")    // ordinary form
+         && !id_equal (fname, "_ZnajPv")    // array form
          && !id_equal (fname, "_ZnamPv"))   // array form
        return NULL_TREE;