public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/52307] New: Segmentation fault in Lapack with -O3 -floop-flatten -floop-strip-mine
@ 2012-02-19  1:57 tkoenig at gcc dot gnu.org
  2012-02-19  9:33 ` [Bug tree-optimization/52307] " tkoenig at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2012-02-19  1:57 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52307

             Bug #: 52307
           Summary: Segmentation fault in Lapack with -O3 -floop-flatten
                    -floop-strip-mine
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tkoenig@gcc.gnu.org
                CC: rguenth@gcc.gnu.org


Running the Lapack tests (and looking at PR 50561), I encountered this:

 All tests for SPP drivers  passed the threshold (   1910 tests run)

 SPB routines passed the tests of the error exits

Program received signal 11 (SIGSEGV): Segmentation fault.

Backtrace for this error:
  + [0xfff8e340418]
  + function 0000009f.plt_call.cosf@@GLIBC_2.3+0 (0x100B6FDC)
    from file crtstuff.c

tkoenig@gcc1-power7 TESTING]$ ~/bin/gfortran -v
Using built-in specs.
COLLECT_GCC=/home/tkoenig/bin/gfortran
COLLECT_LTO_WRAPPER=/home/tkoenig/libexec/gcc/powerpc64-unknown-linux-gnu/4.7.0/lto-wrapper
Target: powerpc64-unknown-linux-gnu
Configured with: ../trunk/configure --prefix=/home/tkoenig
--enable-languages=c,fortran --with-ppl --with-cloog
Thread model: posix
gcc version 4.7.0 20120218 (experimental) [trunk revision 184372] (GCC)
[tkoenig@gcc1-power7 TESTING]$

This is after the fix for PR 50561, and may be related.

I haven't yet checked if this is a regression.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug tree-optimization/52307] Segmentation fault in Lapack with -O3 -floop-flatten -floop-strip-mine
  2012-02-19  1:57 [Bug tree-optimization/52307] New: Segmentation fault in Lapack with -O3 -floop-flatten -floop-strip-mine tkoenig at gcc dot gnu.org
@ 2012-02-19  9:33 ` tkoenig at gcc dot gnu.org
  2012-02-19 12:24 ` dominiq at lps dot ens.fr
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2012-02-19  9:33 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52307

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical

--- Comment #1 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2012-02-19 08:00:36 UTC ---
There are many more bugs.  This occurs with

xlintsts < stest.in

and (using the debugger) the segfault is

Program received signal SIGSEGV, Segmentation fault.
0x00000000100b2bd0 in spbtrf (uplo='\000', n=0, kd=0, ab=..., ldab=0, info=0,
_uplo=<optimized out>) at spbtrf.f:336
336                       WORK( I, J ) = ZERO

      SUBROUTINE SPBTRF( UPLO, N, KD, AB, LDAB, INFO )
*
*  -- LAPACK computational routine (version 3.4.0) --
*  -- LAPACK is a software package provided by Univ. of Tennessee,    --
*  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
*     November 2011
*
*     .. Scalar Arguments ..
      CHARACTER          UPLO
      INTEGER            INFO, KD, LDAB, N
*     ..
*     .. Array Arguments ..
      REAL               AB( LDAB, * )
*     ..
*
*  =====================================================================
*
*     .. Parameters ..
      REAL               ONE, ZERO
      PARAMETER          ( ONE = 1.0E+0, ZERO = 0.0E+0 )
      INTEGER            NBMAX, LDWORK
      PARAMETER          ( NBMAX = 32, LDWORK = NBMAX+1 )
*     ..
*     .. Local Scalars ..
      INTEGER            I, I2, I3, IB, II, J, JJ, NB
*     ..
*     .. Local Arrays ..
      REAL               WORK( LDWORK, NBMAX )

...

*           Zero the lower triangle of the work array.
*
            DO 90 J = 1, NB
               DO 80 I = J + 1, NB
                  WORK( I, J ) = ZERO
   80          CONTINUE
   90       CONTINUE

Trying to reduce this further.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug tree-optimization/52307] Segmentation fault in Lapack with -O3 -floop-flatten -floop-strip-mine
  2012-02-19  1:57 [Bug tree-optimization/52307] New: Segmentation fault in Lapack with -O3 -floop-flatten -floop-strip-mine tkoenig at gcc dot gnu.org
  2012-02-19  9:33 ` [Bug tree-optimization/52307] " tkoenig at gcc dot gnu.org
