Commit 67d1d4ed authored by parcs's avatar parcs

Merge remote-tracking branch 'origin/master' into ghc-parmake-gsoc

parents 1f5338e7 df614779
......@@ -347,8 +347,23 @@ else
compiler_CONFIGURE_OPTS += --ghc-option=-DNO_REGS
ifeq "$(GhcProfiled)" "YES"
# If we're bootstrapping the compiler during stage2, or we're being
# built by a GHC whose version is > 7.8, we need -fcmm-sink to be
# passed to the compiler. This is required on x86 to avoid the
# register allocator running out of stack slots when compiling this
# module with -fPIC -dynamic.
compiler/stage1/build/Parser_HC_OPTS += -fcmm-sink
# However, we may be using e.g. 7.6, and thus the bootstrap compiler
# does not need to pass -fcmm-sink, but stage1+ does!
# We pass -fcmm-sink to every stage != 1
# See #8182 for all the details
compiler/stage2/build/Parser_HC_OPTS += -fcmm-sink
compiler/stage3/build/Parser_HC_OPTS += -fcmm-sink
ifeq "$(GhcProfiled)" "YES"
# If we're profiling GHC then we want SCCs. However, adding -auto-all
# everywhere tends to give a hard-to-read profile, and adds lots of
# overhead. A better approach is to proceed top-down; identify the
......@@ -1917,11 +1917,22 @@ linkBinary' staticLink dflags o_files dep_packages = do
-- on x86.
++ (if sLdSupportsCompactUnwind mySettings &&
not staticLink &&
platformOS platform == OSDarwin &&
platformArch platform `elem` [ArchX86, ArchX86_64]
(platformOS platform == OSDarwin || platformOS platform == OSiOS) &&
case platformArch platform of
ArchX86 -> True
ArchX86_64 -> True
ArchARM {} -> True
_ -> False
then ["-Wl,-no_compact_unwind"]
else [])
-- '-no_pie'
-- iOS uses 'dynamic-no-pic', so we must pass this to ld to suppress a warning; see #7722
++ (if platformOS platform == OSiOS &&
not staticLink
then ["-Wl,-no_pie"]
else [])
-- '-Wl,-read_only_relocs,suppress'
-- ld gives loads of warnings like:
-- ld: warning: text reloc in _base_GHCziArr_unsafeArray_info to _base_GHCziArr_unsafeArray_closure
......@@ -681,6 +681,9 @@ getLinkerInfo' dflags = do
-- that doesn't support --version. We can just assume that's
-- what we're using.
return $ DarwinLD []
OSiOS ->
-- Ditto for iOS
return $ DarwinLD []
OSMinGW32 ->
-- GHC doesn't support anything but GNU ld on Windows anyway.
-- Process creation is also fairly expensive on win32, so
......@@ -24,24 +24,6 @@ to inline certain key external functions, so we instruct GHC not to
throw away inlinings as it would normally do in -O0 mode.
-- CPP tricks because we want the directives in the output of the
-- first CPP pass.
-- Clang note, 6/17/2013 by aseipp: It is *extremely* important (for
-- some reason) that there be a line of whitespace between the two
-- definitions here, and the subsequent use of __IF_GHC_77__ - this
-- seems to be a bug in clang or something, where having the line of
-- whitespace will make the preprocessor correctly format the rendered
-- lines in the 'two step' CPP pass. No, this is not a joke.
#define __IF_GHC_77__ #if __GLASGOW_HASKELL__ >= 707
#define __ENDIF__ #endif
-- Required on x86 to avoid the register allocator running out of
-- stack slots when compiling this module with -fPIC -dynamic.
{-# OPTIONS_GHC -fcmm-sink #-}
module Parser ( parseModule, parseStmt, parseIdentifier, parseType,
parseHeader ) where
......@@ -214,8 +214,11 @@ the sharing of E. Since absence analysis and worker-wrapper are keen
to remove such unused arguments, we add in a void argument to prevent
the function from becoming a thunk.
The user can avoid that argument with the -ffun-to-thunk
flag. However, removing all the value argus may introduce space leaks.
The user can avoid adding the void argument with the -ffun-to-thunk
flag. However, this can create sharing, which may be bad in two ways. 1) It can
create a space leak. 2) It can prevent inlining *under a lambda*. If w/w
removes the last argument from a function f, then f now looks like a thunk, and
so f can't be inlined *under a lambda*.
Note [All One-Shot Arguments of a Worker]
......@@ -156,6 +156,12 @@ FP_COMPARE_VERSIONS([$GhcVersion],[-lt],[7.5],
# GHC 7.7+ needs -fcmm-sink when compiling Parser.hs. See #8182
# GHC is passed to Cabal, so we need a native path
if test "${WithGhc}" != ""
......@@ -145,6 +145,17 @@
New PrimOps for atomic memory operations.
The <literal>casMutVar#</literal> PrimOp was introduced in
GHC 7.2 (debugged in 7.4). This release also includes additional
PrimOps for compare-and-swap (<literal>casArray#</literal> and
<literal>casIntArray#</literal>) and one for fetch-and-add
TODO: mention dynamic changes
......@@ -1786,7 +1786,7 @@ case (error &quot;&quot;) of
<state>South Carolina</state>
<bibliomisc><ulink url=""></ulink></bibliomisc>
<bibliomisc><ulink url=""></ulink></bibliomisc>
<!-- booktitle = "Conference Record of the Twentieth Annual {ACM} {SIGPLAN}-{SIGACT} Symposium on Principles of Programming Languages", -->
......@@ -1585,17 +1585,6 @@
<entry>Worker-wrapper removes unused arguments; this flag
lets it thusly remove all value lambdas. Doing so creates
a thunk where it was previously a function closure, which
may save recomputation but also risks a space leak. Off by
<entry>Enable eta-reduction. Implied by <option>-O</option>.</entry>
......@@ -1661,6 +1650,15 @@
<entry>Allow worker-wrapper to convert a function closure into a
thunk if the function does not use any of its arguments. Off by
<entry>Ignore assertions in the source</entry>
......@@ -1675,6 +1673,14 @@
<entry>Run demand analysis again, at the end of the simplification
<entry>Turn on the liberate-case transformation. Implied by <option>-O2</option>.</entry>
......@@ -2095,16 +2095,15 @@ f "2" = 2
<para>Worker-wrapper removes unused arguments, but usually we
do not remove them all, lest it turn a function closure into a thunk,
thereby perhaps causing extra allocation (since let-no-escape can't happen)
and/or a space leak. This flag
allows worker/wrapper to remove <emphasis>all</emphasis> value lambdas.
Off by default.
<para>Worker-wrapper removes unused arguments, but usually we do
not remove them all, lest it turn a function closure into a thunk,
thereby perhaps creating a space leak and/or disrupting inlining.
This flag allows worker/wrapper to remove <emphasis>all</emphasis>
value lambdas. Off by default.
......@@ -2137,6 +2136,18 @@ f "2" = 2
<para><emphasis>Off by default.</emphasis>Run demand analysis
again, at the end of the simplification pipeline
......@@ -47,8 +47,6 @@ Other commonly-used options are:
-v[n] Control verbosity (n is 0--5, normal verbosity level is 1,
-v alone is equivalent to -v3)
-fglasgow-exts Allow Glasgow extensions (unboxed types, etc.)
-O An `optimising' package of compiler flags, for faster code
-prof Compile for cost-centre profiling
Cabal @ e41a92a7
Subproject commit 9f374ab45e62924506b992db9157c970c7259a03
Subproject commit e41a92a7bbad928d14d4bf1291d23e6bd6ce169e
containers @ c4f44a33
Subproject commit 154cd539a22e4d82ff56fec2d8ad38855f78513a
Subproject commit c4f44a33136df0c6239eb5219b72a487b90b6ad1
haskeline @ 708f0f60
Subproject commit 495b00b4f125c0b4e7f1e966cd961eae89cffdc0
Subproject commit 708f0f604d8a9fea65a445892f262dfdf2a56ee6
......@@ -471,6 +471,8 @@ endif
# C compiler
......@@ -3798,6 +3798,11 @@ ocGetNames_PEi386 ( ObjectCode* oc )
/* I'm sure this is the Right Way to do it. However, the
alternative of testing the sectab_i->Name field seems to
work ok with Cygwin.
EZY: We should strongly consider using this style, because
it lets us pick up sections that should be added (e.g.
for a while the linker did not work due to missing .eh_frame
in this section.)
if (sectab_i->Characteristics & MYIMAGE_SCN_CNT_CODE ||
sectab_i->Characteristics & MYIMAGE_SCN_CNT_INITIALIZED_DATA)
......@@ -3807,6 +3812,7 @@ ocGetNames_PEi386 ( ObjectCode* oc )
if (0==strcmp(".text",(char*)secname) ||
0==strcmp(".text.startup",(char*)secname) ||
0==strcmp(".eh_frame", (char*)secname)||
if (0==strcmp(".data",(char*)secname) ||
......@@ -3835,6 +3841,8 @@ ocGetNames_PEi386 ( ObjectCode* oc )
/* ignore unknown section that appeared in gcc 3.4.5(?) */
&& 0!= strcmp(".reloc", (char*)secname)
&& 0 != strcmp(".rdata$zzz", (char*)secname)
/* ignore linker directive sections */
&& 0 != strcmp(".drectve", (char*)secname)
) {
errorBelch("Unknown PEi386 section name `%s' (while processing: %" PATH_FMT")", secname, oc->fileName);
......@@ -22,6 +22,9 @@ Flags:
--fast Omit dyn way, omit binary distribution
--slow Build stage2 with -DDEBUG.
2008-07-01: 14% slower than the default.
--no-dph: Skip requiring libraries/dph. In --slow mode, these tests
can take a substantial amount of time, and on some platforms
with broken linkers, we don't want to try compiling it.
--help shows this usage help.
Set environment variable 'CPUS' to number of cores, to exploit
......@@ -36,6 +39,7 @@ no_clean=0
while [ $# -gt 0 ]
......@@ -58,6 +62,9 @@ do
exit 0;;
......@@ -115,7 +122,11 @@ if [ $no_clean -eq 0 ]; then
INSTDIR=`cygpath -m "$INSTDIR"`
/usr/bin/perl -w boot --validate --required-tag=dph
if [ $skip_dph -eq 1 ]; then
/usr/bin/perl -w boot --validate
/usr/bin/perl -w boot --validate --required-tag=dph
./configure --prefix="$INSTDIR" $config_args
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment