# New Ticket Created by  Leopold Toetsch 
# Please include the string:  [perl #16838]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=16838 >


Hi,

during hacking on imcc and testing with life.p6 I found wrong core.ops 
of type:

inline op <binary> (out PMC, out PMC, out PMC)

add is ok, broken are mul, div, mod, sub, concat.

Attached patch + make && make shared helps.
Please apply.

TIA,
leo

PS: imcc uses the IN/OUT/INOUT information for life analysis of symbols. 
With improved register allocation above bugs emerged.

PPS: all tests still pass.


-- attachment  1 ------------------------------------------------------
url: http://rt.perl.org/rt2/attach/35992/29114/74a267/core.ops.diff

--- core.ops    Fri Aug 23 20:10:40 2002
+++ /home/lt/src/parrot-007/core.ops    Thu Aug 29 12:24:40 2002
@@ -1492,7 +1492,7 @@
   goto NEXT();
 }
 
-inline op div (out PMC, out PMC, out PMC) {
+inline op div (out PMC, in PMC, in PMC) {
   $2->vtable->divide(interpreter, $2, $3, $1);
   goto NEXT();
 }
@@ -1591,7 +1591,7 @@
   goto NEXT();
 }
 
-inline op mod (out PMC, out PMC, out PMC) {
+inline op mod (out PMC, in PMC, in PMC) {
   $2->vtable->modulus(interpreter, $2, $3, $1);
   goto NEXT();
 }
@@ -1665,7 +1665,7 @@
   goto NEXT();
 }
 
-inline op mul (inout PMC, out PMC) {
+inline op mul (inout PMC, in PMC) {
   $1->vtable->multiply(interpreter, $1, $2, $1);
   goto NEXT();
 }
@@ -1680,7 +1680,7 @@
   goto NEXT();
 }
 
-inline op mul (out PMC, out PMC, out PMC) {
+inline op mul (out PMC, in PMC, in PMC) {
   $2->vtable->multiply(interpreter, $2, $3, $1);
   goto NEXT();
 }
@@ -1829,7 +1829,7 @@
   goto NEXT();
 }
 
-inline op sub (out PMC, out PMC, out PMC) {
+inline op sub (out PMC, in PMC, in PMC) {
   $2->vtable->subtract(interpreter, $2, $3, $1);
   goto NEXT();
 }
@@ -1898,7 +1898,7 @@
   goto NEXT();
 }
 
-inline op concat (out PMC, out PMC, out PMC) {
+inline op concat (out PMC, in PMC, in PMC) {
   $2->vtable->concatenate(interpreter, $2, $3, $1);
   goto NEXT();
 }

Reply via email to