diff options
| author | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-04-01 20:26:18 +0000 | 
|---|---|---|
| committer | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-04-01 20:26:18 +0000 | 
| commit | 9b86eec0d9a47e85df68310b598bf14075a1e326 (patch) | |
| tree | c7580c1e88743ac267d338426669e9cd12ea3bed /gcc | |
| parent | 4588bbd8785340a884b4b2fc43fb595e69a95e7e (diff) | |
| download | ppe42-gcc-9b86eec0d9a47e85df68310b598bf14075a1e326.tar.gz ppe42-gcc-9b86eec0d9a47e85df68310b598bf14075a1e326.zip  | |
	* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51705 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
| -rw-r--r-- | gcc/ChangeLog | 17 | ||||
| -rw-r--r-- | gcc/ada/ChangeLog | 11 | ||||
| -rw-r--r-- | gcc/ada/decl.c | 2 | ||||
| -rw-r--r-- | gcc/ada/gigi.h | 4 | ||||
| -rw-r--r-- | gcc/ada/misc.c | 2 | ||||
| -rw-r--r-- | gcc/ada/trans.c | 9 | ||||
| -rw-r--r-- | gcc/ada/utils.c | 2 | ||||
| -rw-r--r-- | gcc/ada/utils2.c | 22 | ||||
| -rw-r--r-- | gcc/c-decl.c | 2 | ||||
| -rw-r--r-- | gcc/c-lang.c | 2 | ||||
| -rw-r--r-- | gcc/c-tree.h | 1 | ||||
| -rw-r--r-- | gcc/c-typeck.c | 31 | ||||
| -rw-r--r-- | gcc/calls.c | 6 | ||||
| -rw-r--r-- | gcc/cp/ChangeLog | 16 | ||||
| -rw-r--r-- | gcc/cp/call.c | 2 | ||||
| -rw-r--r-- | gcc/cp/class.c | 2 | ||||
| -rw-r--r-- | gcc/cp/cp-lang.c | 2 | ||||
| -rw-r--r-- | gcc/cp/cp-tree.h | 1 | ||||
| -rw-r--r-- | gcc/cp/decl.c | 4 | ||||
| -rw-r--r-- | gcc/cp/decl2.c | 2 | ||||
| -rw-r--r-- | gcc/cp/except.c | 2 | ||||
| -rw-r--r-- | gcc/cp/init.c | 2 | ||||
| -rw-r--r-- | gcc/cp/pt.c | 2 | ||||
| -rw-r--r-- | gcc/cp/semantics.c | 4 | ||||
| -rw-r--r-- | gcc/cp/typeck.c | 32 | ||||
| -rw-r--r-- | gcc/expr.c | 2 | ||||
| -rw-r--r-- | gcc/f/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/f/com.c | 19 | ||||
| -rw-r--r-- | gcc/java/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/java/java-tree.h | 1 | ||||
| -rw-r--r-- | gcc/java/lang.c | 2 | ||||
| -rw-r--r-- | gcc/java/typeck.c | 16 | ||||
| -rw-r--r-- | gcc/langhooks-def.h | 1 | ||||
| -rw-r--r-- | gcc/langhooks.h | 5 | ||||
| -rw-r--r-- | gcc/objc/objc-lang.c | 2 | ||||
| -rw-r--r-- | gcc/stmt.c | 4 | ||||
| -rw-r--r-- | gcc/tree.h | 1 | 
37 files changed, 163 insertions, 84 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b9b882cea24..d06f8cf2e5a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 8e7367f6cb4..545940f97f0 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,16 @@  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):  	Rename.  	* misc.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE, diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c index 32cd00e318c..adf1d35744b 100644 --- a/gcc/ada/decl.c +++ b/gcc/ada/decl.c @@ -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);  	  } diff --git a/gcc/ada/gigi.h b/gcc/ada/gigi.h index 32fcaef7c41..7342117620f 100644 --- a/gcc/ada/gigi.h +++ b/gcc/ada/gigi.h @@ -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.  */ diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c index 866afc3a023..520b02948ab 100644 --- a/gcc/ada/misc.c +++ b/gcc/ada/misc.c @@ -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 diff --git a/gcc/ada/trans.c b/gcc/ada/trans.c index 19c7b01bbf7..371f7f2be2b 100644 --- a/gcc/ada/trans.c +++ b/gcc/ada/trans.c @@ -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) diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c index 58b7af6445a..556e0128a9c 100644 --- a/gcc/ada/utils.c +++ b/gcc/ada/utils.c @@ -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); diff --git a/gcc/ada/utils2.c b/gcc/ada/utils2.c index 2872474bac8..0e8ada4041a 100644 --- a/gcc/ada/utils2.c +++ b/gcc/ada/utils2.c @@ -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;      }  } diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 773beda7827..acb71e589c1 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -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); diff --git a/gcc/c-lang.c b/gcc/c-lang.c index 735017b1fa7..278a252bffd 100644 --- a/gcc/c-lang.c +++ b/gcc/c-lang.c @@ -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 diff --git a/gcc/c-tree.h b/gcc/c-tree.h index 12ae456adb8..503e0451912 100644 --- a/gcc/c-tree.h +++ b/gcc/c-tree.h @@ -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)); diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 2c7a89a83a9..7bca9aad5fe 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -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); diff --git a/gcc/calls.c b/gcc/calls.c index cbeb92c20aa..197914a9e7a 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -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;  	  }        } diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6f5c203e6de..8527f0a9204 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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: diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 8804a61f61e..1a74f748368 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -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); diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 1bba932455c..8ce3fc7ab46 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -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;      } diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c index b330fd1021c..f4d3cb02682 100644 --- a/gcc/cp/cp-lang.c +++ b/gcc/cp/cp-lang.c @@ -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 diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index b7aab09d313..dbd95550242 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -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)); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 5ac75fcf615..b2b501a7f0f 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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);  	} diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 95dc8e023db..2eece8aed05 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -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, diff --git a/gcc/cp/except.c b/gcc/cp/except.c index 8cbbfa916cb..b2d9fe007ab 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -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);  	} diff --git a/gcc/cp/init.c b/gcc/cp/init.c index de3fd2c39c3..10098e72cfa 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -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;      } diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index e1b6c375113..d28298a56a3 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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; diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 29e49fa92c0..8666d7f02c4 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -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)), diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index a68f4a2110a..d379809b81e 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -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;      }  } diff --git a/gcc/expr.c b/gcc/expr.c index cbbcff1a08b..6f1a0d62eef 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -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); diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog index 2f0318caf5f..e0fbdcde40f 100644 --- a/gcc/f/ChangeLog +++ b/gcc/f/ChangeLog @@ -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, diff --git a/gcc/f/com.c b/gcc/f/com.c index fed208c5263..97d245aa4a0 100644 --- a/gcc/f/com.c +++ b/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;        }  } diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 269bdc2c68a..8b5ef4ebac7 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,5 +1,11 @@  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.  	* java-tree.h (java_signed_type, java_unsigned_type,  	java_signed_or_unsigned_type): Update. diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h index 4a55281b2e8..ae26b61cda1 100644 --- a/gcc/java/java-tree.h +++ b/gcc/java/java-tree.h @@ -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)); diff --git a/gcc/java/lang.c b/gcc/java/lang.c index 05b5cedf624..53e11beaed3 100644 --- a/gcc/java/lang.c +++ b/gcc/java/lang.c @@ -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 diff --git a/gcc/java/typeck.c b/gcc/java/typeck.c index 5afa5a45879..108f3fbbe1d 100644 --- a/gcc/java/typeck.c +++ b/gcc/java/typeck.c @@ -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;      }  } diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h index 8e3ac96c0ea..c922e22a127 100644 --- a/gcc/langhooks-def.h +++ b/gcc/langhooks-def.h @@ -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, \ diff --git a/gcc/langhooks.h b/gcc/langhooks.h index c3e5a39a1f0..804e811d4b5 100644 --- a/gcc/langhooks.h +++ b/gcc/langhooks.h @@ -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)); diff --git a/gcc/objc/objc-lang.c b/gcc/objc/objc-lang.c index 322a66e3250..991ecd90060 100644 --- a/gcc/objc/objc-lang.c +++ b/gcc/objc/objc-lang.c @@ -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 diff --git a/gcc/stmt.c b/gcc/stmt.c index 2db32e87060..3f2d29c0858 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -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.  */ diff --git a/gcc/tree.h b/gcc/tree.h index 8abda682bdc..74eefe72ea7 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -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));  | 

