Bug 196987 - clang failure report for build of devel/radare2
Summary: clang failure report for build of devel/radare2
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: CURRENT
Hardware: arm Any
: --- Affects Some People
Assignee: freebsd-arm (Nobody)
URL: http://chips.ysv.freebsd.org/data/11a...
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-22 02:11 UTC by Sean Bruno
Modified: 2015-02-22 15:57 UTC (History)
1 user (show)

See Also:


Attachments
json source file in c and shell script to compile it. Probably have to change to /usr/bin/cc instead of /nxb-bin/usr/bin/cc to generate failure. (175.50 KB, application/x-tar)
2015-01-22 02:11 UTC, Sean Bruno
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Bruno freebsd_committer freebsd_triage 2015-01-22 02:11:39 UTC
Created attachment 151996 [details]
json source file in c and shell script to compile it.  Probably have to change to /usr/bin/cc instead of /nxb-bin/usr/bin/cc to generate failure.

Using the base system clang 3.5 on head, the following port will crash clang:

Stack dump:
0.	Program arguments: /nxb-bin/usr/bin/cc -cc1 -triple armv6--freebsd11.0-gnueabi -emit-obj -disable-free -main-file-name json.c -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -relaxed-aliasing -masm-verbose -mconstructor-aliases -target-cpu arm1176jzf-s -target-feature +soft-float -target-feature +soft-float-abi -target-feature -neon -target-feature -crypto -target-abi aapcs-linux -msoft-float -mfloat-abi soft -gdwarf-2 -dwarf-column-info -coverage-file /wrkdirs/usr/ports/devel/radare2/work/radare2-0.9.6/shlr/sdb/src/json.o -resource-dir /nxb-bin/usr/bin/../lib/clang/3.5.0 -dependency-file json.d -MT json.o -sys-header-deps -D _POSIX_C_SOURCE=200809L -D _XOPEN_SOURCE=700 -D _POSIX_C_SOURCE=200809L -D _XOPEN_SOURCE=700 -O2 -Wall -Wall -fdebug-compilation-dir /wrkdirs/usr/ports/devel/radare2/work/radare2-0.9.6/shlr/sdb/src -ferror-limit 19 -fmessage-length 0 -fvisibility hidden -mstackrealign -fno-signed-char -fobjc-runtime=gnustep -fdiagnostics-show-option -vectorize-loops -vectorize-slp -o json.o -x c json.c 
1.	<eof> parser at end of file
2.	Per-module optimization passes
3.	Running pass 'CallGraph Pass Manager' on module 'json.c'.
4.	Running pass 'Loop Pass Manager' on function '@js0n'
5.	Running pass 'Rotate Loops' on basic block '%for.cond'
cc: error: unable to execute command: Abort trap (core dumped)
cc: error: clang frontend command failed due to signal (use -v to see invocation)
FreeBSD clang version 3.5.0 (tags/RELEASE_350/final 216957) 20141124
Target: armv6--freebsd11.0-gnueabi
Thread model: posix
cc: note: diagnostic msg: PLEASE submit a bug report to https://bugs.freebsd.org/submit/ and include the crash backtrace, preprocessed source, and associated run script.
cc: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
cc: note: diagnostic msg: /tmp/json-3ed7b4.c
cc: note: diagnostic msg: /tmp/json-3ed7b4.sh
cc: note: diagnostic msg: 

********************
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2015-01-22 07:01:15 UTC
If this also had an assertion failure of the form:

Assertion failed: (!isa<IndirectBrInst>(TI) && "Cannot split critical edge from IndirectBrInst"), function SplitCriticalEdge, file contrib/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp, line 148.

then it is the same failure as reported in bug 195480, see the log here:

http://pb2.nyi.freebsd.org/data/head-amd64-PR195480-default/2014-12-12_23h17m02s/logs/errors/radare2-0.9.6.log

This bug still reproduced with clang trunk, so there is no fix for it yet.  I reported it upstream here:

http://llvm.org/PR21968

but no solution has come up yet.  I will try another upstream poke.
Comment 2 commit-hook freebsd_committer freebsd_triage 2015-02-22 15:52:11 UTC
A commit references this bug:

Author: dim
Date: Sun Feb 22 15:51:50 UTC 2015
New revision: 279161
URL: https://svnweb.freebsd.org/changeset/base/279161

Log:
  Pull in r230058 from upstream llvm trunk (by Benjamin Kramer):

    LoopRotate: When reconstructing loop simplify form don't split edges
    from indirectbrs.

    Yet another chapter in the endless story. While this looks like we
    leave the loop in a non-canonical state this replicates the logic in
    LoopSimplify so it doesn't diverge from the canonical form in any way.

    http://llvm.org/PR21968

  This fixes a "Cannot split critical edge from IndirectBrInst" assertion
  failure when building the devel/radare2 port.

  PR:		195480, 196987
  MFC after:	3 days

Changes:
  head/contrib/llvm/lib/Transforms/Scalar/LoopRotation.cpp
Comment 3 Dimitry Andric freebsd_committer freebsd_triage 2015-02-22 15:57:31 UTC
Fixed in r279161.