Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 880677 - sys-devel/llvm-15.0.3: fails to build on ppc (Target/X86/X86InstrAVX512.td:11660:3: error: pattern may store, but mayStore isn't set on the output instructions) (sys-devel/gcc:12 miscompilation?)
Summary: sys-devel/llvm-15.0.3: fails to build on ppc (Target/X86/X86InstrAVX512.td:11...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC Linux
: Normal normal (vote)
Assignee: LLVM support project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: gcc-12 915000
  Show dependency tree
 
Reported: 2022-11-10 03:02 UTC by Sam James
Modified: 2024-03-27 06:26 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log.xz (build.log.xz,52.39 KB, application/x-xz)
2022-11-10 03:02 UTC, Sam James
Details
build.log.xz (ppc, 15.0.7) built with gcc-13.0.1_pre20230129-r1 (llvm-15.0.7:20230202-115231.log.xz,52.92 KB, application/x-xz)
2023-02-02 13:11 UTC, ernsteiswuerfel
Details
build.log.xz (ppc, 16.0.0_rc1) (llvm-16.0.0_rc1:20230202-122613.log.xz,76.64 KB, application/x-xz)
2023-02-02 13:11 UTC, ernsteiswuerfel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-11-10 03:02:10 UTC
Created attachment 830255 [details]
build.log.xz

FAILED: lib/Target/X86/X86GenDAGISel.inc /var/tmp/portage/sys-devel/llvm-15.0.4/work/llvm_build-.ppc/lib/Target/X86/X86GenDAGISel.inc
cd /var/tmp/portage/sys-devel/llvm-15.0.4/work/llvm_build-.ppc && /var/tmp/portage/sys-devel/llvm-15.0.4/work/llvm_build-.ppc/bin/llvm-tblgen -gen-dag-isel -I /var/tmp/portage/sys-devel/llvm-15.0.4/work/llvm/
lib/Target/X86 -I/var/tmp/portage/sys-devel/llvm-15.0.4/work/llvm_build-.ppc/include -I/var/tmp/portage/sys-devel/llvm-15.0.4/work/llvm/include -I /var/tmp/portage/sys-devel/llvm-15.0.4/work/llvm/lib/Target /
var/tmp/portage/sys-devel/llvm-15.0.4/work/llvm/lib/Target/X86/X86.td --write-if-changed -o lib/Target/X86/X86GenDAGISel.inc -d lib/Target/X86/X86GenDAGISel.inc.d
Included from /var/tmp/portage/sys-devel/llvm-15.0.4/work/llvm/lib/Target/X86/X86.td:656:
Included from /var/tmp/portage/sys-devel/llvm-15.0.4/work/llvm/lib/Target/X86/X86InstrInfo.td:3157:
/var/tmp/portage/sys-devel/llvm-15.0.4/work/llvm/lib/Target/X86/X86InstrAVX512.td:11660:3: error: pattern may store, but mayStore isn't set on the output instructions
  def : Pat<(store f16:$src, addr:$dst), (VPEXTRWZmr addr:$dst, (v8i16 (COPY_TO_REGCLASS FR16:$src, VR128)), 0)>;
  ^
Included from /var/tmp/portage/sys-devel/llvm-15.0.4/work/llvm/lib/Target/X86/X86.td:656:
Included from /var/tmp/portage/sys-devel/llvm-15.0.4/work/llvm/lib/Target/X86/X86InstrInfo.td:3157:
/var/tmp/portage/sys-devel/llvm-15.0.4/work/llvm/lib/Target/X86/X86InstrAVX512.td:11544:3: error: defined here
  def mr : AVX512Ii8<opc, MRMDestMem, (outs),
  ^
Included from /var/tmp/portage/sys-devel/llvm-15.0.4/work/llvm/lib/Target/X86/X86.td:656:
Included from /var/tmp/portage/sys-devel/llvm-15.0.4/work/llvm/lib/Target/X86/X86InstrInfo.td:3157:
/var/tmp/portage/sys-devel/llvm-15.0.4/work/llvm/lib/Target/X86/X86InstrAVX512.td:11581:17: note: instantiated from multiclass
    defm NAME : avx512_extract_elt_bw_m<0x15, OpcodeStr, X86pextrw, _>, TAPD;
                ^
Included from /var/tmp/portage/sys-devel/llvm-15.0.4/work/llvm/lib/Target/X86/X86.td:656:
Included from /var/tmp/portage/sys-devel/llvm-15.0.4/work/llvm/lib/Target/X86/X86InstrInfo.td:3157:
/var/tmp/portage/sys-devel/llvm-15.0.4/work/llvm/lib/Target/X86/X86InstrAVX512.td:11606:17: note: instantiated from multiclass
defm VPEXTRWZ : avx512_extract_elt_w<"vpextrw", v8i16x_info>, VEX_WIG;
                ^
Included from /var/tmp/portage/sys-devel/llvm-15.0.4/work/llvm/lib/Target/X86/X86.td:16:
/var/tmp/portage/sys-devel/llvm-15.0.4/work/llvm/include/llvm/Target/Target.td:1170:1: error: defined here
def COPY_TO_REGCLASS : StandardPseudoInstruction {
^
error: Errors in DAG patterns

----

# emerge --info
Portage 3.0.38.1 (python 3.10.8-final-0, default/linux/ppc/17.0/systemd, gcc-12, glibc-2.36-r5, 5.15.63-gentoo-dist-hardened ppc)
=================================================================
System uname: Linux-5.15.63-gentoo-dist-hardened-ppc-POWER9_-architected-,_altivec_supported-with-glibc2.36
KiB Mem:    32914228 total,  18139068 free
KiB Swap:   67108860 total,  66514760 free
Timestamp of repository gentoo: Thu, 10 Nov 2022 02:16:51 +0000
sh bash 5.1_p16-r2
ld GNU ld (Gentoo 2.39 p5) 2.39.0
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r2::gentoo
dev-lang/perl:             5.36.0-r1::gentoo
dev-lang/python:           3.9.15_p2::gentoo, 3.10.8_p2::gentoo, 3.11.0_p1::gentoo
dev-lang/rust-bin:         1.64.0-r1::gentoo
dev-util/cmake:            3.24.3::gentoo
dev-util/meson:            0.63.3::gentoo
sys-apps/baselayout:       2.9::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-apps/systemd:          252::gentoo
sys-devel/autoconf:        2.71-r4::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.39-r4::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/gcc:             12.2.1_p20221008::gentoo
sys-devel/gcc-config:      2.8::gentoo
sys-devel/libtool:         2.4.7::gentoo
sys-devel/make:            4.4::gentoo
sys-kernel/linux-headers:  6.0::gentoo (virtual/os-headers)
sys-libs/glibc:            2.36-r5::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: 
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 24

ACCEPT_KEYWORDS="ppc ~ppc"
ACCEPT_LICENSE="@FREE"
CBUILD="powerpc-unknown-linux-gnu"
CFLAGS="-O2 -mcpu=powerpc -mtune=powerpc -pipe"
CHOST="powerpc-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -mcpu=powerpc -mtune=powerpc -pipe"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--nospinner --ask-enter-invalid --jobs=8 --load-average 15 --quiet-build"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -mcpu=powerpc -mtune=powerpc -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live clean-logs compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync mount-sandbox multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -mcpu=powerpc -mtune=powerpc -pipe"
GENTOO_MIRRORS="https://gentoo.osuosl.org/"
LANG="C.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en"
MAKEOPTS="--jobs=16 --load-average=15"
PKGDIR="/var/cache/binpkgs"
PORTAGE_BZIP2_COMMAND="lbzip2"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/sh"
USE="acl big-endian bzip2 cli crypt dri fortran gdbm iconv ipv6 libglvnd ncurses nls nptl openmp pam pcre ppc readline seccomp split-usr ssl systemd test-rust udev unicode xattr zlib" ADA_TARGET="gnat_2020" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" RUBY_TARGETS="ruby27" USERLAND="GNU" VIDEO_CARDS="fbdev mga nv r128 radeon dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-11-10 03:50:11 UTC
Builds okay with LLVM_TARGETS="BPF PowerPC" (had to unforce others, obviously).

Given bug 875776, wondering if tblgen is miscompiled or something. Will try older GCC...
Comment 2 immolo 2022-11-13 15:40:35 UTC
Testing this with gcc-11.3.0 results in a successful build and then updating to gcc-12 fails so this seems to agree with your current idea.

# emerge --info
Portage 3.0.38.1 (python 3.10.8-final-0, default/linux/ppc/17.0, gcc-12, glibc-2.35-r8, 5.18.10-gentoo-ppc ppc64)
=================================================================
System uname: Linux-5.18.10-gentoo-ppc-ppc64-PPC970MP,_altivec_supported-with-glibc2.35
KiB Mem:    10491192 total,   4731284 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Fri, 11 Nov 2022 23:30:01 +0000
Head commit of repository gentoo: 650be6886304704bc83738d44ed7a1fde7bb3254
sh bash 5.1_p16-r2
ld GNU ld (Gentoo 2.38 p4) 2.38
distcc 3.4 powerpc-unknown-linux-gnu [disabled]
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r2::gentoo
dev-lang/perl:             5.34.1-r4::gentoo
dev-lang/python:           3.10.8_p2::gentoo, 3.11.0_p1::gentoo
dev-util/cmake:            3.24.2::gentoo
dev-util/meson:            0.63.2-r1::gentoo
sys-apps/baselayout:       2.8::gentoo
sys-apps/openrc:           0.45.2-r1::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-devel/autoconf:        2.71-r1::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.38-r2::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/gcc:             11.3.0::gentoo, 12.2.1_p20221008::gentoo
sys-devel/gcc-config:      2.8::gentoo
sys-devel/libtool:         2.4.7::gentoo
sys-devel/llvm:            14.0.6-r2::gentoo, 15.0.3::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/glibc:            2.35-r8::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts: 
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes

ACCEPT_KEYWORDS="ppc"
ACCEPT_LICENSE="@FREE"
CBUILD="powerpc-unknown-linux-gnu"
CFLAGS="-O2 -mcpu=powerpc -mtune=powerpc -pipe"
CHOST="powerpc-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -mcpu=powerpc -mtune=powerpc -pipe"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -mcpu=powerpc -mtune=powerpc -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -mcpu=powerpc -mtune=powerpc -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="C.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j2"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="acl big-endian bzip2 cli crypt dri fortran gdbm iconv ipv6 libglvnd ncurses nls nptl openmp pam pcre ppc readline seccomp split-usr ssl test-rust unicode xattr zlib" ADA_TARGET="gnat_2020" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="PowerPC" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" RUBY_TARGETS="ruby27" USERLAND="GNU" VIDEO_CARDS="fbdev mga r128 radeon dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-12-13 01:30:38 UTC
If I disable almost everything and set minimal LLVM_TARGETS="BPF PowerPC" (I don't remember why I kept BPF in there), the build gets a bit further, but hangs on llvm-tblgen generating for PowerPC, so it's still miscompiled.
Comment 4 ernsteiswuerfel archtester 2023-02-02 13:11:27 UTC
Created attachment 849704 [details]
build.log.xz (ppc, 15.0.7) built with gcc-13.0.1_pre20230129-r1

Tried a build with GCC 13 and a build of 16.0.0_rc1 with GCC 12 but not much difference.
Comment 5 ernsteiswuerfel archtester 2023-02-02 13:11:57 UTC
Created attachment 849706 [details]
build.log.xz (ppc, 16.0.0_rc1)
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-08-06 17:04:55 UTC
Update:

* sys-devel/14.0.0_pre20230702 ((Gentoo 14.0.0_pre20230702 p2) 14.0.0 20230702 (experimental)) works?

* Bisect for the "fix" gives: 
```
5a1ef1cfac005370d0a5a0f85798724cb2c9cf5e is the first bad commit
commit 5a1ef1cfac005370d0a5a0f85798724cb2c9cf5e
Author: Honza <jh@ryzen3.suse.cz>
Date:   Sun Jun 18 18:58:26 2023 +0200

    Analyze SRA candidates in ipa-fnsummary

    this patch extends ipa-fnsummary to anticipate statements that will be removed
    by SRA.  This is done by looking for calls passing addresses of automatic
    variables.  In function body we look for dereferences from pointers of such
    variables and mark them with new not_sra_candidate condition.

    This is just first step which is overly optimistic.  We do not try to prove that
    given automatic variable will not be SRAed even after inlining.  We now also
    optimistically assume that the transformation will always happen.  I will restrict
    this in a followup patch, but I think it is useful to gether some data on how
    much code is affected by this.

    This is motivated by PR109849 where we fail to fully inline push_back.
    The patch alone does not solve the problem even for -O3, but improves
    analysis in this case.
```

* The original bisect for the commit which "broke" it gives https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=22c242342e38ebffa6bbf7e86e7a1e4abdf0d686 (which never made much sense, but IIRC reverting it helped).
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-08-06 17:08:08 UTC
(In reply to Sam James from comment #6)
> Update:
> 
> * sys-devel/14.0.0_pre20230702 ((Gentoo 14.0.0_pre20230702 p2) 14.0.0
> 20230702 (experimental)) works?
> 
> * Bisect for the "fix" gives: 
> ```

ftr:
```
# git bisect log
git bisect start
# status: waiting for both good and bad commits
# bad: [c9434ea40e20584a44a0b6fc8659ee983d5f2dd2] libstdc++: Fix several preprocessor directives
git bisect bad c9434ea40e20584a44a0b6fc8659ee983d5f2dd2
# status: waiting for good commit(s), bad commit known
# good: [b43dc20bdb10087415afb458fd353b4760ea9964] Daily bump.
git bisect good b43dc20bdb10087415afb458fd353b4760ea9964
# good: [8b0bd9ae4e2927f770da352ac64261411e6d652e] PR modula2/110189 Using an unknown TYPE as argument to VAL gives ICE
git bisect good 8b0bd9ae4e2927f770da352ac64261411e6d652e
# good: [8e08c7886eed5824bebd0e011526ec302d622844] ipa: Fix double reference-count decrements for the same edge (PR 107769, PR 109318)
git bisect good 8e08c7886eed5824bebd0e011526ec302d622844
# skip: [f150a084e25eaa98afaf25e2211001047ecc8d44] libstdc++: Add std::numeric_limits<__float128> specialization [PR104772]
git bisect skip f150a084e25eaa98afaf25e2211001047ecc8d44
# skip: [b960c253e988c68ed3f3829125bc267bdf169356] libstdc++: Add missing noexcept to std::scoped_allocator_adaptor
git bisect skip b960c253e988c68ed3f3829125bc267bdf169356
# good: [0251292d2da4039d4b12ecee81588614bf99b546] ada: Add missing guards in Selected_Range_Checks
git bisect good 0251292d2da4039d4b12ecee81588614bf99b546
# bad: [0a3b1a095d451427571299fc78f29dec94c6931c] RISC-V: Support RVV floating-point auto-vectorization
git bisect bad 0a3b1a095d451427571299fc78f29dec94c6931c
# good: [35d2c40e4ac9ba57ae82e4722e557a2028d0cf13] c++: init-list of uncopyable type [PR110102]
git bisect good 35d2c40e4ac9ba57ae82e4722e557a2028d0cf13
# good: [17e45a14a2043ae2117f772945de32d402e10f3f] ada: Fix too small secondary stack allocation for returned conversion
git bisect good 17e45a14a2043ae2117f772945de32d402e10f3f
# bad: [862f84b4a36d6c569968d20949f54e2f427179c1] ada: Spurious error on package instantiation
git bisect bad 862f84b4a36d6c569968d20949f54e2f427179c1
# bad: [0f9bb3e7a4aab95fd449f60b5f891ed9a6e5f352] Fix arc assumption that insns are not re-recognized
git bisect bad 0f9bb3e7a4aab95fd449f60b5f891ed9a6e5f352
# good: [ffb87344dd343df60eafb10d510ac704f37417ca] aarch64: Reimplement [US]Q(R)SHR(U)N patterns with RTL codes
git bisect good ffb87344dd343df60eafb10d510ac704f37417ca
# good: [bc6bd0d608da1609c1caeb04ab795a83720add55] libgo/testsuite: add benchmarks and examples to list
git bisect good bc6bd0d608da1609c1caeb04ab795a83720add55
# good: [729c6f4063f1af4852221c2918466b412c213849] Daily bump.
git bisect good 729c6f4063f1af4852221c2918466b412c213849
# good: [55686e6601b3633a515afad1358d71c7b2d565e2] i386: Standardize shift amount constants as QImode in i386.md.
git bisect good 55686e6601b3633a515afad1358d71c7b2d565e2
# bad: [5a1ef1cfac005370d0a5a0f85798724cb2c9cf5e] Analyze SRA candidates in ipa-fnsummary
git bisect bad 5a1ef1cfac005370d0a5a0f85798724cb2c9cf5e
# good: [af29d0d6b75f9e5ad69820488972027fe4634850] i386: Refactor new ix86_expand_carry to set the carry flag.
git bisect good af29d0d6b75f9e5ad69820488972027fe4634850
# first bad commit: [5a1ef1cfac005370d0a5a0f85798724cb2c9cf5e] Analyze SRA candidates in ipa-fnsummary
```
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-08-06 17:17:20 UTC
Above testing was with sys-devel/llvm-16.0.6.

[18:08:33]  <@sam_> next steps:
[18:08:36]  <@sam_> - test a revert of that on gcc 14
[18:08:40]  <@sam_> - test a cherry-pick of it on 12
[18:08:52]  <@sam_> - rebisect the breakage just to double check, as I don't recall if we ever did that twice
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-08-07 05:55:47 UTC
(In reply to Sam James from comment #8)
> [18:08:52]  <@sam_> - rebisect the breakage just to double check, as I don't
> recall if we ever did that twice

This gives:
```
d70ef65692fced7ab72e0aceeff7407e5a34d96d is the first bad commit
commit d70ef65692fced7ab72e0aceeff7407e5a34d96d
Author: Jan Hubicka <jh@suse.cz>
Date:   Wed Nov 10 13:08:41 2021 +0100

    Make EAF flags more regular (and expressive)

    I hoped that I am done with EAF flags related changes, but while looking into
    the Fortran testcases I noticed that I have designed them in unnecesarily
    restricted way.  I followed the scheme of NOESCAPE and NODIRECTESCAPE which is
    however the only property tht is naturally transitive.

    This patch replaces the existing flags by 9 flags:

    EAF_UNUSED
    EAF_NO_DIRECT_CLOBBER and EAF_NO_INDIRECT_CLOBBER
    EAF_NO_DIRECT_READ and EAF_NO_INDIRECT_READ
    EAF_NO_DIRECT_ESCAPE and EAF_NO_INDIRECT_ESCAPE
    EAF_NO_DIRECT_READ and EAF_NO_INDIRECT_READ

    So I have removed the unified EAF_DIRECT flag and made each of the flags to come
    in direct and indirect variant.  Newly the indirect variant is not implied by direct
    (well except for escape but it is not special cased in the code)
    Consequently we can analyse i.e. the case where function reads directly and clobber
    indirectly as in the following testcase:
[...]
```

with

```
 # git bisect log
git bisect start
# status: waiting for both good and bad commits
# bad: [4b2916a6296469ec621c904a4ad305a0bd14d6f9] Daily bump.
git bisect bad 4b2916a6296469ec621c904a4ad305a0bd14d6f9
# status: waiting for good commit(s), bad commit known
# good: [96f4fb8c2f347fc190952dec6b280908c51803a5] Daily bump.
git bisect good 96f4fb8c2f347fc190952dec6b280908c51803a5
# good: [250f234988b6231669a720c52101d3686d645072] testsuite: Fix up gcc.target/s390/zero-scratch-regs-1.c
git bisect good 250f234988b6231669a720c52101d3686d645072
# good: [a45d577b2b05e231e7a9abd43165f1e3120af013] libstdc++: Refactor emplace-like functions in std::variant
git bisect good a45d577b2b05e231e7a9abd43165f1e3120af013
# bad: [884f77b4222289510e1df9db2889b60c5df6fcda] arm: Implement MVE predicates as vectors of booleans
git bisect bad 884f77b4222289510e1df9db2889b60c5df6fcda
# bad: [ffb5418fb79e951e4a8cc818e2408106aa58b9a8] Daily bump.
git bisect bad ffb5418fb79e951e4a8cc818e2408106aa58b9a8
# bad: [3b2337831a81e4783d7205525c82f3b0cb11459c] libstdc++: Add xfail to some printer tests for debug mode
git bisect bad 3b2337831a81e4783d7205525c82f3b0cb11459c
# bad: [aa1fd30df56d752e3d5a81af409875a1f1e3e327] jit: fix -Werror=format-overflow= in testsuite [PR103199]
git bisect bad aa1fd30df56d752e3d5a81af409875a1f1e3e327
# skip: [7df3ac2e9ed53f9320a63f38081561166b140cf2] [Ada] Tidy up implementation of Has_Compatible_Type
git bisect skip 7df3ac2e9ed53f9320a63f38081561166b140cf2
# good: [1f6dd5de33912c261a5003150212c290165ac1b6] Remove def chain import assert from GORI.
git bisect good 1f6dd5de33912c261a5003150212c290165ac1b6
# good: [f4b4ce152a06578d94ae7630cffd655d590b2857] libstdc++: [_GLIBCXX_DEBUG] Implement unordered container merge
git bisect good f4b4ce152a06578d94ae7630cffd655d590b2857
# bad: [7c8a416da86c175bcb5fa7b49abf3cf343bc068f] Adjust test to avoid target-specific failures [PR103161].
git bisect bad 7c8a416da86c175bcb5fa7b49abf3cf343bc068f
# good: [75ef0353a2d31dad1bda8e35f1849024f7f1e941] rs6000, libgcc: Fix up -Wmissing-prototypes warning on rs6000/linux-unwind.h
git bisect good 75ef0353a2d31dad1bda8e35f1849024f7f1e941
# bad: [0612883d9dc6eebecdbe937893b86597acae237c] vect: Pass scalar_costs to finish_cost
git bisect bad 0612883d9dc6eebecdbe937893b86597acae237c
# good: [5cfa174e08e4964703387aa7de5ece448cc660b8] vect: remove unused variable in complex numbers detection code.
git bisect good 5cfa174e08e4964703387aa7de5ece448cc660b8
# bad: [4725f62789f25b17967695203d7ee821221e2dd6] vect: Move vector costs to loop_vec_info
git bisect bad 4725f62789f25b17967695203d7ee821221e2dd6
# good: [0cf6065ce4997774de66db4de83d461013e0f0e1] testsuite: change vect_long to vect_long_long in complex tests.
git bisect good 0cf6065ce4997774de66db4de83d461013e0f0e1
# bad: [d70ef65692fced7ab72e0aceeff7407e5a34d96d] Make EAF flags more regular (and expressive)
git bisect bad d70ef65692fced7ab72e0aceeff7407e5a34d96d
# first bad commit: [d70ef65692fced7ab72e0aceeff7407e5a34d96d] Make EAF flags more regular (and expressive)
```

I'm going to run it again too.
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-08-09 17:04:34 UTC
(In reply to Sam James from comment #9)
> I'm going to run it again too.

I think the retry result is bogus too:
```
206b22d021d94adbaa79e1d443c87415254b15de is the first bad commit
commit 206b22d021d94adbaa79e1d443c87415254b15de
Author: Martin Liska <mliska@suse.cz>
Date:   Fri Oct 15 16:34:34 2021 +0200

    Remove MAY_HAVE_DEBUG_MARKER_STMTS and MAY_HAVE_DEBUG_BIND_STMTS.

    The macros correspond 1:1 to an option flags and make it harder
    to find all usages of the flags.

    gcc/c-family/ChangeLog:

            * c-gimplify.c (genericize_c_loop): Use option directly.

    gcc/c/ChangeLog:

            * c-parser.c (add_debug_begin_stmt): Use option directly.
```

```
git bisect start
# status: waiting for both good and bad commits
# bad: [4b2916a6296469ec621c904a4ad305a0bd14d6f9] Daily bump.
git bisect bad 4b2916a6296469ec621c904a4ad305a0bd14d6f9
# status: waiting for good commit(s), bad commit known
# good: [96f4fb8c2f347fc190952dec6b280908c51803a5] Daily bump.
git bisect good 96f4fb8c2f347fc190952dec6b280908c51803a5
# good: [250f234988b6231669a720c52101d3686d645072] testsuite: Fix up gcc.target/s390/zero-scratch-regs-1.c
git bisect good 250f234988b6231669a720c52101d3686d645072
# good: [a45d577b2b05e231e7a9abd43165f1e3120af013] libstdc++: Refactor emplace-like functions in std::variant
git bisect good a45d577b2b05e231e7a9abd43165f1e3120af013
# bad: [884f77b4222289510e1df9db2889b60c5df6fcda] arm: Implement MVE predicates as vectors of booleans
git bisect bad 884f77b4222289510e1df9db2889b60c5df6fcda
# bad: [ffb5418fb79e951e4a8cc818e2408106aa58b9a8] Daily bump.
git bisect bad ffb5418fb79e951e4a8cc818e2408106aa58b9a8
# bad: [3b2337831a81e4783d7205525c82f3b0cb11459c] libstdc++: Add xfail to some printer tests for debug mode
git bisect bad 3b2337831a81e4783d7205525c82f3b0cb11459c
# skip: [aa1fd30df56d752e3d5a81af409875a1f1e3e327] jit: fix -Werror=format-overflow= in testsuite [PR103199]
git bisect skip aa1fd30df56d752e3d5a81af409875a1f1e3e327
# good: [e4411622690654cdc530c6262c7115a9e15dc359] Avoid repeating calculations in threader.
git bisect good e4411622690654cdc530c6262c7115a9e15dc359
# good: [48c6cac9caea1dc7c5f50ad3a736f6693e74a11b] Fortran/openmp: Fix '!$omp end'
git bisect good 48c6cac9caea1dc7c5f50ad3a736f6693e74a11b
# good: [53a643f8568067d7700a9f2facc8ba39974973d3] x86: Add -mharden-sls=[none|all|return|indirect-branch]
git bisect good 53a643f8568067d7700a9f2facc8ba39974973d3
# bad: [9c0773984c8ec6dc1838f94177b4594b74650765] Daily bump.
git bisect bad 9c0773984c8ec6dc1838f94177b4594b74650765
# bad: [d3152981f71eef16e50246a94819c39ff1489c70] Reduce cost of aligned sse register store.
git bisect bad d3152981f71eef16e50246a94819c39ff1489c70
# bad: [6fa8e0896c6ec96eddcedb2b92502a7bbb525c03] c++: unqual lookup performed twice w/ template-id ADL [PR102670]
git bisect bad 6fa8e0896c6ec96eddcedb2b92502a7bbb525c03
# good: [15f5e70cbb33b40c97325ef9d55557747a148d39] i386: Fix wrong codegen for -mrelax-cmpxchg-loop
git bisect good 15f5e70cbb33b40c97325ef9d55557747a148d39
# bad: [edd2249b17fb7150da66b03adb1a4e381926047d] libsanitizer: Fix bootstrap on FreeBSD [PR102675]
git bisect bad edd2249b17fb7150da66b03adb1a4e381926047d
# good: [e28afbb90f8eca31d0a658e92e2007eb0db2a964] testsuite/103278 - adjust gcc.dg/tree-ssa/if-to-switch-3.c
git bisect good e28afbb90f8eca31d0a658e92e2007eb0db2a964
# bad: [206b22d021d94adbaa79e1d443c87415254b15de] Remove MAY_HAVE_DEBUG_MARKER_STMTS and MAY_HAVE_DEBUG_BIND_STMTS.
git bisect bad 206b22d021d94adbaa79e1d443c87415254b15de
# first bad commit: [206b22d021d94adbaa79e1d443c87415254b15de] Remove MAY_HAVE_DEBUG_MARKER_STMTS and MAY_HAVE_DEBUG_BIND_STMTS.
```

(I started adding skips when I found an ICE in the log.)
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-08-11 03:20:00 UTC
And retry retry went terribly:

```
The merge base 250f234988b6231669a720c52101d3686d645072 is bad.
This means the bug has been fixed between 250f234988b6231669a720c52101d3686d645072 and [96f4fb8c2f347fc190952dec6b280908c51803a5].
error: bisect run failed: 'git bisect bad' exited with error code -3
```

meh.
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-08-14 06:44:25 UTC
Latest attempt for bisecting for the breakage:
```
There are only 'skip'ped commits left to test.
The first bad commit could be any of:
616ca1024a79c6a1935ea152051b9016d2142fb6
22c242342e38ebffa6bbf7e86e7a1e4abdf0d686
53c964ad996a1bb22566b987eafb333b5899deab
3535be6c6f440909798d1c78e862a657f7adaf63
75ac95f6647367783c4d65f6f686867ca425cb61
6f4ac4f81f89caac7e74127ed2e6db6bbb3d7426
We cannot bisect more!
error: bisect run cannot continue any more
```

```
$ git bisect visualize  --oneline
6f4ac4f81f8 Fix rs6000 predicates.md use of decl_replaceable_p
3535be6c6f4 Fortran: NULL() is not interoperable
22c242342e3 IPA: fix reproducibility in IPA MOD REF
616ca1024a7 IPA: use cgraph_node instance
53c964ad996 c++: error recovery during C++20 template-id ADL failure
75ac95f6647 Turn -fsemantic-interposition to optimization flag
```
Comment 13 Matt Turner gentoo-dev 2024-02-01 19:53:41 UTC
Just a couple of notes. With gcc-13.2.1_p20240113-r1 on an iMac G4, llvm-17.0.6 failed to build with

> COMMON_FLAGS="-O2 -mcpu=G4 -mtune=G4 -pipe"

and also failed with

> COMMON_FLAGS="-O2 -mcpu=G4 -mtune=G4 -pipe -fno-strict-aliasing"

but succeeded with

> COMMON_FLAGS="-O1 -mcpu=G4 -mtune=G4 -pipe"
Comment 14 Larry the Git Cow gentoo-dev 2024-03-27 06:26:24 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2af06d2df0b0d41594490a46fb239b1ed587a76d

commit 2af06d2df0b0d41594490a46fb239b1ed587a76d
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-03-27 06:21:13 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-03-27 06:24:42 +0000

    sys-devel/llvm: add workaround for ppc with < GCC 14
    
    Pass -fno-ipa-sra -fno-ipa-modref -fno-ipa-icf on ppc with < GCC 14. We know
    the problem is related to IPA and these 3 together help. Someone is welcome
    to spend the time trying to narrow it down more, but applying this as a bandaid
    which is better than nothing.
    
    GCC 14 seems fine without this, but the "fix" bisects to something odd
    just like the original "break" commit, so...
    
    Bug: https://gcc.gnu.org/PR108250
    Bug: https://bugs.gentoo.org/914888
    Closes: https://bugs.gentoo.org/880677
    Closes: https://bugs.gentoo.org/875776
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/llvm/llvm-15.0.7-r3.ebuild          | 7 ++++++-
 sys-devel/llvm/llvm-16.0.6.ebuild             | 5 +++++
 sys-devel/llvm/llvm-17.0.6.ebuild             | 5 +++++
 sys-devel/llvm/llvm-18.1.2.ebuild             | 5 +++++
 sys-devel/llvm/llvm-19.0.0.9999.ebuild        | 5 +++++
 sys-devel/llvm/llvm-19.0.0_pre20240316.ebuild | 5 +++++
 sys-devel/llvm/llvm-19.0.0_pre20240322.ebuild | 5 +++++
 7 files changed, 36 insertions(+), 1 deletion(-)