[Bug bootstrap/106472] No rule to make target '../libbacktrace/libbacktrace.la', needed by 'libgo.la'.

2022-08-29 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106472

--- Comment #16 from matoro  ---
I also observed this issue on alpha-unknown-linux-gnu, with gcc 12.2.

[Bug go/103847] New: gccgo SIGSEGV in libgo standard library on sparc64

2021-12-27 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103847

Bug ID: 103847
   Summary: gccgo SIGSEGV in libgo standard library on sparc64
   Product: gcc
   Version: 11.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: go
  Assignee: ian at airs dot com
  Reporter: matoro_gcc_bugzilla at matoro dot tk
CC: cmang at google dot com
  Target Milestone: ---

$ go version
go version go1.16.5 gccgo (Gentoo 11.2.1_p20211127 p2) 11.2.1 20211127
linux/sparc64

$ gccgo -v
Using built-in specs.
COLLECT_GCC=gccgo
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/sparc64-unknown-linux-gnu/11.2.1/lto-wrapper
Target: sparc64-unknown-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/gcc-11-20211127/configure
--host=sparc64-unknown-linux-gnu --build=sparc64-unknown-linux-gnu
--prefix=/usr --bindir=/usr/sparc64-unknown-linux-gnu/gcc-bin/11.2.1
--includedir=/usr/lib/gcc/sparc64-unknown-linux-gnu/11.2.1/include
--datadir=/usr/share/gcc-data/sparc64-unknown-linux-gnu/11.2.1
--mandir=/usr/share/gcc-data/sparc64-unknown-linux-gnu/11.2.1/man
--infodir=/usr/share/gcc-data/sparc64-unknown-linux-gnu/11.2.1/info
--with-gxx-include-dir=/usr/lib/gcc/sparc64-unknown-linux-gnu/11.2.1/include/g++-v11
--with-python-dir=/share/gcc-data/sparc64-unknown-linux-gnu/11.2.1/python
--enable-languages=c,c++,go --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --enable-nls --without-included-gettext
--disable-libunwind-exceptions --enable-checking=release
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo
11.2.1_p20211127 p2' --disable-esp --enable-libstdcxx-time
--with-build-config=bootstrap-lto --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu --disable-multilib
--disable-fixed-point --enable-targets=all --enable-libgomp --disable-libssp
--disable-libada --disable-cet --disable-systemtap
--disable-valgrind-annotations --disable-vtable-verify --disable-libvtv
--without-zstd --enable-lto --with-isl --disable-isl-version-check
--enable-default-pie --enable-default-ssp
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.2.1 20211127 (Gentoo 11.2.1_p20211127 p2) 

$ uname -a
Linux 5.15.11-gentoo-sparc64 #1 SMP sparc64 sun4v UltraSparc T4 (Niagara4)
GNU/Linux


I am attempting to build a simple go application using gccgo on this sparc64
host, but keep getting compiler SEGV inside the libgo standard library.  This
is happening for pretty much all commands except for simple version checks.

When trying to build from a fresh clone, the crash seem to be in network
related code as dependencies are pulled down.

When trying to build in an environment where dependencies are pre-downloaded,
the crash seems to be in semaphore synchronization.

Both runs were done with GOMAXPROCS=1 in order to make the traceback logs
deterministic.  I also attempted to bootstrap the gc compiler using gcc, but
got the same results.  I've attached the crash logs from the two different
types of builds I attempted as build-with-network.log and
build-without-network.log, respectively.

[Bug go/103847] gccgo SIGSEGV in libgo standard library on sparc64

2021-12-27 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103847

matoro  changed:

   What|Removed |Added

 CC||matoro_gcc_bugzilla@matoro.
   ||tk

--- Comment #1 from matoro  ---
Created attachment 52072
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52072&action=edit
build-with-network.log

[Bug go/103847] gccgo SIGSEGV in libgo standard library on sparc64

2021-12-27 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103847

--- Comment #2 from matoro  ---
Created attachment 52073
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52073&action=edit
build-without-network.log

[Bug go/103847] gccgo SIGSEGV in libgo standard library on sparc64

2021-12-27 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103847

--- Comment #3 from matoro  ---
Oh, and just for reference, I did confirm that these crashes do not occur on
amd64.

[Bug go/103847] gccgo SIGSEGV in libgo standard library on sparc64

2021-12-28 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103847

--- Comment #5 from matoro  ---
(In reply to Ian Lance Taylor from comment #4)
> There don't seem to be any sparc64-linux machines in the GCC compile farm,
> so I can't recreate this myself.
> 
> Are you able to recreate the problem while running under gdb?  A backtrace
> from the point of the signal might help.  The stack backtraces you included
> unfortunately don't tell me anything useful.  Thanks.

For some reason despite compiling with debug symbols I can't seem to get gdb to
recognize the symbol table, all I get is:

$ GOMAXPROCS=1 CGO_ENABLED=1 GO111MODULE=on gdb -q --args /usr/bin/go-11 build
Reading symbols from /usr/bin/go-11...
(gdb) r
Starting program: /usr/bin/go-11 build
[New LWP 51735]
[New LWP 51736]

Thread 1 "go-11" received signal SIGSEGV, Segmentation fault.
0xfff80001010c11ac in ?? ()
(gdb) bt full
#0  0xfff80001010c11ac in ?? ()
No symbol table info available.
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) 


$ file -L /usr/bin/go-11
/usr/bin/go-11: ELF 64-bit MSB pie executable, SPARC V9, relaxed memory
ordering, version 1 (SYSV), dynamically linked, interpreter
/lib64/ld-linux.so.2, for GNU/Linux 3.2.0, with debug_info, not stripped
$ ldd /usr/bin/go-11
linux-vdso.so.1 (0xfff800010068)
libgo.so.19 =>
/usr/lib/gcc/sparc64-unknown-linux-gnu/11.2.1/libgo.so.19 (0xfff8000100684000)
libm.so.6 => /lib64/libm.so.6 (0xfff80001020c)
libc.so.6 => /lib64/libc.so.6 (0xfff8000102278000)
libgcc_s.so.1 =>
/usr/lib/gcc/sparc64-unknown-linux-gnu/11.2.1/libgcc_s.so.1
(0xfff8000102508000)
/lib64/ld-linux.so.2 (0xfff80001)
$ file -L /usr/lib/gcc/sparc64-unknown-linux-gnu/11.2.1/libgo.so.19
/usr/lib/gcc/sparc64-unknown-linux-gnu/11.2.1/libgo.so.19: ELF 64-bit MSB
shared object, SPARC V9, relaxed memory ordering, version 1 (SYSV), dynamically
linked, with debug_info, not stripped
$ readelf -S /usr/bin/go-11 | grep -i "debug"
  [27] .debug_arangesPROGBITS   005ad1e6
  [28] .debug_info   PROGBITS   005ade86
  [29] .debug_abbrev PROGBITS   0075e02a
  [30] .debug_line   PROGBITS   00772a5a
  [31] .debug_frame  PROGBITS   007f5b20
  [32] .debug_strPROGBITS   007f5b70
  [33] .debug_line_str   PROGBITS   00846a06
  [34] .debug_loclists   PROGBITS   0084adc8
  [35] .debug_rnglists   PROGBITS   0094e386



