aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2005-11-21 01:19:00 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2005-11-21 01:19:00 +0000
commit7cf3d079762588156f447a45a888fdb544ade528 (patch)
tree106b0a4bb98f19639b7050a889350329f74b64a2 /gcc
parentd116ffa6c26c2e431f9bf72db7b36e8ba84b8d04 (diff)
downloadgcc-7cf3d079762588156f447a45a888fdb544ade528.zip
gcc-7cf3d079762588156f447a45a888fdb544ade528.tar.gz
gcc-7cf3d079762588156f447a45a888fdb544ade528.tar.bz2
combine.c (try_combine): Do not run subst on i1src and i2src in the case of generating a PARALLEL for a...
* combine.c (try_combine): Do not run subst on i1src and i2src in the case of generating a PARALLEL for a comparison. From-SVN: r107273
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/combine.c64
2 files changed, 40 insertions, 29 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 765291e..bc2a54e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2005-11-20 Joseph S. Myers <joseph@codesourcery.com>
+
+ * combine.c (try_combine): Do not run subst on i1src and i2src in
+ the case of generating a PARALLEL for a comparison.
+
2005-11-20 Richard Henderson <rth@redhat.com>
PR 24931
diff --git a/gcc/combine.c b/gcc/combine.c
index b43b9b6..6497336 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -2080,35 +2080,6 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p)
subst_insn = i3;
- /* It is possible that the source of I2 or I1 may be performing an
- unneeded operation, such as a ZERO_EXTEND of something that is known
- to have the high part zero. Handle that case by letting subst look at
- the innermost one of them.
-
- Another way to do this would be to have a function that tries to
- simplify a single insn instead of merging two or more insns. We don't
- do this because of the potential of infinite loops and because
- of the potential extra memory required. However, doing it the way
- we are is a bit of a kludge and doesn't catch all cases.
-
- But only do this if -fexpensive-optimizations since it slows things down
- and doesn't usually win. */
-
- if (flag_expensive_optimizations)
- {
- /* Pass pc_rtx so no substitutions are done, just simplifications. */
- if (i1)
- {
- subst_low_cuid = INSN_CUID (i1);
- i1src = subst (i1src, pc_rtx, pc_rtx, 0, 0);
- }
- else
- {
- subst_low_cuid = INSN_CUID (i2);
- i2src = subst (i2src, pc_rtx, pc_rtx, 0, 0);
- }
- }
-
#ifndef HAVE_cc0
/* Many machines that don't use CC0 have insns that can both perform an
arithmetic operation and set the condition code. These operations will
@@ -2171,6 +2142,41 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p)
else
#endif
{
+ /* It is possible that the source of I2 or I1 may be performing
+ an unneeded operation, such as a ZERO_EXTEND of something
+ that is known to have the high part zero. Handle that case
+ by letting subst look at the innermost one of them.
+
+ Another way to do this would be to have a function that tries
+ to simplify a single insn instead of merging two or more
+ insns. We don't do this because of the potential of infinite
+ loops and because of the potential extra memory required.
+ However, doing it the way we are is a bit of a kludge and
+ doesn't catch all cases.
+
+ But only do this if -fexpensive-optimizations since it slows
+ things down and doesn't usually win.
+
+ This is not done in the COMPARE case above because the
+ unmodified I2PAT is used in the PARALLEL and so a pattern
+ with a modified I2SRC would not match. */
+
+ if (flag_expensive_optimizations)
+ {
+ /* Pass pc_rtx so no substitutions are done, just
+ simplifications. */
+ if (i1)
+ {
+ subst_low_cuid = INSN_CUID (i1);
+ i1src = subst (i1src, pc_rtx, pc_rtx, 0, 0);
+ }
+ else
+ {
+ subst_low_cuid = INSN_CUID (i2);
+ i2src = subst (i2src, pc_rtx, pc_rtx, 0, 0);
+ }
+ }
+
n_occurrences = 0; /* `subst' counts here */
/* If I1 feeds into I2 (not into I3) and I1DEST is in I1SRC, we