• Simon Marlow's avatar
    Allow C argument regs to be used as global regs (R1, R2, etc.) · 14a5c62a
    Simon Marlow authored
    The problem here was that we generated C calls with expressions
    involving R1 etc. as parameters.  When some of the R registers are
    also C argument registers, both GCC and the native code generator
    generate incorrect code.  The hacky workaround is to assign
    problematic arguments to temporaries first; fortunately this works
    with both GCC and the NCG, but we have to be careful not to undo this
    with later optimisations (see changes to CmmOpt).
CgForeignCall.hs 8.11 KB