Re: [PATCH] Do not remove labels with LABEL_PRESERVE_P

2014-09-24 Thread Jeff Law
On 09/24/14 14:38, Ilya Enkovich wrote: 2014-09-24 23:03 GMT+04:00 Jeff Law : 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

Re: [PATCH] Do not remove labels with LABEL_PRESERVE_P

2014-09-24 Thread Ilya Enkovich
2014-09-24 23:03 GMT+04:00 Jeff Law : > 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

Re: [PATCH] Do not remove labels with LABEL_PRESERVE_P

2014-09-24 Thread Jeff Law
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 labe

Re: [PATCH] Do not remove labels with LABEL_PRESERVE_P

2014-09-24 Thread Jeff Law
On 09/24/14 03:30, Steven Bosscher wrote: What appears to be the case here, is that you have a label between two basic blocks B1 and B2, and the label acts as a control flow barrier: B1 and B2 cannot be merged. Then this should be expressed in the CFG. Otherwise: What else prevents the merge_blo

Re: [PATCH] Do not remove labels with LABEL_PRESERVE_P

2014-09-24 Thread Ilya Enkovich
2014-09-24 17:50 GMT+04:00 Steven Bosscher : > On Wed, Sep 24, 2014 at 2:51 PM, Ilya Enkovich wrote: >> 2014-09-24 16:47 GMT+04:00 Steven Bosscher : >> It is not a control flow instruction. It copies value of instruction >> pointer into a general purpose register. Therefore REG_LABEL_OPERAND >> se

Re: [PATCH] Do not remove labels with LABEL_PRESERVE_P

2014-09-24 Thread Steven Bosscher
On Wed, Sep 24, 2014 at 2:51 PM, Ilya Enkovich wrote: > 2014-09-24 16:47 GMT+04:00 Steven Bosscher : > It is not a control flow instruction. It copies value of instruction > pointer into a general purpose register. Therefore REG_LABEL_OPERAND > seems to be correct. OK - sorry for being a bit slow

Re: [PATCH] Do not remove labels with LABEL_PRESERVE_P

2014-09-24 Thread Ilya Enkovich
2014-09-24 16:47 GMT+04:00 Steven Bosscher : > On Wed, Sep 24, 2014 at 2:30 PM, Ilya Enkovich wrote: >> I didn't generate references separately from label. Now I found an >> old patch and a test where this problem appeared. In this patch I >> moved set_rip generation currently performed in ix86_e

Re: [PATCH] Do not remove labels with LABEL_PRESERVE_P

2014-09-24 Thread Steven Bosscher
On Wed, Sep 24, 2014 at 2:30 PM, Ilya Enkovich wrote: > I didn't generate references separately from label. Now I found an > old patch and a test where this problem appeared. In this patch I > moved set_rip generation currently performed in ix86_expand_prologue > into expand pass. And I got foll

Re: [PATCH] Do not remove labels with LABEL_PRESERVE_P

2014-09-24 Thread Ilya Enkovich
2014-09-24 14:35 GMT+04:00 Steven Bosscher : > On Wed, Sep 24, 2014 at 11:57 AM, Ilya Enkovich wrote: >> 2014-09-24 13:30 GMT+04:00 Steven Bosscher : Description of LABEL_PRESERVE_P says label that should always be considered to be needed. >>> >>> It's more specific than that, really: >>>

Re: [PATCH] Do not remove labels with LABEL_PRESERVE_P

2014-09-24 Thread Steven Bosscher
On Wed, Sep 24, 2014 at 11:57 AM, Ilya Enkovich wrote: > 2014-09-24 13:30 GMT+04:00 Steven Bosscher : >>> Description of LABEL_PRESERVE_P says label that should always be >>> considered to be needed. >> >> It's more specific than that, really: >> >> @item LABEL_PRESERVE_P (@var{x}) >> In a @code{co

Re: [PATCH] Do not remove labels with LABEL_PRESERVE_P

2014-09-24 Thread Ilya Enkovich
2014-09-24 13:30 GMT+04:00 Steven Bosscher : > On Wed, Sep 24, 2014 at 8:41 AM, Ilya Enkovich wrote: >> 2014-09-23 20:06 GMT+04:00 Jeff Law: >>> On 09/23/14 10:01, Steven Bosscher wrote: Are you sure this patch is necessary, and is not just papering over another problem? In the past, all

Re: [PATCH] Do not remove labels with LABEL_PRESERVE_P

2014-09-24 Thread Steven Bosscher
On Wed, Sep 24, 2014 at 8:41 AM, Ilya Enkovich wrote: > 2014-09-23 20:06 GMT+04:00 Jeff Law: >> On 09/23/14 10:01, Steven Bosscher wrote: >>> Are you sure this patch is necessary, and is not just papering over >>> another problem? In the past, all cases I've seen where labels were >>> removed inadv

Re: [PATCH] Do not remove labels with LABEL_PRESERVE_P

2014-09-23 Thread Ilya Enkovich
2014-09-23 20:06 GMT+04:00 Jeff Law : > On 09/23/14 10:01, Steven Bosscher wrote: >> >> On Fri, Sep 19, 2014 at 10:03 PM, Jeff Law wrote: >>> >>> On 09/19/14 13:36, Ilya Enkovich wrote: Hi, During my work on enabling pseudo PIC register I've found that cfg cleaunp >>>

Re: [PATCH] Do not remove labels with LABEL_PRESERVE_P

2014-09-23 Thread Jeff Law
On 09/23/14 10:01, Steven Bosscher wrote: On Fri, Sep 19, 2014 at 10:03 PM, Jeff Law wrote: On 09/19/14 13:36, Ilya Enkovich wrote: Hi, During my work on enabling pseudo PIC register I've found that cfg cleaunp may remove lables with LABEL_PRESERVE_P set to 1. In my case I generated SET_RIP

Re: [PATCH] Do not remove labels with LABEL_PRESERVE_P

2014-09-23 Thread Steven Bosscher
On Fri, Sep 19, 2014 at 10:03 PM, Jeff Law wrote: > On 09/19/14 13:36, Ilya Enkovich wrote: >> >> Hi, >> >> During my work on enabling pseudo PIC register I've found that cfg cleaunp >> may remove lables with LABEL_PRESERVE_P set to 1. In my case I generated >> SET_RIP during expand pass and cfg

Re: [PATCH] Do not remove labels with LABEL_PRESERVE_P

2014-09-19 Thread Jeff Law
On 09/19/14 13:36, Ilya Enkovich wrote: Hi, During my work on enabling pseudo PIC register I've found that cfg cleaunp may remove lables with LABEL_PRESERVE_P set to 1. In my case I generated SET_RIP during expand pass and cfg cleanup removed label it used as an operand. Below is a patch th

[PATCH] Do not remove labels with LABEL_PRESERVE_P

2014-09-19 Thread Ilya Enkovich
Hi, During my work on enabling pseudo PIC register I've found that cfg cleaunp may remove lables with LABEL_PRESERVE_P set to 1. In my case I generated SET_RIP during expand pass and cfg cleanup removed label it used as an operand. Below is a patch that fixes it. It is not actually required