Menu

#4054 Сode generation error / optimization error when passing an expression with type conversion to a function.

open
nobody
None
STM8
5
2026-09-02
2026-08-09
No

sdcc version: 4.6.2 #16747 (Linux)
run: sdcc -mstm8 main.c

1 Attachments

Related

Patches: #516

Discussion

  • Philipp Klaus Krause

     
  • Philipp Klaus Krause

    I can reproduce the issue on my Debian GNU/Linux testing on amd64 system, I see it for all ports I tried (pdk14, pdk15, stm8, z80, f8.

    Looks like in iCode, we dereference one time too much for passing a to the first call to check_cast.

     

    Last edit: Philipp Klaus Krause 2026-08-29
    • Li-Hsin Chien

      Li-Hsin Chien - 2026-09-02

      Thanks, this was very helpful.

      I traced the extra dereference to geniCodeSEParms().
      I submitted [patches:#516]. The patch keeps the source address while preparing the struct argument, so the struct is dereferenced only once when passed to the function.

       

      Related

      Patches: #516


Log in to post a comment.