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
This commit is contained in:
Jim Wilson 1998-12-08 22:08:13 +00:00 committed by Jim Wilson
parent 31c2486198
commit 7a3c92a596
2 changed files with 10 additions and 1 deletions

View File

@ -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

View File

@ -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; \