Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

clang self-hosting failure: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:5428:7 signed integer overflow #32604

Open Quuxplusone opened 7 years ago

Quuxplusone commented 7 years ago
Bugzilla Link PR33632
Status NEW
Importance P enhancement
Reported by Roman Lebedev (lebedev.ri@gmail.com)
Reported on 2017-06-28 12:53:07 -0700
Last modified on 2017-06-28 13:13:30 -0700
Version unspecified
Hardware PC Linux
CC llvm-bugs@lists.llvm.org, vsk@apple.com
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
Hi.
When trying to build clang stage 2 by freshly-built clang stage 1 (built by
fresh clang snapshot from apt.llvm.org), the build fails:

$ ninja -j1 -v
[1/2862] /build/llvm-build-Clang-release/bin/clang++  -DGTEST_HAS_RTTI=0 -
DLLVM_BUILD_GLOBAL_ISEL -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -
D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Target/AMDGPU/MCTargetDesc -
I/build/llvm/lib/Target/AMDGPU/MCTargetDesc -I/build/llvm/lib/Target/AMDGPU -
Ilib/Target/AMDGPU -Iinclude -I/build/llvm/include -fPIC -fvisibility-inlines-
hidden -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-
strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -
Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-
conversion -fcolor-diagnostics -ffunction-sections -fdata-sections -O3    -
UNDEBUG  -fno-exceptions -fno-rtti -MD -MT
lib/Target/AMDGPU/MCTargetDesc/CMakeFiles/LLVMAMDGPUDesc.dir/SIMCCodeEmitter.cpp.o
-MF
lib/Target/AMDGPU/MCTargetDesc/CMakeFiles/LLVMAMDGPUDesc.dir/SIMCCodeEmitter.cpp.o.d
-o
lib/Target/AMDGPU/MCTargetDesc/CMakeFiles/LLVMAMDGPUDesc.dir/SIMCCodeEmitter.cpp.o
-c /build/llvm/lib/Target/AMDGPU/MCTargetDesc/SIMCCodeEmitter.cpp
FAILED:
lib/Target/AMDGPU/MCTargetDesc/CMakeFiles/LLVMAMDGPUDesc.dir/SIMCCodeEmitter.cpp.o
/build/llvm-build-Clang-release/bin/clang++  -DGTEST_HAS_RTTI=0 -
DLLVM_BUILD_GLOBAL_ISEL -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -
D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Target/AMDGPU/MCTargetDesc -
I/build/llvm/lib/Target/AMDGPU/MCTargetDesc -I/build/llvm/lib/Target/AMDGPU -
Ilib/Target/AMDGPU -Iinclude -I/build/llvm/include -fPIC -fvisibility-inlines-
hidden -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-
strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -
Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-
conversion -fcolor-diagnostics -ffunction-sections -fdata-sections -O3    -
UNDEBUG  -fno-exceptions -fno-rtti -MD -MT
lib/Target/AMDGPU/MCTargetDesc/CMakeFiles/LLVMAMDGPUDesc.dir/SIMCCodeEmitter.cpp.o
-MF
lib/Target/AMDGPU/MCTargetDesc/CMakeFiles/LLVMAMDGPUDesc.dir/SIMCCodeEmitter.cpp.o.d
-o
lib/Target/AMDGPU/MCTargetDesc/CMakeFiles/LLVMAMDGPUDesc.dir/SIMCCodeEmitter.cpp.o
-c /build/llvm/lib/Target/AMDGPU/MCTargetDesc/SIMCCodeEmitter.cpp
/build/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:5428:7: runtime error: signed
integer overflow: 4602678819172646912 - -4620693217682128896 cannot be
represented in type 'long'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
/build/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:5428:7 in
ninja: build stopped: subcommand failed.

Configure command: (autogenerated by qtcreator)
stage1:
/usr/bin/cmake /build/llvm '-GCodeBlocks - Ninja' -
DCMAKE_BUILD_TYPE:STRING=Release -
DCMAKE_CXX_COMPILER:STRING=/usr/local/bin/clang++ -
DCMAKE_C_COMPILER:STRING=/usr/local/bin/clang -DLLVM_ENABLE_ASSERTIONS:BOOL=ON
'-DLLVM_ENABLE_PROJECTS:STRING=clang;libcxx;libcxxabi;compiler-
rt;lld;polly;openmp' '-DLLVM_USE_SANITIZER:STRING=Address;Undefined'

stage2:
/usr/bin/cmake /build/llvm '-GCodeBlocks - Ninja' -
DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_CXX_COMPILER:STRING=/build/llvm-build-
Clang-release/bin/clang++ -DCMAKE_C_COMPILER:STRING=/build/llvm-build-Clang-
release/bin/clang '-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}' -
DLLVM_ENABLE_ASSERTIONS:BOOL=ON '-
DLLVM_ENABLE_PROJECTS:STRING=clang;libcxx;libcxxabi;compiler-
rt;lld;polly;openmp' -DLLVM_USE_SANITIZER:STRING= -DQT_QMAKE_EXECUTABLE:STRING=
Quuxplusone commented 7 years ago
BTW git log points to:
16e549f1c04f (James Molloy            2016-08-01 07:45:11 +0000 5428)     V -=
Base;

commit 16e549f1c04f22118aee910f4ca604ded25bcc72
Author: James Molloy <james.molloy@arm.com>
Date:   Mon Aug 1 07:45:11 2016 +0000

    [SimplifyCFG] Range reduce switches