This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Do not remove labels with LABEL_PRESERVE_P
- From: Ilya Enkovich <enkovich dot gnu at gmail dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Steven Bosscher <stevenb dot gcc at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 25 Sep 2014 00:38:28 +0400
- Subject: Re: [PATCH] Do not remove labels with LABEL_PRESERVE_P
- Authentication-results: sourceware.org; auth=none
- References: <20140919193604 dot GA48001 at msticlxl57 dot ims dot intel dot com> <541C8C0C dot 8040300 at redhat dot com> <CABu31nN-HZ_qYM4N2w_dstwehmvwTj66XMNB=jfHerwj4NdBXQ at mail dot gmail dot com> <54219A77 dot 70403 at redhat dot com> <CAMbmDYb5zVfQb98WJ40pJy9rYkUFBB-=es1ZHzSemB8f73HAqA at mail dot gmail dot com> <CABu31nMK5UmJtKCMZYC2bb7fLbsGMrej4hmB2H-2BpQqEbbpcQ at mail dot gmail dot com> <CAMbmDYYw1-wqEDRAWycqbHCA5RXzuTZBJdE-X_s=-dbA5wAw4g at mail dot gmail dot com> <CABu31nPgUy-pBJuROKuxuON+LxEsJSiMOZ_6_a0nEixE-gkrLQ at mail dot gmail dot com> <54231584 dot 3000908 at redhat dot com>
2014-09-24 23:03 GMT+04:00 Jeff Law <law@redhat.com>:
> On 09/24/14 04:35, Steven Bosscher wrote:
>>>
>>>
>>> According to description you quoted label marked by LABEL_PRESERVE_P
>>> is used by some code or data. Let this use be not visible to the RTL
>>> of a given function. It is still used, right? How can you remove it?
>>
>>
>> The code_label rtx is removed, but the label itself is still output to
>> the object file. The label number is retained in the CODE_LABEL_NUMBER
>> of the NOTE_INSN_DELETED_LABEL. Look for how NOTE_INSN_DELETED_LABEL
>> is handled in final.c. It's a hack IMHO, but that's how it has been
>> since day 0 (see https://gcc.gnu.org/r104).
>
> Right. We transform it into a NOTE_INSN_DELETED_LABEL, but still output it
> into the assembly code. There's one other intereseting aspect here -- IIRC,
> we allow NOTE_INSN_DELETED_LABELs to move around the insn stream. My
> recollection was we may move them from between two blocks to the start of a
> block to facilitate block merging.
>
> Basically the LABEL_PRESERVE_P ensures the label gets output in the assembly
> code. THe docs could possibly use some clarification.
>
> Jeff
The patch has been already installed. Should it be reverted for now
then? Or probably test and install a version with LABEL_NUSES? It
still doesn't looks correct that cfgcleanup may remove label with
nonzero count of uses with following ICE in optimizers.
Ilya