<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 --- - Don't "double allocate" the Y pointer register when there is a stack spill"
   href="https://llvm.org/bugs/show_bug.cgi?id=31349">31349</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Don't "double allocate" the Y pointer register when there is a stack spill
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Backend: AVR
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>dylanmckay34@gmail.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>Currently, we always allow the 'Y' register to be allocated in all of the
instructions it can be used with.

In functions which do not spill registers, this is absolutely fine and there
are no issues.

In functions which DO spill registers, the Y register is used to store the
frame pointer. It will be stored here even if the Y register has already been
allocated for existing live intervals within the function.

This means that we can clobber Y without restoring and then use the clobbered
value in the same function.

We previously had a hack (before this backend was upstreamed) that would teach
the register allocator that if it generates the first spill in a function, it
will rewind allocation to the start of the function and then mark 'Y' as a
reserved register. It would then reallocate the function and there would be no
"overlaps" of the Y register.

We will need to come up with a proper fix, as this is likely to break many
programs currently.

Raised from PR31346.</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>