Dechenjm / crack-language

Automatically exported from code.google.com/p/crack-language
Other
0 stars 0 forks source link

Argument assignment is still broken in loops #48

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
   import crack.io cout;
   void a(uint64 v) {
       while (v) {
           cout `$v `;
           v >>= 1;
       }
   }

   a(4);

What is the expected output? 4 2 1 What do you see instead? 4 4 4 4 ...

Promotion of arguments from registers to allocas is happening in the context 
where the argument is assigned: if that context is a loop we'll continually 
alloca.  The promotion needs to happen in the function's first block.

Please use labels and text to provide additional information.

Original issue reported on code.google.com by mind...@gmail.com on 19 Oct 2010 at 10:48

GoogleCodeExporter commented 9 years ago

Original comment by mind...@gmail.com on 20 Oct 2010 at 12:08

GoogleCodeExporter commented 9 years ago
Fixed in revision 9e3a9671dec3

Original comment by mind...@gmail.com on 21 Oct 2010 at 11:48