I have a source code that normally takes 4 passes to compile. I have pasted a procedure from another source (just paste, no call references to it) and number of passes increased to 5. Why is that? Even though it is just a piece of code, not being used by the program anyway.
Posted on 2003-04-30 07:21:45 by comrade
Used or not, it still has to be compiled and we can't demand FASM to know if we use a pice of code or not.
Posted on 2003-04-30 08:06:31 by scientica
I know it has to be compiled, but why does number of passes increase? I have understanding that extra passes are required to resolve forward references and such, but why does the number of passes increase for code that has no effect on program?
Posted on 2003-04-30 15:09:00 by comrade
Does FASM do SHORT jump optimization?

That's one possible reason.
Posted on 2003-04-30 22:03:08 by tenkey
Yes, fasm does SHORT optimizations. It was one of the first features.
Posted on 2003-05-01 02:21:04 by eet_1024
Yes, but I have other code in source, and I would think it would optimize all jumps in one pass (so still shouldn't increase).
Posted on 2003-05-01 07:00:33 by comrade
Hi, comrade.

How many passes need the pasted procedure? (Try to separate it in new file, and check)
Posted on 2003-05-01 10:13:45 by JohnFound

Yes, but I have other code in source, and I would think it would optimize all jumps in one pass (so still shouldn't increase).
That is not correct. Are you placing the code between two other pieces of code?
Posted on 2003-05-01 17:26:17 by bitRAKE
No, right at the end of code section. As I've said before, there are no call references to that procedure.
Posted on 2003-05-01 18:30:42 by comrade
comrade, unless the code itself needs more passes there should not be an increase - given what I have seen in FASM source. It is possible for multiple branch optimizations to create another branch optimization, but it is not that common. It is easy to imagine a cascading effect even within a small (<150 bytes) piece of code that would need 5 passes.
Posted on 2003-05-01 19:56:15 by bitRAKE
May I ask a stuped question ?
What dose it matter with as fast as fasm is ?
You added code that isen't being used it has
to try to work this code into the program the extra
pass could be the assembler makeing sure there is
refrences that have ben over looked
Posted on 2003-05-01 22:37:33 by rob.rice
Here is the link to the post in which I've written almost everything about passes, there can't be other reason for that than one of the listed there:
http://www.asmcommunity.net/board/index.php?topic=10640.msg80063
Posted on 2003-05-04 10:12:27 by Tomasz Grysztar