[Bug target/111425] New: ia64: ICE in net/ipv4/fib_semantics.c:1621:1: internal compiler error: Segmentation fault

2023-09-15 Thread frank.scheiner at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111425

Bug ID: 111425
   Summary: ia64: ICE in net/ipv4/fib_semantics.c:1621:1: internal
compiler error: Segmentation fault
   Product: gcc
   Version: 13.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: frank.scheiner at web dot de
  Target Milestone: ---

Created attachment 55904
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55904&action=edit
Used kernel config

Hi there,

there is a regression present for target ia64 since at least 13.1.0 that also
manifests during cross-compilation on amd64 (most likely present also for other
cross-compiling host arches, but not checked). Compiling various Linux kernel
versions (checked for tags v6.6-rc1, v6.4, v6.0 and v5.19 of the mainline
kernel) all lead to the "same" error.

It always happens for the same file (actually multiple files when looking at
the kernel build attempts in Debian ports (e.g. [1], search for "segmentation
fault") but only for the following file for my kernel config):

net/ipv4/fib_semantics.c

...and function fib_create_info().

Not sure what the problem is here, moving the function around in the file or
adding additional but unsued vars or NOPs doesn't change the outcome, only the
line numbers.

[1]:
https://buildd.debian.org/status/fetch.php?pkg=linux&arch=ia64&ver=6.4.4-2&stamp=1690708282&raw=0



```
# ia64-linux-gcc -v -freport-bug -Wp,-MMD,net/ipv4/.fib_semantics.o.d -nostdinc
-I./arch/ia64/include -I./arch/ia64/include/generated  -I./include
-I./arch/ia64/include/uapi -I./arch/ia64/include/generated/uapi
-I./include/uapi -I./include/generated/uapi -include
./include/linux/compiler-version.h -include ./include/linux/kconfig.h -include
./include/linux/compiler_types.h -D__KERNEL__ -DHAVE_WORKING_TEXT_ALIGN
-DHAVE_MODEL_SMALL_ATTRIBUTE -DHAVE_SERIALIZE_DIRECTIVE -fmacro-prefix-map=./=
-std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE
-fno-strict-aliasing -pipe -ffixed-r13 -mfixed-range=f12-f15,f32-f127
-frename-registers -fno-optimize-sibling-calls -fno-delete-null-pointer-checks
-O2 -fno-allow-store-data-races -fno-stack-protector -fomit-frame-pointer
-ftrivial-auto-var-init=zero -fno-stack-clash-protection -falign-functions=32
-fstrict-flex-arrays=3 -fno-strict-overflow -fno-stack-check -fconserve-stack
-Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int
-Werror=return-type -Werror=strict-prototypes -Wno-format-security
-Wno-trigraphs -Wno-frame-address -Wno-address-of-packed-member
-Wframe-larger-than=2048 -Wno-main -Wno-unused-but-set-variable
-Wno-unused-const-variable -Wno-dangling-pointer -Wvla -Wno-pointer-sign
-Wcast-function-type -Wno-array-bounds -Wno-alloc-size-larger-than
-Wimplicit-fallthrough=5 -Werror=date-time -Werror=incompatible-pointer-types
-Werror=designated-init -Wenum-conversion -Wno-unused-but-set-variable
-Wno-unused-const-variable -Wno-restrict -Wno-packed-not-aligned
-Wno-format-overflow -Wno-format-truncation -Wno-stringop-overflow
-Wno-stringop-truncation -Wno-missing-field-initializers -Wno-type-limits
-Wno-shift-negative-value -Wno-maybe-uninitialized -Wno-sign-compare -g 
-mconstant-gp  -DKBUILD_MODFILE='"net/ipv4/fib_semantics"'
-DKBUILD_BASENAME='"fib_semantics"' -DKBUILD_MODNAME='"fib_semantics"'
-D__KBUILD_MODNAME=kmod_fib_semantics -c -o net/ipv4/fib_semantics.o
net/ipv4/fib_semantics.c
Using built-in specs.
COLLECT_GCC=ia64-linux-gcc
Target: ia64-linux
Configured with: /home/arnd/git/gcc/configure --host=x86_64-linux-gnu
--build=aarch64-linux --target=ia64-linux --enable-targets=all
--prefix=/home/arnd/cross/x86_64/gcc-13.2.0-nolibc/ia64-linux
--enable-languages=c --without-headers --disable-bootstrap --disable-nls
--disable-threads --disable-shared --disable-libmudflap --disable-libssp
--disable-libgomp --disable-decimal-float --disable-libquadmath
--disable-libatomic --disable-libcc1 --disable-libmpx --enable-checking=release
--with-static-standard-libraries --with-system-libunwind
Thread model: single
Supported LTO compression algorithms: zlib zstd
gcc version 13.2.0 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-freport-bug' '-nostdinc' '-I' './arch/ia64/include'
'-I' './arch/ia64/include/generated' '-I' './include' '-I'
'./arch/ia64/include/uapi' '-I' './arch/ia64/include/generated/uapi' '-I'
'./include/uapi' '-I' './include/generated/uapi' '-include'
'./include/linux/compiler-version.h' '-include' './include/linux/kconfig.h'
'-include' './include/linux/compiler_types.h' '-D' '__KERNEL__' '-D'
'HAVE_WORKING_TEXT_ALIGN' '-D' 'HAVE_MODEL_SMALL_ATTRIBUTE' '-D'
'HAVE_SERIALIZE_DIRECTIVE' '-fmacro-prefix-map=./=' '-std=gnu11'
'-fshort-wchar' '-funsigned-char' '-fno-common' '-fno-PIE'
'-fno-strict-aliasing' '-pipe' '-ffixed-r13' '-mfixed-range=f12-f15,f32-f127'
'-frename-registers' '-fno-optimize-sibling-calls'
'-fno-delete-null-pointer-ch

[Bug target/111425] ia64: ICE in net/ipv4/fib_semantics.c:1621:1: internal compiler error: Segmentation fault

2023-09-15 Thread frank.scheiner at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111425

--- Comment #1 from Frank Scheiner  ---
Created attachment 55905
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55905&action=edit
the gzip compressed preprocessed file

Added the preprocessed file (gzip compressed due to size of 4.4 MiB).

[Bug target/111425] ia64: ICE in net/ipv4/fib_semantics.c:1621:1: internal compiler error: Segmentation fault

2023-09-16 Thread frank.scheiner at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111425

--- Comment #4 from Frank Scheiner  ---
(In reply to Richard Biener from comment #3)

Hi Richard,

in case you wanted me to test this reduced test case, I ran it through as if it
was the file in question. I needed to remove `-Werror=strict-prototypes` and
`-Werror=return-type` from the command line.

It does not reproduce the problem, though:
```
# ia64-linux-gcc -v -Wp,-MMD,net/ipv4/.fib_semantics.o.d -nostdinc
-I./arch/ia64/include -I./arch/ia64/include/generated  -I./include
-I./arch/ia64/include/uapi -I./arch/ia64/include/generated/uapi
-I./include/uapi -I./include/generated/uapi -include
./include/linux/compiler-version.h -include ./include/linux/kconfig.h -include
./include/linux/compiler_types.h -D__KERNEL__ -DHAVE_WORKING_TEXT_ALIGN
-DHAVE_MODEL_SMALL_ATTRIBUTE -DHAVE_SERIALIZE_DIRECTIVE -fmacro-prefix-map=./=
-std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE
-fno-strict-aliasing -pipe -ffixed-r13 -mfixed-range=f12-f15,f32-f127
-frename-registers -fno-optimize-sibling-calls -fno-delete-null-pointer-checks
-O2 -fno-allow-store-data-races -fno-stack-protector -fomit-frame-pointer
-ftrivial-auto-var-init=zero -fno-stack-clash-protection -falign-functions=32
-fstrict-flex-arrays=3 -fno-strict-overflow -fno-stack-check -fconserve-stack
-Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int
-Wno-format-security -Wno-trigraphs -Wno-frame-address
-Wno-address-of-packed-member -Wframe-larger-than=2048 -Wno-main
-Wno-unused-but-set-variable -Wno-unused-const-variable -Wno-dangling-pointer
-Wvla -Wno-pointer-sign -Wcast-function-type -Wno-array-bounds
-Wno-alloc-size-larger-than -Wimplicit-fallthrough=5 -Werror=date-time
-Werror=incompatible-pointer-types -Werror=designated-init -Wenum-conversion
-Wno-unused-but-set-variable -Wno-unused-const-variable -Wno-restrict
-Wno-packed-not-aligned -Wno-format-overflow -Wno-format-truncation
-Wno-stringop-overflow -Wno-stringop-truncation -Wno-missing-field-initializers
-Wno-type-limits -Wno-shift-negative-value -Wno-maybe-uninitialized
-Wno-sign-compare -g  -mconstant-gp 
-DKBUILD_MODFILE='"net/ipv4/fib_semantics"' -DKBUILD_BASENAME='"fib_semantics"'
-DKBUILD_MODNAME='"fib_semantics"' -D__KBUILD_MODNAME=kmod_fib_semantics -c -o
net/ipv4/fib_semantics.o net/ipv4/fib_semantics.c
Using built-in specs.
COLLECT_GCC=ia64-linux-gcc
Target: ia64-linux
Configured with: /home/arnd/git/gcc/configure --host=x86_64-linux-gnu
--build=aarch64-linux --target=ia64-linux --enable-targets=all
--prefix=/home/arnd/cross/x86_64/gcc-13.2.0-nolibc/ia64-linux
--enable-languages=c --without-headers --disable-bootstrap --disable-nls
--disable-threads --disable-shared --disable-libmudflap --disable-libssp
--disable-libgomp --disable-decimal-float --disable-libquadmath
--disable-libatomic --disable-libcc1 --disable-libmpx --enable-checking=release
--with-static-standard-libraries --with-system-libunwind
Thread model: single
Supported LTO compression algorithms: zlib zstd
gcc version 13.2.0 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-nostdinc' '-I' './arch/ia64/include' '-I'
'./arch/ia64/include/generated' '-I' './include' '-I'
'./arch/ia64/include/uapi' '-I' './arch/ia64/include/generated/uapi' '-I'
'./include/uapi' '-I' './include/generated/uapi' '-include'
'./include/linux/compiler-version.h' '-include' './include/linux/kconfig.h'
'-include' './include/linux/compiler_types.h' '-D' '__KERNEL__' '-D'
'HAVE_WORKING_TEXT_ALIGN' '-D' 'HAVE_MODEL_SMALL_ATTRIBUTE' '-D'
'HAVE_SERIALIZE_DIRECTIVE' '-fmacro-prefix-map=./=' '-std=gnu11'
'-fshort-wchar' '-funsigned-char' '-fno-common' '-fno-PIE'
'-fno-strict-aliasing' '-pipe' '-ffixed-r13' '-mfixed-range=f12-f15,f32-f127'
'-frename-registers' '-fno-optimize-sibling-calls'
'-fno-delete-null-pointer-checks' '-O2' '-fno-allow-store-data-races'
'-fno-stack-protector' '-fomit-frame-pointer' '-ftrivial-auto-var-init=zero'
'-fno-stack-clash-protection' '-falign-functions=32' '-fstrict-flex-arrays=3'
'-fno-strict-overflow' '-fstack-check=no' '-fconserve-stack' '-Wall' '-Wundef'
'-Werror=implicit-function-declaration' '-Werror=implicit-int'
'-Wno-format-security' '-Wno-trigraphs' '-Wno-frame-address'
'-Wno-address-of-packed-member' '-Wframe-larger-than=2048' '-Wno-main'
'-Wunused-const-variable=0' '-Wdangling-pointer=0' '-Wvla' '-Wno-pointer-sign'
'-Wcast-function-type' '-Warray-bounds=0'
'-Walloc-size-larger-than=18446744073709551615EiB' '-Wimplicit-fallthrough=5'
'-Werror=date-time' '-Werror=incompatible-pointer-types'
'-Werror=designated-init' '-Wenum-conversion' '-Wno-unused-but-set-variable'
'-Wunused-const-variable=0' '-Wno-restrict' '-Wno-packed-not-aligned'
'-Wformat-overflow=0' '-Wformat-truncation=0' '-Wstringop-overflow=0'
'-Wno-stringop-truncation' '-Wno-missing-field-initializers' '-Wno-type-limits'
'-Wno-shift-negative-value' '-Wno-maybe-uninitialized' '-Wno-sign-compare' '-g'
'-mconstant-gp' '-D' 'KBUILD_MODFILE="net/ipv4/fib_semantics"' '-D'
'KBUILD_BASENAME="fib_semantics"' '-

[Bug target/111425] ia64: ICE in net/ipv4/fib_semantics.c:1621:1: internal compiler error: Segmentation fault

2023-09-18 Thread frank.scheiner at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111425

--- Comment #5 from Frank Scheiner  ---
(In reply to Richard Biener from comment #2)
> Confirmed on trunk - we ICE in cselib during var-tracking, so
> -fno-var-tracking would be a workaround (or -g0).

Also confirming that both - i.e. using `-fno-var-tracking` or `-g0` - indeed
workaround the problem for me (this time with v6.6-rc2 which without those
options still shows the original problem):

```
# ia64-linux-gcc -fno-var-tracking -Wp,-MMD,net/ipv4/.fib_semantics.o.d
-nostdinc -I./arch/ia64/include -I./arch/ia64/include/generated  -I./include
-I./arch/ia64/include/uapi -I./arch/ia64/include/generated/uapi
-I./include/uapi -I./include/generated/uapi -include
./include/linux/compiler-version.h -include ./include/linux/kconfig.h -include
./include/linux/compiler_types.h -D__KERNEL__ -DHAVE_WORKING_TEXT_ALIGN
-DHAVE_MODEL_SMALL_ATTRIBUTE -DHAVE_SERIALIZE_DIRECTIVE -fmacro-prefix-map=./=
-std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE
-fno-strict-aliasing -pipe -ffixed-r13 -mfixed-range=f12-f15,f32-f127
-frename-registers -fno-optimize-sibling-calls -fno-delete-null-pointer-checks
-O2 -fno-allow-store-data-races -fno-stack-protector -fomit-frame-pointer
-ftrivial-auto-var-init=zero -fno-stack-clash-protection -falign-functions=32
-fstrict-flex-arrays=3 -fno-strict-overflow -fno-stack-check -fconserve-stack
-Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int
-Werror=return-type -Werror=strict-prototypes -Wno-format-security
-Wno-trigraphs -Wno-frame-address -Wno-address-of-packed-member
-Wframe-larger-than=2048 -Wno-main -Wno-unused-but-set-variable
-Wno-unused-const-variable -Wno-dangling-pointer -Wvla -Wno-pointer-sign
-Wcast-function-type -Wno-array-bounds -Wno-alloc-size-larger-than
-Wimplicit-fallthrough=5 -Werror=date-time -Werror=incompatible-pointer-types
-Werror=designated-init -Wenum-conversion -Wno-unused-but-set-variable
-Wno-unused-const-variable -Wno-restrict -Wno-packed-not-aligned
-Wno-format-overflow -Wno-format-truncation -Wno-stringop-overflow
-Wno-stringop-truncation -Wno-missing-field-initializers -Wno-type-limits
-Wno-shift-negative-value -Wno-maybe-uninitialized -Wno-sign-compare -g 
-mconstant-gp  -DKBUILD_MODFILE='"net/ipv4/fib_semantics"'
-DKBUILD_BASENAME='"fib_semantics"' -DKBUILD_MODNAME='"fib_semantics"'
-D__KBUILD_MODNAME=kmod_fib_semantics -c -o net/ipv4/fib_semantics.o
net/ipv4/fib_semantics.c

# echo $?
0

# rm net/ipv4/fib_semantics.o

# ia64-linux-gcc -Wp,-MMD,net/ipv4/.fib_semantics.o.d -nostdinc
-I./arch/ia64/include -I./arch/ia64/include/generated  -I./include
-I./arch/ia64/include/uapi -I./arch/ia64/include/generated/uapi
-I./include/uapi -I./include/generated/uapi -include
./include/linux/compiler-version.h -include ./include/linux/kconfig.h -include
./include/linux/compiler_types.h -D__KERNEL__ -DHAVE_WORKING_TEXT_ALIGN
-DHAVE_MODEL_SMALL_ATTRIBUTE -DHAVE_SERIALIZE_DIRECTIVE -fmacro-prefix-map=./=
-std=gnu11 -fshort-wchar -funsigned-char -fno-common -fno-PIE
-fno-strict-aliasing -pipe -ffixed-r13 -mfixed-range=f12-f15,f32-f127
-frename-registers -fno-optimize-sibling-calls -fno-delete-null-pointer-checks
-O2 -fno-allow-store-data-races -fno-stack-protector -fomit-frame-pointer
-ftrivial-auto-var-init=zero -fno-stack-clash-protection -falign-functions=32
-fstrict-flex-arrays=3 -fno-strict-overflow -fno-stack-check -fconserve-stack
-Wall -Wundef -Werror=implicit-function-declaration -Werror=implicit-int
-Werror=return-type -Werror=strict-prototypes -Wno-format-security
-Wno-trigraphs -Wno-frame-address -Wno-address-of-packed-member
-Wframe-larger-than=2048 -Wno-main -Wno-unused-but-set-variable
-Wno-unused-const-variable -Wno-dangling-pointer -Wvla -Wno-pointer-sign
-Wcast-function-type -Wno-array-bounds -Wno-alloc-size-larger-than
-Wimplicit-fallthrough=5 -Werror=date-time -Werror=incompatible-pointer-types
-Werror=designated-init -Wenum-conversion -Wno-unused-but-set-variable
-Wno-unused-const-variable -Wno-restrict -Wno-packed-not-aligned
-Wno-format-overflow -Wno-format-truncation -Wno-stringop-overflow
-Wno-stringop-truncation -Wno-missing-field-initializers -Wno-type-limits
-Wno-shift-negative-value -Wno-maybe-uninitialized -Wno-sign-compare -g0 
-mconstant-gp  -DKBUILD_MODFILE='"net/ipv4/fib_semantics"'
-DKBUILD_BASENAME='"fib_semantics"' -DKBUILD_MODNAME='"fib_semantics"'
-D__KBUILD_MODNAME=kmod_fib_semantics -c -o net/ipv4/fib_semantics.o
net/ipv4/fib_semantics.c

# echo $?
0
```

[Bug target/111425] ia64: ICE in net/ipv4/fib_semantics.c:1621:1: internal compiler error: Segmentation fault

2023-09-21 Thread frank.scheiner at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111425

--- Comment #6 from Frank Scheiner  ---
Dear Richard,

would it be helpful to bisect this problem or is it already known where and
when the problem was introduced?

I anyhow wanted to look into how those cross-compilers over at [1] are built
and a bisecting run could be the right excuse to actually do that.

Cheers,
Frank

[1]: https://mirrors.edge.kernel.org/pub/tools/crosstool/

[Bug target/111425] ia64: ICE in net/ipv4/fib_semantics.c:1621:1: internal compiler error: Segmentation fault

2023-10-08 Thread frank.scheiner at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111425

--- Comment #7 from Frank Scheiner  ---
Hi again,

this problem was bisected by me and I identified the following commit as first
bad commit:

[5fc4d3e1837](https://gcc.gnu.org/git/?p=gcc.git;a=blobdiff;f=gcc/cselib.cc;h=2abc763a3f8ed4f7bb2460b8fd9cba94b6520b59;hp=9b582e5d3d6db03dd6e47d331830a5ef04fcae31;hb=5fc4d3e1837;hpb=e9d50e7a4e290d7476cc7e6b5a8f2f1fb496c570)

Reverting this one for "gcc-releases/gcc-13.1.0" (plus reverting an older
surrounding change ([1]) that broke the build for me) allows to build Linux
v6.6-rc3 without gcc ICEing on valid code in the two mentioned files.

Actually [1] breaks the build for me and [5fc4d3e1837] unbreaks it, but instead
breaks operation for specical cases.

[1]:
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=d0b00b63a39108311f2e6f9cbe9072579f57df7c



Tomáš Glozar  further debugged this and will add his
findings as soon as his account is approved here. I couldn't add his email
address to the CC list, so maybe this depends on the account approval, too.

Cheers,
Frank

P.S.
The bisect log:
```
root@dl380-g7:/usr/src/gcc# git bisect log
git bisect start
# status: waiting for both good and bad commits
# good: [0afa9dfb8fb3302db7f104add5654436927dcb56] c: support the attribute
starting with '_'
git bisect good 0afa9dfb8fb3302db7f104add5654436927dcb56
# status: waiting for bad commit, 1 good commit known
# bad: [ed7278d98e4727a7def30ab91fcef4658e34baa4] git_update_version: add
robust logging
git bisect bad ed7278d98e4727a7def30ab91fcef4658e34baa4
# good: [ba3e5a3826be53ecbb7d6044c50878d44640c296] rs6000: Rework
vsx_extract_
git bisect good ba3e5a3826be53ecbb7d6044c50878d44640c296
# good: [e9d50e7a4e290d7476cc7e6b5a8f2f1fb496c570] Setting explicit NANs sets
UNDEFINED for -ffinite-math-only.
git bisect good e9d50e7a4e290d7476cc7e6b5a8f2f1fb496c570
# bad: [847f5addc4d07a2f3b95f5daa50ab4a64dfd957d] openmp: Map holds clause to
IFN_ASSUME for C/C++
git bisect bad 847f5addc4d07a2f3b95f5daa50ab4a64dfd957d
# bad: [08b51baddc53d64aa4c5e7a81ef3c4bf320293be] c++, c: Implement C++23
P1774R8 - Portable assumptions [PR106654]
git bisect bad 08b51baddc53d64aa4c5e7a81ef3c4bf320293be
# bad: [5fc4d3e1837ea4850aac6460f563913f1d3fc5b8] cselib: Skip BImode while
keeping track of subvalue relations [PR107088]
git bisect bad 5fc4d3e1837ea4850aac6460f563913f1d3fc5b8
# first bad commit: [5fc4d3e1837ea4850aac6460f563913f1d3fc5b8] cselib: Skip
BImode while keeping track of subvalue relations [PR107088]
```

[Bug debug/111425] ia64: ICE in net/ipv4/fib_semantics.c:1621:1: internal compiler error: Segmentation fault

2024-10-14 Thread frank.scheiner at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111425

--- Comment #9 from Frank Scheiner  ---
Looks like this is fixed in gcc-15-20241013, I assume thanks to the fix for
#116627. Just checked that cross-building Linux v6.12-rc3 for ia64 with the
mentioned snapshot now works w/o using the workaround patch ([1]):

```
[...]
Making kernel...
time make -j8 LOCALVERSION="-80ea26b1f-ia64-ice-check" ARCH=ia64
CROSS_COMPILE=ia64-linux- all
Tue Oct 15 12:21:24 AM CEST 2024
[...]
  NM  .tmp_vmlinux2.syms
  KSYMS   .tmp_vmlinux2.kallsyms.S
  AS  .tmp_vmlinux2.kallsyms.o
  LD  vmlinux
  NM  System.map
  OBJCOPY vmlinux.bin
  GZIPvmlinux.gz
No errors detected in 27904 functions.

real7m55.590s
user57m29.416s
sys 2m27.477s
0
Tue Oct 15 12:29:20 AM CEST 2024
```

[1]:
http://epic-linux.org/testing-effort/patches/ia64-linux-workaround-ice-with-gcc-13-v2.patch

Great! Thanks Andrew for linking #116627 to this bug. I have hoped those were
related.

I still need to confirm that with compilers w/ and w/o [2] applied, to be sure,
though. Waiting to mark thsi bug resolved until then.

[2]: https://gcc.gnu.org/g:73726725ae03995ef8b61622c954f7ca70416f79

[Bug debug/111425] ia64: ICE in net/ipv4/fib_semantics.c:1621:1: internal compiler error: Segmentation fault

2024-10-15 Thread frank.scheiner at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111425

Frank Scheiner  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #10 from Frank Scheiner  ---
Got the confirmation (see below). So it really looks this issue here is the
same as #116627, making that one actually a duplicate. Marking this one as
resolved now.

* gcc-at-73726725ae03995ef8b61622c954f7ca70416f79

```
Making kernel...
time make -j8 LOCALVERSION="-80ea26b1f-ia64-ice-check-w-fix" ARCH=ia64
CROSS_COMPILE=ia64-linux- all
Tue Oct 15 06:55:26 PM CEST 2024
[...]
  NM  .tmp_vmlinux2.syms
  KSYMS   .tmp_vmlinux2.kallsyms.S
  AS  .tmp_vmlinux2.kallsyms.o
  LD  vmlinux
  NM  System.map
  OBJCOPY vmlinux.bin
  GZIPvmlinux.gz
No errors detected in 27903 functions.

real7m50.348s
user56m50.040s
sys 2m26.513s
0
Tue Oct 15 07:03:16 PM CEST 2024
```

* gcc-at-f4d0c6acc0ef43d7971f2d53afaa64ca05fb4718:

```
Making kernel...
time make -j8 LOCALVERSION="-80ea26b1f-ia64-ice-check-w-o-fix" ARCH=ia64
CROSS_COMPILE=ia64-linux- all
Tue Oct 15 07:06:22 PM CEST 2024
[...]
during RTL pass: mach
net/ipv4/fib_semantics.c: In function 'fib_create_info':
net/ipv4/fib_semantics.c:1632:1: internal compiler error: Segmentation fault
 1632 | }
  | ^
[...]
0x175bae0 internal_error(char const*, ...)
/usr/src/gcc/gcc/diagnostic-global-context.cc:517
0xc2f0cf crash_signal
/usr/src/gcc/gcc/toplev.cc:321
0xf68327 vt_expand_loc_callback
/usr/src/gcc/gcc/var-tracking.cc:8538
0x7c5c13 cselib_expand_value_rtx_1
/usr/src/gcc/gcc/cselib.cc:2009
0x7c746e cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, int, rtx_def*
(*)(rtx_def*, bitmap_head*, int, void*), void*)
/usr/src/gcc/gcc/cselib.cc:1857
0xf68190 vt_expand_loc_callback
/usr/src/gcc/gcc/var-tracking.cc:8500
0x7c59d6 cselib_expand_value_rtx_1
/usr/src/gcc/gcc/cselib.cc:1974
0x7c746e cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, int, rtx_def*
(*)(rtx_def*, bitmap_head*, int, void*), void*)
/usr/src/gcc/gcc/cselib.cc:1857
0xf670ec vt_expand_var_loc_chain
/usr/src/gcc/gcc/var-tracking.cc:8403
0xf68364 vt_expand_loc_callback
/usr/src/gcc/gcc/var-tracking.cc:8566
0x7c5c13 cselib_expand_value_rtx_1
/usr/src/gcc/gcc/cselib.cc:2009
0x7c746e cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, int, rtx_def*
(*)(rtx_def*, bitmap_head*, int, void*), void*)
/usr/src/gcc/gcc/cselib.cc:1857
0xf62635 vt_expand_loc
/usr/src/gcc/gcc/var-tracking.cc:8655
0xf735b8 emit_notes_in_bb
/usr/src/gcc/gcc/var-tracking.cc:9249
0xf735b8 vt_emit_notes
/usr/src/gcc/gcc/var-tracking.cc:9586
0xf74ef6 variable_tracking_main_1
/usr/src/gcc/gcc/var-tracking.cc:10557
0xf7500b variable_tracking_main()
/usr/src/gcc/gcc/var-tracking.cc:10571
0xfaec8a ia64_reorg
/usr/src/gcc/gcc/config/ia64/ia64.cc:9933
0xbcc959 execute
/usr/src/gcc/gcc/reorg.cc:3932
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
[...]
make[4]: *** [scripts/Makefile.build:229: net/ipv4/fib_semantics.o] Error 1
make[3]: *** [scripts/Makefile.build:478: net/ipv4] Error 2
make[3]: *** Waiting for unfinished jobs
[...]
```

[Bug target/116627] [14/15 Regression] armv6l: ICE in kernel's net/ipv4/ipmr.c

2024-10-15 Thread frank.scheiner at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116627

Frank Scheiner  changed:

   What|Removed |Added

 CC||frank.scheiner at web dot de

--- Comment #10 from Frank Scheiner  ---
(In reply to Richard Biener from comment #9)
> Fixed then I guess.

This also fixed #111425 - which seems to be the same issue, actually - see [1]
and [2]. NICE! 

[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111425#c9

[2]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111425#c10

[Bug c/117190] [15 Regression] ICE on linux-6.11.3: in size_binop_loc, at fold-const.cc:2085

2024-10-21 Thread frank.scheiner at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117190

Frank Scheiner  changed:

   What|Removed |Added

 CC||frank.scheiner at web dot de

--- Comment #5 from Frank Scheiner  ---
This issue also affects cross-compilation for ia64 on x86_64 using the latest
GCC snapshot (gcc-15-20241020), though for a different file in the Linux
v6.12-rc4 (w/ia64) ([1]) sources, namely: lib/fonts/font_8x8.c.

```
[...]
  CC  lib/fonts/font_8x8.o
  CC  net/sched/sch_mq.o
lib/fonts/font_8x8.c:2584:1: internal compiler error: in size_binop_loc, at
fold-const.cc:2085
 2584 | };
  | ^
  CC [M]  drivers/char/ipmi/ipmi_si_hotmod.o
[...]
  AR  drivers/soc/loongson/built-in.a
0x17a1200 internal_error(char const*, ...)
/usr/src/gcc/gcc/diagnostic-global-context.cc:517
0x61909f fancy_abort(char const*, int, char const*)
/usr/src/gcc/gcc/diagnostic.cc:1551
  CC  net/sched/sch_api.o
  AR  drivers/soc/mediatek/built-in.a
  AR  drivers/soc/microchip/built-in.a
  CC  kernel/cgroup/freezer.o
  CC  net/netlink/genetlink.o
  AR  drivers/soc/nuvoton/built-in.a
0x5eb81f size_binop_loc(unsigned int, tree_code, tree_node*, tree_node*)
/usr/src/gcc/gcc/fold-const.cc:2085
  AR  drivers/soc/pxa/built-in.a
  CC  drivers/pci/host-bridge.o
0xf90739 array_size_for_constructor
/usr/src/gcc/gcc/varasm.cc:5490
0xf90739 output_constructor_regular_field
/usr/src/gcc/gcc/varasm.cc:5660
0xf90739 output_constructor
/usr/src/gcc/gcc/varasm.cc:5956
0xf90a01 assemble_variable_contents
/usr/src/gcc/gcc/varasm.cc:2269
0xf93297 assemble_variable(tree_node*, int, int, int)
/usr/src/gcc/gcc/varasm.cc:2448
  AR  drivers/soc/amlogic/built-in.a
0xf95cda varpool_node::assemble_decl()
/usr/src/gcc/gcc/varpool.cc:596
0xf95cda varpool_node::assemble_decl()
/usr/src/gcc/gcc/varpool.cc:564
0xf966ee symbol_table::output_variables()
/usr/src/gcc/gcc/varpool.cc:764
0x7c014d symbol_table::compile()
/usr/src/gcc/gcc/cgraphunit.cc:2407
0x7c2e37 symbol_table::compile()
/usr/src/gcc/gcc/cgraphunit.cc:2315
0x7c2e37 symbol_table::finalize_compilation_unit()
/usr/src/gcc/gcc/cgraphunit.cc:2589
  AR  drivers/soc/qcom/built-in.a
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
```

[1]: https://github.com/johnny-mnemonic/linux-ia64/tree/v6.12-rc4-w-ia64

[Bug c/117190] [15 Regression] ICE on linux-6.11.3: in size_binop_loc, at fold-const.cc:2085

2024-10-21 Thread frank.scheiner at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117190

--- Comment #7 from Frank Scheiner  ---
(In reply to Jakub Jelinek from comment #3)
> Another option would be to revert r15-4402 and r15-4377 and reapply once
> this fix is tested and approved.

Reverting both commits results in a working compiler:

```
# bski /usr/src/ski/ski-bootloader/ski-bootloader
/boot/vmlinux-6.12.0-rc4-4714f12a36a0-ia64-ski-hp-sim-00037-g4714f12a36a0-dirty
root=/dev/sda simscsi=./sd simeth=enp3s0f0 init=/root/bin/ski_test.bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin rw memblock=debug & 
loading
/boot/vmlinux-6.12.0-rc4-4714f12a36a0-ia64-ski-hp-sim-00037-g4714f12a36a0-dirty...
probing initramfs ...
initramfs not passed
starting kernel...
Linux version 6.12.0-4714f12a36a0-ia64-ski-hp-sim-g4714f12a36a0-dirty
(root@dl380-g7) (ia64-linux-gcc (GCC) 15.0.0 20241020 (experimental), GNU ld
(GNU Binutils) 2.43.1) #1 SMP PREEMPT Mon Oct 21 15:06:56 CEST 2024
efi: EFI v1.0 by Hewlett-Packard
efi: SALsystab=0x10a510 
warning: unable to switch EFI into virtual mode (status=131)
No I/O port range found in EFI memory map, falling back to AR.KR0
(0xc00)
printk: legacy console [simcons0] enabled
[...]
```

[Bug c/117190] [15 Regression] ICE on linux-6.11.3: in size_binop_loc, at fold-const.cc:2085

2024-10-21 Thread frank.scheiner at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117190

--- Comment #6 from Frank Scheiner  ---
(In reply to Jakub Jelinek from comment #2)
> Created attachment 59372 [details]
> gcc15-pr117190.patch
> 
> Untested fix.
Unfortunately applying the patch onto gcc-15-20241020
(01f50ebfd97a7bd17a4cc94c403a8e126986c02c) makes it only worse for my use case:

```
[...]
  CC  init/main.o
during RTL pass: dse2
init/main.c: In function 'set_reset_devices':
init/main.c:187:1: internal compiler error: Segmentation fault
  187 | }
  | ^
0x17a1200 internal_error(char const*, ...)
/usr/src/gcc/gcc/diagnostic-global-context.cc:517
0xc3918f crash_signal
/usr/src/gcc/gcc/toplev.cc:321
0xc14ae0 poly_int_rtx_p(rtx_def const*, poly_int<1u, long>*)
/usr/src/gcc/gcc/rtl.h:2418
0xc14ae0 simplify_context::simplify_binary_operation_1(rtx_code, machine_mode,
rtx_def*, rtx_def*, rtx_def*, rtx_def*)
/usr/src/gcc/gcc/simplify-rtx.cc:2880
0xc1748d simplify_context::simplify_binary_operation(rtx_code, machine_mode,
rtx_def*, rtx_def*)
/usr/src/gcc/gcc/simplify-rtx.cc:2682
0xc199fc simplify_binary_operation(rtx_code, machine_mode, rtx_def*, rtx_def*)
/usr/src/gcc/gcc/rtl.h:3503
0xc199fc simplify_rtx(rtx_def const*)
/usr/src/gcc/gcc/simplify-rtx.cc:8136
0x7ce297 cselib_expand_value_rtx_1
/usr/src/gcc/gcc/cselib.cc:2154
0x7ce468 expand_loc
/usr/src/gcc/gcc/cselib.cc:1782
0x7ce180 cselib_expand_value_rtx_1
/usr/src/gcc/gcc/cselib.cc:1945
0x7cfa06 cselib_expand_value_rtx(rtx_def*, bitmap_head*, int)
/usr/src/gcc/gcc/cselib.cc:1842
0x1578119 canon_address
/usr/src/gcc/gcc/dse.cc:1157
0x15789c0 record_store
/usr/src/gcc/gcc/dse.cc:1431
0x157ab3a scan_insn
/usr/src/gcc/gcc/dse.cc:2692
0x157ab3a dse_step1
/usr/src/gcc/gcc/dse.cc:2809
0x157ab3a rest_of_handle_dse
/usr/src/gcc/gcc/dse.cc:3726
0x157ab3a execute
/usr/src/gcc/gcc/dse.cc:3799
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
make[3]: *** [scripts/Makefile.build:229: init/main.o] Error 1
make[2]: *** [scripts/Makefile.build:478: init] Error 2
make[1]: *** [/dev/shm/torvalds-linux/Makefile:1936: .] Error 2
make: *** [Makefile:224: __sub-make] Error 2
```
...as it already breaks early on. Haven't yet tested reverting the mentioned
commits.

[Bug c/117190] [15 Regression] ICE on linux-6.11.3: in size_binop_loc, at fold-const.cc:2085

2024-10-22 Thread frank.scheiner at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117190

--- Comment #9 from Frank Scheiner  ---
(In reply to GCC Commits from comment #8)
> The master branch has been updated by Jakub Jelinek :
> 
> https://gcc.gnu.org/g:8f173da4520ddf64f3926580042f1103146bf0bd

Works splendid for my use case. Much obliged.

[Bug c/117190] [15 Regression] ICE on linux-6.11.3: in size_binop_loc, at fold-const.cc:2085

2024-10-22 Thread frank.scheiner at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117190

--- Comment #11 from Frank Scheiner  ---
(In reply to GCC Commits from comment #10)
> The master branch has been updated by Jakub Jelinek :
> 
> https://gcc.gnu.org/g:a6db5908a55adbef0a0dc1eb2a22743064fe17b8
> 
> commit r15-4554-ga6db5908a55adbef0a0dc1eb2a22743064fe17b8
> Author: Jakub Jelinek 
> Date:   Tue Oct 22 22:36:03 2024 +0200
> 
> c: Better fix for speed up compilation of large char array initializers
> when not using #embed [PR117190]
Works the same, but in my case is actually slower than with the prior fix (only
two tests so far per compiler):

https://gcc.gnu.org/g:8f173da4520ddf64f3926580042f1103146bf0bd

real7m55.154s
user57m31.140s
sys 2m26.230s

=> 1. Done with fresh clone.

real7m55.196s
user57m27.089s
sys 2m26.544s

=> 4. Done with mrpropered sources from 3.

https://gcc.gnu.org/g:a6db5908a55adbef0a0dc1eb2a22743064fe17b8

real7m58.186s
user57m49.545s
sys 2m28.443s

=> 2. Done with fresh clone.

real7m58.135s
user57m49.629s
sys 2m29.433s

=> 3. Done with mrpropered sources from 2.

[Bug c/117190] [15 Regression] ICE on linux-6.11.3: in size_binop_loc, at fold-const.cc:2085

2024-10-23 Thread frank.scheiner at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117190

--- Comment #14 from Frank Scheiner  ---
(In reply to Sam James from comment #13)
> I would file a new bug with preprocessed sources if you can identify a
> testcase which is slower.

Preprocessed sources for a whole kernel build?

[Bug c/117190] [15 Regression] ICE on linux-6.11.3: in size_binop_loc, at fold-const.cc:2085

2024-10-23 Thread frank.scheiner at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117190

--- Comment #16 from Frank Scheiner  ---
(In reply to Sam James from comment #15)
> I meant identify a single file which takes longer, possibly by using
> -time=/tmp/kernel to record how long each file takes on a good+bad build,
> then diffing the two.
That could be an interesting exercise though it can't be much per file if the
whole build reproduces a difference of around 3 seconds between different GCCs
with short of 8 mins for the whole build. But I'm also unsure if the timings
for single files will reproduce well enough between builds. Hm, maybe with
fixed processor frequency.

Still, I don't expect that new results would contradict the existing results.

[Bug c/117190] [15 Regression] ICE on linux-6.11.3: in size_binop_loc, at fold-const.cc:2085

2024-10-23 Thread frank.scheiner at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117190

--- Comment #18 from Frank Scheiner  ---
(In reply to Sam James from comment #17)
> It's not really actionable without some self-contained testcase like that,
> unless Jakub has some other idea.

Oh, don't get me wrong, I don't urge anybody to do anything about that. My
comment (#11) was simply meant as feedback as the commit message spoke of speed
up.

[Bug tree-optimization/117330] [15 Regression] ICE on Linux 6.12-rc5: in vect_get_operand_map, at tree-vect-slp.cc:552

2024-10-28 Thread frank.scheiner at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117330

--- Comment #6 from Frank Scheiner  ---
(In reply to Andrew Pinski from comment #5)
> r15-4695-gd17e672ce82e69

I'm reducing now, it's at:

```
00:05:53 INFO (26.4%, 2952452 bytes, 47018 lines)
```

Should I stop it?

[Bug c/117330] New: [15 Regression] ICE on Linux 6.12-rc5: in vect_get_operand_map, at tree-vect-slp.cc:552

2024-10-28 Thread frank.scheiner at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117330

Bug ID: 117330
   Summary: [15 Regression] ICE on Linux 6.12-rc5: in
vect_get_operand_map, at tree-vect-slp.cc:552
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: frank.scheiner at web dot de
  Target Milestone: ---

Created attachment 59472
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59472&action=edit
Preprocessed source

Using the latest snapshot (gcc-15-20241027, commit
b281e13ecad12d07209924a7282c53be3a1c3774) leads to an ICE in
vect_get_operand_map, at tree-vect-slp.cc:552 when trying to cross-compile (on
x86_64 for ia64) Linux v6.12-rc5 ([1]). This is new and not present in the
prior snapshot (gcc-15-20241020, commit
01f50ebfd97a7bd17a4cc94c403a8e126986c02c with PR):

```
root@dl380-g7:/usr/src/ramdisk/torvalds-linux# ia64-linux-gcc -v -freport-bug
-Wp,-MMD,kernel/sched/.build_utility.o.d -nostdinc -I./arch/ia64/include
-I./arch/ia64/include/generated  -I./include -I./arch/ia64/include/uapi
-I./arch/ia64/include/generated/uapi -I./include/uapi
-I./include/generated/uapi -include ./include/linux/compiler-version.h -include
./include/linux/kconfig.h -include ./include/linux/compiler_types.h
-D__KERNEL__ -DHAVE_WORKING_TEXT_ALIGN -DHAVE_MODEL_SMALL_ATTRIBUTE
-DHAVE_SERIALIZE_DIRECTIVE -fmacro-prefix-map=./= -std=gnu11 -fshort-wchar
-funsigned-char -fno-common -fno-PIE -fno-strict-aliasing -pipe -ffixed-r13
-mfixed-range=f12-f15,f32-f127 -frename-registers -fno-optimize-sibling-calls
-fno-delete-null-pointer-checks -O2 -fno-allow-store-data-races
-fno-stack-protector -fomit-frame-pointer -ftrivial-auto-var-init=zero
-fno-stack-clash-protection -fmin-function-alignment=32 -fstrict-flex-arrays=3
-fno-strict-overflow -fno-stack-check -fconserve-stack -Wall -Wundef
-Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type
-Werror=strict-prototypes -Wno-format-security -Wno-trigraphs
-Wno-frame-address -Wno-address-of-packed-member -Wmissing-declarations
-Wmissing-prototypes -Wframe-larger-than=2048 -Wno-main -Wno-dangling-pointer
-Wvla -Wno-pointer-sign -Wcast-function-type -Wno-stringop-overflow
-Wno-array-bounds -Wno-alloc-size-larger-than -Wimplicit-fallthrough=5
-Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init
-Wenum-conversion -Wextra -Wunused -Wno-unused-but-set-variable
-Wno-unused-const-variable -Wno-packed-not-aligned -Wno-format-overflow
-Wno-format-truncation -Wno-stringop-truncation -Wno-override-init
-Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value
-Wno-maybe-uninitialized -Wno-sign-compare -Wno-unused-parameter -g
-Wno-unused-but-set-variable  -mconstant-gp 
-DKBUILD_MODFILE='"kernel/sched/build_utility"'
-DKBUILD_BASENAME='"build_utility"' -DKBUILD_MODNAME='"build_utility"'
-D__KBUILD_MODNAME=kmod_build_utility -c -o kernel/sched/build_utility.o
kernel/sched/build_utility.c
Using built-in specs.
COLLECT_GCC=ia64-linux-gcc
Target: ia64-linux
Configured with: /usr/src/gcc/configure --target=ia64-linux
--enable-targets=all --prefix=/opt/gcc-15-20241027-nolibc/ia64-linux
--enable-languages=c --without-headers --disable-bootstrap --disable-nls
--disable-threads --disable-shared --disable-libmudflap --disable-libssp
--disable-libgomp --disable-decimal-float --disable-libquadmath
--disable-libatomic --disable-libcc1 --disable-libmpx --enable-checking=release
--with-system-libunwind
Thread model: single
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20241027 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-v' '-freport-bug' '-nostdinc' '-I' './arch/ia64/include'
'-I' './arch/ia64/include/generated' '-I' './include' '-I'
'./arch/ia64/include/uapi' '-I' './arch/ia64/include/generated/uapi' '-I'
'./include/uapi' '-I' './include/generated/uapi' '-include'
'./include/linux/compiler-version.h' '-include' './include/linux/kconfig.h'
'-include' './include/linux/compiler_types.h' '-D' '__KERNEL__' '-D'
'HAVE_WORKING_TEXT_ALIGN' '-D' 'HAVE_MODEL_SMALL_ATTRIBUTE' '-D'
'HAVE_SERIALIZE_DIRECTIVE' '-fmacro-prefix-map=./=' '-std=gnu11'
'-fshort-wchar' '-funsigned-char' '-fno-common' '-fno-PIE'
'-fno-strict-aliasing' '-pipe' '-ffixed-r13' '-mfixed-range=f12-f15,f32-f127'
'-frename-registers' '-fno-optimize-sibling-calls'
'-fno-delete-null-pointer-checks' '-O2' '-fno-allow-store-data-races'
'-fno-stack-protector' '-fomit-frame-pointer' '-ftrivial-auto-var-init=zero'
'-fno-stack-clash-protection' '-fmin-function-alignment=32'
'-fstrict-flex-arrays=3' '-fno-strict-overflow' '-fstack-check=no'
'-fconserve-stack' '-Wall' '-Wundef' '-Werror=implicit-function-declaration'
'-Werror=implicit-int' '-Werror=return-type' '-Werror=strict-prototypes'
'-Wno-format-security' '-Wno-trigraphs' '-Wno-frame-address'
'-Wno-address-of-packed-member' '-Wmissing-declarations' '-Wm

[Bug tree-optimization/117330] [15 Regression] ICE on Linux 6.12-rc5: in vect_get_operand_map, at tree-vect-slp.cc:552 since r15-4695-gd17e672ce82e69

2024-10-28 Thread frank.scheiner at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117330

--- Comment #11 from Frank Scheiner  ---
Created attachment 59479
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59479&action=edit
reduced source

cvise reduced it to:

```
enum psi_states {
  PSI_IO_SOME,
  PSI_NONIDLE,
  NR_PSI_STATES
} *
get_recent_times_times;
long collect_percpu_times_state_start;
int collect_percpu_times_state_mask, collect_percpu_times_delta;
void collect_percpu_times() {
  enum psi_states s = 0;
  for (; s < NR_PSI_STATES; s++) {
if (collect_percpu_times_state_mask)
  get_recent_times_times[s] += collect_percpu_times_state_start;
get_recent_times_times[s] = collect_percpu_times_delta;
  }
}
```

, also attached as "reduced source".

[Bug tree-optimization/117330] [15 Regression] ICE on Linux 6.12-rc5: in vect_get_operand_map, at tree-vect-slp.cc:552 since r15-4695-gd17e672ce82e69

2024-10-28 Thread frank.scheiner at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117330

--- Comment #12 from Frank Scheiner  ---
(In reply to Andrew Pinski from comment #9)
> Looks to be fixed by r15-4713-g0942bb85fc5573 .

Indeed, that fixes it!

Using a cross-compiler based on r15-4713-g0942bb85fc5573:
```
# ia64-linux-gcc -c -O2 -Wfatal-errors ccQVSPLJ-mod.i
# echo $?
0
```



On a side note, an aarch64 cross-compiler based on gcc-15-20241027 seems
unaffected by that issue:
```
# aarch64-linux-gcc -c -O2 -Wfatal-errors ccQVSPLJ-mod.i
# echo $?
0
```

Maybe I should try to reproduce with an arm(v6l) cross-compiler as per PR116627
instead.

[Bug tree-optimization/117330] [15 Regression] ICE on Linux 6.12-rc5: in vect_get_operand_map, at tree-vect-slp.cc:552 since r15-4695-gd17e672ce82e69

2024-10-28 Thread frank.scheiner at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117330

--- Comment #8 from Frank Scheiner  ---
(In reply to Sam James from comment #7)
> The testcase will be useful irrespective of the bisect result. richi added
> the asserts to find testcases, even :)

Yeah, I somehow did overlook that the addition of `gcc_unreachable ();` was
just made in the very last commit to `gcc/tree-vect-slp.cc`.

[Bug c/117330] [15 Regression] ICE on Linux 6.12-rc5: in vect_get_operand_map, at tree-vect-slp.cc:552

2024-10-28 Thread frank.scheiner at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117330

--- Comment #1 from Frank Scheiner  ---
Using `fno-strict-aliasing -fwrapv` made no difference.

[Bug tree-optimization/117330] [15 Regression] ICE on Linux 6.12-rc5: in vect_get_operand_map, at tree-vect-slp.cc:552

2024-10-28 Thread frank.scheiner at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117330

--- Comment #3 from Frank Scheiner  ---
(In reply to Sam James from comment #2)
> Please try to minimise the command to reproduce as well with the
> preprocessed sources, and then consider using cvise or delta or ... to
> minimise the source code.

That will take some time. I also ran it with `-O1`, `-Os` and `-O0` which made
the compilation of the source file succeed. So a workaround is possible - at
least for that one file. Because when compiling this kernel version with 24
parallel jobs showed that this latest snapshot also fails on other files:

```
during GIMPLE pass: slp
fs/crypto/policy.c: In function 'fscrypt_supported_policy':
fs/crypto/policy.c:302:6: internal compiler error: in vect_get_operand_map, at
tree-vect-slp.cc:552
  302 | bool fscrypt_supported_policy(const union fscrypt_policy *policy_u,
  |  ^~~~

during GIMPLE pass: vect
lib/zlib_deflate/deflate.c: In function 'fill_window':
lib/zlib_deflate/deflate.c:744:13: internal compiler error: in
vect_get_operand_map, at tree-vect-slp.cc:552
  744 | static void fill_window(
  | ^~~

during GIMPLE pass: vect
block/partitions/efi.c: In function 'efi_partition':
block/partitions/efi.c:713:5: internal compiler error: in vect_get_operand_map,
at tree-vect-slp.cc:552
  713 | int efi_partition(struct parsed_partitions *state)
  | ^

during GIMPLE pass: slp
io_uring/poll.c: In function 'io_poll_remove_prep':
io_uring/poll.c:920:5: internal compiler error: in vect_get_operand_map, at
tree-vect-slp.cc:552
  920 | int io_poll_remove_prep(struct io_kiocb *req, const struct io_uring_sqe
*sqe)
  | ^~~

during GIMPLE pass: vect
security/integrity/ima/ima_template.c: In function 'template_desc_init_fields':
security/integrity/ima/ima_template.c:208:5: internal compiler error: in
vect_get_operand_map, at tree-vect-slp.cc:552
  208 | int template_desc_init_fields(const char *template_fmt,
  | ^

during GIMPLE pass: vect
security/apparmor/policy_unpack.c: In function 'unpack_pdb':
security/apparmor/policy_unpack.c:708:12: internal compiler error: in
vect_get_operand_map, at tree-vect-slp.cc:552
  708 | static int unpack_pdb(struct aa_ext *e, struct aa_policydb **policy,
  |^~

during GIMPLE pass: vect
mm/vmstat.c: In function 'extfrag_show':
mm/vmstat.c:2300:12: internal compiler error: in vect_get_operand_map, at
tree-vect-slp.cc:552
 2300 | static int extfrag_show(struct seq_file *m, void *arg)
  |^~~~

during GIMPLE pass: vect
security/selinux/ss/services.c: In function 'security_compute_av':
security/selinux/ss/services.c:1094:6: internal compiler error: in
vect_get_operand_map, at tree-vect-slp.cc:552
 1094 | void security_compute_av(u32 ssid,
  |  ^~~
```

[Bug tree-optimization/117330] [15 Regression] ICE on Linux 6.12-rc5: in vect_get_operand_map, at tree-vect-slp.cc:552

2024-10-28 Thread frank.scheiner at web dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117330

--- Comment #4 from Frank Scheiner  ---
The shortest commandline to reproduce this is:

```
# ia64-linux-gcc -c -O2 ccQVSPLJ.i
during GIMPLE pass: vect
In file included from kernel/sched/build_utility.c:96:
kernel/sched/psi.c: In function 'collect_percpu_times':
kernel/sched/psi.c:340:13: internal compiler error: in vect_get_operand_map, at
tree-vect-slp.cc:552
0x17b3f80 internal_error(char const*, ...)
/usr/src/gcc/gcc/diagnostic-global-context.cc:518
0x61b159 fancy_abort(char const*, int, char const*)
/usr/src/gcc/gcc/diagnostic.cc:1580
0x609f29 vect_get_operand_map
/usr/src/gcc/gcc/tree-vect-slp.cc:552
0xf04fc0 vect_build_slp_tree_2
/usr/src/gcc/gcc/tree-vect-slp.cc:1911
0xf09c6c vect_build_slp_tree
/usr/src/gcc/gcc/tree-vect-slp.cc:1806
0xf0511c vect_build_slp_tree_2
/usr/src/gcc/gcc/tree-vect-slp.cc:2743
0xf09c6c vect_build_slp_tree
/usr/src/gcc/gcc/tree-vect-slp.cc:1806
0xf0511c vect_build_slp_tree_2
/usr/src/gcc/gcc/tree-vect-slp.cc:2743
0xf09c6c vect_build_slp_tree
/usr/src/gcc/gcc/tree-vect-slp.cc:1806
0xf0511c vect_build_slp_tree_2
/usr/src/gcc/gcc/tree-vect-slp.cc:2743
0xf09c6c vect_build_slp_tree
/usr/src/gcc/gcc/tree-vect-slp.cc:1806
0xf0b09c vect_build_slp_instance
/usr/src/gcc/gcc/tree-vect-slp.cc:3851
0xf108be vect_analyze_slp(vec_info*, unsigned int, bool)
/usr/src/gcc/gcc/tree-vect-slp.cc:4731
0xedf14d vect_analyze_loop_2
/usr/src/gcc/gcc/tree-vect-loop.cc:2885
0xee0be8 vect_analyze_loop_1
/usr/src/gcc/gcc/tree-vect-loop.cc:3454
0xee140a vect_analyze_loop(loop*, gimple*, vec_info_shared*)
/usr/src/gcc/gcc/tree-vect-loop.cc:3614
0xf2709d try_vectorize_loop_1
/usr/src/gcc/gcc/tree-vectorizer.cc:1072
0xf2709d try_vectorize_loop
/usr/src/gcc/gcc/tree-vectorizer.cc:1189
0xf27824 execute
/usr/src/gcc/gcc/tree-vectorizer.cc:1305
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
```

Similarly to above, it succeeds with `-O1`, `-Os` and `-O0` instead.