OSDN Git Service

* calls.c (special_function_p): operator new may not be malloc-like.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 3 Mar 2000 09:19:42 +0000 (09:19 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 3 Mar 2000 09:19:42 +0000 (09:19 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32308 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/calls.c

index d229e83..dfd8035 100644 (file)
@@ -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>
index 4ff988a..324cc7b 100644 (file)
@@ -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;
     }
 }