<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 --- - [x86] Redundant displacement in calls to virtual base class function with this-adjustment"
   href="https://llvm.org/bugs/show_bug.cgi?id=26327">26327</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[x86] Redundant displacement in calls to virtual base class function with this-adjustment
          </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>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>Backend: X86
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>hans@chromium.org
          </td>
        </tr>

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

        <tr>
          <th>Blocks</th>
          <td>26299
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Consider:

  struct Base1 { virtual void f1(); };
  struct Base2 { virtual void f2(); };

  struct S : Base1, Base2 {
    void foo();
  };

  void S::foo() {
    f2();
  }

At -Os, we generate:

00000000 <?foo@S@@QAEXXZ>:
   0:    8b 41 04                 mov    0x4(%ecx),%eax
   3:    83 c1 04                 add    $0x4,%ecx
   6:    ff 20                    jmp    *(%eax)

MSVC generates:

?foo@S@@QAEXXZ (public: void __thiscall S::foo(void)):
  00000000: 83 C1 04           add         ecx,4
  00000003: 8B 01              mov         eax,dword ptr [ecx]
  00000005: FF 20              jmp         dword ptr [eax]

saving one byte, admittedly at the cost of a longer dependency chain. Maybe
that's worth it at -Os though?</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>