aboutsummaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2002-02-14 19:30:42 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2002-02-14 19:30:42 +0000
commit9a360704f9edf14fd0dd3a04dcf16923164c09b2 (patch)
tree637c1d0aecd771902516754e8b88d908a13dfb1b /gcc/combine.c
parent4606272bc4fd9daccd4723530a650822a8527671 (diff)
downloadgcc-9a360704f9edf14fd0dd3a04dcf16923164c09b2.zip
gcc-9a360704f9edf14fd0dd3a04dcf16923164c09b2.tar.gz
gcc-9a360704f9edf14fd0dd3a04dcf16923164c09b2.tar.bz2
combine.c (known_cond): After replacing the REG of a SUBREG, try to simplify it.
* combine.c (known_cond): After replacing the REG of a SUBREG, try to simplify it. From-SVN: r49775
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index ba0bf35..5abda2e 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -7430,6 +7430,25 @@ known_cond (x, cond, reg, val)
}
}
}
+ else if (code == SUBREG)
+ {
+ enum machine_mode inner_mode = GET_MODE (SUBREG_REG (x));
+ rtx new, r = known_cond (SUBREG_REG (x), cond, reg, val);
+
+ if (SUBREG_REG (x) != r)
+ {
+ /* We must simplify subreg here, before we lose track of the
+ original inner_mode. */
+ new = simplify_subreg (GET_MODE (x), r,
+ inner_mode, SUBREG_BYTE (x));
+ if (new)
+ return new;
+ else
+ SUBST (SUBREG_REG (x), r);
+ }
+
+ return x;
+ }
fmt = GET_RTX_FORMAT (code);
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)