Decouple -O from -fvia-C

Nowadays, there are situations where -fvia-C is definitely unwanted, such
as when -fPIC is used on some platforms, so we do not want implicit -fvia-C
any more.
parent ea2d0a53
......@@ -540,9 +540,7 @@ data Option
updOptLevel :: Int -> DynFlags -> DynFlags
-- Set dynflags appropriate to the optimisation level
updOptLevel n dfs
= if (n >= 1)
then dfs2{ hscTarget = HscC, optLevel = n } -- turn on -fvia-C with -O
else dfs2{ optLevel = n }
= dfs2{ optLevel = n }
where
dfs1 = foldr (flip dopt_unset) dfs remove_dopts
dfs2 = foldr (flip dopt_set) dfs1 extra_dopts
......
......@@ -567,9 +567,7 @@ $ cat foo.hspp</screen>
<para>Use GHC's native code generator rather than
compiling via C. This will compile faster (up to twice as
fast), but may produce code that is slightly slower than
compiling via C. <option>-fasm</option> is the default
when optimisation is off (see <xref
linkend="options-optimise"/>).</para>
compiling via C. <option>-fasm</option> is the default.</para>
</listitem>
</varlistentry>
......@@ -580,9 +578,8 @@ $ cat foo.hspp</screen>
</term>
<listitem>
<para>Compile via C instead of using the native code
generator. This is default for optimised compilations,
and on architectures for which GHC doesn't have a native
code generator.</para>
generator. This is the default on architectures for which GHC
doesn't have a native code generator.</para>
</listitem>
</varlistentry>
......
......@@ -200,9 +200,6 @@ should go here!</para>
mind-bogglingly clever. Better to let GCC have a go, as it
tries much harder on register allocation, etc.</para>
<para>At the moment, if you turn on <option>-O</option> you
get GCC instead. This may change in the future.</para>
<para>So, when we want very fast code, we use: <option>-O
-fvia-C</option>.</para>
</listitem>
......
......@@ -1252,10 +1252,6 @@ f "2" = 2
<para>Means: &ldquo;Generate good-quality code without
taking too long about it.&rdquo; Thus, for example:
<command>ghc -c -O Main.lhs</command></para>
<para><option>-O</option> currently also implies
<option>-fvia-C</option>. This may change in the
future.</para>
</listitem>
</varlistentry>
......
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