public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "su at cs dot ucdavis.edu" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/64685] New: wrong code by LTO on x86_64-linux-gnu Date: Tue, 20 Jan 2015 08:23:00 -0000 [thread overview] Message-ID: <bug-64685-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64685 Bug ID: 64685 Summary: wrong code by LTO on x86_64-linux-gnu Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: su at cs dot ucdavis.edu The current gcc trunk miscompiles the following code when using LTO on x86_64-linux-gnu in both 32-bit and 64-bit modes. This is a regression from 4.9.x. $ gcc-trunk -v Using built-in specs. COLLECT_GCC=gcc-trunk COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/5.0.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk --enable-languages=c,c++ --disable-werror --enable-multilib Thread model: posix gcc version 5.0.0 20150119 (experimental) [trunk revision 219832] (GCC) $ $ gcc-trunk -O0 -c fn1.c $ gcc-trunk -O1 -c main.c $ gcc-trunk -O1 fn1.o main.o $ ./a.out $ $ gcc-4.9 -flto -O0 -c fn1.c $ gcc-4.9 -flto -O1 -c main.c $ gcc-4.9 -flto -O1 fn1.o main.o $ ./a.out $ $ $ gcc-trunk -flto -O0 -c fn1.c $ gcc-trunk -flto -O1 -c main.c $ gcc-trunk -flto -O1 fn1.o main.o $ ./a.out Aborted (core dumped) $ $ cat fn1.c extern int b; void fn1 (void) { b = 0; } $ cat main.c extern void fn1 (void); int a[2], b; static void foo (int p) { b = 1 ^ a[(b ^ 1) & 1]; b = 1 ^ a[b & 1]; if (p) __builtin_abort (); } int main () { foo (0); b = 0; foo (0); if (b != 1) __builtin_abort (); return 0; } $
next reply other threads:[~2015-01-20 8:23 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-01-20 8:23 su at cs dot ucdavis.edu [this message] 2015-01-20 9:51 ` [Bug lto/64685] [5 Regression] " rguenth at gcc dot gnu.org 2015-01-20 10:47 ` rguenth at gcc dot gnu.org
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=bug-64685-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).