This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: PR 21728


> Hi,
> in the attached testcase there is dead nonlocal label (since we create
> edges call->nonlocal label in the CFG and the outer function has no
> call).  But since at -O0/-O1 we emit the q() we get undefined label in
> assembly output.
> 
> The attached patch fix it by deferring all nested functions to the very
> end of compilation so they are output only when referenced.  Seems
> resonable?

Actually it does not.  Simply adding attribute used to function 'q'
would make it to break again.

One alternative might be to simply teach remove_block to move the label
to other still live block similarly we do with NOTE_LABEL trick in RTL
land.

Other alternative might be to forcingly add ENTRY_BLOCK->label_block
edge for all blocks having nonlocal labels in (as even the reachable
from CALL_EXPR might become unreachable after cfgcleanup)

Honza


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