Re: optimization/10877: [3.3/3.4 regression] miscompilation with -O3 -fPIC on x86

Wolfgang Bangerth <[email protected]>
Newsgroups gmane.comp.gcc.prs
Message-ID <[email protected]>
The following reply was made to PR optimization/10877; it has been noted by GNATS.

From: Wolfgang Bangerth <[email protected]>
To: Andrew Pinski <[email protected]>
Cc: [email protected], <[email protected]>, <[email protected]>
Subject: Re: optimization/10877: [3.3/3.4 regression] miscompilation with
 -O3 -fPIC on x86
Date: Tue, 20 May 2003 10:26:37 -0500 (CDT)

 > It does not fail for me though on i686-pc-linux-gnu with GCC: 3.4  
 > 20030517 (experimental).
 > Or on i686-unkown-openbsd3.1 with gcc version 3.4 20030519  
 > (experimental).
 
 OK, I made the experiment -- and my small snippet still segfaults with 
 both 3.3 and 3.4 checked out an hour or so ago. This is the assembler 
 output I get on my system with present 3.4. I think I'm at a loss for 
 further explanations, but feel free to ask me if you think you have a 
 theory...
 
   W.
 
 
 	.file	"y.cc"
 .globl i
 	.bss
 	.align 4
 	.type	i, @object
 	.size	i, 4
 i:
 	.zero	4
 	.text
 	.align 2
 	.p2align 4,,15
 .globl _Z5get_xv
 	.type	_Z5get_xv, @function
 _Z5get_xv:
 .LFB4:
 	call	.LPR0
 	addl	$_GLOBAL_OFFSET_TABLE_, %eax
 	pushl	%ebp
 .LCFI0:
 	movl	i@GOT(%eax), %edx
 	movl	%esp, %ebp
 .LCFI1:
 	popl	%ebp
 	movl	(%edx), %eax
 	ret
 .LFE4:
 	.size	_Z5get_xv, .-_Z5get_xv
 	.align 2
 	.p2align 4,,15
 .globl main
 	.type	main, @function
 main:
 .LFB5:
 	pushl	%ebp
 .LCFI2:
 	movl	%esp, %ebp
 .LCFI3:
 	leal	-8(%ebp), %eax
 	pushl	%ebx
 .LCFI4:
 	subl	$4, %esp
 .LCFI5:
 	andl	$-16, %esp
 	call	.LPR3
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	movl	i@GOT(%ebx), %ecx
 	movl	%eax, (%ecx)
 	call	_Z5get_xv@PLT
 	movl	-4(%ebp), %ebx
 	xorl	%eax, %eax
 	leave
 	ret
 .LFE5:
 	.size	main, .-main
 .LPR0:
 	movl	(%esp), %eax
 	ret
 .LPR3:
 	movl	(%esp), %ebx
 	ret
 	.ident	"GCC: (GNU) 3.4 20030520 (experimental)"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.