This is the mail archive of the
mailing list for the GCC project.
Re: fake/abnormal/eh edge question
- From: Jeff Law <law at redhat dot com>
- To: Steve Ellcey <sellcey at imgtec dot com>, gcc at gcc dot gnu dot org
- Date: Tue, 25 Aug 2015 14:44:52 -0600
- Subject: Re: fake/abnormal/eh edge question
- Authentication-results: sourceware.org; auth=none
- References: <6ed5618c-3d13-42f6-8842-5a8a0a1e0937 at BAMAIL02 dot ba dot imgtec dot org>
On 08/25/2015 12:39 PM, Steve Ellcey wrote:
I have a question about FAKE, EH, and ABNORMAL edges. I am not sure I
understand all the implications of each type of edge from the description
I am trying to implement dynamic stack alignment for MIPS and I have code
that does the following:
copy incoming $sp to $12 (temp reg)
copy $sp to $fp (after alignment so that $fp is also aligned)
copy $12 to virtual reg (DRAP) for accessing args and for
copy virtual reg (DRAP) back to $12
copy $12 to $sp to restore stack pointer
This works fine as long as there as a path from the entry block to the
exit block but in some cases (like gcc.dg/cleanup-8.c) we have a function
that always calls abort (a non-returning function) and so there is no
path from entry to exit and the exit block and epilogue get removed and
the copy of $sp to $12 also gets removed because GCC sees no uses of $12.
I want to preserve the copy of $sp to $12 and I also want to preserve the
.cfi psuedo-ops (and code) in the exit block and epilogue in order for
exception handling to work correctly. One way I thought of doing this
is to create an edge from the entry block to the exit block but I am
unsure of all the implications of creating a fake/eh/abnormal edge to
do this and which I would want to use.
Presumably it's the RTL DCE pass that's eliminating this stuff?
Do you have the FRAME_RELATED bit set of those insns?
But what I don't understand is why preserving the code is useful if it
can't be reached. Maybe there's something about the dwarf2 unwinding
that I simply don't understand -- I've managed to avoid learning about
it for years.