6732154: REG: Printing an Image using image/gif doc flavor crashes the VM, Solsparc
authorrasbold
Thu, 14 Aug 2008 10:15:29 -0700
changeset 1056 da0241911ea8
parent 1055 f4fb9fb08038
child 1057 44220ef9a775
6732154: REG: Printing an Image using image/gif doc flavor crashes the VM, Solsparc Summary: delay transform call until uses of t2 are constructed Reviewed-by: never
hotspot/src/share/vm/opto/divnode.cpp
--- a/hotspot/src/share/vm/opto/divnode.cpp	Fri Aug 01 10:06:45 2008 -0700
+++ b/hotspot/src/share/vm/opto/divnode.cpp	Thu Aug 14 10:15:29 2008 -0700
@@ -264,8 +264,14 @@
 
   Node *t1 = phase->transform(new (phase->C, 3) URShiftLNode(lolo_product, phase->intcon(N / 2)));
   Node *t2 = phase->transform(new (phase->C, 3) AddLNode(hilo_product, t1));
-  Node *t3 = phase->transform(new (phase->C, 3) RShiftLNode(t2, phase->intcon(N / 2)));
-  Node *t4 = phase->transform(new (phase->C, 3) AndLNode(t2, phase->longcon(0xFFFFFFFF)));
+
+  // Construct both t3 and t4 before transforming so t2 doesn't go dead
+  // prematurely.
+  Node *t3 = new (phase->C, 3) RShiftLNode(t2, phase->intcon(N / 2));
+  Node *t4 = new (phase->C, 3) AndLNode(t2, phase->longcon(0xFFFFFFFF));
+  t3 = phase->transform(t3);
+  t4 = phase->transform(t4);
+
   Node *t5 = phase->transform(new (phase->C, 3) AddLNode(t4, lohi_product));
   Node *t6 = phase->transform(new (phase->C, 3) RShiftLNode(t5, phase->intcon(N / 2)));
   Node *t7 = phase->transform(new (phase->C, 3) AddLNode(t3, hihi_product));