[LLVMbugs] [Bug 13497] New: Regression: "Value::replaceAllUsesWith(<null>) is invalid!" assert with -O1 and -fno-builtin when building libxml

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jul 31 17:04:15 PDT 2012


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

             Bug #: 13497
           Summary: Regression: "Value::replaceAllUsesWith(<null>) is
                    invalid!" assert with -O1 and -fno-builtin when
                    building libxml
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nicolasweber at gmx.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


hummer:delta thakis$ cat repro.c 
char* xmlMallocAtomic(int);
void htmlCreateFileParserCtxt(const char *encoding) {
  if (encoding) {
    char* content = xmlMallocAtomic (1);
    if (content) {
      ((__builtin_object_size(content, 0) !=  -1) ?
        __builtin___strcpy_chk(content, "", __builtin_object_size(content, 1))
:
        __inline_strcpy_chk(content, ""));
    }
  }
}
hummer:delta thakis$
~/src/chrome-git/src/third_party/llvm-build/Release+Asserts/bin/clang -c
repro.c -O1 -fno-builtin
repro.c:8:9: warning: implicit declaration of function '__inline_strcpy_chk' is
invalid in C99 [-Wimplicit-function-declaration]
        __inline_strcpy_chk(content, ""));
        ^
repro.c:6:51: warning: pointer/integer type mismatch in conditional expression
('char *' and 'int') [-Wconditional-type-mismatch]
      ((__builtin_object_size(content, 0) !=  -1) ?
                                                  ^
Assertion failed: (New && "Value::replaceAllUsesWith(<null>) is invalid!"),
function replaceAllUsesWith, file
/Volumes/MacintoshHD2/src/chrome-git/src/third_party/llvm/lib/VMCore/Value.cpp,
line 298.
0  clang             0x00000001015a2ba2 PrintStackTrace(void*) + 34
1  clang             0x00000001015a2ff4 SignalHandler(int) + 644
2  libSystem.B.dylib 0x00007fff815e61ba _sigtramp + 26
3  clang             0x000000010133f7d2
llvm::MergeBlockIntoPredecessor(llvm::BasicBlock*, llvm::Pass*) + 50
4  clang             0x000000010004ce36 abort + 22
5  clang             0x000000010004ce11 __assert_rtn + 81
6  clang             0x000000010156352d
llvm::Value::replaceAllUsesWith(llvm::Value*) + 397
7  clang             0x0000000101248762 (anonymous
namespace)::CodeGenPrepareFortifiedLibCalls::replaceCall(llvm::Value*) + 18
8  clang             0x0000000101346540
llvm::SimplifyFortifiedLibCalls::fold(llvm::CallInst*, llvm::TargetData const*,
llvm::TargetLibraryInfo const*) + 1008
9  clang             0x0000000101246ed7 (anonymous
namespace)::CodeGenPrepare::OptimizeInst(llvm::Instruction*) + 7255
10 clang             0x0000000101244d10 (anonymous
namespace)::CodeGenPrepare::runOnFunction(llvm::Function&) + 4304
11 clang             0x0000000101556630
llvm::FPPassManager::runOnFunction(llvm::Function&) + 432
12 clang             0x00000001015568bb
llvm::FPPassManager::runOnModule(llvm::Module&) + 187
13 clang             0x0000000101556b26
llvm::MPPassManager::runOnModule(llvm::Module&) + 406
14 clang             0x00000001015570d9
llvm::PassManagerImpl::run(llvm::Module&) + 393
15 clang             0x00000001015572bd llvm::PassManager::run(llvm::Module&) +
13
16 clang             0x00000001001bfe5e
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::Module*,
clang::BackendAction, llvm::raw_ostream*) + 5070
17 clang             0x000000010029f8ba
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 602
18 clang             0x00000001002d6434 clang::ParseAST(clang::Sema&, bool,
bool) + 516
19 clang             0x000000010029e5e1 clang::CodeGenAction::ExecuteAction() +
465
20 clang             0x00000001000ab758 clang::FrontendAction::Execute() + 104
21 clang             0x000000010008180f
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 991
22 clang             0x000000010005987a
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3322
23 clang             0x000000010004fe7a cc1_main(char const**, char const**,
char const*, void*) + 730
24 clang             0x000000010005630b main + 3355
25 clang             0x000000010004fb74 start + 52
26 clang             0x000000000000002d start + 4294640877

hummer:delta thakis$
~/src/chrome-git/src/third_party/llvm-build/Release+Asserts/bin/clang --version
clang version 3.2 (trunk 160967)
Target: x86_64-apple-darwin10.8.0
Thread model: posix

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