Commit 8971f720 authored by wolfgang.thaller@gmx.net's avatar wolfgang.thaller@gmx.net
Browse files

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