Commit d96a6d1a by Jason Merrill Committed by Jason Merrill

function.c (assign_parms): If TREE_ADDRESSABLE is set...

        * function.c (assign_parms): If TREE_ADDRESSABLE is set, try to
        give the parm a register and then call put_var_into_stack.
        * stmt.c (expand_decl): Likewise.

cp/
        * typeck.c (mark_addressable): Don't call put_var_into_stack.

From-SVN: r37396
parent 56964678
2000-11-11 Jason Merrill <jason@redhat.com>
* function.c (assign_parms): If TREE_ADDRESSABLE is set, try to
give the parm a register and then call put_var_into_stack.
* stmt.c (expand_decl): Likewise.
2000-11-11 Joseph S. Myers <jsm28@cam.ac.uk> 2000-11-11 Joseph S. Myers <jsm28@cam.ac.uk>
* gcc.texi: Adjust wording. * gcc.texi: Adjust wording.
......
2000-11-09 Jason Merrill <jason@redhat.com> 2000-11-11 Jason Merrill <jason@redhat.com>
* typeck.c (mark_addressable): Don't call put_var_into_stack.
* decl.c (maybe_commonize_var): Set DECL_UNINLINABLE for statics * decl.c (maybe_commonize_var): Set DECL_UNINLINABLE for statics
in inlines. in inlines.
......
...@@ -4904,7 +4904,6 @@ mark_addressable (exp) ...@@ -4904,7 +4904,6 @@ mark_addressable (exp)
if (! flag_this_is_variable) if (! flag_this_is_variable)
error ("cannot take the address of `this', which is an ravlue expression"); error ("cannot take the address of `this', which is an ravlue expression");
TREE_ADDRESSABLE (x) = 1; /* so compiler doesn't die later */ TREE_ADDRESSABLE (x) = 1; /* so compiler doesn't die later */
put_var_into_stack (x);
return 1; return 1;
} }
case VAR_DECL: case VAR_DECL:
...@@ -6797,7 +6796,7 @@ check_return_expr (retval) ...@@ -6797,7 +6796,7 @@ check_return_expr (retval)
/* First convert the value to the function's return type, then /* First convert the value to the function's return type, then
to the type of return value's location to handle the to the type of return value's location to handle the
case that functype is thiner than the valtype. */ case that functype is smaller than the valtype. */
retval = convert_for_initialization retval = convert_for_initialization
(NULL_TREE, functype, retval, LOOKUP_NORMAL|LOOKUP_ONLYCONVERTING, (NULL_TREE, functype, retval, LOOKUP_NORMAL|LOOKUP_ONLYCONVERTING,
"return", NULL_TREE, 0); "return", NULL_TREE, 0);
......
...@@ -4610,8 +4610,6 @@ assign_parms (fndecl) ...@@ -4610,8 +4610,6 @@ assign_parms (fndecl)
else if (! ((! optimize else if (! ((! optimize
&& ! DECL_REGISTER (parm) && ! DECL_REGISTER (parm)
&& ! DECL_INLINE (fndecl)) && ! DECL_INLINE (fndecl))
/* layout_decl may set this. */
|| TREE_ADDRESSABLE (parm)
|| TREE_SIDE_EFFECTS (parm) || TREE_SIDE_EFFECTS (parm)
/* If -ffloat-store specified, don't put explicit /* If -ffloat-store specified, don't put explicit
float variables into registers. */ float variables into registers. */
...@@ -4695,8 +4693,6 @@ assign_parms (fndecl) ...@@ -4695,8 +4693,6 @@ assign_parms (fndecl)
&& ! ((! optimize && ! ((! optimize
&& ! DECL_REGISTER (parm) && ! DECL_REGISTER (parm)
&& ! DECL_INLINE (fndecl)) && ! DECL_INLINE (fndecl))
/* layout_decl may set this. */
|| TREE_ADDRESSABLE (parm)
|| TREE_SIDE_EFFECTS (parm) || TREE_SIDE_EFFECTS (parm)
/* If -ffloat-store specified, don't put explicit /* If -ffloat-store specified, don't put explicit
float variables into registers. */ float variables into registers. */
...@@ -4865,6 +4861,9 @@ assign_parms (fndecl) ...@@ -4865,6 +4861,9 @@ assign_parms (fndecl)
mark_reg_pointer (parmreg, mark_reg_pointer (parmreg,
TYPE_ALIGN (TREE_TYPE (TREE_TYPE (parm)))); TYPE_ALIGN (TREE_TYPE (TREE_TYPE (parm))));
/* If something wants our address, try to use ADDRESSOF. */
if (TREE_ADDRESSABLE (parm))
put_var_into_stack (parm);
} }
else else
{ {
......
...@@ -3837,7 +3837,6 @@ expand_decl (decl) ...@@ -3837,7 +3837,6 @@ expand_decl (decl)
&& !(flag_float_store && !(flag_float_store
&& TREE_CODE (type) == REAL_TYPE) && TREE_CODE (type) == REAL_TYPE)
&& ! TREE_THIS_VOLATILE (decl) && ! TREE_THIS_VOLATILE (decl)
&& ! TREE_ADDRESSABLE (decl)
&& (DECL_REGISTER (decl) || optimize) && (DECL_REGISTER (decl) || optimize)
/* if -fcheck-memory-usage, check all variables. */ /* if -fcheck-memory-usage, check all variables. */
&& ! current_function_check_memory_usage) && ! current_function_check_memory_usage)
...@@ -3855,6 +3854,10 @@ expand_decl (decl) ...@@ -3855,6 +3854,10 @@ expand_decl (decl)
TYPE_ALIGN (TREE_TYPE (TREE_TYPE (decl)))); TYPE_ALIGN (TREE_TYPE (TREE_TYPE (decl))));
maybe_set_unchanging (DECL_RTL (decl), decl); maybe_set_unchanging (DECL_RTL (decl), decl);
/* If something wants our address, try to use ADDRESSOF. */
if (TREE_ADDRESSABLE (decl))
put_var_into_stack (decl);
} }
else if (TREE_CODE (DECL_SIZE_UNIT (decl)) == INTEGER_CST else if (TREE_CODE (DECL_SIZE_UNIT (decl)) == INTEGER_CST
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment