[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-12-10 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

Kirill A. Korinsky  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|WAITING |RESOLVED

--- Comment #45 from Kirill A. Korinsky  ---
Issue was on OpenBSD side (ld).

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-19 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #44 from Kirill A. Korinsky  ---
Eric, sure, and it ends with crash with usual:

Core was generated by `cc1'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00b1d9461600 in _ZN4bidi7contextC1Ev+0xfb59ea0c@plt ()
(gdb) disassemble 
Dump of assembler code for function
_ZN4bidi7contextC1Ev+0xfb59ea0c@plt:
   0x00b1d94615f0 <+0>: mov  %o7, %g5
   0x00b1d94615f4 <+4>: call  0xb1d94615fc
<_ZN4bidi7contextC1Ev+0xfb59ea0c@plt+12>
   0x00b1d94615f8 <+8>: nop 
   0x00b1d94615fc <+12>:ldx  [ %o7 + 0x65c ], %g1
=> 0x00b1d9461600 <+16>:jmpl  %o7 + %g1, %g1
   0x00b1d9461604 <+20>:mov  %g5, %o7
End of assembler dump.
(gdb)

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-19 Thread ebotcazou at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #43 from Eric Botcazou  ---
OK, so can you try to add back only --enable-host-pie then?

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-18 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #42 from Kirill A. Korinsky  ---
Eric, yes, your are righ, OpenBSD has old (before GPLv3) linker.

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-18 Thread ebotcazou at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #41 from Eric Botcazou  ---
> with absolutle useless stacktrace:
> 
> Core was generated by `ld.bfd'.
> Program terminated with signal SIGSEGV, Segmentation fault.
> #0  0x0099a352bb48 in bfd_putb64 ()
> (gdb) bt
> #0  0x0099a352bb48 in bfd_putb64 ()
> #1  0x0099a3544fb8 in bfd_elf64_swap_reloca_out ()
> #2  0x0099a353e644 in ?? ()
> Backtrace stopped: previous frame identical to this frame (corrupt stack?)
> (gdb)
> 
> anyway, it smells like original issue but with different symptop.

Maybe, but it's the linker here, not the compiler directly.  I presume that you
have an old patched linker instead of a recent one?

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-17 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #40 from Kirill A. Korinsky  ---
After very long digging I had discovered that OpenBSD ports setups environment
variable PICFLAG="-fPIC" on make stage, see, for example env at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145#c26 which leads to broken
logic of the build.

So, after I clean this up, I was able to start building gcc-15.2.0 with
-fno-PIE flags, and it leads to

/usr/local/bootstrap-gcc/bin/g++ -std=c++14  -fno-PIE -c  -DIN_GCC_FRONTEND -g
-DIN_GCC-fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall
-Wno-error=narrowing -Wwrite-strings -Wcast-qual -Wno-format
-Wmissing-format-attribute -Wconditionally-supported -Woverloaded-virtual
-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings 
-DHAVE_CONFIG_H -fno-PIE -I. -I. -I/usr/ports/pobj/gcc-15.2.0/gcc-15.2.0/gcc
-I/usr/ports/pobj/gcc-15.2.0/gcc-15.2.0/gcc/.
-I/usr/ports/pobj/gcc-15.2.0/gcc-15.2.0/gcc/../include 
-I/usr/ports/pobj/gcc-15.2.0/gcc-15.2.0/gcc/../libcpp/include
-I/usr/ports/pobj/gcc-15.2.0/gcc-15.2.0/gcc/../libcody -I/usr/local/include 
-I/usr/ports/pobj/gcc-15.2.0/gcc-15.2.0/gcc/../libdecnumber
-I/usr/ports/pobj/gcc-15.2.0/gcc-15.2.0/gcc/../libdecnumber/dpd
-I../libdecnumber -I/usr/ports/pobj/gcc-15.2.0/gcc-15.2.0/gcc/../libbacktrace  
-o cc1-checksum.o -MT cc1-checksum.o -MMD -MP -MF ./.deps/cc1-checksum.TPo
cc1-checksum.cc
/usr/local/bootstrap-gcc/bin/g++ -std=c++14 -no-pie   -g -DIN_GCC   
-fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall
-Wno-error=narrowing -Wwrite-strings -Wcast-qual -Wno-format
-Wmissing-format-attribute -Wconditionally-supported -Woverloaded-virtual
-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings 
-DHAVE_CONFIG_H -no-pie -static-libstdc++ -static-libgcc  -o cc1 c/c-lang.o
c-family/stub-objc.o attribs.o c/c-errors.o c/c-decl.o c/c-typeck.o
c/c-convert.o c/c-aux-info.o c/c-objc-common.o c/c-parser.o c/c-fold.o
c/gimple-parser.o c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o
c-family/c-format.o c-family/c-gimplify.o c-family/c-indentation.o
c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o
c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o
c-family/c-semantics.o c-family/c-ada-spec.o c-family/c-ubsan.o
c-family/known-headers.o c-family/c-attribs.o c-family/c-warn.o
c-family/c-spellcheck.o c-family/c-type-mismatch.o sparc-c.o default-c.o \
  cc1-checksum.o simple-diagnostic-path.o lazy-diagnostic-path.o libbackend.a
main.o libcommon-target.a libcommon.a ../libcpp/libcpp.a
../libdecnumber/libdecnumber.a libcommon.a ../libcpp/libcpp.a  
../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a
../libdecnumber/libdecnumber.a   -L/usr/local/lib -lmpc -lmpfr -lgmp -rdynamic 
-lz 
collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core
dumped

with absolutle useless stacktrace:

Core was generated by `ld.bfd'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0099a352bb48 in bfd_putb64 ()
(gdb) bt
#0  0x0099a352bb48 in bfd_putb64 ()
#1  0x0099a3544fb8 in bfd_elf64_swap_reloca_out ()
#2  0x0099a353e644 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)

anyway, it smells like original issue but with different symptop.

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-17 Thread ebotcazou at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #39 from Eric Botcazou  ---
> --enable-host-shared is required, at least at OpenBSD 
> since
> https://gcc.gnu.org/cgit/gcc/commit/
> ?id=b6cb10af12cf869c1ae348c0e5cb2d364ef0abce not only on sparc64, I can
> reproduce it on amd64 as well.

What do you mean by "is required"?  Obviously something goes wrong with the
PIC/PIE machinery, so we need to disable it entirely and start from a build
that does not involve it.

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-16 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #38 from Kirill A. Korinsky  ---
Andrew, the change in vectorizer, I think, trigger the issue, and never was the
root cause.

Since it, different commit leads to similar issue in different place.

Thus, the same commit but different bootstrap compiler (clang instead of gcc)
leads also to similar issue in different place.

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

Andrew Pinski  changed:

   What|Removed |Added

 Target||sparc64-openbsd
   Keywords||build, wrong-code
  Build||sparc64-openbsd
   Host||sparc64-openbsd

--- Comment #37 from Andrew Pinski  ---
Can you try BOOT_CXXFLAGS="-O2 -g -fno-tree-vectorize" ?

I Know everyone else is focusing on PIC but you did pin point to a change in
the vectorizer that causes the issue so let's see if turning off the vectorizer
works for the bootstrap. And then let's dig from there backwards to understand
what is going wrong.

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-16 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #36 from Kirill A. Korinsky  ---
Yep, config/picflag.m4 explicity enforces -fPIC without any obvious way to not
do it.

Have I missed some magic way to disable it?

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-16 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #35 from Kirill A. Korinsky  ---
Sam,

--enable-host-shared is required, at least at OpenBSD 
since
https://gcc.gnu.org/cgit/gcc/commit/?id=b6cb10af12cf869c1ae348c0e5cb2d364ef0abce
not only on sparc64, I can reproduce it on amd64 as well.

I had tried to use --disable-host-pie and it fails as "
No rule to make target '../libiberty/pic/libiberty.a'".

But, I think, this commit just uncovered an issue, and not introduced it.

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-16 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

Sam James  changed:

   What|Removed |Added

 CC||sjames at gcc dot gnu.org

--- Comment #34 from Sam James  ---
(In reply to Kirill A. Korinsky from comment #33)
> Sam, it fails much early without --enable-host-shared, see:
> https://kirill.korins.ky/pub/gcc-15.2.0-sparc64-build-no-host-shared.log.txt

```
gmake[2]: *** No rule to make target '../libiberty/pic/libiberty.a', needed by
'full-stamp'.  Stop.
gmake[2]: *** Waiting for unfinished jobs
```

In fixincludes/Makefile.in:
```
ifeq ($(PICFLAG),)
LIBIBERTY=../libiberty/libiberty.a
else
LIBIBERTY=../libiberty/pic/libiberty.a
endif
```

Can you try figure out where PICFLAG (or PIC_FLAG) gets set in configure for
you and why? It's only supposed to do that IIRC with --enable-host-shared or
--enable-host-pie.

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-16 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #33 from Kirill A. Korinsky  ---
Sam, it fails much early without --enable-host-shared, see:
https://kirill.korins.ky/pub/gcc-15.2.0-sparc64-build-no-host-shared.log.txt

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-16 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #32 from Sam James  ---
Please try drop --enable-host-shared:

if test x$enable_host_shared = xyes; then
  PICFLAG=-fPIC
elif test x$enable_host_pie = xyes; then
  PICFLAG=-fPIE
elif test x$gcc_cv_c_no_fpie = xyes; then
  PICFLAG=-fno-PIE
else
  PICFLAG=
fi

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-16 Thread ebotcazou at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #31 from Eric Botcazou  ---
> 1. A build log (output from stdout):
> https://kirill.korins.ky/pub/gcc-15.2.0-sparc64-build.log.txt (~1Mb)
> 2. An output of "grep -rn PIE gcc-15.2.0/build-sparc64 | grep -v '^Binary
> file gcc-15.2.0'":
> https://kirill.korins.ky/pub/gcc-15.2.0-sparc64-grep-PIE.txt

Well, there is -fPIC all over the place, which has exactly the same effect, so
we need to find out where it comes from and remove it.

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-16 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #30 from Kirill A. Korinsky  ---
Eric, I can't find any proof that PIE is enabled. Instead I see that it is
disabled.

I'd like to share with you:

1. A build log (output from stdout):
https://kirill.korins.ky/pub/gcc-15.2.0-sparc64-build.log.txt (~1Mb)
2. An output of "grep -rn PIE gcc-15.2.0/build-sparc64 | grep -v '^Binary file
gcc-15.2.0'": https://kirill.korins.ky/pub/gcc-15.2.0-sparc64-grep-PIE.txt
3. gcc-15.2.0/build-sparc64 folder as tgz:
https://kirill.korins.ky/pub/gcc-15.2.0-build-sparc64.tgz (~1Gb)

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-15 Thread ebotcazou at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #29 from Eric Botcazou  ---
There should be no @plt or @got.plt if PIE is not enabled, so where they come
from is a total mystery.

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-15 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #28 from Kirill A. Korinsky  ---
Just did. Same result.

(gdb) r
Starting program: /usr/ports/pobj/gcc-15.2.0/build-sparc64/gcc/cc1 -quiet
-nostdinc -v -iprefix
/usr/ports/pobj/gcc-15.2.0/build-sparc64/gcc/../lib/gcc/sparc64-unknown-openbsd/15.2.0/
-isystem /usr/ports/pobj/gcc-15.2.0/build-sparc64/./gcc/include -isystem
/usr/ports/pobj/gcc-15.2.0/build-sparc64/./gcc/include-fixed -D__sparc_v9__
/dev/null -quiet -dumpbase null -mcpu=ultrasparc -version -fno-checking
-fself-test=/usr/ports/pobj/gcc-15.2.0/gcc-15.2.0/gcc/testsuite/selftests -o
/dev/null

Program received signal SIGSEGV, Segmentation fault.
0x00e6e43607a8 in _ZN4bidi7contextC1Ev+0xfb59f864@plt ()
(gdb) disassemble 
Dump of assembler code for function
_ZN4bidi7contextC1Ev+0xfb59f864@plt:
   0x00e6e4360798 <+0>: mov  %o7, %g5
   0x00e6e436079c <+4>: call  0xe6e43607a4
<_ZN4bidi7contextC1Ev+0xfb59f864@plt+12>
   0x00e6e43607a0 <+8>: nop 
   0x00e6e43607a4 <+12>:ldx  [ %o7 + 0x7ec ], %g1
=> 0x00e6e43607a8 <+16>:jmpl  %o7 + %g1, %g1
   0x00e6e43607ac <+20>:mov  %g5, %o7
End of assembler dump.
(gdb) p/x $o7 + 0x7ec
$1 = 0xe6e4360f88
(gdb) x/x $o7 + 0x7ec
0xe6e4360f88 <[email protected]>:0xf9e39f20
(gdb) p/x $g1
$2 = 0xf9e39f20ffe9dd64
(gdb) x/x $g1
0xf9e39f20ffe9dd64: Cannot access memory at address 0xf9e39f20ffe9dd64
(gdb)

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-15 Thread ebotcazou at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #27 from Eric Botcazou  ---
> Eric,
> 
> I had started drop OpenBSD patches to dismiss an assumption that one of them
> introduced the issue. Well, I just reproduced it with gcc-15.2.0 without any
> patches.
> 
> I have run: make stage1-bubble
> 
> It was configured as:
> 
> --build=sparc64-unknown-openbsd --verbose  --program-transform-name=s,^,e, 
> --disable-nls   --with-system-zlib  --disable-libmudflap  --disable-libgomp 
> --disable-libssp  --disable-tls  --with-gnu-ld  --with-gnu-as 
> --enable-threads=posix  --enable-wchar_t  --with-gmp="/usr/local" 
> --enable-languages=c,c++,fortran,objc  --disable-libstdcxx-pch 
> --enable-default-pie  --enable-host-pie  --enable-host-shared 
> --enable-standard-branch-protection  --without-isl --enable-default-ssp
> --enable-cpp --prefix='/usr/local' --sysconfdir='/etc'
> --mandir='/usr/local/man' --infodir='/usr/local/info' --localstatedir='/var'
> --disable-silent-rules --disable-gtk-doc

Can you remove --enable-default-pie --enable-host-pie and try again?

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-15 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #26 from Kirill A. Korinsky  ---
Eric,

I had started drop OpenBSD patches to dismiss an assumption that one of them
introduced the issue. Well, I just reproduced it with gcc-15.2.0 without any
patches.

I have run: make stage1-bubble

It was configured as:

--build=sparc64-unknown-openbsd --verbose  --program-transform-name=s,^,e, 
--disable-nls   --with-system-zlib  --disable-libmudflap  --disable-libgomp 
--disable-libssp  --disable-tls  --with-gnu-ld  --with-gnu-as 
--enable-threads=posix  --enable-wchar_t  --with-gmp="/usr/local" 
--enable-languages=c,c++,fortran,objc  --disable-libstdcxx-pch 
--enable-default-pie  --enable-host-pie  --enable-host-shared 
--enable-standard-branch-protection  --without-isl --enable-default-ssp
--enable-cpp --prefix='/usr/local' --sysconfdir='/etc'
--mandir='/usr/local/man' --infodir='/usr/local/info' --localstatedir='/var'
--disable-silent-rules --disable-gtk-doc

configure environment variable was:

am_cv_func_iconv=no ac_cv_prog_M4=/usr/bin/m4 ac_cv_header_magic_h=no
lt_cv_path_SED=/usr/bin/sed STRIP=/usr/bin/strip
CONFIG_SITE='/usr/ports/pobj/gcc-15.2.0/config.site' MKDIR_P='mkdir -p'
DATADIRNAME=share ac_cv_path_GTKDOC_CHECK=""   ac_cv_path_GTKDOC_REBASE=""
ac_cv_path_GTKDOC_MKPDF="" MAKE=gmake LIBTOOL="/usr/bin/libtool" 
LIBestdc++_LTVERSION='-version-info 21:0:0' libestdc___ltversion=21.0
LIBgfortran_LTVERSION='-version-info 10:0:0' libgfortran_ltversion=10.0
LIBobjc_LTVERSION='-version-info 10:0:0' libobjc_ltversion=10.0
LIBlto_plugin_LTVERSION='-version-info 7:0:0' liblto_plugin_ltversion=7.0
LIBitm_LTVERSION='-version-info 6:0:0' libitm_ltversion=6.0
LIBatomic_LTVERSION='-version-info 5:0:0' libatomic_ltversion=5.0
LIBquadmath_LTVERSION='-version-info 5:0:0' libquadmath_ltversion=5.0
LIBcc1_LTVERSION='-version-info 3:0:0' libcc1_ltversion=3.0
LIBcc1plugin_LTVERSION='-version-info 3:0:0' libcc1plugin_ltversion=3.0
LIBcp1plugin_LTVERSION='-version-info 2:0:0' libcp1plugin_ltversion=2.0
PATH=/usr/ports/pobj/gcc-15.2.0/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11R6/bin

make environment variable was:
am_cv_func_iconv=no ac_cv_prog_M4=/usr/bin/m4 ac_cv_header_magic_h=no
lt_cv_path_SED=/usr/bin/sed STRIP=/usr/bin/strip AUTOMAKE_VERSION=1.4
AUTOCONF_VERSION=2.13 CONFIG_SITE='/usr/ports/pobj/gcc-15.2.0/config.site'
PORTSDIR="/usr/ports" LIBTOOL="/usr/bin/libtool" 
LIBestdc++_LTVERSION='-version-info 21:0:0' libestdc___ltversion=21.0
LIBgfortran_LTVERSION='-version-info 10:0:0' libgfortran_ltversion=10.0
LIBobjc_LTVERSION='-version-info 10:0:0' libobjc_ltversion=10.0
LIBlto_plugin_LTVERSION='-version-info 7:0:0' liblto_plugin_ltversion=7.0
LIBitm_LTVERSION='-version-info 6:0:0' libitm_ltversion=6.0
LIBatomic_LTVERSION='-version-info 5:0:0' libatomic_ltversion=5.0
LIBquadmath_LTVERSION='-version-info 5:0:0' libquadmath_ltversion=5.0
LIBcc1_LTVERSION='-version-info 3:0:0' libcc1_ltversion=3.0
LIBcc1plugin_LTVERSION='-version-info 3:0:0' libcc1plugin_ltversion=3.0
LIBcp1plugin_LTVERSION='-version-info 2:0:0' libcp1plugin_ltversion=2.0
PATH='/usr/ports/pobj/gcc-15.2.0/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11R6/bin'
PREFIX='/usr/local'  LOCALBASE='/usr/local' X11BASE='/usr/X11R6'  CFLAGS='-O2
-g'  TRUEPREFIX='/usr/local' DESTDIR=''  HOME='/gcc-15.2.0_writes_to_HOME'
PICFLAG="-fPIC"  BINGRP=bin BINOWN=root BINMODE=755 NONBINMODE=644  DIRMODE=755
 INSTALL_COPY=-c INSTALL_STRIP=-s  MANGRP=bin MANOWN=root MANMODE=644
BSD_INSTALL_PROGRAM="/usr/ports/pobj/gcc-15.2.0/bin/install -c -s -m 755" 
BSD_INSTALL_SCRIPT="/usr/ports/pobj/gcc-15.2.0/bin/install -c -m 755" 
BSD_INSTALL_DATA="/usr/ports/pobj/gcc-15.2.0/bin/install -c -m 644" 
BSD_INSTALL_MAN="/usr/ports/pobj/gcc-15.2.0/bin/install -c -m 644" 
BSD_INSTALL_PROGRAM_DIR="/usr/ports/pobj/gcc-15.2.0/bin/install -d -m 755" 
BSD_INSTALL_SCRIPT_DIR="/usr/ports/pobj/gcc-15.2.0/bin/install -d -m 755" 
BSD_INSTALL_DATA_DIR="/usr/ports/pobj/gcc-15.2.0/bin/install -d -m 755" 
BSD_INSTALL_MAN_DIR="/usr/ports/pobj/gcc-15.2.0/bin/install -d -m 755"


(gdb) r
Starting program: /usr/ports/pobj/gcc-15.2.0/build-sparc64/gcc/cc1 -quiet
-nostdinc -v -iprefix
/usr/ports/pobj/gcc-15.2.0/build-sparc64/gcc/../lib/gcc/sparc64-unknown-openbsd/15.2.0/
-isystem /usr/ports/pobj/gcc-15.2.0/build-sparc64/./gcc/include -isystem
/usr/ports/pobj/gcc-15.2.0/build-sparc64/./gcc/include-fixed -D__sparc_v9__
/dev/null -quiet -dumpbase null -mcpu=ultrasparc -version -fno-checking
-fself-test=/usr/ports/pobj/gcc-15.2.0/gcc-15.2.0/gcc/testsuite/selftests -o
/dev/null

Program received signal SIGSEGV, Segmentation fault.
0x008aaa0607a8 in _ZN4bidi7contextC1Ev+0xfb59f864@plt ()
(gdb) disassemble 
Dump of assembler code for function
_ZN4bidi7contextC1Ev+0xfb59f864@plt:
   0x008aaa060798 <+0>: mov  %o7, %g5
   0x008aaa06079c <+4>: call  0x8aaa0607a4
<_ZN4bidi7contextC1Ev+0xfb59f864@plt+12>
   0x008aaa0607a0 <+8>: nop 
   0x0

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-14 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #25 from Kirill A. Korinsky  ---
Same:

(gdb) r
Starting program: /usr/ports/pobj/gcc-8.4.0/build-sparc64/gcc/cc1plus -nostdinc
-v -iprefix
/usr/ports/pobj/gcc-8.4.0/build-sparc64/gcc/../lib/gcc/sparc64-unknown-openbsd/10.0.0/
-isystem /usr/ports/pobj/gcc-8.4.0/build-sparc64/./gcc/include -isystem
/usr/ports/pobj/gcc-8.4.0/build-sparc64/./gcc/include-fixed -D__sparc_v9__
/dev/null -dumpbase null -mcpu=ultrasparc -auxbase-strip /dev/null -version
-fself-test=/usr/ports/pobj/gcc-8.4.0/gcc-a8b98e2fc074dfb6c9419efbe70ce4021a04f356/gcc/testsuite/selftests
-o /dev/null
GNU C++14 (GCC) version 10.0.0 20190613 (experimental)
(sparc64-unknown-openbsd)
compiled by GNU C version 8.4.0, GMP version 6.3.0, MPFR version 4.2.2,
MPC version 1.2.1, isl version none
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
#include "..." search starts here:
#include <...> search starts here:
 /usr/ports/pobj/gcc-8.4.0/build-sparc64/./gcc/include
 /usr/ports/pobj/gcc-8.4.0/build-sparc64/./gcc/include-fixed
End of search list.
GNU C++14 (GCC) version 10.0.0 20190613 (experimental)
(sparc64-unknown-openbsd)
compiled by GNU C version 8.4.0, GMP version 6.3.0, MPFR version 4.2.2,
MPC version 1.2.1, isl version none
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
options passed:  -nostdinc -v
 -iprefix
/usr/ports/pobj/gcc-8.4.0/build-sparc64/gcc/../lib/gcc/sparc64-unknown-openbsd/10.0.0/
 -isystem /usr/ports/pobj/gcc-8.4.0/build-sparc64/./gcc/include
 -isystem /usr/ports/pobj/gcc-8.4.0/build-sparc64/./gcc/include-fixed
 -D__sparc_v9__ /dev/null -mcpu=ultrasparc -auxbase-strip /dev/null

-fself-test=/usr/ports/pobj/gcc-8.4.0/gcc-a8b98e2fc074dfb6c9419efbe70ce4021a04f356/gcc/testsuite/selftests
options enabled:  -fPIC -fPIE -faggressive-loop-optimizations
 -fassume-phsa -fauto-inc-dec -fcommon -fdelete-null-pointer-checks
 -fearly-inlining -feliminate-unused-debug-symbols
 -feliminate-unused-debug-types -fexceptions -ffp-int-builtin-inexact
 -ffunction-cse -fgcse-lm -fgnu-runtime -fgnu-unique -fident
 -finline-atomics -fipa-stack-alignment -fira-hoist-pressure
 -fira-share-spill-slots -fivopts -fkeep-static-consts -fleading-underscore
 -flifetime-dse -fmath-errno -fmerge-debug-strings -fpeephole -fplt
 -fprefetch-loop-arrays -freg-struct-return -fsched-critical-path-heuristic
 -fsched-dep-count-heuristic -fsched-group-heuristic -fsched-interblock
 -fsched-last-insn-heuristic -fsched-rank-heuristic -fsched-spec
 -fsched-spec-insn-heuristic -fsched-stalled-insns-dep -fschedule-fusion
 -fsemantic-interposition -fshow-column -fshrink-wrap-separate
 -fsigned-zeros -fsplit-ivs-in-unroller -fssa-backprop
 -fstack-protector-strong -fstdarg-opt -fstrict-volatile-bitfields
 -fsync-libcalls -fsyntax-only -ftrapping-math -ftree-cselim
 -ftree-forwprop -ftree-loop-if-convert -ftree-loop-im -ftree-loop-ivcanon
 -ftree-loop-optimize -ftree-parallelize-loops= -ftree-phiprop
 -ftree-reassoc -ftree-scev-cprop -funit-at-a-time -fvar-tracking
 -fvar-tracking-assignments -fzero-initialized-in-bss -m64 -mapp-regs -mfpu
 -mfsmuld -mlra -mptr64 -msoft-quad-float -mstack-bias -muser-mode
Compiler executable checksum: d7c52f38ace7df81be5b8da0287ac38d
 {GC 1479k -> 1204k} {GC 1204k -> 1204k} {GC 1205k -> 1205k} {GC 1205k ->
1205k} {GC 1205k -> 1205k} {GC 1205k -> 1205k} {GC 1205k -> 1205k} {GC 1205k ->
1205k} {GC 1205k -> 1205k} {GC 9627k -> 1218k}
Program received signal SIGSEGV, Segmentation fault.
0x00f009ef7b10 in
_Z20notice_global_symbolP9tree_node+0xfd0084fc@plt ()
(gdb) bt
#0  0x00f009ef7b10 in
_Z20notice_global_symbolP9tree_node+0xfd0084fc@plt ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) disassemble 
Dump of assembler code for function
_Z20notice_global_symbolP9tree_node+0xfd0084fc@plt:
   0x00f009ef7b00 <+0>: mov  %o7, %g5
   0x00f009ef7b04 <+4>: call  0xf009ef7b0c
<_Z20notice_global_symbolP9tree_node+0xfd0084fc@plt+12>
   0x00f009ef7b08 <+8>: nop 
   0x00f009ef7b0c <+12>:ldx  [ %o7 + 0x2c ], %g1
=> 0x00f009ef7b10 <+16>:jmpl  %o7 + %g1, %g1
   0x00f009ef7b14 <+20>:mov  %g5, %o7
End of assembler dump.
(gdb) p/x $g1
$1 = 0xfb8ee10cffec
(gdb) x/x $g1
0xfb8ee10cffec: Cannot access memory at address 0xfb8ee10cffec
(gdb) p/x $o7 + 0x2c
$2 = 0xf009ef7b30
(gdb) x/x $o7 + 0x2c
0xf009ef7b30 <[email protected]>: 0xfb8ee10c
(gdb)

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-14 Thread ebotcazou at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #24 from Eric Botcazou  ---
> Eric, I have removed this line from patches and rebuild the same commit.
> 
> It fails as well.

Thanks.  Something else looks suspicious in config/sparc/openbsd64.h:

@@ -42,10 +39,17 @@ along with GCC; see the file COPYING3.  If not see
   while (0)

 #undef ASM_SPEC
+#ifdef PIE_DEFAULT
 #define ASM_SPEC "\
+-s %{fpic|fPIC:-K PIC} %{!fno-pie: %{!p: %{!pg: -K PIC}}} \
+%(asm_cpu) %(asm_arch) \
+"
+#else
+#define ASM_SPEC "\
 -s %{" FPIE_OR_FPIC_SPEC ":-K PIC} \
 %(asm_cpu) %(asm_arch) \
 "
+#endif

 /* Layout of source language data types.  */
 #undef WCHAR_TYPE

Can you remove it as well?

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-14 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #23 from Kirill A. Korinsky  ---
Eric, I have removed this line from patches and rebuild the same commit.

It fails as well.

(gdb) r
Starting program: /usr/ports/pobj/gcc-8.4.0/build-sparc64/gcc/cc1plus -nostdinc
-v -iprefix
/usr/ports/pobj/gcc-8.4.0/build-sparc64/gcc/../lib/gcc/sparc64-unknown-openbsd/10.0.0/
-isystem /usr/ports/pobj/gcc-8.4.0/build-sparc64/./gcc/include -isystem
/usr/ports/pobj/gcc-8.4.0/build-sparc64/./gcc/include-fixed -D__sparc_v9__
/dev/null -dumpbase null -mcpu=ultrasparc -auxbase-strip /dev/null -version
-fself-test=/usr/ports/pobj/gcc-8.4.0/gcc-a8b98e2fc074dfb6c9419efbe70ce4021a04f356/gcc/testsuite/selftests
-o /dev/null
GNU C++14 (GCC) version 10.0.0 20190613 (experimental)
(sparc64-unknown-openbsd)
compiled by GNU C version 8.4.0, GMP version 6.3.0, MPFR version 4.2.2,
MPC version 1.2.1, isl version none
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
#include "..." search starts here:
#include <...> search starts here:
 /usr/ports/pobj/gcc-8.4.0/build-sparc64/./gcc/include
 /usr/ports/pobj/gcc-8.4.0/build-sparc64/./gcc/include-fixed
End of search list.
GNU C++14 (GCC) version 10.0.0 20190613 (experimental)
(sparc64-unknown-openbsd)
compiled by GNU C version 8.4.0, GMP version 6.3.0, MPFR version 4.2.2,
MPC version 1.2.1, isl version none
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
options passed:  -nostdinc -v
 -iprefix
/usr/ports/pobj/gcc-8.4.0/build-sparc64/gcc/../lib/gcc/sparc64-unknown-openbsd/10.0.0/
 -isystem /usr/ports/pobj/gcc-8.4.0/build-sparc64/./gcc/include
 -isystem /usr/ports/pobj/gcc-8.4.0/build-sparc64/./gcc/include-fixed
 -D__sparc_v9__ /dev/null -mcpu=ultrasparc -auxbase-strip /dev/null

-fself-test=/usr/ports/pobj/gcc-8.4.0/gcc-a8b98e2fc074dfb6c9419efbe70ce4021a04f356/gcc/testsuite/selftests
options enabled:  -fPIC -fPIE -faggressive-loop-optimizations
 -fassume-phsa -fauto-inc-dec -fcommon -fdelete-null-pointer-checks
 -fearly-inlining -feliminate-unused-debug-symbols
 -feliminate-unused-debug-types -fexceptions -ffp-int-builtin-inexact
 -ffunction-cse -fgcse-lm -fgnu-runtime -fgnu-unique -fident
 -finline-atomics -fipa-stack-alignment -fira-hoist-pressure
 -fira-share-spill-slots -fivopts -fkeep-static-consts -fleading-underscore
 -flifetime-dse -fmath-errno -fmerge-debug-strings -fpeephole -fplt
 -fprefetch-loop-arrays -freg-struct-return -fsched-critical-path-heuristic
 -fsched-dep-count-heuristic -fsched-group-heuristic -fsched-interblock
 -fsched-last-insn-heuristic -fsched-rank-heuristic -fsched-spec
 -fsched-spec-insn-heuristic -fsched-stalled-insns-dep -fschedule-fusion
 -fsemantic-interposition -fshow-column -fshrink-wrap-separate
 -fsigned-zeros -fsplit-ivs-in-unroller -fssa-backprop
 -fstack-protector-strong -fstdarg-opt -fstrict-volatile-bitfields
 -fsync-libcalls -fsyntax-only -ftrapping-math -ftree-cselim
 -ftree-forwprop -ftree-loop-if-convert -ftree-loop-im -ftree-loop-ivcanon
 -ftree-loop-optimize -ftree-parallelize-loops= -ftree-phiprop
 -ftree-reassoc -ftree-scev-cprop -funit-at-a-time -fvar-tracking
 -fvar-tracking-assignments -fzero-initialized-in-bss -m64 -mapp-regs -mfpu
 -mfsmuld -mlra -mptr64 -msoft-quad-float -mstack-bias -muser-mode
Compiler executable checksum: cf0f82cc7c9fcf63ecbf4337c6894523
 {GC 1479k -> 1204k} {GC 1204k -> 1204k} {GC 1205k -> 1205k} {GC 1205k ->
1205k} {GC 1205k -> 1205k} {GC 1205k -> 1205k} {GC 1205k -> 
1205k} {GC 1205k -> 1205k} {GC 1205k -> 1205k} {GC 9627k -> 1218k}
Program received signal SIGSEGV, Segmentation fault.
0x00210a8f7b10 in
_Z20notice_global_symbolP9tree_node+0xfd0084fc@plt ()
(gdb) bt
#0  0x00210a8f7b10 in
_Z20notice_global_symbolP9tree_node+0xfd0084fc@plt ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) disassemble 
Dump of assembler code for function
_Z20notice_global_symbolP9tree_node+0xfd0084fc@plt:
   0x00210a8f7b00 <+0>: mov  %o7, %g5
   0x00210a8f7b04 <+4>: call  0x210a8f7b0c
<_Z20notice_global_symbolP9tree_node+0xfd0084fc@plt+12>
   0x00210a8f7b08 <+8>: nop 
   0x00210a8f7b0c <+12>:ldx  [ %o7 + 0x2c ], %g1
=> 0x00210a8f7b10 <+16>:jmpl  %o7 + %g1, %g1
   0x00210a8f7b14 <+20>:mov  %g5, %o7
End of assembler dump.
(gdb) p/x $g1
$1 = 0xfb8ee10cffec
(gdb) x/x $g1
0xfb8ee10cffec: Cannot access memory at address 0xfb8ee10cffec
(gdb) x/gx $o7 + 0x2c
0x210a8f7b30 <[email protected]>:
0xfb8ee10cffec
(gdb) p/x $o7 + 0x2c
$2 = 0x210a8f7b30
(gdb)

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-14 Thread ebotcazou at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #22 from Eric Botcazou  ---
> Yes, OpenBSD has some patches. This build had applied the folowing patches:
> 
> https://kirill.korins.ky/pub/gcc-sparc64-a8b98e2-patch.diff.txt

Can you remove this line in there?

 sparc64-*-openbsd*)
+   tm_defines="${tm_defines} DEFAULT_FLAG_PIE=2"

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-14 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #21 from Kirill A. Korinsky  ---
This build was configured as:

--build=sparc64-unknown-openbsd --with-as="/usr/local/bin/gas" --verbose 
--program-transform-name=s,^,e,  --disable-nls   --with-system-zlib 
--disable-libmudflap  --disable-libgomp  --disable-libssp  --disable-tls 
--with-gnu-ld  --with-gnu-as  --enable-threads=posix  --enable-wchar_t 
--with-gmp="/usr/local"  --enable-languages=c,c++  --disable-libstdcxx-pch 
--enable-default-pie  --without-isl --enable-default-ssp --enable-cpp
--prefix='/usr/local' --sysconfdir='/etc' --mandir='/usr/local/man'
--infodir='/usr/local/info' --localstatedir='/var' --disable-silent-rules
--disable-gtk-doc

Yes, OpenBSD has some patches. This build had applied the folowing patches:

https://kirill.korins.ky/pub/gcc-sparc64-a8b98e2-patch.diff.txt

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-14 Thread ebotcazou at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #20 from Eric Botcazou  ---
> (gdb) p/x $g1
> $4 = 0xfb8ee10cffec
> (gdb) x/x $g1
> 0xfb8ee10cffec: Cannot access memory at address 0xfb8ee10cffec
> (gdb)

So it's garbage, i.e. the @got.plt symbol apparently contains garbage.

How do you configure the compiler exactly?  Do you have OpenBSD-specific
patches applied to the sources?

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-14 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #19 from Kirill A. Korinsky  ---
Do you mean this one?

(gdb) p/x $g1
$4 = 0xfb8ee10cffec
(gdb) x/x $g1
0xfb8ee10cffec: Cannot access memory at address 0xfb8ee10cffec
(gdb)

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-14 Thread ebotcazou at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #18 from Eric Botcazou  ---
> Eric, it feels that I don't understand that this code is doing.
> 
>0x00e6d45f7b0c <+12>:ldx  [ %o7 + 0x2c ], %g1
> => 0x00e6d45f7b10 <+16>:jmpl  %o7 + %g1, %g1
> 
> At begining it loads %o7 + 0x2c aka 0xe6d45f7b30
> <[email protected]> into %g1
> 
> After that it tries to jump to %o7 + %g1 which is wrong address:
> 
> (gdb) x/gx $o7 + $g1
> 0xfb8ee1f3d44f7b00: Cannot access memory at address 0xfb8ee1f3d44f7b00
> (gdb) 

OK, it's the jmpl.  The @got.plt symbol is supposed to contain an offset so
adding it to %o7 (which contains the PC) makes sense.

What does %g1 alone point to?

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-14 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #17 from Kirill A. Korinsky  ---
Eric, it feels that I don't understand that this code is doing.

   0x00e6d45f7b0c <+12>:ldx  [ %o7 + 0x2c ], %g1
=> 0x00e6d45f7b10 <+16>:jmpl  %o7 + %g1, %g1

At begining it loads %o7 + 0x2c aka 0xe6d45f7b30
<[email protected]> into %g1

After that it tries to jump to %o7 + %g1 which is wrong address:

(gdb) x/gx $o7 + $g1
0xfb8ee1f3d44f7b00: Cannot access memory at address 0xfb8ee1f3d44f7b00
(gdb) 

So, from where I am it should be:

jumpl %g1, %g1

or

jmpl  %o7 + 0x2c, %g1

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-14 Thread ebotcazou at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #16 from Eric Botcazou  ---
> (gdb) bt
> #0  0x00e6d45f7b10 in
> _Z20notice_global_symbolP9tree_node+0xfd0084fc@plt ()
> Backtrace stopped: previous frame identical to this frame (corrupt stack?)
> (gdb) disassemble 
> Dump of assembler code for function
> _Z20notice_global_symbolP9tree_node+0xfd0084fc@plt:
>0x00e6d45f7b00 <+0>: mov  %o7, %g5
>0x00e6d45f7b04 <+4>: call  0xe6d45f7b0c
> <_Z20notice_global_symbolP9tree_node+0xfd0084fc@plt+12>
>0x00e6d45f7b08 <+8>: nop 
>0x00e6d45f7b0c <+12>:ldx  [ %o7 + 0x2c ], %g1
> => 0x00e6d45f7b10 <+16>:jmpl  %o7 + %g1, %g1
>0x00e6d45f7b14 <+20>:mov  %g5, %o7
> End of assembler dump.
> (gdb) x/gx $o7 + 0x2c
> 0xe6d45f7b30 <[email protected]>:
> 0xfb8ee10cffec
> (gdb) p/x $o7 + 0x2c
> $1 = 0xe6d45f7b30
> (gdb) p/x $g1
> $2 = 0xfb8ee10cffec

So the problematic instruction is the jmpl instead of the ldx and %o7 + %g1
points to nowhere?  If so, this means that the GOT slot contains garbage.

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-14 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #15 from Kirill A. Korinsky  ---
And when I run it via gdb:

Compiler executable checksum: 44669b51357308e94cba2c268643223e
 {GC 1479k -> 1204k} {GC 1204k -> 1204k} {GC 1205k -> 1205k} {GC 1205k ->
1205k} {GC 1205k -> 1205k} {GC 1205k -> 1205k} {GC 1205k -> 1205k} {GC 1205k ->
1205k} {GC 1205k -> 1205k} {GC 9627k -> 1218k}
Program received signal SIGSEGV, Segmentation fault.
0x00e6d45f7b10 in
_Z20notice_global_symbolP9tree_node+0xfd0084fc@plt ()
(gdb) bt
#0  0x00e6d45f7b10 in
_Z20notice_global_symbolP9tree_node+0xfd0084fc@plt ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) disassemble 
Dump of assembler code for function
_Z20notice_global_symbolP9tree_node+0xfd0084fc@plt:
   0x00e6d45f7b00 <+0>: mov  %o7, %g5
   0x00e6d45f7b04 <+4>: call  0xe6d45f7b0c
<_Z20notice_global_symbolP9tree_node+0xfd0084fc@plt+12>
   0x00e6d45f7b08 <+8>: nop 
   0x00e6d45f7b0c <+12>:ldx  [ %o7 + 0x2c ], %g1
=> 0x00e6d45f7b10 <+16>:jmpl  %o7 + %g1, %g1
   0x00e6d45f7b14 <+20>:mov  %g5, %o7
End of assembler dump.
(gdb) x/gx $o7 + 0x2c
0xe6d45f7b30 <[email protected]>:
0xfb8ee10cffec
(gdb) p/x $o7 + 0x2c
$1 = 0xe6d45f7b30
(gdb) p/x $g1
$2 = 0xfb8ee10cffec
(gdb)

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-14 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #14 from Kirill A. Korinsky  ---
So, here the first crash on selftest which I had discovered by git bisect

Commit:
https://gcc.gnu.org/cgit/gcc/commit/?id=a8b98e2fc074dfb6c9419efbe70ce4021a04f356it
 

When I run it as:

/usr/ports/pobj/gcc-8.4.0/build-sparc64/./gcc/cc1plus -nostdinc -v -iprefix
/usr/ports/pobj/gcc-8.4.0/build-sparc64/gcc/../lib/gcc/sparc64-unknown-openbsd/10.0.0/
-isystem /usr/ports/pobj/gcc-8.4.0/build-sparc64/./gcc/include -isystem
/usr/ports/pobj/gcc-8.4.0/build-sparc64/./gcc/include-fixed -D__sparc_v9__
/dev/null -dumpbase null -mcpu=ultrasparc -auxbase-strip /dev/null -version
-fself-test=/usr/ports/pobj/gcc-8.4.0/gcc-a8b98e2fc074dfb6c9419efbe70ce4021a04f356/gcc/testsuite/selftests
-o /dev/null

It fails like this:

GNU C++14 (GCC) version 10.0.0 20190613 (experimental)
(sparc64-unknown-openbsd)
compiled by GNU C version 8.4.0, GMP version 6.3.0, MPFR version 4.2.2,
MPC version 1.2.1, isl version none
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
#include "..." search starts here:
#include <...> search starts here:
 /usr/ports/pobj/gcc-8.4.0/build-sparc64/./gcc/include
 /usr/ports/pobj/gcc-8.4.0/build-sparc64/./gcc/include-fixed
End of search list.
GNU C++14 (GCC) version 10.0.0 20190613 (experimental)
(sparc64-unknown-openbsd)
compiled by GNU C version 8.4.0, GMP version 6.3.0, MPFR version 4.2.2,
MPC version 1.2.1, isl version none
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
options passed:  -nostdinc -v
 -iprefix
/usr/ports/pobj/gcc-8.4.0/build-sparc64/gcc/../lib/gcc/sparc64-unknown-openbsd/10.0.0/
 -isystem /usr/ports/pobj/gcc-8.4.0/build-sparc64/./gcc/include
 -isystem /usr/ports/pobj/gcc-8.4.0/build-sparc64/./gcc/include-fixed
 -D__sparc_v9__ /dev/null -mcpu=ultrasparc -auxbase-strip /dev/null

-fself-test=/usr/ports/pobj/gcc-8.4.0/gcc-a8b98e2fc074dfb6c9419efbe70ce4021a04f356/gcc/testsuite/selftests
options enabled:  -fPIC -fPIE -faggressive-loop-optimizations
 -fassume-phsa -fauto-inc-dec -fcommon -fdelete-null-pointer-checks
 -fearly-inlining -feliminate-unused-debug-symbols
 -feliminate-unused-debug-types -fexceptions -ffp-int-builtin-inexact
 -ffunction-cse -fgcse-lm -fgnu-runtime -fgnu-unique -fident
 -finline-atomics -fipa-stack-alignment -fira-hoist-pressure
 -fira-share-spill-slots -fivopts -fkeep-static-consts -fleading-underscore
 -flifetime-dse -fmath-errno -fmerge-debug-strings -fpeephole -fplt
 -fprefetch-loop-arrays -freg-struct-return -fsched-critical-path-heuristic
 -fsched-dep-count-heuristic -fsched-group-heuristic -fsched-interblock
 -fsched-last-insn-heuristic -fsched-rank-heuristic -fsched-spec
 -fsched-spec-insn-heuristic -fsched-stalled-insns-dep -fschedule-fusion
 -fsemantic-interposition -fshow-column -fshrink-wrap-separate
 -fsigned-zeros -fsplit-ivs-in-unroller -fssa-backprop
 -fstack-protector-strong -fstdarg-opt -fstrict-volatile-bitfields
 -fsync-libcalls -fsyntax-only -ftrapping-math -ftree-cselim
 -ftree-forwprop -ftree-loop-if-convert -ftree-loop-im -ftree-loop-ivcanon
 -ftree-loop-optimize -ftree-parallelize-loops= -ftree-phiprop
 -ftree-reassoc -ftree-scev-cprop -funit-at-a-time -fvar-tracking
 -fvar-tracking-assignments -fzero-initialized-in-bss -m64 -mapp-regs -mfpu
 -mfsmuld -mlra -mptr64 -msoft-quad-float -mstack-bias -muser-mode
Compiler executable checksum: 44669b51357308e94cba2c268643223e
 {GC 1479k -> 1204k} {GC 1204k -> 1204k} {GC 1205k -> 1205k} {GC 1205k ->
1205k} {GC 1205k -> 1205k} {GC 1205k -> 1205k} {GC 1205k -> 1205k} {GC 1205k ->
1205k} {GC 1205k -> 1205k} {GC 9627k -> 1218k}In function 'test':
cc1plus: internal compiler error: Segmentation fault
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-11 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #13 from Kirill A. Korinsky  ---
Meanwhile, I had found that leads to a crash on the first place (and brokes
stack).

It is this commit
https://gcc.gnu.org/cgit/gcc/commit/?id=9b884225bfc609606f9b169b021c4da93feba48e

And when I apply patch:

diff --git gcc/tree-vect-loop.c gcc/tree-vect-loop.c
index 671ef2f7658..01aea3d69e3 100644
--- gcc/tree-vect-loop.c
+++ gcc/tree-vect-loop.c
@@ -1101,7 +1101,9 @@ vect_verify_full_masking (loop_vec_info loop_vinfo)
 ??? We might want to try continuing beyond Pmode for ILP32
 targets if CMP_BITS < IV_PRECISION.  */
  iv_type = this_type;
+#if !defined(SPARC64) && !defined(__OpenBSD__)
  if (!cmp_type || iv_precision > TYPE_PRECISION (cmp_type))
+#endif
cmp_type = this_type;
  if (cmp_bits >= GET_MODE_BITSIZE (Pmode))
break;

it bootstraped.

OpenBSD has following chunk at local patches:

--- gcc/config/sparc/openbsd64.h.orig
+++ gcc/config/sparc/openbsd64.h
@@ -54,6 +58,15 @@ along with GCC; see the file COPYING3.  If not see
 #undef WCHAR_TYPE_SIZE
 #define WCHAR_TYPE_SIZE 32

+#undef WINT_TYPE
+#define WINT_TYPE "int"
+
+#undef INTMAX_TYPE
+#define INTMAX_TYPE "long long int"
+
+#undef UINTMAX_TYPE
+#define UINTMAX_TYPE "long long unsigned int"
+
 #undef SPARC_LONG_DOUBLE_TYPE_SIZE
 #define SPARC_LONG_DOUBLE_TYPE_SIZE 128


maybe it rings any bell.

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-11 Thread ebotcazou at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

Eric Botcazou  changed:

   What|Removed |Added

 CC||ebotcazou at gcc dot gnu.org

--- Comment #12 from Eric Botcazou  ---
What does the problematic address accessed by the PLT stub point to?

_ZN8poly_intILj1ExEC1IiEERKT_+0xfcbb3c94@plt:
   0x0042fca4c368 <+0>: mov  %o7, %g5
   0x0042fca4c36c <+4>: call  0x42fca4c374 
   0x0042fca4c370 <+8>: nop 
   0x0042fca4c374 <+12>:ldx  [ %o7 + 0x80c ], %g1  <--- address
   0x0042fca4c378 <+16>:jmpl  %o7 + %g1, %g1
   0x0042fca4c37c <+20>:mov  %g5, %o7

In other words 0x0042fca4c36c + 0x80c?

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-11 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #11 from Kirill A. Korinsky  ---
Ok, result of bisect. Maybe it rings any bell.

https://gcc.gnu.org/cgit/gcc/commit/?id=9b884225bfc609606f9b169b021c4da93feba48e
and
https://gcc.gnu.org/cgit/gcc/commit/?id=c29c92c789d93848cc1c929838771bfc68cb272c
fails as:

libtool: compile:  /usr/ports/pobj/gcc-8.4.0/build-sparc64/./gcc/xgcc
-shared-libgcc -B/usr/ports/pobj/gcc-8.4.0/build-sparc64/./gcc -nostdinc++
-L/usr/ports/pobj/gcc-8.4.0/build-sparc64/sparc64-unknown-openbsd/libstdc++-v3/src
-L/usr/ports/pobj/gcc-8.4.0/build-sparc64/sparc64-unknown-openbsd/libstdc++-v3/src/.libs
-L/usr/ports/pobj/gcc-8.4.0/build-sparc64/sparc64-unknown-openbsd/libstdc++-v3/libsupc++/.libs
-B/usr/local/sparc64-unknown-openbsd/bin/
-B/usr/local/sparc64-unknown-openbsd/lib/ -isystem
/usr/local/sparc64-unknown-openbsd/include -isystem
/usr/local/sparc64-unknown-openbsd/sys-include -fno-checking
-I/usr/ports/pobj/gcc-8.4.0/gcc/libstdc++-v3/../libgcc
-I/usr/ports/pobj/gcc-8.4.0/build-sparc64/sparc64-unknown-openbsd/libstdc++-v3/include/sparc64-unknown-openbsd
-I/usr/ports/pobj/gcc-8.4.0/build-sparc64/sparc64-unknown-openbsd/libstdc++-v3/include
-I/usr/ports/pobj/gcc-8.4.0/gcc/libstdc++-v3/libsupc++ -std=gnu++98
-D_GLIBCXX_SHARED -fno-implicit-templates -Wall -Wextra -Wwrite-strings
-Wcast-qual -Wabi=2 -fdiagnostics-show-location=once -ffunction-sections
-fdata-sections -frandom-seed=codecvt.lo -g -O2 -pipe -c
/usr/ports/pobj/gcc-8.4.0/gcc/libstdc++-v3/src/c++98/codecvt.cc  -fPIC -DPIC
-D_GLIBCXX_SHARED -o codecvt.o
In file included from
/usr/ports/pobj/gcc-8.4.0/build-sparc64/sparc64-unknown-openbsd/libstdc++-v3/include/bits/locale_facets.h:2655,
 from
/usr/ports/pobj/gcc-8.4.0/build-sparc64/sparc64-unknown-openbsd/libstdc++-v3/include/locale:40,
 from
/usr/ports/pobj/gcc-8.4.0/gcc/libstdc++-v3/src/c++98/codecvt.cc:25:
/usr/ports/pobj/gcc-8.4.0/build-sparc64/sparc64-unknown-openbsd/libstdc++-v3/include/bits/locale_facets.tcc:
In member function 'void std::__numpunct_cache<_CharT>::_M_cache(const
std::locale&)':
/usr/ports/pobj/gcc-8.4.0/build-sparc64/sparc64-unknown-openbsd/libstdc++-v3/include/bits/locale_facets.tcc:89:42:
internal compiler error: Segmentation fault
   89 |__grouping = new char[_M_grouping_size];
  |  ^
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.

Commit before this two
https://gcc.gnu.org/cgit/gcc/commit/?id=fa9863e7d34ecd011ae75083be2ae124e5831b64
had sucefully bootstraped.

Meanwhile, since https://gcc.gnu.org/cgit/gcc/commit/?id=
a8b98e2fc074dfb6c9419efbe70ce4021a04f356it fails on the first use of the first
cc1, like this:

/usr/ports/pobj/gcc-8.4.0/build-sparc64/./gcc/xgcc
-B/usr/ports/pobj/gcc-8.4.0/build-sparc64/./gcc/ -xc++ -nostdinc /dev/null -S
-o /dev/null -fself-test=/usr/ports/pobj/gcc-8.4.0/gcc/gcc/testsuite/selftests
In function 'test':
cc1plus: internal compiler error: Segmentation fault
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
gmake[3]: *** [/usr/ports/pobj/gcc-8.4.0/gcc/gcc/cp/Make-lang.in:178:
s-selftest-c++] Error 1

And I can confirm that it fails on 15.2.0 and 16.0.0 which I tried from this
commit:
https://gcc.gnu.org/cgit/gcc/commit/?id=767f65cf82b516656dda95802a83bf905550f0b3
both are failed.

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-06 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #10 from Kirill A. Korinsky  ---
and when I build it by clang, I do have:

Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/ports/pobj/gcc-15.1.0/build-sparc64/gcc/cc1...
[New process 452166]
Core was generated by `cc1'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00cf08cd5bb0 in
_Z29hash_table_higher_prime_indexm+0xfbd2a45c@plt ()
(gdb) bt
#0  0x00cf08cd5bb0 in
_Z29hash_table_higher_prime_indexm+0xfbd2a45c@plt ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) 


