<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 - Clang :: Sema/offsetof-64.c FAILs on 64-bit Sparc"
   href="https://bugs.llvm.org/show_bug.cgi?id=47710">47710</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang :: Sema/offsetof-64.c FAILs on 64-bit Sparc
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

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

        <tr>
          <th>Hardware</th>
          <td>Sun
          </td>
        </tr>

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

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

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

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

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

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

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

        <tr>
          <th>Reporter</th>
          <td>ro@gcc.gnu.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The Clang :: Sema/offsetof-64.c test FAILs on 64-bit Sparc (seen on both
sparcv9-sun-solaris2.11 and sparc64-unknown-linux-gnu):

Assertion failed: (Size == 0 || EltInfo.Width <= (uint64_t)(-1) / Size) &&
"Overflow in array type bit size evaluation", file
/vol/llvm/src/llvm-project/dist/clang/lib/AST/ASTContext.cpp, line 1914

However, the same problem can be seen in a much reduced testcase (attached).

Compile with

$ clang -m64 -O3 -o o64 o64.c o64d.c && ./o64
Assertion failed: Width <= (uint64_t)(-1) / Size, file o64.c, line 7, function
main
Abort (core dumped)

The test works with gcc and clang-9, while clang-10 and 11 show the same error.</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>