Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
One more optimizer bug (*solved*)
#1
File "test.bas":

Code:
sub test()
    asm
        ld      hl, 56469
        ld      de, 5
        ld      (hl), e
        inc     l
        ld      (hl), d
;        ret
    end asm
end sub

test()

Trying to compile it:

Code:
>zxb.exe -t -O3 test.bas -o test.tap
Traceback (most recent call last):
  File "zxb.py", line 348, in <module>
  File "zxb.py", line 301, in main
  File "optimizer.pyc", line 2290, in optimize
  File "optimizer.pyc", line 1949, in optimize
  File "optimizer.pyc", line 680, in op
  File "optimizer.pyc", line 538, in inc
  File "optimizer.pyc", line 432, in set
TypeError: unsupported operand type(s) for <<: 'NoneType' and 'int'

Compiling it without "-O3" works just fine.
Reply
#2
Regardless of the problem itself, it worries me that the compiler is trying to optimize my assembly code. I certainly understand more about my assembly code context than the compiler, so any attempt by the compiler to "improve" it will most likely break something.

Even if it's necessary for the compiler to analyze small assembly snippets in the middle of a BASIC routine (in order to figure out how to integrate Assembly code with surrounding BASIC code)... perhaps compiler optimization could be disabled whenever a routine is written 100% in Assembly? Or perhaps ZX BASIC could provide a directive (or command-line option) to disable attempts to optimize Assembly code implemented by the programmer, and only optimize Assembly code produced by the compiler?
Reply
#3
Is this bug still pending?? Confusedhock:

Anyway, yes, the compiler should not optimize users code and this will be fixed.
Reply
#4
boriel Wrote:Is this bug still pending??

Yes. Tested against latest version 1.4.0s1967.
Reply
#5
Well, I'm finally addressing it (also fixed another two already, available in version s1975, but wait until I also fix this one).
I'm also trying to integrate the "don't optimize the user asm code" feature.

Update: Version 1.4.0s1980 is out.
Hope it's not too late :|
If you're still interested, try and tell me, please.
Note: This version does still optimize ASM user code (work in progress...)
Reply
#6
Thank you!!!
Reply
#7
Ok. Now updated!
Reply
#8
Okay, from version 1.6.6 and on, user's asm code won't be optimized regardless of the -O flag 8)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)