c-decl.c (grokdeclarator): Update.
* c-decl.c (grokdeclarator): Update. * c-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine. * c-tree.h (c_mark_addressable): New. * c-typeck.c (default_function_array_conversion, build_unary_op, build_array_ref, convert_for_assignment): Update. (mark_addressable): Rename. * calls.c (try_to_integrate, expand_call): Use langhook. * expr.c (expand_expr): Use langhook. * langhooks-def.h (LANG_HOOKS_INITIALIZER): Update. * langhooks.h (struct lang_hooks): New hook. * stmt.c (expand_asm_operands): Use langhook. * tree.h (mark_addressable): Remove. ada: * decl.c (gnat_to_gnu_entity): Update. * gigi.h (mark_addressable): Rename. * misc.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine. * trans.c (tree_transform): Update. * utils.c (create_var_decl): Update. * util2.c (build_binary_op, build_unary_op, fill_vms_descriptor): Update. (mark_addressable): Rename, update. cp: * call.c (build_addr_func): Update. * class.c (resolve_address_of_overloaded_function): Update. * cp-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine. * cp-tree.h (cxx_mark_addressable): New. * decl.c (register_dtor_fn, cxx_maybe_build_cleanup): Update. * decl2.c (build_cleanup): Update. * except.c (build_throw): Update. * init.c (resolve_offset_ref): Update. * pt.c (convert_nontype_argument): Update. * semantics.c (finish_asm_stmt, simplify_affr_init_exprs_r): Update. * typeck.c (decay_conversion, build_array_ref, build_unary_op, unary_complex_lvalue): Update. (mark_addressable): Rename. f: * com.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine. (mark_addressable): Rename. (ffecom_arrayref_, ffecom_1): Update. java: * java-tree.h (java_mark_addressable): New. * lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine. * typeck.c (mark_addressable): Rename, update. objc: * objc-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine. From-SVN: r51705
This commit is contained in:
parent
544ef5b5df
commit
dffd7eb68a
|
@ -1,3 +1,20 @@
|
|||
2002-04-01 Neil Booth <neil@daikokuya.demon.co.uk>
|
||||
|
||||
* c-decl.c (grokdeclarator): Update.
|
||||
* c-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
|
||||
* c-tree.h (c_mark_addressable): New.
|
||||
* c-typeck.c (default_function_array_conversion, build_unary_op,
|
||||
build_array_ref, convert_for_assignment): Update.
|
||||
(mark_addressable): Rename.
|
||||
* calls.c (try_to_integrate, expand_call): Use langhook.
|
||||
* expr.c (expand_expr): Use langhook.
|
||||
* langhooks-def.h (LANG_HOOKS_INITIALIZER): Update.
|
||||
* langhooks.h (struct lang_hooks): New hook.
|
||||
* stmt.c (expand_asm_operands): Use langhook.
|
||||
* tree.h (mark_addressable): Remove.
|
||||
objc:
|
||||
* objc-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
|
||||
|
||||
2002-04-01 Bob Wilson <bob.wilson@acm.org>
|
||||
|
||||
* config/xtensa/xtensa.c (xtensa_va_arg): Fix compiler warning
|
||||
|
|
|
@ -1,3 +1,14 @@
|
|||
2002-04-01 Neil Booth <neil@daikokuya.demon.co.uk>
|
||||
|
||||
* decl.c (gnat_to_gnu_entity): Update.
|
||||
* gigi.h (mark_addressable): Rename.
|
||||
* misc.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
|
||||
* trans.c (tree_transform): Update.
|
||||
* utils.c (create_var_decl): Update.
|
||||
* util2.c (build_binary_op, build_unary_op,
|
||||
fill_vms_descriptor): Update.
|
||||
(mark_addressable): Rename, update.
|
||||
|
||||
2002-04-01 Neil Booth <neil@daikokuya.demon.co.uk>
|
||||
|
||||
* gigi.h (unsigned_type, signed_type, signed_or_unsigned_type):
|
||||
|
|
|
@ -1055,7 +1055,7 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition)
|
|||
if (Has_Nested_Block_With_Handler (Scope (gnat_entity))
|
||||
&& Exception_Mechanism != GCC_ZCX)
|
||||
{
|
||||
mark_addressable (gnu_decl);
|
||||
gnat_mark_addressable (gnu_decl);
|
||||
flush_addressof (gnu_decl);
|
||||
}
|
||||
|
||||
|
|
|
@ -727,8 +727,8 @@ extern tree build_allocator PARAMS((tree, tree, tree, Entity_Id,
|
|||
extern tree fill_vms_descriptor PARAMS((tree, Entity_Id));
|
||||
|
||||
/* Indicate that we need to make the address of EXPR_NODE and it therefore
|
||||
should not be allocated in a register. Return 1 if successful. */
|
||||
extern int mark_addressable PARAMS((tree));
|
||||
should not be allocated in a register. Return true if successful. */
|
||||
extern bool gnat_mark_addressable PARAMS((tree));
|
||||
|
||||
/* These functions return the basic data type sizes and related parameters
|
||||
about the target machine. */
|
||||
|
|
|
@ -114,6 +114,8 @@ static rtx gnat_expand_expr PARAMS ((tree, rtx, enum machine_mode,
|
|||
#define LANG_HOOKS_GET_ALIAS_SET gnat_get_alias_set
|
||||
#undef LANG_HOOKS_EXPAND_EXPR
|
||||
#define LANG_HOOKS_EXPAND_EXPR gnat_expand_expr
|
||||
#undef LANG_HOOKS_MARK_ADDRESSABLE
|
||||
#define LANG_HOOKS_MARK_ADDRESSABLE gnat_mark_addressable
|
||||
#undef LANG_HOOKS_PRINT_DECL
|
||||
#define LANG_HOOKS_PRINT_DECL gnat_print_decl
|
||||
#undef LANG_HOOKS_PRINT_TYPE
|
||||
|
|
|
@ -421,7 +421,7 @@ tree_transform (gnat_node)
|
|||
right now. */
|
||||
if (TREE_VALUE (gnu_except_ptr_stack) != 0)
|
||||
{
|
||||
mark_addressable (gnu_result);
|
||||
gnat_mark_addressable (gnu_result);
|
||||
flush_addressof (gnu_result);
|
||||
}
|
||||
|
||||
|
@ -4764,9 +4764,10 @@ convert_with_check (gnat_type, gnu_expr, overflow_p, range_p, truncate_p)
|
|||
return convert (gnu_type, gnu_result);
|
||||
}
|
||||
|
||||
/* Return 1 if GNU_EXPR can be directly addressed. This is the case unless
|
||||
it is an expression involving computation or if it involves a bitfield
|
||||
reference. This returns the same as mark_addressable in most cases. */
|
||||
/* Return 1 if GNU_EXPR can be directly addressed. This is the case
|
||||
unless it is an expression involving computation or if it involves
|
||||
a bitfield reference. This returns the same as
|
||||
gnat_mark_addressable in most cases. */
|
||||
|
||||
static int
|
||||
addressable_p (gnu_expr)
|
||||
|
|
|
@ -1361,7 +1361,7 @@ create_var_decl (var_name, asm_name, type, var_init, const_flag, public_flag,
|
|||
|
||||
/* If this is volatile, force it into memory. */
|
||||
if (TREE_SIDE_EFFECTS (var_decl))
|
||||
mark_addressable (var_decl);
|
||||
gnat_mark_addressable (var_decl);
|
||||
|
||||
if (TREE_CODE (var_decl) != CONST_DECL)
|
||||
rest_of_decl_compilation (var_decl, 0, global_bindings_p (), 0);
|
||||
|
|
|
@ -817,7 +817,7 @@ build_binary_op (op_code, result_type, left_operand, right_operand)
|
|||
if (! TREE_CONSTANT (right_operand)
|
||||
|| ! TREE_CONSTANT (TYPE_MIN_VALUE (right_type))
|
||||
|| op_code == ARRAY_RANGE_REF)
|
||||
mark_addressable (left_operand);
|
||||
gnat_mark_addressable (left_operand);
|
||||
|
||||
modulus = 0;
|
||||
break;
|
||||
|
@ -1238,7 +1238,7 @@ build_unary_op (op_code, result_type, operand)
|
|||
if (type != error_mark_node)
|
||||
operation_type = build_pointer_type (type);
|
||||
|
||||
mark_addressable (operand);
|
||||
gnat_mark_addressable (operand);
|
||||
result = fold (build1 (ADDR_EXPR, operation_type, operand));
|
||||
}
|
||||
|
||||
|
@ -1991,7 +1991,7 @@ fill_vms_descriptor (expr, gnat_formal)
|
|||
tree const_list = 0;
|
||||
|
||||
expr = maybe_unconstrained_array (expr);
|
||||
mark_addressable (expr);
|
||||
gnat_mark_addressable (expr);
|
||||
|
||||
for (field = TYPE_FIELDS (record_type); field; field = TREE_CHAIN (field))
|
||||
{
|
||||
|
@ -2009,10 +2009,10 @@ fill_vms_descriptor (expr, gnat_formal)
|
|||
}
|
||||
|
||||
/* Indicate that we need to make the address of EXPR_NODE and it therefore
|
||||
should not be allocated in a register. Return 1 if successful. */
|
||||
should not be allocated in a register. Returns true if successful. */
|
||||
|
||||
int
|
||||
mark_addressable (expr_node)
|
||||
bool
|
||||
gnat_mark_addressable (expr_node)
|
||||
tree expr_node;
|
||||
{
|
||||
while (1)
|
||||
|
@ -2030,24 +2030,24 @@ mark_addressable (expr_node)
|
|||
|
||||
case CONSTRUCTOR:
|
||||
TREE_ADDRESSABLE (expr_node) = 1;
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
case VAR_DECL:
|
||||
case PARM_DECL:
|
||||
case RESULT_DECL:
|
||||
put_var_into_stack (expr_node);
|
||||
TREE_ADDRESSABLE (expr_node) = 1;
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
case FUNCTION_DECL:
|
||||
TREE_ADDRESSABLE (expr_node) = 1;
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
case CONST_DECL:
|
||||
return (DECL_CONST_CORRESPONDING_VAR (expr_node) != 0
|
||||
&& (mark_addressable
|
||||
&& (gnat_mark_addressable
|
||||
(DECL_CONST_CORRESPONDING_VAR (expr_node))));
|
||||
default:
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5022,7 +5022,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
|
|||
Otherwise, the fact that those components are volatile
|
||||
will be ignored, and would even crash the compiler. */
|
||||
if (C_TYPE_FIELDS_VOLATILE (TREE_TYPE (decl)))
|
||||
mark_addressable (decl);
|
||||
c_mark_addressable (decl);
|
||||
|
||||
decl_attributes (&decl, returned_attrs, 0);
|
||||
|
||||
|
|
|
@ -54,6 +54,8 @@ static void c_post_options PARAMS ((void));
|
|||
#define LANG_HOOKS_MARK_TREE c_mark_tree
|
||||
#undef LANG_HOOKS_EXPAND_EXPR
|
||||
#define LANG_HOOKS_EXPAND_EXPR c_expand_expr
|
||||
#undef LANG_HOOKS_MARK_ADDRESSABLE
|
||||
#define LANG_HOOKS_MARK_ADDRESSABLE c_mark_addressable
|
||||
#undef LANG_HOOKS_PARSE_FILE
|
||||
#define LANG_HOOKS_PARSE_FILE c_common_parse_file
|
||||
#undef LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES
|
||||
|
|
|
@ -248,6 +248,7 @@ extern tree require_complete_type PARAMS ((tree));
|
|||
extern int comptypes PARAMS ((tree, tree));
|
||||
extern tree c_sizeof_nowarn PARAMS ((tree));
|
||||
extern tree c_size_in_bytes PARAMS ((tree));
|
||||
extern bool c_mark_addressable PARAMS ((tree));
|
||||
extern tree build_component_ref PARAMS ((tree, tree));
|
||||
extern tree build_indirect_ref PARAMS ((tree, const char *));
|
||||
extern tree build_array_ref PARAMS ((tree, tree));
|
||||
|
|
|
@ -932,7 +932,7 @@ default_function_array_conversion (exp)
|
|||
is not the target type of the type of the ADDR_EXPR itself.
|
||||
Question is, can this lossage be avoided? */
|
||||
adr = build1 (ADDR_EXPR, ptrtype, exp);
|
||||
if (mark_addressable (exp) == 0)
|
||||
if (!c_mark_addressable (exp))
|
||||
return error_mark_node;
|
||||
TREE_CONSTANT (adr) = staticp (exp);
|
||||
TREE_SIDE_EFFECTS (adr) = 0; /* Default would be, same as EXP. */
|
||||
|
@ -1317,7 +1317,7 @@ build_array_ref (array, index)
|
|||
|| (COMPLETE_TYPE_P (TREE_TYPE (TREE_TYPE (array)))
|
||||
&& TREE_CODE (TYPE_SIZE (TREE_TYPE (TREE_TYPE (array)))) != INTEGER_CST))
|
||||
{
|
||||
if (mark_addressable (array) == 0)
|
||||
if (!c_mark_addressable (array))
|
||||
return error_mark_node;
|
||||
}
|
||||
/* An array that is indexed by a constant value which is not within
|
||||
|
@ -1328,7 +1328,7 @@ build_array_ref (array, index)
|
|||
&& TYPE_VALUES (TREE_TYPE (array))
|
||||
&& ! int_fits_type_p (index, TYPE_VALUES (TREE_TYPE (array))))
|
||||
{
|
||||
if (mark_addressable (array) == 0)
|
||||
if (!c_mark_addressable (array))
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -2991,7 +2991,7 @@ build_unary_op (code, xarg, flag)
|
|||
/* For &x[y], return x+y */
|
||||
if (TREE_CODE (arg) == ARRAY_REF)
|
||||
{
|
||||
if (mark_addressable (TREE_OPERAND (arg, 0)) == 0)
|
||||
if (!c_mark_addressable (TREE_OPERAND (arg, 0)))
|
||||
return error_mark_node;
|
||||
return build_binary_op (PLUS_EXPR, TREE_OPERAND (arg, 0),
|
||||
TREE_OPERAND (arg, 1), 1);
|
||||
|
@ -3046,7 +3046,7 @@ build_unary_op (code, xarg, flag)
|
|||
|
||||
argtype = build_pointer_type (argtype);
|
||||
|
||||
if (mark_addressable (arg) == 0)
|
||||
if (!c_mark_addressable (arg))
|
||||
return error_mark_node;
|
||||
|
||||
{
|
||||
|
@ -3265,13 +3265,14 @@ readonly_warning (arg, msgid)
|
|||
|
||||
/* Mark EXP saying that we need to be able to take the
|
||||
address of it; it should not be allocated in a register.
|
||||
Value is 1 if successful. */
|
||||
Returns true if successful. */
|
||||
|
||||
int
|
||||
mark_addressable (exp)
|
||||
bool
|
||||
c_mark_addressable (exp)
|
||||
tree exp;
|
||||
{
|
||||
tree x = exp;
|
||||
|
||||
while (1)
|
||||
switch (TREE_CODE (x))
|
||||
{
|
||||
|
@ -3280,7 +3281,7 @@ mark_addressable (exp)
|
|||
{
|
||||
error ("cannot take address of bit-field `%s'",
|
||||
IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (x, 1))));
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* ... fall through ... */
|
||||
|
@ -3295,7 +3296,7 @@ mark_addressable (exp)
|
|||
case COMPOUND_LITERAL_EXPR:
|
||||
case CONSTRUCTOR:
|
||||
TREE_ADDRESSABLE (x) = 1;
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
case VAR_DECL:
|
||||
case CONST_DECL:
|
||||
|
@ -3308,7 +3309,7 @@ mark_addressable (exp)
|
|||
{
|
||||
error ("global register variable `%s' used in nested function",
|
||||
IDENTIFIER_POINTER (DECL_NAME (x)));
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
pedwarn ("register variable `%s' used in nested function",
|
||||
IDENTIFIER_POINTER (DECL_NAME (x)));
|
||||
|
@ -3319,7 +3320,7 @@ mark_addressable (exp)
|
|||
{
|
||||
error ("address of global register variable `%s' requested",
|
||||
IDENTIFIER_POINTER (DECL_NAME (x)));
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* If we are making this addressable due to its having
|
||||
|
@ -3330,7 +3331,7 @@ mark_addressable (exp)
|
|||
else if (C_TYPE_FIELDS_VOLATILE (TREE_TYPE (x)))
|
||||
{
|
||||
error ("cannot put object with volatile field into register");
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
pedwarn ("address of register variable `%s' requested",
|
||||
|
@ -3347,7 +3348,7 @@ mark_addressable (exp)
|
|||
#endif
|
||||
|
||||
default:
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4037,7 +4038,7 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum)
|
|||
error ("cannot pass rvalue to reference parameter");
|
||||
return error_mark_node;
|
||||
}
|
||||
if (mark_addressable (rhs) == 0)
|
||||
if (!c_mark_addressable (rhs))
|
||||
return error_mark_node;
|
||||
rhs = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (rhs)), rhs);
|
||||
|
||||
|
|
|
@ -1903,7 +1903,7 @@ try_to_integrate (fndecl, actparms, target, ignore, type, structure_value_addr)
|
|||
warning_with_decl (fndecl, "inlining failed in call to `%s'");
|
||||
warning ("called from here");
|
||||
}
|
||||
mark_addressable (fndecl);
|
||||
(*lang_hooks.mark_addressable) (fndecl);
|
||||
return (rtx) (size_t) - 1;
|
||||
}
|
||||
|
||||
|
@ -2209,7 +2209,7 @@ expand_call (exp, target, ignore)
|
|||
warning_with_decl (fndecl, "can't inline call to `%s'");
|
||||
warning ("called from here");
|
||||
}
|
||||
mark_addressable (fndecl);
|
||||
(*lang_hooks.mark_addressable) (fndecl);
|
||||
}
|
||||
|
||||
flags |= flags_from_decl_or_type (fndecl);
|
||||
|
@ -2255,7 +2255,7 @@ expand_call (exp, target, ignore)
|
|||
/* In case this is a static function, note that it has been
|
||||
used. */
|
||||
if (! TREE_ADDRESSABLE (fndecl))
|
||||
mark_addressable (fndecl);
|
||||
(*lang_hooks.mark_addressable) (fndecl);
|
||||
is_integrable = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
2002-04-01 Neil Booth <neil@daikokuya.demon.co.uk>
|
||||
|
||||
* call.c (build_addr_func): Update.
|
||||
* class.c (resolve_address_of_overloaded_function): Update.
|
||||
* cp-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
|
||||
* cp-tree.h (cxx_mark_addressable): New.
|
||||
* decl.c (register_dtor_fn, cxx_maybe_build_cleanup): Update.
|
||||
* decl2.c (build_cleanup): Update.
|
||||
* except.c (build_throw): Update.
|
||||
* init.c (resolve_offset_ref): Update.
|
||||
* pt.c (convert_nontype_argument): Update.
|
||||
* semantics.c (finish_asm_stmt, simplify_affr_init_exprs_r): Update.
|
||||
* typeck.c (decay_conversion, build_array_ref, build_unary_op,
|
||||
unary_complex_lvalue): Update.
|
||||
(mark_addressable): Rename.
|
||||
|
||||
2002-04-01 Roger Sayle <roger@eyesopen.com>
|
||||
|
||||
PR c++/5998:
|
||||
|
|
|
@ -355,7 +355,7 @@ build_addr_func (function)
|
|||
|
||||
type = build_pointer_type (type);
|
||||
|
||||
if (mark_addressable (function) == 0)
|
||||
if (!cxx_mark_addressable (function))
|
||||
return error_mark_node;
|
||||
|
||||
addr = build1 (ADDR_EXPR, type, function);
|
||||
|
|
|
@ -6061,7 +6061,7 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'",
|
|||
/* The target must be a REFERENCE_TYPE. Above, build_unary_op
|
||||
will mark the function as addressed, but here we must do it
|
||||
explicitly. */
|
||||
mark_addressable (fn);
|
||||
cxx_mark_addressable (fn);
|
||||
|
||||
return fn;
|
||||
}
|
||||
|
|
|
@ -67,6 +67,8 @@ static bool ok_to_generate_alias_set_for_type PARAMS ((tree));
|
|||
#define LANG_HOOKS_MARK_TREE cxx_mark_tree
|
||||
#undef LANG_HOOKS_UNSAFE_FOR_REEVAL
|
||||
#define LANG_HOOKS_UNSAFE_FOR_REEVAL c_common_unsafe_for_reeval
|
||||
#undef LANG_HOOKS_MARK_ADDRESSABLE
|
||||
#define LANG_HOOKS_MARK_ADDRESSABLE cxx_mark_addressable
|
||||
#undef LANG_HOOKS_PRINT_STATISTICS
|
||||
#define LANG_HOOKS_PRINT_STATISTICS cxx_print_statistics
|
||||
#undef LANG_HOOKS_PRINT_XNODE
|
||||
|
|
|
@ -3672,6 +3672,7 @@ extern tree pushdecl PARAMS ((tree));
|
|||
extern void cxx_init_decl_processing PARAMS ((void));
|
||||
extern void cxx_mark_tree PARAMS ((tree));
|
||||
extern void cxx_insert_default_attributes PARAMS ((tree));
|
||||
extern bool cxx_mark_addressable PARAMS ((tree));
|
||||
extern int toplevel_bindings_p PARAMS ((void));
|
||||
extern int namespace_bindings_p PARAMS ((void));
|
||||
extern void keep_next_level PARAMS ((int));
|
||||
|
|
|
@ -8546,7 +8546,7 @@ register_dtor_fn (decl)
|
|||
end_cleanup_fn ();
|
||||
|
||||
/* Call atexit with the cleanup function. */
|
||||
mark_addressable (cleanup);
|
||||
cxx_mark_addressable (cleanup);
|
||||
cleanup = build_unary_op (ADDR_EXPR, cleanup, 0);
|
||||
if (flag_use_cxa_atexit)
|
||||
{
|
||||
|
@ -14531,7 +14531,7 @@ cxx_maybe_build_cleanup (decl)
|
|||
rval = decl;
|
||||
else
|
||||
{
|
||||
mark_addressable (decl);
|
||||
cxx_mark_addressable (decl);
|
||||
rval = build_unary_op (ADDR_EXPR, decl, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -2567,7 +2567,7 @@ build_cleanup (decl)
|
|||
temp = decl;
|
||||
else
|
||||
{
|
||||
mark_addressable (decl);
|
||||
cxx_mark_addressable (decl);
|
||||
temp = build1 (ADDR_EXPR, build_pointer_type (type), decl);
|
||||
}
|
||||
temp = build_delete (TREE_TYPE (temp), temp,
|
||||
|
|
|
@ -756,7 +756,7 @@ build_throw (exp)
|
|||
complete_dtor_identifier, 0);
|
||||
cleanup = TREE_VALUE (cleanup);
|
||||
mark_used (cleanup);
|
||||
mark_addressable (cleanup);
|
||||
cxx_mark_addressable (cleanup);
|
||||
/* Pretend it's a normal function. */
|
||||
cleanup = build1 (ADDR_EXPR, cleanup_type, cleanup);
|
||||
}
|
||||
|
|
|
@ -1796,7 +1796,7 @@ resolve_offset_ref (exp)
|
|||
|| TREE_CODE (TREE_TYPE (member)) == FUNCTION_TYPE)
|
||||
{
|
||||
/* These were static members. */
|
||||
if (mark_addressable (member) == 0)
|
||||
if (!cxx_mark_addressable (member))
|
||||
return error_mark_node;
|
||||
return member;
|
||||
}
|
||||
|
|
|
@ -3154,7 +3154,7 @@ convert_nontype_argument (type, expr)
|
|||
return error_mark_node;
|
||||
}
|
||||
|
||||
mark_addressable (expr);
|
||||
cxx_mark_addressable (expr);
|
||||
return build1 (ADDR_EXPR, type, expr);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -944,7 +944,7 @@ finish_asm_stmt (cv_qualifier, string, output_operands,
|
|||
DECL_RTL for the OPERAND -- which we don't have at this
|
||||
point. */
|
||||
if (!allows_reg && DECL_P (operand))
|
||||
mark_addressable (operand);
|
||||
cxx_mark_addressable (operand);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2204,7 +2204,7 @@ simplify_aggr_init_exprs_r (tp, walk_subtrees, data)
|
|||
{
|
||||
/* Replace the first argument with the address of the third
|
||||
argument to the AGGR_INIT_EXPR. */
|
||||
mark_addressable (slot);
|
||||
cxx_mark_addressable (slot);
|
||||
args = tree_cons (NULL_TREE,
|
||||
build1 (ADDR_EXPR,
|
||||
build_pointer_type (TREE_TYPE (slot)),
|
||||
|
|
|
@ -1726,7 +1726,7 @@ decay_conversion (exp)
|
|||
is not the target type of the type of the ADDR_EXPR itself.
|
||||
Question is, can this lossage be avoided? */
|
||||
adr = build1 (ADDR_EXPR, ptrtype, exp);
|
||||
if (mark_addressable (exp) == 0)
|
||||
if (!cxx_mark_addressable (exp))
|
||||
return error_mark_node;
|
||||
TREE_CONSTANT (adr) = staticp (exp);
|
||||
TREE_SIDE_EFFECTS (adr) = 0; /* Default would be, same as EXP. */
|
||||
|
@ -2446,7 +2446,7 @@ build_array_ref (array, idx)
|
|||
&& (TREE_CODE (TYPE_SIZE (TREE_TYPE (TREE_TYPE (array))))
|
||||
!= INTEGER_CST)))
|
||||
{
|
||||
if (mark_addressable (array) == 0)
|
||||
if (!cxx_mark_addressable (array))
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -2458,7 +2458,7 @@ build_array_ref (array, idx)
|
|||
&& TYPE_VALUES (TREE_TYPE (array))
|
||||
&& ! int_fits_type_p (idx, TYPE_VALUES (TREE_TYPE (array))))
|
||||
{
|
||||
if (mark_addressable (array) == 0)
|
||||
if (!cxx_mark_addressable (array))
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -4539,7 +4539,7 @@ build_unary_op (code, xarg, noconvert)
|
|||
/* For &x[y], return x+y */
|
||||
if (TREE_CODE (arg) == ARRAY_REF)
|
||||
{
|
||||
if (mark_addressable (TREE_OPERAND (arg, 0)) == 0)
|
||||
if (!cxx_mark_addressable (TREE_OPERAND (arg, 0)))
|
||||
return error_mark_node;
|
||||
return cp_build_binary_op (PLUS_EXPR, TREE_OPERAND (arg, 0),
|
||||
TREE_OPERAND (arg, 1));
|
||||
|
@ -4627,7 +4627,7 @@ build_unary_op (code, xarg, noconvert)
|
|||
if (argtype != error_mark_node)
|
||||
argtype = build_pointer_type (argtype);
|
||||
|
||||
if (mark_addressable (arg) == 0)
|
||||
if (!cxx_mark_addressable (arg))
|
||||
return error_mark_node;
|
||||
|
||||
{
|
||||
|
@ -4811,18 +4811,18 @@ unary_complex_lvalue (code, arg)
|
|||
|
||||
/* Mark EXP saying that we need to be able to take the
|
||||
address of it; it should not be allocated in a register.
|
||||
Value is 1 if successful.
|
||||
Value is true if successful.
|
||||
|
||||
C++: we do not allow `current_class_ptr' to be addressable. */
|
||||
|
||||
int
|
||||
mark_addressable (exp)
|
||||
bool
|
||||
cxx_mark_addressable (exp)
|
||||
tree exp;
|
||||
{
|
||||
register tree x = exp;
|
||||
|
||||
if (TREE_ADDRESSABLE (x) == 1)
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
while (1)
|
||||
switch (TREE_CODE (x))
|
||||
|
@ -4840,7 +4840,7 @@ mark_addressable (exp)
|
|||
{
|
||||
error ("cannot take the address of `this', which is an rvalue expression");
|
||||
TREE_ADDRESSABLE (x) = 1; /* so compiler doesn't die later */
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
case VAR_DECL:
|
||||
/* Caller should not be trying to mark initialized
|
||||
|
@ -4857,24 +4857,24 @@ mark_addressable (exp)
|
|||
warning ("address requested for `%D', which is declared `register'",
|
||||
x);
|
||||
TREE_ADDRESSABLE (x) = 1;
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
case FUNCTION_DECL:
|
||||
TREE_ADDRESSABLE (x) = 1;
|
||||
TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (x)) = 1;
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
case CONSTRUCTOR:
|
||||
TREE_ADDRESSABLE (x) = 1;
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
case TARGET_EXPR:
|
||||
TREE_ADDRESSABLE (x) = 1;
|
||||
mark_addressable (TREE_OPERAND (x, 0));
|
||||
return 1;
|
||||
cxx_mark_addressable (TREE_OPERAND (x, 0));
|
||||
return true;
|
||||
|
||||
default:
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6247,7 +6247,7 @@ expand_expr (exp, target, tmode, modifier)
|
|||
DECL_NONLOCAL (exp) = 1;
|
||||
if (DECL_NO_STATIC_CHAIN (current_function_decl))
|
||||
abort ();
|
||||
mark_addressable (exp);
|
||||
(*lang_hooks.mark_addressable) (exp);
|
||||
if (GET_CODE (DECL_RTL (exp)) != MEM)
|
||||
abort ();
|
||||
addr = XEXP (DECL_RTL (exp), 0);
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
Mon Apr 1 21:39:36 2002 Neil Booth <neil@daikokuya.demon.co.uk>
|
||||
|
||||
* com.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
|
||||
(mark_addressable): Rename.
|
||||
(ffecom_arrayref_, ffecom_1): Update.
|
||||
|
||||
Mon Apr 1 09:59:53 2002 Neil Booth <neil@daikokuya.demon.co.uk>
|
||||
|
||||
* com.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
|
||||
|
|
19
gcc/f/com.c
19
gcc/f/com.c
|
@ -266,6 +266,7 @@ static tree ffe_type_for_size PARAMS ((unsigned int, int));
|
|||
static tree ffe_unsigned_type PARAMS ((tree));
|
||||
static tree ffe_signed_type PARAMS ((tree));
|
||||
static tree ffe_signed_or_unsigned_type PARAMS ((int, tree));
|
||||
static bool ffe_mark_addressable PARAMS ((tree));
|
||||
static void ffecom_init_decl_processing PARAMS ((void));
|
||||
static tree ffecom_arglist_expr_ (const char *argstring, ffebld args);
|
||||
static tree ffecom_widest_expr_type_ (ffebld list);
|
||||
|
@ -860,7 +861,7 @@ ffecom_arrayref_ (tree item, ffebld expr, int want_ptr)
|
|||
return item;
|
||||
|
||||
if (ffeinfo_where (ffebld_info (expr)) == FFEINFO_whereFLEETING
|
||||
&& ! mark_addressable (item))
|
||||
&& ! ffe_mark_addressable (item))
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -9531,7 +9532,7 @@ ffecom_1 (enum tree_code code, tree type, tree node)
|
|||
|
||||
if (code == ADDR_EXPR)
|
||||
{
|
||||
if (!mark_addressable (node))
|
||||
if (!ffe_mark_addressable (node))
|
||||
assert ("can't mark_addressable this node!" == NULL);
|
||||
}
|
||||
|
||||
|
@ -14227,6 +14228,8 @@ static void ffe_mark_tree (tree);
|
|||
#define LANG_HOOKS_PARSE_FILE ffe_parse_file
|
||||
#undef LANG_HOOKS_MARK_TREE
|
||||
#define LANG_HOOKS_MARK_TREE ffe_mark_tree
|
||||
#undef LANG_HOOKS_MARK_ADDRESSABLE
|
||||
#define LANG_HOOKS_MARK_ADDRESSABLE ffe_mark_addressable
|
||||
#undef LANG_HOOKS_PRINT_IDENTIFIER
|
||||
#define LANG_HOOKS_PRINT_IDENTIFIER ffe_print_identifier
|
||||
#undef LANG_HOOKS_DECL_PRINTABLE_NAME
|
||||
|
@ -14346,8 +14349,8 @@ ffe_init_options ()
|
|||
flag_complex_divide_method = 1;
|
||||
}
|
||||
|
||||
int
|
||||
mark_addressable (exp)
|
||||
static bool
|
||||
ffe_mark_addressable (exp)
|
||||
tree exp;
|
||||
{
|
||||
register tree x = exp;
|
||||
|
@ -14362,7 +14365,7 @@ mark_addressable (exp)
|
|||
|
||||
case CONSTRUCTOR:
|
||||
TREE_ADDRESSABLE (x) = 1;
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
case VAR_DECL:
|
||||
case CONST_DECL:
|
||||
|
@ -14374,7 +14377,7 @@ mark_addressable (exp)
|
|||
if (TREE_PUBLIC (x))
|
||||
{
|
||||
assert ("address of global register var requested" == NULL);
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
assert ("address of register variable requested" == NULL);
|
||||
}
|
||||
|
@ -14383,7 +14386,7 @@ mark_addressable (exp)
|
|||
if (TREE_PUBLIC (x))
|
||||
{
|
||||
assert ("address of global register var requested" == NULL);
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
assert ("address of register var requested" == NULL);
|
||||
}
|
||||
|
@ -14398,7 +14401,7 @@ mark_addressable (exp)
|
|||
#endif
|
||||
|
||||
default:
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
2002-04-01 Neil Booth <neil@daikokuya.demon.co.uk>
|
||||
|
||||
* java-tree.h (java_mark_addressable): New.
|
||||
* lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
|
||||
* typeck.c (mark_addressable): Rename, update.
|
||||
|
||||
2002-04-01 Neil Booth <neil@daikokuya.demon.co.uk>
|
||||
|
||||
* expr.c (build_java_binop): Update.
|
||||
|
|
|
@ -1039,6 +1039,7 @@ struct lang_type
|
|||
extern void java_set_yydebug PARAMS ((int));
|
||||
extern void java_parse_file PARAMS ((void));
|
||||
extern void java_mark_tree PARAMS ((tree));
|
||||
extern bool java_mark_addressable PARAMS ((tree));
|
||||
extern tree java_type_for_mode PARAMS ((enum machine_mode, int));
|
||||
extern tree java_type_for_size PARAMS ((unsigned int, int));
|
||||
extern tree java_unsigned_type PARAMS ((tree));
|
||||
|
|
|
@ -229,6 +229,8 @@ static int dependency_tracking = 0;
|
|||
#define LANG_HOOKS_PARSE_FILE java_parse_file
|
||||
#undef LANG_HOOKS_MARK_TREE
|
||||
#define LANG_HOOKS_MARK_TREE java_mark_tree
|
||||
#undef LANG_HOOKS_MARK_ADDRESSABLE
|
||||
#define LANG_HOOKS_MARK_ADDRESSABLE java_mark_addressable
|
||||
#undef LANG_HOOKS_EXPAND_EXPR
|
||||
#define LANG_HOOKS_EXPAND_EXPR java_expand_expr
|
||||
#undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
|
||||
|
|
|
@ -263,10 +263,10 @@ java_unsigned_type (type)
|
|||
|
||||
/* Mark EXP saying that we need to be able to take the
|
||||
address of it; it should not be allocated in a register.
|
||||
Value is 1 if successful. */
|
||||
Value is true if successful. */
|
||||
|
||||
int
|
||||
mark_addressable (exp)
|
||||
bool
|
||||
java_mark_addressable (exp)
|
||||
tree exp;
|
||||
{
|
||||
register tree x = exp;
|
||||
|
@ -288,12 +288,12 @@ mark_addressable (exp)
|
|||
break;
|
||||
|
||||
case COND_EXPR:
|
||||
return mark_addressable (TREE_OPERAND (x, 1))
|
||||
& mark_addressable (TREE_OPERAND (x, 2));
|
||||
return java_mark_addressable (TREE_OPERAND (x, 1))
|
||||
&& java_mark_addressable (TREE_OPERAND (x, 2));
|
||||
|
||||
case CONSTRUCTOR:
|
||||
TREE_ADDRESSABLE (x) = 1;
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
case INDIRECT_REF:
|
||||
/* We sometimes add a cast *(TYPE*)&FOO to handle type and mode
|
||||
|
@ -309,7 +309,7 @@ mark_addressable (exp)
|
|||
x = TREE_OPERAND (x, 0);
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
case VAR_DECL:
|
||||
case CONST_DECL:
|
||||
|
@ -323,7 +323,7 @@ mark_addressable (exp)
|
|||
#endif
|
||||
/* drops through */
|
||||
default:
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -203,6 +203,7 @@ int lhd_tree_dump_type_quals PARAMS ((tree));
|
|||
LANG_HOOKS_SAFE_FROM_P, \
|
||||
LANG_HOOKS_FINISH_INCOMPLETE_DECL, \
|
||||
LANG_HOOKS_UNSAFE_FOR_REEVAL, \
|
||||
LANG_HOOKS_MARK_ADDRESSABLE, \
|
||||
LANG_HOOKS_STATICP, \
|
||||
LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, \
|
||||
LANG_HOOKS_UNSAVE_EXPR_NOW, \
|
||||
|
|
|
@ -218,6 +218,11 @@ struct lang_hooks
|
|||
through. The default hook returns a negative number. */
|
||||
int (*unsafe_for_reeval) PARAMS ((tree));
|
||||
|
||||
/* Mark EXP saying that we need to be able to take the address of
|
||||
it; it should not be allocated in a register. Return true if
|
||||
successful. */
|
||||
bool (*mark_addressable) PARAMS ((tree));
|
||||
|
||||
/* Hook called by staticp for language-specific tree codes. */
|
||||
int (*staticp) PARAMS ((tree));
|
||||
|
||||
|
|
|
@ -50,6 +50,8 @@ static void objc_post_options PARAMS ((void));
|
|||
#define LANG_HOOKS_MARK_TREE c_mark_tree
|
||||
#undef LANG_HOOKS_EXPAND_EXPR
|
||||
#define LANG_HOOKS_EXPAND_EXPR c_expand_expr
|
||||
#undef LANG_HOOKS_MARK_ADDRESSABLE
|
||||
#define LANG_HOOKS_MARK_ADDRESSABLE c_mark_addressable
|
||||
#undef LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES
|
||||
#define LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES c_insert_default_attributes
|
||||
#undef LANG_HOOKS_FINISH_INCOMPLETE_DECL
|
||||
|
|
|
@ -1678,7 +1678,7 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
|
|||
|| (DECL_P (val)
|
||||
&& GET_CODE (DECL_RTL (val)) == REG
|
||||
&& GET_MODE (DECL_RTL (val)) != TYPE_MODE (type))))
|
||||
mark_addressable (val);
|
||||
(*lang_hooks.mark_addressable) (val);
|
||||
|
||||
if (is_inout)
|
||||
ninout++;
|
||||
|
@ -1707,7 +1707,7 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
|
|||
return;
|
||||
|
||||
if (! allows_reg && allows_mem)
|
||||
mark_addressable (TREE_VALUE (tail));
|
||||
(*lang_hooks.mark_addressable) (TREE_VALUE (tail));
|
||||
}
|
||||
|
||||
/* Second pass evaluates arguments. */
|
||||
|
|
|
@ -2947,7 +2947,6 @@ extern int lang_attribute_common;
|
|||
|
||||
/* In front end. */
|
||||
|
||||
extern int mark_addressable PARAMS ((tree));
|
||||
extern void incomplete_type_error PARAMS ((tree, tree));
|
||||
extern tree truthvalue_conversion PARAMS ((tree));
|
||||
|
||||
|
|
Loading…
Reference in New Issue