expr.c (get_inner_reference): Remove the array bias after converting the index to...
authorRichard Henderson <rth@cygnus.com>
Sun, 26 Oct 1997 16:13:10 +0000 (08:13 -0800)
committerJeff Law <law@gcc.gnu.org>
Sun, 26 Oct 1997 16:13:10 +0000 (09:13 -0700)
        * expr.c (get_inner_reference): Remove the array bias after
        converting the index to Pmode.

From-SVN: r16178

gcc/ChangeLog
gcc/expr.c

index 2abf40892dea139d2911e7a5ab93c93174cc0f24..80d231e2f13ce5385f4be4dfb2860ff6c8cdc791 100644 (file)
@@ -1,3 +1,8 @@
+Sun Oct 26 09:15:15 1997  Richard Henderson  <rth@cygnus.com>
+
+       * expr.c (get_inner_reference): Remove the array bias after 
+       converting the index to Pmode.
+
 Sat Oct 25 12:20:58 1997  Jeffrey A Law  (law@cygnus.com)
 
        * mn10300.h (TARGET_SWITCHES): Add -mmult-bug and -mno-mult-bug.
index 91d682a93fd8b783b2d90ade00a7c7afc7206848..920ffbc2461650850f151730ef3a5ec00c30ec9e 100644 (file)
@@ -4345,9 +4345,6 @@ get_inner_reference (exp, pbitsize, pbitpos, poffset, pmode,
            = domain ? TYPE_MIN_VALUE (domain) : integer_zero_node;
          tree index_type = TREE_TYPE (index);
 
-         if (! integer_zerop (low_bound))
-           index = fold (build (MINUS_EXPR, index_type, index, low_bound));
-
          if (TYPE_PRECISION (index_type) != TYPE_PRECISION (sizetype))
            {
              index = convert (type_for_size (TYPE_PRECISION (sizetype), 0),
@@ -4355,6 +4352,9 @@ get_inner_reference (exp, pbitsize, pbitpos, poffset, pmode,
              index_type = TREE_TYPE (index);
            }
 
+         if (! integer_zerop (low_bound))
+           index = fold (build (MINUS_EXPR, index_type, index, low_bound));
+
          index = fold (build (MULT_EXPR, index_type, index,
                               convert (index_type,
                                        TYPE_SIZE (TREE_TYPE (exp)))));