Ticket #5824: 0001-Fix-register-clobber-list-in-StgRun-for-ARM.patch

File 0001-Fix-register-clobber-list-in-StgRun-for-ARM.patch, 1003 bytes (added by bgamari, 3 years ago)

Patch

  • rts/StgCRun.c

    From 6b414663dd955782dc638c4857ab67e29589c944 Mon Sep 17 00:00:00 2001
    From: Ben Gamari <[email protected]>
    Date: Sat, 28 Jan 2012 16:55:04 -0500
    Subject: [PATCH] Fix register clobber list in StgRun for ARM
    
    The ARM implementation of StgRun does not claim that it clobbers r7-r12. As a
    result, the compiler will sometimes put the returned RegTable in one of these
    registers, resulting in an invalid RegTable to be returned. Hilarity ensues.
    
    Signed-off-by: Ben Gamari <[email protected]>
    ---
     rts/StgCRun.c |    2 +-
     1 files changed, 1 insertions(+), 1 deletions(-)
    
    diff --git a/rts/StgCRun.c b/rts/StgCRun.c
    index c302efb..8fcb550 100644
    a b StgRun(StgFunPtr f, StgRegTable *basereg) { 
    672672        "ldmfd sp!, {r4-r10, fp, ip, lr}\n\t" 
    673673      : "=r" (r) 
    674674      : "r" (f), "r" (basereg), "i" (RESERVED_C_STACK_BYTES) 
    675       :  
     675      : "%r4", "%r5", "%r6", "%r8", "%r9", "%r10", "%fp", "%ip", "%lr" 
    676676    ); 
    677677    return r; 
    678678}