mirror of git://gcc.gnu.org/git/gcc.git
calls.c (precompute_arguments): Do not assume that temporaries can be destroyed after expanding the argument.
* calls.c (precompute_arguments): Do not assume that temporaries can be destroyed after expanding the argument. (expand_call): Likewise. From-SVN: r51011
This commit is contained in:
parent
9d5e46be34
commit
1929c971b9
|
|
@ -1,3 +1,9 @@
|
||||||
|
2002-03-18 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
|
* calls.c (precompute_arguments): Do not assume that temporaries
|
||||||
|
can be destroyed after expanding the argument.
|
||||||
|
(expand_call): Likewise.
|
||||||
|
|
||||||
2002-03-15 Eric Christopher <echristo@redhat.com>
|
2002-03-15 Eric Christopher <echristo@redhat.com>
|
||||||
|
|
||||||
* config/mips/mips.md (movdf_internal2): Add two new move constraints.
|
* config/mips/mips.md (movdf_internal2): Add two new move constraints.
|
||||||
|
|
|
||||||
11
gcc/calls.c
11
gcc/calls.c
|
|
@ -1511,14 +1511,9 @@ precompute_arguments (flags, num_actuals, args)
|
||||||
if (TREE_ADDRESSABLE (TREE_TYPE (args[i].tree_value)))
|
if (TREE_ADDRESSABLE (TREE_TYPE (args[i].tree_value)))
|
||||||
abort ();
|
abort ();
|
||||||
|
|
||||||
push_temp_slots ();
|
|
||||||
|
|
||||||
args[i].value
|
args[i].value
|
||||||
= expand_expr (args[i].tree_value, NULL_RTX, VOIDmode, 0);
|
= expand_expr (args[i].tree_value, NULL_RTX, VOIDmode, 0);
|
||||||
|
|
||||||
preserve_temp_slots (args[i].value);
|
|
||||||
pop_temp_slots ();
|
|
||||||
|
|
||||||
/* ANSI doesn't require a sequence point here,
|
/* ANSI doesn't require a sequence point here,
|
||||||
but PCC has one, so this will avoid some problems. */
|
but PCC has one, so this will avoid some problems. */
|
||||||
emit_queue ();
|
emit_queue ();
|
||||||
|
|
@ -2681,10 +2676,6 @@ expand_call (exp, target, ignore)
|
||||||
if (pass && (flags & ECF_LIBCALL_BLOCK))
|
if (pass && (flags & ECF_LIBCALL_BLOCK))
|
||||||
NO_DEFER_POP;
|
NO_DEFER_POP;
|
||||||
|
|
||||||
/* Push the temporary stack slot level so that we can free any
|
|
||||||
temporaries we make. */
|
|
||||||
push_temp_slots ();
|
|
||||||
|
|
||||||
#ifdef FINAL_REG_PARM_STACK_SPACE
|
#ifdef FINAL_REG_PARM_STACK_SPACE
|
||||||
reg_parm_stack_space = FINAL_REG_PARM_STACK_SPACE (args_size.constant,
|
reg_parm_stack_space = FINAL_REG_PARM_STACK_SPACE (args_size.constant,
|
||||||
args_size.var);
|
args_size.var);
|
||||||
|
|
@ -3334,8 +3325,6 @@ expand_call (exp, target, ignore)
|
||||||
if ((flags & ECF_MAY_BE_ALLOCA) && nonlocal_goto_handler_slots != 0)
|
if ((flags & ECF_MAY_BE_ALLOCA) && nonlocal_goto_handler_slots != 0)
|
||||||
emit_stack_save (SAVE_NONLOCAL, &nonlocal_goto_stack_level, NULL_RTX);
|
emit_stack_save (SAVE_NONLOCAL, &nonlocal_goto_stack_level, NULL_RTX);
|
||||||
|
|
||||||
pop_temp_slots ();
|
|
||||||
|
|
||||||
/* Free up storage we no longer need. */
|
/* Free up storage we no longer need. */
|
||||||
for (i = 0; i < num_actuals; ++i)
|
for (i = 0; i < num_actuals; ++i)
|
||||||
if (args[i].aligned_regs)
|
if (args[i].aligned_regs)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,74 @@
|
||||||
|
// { dg-do run }
|
||||||
|
// { dg-options "-O2" }
|
||||||
|
|
||||||
|
extern "C" int printf (...);
|
||||||
|
|
||||||
|
struct _Deque_iterator {
|
||||||
|
int _M_cur;
|
||||||
|
int x[2];
|
||||||
|
int* _M_node;
|
||||||
|
|
||||||
|
_Deque_iterator() : _M_cur(0), _M_node(0) {}
|
||||||
|
_Deque_iterator(const _Deque_iterator& __x)
|
||||||
|
: _M_cur(__x._M_cur),
|
||||||
|
_M_node(__x._M_node) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
class _Deque_base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
int yy;
|
||||||
|
|
||||||
|
_Deque_base()
|
||||||
|
: _M_start()
|
||||||
|
{ _M_initialize_map(); }
|
||||||
|
~_Deque_base();
|
||||||
|
|
||||||
|
void _M_initialize_map();
|
||||||
|
_Deque_iterator _M_start;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
_Deque_base::~_Deque_base() {
|
||||||
|
printf ("bb %x %x\n", this, *_M_start._M_node);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_Deque_base::_M_initialize_map()
|
||||||
|
{
|
||||||
|
yy = 0x123;
|
||||||
|
printf ("aa %x %x\n", this, yy);
|
||||||
|
|
||||||
|
_M_start._M_node = &yy;
|
||||||
|
_M_start._M_cur = yy;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class deque : protected _Deque_base
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
deque () {}
|
||||||
|
deque(const deque& __x) {}
|
||||||
|
~deque() {
|
||||||
|
_Deque_iterator i = _M_start;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class GeometryAddress {
|
||||||
|
public:
|
||||||
|
GeometryAddress(deque addressStack) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
void yyy (const GeometryAddress& gb)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
deque temp1;
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
yyy (GeometryAddress (temp1));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue