[LLVMbugs] [Bug 22123] New: optimization failure when parameters passed by pointer (vs passing in a struct)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jan 8 04:44:37 PST 2015


http://llvm.org/bugs/show_bug.cgi?id=22123

            Bug ID: 22123
           Summary: optimization failure when parameters passed by pointer
                    (vs passing in a struct)
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: skvadrik at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 13649
  --> http://llvm.org/bugs/attachment.cgi?id=13649&action=edit
files 1a.cpp, 1b.cpp, 2a.cpp and 2b.cpp

See files 1a.cpp, 1b.cpp, 2a.cpp and 2b.cpp in attach.

The only difference between 1*.cpp and 2*.cpp is that
1*.cpp pass parameters in a struct, while 2*.cpp pass
them by pointer.

compile:

$ clang++ -g -O2 -c 1a.cpp
$ clang++ -g -O2 -c 1b.cpp
$ clang++ -g -O2 -c 2a.cpp
$ clang++ -g -O2 -c 2b.cpp

disassemble: (GNU objdump (GNU Binutils) 2.24)

$ objdump -d 1a.o > 1a.s
$ objdump -d 1b.o > 1b.s
$ objdump -d 2a.o > 2a.s
$ objdump -d 2b.o > 2b.s

Files 1a.s and 1b.s are equivalent, but
files 2a.s and 2b.s are different: extra memory load in 2b.s.

On -O1, both pairs differ in the same way.

Tested on x86_64, armv7a, powerpc64.

-- 
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/20150108/4356b2d7/attachment.html>


More information about the llvm-bugs mailing list