[commit: ghc] master: CodeGen X86: fix unsafe foreign calls wrt inlining (b61b7c2)

git at git.haskell.org git at git.haskell.org
Sat Oct 1 21:50:37 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/b61b7c2462b919de7eb4c373e2e2145c6d78d04c/ghc

>---------------------------------------------------------------

commit b61b7c2462b919de7eb4c373e2e2145c6d78d04c
Author: Sylvain HENRY <hsyl20 at gmail.com>
Date:   Sat Oct 1 00:25:49 2016 -0400

    CodeGen X86: fix unsafe foreign calls wrt inlining
    
    Foreign calls (unsafe and safe) interact badly with inlining and
    register passing ABIs (see #11792 and #12614):
    the inlined code to compute a parameter of the call may overwrite a
    register already set to pass a preceding parameter.
    
    With this patch, we compute all parameters which are not simple
    expressions before assigning them to fixed registers required by the
    ABI.
    
    Test Plan:
       - Add test (test both reg and stack parameters)
       - Validate
    
    Reviewers: osa1, bgamari, austin, simonmar
    
    Reviewed By: simonmar
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D2263
    
    GHC Trac Issues: #11792, #12614


>---------------------------------------------------------------

b61b7c2462b919de7eb4c373e2e2145c6d78d04c
 compiler/nativeGen/X86/CodeGen.hs            | 111 ++++++++++++++++++---------
 testsuite/tests/ffi/should_run/T12614.hs     |  22 ++++++
 testsuite/tests/ffi/should_run/T12614.stdout |   6 ++
 testsuite/tests/ffi/should_run/T12614_c.c    |   5 ++
 testsuite/tests/ffi/should_run/all.T         |   5 ++
 5 files changed, 113 insertions(+), 36 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc b61b7c2462b919de7eb4c373e2e2145c6d78d04c


More information about the ghc-commits mailing list