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

            Bug ID: 16433
           Summary: the unary operator shall return a 0 if the value of
                    its operand compares unequal to 0, and -1 (i.e. all
                    bits set) if the value of its operand compares equal
                    to 0.
           Product: clang
           Version: 3.3
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

#include<stdio.h>
#include <math.h>
typedef char char2 _attribute_((ext_vector_type(2)));
int main(){
char a = 0x0;
char2 b = (char2)
{0,0}
;
printf("%x\n", !a);
printf("%x\n", !b);
}

The result of this code is different between PC and MIPS.
The result is correct in PC , but error in MIPS.
So, it is Clang's bug .

For scalar types, the result of the logical unary operator is 0 if the value of
its operand
compares unequal to 0, and 1 if the value of its operand compares equal to 0.
For vector
types, the unary operator shall return a 0 if the value of its operand compares
unequal to 0,
and -1 (i.e. all bits set) if the value of its operand compares equal to 0.

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