<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 - After r320749, Assertion failed: (ScaledReg == nullptr), function SetCombinedField, file lib/CodeGen/CodeGenPrepare.cpp, line 1980."
   href="https://bugs.llvm.org/show_bug.cgi?id=35864">35864</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>After r320749, Assertion failed: (ScaledReg == nullptr), function SetCombinedField, file lib/CodeGen/CodeGenPrepare.cpp, line 1980.
          </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>dimitry@andric.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This bug is different from <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED DUPLICATE - Assertion failed: (ScaledReg == nullptr), function SetCombinedField, file lib/CodeGen/CodeGenPrepare.cpp, line 1973."
   href="show_bug.cgi?id=35805">bug 35805</a> and <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - clang crashes on valid code at -O2 and -O3 on x86_64-linux-gnu in 32-bit mode: Assertion `ScaledReg == nullptr' failed"
   href="show_bug.cgi?id=35799">bug 35799</a>.  As reported in
<a href="https://bugs.freebsd.org/224995">https://bugs.freebsd.org/224995</a>, clang 6.0.0 (trunk r321545) asserts on
compiling imap/src/imapd/imapd.c of the alpine port:
(gdb) bt
#0  thr_kill () at thr_kill.S:3
#1  0x000000080347b084 in __raise (s=6) at /usr/src/lib/libc/gen/raise.c:54
#2  0x000000080347aff9 in abort () at /usr/src/lib/libc/stdlib/abort.c:67
#3  0x00000008034f8431 in __assert (func=<optimized out>, file=<optimized out>,
line=<optimized out>, failedexpr=<optimized out>) at
/usr/src/lib/libc/gen/assert.c:53
#4  0x000000000114631b in (anonymous
namespace)::CodeGenPrepare::optimizeMemoryInst(llvm::Instruction*,
llvm::Value*, llvm::Type*, unsigned int) ()
#5  0x000000000113cb5c in (anonymous
namespace)::CodeGenPrepare::optimizeInst(llvm::Instruction*, bool&) ()
#6  0x0000000001136177 in (anonymous
namespace)::CodeGenPrepare::runOnFunction(llvm::Function&) ()
#7  0x000000000152ea9a in llvm::FPPassManager::runOnFunction(llvm::Function&)
()
#8  0x000000000152ed03 in llvm::FPPassManager::runOnModule(llvm::Module&) ()
#9  0x000000000152f27b in llvm::legacy::PassManagerImpl::run(llvm::Module&) ()
#10 0x0000000001ba6f33 in clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::__1::unique_ptr<llvm::raw_pwrite_stream,
std::__1::default_delete<llvm::raw_pwrite_stream> >) ()
#11 0x0000000002118868 in
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) ()
#12 0x0000000002599af2 in clang::ParseAST(clang::Sema&, bool, bool) ()
#13 0x000000000208b68c in clang::FrontendAction::Execute() ()
#14 0x000000000201d0c1 in
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) ()
#15 0x0000000002112cee in
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) ()
#16 0x0000000000d76c95 in cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) ()
#17 0x0000000000d74d9e in main ()

The test case minimizes to:

/* clang -cc1 -triple i386 -S -O2 -vectorize-loops -vectorize-slp
imapd-minimized.c */
char c[0];
enum { d, f } e;
int i();
void m();
void n() {
  char j, a, *g, b[0];
  int l = i(), k = l;
  g = b;
  char *h = "PID=";
  while (*h)
    *g++ = *h++;
  h = c;
  do
    h++;
  while (k);
  while (h > c)
    *g++ = *--h;
  switch (e)
  case 0: {
    h = "   in";
    while (*h)
      *g++ = *h++;
    a = 0;
    break;
  case 1:
    h = "  in";
    while (*h)
      *g++ = *h++;
    j = 0;
  }
  m(g - b);
}

As opposed to <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED DUPLICATE - Assertion failed: (ScaledReg == nullptr), function SetCombinedField, file lib/CodeGen/CodeGenPrepare.cpp, line 1973."
   href="show_bug.cgi?id=35805">bug 35805</a> and <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - clang crashes on valid code at -O2 and -O3 on x86_64-linux-gnu in 32-bit mode: Assertion `ScaledReg == nullptr' failed"
   href="show_bug.cgi?id=35799">bug 35799</a>, which regressed with
<a href="https://reviews.llvm.org/rL319302">https://reviews.llvm.org/rL319302</a> ("[CGP] Enable complex addr mode"), this
particular bug regressed with <a href="https://reviews.llvm.org/rL320749">https://reviews.llvm.org/rL320749</a> ("[SimplifyCFG]
don't sink common insts too soon (PR34603)"), which is apparently a fix for bug
34603.</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>