aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-08-01 22:30:09 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2008-08-01 22:30:09 +0200
commit07b11a21bfa1377f1f27753eb3f04062c8b56312 (patch)
tree88ea4336cffc42d33feb4763070ca6eef8bb7e29 /gcc
parent35a84e137bfbcebb3da614c8a0cfd8aae3a3724f (diff)
downloadgcc-07b11a21bfa1377f1f27753eb3f04062c8b56312.zip
gcc-07b11a21bfa1377f1f27753eb3f04062c8b56312.tar.gz
gcc-07b11a21bfa1377f1f27753eb3f04062c8b56312.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/dwarf2out.c34
2 files changed, 34 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8ce1e66..fec4488 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+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>
* cfgexpand.c (expand_stack_alignment): Assert that
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 7e29d2a..e5128d4 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -1256,10 +1256,10 @@ compute_barrier_args_size (void)
{
while (!VEC_empty (rtx, worklist))
{
- rtx prev, body;
+ rtx prev, body, first_insn;
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)];
prev = prev_nonnote_insn (insn);
if (prev && BARRIER_P (prev))
@@ -1274,10 +1274,21 @@ compute_barrier_args_size (void)
if (LABEL_P (insn))
{
- gcc_assert (barrier_args_size[INSN_UID (insn)] < 0
- || barrier_args_size[INSN_UID (insn)]
+ if (insn == first_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);
- continue;
+ break;
+ }
}
body = PATTERN (insn);
@@ -1356,11 +1367,18 @@ dwarf2out_stack_adjust (rtx insn, bool after_p)
}
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 ();
- offset = barrier_args_size[INSN_UID (insn)];
- if (offset < 0)
+ if (barrier_args_size == NULL)
offset = 0;
+ else
+ {
+ offset = barrier_args_size[INSN_UID (insn)];
+ if (offset < 0)
+ offset = 0;
+ }
offset -= args_size;
#ifndef STACK_GROWS_DOWNWARD