This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: More miscellaneous patches
I tracked down the bug. Here's a short testcase that crashes with
-gdwarf-2 -O. Making g() inline removes the crash, but the block
structure is still wrong; the block containing g's locals is within
the block for the inlined copy of f. This happens because:
retrofit_block inserts the inlined block ahead of the locals block,
because it fails to find an insn for the locals block. This happens
because when we call retrofit_block we're inside a sequence for the
current STMT_EXPR, and we can't see the rest of the function.
identify_blocks therefore assigns the wrong blocks to the various
block notes, and reorder_blocks dutifully fixes things up to reflect
the nesting indicated by the notes.
Your ball.
Jason
struct A { };
inline A f () { return A(); }
template <class T> void g()
{
A a = f();
while (1) { }
}
int
main()
{
g<int> ();
}