<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [NVC0/Codegen] Shader compilation falis in spill logic"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=79462#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [NVC0/Codegen] Shader compilation falis in spill logic"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=79462">bug 79462</a>
              from <span class="vcard"><a class="email" href="mailto:imirkin@alum.mit.edu" title="Ilia Mirkin <imirkin@alum.mit.edu>"> <span class="fn">Ilia Mirkin</span></a>
</span></b>
        <pre>The below patch helps avoid the crash, but it still still generate incorrect
code. I think there are a few issues here, and I'll have to think a little
harder about how to properly resolve them.


diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp
b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp
index 5ab6570..89c83cb 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp
@@ -1576,7 +1576,8 @@ SpillCodeInserter::run(const std::list<ValuePair>& lst)

          assert(defi);
          if (defi->isPseudo()) {
-            d = lval->defs.erase(d);
+            while (d != lval->defs.end() && (*d)->getInsn() == defi)
+               d = lval->defs.erase(d);
             --d;
             if (slot->reg.file == FILE_MEMORY_LOCAL)
                delete_Instruction(func->getProgram(), defi);</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>