I am able to provide ssh access to the live system on which this is occurring -
would that be helpful or is that not really something you prefer to do in the
course of debugging?

[Bug go/103847] gccgo SIGSEGV in libgo standard library on sparc64

2021-12-28 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103847

--- Comment #7 from matoro  ---
(In reply to Ian Lance Taylor from comment #6)
> I can try debugging it with ssh access.  I'll want to build my own copy of
> gccgo.  Let me know where I should send the public key.  Thanks.

matoro_gcc_bugzilla  matoro  tk

[Bug bootstrap/106472] No rule to make target '../libbacktrace/libbacktrace.la', needed by 'libgo.la'.

2022-11-01 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106472

--- Comment #22 from matoro  ---
This is still a problem on the gcc-12 branch, at least as of 20221008. 
Attaching a complete log from a -j1 build.

[Bug bootstrap/106472] No rule to make target '../libbacktrace/libbacktrace.la', needed by 'libgo.la'.

2022-11-01 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106472

--- Comment #23 from matoro  ---
Created attachment 53810
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53810&action=edit
build log

[Bug target/105445] New: miscompile on ia64 with -foptimize-sibling-calls

2022-04-30 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105445

Bug ID: 105445
   Summary: miscompile on ia64 with -foptimize-sibling-calls
   Product: gcc
   Version: 11.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: matoro_gcc_bugzilla at matoro dot tk
  Target Milestone: ---

On ia64, the berkeleydb python module (
https://www.jcea.es/programacion/pybsddb.htm ,
https://pypi.org/project/berkeleydb/ ) is generating code that triggers a
SIGILL during unit tests with -O2.  The code does not crash with -O2
-fno-optimize-sibling-calls.  I apologize for not having a minimized test case.
 Preprocessed source is attached though.

GCC details:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/ia64-unknown-linux-gnu/11.3.0/lto-wrapper
Target: ia64-unknown-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-11.3.0/work/gcc-11.3.0/configure
--host=ia64-unknown-linux-gnu --build=ia64-unknown-linux-gnu --prefix=/usr
--bindir=/usr/ia64-unknown-linux-gnu/gcc-bin/11.3.0
--includedir=/usr/lib/gcc/ia64-unknown-linux-gnu/11.3.0/include
--datadir=/usr/share/gcc-data/ia64-unknown-linux-gnu/11.3.0
--mandir=/usr/share/gcc-data/ia64-unknown-linux-gnu/11.3.0/man
--infodir=/usr/share/gcc-data/ia64-unknown-linux-gnu/11.3.0/info
--with-gxx-include-dir=/usr/lib/gcc/ia64-unknown-linux-gnu/11.3.0/include/g++-v11
--with-python-dir=/share/gcc-data/ia64-unknown-linux-gnu/11.3.0/python
--enable-languages=c,c++,go --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --enable-nls --without-included-gettext
--disable-libunwind-exceptions --enable-checking=release
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 11.3.0 p4'
--disable-esp --enable-libstdcxx-time --disable-libstdcxx-pch --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--disable-multilib --disable-fixed-point --enable-libgomp --disable-libssp
--disable-libada --disable-cet --disable-systemtap
--disable-valgrind-annotations --disable-vtable-verify --disable-libvtv
--without-zstd --enable-lto --with-isl --disable-isl-version-check
--disable-libsanitizer --enable-default-pie --enable-default-ssp
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.3.0 (Gentoo 11.3.0 p4)

Backtrace during crash:

test02_basicPost32 (tests.test_queue.SimpleQueueTestCase) ... 
Program received signal SIGILL, Illegal instruction.
0x2161ab01 in DB_consume_wait () from
/var/tmp/portage/dev-python/berkeleydb-18.1.5/work/berkeleydb-18.1.5-python3_10/build/lib/berkeleydb/_berkeleydb.cpython-310-ia64-linux-gnu.so
(gdb) bt
#0  0x2161ab01 in DB_consume_wait () from
/var/tmp/portage/dev-python/berkeleydb-18.1.5/work/berkeleydb-18.1.5-python3_10/build/lib/berkeleydb/_berkeleydb.cpython-310-ia64-linux-gnu.so
#1  0x201f9800 in method_vectorcall_VARARGS_KEYWORDS
(func=, args=,
nargsf=, kwnames=)
at ./Include/internal/pycore_ceval.h:100
#2  0x201e11a0 in _PyObject_VectorcallTstate (kwnames=,
nargsf=, args=, callable=,
tstate=)
at ./Include/cpython/abstract.h:114
#3  PyObject_Vectorcall (kwnames=, nargsf=,
args=, callable=) at
./Include/cpython/abstract.h:123
#4  call_function (tstate=, trace_info=,
pp_stack=0x6fff7f98, oparg=, kwnames=0x0) at
Python/ceval.c:5867
#5  0x201c7670 in _PyEval_EvalFrameDefault (tstate=0x200800032250, 
f=Frame 0x213f1590, for file
/var/tmp/portage/dev-python/berkeleydb-18.1.5/work/berkeleydb-18.1.5-python3_10/tests/test_queue.py,
line 142, in test02_basicPost32
(self=,
_original_stderr=<_io.TextIOWrapper at remote 0x20fb1150>,
_mirrorOutput=False, stream=<_WritelnDecorator(stream=<_io.TextIOWrapper at
remote 0x20fb1150>) at remote 0x213979d0>, showAll=True,
dots=False, descriptions=True, _debug=False, _progress=False,
_progressWithNames=False, _count=1, _testRunEntered=True,
_moduleSetUpFailed=False, _previousTestClass=, _time=) at Python/ceval.c:4202
#6  0x in ?? ()

Bad codegen:

0002ab00 :
   2ab00:   09 00 00 00 01 00   [MMI]   nop.m 0x0
   2ab06:   30 2a 00 00 48 00   mov r35=5
   2ab0c:   00 00 04 00 nop.i 0x0;;
   2ab10:   11 10 10 00 80 05   [MIB]   alloc r2=ar.pfs,4,0,0
   2ab16:   00 00 00 02 00 00   nop.i 0x0
   2ab1c:   38 f7 ff 48 br.many 2a240
<_DB_consume>;;
   2ab20:   0d 00 00 00 01 00   [MFI]   nop.m 0x0
   2ab26:   00 00 00 00 00 00   break.f 0x0
   2ab2c:   00 00 04 00 nop.i 0x0;;
   2ab30:   08 00 00 00 01 00   [MMI]   nop.m 0x0
   2ab36:   00 00 00 02 00 00   nop.m 0x0
   2ab3c:   00 00 04 00 nop.i 0x0


Good codegen:

0002ad00 

[Bug target/105445] miscompile on ia64 with -foptimize-sibling-calls

2022-04-30 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105445

--- Comment #1 from matoro  ---
Created attachment 52914
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52914&action=edit
Preprocessed source.

[Bug target/105552] New: munmap_chunk(): invalid pointer in __gmp_default_free on ia64

2022-05-10 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105552

