#1440 Peepholes 49-56 broken

closed-fixed
z80 port (188)
5
2013-05-25
2008-03-24
No

Here's peephole 49:

replace restart {
or a,%1
jp NZ,%2
ld a,%3
or a,a
} by {
or a,%1
jp NZ,%2
or a,%3
}

This breaks when %3 is (bc) or (de).
The bug is in 2.8.0rc2, but this peephole has been in sdcc for a long time. I added it in october 2006; I didn't observe the bug until today, even though the peephole rule is applied frequently. It seems sdcc very rarely generates code where %3 is (bc). I have never seen %3 to be (de).

Philipp

Discussion

  • Maarten Brock

    Maarten Brock - 2008-03-24

    Logged In: YES
    user_id=888171
    Originator: NO

    I think this can be fixed by using the following condition:

    if operandsNotRelated(%3 (bc) (de))

     
  • Philipp Klaus Krause

    Logged In: YES
    user_id=564030
    Originator: YES

    Yes, but I intended to do it after 2.8.0. Do you think the fix should be applied before 2.8.0?

     
  • Borut Ražem

    Borut Ražem - 2008-03-25

    Logged In: YES
    user_id=568035
    Originator: NO

    Let do it after the 2.8.0 release.

    Borut

     
  • Philipp Klaus Krause

    Logged In: YES
    user_id=564030
    Originator: YES

    Peepholes 42 and 43 have the same problem.

    Unfortunately, '(bc)' and '(de)' can't be used as operands to OperandsNotRelated or OperandsNotSame.

     
  • Philipp Klaus Krause

    • status: open --> open-fixed
     
  • Philipp Klaus Krause

    Fixed in revision #5455. Support for '(bc)' and '(de)' had been added to OperandsNotRelated some time ago.

     
  • Philipp Klaus Krause

    • milestone: --> fixed
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks