#207 When optimizer runs out of passes, no list file is produced

closed-fixed
Chuck Crayne
None
6
2008-10-02
2004-12-20
H. Peter Anvin
No

When the optimizer runs out of passes, the variable
"pass0" never changes, and therefore no list file is
ever produced.

See bug 1088210 for a test case.

Discussion

1 2 > >> (Page 1 of 2)
  • H. Peter Anvin
    H. Peter Anvin
    2007-10-20

    Logged In: YES
    user_id=58697
    Originator: YES

    I wonder if this is related to the "missing symbols at low optimizer passes"?

    It might be that if the optimizer isn't allowed to converge, things just don't get finished up.

     
  • Chuck Crayne
    Chuck Crayne
    2008-03-22

    Logged In: YES
    user_id=73628
    Originator: NO

    I recently saw a "phase error" from this same cause.

     
  • H. Peter Anvin
    H. Peter Anvin
    2008-03-22

    Logged In: YES
    user_id=58697
    Originator: YES

    The whole optimizer thing should have been fixed. If you're seeing a bug related to it, please file a report.

     
  • Chuck Crayne
    Chuck Crayne
    2008-03-23

    Logged In: YES
    user_id=73628
    Originator: NO

    I saw the problem when testing with -O5. It went away at -O9, and, of course, it work fine with the default. As no one else has reported it, I think it can wait until we eliminate the multiple pass design, as you previously suggested.

     
  • H. Peter Anvin
    H. Peter Anvin
    2008-03-23

    Logged In: YES
    user_id=58697
    Originator: YES

    Please give the test case. I don't think rewriting the optimizer is going to happen any time soon, especially given the ways NASM ties into the preprocessor.

    As I said, it is my belief that this is fixed in NASM 2.02. If not, I really want to figure out why.

     
  • Chuck Crayne
    Chuck Crayne
    2008-03-23

    Logged In: YES
    user_id=73628
    Originator: NO

    Unfortunately, the "test case" is a real world application which, with its various macro and include files, runs to 4794 lines. So it is probably a better use of your time to let me work on this one. However, if you want to proceed, I will be happy to make the files available.

    As to why this happens, I am reasonably sure that it is because the test which we use for phase errors is if a global address changes on the last pass. If the optimizing process is not complete, then -- even though no true phase error exists -- the error will be triggered.

     
  • H. Peter Anvin
    H. Peter Anvin
    2008-07-25

    Logged In: YES
    user_id=58697
    Originator: YES

    Chuck, is this still a problem in the current NASM?

     
  • Chuck Crayne
    Chuck Crayne
    2008-07-26

    Logged In: YES
    user_id=73628
    Originator: NO

    Although the work-around is simple, the basic problem still remains. Once the optimizer has been invoked, there is no safe way to turn it off again, until it has completed its work. And therefore, allowing a user to set the number of passes is doomed to failure -- usually in the form of a phase error.

    My recommendation is to change the behavior of the -On switch, so that the optimization level controls what types of optimization will take place, but not the number of passes.

     
  • Chuck Crayne
    Chuck Crayne
    2008-07-26

    • assigned_to: nobody --> ccrayne
     
  • H. Peter Anvin
    H. Peter Anvin
    2008-10-02

    The current version doesn't appear to have this problem. You may want to try the latest release version and/or the latest snapshot from ftp://ftp.zytor.com/pub/nasm/snapshots/

     
1 2 > >> (Page 1 of 2)