changeset 241:96ca4f142c22

6676841: ClearArrayNode::Identity is incorrect for 64-bit Summary: ClearArrayNode::Identity should use TypeX instead of TypeInt Reviewed-by: jrose, kvn, sgoldman
author never
date Tue, 18 Mar 2008 23:44:46 -0700
parents a9ec1f7d29d6
children f4a8c30a53b0
files hotspot/src/share/vm/opto/memnode.cpp
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hotspot/src/share/vm/opto/memnode.cpp	Tue Mar 18 11:17:37 2008 -0700
+++ b/hotspot/src/share/vm/opto/memnode.cpp	Tue Mar 18 23:44:46 2008 -0700
@@ -1881,7 +1881,7 @@
 //------------------------------Identity---------------------------------------
 // Clearing a zero length array does nothing
 Node *ClearArrayNode::Identity( PhaseTransform *phase ) {
-  return phase->type(in(2))->higher_equal(TypeInt::ZERO)  ? in(1) : this;
+  return phase->type(in(2))->higher_equal(TypeX::ZERO)  ? in(1) : this;
 }
 
 //------------------------------Idealize---------------------------------------
@@ -1954,6 +1954,11 @@
                                    Node* start_offset,
                                    Node* end_offset,
                                    PhaseGVN* phase) {
+  if (start_offset == end_offset) {
+    // nothing to do
+    return mem;
+  }
+
   Compile* C = phase->C;
   int unit = BytesPerLong;
   Node* zbase = start_offset;
@@ -1979,6 +1984,11 @@
                                    intptr_t start_offset,
                                    intptr_t end_offset,
                                    PhaseGVN* phase) {
+  if (start_offset == end_offset) {
+    // nothing to do
+    return mem;
+  }
+
   Compile* C = phase->C;
   assert((end_offset % BytesPerInt) == 0, "odd end offset");
   intptr_t done_offset = end_offset;