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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to