Message ID | 4EC4CCC1.4050802@mentor.com |
---|---|
State | New |
Headers | show |
On 17/11/2011, at 9:58 PM, Tom de Vries wrote: > On 11/15/2011 10:07 PM, Maxim Kuvyrkov wrote: >> On 30/10/2011, at 8:17 AM, Tom de Vries wrote: >> >>> Richard, >>> >>> I have a tentative fix for PR50764. >> >> Richard, >> >> Tom's patch is good (with the comments below addressed), and I would appreciate you validating my review with your formal approval. >> > > Richard, > > Updated patch according to comments from Maxim. Added test-case. Bootstrapped > and reg-tested on x86_64. > > Ok for trunk? > > Thanks, > - Tom > ... > Index: gcc/sched-deps.c > =================================================================== > --- gcc/sched-deps.c (revision 181377) > +++ gcc/sched-deps.c (working copy) > @@ -2812,8 +2812,15 @@ sched_analyze_insn (struct deps_desc *de > during prologue generation and avoid marking the frame pointer setup > as frame-related at all. */ > if (RTX_FRAME_RELATED_P (insn)) > - deps->sched_before_next_jump > - = alloc_INSN_LIST (insn, deps->sched_before_next_jump); > + { > + /* Make sure prologue insn is scheduled before next jump. */ > + deps->sched_before_next_jump > + = alloc_INSN_LIST (insn, deps->sched_before_next_jump); > + > + /* Make sure epilogue insn is scheduled after preceding jumps. */ > + if (deps->pending_jump_insns) You don't need this check, it's done anyway in add_dependence_list. [No need to resubmit or retest the patch after this change, it's trivial.] > + add_dependence_list (insn, deps->pending_jump_insns, 1, REG_DEP_ANTI); > + } > > if (code == COND_EXEC) > { Thank you, -- Maxim Kuvyrkov CodeSourcery / Mentor Graphics
On 17/11/11 17:53, Maxim Kuvyrkov wrote: > On 17/11/2011, at 9:58 PM, Tom de Vries wrote: > >> On 11/15/2011 10:07 PM, Maxim Kuvyrkov wrote: >>> On 30/10/2011, at 8:17 AM, Tom de Vries wrote: >>> >>>> Richard, >>>> >>>> I have a tentative fix for PR50764. >>> >>> Richard, >>> >>> Tom's patch is good (with the comments below addressed), and I would appreciate you validating my review with your formal approval. >>> >> >> Richard, >> >> Updated patch according to comments from Maxim. Added test-case. Bootstrapped >> and reg-tested on x86_64. >> >> Ok for trunk? >> Ping. Vladimir, could you take a look at this patch? Thanks, - Tom >> Thanks, >> - Tom >> > ... >> Index: gcc/sched-deps.c >> =================================================================== >> --- gcc/sched-deps.c (revision 181377) >> +++ gcc/sched-deps.c (working copy) >> @@ -2812,8 +2812,15 @@ sched_analyze_insn (struct deps_desc *de >> during prologue generation and avoid marking the frame pointer setup >> as frame-related at all. */ >> if (RTX_FRAME_RELATED_P (insn)) >> - deps->sched_before_next_jump >> - = alloc_INSN_LIST (insn, deps->sched_before_next_jump); >> + { >> + /* Make sure prologue insn is scheduled before next jump. */ >> + deps->sched_before_next_jump >> + = alloc_INSN_LIST (insn, deps->sched_before_next_jump); >> + >> + /* Make sure epilogue insn is scheduled after preceding jumps. */ >> + if (deps->pending_jump_insns) > > You don't need this check, it's done anyway in add_dependence_list. [No need to resubmit or retest the patch after this change, it's trivial.] > >> + add_dependence_list (insn, deps->pending_jump_insns, 1, REG_DEP_ANTI); >> + } >> >> if (code == COND_EXEC) >> { > > Thank you, > > -- > Maxim Kuvyrkov > CodeSourcery / Mentor Graphics > > > >
On 11/22/2011 04:39 AM, Tom de Vries wrote: > On 17/11/11 17:53, Maxim Kuvyrkov wrote: >> On 17/11/2011, at 9:58 PM, Tom de Vries wrote: >> >>> On 11/15/2011 10:07 PM, Maxim Kuvyrkov wrote: >>>> On 30/10/2011, at 8:17 AM, Tom de Vries wrote: >>>> >>>>> Richard, >>>>> >>>>> I have a tentative fix for PR50764. >>>> Richard, >>>> >>>> Tom's patch is good (with the comments below addressed), and I would appreciate you validating my review with your formal approval. >>>> >>> Richard, >>> >>> Updated patch according to comments from Maxim. Added test-case. Bootstrapped >>> and reg-tested on x86_64. >>> >>> Ok for trunk? >>> > Ping. > > Vladimir, > > could you take a look at this patch? > The patch is ok for me. It can go to the trunk. Thanks for working on this.
Index: gcc/sched-deps.c =================================================================== --- gcc/sched-deps.c (revision 181377) +++ gcc/sched-deps.c (working copy) @@ -2812,8 +2812,15 @@ sched_analyze_insn (struct deps_desc *de during prologue generation and avoid marking the frame pointer setup as frame-related at all. */ if (RTX_FRAME_RELATED_P (insn)) - deps->sched_before_next_jump - = alloc_INSN_LIST (insn, deps->sched_before_next_jump); + { + /* Make sure prologue insn is scheduled before next jump. */ + deps->sched_before_next_jump + = alloc_INSN_LIST (insn, deps->sched_before_next_jump); + + /* Make sure epilogue insn is scheduled after preceding jumps. */ + if (deps->pending_jump_insns) + add_dependence_list (insn, deps->pending_jump_insns, 1, REG_DEP_ANTI); + } if (code == COND_EXEC) { Index: gcc/testsuite/gcc.dg/pr50764.c =================================================================== --- /dev/null (new file) +++ gcc/testsuite/gcc.dg/pr50764.c (revision 0) @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fsched2-use-superblocks -ftree-tail-merge" } */ + +typedef int aligned __attribute__ ((aligned (64))); +extern void abort (void); + +int bar (void *p); + +void +foo (void) +{ + char *p = __builtin_alloca (13); + aligned i; + + if (bar (p) || bar (&i)) + abort (); +}