Commit 07b11a21 by Jakub Jelinek Committed by Jakub Jelinek

dwarf2out.c (compute_barrier_args_size): Set barrier_args_size for labels for…

dwarf2out.c (compute_barrier_args_size): Set barrier_args_size for labels for which it hasn't been set yet.

	* dwarf2out.c (compute_barrier_args_size): Set barrier_args_size
	for labels for which it hasn't been set yet.  If it has been set,
	stop walking insns and continue with next worklist item.
	(dwarf2out_stack_adjust): Don't call compute_barrier_args_size
	if the only BARRIER is at the very end of a function.

From-SVN: r138537
parent 35a84e13
2008-08-01 Jakub Jelinek <jakub@redhat.com>
* dwarf2out.c (compute_barrier_args_size): Set barrier_args_size
for labels for which it hasn't been set yet. If it has been set,
stop walking insns and continue with next worklist item.
(dwarf2out_stack_adjust): Don't call compute_barrier_args_size
if the only BARRIER is at the very end of a function.
2008-08-01 H.J. Lu <hongjiu.lu@intel.com> 2008-08-01 H.J. Lu <hongjiu.lu@intel.com>
* cfgexpand.c (expand_stack_alignment): Assert that * cfgexpand.c (expand_stack_alignment): Assert that
......
...@@ -1256,10 +1256,10 @@ compute_barrier_args_size (void) ...@@ -1256,10 +1256,10 @@ compute_barrier_args_size (void)
{ {
while (!VEC_empty (rtx, worklist)) while (!VEC_empty (rtx, worklist))
{ {
rtx prev, body; rtx prev, body, first_insn;
HOST_WIDE_INT cur_args_size; HOST_WIDE_INT cur_args_size;
insn = VEC_pop (rtx, worklist); first_insn = insn = VEC_pop (rtx, worklist);
cur_args_size = barrier_args_size[INSN_UID (insn)]; cur_args_size = barrier_args_size[INSN_UID (insn)];
prev = prev_nonnote_insn (insn); prev = prev_nonnote_insn (insn);
if (prev && BARRIER_P (prev)) if (prev && BARRIER_P (prev))
...@@ -1274,10 +1274,21 @@ compute_barrier_args_size (void) ...@@ -1274,10 +1274,21 @@ compute_barrier_args_size (void)
if (LABEL_P (insn)) if (LABEL_P (insn))
{ {
gcc_assert (barrier_args_size[INSN_UID (insn)] < 0 if (insn == first_insn)
|| barrier_args_size[INSN_UID (insn)] continue;
else if (barrier_args_size[INSN_UID (insn)] < 0)
{
barrier_args_size[INSN_UID (insn)] = cur_args_size;
continue;
}
else
{
/* The insns starting with this label have been
already scanned or are in the worklist. */
gcc_assert (barrier_args_size[INSN_UID (insn)]
== cur_args_size); == cur_args_size);
continue; break;
}
} }
body = PATTERN (insn); body = PATTERN (insn);
...@@ -1356,11 +1367,18 @@ dwarf2out_stack_adjust (rtx insn, bool after_p) ...@@ -1356,11 +1367,18 @@ dwarf2out_stack_adjust (rtx insn, bool after_p)
} }
else if (BARRIER_P (insn)) else if (BARRIER_P (insn))
{ {
if (barrier_args_size == NULL) /* Don't call compute_barrier_args_size () if the only
BARRIER is at the end of function. */
if (barrier_args_size == NULL && next_nonnote_insn (insn))
compute_barrier_args_size (); compute_barrier_args_size ();
offset = barrier_args_size[INSN_UID (insn)]; if (barrier_args_size == NULL)
if (offset < 0)
offset = 0; offset = 0;
else
{
offset = barrier_args_size[INSN_UID (insn)];
if (offset < 0)
offset = 0;
}
offset -= args_size; offset -= args_size;
#ifndef STACK_GROWS_DOWNWARD #ifndef STACK_GROWS_DOWNWARD
......
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