aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@cygnus.com>1998-12-08 22:08:13 +0000
committerJim Wilson <wilson@gcc.gnu.org>1998-12-08 14:08:13 -0800
commit7a3c92a5968ea274e16e23a4eaa56a62ae94839f (patch)
treeaa31d5192cffe1803c8a8a2a0e73ee24385bd206 /gcc
parent31c24861989997f2820d77da7a2af88887f34708 (diff)
downloadgcc-7a3c92a5968ea274e16e23a4eaa56a62ae94839f.zip
gcc-7a3c92a5968ea274e16e23a4eaa56a62ae94839f.tar.gz
gcc-7a3c92a5968ea274e16e23a4eaa56a62ae94839f.tar.bz2
Fix bug found by i960 simulator testing.
* i960/i960.h (CONST_COSTS, case CONST_INT): Accept power2_operand only when OUTER_CODE is SET. From-SVN: r24199
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/i960/i960.h6
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b2c8ae7..3b58772 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Tue Dec 8 22:04:33 1998 Jim Wilson <wilson@cygnus.com>
+
+ * i960/i960.h (CONST_COSTS, case CONST_INT): Accept power2_operand
+ only when OUTER_CODE is SET.
+
Tue Dec 8 22:47:15 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
* loop.c (strength_reduce): If scan_start points to the loop exit
diff --git a/gcc/config/i960/i960.h b/gcc/config/i960/i960.h
index 5889a41..627dfb0 100644
--- a/gcc/config/i960/i960.h
+++ b/gcc/config/i960/i960.h
@@ -1190,10 +1190,14 @@ extern struct rtx_def *gen_compare_reg ();
that can be non-ldconst operands in rare cases are cost 1. Other constants
have higher costs. */
+/* Must check for OUTER_CODE of SET for power2_operand, because
+ reload_cse_move2add calls us with OUTER_CODE of PLUS to decide when
+ to replace set with add. */
+
#define CONST_COSTS(RTX, CODE, OUTER_CODE) \
case CONST_INT: \
if ((INTVAL (RTX) >= 0 && INTVAL (RTX) < 32) \
- || power2_operand (RTX, VOIDmode)) \
+ || (OUTER_CODE == SET && power2_operand (RTX, VOIDmode))) \
return 0; \
else if (INTVAL (RTX) >= -31 && INTVAL (RTX) < 0) \
return 1; \