[rfc][gold plugin] Fix pr19901

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Aug 6 08:32:33 PDT 2014


> I don't think we drop them yet, but I see it is as just a convenience
> so that it is easy to test it with llc. While developing this patch I
> did a few clang bootstraps and only once noticed a unused linkonce_odr
> in a .bc produced by clang. The previous passes should drop it. We
> could add an option to do it, I am just not sure it would have a big
> impact (I will write a patch to check).

And I can't even reproduce that anymore.

I applied the attached patch to llvm to make it assert when writing
bitcode or assembly with a dead linkonce_odr. It will correctly crash
in llvm-as or llc when given just

define linkonce_odr void @g() {
  ret void
}

But it can successfully build a stage2 with or without LTO, so it
looks we are pretty good at dropping unused linkonce_odr and dropping
it in codegen proper would not add any real value.

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: application/octet-stream
Size: 2106 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140806/d419db0f/attachment.obj>


More information about the llvm-commits mailing list