[project @ 1999-07-14 11:16:43 by simonmar]
[ghc-hetmet.git] / ghc / driver / ghc.lprl
index 8dbeef2..9886de5 100644 (file)
@@ -116,10 +116,12 @@ GHC_UNLIT GHC_HSCPP GHC_HSC GHC_SYSMAN
 
 CP RM CONTEXT_DIFF
 
-WAY_*_NAME WAY_*_HC_OPTS
+WAY_*_NAME WAY_*_REAL_OPTS
 
 LeadingUnderscore
 
+GhcWithRegisterised
+
 \end{verbatim}
 
 Establish what executables to run for the various phases, what the
@@ -223,16 +225,11 @@ These are the default values, which may be changed by user flags.
 sub setupOptFlags {
    $Oopt_MaxSimplifierIterations  = '-fmax-simplifier-iterations4';
    $Oopt_PedanticBottoms         = '-fpedantic-bottoms'; # ON by default
-   $Oopt_MonadEtaExpansion       = '';
    $Oopt_FinalStgProfilingMassage = '';
    $Oopt_StgStats                = '';
    $Oopt_DoSpecialise            = '-fspecialise';
    $Oopt_FoldrBuild              = 0; # *Off* by default!
-   $Oopt_FB_Support              = ''; # was '-fdo-arity-expand';
-#  $Oopt_FoldrBuildWW            = 0; # Off by default
-   $Oopt_FoldrBuildInline        = ''; # was '-fdo-inline-foldr-build';
    $Oopt_UsageSPInf               = ''; # Off by default
-   $Oopt_ShowSimplifierProgress   = '';
 } # end of setupOptFlags
 
 # Assign defaults to these right away.
@@ -284,11 +281,11 @@ these are turned off by -Wnot.
                     '-fwarn-missing-methods',
                     '-fwarn-duplicate-exports');
 @MinusWOpts              = (@StandardWarnings, 
-                    '-fwarn-incomplete-patterns', 
                     '-fwarn-unused-binds',
+                    '-fwarn-unused-matches',
+                    '-fwarn-incomplete-patterns', 
                     '-fwarn-unused-imports');
 @MinusWallOpts           = (@MinusWOpts, 
-                    '-fwarn-unused-matches',
                     '-fwarn-type-defaults',
                     '-fwarn-name-shadowing',
                     '-fwarn-missing-signatures');
