aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2001-12-05 22:37:41 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2001-12-05 17:37:41 -0500
commit37a08a298f85099eda5290d250c95eaf707e6c6f (patch)
tree16fd35f587497e051ac05a7ae930fd07de7f29ba /gcc/builtins.c
parent0228de0c4f91cb2cc0381f2f2c403caab6e7d82e (diff)
downloadgcc-37a08a298f85099eda5290d250c95eaf707e6c6f.zip
gcc-37a08a298f85099eda5290d250c95eaf707e6c6f.tar.gz
gcc-37a08a298f85099eda5290d250c95eaf707e6c6f.tar.bz2
attribs.c (handle_no_check_memory_usage_atribute): Deleted.
* attribs.c (handle_no_check_memory_usage_atribute): Deleted. (c_com): Delete its reference. * builtins.c: Delete memory checking code. * calls.c, expr.c, function.c, stmt.c: Likewise. * builtins.c (expand_builtin_arg_info): Remove reference to EXPAND_MEMORY_USE_* modifiers. * explow.c (expr_size): Likewise. * expr.c (expand_expr, expand_increment): Likewise. * expr.h (ARGS_SIZE_RTX): Likewise. * function.c (assign_parms, expand_pending_sizeso): Likewise. * c-decl.c (duplicate_decls): Don't handle DECL_NO_CHECK_MEMORY_USAGE. * expr.c (in_check_memory_usage): Delete. (get_push_address, get_memory_usage_from_modifier): Delete. (expand_assigment): Use EXPAND_WRITE on destination. (expand_expr): Delete ro_modifier. * expr.h (expand_modifier): Delete EXPAND_MEMORY_* entries and add EXPAND_WRITE. (memory_use_mode): Delete. * flags.h (flag_check_memory_usage): Deleted. (flag_prefix_function_name): Likewise. * function.c (expand_function_start): Don't set current_function_check_memory_usage. * function.h (check_memory_usage): Delete. * libfuncs.h, optabs.c: Delete chkr_* stuff. * stmt.c (expand_asm_opernd): Change EXPAND_MEMORY_USE_WO to EXPAND_WRITE. * toplev.c (flag_check_memory_usage): Deleted. (flag_prefix_function_name): Likewise. (f_options, process_options): Delete references to above. * tree.h (DECL_NO_CHECK_MEMORY_USAGE): Deleted. * varasm.c (CHKR_PREFIX): Deleted. (make_decl_rtl): Remove flag_prefix_function_name handling. (assemble_name): Likewise. * doc/extend.texi: Remove no_check_memory_usage attribute. * doc/invoke.texi: Remove -fcheck-memory-usage and -fprefix-function-name. * cp/decl.c (duplicate_decls): Don't copy DECL_NO_CHECK_MEMORY_USAGE. From-SVN: r47697
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c77
1 files changed, 9 insertions, 68 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 6785ce5..68df170 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -1617,13 +1617,6 @@ expand_builtin_strlen (exp, target)
source operand later. */
before_strlen = get_last_insn();
- /* Check the string is readable and has an end. */
- if (current_function_check_memory_usage)
- emit_library_call (chkr_check_str_libfunc, LCT_CONST_MAKE_BLOCK,
- VOIDmode, 2, src_reg, Pmode,
- GEN_INT (MEMORY_USE_RO),
- TYPE_MODE (integer_type_node));
-
char_rtx = const0_rtx;
char_mode = insn_data[(int) icode].operand[2].mode;
if (! (*insn_data[(int) icode].operand[2].predicate) (char_rtx,
@@ -1672,8 +1665,7 @@ expand_builtin_strstr (arglist, target, mode)
rtx target;
enum machine_mode mode;
{
- if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)
- || current_function_check_memory_usage)
+ if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE))
return 0;
else
{
@@ -1729,8 +1721,7 @@ expand_builtin_strchr (arglist, target, mode)
rtx target;
enum machine_mode mode;
{
- if (!validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)
- || current_function_check_memory_usage)
+ if (!validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE))
return 0;
else
{
@@ -1776,8 +1767,7 @@ expand_builtin_strrchr (arglist, target, mode)
rtx target;
enum machine_mode mode;
{
- if (!validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)
- || current_function_check_memory_usage)
+ if (!validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE))
return 0;
else
{
@@ -1831,8 +1821,7 @@ expand_builtin_strpbrk (arglist, target, mode)
rtx target;
enum machine_mode mode;
{
- if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)
- || current_function_check_memory_usage)
+ if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE))
return 0;
else
{
@@ -1939,7 +1928,6 @@ expand_builtin_memcpy (arglist)
by pieces, we can avoid loading the string from memory
and only stored the computed constants. */
if (src_str
- && !current_function_check_memory_usage
&& GET_CODE (len_rtx) == CONST_INT
&& (unsigned HOST_WIDE_INT) INTVAL (len_rtx) <= strlen (src_str) + 1
&& can_store_by_pieces (INTVAL (len_rtx), builtin_memcpy_read_str,
@@ -1954,13 +1942,6 @@ expand_builtin_memcpy (arglist)
src_mem = get_memory_rtx (src);
set_mem_align (src_mem, src_align);
- /* Just copy the rights of SRC to the rights of DEST. */
- if (current_function_check_memory_usage)
- emit_library_call (chkr_copy_bitmap_libfunc, LCT_CONST_MAKE_BLOCK,
- VOIDmode, 3, XEXP (dest_mem, 0), Pmode,
- XEXP (src_mem, 0), Pmode,
- len_rtx, TYPE_MODE (sizetype));
-
/* Copy word part most expediently. */
dest_addr = emit_block_move (dest_mem, src_mem, len_rtx);
@@ -2143,10 +2124,9 @@ expand_builtin_memset (exp)
{
if (!host_integerp (len, 1))
return 0;
- if (current_function_check_memory_usage
- || !can_store_by_pieces (tree_low_cst (len, 1),
- builtin_memset_read_str,
- (PTR) &c, dest_align))
+ if (!can_store_by_pieces (tree_low_cst (len, 1),
+ builtin_memset_read_str, (PTR) &c,
+ dest_align))
return 0;
dest_mem = get_memory_rtx (dest);
@@ -2160,16 +2140,6 @@ expand_builtin_memset (exp)
dest_mem = get_memory_rtx (dest);
set_mem_align (dest_mem, dest_align);
-
- /* Just check DST is writable and mark it as readable. */
- if (current_function_check_memory_usage)
- emit_library_call (chkr_check_addr_libfunc, LCT_CONST_MAKE_BLOCK,
- VOIDmode, 3, XEXP (dest_mem, 0), Pmode,
- len_rtx, TYPE_MODE (sizetype),
- GEN_INT (MEMORY_USE_WO),
- TYPE_MODE (integer_type_node));
-
-
dest_addr = clear_storage (dest_mem, len_rtx);
if (dest_addr == 0)
@@ -2225,10 +2195,6 @@ expand_builtin_memcmp (exp, arglist, target)
tree arglist;
rtx target;
{
- /* If we need to check memory accesses, call the library function. */
- if (current_function_check_memory_usage)
- return 0;
-
if (!validate_arglist (arglist,
POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE))
return 0;
@@ -2309,10 +2275,6 @@ expand_builtin_strcmp (exp, target, mode)
tree arg1, arg2;
const char *p1, *p2;
- /* If we need to check memory accesses, call the library function. */
- if (current_function_check_memory_usage)
- return 0;
-
if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE))
return 0;
@@ -2414,10 +2376,6 @@ expand_builtin_strncmp (exp, target, mode)
tree arg1, arg2, arg3;
const char *p1, *p2;
- /* If we need to check memory accesses, call the library function. */
- if (current_function_check_memory_usage)
- return 0;
-
if (!validate_arglist (arglist,
POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE))
return 0;
@@ -2518,10 +2476,6 @@ expand_builtin_strcat (arglist, target, mode)
rtx target;
enum machine_mode mode;
{
- /* If we need to check memory accesses, call the library function. */
- if (current_function_check_memory_usage)
- return 0;
-
if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE))
return 0;
else
@@ -2548,10 +2502,6 @@ expand_builtin_strncat (arglist, target, mode)
rtx target;
enum machine_mode mode;
{
- /* If we need to check memory accesses, call the library function. */
- if (current_function_check_memory_usage)
- return 0;
-
if (!validate_arglist (arglist,
POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE))
return 0;
@@ -2605,10 +2555,6 @@ expand_builtin_strspn (arglist, target, mode)
rtx target;
enum machine_mode mode;
{
- /* If we need to check memory accesses, call the library function. */
- if (current_function_check_memory_usage)
- return 0;
-
if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE))
return 0;
else
@@ -2646,10 +2592,6 @@ expand_builtin_strcspn (arglist, target, mode)
rtx target;
enum machine_mode mode;
{
- /* If we need to check memory accesses, call the library function. */
- if (current_function_check_memory_usage)
- return 0;
-
if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE))
return 0;
else
@@ -2791,7 +2733,7 @@ expand_builtin_args_info (exp)
TREE_STATIC (result) = 1;
result = build1 (INDIRECT_REF, build_pointer_type (type), result);
TREE_CONSTANT (result) = 1;
- return expand_expr (result, NULL_RTX, VOIDmode, EXPAND_MEMORY_USE_BAD);
+ return expand_expr (result, NULL_RTX, VOIDmode, 0);
#endif
}
@@ -3280,8 +3222,7 @@ expand_builtin_fputs (arglist, ignore)
return 0;
/* Verify the arguments in the original call. */
- if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)
- || current_function_check_memory_usage)
+ if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE))
return 0;
/* Get the length of the string passed to fputs. If the length