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

            Bug ID: 20118
           Summary: llc handles pointer arithmetic in a strange way,
                    Linux, trunk, regression from version 3.4
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: llc
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Created attachment 12700
  --> http://llvm.org/bugs/attachment.cgi?id=12700&action=edit
Reproducer

To reproduce:
llc reproducer.ll -mattr=+avx2 -o c.s (llc from trunk)
clang c.s test.cpp -O0 (any clang)

test.cpp:
#include <stdio.h>
extern "C" {
    extern void f_fu(float *result);
}
int main(int argc, char *argv[]) {
    float returned_result[64] __attribute__((aligned(64)));
    f_fu(returned_result);
    for (int i = 0; i < 8; ++i) {
        printf("%f, ", returned_result[i]);
    }
    printf("\n");
    return 0;
}
reproducer.ll is attached.

The right answer is
"6.000000, 7.000000, 8.000000, 9.000000, 10.000000, 11.000000, 12.000000,
13.000000,"
and if we take llc from 3.4 version we will have this answer. However llc from
trunk results in:
"6.000000, 15.000000, 8.000000, 9.000000, 2.000000, 11.000000, 12.000000,
13.000000,", which is wrong.

-- 
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