Bug ID: 105552
   Summary: munmap_chunk(): invalid pointer in __gmp_default_free
on ia64
   Product: gcc
   Version: 12.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: matoro_gcc_bugzilla at matoro dot tk
  Target Milestone: ---

I am unsure if this one is specifically gcc's fault because it also traverses
mpfr and gmp codepaths.  Since I don't have a standalone call into either of
those libs that reproduces though I believe it may be specific to how gcc calls
into them.  Tested with gcc-11.3.0, gcc-12.1.0.

The warnings are irrelevant, adding simple fixes to them (including math.h,
specifying void return) do not fix the crash.

I can provide live ssh access to the system in question if that would be
helpful.  Simply email me at this address.

The minimized example is as follows:

$ cat testcairo.i
draw_3circles() { sin(3.1415926535897932384626433832795028841971693993751); }

$ gcc -c testcairo.i
testcairo.i:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
1 | draw_3circles() {
sin(3.1415926535897932384626433832795028841971693993751); }
  | ^
testcairo.i: In function ‘draw_3circles’:
testcairo.i:1:19: warning: implicit declaration of function ‘sin’
[-Wimplicit-function-declaration]
1 | draw_3circles() {
sin(3.1415926535897932384626433832795028841971693993751); }
  |   ^~~
testcairo.i:1: note: include ‘’ or provide a declaration of ‘sin’
1 | draw_3circles() {
sin(3.1415926535897932384626433832795028841971693993751); }
testcairo.i:1:19: warning: incompatible implicit declaration of built-in
function ‘sin’ [-Wbuiltin-declaration-mismatch]
1 | draw_3circles() {
sin(3.1415926535897932384626433832795028841971693993751); }
  |   ^~~
testcairo.i:1:19: note: include ‘’ or provide a declaration of ‘sin’
munmap_chunk(): invalid pointer
testcairo.i:1:1: internal compiler error: Aborted
1 | draw_3circles() {
sin(3.1415926535897932384626433832795028841971693993751); }
  | ^
linux-gate.so.1: Bad address

$ gdb -q --args gcc -c testcairo.i
Reading symbols from gcc...
Reading symbols from
/usr/lib/debug//usr/ia64-unknown-linux-gnu/gcc-bin/12.1.0/ia64-unknown-linux-gnu-gcc.debug...
(gdb) set follow-fork-mode child
(gdb) r
Starting program: /usr/bin/gcc -c testcairo.i
Failed to read a valid object file image from memory.
warning: Can't read pathname for load map.
warning: Can't read pathname for load map.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
[Attaching after Thread 0x20204d60 (LWP 27400) vfork to child process
27402]
[New inferior 2 (process 27402)]
warning: Can't read pathname for load map.
Failed to read a valid object file image from memory.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
[Detaching vfork parent process 27400 after child exec]
[Inferior 1 (process 27400) detached]
process 27402 is executing new program:
/usr/libexec/gcc/ia64-unknown-linux-gnu/12.1.0/cc1
warning: Can't read pathname for load map.
warning: Can't read pathname for load map.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
testcairo.i:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
1 | draw_3circles() {
sin(3.1415926535897932384626433832795028841971693993751); }
  | ^
testcairo.i: In function ‘draw_3circles’:
testcairo.i:1:19: warning: implicit declaration of function ‘sin’
[-Wimplicit-function-declaration]
1 | draw_3circles() {
sin(3.1415926535897932384626433832795028841971693993751); }
  |   ^~~
testcairo.i:1: note: include ‘’ or provide a declaration of ‘sin’
1 | draw_3circles() {
sin(3.1415926535897932384626433832795028841971693993751); }
testcairo.i:1:19: warning: incompatible implicit declaration of built-in
function ‘sin’ [-Wbuiltin-declaration-mismatch]
1 | draw_3circles() {
sin(3.1415926535897932384626433832795028841971693993751); }
  |   ^~~
testcairo.i:1:19: note: include ‘’ or provide a declaration of ‘sin’
munmap_chunk(): invalid pointer

Thread 2.1 "cc1" received signal SIGABRT, Aborted.
[Switching to Thread 0x20516ba0 (LWP 27402)]
0xa0040721 in ?? ()
(gdb) bt
#0  0xa0040721 in ?? ()
#1  0x20a3c240 in __pthread_kill_implementation () from
/lib/libc.so.6.1
#2  0x20991c40 in raise () from /lib/libc.so.6.1
#3  0x2095eb70 in abort () from /lib/libc.so.6.1
#4  0x20a1b960 in __libc_message () from /lib/libc.so.6.1
#5  0x20a56c70 in malloc_printerr () from /lib/libc.so.6.1
#6  0x20a57290 in munmap_chunk () from /lib/libc.so.6.1
#7  0x20a61870 in free

[Bug target/105552] munmap_chunk(): invalid pointer in __gmp_default_free on ia64

2022-05-13 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105552

matoro  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #2 from matoro  ---
While trying to get a better stacktrace, I reduced the optimizations on
mpfr/gmp.  Turns out I forgot I had gmp at -O3.  Reducing it to -O2 solves the
issue.

[Bug bootstrap/106472] No rule to make target '../libbacktrace/libbacktrace.la', needed by 'libgo.la'.

2023-09-10 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106472

