[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2019-03-29 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

Jakub Jelinek  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #27 from Jakub Jelinek  ---
Fixed.

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2019-03-29 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

--- Comment #26 from Jakub Jelinek  ---
Author: jakub
Date: Fri Mar 29 11:42:51 2019
New Revision: 270013

URL: https://gcc.gnu.org/viewcvs?rev=270013=gcc=rev
Log:
PR rtl-optimization/87485
* function.c (expand_function_end): Move stack_protect_epilogue
before loading of return value into hard register(s).

* gcc.dg/pr87485.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/pr87485.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/function.c
trunk/gcc/testsuite/ChangeLog

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2019-03-29 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

--- Comment #25 from Uroš Bizjak  ---
(In reply to Richard Biener from comment #24)
> IIRC we used to say sth like "unable to find a register to spill" for
> -fschedule-insns introduced issues.  Even the ICE with max. number of
> LRA passes is nicer than compiling indefinitely.
> 
> So I wonder if we can at least avoid endless work in IRA/LRA and
> maybe even give a sensible hint to the user (try disabling -fschedule-insns).

The patch in Comment #20 is the correct solution, as explained in Comment #19.

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2019-03-29 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1

--- Comment #24 from Richard Biener  ---
IIRC we used to say sth like "unable to find a register to spill" for
-fschedule-insns introduced issues.  Even the ICE with max. number of
LRA passes is nicer than compiling indefinitely.

So I wonder if we can at least avoid endless work in IRA/LRA and
maybe even give a sensible hint to the user (try disabling -fschedule-insns).

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2019-02-02 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

--- Comment #23 from Eric Botcazou  ---
> Because these testcases uncover real problems in the code base, please see
> comment #19.

But there are hundreds open PRs in the database for *real* code with
*realistic* combinations of options.  This one is not one of them.

Regarding -fschedule-insns, there was quite some work done some
> years ago to enable this option on x86, so by fixing PRs involving
> -fchedule-insns, we are inching closer to enabling it by default.

IMO it will really be usable only when they double again the # of registers.

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2019-02-02 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

--- Comment #22 from Uroš Bizjak  ---
(In reply to Eric Botcazou from comment #21)
> Why are we wasting any time or energy on useless PRs like this one involving
> an improbable combination of options on nonsensical code, especially
> -fschedule-insns which is known to be problematic on x86?  We should really
> restrict the PRs to sensible command lines at this point, this is getting
> worse with every release.

Because these testcases uncover real problems in the code base, please see
comment #19. Regarding -fschedule-insns, there was quite some work done some
years ago to enable this option on x86, so by fixing PRs involving
-fchedule-insns, we are inching closer to enabling it by default.

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2019-02-01 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

Eric Botcazou  changed:

   What|Removed |Added

 CC||ebotcazou at gcc dot gnu.org

--- Comment #21 from Eric Botcazou  ---
Why are we wasting any time or energy on useless PRs like this one involving an
improbable combination of options on nonsensical code, especially
-fschedule-insns which is known to be problematic on x86?  We should really
restrict the PRs to sensible command lines at this point, this is getting worse
with every release.

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2019-02-01 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

--- Comment #20 from Jakub Jelinek  ---
Created attachment 45583
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45583=edit
gcc9-pr87485.patch

So like this (untested so far except for the testcase)?

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2018-11-22 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

--- Comment #19 from Uroš Bizjak  ---
(In reply to Vladimir Makarov from comment #18)
> (In reply to Vladimir Makarov from comment #17)
> >   I've reproduced it.  Clearly, it is some bug in LRA conflict calculation. 
> > I will be working on it.
> 
> I investigated it more.  Before scheduling we have
> 
> (insn 60 122 61 7 (parallel [
> (set (subreg:DI (reg:TI 125) 0)
> (zero_extend:DI (udiv:SI (reg:SI 116)
> (reg:SI 119
> (set (reg:SI 118)
> (umod:SI (reg:SI 116)
> (reg:SI 119)))
> (clobber (reg:CC 17 flags))
>  ...
> 
> (insn 90 69 92 7 (set (reg/i:SI 0 ax)
> (const_int 0 [0])) "pr87485.c":34:1 67 {*movsi_internal}
>  (nil))
> 
> After scheduling we have
> 
> (insn 90 54 60 7 (set (reg/i:SI 0 ax)
> (const_int 0 [0])) "pr87485.c":34:1 67 {*movsi_internal}
>  (nil))
> (insn 60 90 61 7 (parallel [
> (set (subreg:DI (reg:TI 125) 0)
> (zero_extend:DI (udiv:SI (reg:SI 116)
> (reg:SI 119
> (set (reg:SI 118)
> (umod:SI (reg:SI 116)
> (reg:SI 119)))
> (clobber (reg:CC 17 flags))

This happens when return pair gets split in expand_function_end. sched1 pass
has certain code that marks both instructions as CANT_MOVE (c.f. a comment in
add_branch_dependencies:

 Insns setting TARGET_CLASS_LIKELY_SPILLED_P registers (usually return
 values) are not moved before reload because we can wind up with register
 allocation failures.
)

stack protect epilogue code gets inserted in between return pair, so the final
assignment to a hard register gets away from the USE insn. The above code is
ineffective in case of split return pair.

So, expand_function_end should be fixed to emit an assignment to a function
value hard reg just before use insn. Some parts of the compiler (sched1 and
mode switching passes) depend on an unbroken return pair!

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2018-11-22 Thread vmakarov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

--- Comment #18 from Vladimir Makarov  ---
(In reply to Vladimir Makarov from comment #17)
>   I've reproduced it.  Clearly, it is some bug in LRA conflict calculation. 
> I will be working on it.

I investigated it more.  Before scheduling we have

(insn 60 122 61 7 (parallel [
(set (subreg:DI (reg:TI 125) 0)
(zero_extend:DI (udiv:SI (reg:SI 116)
(reg:SI 119
(set (reg:SI 118)
(umod:SI (reg:SI 116)
(reg:SI 119)))
(clobber (reg:CC 17 flags))
 ...

(insn 90 69 92 7 (set (reg/i:SI 0 ax)
(const_int 0 [0])) "pr87485.c":34:1 67 {*movsi_internal}
 (nil))

After scheduling we have

(insn 90 54 60 7 (set (reg/i:SI 0 ax)
(const_int 0 [0])) "pr87485.c":34:1 67 {*movsi_internal}
 (nil))
(insn 60 90 61 7 (parallel [
(set (subreg:DI (reg:TI 125) 0)
(zero_extend:DI (udiv:SI (reg:SI 116)
(reg:SI 119
(set (reg:SI 118)
(umod:SI (reg:SI 116)
(reg:SI 119)))
(clobber (reg:CC 17 flags))

  No way, RA can allocate ax for insn 60.  So it is typical problem for 1st
insn scheduling on x86/x86-64.  That is why it is switched off by default on
this target.

  -fsched-presure and hard reg splitting in lra does not work for this case. 
Unfortunately, they are not panacea.

   I'll look what can I do in hard register splitting but I am bit pessimistic
that it will be fixed soon.

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2018-11-21 Thread vmakarov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

--- Comment #17 from Vladimir Makarov  ---
  I've reproduced it.  Clearly, it is some bug in LRA conflict calculation.  I
will be working on it.

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2018-11-20 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

--- Comment #16 from Uroš Bizjak  ---
(In reply to Uroš Bizjak from comment #15)
> (In reply to Uroš Bizjak from comment #14)
> > (In reply to Jakub Jelinek from comment #13)
> > > (In reply to Uroš Bizjak from comment #12)
> > > > (In reply to Jakub Jelinek from comment #10)
> > > > > and r264676 fixed that ICE, but hangs on it.
> > > > Are you sure you have correct revision here? Mentioned revision removes 
> > > > FPSR
> > > > x87 status register, which x86_64 should not use at all. The description
> > > > mentions r264726 that mentions many changes in ira-lives.c and 
> > > > lra-lives.c
> > > 
> > > Yes.
> > 
> > Strange... Even more strange is the fact, that it works for me with:
> > 
> > GCC: (GNU) 9.0.0 20181119 (experimental) [trunk revision 266278]
> > 
> > $ /ssd/uros/gcc-build/gcc/cc1 -quiet -O2 -fschedule-insns
> > -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference
> > -fno-omit-frame-pointer -fno-split-wide-types -fno-tree-ccp -fno-tree-sra
> > pr87485.c; echo $?
> > pr87485.c: In function ‘c8’:
> > pr87485.c:19:23: warning: division by zero [-Wdiv-by-zero]
> >19 |   *xh += fl < (e4 / 0);
> >   |   ^
> > 0
> 
> Ah, needs also -fstack-protector-strong.

The compiler goes into reload loop, the loop can be seen in _reload dump, which
will quickly grow to several megabytes:

 Choosing alt 0 in insn 60:  (0) =a  (1) =  (2) 0  (3) rm
{*udivmodsi4_zext_1}
  Creating newreg=146, assigning class AREG to r146
   60:
{r146:DI=zero_extend(udiv(r146:DI#0,r119:SI));r118:SI=umod(r146:DI#0,r119:SI);clobber
flags:CC;}
  REG_DEAD r119:SI
  REG_DEAD r116:SI
  REG_UNUSED r118:SI
  REG_UNUSED flags:CC
Inserting insn reload before:
  146: clobber r146:DI
  147: r146:DI#0=r116:SI
Inserting insn reload after:
  148: r125:TI#0=r146:DI

...

 Choosing alt 0 in insn 60:  (0) =a  (1) =  (2) 0  (3) rm
{*udivmodsi4_zext_1}
  Creating newreg=149 from oldreg=146, assigning class AREG to r149
   60:
{r149:DI=zero_extend(udiv(r149:DI#0,r119:SI));r118:SI=umod(r149:DI#0,r119:SI);clobber
flags:CC;}
  REG_DEAD r119:SI
  REG_UNUSED r118:SI
  REG_UNUSED flags:CC
Inserting insn reload before:
  151: clobber r149:DI
  152: r149:DI#0=r146:DI#0
Inserting insn reload after:
  153: r146:DI=r149:DI

...

 Choosing alt 0 in insn 60:  (0) =a  (1) =  (2) 0  (3) rm
{*udivmodsi4_zext_1}
  Creating newreg=151 from oldreg=149, assigning class AREG to r151
   60:
{r151:DI=zero_extend(udiv(r151:DI#0,r119:SI));r118:SI=umod(r151:DI#0,r119:SI);clobber
flags:CC;}
  REG_DEAD r119:SI
  REG_UNUSED r118:SI
  REG_UNUSED flags:CC
Inserting insn reload before:
  156: clobber r151:DI
  157: r151:DI#0=r149:DI#0
Inserting insn reload after:
  158: r149:DI=r151:DI

...

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2018-11-20 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

--- Comment #15 from Uroš Bizjak  ---
(In reply to Uroš Bizjak from comment #14)
> (In reply to Jakub Jelinek from comment #13)
> > (In reply to Uroš Bizjak from comment #12)
> > > (In reply to Jakub Jelinek from comment #10)
> > > > and r264676 fixed that ICE, but hangs on it.
> > > Are you sure you have correct revision here? Mentioned revision removes 
> > > FPSR
> > > x87 status register, which x86_64 should not use at all. The description
> > > mentions r264726 that mentions many changes in ira-lives.c and lra-lives.c
> > 
> > Yes.
> 
> Strange... Even more strange is the fact, that it works for me with:
> 
> GCC: (GNU) 9.0.0 20181119 (experimental) [trunk revision 266278]
> 
> $ /ssd/uros/gcc-build/gcc/cc1 -quiet -O2 -fschedule-insns
> -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference
> -fno-omit-frame-pointer -fno-split-wide-types -fno-tree-ccp -fno-tree-sra
> pr87485.c; echo $?
> pr87485.c: In function ‘c8’:
> pr87485.c:19:23: warning: division by zero [-Wdiv-by-zero]
>19 |   *xh += fl < (e4 / 0);
>   |   ^
> 0

Ah, needs also -fstack-protector-strong.

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2018-11-20 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

--- Comment #14 from Uroš Bizjak  ---
(In reply to Jakub Jelinek from comment #13)
> (In reply to Uroš Bizjak from comment #12)
> > (In reply to Jakub Jelinek from comment #10)
> > > and r264676 fixed that ICE, but hangs on it.
> > Are you sure you have correct revision here? Mentioned revision removes FPSR
> > x87 status register, which x86_64 should not use at all. The description
> > mentions r264726 that mentions many changes in ira-lives.c and lra-lives.c
> 
> Yes.

Strange... Even more strange is the fact, that it works for me with:

GCC: (GNU) 9.0.0 20181119 (experimental) [trunk revision 266278]

$ /ssd/uros/gcc-build/gcc/cc1 -quiet -O2 -fschedule-insns
-fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference
-fno-omit-frame-pointer -fno-split-wide-types -fno-tree-ccp -fno-tree-sra
pr87485.c; echo $?
pr87485.c: In function ‘c8’:
pr87485.c:19:23: warning: division by zero [-Wdiv-by-zero]
   19 |   *xh += fl < (e4 / 0);
  |   ^
0

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2018-11-20 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

--- Comment #13 from Jakub Jelinek  ---
(In reply to Uroš Bizjak from comment #12)
> (In reply to Jakub Jelinek from comment #10)
> > and r264676 fixed that ICE, but hangs on it.
> Are you sure you have correct revision here? Mentioned revision removes FPSR
> x87 status register, which x86_64 should not use at all. The description
> mentions r264726 that mentions many changes in ira-lives.c and lra-lives.c

Yes.

$ timeout 10s ./cc1.264675 -quiet -O2 -fschedule-insns
-fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference
-fno-omit-frame-pointer -fno-split-wide-types -fno-tree-ccp -fno-tree-sra
-fstack-protector-strong pr87485.c; echo $?
pr87485.c: In function ‘c8’:
pr87485.c:19:23: warning: division by zero [-Wdiv-by-zero]
19 |   *xh += fl < (e4 / 0);
   |   ^
during RTL pass: reload
pr87485.c:34:1: internal compiler error: Maximum number of LRA assignment
passes is achieved (30)

34 | }
   | ^
0xe30a28 lra_assign(bool&)
../../gcc/lra-assigns.c:1669
0xe2844b lra(_IO_FILE*)
../../gcc/lra.c:2508
0xdbcf3b do_reload
../../gcc/ira.c:5469
0xdbd42e execute
../../gcc/ira.c:5653
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
4
$ timeout 10s ./cc1.264676 -quiet -O2 -fschedule-insns
-fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference
-fno-omit-frame-pointer -fno-split-wide-types -fno-tree-ccp -fno-tree-sra
-fstack-protector-strong pr87485.c; echo $?
pr87485.c: In function ‘c8’:
pr87485.c:19:23: warning: division by zero [-Wdiv-by-zero]
19 |   *xh += fl < (e4 / 0);
   |   ^
124
$ ls -l ./cc1.26467[567]
-rwxrwxr-x. 1 jakub jakub 147562008 Oct  8 08:18 ./cc1.264675
-rwxrwxr-x. 1 jakub jakub 147554608 Oct  8 08:19 ./cc1.264676
-rwxrwxr-x. 1 jakub jakub 147554568 Oct  8 08:21 ./cc1.264677

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2018-11-20 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

--- Comment #12 from Uroš Bizjak  ---
(In reply to Jakub Jelinek from comment #10)
> and r264676 fixed that ICE, but hangs on it.
Are you sure you have correct revision here? Mentioned revision removes FPSR
x87 status register, which x86_64 should not use at all. The description
mentions r264726 that mentions many changes in ira-lives.c and lra-lives.c

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2018-11-20 Thread amonakov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

--- Comment #11 from Alexander Monakov  ---
Just for information: the extra flag is needed due to --enable-default-ssp on
Arseny's configure command line.

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2018-11-20 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

Jakub Jelinek  changed:

   What|Removed |Added

 Status|WAITING |NEW
 CC||rsandifo at gcc dot gnu.org,
   ||uros at gcc dot gnu.org,
   ||vmakarov at gcc dot gnu.org

--- Comment #10 from Jakub Jelinek  ---
Confirmed, with -O2 -fschedule-insns -fno-guess-branch-probability
-fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer
-fno-split-wide-types -fno-tree-ccp -fno-tree-sra -fstack-protector-strong this
used to be fast until
r261531 when it started to ICE:
pr87485.c:34:1: internal compiler error: Maximum number of LRA assignment
passes is achieved (30)
and r264676 fixed that ICE, but hangs on it.

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2018-11-16 Thread amonakov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

--- Comment #9 from Alexander Monakov  ---
Martin, Jakub: if I add -fstack-protector-strong, the problem is reproducible
for me - can you try that?

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2018-11-16 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

--- Comment #8 from Arseny Solokha  ---
(In reply to Alexander Monakov from comment #7)
> It appears you are building via portage and thus have Gentoo patches applied?

Yes, I build weekly snapshots via Portage for convenience. But I use modified
toolchain.eclass, and of course never apply Gentoo patches to them. My
snapshots are vanilla.

Gentoo's unpatched toolchain.eclass adds custom branding, among other things,
which can be seen in -v output from my system compiler (compare it w/ the one
from snapshot in comment 3):

% gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-unknown-linux-gnu/8.2.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-8.2.0-r4/work/gcc-8.2.0/configure
--host=x86_64-unknown-linux-gnu --build=x86_64-unknown-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-unknown-linux-gnu/gcc-bin/8.2.0
--includedir=/usr/lib/gcc/x86_64-unknown-linux-gnu/8.2.0/include
--datadir=/usr/share/gcc-data/x86_64-unknown-linux-gnu/8.2.0
--mandir=/usr/share/gcc-data/x86_64-unknown-linux-gnu/8.2.0/man
--infodir=/usr/share/gcc-data/x86_64-unknown-linux-gnu/8.2.0/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-unknown-linux-gnu/8.2.0/include/g++-v8
--with-python-dir=/share/gcc-data/x86_64-unknown-linux-gnu/8.2.0/python
--enable-languages=c,c++ --enable-obsolete --enable-secureplt --disable-werror
--with-system-zlib --disable-nls --enable-checking=release
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo Hardened
8.2.0-r4 p1.5' --enable-esp --enable-libstdcxx-time --disable-libstdcxx-pch
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-clocale=gnu --disable-multilib --with-multilib-list=m64
--disable-altivec --disable-fixed-point --enable-targets=all --enable-libgomp
--disable-libmudflap --disable-libssp --disable-libmpx --disable-systemtap
--enable-vtable-verify --enable-libvtv --disable-libquadmath --enable-lto
--with-isl --disable-isl-version-check --disable-libsanitizer
--enable-default-pie --enable-default-ssp
Thread model: posix
gcc version 8.2.0 (Gentoo Hardened 8.2.0-r4 p1.5)

On the last line here you can see custom branding (Gentoo Hardened) and the
Gentoo patchset verson (1.5).

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2018-11-16 Thread amonakov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

Alexander Monakov  changed:

   What|Removed |Added

 CC||amonakov at gcc dot gnu.org

--- Comment #7 from Alexander Monakov  ---
It appears you are building via portage and thus have Gentoo patches applied?

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2018-11-16 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

--- Comment #6 from Arseny Solokha  ---
There must be something wrong w/ the way I configure gcc, then. It takes
indefinite time compiling the testcase only at -O2 or -Os and finishes
instantly at any other optimization level. But it also finishes instantly when
I add -fstack-protector or -fno-stack-protector - strangely, either of them.

What additional info should I provide? config.status, maybe?

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2018-11-16 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #5 from Jakub Jelinek  ---
Can't reproduce either:
/opt/notnfs/gcc-bisect/obj/gcc/cc1.264727 -quiet -O2 -fschedule-insns
-fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference
-fno-omit-frame-pointer -fno-split-wide-types -fno-tree-ccp -fno-tree-sra
pr87485.c
pr87485.c: In function ‘c8’:
pr87485.c:19:23: warning: division by zero [-Wdiv-by-zero]
19 |   *xh += fl < (e4 / 0);
   |   ^
finishes instantly.

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2018-10-03 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

--- Comment #4 from Martin Liška  ---
Unfortunately can't reproduce even with your complete option list.

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2018-10-03 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

--- Comment #3 from Arseny Solokha  ---
% x86_64-pc-linux-gnu-gcc-9.0.0-alpha20180930 -O2 -fschedule-insns
-fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference
-fno-omit-frame-pointer -fno-split-wide-types -fno-tree-ccp -fno-tree-sra -w -c
wo2ahro9.c --verbose
Using built-in specs.
COLLECT_GCC=x86_64-pc-linux-gnu-gcc-9.0.0-alpha20180930
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20180930/work/gcc-9-20180930/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/9.0.0-alpha20180930
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/9.0.0-alpha20180930/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/9.0.0-alpha20180930
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/9.0.0-alpha20180930/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/9.0.0-alpha20180930/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/9.0.0-alpha20180930/include/g++-v9
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/9.0.0-alpha20180930/python
--enable-languages=c,c++ --enable-obsolete --enable-secureplt --disable-werror
--with-system-zlib --disable-nls --enable-checking=yes --disable-esp
--enable-libstdcxx-time --disable-libstdcxx-pch --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--disable-multilib --with-multilib-list=m64 --disable-altivec
--disable-fixed-point --enable-targets=all --enable-libgomp
--disable-libmudflap --disable-libssp --disable-libmpx --disable-systemtap
--disable-vtable-verify --disable-libvtv --disable-libquadmath --enable-lto
--with-isl --disable-isl-version-check --disable-libsanitizer
--enable-default-pie --enable-default-ssp
Thread model: posix
gcc version 9.0.0-alpha20180930 20180930 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-O2' '-fschedule-insns' '-fno-guess-branch-probability'
'-fno-isolate-erroneous-paths-dereference' '-fno-omit-frame-pointer'
'-fno-split-wide-types' '-fno-tree-ccp' '-fno-tree-sra' '-w' '-c' '-v'
'-mtune=generic' '-march=x86-64'
 /usr/libexec/gcc/x86_64-pc-linux-gnu/9.0.0-alpha20180930/cc1 -quiet -v
wo2ahro9.c -quiet -dumpbase wo2ahro9.c -mtune=generic -march=x86-64 -auxbase
wo2ahro9 -O2 -w -version -fschedule-insns -fno-guess-branch-probability
-fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer
-fno-split-wide-types -fno-tree-ccp -fno-tree-sra -o /tmp/ccMuyRPu.s
GNU C17 (GCC) version 9.0.0-alpha20180930 20180930 (experimental)
(x86_64-pc-linux-gnu)
compiled by GNU C version 9.0.0-alpha20180930 20180930 (experimental),
GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version
isl-0.20-GMP

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-pc-linux-gnu/9.0.0-alpha20180930/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-pc-linux-gnu/9.0.0-alpha20180930/include
 /usr/lib/gcc/x86_64-pc-linux-gnu/9.0.0-alpha20180930/include-fixed
 /usr/include
End of search list.
GNU C17 (GCC) version 9.0.0-alpha20180930 20180930 (experimental)
(x86_64-pc-linux-gnu)
compiled by GNU C version 9.0.0-alpha20180930 20180930 (experimental),
GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version
isl-0.20-GMP

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 7ddb5283a960f24fa6ae96c9b977a55b

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2018-10-03 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2018-10-03
 CC||marxin at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Martin Liška  ---
Can't confirm, can you please paste content of --verbose option?

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2018-10-02 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

Richard Biener  changed:

   What|Removed |Added

   Keywords||ra
   Target Milestone|--- |9.0

[Bug rtl-optimization/87485] [9 Regression] Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-type

2018-10-02 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87485

--- Comment #1 from Arseny Solokha  ---
Some hot entries from the tip of "perf top" output:

Overhead  Shared Objec  Symbol
  23.31%  cc1   [.] find_hard_regno_for_1
  18.20%  cc1   [.] assign_by_spills
  14.17%  cc1   [.] process_bb_lives
   8.35%  cc1   [.] bitmap_set_bit
   8.01%  cc1   [.] reload_pseudo_compare_func
   4.04%  cc1   [.] lra_get_insn_regs
   3.40%  cc1   [.] lra_create_live_ranges_1
   3.03%  cc1   [.] mark_pseudo_live
   2.34%  cc1   [.] lra_assign
   1.71%  cc1   [.] bitmap_clear_bit
   1.35%  cc1   [.] update_reg_eliminate
   1.27%  cc1   [.] update_lives
   1.07%  cc1   [.] qsort_chk
   0.85%  cc1   [.] lra_clear_live_ranges
   0.85%  cc1   [.] mark_regno_live
   0.84%  cc1   [.] mark_pseudo_dead
   0.78%  cc1   [.] insert_in_live_range_start_chain
   0.71%  cc1   [.] lra_split_hard_reg_for
   0.71%  cc1   [.] sparseset_clear_bit
   0.50%  cc1   [.] find_hard_regno_for
   0.48%  cc1   [.] sparseset_and_compl
   0.43%  cc1   [.] lra_free_copies
   0.36%  cc1   [.] get_equiv
   0.28%  cc1   [.] may_trap_p_1