<html>
    <head>
      <base href="http://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 --- - Destructor alias emission ignores calling convention"
   href="http://llvm.org/bugs/show_bug.cgi?id=19007">19007</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Destructor alias emission ignores calling convention
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>URL</th>
          <td>http://www.freebsd.org/cgi/query-pr.cgi?pr=187103
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Keywords</th>
          <td>miscompilation
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>LLVM Codegen
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>benny.kra@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu, rafael.espindola@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Here's a mildly insane test case reduced from mozilla.

$ cat t.cc
#define NS_CONSTRUCTOR_FASTCALL __attribute__ ((regparm (3), stdcall))

struct nsCOMPtr_base {
  NS_CONSTRUCTOR_FASTCALL ~nsCOMPtr_base() {}
};

struct nsCOMPtr : private nsCOMPtr_base {};

int main() {
  nsCOMPtr ptr;
}

$ clang -target i386-linux-gnu -O1 -Xclang -disable-llvm-optzns -flto -S -o -
t.cc
define i32 @main() #0 {
entry:
  %ptr = alloca %struct.nsCOMPtr, align 1
  call void bitcast (void (%struct.nsCOMPtr_base*)* @_ZN13nsCOMPtr_baseD2Ev to
void (%struct.nsCOMPtr*)*)(%struct.nsCOMPtr* %ptr)
  ret i32 0
}

define linkonce_odr x86_stdcallcc void
@_ZN13nsCOMPtr_baseD2Ev(%struct.nsCOMPtr_base* inreg %this)



Here we create a call to @_ZN13nsCOMPtr_baseD2Ev without adding the
x86_stdcallcc attribute to the call. The optimizer will turn this into a call
to @llvm.trap.</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>