<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:nunoplopes@sapo.pt" title="Nuno Lopes <nunoplopes@sapo.pt>"> <span class="fn">Nuno Lopes</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WONTFIX - missed opt: indeterminate value in lvalue expression does not optimize function call away"
   href="https://bugs.llvm.org/show_bug.cgi?id=41112">bug 41112</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>WONTFIX
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WONTFIX - missed opt: indeterminate value in lvalue expression does not optimize function call away"
   href="https://bugs.llvm.org/show_bug.cgi?id=41112#c5">Comment # 5</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WONTFIX - missed opt: indeterminate value in lvalue expression does not optimize function call away"
   href="https://bugs.llvm.org/show_bug.cgi?id=41112">bug 41112</a>
              from <span class="vcard"><a class="email" href="mailto:nunoplopes@sapo.pt" title="Nuno Lopes <nunoplopes@sapo.pt>"> <span class="fn">Nuno Lopes</span></a>
</span></b>
        <pre>(In reply to Gonzalo BG from <a href="show_bug.cgi?id=41112#c4">comment #4</a>)
<span class="quote">> > I'm inclined to not "fix" this (i.e., to not optimize this case).

> Can you elaborate about why you think that the more aggressive dead-code
> elimination that would result from this optimization is not worth pursuing?</span >

The burden of proof is the other way around: you need to prove that the benefit
is worth the cost of implementing this feature.
We don't exploit undefined behavior just for the sake of it. We do it where it
brings some benefit (e.g., performance).

The example above doesn't feel like it would give any benefit for real
programs. Hence it's not worth the cost. Please reopen this report if you have
a concrete example from real code where this would help.</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>