<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:ndesaulniers@google.com" title="Nick Desaulniers <ndesaulniers@google.com>"> <span class="fn">Nick Desaulniers</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - __attribute__((alias)) should prevent DCE"
   href="https://bugs.llvm.org/show_bug.cgi?id=39088">bug 39088</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>INVALID
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - __attribute__((alias)) should prevent DCE"
   href="https://bugs.llvm.org/show_bug.cgi?id=39088#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - __attribute__((alias)) should prevent DCE"
   href="https://bugs.llvm.org/show_bug.cgi?id=39088">bug 39088</a>
              from <span class="vcard"><a class="email" href="mailto:ndesaulniers@google.com" title="Nick Desaulniers <ndesaulniers@google.com>"> <span class="fn">Nick Desaulniers</span></a>
</span></b>
        <pre>Sorry, after thinking more about this and discussing more with a coworker, I
think Clang is doing the right thing, and that `static` should be removed from
declarations passed to MODULE_DEVICE_TABLE without other references.  Clang's
Dead Code Elimination (DCE) here seems to be more aggressive, but it still
looks correct to me.

int foo [] = { 42, 0xDEAD }; // extern
extern typeof(foo) bar __attribute__((unused, alias("foo")));

GCC and Clang at -O2 both produce references to foo and bar.

Adding `static` to foo, then GCC produces both references, while Clang moves
the data to bar and removes foo.  This is safe because foo has no other
references, and bar is what we care about in the Linux kernel's case.</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>