--- Comment #31 from matoro  ---
(In reply to Eric Gallager from comment #30)
> (In reply to matoro from comment #26)
> > We also had somebody report on IRC that they observed this on powerpc (not
> > sure what tuple), again with -j1.  It does not seem to show up with -j2, so
> > likely -j1 is necessary to trigger.
> 
> I can also confirm that switching to -j2 makes this particular error go away

It may make it "go away", but how can it be worked around on real single-core
systems?  All that does is get lucky by throwing more parallelism at it.  I've
been completely unable to even try out gccgo because of this bug.

[Bug bootstrap/106472] No rule to make target '../libbacktrace/libbacktrace.la', needed by 'libgo.la'.

2023-05-12 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106472

--- Comment #25 from matoro  ---
Created attachment 55067
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55067&action=edit
build.log for gcc-13.1

This bug is still present on 13.1.0, attaching log

[Bug bootstrap/106472] No rule to make target '../libbacktrace/libbacktrace.la', needed by 'libgo.la'.

2023-05-12 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106472

--- Comment #26 from matoro  ---
We also had somebody report on IRC that they observed this on powerpc (not sure
what tuple), again with -j1.  It does not seem to show up with -j2, so likely
-j1 is necessary to trigger.

[Bug regression/111709] [13/14/15 Regression] Miscompilation of sysdeps/ieee754/dbl-64/s_fma.c

2024-05-01 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111709

--- Comment #13 from matoro  ---
Current state of this has expanded to more of the math tests.

FAIL: math/test-double-fma
FAIL: math/test-double-j0
FAIL: math/test-double-j1
FAIL: math/test-double-ldouble-fma
FAIL: math/test-double-log
FAIL: math/test-float32x-float64-fma
FAIL: math/test-float32x-fma
FAIL: math/test-float32x-j0
FAIL: math/test-float32x-j1
FAIL: math/test-float32x-log
FAIL: math/test-float64-fma
FAIL: math/test-float64-j0
FAIL: math/test-float64-j1
FAIL: math/test-float64-log
FAIL: math/test-ldouble-fma
FAIL: math/test-ldouble-j0
FAIL: math/test-ldouble-j1
FAIL: math/test-ldouble-log

[Bug rtl-optimization/115169] New: [14 regression] ICE in loongarch bootstrap with checking: RTL check: expected code 'reg', have 'const_int' in rhs_regno, at rtl.h:1934

2024-05-20 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115169

Bug ID: 115169
   Summary: [14 regression] ICE in loongarch bootstrap with
checking: RTL check: expected code 'reg', have
'const_int' in rhs_regno, at rtl.h:1934
   Product: gcc
   Version: 14.1.1
Status: UNCONFIRMED
  Keywords: ice-checking
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: matoro_gcc_bugzilla at matoro dot tk
  Target Milestone: ---
  Host: loongarch64-unknown-linux-gnu
Target: loongarch64-unknown-linux-gnu
 Build: loongarch64-unknown-linux-gnu

There seems to be a couple RISC-V items with similar stack traces but unsure if
they are the same bug.  Trying to upgrade 13 -> 14 on a 3A5000 and I get a
SIGILL from genmodes, so fell back to checking build and unfortunately
encountered an ICE there as well.  Unsure if this is the cause of the SIGILL or
not, so one bug at a time.

/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/build/./gcc/xgcc
-B/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/build/./gcc/
-B/usr/loongarch64-unknown-linux-gnu/bin/
-B/usr/loongarch64-unknown-linux-gnu/lib/ -isystem
/usr/loongarch64-unknown-linux-gnu/include -isystem
/usr/loongarch64-unknown-linux-gnu/sys-include -fmultiflags   -fno-checking -g
-ggdb3 -O2 -O2  -g -ggdb3 -O2 -DIN_GCC   -W -Wall -Wno-narrowing
-Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fpic -g
-DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fno-stack-clash-protection
 -fpic -I. -I. -I../.././gcc
-I/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/gcc-14-20240518/libgcc
-I/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/gcc-14-20240518/libgcc/.
-I/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/gcc-14-20240518/libgcc/../gcc
-I/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/gcc-14-20240518/libgcc/../include
 -DHAVE_CC_TLS   -o _mulvdi3.o -MT _mulvdi3.o -MD -MP -MF _mulvdi3.dep
-DL_mulvdi3 -c
/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/gcc-14-20240518/libgcc/libgcc2.c
-fvisibility=hidden -DHIDE_EXPORTS
during RTL pass: ce1
/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/gcc-14-20240518/libgcc/libgcc2.c:
In function ‘__mulvti3’:
/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/gcc-14-20240518/libgcc/libgcc2.c:376:1:
internal compiler error: RTL check: expected code 'reg', have 'const_int' in
rhs_regno, at rtl.h:1934
  376 | }
  | ^
0x5776ca7b rtl_check_failed_code1(rtx_def const*, rtx_code, char const*,
int, char const*)
   
/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/gcc-14-20240518/gcc/rtl.cc:770
0x5777e457 rhs_regno(rtx_def const*)
   
/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/gcc-14-20240518/gcc/rtl.h:1934
0x584be663 rhs_regno(rtx_def const*)
./genrtl.h:38
0x584be663 loongarch_expand_conditional_move(rtx_def**)
   
/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/gcc-14-20240518/gcc/config/loongarch/loongarch.cc:5355
0x589f5293 gen_movdicc(rtx_def*, rtx_def*, rtx_def*, rtx_def*)
   
/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/gcc-14-20240518/gcc/config/loongarch/loongarch.md:2556
0x57e74ceb maybe_expand_insn(insn_code, unsigned int, expand_operand*)
   
/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/gcc-14-20240518/gcc/optabs.cc:8275
0x57e74ceb emit_conditional_move_1
   
/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/gcc-14-20240518/gcc/optabs.cc:5249
0x57e751c7 emit_conditional_move(rtx_def*, rtx_comparison, rtx_def*,
rtx_def*, machine_mode, int)
   
/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/gcc-14-20240518/gcc/optabs.cc:5162
0x58c3c02b noce_emit_cmove
   
/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/gcc-14-20240518/gcc/ifcvt.cc:1777
0x58c4062b noce_try_cmove_arith
   
/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/gcc-14-20240518/gcc/ifcvt.cc:2363
0x58c4644f noce_process_if_block
   
/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/gcc-14-20240518/gcc/ifcvt.cc:4161
0x58c4644f noce_find_if_block
   
/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/gcc-14-20240518/gcc/ifcvt.cc:4716
0x58c479c3 find_if_header
   
/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/gcc-14-20240518/gcc/ifcvt.cc:4921
0x58c479c3 if_convert
   
/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/gcc-14-20240518/gcc/ifcvt.cc:6068
0x58c48b97 rest_of_handle_if_conversion
   
/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/gcc-14-20240518/gcc/ifcvt.cc:6133
0x58c48b97 execute
   
/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/gcc-14-20240518/gcc/ifcvt.cc:6172

[Bug rtl-optimization/115169] [14 regression] ICE in loongarch bootstrap with checking: RTL check: expected code 'reg', have 'const_int' in rhs_regno, at rtl.h:1934

2024-05-20 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115169

matoro  changed:

   What|Removed |Added

 CC||matoro_gcc_bugzilla@matoro.
   ||tk

--- Comment #1 from matoro  ---
Created attachment 58256
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58256&action=edit
build.log and emerge --info

[Bug target/115169] [14 regression] ICE in loongarch bootstrap with checking: RTL check: expected code 'reg', have 'const_int' in rhs_regno, at rtl.h:1934

2024-05-20 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115169

--- Comment #2 from matoro  ---
Created attachment 58257
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58257&action=edit
preprocessed source

[Bug target/115169] [14 regression] ICE in loongarch bootstrap with checking: RTL check: expected code 'reg', have 'const_int' in rhs_regno, at rtl.h:1934

2024-05-20 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115169

--- Comment #3 from matoro  ---
Minimal command to trigger: ./gcc/xgcc -O1 -c _mulvdi3.i -B./gcc/

[Bug target/115169] [14 regression] ICE in loongarch bootstrap with checking: RTL check: expected code 'reg', have 'const_int' in rhs_regno, at rtl.h:1934

2024-05-20 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115169

--- Comment #4 from matoro  ---
Minimized:

int __mulvti3_uu_0, __mulvti3_vv_0_1, __mulvti3_w0_1;
int __mulvti3() {
  if (__builtin_expect(__mulvti3_uu_0, 1)) {
int w1_0_1;
if (__mulvti3_vv_0_1)
  w1_0_1 -= __mulvti3_uu_0;
if (__builtin_expect(w1_0_1, 1))
  return __mulvti3_w0_1;
  }
}

[Bug target/115169] [14/15 regression] ICE in loongarch bootstrap with checking: RTL check: expected code 'reg', have 'const_int' in rhs_regno, at rtl.h:1934

2024-05-28 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115169

--- Comment #10 from matoro  ---
(In reply to Xi Ruoyao from comment #9)
> Fixed.
> 
> For the SIGILL issue note that in GCC 14 the default of -march is raised
> from loongarch64 to la64v1.0 which implies LSX.  So I'd suggest to check if
> CPU_HAS_LSX is enabled in the kernel configuration first.

Thank you, that indeed was it!  I'll make sure we get this kernel check sorted
out downstream.

[Bug rtl-optimization/115297] New: [14 regression] alpha: ICE in simplify_subreg, at simplify-rtx.cc:7554 with -O1

2024-05-30 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115297

Bug ID: 115297
   Summary: [14 regression] alpha: ICE in simplify_subreg, at
simplify-rtx.cc:7554 with -O1
   Product: gcc
   Version: 14.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: matoro_gcc_bugzilla at matoro dot tk
  Target Milestone: ---
Target: alpha-unknown-linux-gnu

Created attachment 58314
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58314&action=edit
gdb context and complete backtrace

Found this while building kernel with gcc-14.  This reproduces on cross, so
using that as an example.

Minimized:

enum { BPF_F_USER_BUILD_ID } __bpf_get_stack_size;
long __bpf_get_stack_flags, bpf_get_stack___trans_tmp_2;
void bpf_get_stack() {
  unsigned elem_size;
  int err = elem_size = __bpf_get_stack_flags ?: sizeof(long);
  if (__builtin_expect(__bpf_get_stack_size % elem_size, 0))
bpf_get_stack___trans_tmp_2 = err;
}

$ alpha-unknown-linux-gnu-gcc-14 -O1 -c stackmap.i
during RTL pass: combine
stackmap.i: In function ‘bpf_get_stack’:
stackmap.i:8:1: internal compiler error: in simplify_subreg, at
simplify-rtx.cc:7554
8 | }
  | ^

Backtrace summary (more detailed bt with locals and snippets in attachment):

#0  internal_error (gmsgid=0x1033e41b0 "in %s, at %s:%d") at
/usr/src/debug/cross-alpha-unknown-linux-gnu/gcc-14.1.1_p20240518/gcc-14-20240518/gcc/diagnostic.cc:2227
#1  0x000102ff9cac in fancy_abort (file=0x103272d20
"/var/tmp/portage/cross-alpha-unknown-linux-gnu/gcc-14.1.1_p20240518/work/gcc-14-20240518/gcc/simplify-rtx.cc",
line=7554, 
function=0x1032731f0 "simplify_subreg") at
/usr/src/debug/cross-alpha-unknown-linux-gnu/gcc-14.1.1_p20240518/gcc-14-20240518/gcc/diagnostic.cc:2353
#2  0x0001017b5ea4 in simplify_context::simplify_subreg
(this=0x7fff9f00, outermode=E_DImode, op=0x75448c28,
innermode=E_SImode, byte=...)
at
/usr/src/debug/cross-alpha-unknown-linux-gnu/gcc-14.1.1_p20240518/gcc-14-20240518/gcc/simplify-rtx.cc:7554
#3  0x0001017b8da8 in simplify_context::simplify_subreg
(this=0x7fff9f00, outermode=E_DImode, op=0x75449ff0,
innermode=E_SImode, byte=...)
at
/usr/src/debug/cross-alpha-unknown-linux-gnu/gcc-14.1.1_p20240518/gcc-14-20240518/gcc/simplify-rtx.cc:7804
#4  0x0001017b988c in simplify_context::simplify_gen_subreg
(this=0x7fff9f00, outermode=E_DImode, op=0x75449ff0,
innermode=E_SImode, byte=...)
at
/usr/src/debug/cross-alpha-unknown-linux-gnu/gcc-14.1.1_p20240518/gcc-14-20240518/gcc/simplify-rtx.cc:7875
#5  0x000100bb6224 in simplify_gen_subreg (outermode=E_DImode,
op=0x75449ff0, innermode=E_SImode, byte=...)
at
/usr/src/debug/cross-alpha-unknown-linux-gnu/gcc-14.1.1_p20240518/gcc-14-20240518/gcc/rtl.h:3552
#6  0x0001028f87dc in if_then_else_cond (x=0x75449f60,
ptrue=0x7fffa528, pfalse=0x7fffa538)
at
/usr/src/debug/cross-alpha-unknown-linux-gnu/gcc-14.1.1_p20240518/gcc-14-20240518/gcc/combine.cc:9423
#7  0x0001028f55ec in if_then_else_cond (x=0x75449f78,
ptrue=0x7fffa948, pfalse=0x7fffa958)
at
/usr/src/debug/cross-alpha-unknown-linux-gnu/gcc-14.1.1_p20240518/gcc-14-20240518/gcc/combine.cc:9286
#8  0x0001028f55ec in if_then_else_cond (x=0x75449f90,
ptrue=0x7fffb148, pfalse=0x7fffb150)
at
/usr/src/debug/cross-alpha-unknown-linux-gnu/gcc-14.1.1_p20240518/gcc-14-20240518/gcc/combine.cc:9286
#9  0x0001028bf07c in combine_simplify_rtx (x=0x75449f90,
op0_mode=E_VOIDmode, in_dest=false, in_cond=false)
at
/usr/src/debug/cross-alpha-unknown-linux-gnu/gcc-14.1.1_p20240518/gcc-14-20240518/gcc/combine.cc:5758
#10 0x0001028bc3d8 in subst (x=0x75449f90, from=0x754488c8,
to=0x75451920, in_dest=false, in_cond=false, unique_copy=false)
at
/usr/src/debug/cross-alpha-unknown-linux-gnu/gcc-14.1.1_p20240518/gcc-14-20240518/gcc/combine.cc:5619
#11 0x0001028bba88 in subst (x=0x75448cb8, from=0x754488c8,
to=0x75451920, in_dest=false, in_cond=false, unique_copy=false)
at
/usr/src/debug/cross-alpha-unknown-linux-gnu/gcc-14.1.1_p20240518/gcc-14-20240518/gcc/combine.cc:5546
#12 0x0001028babe8 in subst (x=0x754a68a0, from=0x754488c8,
to=0x75451920, in_dest=false, in_cond=false, unique_copy=false)
at
/usr/src/debug/cross-alpha-unknown-linux-gnu/gcc-14.1.1_p20240518/gcc-14-20240518/gcc/combine.cc:5480
#13 0x00010289ba0c in try_combine (i3=0x754e0540, i2=0x754e0500,
i1=0x754e06c0, i0=0x0, new_direct_jump_p=0x7fffe2df,
last_combined_insn=0x754e0540)
at
/usr/src/debug/cross-alpha-unknown-linux-gnu/gcc-14.1.1_p20240518/gcc-14-20240518/gcc/combine.cc:3349
#14 0x00010288c22c in combine_instructions (f=0x754009a0, nregs=88) at
/usr/src/debug/cross-alpha-unknown-linux-gnu/gcc-14.1.1_p20240518/gcc-14-20240518/gc

