Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

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

Closed Quuxplusone closed 8 years ago

Quuxplusone commented 9 years ago
Bugzilla Link PR25339
Status RESOLVED FIXED
Importance P normal
Reported by Stephen Hines (srhines@google.com)
Reported on 2015-10-28 15:09:22 -0700
Last modified on 2016-02-24 06:00:44 -0800
Version trunk
Hardware PC Linux
CC arnaud.degrandmaison@arm.com, chh@google.com, danalbert@google.com, jsweval@arxan.com, kristof.beyls@arm.com, kristof.beyls@gmail.com, llvm-bugs@lists.llvm.org, pirama@google.com, rengolin@gmail.com, srhines@google.com, weimingz@codeaurora.org
Fixed by commit(s)
Attachments intrinsics_arm64-41d346.sh (11387 bytes, application/x-shellscript)
constant_island_bug.tar.gz (1012447 bytes, application/gzip)
test.ll.bz2 (75949 bytes, application/octet-stream)
constant-island2.ll (89403 bytes, application/octet-stream)
Blocks PR21420
Blocked by
See also
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:
Quuxplusone commented 9 years ago

Attached intrinsics_arm64-41d346.sh (11387 bytes, application/x-shellscript): shell script to trigger breakage (replace clang with TOT clang)

Quuxplusone commented 9 years ago

Attached constant_island_bug.tar.gz (1012447 bytes, application/gzip): zipped version of .cpp and .sh

Quuxplusone 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:
 - the shell script uses "-g", which is rejected by ToT "clang -cc1",
 - removing the "-g" option, the preprocessed cpp file compiles just fine with a Release+Assert or Debug+Asssert compiler
Quuxplusone 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
Quuxplusone 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.
Quuxplusone commented 8 years ago

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

Quuxplusone commented 8 years ago

Attached test.ll.bz2 (75949 bytes, application/octet-stream): Test case

Quuxplusone commented 8 years ago

Attached constant-island2.ll (89403 bytes, application/octet-stream): another test case

Quuxplusone commented 8 years ago

Fixed in 261665.