Bug 225471 - emulators/snes9x: clang crashes during build
Summary: emulators/snes9x: clang crashes during build
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Dimitry Andric
URL:
Keywords: toolchain
Depends on:
Blocks: 219139
  Show dependency treegraph
 
Reported: 2018-01-26 17:38 UTC by Jan Beich
Modified: 2018-10-31 18:49 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (acm)


Attachments
fxemu.cpp (compressed, preprocessed) (50.28 KB, application/x-xz)
2018-01-26 17:38 UTC, Jan Beich
no flags Details
command line args (for clang 6.0) (4.24 KB, text/plain)
2018-01-26 17:39 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 2018-01-26 17:38:44 UTC
Created attachment 190085 [details]
fxemu.cpp (compressed, preprocessed)

$ echo CPUTYPE?=haswell >>/etc/make.conf
$ cd emulators/snes9x
$ make
[...]
c++  -fno-rtti -I/wrkdirs/usr/ports/emulators/snes9x/work/snes9x-1.51-src/unzip -I/wrkdirs/usr/ports/emulators/snes9x/work/snes9x-1.51-src -I/usr/local/include -c -O2 -pipe -march=haswell -fstack-protector -fno-strict-aliasing   -I/wrkdirs/usr/ports/emulators/snes9x/work/snes9x-1.51-src/unzip -I/wrkdirs/usr/ports/emulators/snes9x/work/snes9x-1.51-src -I/usr/local/include -DMITSHM -DCPU_SHUTDOWN -DSPC700_SHUTDOWN   -DUSE_THREADS -DSPC700_C -DNETPLAY_SUPPORT -DUNZIP_SUPPORT -DJMA_SUPPORT     -DSDD1_DECOMP -DCORRECT_VRAM_READS -DJOYSTICK_SUPPORT -DNO_INLINE_SET_GET  -DNOASM -DNEW_COLOUR_BLENDING -DZLIB -DHAVE_LIBPNG -DHAVE_MKSTEMP -DHAVE_STRINGS_H -DHAVE_SYS_IOCTL_H -DHAVE_STDINT_H -DPTR_NOT_INT -DRIGHTSHIFT_int8_IS_SAR -DRIGHTSHIFT_int16_IS_SAR -DRIGHTSHIFT_int32_IS_SAR -DRIGHTSHIFT_int64_IS_SAR -DRIGHTSHIFT_IS_SAR '-DACCEPT_SIZE_T=socklen_t' fxinst.cpp -o fxinst.o
c++  -fno-rtti -I/wrkdirs/usr/ports/emulators/snes9x/work/snes9x-1.51-src/unzip -I/wrkdirs/usr/ports/emulators/snes9x/work/snes9x-1.51-src -I/usr/local/include -c -O2 -pipe -march=haswell -fstack-protector -fno-strict-aliasing   -I/wrkdirs/usr/ports/emulators/snes9x/work/snes9x-1.51-src/unzip -I/wrkdirs/usr/ports/emulators/snes9x/work/snes9x-1.51-src -I/usr/local/include -DMITSHM -DCPU_SHUTDOWN -DSPC700_SHUTDOWN   -DUSE_THREADS -DSPC700_C -DNETPLAY_SUPPORT -DUNZIP_SUPPORT -DJMA_SUPPORT     -DSDD1_DECOMP -DCORRECT_VRAM_READS -DJOYSTICK_SUPPORT -DNO_INLINE_SET_GET  -DNOASM -DNEW_COLOUR_BLENDING -DZLIB -DHAVE_LIBPNG -DHAVE_MKSTEMP -DHAVE_STRINGS_H -DHAVE_SYS_IOCTL_H -DHAVE_STDINT_H -DPTR_NOT_INT -DRIGHTSHIFT_int8_IS_SAR -DRIGHTSHIFT_int16_IS_SAR -DRIGHTSHIFT_int32_IS_SAR -DRIGHTSHIFT_int64_IS_SAR -DRIGHTSHIFT_IS_SAR '-DACCEPT_SIZE_T=socklen_t' fxemu.cpp -o fxemu.o
Assertion failed: (New->getType() == getType() && "replaceAllUses of value with new value of different type!"), function doRAUW, file /poudriere/jails/head-amd64/usr/src/contrib/llvm/lib/IR/Value.cpp, line 404.
c++: error: unable to execute command: Abort trap
c++: error: clang frontend command failed due to signal (use -v to see invocation)
FreeBSD clang version 6.0.0 (branches/release_60 323338) (based on LLVM 6.0.0)
Target: x86_64-unknown-freebsd12.0
Thread model: posix
InstalledDir: /usr/bin
Comment 1 Jan Beich freebsd_committer freebsd_triage 2018-01-26 17:39:27 UTC
Created attachment 190086 [details]
command line args (for clang 6.0)
Comment 2 Jan Beich freebsd_committer freebsd_triage 2018-01-26 17:41:56 UTC
Clang 4 builds fine but Clang 5 crashes with a bit different error:

