[llvm-bugs] [Bug 27721] New: PowerPC64: fast isel issue with 16 bit signed constant

via llvm-bugs llvm-bugs at lists.llvm.org
Thu May 12 04:37:49 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=27721

            Bug ID: 27721
           Summary: PowerPC64: fast isel issue with 16 bit signed constant
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: PowerPC
          Assignee: unassignedbugs at nondot.org
          Reporter: anton at samba.org
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

I'm seeing issues with the following test case:

unsigned int k = 1;
unsigned int i;

float h;
float *j = &h;

void foo(void)
{
        unsigned short m = 0;

        if (k) {
                m = 46334;
                k = 3;
        }

        i;

        for (;;) {
                *j = m;
                if (m)
                        break;
        }
}

The constant is created as expected at -O1:

clang -O1 -fno-strict-aliasing

    lis 5, 0
    ori 3, 5, 46334
    mtvsrwz 0, 3

But if we enable fast isel, we end up with a sign extended constant:

clang -O1 -fno-strict-aliasing -mllvm -fast-isel

    li 3, -19202
    mtvsrwz 0, 3

-- 
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/20160512/35eda00b/attachment.html>


More information about the llvm-bugs mailing list