<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 - [GVNHoist] Invalid hoist of store"
   href="https://bugs.llvm.org/show_bug.cgi?id=32153">32153</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[GVNHoist] Invalid hoist of store
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>All
          </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>Scalar Optimizations
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>gberry@codeaurora.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>GVNHoist hoists the store to @G in the following code, even though the switch
default path directly to %exit does not store to @G.  This is a reduced test
case that was reported by Benjamin Kramer when compiling bash with the GVNHoist
pass moved in the pass pipeline to the beginning of the function simplification
phase.


%struct.__jmp_buf_tag = type { [8 x i64], i32 }

@test_exit_buf = global %struct.__jmp_buf_tag zeroinitializer
@G = global i32 0

define void @test_command(i32 %c1) {
entry:
  switch i32 %c1, label %exit [
    i32 0, label %sw0
    i32 1, label %sw1
  ]

sw0:
  store i32 1, i32* @G
  br label %exit

sw1:
  store i32 1, i32* @G
  br label %exit

exit:
  call void @longjmp(%struct.__jmp_buf_tag* @test_exit_buf, i32 1) #0
  unreachable
}

declare void @longjmp(%struct.__jmp_buf_tag*, i32) #0

attributes #0 = { noreturn nounwind }</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>