This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/63393] New: -ffreestanding not work: memset call cause valgrind crash
- From: "dushistov at mail dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 27 Sep 2014 19:25:22 +0000
- Subject: [Bug c/63393] New: -ffreestanding not work: memset call cause valgrind crash
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63393
Bug ID: 63393
Summary: -ffreestanding not work: memset call cause valgrind
crash
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: dushistov at mail dot ru
Created attachment 33588
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33588&action=edit
problem code
On my system linux/x86_64 compilation of valgrind with -O3 -march=native cause
crash of valgrind with any executable file.
The problem is similar to http://llvm.org/bugs/show_bug.cgi?id=9795,
vgPlain_memset call memset, memset call vgPlain_memset and so on.
To simplify bug hunting I extract code to separate file,
if compile it with:
>gcc -O3 -march=native -ffreestanding -static -nodefaultlibs -nostartfiles -ggdb test_memset.c
gcc give error: undefined reference to `memset', but with "-O2"
>>gcc -O2 -march=native -ffreestanding -static -nodefaultlibs -nostartfiles -ggdb test_memset.c
all works fine.
gcc 4.8.1