aboutsummaryrefslogtreecommitdiff
path: root/gcc/calls.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2003-04-14 02:55:31 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2003-04-14 02:55:31 +0000
commit1331d16fd4b57c5927cec03b5a320bc59366a628 (patch)
treedd3d088e82001ccf169ac01fc9027aa8ec737b49 /gcc/calls.c
parente235df1f71573b7652df5ecec912f190055baf22 (diff)
downloadgcc-1331d16fd4b57c5927cec03b5a320bc59366a628.zip
gcc-1331d16fd4b57c5927cec03b5a320bc59366a628.tar.gz
gcc-1331d16fd4b57c5927cec03b5a320bc59366a628.tar.bz2
builtin-types.def (BT_FN_STRING_CONST_STRING): New builtin type.
* builtin-types.def (BT_FN_STRING_CONST_STRING): New builtin type. (BT_FN_PTR_SIZE_SIZE): Likewise. * builtins.def (BUILT_IN_MALLOC, BUILT_IN_CALLOC, BUILT_IN_STRDUP): New built-in functions for malloc, calloc and strdup respectively. * calls.c (special_function_p): No need to handle malloc-like functions any longer. ECF_MALLOC is set via built-in attributes. * c-decl.c (duplicate_decls): Preserve pure and malloc attributes. * cp/decl.c (duplicate_decls): Preserve pure and malloc attributes. * f/com.c (duplicate_decls): Preserve pure and malloc attributes. * doc/extend.texi: Document these new built-in functions. * gcc.dg/builtins-13.c: New test case. * gcc.dg/builtins-14.c: New test case. From-SVN: r65560
Diffstat (limited to 'gcc/calls.c')
-rw-r--r--gcc/calls.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index ffb8a21..1dc5fc5 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -665,9 +665,6 @@ emit_call_1 (funexp, fndecl, funtype, stack_size, rounded_stack_size,
Similarly set LONGJMP for if the function is in the longjmp family.
- Set MALLOC for any of the standard memory allocation functions which
- allocate from the heap.
-
Set MAY_BE_ALLOCA for any memory allocation function that might allocate
space from the stack such as alloca. */
@@ -747,19 +744,6 @@ special_function_p (fndecl, flags)
|| ((tname[5] == 'p' || tname[5] == 'e')
&& tname[6] == '\0'))))
flags |= ECF_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.
- 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 (TYPE_MODE (TREE_TYPE (TREE_TYPE (fndecl))) == Pmode
- && (! strcmp (tname, "malloc")
- || ! strcmp (tname, "calloc")
- || ! strcmp (tname, "strdup")))
- flags |= ECF_MALLOC;
}
return flags;
}