On 07/12/15 09:19, Claudiu Zissulescu wrote:
Hi Joern,
+ insn = emit_insn (gen_blockage ());
Is this actually part of the patch to fix cfi generation?
This instruction prevents the delay branch scheduler to speculatively use
epilogue instructions to fill up the delay slots. Hence, generating an assert
during dwarf2cfi execution. This behavior is experiment by dg.exp/pr49994-1.s
test.
The main point of having rtl epilogues is to allow such optimizations.
Traditionally, we have said that at -O1, it is OK to curb optimizations
for the sake of having programs
that are saner to debug, while -O2 and above should just optimize, and
the debug info generation is
just thrown in afterwards as a best-effort attempt.
Additionally, we also have -Og now.
You can also consider having separate options to control optimizations
that affect debugging.
If leaving out epilogue cfi is what it takes to allow epilogue
scheduling without the compiler crashing,
then that is what should be done by default at -O2, but if someone finds
that particularly vexing,
they might appreciate a -mepilogue-cfi option to change that default,
and instead disable some
scheduling (delay slot and otherwise).