[LLVMbugs] [Bug 19115] New: clang generates 26 times as much instructions as gcc for code with a variable length array

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Mar 12 09:53:16 PDT 2014


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

            Bug ID: 19115
           Summary: clang generates 26 times as much instructions as gcc
                    for code with a variable length array
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: F9GrVJpcTDB8 at inbox.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12216
  --> http://llvm.org/bugs/attachment.cgi?id=12216&action=edit
test1.c

A variable length array in a function blocks possible dead code elimination if
used with clang.

clang generates 53 instructions for test1.c, but
my gcc of 4.9-20131229_0 generates only two instructions.

I know that if

...
size_t swap[size];
...

is replaced by

...
size_t swap[2];
...

then the generated code is eliminated also in clang.

-- 
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/20140312/cd5b44bb/attachment.html>


More information about the llvm-bugs mailing list