Disallow optimizing by less than 5 passes.
authorH. Peter Anvin <hpa@zytor.com>
Sun, 23 Sep 2007 01:16:52 +0000 (18:16 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Sun, 23 Sep 2007 01:20:49 +0000 (18:20 -0700)
Disallow optimizing by less than 5 passes.  If the user requests 2-4
passes, run 5 passes anyway.

nasm.c

diff --git a/nasm.c b/nasm.c
index 161a216..f9917b1 100644 (file)
--- a/nasm.c
+++ b/nasm.c
@@ -407,8 +407,12 @@ static int process_arg(char *p, char *q)
                             optimizing = -1;    /* 0.98 behaviour */
                         else if (opt == 1)
                             optimizing = 0;     /* Two passes, 0.98.09 behavior */
-                        else
-                            optimizing = opt;   /* Multiple passes */
+                        else if (opt <= 5)
+                           /* The optimizer seems to have problems with
+                              < 5 passes?  Hidden bug? */
+                           optimizing = 5;     /* 5 passes */
+                       else
+                            optimizing = opt;   /* More than 5 passes */
                     } else {
                         if (*param == 'v' || *param == '+') {
                             ++param;