Fix bug found by i960 simulator testing.
authorJim Wilson <wilson@cygnus.com>
Tue, 8 Dec 1998 22:08:13 +0000 (22:08 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Tue, 8 Dec 1998 22:08:13 +0000 (14:08 -0800)
* i960/i960.h (CONST_COSTS, case CONST_INT): Accept power2_operand
only when OUTER_CODE is SET.

From-SVN: r24199

gcc/ChangeLog
gcc/config/i960/i960.h

index b2c8ae7598844cb555adf4b7342f0a6ee104aff1..3b587720ba8bb0cd7cfc67d5ffe2fd72a4fed191 100644 (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
index 5889a4193d8d9d7e4aab46552de412b5ba38b337..627dfb085f763331ce64f987ee418149e787cbb0 100644 (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;                                                                \