[LLVMbugs] [Bug 23884] New: WinEHPrepare failed to demote instruction

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jun 18 11:44:28 PDT 2015


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

            Bug ID: 23884
           Summary: WinEHPrepare failed to demote instruction
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: alex at crichton.co
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Compiling this IR:

```
target triple = "x86_64-pc-windows-msvc"                                     

declare i32 @__C_specific_handler(...)                                       
declare void @bar()                                                          
declare void @baz()                                                          
declare void @free(i8*)                                                      

define void @foo() {                                                         
  invoke void @baz()                                                         
          to label %normal unwind label %unwind1                             

normal:                                                                      
  unreachable                                                                

unwind1:                                                                     
  %lp5 = landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler
          cleanup                                                            
  %rem = load i8*, i8** undef, align 8                                       
  invoke void @bar()                                                         
          to label %normal unwind label %unwind2                             

unwind2:                                                                     
  %lp6 = landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler
          cleanup                                                            
  invoke void @baz()                                                         
          to label %normal2 unwind label %unwind3                            

normal2:                                                                     
  call void @free(i8* %rem)                                                  
  unreachable                                                                

unwind3:                                                                     
  %lp4 = landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler
          cleanup                                                            
  unreachable                                                                
}                                                                            
```

will end up yielding the following when compiled with llc:

Failed to demote instruction used in exception handler of function foo:
    %rem = load i8*, i8** undef, align 8
LLVM ERROR: WinEHPrepare failed to demote instruction


This may be a dupe of one of these bugs, but I didn't see a reduced version of
them so I wasn't sure unfortnately:

* https://llvm.org/bugs/show_bug.cgi?id=23427
* https://llvm.org/bugs/show_bug.cgi?id=23557

-- 
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/20150618/e25a2c8b/attachment.html>


More information about the llvm-bugs mailing list