[llvm-bugs] [Bug 32153] New: [GVNHoist] Invalid hoist of store

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Mar 6 09:27:56 PST 2017


https://bugs.llvm.org/show_bug.cgi?id=32153

            Bug ID: 32153
           Summary: [GVNHoist] Invalid hoist of store
           Product: libraries
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: gberry at codeaurora.org
                CC: llvm-bugs at lists.llvm.org

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 }

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170306/56434bae/attachment.html>


More information about the llvm-bugs mailing list