<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Clang crashes when incrementing a vector by a float scalar"
   href="https://bugs.llvm.org/show_bug.cgi?id=43969">43969</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang crashes when incrementing a vector by a float scalar
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>marksl@synopsys.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=22793" name="attach_22793" title="Same f.c source as exists in the description">attachment 22793</a> <a href="attachment.cgi?id=22793&action=edit" title="Same f.c source as exists in the description">[details]</a></span>
Same f.c source as exists in the description

#include "float.h"

typedef short v2i16 __attribute__((vector_size(4)));
typedef int v2i32 __attribute__((vector_size(8)));
typedef long long v2i64 __attribute__((vector_size(16)));
typedef short v4i16 __attribute__((vector_size(8)));
typedef int v4i32 __attribute__((vector_size(16)));
typedef char v8i8 __attribute__((vector_size(8)));
typedef short v8i16 __attribute__((vector_size(16)));
typedef char v16i8 __attribute__((vector_size(16)));

void func(TYPE a) {
//crash
a+=1.0f;
a-=1.0f;

//OK
a+=1;
a-=1;
}

//Executing clang -DTYPE=v2i32 f.c
// clang-8:
/slowfs/us01dwt2p448/hartman/hartman_1/work/llvm-project/llvm/lib/IR/Instructions.cpp:2168:
static llvm::BinaryOperator*
llvm::BinaryOperator::Create(llvm::Instruction::BinaryOps, llvm::Value*,
llvm::Value*, const llvm::Twine&, llvm::Instruction*): Assertion `S1->getType()
== S2->getType() && "Cannot create binary operator with two operands of
differing type!"' failed.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>