c4x.c (c4x_address_cost): Return cost of 1 for REG+REG addressing if strength reducti...
authorMichael Hayes <m.hayes@elec.canterbury.ac.nz>
Mon, 8 Feb 1999 13:50:22 +0000 (13:50 +0000)
committerMichael Hayes <m.hayes@gcc.gnu.org>
Mon, 8 Feb 1999 13:50:22 +0000 (13:50 +0000)
* config/c4x/c4x.c (c4x_address_cost): Return cost of 1 for
REG+REG addressing if strength reduction enabled.

From-SVN: r25086

gcc/ChangeLog
gcc/config/c4x/c4x.c

index 196d66ea24df55ac24bc24305f1159fcbcb4f6f5..c81dbb583cddcc548b8a6bbaa6deeaffba197f95 100644 (file)
@@ -1,3 +1,8 @@
+Tue Feb  9 10:46:42 1999  Michael Hayes  <m.hayes@elec.canterbury.ac.nz>
+
+       * config/c4x/c4x.c (c4x_address_cost): Return cost of 1 for
+       REG+REG addressing if strength reduction enabled.
+
 Tue Feb  9 10:10:31 1999  Michael Hayes  <m.hayes@elec.canterbury.ac.nz>
 
        * config/c4x/t-c4x  (LIBGCC2_CFLAGS): Delete.
index 2e4b941136ebdd89f3c92f13f78699c1e0c7c5e4..291c22dba5491b0374f4657b47500ee02dd42beb 100644 (file)
@@ -1508,6 +1508,14 @@ rtx addr;
            break;
 
          case REG:
+           /* Paradoxically, if we want autoincrement addressing for
+              complex arithmetic and structure arrays, we must give
+              REG+REG addressing the same cost as REG addressing to
+              prevent CSE from avoiding REG+REG addresses.  This is
+              because GIV combination in loop.c is suboptimal and
+              needs fixing.  */
+           if (flag_strength_reduce)
+             return 1;
            return 2;
 
          case CONST_INT: