[llvm-bugs] [Bug 33352] New: Comparison between altivec vector bool types are not allowed by clang

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 7 22:25:45 PDT 2017


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

            Bug ID: 33352
           Summary: Comparison between altivec vector bool types are not
                    allowed by clang
           Product: clang
           Version: trunk
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: westion717 at gmail.com
                CC: llvm-bugs at lists.llvm.org

It seems that AST parsing is not correct.

int main(){
  vector  long long op_median = { 1, 4 };
  vector  long long op_less = { 0, 3 };
  if ( ++op_less == op_median ) return 1;
  return 0;
}

clang -maltivec -Xclang  -ast-dump -fsyntax-only   b.c

\TranslationUnitDecl 0x100173218b0 <<invalid sloc>> <invalid sloc>
|-TypedefDecl 0x10017321e00 <<invalid sloc>> <invalid sloc> implicit __int128_t
'__int128'
| `-BuiltinType 0x10017321b20 '__int128'
|-TypedefDecl 0x10017321e70 <<invalid sloc>> <invalid sloc> implicit
__uint128_t 'unsigned __int128'
| `-BuiltinType 0x10017321b40 'unsigned __int128'
|-TypedefDecl 0x10017322148 <<invalid sloc>> <invalid sloc> implicit
__NSConstantString 'struct __NSConstantString_tag'
| `-RecordType 0x10017321f50 'struct __NSConstantString_tag'
|   `-Record 0x10017321ec8 '__NSConstantString_tag'
|-TypedefDecl 0x100173221e0 <<invalid sloc>> <invalid sloc> implicit
__builtin_va_list 'char *'
| `-PointerType 0x100173221a0 'char *'
|   `-BuiltinType 0x10017321940 'char'
`-FunctionDecl 0x10017322290 <b.c:1:1, line:6:1> line:1:5 main 'int ()'
  `-CompoundStmt 0x10017361a90 <col:11, line:6:1>
    |-DeclStmt 0x10017322518 <line:2:3, col:40>
    | `-VarDecl 0x100173223a8 <col:3, col:39> col:20 used op_median '__vector
long long' cinit
    |   `-InitListExpr 0x10017322498 <col:32, col:39> '__vector long long'
    |     |-ImplicitCastExpr 0x100173224e8 <col:34> 'long long' <IntegralCast>
    |     | `-IntegerLiteral 0x10017322408 <col:34> 'int' 1
    |     `-ImplicitCastExpr 0x10017322500 <col:37> 'long long' <IntegralCast>
    |       `-IntegerLiteral 0x10017322428 <col:37> 'int' 4
    |-DeclStmt 0x10017361920 <line:3:3, col:38>
    | `-VarDecl 0x10017322540 <col:3, col:37> col:20 used op_less '__vector
long long' cinit
    |   `-InitListExpr 0x100173618a0 <col:30, col:37> '__vector long long'
    |     |-ImplicitCastExpr 0x100173618f0 <col:32> 'long long' <IntegralCast>
    |     | `-IntegerLiteral 0x100173225a0 <col:32> 'int' 0
    |     `-ImplicitCastExpr 0x10017361908 <col:35> 'long long' <IntegralCast>
    |       `-IntegerLiteral 0x100173225c0 <col:35> 'int' 3
   |-IfStmt 0x10017361a20 <line:4:3, col:40>
    | |-<<<NULL>>>
    | |-<<<NULL>>>
    | |-BinaryOperator 0x100173619c0 <col:8, col:21> 'int' '=='
    | | |-UnaryOperator 0x10017361960 <col:8, col:10> '__vector long long'
prefix '++'
    | | | `-DeclRefExpr 0x10017361938 <col:10> '__vector long long' lvalue Var
0x10017322540 'op_less' '__vector long long'
    | | `-ImplicitCastExpr 0x100173619a8 <col:21> '__vector long long'
<LValueToRValue>
    | |   `-DeclRefExpr 0x10017361980 <col:21> '__vector long long' lvalue Var
0x100173223a8 'op_median' '__vector long long'
    | |-ReturnStmt 0x10017361a08 <col:33, col:40>
    | | `-IntegerLiteral 0x100173619e8 <col:40> 'int' 1
    | `-<<<NULL>>>
    `-ReturnStmt 0x10017361a78 <line:5:3, col:10>
      `-IntegerLiteral 0x10017361a58 <col:10> 'int' 0


int main(){
  vector bool long long op_median = { 1, 4 };
  vector bool long long op_less = { 0, 3 };
  if ( ++op_less == op_median ) return 1;
  return 0;
}

FunctionDecl 0x10015bb2290 <a.c:1:1, line:6:1> line:1:5 main 'int ()'
  `-CompoundStmt 0x10015bf1f08 <col:11, line:6:1>
    |-DeclStmt 0x10015bb2518 <line:2:3, col:45>
    | `-VarDecl 0x10015bb23a8 <col:3, col:44> col:25 used op_median '__vector
__bool unsigned long long' cinit
    |   `-InitListExpr 0x10015bb2498 <col:37, col:44> '__vector __bool unsigned
long long'
    |     |-ImplicitCastExpr 0x10015bb24e8 <col:39> 'unsigned long long'
<IntegralCast>
    |     | `-IntegerLiteral 0x10015bb2408 <col:39> 'int' 1
    |     `-ImplicitCastExpr 0x10015bb2500 <col:42> 'unsigned long long'
<IntegralCast>
    |       `-IntegerLiteral 0x10015bb2428 <col:42> 'int' 4
    |-DeclStmt 0x10015bf1930 <line:3:3, col:43>
    | `-VarDecl 0x10015bb2540 <col:3, col:42> col:25 used op_less '__vector
__bool unsigned long long' cinit
    |   `-InitListExpr 0x10015bf18b0 <col:35, col:42> '__vector __bool unsigned
long long'
    |     |-ImplicitCastExpr 0x10015bf1900 <col:37> 'unsigned long long'
<IntegralCast>
    |     | `-IntegerLiteral 0x10015bb25a0 <col:37> 'int' 0
    |     `-ImplicitCastExpr 0x10015bf1918 <col:40> 'unsigned long long'
<IntegralCast>
    |       `-IntegerLiteral 0x10015bb25c0 <col:40> 'int' 3
    |-IfStmt 0x10015bf1e98 <line:4:3, col:40>
    | |-<<<NULL>>>
    | |-<<<NULL>>>
    | |-OpaqueValueExpr 0x10015bf1e78 <<invalid sloc>> '_Bool'
    | |-ReturnStmt 0x10015bf1e60 <col:33, col:40>
    | | `-IntegerLiteral 0x10015bf1e40 <col:40> 'int' 1
    | `-<<<NULL>>>
    `-ReturnStmt 0x10015bf1ef0 <line:5:3, col:10>
      `-IntegerLiteral 0x10015bf1ed0 <col:10> 'int' 0

-- 
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/20170608/84573264/attachment-0001.html>


More information about the llvm-bugs mailing list