aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@casey.cygnus.com>2000-03-03 09:19:42 +0000
committerJason Merrill <jason@gcc.gnu.org>2000-03-03 04:19:42 -0500
commit1e5a1107e4bcfcfdf5ee172009812689109a9012 (patch)
tree1f5a0b1f3495717a7afe9e88d266b213ac8ddfe0 /gcc
parent09496b7c183524bcae9606d118b7f7cfb0196878 (diff)
downloadgcc-1e5a1107e4bcfcfdf5ee172009812689109a9012.zip
gcc-1e5a1107e4bcfcfdf5ee172009812689109a9012.tar.gz
gcc-1e5a1107e4bcfcfdf5ee172009812689109a9012.tar.bz2
* calls.c (special_function_p): operator new may not be malloc-like.
From-SVN: r32308
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog2
-rw-r--r--gcc/calls.c13
2 files changed, 7 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d229e83..dfd8035 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,7 @@
2000-03-03 Jason Merrill <jason@casey.cygnus.com>
+ * calls.c (special_function_p): operator new may not be malloc-like.
+
* gcse.c (dump_hash_table): Really fix error in last change.
2000-03-02 Denis Chertykov <denisc@overta.ru>
diff --git a/gcc/calls.c b/gcc/calls.c
index 4ff988a..324cc7b 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -634,16 +634,13 @@ special_function_p (fndecl, returns_twice, is_longjmp, fork_or_exec,
/* Do not add any more malloc-like functions to this list,
instead mark them as malloc functions using the malloc attribute.
Note, realloc is not suitable for attribute malloc since
- it may return the same address across multiple calls. */
+ it may return the same address across multiple calls.
+ C++ operator new is not suitable because it is not required
+ to return a unique pointer; indeed, the standard placement new
+ just returns its argument. */
else if (! strcmp (tname, "malloc")
|| ! strcmp (tname, "calloc")
- || ! strcmp (tname, "strdup")
- /* Note use of NAME rather than TNAME here. These functions
- are only reserved when preceded with __. */
- || ! strcmp (name, "__vn") /* mangled __builtin_vec_new */
- || ! strcmp (name, "__nw") /* mangled __builtin_new */
- || ! strcmp (name, "__builtin_new")
- || ! strcmp (name, "__builtin_vec_new"))
+ || ! strcmp (tname, "strdup"))
*is_malloc = 1;
}
}