Module Name:    src
Committed By:   martin
Date:           Sun Oct  8 14:35:24 UTC 2023

Modified Files:
        src/crypto/external/bsd/openssh/lib [netbsd-10]: Makefile
        src/distrib/utils/x_ping [netbsd-10]: Makefile
        src/doc [netbsd-10]: CHANGES
        src/external/apache2/argon2/lib/libargon2 [netbsd-10]: Makefile.inc
        src/external/bsd/jemalloc/lib [netbsd-10]: Makefile.inc
        src/external/bsd/mdocml/lib/libmandoc [netbsd-10]: Makefile
        src/external/gpl3/binutils.old/lib/libbfd [netbsd-10]: Makefile
        src/external/gpl3/binutils/dist/gas/config [netbsd-10]: tc-vax.c
            tc-vax.h
        src/external/gpl3/binutils/lib/libbfd [netbsd-10]: Makefile
        src/external/gpl3/gcc/dist/gcc [netbsd-10]: dse.c function.c recog.c
            reload.c rtlanal.c target.def targhooks.c targhooks.h
        src/external/gpl3/gcc/dist/gcc/config/vax [netbsd-10]: builtins.md
            elf.h vax.c vax.md
        src/external/gpl3/gcc/dist/gcc/doc [netbsd-10]: tm.texi tm.texi.in
        src/external/gpl3/gcc/lib [netbsd-10]: Makefile.sanitizer
        src/external/gpl3/gcc/lib/libasan [netbsd-10]: Makefile
        src/external/gpl3/gcc/lib/liblsan [netbsd-10]: Makefile
        src/external/gpl3/gcc/lib/libubsan [netbsd-10]: Makefile
        src/external/gpl3/gcc/usr.bin/backend [netbsd-10]: Makefile
        src/external/gpl3/gcc/usr.bin/cc1 [netbsd-10]: Makefile
        src/external/gpl3/gcc/usr.bin/cc1obj [netbsd-10]: Makefile
        src/external/gpl3/gcc/usr.bin/cc1objplus [netbsd-10]: Makefile
        src/external/gpl3/gcc/usr.bin/cc1plus [netbsd-10]: Makefile
        src/external/gpl3/gcc/usr.bin/gcc [netbsd-10]: Makefile
        src/external/gpl3/gcc/usr.bin/libdecnumber [netbsd-10]: Makefile
        src/external/gpl3/gcc/usr.bin/lto-dump [netbsd-10]: Makefile
        src/external/gpl3/gcc/usr.bin/lto1 [netbsd-10]: Makefile
        src/external/gpl3/gdb.old/lib/libdecnumber [netbsd-10]: Makefile
        src/external/gpl3/gdb/lib/libdecnumber [netbsd-10]: Makefile
        src/external/gpl3/gdb/lib/libgdb [netbsd-10]: Makefile
        src/external/mit/xorg/lib/gallium [netbsd-10]: Makefile
        src/external/mit/xorg/lib/gallium.old [netbsd-10]: Makefile
        src/external/mit/xorg/lib/libX11 [netbsd-10]: Makefile.libx11
        src/games/gomoku [netbsd-10]: Makefile
        src/games/phantasia [netbsd-10]: Makefile
        src/lib/i18n_module/UTF7 [netbsd-10]: Makefile
        src/lib/libbz2 [netbsd-10]: Makefile
        src/lib/libc/gdtoa [netbsd-10]: Makefile.inc
        src/lib/libcrypt [netbsd-10]: Makefile
        src/libexec/ld.elf_so [netbsd-10]: Makefile
        src/sbin/fsck_ffs [netbsd-10]: Makefile.common
        src/sbin/fsdb [netbsd-10]: Makefile
        src/sbin/newfs_ext2fs [netbsd-10]: Makefile
        src/sbin/ping [netbsd-10]: Makefile
        src/sys/arch/vax/conf [netbsd-10]: Makefile.vax
        src/sys/lib/libsa [netbsd-10]: Makefile
        src/sys/lib/libz [netbsd-10]: Makefile
        src/sys/modules/lfs [netbsd-10]: Makefile
        src/sys/rump/fs/lib/liblfs [netbsd-10]: Makefile
        src/tools/gcc [netbsd-10]: Makefile
        src/usr.sbin/mtrace [netbsd-10]: Makefile

