llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.82k stars 11.91k forks source link

Clang breaks ART build with "Constant Island pass failed to converge!" #25713

Closed stephenhines closed 8 years ago

stephenhines commented 9 years ago
Bugzilla Link 25339
Resolution FIXED
Resolved on Feb 24, 2016 06:00
Version trunk
OS Linux
Blocks llvm/llvm-project#21794
Attachments shell script to trigger breakage (replace clang with TOT clang), zipped version of .cpp and .sh
CC @Arnaud-de-Grandmaison-ARM,@kbeyls,@kbeyls,@pirama-arumuga-nainar,@rengolin,@stephenhines

Extended Description

With a recent TOT Clang, we noticed the following internal error in the ARM backend.

FAILED: /bin/bash -c "(true) && (mkdir -p out/target/product/bullhead/obj_arm/SHARED_LIBRARIES/libart-compiler_intermediates/optimizing/) && (PWD=/proc/self/cwd prebuilts/clang/host/linux-x86/3.8/bin/clang++ -I external/gtest/include -I external/icu/icu4c/source/common -I external/valgrind/include -I external/valgrind -I external/vixl/src -I external/zlib -I bionic/libc/private -I art/runtime -I art/disassembler -I art/compiler -I out/target/product/bullhead/obj_arm/SHARED_LIBRARIES/libart-compiler_intermediates -I out/target/product/bullhead/gen/SHARED_LIBRARIES/libart-compiler_intermediates -I libnativehelper/include/nativehelper \$(cat out/target/product/bullhead/obj_arm/SHARED_LIBRARIES/libart-compiler_intermediates/import_includes) -isystem system/core/include -isystem system/media/audio/include -isystem hardware/libhardware/include -isystem hardware/libhardware_legacy/include -isystem hardware/ril/include -isystem libnativehelper/include -isystem frameworks/native/include -isystem frameworks/native/opengl/include -isystem frameworks/av/include -isystem frameworks/base/include -isystem out/target/product/bullhead/obj/include -isystem device/lge/bullhead/kernel-headers -isystem hardware/qcom/msm8994/kernel-headers -isystem bionic/libc/arch-arm/include -isystem bionic/libc/include -isystem bionic/libc/kernel/uapi -isystem bionic/libc/kernel/common -isystem bionic/libc/kernel/uapi/asm-arm -isystem bionic/libm/include -isystem bionic/libm/include/arm -c -fno-exceptions -Wno-multichar -msoft-float -ffunction-sections -fdata-sections -funwind-tables -fstack-protector -Werror=format-security -D_FORTIFY_SOURCE=2 -fno-short-enums -no-canonical-prefixes -mcpu=cortex-a7 -mfloat-abi=softfp -mfpu=neon -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -DNDEBUG -g -Wstrict-aliasing=2 -DNDEBUG -UDEBUG -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -nostdlibinc -target arm-linux-androideabi -target arm-linux-androideabi -Bprebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/arm-linux-androideabi/bin -fvisibility-inlines-hidden -Wsign-promo -Wno-inconsistent-missing-override -nostdlibinc -target arm-linux-androideabi -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -fno-rtti -fno-rtti -std=gnu++11 -ggdb3 -Wall -Werror -Wextra -Wstrict-aliasing -fstrict-aliasing -Wunreachable-code -Wredundant-decls -Wshadow -Wunused -fvisibility=protected -DART_DEFAULT_GC_TYPE_IS_CMS -DIMT_SIZE=64 -DART_TARGET -DART_BASE_ADDRESS=0x70000000 -DART_ENABLE_CODEGEN_arm -DART_ENABLE_CODEGEN_arm64 -DART_ENABLE_CODEGEN_mips -DART_ENABLE_CODEGEN_mips64 -DART_ENABLE_CODEGEN_x86 -DART_ENABLE_CODEGEN_x86_64 -DART_BASE_ADDRESS_MIN_DELTA=-0x1000000 -DART_BASE_ADDRESS_MAX_DELTA=0x1000000 -O3 -Wframe-larger-than=1728 -fPIC -D_USING_LIBCXX -Wthread-safety -Wthread-safety-negative -Wimplicit-fallthrough -Wfloat-equal -Wint-to-void-pointer-cast -Wused-but-marked-unused -Wdeprecated -Wunreachable-code-break -Wunreachable-code-return -Wmissing-noreturn -std=gnu++14 -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=null-dereference -Werror=return-type -MD -MF out/target/product/bullhead/obj_arm/SHARED_LIBRARIES/libart-compiler_intermediates/optimizing/intrinsics_arm64.d -o out/target/product/bullhead/obj_arm/SHARED_LIBRARIES/libart-compiler_intermediates/optimizing/intrinsics_arm64.o art/compiler/optimizing/intrinsics_arm64.cc) && (cp out/target/product/bullhead/obj_arm/SHARED_LIBRARIES/libart-compiler_intermediates/optimizing/intrinsics_arm64.d out/target/product/bullhead/obj_arm/SHARED_LIBRARIES/libart-compiler_intermediates/optimizing/intrinsics_arm64.P; sed -e 's/#.//' -e 's/^[^:]: //' -e 's/ \\\$//' -e '/^\$/ d' -e 's/\$/ :/' < out/target/product/bullhead/obj_arm/SHARED_LIBRARIES/libart-compiler_intermediates/optimizing/intrinsics_arm64.d >> out/target/product/bullhead/obj_arm/SHARED_LIBRARIES/libart-compiler_intermediates/optimizing/intrinsics_arm64.P)" fatal error: error in backend: Constant Island pass failed to converge! clang++: error: clang frontend command failed with exit code 70 (use -v to see invocation) clang version 3.8.243773 Target: arm--linux-android Thread model: posix clang++: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script. clang++: note: diagnostic msg:


PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang++: note: diagnostic msg: /buildbot/tmp/intrinsics_arm64-a807fb.cpp clang++: note: diagnostic msg: /buildbot/tmp/intrinsics_arm64-a807fb.sh clang++: note: diagnostic msg:

rengolin commented 8 years ago

Fixed in 261665.

llvmbot commented 8 years ago

another test case To run:

llc -O3 -relocation-model=pic

It may not reproducible on community's llc because it converges at 28th or 29th iteration. But on our backend modified modified scheduling model, we can see it will converge on around 35th iteration.

llvmbot commented 8 years ago

Test case Run: llc -O3 -relocation-model=pic < test.ll

rengolin commented 8 years ago

Being worked on by Weiming: http://reviews.llvm.org/D16890

llvmbot commented 8 years ago

I encounter this issue when compiling a proprietary code. The code has a huge switch-case, and each case statement accesses a unique constant (string literal). What happens is after some CPE is moved to a lower address, the disp between other users to their CPEs are enlarged. After 10 minutes compiling, it reached the max iteration of 30.

llvmbot commented 9 years ago

I replace -g with -debug-info-kind=limited, and tried both Release+Asserts and Debug+Asserts and still cannot reproduce the crash. My LLVM is on r215867

Arnaud-de-Grandmaison-ARM commented 9 years ago

I replaced the clang binary path in the shell script with a ToT @ 251785, and I'm unable to reproduce the crash: