<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - clang front-end crashes trying to codegen an fma when the mul has multiple uses"
href="https://llvm.org/bugs/show_bug.cgi?id=25719">25719</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang front-end crashes trying to codegen an fma when the mul has multiple uses
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>LLVM Codegen
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>spatel+llvm@rotateright.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>$ cat fpcontract.c
#pragma STDC FP_CONTRACT ON
float foo(float U, float base, float cell) {
return (U = 2 * base) - cell;
}
$ ./clang -ffp-contract=on fpcontract.c
Assertion failed: (LHSBinOp->getNumUses() == 0 && "Operations with multiple
uses shouldn't be contracted."), function tryEmitFMulAdd, file
/Users/spatel/myllvm/llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp, line 2570.
0 clang-3.8 0x00000001123ac4ae
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 46
1 clang-3.8 0x00000001123ac8f9
PrintStackTraceSignalHandler(void*) + 25
2 clang-3.8 0x00000001123a9099 llvm::sys::RunSignalHandlers() +
425
3 clang-3.8 0x00000001123acc59 SignalHandler(int) + 345
4 libsystem_platform.dylib 0x00007fff9cfac52a _sigtramp + 26
5 clang-3.8 0x000000011619c88d guard variable for
shouldAddRequirement(clang::Module*, llvm::StringRef, bool&)::IOKitAVC + 109101
6 clang-3.8 0x00000001123ac91b raise + 27
7 clang-3.8 0x00000001123ac9d2 abort + 18
8 clang-3.8 0x00000001123ac9b1 __assert_rtn + 129
9 clang-3.8 0x0000000112826ba9 tryEmitFMulAdd((anonymous
namespace)::BinOpInfo const&, clang::CodeGen::CodeGenFunction const&,
clang::CodeGen::CGBuilderTy&, bool) + 377
10 clang-3.8 0x000000011281153a (anonymous
namespace)::ScalarExprEmitter::EmitSub((anonymous namespace)::BinOpInfo const&)
+ 714
11 clang-3.8 0x0000000112814b75 (anonymous
namespace)::ScalarExprEmitter::VisitBinSub(clang::BinaryOperator const*) + 53
12 clang-3.8 0x0000000112812ef2
clang::StmtVisitorBase<clang::make_ptr, (anonymous
namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) + 290
13 clang-3.8 0x000000011280d029 (anonymous
namespace)::ScalarExprEmitter::Visit(clang::Expr*) + 73
14 clang-3.8 0x000000011280cf90
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) + 192
15 clang-3.8 0x00000001128e9b5f
clang::CodeGen::CodeGenFunction::EmitReturnStmt(clang::ReturnStmt const&) + 927
16 clang-3.8 0x00000001128e7771
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 993
17 clang-3.8 0x00000001128f4785
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot) + 133
18 clang-3.8 0x00000001129443a4
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&,
clang::Stmt const*) + 116
19 clang-3.8 0x0000000112944c4c
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 1900
20 clang-3.8 0x00000001129624a1
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) + 577
21 clang-3.8 0x000000011295c30d
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) + 733
22 clang-3.8 0x000000011296116c
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) + 1116
23 clang-3.8 0x0000000112964804
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) + 292
24 clang-3.8 0x0000000112accddd (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) + 157
25 clang-3.8 0x0000000112937d74
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) + 196
26 clang-3.8 0x0000000113d3b5e6 clang::ParseAST(clang::Sema&,
bool, bool) + 966
27 clang-3.8 0x0000000112e814bf
clang::ASTFrontendAction::ExecuteAction() + 511
28 clang-3.8 0x00000001129366b7
clang::CodeGenAction::ExecuteAction() + 5991
29 clang-3.8 0x0000000112e80a20 clang::FrontendAction::Execute()
+ 112
30 clang-3.8 0x0000000112dd4a91
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1873
31 clang-3.8 0x0000000112f0fc4a
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 4410
32 clang-3.8 0x000000010ff9261e cc1_main(llvm::ArrayRef<char
const*>, char const*, void*) + 4926
33 clang-3.8 0x000000010ff8219f
ExecuteCC1Tool(llvm::ArrayRef<char const*>, llvm::StringRef) + 479
34 clang-3.8 0x000000010ff7fcfd main + 3245
35 libdyld.dylib 0x00007fff88c5f5ad start + 1
36 libdyld.dylib 0x0000000000000030 start + 2000292484
Stack dump:
0. Program arguments: /Users/spatel/myllvm/build2/bin/clang-3.8 -cc1 -triple
x86_64-apple-macosx10.11.0 -Wdeprecated-objc-isa-usage
-Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free
-main-file-name fpcontract.c -mrelocation-model pic -pic-level 2 -mthread-model
posix -mdisable-fp-elim -ffp-contract=on -masm-verbose -munwind-tables
-target-cpu core2 -target-linker-version 253.6 -dwarf-column-info -resource-dir
/Users/spatel/myllvm/build2/bin/../lib/clang/3.8.0
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/
-fdebug-compilation-dir /Users/spatel/myllvm/build2/bin -ferror-limit 19
-fmessage-length 197 -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.11.0
-fencode-extended-block-signature -fmax-type-align=16 -fdiagnostics-show-option
-fcolor-diagnostics -o
/var/folders/wd/6v6_1gq16p1fbth_yn1pr41m0000gn/T/fpcontract-66e2d2.o -x c
fpcontract.c
1. <eof> parser at end of file
2. fpcontract.c:2:7: LLVM IR generation of declaration 'foo'
3. fpcontract.c:2:7: Generating code for declaration 'foo'
clang-3.8: error: unable to execute command: Illegal instruction: 4
clang-3.8: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.8.0 (trunk 254421)
Target: x86_64-apple-darwin15.0.0
Thread model: posix</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>