aboutsummaryrefslogtreecommitdiff
path: root/gcc/cse.c
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@redhat.com>2005-04-01 17:16:04 +0000
committerDiego Novillo <dnovillo@redhat.com>2005-04-01 17:16:04 +0000
commit2c1b41938630950e8699a2cbae3088b9c179f809 (patch)
treef93745f2390682fcf3269662fee7c5e14bf0d2d1 /gcc/cse.c
parent7b560836d28c028988edc3c1ccc7348bbfc91ac8 (diff)
Merge mainline->tcb as of 2005-03-29.tree-cleanup-branch
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@97408 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cse.c')
-rw-r--r--gcc/cse.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index fd5e21ac2ee..4d6f76d9328 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -1234,7 +1234,24 @@ insert_regs (rtx x, struct table_elt *classp, int modified)
if (REG_P (classp->exp)
&& GET_MODE (classp->exp) == GET_MODE (x))
{
- make_regs_eqv (regno, REGNO (classp->exp));
+ unsigned c_regno = REGNO (classp->exp);
+
+ gcc_assert (REGNO_QTY_VALID_P (c_regno));
+
+ /* Suppose that 5 is hard reg and 100 and 101 are
+ pseudos. Consider
+
+ (set (reg:si 100) (reg:si 5))
+ (set (reg:si 5) (reg:si 100))
+ (set (reg:di 101) (reg:di 5))
+
+ We would now set REG_QTY (101) = REG_QTY (5), but the
+ entry for 5 is in SImode. When we use this later in
+ copy propagation, we get the register in wrong mode. */
+ if (qty_table[REG_QTY (c_regno)].mode != GET_MODE (x))
+ continue;
+
+ make_regs_eqv (regno, c_regno);
return 1;
}