Commit c9a83f74 authored by qinsoon's avatar qinsoon

spilled variables are properly aligned on stack as well

parent 3b88ae36
Pipeline #390 failed with stage
in 69 minutes and 34 seconds
......@@ -103,16 +103,37 @@ impl Frame {
trace!("add exception callsite: {} to dest {}", callsite, dest);
self.exception_callsites.push((callsite, dest));
}
#[cfg(target_arch = "x86_64")]
fn alloc_slot(&mut self, val: &P<Value>, vm: &VM) -> &FrameSlot {
// RBP is 16 bytes aligned, we are offsetting from RBP
// every value should be properly aligned
let backendty = vm.get_backend_type_info(val.ty.id());
if backendty.alignment > 16 {
unimplemented!()
}
self.cur_offset -= backendty.size as isize;
{
// if alignment doesnt satisfy, make adjustment
let abs_offset = self.cur_offset.abs() as usize;
if abs_offset % backendty.alignment != 0 {
use utils::math;
let abs_offset = math::align_up(abs_offset, backendty.alignment);
self.cur_offset = -(abs_offset as isize);
}
}
let id = val.id();
let ret = FrameSlot {
offset: self.cur_offset,
value: val.clone()
};
self.cur_offset -= vm.get_type_size(val.ty.id()) as isize;
self.allocated.insert(id, ret);
self.allocated.get(&id).unwrap()
}
......
......@@ -1158,7 +1158,7 @@ def test_rpytarget_richards():
res = run_boot_image(main, '/tmp/test_richards-mu', args=['5'])
assert res.returncode == 0, res.err
@pytest.mark.xfail(reason='printing time fails')
@pytest.mark.xfail(reason='Segment Fault')
@may_spawn_proc
def test_rpytarget_richards_measure_time():
from rpython.translator.goal.richards import entry_point
......@@ -1172,7 +1172,6 @@ def test_rpytarget_richards_measure_time():
res = run_boot_image(main, '/tmp/test_richards_measure_time-mu', args=['5'])
assert res.returncode == 0, res.err
@pytest.mark.xfail(reason='ValueError exception, probably formatting fails')
@may_spawn_proc
def test_rpython_print_time():
import time
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment