[llvm-bugs] [Bug 50960] New: ICE on valid code with -O1: llvm::APFloat::convertToDouble() const: Assertion `getSemantics().isRepresentableBy(semIEEEdouble) && "Float semantics is not representable by IEEEdouble"' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jul 1 15:45:28 PDT 2021


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

            Bug ID: 50960
           Summary: ICE on valid code with -O1:
                    llvm::APFloat::convertToDouble() const: Assertion
                    `getSemantics().isRepresentableBy(semIEEEdouble) &&
                    "Float semantics is not representable by IEEEdouble"'
                    failed.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: cnsun at uwaterloo.ca
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

`clang-trunk -O0` can compile the code successfully. 

$ clang-trunk -v
clang version 13.0.0 (https://github.com/llvm/llvm-project.git
4aa1c141bd674564aaee83516b7e338aa3aae9e3)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/cnsun/usr/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64

$ cat mutant.c
double sin(long double) { sin(1.0); }

$ clang-trunk -w -O1 mutant.c
clang-13:
/tmp/tmp.M5Z1vtu79t-clang-builder/llvm-project/llvm/lib/Support/APFloat.cpp:4888:
double llvm::APFloat::convertToDouble() const: Assertion
`getSemantics().isRepresentableBy(semIEEEdouble) && "Float semantics is not
representable by IEEEdouble"' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /scratch/software/clang-trunk/bin/clang-13 -cc1
-triple x86_64-unknown-linux-gnu -emit-obj --mrelax-relocations -disable-free
-main-file-name mutant.c -mrelocation-model static -mframe-pointer=none
-fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables
-target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb
-fcoverage-compilation-dir=/scratch/cnsun/workspace/perses-fuzzer/default_c_finding_folder/crash_20210701_113317_12d2/delta/perses_result
-resource-dir /scratch/software/clang-trunk/lib/clang/13.0.0 -c-isystem .
-c-isystem /usr/local/include/cmsith -internal-isystem
/scratch/software/clang-trunk/lib/clang/13.0.0/include -internal-isystem
/usr/local/include -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O1
-w
-fdebug-compilation-dir=/scratch/cnsun/workspace/perses-fuzzer/default_c_finding_folder/crash_20210701_113317_12d2/delta/perses_result
-ferror-limit 19 -fgnuc-version=4.2.1 -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1
-o /tmp/mutant-25a8e9.o -x c mutant.c
1.      <eof> parser at end of file
2.      Optimizer
 #0 0x00005607c54b7264 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x00005607c54b4a1e SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f1e5a0453c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #3 0x00007f1e59ae418b raise
/build/glibc-ZN95T4/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #4 0x00007f1e59ac3859 abort /build/glibc-ZN95T4/glibc-2.31/stdlib/abort.c:81:7
 #5 0x00007f1e59ac3729 get_sysdep_segment_value
/build/glibc-ZN95T4/glibc-2.31/intl/loadmsgcat.c:509:8
 #6 0x00007f1e59ac3729 _nl_load_domain
/build/glibc-ZN95T4/glibc-2.31/intl/loadmsgcat.c:970:34
 #7 0x00007f1e59ad4f36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
 #8 0x00005607c53d166f llvm::APFloat::convertToDouble() const
(/scratch/software/clang-trunk/bin/clang-13+0x38a866f)
 #9 0x00005607c42dbd33 (anonymous namespace)::ConstantFoldFP(double
(*)(double), llvm::APFloat const&, llvm::Type*) ConstantFolding.cpp:0:0
#10 0x00005607c42e4305 (anonymous
namespace)::ConstantFoldScalarCall1(llvm::StringRef, unsigned int, llvm::Type*,
llvm::ArrayRef<llvm::Constant*>, llvm::TargetLibraryInfo const*, llvm::CallBase
const*) ConstantFolding.cpp:0:0
#11 0x00005607c42eb269 llvm::ConstantFoldCall(llvm::CallBase const*,
llvm::Function*, llvm::ArrayRef<llvm::Constant*>, llvm::TargetLibraryInfo
const*) (/scratch/software/clang-trunk/bin/clang-13+0x27c2269)
#12 0x00005607c4346066 llvm::SimplifyCall(llvm::CallBase*, llvm::SimplifyQuery
const&) (/scratch/software/clang-trunk/bin/clang-13+0x281d066)
#13 0x00005607c434c25d llvm::SimplifyInstruction(llvm::Instruction*,
llvm::SimplifyQuery const&, llvm::OptimizationRemarkEmitter*)
(/scratch/software/clang-trunk/bin/clang-13+0x282325d)
#14 0x00005607c515736c (anonymous
namespace)::EarlyCSE::processNode(llvm::DomTreeNodeBase<llvm::BasicBlock>*)
EarlyCSE.cpp:0:0
#15 0x00005607c5158dd4 (anonymous namespace)::EarlyCSE::run() EarlyCSE.cpp:0:0
#16 0x00005607c5159e23 llvm::EarlyCSEPass::run(llvm::Function&,
llvm::AnalysisManager<llvm::Function>&)
(/scratch/software/clang-trunk/bin/clang-13+0x3630e23)
#17 0x00005607c57de296 llvm::detail::PassModel<llvm::Function,
llvm::EarlyCSEPass, llvm::PreservedAnalyses,
llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&,
llvm::AnalysisManager<llvm::Function>&)
(/scratch/software/clang-trunk/bin/clang-13+0x3cb5296)
#18 0x00005607c4bee6f6 llvm::PassManager<llvm::Function,
llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&,
llvm::AnalysisManager<llvm::Function>&)
(/scratch/software/clang-trunk/bin/clang-13+0x30c56f6)
#19 0x00005607c306a7b6 llvm::detail::PassModel<llvm::Function,
llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >,
llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>
>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&)
(/scratch/software/clang-trunk/bin/clang-13+0x15417b6)
#20 0x00005607c4bed219 llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
(/scratch/software/clang-trunk/bin/clang-13+0x30c4219)
#21 0x00005607c306b026 llvm::detail::PassModel<llvm::Module,
llvm::ModuleToFunctionPassAdaptor, llvm::PreservedAnalyses,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
(/scratch/software/clang-trunk/bin/clang-13+0x1542026)
#22 0x00005607c4beaaff llvm::PassManager<llvm::Module,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
(/scratch/software/clang-trunk/bin/clang-13+0x30c1aff)
#23 0x00005607c57ee11d (anonymous
namespace)::EmitAssemblyHelper::EmitAssemblyWithNewPassManager(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >) BackendUtil.cpp:0:0
#24 0x00005607c57f139d clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef,
llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/scratch/software/clang-trunk/bin/clang-13+0x3cc839d)
#25 0x00005607c6624dbf
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/scratch/software/clang-trunk/bin/clang-13+0x4afbdbf)
#26 0x00005607c76dc6f9 clang::ParseAST(clang::Sema&, bool, bool)
(/scratch/software/clang-trunk/bin/clang-13+0x5bb36f9)
#27 0x00005607c6623908 clang::CodeGenAction::ExecuteAction()
(/scratch/software/clang-trunk/bin/clang-13+0x4afa908)
#28 0x00005607c5ec9d99 clang::FrontendAction::Execute()
(/scratch/software/clang-trunk/bin/clang-13+0x43a0d99)
#29 0x00005607c5e5cdb6
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/scratch/software/clang-trunk/bin/clang-13+0x4333db6)
#30 0x00005607c5fa7a80
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/scratch/software/clang-trunk/bin/clang-13+0x447ea80)
#31 0x00005607c2da0946 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/scratch/software/clang-trunk/bin/clang-13+0x1277946)
#32 0x00005607c2d9cc88 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
driver.cpp:0:0
#33 0x00005607c2cca0d6 main
(/scratch/software/clang-trunk/bin/clang-13+0x11a10d6)
#34 0x00007f1e59ac50b3 __libc_start_main
/build/glibc-ZN95T4/glibc-2.31/csu/../csu/libc-start.c:342:3
#35 0x00005607c2d9c7fe _start
(/scratch/software/clang-trunk/bin/clang-13+0x12737fe)
clang-13: error: unable to execute command: Aborted (core dumped)
clang-13: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 13.0.0 (https://github.com/llvm/llvm-project.git
4aa1c141bd674564aaee83516b7e338aa3aae9e3)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/cnsun/usr/bin
clang-13: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-13: note: diagnostic msg: /tmp/mutant-2b7809.c
clang-13: note: diagnostic msg: /tmp/mutant-2b7809.sh
clang-13: note: diagnostic msg:

********************

-- 
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/20210701/e06fab03/attachment-0001.html>


More information about the llvm-bugs mailing list