1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'Function Pass Manager' on module 'fxemu-e9d1b4.cpp'.
4.      Running pass 'Loop Pass Manager' on function '@_Z24fx_computeScreenPointersv'
5.      Running pass 'Unroll loops' on basic block '%vector.body425'
Comment 3 Dimitry Andric freebsd_committer freebsd_triage 2018-01-27 00:03:35 UTC
Reproduced, minimized, and reported upstream here:
https://bugs.llvm.org/show_bug.cgi?id=36116
Comment 4 commit-hook freebsd_committer freebsd_triage 2018-03-16 17:50:48 UTC
A commit references this bug:

Author: dim
Date: Fri Mar 16 17:50:44 UTC 2018
New revision: 331065
URL: https://svnweb.freebsd.org/changeset/base/331065

Log:
  Pull in r327638 from upstream llvm trunk (by Matthew Simpson):

    [ConstantFolding, InstSimplify] Handle more vector GEPs

    This patch addresses some additional cases where the compiler crashes
    upon encountering vector GEPs. This should fix PR36116.

    Differential Revision: https://reviews.llvm.org/D44219
    Reference: https://bugs.llvm.org/show_bug.cgi?id=36116

  This fixes an assertion when building the emulators/snes9x port.

  Reported by:	jbeich
  PR:		225471
  MFC after:	3 months
  X-MFC-With:	r327952

Changes:
  head/contrib/llvm/lib/Analysis/InstructionSimplify.cpp
  head/contrib/llvm/lib/IR/ConstantFold.cpp
Comment 5 commit-hook freebsd_committer freebsd_triage 2018-10-26 21:20:29 UTC
A commit references this bug:

Author: dim
Date: Fri Oct 26 21:20:06 UTC 2018
New revision: 483054
URL: https://svnweb.freebsd.org/changeset/ports/483054

Log:
  Add all patches from base llvm/clang/lld/lldb 6.0 to devel/llvm60

  This adds all the patches that were applied in the past to head, under
  contrib/llvm.  After these, there only minimal diffs left between the
  port sources and the base sources.

  Most of these remaining diffs are due to #ifdef shortcuts in the base
  sources, because we don't compile certain features in.  Other diffs are
  because the port has applied a few changes that we don't have in base.

  While here, use Makefile.LICENSE from the devel/llvm-devel port.

  Approved by:	brooks (maintainer)
  Reviewed by:	brooks
  PR:		212343, 225128, 225471, 226388, 226658, 226872, 229050, 230444, 230604, 231355
  MFH:		2018Q4
  Differential Revision: https://reviews.freebsd.org/D17702

