Bug 225086 - editors/libreoffice: clang 6 crashes during build
Summary: editors/libreoffice: clang 6 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
Keywords: toolchain
Depends on:
Blocks: 224669
  Show dependency treegraph
Reported: 2018-01-11 21:56 UTC by Jan Beich
Modified: 2018-01-13 02:11 UTC (History)
2 users (show)

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

vcl/source/gdi/pdfwriter_impl.cxx (compressed, preprocessed) (901.52 KB, application/x-xz)
2018-01-11 21:56 UTC, Jan Beich
no flags Details
command line args (for clang 6.0) (9.36 KB, text/plain)
2018-01-11 21:57 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 2018-01-11 21:56:08 UTC
Created attachment 189635 [details]
vcl/source/gdi/pdfwriter_impl.cxx (compressed, preprocessed)

[CXX] vcl/source/gdi/pdfwriter_impl.cxx
S=/wrkdirs/usr/ports/editors/libreoffice/work/libreoffice- && I=$S/instdir && W=$S/workdir &&  mkdir -p $W/CxxObject/vcl/source/gdi/ $W/Dep/CxxObject/vcl/source/gdi/ && cd /wrkdirs/usr/ports/editors/libreoffice/work/libreoffice- && CCACHE_CPP2=1   c++ -DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_SYSTEM_NO_DEPRECATED -DCPPU_ENV=gcc3 -DFREEBSD -DNDEBUG -DOPTIMIZE -DOSL_DEBUG_LEVEL=0 -DUNIX -DUNX -DX86_64 -D_PTHREADS -D_REENTRANT -isystem /usr/local/include  -DVCL_DLLIMPLEMENTATION -DDLLIMPLEMENTATION_UITEST -DCUI_DLL_NAME=\"libcuilo.so\" -DDESKTOP_DETECTOR_DLL_NAME=\"libdesktop_detectorlo.so\" -DTK_DLL_NAME=\"libtklo.so\" -DENABLE_MERGELIBS=0  -DSYSTEM_CURL  -DSYSTEM_NSS  -DSYSTEM_NSS  -DENABLE_CUPS   -fvisibility=hidden    -Wall -Wno-missing-braces -Wnon-virtual-dtor -Wendif-labels -Wextra -Wundef -Wunused-macros -fmessage-length=0 -fno-common -pipe  -Wimplicit-fallthrough -fvisibility-inlines-hidden -fstack-protector-strong -fPIC -Woverloaded-virtual -Wno-unused-parameter -Wno-unused-local-typedefs -std=gnu++14   -DEXCEPTIONS_ON -fexceptions -O2 -pipe -fstack-protector -DLDAP_DEPRECATED -fno-strict-aliasing   -DLIBO_INTERNAL_ONLY  -c $S/vcl/source/gdi/pdfwriter_impl.cxx -o $W/CxxObject/vcl/source/gdi/pdfwriter_impl.o  -I$S/vcl/source/gdi/ -isystem /usr/local/include/mdds-1.2   -I$S/include   -I$S/config_host  -I$W/CustomTarget/officecfg/registry -I$W/CustomTarget/vcl/unx/generic/fontmanager -I$S/vcl/inc   -I$W/UnoApiHeadersTarget/udkapi/normal -I$W/UnoApiHeadersTarget/offapi/normal -I$W/CustomTarget/officecfg/registry  -I/usr/local/include    -isystem /usr/local/include/nss -isystem /usr/local/include/nss/nss -isystem /usr/local/include/nspr    -isystem /usr/local/include/nss -isystem /usr/local/include/nss/nss -isystem /usr/local/include/nspr   -I/usr/local/include   -isystem /usr/local/include/glib-2.0 -isystem /usr/local/lib/glib-2.0/include -isystem /usr/local/include -pthread    -isystem /usr/local/include    -isystem /usr/local/include/harfbuzz -isystem /usr/local/include/glib-2.0 -isystem /usr/local/lib/glib-2.0/include -isystem /usr/local/include    -isystem /usr/local/include  -Wno-long-long    -isystem /usr/local/include -isystem /usr/local/include/libdrm -D_THREAD_SAFE -pthread    -isystem /usr/local/include/cairo -isystem /usr/local/include/glib-2.0 -isystem /usr/local/lib/glib-2.0/include -isystem /usr/local/include -isystem /usr/local/include/pixman-1 -isystem /usr/local/include/freetype2 -isystem /usr/local/include/libdrm -isystem /usr/local/include/libpng16 -D_THREAD_SAFE -pthread    -isystem /usr/local/include/freetype2    -I/usr/local/include -I/usr/local/include/freetype2    -isystem /usr/local/include/freetype2
Invalid InsertValueInst operands!
  %.fca.0.insert = insertvalue { i64, i64 } undef, i32 %17, 0
Invalid InsertValueInst operands!
  %.fca.1.insert = insertvalue { i64, i64 } %.fca.0.insert, i32 %18, 1
fatal error: error in backend: Broken function found, compilation aborted!
Comment 1 Jan Beich freebsd_committer 2018-01-11 21:57:35 UTC
Created attachment 189636 [details]
command line args (for clang 6.0)
Comment 2 Dimitry Andric freebsd_committer 2018-01-12 16:17:59 UTC
This turns out to be https://bugs.llvm.org/show_bug.cgi?id=35777, which is fixed by https://reviews.llvm.org/rL321994.  This fix will land in the upstream release_60 branch, but I am going to import it separately.
Comment 3 commit-hook freebsd_committer 2018-01-12 18:19:25 UTC
A commit references this bug:

Author: dim
Date: Fri Jan 12 18:19:15 UTC 2018
New revision: 327885
URL: https://svnweb.freebsd.org/changeset/base/327885

  Pull in r321994 from upstream llvm trunk (by Alexey Bataev):

    [SLP] Fix PR35777: Incorrect handling of aggregate values.

    Fixes the bug with incorrect handling of InsertValue|InsertElement
    instrucions in SLP vectorizer. Currently, we may use incorrect
    ExtractElement instructions as the operands of the original
    InsertValue|InsertElement instructions.

    Reviewers: mkuper, hfinkel, RKSimon, spatel

    Subscribers: llvm-commits

    Differential Revision: https://reviews.llvm.org/D41767

  This should fix "Invalid InsertValueInst operands!" errors when building
  certain parts of editors/libreoffice.

  Reported by:	jbeich
  PR:		225086

Comment 4 Dimitry Andric freebsd_committer 2018-01-12 21:53:24 UTC
Jan, I'll probably not be able to test building libreoffice with this fix very quickly, if you have some time and resources, can you please verify?
Comment 5 Jan Beich freebsd_committer 2018-01-13 02:11:53 UTC
I confirm, libreoffice builds fine now.