FreeBSD Bugzilla – Attachment 140311 Details for
Bug 186848
CLANG/LLVM code generation bug with optimisation on i386
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
file.shar
file.shar (text/plain), 1.38 KB, created by
David Hines
on 2014-02-17 17:50:00 UTC
(
hide
)
Description:
file.shar
Filename:
MIME Type:
Creator:
David Hines
Created:
2014-02-17 17:50:00 UTC
Size:
1.38 KB
patch
obsolete
># This is a shell archive. Save it in a file, remove anything before ># this line, and then unpack it by entering "sh file". Note, it may ># create directories; files and directories will be owned by you and ># have default permissions. ># ># This archive contains: ># ># clang_bug.c ># >echo x - clang_bug.c >sed 's/^X//' >clang_bug.c << '7cdc9fc910e8be01c1758f1d1bf4e799' >X#include <stdio.h> >X >X/* >X * This demonstrates a bug in the code generation of the C compiler >X * distributed as part of FreeBSD 10.0 on i386 when using optimisation. >X * >X * To identify the affected system: >X * Output from uname -ap: >X * FreeBSD free100 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: >X * Fri Jan 17 01:46:25 UTC 2014 >X * root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC i386 i386 >X * Output from cc -v: >X * FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610 >X * Target: i386-unknown-freebsd10.0 >X * Thread model: posix >X * >X * When this is compiled without optimisation the output is correct. >X * cc -o clang_bug clang_bug.c; ./clang_bug >X * An int has 32 bits >X * >X * With optimisation it is incorrect. >X * cc -O -o clang_bug-O clang_bug.c; ./clang_bug-O >X * An int has 33 bits >X */ >X >Xunion >X{ >X int i; >X} u; >X >X >Xint >Xmain(int argc, char *argv[]) >X{ >X int j = 1; >X >X for (u.i = 1; u.i += u.i; ++j) >X ; >X printf("An int has %d bits\n", j); >X >X return 0; >X} >7cdc9fc910e8be01c1758f1d1bf4e799 >exit
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 186848
: 140311