On 08/12/2018 02:38 PM, Dave Pitts wrote:
I've been hacking with version 7.2.0 of gcc trying to adapt some old md files that I've got to this newer gcc. I've been getting errors from the dwarf2out_frame_debug_expr() function in dwarf2cfi.c line 1790 calling gcc_unreachable(). The expression being processed is a SET. The src operand is a MEM reference and the dest operand is a REG reference. If I run the compiler with the option -fno-asynchronous-unwind-tables I do NOT get the error and the generated code looks reasonable.
(set (REG) (MEM)) is not one of the patterns handled by dwarf2out_frame_debug_expr. If this is an epilogue instruction to restore a register, then it should have a REG_CFA_RESTORE regnote which takes you to dwarf2out_frame_debug_cfa_restore instead. If you are missing REG_CFA_RESTORE regnotes, then you are probably missing other CFA related regnotes too. If this is not an epilogue register restore instruction, then you need to figure out why it was marked as frame related, and figure out what should have been done instead.
Jim