Menu

#3995 mcs51 port needs peephole rule 130

pending-fixed
mcs51 (7)
MCS51
5
2026-06-01
2026-05-29
No

The mcs51 port sometimes generates invalid asm, which is then patched by peephole rule 130. Codegen should not generate invalid asm in the first place, SDCC should work with --no-peep (which if it works, like it does for other ports, is a good tool for debugging and bug workarounds).

Discussion

  • Philipp Klaus Krause

    The bug was originally found in the fuzzing branch; it looks like all problematic asm comes from either genRet or genCall codegen.

     
  • Philipp Klaus Krause

    As of [r16568], the main issue is fixed in the next branch, the number of asm lines in generated in regression tests affected by this bug is down by 93%.

     

    Related

    Commit: [r16568]

  • Philipp Klaus Krause

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

    Remaining part fixed in [r16569].

     

    Related

    Commit: [r16569]

  • Maarten Brock

    Maarten Brock - 2026-05-31

    Maybe it is wise to drop this rule.

     
    • Philipp Klaus Krause

      I agree. Though that change should only go into trunk after the 4.6.0 release, while IMO, this fix could be picked to trunk if we do an RC2.

       
      👍
      1

      Last edit: Philipp Klaus Krause 2026-06-01
  • Philipp Klaus Krause

    • status: closed-fixed --> pending-fixed
     

Log in to post a comment.

Auth0 Logo