<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed."
   href="https://llvm.org/bugs/show_bug.cgi?id=24783">24783</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed.
          </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>Linux
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>octoploid@yandex.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>trippels@gcc2-power8 tmp % cat test.ii
class A {
public:
  typedef A *const_iterator;
  const_iterator m_fn1() { return this; }
  const_iterator end___trans_tmp_1;
  const_iterator m_fn2() {
    end___trans_tmp_1 = this;
    return end___trans_tmp_1 + 1;
  }
};
inline int fn1(A &) { return 0; }
class buffers_iterator {
public:
  static buffers_iterator m_fn3() {
    A a;
    buffers_iterator b;
    b.current_ = a.m_fn1();
    b.end_ = a.m_fn2();
    while (b.current_ != b.end_) {
      A c = *b.current_;
      fn1(c);
      ++b.current_;
    }
    return b;
  }
  A::const_iterator current_;
  A::const_iterator end_;
  int position_;
} d = buffers_iterator::m_fn3();

trippels@gcc2-power8 tmp % clang++ -c -O2 test.ii -fno-crash-diagnostics
clang-3.8: /home/trippels/llvm/lib/IR/Value.cpp:356: void
llvm::Value::replaceAllUsesWith(llvm::Value *): Assertion `New->getType() ==
getType() && "replaceAllUses of value with new value of different type!"'
failed.
#0 0x10cf162c llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/trippels/llvm-install/bin/clang-3.8+0x10cf162c)
#1 0x10cf2ab8 PrintStackTraceSignalHandler(void*)
(/home/trippels/llvm-install/bin/clang-3.8+0x10cf2ab8)
#2 0x10cf0824 llvm::sys::RunSignalHandlers()
(/home/trippels/llvm-install/bin/clang-3.8+0x10cf0824)
#3 0x10cf2ee8 SignalHandler(int)
(/home/trippels/llvm-install/bin/clang-3.8+0x10cf2ee8)
0  clang-3.8 0x0000000010cf162c llvm::sys::PrintStackTrace(llvm::raw_ostream&)
+ 124
1  clang-3.8 0x0000000010cf2ab8
2  clang-3.8 0x0000000010cf0824 llvm::sys::RunSignalHandlers() + 132
3  clang-3.8 0x0000000010cf2ee8
4            0x00003fffaf060478 __kernel_sigtramp_rt64 + 0
5  libc.so.6 0x00003fffaea3d978 gsignal + 72
6  libc.so.6 0x00003fffaea3ff7c abort + 684
7  libc.so.6 0x00003fffaea33544
8  libc.so.6 0x00003fffaea33634 __assert_fail + 100
9  clang-3.8 0x000000001092d910 llvm::Value::replaceAllUsesWith(llvm::Value*) +
1072
10 clang-3.8 0x0000000010b8d5f8
11 clang-3.8 0x00000000116b439c
llvm::LPPassManager::runOnFunction(llvm::Function&) + 1404
12 clang-3.8 0x00000000108ed704
llvm::FPPassManager::runOnFunction(llvm::Function&) + 804
13 clang-3.8 0x000000001168abdc
14 clang-3.8 0x00000000108ee308
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1304
15 clang-3.8 0x00000000108eeb34 llvm::legacy::PassManager::run(llvm::Module&) +
36
16 clang-3.8 0x0000000010e4f9a0
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&,
llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::raw_pwrite_stream*)
+ 8672
17 clang-3.8 0x0000000011530dc8
18 clang-3.8 0x0000000011960ab8 clang::ParseAST(clang::Sema&, bool, bool) + 824
19 clang-3.8 0x000000001121a7c4 clang::ASTFrontendAction::ExecuteAction() + 228
20 clang-3.8 0x000000001152f71c clang::CodeGenAction::ExecuteAction() + 284
21 clang-3.8 0x0000000011219f78 clang::FrontendAction::Execute() + 152
22 clang-3.8 0x00000000111e4a40
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1168
23 clang-3.8 0x00000000112c2298
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 4152
24 clang-3.8 0x000000001027878c cc1_main(llvm::ArrayRef<char const*>, char
const*, void*) + 1436
25 clang-3.8 0x0000000010276f04 main + 13764
26 libc.so.6 0x00003fffaea22920
27 libc.so.6 0x00003fffaea22b34 __libc_start_main + 196
Stack dump:
0.      Program arguments: /home/trippels/llvm-install/bin/clang-3.8 -cc1
-triple powerpc64le-unknown-linux-gnu -emit-obj -disable-free -main-file-name
test.ii -mrelocation-model static -mthread-model posix -mdisable-fp-elim
-fmath-errno -masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu
ppc64le -target-abi elfv2 -dwarf-column-info -coverage-file
/home/trippels/tmp/test.ii -resource-dir
/home/trippels/llvm-install/bin/../lib/clang/3.8.0 -O2 -fdeprecated-macro
-fdebug-compilation-dir /home/trippels/tmp -ferror-limit 19 -fmessage-length
174 -mstackrealign -fno-signed-char -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops
-vectorize-slp -o test.o -x c++-cpp-output test.ii 
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'CallGraph Pass Manager' on module 'test.ii'.
4.      Running pass 'Loop Pass Manager' on function '@__cxx_global_var_init'
5.      Running pass 'Induction Variable Simplification' on basic block
'%while.body.i'
clang-3.8: error: unable to execute command: Aborted (core dumped)
clang-3.8: error: clang frontend command failed due to signal (use -v to see
invocation)</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>