Changes:
  head/devel/llvm60/Makefile
  head/devel/llvm60/files/clang/patch-head-r331066.diff
  head/devel/llvm60/files/clang/patch-head-r336227.diff
  head/devel/llvm60/files/clang/patch-head-r338697.diff
  head/devel/llvm60/files/clang/patch-head-r339019.diff
  head/devel/llvm60/files/lld/
  head/devel/llvm60/files/lld/patch-head-r331731.diff
  head/devel/llvm60/files/lld/patch-head-r333401.diff
  head/devel/llvm60/files/lld/patch-head-r336664.diff
  head/devel/llvm60/files/lld/patch-head-r336972.diff
  head/devel/llvm60/files/lld/patch-head-r337282.diff
  head/devel/llvm60/files/lld/patch-head-r338251.diff
  head/devel/llvm60/files/lld/patch-head-r338682.diff
  head/devel/llvm60/files/lld/patch-head-r339013.diff
  head/devel/llvm60/files/lld/patch-head-r339304.diff
  head/devel/llvm60/files/lldb/
  head/devel/llvm60/files/lldb/patch-head-r332849.diff
  head/devel/llvm60/files/lldb/patch-head-r332965.diff
  head/devel/llvm60/files/patch-head-r308867.diff
  head/devel/llvm60/files/patch-head-r330686.diff
  head/devel/llvm60/files/patch-head-r331065.diff
  head/devel/llvm60/files/patch-head-r331366.diff
  head/devel/llvm60/files/patch-head-r336969.diff
  head/devel/llvm60/files/patch-head-r336970.diff
  head/devel/llvm60/files/patch-head-r337615.diff
  head/devel/llvm60/files/patch-head-r338689.diff
Comment 6 commit-hook freebsd_committer freebsd_triage 2018-10-31 18:49:38 UTC
A commit references this bug:

Author: dim
Date: Wed Oct 31 18:49:07 UTC 2018
New revision: 483602
URL: https://svnweb.freebsd.org/changeset/ports/483602

Log:
  MFH: r481120

  Update to a new snapshot.

  Update LICENSE data per mailing list feedback and move to a seperate
  Makefile.LICENSE for use by other llvm ports.

  MFH: r483054

  Add all patches from base llvm/clang/lld/lldb 6.0 to devel/llvm60

  This adds all the patches that were applied in the past to head, under
  contrib/llvm.  After these, there only minimal diffs left between the
  port sources and the base sources.

  Most of these remaining diffs are due to #ifdef shortcuts in the base
  sources, because we don't compile certain features in.  Other diffs are
  because the port has applied a few changes that we don't have in base.

  While here, use Makefile.LICENSE from the devel/llvm-devel port.

  Approved by:	portmgr (miwi)
  Reviewed by:	brooks
  PR:		212343, 225128, 225471, 226388, 226658, 226872, 229050, 230444, 230604, 231355
  Differential Revision: https://reviews.freebsd.org/D17702

Changes:
_U  branches/2018Q4/
  branches/2018Q4/devel/llvm-devel/Makefile
  branches/2018Q4/devel/llvm-devel/Makefile.LICENSE
  branches/2018Q4/devel/llvm-devel/Makefile.snapshot
  branches/2018Q4/devel/llvm-devel/distinfo
  branches/2018Q4/devel/llvm-devel/files/lldb-patch-tools_lldb_source_Plugins_Process_FreeBSD_ProcessFreeBSD.cpp
  branches/2018Q4/devel/llvm-devel/pkg-plist
  branches/2018Q4/devel/llvm60/Makefile
  branches/2018Q4/devel/llvm60/files/clang/patch-head-r331066.diff
  branches/2018Q4/devel/llvm60/files/clang/patch-head-r336227.diff
  branches/2018Q4/devel/llvm60/files/clang/patch-head-r338697.diff
  branches/2018Q4/devel/llvm60/files/clang/patch-head-r339019.diff
  branches/2018Q4/devel/llvm60/files/lld/
  branches/2018Q4/devel/llvm60/files/lldb/
  branches/2018Q4/devel/llvm60/files/patch-head-r308867.diff
  branches/2018Q4/devel/llvm60/files/patch-head-r330686.diff
  branches/2018Q4/devel/llvm60/files/patch-head-r331065.diff
  branches/2018Q4/devel/llvm60/files/patch-head-r331366.diff
  branches/2018Q4/devel/llvm60/files/patch-head-r336969.diff
  branches/2018Q4/devel/llvm60/files/patch-head-r336970.diff
  branches/2018Q4/devel/llvm60/files/patch-head-r337615.diff
  branches/2018Q4/devel/llvm60/files/patch-head-r338689.diff