Decouple -O from -fvia-C
authorwolfgang.thaller@gmx.net <unknown>
Fri, 1 Dec 2006 12:53:04 +0000 (12:53 +0000)
committerwolfgang.thaller@gmx.net <unknown>
Fri, 1 Dec 2006 12:53:04 +0000 (12:53 +0000)
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.

compiler/main/DynFlags.hs
docs/users_guide/phases.xml
docs/users_guide/sooner.xml
docs/users_guide/using.xml

index 2ba6172..8de1eec 100644 (file)
@@ -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
index cd18469..2f74a6b 100644 (file)
@@ -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>
 
index ec1bb3d..19c1c11 100644 (file)
@@ -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>
index 73f5637..0168123 100644 (file)
@@ -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>