BigEd / atalan

Automatically exported from code.google.com/p/atalan
MIT License
1 stars 0 forks source link

Optimizer bug - cuts out address assigmnent #50

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have added one rule in m6502.atl to get address assignments to work (rev 98)
Unfortunately, optimizer cuts-out those assignments.

You can see this in currentbuf assignments in changepicture func.

So the fifteen does not compile with optimization on. With off it does.

Anyway, good work with optimizer (almost 1 kB cut-out !).

Original issue reported on code.google.com by jakub.hu...@gmail.com on 11 Jan 2011 at 12:19

GoogleCodeExporter commented 9 years ago
I believe I have fixed this bug.

However the fifteen still does not work (only black screen).

Original comment by rudla.ku...@gmail.com on 15 Jan 2011 at 11:35

GoogleCodeExporter commented 9 years ago
Could you perhaps try to find out why?

Original comment by rudla.ku...@gmail.com on 15 Jan 2011 at 11:35

GoogleCodeExporter commented 9 years ago
:)))

now you cut-out the result assignment, for example:

Optimized:                                                  | unpotimized

    jsr changepicture                                    |     jsr changepicture
  -------------------------------------------------------|     lda
changepicture__c
  -------------------------------------------------------|     sta
drawmainscreen__tmpcol

That's why fifteen loops in one of procedures further :)

Look at this too:

     lda changepicture__c                                |     lda
changepicture__c
     sta btmp1                                           |     sta btmp1
  ;### fifteen.atl(630)           showboard              |  ;###
fifteen.atl(630)           showboard
     jsr showboard                                       |     jsr showboard
  ;### fifteen.atl(631)           changecolor btmp1      |  ;###
fifteen.atl(631)           changecolor btmp1
  -------------------------------------------------------|     lda
btmp1
     sta changecolor__col                                |     sta
changecolor__col
     jsr changecolor                                     |     jsr changecolor

cutting-out btmp1 makes error

Once you cut-out, once not :)

I have noticed somewhere during experimenting, that around "jsr
showboard" was something like:

lda something
jsr showboard
sta something another.

Like optimiser had not noticed the fact that inside showboard accu is used.

Original comment by jakub.hu...@gmail.com on 17 Jan 2011 at 2:29

GoogleCodeExporter commented 9 years ago
I have forhotten to mension, that that issue:

was right before optimisation, because there was a zp address (in form
_95) instead of acc

Kuba

2011/1/17 Jakub Husak <jakub.husak@gmail.com>:

Original comment by jakub.hu...@gmail.com on 17 Jan 2011 at 2:38

GoogleCodeExporter commented 9 years ago
Hurray!!!
Little15 compiles with optimization turned on!!!

Original comment by rudla.ku...@gmail.com on 27 Jan 2011 at 11:33

GoogleCodeExporter commented 9 years ago
So, this is good test case:)

Original comment by jakub.hu...@gmail.com on 28 Jan 2011 at 10:27