call.c (special_function_p): It is only malloc if it returns Pmode.
authorMartin v. Löwis <loewis@informatik.hu-berlin.de>
Fri, 17 Mar 2000 09:11:17 +0000 (09:11 +0000)
committerMartin v. Löwis <loewis@gcc.gnu.org>
Fri, 17 Mar 2000 09:11:17 +0000 (09:11 +0000)
* call.c (special_function_p): It is only malloc if it returns
Pmode.

From-SVN: r32604

gcc/ChangeLog
gcc/calls.c

index 7f1fc13882cd4ef176da180ad7f8139924adaec4..09dffc1d613ad21e2a55dac9b801515200bf9623 100644 (file)
@@ -1,3 +1,8 @@
+2000-03-17  Martin v. Löwis  <loewis@informatik.hu-berlin.de>
+
+       * call.c (special_function_p): It is only malloc if it returns
+       Pmode.
+
 2000-03-17  Michael Hayes  <m.hayes@elec.canterbury.ac.nz>
 
        * config/c4x/c4x.h (ASM_SPEC, CPP_SPEC, LINK_SPEC): Support C33.
index 7ae7b3d60f33dcc545782b6f6e985f30f16a4d04..6a4c1484ffc7226d88dad631dce8a048d4726d89 100644 (file)
@@ -645,9 +645,10 @@ special_function_p (fndecl, returns_twice, is_longjmp, fork_or_exec,
          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"))
+      else if (TYPE_MODE (TREE_TYPE (TREE_TYPE (fndecl))) == Pmode
+              && (! strcmp (tname, "malloc")
+                  || ! strcmp (tname, "calloc")
+                  || ! strcmp (tname, "strdup")))
        *is_malloc = 1;
     }
 }