aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@cygnus.com>1998-10-08 12:52:52 +0000
committerJim Wilson <wilson@gcc.gnu.org>1998-10-08 05:52:52 -0700
commit12f289ac329fc5352af5b29e9455b119b511a4fe (patch)
treef6f01b92297685e3cc1ad90741078d39edbdaacd /gcc
parent1636b950f9efe5813f05777ea5a3b18046b0c618 (diff)
downloadgcc-12f289ac329fc5352af5b29e9455b119b511a4fe.zip
gcc-12f289ac329fc5352af5b29e9455b119b511a4fe.tar.gz
gcc-12f289ac329fc5352af5b29e9455b119b511a4fe.tar.bz2
Fix for powerpc/c4x problem with missed loop optimizations.
* loop.c (get_condition): Allow combine when either compare is VOIDmode. From-SVN: r22922
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/loop.c20
2 files changed, 20 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ac2222b..73e72b1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Thu Oct 8 12:50:47 1998 Jim Wilson <wilson@cygnus.com>
+
+ * loop.c (get_condition): Allow combine when either compare is
+ VOIDmode.
+
Thu Oct 8 11:31:01 PDT 1998 Jeff Law (law@cygnus.com)
* version.c: Bump for snapshot.
diff --git a/gcc/loop.c b/gcc/loop.c
index 4529946..dc4eaa9 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -7765,7 +7765,14 @@ get_condition (jump, earliest)
like Alpha that have an IEEE compliant EQ instruction, and
a non-IEEE compliant BEQ instruction. The use of CCmode is
actually artificial, simply to prevent the combination, but
- should not affect other platforms. */
+ should not affect other platforms.
+
+ However, we must allow VOIDmode comparisons to match either
+ CCmode or non-CCmode comparison, because some ports have
+ modeless comparisons inside branch patterns.
+
+ ??? This mode check should perhaps look more like the mode check
+ in simplify_comparison in combine. */
if ((GET_CODE (SET_SRC (set)) == COMPARE
|| (((code == NE
@@ -7783,8 +7790,9 @@ get_condition (jump, earliest)
#endif
))
&& GET_RTX_CLASS (GET_CODE (SET_SRC (set))) == '<'))
- && ((GET_MODE_CLASS (mode) == MODE_CC)
- == (GET_MODE_CLASS (inner_mode) == MODE_CC)))
+ && (((GET_MODE_CLASS (mode) == MODE_CC)
+ == (GET_MODE_CLASS (inner_mode) == MODE_CC))
+ || mode == VOIDmode || inner_mode == VOIDmode))
x = SET_SRC (set);
else if (((code == EQ
|| (code == GE
@@ -7801,8 +7809,10 @@ get_condition (jump, earliest)
#endif
))
&& GET_RTX_CLASS (GET_CODE (SET_SRC (set))) == '<'
- && ((GET_MODE_CLASS (mode) == MODE_CC)
- == (GET_MODE_CLASS (inner_mode) == MODE_CC)))
+ && (((GET_MODE_CLASS (mode) == MODE_CC)
+ == (GET_MODE_CLASS (inner_mode) == MODE_CC))
+ || mode == VOIDmode || inner_mode == VOIDmode))
+
{
/* We might have reversed a LT to get a GE here. But this wasn't
actually the comparison of data, so we don't flag that we