[LLVMbugs] [Bug 10210] New: Odd behavior with llvm::StringMap::GetOrCreateValue when passed const char * vs. std::string.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jun 27 17:45:50 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=10210

           Summary: Odd behavior with llvm::StringMap::GetOrCreateValue
                    when passed const char * vs. std::string.
           Product: new-bugs
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: chad.rosier at gmail.com
                CC: llvmbugs at cs.uiuc.edu


LLVM commit r133516 caused link-time errors when LTO was enabled for a number
of the ObjC and ObjC++ benchmarks in the llvm test-suite.  The change in
r133516 are all of the nature:

-        _undefines.GetOrCreateValue(superclassName.c_str());
+        _undefines.GetOrCreateValue(superclassName);

In the first instance a C style string (i.e., const char *) is passed, while in
the second version a std::string is passed.  It is unclear as to why passing a
std::string would cause an issue and should be further investigated.

** To Reproduce:
1. Checkout revision 133516.
2. Checkout the llvm test-suite.
3. Build with --enable-optimized
4. Run the test-suite in the ObjC and/or Obj-C++ subdirectories with the
following flags:
make ARCH=x86 CC_UNDER_TEST_IS_CLANG=1 CC_UNDER_TEST_TARGET_IS_I386=1
DISABLE_CBE=1
DISABLE_JIT=1 ENABLE_HASHED_PROGRAM_OUTPUT=1 ENABLE_OPTIMIZED=1
LD_ENV_OVERRIDES="env DYLD_LIBRARY_PATH=$YOUR_INSTALL_DIR/lib" LLC_OPTFLAGS=-O2
LLI_OPTFLAGS=-O2 OPTFLAGS=-Os SMALL_PROBLEM_SIZE=1 TARGET_CC="" TARGET_CXX=""
TARGET_FLAGS="-flto -arch i386" TARGET_LLVMGCC=$YOUR_INSTALL_DIR/bin/clang
TARGET_LLVMGXX=$YOUR_INSTALL_DIR/bin/clang++ TEST=simple USE_REFERENCE_OUTPUT=1
report

Obviously, $YOUR_TEST_DIR should be the directory where clang has been
installed.  You should see many of the ObjC and ObjC++ tests fails due to a
linking issue of the form "ld: duplicate symbol ...".  If you repeat the above
process with r133955 (which reverts 133516) the errors are removed.

-- 
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