same as before

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-08-05 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #9 from Kirill A. Korinsky  ---
Meanwhile, I had a confirmation that GCC-15.1.0 fails the same way.

echo timestamp > stmp-int-hdrs  
LC_ALL=C GCC_COLORS= /usr/ports/pobj/gcc-15.1.0/build-sparc64/./gcc/xgcc
-B/usr/ports/pobj/gcc-15.1.0/build-sparc64/./gcc/ -fno-checking -xc -nostdinc
/dev/n
ull -S -o /dev/null
-fself-test=/usr/ports/pobj/gcc-15.1.0/gcc-15.1.0/gcc/testsuite/selftests   
xgcc: internal compiler error: Segmentation fault signal terminated program cc1 
Please submit a full bug report, with preprocessed source (by using
-freport-bug).  
See  for instructions.   
gmake[3]: *** [/usr/ports/pobj/gcc-15.1.0/gcc-15.1.0/gcc/c/Make-lang.in:152:
s-selftest-c] Error 4   
gmake[3]: *** Waiting for unfinished jobs   

and inside core:

Reading symbols from /usr/ports/pobj/gcc-15.1.0/build-sparc64/gcc/cc1...
[New process 452868]
Core was generated by `cc1'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000a26a57f30 in _ZN4bidi7contextC1Ev+0xfb5a80dc@plt ()
(gdb) bt
#0  0x000a26a57f30 in _ZN4bidi7contextC1Ev+0xfb5a80dc@plt ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) bt f
#0  0x000a26a57f30 in _ZN4bidi7contextC1Ev+0xfb5a80dc@plt ()
No symbol table info available.
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-05-09 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #8 from Kirill A. Korinsky  ---
Just finished the test with gcc-12.5.0.

It fails.

My test was: build gcc-12.5.0 by clang18, and try to use gcc12 to build gcc12.

gdb session:

(gdb) r 
Starting program: /usr/ports/pobj/gcc-12.4.0/build-sparc64/gcc/cc1  
warning: File
"/usr/ports/pobj/kirill-gcc/gcc-12.4.0-by-clang18/usr/local/lib/libestdc++.so.21.0-gdb.py"
auto-loading has been declined by your `auto-load safe-path' set to
"/usr/local/share/gdb/auto-load".   
To enable execution of this file add
add-auto-load-safe-path
/usr/ports/pobj/kirill-gcc/gcc-12.4.0-by-clang18/usr/local/lib/libestdc++.so.21.0-gdb.py
line to your configuration file "/home/kmos/.config/gdb/gdbinit".
To completely disable this security protection add
set auto-load safe-path /
line to your configuration file "/home/kmos/.config/gdb/gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
info "(gdb)Auto-loading safe path"

