openhwgroup / corev-binutils-gdb

GNU General Public License v2.0
9 stars 26 forks source link

Zcmp CFI may need fixing #47

Closed abukharmeh closed 1 year ago

abukharmeh commented 1 year ago

It looks like we used CFI information from msave restore to implement push/pop, while they are reversed ? This could potentially mean that the debugger wont work when we have exception and we try to unwind stack frame ref : https://github.com/riscv/riscv-code-size-reduction/issues/182

linsinan1995 commented 1 year ago

The current CFI info is correct. The mentioned problem is the order of CFI, or the order of saving/restoring is different from the example in spec.

I don't think we need to make any change unless the spec has a regulation for the order of saving.

abukharmeh commented 1 year ago

So you think the offsets are correct ? (I.e I dont think there is restriction on what order the stores are, but their location in memory) If so we can close this issue.

linsinan1995 commented 1 year ago

Better double-check it. But the implementation of the push/pop order also follows the implementation of msave-restore, and that is why they have the same CFI order.

jeremybennett commented 1 year ago

This is actually a GCC problem see GCC issue #20

jeremybennett commented 1 year ago

Closing issue, now it is filed with GCC