[Bug c/114493] [11/12/13/14/15 Regression] internal compiler error: in fld_incomplete_type_of, at ipa-free-lang-data.cc:257

2024-06-01 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114493

matoro  changed:

   What|Removed |Added

 CC||matoro_gcc_bugzilla@matoro.
   ||tk

--- Comment #6 from matoro  ---
Hit this as well building samba on 14.

Minimized:

void _talloc_array();
struct sockaddr_storage
resolve_lmhosts_file_as_sockaddr(struct sockaddr_storage **);
struct __attribute__((__may_alias__)) sockaddr_storage {
} resolve_name_multiple_recv() {
  _talloc_array();
}

$ x86_64-pc-linux-gnu-gcc-14 -flto -c resolve.c.10.i
during IPA pass: *free_lang_data
resolve.c.10.i:7:1: internal compiler error: in fld_incomplete_type_of, at
ipa-free-lang-data.cc:257
7 | }
  | ^

[Bug driver/112759] New: [13 regression] mips -march=native detection broken with gcc 13+

2023-11-28 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112759

Bug ID: 112759
   Summary: [13 regression] mips -march=native detection broken
with gcc 13+
   Product: gcc
   Version: 13.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: driver
  Assignee: unassigned at gcc dot gnu.org
  Reporter: matoro_gcc_bugzilla at matoro dot tk
  Target Milestone: ---