Log Message:
Pull up following revision(s) (requested by rin in ticket #394):

        external/gpl3/binutils/dist/gas/config/tc-vax.h: revision 1.10
        tools/gcc/Makefile: revision 1.109
        external/gpl3/binutils/dist/gas/config/tc-vax.c: revision 1.16
        external/gpl3/binutils/dist/gas/config/tc-vax.c: revision 1.17
        external/gpl3/binutils/dist/gas/config/tc-vax.c: revision 1.18
        external/gpl3/gcc.old/dist/gcc/recog.c: revision 1.12
        external/gpl3/gcc.old/dist/gcc/function.c: revision 1.16
        external/gpl3/gcc.old/dist/gcc/dse.c: revision 1.14 - 1.16
        external/gpl3/gcc.old/dist/gcc/config/vax/vax.c: revision 1.13
        external/gpl3/gcc.old/dist/gcc/config/vax/vax.c: revision 1.14
        external/gpl3/gcc.old/dist/gcc/config/vax/vax.c: revision 1.15
        external/gpl3/gcc.old/dist/gcc/doc/tm.texi.in: revision 1.10
        external/gpl3/gcc.old/dist/gcc/config/vax/vax.c: revision 1.16
        external/gpl3/gcc.old/dist/gcc/config/vax/vax.c: revision 1.17
        external/gpl3/gcc.old/dist/gcc/config/vax/vax.c: revision 1.18
        external/gpl3/gcc.old/dist/gcc/config/vax/vax.c: revision 1.19
        external/gpl3/gcc.old/dist/gcc/config/vax/vax.md: revision 1.12
        external/gpl3/gcc.old/dist/gcc/config/vax/vax.md: revision 1.13
        external/gpl3/gcc.old/usr.bin/backend/Makefile: revision 1.20
        external/gpl3/gcc.old/dist/gcc/targhooks.c: revision 1.12
        external/gpl3/gcc.old/dist/gcc/config/vax/vax.md: revision 1.14
        external/gpl3/gcc.old/dist/gcc/config/vax/vax.md: revision 1.15
        external/gpl3/gcc.old/dist/gcc/config/vax/builtins.md: revision 1.12
        external/gpl3/gcc.old/dist/gcc/config/vax/vax.md: revision 1.16
        external/gpl3/gcc.old/dist/gcc/config/vax/builtins.md: revision 1.13
        external/gpl3/gcc.old/dist/gcc/doc/tm.texi: revision 1.12
        external/gpl3/gcc.old/dist/gcc/config/vax/vax.md: revision 1.17
        external/gpl3/gcc.old/dist/gcc/config/vax/vax.md: revision 1.18
        external/gpl3/gcc.old/dist/gcc/config/vax/elf.h: revision 1.12
        external/gpl3/gcc.old/dist/gcc/config/vax/elf.h: revision 1.13
        external/gpl3/gcc.old/dist/gcc/targhooks.h: revision 1.12
        external/gpl3/gcc.old/dist/gcc/target.def: revision 1.10
        external/gpl3/gcc.old/dist/gcc/rtlanal.c: revision 1.14
        external/gpl3/gcc.old/dist/gcc/reload.c: revision 1.12
        external/gpl3/gcc.old/usr.bin/gcc/Makefile: revision 1.11
        external/gpl3/gcc.old/usr.bin/lto-dump/Makefile: revision 1.3
        external/gpl3/gcc.old/lib/Makefile.sanitizer: revision 1.7
        external/gpl3/binutils.old/lib/libbfd/Makefile: revision 1.10
        distrib/utils/x_ping/Makefile: revision 1.9
        games/phantasia/Makefile: revision 1.38
        external/apache2/argon2/lib/libargon2/Makefile.inc: revision 1.2
        external/gpl3/gcc.old/lib/libubsan/Makefile: revision 1.8
        external/bsd/mdocml/lib/libmandoc/Makefile: revision 1.13
        sbin/ping/Makefile: revision 1.18
        sbin/newfs_ext2fs/Makefile: revision 1.7
        sys/lib/libz/Makefile: revision 1.24
        sys/lib/libsa/Makefile: revision 1.97
        external/gpl3/gcc.old/usr.bin/cc1objplus/Makefile: revision 1.3
        external/gpl3/gdb/lib/libgdb/Makefile: revision 1.36
        sys/modules/lfs/Makefile: revision 1.11
        external/mit/xorg/lib/gallium/Makefile: revision 1.51
        external/gpl3/gdb.old/lib/libdecnumber/Makefile: revision 1.10
        external/mit/xorg/lib/libX11/Makefile.libx11: revision 1.26
        libexec/ld.elf_so/Makefile: revision 1.148
        external/bsd/jemalloc/lib/Makefile.inc: revision 1.16
        external/gpl3/gcc.old/usr.bin/libdecnumber/Makefile: revision 1.14
        crypto/external/bsd/openssh/lib/Makefile: revision 1.38
        external/gpl3/gcc.old/usr.bin/backend/Makefile: revision 1.21
        external/gpl3/gcc.old/usr.bin/cc1/Makefile: revision 1.12
        external/gpl3/gcc.old/lib/libasan/Makefile: revision 1.11
        external/gpl3/gcc.old/usr.bin/cc1plus/Makefile: revision 1.13
        lib/libcrypt/Makefile: revision 1.36
        external/gpl3/gdb/lib/libdecnumber/Makefile: revision 1.5
        lib/libc/gdtoa/Makefile.inc: revision 1.13
        games/gomoku/Makefile: revision 1.13
        sbin/fsdb/Makefile: revision 1.43
        external/gpl3/gcc.old/usr.bin/lto1/Makefile: revision 1.9
        external/mit/xorg/lib/gallium.old/Makefile: revision 1.8
        lib/libbz2/Makefile: revision 1.22
        external/gpl3/gcc.old/usr.bin/cc1obj/Makefile: revision 1.12
        usr.sbin/mtrace/Makefile: revision 1.14
        external/gpl3/gcc.old/usr.bin/cc1obj/Makefile: revision 1.13
        sys/arch/vax/conf/Makefile.vax: revision 1.86
        sys/rump/fs/lib/liblfs/Makefile: revision 1.18
        sbin/fsck_ffs/Makefile.common: revision 1.3
        external/gpl3/binutils/lib/libbfd/Makefile: revision 1.27
        lib/i18n_module/UTF7/Makefile: revision 1.5
        external/gpl3/gcc.old/lib/liblsan/Makefile: revision 1.7
        doc/CHANGES (apply patch)
        (all external/gpl3/gcc.old/ changes applied to external/gpl3/gcc/)

PR 57646: Import major vax toolchain fix.


To generate a diff of this commit:
cvs rdiff -u -r1.34.6.3 -r1.34.6.4 \
    src/crypto/external/bsd/openssh/lib/Makefile
cvs rdiff -u -r1.8 -r1.8.36.1 src/distrib/utils/x_ping/Makefile
cvs rdiff -u -r1.2940.2.5 -r1.2940.2.6 src/doc/CHANGES
cvs rdiff -u -r1.1 -r1.1.2.1 \
    src/external/apache2/argon2/lib/libargon2/Makefile.inc
cvs rdiff -u -r1.15 -r1.15.2.1 src/external/bsd/jemalloc/lib/Makefile.inc
cvs rdiff -u -r1.12 -r1.12.10.1 \
    src/external/bsd/mdocml/lib/libmandoc/Makefile
cvs rdiff -u -r1.8 -r1.8.6.1 \
    src/external/gpl3/binutils.old/lib/libbfd/Makefile
cvs rdiff -u -r1.13 -r1.13.6.1 \
    src/external/gpl3/binutils/dist/gas/config/tc-vax.c
cvs rdiff -u -r1.8 -r1.8.6.1 \
    src/external/gpl3/binutils/dist/gas/config/tc-vax.h
cvs rdiff -u -r1.24 -r1.24.2.1 src/external/gpl3/binutils/lib/libbfd/Makefile
cvs rdiff -u -r1.15 -r1.15.2.1 src/external/gpl3/gcc/dist/gcc/dse.c
cvs rdiff -u -r1.1.1.17.2.1 -r1.1.1.17.2.2 \
    src/external/gpl3/gcc/dist/gcc/function.c
cvs rdiff -u -r1.1.1.12 -r1.1.1.12.6.1 src/external/gpl3/gcc/dist/gcc/recog.c
cvs rdiff -u -r1.12 -r1.12.2.1 src/external/gpl3/gcc/dist/gcc/reload.c \
    src/external/gpl3/gcc/dist/gcc/rtlanal.c
cvs rdiff -u -r1.1.1.10 -r1.1.1.10.2.1 \
    src/external/gpl3/gcc/dist/gcc/target.def
cvs rdiff -u -r1.10 -r1.10.6.1 src/external/gpl3/gcc/dist/gcc/targhooks.c
cvs rdiff -u -r1.1.1.10 -r1.1.1.10.6.1 \
    src/external/gpl3/gcc/dist/gcc/targhooks.h
cvs rdiff -u -r1.12 -r1.12.6.1 \
    src/external/gpl3/gcc/dist/gcc/config/vax/builtins.md
cvs rdiff -u -r1.11 -r1.11.6.1 \
    src/external/gpl3/gcc/dist/gcc/config/vax/elf.h
cvs rdiff -u -r1.22 -r1.22.6.1 \
    src/external/gpl3/gcc/dist/gcc/config/vax/vax.c
cvs rdiff -u -r1.17 -r1.17.6.1 \
    src/external/gpl3/gcc/dist/gcc/config/vax/vax.md
cvs rdiff -u -r1.1.1.13 -r1.1.1.13.2.1 \
    src/external/gpl3/gcc/dist/gcc/doc/tm.texi
cvs rdiff -u -r1.1.1.12 -r1.1.1.12.2.1 \
    src/external/gpl3/gcc/dist/gcc/doc/tm.texi.in
cvs rdiff -u -r1.16 -r1.16.6.1 src/external/gpl3/gcc/lib/Makefile.sanitizer
cvs rdiff -u -r1.33 -r1.33.6.1 src/external/gpl3/gcc/lib/libasan/Makefile
cvs rdiff -u -r1.8 -r1.8.6.1 src/external/gpl3/gcc/lib/liblsan/Makefile
cvs rdiff -u -r1.19 -r1.19.6.1 src/external/gpl3/gcc/lib/libubsan/Makefile
cvs rdiff -u -r1.66.2.1 -r1.66.2.2 \
    src/external/gpl3/gcc/usr.bin/backend/Makefile
cvs rdiff -u -r1.20 -r1.20.6.1 src/external/gpl3/gcc/usr.bin/cc1/Makefile
cvs rdiff -u -r1.18 -r1.18.6.1 src/external/gpl3/gcc/usr.bin/cc1obj/Makefile
cvs rdiff -u -r1.3 -r1.3.6.1 \
    src/external/gpl3/gcc/usr.bin/cc1objplus/Makefile
cvs rdiff -u -r1.17 -r1.17.6.1 src/external/gpl3/gcc/usr.bin/cc1plus/Makefile
cvs rdiff -u -r1.7 -r1.7.26.1 src/external/gpl3/gcc/usr.bin/gcc/Makefile
cvs rdiff -u -r1.8.2.1 -r1.8.2.2 \
    src/external/gpl3/gcc/usr.bin/libdecnumber/Makefile
cvs rdiff -u -r1.1 -r1.1.6.1 src/external/gpl3/gcc/usr.bin/lto-dump/Makefile
cvs rdiff -u -r1.7 -r1.7.6.1 src/external/gpl3/gcc/usr.bin/lto1/Makefile
cvs rdiff -u -r1.8 -r1.8.6.1 \
    src/external/gpl3/gdb.old/lib/libdecnumber/Makefile
cvs rdiff -u -r1.3 -r1.3.36.1 src/external/gpl3/gdb/lib/libdecnumber/Makefile
cvs rdiff -u -r1.32 -r1.32.2.1 src/external/gpl3/gdb/lib/libgdb/Makefile
cvs rdiff -u -r1.48.2.1 -r1.48.2.2 src/external/mit/xorg/lib/gallium/Makefile
cvs rdiff -u -r1.4.2.1 -r1.4.2.2 \
    src/external/mit/xorg/lib/gallium.old/Makefile
cvs rdiff -u -r1.25 -r1.25.2.1 \
    src/external/mit/xorg/lib/libX11/Makefile.libx11
cvs rdiff -u -r1.12 -r1.12.2.1 src/games/gomoku/Makefile
cvs rdiff -u -r1.37 -r1.37.34.1 src/games/phantasia/Makefile
cvs rdiff -u -r1.4 -r1.4.52.1 src/lib/i18n_module/UTF7/Makefile
cvs rdiff -u -r1.20 -r1.20.8.1 src/lib/libbz2/Makefile
cvs rdiff -u -r1.12 -r1.12.2.1 src/lib/libc/gdtoa/Makefile.inc
cvs rdiff -u -r1.34 -r1.34.2.1 src/lib/libcrypt/Makefile
cvs rdiff -u -r1.144.2.1 -r1.144.2.2 src/libexec/ld.elf_so/Makefile
cvs rdiff -u -r1.2 -r1.2.8.1 src/sbin/fsck_ffs/Makefile.common
cvs rdiff -u -r1.41 -r1.41.6.1 src/sbin/fsdb/Makefile
cvs rdiff -u -r1.6 -r1.6.36.1 src/sbin/newfs_ext2fs/Makefile
cvs rdiff -u -r1.17 -r1.17.36.1 src/sbin/ping/Makefile
cvs rdiff -u -r1.85 -r1.85.20.1 src/sys/arch/vax/conf/Makefile.vax
cvs rdiff -u -r1.95 -r1.95.12.1 src/sys/lib/libsa/Makefile
cvs rdiff -u -r1.23 -r1.23.32.1 src/sys/lib/libz/Makefile
cvs rdiff -u -r1.10 -r1.10.30.1 src/sys/modules/lfs/Makefile
cvs rdiff -u -r1.17 -r1.17.20.1 src/sys/rump/fs/lib/liblfs/Makefile
cvs rdiff -u -r1.105 -r1.105.2.1 src/tools/gcc/Makefile
cvs rdiff -u -r1.12 -r1.12.6.1 src/usr.sbin/mtrace/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/external/bsd/openssh/lib/Makefile
diff -u src/crypto/external/bsd/openssh/lib/Makefile:1.34.6.3 src/crypto/external/bsd/openssh/lib/Makefile:1.34.6.4
--- src/crypto/external/bsd/openssh/lib/Makefile:1.34.6.3	Fri Aug 11 18:13:07 2023
+++ src/crypto/external/bsd/openssh/lib/Makefile	Sun Oct  8 14:35:22 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.34.6.3 2023/08/11 18:13:07 martin Exp $
+#	$NetBSD: Makefile,v 1.34.6.4 2023/10/08 14:35:22 martin Exp $
 
 .include <bsd.own.mk>
 
@@ -117,12 +117,6 @@ COPTS.${f}.c+=	-Wno-pointer-sign
 # XXX
 COPTS.channels.c+=	-fno-strict-aliasing
 
-# XXX
-.if ${MACHINE} == "vax"
-COPTS.poly1305.c+=	-O0
-COPTS.umac.c+=		-O0
-.endif
-
 COPTS.hostfile.c+=	${GCC_NO_FORMAT_TRUNCATION}
 COPTS.sshkey.c+=	${GCC_NO_FORMAT_TRUNCATION}
 COPTS.cipher.c+=	-Wno-error=deprecated-declarations

Index: src/distrib/utils/x_ping/Makefile
diff -u src/distrib/utils/x_ping/Makefile:1.8 src/distrib/utils/x_ping/Makefile:1.8.36.1
--- src/distrib/utils/x_ping/Makefile:1.8	Sat Nov  9 21:39:27 2013
+++ src/distrib/utils/x_ping/Makefile	Sun Oct  8 14:35:19 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2013/11/09 21:39:27 christos Exp $
+# $NetBSD: Makefile,v 1.8.36.1 2023/10/08 14:35:19 martin Exp $
 # Build ping without IPSEC
 
 .include <bsd.own.mk>
@@ -12,10 +12,6 @@ CPPFLAGS+=	-I${SRCDIR} -DCRUNCHOPS
 DPADD=		${LIBM}
 LDADD=		-lm
 
-.if ${MACHINE_ARCH} == "vax"
-COPTS.ping.c=-O0
-.endif
-
 .include <bsd.prog.mk>
 
 .PATH:		${SRCDIR}

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2940.2.5 src/doc/CHANGES:1.2940.2.6
--- src/doc/CHANGES:1.2940.2.5	Sun Oct  8 13:19:34 2023
+++ src/doc/CHANGES	Sun Oct  8 14:35:24 2023
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2940.2.5 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2940.2.6 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -796,6 +796,8 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	aq(4): add support for AQC113-116 [ryo 20230114]
 	lua: Import version 5.4.6.
 		Bumped shlib minor because of API/ABI changes. [nikita 20230608]
+	gcc.old: Initial import of major vax toolchain fix by Kalvis Duckmanton.
+		[rin 20231007]
 	igc(4): Add initial support to Intel I225/I226 series Ethernet devices.
 		[knakahara, rin, msaitoh 20231006]
 

Index: src/external/apache2/argon2/lib/libargon2/Makefile.inc
diff -u src/external/apache2/argon2/lib/libargon2/Makefile.inc:1.1 src/external/apache2/argon2/lib/libargon2/Makefile.inc:1.1.2.1
--- src/external/apache2/argon2/lib/libargon2/Makefile.inc:1.1	Tue May 17 18:55:41 2022
+++ src/external/apache2/argon2/lib/libargon2/Makefile.inc	Sun Oct  8 14:35:20 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.1 2022/05/17 18:55:41 christos Exp $
+# $NetBSD: Makefile.inc,v 1.1.2.1 2023/10/08 14:35:20 martin Exp $
 
 ARGON2DIR=	${NETBSDSRCDIR}/external/apache2/argon2/dist/phc-winner-argon2
 
@@ -16,7 +16,3 @@ CFLAGS+=	-pthread
 LDADD+=-lpthread
 DPADD+=${LIBPTHREAD}
 .endif
-
-.if ${MACHINE} == "vax"
-COPTS.blake2b.c+=	-O0
-.endif

Index: src/external/bsd/jemalloc/lib/Makefile.inc
diff -u src/external/bsd/jemalloc/lib/Makefile.inc:1.15 src/external/bsd/jemalloc/lib/Makefile.inc:1.15.2.1
--- src/external/bsd/jemalloc/lib/Makefile.inc:1.15	Sun Aug 15 12:41:40 2021
+++ src/external/bsd/jemalloc/lib/Makefile.inc	Sun Oct  8 14:35:21 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.15 2021/08/15 12:41:40 rillig Exp $
+#	$NetBSD: Makefile.inc,v 1.15.2.1 2023/10/08 14:35:21 martin Exp $
 
 JEMALLOC:=${.PARSEDIR}/..
 
@@ -53,12 +53,6 @@ COPTS.ctl.c+=-Wno-error=stack-protector
 COPTS.stats.c+=-Wno-error=stack-protector
 COPTS.tcache.c+=-Wno-error=stack-protector
 
-.if ${MACHINE_ARCH} == "vax"
-# in merge_overlapping_regs, at regrename.c
-COPTS.arena.c+=-O0
-COPTS.extent.c+=-O0
-.endif
-
 SRCS+=${JEMALLOC_SRCS}
 
 jemalloc.d jemalloc.pico jemalloc.o jemalloc.ln jemalloc.po jemalloc.go: \

Index: src/external/bsd/mdocml/lib/libmandoc/Makefile
diff -u src/external/bsd/mdocml/lib/libmandoc/Makefile:1.12 src/external/bsd/mdocml/lib/libmandoc/Makefile:1.12.10.1
--- src/external/bsd/mdocml/lib/libmandoc/Makefile:1.12	Mon Mar 11 00:15:38 2019
+++ src/external/bsd/mdocml/lib/libmandoc/Makefile	Sun Oct  8 14:35:20 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.12 2019/03/11 00:15:38 christos Exp $
+# $NetBSD: Makefile,v 1.12.10.1 2023/10/08 14:35:20 martin Exp $
 
 LIBISPRIVATE=	yes
 
@@ -39,11 +39,6 @@ tbl_opts.c
 
 MAN=	mandoc.3
 
-# XXX
-.if ${MACHINE} == "vax"
-COPTS.mdoc_macro.c+=-O0
-.endif
-
 COPTS.man_validate.c+=-Wno-error=array-bounds
 
 .include <bsd.lib.mk>

Index: src/external/gpl3/binutils.old/lib/libbfd/Makefile
diff -u src/external/gpl3/binutils.old/lib/libbfd/Makefile:1.8 src/external/gpl3/binutils.old/lib/libbfd/Makefile:1.8.6.1
--- src/external/gpl3/binutils.old/lib/libbfd/Makefile:1.8	Fri Apr  3 17:51:22 2020
+++ src/external/gpl3/binutils.old/lib/libbfd/Makefile	Sun Oct  8 14:35:19 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2020/04/03 17:51:22 christos Exp $
+#	$NetBSD: Makefile,v 1.8.6.1 2023/10/08 14:35:19 martin Exp $
 
 NOLINKLIB=	# defined
 NOLINT=		# defined
@@ -39,10 +39,6 @@ CPPFLAGS+=	-I${.CURDIR}/arch/${BFD_MACHI
 		-I${DIST}/bfd ${GCPPFLAGS:M-D*} ${GCPPFLAGS:M-I*:N-I.*} \
 		-DDEBUGDIR=\"${DEBUGDIR}\" -DBINDIR=\"${BINDIR}\"
 
-.if (${BFD_MACHINE_ARCH} == "vax")
-CPPFLAGS.elf.c +=	-O0
-.endif
-
 COPTS.pei-x86_64.c += -Wno-stack-protector
 COPTS.elfxx-mips.c += -Wno-stack-protector
 

Index: src/external/gpl3/binutils/dist/gas/config/tc-vax.c
diff -u src/external/gpl3/binutils/dist/gas/config/tc-vax.c:1.13 src/external/gpl3/binutils/dist/gas/config/tc-vax.c:1.13.6.1
--- src/external/gpl3/binutils/dist/gas/config/tc-vax.c:1.13	Fri Apr  3 23:48:47 2020
+++ src/external/gpl3/binutils/dist/gas/config/tc-vax.c	Sun Oct  8 14:35:18 2023
@@ -282,6 +282,29 @@ md_apply_fix (fixS *fixP, valueT *valueP
   if (fixP->fx_subsy != (symbolS *) NULL)
     as_bad_where (fixP->fx_file, fixP->fx_line, _("expression too complex"));
 
+  if (fixP->fx_pcrel)
+    {
+      switch (fixP->fx_r_type)
+	{
+	case BFD_RELOC_32:
+	  /* change the relocation type to 32 bit PC-relative */
+	  fixP->fx_r_type = BFD_RELOC_32_PCREL;
+	  if (fixP->fx_addsy != NULL)
+	    {
+	      /* Hack around bfd_install_relocation brain damage.  */
+	      value += fixP->fx_frag->fr_address + fixP->fx_where;
+	    }
+	  if (fixP->fx_addsy == abs_section_sym)
+	    fixP->fx_done = 1;
+	  break;
+	default:
+	  break;
+	}
+    }
+
+  /*
+   * Common code for pc-relative and non-pc-relative cases
+   */
   if (fixP->fx_addsy == NULL)
     fixP->fx_done = 1;
 
@@ -2332,18 +2355,19 @@ md_create_short_jump (char *ptr,
 
 void
 md_create_long_jump (char *ptr,
-		     addressT from_addr ATTRIBUTE_UNUSED,
+		     addressT from_addr,
 		     addressT to_addr,
-		     fragS *frag,
-		     symbolS *to_symbol)
+		     fragS *frag ATTRIBUTE_UNUSED,
+		     symbolS *to_symbol ATTRIBUTE_UNUSED)
 {
   valueT offset;
 
-  offset = to_addr - S_GET_VALUE (to_symbol);
-  *ptr++ = VAX_JMP;		/* Arbitrary jump.  */
-  *ptr++ = VAX_ABSOLUTE_MODE;
+  /* Account for 1 byte instruction, 1 byte of address specifier and
+     4 bytes of offset from PC.  */
+  offset = to_addr - (from_addr + 1 + 1 + 4);
+  *ptr++ = VAX_JMP;
+  *ptr++ = VAX_PC_RELATIVE_MODE;
   md_number_to_chars (ptr, offset, 4);
-  fix_new (frag, ptr - frag->fr_literal, 4, to_symbol, (long) 0, 0, NO_RELOC);
 }
 
 #ifdef OBJ_VMS
@@ -3557,12 +3581,39 @@ void
 vax_cons_fix_new (fragS *frag, int where, unsigned int nbytes, expressionS *exp,
 		  bfd_reloc_code_real_type r)
 {
-  if (r == NO_RELOC)
+  int pcrel;
+  // fix PC relative frags too ...
+  switch (r)
+    {
+    case BFD_RELOC_8_PCREL:
+    case BFD_RELOC_16_PCREL:
+    case BFD_RELOC_32_PCREL:
+      pcrel = 1;
+      /*
+       * Displacement mode addressing (of which PC relative is one
+       * type) uses the updated contents of the register as the base
+       * address.  VARM, Leonard 1987, pp34
+       */
+      switch (exp->X_op)
+	{
+	case O_constant:
+	case O_symbol:
+	  exp->X_add_number += nbytes;
+	  break;
+	}
+      break;
+    case NO_RELOC:
     r = (nbytes == 1 ? BFD_RELOC_8
 	 : nbytes == 2 ? BFD_RELOC_16
 	 : BFD_RELOC_32);
+      pcrel = 0;
+      break;
+    default:
+      pcrel = 0;
+      break;
+    }
 
-  fix_new_exp (frag, where, (int) nbytes, exp, 0, r);
+  fix_new_exp (frag, where, (int) nbytes, exp, pcrel, r);
 }
 
 const char *
@@ -3600,6 +3651,11 @@ tc_vax_regname_to_dw2regnum (char *regna
 void
 vax_cfi_emit_pcrel_expr (expressionS *expP, unsigned int nbytes)
 {
+  expressionS tmp = *expP;
+
+  tmp.X_op = O_subtract;
+  tmp.X_op_symbol = symbol_temp_new_now ();
+  expP = &tmp;
   expP->X_add_number += nbytes;
   emit_expr (expP, nbytes);
 }

Index: src/external/gpl3/binutils/dist/gas/config/tc-vax.h
diff -u src/external/gpl3/binutils/dist/gas/config/tc-vax.h:1.8 src/external/gpl3/binutils/dist/gas/config/tc-vax.h:1.8.6.1
--- src/external/gpl3/binutils/dist/gas/config/tc-vax.h:1.8	Fri Apr  3 23:48:47 2020
+++ src/external/gpl3/binutils/dist/gas/config/tc-vax.h	Sun Oct  8 14:35:18 2023
@@ -37,6 +37,8 @@
 
 #ifdef OBJ_ELF
 #define TARGET_FORMAT "elf32-vax"
+#define DIFF_EXPR_OK 1
+#define CFI_DIFF_EXPR_OK 0
 #endif
 
 #define TARGET_ARCH	bfd_arch_vax

Index: src/external/gpl3/binutils/lib/libbfd/Makefile
diff -u src/external/gpl3/binutils/lib/libbfd/Makefile:1.24 src/external/gpl3/binutils/lib/libbfd/Makefile:1.24.2.1
--- src/external/gpl3/binutils/lib/libbfd/Makefile:1.24	Wed Dec 14 18:59:04 2022
+++ src/external/gpl3/binutils/lib/libbfd/Makefile	Sun Oct  8 14:35:24 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.24 2022/12/14 18:59:04 skrll Exp $
+#	$NetBSD: Makefile,v 1.24.2.1 2023/10/08 14:35:24 martin Exp $
 
 NOLINKLIB=	# defined
 NOLINT=		# defined
@@ -41,10 +41,6 @@ CPPFLAGS+=	-I${.CURDIR}/arch/${BFD_MACHI
 		-DDEBUGDIR=\"${DEBUGDIR}\" -DLIBDIR=\"${LIBDIR}\" \
 		-DBINDIR=\"${BINDIR}\"
 
-.if (${BFD_MACHINE_ARCH} == "vax")
-CPPFLAGS.elf.c +=	-O0
-.endif
-
 COPTS.pei-x86_64.c+=	-Wno-stack-protector
 COPTS.elfxx-mips.c+=	-Wno-stack-protector
 COPTS.elf.c+=		${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-overflow :}

Index: src/external/gpl3/gcc/dist/gcc/dse.c
diff -u src/external/gpl3/gcc/dist/gcc/dse.c:1.15 src/external/gpl3/gcc/dist/gcc/dse.c:1.15.2.1
--- src/external/gpl3/gcc/dist/gcc/dse.c:1.15	Fri Jul 22 20:22:34 2022
+++ src/external/gpl3/gcc/dist/gcc/dse.c	Sun Oct  8 14:35:18 2023
@@ -301,7 +301,12 @@ static unsigned HOST_WIDE_INT
 lowpart_bitmask (int n)
 {
   unsigned HOST_WIDE_INT mask = HOST_WIDE_INT_M1U;
-#if 1 // XXXMRG
+#ifdef NB_FIX_VAX_BACKEND
+  if (n < 1)
+    return 0;
+  if (n >= HOST_BITS_PER_WIDE_INT)
+    return mask;
+#else // XXXMRG
   gcc_assert(n >= 0 && n <= HOST_BITS_PER_WIDE_INT);
   if (n == 0)
     return 0;
@@ -1340,6 +1345,10 @@ all_positions_needed_p (store_info *s_in
 	  return false;
       return true;
     }
+#ifdef NB_FIX_VAX_BACKEND
+  if (const_start >= HOST_BITS_PER_WIDE_INT || const_start < 0)
+    return true;
+#endif
   else
     {
       unsigned HOST_WIDE_INT mask

Index: src/external/gpl3/gcc/dist/gcc/function.c
diff -u src/external/gpl3/gcc/dist/gcc/function.c:1.1.1.17.2.1 src/external/gpl3/gcc/dist/gcc/function.c:1.1.1.17.2.2
--- src/external/gpl3/gcc/dist/gcc/function.c:1.1.1.17.2.1	Thu Jul 13 09:18:18 2023
+++ src/external/gpl3/gcc/dist/gcc/function.c	Sun Oct  8 14:35:18 2023
@@ -1720,6 +1720,27 @@ instantiate_virtual_regs_in_insn (rtx_in
 	  break;
 
 	case SUBREG:
+#ifdef NB_FIX_VAX_BACKEND
+	  if (MEM_P (XEXP (x, 0)))
+	    {
+	      /* convert a subreg of a MEMORY operand into a
+		 register operand */
+	      rtx mx = XEXP (x, 0); /* memory operand */
+	      rtx addr = XEXP (mx, 0);
+	      instantiate_virtual_regs_in_rtx (&addr);
+	      start_sequence ();
+	      mx = replace_equiv_address (mx, addr, true);
+	      addr = force_reg (GET_MODE (addr), addr);
+	      mx = replace_equiv_address (mx, addr, true);
+	      seq = get_insns ();
+	      end_sequence ();
+	      if (seq)
+		emit_insn_before (seq, insn);
+
+	      /* generate a new subreg expression */
+	      x = gen_rtx_SUBREG (GET_MODE (x), mx, SUBREG_BYTE (x));
+	    }
+#endif
 	  new_rtx = instantiate_new_reg (SUBREG_REG (x), &offset);
 	  if (new_rtx == NULL)
 	    continue;
@@ -1822,6 +1843,15 @@ instantiate_decl_rtl (rtx x)
       return;
     }
 
+#ifdef NB_FIX_VAX_BACKEND
+  /* If this is a SUBREG, recurse for the pieces */
+  if (GET_CODE (x) == SUBREG)
+    {
+      instantiate_decl_rtl (XEXP (x, 0));
+      return;
+    }
+#endif
+
   /* If this is not a MEM, no need to do anything.  Similarly if the
      address is a constant or a register that is not a virtual register.  */
   if (!MEM_P (x))

Index: src/external/gpl3/gcc/dist/gcc/recog.c
diff -u src/external/gpl3/gcc/dist/gcc/recog.c:1.1.1.12 src/external/gpl3/gcc/dist/gcc/recog.c:1.1.1.12.6.1
--- src/external/gpl3/gcc/dist/gcc/recog.c:1.1.1.12	Sat Apr 10 22:09:26 2021
+++ src/external/gpl3/gcc/dist/gcc/recog.c	Sun Oct  8 14:35:18 2023
@@ -992,7 +992,12 @@ general_operand (rtx op, machine_mode mo
 	 ??? This is a kludge.  */
       if (!reload_completed
 	  && maybe_ne (SUBREG_BYTE (op), 0)
-	  && MEM_P (sub))
+	  && MEM_P (sub)
+#ifdef NB_FIX_VAX_BACKEND
+	  && (maybe_gt (SUBREG_BYTE (op), GET_MODE_SIZE (GET_MODE (sub)))
+	      || !multiple_p (SUBREG_BYTE (op), GET_MODE_SIZE (mode)))
+#endif
+	 )
 	return 0;
 
       if (REG_P (sub)

Index: src/external/gpl3/gcc/dist/gcc/reload.c
diff -u src/external/gpl3/gcc/dist/gcc/reload.c:1.12 src/external/gpl3/gcc/dist/gcc/reload.c:1.12.2.1
--- src/external/gpl3/gcc/dist/gcc/reload.c:1.12	Fri Jul 22 20:22:34 2022
+++ src/external/gpl3/gcc/dist/gcc/reload.c	Sun Oct  8 14:35:18 2023
@@ -4529,6 +4529,50 @@ find_reloads (rtx_insn *insn, int replac
       }
   }
 
+#if NB_FIX_VAX_BACKEND
+  /*
+   * Scan the reloads again looking for a case where there is
+   * precisely one RELOAD_FOR_OPERAND_ADDRESS reload and one
+   * RELOAD_FOR_OPADDR_ADDR reload BUT they are for different
+   * operands.  choose_reload_regs assumes that the
+   * RELOAD_FOR_OPADDR_ADDR and RELOAD_FOR_OPERAND_ADDRESS reloads are
+   * a pair operating on the same operand and will choose the same
+   * register for both, which is not what is wanted.
+   */
+  {
+    int n_operand_address_reloads = 0,
+	n_opaddr_addr_reloads = 0;
+    int reloadnum_for_operand_address_reload = -1,
+	reloadnum_for_opaddr_addr_reload = -1;
+
+    for (i = 0; i < n_reloads; i++)
+      {
+	switch (rld[i].when_needed)
+	  {
+	  case RELOAD_FOR_OPADDR_ADDR:
+	    n_opaddr_addr_reloads++;
+	    reloadnum_for_opaddr_addr_reload = i;
+	    break;
+	  case RELOAD_FOR_OPERAND_ADDRESS:
+	    n_operand_address_reloads++;
+	    reloadnum_for_operand_address_reload = i;
+	    break;
+	  default:
+	    break;
+	  }
+      }
+
+    if (n_operand_address_reloads == 1
+	&& n_opaddr_addr_reloads == 1
+	&& rld[reloadnum_for_opaddr_addr_reload].opnum
+	   != rld[reloadnum_for_operand_address_reload].opnum)
+      {
+	rld[reloadnum_for_opaddr_addr_reload].when_needed
+	= RELOAD_FOR_OPERAND_ADDRESS;
+      }
+  }
+#endif
+
   /* See if we have any reloads that are now allowed to be merged
      because we've changed when the reload is needed to
      RELOAD_FOR_OPERAND_ADDRESS or RELOAD_FOR_OTHER_ADDRESS.  Only
Index: src/external/gpl3/gcc/dist/gcc/rtlanal.c
diff -u src/external/gpl3/gcc/dist/gcc/rtlanal.c:1.12 src/external/gpl3/gcc/dist/gcc/rtlanal.c:1.12.2.1
--- src/external/gpl3/gcc/dist/gcc/rtlanal.c:1.12	Fri Jul 22 20:22:34 2022
+++ src/external/gpl3/gcc/dist/gcc/rtlanal.c	Sun Oct  8 14:35:18 2023
@@ -2953,6 +2953,15 @@ may_trap_p_1 (const_rtx x, unsigned flag
       /* These operations don't trap even with floating point.  */
       break;
 
+    case SIGN_EXTRACT:
+      if (targetm.have_extv ())
+	return targetm.bitfield_may_trap_p (x, flags);
+      break;
+    case ZERO_EXTRACT:
+      if (targetm.have_extzv ())
+	return targetm.bitfield_may_trap_p (x, flags);
+      break;
+
     default:
       /* Any floating arithmetic may trap.  */
       if (FLOAT_MODE_P (GET_MODE (x)) && flag_trapping_math)

Index: src/external/gpl3/gcc/dist/gcc/target.def
diff -u src/external/gpl3/gcc/dist/gcc/target.def:1.1.1.10 src/external/gpl3/gcc/dist/gcc/target.def:1.1.1.10.2.1
--- src/external/gpl3/gcc/dist/gcc/target.def:1.1.1.10	Fri Jul 22 19:52:55 2022
+++ src/external/gpl3/gcc/dist/gcc/target.def	Sun Oct  8 14:35:18 2023
@@ -3919,6 +3919,20 @@ passed along.",
  int, (const_rtx x, unsigned flags),
  default_unspec_may_trap_p)
 
+/* Return nonzero if evaluating SIGN_EXTRACT X or ZERO_EXTRACT X might
+   cause a trap.  FLAGS has the same meaning as in rtlanal.c:
+   may_trap_p_1. */
+DEFHOOK
+(bitfield_may_trap_p,
+ "This target hook returns nonzero if @var{x}, an @code{sign_extract} or\n\
+@code{zero_extract} operation, might cause a trap.  Targets can use\n\
+this hook to enhance precision of analysis for @code{sign_extract} and\n\
+@code{zero_extract} operations.  You may call @code{may_trap_p_1}\n\
+to analyze inner elements of @var{x} in which case @var{flags} should be\n\
+passed along.",
+ int, (const_rtx x, unsigned flags),
+ default_bitfield_may_trap_p)
+
 /* Given a register, this hook should return a parallel of registers
    to represent where to find the register pieces.  Define this hook
    if the register and its mode are represented in Dwarf in

Index: src/external/gpl3/gcc/dist/gcc/targhooks.c
diff -u src/external/gpl3/gcc/dist/gcc/targhooks.c:1.10 src/external/gpl3/gcc/dist/gcc/targhooks.c:1.10.6.1
--- src/external/gpl3/gcc/dist/gcc/targhooks.c:1.10	Sun Apr 11 00:02:11 2021
+++ src/external/gpl3/gcc/dist/gcc/targhooks.c	Sun Oct  8 14:35:18 2023
@@ -126,6 +126,12 @@ default_unspec_may_trap_p (const_rtx x, 
   return 0;
 }
 
+int
+default_bitfield_may_trap_p (const_rtx x, unsigned flags)
+{
+  return 0;
+}
+
 machine_mode
 default_promote_function_mode (const_tree type ATTRIBUTE_UNUSED,
 			       machine_mode mode,

Index: src/external/gpl3/gcc/dist/gcc/targhooks.h
diff -u src/external/gpl3/gcc/dist/gcc/targhooks.h:1.1.1.10 src/external/gpl3/gcc/dist/gcc/targhooks.h:1.1.1.10.6.1
--- src/external/gpl3/gcc/dist/gcc/targhooks.h:1.1.1.10	Sat Apr 10 22:09:28 2021
+++ src/external/gpl3/gcc/dist/gcc/targhooks.h	Sun Oct  8 14:35:18 2023
@@ -29,6 +29,7 @@ extern bool default_legitimize_address_d
 extern bool default_const_not_ok_for_debug_p (rtx);
 
 extern int default_unspec_may_trap_p (const_rtx, unsigned);
+extern int default_bitfield_may_trap_p (const_rtx, unsigned);
 extern machine_mode default_promote_function_mode (const_tree, machine_mode,
 							int *, const_tree, int);
 extern machine_mode default_promote_function_mode_always_promote

Index: src/external/gpl3/gcc/dist/gcc/config/vax/builtins.md
diff -u src/external/gpl3/gcc/dist/gcc/config/vax/builtins.md:1.12 src/external/gpl3/gcc/dist/gcc/config/vax/builtins.md:1.12.6.1
--- src/external/gpl3/gcc/dist/gcc/config/vax/builtins.md:1.12	Sun Apr 11 00:02:15 2021
+++ src/external/gpl3/gcc/dist/gcc/config/vax/builtins.md	Sun Oct  8 14:35:18 2023
@@ -32,12 +32,15 @@
 
 (define_expand "ffssi2"
   [(set (match_operand:SI 0 "nonimmediate_operand" "")
-	(ffs:SI (match_operand:SI 1 "general_operand" "")))]
+	(ffs:SI (match_operand:SI 1 "general_operand" "")))
+   (set (cc0)
+	 (compare (match_dup 0) (const_int 0)))
+	 ]
   ""
   "
 {
   rtx label = gen_label_rtx ();
-  emit_insn (gen_ctzsi2 (operands[0], operands[1]));
+  emit_insn (gen_count_zero (operands[0], operands[1]));
   emit_jump_insn (gen_condjump (gen_rtx_NE(VOIDmode, cc0_rtx, const0_rtx), label));
   emit_move_insn (operands[0], constm1_rtx);
   emit_label (label);
@@ -48,7 +51,19 @@
 (define_insn "ctzsi2"
   [(set (match_operand:SI 0 "nonimmediate_operand" "=rQ")
 	(ctz:SI (match_operand:SI 1 "general_operand" "nrQT")))
-   (set (cc0) (match_dup 0))]
+    (set (cc0)
+	 (compare (match_dup 0) (const_int 0)))
+   ]
+  ""
+  "ffs $0,$32,%1,%0\;tstl %0")
+
+(define_insn "count_zero"
+  [ (set (match_operand:SI 0 "nonimmediate_operand" "")
+         (ctz:SI (match_operand:SI 1 "general_operand" "")))
+    (set (cc0)
+	 (compare (match_dup 0)
+		  (const_int 33)))
+  ]
   ""
   "ffs $0,$32,%1,%0")
 
@@ -67,7 +82,7 @@
 
   label = gen_label_rtx ();
   emit_move_insn (operands[0], const1_rtx);
-  emit_jump_insn (gen_jbbssi<mode> (operands[1], const0_rtx, label, operands[1]));
+  emit_jump_insn (gen_jbbssi<mode> (operands[1], const0_rtx, label));
   emit_move_insn (operands[0], const0_rtx);
   emit_label (label);
   DONE;
@@ -77,13 +92,13 @@
   [(parallel
     [(set (pc)
 	  (if_then_else
-	    (ne (zero_extract:SI (match_operand:QI 0 "volatile_mem_operand" "g")
+	    (ne (zero_extract:SI (match_operand:QI 0 "volatile_mem_operand" "+g")
 				 (const_int 1)
 				 (match_operand:SI 1 "general_operand" "nrm"))
 		(const_int 0))
 	    (label_ref (match_operand 2 "" ""))
 	    (pc)))
-     (set (zero_extract:SI (match_operand:QI 3 "volatile_mem_operand" "+0")
+     (set (zero_extract:SI (match_dup 0)
 			   (const_int 1)
 			   (match_dup 1))
 	  (const_int 1))])]
@@ -94,13 +109,13 @@
   [(parallel
     [(set (pc)
 	  (if_then_else
-	    (ne (zero_extract:SI (match_operand:HI 0 "volatile_mem_operand" "Q")
+	    (ne (zero_extract:SI (match_operand:HI 0 "volatile_mem_operand" "+Q")
 				 (const_int 1)
 				 (match_operand:SI 1 "general_operand" "nrm"))
 		(const_int 0))
 	    (label_ref (match_operand 2 "" ""))
 	    (pc)))
-     (set (zero_extract:SI (match_operand:HI 3 "volatile_mem_operand" "+0")
+     (set (zero_extract:SI (match_dup 0)
 			   (const_int 1)
 			   (match_dup 1))
 	  (const_int 1))])]
@@ -111,13 +126,13 @@
   [(parallel
     [(set (pc)
 	  (if_then_else
-	    (ne (zero_extract:SI (match_operand:SI 0 "volatile_mem_operand" "Q")
+	    (ne (zero_extract:SI (match_operand:SI 0 "volatile_mem_operand" "+Q")
 				 (const_int 1)
 				 (match_operand:SI 1 "general_operand" "nrm"))
 		(const_int 0))
 	    (label_ref (match_operand 2 "" ""))
 	    (pc)))
-     (set (zero_extract:SI (match_operand:SI 3 "volatile_mem_operand" "+0")
+     (set (zero_extract:SI (match_dup 0)
 			   (const_int 1)
 			   (match_dup 1))
 	  (const_int 1))])]

Index: src/external/gpl3/gcc/dist/gcc/config/vax/elf.h
diff -u src/external/gpl3/gcc/dist/gcc/config/vax/elf.h:1.11 src/external/gpl3/gcc/dist/gcc/config/vax/elf.h:1.11.6.1
--- src/external/gpl3/gcc/dist/gcc/config/vax/elf.h:1.11	Sun Apr 11 00:02:15 2021
+++ src/external/gpl3/gcc/dist/gcc/config/vax/elf.h	Sun Oct  8 14:35:19 2023
@@ -45,7 +45,9 @@ along with GCC; see the file COPYING3.  
    count pushed by the CALLS and before the start of the saved registers.  */
 #define INCOMING_FRAME_SP_OFFSET 0
 
-/* Offset from the frame pointer register value to the top of the stack.  */
+/* Offset from the frame pointer register value to the DWARF Canonical Frame
+   Address. */
+#undef FRAME_POINTER_CFA_OFFSET
 #define FRAME_POINTER_CFA_OFFSET(FNDECL) 0
 
 /* We use R2-R5 (call-clobbered) registers for exceptions.  */
@@ -56,14 +58,14 @@ along with GCC; see the file COPYING3.  
   gen_rtx_MEM (SImode,							\
 	       plus_constant (Pmode,					\
 			      gen_rtx_REG (Pmode, FRAME_POINTER_REGNUM),\
-			      -4))
+			      -1 * UNITS_PER_WORD))
 
 /* Simple store the return handler into the call frame.  */
 #define EH_RETURN_HANDLER_RTX						\
   gen_rtx_MEM (Pmode,							\
 	       plus_constant (Pmode,					\
 			      gen_rtx_REG (Pmode, FRAME_POINTER_REGNUM),\
-			      16))
+			      RETURN_ADDRESS_OFFSET))
 
 
 /* The VAX wants no space between the case instruction and the jump table.  */
@@ -104,5 +106,5 @@ along with GCC; see the file COPYING3.  
     fputs (integer_asm_op (SIZE, FALSE), FILE);		\
     fprintf (FILE, "%%pcrel%d(", SIZE * 8);		\
     assemble_name (FILE, LABEL);			\
-    fprintf (FILE, "%+d)", SIZE);			\
+    fputc (')', FILE);					\
   } while (0)

Index: src/external/gpl3/gcc/dist/gcc/config/vax/vax.c
diff -u src/external/gpl3/gcc/dist/gcc/config/vax/vax.c:1.22 src/external/gpl3/gcc/dist/gcc/config/vax/vax.c:1.22.6.1
--- src/external/gpl3/gcc/dist/gcc/config/vax/vax.c:1.22	Sun Apr 11 00:02:15 2021
+++ src/external/gpl3/gcc/dist/gcc/config/vax/vax.c	Sun Oct  8 14:35:18 2023
@@ -46,6 +46,7 @@ along with GCC; see the file COPYING3.  
 #include "target-def.h"
 
 static void vax_option_override (void);
+static void vax_init_builtins (void);
 static bool vax_legitimate_address_p (machine_mode, rtx, bool);
 static void vax_file_start (void);
 static void vax_init_libfuncs (void);
@@ -63,6 +64,7 @@ static void vax_trampoline_init (rtx, tr
 static poly_int64 vax_return_pops_args (tree, tree, poly_int64);
 static bool vax_mode_dependent_address_p (const_rtx, addr_space_t);
 static HOST_WIDE_INT vax_starting_frame_offset (void);
+static int vax_bitfield_may_trap_p (const_rtx, unsigned);
 
 /* Initialize the GCC target structure.  */
 #undef TARGET_ASM_ALIGNED_HI_OP
@@ -76,6 +78,9 @@ static HOST_WIDE_INT vax_starting_frame_
 #undef TARGET_INIT_LIBFUNCS
 #define TARGET_INIT_LIBFUNCS vax_init_libfuncs
 
+#undef TARGET_INIT_BUILTINS
+#define TARGET_INIT_BUILTINS vax_init_builtins
+
 #undef TARGET_ASM_OUTPUT_MI_THUNK
 #define TARGET_ASM_OUTPUT_MI_THUNK vax_output_mi_thunk
 #undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
@@ -136,6 +141,9 @@ vax_elf_binds_local_p (const_tree exp)
 #undef TARGET_HAVE_SPECULATION_SAFE_VALUE
 #define TARGET_HAVE_SPECULATION_SAFE_VALUE speculation_safe_value_not_needed
 
+#undef TARGET_BITFIELD_MAY_TRAP_P
+#define TARGET_BITFIELD_MAY_TRAP_P vax_bitfield_may_trap_p
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 /* Set global variables as needed for the options enabled.  */
@@ -147,12 +155,19 @@ vax_option_override (void)
   if (TARGET_G_FLOAT)
     REAL_MODE_FORMAT (DFmode) = &vax_g_format;
 
-  flag_dwarf2_cfi_asm = 0;
-
 #ifdef SUBTARGET_OVERRIDE_OPTIONS
   SUBTARGET_OVERRIDE_OPTIONS;
 #endif
 }
+/* Implement the TARGET_INIT_BUILTINS target hook.  */
+
+static void
+vax_init_builtins (void)
+{
+#ifdef SUBTARGET_INIT_BUILTINS
+  SUBTARGET_INIT_BUILTINS;
+#endif
+}
 
 static void
 vax_add_reg_cfa_offset (rtx insn, int offset, rtx src)
@@ -182,20 +197,28 @@ vax_expand_prologue (void)
   HOST_WIDE_INT size;
   rtx insn;
 
-  offset = 20;
   for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
     if (df_regs_ever_live_p (regno) && !call_used_or_fixed_reg_p (regno))
       {
         mask |= 1 << regno;
-        offset += 4;
       }
 
+  if (crtl->calls_eh_return)
+    {
+      mask |= 0
+	| ( 1 << EH_RETURN_DATA_REGNO(0) )
+	| ( 1 << EH_RETURN_DATA_REGNO(1) )
+	| ( 1 << EH_RETURN_DATA_REGNO(2) )
+	| ( 1 << EH_RETURN_DATA_REGNO(3) )
+	;
+    }
+
   insn = emit_insn (gen_procedure_entry_mask (GEN_INT (mask)));
   RTX_FRAME_RELATED_P (insn) = 1;
 
   /* The layout of the CALLG/S stack frame is follows:
 
-		<- CFA, AP
+		<- AP
 	r11
 	r10
 	...	Registers saved as specified by MASK
@@ -205,16 +228,11 @@ vax_expand_prologue (void)
 	old fp
 	old ap
 	old psw
-	zero
-		<- FP, SP
+	condition handler	<- CFA, FP, SP
+	  (initially zero)
 
      The rest of the prologue will adjust the SP for the local frame.  */
 
-  add_reg_note (insn, REG_CFA_DEF_CFA,
-                plus_constant (Pmode, frame_pointer_rtx, offset));
-  insn = emit_insn (gen_blockage ());
-  RTX_FRAME_RELATED_P (insn) = 1;
-
 #ifdef notyet
   /*
    * We can't do this, the dwarf code asserts and we don't have yet a 
@@ -226,14 +244,21 @@ vax_expand_prologue (void)
   vax_add_reg_cfa_offset (insn, 12, frame_pointer_rtx);
   vax_add_reg_cfa_offset (insn, 16, pc_rtx);
 
-  offset = 20;
+  offset = 5 * UNITS_PER_WORD;	/* PSW, AP &c */
   for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
     if (mask & (1 << regno))
       {
 	vax_add_reg_cfa_offset (insn, offset, gen_rtx_REG (SImode, regno));
-	offset += 4;
+	offset += 1 * UNITS_PER_WORD;
       }
 
+  /* Because add_reg_note pushes the notes, adding this last means that
+     it will be processed first.  This is required to allow the other
+     notes to be interpreted properly.  */
+  /* The RTX here must match the instantiation of the CFA vreg */
+  add_reg_note (insn, REG_CFA_DEF_CFA,
+		plus_constant (Pmode, frame_pointer_rtx,
+			       FRAME_POINTER_CFA_OFFSET(current_function_decl)));
   /* Allocate the local stack frame.  */
   size = get_frame_size ();
   size -= vax_starting_frame_offset ();
@@ -577,7 +602,7 @@ print_operand (FILE *file, rtx x, int co
   else if (code == 'b' && CONST_INT_P (x))
     fprintf (file, "$%d", (int) (0xff & - INTVAL (x)));
   else if (code == 'M' && CONST_INT_P (x))
-    fprintf (file, "$%d", ~((1 << INTVAL (x)) - 1));
+    fprintf (file, "$%d", ((~0) << (INTVAL (x))));
   else if (code == 'x' && CONST_INT_P (x))
     fprintf (file, HOST_WIDE_INT_PRINT_HEX, INTVAL (x));
   else if (REG_P (x))
@@ -1633,13 +1658,67 @@ vax_output_int_subtract (rtx_insn *insn,
 	      {
 		/* Negation is tricky.  It's basically complement and increment.
 		   Negate hi, then lo, and subtract the carry back.  */
-		if ((MEM_P (low[0]) && GET_CODE (XEXP (low[0], 0)) == POST_INC)
-		    || (MEM_P (operands[0])
-			&& GET_CODE (XEXP (operands[0], 0)) == POST_INC))
-		  fatal_insn ("illegal operand detected", insn);
-		output_asm_insn ("mnegl %2,%0", operands);
+
+		/*
+		 * If the source *or* the destination operands are
+		 * indirect memory references with post-increment
+		 * addressing, an memory reference using the base
+		 * register plus an offset must be constructed to
+		 * address the high word of the source or result.
+		 *
+		 * pre-decrement memory references are rejected by the
+		 * illegal_addsub_di_memory_operand predicate
+		 */
+
+		rtx earlyhiw[3];
+
+		/* high word - destination */
+		if (MEM_P (operands[0])
+		    && GET_CODE (XEXP (operands[0], 0)) == POST_INC)
+		  {
+		    const enum machine_mode mode = GET_MODE (operands[0]);
+		    rtx x = XEXP (XEXP (operands[0], 0), 0);
+		    x = plus_constant (Pmode, x, GET_MODE_SIZE (mode));
+		    x = gen_rtx_MEM (mode, x);
+		    earlyhiw[0] = x;
+		  }
+		else
+		  earlyhiw[0] = operands[0];
+
+		earlyhiw[1] = operands[1]; /* easy, this is const0_rtx */
+
+		/* high word - source */
+		if (MEM_P (operands[2])
+		    && GET_CODE (XEXP (operands[2], 0)) == POST_INC)
+		  {
+		    const enum machine_mode mode = GET_MODE (operands[2]);
+		    rtx x = XEXP (XEXP (operands[2], 0), 0);
+		    x = plus_constant (Pmode, x, GET_MODE_SIZE (mode));
+		    x = gen_rtx_MEM (mode, x);
+		    earlyhiw[2] = x;
+		  }
+		else
+		  earlyhiw[2] = operands[2];
+
+		output_asm_insn ("mnegl %2,%0", earlyhiw);
 		output_asm_insn ("mnegl %2,%0", low);
-		return "sbwc $0,%0";
+
+		if (earlyhiw[2] != operands[2])
+		  {
+		    rtx ops[3];
+		    const enum machine_mode mode = GET_MODE (operands[2]);
+
+		    output_asm_insn ("sbwc $0,%0", operands);
+		    /* update the source operand's base register to
+		       point to the following word */
+		    ops[0] = XEXP (XEXP (operands[2], 0), 0);
+		    ops[1] = const0_rtx;
+		    ops[2] = gen_int_mode (GET_MODE_SIZE (mode), SImode);
+		    output_asm_insn ("addl2 %2,%0", ops);
+		    return "";
+		  }
+		else
+		  return "sbwc $0,%0";
 	      }
 	    gcc_assert (rtx_equal_p (operands[0], operands[1]));
 	    gcc_assert (rtx_equal_p (low[0], low[1]));
@@ -2040,6 +2119,46 @@ vax_mode_dependent_address_p (const_rtx 
 }
 
 static rtx
+decompose_address_operand(rtx addr)
+{
+  enum rtx_code code = GET_CODE (addr);
+
+  switch (code)
+    {
+    case CONST:
+      return decompose_address_operand (XEXP (addr, 0));
+    case PLUS:
+    case MULT:
+      {
+	rtx op0, op1;
+	rtx temp;
+	/*
+	 * Generate a temporary register, assign the result of
+	 * decomposing op0 to it, then generate an op code opping (PLUS
+	 * or MULT) the result of decomposing op1 to it.
+	 * Return the temporary register.
+	 */
+	temp = gen_reg_rtx (Pmode);
+	op0 = decompose_address_operand (XEXP (addr, 0));
+	op1 = decompose_address_operand (XEXP (addr, 1));
+
+	emit_move_insn (temp, op0);
+
+	if (code == PLUS)
+	  temp = gen_rtx_PLUS (Pmode, temp, op1);
+	else if (code == MULT)
+	  temp = gen_rtx_MULT (Pmode, temp, op1);
+
+	return temp;
+      }
+      break;
+    default:
+      break;
+    }
+  return addr;
+}
+
+static rtx
 fixup_mathdi_operand (rtx x, machine_mode mode)
 {
   if (illegal_addsub_di_memory_operand (x, mode))
@@ -2054,7 +2173,7 @@ fixup_mathdi_operand (rtx x, machine_mod
 	  addr = XEXP (XEXP (addr, 0), 0);
 	}
 #endif
-      emit_move_insn (temp, addr);
+      emit_move_insn (temp, decompose_address_operand (addr));
       if (offset)
 	temp = gen_rtx_PLUS (Pmode, temp, offset);
       x = gen_rtx_MEM (DImode, temp);
@@ -2393,3 +2512,34 @@ vax_decomposed_dimode_operand_p (rtx lo,
 
   return rtx_equal_p(lo, hi) && lo_offset + 4 == hi_offset;
 }
+
+/* Return 1 if a bitfield instruction (extv/extzv) may trap */
+static int
+vax_bitfield_may_trap_p (const_rtx x, unsigned flags)
+{
+  /* per the VARM
+   * Bitfield instructions may trap if
+   * size (arg1) GTRU 32
+   * size (arg1) NEQ 0, pos (arg 2) GTRU 31 and the field is in a register
+   * i.e. REG_P(operands[0]) is true
+   *
+   * GCC can only determine that a bitfield instruction will not trap
+   * if the size and position arguments are constants; if they aren't,
+   * the instruction must be assumed to trap.
+   */
+  rtx field = XEXP (x, 0);
+  rtx size = XEXP (x, 1);
+  rtx pos = XEXP (x, 2);
+  int retval = 0;
+
+  if (!CONST_INT_P (size) || !CONST_INT_P (pos))
+    retval = 1;
+  else if (INTVAL (size) < 0 || INTVAL (size) > GET_MODE_BITSIZE ( SImode ))
+    retval = 1;
+  else if (REG_P (field) && INTVAL (size) != 0
+	   && (INTVAL (pos) < 0 || INTVAL (pos) >= GET_MODE_BITSIZE ( SImode )))
+    retval = 1;
+  else
+    retval = 0;
+  return retval;
+}

Index: src/external/gpl3/gcc/dist/gcc/config/vax/vax.md
diff -u src/external/gpl3/gcc/dist/gcc/config/vax/vax.md:1.17 src/external/gpl3/gcc/dist/gcc/config/vax/vax.md:1.17.6.1
--- src/external/gpl3/gcc/dist/gcc/config/vax/vax.md:1.17	Sun Apr 11 01:38:05 2021
+++ src/external/gpl3/gcc/dist/gcc/config/vax/vax.md	Sun Oct  8 14:35:18 2023
@@ -33,6 +33,8 @@
 			    ; insn in the code.
   VUNSPEC_SYNC_ISTREAM      ; sequence of insns to sync the I-stream
   VUNSPEC_PEM		    ; 'procedure_entry_mask' insn.
+
+  VUNSPEC_EH_RETURN
 ])
 
 (define_constants
@@ -438,7 +440,7 @@
   "vax_expand_addsub_di_operands (operands, MINUS); DONE;")
 
 (define_insn "sbcdi3"
-  [(set (match_operand:DI 0 "nonimmediate_addsub_di_operand" "=Rr,Rr")
+  [(set (match_operand:DI 0 "nonimmediate_addsub_di_operand" "=&Rr,&Rr")
 	(minus:DI (match_operand:DI 1 "general_addsub_di_operand" "0,I")
 		  (match_operand:DI 2 "general_addsub_di_operand" "nRr,Rr")))]
   "TARGET_QMATH"
@@ -731,7 +733,7 @@
 	(minus:QI (const_int 32)
 		  (match_dup 4)))
    (set (match_operand:SI 0 "nonimmediate_operand" "=g")
-	(zero_extract:SI (match_operand:SI 1 "register_operand" "r")
+	(zero_extract:SI (match_operand:SI 1 "general_operand" "g")
 			 (match_dup 3)
 			 (match_operand:SI 2 "register_operand" "g")))]
   ""
@@ -739,6 +741,10 @@
 {
   operands[3] = gen_reg_rtx (QImode);
   operands[4] = gen_lowpart (QImode, operands[2]);
+  operands[4] = gen_rtx_MINUS (QImode, GEN_INT (32), operands[4]);
+  emit_move_insn (operands[3], operands[4]);
+  emit_insn (gen_extzv (operands[0], operands[1], operands[3], operands[2]));
+  DONE;
 }")
 
 ;; Rotate right on the VAX works by negating the shift count.
@@ -821,32 +827,87 @@
   return \"movw %3,%0\";
 }")
 
-(define_insn ""
-  [(set (match_operand:SI 0 "nonimmediate_operand" "=&g")
-	(zero_extract:SI (match_operand:SI 1 "register_operand" "ro")
+;;
+;; Register source, field width is either 8 or 16, field start
+;; is zero - simple, this is a mov[bl].
+;;
+(define_insn "*extzvQISI"
+  [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
+	(zero_extract:SI (match_operand:SI 1 "register_operand" "r")
 			 (match_operand:QI 2 "const_int_operand" "n")
 			 (match_operand:SI 3 "const_int_operand" "n")))]
-  "(INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16)
+  "INTVAL (operands[3]) == 0
+    && INTVAL (operands[2]) == GET_MODE_BITSIZE ( QImode )"
+  "movzbl %1, %0"
+)
+
+(define_insn "*extzvHISI"
+  [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
+	(zero_extract:SI (match_operand:SI 1 "register_operand" "r")
+			 (match_operand:QI 2 "const_int_operand" "n")
+			 (match_operand:SI 3 "const_int_operand" "n")))]
+  "INTVAL (operands[3]) == 0
+    && INTVAL (operands[2]) == GET_MODE_BITSIZE ( HImode )"
+  "movzwl %1, %0"
+)
+
+;;
+;; Register source, field width is the entire register
+;;
+(define_insn "*extzvSISI"
+  [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
+	(zero_extract:SI (match_operand:SI 1 "register_operand" "r")
+			 (match_operand:QI 2 "const_int_operand" "n")
+			 (match_operand:SI 3 "const_int_operand" "n")
+
+			 ))]
+  "INTVAL (operands[3]) == 0
+   && INTVAL (operands[2]) == GET_MODE_BITSIZE ( SImode )"
+  "*
+{
+  if (rtx_equal_p (operands[0], operands[1]))
+    return \"\";  /* no-op */
+  return \"movl %1,%0\";
+}")
+
+;; Register source, non-zero field start is handled elsewhere
+
+;; Offsettable memory, field width 8 or 16, field start on
+;; boundary matching the field width.
+
+(define_insn "*extzvQISI2"
+  [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
+	(zero_extract:SI (match_operand:SI 1 "memory_operand" "o")
+			 (match_operand:QI 2 "const_int_operand" "n")
+			 (match_operand:SI 3 "const_int_operand" "n")))]
+  "INTVAL (operands[2]) == 8
    && INTVAL (operands[3]) % INTVAL (operands[2]) == 0
-   && (REG_P (operands[1])
-       || (MEM_P (operands[1])
-          && ! mode_dependent_address_p (XEXP (operands[1], 0),
-				      MEM_ADDR_SPACE (operands[1]))))"
+   && ! mode_dependent_address_p (XEXP (operands[1], 0),
+				  MEM_ADDR_SPACE (operands[1]))"
   "*
 {
-  if (REG_P (operands[1]))
-    {
-      if (INTVAL (operands[3]) != 0)
-	return \"extzv %3,%2,%1,%0\";
-    }
-  else
-    operands[1]
-      = adjust_address (operands[1],
-			INTVAL (operands[2]) == 8 ? QImode : HImode,
-			INTVAL (operands[3]) / 8);
+  operands[1]
+    = adjust_address (operands[1],
+		      QImode,
+		      INTVAL (operands[3]) / 8);
+  return \"movzbl %1,%0\";
+}")
 
-  if (INTVAL (operands[2]) == 8)
-    return \"movzbl %1,%0\";
+(define_insn "*extzvHISI2"
+  [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
+	(zero_extract:SI (match_operand:SI 1 "memory_operand" "o")
+			 (match_operand:QI 2 "const_int_operand" "n")
+			 (match_operand:SI 3 "const_int_operand" "n")))]
+  "INTVAL (operands[2]) == 16
+   && INTVAL (operands[3]) % INTVAL (operands[2]) == 0
+   && ! mode_dependent_address_p (XEXP (operands[1], 0),
+				  MEM_ADDR_SPACE (operands[1]))"
+  "*
+{
+  operands[1]
+    = adjust_address (operands[1],
+                      HImode,
+                      INTVAL (operands[3]) / 8);
   return \"movzwl %1,%0\";
 }")
 
@@ -923,17 +984,26 @@
   return \"rotl %R3,%1,%0\;cvtwl %0,%0\";
 }")
 
+;; When the field position and size are constant and the destination
+;; is a register, extv and extzv are much slower than a rotate followed
+;; by a bicl or sign extension.  Because we might end up choosing ext[z]v
+;; anyway, we can't allow immediate values for the primary source operand.
+
+;; Because some of the instruction sequences generated by this pattern
+;; overwrite the output operand part way through, the output operand
+;; must be marked earlyclobber, may only be a register or memory
+;; operand and must not have any side effects (e.g. pre/post increment)
+;;
 (define_insn ""
-  [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
-	(zero_extract:SI (match_operand:SI 1 "register_operand" "ro")
-			 (match_operand:QI 2 "general_operand" "g")
-			 (match_operand:SI 3 "general_operand" "nrmT")))]
-  ""
+  [(set (match_operand:SI 0 "nonimmediate_operand" "=&ro")
+	(zero_extract:SI (match_operand:SI 1 "register_operand" "r")
+			 (match_operand:QI 2 "const_int_operand" "n")
+			 (match_operand:SI 3 "const_int_operand" "n")
+
+			 ))]
+  "INTVAL (operands[3]) != 0"
   "*
 {
-  if (! CONST_INT_P (operands[3]) || ! CONST_INT_P (operands[2])
-      || ! REG_P (operands[0]))
-    return \"extzv %3,%2,%1,%0\";
   if (INTVAL (operands[2]) == 8)
     return \"rotl %R3,%1,%0\;movzbl %0,%0\";
   if (INTVAL (operands[2]) == 16)
@@ -941,7 +1011,14 @@
   if (INTVAL (operands[3]) & 31)
     return \"rotl %R3,%1,%0\;bicl2 %M2,%0\";
   if (rtx_equal_p (operands[0], operands[1]))
-    return \"bicl2 %M2,%0\";
+    {
+      if (INTVAL (operands[2]) == 32)
+	return \"\";  /* no-op */
+      else
+	return \"bicl2 %M2,%0\";
+    }
+  if (INTVAL (operands[2]) == 32)
+    return \"movl %1,%0\";
   return \"bicl3 %M2,%1,%0\";
 }")
 
@@ -969,7 +1046,40 @@
   ""
   "cmpzv %2,%1,%0,%3")
 
-(define_insn "extv"
+(define_expand "extv"
+  [(set (match_operand:SI 0 "general_operand" "")
+	(sign_extract:SI (match_dup 4)
+			 (match_operand:QI 2 "general_operand" "")
+			 (match_operand:SI 3 "general_operand" ""))
+   )]
+  ""
+  "{
+      /*
+       * If the source operand is a memory reference, and the address
+       * is a symbol, and we're in PIC mode, load the address into a
+       * register.  Don't evaluate the field start or width at this time.
+       */
+      operands[4] = operands[1];
+      if (flag_pic
+       /* && !reload_completed */
+	  && MEM_P (operands[1])
+	  && !mode_dependent_address_p (XEXP (operands[1], 0),
+					MEM_ADDR_SPACE (operands[1]))
+          && SYMBOL_REF_P (XEXP (operands[1], 0))
+	  && !SYMBOL_REF_LOCAL_P (XEXP (operands[1], 0))
+	 )
+	{
+	  rtx address = XEXP (operands[1], 0);
+	  rtx temp = gen_reg_rtx (Pmode);
+	  emit_move_insn (temp, address);
+	  /* copy the original memory reference, replacing the address */
+	  operands[4] = change_address (operands[1], VOIDmode, temp);
+	  set_mem_align (operands[4], MEM_ALIGN (operands[1]));
+	}
+  }"
+)
+
+(define_insn ""
   [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
 	(sign_extract:SI (match_operand:QI 1 "memory_operand" "m")
 			 (match_operand:QI 2 "general_operand" "g")
@@ -995,13 +1105,70 @@
   [(set (match_operand:SI 0 "general_operand" "")
 	(zero_extract:SI (match_operand:SI 1 "general_operand" "")
 			 (match_operand:QI 2 "general_operand" "")
-			 (match_operand:SI 3 "general_operand" "")))]
+			 (match_operand:SI 3 "general_operand" ""))
+   )]
   ""
-  "")
+  "{
+    if (CONST_INT_P (operands[1]))
+      {
+	/*
+	 * extzv of a constant doesn't work, so load the constant
+	 * into a register.
+	 */
+	rtx temp = gen_reg_rtx (SImode);
+	emit_move_insn (temp, operands[1]);
+	operands[1] = temp;
+      }
+
+
+    /*
+     * If the source operand is a memory reference, and the address
+     * is a symbol, and we're in PIC mode, load the address into a
+     * register.  Don't evaluate the field start or width at this time.
+     */
+    if (flag_pic
+     /*	&& !reload_completed */
+	&& MEM_P (operands[1])
+	&& !mode_dependent_address_p (XEXP (operands[1], 0),
+				      MEM_ADDR_SPACE (operands[1]))
+	&& SYMBOL_REF_P (XEXP (operands[1], 0))
+	&& !SYMBOL_REF_LOCAL_P (XEXP (operands[1], 0))
+       )
+      {
+	rtx address = XEXP (operands[1], 0);
+	rtx temp = gen_reg_rtx (Pmode);
+	emit_move_insn (temp, address);
+	/* copy the original memory reference, replacing the address */
+	operands[1] = change_address (operands[1], VOIDmode, temp);
+	set_mem_align (operands[1], MEM_ALIGN (operands[1]));
+      }
+    else
+      if ((MEM_P (operands[1]) && !CONST_INT_P (operands[2]))
+	  || SUBREG_P (operands[1])
+	 )
+	{
+	  /* Memory addresses for extzv are bytes, so load the source
+	     operand into a register */
+	  rtx temp = gen_reg_rtx (SImode);
+	  emit_move_insn (temp, operands[1]);
+	  operands[1] = temp;
+	}
+      else if (address_operand (operands[1], SImode))
+	{
+	  operands[1] = force_reg (SImode, operands[1]);
+	}
+
+  }"
+)
+
+;;
+;; Operand 1 must not, under any circumstances, be an indexed operand
+;; as extzv computes indices based on the size of a byte.
+;;
 
 (define_insn ""
-  [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
-	(zero_extract:SI (match_operand:QI 1 "memory_operand" "m")
+  [(set (match_operand:SI 0 "nonimmediate_operand" "=&g")
+	(zero_extract:SI (match_operand:SI 1 "nonimmediate_operand" "rQ")
 			 (match_operand:QI 2 "general_operand" "g")
 			 (match_operand:SI 3 "general_operand" "nrmT")))]
   ""
@@ -1010,10 +1177,7 @@
   if (! REG_P (operands[0]) || ! CONST_INT_P (operands[2])
       || ! CONST_INT_P (operands[3])
       || INTVAL (operands[2]) + INTVAL (operands[3]) > 32
-      || side_effects_p (operands[1])
-      || (MEM_P (operands[1])
-	  && mode_dependent_address_p (XEXP (operands[1], 0),
-				       MEM_ADDR_SPACE (operands[1]))))
+      || side_effects_p (operands[1]))
     return \"extzv %3,%2,%1,%0\";
   if (INTVAL (operands[2]) == 8)
     return \"rotl %R3,%1,%0\;movzbl %0,%0\";
@@ -1045,12 +1209,36 @@
 }")
 
 (define_expand "insv"
-  [(set (zero_extract:SI (match_operand:SI 0 "general_operand" "")
+  [(set (zero_extract:SI (match_dup 4)
 			 (match_operand:QI 1 "general_operand" "")
 			 (match_operand:SI 2 "general_operand" ""))
 	(match_operand:SI 3 "general_operand" ""))]
   ""
-  "")
+  "{
+    /*
+     * If the destination operand is a memory reference, and the address
+     * is a symbol, and we're in PIC mode, load the address into a
+     * register.  Don't evaluate the field start or width at this time.
+     */
+    operands[4] = operands[0];
+    if (flag_pic
+     /*	&& !reload_completed */
+	&& MEM_P (operands[0])
+	&& !mode_dependent_address_p (XEXP (operands[0], 0),
+				       MEM_ADDR_SPACE (operands[0]))
+	&& SYMBOL_REF_P (XEXP (operands[0], 0))
+	&& !SYMBOL_REF_LOCAL_P (XEXP (operands[0], 0))
+       )
+      {
+	rtx address = XEXP (operands[0], 0);
+	rtx temp = gen_reg_rtx (Pmode);
+	emit_move_insn (temp, address);
+	/* copy the original memory reference, replacing the address */
+	operands[4] = change_address (operands[0], VOIDmode, temp);
+	set_mem_align (operands[4], MEM_ALIGN (operands[0]));
+      }
+
+  }")
 
 (define_insn ""
   [(set (zero_extract:SI (match_operand:QI 0 "memory_operand" "+g")
@@ -1470,6 +1658,36 @@
   DONE;
 }")
 
+;; Exception handling
+;; This is used when compiling the stack unwinding routines.
+(define_expand "eh_return"
+  [(use (match_operand 0 "general_operand"))]
+  ""
+{
+  if (GET_MODE (operands[0]) != word_mode)
+    operands[0] = convert_to_mode (word_mode, operands[0], 0);
+  emit_insn (gen_eh_set_retaddr (operands[0]));
+  DONE;
+})
+
+(define_insn_and_split "eh_set_retaddr"
+  [(unspec [(match_operand:SI 0 "general_operand")] VUNSPEC_EH_RETURN)
+   (clobber (match_scratch:SI 1 "=&r"))
+   ]
+  ""
+  "#"
+  "reload_completed"
+  [(const_int 0)]
+{
+  /* the return address for the current frame is always at 0x10(%fp) */
+  rtx tmp = plus_constant(Pmode, frame_pointer_rtx, 4 * UNITS_PER_WORD);
+  tmp = gen_rtx_MEM (word_mode, tmp);
+  MEM_VOLATILE_P(tmp) = 1;
+  tmp = gen_rtx_SET(tmp, operands[0]);
+  emit_insn(tmp);
+  DONE;
+})
+
 (define_insn "nop"
   [(const_int 0)]
   ""

Index: src/external/gpl3/gcc/dist/gcc/doc/tm.texi
diff -u src/external/gpl3/gcc/dist/gcc/doc/tm.texi:1.1.1.13 src/external/gpl3/gcc/dist/gcc/doc/tm.texi:1.1.1.13.2.1
--- src/external/gpl3/gcc/dist/gcc/doc/tm.texi:1.1.1.13	Fri Jul 22 19:53:12 2022
+++ src/external/gpl3/gcc/dist/gcc/doc/tm.texi	Sun Oct  8 14:35:19 2023
@@ -11803,6 +11803,15 @@ to analyze inner elements of @var{x} in 
 passed along.
 @end deftypefn
 
+@deftypefn {Target Hook} int TARGET_BITFIELD_MAY_TRAP_P (const_rtx @var{x}, unsigned @var{flags})
+This target hook returns nonzero if @var{x}, an @code{sign_extract} or
+@code{zero_extract} operation, might cause a trap.  Targets can use
+this hook to enhance precision of analysis for @code{sign_extract} and
+@code{zero_extract} operations.  You may call @code{may_trap_p_1}
+to analyze inner elements of @var{x} in which case @var{flags} should be
+passed along.
+@end deftypefn
+
 @deftypefn {Target Hook} void TARGET_SET_CURRENT_FUNCTION (tree @var{decl})
 The compiler invokes this hook whenever it changes its current function
 context (@code{cfun}).  You can define this function if

Index: src/external/gpl3/gcc/dist/gcc/doc/tm.texi.in
diff -u src/external/gpl3/gcc/dist/gcc/doc/tm.texi.in:1.1.1.12 src/external/gpl3/gcc/dist/gcc/doc/tm.texi.in:1.1.1.12.2.1
--- src/external/gpl3/gcc/dist/gcc/doc/tm.texi.in:1.1.1.12	Fri Jul 22 19:53:12 2022
+++ src/external/gpl3/gcc/dist/gcc/doc/tm.texi.in	Sun Oct  8 14:35:19 2023
@@ -7979,6 +7979,8 @@ to by @var{ce_info}.
 
 @hook TARGET_UNSPEC_MAY_TRAP_P
 
+@hook TARGET_BITFIELD_MAY_TRAP_P
+
 @hook TARGET_SET_CURRENT_FUNCTION
 
 @defmac TARGET_OBJECT_SUFFIX

Index: src/external/gpl3/gcc/lib/Makefile.sanitizer
diff -u src/external/gpl3/gcc/lib/Makefile.sanitizer:1.16 src/external/gpl3/gcc/lib/Makefile.sanitizer:1.16.6.1
--- src/external/gpl3/gcc/lib/Makefile.sanitizer:1.16	Tue Sep 15 05:19:34 2020
+++ src/external/gpl3/gcc/lib/Makefile.sanitizer	Sun Oct  8 14:35:19 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.sanitizer,v 1.16 2020/09/15 05:19:34 mrg Exp $
+#	$NetBSD: Makefile.sanitizer,v 1.16.6.1 2023/10/08 14:35:19 martin Exp $
 
 SANITIZER=${GCCDIST}/libsanitizer
 .PATH: ${SANITIZER}/interception ${SANITIZER}/sanitizer_common
@@ -88,22 +88,3 @@ COPTS+=-fno-builtin -fno-exceptions -fno
 
 # Can't profile without it`
 #-fomit-frame-pointer
-
-.if ${MACHINE_ARCH} == "vax"
-COPTS.sanitizer_allocator.cc += -O1
-COPTS.sanitizer_common.cc += -O1
-COPTS.sanitizer_common_libcdep.cc += -O1
-COPTS.sanitizer_coverage_libcdep.cc += -O1
-COPTS.sanitizer_coverage_mapping_libcdep.cc += -O1
-COPTS.sanitizer_deadlock_detector1.cc += -O1
-COPTS.sanitizer_mac.cc += -O1
-COPTS.sanitizer_netbsd.cc += -O1
-COPTS.sanitizer_posix.cc += -O1
-COPTS.sanitizer_printf.cc += -O1
-COPTS.sanitizer_procmaps_common.cc += -O1
-COPTS.sanitizer_stackdepot.cc += -O1
-COPTS.sanitizer_symbolizer_libcdep.cc += -O1
-COPTS.sanitizer_symbolizer_report.cc += -O1
-COPTS.ubsan_diag.cc += -O1
-COPTS.ubsan_init.cc += -O1
-.endif

Index: src/external/gpl3/gcc/lib/libasan/Makefile
diff -u src/external/gpl3/gcc/lib/libasan/Makefile:1.33 src/external/gpl3/gcc/lib/libasan/Makefile:1.33.6.1
--- src/external/gpl3/gcc/lib/libasan/Makefile:1.33	Mon Sep 14 15:01:57 2020
+++ src/external/gpl3/gcc/lib/libasan/Makefile	Sun Oct  8 14:35:22 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.33 2020/09/14 15:01:57 kamil Exp $
+# $NetBSD: Makefile,v 1.33.6.1 2023/10/08 14:35:22 martin Exp $
 
 UNSUPPORTED_COMPILER.clang=	# defined
 NOSANITIZER=	# defined
@@ -49,14 +49,6 @@ LIBDPLIBS+= m  ${NETBSDSRCDIR}/lib/libm
 LIBDPLIBS+= pthread ${NETBSDSRCDIR}/lib/libpthread
 CPPFLAGS+=-DCAN_SANITIZE_UB=0
 
-.if ${MACHINE_ARCH} == "vax"
-COPTS.asan_allocator.cc += -O1
-COPTS.asan_report.cc += -O1
-COPTS.sanitizer_file.cc += -O1
-COPTS.ubsan_diag.cc += -O1
-COPTS.ubsan_init.cc += -O1
-.endif
-
 .if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
 COPTS.asan_interceptors.cc += -O1
 .endif

Index: src/external/gpl3/gcc/lib/liblsan/Makefile
diff -u src/external/gpl3/gcc/lib/liblsan/Makefile:1.8 src/external/gpl3/gcc/lib/liblsan/Makefile:1.8.6.1
--- src/external/gpl3/gcc/lib/liblsan/Makefile:1.8	Mon Sep 14 15:01:57 2020
+++ src/external/gpl3/gcc/lib/liblsan/Makefile	Sun Oct  8 14:35:24 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2020/09/14 15:01:57 kamil Exp $
+# $NetBSD: Makefile,v 1.8.6.1 2023/10/08 14:35:24 martin Exp $
 
 .include <bsd.own.mk>
 
@@ -16,11 +16,6 @@ LSAN_SRCS+= \
 	lsan_linux.cc \
 	lsan_thread.cc
 
-.if ${MACHINE_ARCH} == "vax"
-COPTS.lsan_allocator.cc += -O1
-COPTS.sanitizer_file.cc += -O1
-.endif
-
 LIB=	lsan
 SRCS+=	${LSAN_SRCS}
 LIBDPLIBS+= m ${NETBSDSRCDIR}/lib/libm

Index: src/external/gpl3/gcc/lib/libubsan/Makefile
diff -u src/external/gpl3/gcc/lib/libubsan/Makefile:1.19 src/external/gpl3/gcc/lib/libubsan/Makefile:1.19.6.1
--- src/external/gpl3/gcc/lib/libubsan/Makefile:1.19	Mon Apr 12 00:05:56 2021
+++ src/external/gpl3/gcc/lib/libubsan/Makefile	Sun Oct  8 14:35:20 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.19 2021/04/12 00:05:56 mrg Exp $
+#	$NetBSD: Makefile,v 1.19.6.1 2023/10/08 14:35:20 martin Exp $
 
 UNSUPPORTED_COMPILER.clang=	# defined
 LIBISCXX = yes
@@ -26,10 +26,6 @@ UBSAN_SRCS= \
 COPTS.${_s}.cc+=-frtti
 .endfor
 
-.if ${MACHINE_ARCH} == "vax"
-COPTS.sanitizer_file.cc += -O1
-.endif
-
 LIB=	ubsan
 SRCS+=	${UBSAN_SRCS}
 LIBDPLIBS+= m ${NETBSDSRCDIR}/lib/libm

Index: src/external/gpl3/gcc/usr.bin/backend/Makefile
diff -u src/external/gpl3/gcc/usr.bin/backend/Makefile:1.66.2.1 src/external/gpl3/gcc/usr.bin/backend/Makefile:1.66.2.2
--- src/external/gpl3/gcc/usr.bin/backend/Makefile:1.66.2.1	Sun May 28 09:47:27 2023
+++ src/external/gpl3/gcc/usr.bin/backend/Makefile	Sun Oct  8 14:35:19 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.66.2.1 2023/05/28 09:47:27 martin Exp $
+#	$NetBSD: Makefile,v 1.66.2.2 2023/10/08 14:35:19 martin Exp $
 
 HOSTPROG_CXX=	1
 LIBISPRIVATE=	yes
@@ -533,68 +533,9 @@ COPTS.insn-recog.c+=-Wno-error
 
 .if ${GCC_MACHINE_ARCH} == "vax"
 CPPFLAGS+=-I${.CURDIR}/../../lib/libgcc/libgcov/arch/${GCC_MACHINE_ARCH}
-COPTS.builtins.c+=-O0
-COPTS.calls.c+=-O0
-COPTS.convert.c+=-O0
-COPTS.data-streamer-out.c+=-O0
-COPTS.dse.c+=-O0					# XXX port-vax/51967
-COPTS.dwarf2out.c+=-O0
-COPTS.expmed.c+=-O0
-COPTS.expr.c+=-O0 -Wno-error=tautological-compare
-COPTS.fixed-value.c+=-O0
-COPTS.fold-const.c+=-O0
-COPTS.generic-match.c+=-O0
-COPTS.gimple-fold.c+=-O0
-COPTS.gimple-match.c+=-O0
-COPTS.gimple-ssa-strength-reduction.c+=-O0
-COPTS.gimple-ssa-warn-restrict.c+=-O0
-COPTS.gimple.c+=-O0
-COPTS.internal-fn.c+=-O0
-COPTS.lto-streamer-out.c+=-O0
-COPTS.omp-low.c+=-O0
-COPTS.predict.c+=-O0
-COPTS.range-op.cc+=-O0
-COPTS.recog.c+=-O0
-COPTS.sanopt.c+=-O0
-COPTS.stmt.c+=-O0
-COPTS.stor-layout.c+=-O0
-COPTS.targhooks.c+=-O0
-COPTS.tree-affine.c+=-O0
-COPTS.tree-cfg.c+=-O0
-COPTS.tree-data-ref.c+=-O0
-COPTS.tree-eh.c+=-O0
-COPTS.tree-if-conv.c+=-O0
-COPTS.tree-object-size.c+=-O0
-COPTS.tree-parloops.c+=-O0
-COPTS.tree-predcom.c+=-O0
-COPTS.tree-pretty-print.c+=-O0
-COPTS.tree-ssa-alias.c+=-O0
-COPTS.tree-ssa-ccp.c+=-O0
-COPTS.tree-ssa-forwprop.c+=-O0
-COPTS.tree-ssa-loop-ivopts.c+=-O0
-COPTS.tree-ssa-loop-manip.c+=-O0
-COPTS.tree-ssa-loop-niter.c+=-O0
-COPTS.tree-ssa-math-opts.c+=-O0
-COPTS.tree-ssa-phiopt.c+= -O0
-COPTS.tree-ssa-pre.c+=-O0
-COPTS.tree-ssa-reassoc.c+=-O0
-COPTS.tree-ssa-strlen.c+=-O0
-COPTS.tree-ssa-uninit.c+=-O0
-COPTS.tree-ssa.c+=-O0
-COPTS.tree-switch-conversion.c+=-O0
-COPTS.tree-vect-data-refs.c+=-O0
-COPTS.tree-vect-loop-manip.c+=-O0
-COPTS.tree-vect-loop.c+=-O0
-COPTS.tree-vect-patterns.c+=-O0
-COPTS.tree-vect-stmts.c+=-O0
-COPTS.tree-vrp.c+=-O0
-COPTS.tree.c+=-O0
-COPTS.ubsan.c+=-O0
-COPTS.varasm.c+=-O0
-COPTS.vr-values.c+=-O0
-COPTS.web.c+=-O0
-COPTS.wide-int-range.cc+=-O0
-COPTS.wide-int.cc+=-O0
+
+COPTS.expmed.c+=-Wno-error=tautological-compare
+COPTS.expr.c+=-Wno-error=tautological-compare
 .else
 COPTS.tree.c=	${${ACTIVE_CC} == "clang" :? -O0 :}
 .endif
@@ -622,3 +563,7 @@ CFLAGS+= -fno-exceptions -fno-rtti -fasy
 .if ${MACHINE_CPU} == "aarch64"
 .PATH: ${DIST}/gcc/config/arm
 .endif
+
+.if ${MACHINE} == "vax"
+CPPFLAGS+=	-DNB_FIX_VAX_BACKEND
+.endif

Index: src/external/gpl3/gcc/usr.bin/cc1/Makefile
diff -u src/external/gpl3/gcc/usr.bin/cc1/Makefile:1.20 src/external/gpl3/gcc/usr.bin/cc1/Makefile:1.20.6.1
--- src/external/gpl3/gcc/usr.bin/cc1/Makefile:1.20	Fri Apr 23 22:50:06 2021
+++ src/external/gpl3/gcc/usr.bin/cc1/Makefile	Sun Oct  8 14:35:22 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.20 2021/04/23 22:50:06 mrg Exp $
+#	$NetBSD: Makefile,v 1.20.6.1 2023/10/08 14:35:22 martin Exp $
 
 PROG=		cc1
 SRCS=		${G_C_OBJS:S,c-family/,,:S,c/,,:S,known-headers.o,known-headers.cc,:S,c-spellcheck.o,c-spellcheck.cc,:Nlibcpp.a:.o=.c}
@@ -46,17 +46,6 @@ CPPFLAGS.default-c.c+=	-I${BACKENDOBJ}
 BUILDSYMLINKS+= ${GNUHOSTDIST}/gcc/config/sh/sh-c.cc sh-c.c
 .endif
 
-.if ${MACHINE_CPU} == "vax"
-COPTS.c-decl.c+=-O0
-COPTS.c-typeck.c+=-O0
-COPTS.c-array-notation.c+=-O0
-COPTS.c-common.c+=-O0
-COPTS.c-ada-spec.c+=-O0
-COPTS.cilk.c+=-O0
-COPTS.c-ubsan.c+=-O0
-COPTS.cc1-checksum.c+=-O0
-.endif
-
 .if ${MACHINE_ARCH} == "mipseb" || ${MACHINE_ARCH} == "mipsel"
 COPTS.c-common.c+=-O3
 .endif

Index: src/external/gpl3/gcc/usr.bin/cc1obj/Makefile
diff -u src/external/gpl3/gcc/usr.bin/cc1obj/Makefile:1.18 src/external/gpl3/gcc/usr.bin/cc1obj/Makefile:1.18.6.1
--- src/external/gpl3/gcc/usr.bin/cc1obj/Makefile:1.18	Fri Apr 23 22:50:06 2021
+++ src/external/gpl3/gcc/usr.bin/cc1obj/Makefile	Sun Oct  8 14:35:23 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.18 2021/04/23 22:50:06 mrg Exp $
+#	$NetBSD: Makefile,v 1.18.6.1 2023/10/08 14:35:23 martin Exp $
 
 MYOBJS=		${G_OBJC_OBJS} ${G_C_AND_OBJC_OBJS} 
 PROG=		cc1obj
@@ -44,17 +44,6 @@ COPTS.objc-act.c+=			-Wno-stack-protecto
 COPTS.objc-gnu-runtime-abi-01.c+=	-Wno-stack-protector
 COPTS.objc-next-runtime-abi-01.c+=	-Wno-stack-protector
 
-.if ${MACHINE_ARCH} == "vax"
-COPTS.c-decl.c+=-O0
-COPTS.c-typeck.c+=-O0
-COPTS.c-array-notation.c+=-O0
-COPTS.c-common.c+=-O0
-COPTS.c-ada-spec.c+=-O0
-COPTS.cilk.c+=-O0
-COPTS.c-ubsan.c+=-O0
-COPTS.cc1obj-checksum.c+=-O0
-.endif
-
 .if ${MACHINE_ARCH} == "mipseb" || ${MACHINE_ARCH} == "mipsel"
 COPTS.c-common.c+=-O3
 .endif

Index: src/external/gpl3/gcc/usr.bin/cc1objplus/Makefile
diff -u src/external/gpl3/gcc/usr.bin/cc1objplus/Makefile:1.3 src/external/gpl3/gcc/usr.bin/cc1objplus/Makefile:1.3.6.1
--- src/external/gpl3/gcc/usr.bin/cc1objplus/Makefile:1.3	Tue Apr 27 14:18:25 2021
+++ src/external/gpl3/gcc/usr.bin/cc1objplus/Makefile	Sun Oct  8 14:35:21 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2021/04/27 14:18:25 christos Exp $
+#	$NetBSD: Makefile,v 1.3.6.1 2023/10/08 14:35:21 martin Exp $
 
 # XXX: Pull this (G_OBJCXX_OBJS) out with mknative-gcc.  Needs some
 # minor re-org of cc1plus and perhaps cc1obj.  G_CXX_AND_OBJCXX_OBJS
@@ -69,18 +69,6 @@ COPTS.objc-act.c+=			-Wno-stack-protecto
 COPTS.objc-gnu-runtime-abi-01.c+=	-Wno-stack-protector
 COPTS.objc-next-runtime-abi-01.c+=	-Wno-stack-protector
 
-.if ${MACHINE_ARCH} == "vax"
-COPTS.c-decl.c+=-O0
-COPTS.c-typeck.c+=-O0
-COPTS.c-array-notation.c+=-O0
-COPTS.c-common.c+=-O0
-COPTS.c-ada-spec.c+=-O0
-COPTS.cilk.c+=-O0
-COPTS.c-ubsan.c+=-O0
-COPTS.cc1obj-checksum.c+=-O0
-COPTS.decl.c+=-O0
-.endif
-
 .if ${MACHINE_ARCH} == "mipseb" || ${MACHINE_ARCH} == "mipsel"
 COPTS.c-common.c+=-O3
 .endif

Index: src/external/gpl3/gcc/usr.bin/cc1plus/Makefile
diff -u src/external/gpl3/gcc/usr.bin/cc1plus/Makefile:1.17 src/external/gpl3/gcc/usr.bin/cc1plus/Makefile:1.17.6.1
--- src/external/gpl3/gcc/usr.bin/cc1plus/Makefile:1.17	Tue Apr 27 14:18:25 2021
+++ src/external/gpl3/gcc/usr.bin/cc1plus/Makefile	Sun Oct  8 14:35:22 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.17 2021/04/27 14:18:25 christos Exp $
+#	$NetBSD: Makefile,v 1.17.6.1 2023/10/08 14:35:22 martin Exp $
 
 PROG=		cc1plus
 SRCS=		${G_CXX_OBJS:S,c-family/,,:S,cp/,,:S,constraint.o,constraint.cc,:S,logic.o,logic.cc,:S,known-headers.o,known-headers.cc,:S,c-spellcheck.o,c-spellcheck.cc,:S,coroutines.o,coroutines.cc,:Nlibcpp.a:.o=.c}
@@ -31,23 +31,6 @@ CHECKSUM_OBJS= ${LIBBACKTRACEOBJ}/libbac
 
 CFLAGS+=	-Wno-error=stack-protector
 
-.if ${MACHINE_ARCH} == "vax"
-COPTS.call.c+=-O0
-COPTS.decl.c+=-O0
-COPTS.typeck2.c+=-O0
-COPTS.class.c+=-O0
-COPTS.typeck.c+=-O0
-COPTS.init.c+=-O0
-COPTS.semantics.c+=-O0
-COPTS.mangle.c+=-O0
-COPTS.constexpr.c+=-O0
-COPTS.c-common.c+=-O0
-COPTS.c-ada-spec.c+=-O0
-COPTS.cilk.c+=-O0
-COPTS.c-ubsan.c+=-O0
-COPTS.cc1plus-checksum.c+=-O0
-.endif
-
 .if ${MACHINE_ARCH} == "mipseb" || ${MACHINE_ARCH} == "mipsel"
 COPTS.c-common.c+=-O3
 .endif

Index: src/external/gpl3/gcc/usr.bin/gcc/Makefile
diff -u src/external/gpl3/gcc/usr.bin/gcc/Makefile:1.7 src/external/gpl3/gcc/usr.bin/gcc/Makefile:1.7.26.1
--- src/external/gpl3/gcc/usr.bin/gcc/Makefile:1.7	Tue Mar 15 19:12:06 2016
+++ src/external/gpl3/gcc/usr.bin/gcc/Makefile	Sun Oct  8 14:35:19 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.7 2016/03/15 19:12:06 mrg Exp $
+#	$NetBSD: Makefile,v 1.7.26.1 2023/10/08 14:35:19 martin Exp $
 
 PROG=		gcc
 SRCS=		gccspec.c ${G_GCC_OBJS:.o=.c}
@@ -25,9 +25,6 @@ ${SRCS}: ${GCCARCH}/defs.mk
 .include <bsd.info.mk>
 
 COPTS.gcc.c=	-Wno-stack-protector
-.if ${MACHINE_ARCH} == "vax"
-COPTS.dse.c=	-O1
-.endif
 
 .PATH: ${DIST}/gcc ${DIST}/gcc/doc ${DIST}/gcc/c
 

Index: src/external/gpl3/gcc/usr.bin/libdecnumber/Makefile
diff -u src/external/gpl3/gcc/usr.bin/libdecnumber/Makefile:1.8.2.1 src/external/gpl3/gcc/usr.bin/libdecnumber/Makefile:1.8.2.2
--- src/external/gpl3/gcc/usr.bin/libdecnumber/Makefile:1.8.2.1	Sun May 28 09:47:27 2023
+++ src/external/gpl3/gcc/usr.bin/libdecnumber/Makefile	Sun Oct  8 14:35:22 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8.2.1 2023/05/28 09:47:27 martin Exp $
+#	$NetBSD: Makefile,v 1.8.2.2 2023/10/08 14:35:22 martin Exp $
 
 DIST=		${GCCDIST}
 GNUHOSTDIST=	${DIST}
@@ -14,10 +14,6 @@ SRCS=		decNumber.c decContext.c decimal3
 CPPFLAGS+=	-I${.CURDIR}/arch/${GCC_MACHINE_ARCH} -I${DIST}/libdecnumber
 CPPFLAGS+=	-I${DIST}/libgcc
 
-.if ${MACHINE_ARCH} == "vax"
-COPTS.decNumber.c=-O0
-.endif
-
 .include <bsd.lib.mk>
 
 # Force using C++ for this

Index: src/external/gpl3/gcc/usr.bin/lto-dump/Makefile
diff -u src/external/gpl3/gcc/usr.bin/lto-dump/Makefile:1.1 src/external/gpl3/gcc/usr.bin/lto-dump/Makefile:1.1.6.1
--- src/external/gpl3/gcc/usr.bin/lto-dump/Makefile:1.1	Fri Apr 23 01:56:14 2021
+++ src/external/gpl3/gcc/usr.bin/lto-dump/Makefile	Sun Oct  8 14:35:19 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2021/04/23 01:56:14 mrg Exp $
+#	$NetBSD: Makefile,v 1.1.6.1 2023/10/08 14:35:19 martin Exp $
 
 PROG=		lto-dump
 # XXX pullout from LTO_DUMP_OBJS
@@ -24,11 +24,6 @@ COPTS.lto-common.c+=	-Wno-stack-protecto
 .include "../Makefile.backtrace"
 .include "../Makefile.libdecnumber"
 
-.if ${MACHINE_ARCH} == "vax"
-COPTS.lto-lang.c+=-O0
-COPTS.lto-symtab.c+=-O0
-.endif
-
 LDADD+=	${LIBIBERTY} ${LIBMPC} ${LIBMPFR} ${LIBGMP} -lintl -lz -lm
 DPADD+=	${LIBIBERTY} ${LIBMPC} ${LIBMPFR} ${LIBGMP} ${LIBINTL} ${LIBZ} ${LIBM}
 

Index: src/external/gpl3/gcc/usr.bin/lto1/Makefile
diff -u src/external/gpl3/gcc/usr.bin/lto1/Makefile:1.7 src/external/gpl3/gcc/usr.bin/lto1/Makefile:1.7.6.1
--- src/external/gpl3/gcc/usr.bin/lto1/Makefile:1.7	Wed Apr 14 12:20:59 2021
+++ src/external/gpl3/gcc/usr.bin/lto1/Makefile	Sun Oct  8 14:35:23 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.7 2021/04/14 12:20:59 christos Exp $
+#	$NetBSD: Makefile,v 1.7.6.1 2023/10/08 14:35:23 martin Exp $
 
 PROG=		lto1
 SRCS=		attribs.c \
@@ -21,11 +21,6 @@ COPTS.lto-common.c+=	-Wno-stack-protecto
 .include "../Makefile.libcpp"
 .include "../Makefile.libdecnumber"
 
-.if ${MACHINE_ARCH} == "vax"
-COPTS.lto-lang.c+=-O0
-COPTS.lto-symtab.c+=-O0
-.endif
-
 LDADD+= ${LIBIBERTYOBJ}/libiberty.a
 DPADD+= ${LIBIBERTYOBJ}/libiberty.a
 LDADD+=	${LIBIBERTY} ${LIBMPC} ${LIBMPFR} ${LIBGMP} -lintl -lz -lm

Index: src/external/gpl3/gdb.old/lib/libdecnumber/Makefile
diff -u src/external/gpl3/gdb.old/lib/libdecnumber/Makefile:1.8 src/external/gpl3/gdb.old/lib/libdecnumber/Makefile:1.8.6.1
--- src/external/gpl3/gdb.old/lib/libdecnumber/Makefile:1.8	Mon Sep 14 00:40:40 2020
+++ src/external/gpl3/gdb.old/lib/libdecnumber/Makefile	Sun Oct  8 14:35:21 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2020/09/14 00:40:40 christos Exp $
+#	$NetBSD: Makefile,v 1.8.6.1 2023/10/08 14:35:21 martin Exp $
 
 .include <bsd.own.mk>
 .include "../Makefile.inc"
@@ -18,10 +18,6 @@ CPPFLAGS+=	-I${.CURDIR}/arch/${GDB_MACHI
 
 SRCS=		${G_OBJS:.o=.c} ${G_SOURCES}
 
-.if ${MACHINE_ARCH} == "vax"
-COPTS.decNumber.c=-O0
-.endif
-
 .PATH: ${DIST}/libdecnumber ${DIST}/libdecnumber/dpd
 
 .include <bsd.lib.mk>

Index: src/external/gpl3/gdb/lib/libdecnumber/Makefile
diff -u src/external/gpl3/gdb/lib/libdecnumber/Makefile:1.3 src/external/gpl3/gdb/lib/libdecnumber/Makefile:1.3.36.1
--- src/external/gpl3/gdb/lib/libdecnumber/Makefile:1.3	Sat Nov  9 21:39:27 2013
+++ src/external/gpl3/gdb/lib/libdecnumber/Makefile	Sun Oct  8 14:35:22 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2013/11/09 21:39:27 christos Exp $
+#	$NetBSD: Makefile,v 1.3.36.1 2023/10/08 14:35:22 martin Exp $
 
 .include <bsd.own.mk>
 .include "../Makefile.inc"
@@ -18,10 +18,6 @@ CPPFLAGS+=	-I${.CURDIR}/arch/${GDB_MACHI
 
 SRCS=		${G_OBJS:.o=.c} ${G_SOURCES}
 
-.if ${MACHINE_ARCH} == "vax"
-COPTS.decNumber.c=-O0
-.endif
-
 .PATH: ${DIST}/libdecnumber ${DIST}/libdecnumber/dpd
 
 .include <bsd.lib.mk>

Index: src/external/gpl3/gdb/lib/libgdb/Makefile
diff -u src/external/gpl3/gdb/lib/libgdb/Makefile:1.32 src/external/gpl3/gdb/lib/libgdb/Makefile:1.32.2.1
--- src/external/gpl3/gdb/lib/libgdb/Makefile:1.32	Sat Sep 18 01:47:09 2021
+++ src/external/gpl3/gdb/lib/libgdb/Makefile	Sun Oct  8 14:35:21 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.32 2021/09/18 01:47:09 christos Exp $
+#	$NetBSD: Makefile,v 1.32.2.1 2023/10/08 14:35:21 martin Exp $
 
 NOCTF=
 HOSTPROG_CXX=   1
@@ -60,12 +60,6 @@ CFLAGS:=		${CXXFLAGS} -std=gnu++17 -Wno-
 
 ada-exp.c: ada-lex.c
 
-.if ${MACHINE} == "vax"
-. if ${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8
-COPTS.read.c+=	-O0
-. endif
-.endif
-
 # These are generated by implicit rules and are not easy to generate
 CLEANDIRFILES+= \
 	ada-exp.c ada-lex.c \

Index: src/external/mit/xorg/lib/gallium/Makefile
diff -u src/external/mit/xorg/lib/gallium/Makefile:1.48.2.1 src/external/mit/xorg/lib/gallium/Makefile:1.48.2.2
--- src/external/mit/xorg/lib/gallium/Makefile:1.48.2.1	Tue Feb 14 15:47:01 2023
+++ src/external/mit/xorg/lib/gallium/Makefile	Sun Oct  8 14:35:21 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.48.2.1 2023/02/14 15:47:01 martin Exp $
+# $NetBSD: Makefile,v 1.48.2.2 2023/10/08 14:35:21 martin Exp $
 
 # Link the gallium mega driver.
 
@@ -1208,10 +1208,6 @@ SYMLINKS+= gallium_dri.so.${SHLIB_MAJOR}
 COPTS+=	${${ACTIVE_CC} == "clang":? -Wa,-Av8plus  :}
 .endif
 
-.if ${MACHINE_ARCH} == "vax"
-COPTS.nir.c += -O1
-.endif
-
 COPTS.u_atomic.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-builtin-declaration-mismatch :}
 
 .include <bsd.lib.mk>

Index: src/external/mit/xorg/lib/gallium.old/Makefile
diff -u src/external/mit/xorg/lib/gallium.old/Makefile:1.4.2.1 src/external/mit/xorg/lib/gallium.old/Makefile:1.4.2.2
--- src/external/mit/xorg/lib/gallium.old/Makefile:1.4.2.1	Tue Feb 14 15:47:01 2023
+++ src/external/mit/xorg/lib/gallium.old/Makefile	Sun Oct  8 14:35:23 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4.2.1 2023/02/14 15:47:01 martin Exp $
+# $NetBSD: Makefile,v 1.4.2.2 2023/10/08 14:35:23 martin Exp $
 
 # Transparent struct/union broken
 NOLINT=yes
@@ -1211,10 +1211,6 @@ SYMLINKS+= gallium_dri.so.${SHLIB_MAJOR}
 COPTS+=	${${ACTIVE_CC} == "clang":? -Wa,-Av8plus  :}
 .endif
 
-.if ${MACHINE_ARCH} == "vax"
-COPTS.nir.c += -O1
-.endif
-
 COPTS.u_atomic.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-builtin-declaration-mismatch :}
 
 .include <bsd.lib.mk>

Index: src/external/mit/xorg/lib/libX11/Makefile.libx11
diff -u src/external/mit/xorg/lib/libX11/Makefile.libx11:1.25 src/external/mit/xorg/lib/libX11/Makefile.libx11:1.25.2.1
--- src/external/mit/xorg/lib/libX11/Makefile.libx11:1.25	Fri Oct 28 09:43:58 2022
+++ src/external/mit/xorg/lib/libX11/Makefile.libx11	Sun Oct  8 14:35:21 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.libx11,v 1.25 2022/10/28 09:43:58 wiz Exp $
+#	$NetBSD: Makefile.libx11,v 1.25.2.1 2023/10/08 14:35:21 martin Exp $
 
 LIB=	X11
 .PATH:	${X11SRCDIR.${LIB}}/src
@@ -471,11 +471,6 @@ COPTS.OpenDis.c+=	-Wno-error	# XXX xf86b
 COPTS.XlibInt.c+=	-Wno-error	# XXX xcmiscstr.h
 COPTS.XKBBind.c+=	-Wno-deprecated-declarations	# uses XKeycodeToKeysym
 
-# XXX
-.if ${MACHINE} == "vax"
-COPTS.lcWrap.c+=	-O0
-.endif
-
 CWARNFLAGS.clang+=	-Wno-string-plus-int
 
 .include "${NETBSDSRCDIR}/external/mit/xorg/tools/makekeys/Makefile.makekeys"

Index: src/games/gomoku/Makefile
diff -u src/games/gomoku/Makefile:1.12 src/games/gomoku/Makefile:1.12.2.1
--- src/games/gomoku/Makefile:1.12	Tue May 31 19:11:58 2022
+++ src/games/gomoku/Makefile	Sun Oct  8 14:35:23 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.12 2022/05/31 19:11:58 christos Exp $
+#	$NetBSD: Makefile,v 1.12.2.1 2023/10/08 14:35:23 martin Exp $
 #	@(#)Makefile	8.1 (Berkeley) 7/24/94
 
 PROG=	gomoku
@@ -9,10 +9,6 @@ LDADD=	-lcurses -lterminfo
 HIDEGAME=hidegame
 CPPFLAGS+=	${DEBUG:D-DDEBUG}
 
-.if ${MACHINE} == "vax"
-COPTS.pickmove.c += -O0
-.endif
-
 #WARNS=		6	# would produce warnings about small integer types
 LINTFLAGS+=	-w	# treat warnings as errors
 LINTFLAGS+=	-T	# strict bool mode

Index: src/games/phantasia/Makefile
diff -u src/games/phantasia/Makefile:1.37 src/games/phantasia/Makefile:1.37.34.1
--- src/games/phantasia/Makefile:1.37	Sat Jun 14 20:49:37 2014
+++ src/games/phantasia/Makefile	Sun Oct  8 14:35:20 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.37 2014/06/14 20:49:37 mrg Exp $
+#	$NetBSD: Makefile,v 1.37.34.1 2023/10/08 14:35:20 martin Exp $
 #	@(#)Makefile	8.1 (Berkeley) 5/31/93
 
 .include <bsd.own.mk>
@@ -52,7 +52,3 @@ map: map.c
 	./map | plot > /dev/tty
 
 .include <bsd.prog.mk>
-
-.if defined(HAVE_GCC) && ${MACHINE_ARCH} == "vax"
-COPTS.misc.c+=	-O0
-.endif

Index: src/lib/i18n_module/UTF7/Makefile
diff -u src/lib/i18n_module/UTF7/Makefile:1.4 src/lib/i18n_module/UTF7/Makefile:1.4.52.1
--- src/lib/i18n_module/UTF7/Makefile:1.4	Mon Jun 20 06:52:36 2011
+++ src/lib/i18n_module/UTF7/Makefile	Sun Oct  8 14:35:24 2023
@@ -1,8 +1,5 @@
-#	$NetBSD: Makefile,v 1.4 2011/06/20 06:52:36 mrg Exp $
+#	$NetBSD: Makefile,v 1.4.52.1 2023/10/08 14:35:24 martin Exp $
 
 SRCPRE=citrus_
 .include <bsd.lib.mk>
 
-.if ${MACHINE_ARCH} == "vax" && defined(HAVE_GCC)
-COPTS.citrus_utf7.c+=	-O0
-.endif

Index: src/lib/libbz2/Makefile
diff -u src/lib/libbz2/Makefile:1.20 src/lib/libbz2/Makefile:1.20.8.1
--- src/lib/libbz2/Makefile:1.20	Sun Sep 29 23:44:59 2019
+++ src/lib/libbz2/Makefile	Sun Oct  8 14:35:23 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.20 2019/09/29 23:44:59 mrg Exp $
+#	$NetBSD: Makefile,v 1.20.8.1 2023/10/08 14:35:23 martin Exp $
 
 USE_FORT?= yes	# data driven bugs?
 
@@ -15,11 +15,6 @@ SRCS=		blocksort.c huffman.c crctable.c 
 INCS=		bzlib.h
 INCSDIR=	/usr/include
 
-# XXX huffman.c gets mis-compiled with 2.95.3
-.if ${MACHINE_ARCH} == "vax"
-COPTS+=		-O0
-.endif
-
 .if defined(HAVE_GCC) && ${HAVE_GCC} >= 7 && ${ACTIVE_CC} == "gcc"
 COPTS+=		-Wno-error=implicit-fallthrough
 .endif

Index: src/lib/libc/gdtoa/Makefile.inc
diff -u src/lib/libc/gdtoa/Makefile.inc:1.12 src/lib/libc/gdtoa/Makefile.inc:1.12.2.1
--- src/lib/libc/gdtoa/Makefile.inc:1.12	Sun Dec  4 22:35:15 2022
+++ src/lib/libc/gdtoa/Makefile.inc	Sun Oct  8 14:35:22 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.12 2022/12/04 22:35:15 jakllsch Exp $
+#	$NetBSD: Makefile.inc,v 1.12.2.1 2023/10/08 14:35:22 martin Exp $
 
 # gdtoa sources
 .PATH: ${.CURDIR}/gdtoa
@@ -44,10 +44,3 @@ SRCS+=	dmisc.c \
 .if ${MACHINE_ARCH} != "vax"
 SRCS+=	strtord.c
 .endif
-
-# XXX revisit with newer GCC.
-# Ensure numbers like 0xffff319f5fa95963 print correctly
-# ("999999999999999.98", not garbage like "?A>C>@>C:BA;A><.:<")
-.if ${MACHINE_ARCH} == "vax" && defined(HAVE_GCC)
-COPTS.misc.c+=	-O0
-.endif

Index: src/lib/libcrypt/Makefile
diff -u src/lib/libcrypt/Makefile:1.34 src/lib/libcrypt/Makefile:1.34.2.1
--- src/lib/libcrypt/Makefile:1.34	Sun May 15 16:25:09 2022
+++ src/lib/libcrypt/Makefile	Sun Oct  8 14:35:22 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.34 2022/05/15 16:25:09 christos Exp $
+#	$NetBSD: Makefile,v 1.34.2.1 2023/10/08 14:35:22 martin Exp $
 
 USE_FORT?=	yes	# cryptographic software
 
@@ -30,9 +30,6 @@ SRCS+=		crypt-argon2.c
 SRCS+=		${src}
 COPTS.${src}+=	-fvisibility=hidden
 .  endfor
-.  if ${MACHINE} == "vax"
-COPTS.blake2b.c+=	-O0
-.  endif
 .endif
 
 WARNS?=	5

Index: src/libexec/ld.elf_so/Makefile
diff -u src/libexec/ld.elf_so/Makefile:1.144.2.1 src/libexec/ld.elf_so/Makefile:1.144.2.2
--- src/libexec/ld.elf_so/Makefile:1.144.2.1	Tue Aug  1 17:03:53 2023
+++ src/libexec/ld.elf_so/Makefile	Sun Oct  8 14:35:21 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.144.2.1 2023/08/01 17:03:53 martin Exp $
+#	$NetBSD: Makefile,v 1.144.2.2 2023/10/08 14:35:21 martin Exp $
 #
 # NOTE: when changing ld.so, ensure that ldd still compiles.
 #
@@ -141,10 +141,6 @@ CPPFLAGS+=	-DRTLD_DEFAULT_LIBRARY_PATH=\
 COPTS.rtld.c+=	-Wno-stack-protector
 COPTS.symbol.c+=-Wno-stack-protector
 
-.if ${MACHINE_CPU} == "vax"
-COPTS.rtld.c+=	-O0
-.endif
-
 LDADD+=		-Wl,--version-script=${.CURDIR}/symbols.map
 LDADD+=		-L${CLIBOBJ} -L${DESTDIR}${LIBDIR}
 .if ${MKPICLIB} != "no"

Index: src/sbin/fsck_ffs/Makefile.common
diff -u src/sbin/fsck_ffs/Makefile.common:1.2 src/sbin/fsck_ffs/Makefile.common:1.2.8.1
--- src/sbin/fsck_ffs/Makefile.common:1.2	Mon Oct 28 22:52:43 2019
+++ src/sbin/fsck_ffs/Makefile.common	Sun Oct  8 14:35:24 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.common,v 1.2 2019/10/28 22:52:43 christos Exp $
+#	$NetBSD: Makefile.common,v 1.2.8.1 2023/10/08 14:35:24 martin Exp $
 #	@(#)Makefile	8.2 (Berkeley) 4/27/95
 
 # shared stuff with src/distrib/utils/x_newfs for install media.
@@ -36,7 +36,3 @@ COPTS.ffs_appleufs.c+=	-Wno-pointer-sign
 .if ${MACHINE_ARCH} == "m68000"
 COPTS.pass1.c+=	-fno-tree-fre -fno-tree-lrs
 .endif
-.if ${MACHINE_ARCH} == "vax"
-COPTS.pass1.c+=	-O0
-COPTS.inode.c+=	-O0
-.endif

Index: src/sbin/fsdb/Makefile
diff -u src/sbin/fsdb/Makefile:1.41 src/sbin/fsdb/Makefile:1.41.6.1
--- src/sbin/fsdb/Makefile:1.41	Thu Apr 15 01:56:00 2021
+++ src/sbin/fsdb/Makefile	Sun Oct  8 14:35:23 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.41 2021/04/15 01:56:00 mrg Exp $
+#	$NetBSD: Makefile,v 1.41.6.1 2023/10/08 14:35:23 martin Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/5/93
 
 .include <bsd.own.mk>
@@ -39,12 +39,6 @@ COPTS.${f}.c+=	-Wno-pointer-sign
 COPTS.pass1.c+=	-fno-tree-fre -fno-tree-lrs
 .endif
 
-.if ${MACHINE_ARCH} == "vax"
-COPTS.pass1.c+=	-O0
-COPTS.inode.c+=	-O0
-COPTS.fsdb.c+=	-O0
-.endif
-
 CWARNFLAGS.gcc+=	${GCC_NO_ADDR_OF_PACKED_MEMBER}
 
 .include <bsd.prog.mk>

Index: src/sbin/newfs_ext2fs/Makefile
diff -u src/sbin/newfs_ext2fs/Makefile:1.6 src/sbin/newfs_ext2fs/Makefile:1.6.36.1
--- src/sbin/newfs_ext2fs/Makefile:1.6	Sat Nov  9 21:39:27 2013
+++ src/sbin/newfs_ext2fs/Makefile	Sun Oct  8 14:35:20 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2013/11/09 21:39:27 christos Exp $
+#	$NetBSD: Makefile,v 1.6.36.1 2023/10/08 14:35:20 martin Exp $
 #	@(#)Makefile	8.2 (Berkeley) 3/27/94
 
 CWARNFLAGS+=	-Wno-sign-compare
@@ -20,8 +20,4 @@ DPADD+=${LIBPROP}
 
 .PATH:	${NETBSDSRCDIR}/sys/ufs/ext2fs ${FSCK}
 
-.if ${MACHINE_ARCH} == "vax"
-COPTS.mke2fs.c=-O0
-.endif
-
 .include <bsd.prog.mk>

Index: src/sbin/ping/Makefile
diff -u src/sbin/ping/Makefile:1.17 src/sbin/ping/Makefile:1.17.36.1
--- src/sbin/ping/Makefile:1.17	Sat Nov  9 21:39:27 2013
+++ src/sbin/ping/Makefile	Sun Oct  8 14:35:20 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.17 2013/11/09 21:39:27 christos Exp $
+#	$NetBSD: Makefile,v 1.17.36.1 2023/10/08 14:35:20 martin Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/5/93
 
 USE_FORT?= yes	# setuid
@@ -12,8 +12,4 @@ CPPFLAGS+=	-DIPSEC
 LDADD+= -lipsec
 DPADD+= ${LIBIPSEC}
 
-.if ${MACHINE_ARCH} == "vax"
-COPTS.ping.c=-O0
-.endif
-
 .include <bsd.prog.mk>

Index: src/sys/arch/vax/conf/Makefile.vax
diff -u src/sys/arch/vax/conf/Makefile.vax:1.85 src/sys/arch/vax/conf/Makefile.vax:1.85.20.1
--- src/sys/arch/vax/conf/Makefile.vax:1.85	Tue Sep 15 05:08:07 2020
+++ src/sys/arch/vax/conf/Makefile.vax	Sun Oct  8 14:35:23 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.vax,v 1.85 2020/09/15 05:08:07 mrg Exp $
+#	$NetBSD: Makefile.vax,v 1.85.20.1 2023/10/08 14:35:23 martin Exp $
 
 # Makefile for NetBSD
 #
@@ -34,7 +34,6 @@ GENASSYM_CONF=	${VAX}/vax/genassym.cf
 CPPFLAGS+=	-D_VAX_INLINE_
 AFLAGS+=	-x assembler-with-cpp -fno-pic
 CFLAGS+=	-fno-pic
-COPTS.wsmux.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 9:? -O1 :}
 
 
 ##

Index: src/sys/lib/libsa/Makefile
diff -u src/sys/lib/libsa/Makefile:1.95 src/sys/lib/libsa/Makefile:1.95.12.1
--- src/sys/lib/libsa/Makefile:1.95	Thu May 27 06:54:44 2021
+++ src/sys/lib/libsa/Makefile	Sun Oct  8 14:35:20 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.95 2021/05/27 06:54:44 mrg Exp $
+#	$NetBSD: Makefile,v 1.95.12.1 2023/10/08 14:35:20 martin Exp $
 
 LIB=	sa
 LIBISPRIVATE?= yes
@@ -96,7 +96,3 @@ SRCS+=	ufs.c
 lib${LIB}.o:: ${OBJS:O} __buildstdlib
 
 CPPFLAGS+=	-Wno-pointer-sign
-
-.if defined(HAVE_GCC) && ${MACHINE_ARCH} == "vax"
-COPTS.bootp.c+=	-O0
-.endif

Index: src/sys/lib/libz/Makefile
diff -u src/sys/lib/libz/Makefile:1.23 src/sys/lib/libz/Makefile:1.23.32.1
--- src/sys/lib/libz/Makefile:1.23	Tue Jun  5 00:57:47 2018
+++ src/sys/lib/libz/Makefile	Sun Oct  8 14:35:20 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.23 2018/06/05 00:57:47 christos Exp $
+#	$NetBSD: Makefile,v 1.23.32.1 2023/10/08 14:35:20 martin Exp $
 
 LIB=	z
 LIBISPRIVATE=	yes
@@ -25,7 +25,3 @@ CLEANFILES+= lib${LIB}.o
 .include <bsd.lib.mk>
 
 lib${LIB}.o:: ${OBJS:O} __buildstdlib
-
-.if defined(HAVE_GCC) && ${MACHINE_ARCH} == "vax"
-COPTS.inftrees.c+=	-O0
-.endif

Index: src/sys/modules/lfs/Makefile
diff -u src/sys/modules/lfs/Makefile:1.10 src/sys/modules/lfs/Makefile:1.10.30.1
--- src/sys/modules/lfs/Makefile:1.10	Sun Feb 17 14:04:31 2019
+++ src/sys/modules/lfs/Makefile	Sun Oct  8 14:35:21 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.10 2019/02/17 14:04:31 rin Exp $
+#	$NetBSD: Makefile,v 1.10.30.1 2023/10/08 14:35:21 martin Exp $
 
 .include "../Makefile.inc"
 
@@ -18,9 +18,4 @@ SRCS+=	ulfs_bmap.c ulfs_dirhash.c ulfs_i
 
 WARNS=	3
 
-.if ${MACHINE} == "vax"
-# GCC 6.5 and 7.4 cannot compile this with -DDIAGNOSTIC and -O2/-O1
-COPTS.lfs_inode.c+=	-O0
-.endif
-
 .include <bsd.kmodule.mk>

Index: src/sys/rump/fs/lib/liblfs/Makefile
diff -u src/sys/rump/fs/lib/liblfs/Makefile:1.17 src/sys/rump/fs/lib/liblfs/Makefile:1.17.20.1
--- src/sys/rump/fs/lib/liblfs/Makefile:1.17	Mon Sep  7 03:09:53 2020
+++ src/sys/rump/fs/lib/liblfs/Makefile	Sun Oct  8 14:35:24 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.17 2020/09/07 03:09:53 mrg Exp $
+#	$NetBSD: Makefile,v 1.17.20.1 2023/10/08 14:35:24 martin Exp $
 #
 
 .PATH:  ${.CURDIR}/../../../../ufs/lfs
@@ -17,9 +17,6 @@ SRCS+=	ulfs_bmap.c ulfs_dirhash.c ulfs_e
 
 
 CFLAGS+=        -DLFS_KERNEL_RFW
-.if ${MACHINE_ARCH} == "vax"
-COPTS.lfs_inode.c+=-O0
-.endif
 
 .include <bsd.lib.mk>
 .include <bsd.klinks.mk>

Index: src/tools/gcc/Makefile
diff -u src/tools/gcc/Makefile:1.105 src/tools/gcc/Makefile:1.105.2.1
--- src/tools/gcc/Makefile:1.105	Sat Sep 18 01:47:10 2021
+++ src/tools/gcc/Makefile	Sun Oct  8 14:35:18 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.105 2021/09/18 01:47:10 christos Exp $
+#	$NetBSD: Makefile,v 1.105.2.1 2023/10/08 14:35:18 martin Exp $
 
 .include <bsd.hostinit.mk>
 
@@ -74,6 +74,10 @@ GCC_CPPFLAGS=	-DNETBSD_TOOLS -DTARGET_SY
 		-DTARGET_SYSTEM_ROOT_RELOCATABLE 
 #		${HOST_CPPFLAGS}
 
+.if ${MACHINE} == "vax"
+GCC_CPPFLAGS+=	-DNB_FIX_VAX_BACKEND
+.endif
+
 MAKE_ARGS=	MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q} \
 		LIBGCC= LIBGCC1= LIBGCC1_TEST= LIBGCC2= INSTALL_LIBGCC= \
 		EXTRA_PARTS= CPPFLAGS=${GCC_CPPFLAGS:Q} \

Index: src/usr.sbin/mtrace/Makefile
diff -u src/usr.sbin/mtrace/Makefile:1.12 src/usr.sbin/mtrace/Makefile:1.12.6.1
--- src/usr.sbin/mtrace/Makefile:1.12	Sun Sep  6 07:20:32 2020
+++ src/usr.sbin/mtrace/Makefile	Sun Oct  8 14:35:23 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.12 2020/09/06 07:20:32 mrg Exp $
+#	$NetBSD: Makefile,v 1.12.6.1 2023/10/08 14:35:23 martin Exp $
 #	from: Id: Makefile,v 1.5 1993/06/24 05:11:16 deering Exp
 
 .include <bsd.own.mk>
@@ -12,10 +12,6 @@ PROG=	mtrace
 SRCS=	igmp.c inet.c kern.c mtrace.c
 MAN=	mtrace.8
 
-.if ${MACHINE_ARCH} == "vax"
-COPTS.mtrace.c=-O0
-.endif
-
 BINMODE=4555
 BINOWN= root
 

Reply via email to