mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: James Cloos <cloos@jhcloos.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	musl@lists.openwall.com
Subject: Re: Broken GCC versions: 4.8.2 and 4.9.0
Date: Sun, 11 May 2014 15:03:20 -0400	[thread overview]
Message-ID: <20140511190320.GV26358@brightrain.aerifal.cx> (raw)
In-Reply-To: <m31tw06tl7.fsf@carbon.jhcloos.org>

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 gcc.godbolt.org 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.

Rich


  reply	other threads:[~2014-05-11 19:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-11  1:05 Rich Felker
2014-05-11 16:10 ` Thomas Petazzoni
2014-05-11 16:19   ` Rich Felker
2014-05-11 18:46     ` James Cloos
2014-05-11 19:03       ` Rich Felker [this message]
2014-05-11 20:08         ` James Cloos
2014-05-11 21:20           ` Rich Felker
2014-05-12  1:23             ` Stephen Thomas
2014-05-12  9:28             ` Natanael Copa
2014-05-12 14:30               ` Anthony G. Basile
2014-05-14  7:49                 ` Natanael Copa
2014-05-12 12:13           ` Rich Felker
2014-05-12 13:49             ` Thorsten Glaser
2014-05-12 13:56             ` James Cloos
2014-05-11 20:20     ` Matias A. Fonzo
2014-05-15  4:45     ` Rich Felker
2014-05-19  0:47       ` Rich Felker
2014-05-19 11:47         ` Szabolcs Nagy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140511190320.GV26358@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=cloos@jhcloos.com \
    --cc=musl@lists.openwall.com \
    --cc=thomas.petazzoni@free-electrons.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).