From c762ab6ebb62bc1e1d93b6d81b83737e39df2c01 Mon Sep 17 00:00:00 2001 From: "J\"orn Rennecke" Date: Thu, 20 Sep 2001 14:25:11 +0000 Subject: [PATCH] sh.c (shiftcosts): Don't use shiftcosts array for modes wider than SImode. * sh.c (shiftcosts): Don't use shiftcosts array for modes wider than SImode. From-SVN: r45709 --- gcc/ChangeLog | 5 +++++ gcc/config/sh/sh.c | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1b17a43b660..587e5d9d107 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Thu Sep 20 12:49:34 2001 J"orn Rennecke + + * sh.c (shiftcosts): Don't use shiftcosts array for modes wider + than SImode. + Thu Sep 20 09:00:27 2001 Richard Kenner * stor-layout.c (layout_type, case ARRAY_TYPE): Kludge to disable diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index fa39c743bca..53f8b1227e2 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -1019,6 +1019,16 @@ shiftcosts (x) { int value; + if (GET_MODE_SIZE (GET_MODE (x)) > UNITS_PER_WORD) + { + if (GET_MODE (x) == DImode + && GET_CODE (XEXP (x, 1)) == CONST_INT + && INTVAL (XEXP (x, 1)) == 1) + return 2; + + /* Everything else is invalid, because there is no pattern for it. */ + return 10000; + } /* If shift by a non constant, then this will be expensive. */ if (GET_CODE (XEXP (x, 1)) != CONST_INT) return SH_DYNAMIC_SHIFT_COST;