<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 - Assertion on vector code: "Invalid constantexpr cast!""
   href="https://bugs.llvm.org/show_bug.cgi?id=34856">34856</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion on vector code: "Invalid constantexpr cast!"
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

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

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

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

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>babokin@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>clang trunk rev314936, x86_64.

The diagnostic in this bug is the same as in a number of still opened issues,
but the test case is quite regular C++, though with vector extensions. Other
issues use __asm__() to trigger the problem. So this seems to be a different
problem with same diagnostic.

<span class="quote">> cat f.cpp</span >
typedef unsigned a __attribute__((ext_vector_type(8)));
a b, c, d, e;
void f() {
  a g(-(-~0 % (c * c | b)));
  d = -~0 % (c * c | b) + e % (g & 508903);
}

<span class="quote">> clang++ -std=c++11 -c -O2 f.cpp</span >
clang-6.0: /home/dybaboki/llvm/llvm-trunk-20171004/lib/IR/Constants.cpp:1440:
static llvm::Constant *llvm::ConstantExpr::getCast(unsigned int, llvm::Constant
*, llvm::Type *, bool): Assertion `CastInst::castIsValid(opc, C, Ty) &&
"Invalid constantexpr cast!"' failed.
#0 0x000000000135083f llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/dybaboki/llvm/bin-trunk-20171004/bin/clang-6.0+0x135083f)
#1 0x0000000001350b46 SignalHandler(int)
(/home/dybaboki/llvm/bin-trunk-20171004/bin/clang-6.0+0x1350b46)
#2 0x00007f59617f3370 __restore_rt (/lib64/libpthread.so.0+0xf370)
#3 0x00007f596036f1d7 __GI_raise (/lib64/libc.so.6+0x351d7)
#4 0x00007f59603708c8 __GI_abort (/lib64/libc.so.6+0x368c8)
#5 0x00007f5960368146 __assert_fail_base (/lib64/libc.so.6+0x2e146)
#6 0x00007f59603681f2 (/lib64/libc.so.6+0x2e1f2)
#7 0x0000000000e528bc llvm::ConstantExpr::getCast(unsigned int,
llvm::Constant*, llvm::Type*, bool)
(/home/dybaboki/llvm/bin-trunk-20171004/bin/clang-6.0+0xe528bc)
#8 0x00000000009f3ac0 llvm::ConstantFoldInstruction(llvm::Instruction*,
llvm::DataLayout const&, llvm::TargetLibraryInfo const*)
(/home/dybaboki/llvm/bin-trunk-20171004/bin/clang-6.0+0x9f3ac0)
#9 0x0000000000feccb2 llvm::InstCombiner::run()
(/home/dybaboki/llvm/bin-trunk-20171004/bin/clang-6.0+0xfeccb2)
#10 0x0000000000fef026 combineInstructionsOverFunction(llvm::Function&,
llvm::InstCombineWorklist&, llvm::AAResults*, llvm::AssumptionCache&,
llvm::TargetLibraryInfo&, llvm::DominatorTree&,
llvm::OptimizationRemarkEmitter&, bool, llvm::LoopInfo*)
(/home/dybaboki/llvm/bin-trunk-20171004/bin/clang-6.0+0xfef026)
#11 0x0000000000fef6ba
llvm::InstructionCombiningPass::runOnFunction(llvm::Function&)
(/home/dybaboki/llvm/bin-trunk-20171004/bin/clang-6.0+0xfef6ba)
<...></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>