[commit: ghc] wip/T13861: WIP: DON'T PUSH, misc local changes (091e9e3)

git at git.haskell.org git at git.haskell.org
Wed Jan 3 16:11:08 UTC 2018


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

On branch  : wip/T13861
Link       : http://ghc.haskell.org/trac/ghc/changeset/091e9e35398d472432f32f8d82b278663f7735bf/ghc

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

commit 091e9e35398d472432f32f8d82b278663f7735bf
Author: Gabor Greif <ggreif at gmail.com>
Date:   Wed Jan 3 15:57:17 2018 +0100

    WIP: DON'T PUSH, misc local changes


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

091e9e35398d472432f32f8d82b278663f7735bf
 compiler/codeGen/StgCmmClosure.hs            | 7 +++++++
 compiler/codeGen/StgCmmExpr.hs               | 6 ++++--
 libffi/ghc.mk                                | 2 ++
 testsuite/tests/codeGen/should_compile/all.T | 3 ++-
 utils/gen-dll/Main.hs                        | 2 +-
 5 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/compiler/codeGen/StgCmmClosure.hs b/compiler/codeGen/StgCmmClosure.hs
index 9de4f9d..03f0169 100644
--- a/compiler/codeGen/StgCmmClosure.hs
+++ b/compiler/codeGen/StgCmmClosure.hs
@@ -60,6 +60,7 @@ module StgCmmClosure (
         cafBlackHoleInfoTable,
         indStaticInfoTable,
         staticClosureNeedsLink,
+        LambdaFormInfo(LFThunk)
     ) where
 
 #include "../includes/MachDeps.h"
@@ -597,6 +598,12 @@ getCallMethod _ _name _ (LFCon _) n_args _v_args _cg_loc _self_loop_info
     -- n_args=0 because it'd be ill-typed to apply a saturated
     --          constructor application to anything
 
+getCallMethod _ _name id lf 0 _v_args _cg_loc _self_loop_info
+  | isEvaldUnfolding (idUnfolding id) && trace lf "getCallMethod##" (ppr id $$ (text . show $ lf) $$ ppr (idUnfolding id)) False
+  = undefined
+  where trace LFLetNoEscape _ _ = GhcPrelude.id
+        trace _ s d = pprTrace s d
+
 getCallMethod dflags name id (LFThunk _ _ updatable std_form_info is_fun)
               n_args _v_args _cg_loc _self_loop_info
   | is_fun      -- it *might* be a function, so we must "call" it (which is always safe)
diff --git a/compiler/codeGen/StgCmmExpr.hs b/compiler/codeGen/StgCmmExpr.hs
index 1de03e5..ef4b22d 100644
--- a/compiler/codeGen/StgCmmExpr.hs
+++ b/compiler/codeGen/StgCmmExpr.hs
@@ -835,6 +835,8 @@ cgIdApp fun_id args = do
         n_args      = length args
         v_args      = length $ filter (isVoidTy . stgArgType) args
         node_points dflags = nodeMustPointToIt dflags lf_info
+        --okay LFThunk{} = True
+        --okay _ = False
     case getCallMethod dflags fun_name cg_fun_id lf_info n_args v_args (cg_loc fun_info) self_loop_info of
             -- A value in WHNF, so we can just return it.
         ReturnIt
@@ -843,8 +845,8 @@ cgIdApp fun_id args = do
           -- ToDo: does ReturnIt guarantee tagged?
 
         EnterIt -> ASSERT( null args )  -- Discarding arguments
-                   ASSERT2( not (isEvaldUnfolding (idUnfolding fun_id)), ppr fun_id <+> ppr (idUnfolding fun_id) $$ ppr cg_fun_id <+> ppr (idUnfolding cg_fun_id))
-                   if isEvaldUnfolding (idUnfolding fun_id) then pprPanic "cgIdApp" (ppr fun_id <+> ppr (idUnfolding fun_id) $$ ppr cg_fun_id <+> ppr (idUnfolding cg_fun_id)) else emitEnter fun
+                   --ASSERT2( okay lf_info || not (isEvaldUnfolding (idUnfolding fun_id)), ppr fun_id <+> ppr (idUnfolding fun_id) $$ ppr cg_fun_id <+> ppr (idUnfolding cg_fun_id))
+                   if isEvaldUnfolding (idUnfolding fun_id) then pprTrace "cgIdApp" (ppr fun_id <+> ppr (idUnfolding fun_id) $$ ppr cg_fun_id <+> ppr (idUnfolding cg_fun_id)) $ emitEnter fun else emitEnter fun
 
         SlowCall -> do      -- A slow function call via the RTS apply routines
                 { tickySlowCall lf_info args
diff --git a/libffi/ghc.mk b/libffi/ghc.mk
index 6bc8897..776da70 100644
--- a/libffi/ghc.mk
+++ b/libffi/ghc.mk
@@ -89,7 +89,9 @@ $(libffi_STAMP_CONFIGURE): $(TOUCH_DEP)
 	cd libffi && \
 	    cd build && \
 	    CC=$(CC_STAGE1) \
+	    CPP="$(CC_STAGE1) -E" \
 	    CXX=$(CC_STAGE1) \
+	    CXXCPP="$(CC_STAGE1:gcc=g++) -E" \
 	    LD=$(LD) \
 	    AR=$(AR_STAGE1) \
 	    NM=$(NM) \
diff --git a/testsuite/tests/codeGen/should_compile/all.T b/testsuite/tests/codeGen/should_compile/all.T
index 53092c9..d5acef4 100644
--- a/testsuite/tests/codeGen/should_compile/all.T
+++ b/testsuite/tests/codeGen/should_compile/all.T
@@ -38,7 +38,8 @@ test('T12355', normal, compile, [''])
 test('T14373a', [],
      multimod_compile, ['T14373a', '-fasm -O2 -ddump-cmm-from-stg -dsuppress-uniques'])
 test('T14373b', [],
-     multimod_compile, ['T14373b', '-fasm -O2 -ddump-cmm-from-stg -dsuppress-uniques'])
+     multimod_compile, ['T14373b', '-v -O2 -dsuppress-uniques'])
+#     multimod_compile, ['T14373b', '-fasm -O2 -ddump-cmm-from-stg -dsuppress-uniques'])
 test('T14626',
      normal,
      run_command, ['$MAKE -s --no-print-directory T14626'])
diff --git a/utils/gen-dll/Main.hs b/utils/gen-dll/Main.hs
index 0383b8e..7cc965b 100644
--- a/utils/gen-dll/Main.hs
+++ b/utils/gen-dll/Main.hs
@@ -85,7 +85,7 @@
 
      In the end we end up with libfoo-pt1.dll, libfoo-pt2.dll and libfoo-pt3.dll
      along with libfoo.dll.a. To the rest of the pipeline the split is
-     completely transparant as -lfoo will just continue to work, and the linker
+     completely transparent as -lfoo will just continue to work, and the linker
      is responsible for populating the IAT (Import Address Table) with the
      actual dlls we need.
 



More information about the ghc-commits mailing list