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

        <tr>
          <th>Summary</th>
          <td>Assertion failed: (ScaledReg == nullptr), function SetCombinedField, file lib/CodeGen/CodeGenPrepare.cpp, line 1973.
          </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>release blocker
          </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>As reported in <a href="https://bugs.freebsd.org/224866">https://bugs.freebsd.org/224866</a>, clang 6.0.0 (trunk r321545)
asserts on compiling colset.c of the graphics/xpx port:

Starting program: /usr/bin/clang -cc1 -triple x86_64-unknown-freebsd12.0
-emit-obj -disable-free -main-file-name colset.c -mrelocation-model static
-mthread-model posix -mdisable-fp-elim -relaxed-aliasing -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -dwarf-column-info
-debugger-tuning=gdb -coverage-notes-file
/wrkdirs/usr/ports/graphics/xpx/work/xpx/colset.gcno -D CSRG_BASED -D
FUNCPROTO=15 -D NARROWPROTO -O2 -ferror-limit 19 -fmessage-length 101
-stack-protector 1 -fobjc-runtime=gnustep -fdiagnostics-show-option
-fcolor-diagnostics -vectorize-loops -vectorize-slp -x c colset-bf0c31.c
Assertion failed: (ScaledReg == nullptr), function SetCombinedField, file
/share/dim/src/freebsd/clang600-import/contrib/llvm/lib/CodeGen/CodeGenPrepare.cpp,
line 1973.

Program received signal SIGABRT, Aborted.
thr_kill () at thr_kill.S:3
3       in thr_kill.S
(gdb) bt
#0  thr_kill () at thr_kill.S:3
#1  0x00000000041090bf in __raise (s=6) at
/share/dim/src/freebsd/clang600-import/lib/libc/gen/raise.c:54
#2  0x0000000004109039 in abort () at
/share/dim/src/freebsd/clang600-import/lib/libc/stdlib/abort.c:67
#3  0x000000000417864a in __assert (func=<optimized out>, file=<optimized out>,
line=<optimized out>, failedexpr=<optimized out>) at
/share/dim/src/freebsd/clang600-import/lib/libc/gen/assert.c:53
#4  0x000000000398ede4 in SetCombinedField () at
/share/dim/src/freebsd/clang600-import/contrib/llvm/lib/CodeGen/CodeGenPrepare.cpp:1973
#5  combineAddrModes () at
/share/dim/src/freebsd/clang600-import/contrib/llvm/lib/CodeGen/CodeGenPrepare.cpp:2754
#6  0x0000000003984b80 in optimizeMemoryInst () at
/share/dim/src/freebsd/clang600-import/contrib/llvm/lib/CodeGen/CodeGenPrepare.cpp:4251
#7  0x000000000397ddd9 in optimizeInst () at
/share/dim/src/freebsd/clang600-import/contrib/llvm/lib/CodeGen/CodeGenPrepare.cpp:6228
#8  0x0000000003976497 in optimizeBlock () at
/share/dim/src/freebsd/clang600-import/contrib/llvm/lib/CodeGen/CodeGenPrepare.cpp:6335
#9  runOnFunction () at
/share/dim/src/freebsd/clang600-import/contrib/llvm/lib/CodeGen/CodeGenPrepare.cpp:420
#10 0x000000000374326a in runOnFunction () at
/share/dim/src/freebsd/clang600-import/contrib/llvm/lib/IR/LegacyPassManager.cpp:1520
#11 0x0000000003743553 in runOnModule () at
/share/dim/src/freebsd/clang600-import/contrib/llvm/lib/IR/LegacyPassManager.cpp:1541
#12 0x0000000003743a82 in runOnModule () at
/share/dim/src/freebsd/clang600-import/contrib/llvm/lib/IR/LegacyPassManager.cpp:1597
#13 run () at
/share/dim/src/freebsd/clang600-import/contrib/llvm/lib/IR/LegacyPassManager.cpp:1700
#14 0x00000000015c9518 in EmitAssembly () at
/share/dim/src/freebsd/clang600-import/contrib/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp:815
#15 EmitBackendOutput () at
/share/dim/src/freebsd/clang600-import/contrib/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp:1181
#16 0x00000000015c3894 in HandleTranslationUnit () at
/share/dim/src/freebsd/clang600-import/contrib/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:292
#17 0x0000000001fbd372 in ParseAST () at
/share/dim/src/freebsd/clang600-import/contrib/llvm/tools/clang/lib/Parse/ParseAST.cpp:159
#18 0x00000000019d236e in Execute () at
/share/dim/src/freebsd/clang600-import/contrib/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:897
#19 0x00000000027b7b71 in ExecuteAction () at
/share/dim/src/freebsd/clang600-import/contrib/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:991
#20 0x00000000015a1a33 in ExecuteCompilerInvocation () at
/share/dim/src/freebsd/clang600-import/contrib/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:252
#21 0x00000000015967d0 in cc1_main () at
/share/dim/src/freebsd/clang600-import/contrib/llvm/tools/clang/tools/driver/cc1_main.cpp:221
#22 0x000000000159effa in ExecuteCC1Tool () at
/share/dim/src/freebsd/clang600-import/contrib/llvm/tools/clang/tools/driver/driver.cpp:309
#23 main () at
/share/dim/src/freebsd/clang600-import/contrib/llvm/tools/clang/tools/driver/driver.cpp:388

The test case minimizes to:

/* clang -cc1 -triple x86_64 -S -O1 colset-minimized.c */
int h;
void k();
typedef struct {
  struct {
    unsigned char b;
    unsigned char c;
  } d;
} e;
typedef struct { short f; } g;
e j;
void n(g *l)
{
  int i, m;
  e a = *(&j + h);
  switch (l->f) {
  case 4:
    i = 0;
    m = a.d.b;
    break;
  case 5:
    i = 1;
    m = a.d.c;
  }
  k((long)i, m);
}</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>