[llvm-bugs] [Bug 43520] New: Increment and decrement operators for vector types

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 1 01:31:42 PDT 2019


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

            Bug ID: 43520
           Summary: Increment and decrement operators for vector types
           Product: clang
           Version: 9.0
          Hardware: PC
                OS: other
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: vasilyz at synopsys.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

The compiler reports an error if there's an attempt to increment or decrement a
vector type variable. Consider the following test case:

typedef int v2i32 __attribute__((__vector_size__(8)));
v2i32 func(v2i32 a) {
    a+=1;
    ++a;
    a-=1;
    --a;
    return a;
}

Compiling it with "clang -c test.c" will result in errors being reported:

test.c:4:5: error: cannot increment value of type 'v2i32' (vector of 2 'int'
values)
    ++a;
    ^ ~
test.c:6:5: error: cannot decrement value of type 'v2i32' (vector of 2 'int'
values)
    --a;
    ^ ~

-- 
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/20191001/26bd05d9/attachment-0001.html>


More information about the llvm-bugs mailing list