0

Hello support team,

I’m facing unexpected behavior of compiled code with -O0 optimize option. The following code is expected to toggle P5.2 every function call but it doesn’t work. According to disassembly view and objdump result, there are strange code ‘xor1 cy, a.7’ and ‘mov1 cy, 0xffef8.2’.

(1) ‘xor1 cy, a.7’ –> What is the purpose of this code?
(2) ‘mov1 cy, 0xffef8.2’ –> Is this code correct? It seems that this code should be ‘mov1 cy, 0xffef8.0′
(2’) or ‘movw de, #1’ –> This code might be ‘movw de, #0b00000100’

Screen copies:


Best regards,
NoMaY

[Added]

Also the previous shared RL78/G14 LLVM project shows the same strange code (in case of -O0 optimize option).

Screen copy:

Best regards,
NoMaY

[Added]

Please note that programs doesn’t work due to stack size problem of my side at lower optimization level as of today even if this issued will be solved.

Best regards,
NoMaY

Open Source Tools Support コメント済
    • Dear NoMaY-san,

      Thank you for reporting this. We have managed to reproduce the issue and we are currently working towards solving it.

      The xor1 cy, a.7 instruction is a result of the compiler treating the comparison as a signed comparison.
      The mov1 cy, 0xffef8.2 instruction is considered mov1 cy, x.2, but as we have discussed before, this works for bank 0 only.

      __
      Best regards,
      The Open Source Tools Team

    • Dear customer,

      We are happy to report that this issue should be resolved in the new 10.0.0.202107 release of the LLVM for Renesas RL78 toolchain, present on our website for download at: https://llvm-gcc-renesas.com/rl78/rl78-download-toolchains/

      If you have any further questions about the issue, please let us know.

      __
      Thank you,
      The Open Source Tools Team