Menu

#3328 __preserves_regs

closed-fixed
None
Z80
5
2023-03-01
2022-02-20
No

__preserves_regs

returns an error when IX is specified

To reproduce the issue try

void foo(void) __preserves_regs(b, c, ixl, ixh);

in this version of SDCC

SDCC : mcs51/z80/z180/r2k/r2ka/r3ka/sm83/tlcs90/ez80_z80/z80n/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8/pdk13/pdk14/pdk15/mos6502 4.2.0 #13031 (MINGW32)
published under GNU General Public License (GPL)

Related

Wiki: NGI0-Entrust-SDCC

Discussion

  • Philipp Klaus Krause

    I guess we could silently ignore ixl and ixh.
    Specifying them shouldn't make a difference, as our Z80 ABI mandates that ix is always preserved by the callee.

     
  • Maarten Brock

    Maarten Brock - 2022-03-07

    Isn't it better to document that ix is not allowed here?
    And keep the error or replace it by a better one?
    If you're going to ignore it at least generate a warning.
    I can imagine such if the behaviour depends on the used calling convention.

     
  • Philipp Klaus Krause

     
  • Philipp Klaus Krause

    In sdcc from current svn, we ignore it and emit a warning "unknown register specification ixh".

     
  • Philipp Klaus Krause

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

Log in to post a comment.

MongoDB Logo MongoDB