Re: Statically propagate basic blocks which are likely executed 0 times

2017-06-12 Thread Jan Hubicka
> Hi Honza & Christophe, > > I have tested your suggested fix. It does fix the regression. > Here is a simple patch for it. > > After r249013, die () and dump_stack () are both in cold section. This makes > the compiler generate bl instruction for the function call, instead of > honoring the -mlo

Re: Statically propagate basic blocks which are likely executed 0 times

2017-06-12 Thread Renlin Li
Hi Honza & Christophe, I have tested your suggested fix. It does fix the regression. Here is a simple patch for it. After r249013, die () and dump_stack () are both in cold section. This makes the compiler generate bl instruction for the function call, instead of honoring the -mlong-calls option

Re: Statically propagate basic blocks which are likely executed 0 times

2017-06-09 Thread Jan Hubicka
Hi, this is patch I comitted. Thanks! Honza * predict.c (unlikely_executed_stmt_p): Cleanup. Index: predict.c === --- predict.c (revision 249057) +++ predict.c (working copy) @@ -780,7 +780,7 @@ unlikely_executed_stmt_p (g

Re: Statically propagate basic blocks which are likely executed 0 times

2017-06-09 Thread Jan Hubicka
> Since this commit (r249013), I've noticed a regression on arm targets: > FAIL: gcc.target/arm/cold-lc.c scan-assembler-not bl[^\n]*dump_stack I think that is because we optimize the testcase: /* { dg-do compile } */ /* { dg-options "-O2 -mlong-calls" } */ /* { dg-final { scan-assembler-not "bl\[

Re: Statically propagate basic blocks which are likely executed 0 times

2017-06-09 Thread Christophe Lyon
Hi, On 9 June 2017 at 08:43, Bernhard Reutner-Fischer wrote: > On 8 June 2017 14:52:49 CEST, Jan Hubicka wrote: >>Hi, >>this patch adds static code to detect basic block with 0 execution >>count. >>Those are basic block either reached only by EH or those which leads to >>call of >>function deco

Re: Statically propagate basic blocks which are likely executed 0 times

2017-06-08 Thread Bernhard Reutner-Fischer
On 8 June 2017 14:52:49 CEST, Jan Hubicka wrote: >Hi, >this patch adds static code to detect basic block with 0 execution >count. >Those are basic block either reached only by EH or those which leads to >call of >function decorated with cold attribute. > >Function decorated by noreturn is not suff

Statically propagate basic blocks which are likely executed 0 times

2017-06-08 Thread Jan Hubicka
Hi, this patch adds static code to detect basic block with 0 execution count. Those are basic block either reached only by EH or those which leads to call of function decorated with cold attribute. Function decorated by noreturn is not sufficient, because exit(0) is a call that is executed in most