Backported from trunk:

Consider size_t mangling as unsigned int and long [PR100876].

gcc/ChangeLog:

	PR middle-end/100876
	* builtins.c: (gimple_call_return_array): Account for size_t
	mangling as either unsigned int or unsigned long
This commit is contained in:
Martin Sebor 2021-06-17 12:22:28 -06:00
parent fbafba7114
commit 00bf3e4d12

View File

@ -5171,8 +5171,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;