aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJames E Wilson <wilson@specifixinc.com>2003-12-20 02:39:43 +0000
committerJim Wilson <wilson@gcc.gnu.org>2003-12-19 18:39:43 -0800
commita06f01ba1e9b964c14ed6c63b56102d34ec6c45f (patch)
treeefcdb3a3200c268a6543afc46e842ac9d31ecbed /gcc
parent020036b90ebb42cee83694d332800d98960f9e6b (diff)
downloadgcc-a06f01ba1e9b964c14ed6c63b56102d34ec6c45f.zip
gcc-a06f01ba1e9b964c14ed6c63b56102d34ec6c45f.tar.gz
gcc-a06f01ba1e9b964c14ed6c63b56102d34ec6c45f.tar.bz2
Patch for asm clobber of fp.
* flow.c (mark_set_regs, case PARALLEL): Scan loop forwards. Add case for ASM_OPERANDS. * global.c (global_alloc): Set regs_ever_live for regs_asm_clobbered registers. From-SVN: r74869
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/flow.c8
-rw-r--r--gcc/global.c6
3 files changed, 20 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5528fd7..eea65d3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2003-12-19 James E Wilson <wilson@specifixinc.com>
+
+ * flow.c (mark_set_regs, case PARALLEL): Scan loop forwards.
+ Add case for ASM_OPERANDS.
+ * global.c (global_alloc): Set regs_ever_live for regs_asm_clobbered
+ registers.
+
2003-12-19 Kazu Hirata <kazu@cs.umass.edu>
* expr.c (check_max_integer_computation_mode): Remove.
diff --git a/gcc/flow.c b/gcc/flow.c
index 023fb1c..c146310 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -2468,7 +2468,9 @@ mark_set_regs (struct propagate_block_info *pbi, rtx x, rtx insn)
{
int i;
- for (i = XVECLEN (x, 0) - 1; i >= 0; i--)
+ /* We must scan forwards. If we have an asm, we need to set
+ the PROP_ASM_SCAN flag before scanning the clobbers. */
+ for (i = 0; i < XVECLEN (x, 0); i++)
{
rtx sub = XVECEXP (x, 0, i);
switch (code = GET_CODE (sub))
@@ -2495,6 +2497,10 @@ mark_set_regs (struct propagate_block_info *pbi, rtx x, rtx insn)
mark_set_1 (pbi, code, SET_DEST (sub), cond, insn, flags);
break;
+ case ASM_OPERANDS:
+ flags |= PROP_ASM_SCAN;
+ break;
+
default:
break;
}
diff --git a/gcc/global.c b/gcc/global.c
index d19e87e..de765b3 100644
--- a/gcc/global.c
+++ b/gcc/global.c
@@ -355,6 +355,8 @@ global_alloc (FILE *file)
else if (cannot_elim)
error ("%s cannot be used in asm here",
reg_names[eliminables[i].from]);
+ else
+ regs_ever_live[eliminables[i].from] = 1;
}
#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
if (!regs_asm_clobbered[HARD_FRAME_POINTER_REGNUM])
@@ -366,6 +368,8 @@ global_alloc (FILE *file)
else if (need_fp)
error ("%s cannot be used in asm here",
reg_names[HARD_FRAME_POINTER_REGNUM]);
+ else
+ regs_ever_live[HARD_FRAME_POINTER_REGNUM] = 1;
#endif
#else
@@ -377,6 +381,8 @@ global_alloc (FILE *file)
}
else if (need_fp)
error ("%s cannot be used in asm here", reg_names[FRAME_POINTER_REGNUM]);
+ else
+ regs_ever_live[FRAME_POINTER_REGNUM] = 1;
#endif
/* Track which registers have already been used. Start with registers