@ 2012-02-19 12:24 ` dominiq at lps dot ens.fr
  2012-02-19 12:27 ` dominiq at lps dot ens.fr
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens.fr @ 2012-02-19 12:24 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52307

--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2012-02-19 12:22:21 UTC ---
PR52307 could be a duplicate.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug tree-optimization/52307] Segmentation fault in Lapack with -O3 -floop-flatten -floop-strip-mine
  2012-02-19  1:57 [Bug tree-optimization/52307] New: Segmentation fault in Lapack with -O3 -floop-flatten -floop-strip-mine tkoenig at gcc dot gnu.org
  2012-02-19  9:33 ` [Bug tree-optimization/52307] " tkoenig at gcc dot gnu.org
  2012-02-19 12:24 ` dominiq at lps dot ens.fr
@ 2012-02-19 12:27 ` dominiq at lps dot ens.fr
  2012-02-19 13:34 ` dominiq at lps dot ens.fr
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens.fr @ 2012-02-19 12:27 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52307

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-02-19
                 CC|                            |grosser at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2012-02-19 12:21:42 UTC ---
Confirmed with '-O2 -floop-flatten'. The failure disappears if I link the codes
compiled with these option to lapack_LINUX.a compiled with -O2 or -O3. This PR
could be a duplicate of pr52275. Note that UPLO should be U or L and not \0.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug tree-optimization/52307] Segmentation fault in Lapack with -O3 -floop-flatten -floop-strip-mine
  2012-02-19  1:57 [Bug tree-optimization/52307] New: Segmentation fault in Lapack with -O3 -floop-flatten -floop-strip-mine tkoenig at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-02-19 12:27 ` dominiq at lps dot ens.fr
@ 2012-02-19 13:34 ` dominiq at lps dot ens.fr
  2012-02-19 14:19 ` dominiq at lps dot ens.fr
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens.fr @ 2012-02-19 13:34 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52307

--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2012-02-19 12:27:18 UTC ---
> PR52307 could be a duplicate.

Oops! put in the wrong pr;-(


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug tree-optimization/52307] Segmentation fault in Lapack with -O3 -floop-flatten -floop-strip-mine
  2012-02-19  1:57 [Bug tree-optimization/52307] New: Segmentation fault in Lapack with -O3 -floop-flatten -floop-strip-mine tkoenig at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2012-02-19 13:34 ` dominiq at lps dot ens.fr
