[LLVMbugs] [Bug 8389] New: Global Variable Optimizer transforms OcamlGCPrinter.cpp incorrectly
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Fri Oct 15 15:34:40 PDT 2010
http://llvm.org/bugs/show_bug.cgi?id=8389
Summary: Global Variable Optimizer transforms
OcamlGCPrinter.cpp incorrectly
Product: libraries
Version: trunk
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P
Component: Interprocedural Optimizations
AssignedTo: unassignedbugs at nondot.org
ReportedBy: foldr at codedgers.com
CC: llvmbugs at cs.uiuc.edu
Created an attachment (id=5622)
--> (http://llvm.org/bugs/attachment.cgi?id=5622)
OcamlGCPrinter.O0.bc
When trying to compile LLVM 2.8 with llvm-gcc on Windows I encountered the
following error:
c:/code/codedgers/evaluation-2.8/obj/Release/lib/libLLVMAsmPrinter.a(AsmPrinter.
o):fake:(.bss$linkonce__ZN4llvm8RegistryINS_17GCMetadataPrinterENS_14RegistryTra
itsIS1_EEE4HeadE+0x0): multiple definition of
`llvm::Registry<llvm::GCMetadataPr
inter, llvm::RegistryTraits<llvm::GCMetadataPrinter> >::Head'
c:/code/codedgers/evaluation-2.8/obj/Release/lib/libLLVMAsmPrinter.a(OcamlGCPrin
ter.o):fake:(.data$linkonce__ZN4llvm8RegistryINS_17GCMetadataPrinterENS_14Regist
ryTraitsIS1_EEE4HeadE+0x0): first defined here
Taking a look at the bytecode:
OcamlGCPrinter.ll:
@_ZN4llvm8RegistryINS_17GCMetadataPrinterENS_14RegistryTraitsIS1_EEE4HeadE =
weak_odr global
%"struct.llvm::Registry<llvm::GCMetadataPrinter,llvm::RegistryTraits<llvm::GCMetadataPrinter>
>::node"* getelementptr inbounds
(%"struct.llvm::Registry<llvm::GCMetadataPrinter,llvm::RegistryTraits<llvm::GCMetadataPrinter>
>::Add<<unnamed>::OcamlGCMetadataPrinter>"* @_ZL1Y, i32 0, i32 1)
AsmPrinter.ll:
@_ZN4llvm8RegistryINS_17GCMetadataPrinterENS_14RegistryTraitsIS1_EEE4HeadE =
weak_odr global
%"struct.llvm::Registry<llvm::GCMetadataPrinter,llvm::RegistryTraits<llvm::GCMetadataPrinter>
>::node"* null
However, when compiled with -O0, the relevant fragment of OcamlGCPrinter.ll
looks like this:
@_ZN4llvm8RegistryINS_17GCMetadataPrinterENS_14RegistryTraitsIS1_EEE4HeadE =
weak_odr global
%"struct.llvm::Registry<llvm::GCMetadataPrinter,llvm::RegistryTraits<llvm::GCMetadataPrinter>
>::node"* null
Running opt with -print-after-all showed that -globalopt is to blame. Attached
are both -O0 and -O2 versions of OCamlGCPrinter.bc
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list