@@ -302,12 +299,12 @@ Prelude ({\em including} its interface file(s)).
 $BuildTag      = ''; # default is sequential build w/ Appel-style GC
 
 %BuildDescr    = (# system ways begin
-                   '',     'normal sequential',
-                  '_p',    "$WAY_p_NAME",
-                  '_t',    "$WAY_t_NAME",
-                  '_u',    "$WAY_u_NAME",
-                  '_mp',   "$WAY_mp_NAME",
-                  '_mg',   "$WAY_mg_NAME",
+                   '',     'Normal Sequential',
+                  '_p',    "Profiling",
+                  '_t',    "Ticky-ticky Profiling",
+                  '_u',    "Unregisterised",
+                  '_mp',   "Parallel",
+                  '_mg',   "Gransim",
                   # system ways end
                   '_a',    "$WAY_a_NAME",
                   '_b',    "$WAY_b_NAME",
@@ -331,39 +328,30 @@ $BuildTag = ''; # default is sequential build w/ Appel-style GC
 #
 %SetupOpts = 
        (
-       '_a', "$WAY_a_HC_OPTS",
-       '_b', "$WAY_b_HC_OPTS",
-       '_c', "$WAY_c_HC_OPTS",
-       '_d', "$WAY_d_HC_OPTS",
-       '_e', "$WAY_e_HC_OPTS",
-       '_f', "$WAY_f_HC_OPTS",
-       '_g', "$WAY_g_HC_OPTS",
-       '_h', "$WAY_h_HC_OPTS",
-       '_i', "$WAY_i_HC_OPTS",
-       '_j', "$WAY_j_HC_OPTS",
-       '_k', "$WAY_k_HC_OPTS",
-       '_l', "$WAY_l_HC_OPTS",
-       '_m', "$WAY_m_HC_OPTS",
-       '_n', "$WAY_n_HC_OPTS",
-       '_o', "$WAY_o_HC_OPTS",
-       '_A', "$WAY_A_HC_OPTS",
-       '_B', "$WAY_B_HC_OPTS",
+       '_a', "$WAY_a_REAL_OPTS",
+       '_b', "$WAY_b_REAL_OPTS",
+       '_c', "$WAY_c_REAL_OPTS",
+       '_d', "$WAY_d_REAL_OPTS",
+       '_e', "$WAY_e_REAL_OPTS",
+       '_f', "$WAY_f_REAL_OPTS",
+       '_g', "$WAY_g_REAL_OPTS",
+       '_h', "$WAY_h_REAL_OPTS",
+       '_i', "$WAY_i_REAL_OPTS",
+       '_j', "$WAY_j_REAL_OPTS",
+       '_k', "$WAY_k_REAL_OPTS",
+       '_l', "$WAY_l_REAL_OPTS",
+       '_m', "$WAY_m_REAL_OPTS",
+       '_n', "$WAY_n_REAL_OPTS",
+       '_o', "$WAY_o_REAL_OPTS",
+       '_A', "$WAY_A_REAL_OPTS",
+       '_B', "$WAY_B_REAL_OPTS",
 
        # system ways
-       '_p',  "$WAY_p_HC_OPTS",
-       '_t',  "$WAY_t_HC_OPTS",
-       '_u',  "$WAY_u_HC_OPTS",
-       '_mp', "$WAY_mp_HC_OPTS",
-       '_mg', "$WAY_mg_HC_OPTS");
-
-\end{code}
-
-Import/include directories (\tr{-I} options) are sufficiently weird to
-require special handling.
-
-\begin{code}
-@Import_dir    = ('.'); #-i things
-@Include_dir   = ('.'); #-I things; other default(s) stuck on AFTER option processing
+       '_p',  "-fscc-profiling -DPROFILING -optc-DPROFILING",
+       '_t',  "-fticky-ticky -DTICKY_TICKY -optc-DTICKY_TICKY",
+       '_u',  "-optc-DNO_REGS -optc-DUSE_MINIINTERPRETER -fno-asm-mangling -funregisterised",
+       '_mp', "-fstack-check -fparallel -D__PARALLEL_HASKELL__ -optc-DPAR",
+       '_mg', "-fstack-check -fconcurrent -fgransim -D__GRANSIM__ -D__CONCURRENT_HASKELL__ -optc-DCONCURRENT -optc-DGRAN");
 
 # where to look for interface files (system hi's, i.e., prelude and syslibs)
 @SysImport_dir = ( $INSTALLING )
@@ -385,8 +373,6 @@ $Haskell1Version = 5; # i.e., Haskell 1.4
        , "-D__CONCURRENT_HASKELL__"
        );
 
-@UserLibrary_dir= ();  #-L things;...
-@UserLibrary           = ();   #-l things asked for by the user
 
 @SysLibrary_dir = ( ( $INSTALLING )    #-syslib things supplied by the system
                    ? $InstLibDirGhc
@@ -396,7 +382,6 @@ $Haskell1Version = 5; # i.e., Haskell 1.4
                      , "$TopPwd/$CURRENT_DIR/$GHC_LIB_DIR/std/cbits"
                      )
                  );
-@SysLibrary = (); # will be built up as we go along
 
 $TopClosureFile # defaults to 1.2 one; will be mangled later
        = '';
