This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: relaod1.c: fixup_abnormal_edges


> This function has the following header comment:
> 
> /* This is used by reload pass, that does emit some instructions after
>    abnormal calls moving basic block end, but in fact it wants to emit
>    them on the edge.  Looks for abnormal call edges, find backward the
>    proper call and fix the damage.
>  
>    Similar handle instructions throwing exceptions internally.  */
> 
> I must say that I can't understand this at all and have no idea what this
> function is supposed to do.

Imagine you do have CALL_INSN that may trap.  In such case, it must be the
last insn in the basic block and the basic block must have proper EH edges.
Reload sometimes decide to emit instruction after such call in caller-save.c.
This moves the basic block boundary and results in incorrect CFG.

In such cases we want to emit the code not after CALL, but to the fallthru
edge out of the block, but instead of modifying reload to be fully aware
of CFG, it is easier to fix the damage at the end.
> 
> I was told that one of my changes may have caused a blowup compiling libjava,
> but when I try to do the compilation, it hits the abort in that function and
> I have no idea what the function is supposed to do.
> 
> That comment should be rewritten.  It might also be good to add a few
Can you suggest better working?

Honza
> more comments inside the function and certainly to correct the grammatical
> error in one of the two existing comments.
> 
> I'd also like to take this opportunity to urge all people who approve patches
> to not approve them until they are properly documented: it's much easier to
> get this done before a patch is installed than after.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]