Program received signal SIGSEGV, Segmentation fault.
0x0017b3ae6728 in _Z29hash_table_higher_prime_indexm+0xfc6198e4@plt
()
(gdb) b _Z29hash_table_higher_prime_indexm+0xfc6198e4@plt
Breakpoint 1 at 0x17b3ae6718
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/ports/pobj/gcc-12.4.0/build-sparc64/gcc/cc1 
warning: File
"/usr/ports/pobj/kirill-gcc/gcc-12.4.0-by-clang18/usr/local/lib/libestdc++.so.21.0-gdb.py"
auto-loading has been declined by your `auto-load safe-path' set to
"/usr/local/share/gdb/auto-load".

Breakpoint 1, 0x00f145ae6718 in
_Z29hash_table_higher_prime_indexm+0xfc6198e4@plt ()
(gdb) c
Continuing.

Breakpoint 1, 0x00f145ae6718 in
_Z29hash_table_higher_prime_indexm+0xfc6198e4@plt ()
(gdb) bt
#0  0x00f145ae6718 in
_Z29hash_table_higher_prime_indexm+0xfc6198e4@plt ()
#1  0x00f144731d28 in hash_table, simple_hashmap_traits, mem_usage_pair > >::hash_entry, false,
xcallocator>::hash_table (this=0xf36e1c5560, size=13, ggc=false,
sanitize_eq_and_hash=false, gather_mem_stats=false, 
origin=HASH_MAP_ORIGIN) at
/usr/ports/pobj/gcc-12.4.0/gcc-12.4.0/gcc/hash-table.h:618
#2  0x00f144730f88 in hash_map,
simple_hashmap_traits,
mem_usage_pair > >::hash_map (this=0xf36e1c5560, n=13, ggc=false,
sanitize_eq_and_hash=false, gather_mem_stats=false)
at /usr/ports/pobj/gcc-12.4.0/gcc-12.4.0/gcc/hash-map.h:142
#3  0x00f144730750 in
mem_alloc_description::mem_alloc_description (this=0xf145deb518
)
at /usr/ports/pobj/gcc-12.4.0/gcc-12.4.0/gcc/mem-stats.h:560
#4  0x00f14472f52c in __static_initialization_and_destruction_0
(__initialize_p=1, __priority=65535)
at /usr/ports/pobj/gcc-12.4.0/gcc-12.4.0/gcc/vec.cc:114
#5  0x00f14472f590 in
_GLOBAL__sub_I__ZN10vec_prefix17register_overheadEPvmm () at
/usr/ports/pobj/gcc-12.4.0/gcc-12.4.0/gcc/vec.cc:592
#6  0x00f1421006a4 in _start ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x00f145ae6728 in _Z29hash_table_higher_prime_indexm+0xfc6198e4@plt
()
(gdb) bt
#0  0x00f145ae6728 in
_Z29hash_table_higher_prime_indexm+0xfc6198e4@plt ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-05-07 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #7 from Kirill A. Korinsky  ---
For that it worth I had tried to remove 'const' by moving definition into .c
file and use 'extern' in .h.

Crashed the same way.

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-05-07 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #6 from Kirill A. Korinsky  ---
I have backported both patch to used 8.4.0 as bootstrap compiler and 11.2.0 as
target.

It crashed the same way:

Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/ports/pobj/gcc-11.2.0/build-sparc64/gcc/cc1...
(gdb) r
Starting program: /usr/ports/pobj/gcc-11.2.0/build-sparc64/gcc/cc1 

Program received signal SIGSEGV, Segmentation fault.
0x00a16254c378 in _ZN8poly_intILj1ExEC1IiEERKT_+0xfcbb3c94@plt ()
(gdb) b _ZN8poly_intILj1ExEC1IiEERKT_+0xfcbb3c94@plt
Breakpoint 1 at 0xa16254c368
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/ports/pobj/gcc-11.2.0/build-sparc64/gcc/cc1 

Breakpoint 1, 0x00670c44c368 in
_ZN8poly_intILj1ExEC1IiEERKT_+0xfcbb3c94@plt ()
(gdb) c
Continuing.

Breakpoint 1, 0x00670c44c368 in
_ZN8poly_intILj1ExEC1IiEERKT_+0xfcbb3c94@plt ()
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x00670c44c378 in _ZN8poly_intILj1ExEC1IiEERKT_+0xfcbb3c94@plt ()
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/ports/pobj/gcc-11.2.0/build-sparc64/gcc/cc1 

Breakpoint 1, 0x0038ba64c368 in
_ZN8poly_intILj1ExEC1IiEERKT_+0xfcbb3c94@plt ()
(gdb) c
Continuing.

Breakpoint 1, 0x0038ba64c368 in
_ZN8poly_intILj1ExEC1IiEERKT_+0xfcbb3c94@plt ()
(gdb) bt
#0  0x0038ba64c368 in _ZN8poly_intILj1ExEC1IiEERKT_+0xfcbb3c94@plt
()
#1  0x0038b82a25c0 in __static_initialization_and_destruction_0
(__initialize_p=1, __priority=65535)
at /usr/ports/pobj/gcc-11.2.0/gcc-11.2.0/gcc/ipa-modref-tree.h:95
#2  0x0038b82a2698 in _GLOBAL__sub_I__Z16dump_alias_statsP7__sFILE () at
/usr/ports/pobj/gcc-11.2.0/gcc-11.2.0/gcc/tree-ssa-alias.c:4215
#3  0x0038b72006a4 in _start ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-05-06 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #5 from Kirill A. Korinsky  ---
Thanks,

https://gcc.gnu.org/cgit/gcc/commit/?id=dfe7b5e9e7010f10e9737d5f15f5b48ba536e8f5
and
https://gcc.gnu.org/cgit/gcc/commit/?id=29ac92436aa5c702e9e02c206e7590ebd806398e
looks quite trivial to backport.

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-05-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

Andrew Pinski  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=113976,
   ||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=116369

--- Comment #4 from Andrew Pinski  ---
PR 113976 which didn't get fixed until GCC 14.
PR 116369 which didn't get fixed until GCC 12.5.0

There might be others too.

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-05-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #3 from Andrew Pinski  ---
(In reply to Kirill A. Korinsky from comment #2)
> Andrew, thanks for reply.
> 
> I'll try to backport OpenBSD patches to 12.4.0 and try to bootsrap it, but
> it needs some time.
> 
> Am I right that it doesn't ring any bell?

Oh it is this variable:
const modref_access_node unspecified_modref_access_node
= {0, -1, -1, 0, -1, false};

Which maybe it is being placed in the read only section even though it has
dynamic initializers. Which does ring a few bells (let me look up the bug
report).

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-05-06 Thread kirill at korins dot ky via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #2 from Kirill A. Korinsky  ---
Andrew, thanks for reply.

I'll try to backport OpenBSD patches to 12.4.0 and try to bootsrap it, but it
needs some time.

Am I right that it doesn't ring any bell?

[Bug bootstrap/120145] Can't bootstrap gcc11 on OpenBSD / sparc64

2025-05-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2025-05-06
 Ever confirmed|0   |1

--- Comment #1 from Andrew Pinski  ---
static poly_int64 hard_frame_pointer_adjustment = -1;

[apinski@xeond2 gcc]$ c++filt _ZN8poly_intILj1ExEC1IiEERKT_
poly_int<1u, long long>::poly_int(int const&)



e535b963b4a3 (Richard Sandiford 2017-12-14 00:06:02 +  665)
template
e535b963b4a3 (Richard Sandiford 2017-12-14 00:06:02 +  666)
template
e535b963b4a3 (Richard Sandiford 2017-12-14 00:06:02 +  667) inline
e535b963b4a3 (Richard Sandiford 2017-12-14 00:06:02 +  668) poly_int::poly_int (const C0 &c0)
e535b963b4a3 (Richard Sandiford 2017-12-14 00:06:02 +  669) {
e535b963b4a3 (Richard Sandiford 2017-12-14 00:06:02 +  670)  
POLY_SET_COEFF (C, *this, 0, c0);
e535b963b4a3 (Richard Sandiford 2017-12-14 00:06:02 +  671)   for (unsigned
int i = 1; i < N; i++)
e535b963b4a3 (Richard Sandiford 2017-12-14 00:06:02 +  672)
POLY_SET_COEFF (C, *this, i, wi::ints_for::zero (this->coeffs[0]));
e535b963b4a3 (Richard Sandiford 2017-12-14 00:06:02 +  673) }

This has changed recently to be C++14 and constexpr.

Plus GCC 11.2. is no longer supported. Can you try building GCC 12 and then
bootstrapping 12 with itself?