https://llvm.org/bugs/show_bug.cgi?id=24158
Bug ID: 24158
Summary: -03 Optimization causes function to execute twice
Product: new-bugs
Version: 3.6
Hardware: PC
OS: FreeBSD
Status: NEW
Severity: normal
Priority: P
Component: new bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
I started writing a new C project and I noticed that a function was executing
twice even though It's only being called once. While trying to figure out what
was going on I removed, -O3 from the Makefile and built and ran the program and
saw that the function was no longer being called twice.
To reproduce the problem pull the repository below, don't worry there's barely
any code, it's a new project.
https://github.com/Secure-Labs/nextgen.git
Then use gmake to build the project, I put the -O3 back in the Makefile, and
I'm using clang 3.6.1 on FreeBSD 10.1 Release.
To run the program use sudo ./nextgen --file --in / --out / --exec /usr/bin/ls
The function that's being called twice is start_runtime which is in the file
runtime.c and starts on line 90. start_runtime is called from nextgen.c in
main.
Remove -03 from the makefile and start_runtime is only executed once.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs