[Bug tree-optimization/63595] Segmentation faults inside kernel

2014-10-21 Thread pthaugen at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63595

--- Comment #4 from Pat Haugen pthaugen at gcc dot gnu.org ---
Created attachment 33775
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=33775action=edit
unreduced bzip2 testcase

CPU2006 benchmark 447.dealII started segfaulting on PowerPC with revision
216305. Sorry for unreduced testcase, but wanted to get info out. ICF is
commoning functions, but doing so incorrectly. Atached .bzip2 file can be
compiled with 'g++ -S -m64 -O2 -mcpu=power7 tria.ii' to show the problem.

Looking at the generated assembler, the following 3 functions:
_ZNK13TriangulationILi3EE8end_faceEv
_ZNK13TriangulationILi3EE7end_hexEv
_ZNK13TriangulationILi3EE3endEv
have all been changed to call '_ZNK13TriangulationILi3EE8end_quadEv' instead of
having equivalent inline code. It appears the code for all 4 functions is the
same in r216304, but with r216305 the 3 named functions are loading gpr3 with
the addr of a local stack temp before calling
'_ZNK13TriangulationILi3EE8end_quadEv', such that the desired values do not get
stored off the original gpr3 value passed in (see '' line noted below).

Following is generated asm for '_ZNK13TriangulationILi3EE8end_faceEv', the
other two are similar:

r216304:
li 10,-1
std 4,8(3)
stw 10,0(3)
stw 10,4(3)
blr


216305:
mflr 0
std 0,16(1)
stdu 1,-128(1)
.cfi_def_cfa_offset 128
.cfi_offset 65, 16
 addi 3,1,112
bl _ZNK13TriangulationILi3EE8end_quadEv
nop
addi 1,1,128
.cfi_def_cfa_offset 0
ld 0,16(1)
mtlr 0
.cfi_restore 65
blr

A side comment about the above ICF tranformation, it sure seems like this is
going to degrade performance. We've went from a simple stackless leaf function
to one that stacks a frame and makes a call.


[Bug tree-optimization/63595] Segmentation faults inside kernel

2014-10-20 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63595

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2014-10-20
 Ever confirmed|0   |1


[Bug tree-optimization/63595] Segmentation faults inside kernel

2014-10-19 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63595

Andrew Pinski pinskia at gcc dot gnu.org changed:

   What|Removed |Added

  Component|c   |tree-optimization

--- Comment #1 from Andrew Pinski pinskia at gcc dot gnu.org ---
This is most likely either bug 63569 or bug 63583 (both I filed after creating
a reduced testcase).


[Bug tree-optimization/63595] Segmentation faults inside kernel

2014-10-19 Thread sasha.levin at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63595

--- Comment #2 from Sasha Levin sasha.levin at oracle dot com ---
Thanks. I'll keep an eye on both of them, and will report here if the fix for
either of those fixes the segmentation faults I'm seeing.

Did you happen to bisect it down to the same commit?


[Bug tree-optimization/63595] Segmentation faults inside kernel

2014-10-19 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63595

--- Comment #3 from Andrew Pinski pinskia at gcc dot gnu.org ---
(In reply to Sasha Levin from comment #2)
 Did you happen to bisect it down to the same commit?

Yes.