Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 11 May 2014 15:03:20 -0400
From: Rich Felker <>
To: James Cloos <>
Cc: Thomas Petazzoni <>,
Subject: Re: Broken GCC versions: 4.8.2 and 4.9.0

On Sun, May 11, 2014 at 02:46:51PM -0400, James Cloos wrote:
> What does the wrong assembly of your test code look like?

xorl %eax,%eax ; ret

> The assembly I get looks reasonable, in that it always references foo:
> The O3 version is:
> 	.file	"test.c"
> 	.text
> 	.p2align 5,,31
> 	.globl	bar
> 	.type	bar, @function
> bar:
> ..LFB0:
> 	.cfi_startproc
> 	movl	foo(%rip), %edx
> 	xorl	%eax, %eax
> 	testl	%edx, %edx
> 	setne	%al
> 	ret
> 	.cfi_endproc
> ..LFE0:
> 	.size	bar, .-bar
> 	.section	.rodata
> 	.align 4
> 	.type	dummy, @object
> 	.size	dummy, 4
> dummy:
> 	.zero	4
> 	.weak	foo
> 	.set	foo,dummy
> 	.ident	"GCC: (Gentoo 4.8.2-r1 p1.4-ssptest, pie-0.5.9-ssptest) 4.8.2"
> 	.section	.note.GNU-stack,"",@progbits
> Every version tests foo(%rip) and gets the result into %rax.
> The ia32, arm32 and arm64 assembly looks right, too.
> Perhaps distribution patches affect this?

I've tested it on and others have tested with local
gcc 4.8.2 and 4.9.0, probably distro-provided (I didn't ask).

I wonder if the broken GCC is using isl/cloog (some third-party
optimization library they hacked into gcc that's used only if it's
available). That could explain it, especially since people who are
building their own toolchains against musl do not seem to be
experiencing the problem.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.