alias.c (find_base_value): Recognize TRUNCATE.
authorJ"orn Rennecke <amylaar@redhat.com>
Fri, 19 Jan 2001 09:20:14 +0000 (09:20 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Fri, 19 Jan 2001 09:20:14 +0000 (09:20 +0000)
* alias.c (find_base_value): Recognize TRUNCATE.
(record_set): In PLUS case, invalidate if other summand is also a
base value.

From-SVN: r39128

gcc/ChangeLog
gcc/alias.c

index 51cb1866feb988416a2fdb91d39c965a35b18e7c..6866f157e8de9b22cdb08c5d455f65ada0babacc 100644 (file)
@@ -1,3 +1,9 @@
+Fri Jan 19 09:18:42 2001  J"orn Rennecke <amylaar@redhat.com>
+
+       * alias.c (find_base_value): Recognize TRUNCATE.
+       (record_set): In PLUS case, invalidate if other summand is also a
+       base value.
+
 Thu Jan 18 06:43:04 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
        * flow.c (mark_set_1, case PARALLEL): Now case; rework to allow
index 235d299f42f6938ad18879e50960cb475be1f1f2..a77e7c8f7c1e93c203e7c0b0fbc724d3bb141cd2 100644 (file)
@@ -759,6 +759,10 @@ find_base_value (src)
        return find_base_value (XEXP (src, 0));
       return 0;
 
+    case TRUNCATE:
+      if (GET_MODE_SIZE (GET_MODE (src)) < GET_MODE_SIZE (Pmode))
+       break;
+      /* Fall through.  */
     case ZERO_EXTEND:
     case SIGN_EXTEND:  /* used for NT/Alpha pointers */
     case HIGH:
@@ -832,11 +836,26 @@ record_set (dest, set, data)
     switch (GET_CODE (src))
       {
       case LO_SUM:
-      case PLUS:
       case MINUS:
        if (XEXP (src, 0) != dest && XEXP (src, 1) != dest)
          new_reg_base_value[regno] = 0;
        break;
+      case PLUS:
+       /* If the value we add in the PLUS is also a valid base value,
+          this might be the actual base value, and the original value
+          an index.  */
+       {
+         rtx other = NULL_RTX;
+
+         if (XEXP (src, 0) == dest)
+           other = XEXP (src, 1);
+         else if (XEXP (src, 1) == dest)
+           other = XEXP (src, 0);
+
+         if (! other || find_base_value (other))
+           new_reg_base_value[regno] = 0;
+         break;
+       }
       case AND:
        if (XEXP (src, 0) != dest || GET_CODE (XEXP (src, 1)) != CONST_INT)
          new_reg_base_value[regno] = 0;