31 July 2020, 22:24 | #1 |
Registered User
Join Date: Oct 2015
Location: Landsberg / Germany
Posts: 526
|
VASM: strange behaviour, quits with error 8
I am currently cleaning up portions of code within the RESHOOT PROXIMA 3 project. Strange things happen. For example, VASM compiles sourcecode perfectly fine when it looks like this:
Code:
tst.b .wbclosed(pc) beq .reopenWB nop ; without this VASM quits. Wtf? CALLINTUITION OpenWorkBench .reopenWB Code:
tst.b .wbclosed(pc) beq .reopenWB ; nop ; without this VASM quits. Wtf? CALLINTUITION OpenWorkBench .reopenWB fatal error 8: cannot resolve section <CODE>, maximum number of passes reached Given code is just an example. I am having trouble reproducing the error, but it seems like the error happens if size of code is too small (?!) / behavour seems to be related to size of source / compiled code. Puzzled. Anyone got any idea what might happen here? Last edited by buzzybee; 31 July 2020 at 22:36. |
31 July 2020, 22:49 | #2 |
Registered User
Join Date: Oct 2015
Location: Landsberg / Germany
Posts: 526
|
Ah, seems like the puzzle was solved. I had these lines in my startup-code
Code:
.VARS ALIGNLONG (align to 4-byte address) .OldView dc.l 0 .OldCop1 dc.l 0 .OldCop2 dc.l 0 .VBRptr dc.l 0 ... Code:
ALIGNLONG (align to 4-byte address) .VARS .OldView dc.l 0 .OldCop1 dc.l 0 .OldCop2 dc.l 0 .VBRptr dc.l 0 ... move.l sp,.Stack-.VARS(a5) ; save stack I would have imagined VASM would still compile even the address of VARS is not aligned and not dividable by 4 (of course code would have crashed then), but hey ... Should not code when I am too tired at night. Last edited by buzzybee; 31 July 2020 at 22:58. |
07 August 2020, 23:06 | #3 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Quote:
The problem here is that the combination of branch-optimizations and 32-bit alignments may get you into a situation which results in an endless oscillation of performing the optimization and having to revert it again. A special difficulty on the M68k is that a branch instruction has to become larger (Bcc.W) when the distance to the target becomes zero (even when only momentarily). vasm has lots of strategies to deal with it. So usually it shouldn't happen, but with some weird code constructions it still seems to be possible. I'm glad that you found the problem. Otherwise your last options would have been to set a fixed size for the branch or to disable optimizations in this area. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
vasm strange behaviour | Den | Coders. Asm / Hardware | 3 | 12 December 2015 15:24 |
Strange Prefs (non) behaviour. | khph_re | support.WinUAE | 4 | 02 October 2010 14:34 |
Strange A600 behaviour | Gavilan | support.Hardware | 9 | 08 July 2009 19:02 |
Strange guru behaviour! | deejaya | support.Other | 11 | 31 January 2009 21:01 |
Strange A1200 behaviour | manicx | support.Hardware | 39 | 09 November 2005 08:32 |
|
|