This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


> 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)"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]