[pypy-svn] r22445 - in pypy/dist/pypy/translator/llvm: . test

ericvrp at codespeak.net ericvrp at codespeak.net
Thu Jan 19 16:07:03 CET 2006


Author: ericvrp
Date: Thu Jan 19 16:06:59 2006
New Revision: 22445

Modified:
   pypy/dist/pypy/translator/llvm/opwriter.py
   pypy/dist/pypy/translator/llvm/test/test_lladdresses.py
Log:
Fixes for raw memory arithmetic.
Fix for test this gives misalignment warnings on ia64.
("python(17687): unaligned access to 0x6000000000a3f05a, ip=0x2000000001b14c00")


Modified: pypy/dist/pypy/translator/llvm/opwriter.py
==============================================================================
--- pypy/dist/pypy/translator/llvm/opwriter.py	(original)
+++ pypy/dist/pypy/translator/llvm/opwriter.py	Thu Jan 19 16:06:59 2006
@@ -457,7 +457,7 @@
             self.codewriter.getelementptr(incr_addr,
                                           addr_type,
                                           cast_addr,
-                                          [("int", arg_incr)],
+                                          [(self.word, arg_incr)],
                                           getptr=False)
             cast_addr = incr_addr
         self.codewriter.store(argtype_value, arg_value, cast_addr)
@@ -479,7 +479,7 @@
             self.codewriter.getelementptr(incr_addr,
                                           addr_type,
                                           cast_addr,
-                                          [("int", arg_incr)],
+                                          [(self.word, arg_incr)],
                                           getptr=False)
             cast_addr = incr_addr
 

Modified: pypy/dist/pypy/translator/llvm/test/test_lladdresses.py
==============================================================================
--- pypy/dist/pypy/translator/llvm/test/test_lladdresses.py	(original)
+++ pypy/dist/pypy/translator/llvm/test/test_lladdresses.py	Thu Jan 19 16:06:59 2006
@@ -75,13 +75,13 @@
     def f():
         addr = raw_malloc(100)
         addr.signed[0] = 12
-        (addr + 10).signed[0] = 42
-        (addr + 20).char[0] = "a"
+        (addr + 16).signed[0] = 42
+        (addr + 32).char[0] = "a"
         addr1 = raw_malloc(100)
         raw_memcopy(addr, addr1, 100)
         result = addr1.signed[0] == 12
-        result += (addr1 + 10).signed[0] == 42
-        result += (addr1 + 20).char[0] == "a"
+        result += (addr1 + 16).signed[0] == 42
+        result += (addr1 + 32).char[0] == "a"
         return result
     fc = compile(f, [])
     res = fc()



More information about the Pypy-commit mailing list