[Bug bootstrap/89494] Bootstrap error when using GCC 4.2.1

2024-03-17 Thread pkubaj at anongoth dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89494

--- Comment #32 from Piotr Kubaj  ---
(In reply to Iain Sandoe from comment #31)
> what is the current situation with this 
>  - what input are we waiting for?
>  - is the problem now cleared for powerpc64-freebsd?
Probably not, but FreeBSD now uses ELFv2 and LLVM, GCC builds fine with LLVM
with one small patch:
Index: gcc/tree-vect-loop.cc
===
--- gcc/tree-vect-loop.cc   (revision 273856)
+++ gcc/tree-vect-loop.cc   (working copy)
@@ -55,6 +55,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "vec-perm-indices.h"
 #include "tree-eh.h"

+#define vec_step vec_step_
+
 /* Loop Vectorization Pass.

This pass tries to vectorize loops.


All the releases using GCC 4.2.1 are EOL now.

[Bug target/105010] [12/13 regression] GCC 12 after 20220227 fails to build on powerpc64-freebsd with Error: invalid mfcr mask

2023-02-13 Thread pkubaj at anongoth dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105010

--- Comment #23 from Piotr Kubaj  ---
(In reply to Segher Boessenkool from comment #22)
> (In reply to Piotr Kubaj from comment #21)
> > I'm not sure whether it will help, but the issue only affects building
> > 32-bit multilib libraries on powerpc64. That is, building a full 32-bit gcc
> > for powerpc works just fine.
> 
> I can reproduce it with a simple testcase always.  It needs a
> powerpc64-freebsd
> compiler, built with all default options.  With -m32 it still uses the 64-bit
> processor, so equivalent to -mcpu=power4.  If you manually use -mcpu=7450 all
> works fine.

Wouldn't it be possible to just set -mcpu=7450 in the Makefile for multilib?

[Bug target/105010] [12/13 regression] GCC 12 after 20220227 fails to build on powerpc64-freebsd with Error: invalid mfcr mask

2023-01-05 Thread pkubaj at anongoth dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105010

--- Comment #21 from Piotr Kubaj  ---
I'm not sure whether it will help, but the issue only affects building 32-bit
multilib libraries on powerpc64. That is, building a full 32-bit gcc for
powerpc works just fine.

[Bug target/105010] [12/13 regression] GCC 12 after 20220227 fails to build on powerpc64-freebsd with Error: invalid mfcr mask

2023-01-01 Thread pkubaj at anongoth dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105010

--- Comment #19 from Piotr Kubaj  ---
Created attachment 54172
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54172=edit
generated assembly

Attached.

[Bug target/105010] [12/13 regression] GCC 12 after 20220227 fails to build on powerpc64-freebsd with Error: invalid mfcr mask

2022-12-30 Thread pkubaj at anongoth dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105010

--- Comment #17 from Piotr Kubaj  ---
This also affects GCC 10.4 and the snapshots of GCC 11.

[Bug fortran/100662] intrinsic::ieee_arithmetic fails on aarch, powerpc architectures on FreeBSD

2022-05-16 Thread pkubaj at anongoth dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100662

Piotr Kubaj  changed:

   What|Removed |Added

 CC||pkubaj at anongoth dot pl

--- Comment #16 from Piotr Kubaj  ---
This issue has been fixed in FreeBSD's main branch on powerpc* in
https://cgit.freebsd.org/src/commit/?id=448c505c33cc334193590f3844406d6a74f26e2a

Similar fix could be done for other affected architectures.

[Bug target/105010] [12 regression] GCC 12 after 20220227 fails to build on powerpc64-freebsd with Error: invalid mfcr mask

2022-03-23 Thread pkubaj at anongoth dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105010

--- Comment #13 from Piotr Kubaj  ---
Is it possible there's an underlying bug in GCC and it only works on Linux
because the default for Linux for 32-bits is POWER7?

[Bug target/105010] [12 regression] GCC 12 after 20220227 fails to build on powerpc64-freebsd with Error: invalid mfcr mask

2022-03-23 Thread pkubaj at anongoth dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105010

--- Comment #11 from Piotr Kubaj  ---
Unfortunately, this fails with the original issue:
/wrkdirs/usr/ports/lang/gcc12-devel/work/.build/./gcc/xgcc
-B/wrkdirs/usr/ports/lang/gcc12-devel/work/.build/./gcc/
-B/usr/local/powerpc64-portbld-freebsd13.1/bin/
-B/usr/local/powerpc64-portbld-freebsd13.1/lib/ -isystem
/usr/local/powerpc64-portbld-freebsd13.1/include -isystem
/usr/local/powerpc64-portbld-freebsd13.1/sys-include   -fno-checking -g -O2
-pipe -DLIBICONV_PLUG -fstack-protector-strong -fno-strict-aliasing -m32 -fPIC
-mstrict-align -msecure-plt -O2  -g -O2 -pipe  -DLIBICONV_PLUG
-fstack-protector-strong -fno-strict-aliasing  -DIN_GCC -fPIC   -W -Wall
-Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -pthread
-mno-minimal-toc -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector  -fPIC
-pthread -mno-minimal-toc -I. -I. -I../../.././gcc
-I/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20220320/libgcc
-I/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20220320/libgcc/.
-I/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20220320/libgcc/../gcc
-I/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20220320/libgcc/../include 
-DHAVE_CC_TLS   -o _mulsc3.o -MT _mulsc3.o -MD -MP -MF _mulsc3.dep -DL_mulsc3
-c /wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20220320/libgcc/libgcc2.c
-fvisibility=hidden -DHIDE_EXPORTS
{standard input}: Assembler messages:
{standard input}:140: Error: invalid mfcr mask
{standard input}:147: Error: unrecognized opcode: `fcfid'
{standard input}:166: Error: invalid mfcr mask
{standard input}:175: Error: unrecognized opcode: `fcfid'
{standard input}:326: Error: invalid mfcr mask
{standard input}:337: Error: unrecognized opcode: `fcfid'
{standard input}:356: Error: invalid mfcr mask
{standard input}:365: Error: unrecognized opcode: `fcfid'

[Bug target/105010] [12 regression] GCC 12 after 20220227 fails to build on powerpc64-freebsd with Error: invalid mfcr mask

2022-03-23 Thread pkubaj at anongoth dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105010

--- Comment #9 from Piotr Kubaj  ---
Now libgcc fails to configure.
>From config.log:
configure:3789: checking for suffix of object files
configure:3811: /wrkdirs/usr/ports/lang/gcc12-devel/work/.build/./gcc/xgcc
-B/wrkdirs/usr/ports/lang/gcc12-devel/work/.build/./gcc/
-B/usr/local/powerpc64-portbld-freebsd13.1/bin/
-B/usr/local/powerpc64-portbld-freebsd13.1/lib/ -isystem
 /usr/local/powerpc64-portbld-freebsd13.1/include -isystem
/usr/local/powerpc64-portbld-freebsd13.1/sys-include -fno-checking  -m32 -fPIC
-mstrict-align -msecure-plt -c -g -O2 -pipe  -DLIBICONV_PLUG
-fstack-protector-strong -fno-strict-
aliasing   conftest.c >&5
{standard input}: Assembler messages:
{standard input}:2: Error: junk at end of line, first unrecognized character is
`,'

[Bug target/105010] [12 regression] GCC 12 after 20220227 fails to build on powerpc64-freebsd with Error: invalid mfcr mask

2022-03-23 Thread pkubaj at anongoth dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105010

--- Comment #8 from Piotr Kubaj  ---
Testing.

FYI, on 12-20220227, .machine power4 is used.

[Bug target/105010] [12 regression] GCC 12 after 20220227 fails to build on powerpc64-freebsd with Error: invalid mfcr mask

2022-03-23 Thread pkubaj at anongoth dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105010

--- Comment #6 from Piotr Kubaj  ---
OK, it's .machine "7450", which seems correct.

[Bug target/105010] [12 regression] GCC 12 after 20220227 fails to build on powerpc64-freebsd with Error: invalid mfcr mask

2022-03-22 Thread pkubaj at anongoth dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105010

--- Comment #5 from Piotr Kubaj  ---
The command line output I pasted in the OP is actually from 12-20220320 (but
12-20220306 fails the same way). So I guess that fix did nothing for
powerpc64-freebsd.

Regarding .machine, I will check it tomorrow.

[Bug target/105010] [12 regression] GCC 12 after 20220227 fails to build on powerpc64-freebsd with Error: invalid mfcr mask

2022-03-22 Thread pkubaj at anongoth dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105010

Piotr Kubaj  changed:

   What|Removed |Added

 CC||segher at kernel dot 
crashing.org

--- Comment #3 from Piotr Kubaj  ---
Current git bisect visualize --oneline:
93557e6dc39 (refs/bisect/bad) Update gcc de.po
77eccbf39ed rs6000: Improve .machine
0e5d9ae8e41 Update .po files
591d2130348 c++: Standard mangling abbreviations & modules
14dfbb53594 (HEAD) Fix 'libgomp.oacc-c-c++-common/kernels-decompose-1.c'
expected diagnostics
458ad38ce2b analyzer: reduce svalue depth limit from 13 to 12 [PR103521]
c3402486afa mkruntimeinc: skip _FILE

14dfbb53594 is still building but it looks like it will succeed. This would
mean that 77eccbf39ed is the culprit.

@segher
Could you look into it?

[Bug bootstrap/102278] [12 regression] Bootstrap fails with LLVM 11.0.1 on powerpc-unknown-freebsd: libgcov-interface.c:201:1: internal compiler error

2022-03-22 Thread pkubaj at anongoth dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102278

Piotr Kubaj  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|WAITING |RESOLVED

--- Comment #6 from Piotr Kubaj  ---
Builds fine now.

[Bug bootstrap/105010] GCC 12 after 20220227 fails to build on powerpc64-freebsd with Error: invalid mfcr mask

2022-03-22 Thread pkubaj at anongoth dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105010

--- Comment #2 from Piotr Kubaj  ---
GNU assembler version 2.37 (powerpc64-portbld-freebsd13.1) using BFD version
(GNU Binutils) 2.37

[Bug bootstrap/105010] New: GCC 12 after 20220227 fails on powerpc64-freebsd with Error: invalid mfcr mask

2022-03-21 Thread pkubaj at anongoth dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105010

Bug ID: 105010
   Summary: GCC 12 after 20220227 fails on powerpc64-freebsd with
Error: invalid mfcr mask
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pkubaj at anongoth dot pl
  Target Milestone: ---

On FreeBSD 13.1 on powerpc64, 12-20220227 is the last snapshot that builds
correctly.
12-20220306 fail with:
/wrkdirs/usr/ports/lang/gcc12-devel/work/.build/./gcc/xgcc
-B/wrkdirs/usr/ports/lang/gcc12-devel/work/.build/./gcc/
-B/usr/local/powerpc64-portbld-freebsd13.1/bin/
-B/usr/local/powerpc64-portbld-freebsd13.1/lib/ -isystem
/usr/local/powerpc64-portbld-freebsd13.1/include -isystem
/usr/local/powerpc64-portbld-freebsd13.1/sys-include   -fno-checking -g -O2
-pipe -DLIBICONV_PLUG -fstack-protector-strong -fno-strict-aliasing -m32 -fPIC
-mstrict-align -msecure-plt -O2  -g -O2 -pipe  -DLIBICONV_PLUG
-fstack-protector-strong -fno-strict-aliasing  -DIN_GCC -fPIC   -W -Wall
-Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -pthread
-mno-minimal-toc -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector  -fPIC
-pthread -mno-minimal-toc -I. -I. -I../../.././gcc
-I/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20220320/libgcc
-I/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20220320/libgcc/.
-I/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20220320/libgcc/../gcc
-I/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20220320/libgcc/../include 
-DHAVE_CC_TLS   -o _mulsc3.o -MT _mulsc3.o -MD -MP -MF _mulsc3.dep -DL_mulsc3
-c /wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20220320/libgcc/libgcc2.c
-fvisibility=hidden -DHIDE_EXPORTS
{standard input}: Assembler messages:
{standard input}:140: Error: invalid mfcr mask
{standard input}:147: Error: unrecognized opcode: `fcfid'
{standard input}:166: Error: invalid mfcr mask
{standard input}:175: Error: unrecognized opcode: `fcfid'
{standard input}:326: Error: invalid mfcr mask
{standard input}:337: Error: unrecognized opcode: `fcfid'
{standard input}:356: Error: invalid mfcr mask
{standard input}:365: Error: unrecognized opcode: `fcfid'

[Bug bootstrap/102278] [12 regression] Bootstrap fails with LLVM 11.0.1 on powerpc-unknown-freebsd: libgcov-interface.c:201:1: internal compiler error

2021-09-13 Thread pkubaj at anongoth dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102278

--- Comment #5 from Piotr Kubaj  ---
Still the same issue:
/wrkdirs/usr/ports/lang/gcc12-devel/work/.build/./gcc/xgcc
-B/wrkdirs/usr/ports/lang/gcc12-devel/work/.build/./gcc/
-B/usr/local/powerpc-portbld-freebsd13.0/bin/
-B/usr/local/powerpc-portbld-freebsd13.0/lib/ -isystem
/usr/local/powerpc-portbld-freebsd13.0/include -isystem
/usr/local/powerpc-portbld-freebsd13.0/sys-include   -fno-checking -g -O2 -O2 
-g -O2   -DIN_GCC -fPIC   -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual
-Wno-error=format-diag -Wno-format -Wstrict-prototypes -Wmissing-prototypes
-Wno-error=format-diag -Wold-style-definition  -isystem ./include  -fPIC
-pthread -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector  -fPIC -pthread
-I. -I. -I../.././gcc
-I/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/libgcc
-I/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/libgcc/.
-I/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/libgcc/../gcc
-I/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/libgcc/../include 
-DHAVE_CC_TLS  -o _gcov_execl.o -MT _gcov_execl.o -MD -MP -MF _gcov_execl.dep
-DL_gcov_execl -c
/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/libgcc/libgcov-interface.c
during GIMPLE pass: ldist
/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/libgcc/libgcov-interface.c:
In function '__gcov_execl':
/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/libgcc/libgcov-interface.c:201:1:
internal compiler error: Segmentation fault
  201 | __gcov_execl (const char *path, char *arg, ...)

[Bug bootstrap/102278] [12 regression] Bootstrap fails with LLVM 11.0.1 on powerpc-unknown-freebsd: libgcov-interface.c:201:1: internal compiler error

2021-09-10 Thread pkubaj at anongoth dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102278

--- Comment #3 from Piotr Kubaj  ---
Created attachment 51436
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51436=edit
build log

The full build log is attached. The used compilation flags and configuration
options are listed there.

To make sure it's not misoptimization, I also built now with (FreeBSD by
default uses -O2):
CFLAGS_FOR_TARGET="-O0" CXXFLAGS_FOR_TARGET="-O0" BOOT_CFLAGS="-O0"

It fails with another error:
/wrkdirs/usr/ports/lang/gcc12-devel/work/.build/./prev-gcc/xg++
-B/wrkdirs/usr/ports/lang/gcc12-devel/work/.build/./prev-gcc/
-B/usr/local/powerpc-portbld-freebsd13.0/bin/ -nostdinc++
-B/wrkdirs/usr/ports/lang/gcc12-devel/work/.build/prev-powerpc-portbld-freebsd13.0/libstdc++-v3/src/.libs
-B/wrkdirs/usr/ports/lang/gcc12-devel/work/.build/prev-powerpc-portbld-freebsd13.0/libstdc++-v3/libsupc++/.libs
 -isystem
/wrkdirs/usr/ports/lang/gcc12-devel/work/.build/prev-powerpc-portbld-freebsd13.0/libstdc++-v3/include/powerpc-portbld-freebsd13.0
 -isystem
/wrkdirs/usr/ports/lang/gcc12-devel/work/.build/prev-powerpc-portbld-freebsd13.0/libstdc++-v3/include
 -isystem
/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/libstdc++-v3/libsupc++
-L/wrkdirs/usr/ports/lang/gcc12-devel/work/.build/prev-powerpc-portbld-freebsd13.0/libstdc++-v3/src/.libs
-L/wrkdirs/usr/ports/lang/gcc12-devel/work/.build/prev-powerpc-portbld-freebsd13.0/libstdc++-v3/libsupc++/.libs
 -fno-PIE -c   -O0 -fno-checking -gtoggle -DIN_GCC -fPIC-fno-exceptions
-fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute
-Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -Werror -fno-common  -DHAVE_CONFIG_H -I. -I.
-I/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/gcc
-I/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/gcc/.
-I/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/gcc/../include
-I/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/gcc/../libcpp/include
-I/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/gcc/../libcody
-I/usr/local/include 
-I/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/gcc/../libdecnumber
-I/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/gcc/../libdecnumber/dpd
-I../libdecnumber
-I/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/gcc/../libbacktrace 
-DLIBICONV_PLUG -o opts.o -MT opts.o -MMD -MP -MF ./.deps/opts.TPo
/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/gcc/opts.c
/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/gcc/opts.c: In
function 'void print_filtered_help(unsigned int, unsigned int, unsigned int,
unsigned int, gcc_options*, unsigned int)':
/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/gcc/opts.c:1517:26:
error: '  ' directive output may be truncated writing 2 bytes into a region
of size between 1 and 256 [-Werror=format-truncation=]
 1517 |   "%s  %s", help, _(use_diagnosed_msg));
  |  ^~
/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/gcc/opts.c:1516:22:
note: 'snprintf' output between 37 and 292 bytes into a destination of size
256
 1516 | snprintf (new_help, sizeof new_help,
  | ~^~~
 1517 |   "%s  %s", help, _(use_diagnosed_msg));
  |   ~
cc1plus: all warnings being treated as errors

[Bug bootstrap/102278] [12 regression] Bootstrap fails with LLVM 11.0.1 on powerpc-unknown-freebsd: libgcov-interface.c:201:1: internal compiler error

2021-09-10 Thread pkubaj at anongoth dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102278

--- Comment #1 from Piotr Kubaj  ---
The full error with the command line executed is:
/wrkdirs/usr/ports/lang/gcc12-devel/work/.build/./gcc/xgcc
-B/wrkdirs/usr/ports/lang/gcc12-devel/work/.build/./gcc/
-B/usr/local/powerpc-portbld-freebsd13.0/bin/
-B/usr/local/powerpc-portbld-freebsd13.0/lib/ -isystem
/usr/local/powerpc-portbld-freebsd13.0/include -isystem
/usr/local/powerpc-portbld-freebsd13.0/sys-include   -fno-checking -g -O2 -pipe
-DLIBICONV_PLUG -fstack-protector-strong -fno-strict-aliasing -O2  -g -O2 -pipe
 -DLIBICONV_PLUG -fstack-protector-strong -fno-strict-aliasing  -DIN_GCC -fPIC 
 -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag
-Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wno-error=format-diag
-Wold-style-definition  -isystem ./include  -fPIC -pthread -g -DIN_LIBGCC2
-fbuilding-libgcc -fno-stack-protector  -fPIC -pthread -I. -I. -I../.././gcc
-I/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/libgcc
-I/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/libgcc/.
-I/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/libgcc/../gcc
-I/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/libgcc/../include 
-DHAVE_CC_TLS  -o _gcov_execl.o -MT _gcov_execl.o -MD -MP -MF _gcov_execl.dep
-DL_gcov_execl -c
/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/libgcc/libgcov-interface.c
during GIMPLE pass: ldist
/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/libgcc/libgcov-interface.c:
In function '__gcov_execl':
/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210829/libgcc/libgcov-interface.c:201:1:
internal compiler error: Segmentation fault
  201 | __gcov_execl (const char *path, char *arg, ...)

[Bug libgcc/102278] New: Fails to build on powerpc-unknown-freebsd since 20210801 snapshot

2021-09-10 Thread pkubaj at anongoth dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102278

Bug ID: 102278
   Summary: Fails to build on powerpc-unknown-freebsd since
20210801 snapshot
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libgcc
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pkubaj at anongoth dot pl
  Target Milestone: ---

20210725 was the last snapshot that built.
20210801 fails with:
/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210801/gcc/lra-constraints.c:
In function 'bool curr_insn_transform(bool)':  
   
/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210801/gcc/lra-constraints.c:4367:21:
error: suggest parentheses around assignment used as truth value
[-Werror=parentheses]  
4367 |  (c = *constraint) && c != ',' && c != '#'; 


After that, build fails with:
during GIMPLE pass: ldist
/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210808/libgcc/libgcov-interface.c:
In function '__gcov_execl':
/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20210808/libgcc/libgcov-interface.c:201:1:
internal compiler error: Segmentation fault
  201 | __gcov_execl (const char *path, char *arg, ...)
  | ^~~~

I build on FreeBSD 13.0-RELEASE using LLVM 11.0.1.

[Bug bootstrap/97163] Build error with -mcpu=power9 on ppc64

2021-04-16 Thread pkubaj at anongoth dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97163

--- Comment #10 from Piotr Kubaj  ---
Would it be possible to backport this issue to 9?

[Bug bootstrap/89494] Bootstrap error when using GCC 4.2.1

2021-04-10 Thread pkubaj at anongoth dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89494

--- Comment #30 from Piotr Kubaj  ---
With default flags:
during RTL pass: cprop_hardreg
In file included from
/wrkdirs/usr/ports/lang/gcc10-devel/work/gcc-10-20210327/libgcc/unwind-c.c:32:
/wrkdirs/usr/ports/lang/gcc10-devel/work/gcc-10-20210327/libgcc/unwind-pe.h: In
function 'base_of_encoded_value':
/wrkdirs/usr/ports/lang/gcc10-devel/work/gcc-10-20210327/libgcc/unwind-pe.h:121:1:
internal compiler error: Segmentation fault

With my hack that allows gcc9 to build:
during RTL pass: reload
In file included from
/wrkdirs/usr/ports/lang/gcc10-devel/work/gcc-10-20210327/libiberty/regex.c:639:
/wrkdirs/usr/ports/lang/gcc10-devel/work/gcc-10-20210327/libiberty/regex.c: In
function 'byte_regex_compile':
/wrkdirs/usr/ports/lang/gcc10-devel/work/gcc-10-20210327/libiberty/regex.c:4223:1:
internal compiler error: Segmentation fault
 4223 | } /* regex_compile */

The hack is:
CFLAGS_FOR_TARGET="-O0" CXXFLAGS_FOR_TARGET="-O0" BOOT_CFLAGS="-O0"
And the patch:
--- libgcc/config/rs6000/t-crtstuff.orig2020-04-07 15:17:50 UTC
+++ libgcc/config/rs6000/t-crtstuff
@@ -3,4 +3,4 @@
 # Do not build crtend.o with -Os as that can result in references to
 # out-of-line register save/restore functions, which may be unresolved
 # as crtend.o is linked after libgcc.a.  See PR45053.
-CRTSTUFF_T_CFLAGS = -msdata=none -O2 -fno-asynchronous-unwind-tables
+CRTSTUFF_T_CFLAGS = -msdata=none -O0 -fno-asynchronous-unwind-tables

[Bug bootstrap/89494] Bootstrap error when using GCC 4.2.1

2021-03-24 Thread pkubaj at anongoth dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89494

Piotr Kubaj  changed:

   What|Removed |Added

 Status|RESOLVED|WAITING
 Resolution|FIXED   |---

--- Comment #28 from Piotr Kubaj  ---
I just tried on FreeBSD 12.2-RELEASE on powerpc64 with base gcc 4.2.1:
gmake[4]: Entering directory
'/wrkdirs/usr/ports/lang/gcc10-devel/work/.build/gcc'
c++ -std=gnu++98 -fno-PIE -c  -DIN_GCC_FRONTEND -g -DIN_GCC   
-fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W
-Wall -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute
-Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -I. -Icp
-I/wrkdirs/usr/ports/lang/gcc10-devel/work/gcc-10-20210313/gcc
-I/wrkdirs/usr/ports/lang/gcc10-devel/work/gcc-10-20210313/gcc/cp
-I/wrkdirs/usr/ports/lang/gcc10-devel/work/gcc-10-20210313/gcc/../include
-I/wrkdirs/usr/ports/lang/gcc10-devel/work/gcc-10-20210313/gcc/../libcpp/include
-I/usr/local/include 
-I/wrkdirs/usr/ports/lang/gcc10-devel/work/gcc-10-20210313/gcc/../libdecnumber
-I/wrkdirs/usr/ports/lang/gcc10-devel/work/gcc-10-20210313/gcc/../libdecnumber/dpd
-I../libdecnumber
-I/wrkdirs/usr/ports/lang/gcc10-devel/work/gcc-10-20210313/gcc/../libbacktrace 
-DLIBICONV_PLUG -o cp/coroutines.o -MT cp/coroutines.o -MMD -MP -MF
cp/.deps/coroutines.TPo
/wrkdirs/usr/ports/lang/gcc10-devel/work/gcc-10-20210313/gcc/cp/coroutines.cc
/wrkdirs/usr/ports/lang/gcc10-devel/work/gcc-10-20210313/gcc/cp/coroutines.cc:2700:
error: invalid pure specifier (only `= 0' is allowed) before ';' token
/wrkdirs/usr/ports/lang/gcc10-devel/work/gcc-10-20210313/gcc/cp/coroutines.cc:2700:
error: initializer specified for non-virtual method
'var_nest_node::var_nest_node()'

[Bug bootstrap/98181] New: Add support for FreeBSD on powerpc64le

2020-12-07 Thread pkubaj at anongoth dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98181

Bug ID: 98181
   Summary: Add support for FreeBSD on powerpc64le
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pkubaj at anongoth dot pl
  Target Milestone: ---

Created attachment 49698
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49698=edit
patch

FreeBSD has recently added support for powerpc64le architecture (ppc64le using
Linux naming). FreeBSD and GCC both had previously supported powerpc64 (ppc64
using Linux naming) so this patch is pretty simple, it only adds endianness
detection using similar code that Linux code uses.

While here, also clear the issue of default tuning. People that still use
32-bit POWER are likely on G4, so tune for that. On 64-bits, tune for POWER8
(similarly to Linux). Also remove the obsolete comment that FreeBSD doesn't
support anything newer than PPC970 - it works nice on my POWER9 workstation.

[Bug libstdc++/97163] Build error with -mcpu=power9 on ppc64

2020-09-22 Thread pkubaj at anongoth dot pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97163

--- Comment #1 from Piotr Kubaj  ---
This is on FreeBSD head, which uses ELFv2.

[Bug libstdc++/97163] New: Build error with -mcpu=power9 on ppc64

2020-09-22 Thread pkubaj at anongoth dot pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97163

Bug ID: 97163
   Summary: Build error with -mcpu=power9 on ppc64
   Product: gcc
   Version: 10.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pkubaj at anongoth dot pl
  Target Milestone: ---

The same error happens also on GCC 9.3.0.
I'm using Clang 11.0.0 rc2 to build, but it happened before with 10 (I only now
got to report it).

Issue:
gmake[5]: Entering directory
'/tmp/usr/ports/lang/gcc10/work/.build/build-powerpc64-portbld-freebsd13.0/libcpp'
test -f config.h || (rm -f stamp-h1 && gmake stamp-h1)
c++ -std=gnu++98  -I/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp -I.
-I/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp/../include
-I/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp/include -DLIBICONV_PLUG -O2
-pipe -mcpu=power9   -DLIBICONV_PLUG  -W -Wall -Wno-narrowing -Wwrite-strings
-Wmissing-format-attribute -pedantic -Wno-long-long  -fno-exceptions -fno-rtti
-I/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp -I.
-I/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp/../include
-I/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp/include -DLIBICONV_PLUG  -c
-o lex.o -MT lex.o -MMD -MP -MF .deps/lex.Tpo
/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp/lex.c
c++: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is
deprecated [-Wdeprecated]
In file included from
/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp/lex.c:23:
/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp/system.h:439:9: warning:
keyword is hidden by macro definition [-Wkeyword-macro]
#define true 1
^
/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp/system.h:440:9: warning:
keyword is hidden by macro definition [-Wkeyword-macro]
#define false 0
^
/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp/lex.c:544:26: warning: unknown
attribute 'altivec' ignored [-Wunknown-attributes]
  typedef __attribute__((altivec(vector))) unsigned char vc;
 ^
/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp/lex.c:546:12: error: excess
elements in scalar initializer
  const vc repl_nl = {
   ^
/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp/lex.c:550:12: error: excess
elements in scalar initializer
  const vc repl_cr = {
   ^
/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp/lex.c:554:12: error: excess
elements in scalar initializer
  const vc repl_bs = {
   ^
/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp/lex.c:558:12: error: excess
elements in scalar initializer
  const vc repl_qm = {
   ^
/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp/lex.c:571:14: error: use of
undeclared identifier '__builtin_vec_vsx_ld'
  data = __builtin_vec_vsx_ld (0, s);
 ^
/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp/lex.c:574:19: error: use of
undeclared identifier '__builtin_vec_cmpeq'
  m_nl = (vc) __builtin_vec_cmpeq(data, repl_nl);
  ^
/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp/lex.c:575:19: error: use of
undeclared identifier '__builtin_vec_cmpeq'
  m_cr = (vc) __builtin_vec_cmpeq(data, repl_cr);
  ^
/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp/lex.c:576:19: error: use of
undeclared identifier '__builtin_vec_cmpeq'
  m_bs = (vc) __builtin_vec_cmpeq(data, repl_bs);
  ^
/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp/lex.c:577:19: error: use of
undeclared identifier '__builtin_vec_cmpeq'
  m_qm = (vc) __builtin_vec_cmpeq(data, repl_qm);
  ^
/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp/lex.c:584:11: error: use of
undeclared identifier '__builtin_vec_vcmpeq_p'
  while (!__builtin_vec_vcmpeq_p(/*__CR6_LT_REV*/3, t, zero));
  ^
/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp/lex.c:595:23: error: array is
too large (18446744073709551615 elements)
  unsigned long l[(N == 2 || N == 4) ? N : -1];
  ^~~
/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp/lex.c:602:13: warning: no case
matching constant switch condition '0'
switch (N)
^
/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp/lex.c:590:12: note: expanded
from macro 'N'
#define N  (sizeof(vc) / sizeof(long))
   ^~~
/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp/lex.c:1729:8: warning: result
of comparison against a string literal is unspecified (use an explicit string
comparison function instead) [-Wstring-compare]
  BUF_APPEND ("\\", 1);
  ^~~~
/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp/lex.c:1699:30: note: expanded
from macro 'BUF_APPEND'
&& (const uchar *)(STR) != base \
    ^
/tmp/usr/ports/lang/gcc10/work/gcc-10.2.0/libcpp/lex.c:1738:5: warning: result
of compariso

[Bug bootstrap/89494] Bootstrap error when using GCC 4.2.1

2020-04-30 Thread pkubaj at anongoth dot pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89494

Piotr Kubaj  changed:

   What|Removed |Added

Version|9.3.0   |10.0

--- Comment #25 from Piotr Kubaj  ---
Happens on 20200419 snapshot:
gmake[4]: Entering directory
'/wrkdirs/usr/ports/lang/gcc10-devel/work/.build/libiberty'
if [ x"-fPIC" != x ]; then \
  /wrkdirs/usr/ports/lang/gcc10-devel/work/.build/./prev-gcc/xgcc
-B/wrkdirs/usr/ports/lang/gcc10-devel/work/.build/./prev-gcc/
-B/usr/local/powerpc64-portbld-freebsd12.1/bin/
-B/usr/local/powerpc64-portbld-freebsd12.1/bin/
-B/usr/local/powerpc64-portbld-freebsd12.1/lib/ -isystem
/usr/local/powerpc64-portbld-freebsd12.1/include -isystem
/usr/local/powerpc64-portbld-freebsd12.1/sys-include   -fno-checking -c
-DHAVE_CONFIG_H -O0 -fno-checking -gtoggle -DLIBICONV_PLUG -I.
-I/wrkdirs/usr/ports/lang/gcc10-devel/work/gcc-10-20200419/libiberty/../include
 -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -Wshadow=local
-pedantic  -D_GNU_SOURCE -fPIC
/wrkdirs/usr/ports/lang/gcc10-devel/work/gcc-10-20200419/libiberty/regex.c -o
pic/regex.o; \
else true; fi
during RTL pass: reload
In file included from
/wrkdirs/usr/ports/lang/gcc10-devel/work/gcc-10-20200419/libiberty/regex.c:639:
/wrkdirs/usr/ports/lang/gcc10-devel/work/gcc-10-20200419/libiberty/regex.c: In
function 'byte_regex_compile':
/wrkdirs/usr/ports/lang/gcc10-devel/work/gcc-10-20200419/libiberty/regex.c:4223:1:
internal compiler error: Segmentation fault
 4223 | } /* regex_compile */
  | ^
no stack trace because unwind library not available
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
gmake[4]: *** [Makefile:1179: regex.o] Error 1
gmake[4]: Leaving directory
'/wrkdirs/usr/ports/lang/gcc10-devel/work/.build/libiberty'
gmake[3]: *** [Makefile:11311: all-stage2-libiberty] Error 2
gmake[3]: Leaving directory '/wrkdirs/usr/ports/lang/gcc10-devel/work/.build'
gmake[2]: *** [Makefile:23020: stage2-bubble] Error 2
gmake[2]: Leaving directory '/wrkdirs/usr/ports/lang/gcc10-devel/work/.build'
gmake[1]: *** [Makefile:23235: bootstrap-lean] Error 2
gmake[1]: Leaving directory '/wrkdirs/usr/ports/lang/gcc10-devel/work/.build'
*** Error code 1

[Bug bootstrap/89494] Bootstrap error when using GCC 4.2.1

2020-04-15 Thread pkubaj at anongoth dot pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89494

--- Comment #22 from Piotr Kubaj  ---
(In reply to CVS Commits from comment #21)
> The master branch has been updated by Jakub Jelinek :
> 
> https://gcc.gnu.org/g:c00568f376078129196740d83946d54dc5437401
> 
> commit r10-7736-gc00568f376078129196740d83946d54dc5437401
> Author: Gustavo Romero 
> Date:   Wed Apr 15 15:14:45 2020 +0200
> 
> selftest: Work around GCC 4.2 PR33916 bug by optimizing the ctor
> [PR89494]
> 
> GCC 4.2 due to PR33916 miscompiles temp_dump_context ctor, because it
> doesn't
> zero initialize the whole dump_context temporary on which it runs the
> static
> get method and during destruction of the temporary an uninitialized
> pointer
> is deleted.
> 
> More recent GCC versions properly zero initialize it and ideally
> optimize away
> the construction/destruction of the temporary, as it isn't used for
> anything,
> but there is no reason to create the temporary, static member functions
> can
> be called without an associated object.
> 
> 2020-04-15  Gustavo Romero  
> 
> PR bootstrap/89494
> * dumpfile.c (selftest::temp_dump_context::temp_dump_context):
> Don't construct a dump_context temporary to call static method.

Thanks for commiting this! Can you also merge to branch 9?

[Bug bootstrap/89494] Bootstrap error when using GCC 4.2.1

2020-04-12 Thread pkubaj at anongoth dot pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89494

--- Comment #16 from Piotr Kubaj  ---
634afa05a8cbff010480088811fe1f39eca70c1d is the first bad commit
commit 634afa05a8cbff010480088811fe1f39eca70c1d
Author: Richard Sandiford 
Date:   Tue Aug 20 08:53:52 2019 +

Make function.c use function_arg_info internally

This patch adds a function_arg_info field to assign_parm_data_one,
so that:

  - passed_type -> arg.type
  - promoted_mode -> arg.mode
  - named_arg -> arg.named

We can then pass this function_arg_info directly to the converted
hooks.

Between the initialisation of the assign_parm_data_one and the
application of promotion rules (which is a state internal to
assign_parm_find_data_types), arg.mode is equivalent to passed_mode
(i.e. to TYPE_MODE).

2019-08-20  Richard Sandiford  

gcc/
* function.c (assign_parm_data_one): Replace passed_type,
promoted_mode and named_arg with a function_arg_info field.
(assign_parm_find_data_types): Remove local variables and
assign directly to "data".  Make data->passed_mode shadow
data->arg.mode until promotion, then assign the promoted
mode to data->arg.mode.
(assign_parms_setup_varargs, assign_parm_find_entry_rtl)
(assign_parm_find_stack_rtl, assign_parm_adjust_entry_rtl)
(assign_parm_remove_parallels, assign_parm_setup_block_p)
(assign_parm_setup_block, assign_parm_setup_reg)
(assign_parm_setup_stack, assign_parms, gimplify_parameters): Use
arg.mode instead of promoted_mode, arg.type instead of passed_type
and arg.named instead of named_arg.  Use data->arg for
function_arg_info structures that had the field values passed_type,
promoted_mode and named_arg.  Base other function_arg_infos on
data->arg, changing the necessary properties.

From-SVN: r274705

 gcc/ChangeLog  |  19 +++
 gcc/function.c | 168 +
 2 files changed, 92 insertions(+), 95 deletions(-)

[Bug bootstrap/89494] Bootstrap error when using GCC 4.2.1

2020-04-12 Thread pkubaj at anongoth dot pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89494

Piotr Kubaj  changed:

   What|Removed |Added

 CC||richard.sandiford at arm dot 
com

--- Comment #15 from Piotr Kubaj  ---
CC'ing richard.sandif...@arm.com, whose one of commits broke building of GCC 10
with GCC 4.2.
I'm still bisecting, but it was one of those commits, all by
richard.sandif...@arm.com:
pkubaj@talos:$/usr/home/pkubaj/gcc$ git bisect view | grep commit
commit cf0d189eb989906d17010ca7c0b07f1763d5fde5
commit 634afa05a8cbff010480088811fe1f39eca70c1d
commit b12cdd6e8e8dd1f39a941b731ba1056d656a094f
commit 0ffef2005fd7536efbc9c3a572701998c8a8080c
commit 7256c7194e186fce6ff866a124a77b08196c2a5f
commit 6930c98c69ad695469ee7daa74b3b6d578afdd0d
commit 6783fdb7057d559aa1da8afa2c15a702c532a03e
commit e7056ca417326a70eca05defb6a8b20b737d3417
commit 52090e4dbd064f486af606e3f8a283dbddc7c18a
commit a7c81bc1fb43366ca1b4332d8a6042b648a84cdc
commit 4f53599cb5b822cd7f95997861c2e064977ecb6a

[Bug bootstrap/89494] Bootstrap error when using GCC 4.2.1

2020-04-11 Thread pkubaj at anongoth dot pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89494

--- Comment #14 from Piotr Kubaj  ---
Exact error for 10.0:
In file included from
/usr/ports/lang/gcc10-devel/work/gcc-10-20190825/libgcc/libgcc2.c:56:
/usr/ports/lang/gcc10-devel/work/gcc-10-20190825/libgcc/libgcc2.c: In function
'__multi3':
/usr/ports/lang/gcc10-devel/work/gcc-10-20190825/libgcc/libgcc2.h:203:20:
internal compiler error: tree check: expected class 'type', have 'exceptional'
(error_mark) in build_int_cst, at tree.c:1371
  203 | #define __NDW(a,b) __ ## a ## ti ## b
  |^~
/usr/ports/lang/gcc10-devel/work/gcc-10-20190825/libgcc/libgcc2.h:273:18: note:
in expansion of macro '__NDW'
  273 | #define __muldi3 __NDW(mul,3)
  |  ^
/usr/ports/lang/gcc10-devel/work/gcc-10-20190825/libgcc/libgcc2.c:548:1: note:
in expansion of macro '__muldi3'
  548 | __muldi3 (DWtype u, DWtype v)
  | ^~~~

[Bug bootstrap/89494] Bootstrap error when using GCC 4.2.1

2020-04-11 Thread pkubaj at anongoth dot pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89494

--- Comment #13 from Piotr Kubaj  ---
Breakage in GCC 10 was caused after 201900818 snapshot, but before 201900825
(201900825 is the first broken).

[Bug bootstrap/89494] Bootstrap error when using GCC 4.2.1

2020-04-10 Thread pkubaj at anongoth dot pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89494

--- Comment #12 from Piotr Kubaj  ---
This issue can be fixed with the following patches:
--- gcc/dumpfile.c.orig 2020-04-07 14:09:14 UTC
+++ gcc/dumpfile.c
@@ -2055,7 +2055,7 @@ temp_dump_context::temp_dump_context (bool forcibly_en
  bool forcibly_enable_dumping,
  dump_flags_t test_pp_flags)
 : m_context (),
-  m_saved (_context ().get ())
+  m_saved(_context::get())
 {
   dump_context::s_current = _context;
   if (forcibly_enable_optinfo)
--- libgcc/config/rs6000/t-crtstuff.orig2020-04-07 15:17:50 UTC
+++ libgcc/config/rs6000/t-crtstuff
@@ -3,4 +3,4 @@
 # Do not build crtend.o with -Os as that can result in references to
 # out-of-line register save/restore functions, which may be unresolved
 # as crtend.o is linked after libgcc.a.  See PR45053.
-CRTSTUFF_T_CFLAGS = -msdata=none -O2 -fno-asynchronous-unwind-tables
+CRTSTUFF_T_CFLAGS = -msdata=none -O0 -fno-asynchronous-unwind-tables
--- Makefile.in.orig2020-04-08 13:04:40 UTC
+++ Makefile.in
@@ -372,7 +372,7 @@ BUILD_PREFIX_1 = @BUILD_PREFIX_1@

 # Flags to pass to stage2 and later makes.  They are defined
 # here so that they can be overridden by Makefile fragments.
-BOOT_CFLAGS= -g -O2
+BOOT_CFLAGS?= -g -O2
 BOOT_LDFLAGS=
 BOOT_ADAFLAGS= -gnatpg


And then you need to pass to configure and make the following env variables
CFLAGS_FOR_TARGET="-O0" CXXFLAGS_FOR_TARGET="-O0" BOOT_CFLAGS="-O0".
The first patch is already sent by Gustavo Romero from IBM to GCC patches list.

GCC10 needs further fixing, unfortunately.

[Bug go/86535] FreeBSD/PowerPC64 - Building Go Frontend support for gcc 7.3.0 fails

2019-03-03 Thread pkubaj at anongoth dot pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86535

--- Comment #17 from Piotr Kubaj  ---
Since you mentioned libgo/runtime_sysinfo.go, I also had a look there and saw
that umtx_time is already present there:
type __umtx_time struct { _timeout timespec; _flags uint32; _clockid uint32; }
const _sizeof__umtx_time = 24

[Bug go/86535] FreeBSD/PowerPC64 - Building Go Frontend support for gcc 7.3.0 fails

2019-03-03 Thread pkubaj at anongoth dot pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86535

--- Comment #16 from Piotr Kubaj  ---
(In reply to Ian Lance Taylor from comment #15)
> I committed a patch that should fix the nanotime problem.
> 
> Some of the other issues you describe will most likely require a fix in the
> libgo/mkrsysinfo.sh script, which generates the file runtime_sysinfo.go. 
> For example, that is likely the problem with _CTL_HW and _HW_PAGESIZE.
> 
> For sysctl we'll need a declaration with a //extern comment.
> 
> I'm happy to advise but I don't realistically have the time to do the work
> myself.

Thank you.

I'm fine to work on it myself, it looks like just couple function definitions
are missing.

However, I didn't hack on GCC before, I'm really not sure where I should add
the appriopriate include with a system C header.

I hope you can help me with one example and then I'll figure the rest out
myself. I already saw that some functions are defined in *stub*.go files and
managed to fix one error with a simple patch:
--- libgo/go/runtime/timestub2.go.orig  2019-03-03 12:33:56.339627000 +0100
+++ libgo/go/runtime/timestub2.go   2019-03-03 12:34:11.055696000 +0100
@@ -4,7 +4,6 @@

 // +build !darwin
 // +build !windows
-// +build !freebsd
 // +build !aix

 package runtime

To fix missing archauxv function, I added libgo/go/runtime/os_freebsd_ppc64.go,
with contents basically copied from os_linux_ppc64x.go, only +build is changed
to apply on freebsd,ppc64. IMO that file should be moved to os_ppc64x.go to
apply on each OS.

But there are other errors like:
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/gcc-9-20190224/libgo/go/runtime/os_freebsd.go:15:76:
error: use of undefined type 'umtx_time'
   15 | func sys_umtx_op(addr *uint32, mode int32, val uint32, uaddr1 uintptr,
ts *umtx_time) int32
  |
   ^

umtx_time is a C struct defined in sys/_umtx.h, but you're supposed to actually
include sys/umtx.h (sys/umtx.h includes sys/_umtx.h).

I tried to add:
// #include 
import "C"

to libgo/go/runtime/os_freebsd.go, but that didn't work. I also saw that some
includes are set in libgo/go/internal/x/net/route/defs_freebsd.go, but
including sys/umtx.h also didn't work.

[Bug bootstrap/89494] Bootstrap error when using GCC 4.2.1

2019-03-01 Thread pkubaj at anongoth dot pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89494

--- Comment #11 from Piotr Kubaj  ---
Hm, sorry, I copied the Entering directive from a line before.

Nevertheless, setting -O1 helps with GCC 7 and 8.

But building GCC 9 still fails (I'm testing the newest snapshot). I tried both
-O0 and -O1.

The exact set of env variables I set is:
CXXFLAGS_FOR_TARGET="-O0" CFLAGS_FOR_TARGET="-O0" BOOT_CFLAGS="-O0"

rm -f include-fixed/README
cp
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/gcc-9-20190224/gcc/../fixincludes/README-fixinc
include-fixed/README
chmod a+r include-fixed/README
echo timestamp > stmp-int-hdrs
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/.build/./gcc/xgcc
-B/usr/local/poudriere/ports/default/lang/gcc9-devel/work/.build/./gcc/ -xc
-nostdinc /dev/null -S -o /dev/null
-fself-test=/usr/local/poudriere/ports/default/lang/gcc9-devel/work/gcc-9-20190224/gcc/testsuite/selftests
cc1: internal compiler error: Segmentation fault

[Bug bootstrap/89494] Bootstrap error when using GCC 4.2.1

2019-02-26 Thread pkubaj at anongoth dot pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89494

--- Comment #7 from Piotr Kubaj  ---
It still crashes (test was done with 7.4.0), but we're getting somewhere.
It crashes at:
libtool: compile: 
/usr/local/poudriere/ports/default/lang/gcc7/work/.build/./gcc/xgcc
-shared-libgcc -B/usr/local/poudriere/ports/default/lang/gcc7/work/.build/./gcc
-nostdinc++
-L/usr/local/poudriere/ports/default/lang/gcc7/work/.build/powerpc64-portbld-freebsd12.0/libstdc++-v3/src
-L/usr/local/poudriere/ports/default/lang/gcc7/work/.build/powerpc64-portbld-freebsd12.0/libstdc++-v3/src/.libs
-L/usr/local/poudriere/ports/default/lang/gcc7/work/.build/powerpc64-portbld-freebsd12.0/libstdc++-v3/libsupc++/.libs
-B/usr/local/powerpc64-portbld-freebsd12.0/bin/
-B/usr/local/powerpc64-portbld-freebsd12.0/lib/ -isystem
/usr/local/powerpc64-portbld-freebsd12.0/include -isystem
/usr/local/powerpc64-portbld-freebsd12.0/sys-include
-I/usr/local/poudriere/ports/default/lang/gcc7/work/gcc-7.4.0/libstdc++-v3/../libgcc
-I/usr/local/poudriere/ports/default/lang/gcc7/work/.build/powerpc64-portbld-freebsd12.0/libstdc++-v3/include/powerpc64-portbld-freebsd12.0
-I/usr/local/poudriere/ports/default/lang/gcc7/work/.build/powerpc64-portbld-freebsd12.0/libstdc++-v3/include
-I/usr/local/poudriere/ports/default/lang/gcc7/work/gcc-7.4.0/libstdc++-v3/libsupc++
-D_GLIBCXX_SHARED -fno-implicit-templates -Wall -Wextra -Wwrite-strings
-Wcast-qual -Wabi -fdiagnostics-show-location=once -ffunction-sections
-fdata-sections -frandom-seed=class_type_info.lo -g -O2 -pipe -DLIBICONV_PLUG
-c
/usr/local/poudriere/ports/default/lang/gcc7/work/gcc-7.4.0/libstdc++-v3/libsupc++/class_type_info.cc
 -fPIC -DPIC -D_GLIBCXX_SHARED -o class_type_info.o
/usr/local/poudriere/ports/default/lang/gcc7/work/gcc-7.4.0/libstdc++-v3/libsupc++/class_type_info.cc:
In member function 'virtual bool
__cxxabiv1::__class_type_info::__do_upcast(const
__cxxabiv1::__class_type_info*, void**) const':
/usr/local/poudriere/ports/default/lang/gcc7/work/gcc-7.4.0/libstdc++-v3/libsupc++/class_type_info.cc:45:6:
internal compiler error: Segmentation fault
 bool __class_type_info::
  ^

Interestingly, I can see -O0 added to flags before:
gmake "AR_FLAGS=rc" "CC_FOR_BUILD=cc"
"CC_FOR_TARGET=/usr/local/poudriere/ports/default/lang/gcc7/work/.build/./gcc/xgcc
-B/usr/local/poudriere/ports/default/lang/gcc7/work/.build/./gcc/" "CFLAGS=-O0"
"CXXFLAGS=-g -O2 -pipe   -DLIBICONV_PLUG " "CFLAGS_FOR_BUILD=-O0"
"CFLAGS_FOR_TARGET=-O0" "INSTALL=/usr/bin/install -c" "INSTALL_DATA=install  -m
0644" "INSTALL_PROGRAM=install  -s -m 555" "INSTALL_SCRIPT=install  -m 555"
"LDFLAGS=" "LIBCFLAGS=-O0" "LIBCFLAGS_FOR_TARGET=-O0" "MAKE=gmake"
"MAKEINFO=makeinfo --no-split --split-size=500 --split-size=500
--split-size=500" "SHELL=/bin/sh" "RUNTESTFLAGS=" "exec_prefix=/usr/local"
"infodir=/usr/local/share/info/gcc7" "libdir=/usr/local/lib/gcc7"
"includedir=/usr/local/include" "prefix=/usr/local"
"tooldir=/usr/local/powerpc64-portbld-freebsd12.0"
"gxx_include_dir=/usr/local/lib/gcc7/include/c++/"
"AR=/usr/local/powerpc64-portbld-freebsd12.0/bin/ar"
"AS=/usr/local/poudriere/ports/default/lang/gcc7/work/.build/./gcc/as"
"LD=/usr/local/poudriere/ports/default/lang/gcc7/work/.build/./gcc/collect-ld"
"RANLIB=/usr/local/powerpc64-portbld-freebsd12.0/bin/ranlib"
"NM=/usr/local/poudriere/ports/default/lang/gcc7/work/.build/./gcc/nm"
"NM_FOR_BUILD=" "NM_FOR_TARGET=/usr/local/powerpc64-portbld-freebsd12.0/bin/nm"
"DESTDIR=" "WERROR=" all-recursive

But the failing command is run strictly with -O2. If I just cd to
'/usr/local/poudriere/ports/default/lang/gcc7/work/.build/libiberty' and run it
manually, but change -O2 to -O0, it passes.

I can't find how to change -O level globally.
I currently set BOOT_CFLAGS="-O0" CFLAGS_FOR_TARGET="-O0"
CFLAGS_FOR_BUILD="-O0" STAGE_CFLAGS="-O0" STAGE2_CXXFLAGS="-O0"
STAGE2_CFLAGS="-O0" STAGE1_CXXFLAGS="-O0" STAGE1_CFLAGS="-O0" and it looks like
some files are compiled with -O0, but some commands still use -O2 (like the one
above). How can I set it to add -O0 everywhere?

[Bug bootstrap/89494] Bootstrap error when using GCC 4.2.1

2019-02-26 Thread pkubaj at anongoth dot pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89494

--- Comment #6 from Piotr Kubaj  ---
(In reply to Richard Biener from comment #5)
> So it looks like stage1 gcc is miscompiled somehow.  I wonder if you can
> avoid
> setting CFLAGS et al?

I just added CFLAGS+=-O0 and CXXFLAGS+=-O0. For now, the build is ongoing (I'm
building GCC 7 first, as it had the most verbose errors), but I think it's
already past the stage where it crashed. I will leave it open until all
versions are built (7, 8, 9)

Thanks!

[Bug bootstrap/89494] Bootstrap error when using GCC 4.2.1

2019-02-25 Thread pkubaj at anongoth dot pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89494

--- Comment #4 from Piotr Kubaj  ---
Sorry, that was for a build with GCC 6. A build with GCC 4.2.1 is done with the
following.

Configure:
/usr/bin/env CC="cc" CPP="cpp" CXX="c++"  CFLAGS="-O2 -pipe  -DLIBICONV_PLUG
-fno-strict-aliasing " CPPFLAGS="-DLIBICONV_PLUG" CXXFLAGS="-O2 -pipe
-DLIBICONV_PLUG -fno-strict-aliasing  -DLIBICONV_PLUG "  LDFLAGS=" " LIBS="" 
INSTALL="/usr/bin/install -c"  INSTALL_DATA="install  -m 0644" 
INSTALL_LIB="install  -s -m 0644"  INSTALL_PROGRAM="install  -s -m 555" 
INSTALL_SCRIPT="install  -m 555"  MAKE=gmake
ac_cv_path_PERL=/usr/local/bin/perl ac_cv_path_PERL_PATH=/usr/local/bin/perl 
PERL_USE_UNSAFE_INC=1 UNAME_m="powerpc64"
XDG_DATA_HOME=/usr/local/poudriere/ports/default/lang/gcc9-devel/work 
XDG_CONFIG_HOME=/usr/local/poudriere/ports/default/lang/gcc9-devel/work 
HOME=/usr/local/poudriere/ports/default/lang/gcc9-devel/work
PATH=/usr/local/poudriere/ports/default/lang/gcc9-devel/work/.bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
SHELL=/bin/sh CONFIG_SHELL=/bin/sh ADDR2LINE="/usr/local/bin/addr2line"
AR="/usr/local/bin/ar" AS="/usr/local/bin/as" CPPFILT="/usr/local/bin/c++filt"
GPROF="/usr/local/bin/gprof" LD="/usr/local/bin/ld" NM="/usr/local/bin/nm"
OBJCOPY="/usr/local/bin/objcopy" OBJDUMP="/usr/local/bin/objdump"
RANLIB="/usr/local/bin/ranlib" READELF="/usr/local/bin/readelf"
SIZE="/usr/local/bin/size" STRINGS="/usr/local/bin/strings"
CONFIG_SITE=/usr/local/poudriere/ports/default/Templates/config.site
lt_cv_sys_max_cmd_len=262144
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/gcc-9-20190217/configure
--enable-multilib --with-build-config=bootstrap-debug --disable-nls 
--enable-gnu-indirect-function  --libdir=/usr/local/lib/gcc9 
--libexecdir=/usr/local/libexec/gcc9  --program-suffix=9 
--with-as=/usr/local/bin/as  --with-gmp=/usr/local 
--with-gxx-include-dir=/usr/local/lib/gcc9/include/c++/ 
--with-ld=/usr/local/bin/ld--with-pkgversion="FreeBSD Ports Collection" 
--with-system-zlib --enable-languages=c,c++,objc,fortran --prefix=/usr/local

Make:
/usr/bin/env PERL_USE_UNSAFE_INC=1
XDG_DATA_HOME=/usr/local/poudriere/ports/default/lang/gcc9-devel/work 
XDG_CONFIG_HOME=/usr/local/poudriere/ports/default/lang/gcc9-devel/work 
HOME=/usr/local/poudriere/ports/default/lang/gcc9-devel/work
PATH=/usr/local/poudriere/ports/default/lang/gcc9-devel/work/.bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
NO_PIE=yes MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES
ADDR2LINE="/usr/local/bin/addr2line" AR="/usr/local/bin/ar"
AS="/usr/local/bin/as" CPPFILT="/usr/local/bin/c++filt"
GPROF="/usr/local/bin/gprof" LD="/usr/local/bin/ld" NM="/usr/local/bin/nm"
OBJCOPY="/usr/local/bin/objcopy" OBJDUMP="/usr/local/bin/objdump"
RANLIB="/usr/local/bin/ranlib" READELF="/usr/local/bin/readelf"
SIZE="/usr/local/bin/size" STRINGS="/usr/local/bin/strings" PREFIX=/usr/local 
LOCALBASE=/usr/local CC="cc" CFLAGS="-O2 -pipe  -DLIBICONV_PLUG
-fno-strict-aliasing "  CPP="cpp" CPPFLAGS="-DLIBICONV_PLUG"  LDFLAGS=" "
LIBS=""  CXX="c++" CXXFLAGS="-O2 -pipe -DLIBICONV_PLUG -fno-strict-aliasing 
-DLIBICONV_PLUG "  MANPREFIX="/usr/local" BSD_INSTALL_PROGRAM="install  -s -m
555" BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m
555"  BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444"
gmake -f Makefile -j16 MAKEINFOFLAGS="--no-split" bootstrap-lean

[Bug bootstrap/89494] Bootstrap error when using GCC 4.2.1

2019-02-25 Thread pkubaj at anongoth dot pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89494

--- Comment #3 from Piotr Kubaj  ---
Make is executed with:
/usr/bin/env PERL_USE_UNSAFE_INC=1
XDG_DATA_HOME=/usr/local/poudriere/ports/default/lang/gcc9-devel/work 
XDG_CONFIG_HOME=/usr/local/poudriere/ports/default/lang/gcc9-devel/work 
HOME=/usr/local/poudriere/ports/default/lang/gcc9-devel/work
PATH=/usr/local/poudriere/ports/default/lang/gcc9-devel/work/.bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
NO_PIE=yes MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES
ADDR2LINE="/usr/local/bin/addr2line" AR="/usr/local/bin/ar"
AS="/usr/local/bin/as" CPPFILT="/usr/local/bin/c++filt"
GPROF="/usr/local/bin/gprof" LD="/usr/local/bin/ld" NM="/usr/local/bin/nm"
OBJCOPY="/usr/local/bin/objcopy" OBJDUMP="/usr/local/bin/objdump"
RANLIB="/usr/local/bin/ranlib" READELF="/usr/local/bin/readelf"
SIZE="/usr/local/bin/size" STRINGS="/usr/local/bin/strings" PREFIX=/usr/local 
LOCALBASE=/usr/local CC="gcc6" CFLAGS="-O2 -pipe  -DLIBICONV_PLUG
-fno-strict-aliasing "  CPP="cpp6" CPPFLAGS="-DLIBICONV_PLUG"  LDFLAGS=" "
LIBS=""  CXX="g++6" CXXFLAGS="-O2 -pipe  -DLIBICONV_PLUG  -DLIBICONV_PLUG " 
MANPREFIX="/usr/local" BSD_INSTALL_PROGRAM="install  -s -m 555" 
BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555" 
BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444" gmake -f
Makefile -j16 MAKEINFOFLAGS="--no-split" bootstrap-lean

[Bug bootstrap/89494] Bootstrap error when using GCC 4.2.1

2019-02-25 Thread pkubaj at anongoth dot pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89494

--- Comment #2 from Piotr Kubaj  ---
I compile from FreeBSD ports tree (just change the port's Makefile not to use
external (newer) GCC, but the in-base 4.2.1), so it adds some environment
variables.

/usr/bin/env CC="g
cc6" CPP="cpp6" CXX="g++6"  CFLAGS="-O2 -pipe  -DLIBICONV_PLUG
-fno-strict-aliasing " CPPFLAGS="-DLIBICONV_PLUG" CXXFLAGS="-O2 -pipe 
-DLIBICONV_PLUG  -DLIBICONV_PLUG "  LDFLAGS=" " LIBS="" 
INSTALL="/usr/bin/install -c"  INSTALL_DATA="install  -m 0644" 
INSTALL_LIB="install  -s -m 0644"  INSTALL_PROGRAM="install  -s -m 555" 
INSTALL_SCRIPT="install  -m 555"  MAKE=gmake
ac_cv_path_PERL=/usr/local/bin/perl ac_cv_path_PERL_PATH=/usr/local/bin/perl 
PERL_USE_UNSAFE_INC=1 UNAME_m="powerpc64"
XDG_DATA_HOME=/usr/local/poudriere/ports/default/lang/gcc9-devel/work 
XDG_CONFIG_HOME=/usr/local/poudriere/ports/default/lang/gcc9-devel/work 
HOME=/usr/local/poudriere/ports/default/lang/gcc9-devel/work
PATH=/usr/local/poudriere/ports/default/lang/gcc9-devel/work/.bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
SHELL=/bin/sh CONFIG_SHELL=/bin/sh ADDR2LINE="/usr/local/bin/addr2line"
AR="/usr/local/bin/ar" AS="/usr/local/bin/as" CPPFILT="/usr/local/bin/c++filt"
GPROF="/usr/local/bin/gprof" LD="/usr/local/bin/ld" NM="/usr/local/bin/nm"
OBJCOPY="/usr/local/bin/objcopy" OBJDUMP="/usr/local/bin/objdump"
RANLIB="/usr/local/bin/ranlib" READELF="/usr/local/bin/readelf"
SIZE="/usr/local/bin/size" STRINGS="/usr/local/bin/strings"
CONFIG_SITE=/usr/local/poudriere/ports/default/Templates/config.site
lt_cv_sys_max_cmd_len=262144
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/gcc-9-20190217/configure
--enable-multilib --with-build-config=bootstrap-debug --disable-nls 
--enable-gnu-indirect-function  --libdir=/usr/local/lib/gcc9 
--libexecdir=/usr/local/libexec/gcc9  --program-suffix=9 
--with-as=/usr/local/bin/as  --with-gmp=/usr/local 
--with-gxx-include-dir=/usr/local/lib/gcc9/include/c++/ 
--with-ld=/usr/local/bin/ld--with-pkgversion="FreeBSD Ports Collection" 
--with-system-zlib --enable-languages=c,c++,objc,fortran --prefix=/usr/local

[Bug go/86535] FreeBSD/PowerPC64 - Building Go Frontend support for gcc 7.3.0 fails

2019-02-25 Thread pkubaj at anongoth dot pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86535

Piotr Kubaj  changed:

   What|Removed |Added

 CC||pkubaj at anongoth dot pl

--- Comment #13 from Piotr Kubaj  ---
I have similar errors when building GCC 9:
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/gcc-9-20190217/libgo/go/runtime/cpuprof.go:73:26:
error: reference to undefined name 'nanotime'
   73 |   cpuprof.log.write(nil, nanotime(), hdr[:], nil)
  |  ^
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/gcc-9-20190217/libgo/go/runtime/cpuprof.go:105:33:
error: reference to undefined name 'nanotime'
  105 |   cpuprof.log.write(, nanotime(), hdr[:], stk)
  | ^
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/gcc-9-20190217/libgo/go/runtime/lock_futex.go:199:14:
error: reference to undefined name 'nanotime'
  199 |  deadline := nanotime() + ns
  |  ^
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/gcc-9-20190217/libgo/go/runtime/lock_futex.go:213:10:
error: reference to undefined name 'nanotime'
  213 |   now := nanotime()
  |  ^
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/gcc-9-20190217/libgo/go/runtime/mgc.go:591:20:
error: reference to undefined name 'nanotime'
  591 |  assistDuration := nanotime() - c.markStartTime
  |^
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/gcc-9-20190217/libgo/go/runtime/mgc.go:721:12:
error: reference to undefined name 'nanotime'
  721 |   delta := nanotime() - gcController.markStartTime
  |^
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/gcc-9-20190217/libgo/go/runtime/mgc.go:745:9:
error: reference to undefined name 'nanotime'
  745 |  now := nanotime()
  | ^
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/gcc-9-20190217/libgo/go/runtime/mgc.go:1279:9:
error: reference to undefined name 'nanotime'
 1279 |  now := nanotime()
  | ^
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/gcc-9-20190217/libgo/go/runtime/mgc.go:1492:9:
error: reference to undefined name 'nanotime'
 1492 |  now := nanotime()
  | ^
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/gcc-9-20190217/libgo/go/runtime/mgc.go:1591:15:
error: reference to undefined name 'nanotime'
 1591 |  startTime := nanotime()
  |   ^
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/gcc-9-20190217/libgo/go/runtime/mgc.go:1656:9:
error: reference to undefined name 'nanotime'
 1656 |  now := nanotime()
  | ^
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/gcc-9-20190217/libgo/go/runtime/mgc.go:1882:16:
error: reference to undefined name 'nanotime'
 1882 |   startTime := nanotime()
  |^
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/gcc-9-20190217/libgo/go/runtime/mgc.go:1933:15:
error: reference to undefined name 'nanotime'
 1933 |   duration := nanotime() - startTime
  |   ^
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/gcc-9-20190217/libgo/go/runtime/mgcmark.go:437:15:
error: reference to undefined name 'nanotime'
  437 |  startTime := nanotime()
  |   ^
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/gcc-9-20190217/libgo/go/runtime/mgcmark.go:480:14:
error: reference to undefined name 'nanotime'
  480 |  duration := nanotime() - startTime
  |  ^
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/gcc-9-20190217/libgo/go/runtime/mheap.go:1215:19:
error: reference to undefined name 'nanotime'
 1215 |   s.unusedsince = nanotime()
  |   ^
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/gcc-9-20190217/libgo/go/runtime/netpoll.go:220:8:
error: reference to undefined name 'nanotime'
  220 |   d += nanotime()
  |^
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/gcc-9-20190217/libgo/go/runtime/os_freebsd.go:18:19:
error: reference to undefined name '_CTL_HW'
   18 |  mib := [2]uint32{_CTL_HW, _HW_PAGESIZE}
  |   ^
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/gcc-9-20190217/libgo/go/runtime/os_freebsd.go:18:28:
error: reference to undefined name '_HW_PAGESIZE'
   18 |  mib := [2]uint32{_CTL_HW, _HW_PAGESIZE}
  |^
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/gcc-9-20190217/libgo/go/runtime/os_freebsd.go:21:9:
error: reference to undefined name 'sysctl'
   21 |  ret := sysctl([0], 2, (*byte)(unsafe.Pointer()), , nil,
0)
  | ^
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/gcc-9-20190217/libgo/go/runtime/os_freebsd.go:15:75:
error: use of undefined type 'umtx_time'
   15 | func sys_umtx_op(addr *uint32, mode int32, val uint32, uaddr1 uinptr,
ts *umtx_time) int32

There are more of those errors, all

[Bug bootstrap/89494] New: Bootstrap error when using GCC 4.2.1

2019-02-25 Thread pkubaj at anongoth dot pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89494

Bug ID: 89494
   Summary: Bootstrap error when using GCC 4.2.1
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pkubaj at anongoth dot pl
  Target Milestone: ---

I use FreeBSD on powerpc64 architecture, which has GCC 4.2.1 as a system
compiler.

It does support C++98 which, according to
https://gcc.gnu.org/install/prerequisites.html is enough to bootstrap GCC.

I can compile GCC 6.5 at most. GCC 7 and newer are broken. FreeBSD ports tree
has a work around for that to use newer GCC release from FreeBSD's ports, but
it means that to compile GCC 7 or newer, we need to compile 5 or 6.

Building GCC 9 fails with:
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/.build/./gcc/xgcc
-B/usr/local/poudriere/ports/default/lang/gcc9-devel/work/.build/./gcc/ -xc
-nostdinc /dev/null -S -o /dev/null
-fself-test=/usr/local/poudriere/ports/default/lang/g
cc9-devel/work/gcc-9-20190217/gcc/testsuite/selftests
cc1: internal compiler error: Segmentation fault
no stack trace because unwind library not available


Building GCC 7 is more verbose:
/usr/local/poudriere/ports/default/lang/gcc7/work/.build/./gcc/xgcc
-B/usr/local/poudriere/ports/default/lang/gcc7/work/.build/./gcc/
-B/usr/local/powerpc64-portbld-freebsd12.0/bin/
-B/usr/local/powerpc64-portbld-freebsd12.0/lib/ -isystem
/usr/local/powerpc64-portbld-freebsd12.0/include -isystem
/usr/local/powerpc64-portbld-freebsd12.0/sys-include-g -O2 -pipe
-DLIBICONV_PLUG -fno-strict-aliasing -m32 -fPIC -mstrict-align -O2  -g -O2
-pipe  -DLIBICONV_PLUG -fno-strict-aliasing  -DIN_GCC-W -Wall
-Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fPIC
-pthread -mno-minimal-toc -g -DIN_LIBGCC2 -fbuilding-libgcc
-fno-stack-protector   -fPIC -pthread -mno-minimal-toc -I. -I. -I../../.././gcc
-I/usr/local/poudriere/ports/default/lang/gcc7/work/gcc-7.4.0/libgcc
-I/usr/local/poudriere/ports/default/lang/gcc7/work/gcc-7.4.0/libgcc/.
-I/usr/local/poudriere/ports/default/lang/gcc7/work/gcc-7.4.0/libgcc/../gcc
-I/usr/local/poudriere/ports/default/lang/gcc7/work/gcc-7.4.0/libgcc/../include
 -DHAVE_CC_TLS  -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3
-c /usr/local/poudriere/ports/default/lang/gcc7/work/gcc-7.4.0/libgcc/libgcc2.c
-fvisibility=hidden -DHIDE_EXPORTS
In file included from
/usr/local/poudriere/ports/default/lang/gcc7/work/gcc-7.4.0/libgcc/libgcc2.c:56:0:
/usr/local/poudriere/ports/default/lang/gcc7/work/gcc-7.4.0/libgcc/libgcc2.c:
In function '__muldi3':
/usr/local/poudriere/ports/default/lang/gcc7/work/gcc-7.4.0/libgcc/libgcc2.h:219:20:
internal compiler error: Segmentation fault
 #define __NDW(a,b) __ ## a ## di ## b
^
/usr/local/poudriere/ports/default/lang/gcc7/work/gcc-7.4.0/libgcc/libgcc2.h:273:18:
note: in expansion of macro '__NDW'
 #define __muldi3 __NDW(mul,3)
  ^
/usr/local/poudriere/ports/default/lang/gcc7/work/gcc-7.4.0/libgcc/libgcc2.c:548:1:
note: in expansion of macro '__muldi3'
 __muldi3 (DWtype u, DWtype v)
 ^~~~
no stack trace because unwind library not available

Obviously, I'm not asking to fix GCC 4.2.1, but to make a workaround for newer
releases