FAQ  •  Register  •  Login

One more optimizer bug (*solved*)

<<

einar

Posts: 84

Joined: Sun Apr 08, 2012 9:33 pm

Post Sat May 07, 2016 4:46 pm

One more optimizer bug (*solved*)

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.
<<

einar

Posts: 84

Joined: Sun Apr 08, 2012 9:33 pm

Post Sat May 07, 2016 5:02 pm

Re: One more optimizer bug

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?
<<

boriel

Site Admin

Posts: 1462

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Tue May 17, 2016 9:15 pm

Re: One more optimizer bug

Is this bug still pending?? :shock:

Anyway, yes, the compiler should not optimize users code and this will be fixed.
<<

einar

Posts: 84

Joined: Sun Apr 08, 2012 9:33 pm

Post Wed May 18, 2016 3:31 am

Re: One more optimizer bug

boriel wrote:Is this bug still pending??


Yes. Tested against latest version 1.4.0s1967.
<<

boriel

Site Admin

Posts: 1462

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Tue Mar 21, 2017 8:53 am

Re: One more optimizer bug

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...)
<<

einar

Posts: 84

Joined: Sun Apr 08, 2012 9:33 pm

Post Wed Mar 22, 2017 11:08 am

Re: One more optimizer bug

Thank you!!!
<<

boriel

Site Admin

Posts: 1462

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Wed Mar 22, 2017 7:24 pm

Re: One more optimizer bug

Ok. Now updated!
<<

boriel

Site Admin

Posts: 1462

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Tue Jul 11, 2017 7:48 am

Re: One more optimizer bug (*solved*)

Okay, from version 1.6.6 and on, user's asm code won't be optimized regardless of the -O flag 8)

Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.

phpBB SEO