Bug 223048 - www/firefox: Clang 5.0 crashes during TEST=on build on aarch64
Summary: www/firefox: Clang 5.0 crashes during TEST=on build on aarch64
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: arm64 Any
: --- Affects Only Me
Assignee: Dimitry Andric
URL:
Keywords: needs-qa, regression
Depends on:
Blocks:
 
Reported: 2017-10-16 18:05 UTC by Jan Beich
Modified: 2017-10-24 06:51 UTC (History)
2 users (show)

See Also:


Attachments
mfbt/tests/TestLinkedList.cpp (preprocessed, compressed) (80.64 KB, application/x-xz)
2017-10-16 18:05 UTC, Jan Beich
no flags Details
command line args (for clang 5.0) (5.25 KB, text/plain)
2017-10-16 18:06 UTC, Jan Beich
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2017-10-16 18:05:17 UTC
Created attachment 187217 [details]
mfbt/tests/TestLinkedList.cpp (preprocessed, compressed)

$ pkg install autoconf213 gmake python27 binutils mercurial
$ hg clone https://hg.mozilla.org/mozilla-central
$ cd mozilla-central/js/src
$ autoconf-2.13
$ ./configure --disable-jemalloc
$ gmake
[...]
/usr/bin/clang++ -std=gnu++11 -o TestLinkedList.o -c -I/tmp/mozilla-central/js/src/dist/system_wrappers -include /tmp/mozilla-central/config/gcc_hidden.h -DNDEBUG=1 -DTRIMMED=1 -DIMPL_MFBT -I/tmp/mozilla-central/mfbt/tests -I/tmp/mozilla-central/js/src/mfbt/tests -I/tmp/mozilla-central/js/src/dist/include -I/tmp/mozilla-central/js/src/dist/include/testing  -fPIC  -DMOZILLA_CLIENT -include /tmp/mozilla-central/js/src/js/src/js-confdefs.h -MD -MP -MF .deps/TestLinkedList.o.pp -Qunused-arguments   -Qunused-arguments -Wall -Wc++11-compat -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wunreachable-code-return -Wwrite-strings -Wno-invalid-offsetof -Wclass-varargs -Wloop-analysis -Wc++11-compat-pedantic -Wc++14-compat -Wc++14-compat-pedantic -Wc++1z-compat -Wcomma -Wimplicit-fallthrough -Wstring-conversion -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wformat -Wno-gnu-zero-variadic-macro-arguments -Wformat-security -Wno-noexcept-type -Wno-unknown-warning-option -Wno-return-type-c-linkage -fno-rtti -fno-exceptions -fno-math-errno -pipe  -g -O -fno-omit-frame-pointer   -Wno-error=shadow   /tmp/mozilla-central/mfbt/tests/TestLinkedList.cpp
Assertion failed: (isReg() && "This is not a register operand!"), function getReg, file /tmp/12.0/contrib/llvm/include/llvm/CodeGen/MachineOperand.h, line 278.
clang++: error: unable to execute command: Abort trap
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
FreeBSD clang version 5.0.0 (tags/RELEASE_500/final 312559) (based on LLVM 5.0.0svn)
Target: aarch64-unknown-freebsd12.0
Thread model: posix
InstalledDir: /usr/bin
Comment 1 Jan Beich freebsd_committer freebsd_triage 2017-10-16 18:05:52 UTC
Clang 4.0 on 11.1-RELEASE appears to be unaffected.
Comment 2 Jan Beich freebsd_committer freebsd_triage 2017-10-16 18:06:36 UTC
Created attachment 187218 [details]
command line args (for clang 5.0)
Comment 3 Jan Beich freebsd_committer freebsd_triage 2017-10-16 18:24:48 UTC
Forgot to mention the intent. Until bug 221185 and bug 223009 are fixed building JS standalone is the only way to check www/firefox for regressions on aarch64.
Comment 4 Dimitry Andric freebsd_committer freebsd_triage 2017-10-17 06:54:52 UTC
I can reproduce this, and will reduce/bisect.
Comment 5 Dimitry Andric freebsd_committer freebsd_triage 2017-10-17 15:40:42 UTC
This regressed by the upstream commit https://reviews.llvm.org/rL308025, I reported a bug here: https://bugs.llvm.org/show_bug.cgi?id=34979
Comment 6 commit-hook freebsd_committer freebsd_triage 2017-10-21 19:15:12 UTC
A commit references this bug:

Author: dim
Date: Sat Oct 21 19:14:45 UTC 2017
New revision: 324826
URL: https://svnweb.freebsd.org/changeset/base/324826

Log:
  Pull in r316035 from upstream llvm trunk (by Tim Northover):

    AArch64: account for possible frame index operand in compares.

    If the address of a local is used in a comparison, AArch64 can fold
    the address-calculation into the comparison via "adds".
    Unfortunately, a couple of places (both hit in this one test) are not
    ready to deal with that yet and just assume the first source operand
    is a register.

  This should fix an assertion failure while building the test suite of
  www/firefox for AArch64.

  PR:		223048
  MFC after:	3 days

Changes:
  head/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
  head/contrib/llvm/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp
Comment 7 commit-hook freebsd_committer freebsd_triage 2017-10-24 06:49:57 UTC
A commit references this bug:

Author: dim
Date: Tue Oct 24 06:49:07 UTC 2017
New revision: 324946
URL: https://svnweb.freebsd.org/changeset/base/324946

Log:
  MFC r324826:

  Pull in r316035 from upstream llvm trunk (by Tim Northover):

    AArch64: account for possible frame index operand in compares.

    If the address of a local is used in a comparison, AArch64 can fold
    the address-calculation into the comparison via "adds".
    Unfortunately, a couple of places (both hit in this one test) are not
    ready to deal with that yet and just assume the first source operand
    is a register.

  This should fix an assertion failure while building the test suite of
  www/firefox for AArch64.

  PR:		223048

Changes:
_U  stable/11/
  stable/11/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
  stable/11/contrib/llvm/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp