[PATCH] Prevent MDNode's RAUW from introducing a reference to a void Value.

Frederic Riss friss at apple.com
Thu Oct 16 15:54:50 PDT 2014


If you look at the added testcase, it cast a void (*func)() to a int (*func)(). The int typed result is referenced in a debug info metadata node (an argument to the dbg.value intrinsic). Then instcombine would remove the bitcast and turn the int returning function into a void returning function that gets RAUWd over the value in the MDNode. And at this point in the current code you have invalid IR. 

The code in the testcase is reduced from a huge LTO link that encountered this situation in a much more complicated setup.

http://reviews.llvm.org/D5828






More information about the llvm-commits mailing list