aboutsummaryrefslogtreecommitdiff
path: root/gcc/except.c
diff options
context:
space:
mode:
authorJeff Sturm <jsturm@one-point.com>2001-09-17 23:16:28 +0000
committerJeff Sturm <jsturm@gcc.gnu.org>2001-09-17 23:16:28 +0000
commit5c701bb10c0655503db698572b537f3a3df8f9d1 (patch)
treedd7f6e080847210376fcad70b237cd3df3c4dce4 /gcc/except.c
parentc793eea7abb23067e67179546acfea0db28af1ae (diff)
downloadgcc-5c701bb10c0655503db698572b537f3a3df8f9d1.zip
gcc-5c701bb10c0655503db698572b537f3a3df8f9d1.tar.gz
gcc-5c701bb10c0655503db698572b537f3a3df8f9d1.tar.bz2
except.c (dw2_build_landing_pads): New local clobbers_hard_regs.
* except.c (dw2_build_landing_pads): New local clobbers_hard_regs. Emit an ASM_INPUT as a scheduling barrier after clobbers. Fixes c++/4012. From-SVN: r45667
Diffstat (limited to 'gcc/except.c')
-rw-r--r--gcc/except.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/except.c b/gcc/except.c
index 90423a7..bc21b2c 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -1865,6 +1865,7 @@ dw2_build_landing_pads ()
{
struct eh_region *region = cfun->eh->region_array[i];
rtx seq;
+ bool clobbers_hard_regs = false;
/* Mind we don't process a region more than once. */
if (!region || region->region_number != i)
@@ -1901,7 +1902,19 @@ dw2_build_landing_pads ()
if (r == INVALID_REGNUM)
break;
if (! call_used_regs[r])
- emit_insn (gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, r)));
+ {
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, r)));
+ clobbers_hard_regs = true;
+ }
+ }
+
+ if (clobbers_hard_regs)
+ {
+ /* @@@ This is a kludge. Not all machine descriptions define a
+ blockage insn, but we must not allow the code we just generated
+ to be reordered by scheduling. So emit an ASM_INPUT to act as
+ blockage insn. */
+ emit_insn (gen_rtx_ASM_INPUT (VOIDmode, ""));
}
emit_move_insn (cfun->eh->exc_ptr,