@ 2012-02-19 14:19 ` dominiq at lps dot ens.fr
  2012-02-19 14:30 ` dominiq at lps dot ens.fr
  2012-02-26 12:35 ` tkoenig at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens.fr @ 2012-02-19 14:19 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52307

--- Comment #5 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2012-02-19 13:34:13 UTC ---
In spbtrf.f I have put PRINT statements before and after the loops

            DO 90 J = 1, NB
               DO 80 I = J + 1, NB
                  WORK( I, J ) = ZERO
   80          CONTINUE
   90       CONTINUE

The print after the loops is never reached. The code generated between the last
print before the loops and the first one after with -O2 is

    call    __gfortran_st_write_done
    leal    1(%r14), %edi
    movl    $1, %eax
    movq    168(%rsp), %r8
    movl    $1, %ecx
L30:
    leaq    34(%rax), %rsi
    addl    $1, %ecx
    cmpl    %r14d, %ecx
    jg      L28
    leaq    (%r8,%rax,4), %rax
    movl    %r14d, %edx
    subl    %ecx, %edx
    addq    %rsi, %rdx
    leaq    572(%rsp,%rdx,4), %rdx
    .align 4,0x90
L29:
    movl    $0x00000000, (%rax)
    addq    $4, %rax
    cmpq    %rdx, %rax
    jne     L29
L28:
    cmpl    %edi, %ecx
    movq    %rsi, %rax
    jne     L30
    leaq    LC14(%rip), %rcx
    movl    $343, 240(%rsp)
    leaq    224(%rsp), %rdi
    movq    %rcx, 232(%rsp)
    movl    $128, 224(%rsp)
    movl    $6, 228(%rsp)
    call    __gfortran_st_write

When compiled with -O2 -floop-flatten, it is

    call    __gfortran_st_write_done
    movl    $2, %ecx
    movl    $4294967295, %esi
    subq    %r15, %rcx
    movq    %rcx, %rdx
    movq    %rcx, %rax
    sarq    $63, %rdx
    idivq   %rsi
    testq   %rdx, %rdx
    je      L27
    movq    %rcx, %rdx
    xorq    %rsi, %rdx
    notq    %rdx
    shrq    $63, %rdx
    addq    %rdx, %rax
L27:
    movabsq $-8589934593, %rcx
    movq    %r15, %rdx
    salq    $32, %rdx
    addq    %r15, %rdx
    addq    %rdx, %rcx
    cmpq    %rcx, %rax
    jge     L28
    movabsq $-8589934594, %r11
    movl    $2, %r9d
    movq    %rax, %r8
    leaq    -2(%r15), %r10
    addq    %rdx, %r11
    subq    %r15, %r9
L31:
    leaq    (%r9,%r8), %rax
    cmpq    %r10, %r8
    movq    %r10, %rdi
    cmovle  %r8, %rdi
    movq    %rax, %rsi
    sarq    $32, %rsi
    testl   %eax, %eax
    setne   %al
    movzbl  %al, %eax
    addq    %rax, %rsi
    cmpq    %rdi, %rsi
    jg      L29
    leaq    (%rsi,%r8), %rdx
    movq    %rsi, %rax
    salq    $5, %rax
    leaq    1(%rdx,%rax), %rax
    leaq    704(%rsp,%rax,4), %rdx
    xorl    %eax, %eax
    .align 4,0x90
L30:
    movl    $0x00000000, (%rdx)
    leaq    (%rax,%rsi), %rcx
    addq    $132, %rdx
    addq    $1, %rax
    cmpq    %rdi, %rcx
    jl      L30
L29:
    leaq    1(%r8), %rax
    cmpq    %r8, %r11
    jle     L28
    movq    %rax, %r8
    jmp     L31
L28:
    leaq    LC14(%rip), %rax
    movl    $343, 240(%rsp)
    leaq    224(%rsp), %rdi
    movq    %rax, 232(%rsp)
    movl    $128, 224(%rsp)
    movl    $6, 228(%rsp)
    call    __gfortran_st_write


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug tree-optimization/52307] Segmentation fault in Lapack with -O3 -floop-flatten -floop-strip-mine
  2012-02-19  1:57 [Bug tree-optimization/52307] New: Segmentation fault in Lapack with -O3 -floop-flatten -floop-strip-mine tkoenig at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2012-02-19 14:19 ` dominiq at lps dot ens.fr
@ 2012-02-19 14:30 ` dominiq at lps dot ens.fr
  2012-02-26 12:35 ` tkoenig at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens.fr @ 2012-02-19 14:30 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52307

--- Comment #6 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2012-02-19 14:19:23 UTC ---
Reduced code

integer :: I, J, NB = 3
real :: WORK(3,3) =1.0
real :: ZERO = 0.0
            DO 90 J = 1, NB
               DO 80 I = J + 1, NB
                  WORK( I, J ) = ZERO
   80          CONTINUE
   90       CONTINUE

print *, WORK
end


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug tree-optimization/52307] Segmentation fault in Lapack with -O3 -floop-flatten -floop-strip-mine
  2012-02-19  1:57 [Bug tree-optimization/52307] New: Segmentation fault in Lapack with -O3 -floop-flatten -floop-strip-mine tkoenig at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2012-02-19 14:30 ` dominiq at lps dot ens.fr
@ 2012-02-26 12:35 ` tkoenig at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2012-02-26 12:35 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52307

--- Comment #7 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2012-02-26 12:28:44 UTC ---
Also confirmed on x86_64-unknown-linux-gnu.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-02-26 12:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-19  1:57 [Bug tree-optimization/52307] New: Segmentation fault in Lapack with -O3 -floop-flatten -floop-strip-mine tkoenig at gcc dot gnu.org
2012-02-19  9:33 ` [Bug tree-optimization/52307] " tkoenig at gcc dot gnu.org
2012-02-19 12:24 ` dominiq at lps dot ens.fr
2012-02-19 12:27 ` dominiq at lps dot ens.fr
2012-02-19 13:34 ` dominiq at lps dot ens.fr
2012-02-19 14:19 ` dominiq at lps dot ens.fr
2012-02-19 14:30 ` dominiq at lps dot ens.fr
2012-02-26 12:35 ` tkoenig at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).