[LLVMbugs] [Bug 17311] New: wrong code at -O1 and higher, variadic function

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Sep 20 20:22:51 PDT 2013


            Bug ID: 17311
           Summary: wrong code at -O1 and higher, variadic function
           Product: clang
           Version: 3.3
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jed at 59a2.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11253
  --> http://llvm.org/bugs/attachment.cgi?id=11253&action=edit
test case

Attached is a test case that I have reduced after noticing in the error
handling code of one of my projects.  It is only present with clang at -O1 and

$ make a.out && ./a.out
clang -Wall -Wextra -pedantic -std=c99 -O1 -g     -c -o a.o a.c
clang -Wall -Wextra -pedantic -std=c99 -O1 -g     -c -o xrank.o xrank.c
clang -o a.out a.o xrank.o
main() line 47 in /dir/NOT THE FILE NAME

At any lower optimization level, or with gcc, this program prints the expected

main() line 47 in /dir/a.c

I'm running Archlinux from today (2013-09-20),

clang version 3.3 (tags/RELEASE_33/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix

Linux batura 3.11.1-1-ARCH #1 SMP PREEMPT Sat Sep 14 19:30:21 CEST 2013 x86_64

Test case also available at:


You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130921/addcd1a9/attachment.html>

More information about the llvm-bugs mailing list