<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:hans@chromium.org" title="Hans Wennborg <hans@chromium.org>"> <span class="fn">Hans Wennborg</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - [x86] Tail call with conditional jumps"
   href="https://bugs.llvm.org/show_bug.cgi?id=26302">bug 26302</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;">Resolution</td>
           <td>---
           </td>
           <td>FIXED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>REOPENED
           </td>
           <td>RESOLVED
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - [x86] Tail call with conditional jumps"
   href="https://bugs.llvm.org/show_bug.cgi?id=26302#c7">Comment # 7</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - [x86] Tail call with conditional jumps"
   href="https://bugs.llvm.org/show_bug.cgi?id=26302">bug 26302</a>
              from <span class="vcard"><a class="email" href="mailto:hans@chromium.org" title="Hans Wennborg <hans@chromium.org>"> <span class="fn">Hans Wennborg</span></a>
</span></b>
        <pre>(In reply to Nikita Kniazev from <a href="show_bug.cgi?id=26302#c6">comment #6</a>)
<span class="quote">> Correct me if I am wrong. The example in the first post is not affected by
> this comment, as folding will not change the branch direction in it.</span >

But it does. Before the optimization:

        testb   $1, 4(%esp)
        je      .LBB0_2
        jmp     foo
  .LBB0_2:
        jmp     bar

The "je" branches "forward" due to the code layout.

After folding:

        testb   $1, 4(%esp)
        je      bar
        jmp     foo

The "je" might branch "forward" or "backward" depending on where the linker
puts "bar" in relation to the current code. The code layout done by the
compiler is lost.

At least that was the motivation for restricting this to optsize.

If you want to make the case that this optimization should fire also without
optsize, please open another bug.</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>