@@ -425,8 +410,6 @@ sub initDriverGlobals {
 # reset the following options:
 # RTS flags to use while compiling
 @HsC_rts_flags      = ();
-@HsP_flags     = (); # these are the flags destined solely for
-                     # the flex/yacc parser
 @HsC_flags     = ();
 @HsC_antiflags  = ();
 \end{code}
@@ -445,7 +428,10 @@ $StgLint       = '';
 @Import_dir    = ('.'); #-i things
 @Include_dir   = ('.'); #-I things; other default(s) stuck on AFTER option processing
 
+@UserLibrary_dir= ();  #-L things;...
+@UserLibrary           = ();   #-l things asked for by the user
 
+@SysLibrary = (); # will be built up as we go along
 \end{code}
 
 We are given a list of files with various presumably-known suffixes
@@ -494,6 +480,7 @@ $UNPROFscc_auto = '';       # set to relevant hsc flag if forcing auto sccs without pr
 $TICKYing = '';        # set to t if compiling for ticky-ticky profiling
 $PARing = '';          # set to p if compiling for PAR
 $GRANing = '';         # set to g if compiling for GRAN
+$UNREGing = ($GhcWithRegisterised eq 'YES') ? '' : 'u';
 $Specific_hi_file = '';                # set by -ohi <file>; "-" for stdout
 $Specific_dump_file = '';      # set by -odump <file>; "-" for stdout
 $Using_dump_file = 0;
@@ -695,219 +682,104 @@ It really really wants to be the last STG-to-STG pass that is run.
 
 sub setupOptimiseFlags {
 
+       # this pass-ordering sequence was agreed by Simon and Andr\'e
+       # (WDP 94/07, 94/11).
+
    @HsC_minusNoO_flags 
-    = (        '-fsimplify',
-         '[',
-         $Oopt_FB_Support,
-         '-ffloat-lets-exposing-whnf',
-         '-ffloat-primops-ok',
-         '-fcase-of-case',
-         '-fdo-case-elim',
-#        '-fdo-lambda-eta-expansion',  # too complicated
-         '-freuse-con',
-#        '-flet-to-case',              # no strictness analysis, so...
-         $Oopt_PedanticBottoms,
-#        $Oopt_MonadEtaExpansion,      # no thanks
-
-# These two work fine, if you really want no simplification at all,
-# for bizarre test reasons.  But you get really terrible code if you use them,
-#      for example: let x = e in x
-# with dozens of redundant thunks etc.  So I'm leaving them out.
-#
-#        '-fsimpl-uf-use-threshold0',
-#        '-fessential-unfoldings-only',
-
-         #
-         # The presence of -fclone-binds is *temporary* to work around
-          # the fact that the desugarer in 3.0{2.3} does generate
-         # bindings with identical ids, and the type checker doesn't perform
-         # properly cloned type substitutions. Instead, we make sure that all 
-         # binders are cloned first time through the simplifier.
-          #
-         # Will be properly fixed in the `new compiler` I hear, at which point
-         # the cloning can be turned off here.
-         #
-          # Let's find out..
-          #'-fclone-binds',
-
-         $Oopt_MaxSimplifierIterations,
-         $Oopt_ShowSimplifierProgress,
+    = (        
+       '-fsimplify',
+         '[', 
+               '-finline-phase2',
+               $Oopt_MaxSimplifierIterations,
          ']',
-       $Oopt_AddAutoSccs,
-#      '-ffull-laziness',      # removed 95/04 WDP following Andr\'e's lead
 
+       $Oopt_AddAutoSccs,
        $Oopt_FinalStgProfilingMassage
       );
 
    @HsC_minusO_flags # NOTE: used for *both* -O and -O2 (some conditional bits)
     = (
+       '-ffoldr-build-on',
+
         '-fdo-eta-reduction',
+       '-fdo-lambda-eta-expansion',
+       '-fcase-of-case',
+       '-fcase-merge',
+       '-flet-to-case',
+       $Oopt_PedanticBottoms,
 
        # initial simplify: mk specialiser happy: minimum effort please
+
        '-fsimplify',
          '[', 
-         $Oopt_FB_Support,
-         '-fkeep-spec-pragma-ids',     # required before specialisation
-
-# I don't understand why we want -fessential-unfoldings-only here
-# If we have it, the following nasty thing happens:
-#      f  = E
-#      g* = f
-#      ...g...
-# where "*" means exported.
-# In the essential-unfoldings pass we still substitute f for g
-# but we don't substitute E for f first.  So we get
-#      f  = E
-#      g* = f
-#      ...f...
-# The g=f will get reverse-substituted later, but it's untidy. --SLPJ
-#
-# SDM: Here's why it's necessary.
-#
-#   If we unfold in the first pass before the specialiser is run
-#   we miss opportunities for specialisation because eg. wrappers
-#   have been inlined for specialisable functions.  
-#
-#   This shows up in PrelArr.lhs - the specialised instance for newArray 
-#   calls the generic rangeSize, because rangeSize is strict and is
-#   replaced by its wrapper by the simplifier.
+               '-finline-phase0',      # Don't inline anything till full laziness has bitten
+                                       # In particular, inlining wrappers inhibits floating
+                                       # e.g. ...(case f x of ...)...
+                                       #  ==> ...(case (case x of I# x# -> fw x#) of ...)...
+                                       #  ==> ...(case x of I# x# -> case fw x# of ...)...
+                                       # and now the redex (f x) isn't floatable any more
+               '-fmax-simplifier-iterations2',
+         ']',
 
-         '-fessential-unfoldings-only',
-         '-fsimpl-uf-use-threshold0',
+       # Specialisation is best done before full laziness
+       # so that overloaded functions have all their dictionary lambdas manifest
+       ($Oopt_DoSpecialise) ? ( $Oopt_DoSpecialise, ) : (),
+       '-ffull-laziness',
+       '-ffloat-inwards',
 
-         # See remark re: cloning in defn of minusnotO
-         '-fclone-binds',
+#      '-fsimplify',
+#        '[', 
+#              # Run the simplifier before specialising, so that overloaded functions
+#              # look like             f = \d -> ...
+#              # (Full laziness may lift out something hiding the \d
+#              '-finline-phase1',
+#              '-fmax-simplifier-iterations1',
+#        ']',
 
-         '-fdo-case-elim',
-         '-fmax-simplifier-iterations1',
-         $Oopt_PedanticBottoms,
-         ']',
 
-       ($Oopt_DoSpecialise) ? (
-         $Oopt_DoSpecialise,
-       ) : (),
+       '-fsimplify',
+         '[', 
+               '-finline-phase1',
+               # Want to run with inline phase 1 after the specialiser to give
+               # maximum chance for fusion to work before we inline build/augment
+               # in phase 2.  This made a difference in 'ansi' where an overloaded
+               # function wasn't inlined till too late.
+               $Oopt_MaxSimplifierIterations,  
+         ']',
 
         $Oopt_UsageSPInf, # infer usage information here in case we need it later.
                           # (add more of these where you need them --KSW 1999-04)
 
-       '-fsimplify',           # need dependency anal after specialiser ...
-         '[',                  # need tossing before calc-inlinings ...
-         $Oopt_FB_Support,
-         '-ffloat-lets-exposing-whnf',
-         '-ffloat-primops-ok',
-         '-fcase-of-case',
-         '-fdo-case-elim',
-         '-fcase-merge',
-#        '-fdo-eta-reduction',
-         '-fdo-lambda-eta-expansion',
-         '-freuse-con',
-         $Oopt_PedanticBottoms,
-         $Oopt_MonadEtaExpansion,
-         $Oopt_MaxSimplifierIterations,
-         $Oopt_ShowSimplifierProgress,
-         #
-         # The presence of -fclone-binds is *crucial* here as
-         # -ffull-laziness (which we're about to do next) floats
-         # bindings outwards, so we better make sure that this
-         # doesn't result in the floating out of bindings
-         # with identical uniques, i.e., -ffull-laziness needs
-         # to be preceeded by a simplifier pass with -fclone-binds
-         # set.
-          '-fclone-binds',
-         ']',
-
-#      ($Oopt_FoldrBuildWW) ? (
-#              '-ffoldr-build-ww-anal',
-#              '-ffoldr-build-worker-wrapper',
-#              '-fsimplify', 
-#                '[', 
-#                $Oopt_FB_Support,
-#                '-ffloat-lets-exposing-whnf',
-#                '-ffloat-primops-ok',
-#                '-fcase-of-case',
-#                '-fdo-case-elim',
-#                '-fcase-merge',
-#                '-fdo-eta-reduction',
-#                '-fdo-lambda-eta-expansion',
-#                '-freuse-con',
-#                $Oopt_PedanticBottoms,
-#                $Oopt_MonadEtaExpansion,
-#                $Oopt_MaxSimplifierIterations,
-#                $Oopt_ShowSimplifierProgress,
-#                ']',
-#       ) : (),
-
-       # this pass-ordering sequence was agreed by Simon and Andr\'e
-       # (WDP 94/07, 94/11).
-       '-ffull-laziness',
-
-       ($Oopt_FoldrBuild) ? (
-         '-ffoldr-build-on',           # desugar list comprehensions for foldr/build
-
-         '-fsimplify', 
-           '[', 
-           '-fignore-inline-pragma',   # **** NB!
-           '-fdo-foldr-build',         # NB
-           $Oopt_FB_Support,
-           '-ffloat-lets-exposing-whnf',
-           '-ffloat-primops-ok',
-           '-fcase-of-case',
-           '-fdo-case-elim',
-           '-fcase-merge',
-#          '-fdo-eta-reduction',
-           '-fdo-lambda-eta-expansion',        # After full laziness
-           '-freuse-con',
-           $Oopt_PedanticBottoms,
-           $Oopt_MonadEtaExpansion,
-           $Oopt_MaxSimplifierIterations,
-           $Oopt_ShowSimplifierProgress,
-           ']',
-       ) : (),
-
-       '-ffloat-inwards',
-
        '-fsimplify',
          '[', 
-         $Oopt_FB_Support,
-         '-ffloat-lets-exposing-whnf',
-         '-ffloat-primops-ok',
-         '-fcase-of-case',
-         '-fdo-case-elim',
-         '-fcase-merge',
-         '-fdo-eta-reduction',
-         '-fdo-lambda-eta-expansion',
-         '-freuse-con',
-         ($Oopt_FoldrBuildInline),
-                       # you need to inline foldr and build
-         ($Oopt_FoldrBuild) ? ('-fdo-foldr-build') : (), 
-                       # but do reductions if you see them!
-         $Oopt_PedanticBottoms,
-         $Oopt_MonadEtaExpansion,
-         $Oopt_MaxSimplifierIterations,
-         $Oopt_ShowSimplifierProgress,
+               # Need inline-phase2 here so that build/augment get 
+               # inlined.  I found that spectral/hartel/genfft lost some useful
+               # strictness in the function sumcode' if augment is not inlined
+               # before strictness analysis runs
+
+               '-finline-phase2',
+               $Oopt_MaxSimplifierIterations,  
          ']',
 
+
        '-fstrictness',
+       '-fcpr-analyse',
        '-fworker-wrapper',
 
        '-fsimplify',
          '[', 
-         $Oopt_FB_Support,
-         '-ffloat-lets-exposing-whnf',
-         '-ffloat-primops-ok',
-         '-fcase-of-case',
-         '-fdo-case-elim',
-         '-fcase-merge',
-#        '-fdo-eta-reduction',
-         '-fdo-lambda-eta-expansion',
-         '-freuse-con',
-         '-flet-to-case',              # Aha! Only done after strictness analysis
-         $Oopt_PedanticBottoms,
-         $Oopt_MonadEtaExpansion,
-         $Oopt_MaxSimplifierIterations,
-         $Oopt_ShowSimplifierProgress,
+               $Oopt_MaxSimplifierIterations,  
+               # No -finline-phase: allow all Ids to be inlined now
          ']',
 
+       '-fcse',        # CSE must immediately follow a simplification pass, because it relies
+                       # on the no-shadowing invariant.  See comments at the top of CSE.lhs
+                
+       '-ffull-laziness',      # nofib/spectral/hartel/wang doubles in speed if you
+                               # do full laziness late in the day.  It only happens
+                               # after fusion and other stuff, so the early pass doesn't
+                               # catch it.  For the record, the redex is 
+                               #       f_el22 (f_el21 r_midblock)
        '-ffloat-inwards',
 
 # Case-liberation for -O2.  This should be after
@@ -915,38 +787,20 @@ sub setupOptimiseFlags {
 
 #      ( ($OptLevel != 2)
 #        ? ''
-#      : "-fliberate-case -fsimplify [ $Oopt_FB_Support -ffloat-lets-exposing-whnf -ffloat-primops-ok -fcase-of-case -fdo-case-elim -fcase-merge -fdo-eta-reduction -fdo-lambda-eta-expansion -freuse-con -flet-to-case $Oopt_PedanticBottoms $Oopt_MonadEtaExpansion $Oopt_MaxSimplifierIterations $Oopt_ShowSimplifierProgress ]" ),
+#      : "-fliberate-case -fsimplify [ $Oopt_FB_Support -ffloat-lets-exposing-whnf -ffloat-primops-ok -fcase-of-case -fdo-case-elim -fcase-merge -fdo-lambda-eta-expansion -freuse-con -flet-to-case $Oopt_PedanticBottoms $Oopt_MaxSimplifierIterations $Oopt_ShowSimplifierProgress ]" ),
 
 # Final clean-up simplification:
 
        '-fsimplify',
          '[', 
-         $Oopt_FB_Support,
-         '-ffloat-lets-exposing-whnf',
-         '-ffloat-primops-ok',
-         '-fcase-of-case',
-         '-fdo-case-elim',
-         '-fcase-merge',
-#        '-fdo-eta-reduction',
-         '-fdo-lambda-eta-expansion',
-         '-freuse-con',
-         '-flet-to-case',
-         '-fignore-inline-pragma',     # **** NB!
-         $Oopt_FoldrBuildInline,       
-         ($Oopt_FoldrBuild) ? ('-fdo-foldr-build') : (), 
-                       # but still do reductions if you see them!
-         $Oopt_PedanticBottoms,
-         $Oopt_MonadEtaExpansion,
-         $Oopt_MaxSimplifierIterations,
-         $Oopt_ShowSimplifierProgress,
+               $Oopt_MaxSimplifierIterations,  
+               # No -finline-phase: allow all Ids to be inlined now
          ']',
 
       #        '-fstatic-args',
 
-#LATER:        '-fcalc-inlinings2', -- pointless for 2.01
-
       # stg2stg passes
-       '-flambda-lift',
+#      '-flambda-lift',
        $Oopt_FinalStgProfilingMassage,
        $Oopt_StgStats,
 
@@ -1001,16 +855,13 @@ if ( $OptLevel <= 0 ) {
 %************************************************************************
 
 Sort out @$BuildTag@, @$PROFing@, @$PARing@,
-@$GRANing@, @$TICKYing@:
+@$GRANing@, @$TICKYing@, @UNREGing@:
 \begin{code}
 sub setupBuildFlags {
 
 
    # PROFILING stuff after argv mangling:
    if ( ! $PROFing ) {
-     # warn about any scc exprs found (in case scc used as identifier)
-     push(@HsP_flags, '-W');
-
      # add -auto sccs even if not profiling !
      push(@HsC_flags, $UNPROFscc_auto) if $UNPROFscc_auto;
 
@@ -1023,8 +874,6 @@ sub setupBuildFlags {
 
       # Ignore user sccs when auto annotating, but warn when doing so.
       $PROFignore_scc = '-W' if $PROFauto; 
-
-      push(@HsP_flags, (($PROFignore_scc) ? $PROFignore_scc : '-S'));
   }
   #if ( $BuildTag ne '' ) {
   #    local($b) = $BuildDescr{$BuildTag};
@@ -1058,8 +907,12 @@ sub setupBuildFlags {
 
   } elsif ( $TICKYing eq 't' ) {
       $BuildTag = '_t';
-  }
 
+  } elsif ( $UNREGing eq 'u' ) {
+      if ($GhcWithRegisterised eq 'YES') {
+        $BuildTag = '_u';
+      }
+  }
 \end{code}
 
 After the sanity checks, add flags to the necessary parts of the driver pipeline:
@@ -1227,6 +1080,7 @@ sub setupLinkOpts {
           ,'-u', "${uscore}PrelPack_unpackCString_closure"
           ,'-u', "${uscore}PrelException_stackOverflow_closure"
           ,'-u', "${uscore}PrelException_heapOverflow_closure"
+          ,'-u', "${uscore}PrelException_NonTermination_static_closure"
        ));
   if (!$NoHaskellMain) {
    unshift (@Ld_flags,'-u', "${uscore}PrelMain_mainIO_closure");
@@ -1849,9 +1703,6 @@ sub runHscAndProcessInterfaces {
 sub runHsc {
     local($ifile_root, $hsc_out, $hsc_hi, $hsc_out_c_stub, $hsc_out_h_stub, $going_interactive) = @_;
 
-    # prepend comma to HsP flags (so hsc can tell them apart...)
-    foreach $a ( @HsP_flags ) { $a = ",$a" unless $a =~ /^,/; }
-
     &makeHiMap() unless $HiMapDone;
     push(@HsC_flags, "-himap=$HiIncludeString");
 
@@ -1907,11 +1758,11 @@ sub runHsc {
       open(OPTS, "> $Tmp_prefix.opts") || &tidy_up_and_die(1,"Can't open $Tmp_prefix.opts\n");
       print OPTS "$dump @HsC_flags $CoreLint $USPLint $StgLint $Verbose";
       close(OPTS);
-      $to_do = "$HsC @HsP_flags ,$hscpp_hsc \@$Tmp_prefix.opts $output +RTS @HsC_rts_flags";
+      $to_do = "$HsC $hscpp_hsc \@$Tmp_prefix.opts $output +RTS @HsC_rts_flags";
 
     } else {
 
-      $to_do = "$HsC @HsP_flags ,$hscpp_hsc $dump @HsC_flags $CoreLint $USPLint $StgLint $Verbose $output +RTS @HsC_rts_flags";
+    $to_do = "$HsC $hscpp_hsc $dump @HsC_flags $CoreLint $USPLint $StgLint $Verbose $output +RTS @HsC_rts_flags";
     }
     &run_something($to_do, 'Haskell compiler');
 
@@ -3149,7 +3000,6 @@ arg: while($_ = $Args[0]) {
     /^-optP(.*)$/   && do { push(@HsCpp_flags,      $1); next arg; };
     /^-optCrts(.*)$/&& do { push(@HsC_rts_flags,    $1); next arg; };
     /^-optC(.*)$/   && do { push(@HsC_flags,        $1); next arg; };
-    /^-optp(.*)$/   && do { push(@HsP_flags,        $1); next arg; };
     /^-optcpp(.*)$/ && do { push(@Cpp_define,       $1); $Only_preprocess_hc = ($1 eq "-E"); next arg; };
     /^-optc(.*)$/   && do { push(@CcBoth_flags,     $1); next arg; };
     /^-opta(.*)$/   && do { push(@As_flags,         $1); next arg; };
@@ -3203,13 +3053,16 @@ arg: while($_ = $Args[0]) {
                        }
                        next arg; };
 
+    /^-unreg$/             && do { $UNREGing = 'u'; next arg; };
+    /^-funregisterised$/    && do { push(@HsC_flags, $_); next arg; };
     /^-fno-asm-mangling$/   && do { $DoAsmMangling = 0; next arg; };
 
     /^-fallow-overlapping-instances$/ && do { push(@HsC_flags, $_); next arg; };
     /^-fallow-undecidable-instances$/ && do { push(@HsC_flags, $_); next arg; };
+    /^-fhistory-size.*$/             && do { push(@HsC_flags, $_); next arg; };
+    /^-fdicts-strict$/                       && do { push(@HsC_flags, $_); next arg; };
     /^-fglasgow-exts$/
                && do { push(@HsC_flags, $_);
-                       push(@HsP_flags, '-N');
 
                        # -fglasgow-exts implies -syslib exts
                        &add_syslib('exts');
@@ -3231,25 +3084,11 @@ arg: while($_ = $Args[0]) {
 
     /^-ffoldr-build$/
                    && do { $Oopt_FoldrBuild = 1; 
-                           $Oopt_FB_Support = '-fdo-arity-expand';
                            #print "Yes F/B\n";
                            next arg; };
 
     /^-fno-foldr-build$/
                    && do { $Oopt_FoldrBuild = 0; 
-                           $Oopt_FB_Support = ''; 
-                           next arg; };
-
-    /^-fno-foldr-build-rule$/
-                   && do { $Oopt_FoldrBuild = 0; 
-                           next arg; };
-
-    /^-fno-enable-tech$/
-                   && do { $Oopt_FB_Support = ''; 
-                           next arg; };
-
-    /^-fno-snapback-to-append$/
-                   && do { $Oopt_FoldrBuildInline .= ' -fdo-not-fold-back-append '; 
                            next arg; };
 
     # --------------- Renamer -------------
@@ -3281,9 +3120,6 @@ arg: while($_ = $Args[0]) {
     /^-fno-pre-inlining$/
                    && do { push(@HsC_flags, $_); next arg };
 
-    /^-fdo-monad-eta-expansion$/
-                   && do { $Oopt_MonadEtaExpansion = $_; next arg; };
-
     /^-fno-let-from-(case|app|strict-let)$/ # experimental, really (WDP 95/10)
                    && do { push(@HsC_flags, $_); next arg; };