[llvm-bugs] [Bug 45430] New: ppc_fp128 math causes: Assertion failed: (!carry), function addOrSubtractSignificand

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Apr 4 14:04:03 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=45430

            Bug ID: 45430
           Summary: ppc_fp128 math causes: Assertion failed: (!carry),
                    function addOrSubtractSignificand
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Core LLVM classes
          Assignee: unassignedbugs at nondot.org
          Reporter: florian_hahn at apple.com
                CC: llvm-bugs at lists.llvm.org

The code below causes LLVM to crash when running opt -instcombine with the
trace below

define ppc_fp128 @bitcast_bitcast_s_s_s() {
  %B2 = fadd ppc_fp128 0xM00000000000000010000000000000000,
0xM00000000000000010000000000000000
  %B16 = fmul ppc_fp128 %B2, 0xM7FEFFFFFFFFFFFFF7C8FFFFFFFFFFFFE
  %B10 = fadd ppc_fp128 %B2, 0xM00000000000000010000000000000000
  %B27 = fdiv ppc_fp128 %B10, %B16
  %B11 = fadd ppc_fp128 %B27, %B2
  %B1 = fdiv ppc_fp128 %B2, 0xM00000000000000010000000000000000
  %B14 = fdiv ppc_fp128 %B11, %B16
  %B4 = fdiv ppc_fp128 %B2, %B1
  %B12 = fsub ppc_fp128 0xM00000000000000000000000000000000, %B14
  %B8 = fsub ppc_fp128 0xM00000000000000000000000000000000, %B12
  %B6 = frem ppc_fp128 %B1, %B12
  %B18 = fsub ppc_fp128 0xM00000000000000000000000000000000, %B6
  %B9 = frem ppc_fp128 %B8, %B18
  %B22 = fdiv ppc_fp128 %B4, %B9
  %B5 = fmul ppc_fp128 %B22, %B9
  ret ppc_fp128 %B5
}

Assertion failed: (!carry), function addOrSubtractSignificand, file
llvm-project/llvm/lib/Support/APFloat.cpp, line 1540.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace.
Stack dump:
0.      Program arguments: bin/opt -instcombine bugpoint-reduced-simplified.ll
1.      Running pass 'Function Pass Manager' on module
'bugpoint-reduced-simplified.ll'.
2.      Running pass 'Combine redundant instructions' on function
'@bitcast_bitcast_s_s_s'
0  opt                      0x000000010b2c2b35
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  opt                      0x000000010b2c1948 llvm::sys::RunSignalHandlers() +
248
2  opt                      0x000000010b2c3126 SignalHandler(int) + 262
3  libsystem_platform.dylib 0x00007fff6e0d85fd _sigtramp + 29
4  libsystem_platform.dylib 000000000000000000 _sigtramp + 18446603338669783584
5  libsystem_c.dylib        0x00007fff6dfae808 abort + 120
6  libsystem_c.dylib        0x00007fff6dfadac6 err + 0
7  opt                      0x000000010c545be3
llvm::detail::IEEEFloat::addOrSubtractSignificand(llvm::detail::IEEEFloat
const&, bool) (.cold.3) + 35
8  opt                      0x000000010b1d1c90
llvm::detail::IEEEFloat::addOrSubtractSignificand(llvm::detail::IEEEFloat
const&, bool) + 1296
9  opt                      0x000000010b1d117d
llvm::detail::IEEEFloat::multiplySignificand(llvm::detail::IEEEFloat const&,
llvm::detail::IEEEFloat) + 589
10 opt                      0x000000010b1d3a66
llvm::detail::IEEEFloat::fusedMultiplyAdd(llvm::detail::IEEEFloat const&,
llvm::detail::IEEEFloat const&, llvm::APFloatBase::roundingMode) + 166
11 opt                      0x000000010b1dc714
llvm::detail::DoubleAPFloat::multiply(llvm::detail::DoubleAPFloat const&,
llvm::APFloatBase::roundingMode) + 916
12 opt                      0x000000010aa899ef
llvm::ConstantFoldBinaryInstruction(unsigned int, llvm::Constant*,
llvm::Constant*) + 5567
13 opt                      0x000000010aaa9bd7 llvm::ConstantExpr::get(unsigned
int, llvm::Constant*, llvm::Constant*, unsigned int, llvm::Type*) + 231
14 opt                      0x000000010a40d59e
llvm::ConstantFoldBinaryOpOperands(unsigned int, llvm::Constant*,
llvm::Constant*, llvm::DataLayout const&) + 1182
15 opt                      0x000000010a40b088
llvm::ConstantFoldInstruction(llvm::Instruction*, llvm::DataLayout const&,
llvm::TargetLibraryInfo const*) + 1224
16 opt                      0x000000010ad57323
combineInstructionsOverFunction(llvm::Function&, llvm::InstCombineWorklist&,
llvm::AAResults*, llvm::AssumptionCache&, llvm::TargetLibraryInfo&,
llvm::DominatorTree&, llvm::OptimizationRemarkEmitter&,
llvm::BlockFrequencyInfo*, llvm::ProfileSummaryInfo*, unsigned int,
llvm::LoopInfo*) + 1699
17 opt                      0x000000010ad58831
llvm::InstructionCombiningPass::runOnFunction(llvm::Function&) + 913
18 opt                      0x000000010ab5a723
llvm::FPPassManager::runOnFunction(llvm::Function&) + 1091
19 opt                      0x000000010ab5a9e8
llvm::FPPassManager::runOnModule(llvm::Module&) + 72
20 opt                      0x000000010ab5aec2
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 994
21 opt                      0x00000001093a7408 main + 10696
22 libdyld.dylib            0x00007fff6dedfcc9 start + 1
[1]    53415 abort      bin/opt -instcombine bugpoint-reduced-simplified.ll

Found by https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20034#c1

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200404/f203d140/attachment.html>


More information about the llvm-bugs mailing list