Since gcc 13 - and presumably 66c48be23e0fa5ee7474b4b078e013f901c71eed since
that is the only recent change to this area - detection of -march=native on
mips is broken, defaulting to mips1.

With gcc 13:
# gcc -march=native -Q --help=target | grep "arch=" | head -n 1
  -march=ISAmips1
# gcc --version
gcc (Gentoo 13.2.1_p20231014 p9) 13.2.1 20231014

With gcc 12:
# gcc -march=native -Q --help=target | grep "arch=" | head -n 1
  -march=ISAocteon2
# gcc --version
gcc (Gentoo 12.3.1_p20230825 p2) 12.3.1 20230825

Contents of my /proc/cpuinfo are attached.  strace seems to indicate that it is
reading the data at least:

openat(AT_FDCWD, "/proc/cpuinfo", O_RDONLY) = 3
statx(3, "", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT|AT_EMPTY_PATH,
STATX_BASIC_STATS, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0,
stx_mode=S_IFREG|0444, stx_size=0, ...}) = 0
read(3, "system type\t\t: EBB6800 (CN6880p2"..., 1024) = 1024
close(3)= 0

[Bug driver/112759] [13 regression] mips -march=native detection broken with gcc 13+

2023-11-28 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112759

matoro  changed:

   What|Removed |Added

 CC||matoro_gcc_bugzilla@matoro.
   ||tk

--- Comment #1 from matoro  ---
Created attachment 56714
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56714&action=edit
/proc/cpuinfo

[Bug driver/112759] [13/14 regression] mips -march=native detection broken with gcc 13+

2023-11-30 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112759

--- Comment #3 from matoro  ---
(In reply to Andrew Pinski from comment #2)
> Hmm, looks like it is this part of the change:
> +  if (cpu)
> +ret = reconcat (ret, ret, "-m", argv[0], "=", cpu, NULL);
>  
> -  return concat ("-m", argv[0], "=", cpu, NULL);
> 
> 
> Maybe it should have been:
> ```
> if (cpu)
>   {
> if (!ret)
>   ret = concat ("-m", argv[0], "=", cpu, NULL);
> else
>   ret = reconcat (ret, ret, "-m", argv[0], "=", cpu, NULL);
>   }
> ```
> 
> Can you try that?

Indeed fixes it, thanks!

[Bug rtl-optimization/110095] New: RISC-V: unrecognizable insn during RTL pass: vregs with -O2 -mcpu=sifive-u74

2023-06-02 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110095

Bug ID: 110095
   Summary: RISC-V: unrecognizable insn during RTL pass: vregs
with -O2 -mcpu=sifive-u74
   Product: gcc
   Version: 13.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: matoro_gcc_bugzilla at matoro dot tk
  Target Milestone: ---

Not sure if this is a regression or not.  Minimized test case produced with
cvise.

$ cat test3.i
double CastDoubleToLong_x;
long __attribute__DrawAffineImage_x;
long CastDoubleToLong() {
  if (CastDoubleToLong_x)
return 0;
  return CastDoubleToLong_x;
}
void __attribute__DrawAffineImage() {
  for (; __attribute__DrawAffineImage_x <= CastDoubleToLong();)
;
}

$ riscv64-unknown-linux-gnu-gcc -O2 -mcpu=sifive-u74 -c test3.i
test3.i: In function ‘__attribute__DrawAffineImage’:
test3.i:11:1: error: unrecognizable insn:
   11 | }
  | ^
(insn 9 8 10 2 (set (reg:DI 140)
(if_then_else:DI (eq:DF (reg:DF 136 [ CastDoubleToLong_x.0_4 ])
(reg:DF 142))
(reg:DI 141)
(const_int 0 [0]))) -1
 (nil))
during RTL pass: vregs
test3.i:11:1: internal compiler error: in extract_insn, at recog.cc:2791
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See  for instructions.

Passing -fdisable-rtl-vregs does not fix the problem as the same issue appears
in sched1 pass; there is a little bit more context in the output.

$ riscv64-unknown-linux-gnu-gcc -O2 -mcpu=sifive-u74 -c test3.i
-fdisable-rtl-vregs   
cc1: note: disable pass rtl-vregs for functions in the range of [0, 4294967295]
test3.i: In function ‘__attribute__DrawAffineImage’:
test3.i:11:1: error: unrecognizable insn:
   11 | }
  | ^
