[cfe-commits] r147655 - in /cfe/trunk: lib/CodeGen/CGBuiltin.cpp test/CodeGen/no-builtin.c

Eli Friedman eli.friedman at gmail.com
Fri Jan 6 12:15:32 PST 2012


On Fri, Jan 6, 2012 at 12:07 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
> On Fri, Jan 6, 2012 at 4:20 AM, David Chisnall <csdavec at swan.ac.uk> wrote:
>> Author: theraven
>> Date: Fri Jan  6 06:20:19 2012
>> New Revision: 147655
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=147655&view=rev
>> Log:
>> If we are compiling with -fno-builtin then don't do constant folding of
>> builtins.
>>
>> This fixes PR11711.
>
> I had to revert this in r147677 because it broke building compiler_rt on OSX.

It was pointed out to me that I could say a bit more here. The
assertion+backtrace is below, and I've attached the preprocessed
source.

Assertion failed: (Arg < NumArgs && "Arg access out of range!"),
function getArg, file
/Volumes/storage/llvm/tools/clang/lib/CodeGen/../../include/clang/AST/Expr.h,
line 2022.
0  clang             0x000000010c485ae2 _ZL15PrintStackTracePv + 34
1  clang             0x000000010c4860d9 _ZL13SignalHandleri + 777
2  libsystem_c.dylib 0x00007fff8d126cfa _sigtramp + 26
3  libsystem_c.dylib 000000000000000000 _sigtramp + 18446603338149368608
4  clang             0x000000010c485d26 abort + 22
5  clang             0x000000010c485ce7 __assert_rtn + 55
6  clang             0x000000010b19c838
clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr(unsigned int,
clang::CallExpr const*) + 21864
7  clang             0x000000010b195f0e
clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(clang::FunctionDecl
const*, unsigned int, clang::CallExpr const*) + 21534
8  clang             0x000000010b1e4b59
clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*,
clang::CodeGen::ReturnValueSlot) + 281
9  clang             0x000000010b209320 (anonymous
namespace)::ScalarExprEmitter::VisitCallExpr(clang::CallExpr const*) +
208
10 clang             0x000000010b20591b
clang::StmtVisitorBase<clang::make_ptr, (anonymous
namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) +
14635
11 clang             0x000000010b204769
clang::StmtVisitorBase<clang::make_ptr, (anonymous
namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) +
10105
12 clang             0x000000010b1fd4c0
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*,
bool) + 96
13 clang             0x000000010b1d9509
clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*,
clang::CodeGen::AggValueSlot, bool) + 57
14 clang             0x000000010b1d9fb8
clang::CodeGen::CodeGenFunction::EmitAnyExprToTemp(clang::Expr const*)
+ 136
15 clang             0x000000010b1ac042
clang::CodeGen::CodeGenFunction::EmitCallArg(clang::CodeGen::CallArgList&,
clang::Expr const*, clang::QualType) + 2626
16 clang             0x000000010b1e7d38 void
clang::CodeGen::CodeGenFunction::EmitCallArgs<clang::FunctionProtoType>(clang::CodeGen::CallArgList&,
clang::FunctionProtoType const*, clang::ConstExprIterator,
clang::ConstExprIterator) + 328
17 clang             0x000000010b1e4f5c
clang::CodeGen::CodeGenFunction::EmitCall(clang::QualType,
llvm::Value*, clang::CodeGen::ReturnValueSlot,
clang::ConstExprIterator, clang::ConstExprIterator, clang::Decl
const*) + 252
18 clang             0x000000010b195ab3
clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(clang::FunctionDecl
const*, unsigned int, clang::CallExpr const*) + 20419
19 clang             0x000000010b1e4b59
clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*,
clang::CodeGen::ReturnValueSlot) + 281
20 clang             0x000000010b209320 (anonymous
namespace)::ScalarExprEmitter::VisitCallExpr(clang::CallExpr const*) +
208
21 clang             0x000000010b20591b
clang::StmtVisitorBase<clang::make_ptr, (anonymous
namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) +
14635
22 clang             0x000000010b2021b2
clang::StmtVisitorBase<clang::make_ptr, (anonymous
namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) +
450
23 clang             0x000000010b203290
clang::StmtVisitorBase<clang::make_ptr, (anonymous
namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) +
4768
24 clang             0x000000010b1fd4c0
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*,
bool) + 96
25 clang             0x000000010b1d9509
clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*,
clang::CodeGen::AggValueSlot, bool) + 57
26 clang             0x000000010b1d94b9
clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) +
41
27 clang             0x000000010b24f6a7
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 391
28 clang             0x000000010b254cbb
clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot) + 267
29 clang             0x000000010b24fadd
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) +
141
30 clang             0x000000010b24f549
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 41
31 clang             0x000000010b24fef4
clang::CodeGen::CodeGenFunction::EmitIfStmt(clang::IfStmt const&) +
500
32 clang             0x000000010b24f6f5
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 469
33 clang             0x000000010b254cbb
clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot) + 267
34 clang             0x000000010b24fadd
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) +
141
35 clang             0x000000010b24f549
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 41
36 clang             0x000000010b24fef4
clang::CodeGen::CodeGenFunction::EmitIfStmt(clang::IfStmt const&) +
500
37 clang             0x000000010b24f6f5
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 469
38 clang             0x000000010b254cbb
clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot) + 267
39 clang             0x000000010b24fadd
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) +
141
40 clang             0x000000010b24f549
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 41
41 clang             0x000000010b2608e7
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 839
42 clang             0x000000010b2688c5
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl)
+ 2165
43 clang             0x000000010b266232
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl)
+ 386
44 clang             0x000000010b26785c
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) + 1516
45 clang             0x000000010b26be47
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) + 279
46 clang             0x000000010b2852ef (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
+ 127
47 clang             0x000000010b25e24a
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) + 170
48 clang             0x000000010b290141 clang::ParseAST(clang::Sema&,
bool) + 305
49 clang             0x000000010b25d5f6
clang::CodeGenAction::ExecuteAction() + 1062
50 clang             0x000000010b04d0c2
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 978
51 clang             0x000000010b033db8
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2776
52 clang             0x000000010b02b3b7 cc1_main(char const**, char
const**, char const*, void*) + 5495
53 clang             0x000000010b030152 main + 706
54 clang             0x000000010b029e34 start + 52
55 clang             0x0000000000000047 start + 18446744069229863495
Stack dump:
0.	Program arguments:
/Volumes/storage/llvmbin/Release+Asserts/bin/clang -cc1 -triple
thumbv7-apple-ios1.0.0 -S -disable-free -main-file-name divsc3.c
-static-define -mrelocation-model static -fforbid-guard-variables
-target-abi apcs-gnu -target-cpu cortex-a8 -mfloat-abi soft
-target-feature +soft-float-abi -backend-option -arm-long-calls
-backend-option -arm-strict-align -backend-option
-arm-darwin-use-movt=0 -target-linker-version 126.3.2 -coverage-file
/var/folders/mb/c671t2cn7k385sks9twml1380000gn/T/divsc3-RmqY2g.s
-resource-dir /Volumes/storage/llvmbin/Release+Asserts/bin/../lib/clang/3.1
-isysroot /Volumes/storage/llvm/projects/compiler-rt/SDKs/darwin -D
VISIBILITY_HIDDEN -D KERNEL_USE -fmodule-cache-path
/var/folders/mb/c671t2cn7k385sks9twml1380000gn/T/clang-module-cache
-O3 -Wall -Werror -fno-dwarf2-cfi-asm -fno-dwarf-directory-asm
-fdebug-compilation-dir
/Volumes/storage/llvmbin/tools/clang/runtime/compiler-rt -ferror-limit
19 -fmessage-length 148 -fvisibility hidden -ffreestanding
-stack-protector 1 -mstackrealign -fno-builtin -fblocks
-fblocks-runtime-optional -fno-rtti -fno-use-cxa-atexit
-fsjlj-exceptions -fno-common -fdiagnostics-show-option
-fcolor-diagnostics -o
/var/folders/mb/c671t2cn7k385sks9twml1380000gn/T/divsc3-RmqY2g.s -x c
/Volumes/storage/llvm/projects/compiler-rt/lib/divsc3.c
1.	<eof> parser at end of file
2.	/Volumes/storage/llvm/projects/compiler-rt/lib/divsc3.c:21:1: LLVM
IR generation of declaration '__divsc3'
3.	/Volumes/storage/llvm/projects/compiler-rt/lib/divsc3.c:21:1:
Generating code for declaration '__divsc3'
4.	/Volumes/storage/llvm/projects/compiler-rt/lib/divsc3.c:22:1: LLVM
IR generation of compound statement ('{}')
5.	/Volumes/storage/llvm/projects/compiler-rt/lib/divsc3.c:36:5: LLVM
IR generation of compound statement ('{}')
6.	/Volumes/storage/llvm/projects/compiler-rt/lib/divsc3.c:38:9: LLVM
IR generation of compound statement ('{}')
clang: error: unable to execute command: Illegal instruction: 4
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.
clang: note: diagnostic msg: Preprocessed source(s) and associated run
script(s) are located at:
clang: note: diagnostic msg:
/var/folders/mb/c671t2cn7k385sks9twml1380000gn/T/divsc3-jR3kbs.i
clang: note: diagnostic msg:
/var/folders/mb/c671t2cn7k385sks9twml1380000gn/T/divsc3-jR3kbs.sh

-Eli
-------------- next part --------------
A non-text attachment was scrubbed...
Name: divsc3-jR3kbs.i
Type: application/octet-stream
Size: 6043 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120106/37dfc138/attachment.obj>


More information about the cfe-commits mailing list