diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-01-08 22:29:21 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-01-08 22:29:21 -0800 |
commit | 62cf415f4976f681edecb067e9ca1c17f145a349 (patch) | |
tree | 0e7ea558edb0830926fe9c64fa090638507bda12 /nasm.c | |
parent | 72c64378909cf7d961d6fd7cad1adc77ce72507d (diff) | |
download | nasm-62cf415f4976f681edecb067e9ca1c17f145a349.tar.gz |
Optimizer: force progression through final passes when hitting limit
We have a number of bug reports about things not working properly when
the optimizer is running out of passes. I suspect the reason is
simply that we don't properly execute the final passes (pass0 = 1, 2)
when hitting the limit. Make sure we advance pass0 the last few
times.
Diffstat (limited to 'nasm.c')
-rw-r--r-- | nasm.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -910,7 +910,7 @@ static void assemble_file(char *fname) pass_max = (optimizing > 0 ? optimizing : 0) + 2; /* passes 1, optimizing, then 2 */ pass0 = !(optimizing > 0); /* start at 1 if not optimizing */ - for (pass = 1; pass <= pass_max && pass0 <= 2; pass++) { + for (pass = 1; pass0 <= 2; pass++) { int pass1, pass2; ldfunc def_label; @@ -1476,7 +1476,8 @@ static void assemble_file(char *fname) exit(1); } pass_cnt++; - if (pass > 1 && !global_offset_changed) { + if ((pass > 1 && !global_offset_changed) || + pass >= pass_max - 2) { pass0++; if (pass0 == 2) pass = pass_max - 1; |