(insn 9 8 12 2 (set (reg:DI 140)
(if_then_else:DI (eq:DF (reg:DF 136 [ CastDoubleToLong_x.0_4 ])
(reg:DF 142))
(reg:DI 141)
(const_int 0 [0]))) -1
 (expr_list:REG_DEAD (reg:DF 142)
(expr_list:REG_DEAD (reg:DI 141)
(expr_list:REG_DEAD (reg:DF 136 [ CastDoubleToLong_x.0_4 ])
(expr_list:REG_EQUAL (if_then_else:DI (eq:DF (reg:DF 136 [
CastDoubleToLong_x.0_4 ])
(const_double:DF 0.0 [0x0.0p+0]))
(reg:DI 141)
(const_int 0 [0]))
(nil))
during RTL pass: sched1
test3.i:11:1: internal compiler error: in extract_insn, at recog.cc:2791
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See  for instructions.

Reducing optimization to -O1 removes the issue:
$ riscv64-unknown-linux-gnu-gcc -O1 -mcpu=sifive-u74 -c test3.i

Removing CPU tuning also removes the issue:
$ riscv64-unknown-linux-gnu-gcc -O2 -c test3.i

Clang has no problems (though I'm not sure if it actually supports optimization
for this CPU or if it's a no-op):
$ clang -O2 -mcpu=sifive-u74 -c test3.i


$ gcc --version --verbose
Using built-in specs.
COLLECT_AS_OPTIONS='--version'
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/riscv64-unknown-linux-gnu/13/lto-wrapper
gcc (Gentoo 13.1.1_p20230527 p3) 13.1.1 20230527
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Target: riscv64-unknown-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-13.1.1_p20230527/work/gcc-13-20230527/configure
--host=riscv64-unknown-linux-gnu --build=riscv64-unknown-linux-gnu
--prefix=/usr --bindir=/usr/riscv64-unknown-linux-gnu/gcc-bin/13
--includedir=/usr/lib/gcc/riscv64-unknown-linux-gnu/13/include
--datadir=/usr/share/gcc-data/riscv64-unknown-linux-gnu/13
--mandir=/usr/share/gcc-data/riscv64-unknown-linux-gnu/13/man
--infodir=/usr/share/gcc-data/riscv64-unknown-linux-gnu/13/info
--with-gxx-include-dir=/usr/lib/gcc/riscv64-unknown-linux-gnu/13/include/g++-v13
--with-python-dir=/share/gcc-data/riscv64-unknown-linux-gnu/13/python
--enable-languages=c,c++ --enable-obsolete --enable-secureplt --disable-werror
--with-system-zlib --enable-nls --without-included-gettext
--disable-libunwind-exceptions --enable-checking=release
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo
13.1.1_p20230527 p3' --with-gcc-major-version-only --disable-esp
--enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--disable-multilib --disable-fixed-point --with-abi=lp64d --enable-libgomp
--disable-libssp --disable-libada --disable-cet --disable-systemtap
--disable-valgrind-annotations --disable-vtable-verify --disable-libvtv
--without-zstd --with-isl --disable-isl-version-check --ena

[Bug rtl-optimization/110307] New: ICE in move_insn, at haifa-sched.cc:5473 on alpha with -fPIC -fpeephole2 -fschedule-insns2

2023-06-19 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110307

Bug ID: 110307
   Summary: ICE in move_insn, at haifa-sched.cc:5473 on alpha with
-fPIC -fpeephole2 -fschedule-insns2
   Product: gcc
   Version: 13.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: matoro_gcc_bugzilla at matoro dot tk
  Target Milestone: ---

Minimized reproducer:

$ cat test.c
_Thread_local struct rb_execution_context_struct ruby_current_ec;
struct rb_execution_context_struct {
  int fiber_ptr
} rb_fiber_start() {
  __builtin_setjmp(0);
  if (ruby_current_ec.fiber_ptr)
root_fiber_alloc();
}

$ alpha-unknown-linux-gnu-gcc -O1 -fpeephole2 -fschedule-insns2 -fPIC test.c -o
test.o -c
test.c:4:1: warning: no semicolon at end of struct or union
4 | } rb_fiber_start() {
  | ^
test.c: In function ‘rb_fiber_start’:
test.c:7:5: warning: implicit declaration of function ‘root_fiber_alloc’
[-Wimplicit-function-declaration]
7 | root_fiber_alloc();
  | ^~~~
during RTL pass: sched2
test.c:8:1: internal compiler error: in move_insn, at haifa-sched.cc:5473
8 | }
  | ^


-fPIC is required to reproduce, as well as both -fpeephole2 and
-fschedule-insns2 optimizers (or simply -O2 which includes them).  Removing any
of those three flags no longer reproduces.  If required I can also work on
getting a complete stack trace.  If somebody would like to take a look at this
without the appropriate hardware, mine is publicly available for use.


$ alpha-unknown-linux-gnu-gcc --version --verbose
Using built-in specs.
COLLECT_AS_OPTIONS='--version'
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/alpha-unknown-linux-gnu/13/lto-wrapper
gcc (Gentoo 13.1.1_p20230527 p3) 13.1.1 20230527
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Target: alpha-unknown-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-13.1.1_p20230527/work/gcc-13-20230527/configure
--host=alpha-unknown-linux-gnu --build=alpha-unknown-linux-gnu --prefix=/usr
--bindir=/usr/alpha-unknown-linux-gnu/gcc-bin/13
--includedir=/usr/lib/gcc/alpha-unknown-linux-gnu/13/include
--datadir=/usr/share/gcc-data/alpha-unknown-linux-gnu/13
--mandir=/usr/share/gcc-data/alpha-unknown-linux-gnu/13/man
--infodir=/usr/share/gcc-data/alpha-unknown-linux-gnu/13/info
--with-gxx-include-dir=/usr/lib/gcc/alpha-unknown-linux-gnu/13/include/g++-v13
--with-python-dir=/share/gcc-data/alpha-unknown-linux-gnu/13/python
--enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --enable-nls --without-included-gettext
--disable-libunwind-exceptions --enable-checking=release
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo
13.1.1_p20230527 p3' --with-gcc-major-version-only --disable-esp
--enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--disable-multilib --disable-fixed-point --enable-libgomp --disable-libssp
--disable-libada --disable-cet --disable-systemtap
--disable-valgrind-annotations --disable-vtable-verify --disable-libvtv
--without-zstd --without-isl --disable-libsanitizer --enable-default-pie
--disable-default-ssp
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 13.1.1 20230527 (Gentoo 13.1.1_p20230527 p3) 
COLLECT_GCC_OPTIONS='--version' '-v' '-dumpdir' 'a-'
 /usr/libexec/gcc/alpha-unknown-linux-gnu/13/cc1 -quiet -v help-dummy -quiet
-dumpdir a- -dumpbase help-dummy -version --version -o /tmp/ccNd1lqC.s
GNU C17 (Gentoo 13.1.1_p20230527 p3) version 13.1.1 20230527
(alpha-unknown-linux-gnu)
compiled by GNU C version 13.1.1 20230527, GMP version 6.2.1, MPFR
version 4.2.0-p9, MPC version 1.3.1, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
COLLECT_GCC_OPTIONS='--version' '-v' '-dumpdir' 'a-'

/usr/lib/gcc/alpha-unknown-linux-gnu/13/../../../../alpha-unknown-linux-gnu/bin/as
-v --version -o /tmp/ccq4Tbtn.o /tmp/ccNd1lqC.s
GNU assembler version 2.40.0 (alpha-unknown-linux-gnu) using BFD version
(Gentoo 2.40 p5) 2.40.0
GNU assembler (Gentoo 2.40 p5) 2.40.0
Copyright (C) 2023 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `alpha-unknown-linux-gnu'.
COMPILER_PATH=/usr/libexec/gcc/alpha-unknown-linux-gnu/13/:/usr/libexec/gcc/alpha-unknown-linux-gnu/13/:/usr/libexec/gcc/alpha-unknown-linux-gnu/:/usr/lib/gcc/alpha-unknown-linux-gnu/13/:/usr/lib/gcc/alpha-unknown-linux-gnu/:/usr/lib/gcc/alpha-unknown-linux-gnu/1

[Bug rtl-optimization/110307] ICE in move_insn, at haifa-sched.cc:5473 when building Ruby on alpha with -fPIC -O2 (or -fpeephole2 -fschedule-insns2)

2023-06-19 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110307

--- Comment #2 from matoro  ---
Created attachment 55365
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55365&action=edit
archive from -fdump-tree-all -fdump-rtl-all

(In reply to Alexander Monakov from comment #1)
> I tried building a cross-compiler from trunk with
> --target=alpha-unknown-linux-gnu --with-gnu-ld --with-gnu-as
> --enable-secureplt --enable-languages=c --enable-tls and got
> 
> t.c:8:1: error: unrecognizable insn:
> 8 | }
>   | ^
> (insn 23 22 24 5 (set (reg/f:DI 74)
> (symbol_ref:DI ("ruby_current_ec") [flags 0x10]   0x7fb457a6c090 ruby_current_ec>)) "t.c":6:22 -1
>  (nil))
> during RTL pass: vregs
> 
> Would you mind compiling the testcase with -fdump-tree-all -fdump-rtl-all
> and attaching a tar.gz with the resulting dumps?

Absolutely, here you go.

[Bug rtl-optimization/110307] ICE in move_insn, at haifa-sched.cc:5473 when building Ruby on alpha with -fPIC -O2 (or -fpeephole2 -fschedule-insns2)

2023-06-19 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110307

--- Comment #4 from matoro  ---
(In reply to Alexander Monakov from comment #3)
> Do you have older versions of GCC to check on this testcase?

No, for the same reason I didn't get a complete backtrace, it takes a while to
compile on this machine.  I can go ahead and kick it off though, and update
with results as I find them.

[Bug rtl-optimization/110307] ICE in move_insn, at haifa-sched.cc:5473 when building Ruby on alpha with -fPIC -O2 (or -fpeephole2 -fschedule-insns2)

2023-06-22 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110307

matoro  changed:

   What|Removed |Added

  Known to fail||12.3.1, 13.1.1

--- Comment #9 from matoro  ---
I have a gcc 12 build, this does repro there as well.  Assertions enabled on
this one so I see the same instruction dump now.  It takes about 2 days, so I
will go ahead and kick off a build of 13 with those two patches mentioned
above.  Any other changes I should include in the build?

[Bug rtl-optimization/110307] ICE in move_insn, at haifa-sched.cc:5473 when building Ruby on alpha with -fPIC -O2 (or -fpeephole2 -fschedule-insns2)

2023-06-22 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110307

--- Comment #11 from matoro  ---
(In reply to Alexander Monakov from comment #10)
> I think the first patch may result in duplicated notes, so I wouldn't
> recommend picking it.

Oh okay, so just the second patch then?  Let me try that.

[Bug rtl-optimization/110307] ICE in move_insn, at haifa-sched.cc:5473 when building Ruby on alpha with -fPIC -O2 (or -fpeephole2 -fschedule-insns2)

2023-06-25 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110307

--- Comment #12 from matoro  ---
Just tested applying this patch on top of 13 and it worked!  Thanks so much for
the help!

[Bug target/106966] [12/13/14 Regression] alpha cross build crashes gcc-12 "internal compiler error: in emit_move_insn"

2023-07-09 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106966

matoro  changed:

   What|Removed |Added

 CC||matoro_gcc_bugzilla@matoro.
   ||tk

--- Comment #9 from matoro  ---
(In reply to Uroš Bizjak from comment #8)
> Created attachment 55504 [details]
> Proposed patch.
> 
> Can someone please bootstrap and test the attached patch?

I can queue this up to test on real hardware.  By bootstrap, do you mean with
--enable-bootstrap, and by test do you mean a full testsuite run or just
checking that it doesn't ICE on the reproducer here?

[Bug target/106966] [12/13/14 Regression] alpha cross build crashes gcc-12 "internal compiler error: in emit_move_insn"

2023-07-10 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106966

--- Comment #11 from matoro  ---
(In reply to Uroš Bizjak from comment #10)
> (In reply to matoro from comment #9)
> > (In reply to Uroš Bizjak from comment #8)
> > > Created attachment 55504 [details]
> > > Proposed patch.
> > > 
> > > Can someone please bootstrap and test the attached patch?
> > 
> > I can queue this up to test on real hardware.  By bootstrap, do you mean
> > with --enable-bootstrap, and by test do you mean a full testsuite run or
> > just checking that it doesn't ICE on the reproducer here?
> 
> I have already checked that it doesn't ICE with a crosscompiler. Regarding
> the bootstrap, please note that --enable-bootstrap is the default nowadays,
> so the option it is not needed to make a full build ("bootstrap"). Also,
> "make -j N -k check-gcc" should be enough to test the compiler, since other
> parts of the compiler never exercise -mbuild-constants (N in the command
> should be substituted with a number of processors to parallelize the
> testsuite run).

I was just checking because alpha hardware is quite antique, it's single-core
so a full compile with bootstrap takes around ~72 hours.  I don't know how long
the test suite takes because I've never run it on this machine, but I would
expect it to add a couple additional days to that.  If that's fine I'll kick it
off, just want to be clear on what exactly you'd like to see.

[Bug target/104820] mips: ICE in int_mode_for_mode, at stor-layout.cc:407 with -fzero-call-used-regs=all -mips4

2023-12-19 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104820

matoro  changed:

   What|Removed |Added

 CC||matoro_gcc_bugzilla@matoro.
   ||tk

--- Comment #1 from matoro  ---
This also seems to affect ia64 I think:

# echo 'int t() {}' | ia64-unknown-linux-gnu-gcc -nostdinc
-fzero-call-used-regs=all -x c -
during RTL pass: zero_call_used_regs
: In function ‘t’:
:1:10: internal compiler error: in int_mode_for_mode, at
stor-layout.cc:407
linux-gate.so.1: Bad address
0x4285670f internal_error(char const*, ...)
???:0
0x401c885f fancy_abort(char const*, int, char const*)
???:0
0x411004af int_mode_for_mode(machine_mode)
???:0
0x408290ef emit_move_insn_1(rtx_def*, rtx_def*)
???:0
0x408298bf emit_move_insn(rtx_def*, rtx_def*)
???:0
0x41119e0f default_zero_call_used_regs(HARD_REG_SET)
???:0
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.

[Bug c++/118751] New: optional diagnostic not given on invalid bitfield reference in uninstantiated template

2025-02-04 Thread matoro_gcc_bugzilla at matoro dot tk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118751

Bug ID: 118751
   Summary: optional diagnostic not given on invalid bitfield
reference in uninstantiated template
   Product: gcc
   Version: 14.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: matoro_gcc_bugzilla at matoro dot tk
  Target Milestone: ---

Sample comparison:  https://godbolt.org/z/3zYfe35jM

gcc does not diagnose non-const bitfield references in uninstantiated
templates, while clang does.

#include 

template 
struct s
{
int m : 5;
void swap()
{
std::swap(m, m);
}
};

clang:

:9:19: error: non-const reference cannot bind to bit-field 'm'
9 | std::swap(m, m);
  |   ^
:6:9: note: bit-field is declared here
6 | int m : 5;
  | ^
/opt/compiler-explorer/gcc-14.2.0/lib/gcc/x86_64-linux-gnu/14.2.0/../../../../include/c++/14.2.0/bits/move.h:213:15:
note: passing argument to parameter '__a' here
  213 | swap(_Tp& __a, _Tp& __b)
  |   ^

gcc does correctly diagnose if template is instantiated.  This is technically
optional so it's not a correctness issue but gcc's lack of even a warning here
is giving the impression that clang is doing something wrong.