[commit: ghc] ghc-8.0: CodeGen X86: fix unsafe foreign calls wrt inlining (aec4a51)

git at git.haskell.org git at git.haskell.org
Sun Oct 2 01:04:21 UTC 2016


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

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/aec4a514857d051f5eeb15b9cbc8e6dd29850c5f/ghc

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

commit aec4a514857d051f5eeb15b9cbc8e6dd29850c5f
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
    
    (cherry picked from commit b61b7c2462b919de7eb4c373e2e2145c6d78d04c)


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

aec4a514857d051f5eeb15b9cbc8e6dd29850c5f
 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 aec4a514857d051f5eeb15b9cbc8e6dd29850c5f


More information about the ghc-commits mailing list