aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@cygnus.com>1997-10-26 08:13:10 -0800
committerJeff Law <law@gcc.gnu.org>1997-10-26 09:13:10 -0700
commitca0f22208fdcfd30565f0163fdeab273af69456b (patch)
treed8c0ea63a4e3fb849109a7d77cd00ed7efb531dd
parenta6f7ba1798530b13d702814433761bf392e84796 (diff)
downloadgcc-ca0f22208fdcfd30565f0163fdeab273af69456b.zip
gcc-ca0f22208fdcfd30565f0163fdeab273af69456b.tar.gz
gcc-ca0f22208fdcfd30565f0163fdeab273af69456b.tar.bz2
expr.c (get_inner_reference): Remove the array bias after converting the index to Pmode.
* expr.c (get_inner_reference): Remove the array bias after converting the index to Pmode. From-SVN: r16178
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/expr.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2abf408..80d231e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/expr.c b/gcc/expr.c
index 91d682a..920ffbc 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -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)))));