[LLVMbugs] [Bug 11928] New: /lib/CodeGen/CGExpr.cpp:1377 Assertion "Should not use decl without marking it used!" failed

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Feb 5 12:48:50 PST 2012


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

             Bug #: 11928
           Summary: /lib/CodeGen/CGExpr.cpp:1377 Assertion "Should not use
                    decl without marking it used!"  failed
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: markus at trippelsdorf.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Happened during a Firefox build:

 % clang -v
clang version 3.1 (trunk 149841)
Target: x86_64-unknown-linux-gnu
Thread model: posix

clang: /var/tmp/llvm/tools/clang/lib/CodeGen/CGExpr.cpp:1377:
clang::CodeGen::LValue clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(const
clang::
DeclRefExpr *): Assertion `(ND->isUsed(false) || !isa<VarDecl>(ND) ||
!E->getLocation().isValid()) && "Should not use decl without marking it used!"'
 failed.
0  clang           0x0000000001725a9f
1  clang           0x0000000001725fb9
2  libpthread.so.0 0x00007fa5ec024190
3  libc.so.6       0x00007fa5eb85f9d5 gsignal + 53
4  libc.so.6       0x00007fa5eb860e58 abort + 328
5  libc.so.6       0x00007fa5eb8589b2
6  libc.so.6       0x00007fa5eb858a62
7  clang           0x000000000077f992
clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(clang::DeclRefExpr const*) +
2082
8  clang           0x000000000077bd30
clang::CodeGen::CodeGenFunction::EmitLValue(clang::Expr const*) + 384
9  clang           0x000000000077eb46
clang::CodeGen::CodeGenFunction::EmitCheckedLValue(clang::Expr const*) + 22
10 clang           0x00000000007a9e3b
11 clang           0x00000000007ade74
12 clang           0x00000000007a9cc7
13 clang           0x00000000007a0d3d
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) + 93
14 clang           0x000000000077b9fe
clang::CodeGen::CodeGenFunction::EvaluateExprAsBool(clang::Expr const*) + 318
15 clang           0x00000000008084c8
clang::CodeGen::CodeGenFunction::EmitBranchOnBoolExpr(clang::Expr const*,
llvm::BasicBlock*, llvm::BasicBlock*)
 + 1672
16 clang           0x00000000007f8c02
clang::CodeGen::CodeGenFunction::EmitIfStmt(clang::IfStmt const&) + 434
17 clang           0x00000000007f8469
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 473
18 clang           0x00000000007fdc4c
clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&,
bool, clang::CodeGen::AggValueSlo
t) + 252
19 clang           0x00000000007f8847
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 135
20 clang           0x00000000007f82b6
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 38
21 clang           0x00000000007f9c0e
clang::CodeGen::CodeGenFunction::EmitForStmt(clang::ForStmt const&) + 1198
22 clang           0x00000000007f8499
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 521
23 clang           0x00000000007fdc4c
clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&,
bool, clang::CodeGen::AggValueSlo
t) + 252
24 clang           0x00000000007f8847
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 135
25 clang           0x00000000007f82b6
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 38
26 clang           0x0000000000807846
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInf
o const&) + 726
27 clang           0x00000000007176b3
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl)
+ 2851
28 clang           0x0000000000714cc8
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl) + 248
29 clang           0x000000000071637e
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) + 1502
30 clang           0x000000000071ac44
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) + 276
31 clang           0x000000000071ac9b
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) + 363
32 clang           0x000000000070fddf
33 clang           0x000000000070f37c
34 clang           0x00000000008256f2 clang::ParseAST(clang::Sema&, bool) + 306
35 clang           0x000000000070ea9e clang::CodeGenAction::ExecuteAction() +
974
36 clang           0x00000000005d131d
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 957
37 clang           0x00000000005ba37a
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3114
38 clang           0x00000000005b0486 cc1_main(char const**, char const**, char
const*, void*) + 3126
39 clang           0x00000000005b6475 main + 757
40 libc.so.6       0x00007fa5eb84c405 __libc_start_main + 245
41 clang           0x00000000005af769
Stack dump:
0.      Program arguments: /usr/local/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name
waitable_event_posix.cc
 -pic-level 2 -relaxed-aliasing -masm-verbose -mconstructor-aliases
-munwind-tables -target-cpu amdfam10 -target-linker-version 2.22.52.20120205
-mom
it-leaf-frame-pointer -ffunction-sections -coverage-file waitable_event_posix.o
-resource-dir /usr/local/bin/../lib/clang/3.1 -dependency-file .deps/
waitable_event_posix.pp -MT waitable_event_posix.o -sys-header-deps -include
/var/tmp/mozilla-central/config/gcc_hidden.h -include ../../mozilla-conf
ig.h -D MOZILLA_INTERNAL_API -D _IMPL_NS_COM -D EXPORT_XPT_API -D
EXPORT_XPTC_API -D _IMPL_NS_GFX -D _IMPL_NS_WIDGET -D IMPL_XREAPI -D
IMPL_NS_NET -D
 IMPL_THEBES -D STATIC_EXPORTABLE_JS_API -D OSTYPE="Linux3.3" -D OSARCH=Linux
-D EXCLUDE_SKIA_DEPENDENCIES -D OS_LINUX=1 -D OS_POSIX=1 -D NDEBUG -D T
RIMMED -D QT_SHARED -D MOZILLA_CLIENT -I ../../dist/stl_wrappers -I
../../dist/system_wrappers -I ../../dist -I
/var/tmp/mozilla-central/ipc/chromium
/src -I /var/tmp/mozilla-central/ipc/glue -I ../../ipc/ipdl/_ipdlheaders -I
/var/tmp/mozilla-central/ipc/chromium -I . -I ../../dist/include -I ../..
/dist/include/nsprpub -I
/var/tmp/mozilla-central/moz-build-dir/dist/include/nspr -I
/var/tmp/mozilla-central/moz-build-dir/dist/include/nss -I /usr/
include/gtk-2.0 -I /usr/lib64/gtk-2.0/include -I /usr/include/atk-1.0 -I
/usr/include/cairo -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/pango-1.0 
-I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I
/usr/include/pixman-1 -I /usr/include/freetype2 -I /usr/include/libpng15 -I
/usr/include/q
t4 -I /usr/include/qt4/QtGui -I /usr/include/libdrm -I /usr/include/qt4/QtCore
-I /usr/include/gtk-unix-print-2.0 -fmodule-cache-path /var/tmp/clang-
module-cache -internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/include/g++-v4 -internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/include
/g++-v4/x86_64-pc-linux-gnu -internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/include/g++-v4/backward
-internal-isystem /usr/local/include -in
ternal-isystem /usr/local/bin/../lib/clang/3.1/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O3
-Wall -Wpointer-
arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor
-Wno-c++0x-extensions -Wno-extended-offsetof -Wno-invalid-offsetof -W
no-variadic-macros -Werror=return-type -Wno-long-long
-Wno-delete-non-virtual-dtor -std=gnu++0x -fdeprecated-macro
-fdebug-compilation-dir /var/tmp/m
ozilla-central -ferror-limit 19 -fmessage-length 149 -pthread -mstackrealign
-fno-rtti -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -
fobjc-fragile-abi -fdiagnostics-show-option -fcolor-diagnostics -o
waitable_event_posix.o -x c++
/var/tmp/mozilla-central/ipc/chromium/src/base/waita
ble_event_posix.cc 
1.      <eof> parser at end of file
2.     
/var/tmp/mozilla-central/ipc/chromium/src/base/waitable_event_posix.cc:32:11:
LLVM IR generation of declaration 'base'
3.     
/var/tmp/mozilla-central/ipc/chromium/src/base/waitable_event_posix.cc:353:21:
Generating code for declaration 'base::WaitableEvent::SignalOn
e'
4.     
/var/tmp/mozilla-central/ipc/chromium/src/base/waitable_event_posix.cc:353:33:
LLVM IR generation of compound statement ('{}')
5.     
/var/tmp/mozilla-central/ipc/chromium/src/base/waitable_event_posix.cc:354:12:
LLVM IR generation of compound statement ('{}')
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang: note: diagnostic msg: Please submit a bug report to
http://llvm.org/bugs/ and include command line arguments and all diagnostic
information.
atomicops_internals_x86_gcc.cc
clang++ -o atomicops_internals_x86_gcc.o -c -I../../dist/stl_wrappers
-I../../dist/system_wrappers -include /var/tmp/mozilla-central/config/gcc_hidde
n.h -DMOZILLA_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API
-D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DIMPL_THEB
ES  -DSTATIC_EXPORTABLE_JS_API -DOSTYPE=\"Linux3.3\" -DOSARCH=Linux
-DEXCLUDE_SKIA_DEPENDENCIES  -DOS_LINUX=1 -DOS_POSIX=1  -I../../dist
-I/var/tmp/m
ozilla-central/ipc/chromium/src -I/var/tmp/mozilla-central/ipc/glue
-I../../ipc/ipdl/_ipdlheaders  -I/var/tmp/mozilla-central/ipc/chromium -I.
-I../.
./dist/include -I../../dist/include/nsprpub 
-I/var/tmp/mozilla-central/moz-build-dir/dist/include/nspr
-I/var/tmp/mozilla-central/moz-build-dir/dist
/include/nss      -fPIC -Qunused-arguments -fno-rtti -Qunused-arguments -Wall
-Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wn
o-non-virtual-dtor -Wno-c++0x-extensions -Wno-extended-offsetof
-Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -Wno-long-long
-march=
native -Wno-delete-non-virtual-dtor -fno-exceptions -fno-strict-aliasing
-std=gnu++0x -pthread -ffunction-sections -pipe -DNDEBUG -DTRIMMED -pthread 
-DQT_SHARED -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include
-I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0
-I/usr/incl
ude/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include
-I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng15
-I/usr/i
nclude/qt4 -I/usr/include/qt4/QtGui -I/usr/include/libdrm
-I/usr/include/qt4/QtCore -I/usr/include/gtk-unix-print-2.0   -O3
-fomit-frame-pointer  -Qu
nused-arguments  -DMOZILLA_CLIENT -include ../../mozilla-config.h -MD -MF
.deps/atomicops_internals_x86_gcc.pp /var/tmp/mozilla-central/ipc/chromium/
src/base/atomicops_internals_x86_gcc.cc
clang: note: diagnostic msg: Preprocessed source(s) and associated run
script(s) are located at:
clang: note: diagnostic msg: /tmp/waitable_event_posix-uD022r.ii
clang: note: diagnostic msg: /tmp/waitable_event_posix-uD022r.sh
make[6]: *** [waitable_event_posix.o] Error 254

reducing...

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