aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2002-02-19 12:39:01 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2002-02-19 11:39:01 +0000
commitfd973d5630bb29a2a0a90aa325b26395b8882320 (patch)
tree222a2716de93e05a06cbe5eabc0d34f99a518c09
parent419a71d37c276fdc2dbd8e7487ca719861b62e75 (diff)
downloadgcc-fd973d5630bb29a2a0a90aa325b26395b8882320.zip
gcc-fd973d5630bb29a2a0a90aa325b26395b8882320.tar.gz
gcc-fd973d5630bb29a2a0a90aa325b26395b8882320.tar.bz2
* regmove.c (regmove_optimize): Avoid increasing of register pressure.
From-SVN: r49864
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/regmove.c26
2 files changed, 19 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ffb087c..b6f6a1c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+Tue Feb 19 12:37:23 CET 2002 Jan Hubicka <jh@suse.cz>
+
+ * regmove.c (regmove_optimize): Avoid increasing of register pressure.
+
2002-02-19 Neil Booth <neil@daikokuya.demon.co.uk>
PR other/5718
diff --git a/gcc/regmove.c b/gcc/regmove.c
index 9530128..aa1c17b 100644
--- a/gcc/regmove.c
+++ b/gcc/regmove.c
@@ -1328,19 +1328,22 @@ regmove_optimize (f, nregs, regmove_dump_file)
}
src_class = reg_preferred_class (REGNO (src));
dst_class = reg_preferred_class (REGNO (dst));
- if (! regclass_compatible_p (src_class, dst_class))
+
+ if (! (src_note = find_reg_note (insn, REG_DEAD, src)))
{
- if (!copy_src)
- {
- copy_src = src;
- copy_dst = dst;
- }
+ /* We used to force the copy here like in other cases, but
+ it produces worse code, as it eliminates no copy
+ instructions and the copy emitted will be produced by
+ reload anyway. On patterns with multiple alternatives,
+ there may be better sollution availble.
+
+ In particular this change produced slower code for numeric
+ i387 programs. */
+
continue;
}
- /* Can not modify an earlier insn to set dst if this insn
- uses an old value in the source. */
- if (reg_overlap_mentioned_p (dst, SET_SRC (set)))
+ if (! regclass_compatible_p (src_class, dst_class))
{
if (!copy_src)
{
@@ -1350,7 +1353,9 @@ regmove_optimize (f, nregs, regmove_dump_file)
continue;
}
- if (! (src_note = find_reg_note (insn, REG_DEAD, src)))
+ /* Can not modify an earlier insn to set dst if this insn
+ uses an old value in the source. */
+ if (reg_overlap_mentioned_p (dst, SET_SRC (set)))
{
if (!copy_src)
{
@@ -1360,7 +1365,6 @@ regmove_optimize (f, nregs, regmove_dump_file)
continue;
}
-
/* If src is set once in a different basic block,
and is set equal to a constant, then do not use
it for this optimization, as this would make it