summaryrefslogtreecommitdiff
path: root/gcc/loop.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-13 07:41:45 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-13 07:41:45 +0000
commit73b691760b7d6cee9dcae91b750da54111d292a9 (patch)
treed1257f9eca533414f42e43fe6d3e0fc749d0f580 /gcc/loop.c
parent5c0913b4c7b4d6796981d57a717036531d114874 (diff)
downloadgcc-73b691760b7d6cee9dcae91b750da54111d292a9.tar.gz
* loop.c (basic_induction_var): Don't call convert_modes if mode
classes are different. * gcc.c-torture/compile/20020309-2.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50721 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/loop.c')
-rw-r--r--gcc/loop.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/loop.c b/gcc/loop.c
index 3108b032498..6617608cfd3 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -6214,10 +6214,11 @@ basic_induction_var (loop, x, mode, dest_reg, p, inc_val, mult_val, location)
case CONST:
/* convert_modes aborts if we try to convert to or from CCmode, so just
exclude that case. It is very unlikely that a condition code value
- would be a useful iterator anyways. */
+ would be a useful iterator anyways. convert_modes aborts if we try to
+ convert a float mode to non-float or vice versa too. */
if (loop->level == 1
- && GET_MODE_CLASS (mode) != MODE_CC
- && GET_MODE_CLASS (GET_MODE (dest_reg)) != MODE_CC)
+ && GET_MODE_CLASS (mode) == GET_MODE_CLASS (GET_MODE (dest_reg))
+ && GET_MODE_CLASS (mode) != MODE_CC)
{
/* Possible bug here? Perhaps we don't know the mode of X. */
*inc_val = convert_modes (GET_MODE (dest_reg), mode, x, 0);