<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 - LTO build gives assertion"
   href="https://bugs.llvm.org/show_bug.cgi?id=38120">38120</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LTO build gives assertion
          </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>normal
          </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>ftee@flametop.co.uk
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>eleviant@accesssoftek.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Change 'r336059 - [Evaluator] Improve evaluation of call instruction' appears
to have introduced a compiler assertion when compiling this example code.

NB. This code sample is technically invalid C++ as it breaks the one definition
rules, but it used to compile benignly before the change.

$ cat a.cpp
class dYj typedef *(*vfY)(class lYY *);
struct Mxl {
  Mxl(vfY, int, const char *, int, const char *, const char *, const char *,
      bool);
  vfY AvQ;
};
Mxl::Mxl(vfY, int, const char *, int, const char *, const char *, const char *,
         bool) {}
$ cat b.cpp
class dYj;
struct Mxl {
  Mxl(dYj *(class lYY *), int, const char *, int, const char *, const char *,
      const char *, bool = true);
} a(0, 0, 0, 0, 0, 0, 0);

$ clang++ -c a.cpp -o a.cpp.o -flto
$ clang++ -c b.cpp -o b.cpp.o -flto
$ llvm-lto a.cpp.o b.cpp.o

gives the assertion:

llvm-lto: Casting.h:255: typename llvm::cast_retty<X,Y*>::ret_type
llvm::cast(Y*) [with X = llvm::Function; Y = llvm::Constant; typename
llvm::cast_retty<X, Y*>::ret_type = llvm::Function*]:
Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.

It would seem better if the compiler could give an error in this case rather
than aborting with an assertion.</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>