From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21807 invoked by alias); 19 Feb 2012 13:34:29 -0000 Received: (qmail 21520 invoked by uid 22791); 19 Feb 2012 13:34:28 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,LOTS_OF_MONEY,TW_DD,TW_HR,TW_IV,TW_OV,TW_VZ,TW_ZB X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 19 Feb 2012 13:34:15 +0000 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/52307] Segmentation fault in Lapack with -O3 -floop-flatten -floop-strip-mine Date: Sun, 19 Feb 2012 14:19:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: critical X-Bugzilla-Who: dominiq at lps dot ens.fr X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-02/txt/msg01887.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52307 --- Comment #5 from Dominique d'Humieres 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