Merge from trunk revision 99b1021d21e5812ed01221d8fca8e8a32488a934.
diff --git a/ChangeLog b/ChangeLog
index c0fb0f2..40aa759 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,30 @@
+2021-10-26  Jeff Law  <jeffreyalaw@gmail.com>
+
+	* MAINTAINERS: Fix up Maciej's entries.
+
+2021-10-26  Maciej W. Rozycki  <macro@embecosm.com>
+
+	* MAINTAINERS (CPU Port Maintainers): Add myself as a VAX port
+	maintainer.
+
+2021-10-22  Eric Gallager  <egallager@gcc.gnu.org>
+
+	PR other/102663
+	* Makefile.def: Handle install-dvi target.
+	* Makefile.tpl: Likewise.
+	* Makefile.in: Regenerate.
+
+2021-10-19  Clément Chigot  <clement.chigot@atos.net>
+
+	* MAINTAINERS: Add myself for write after approval.
+
+2021-10-12  Eric Gallager  <egallager@gcc.gnu.org>
+
+	* Makefile.def: Mark libcody, libdecnumber,
+	c++tools, libgcc, and libobjc as missing TAGS
+	targets.
+	* Makefile.in: Regenerate.
+
 2021-10-07  Siddhesh Poyarekar  <siddhesh@gotplt.org>
 
 	* MAINTAINERS: Add myself to DCO section and update email
diff --git a/MAINTAINERS b/MAINTAINERS
index bf4006c..fe56b2f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -117,6 +117,7 @@
 tilepro port		Walter Lee		<walt@tilera.com>
 v850 port		Nick Clifton		<nickc@redhat.com>
 vax port		Matt Thomas		<matt@3am-software.com>
+vax port		Maciej W. Rozycki	<macro@embecosm.com>
 visium port		Eric Botcazou		<ebotcazou@libertysurf.fr>
 x86-64 port		Jan Hubicka		<hubicka@ucw.cz>
 xstormy16 port		Nick Clifton		<nickc@redhat.com>
@@ -352,6 +353,7 @@
 Chandra Chavva					<cchavva@redhat.com>
 Dehao Chen					<dehao@google.com>
 Fabien Chêne					<fabien@gcc.gnu.org>
+Clément Chigot					<clement.chigot@atos.net>
 Harshit Chopra					<harshit@google.com>
 Tamar Christina					<tamar.christina@arm.com>
 Eric Christopher				<echristo@gmail.com>
@@ -589,7 +591,6 @@
 Ira Rosen					<irar@il.ibm.com>
 Yvan Roux					<yvan.roux@linaro.org>
 Eugene Rozenfeld				<erozen@microsoft.com>
-Maciej W. Rozycki				<macro@orcam.me.uk>
 Silvius Rus					<rus@google.com>
 Matthew Sachs					<msachs@apple.com>
 Ankur Saini					<arsenic@sourceware.org>
diff --git a/Makefile.def b/Makefile.def
index e015a7a..0abc42b 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -42,7 +42,8 @@
 host_modules= { module= etc; };
 host_modules= { module= fastjar; no_check_cross= true; };
 host_modules= { module= fixincludes; bootstrap=true;
-		missing= TAGS; };
+		missing= TAGS;
+		missing= install-dvi; };
 host_modules= { module= flex; no_check_cross= true; };
 host_modules= { module= gas; bootstrap=true; };
 host_modules= { module= gcc; bootstrap=true; 
@@ -87,10 +88,14 @@
 		missing= pdf;
 		missing= html;
 		missing= info;
+		missing= dvi;
 		missing= install-pdf;
 		missing= install-html;
-		missing= install-info; };
-host_modules= { module= libdecnumber; bootstrap=true; };
+		missing= install-info;
+		missing= install-dvi;
+		missing=TAGS; };
+host_modules= { module= libdecnumber; bootstrap=true;
+		missing=TAGS; };
 host_modules= { module= libgui; };
 host_modules= { module= libiberty; bootstrap=true;
 	        extra_configure_flags='@extra_host_libiberty_configure_flags@';};
@@ -134,7 +139,8 @@
                 missing=distclean;
                 missing=maintainer-clean; };
 host_modules= { module= utils; no_check=true; };
-host_modules= { module= c++tools; };
+host_modules= { module= c++tools;
+                missing=TAGS; };
 host_modules= { module= gnattools; };
 host_modules= { module= lto-plugin; bootstrap=true;
 		extra_configure_flags='--enable-shared @extra_linker_plugin_flags@ @extra_linker_plugin_configure_flags@';
@@ -160,11 +166,15 @@
 		   extra_configure_flags='@extra_liboffloadmic_configure_flags@'; };
 target_modules = { module= libssp; lib_path=.libs; };
 target_modules = { module= newlib; };
-target_modules = { module= libgcc; bootstrap=true; no_check=true; };
+target_modules = { module= libgcc; bootstrap=true; no_check=true;
+		  missing=TAGS;
+		  missing=install-dvi; };
 target_modules = { module= libbacktrace; };
 target_modules = { module= libquadmath; };
 target_modules = { module= libgfortran; };
-target_modules = { module= libobjc; };
+target_modules = { module= libobjc;
+		  missing=TAGS;
+		  missing=install-dvi; };
 target_modules = { module= libgo; };
 target_modules = { module= libphobos;
 		   lib_path=src/.libs; };
@@ -200,6 +210,9 @@
 recursive_targets = { make_target= install-info; 
                       depend=configure;
                       depend=info; };
+recursive_targets = { make_target= install-dvi;
+                      depend=configure;
+                      depend=dvi; };
 recursive_targets = { make_target= install-pdf; 
                       depend=configure;
                       depend=pdf; };
diff --git a/Makefile.in b/Makefile.in
index 9219ebf..34b2d89 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1802,6 +1802,96 @@
 install-info-target: maybe-install-info-target-libitm
 install-info-target: maybe-install-info-target-libatomic
 
+.PHONY: do-install-dvi
+do-install-dvi:
+	@: $(MAKE); $(unstage)
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS) install-dvi-host \
+	  install-dvi-target
+
+
+.PHONY: install-dvi-host
+
+install-dvi-host: maybe-install-dvi-bfd
+install-dvi-host: maybe-install-dvi-opcodes
+install-dvi-host: maybe-install-dvi-binutils
+install-dvi-host: maybe-install-dvi-bison
+install-dvi-host: maybe-install-dvi-cgen
+install-dvi-host: maybe-install-dvi-dejagnu
+install-dvi-host: maybe-install-dvi-etc
+install-dvi-host: maybe-install-dvi-fastjar
+install-dvi-host: maybe-install-dvi-fixincludes
+install-dvi-host: maybe-install-dvi-flex
+install-dvi-host: maybe-install-dvi-gas
+install-dvi-host: maybe-install-dvi-gcc
+install-dvi-host: maybe-install-dvi-gmp
+install-dvi-host: maybe-install-dvi-mpfr
+install-dvi-host: maybe-install-dvi-mpc
+install-dvi-host: maybe-install-dvi-isl
+install-dvi-host: maybe-install-dvi-libelf
+install-dvi-host: maybe-install-dvi-gold
+install-dvi-host: maybe-install-dvi-gprof
+install-dvi-host: maybe-install-dvi-intl
+install-dvi-host: maybe-install-dvi-tcl
+install-dvi-host: maybe-install-dvi-itcl
+install-dvi-host: maybe-install-dvi-ld
+install-dvi-host: maybe-install-dvi-libbacktrace
+install-dvi-host: maybe-install-dvi-libcpp
+install-dvi-host: maybe-install-dvi-libcody
+install-dvi-host: maybe-install-dvi-libdecnumber
+install-dvi-host: maybe-install-dvi-libgui
+install-dvi-host: maybe-install-dvi-libiberty
+install-dvi-host: maybe-install-dvi-libiberty-linker-plugin
+install-dvi-host: maybe-install-dvi-libiconv
+install-dvi-host: maybe-install-dvi-m4
+install-dvi-host: maybe-install-dvi-readline
+install-dvi-host: maybe-install-dvi-sid
+install-dvi-host: maybe-install-dvi-sim
+install-dvi-host: maybe-install-dvi-texinfo
+install-dvi-host: maybe-install-dvi-zlib
+install-dvi-host: maybe-install-dvi-gnulib
+install-dvi-host: maybe-install-dvi-gdbsupport
+install-dvi-host: maybe-install-dvi-gdbserver
+install-dvi-host: maybe-install-dvi-gdb
+install-dvi-host: maybe-install-dvi-expect
+install-dvi-host: maybe-install-dvi-guile
+install-dvi-host: maybe-install-dvi-tk
+install-dvi-host: maybe-install-dvi-libtermcap
+install-dvi-host: maybe-install-dvi-utils
+install-dvi-host: maybe-install-dvi-c++tools
+install-dvi-host: maybe-install-dvi-gnattools
+install-dvi-host: maybe-install-dvi-lto-plugin
+install-dvi-host: maybe-install-dvi-libcc1
+install-dvi-host: maybe-install-dvi-gotools
+install-dvi-host: maybe-install-dvi-libctf
+
+.PHONY: install-dvi-target
+
+install-dvi-target: maybe-install-dvi-target-libstdc++-v3
+install-dvi-target: maybe-install-dvi-target-libsanitizer
+install-dvi-target: maybe-install-dvi-target-libvtv
+install-dvi-target: maybe-install-dvi-target-liboffloadmic
+install-dvi-target: maybe-install-dvi-target-libssp
+install-dvi-target: maybe-install-dvi-target-newlib
+install-dvi-target: maybe-install-dvi-target-libgcc
+install-dvi-target: maybe-install-dvi-target-libbacktrace
+install-dvi-target: maybe-install-dvi-target-libquadmath
+install-dvi-target: maybe-install-dvi-target-libgfortran
+install-dvi-target: maybe-install-dvi-target-libobjc
+install-dvi-target: maybe-install-dvi-target-libgo
+install-dvi-target: maybe-install-dvi-target-libphobos
+install-dvi-target: maybe-install-dvi-target-libtermcap
+install-dvi-target: maybe-install-dvi-target-winsup
+install-dvi-target: maybe-install-dvi-target-libgloss
+install-dvi-target: maybe-install-dvi-target-libffi
+install-dvi-target: maybe-install-dvi-target-zlib
+install-dvi-target: maybe-install-dvi-target-rda
+install-dvi-target: maybe-install-dvi-target-libada
+install-dvi-target: maybe-install-dvi-target-libgomp
+install-dvi-target: maybe-install-dvi-target-libitm
+install-dvi-target: maybe-install-dvi-target-libatomic
+
 .PHONY: do-install-pdf
 do-install-pdf:
 	@: $(MAKE); $(unstage)
@@ -2436,7 +2526,7 @@
 # Here are the targets which correspond to the do-X targets.
 
 .PHONY: info installcheck dvi pdf html
-.PHONY: install-info install-pdf install-html
+.PHONY: install-info install-dvi install-pdf install-html
 .PHONY: clean distclean mostlyclean maintainer-clean realclean
 .PHONY: local-clean local-distclean local-maintainer-clean
 info: do-info
@@ -2455,6 +2545,8 @@
 	  $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info; \
 	else true; fi
 
+install-dvi: do-install-dvi
+
 install-pdf: do-install-pdf
 
 install-html: do-install-html
@@ -4267,6 +4359,32 @@
 
 @endif bfd
 
+.PHONY: maybe-install-dvi-bfd install-dvi-bfd
+maybe-install-dvi-bfd:
+@if bfd
+maybe-install-dvi-bfd: install-dvi-bfd
+
+install-dvi-bfd: \
+    configure-bfd \
+    dvi-bfd 
+	@[ -f ./bfd/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in bfd"; \
+	(cd $(HOST_SUBDIR)/bfd && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif bfd
+
 .PHONY: maybe-install-pdf-bfd install-pdf-bfd
 maybe-install-pdf-bfd:
 @if bfd
@@ -5381,6 +5499,32 @@
 
 @endif opcodes
 
+.PHONY: maybe-install-dvi-opcodes install-dvi-opcodes
+maybe-install-dvi-opcodes:
+@if opcodes
+maybe-install-dvi-opcodes: install-dvi-opcodes
+
+install-dvi-opcodes: \
+    configure-opcodes \
+    dvi-opcodes 
+	@[ -f ./opcodes/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in opcodes"; \
+	(cd $(HOST_SUBDIR)/opcodes && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif opcodes
+
 .PHONY: maybe-install-pdf-opcodes install-pdf-opcodes
 maybe-install-pdf-opcodes:
 @if opcodes
@@ -6495,6 +6639,32 @@
 
 @endif binutils
 
+.PHONY: maybe-install-dvi-binutils install-dvi-binutils
+maybe-install-dvi-binutils:
+@if binutils
+maybe-install-dvi-binutils: install-dvi-binutils
+
+install-dvi-binutils: \
+    configure-binutils \
+    dvi-binutils 
+	@[ -f ./binutils/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in binutils"; \
+	(cd $(HOST_SUBDIR)/binutils && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif binutils
+
 .PHONY: maybe-install-pdf-binutils install-pdf-binutils
 maybe-install-pdf-binutils:
 @if binutils
@@ -6932,6 +7102,33 @@
 
 @endif bison
 
+.PHONY: maybe-install-dvi-bison install-dvi-bison
+maybe-install-dvi-bison:
+@if bison
+maybe-install-dvi-bison: install-dvi-bison
+
+install-dvi-bison: \
+    configure-bison \
+    dvi-bison 
+	@: $(MAKE); $(unstage)
+	@[ -f ./bison/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in bison"; \
+	(cd $(HOST_SUBDIR)/bison && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif bison
+
 .PHONY: maybe-install-pdf-bison install-pdf-bison
 maybe-install-pdf-bison:
 @if bison
@@ -7373,6 +7570,33 @@
 
 @endif cgen
 
+.PHONY: maybe-install-dvi-cgen install-dvi-cgen
+maybe-install-dvi-cgen:
+@if cgen
+maybe-install-dvi-cgen: install-dvi-cgen
+
+install-dvi-cgen: \
+    configure-cgen \
+    dvi-cgen 
+	@: $(MAKE); $(unstage)
+	@[ -f ./cgen/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in cgen"; \
+	(cd $(HOST_SUBDIR)/cgen && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif cgen
+
 .PHONY: maybe-install-pdf-cgen install-pdf-cgen
 maybe-install-pdf-cgen:
 @if cgen
@@ -7814,6 +8038,33 @@
 
 @endif dejagnu
 
+.PHONY: maybe-install-dvi-dejagnu install-dvi-dejagnu
+maybe-install-dvi-dejagnu:
+@if dejagnu
+maybe-install-dvi-dejagnu: install-dvi-dejagnu
+
+install-dvi-dejagnu: \
+    configure-dejagnu \
+    dvi-dejagnu 
+	@: $(MAKE); $(unstage)
+	@[ -f ./dejagnu/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in dejagnu"; \
+	(cd $(HOST_SUBDIR)/dejagnu && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif dejagnu
+
 .PHONY: maybe-install-pdf-dejagnu install-pdf-dejagnu
 maybe-install-pdf-dejagnu:
 @if dejagnu
@@ -8255,6 +8506,33 @@
 
 @endif etc
 
+.PHONY: maybe-install-dvi-etc install-dvi-etc
+maybe-install-dvi-etc:
+@if etc
+maybe-install-dvi-etc: install-dvi-etc
+
+install-dvi-etc: \
+    configure-etc \
+    dvi-etc 
+	@: $(MAKE); $(unstage)
+	@[ -f ./etc/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in etc"; \
+	(cd $(HOST_SUBDIR)/etc && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif etc
+
 .PHONY: maybe-install-pdf-etc install-pdf-etc
 maybe-install-pdf-etc:
 @if etc
@@ -8699,6 +8977,33 @@
 
 @endif fastjar
 
+.PHONY: maybe-install-dvi-fastjar install-dvi-fastjar
+maybe-install-dvi-fastjar:
+@if fastjar
+maybe-install-dvi-fastjar: install-dvi-fastjar
+
+install-dvi-fastjar: \
+    configure-fastjar \
+    dvi-fastjar 
+	@: $(MAKE); $(unstage)
+	@[ -f ./fastjar/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in fastjar"; \
+	(cd $(HOST_SUBDIR)/fastjar && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif fastjar
+
 .PHONY: maybe-install-pdf-fastjar install-pdf-fastjar
 maybe-install-pdf-fastjar:
 @if fastjar
@@ -9805,6 +10110,16 @@
 
 @endif fixincludes
 
+.PHONY: maybe-install-dvi-fixincludes install-dvi-fixincludes
+maybe-install-dvi-fixincludes:
+@if fixincludes
+maybe-install-dvi-fixincludes: install-dvi-fixincludes
+
+# fixincludes doesn't support install-dvi.
+install-dvi-fixincludes:
+
+@endif fixincludes
+
 .PHONY: maybe-install-pdf-fixincludes install-pdf-fixincludes
 maybe-install-pdf-fixincludes:
 @if fixincludes
@@ -10242,6 +10557,33 @@
 
 @endif flex
 
+.PHONY: maybe-install-dvi-flex install-dvi-flex
+maybe-install-dvi-flex:
+@if flex
+maybe-install-dvi-flex: install-dvi-flex
+
+install-dvi-flex: \
+    configure-flex \
+    dvi-flex 
+	@: $(MAKE); $(unstage)
+	@[ -f ./flex/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in flex"; \
+	(cd $(HOST_SUBDIR)/flex && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif flex
+
 .PHONY: maybe-install-pdf-flex install-pdf-flex
 maybe-install-pdf-flex:
 @if flex
@@ -11363,6 +11705,32 @@
 
 @endif gas
 
+.PHONY: maybe-install-dvi-gas install-dvi-gas
+maybe-install-dvi-gas:
+@if gas
+maybe-install-dvi-gas: install-dvi-gas
+
+install-dvi-gas: \
+    configure-gas \
+    dvi-gas 
+	@[ -f ./gas/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in gas"; \
+	(cd $(HOST_SUBDIR)/gas && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif gas
+
 .PHONY: maybe-install-pdf-gas install-pdf-gas
 maybe-install-pdf-gas:
 @if gas
@@ -12477,6 +12845,32 @@
 
 @endif gcc
 
+.PHONY: maybe-install-dvi-gcc install-dvi-gcc
+maybe-install-dvi-gcc:
+@if gcc
+maybe-install-dvi-gcc: install-dvi-gcc
+
+install-dvi-gcc: \
+    configure-gcc \
+    dvi-gcc 
+	@[ -f ./gcc/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in gcc"; \
+	(cd $(HOST_SUBDIR)/gcc && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif gcc
+
 .PHONY: maybe-install-pdf-gcc install-pdf-gcc
 maybe-install-pdf-gcc:
 @if gcc
@@ -13588,6 +13982,32 @@
 
 @endif gmp
 
+.PHONY: maybe-install-dvi-gmp install-dvi-gmp
+maybe-install-dvi-gmp:
+@if gmp
+maybe-install-dvi-gmp: install-dvi-gmp
+
+install-dvi-gmp: \
+    configure-gmp \
+    dvi-gmp 
+	@[ -f ./gmp/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in gmp"; \
+	(cd $(HOST_SUBDIR)/gmp && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif gmp
+
 .PHONY: maybe-install-pdf-gmp install-pdf-gmp
 maybe-install-pdf-gmp:
 @if gmp
@@ -14699,6 +15119,32 @@
 
 @endif mpfr
 
+.PHONY: maybe-install-dvi-mpfr install-dvi-mpfr
+maybe-install-dvi-mpfr:
+@if mpfr
+maybe-install-dvi-mpfr: install-dvi-mpfr
+
+install-dvi-mpfr: \
+    configure-mpfr \
+    dvi-mpfr 
+	@[ -f ./mpfr/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) AM_CFLAGS="-DNO_ASM"; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in mpfr"; \
+	(cd $(HOST_SUBDIR)/mpfr && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif mpfr
+
 .PHONY: maybe-install-pdf-mpfr install-pdf-mpfr
 maybe-install-pdf-mpfr:
 @if mpfr
@@ -15810,6 +16256,32 @@
 
 @endif mpc
 
+.PHONY: maybe-install-dvi-mpc install-dvi-mpc
+maybe-install-dvi-mpc:
+@if mpc
+maybe-install-dvi-mpc: install-dvi-mpc
+
+install-dvi-mpc: \
+    configure-mpc \
+    dvi-mpc 
+	@[ -f ./mpc/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in mpc"; \
+	(cd $(HOST_SUBDIR)/mpc && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif mpc
+
 .PHONY: maybe-install-pdf-mpc install-pdf-mpc
 maybe-install-pdf-mpc:
 @if mpc
@@ -16921,6 +17393,32 @@
 
 @endif isl
 
+.PHONY: maybe-install-dvi-isl install-dvi-isl
+maybe-install-dvi-isl:
+@if isl
+maybe-install-dvi-isl: install-dvi-isl
+
+install-dvi-isl: \
+    configure-isl \
+    dvi-isl 
+	@[ -f ./isl/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) V=1; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in isl"; \
+	(cd $(HOST_SUBDIR)/isl && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif isl
+
 .PHONY: maybe-install-pdf-isl install-pdf-isl
 maybe-install-pdf-isl:
 @if isl
@@ -18032,6 +18530,32 @@
 
 @endif libelf
 
+.PHONY: maybe-install-dvi-libelf install-dvi-libelf
+maybe-install-dvi-libelf:
+@if libelf
+maybe-install-dvi-libelf: install-dvi-libelf
+
+install-dvi-libelf: \
+    configure-libelf \
+    dvi-libelf 
+	@[ -f ./libelf/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in libelf"; \
+	(cd $(HOST_SUBDIR)/libelf && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif libelf
+
 .PHONY: maybe-install-pdf-libelf install-pdf-libelf
 maybe-install-pdf-libelf:
 @if libelf
@@ -19146,6 +19670,32 @@
 
 @endif gold
 
+.PHONY: maybe-install-dvi-gold install-dvi-gold
+maybe-install-dvi-gold:
+@if gold
+maybe-install-dvi-gold: install-dvi-gold
+
+install-dvi-gold: \
+    configure-gold \
+    dvi-gold 
+	@[ -f ./gold/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in gold"; \
+	(cd $(HOST_SUBDIR)/gold && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif gold
+
 .PHONY: maybe-install-pdf-gold install-pdf-gold
 maybe-install-pdf-gold:
 @if gold
@@ -19580,6 +20130,33 @@
 
 @endif gprof
 
+.PHONY: maybe-install-dvi-gprof install-dvi-gprof
+maybe-install-dvi-gprof:
+@if gprof
+maybe-install-dvi-gprof: install-dvi-gprof
+
+install-dvi-gprof: \
+    configure-gprof \
+    dvi-gprof 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gprof/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in gprof"; \
+	(cd $(HOST_SUBDIR)/gprof && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif gprof
+
 .PHONY: maybe-install-pdf-gprof install-pdf-gprof
 maybe-install-pdf-gprof:
 @if gprof
@@ -20701,6 +21278,32 @@
 
 @endif intl
 
+.PHONY: maybe-install-dvi-intl install-dvi-intl
+maybe-install-dvi-intl:
+@if intl
+maybe-install-dvi-intl: install-dvi-intl
+
+install-dvi-intl: \
+    configure-intl \
+    dvi-intl 
+	@[ -f ./intl/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in intl"; \
+	(cd $(HOST_SUBDIR)/intl && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif intl
+
 .PHONY: maybe-install-pdf-intl install-pdf-intl
 maybe-install-pdf-intl:
 @if intl
@@ -21135,6 +21738,33 @@
 
 @endif tcl
 
+.PHONY: maybe-install-dvi-tcl install-dvi-tcl
+maybe-install-dvi-tcl:
+@if tcl
+maybe-install-dvi-tcl: install-dvi-tcl
+
+install-dvi-tcl: \
+    configure-tcl \
+    dvi-tcl 
+	@: $(MAKE); $(unstage)
+	@[ -f ./tcl/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in tcl"; \
+	(cd $(HOST_SUBDIR)/tcl && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif tcl
+
 .PHONY: maybe-install-pdf-tcl install-pdf-tcl
 maybe-install-pdf-tcl:
 @if tcl
@@ -21561,6 +22191,33 @@
 
 @endif itcl
 
+.PHONY: maybe-install-dvi-itcl install-dvi-itcl
+maybe-install-dvi-itcl:
+@if itcl
+maybe-install-dvi-itcl: install-dvi-itcl
+
+install-dvi-itcl: \
+    configure-itcl \
+    dvi-itcl 
+	@: $(MAKE); $(unstage)
+	@[ -f ./itcl/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in itcl"; \
+	(cd $(HOST_SUBDIR)/itcl && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif itcl
+
 .PHONY: maybe-install-pdf-itcl install-pdf-itcl
 maybe-install-pdf-itcl:
 @if itcl
@@ -22682,6 +23339,32 @@
 
 @endif ld
 
+.PHONY: maybe-install-dvi-ld install-dvi-ld
+maybe-install-dvi-ld:
+@if ld
+maybe-install-dvi-ld: install-dvi-ld
+
+install-dvi-ld: \
+    configure-ld \
+    dvi-ld 
+	@[ -f ./ld/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in ld"; \
+	(cd $(HOST_SUBDIR)/ld && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif ld
+
 .PHONY: maybe-install-pdf-ld install-pdf-ld
 maybe-install-pdf-ld:
 @if ld
@@ -23796,6 +24479,32 @@
 
 @endif libbacktrace
 
+.PHONY: maybe-install-dvi-libbacktrace install-dvi-libbacktrace
+maybe-install-dvi-libbacktrace:
+@if libbacktrace
+maybe-install-dvi-libbacktrace: install-dvi-libbacktrace
+
+install-dvi-libbacktrace: \
+    configure-libbacktrace \
+    dvi-libbacktrace 
+	@[ -f ./libbacktrace/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in libbacktrace"; \
+	(cd $(HOST_SUBDIR)/libbacktrace && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif libbacktrace
+
 .PHONY: maybe-install-pdf-libbacktrace install-pdf-libbacktrace
 maybe-install-pdf-libbacktrace:
 @if libbacktrace
@@ -24910,6 +25619,32 @@
 
 @endif libcpp
 
+.PHONY: maybe-install-dvi-libcpp install-dvi-libcpp
+maybe-install-dvi-libcpp:
+@if libcpp
+maybe-install-dvi-libcpp: install-dvi-libcpp
+
+install-dvi-libcpp: \
+    configure-libcpp \
+    dvi-libcpp 
+	@[ -f ./libcpp/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in libcpp"; \
+	(cd $(HOST_SUBDIR)/libcpp && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif libcpp
+
 .PHONY: maybe-install-pdf-libcpp install-pdf-libcpp
 maybe-install-pdf-libcpp:
 @if libcpp
@@ -25876,23 +26611,8 @@
 @if libcody
 maybe-dvi-libcody: dvi-libcody
 
-dvi-libcody: \
-    configure-libcody 
-	@[ -f ./libcody/Makefile ] || exit 0; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
-	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
-	done; \
-	echo "Doing dvi in libcody"; \
-	(cd $(HOST_SUBDIR)/libcody && \
-	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
-	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
-	          "RANLIB=$${RANLIB}" \
-	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
-	          dvi) \
-	  || exit 1
+# libcody doesn't support dvi.
+dvi-libcody:
 
 @endif libcody
 
@@ -25921,23 +26641,8 @@
 @if libcody
 maybe-TAGS-libcody: TAGS-libcody
 
-TAGS-libcody: \
-    configure-libcody 
-	@[ -f ./libcody/Makefile ] || exit 0; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
-	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
-	done; \
-	echo "Doing TAGS in libcody"; \
-	(cd $(HOST_SUBDIR)/libcody && \
-	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
-	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
-	          "RANLIB=$${RANLIB}" \
-	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
-	          TAGS) \
-	  || exit 1
+# libcody doesn't support TAGS.
+TAGS-libcody:
 
 @endif libcody
 
@@ -25951,6 +26656,16 @@
 
 @endif libcody
 
+.PHONY: maybe-install-dvi-libcody install-dvi-libcody
+maybe-install-dvi-libcody:
+@if libcody
+maybe-install-dvi-libcody: install-dvi-libcody
+
+# libcody doesn't support install-dvi.
+install-dvi-libcody:
+
+@endif libcody
+
 .PHONY: maybe-install-pdf-libcody install-pdf-libcody
 maybe-install-pdf-libcody:
 @if libcody
@@ -26987,23 +27702,8 @@
 @if libdecnumber
 maybe-TAGS-libdecnumber: TAGS-libdecnumber
 
-TAGS-libdecnumber: \
-    configure-libdecnumber 
-	@[ -f ./libdecnumber/Makefile ] || exit 0; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
-	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
-	done; \
-	echo "Doing TAGS in libdecnumber"; \
-	(cd $(HOST_SUBDIR)/libdecnumber && \
-	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
-	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
-	          "RANLIB=$${RANLIB}" \
-	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
-	          TAGS) \
-	  || exit 1
+# libdecnumber doesn't support TAGS.
+TAGS-libdecnumber:
 
 @endif libdecnumber
 
@@ -27033,6 +27733,32 @@
 
 @endif libdecnumber
 
+.PHONY: maybe-install-dvi-libdecnumber install-dvi-libdecnumber
+maybe-install-dvi-libdecnumber:
+@if libdecnumber
+maybe-install-dvi-libdecnumber: install-dvi-libdecnumber
+
+install-dvi-libdecnumber: \
+    configure-libdecnumber \
+    dvi-libdecnumber 
+	@[ -f ./libdecnumber/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in libdecnumber"; \
+	(cd $(HOST_SUBDIR)/libdecnumber && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif libdecnumber
+
 .PHONY: maybe-install-pdf-libdecnumber install-pdf-libdecnumber
 maybe-install-pdf-libdecnumber:
 @if libdecnumber
@@ -27467,6 +28193,33 @@
 
 @endif libgui
 
+.PHONY: maybe-install-dvi-libgui install-dvi-libgui
+maybe-install-dvi-libgui:
+@if libgui
+maybe-install-dvi-libgui: install-dvi-libgui
+
+install-dvi-libgui: \
+    configure-libgui \
+    dvi-libgui 
+	@: $(MAKE); $(unstage)
+	@[ -f ./libgui/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in libgui"; \
+	(cd $(HOST_SUBDIR)/libgui && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif libgui
+
 .PHONY: maybe-install-pdf-libgui install-pdf-libgui
 maybe-install-pdf-libgui:
 @if libgui
@@ -28597,6 +29350,32 @@
 
 @endif libiberty
 
+.PHONY: maybe-install-dvi-libiberty install-dvi-libiberty
+maybe-install-dvi-libiberty:
+@if libiberty
+maybe-install-dvi-libiberty: install-dvi-libiberty
+
+install-dvi-libiberty: \
+    configure-libiberty \
+    dvi-libiberty 
+	@[ -f ./libiberty/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in libiberty"; \
+	(cd $(HOST_SUBDIR)/libiberty && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif libiberty
+
 .PHONY: maybe-install-pdf-libiberty install-pdf-libiberty
 maybe-install-pdf-libiberty:
 @if libiberty
@@ -29720,6 +30499,32 @@
 
 @endif libiberty-linker-plugin
 
+.PHONY: maybe-install-dvi-libiberty-linker-plugin install-dvi-libiberty-linker-plugin
+maybe-install-dvi-libiberty-linker-plugin:
+@if libiberty-linker-plugin
+maybe-install-dvi-libiberty-linker-plugin: install-dvi-libiberty-linker-plugin
+
+install-dvi-libiberty-linker-plugin: \
+    configure-libiberty-linker-plugin \
+    dvi-libiberty-linker-plugin 
+	@[ -f ./libiberty-linker-plugin/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) @extra_linker_plugin_flags@; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in libiberty-linker-plugin"; \
+	(cd $(HOST_SUBDIR)/libiberty-linker-plugin && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif libiberty-linker-plugin
+
 .PHONY: maybe-install-pdf-libiberty-linker-plugin install-pdf-libiberty-linker-plugin
 maybe-install-pdf-libiberty-linker-plugin:
 @if libiberty-linker-plugin
@@ -30770,6 +31575,32 @@
 
 @endif libiconv
 
+.PHONY: maybe-install-dvi-libiconv install-dvi-libiconv
+maybe-install-dvi-libiconv:
+@if libiconv
+maybe-install-dvi-libiconv: install-dvi-libiconv
+
+install-dvi-libiconv: \
+    configure-libiconv \
+    dvi-libiconv 
+	@[ -f ./libiconv/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in libiconv"; \
+	(cd $(HOST_SUBDIR)/libiconv && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif libiconv
+
 .PHONY: maybe-install-pdf-libiconv install-pdf-libiconv
 maybe-install-pdf-libiconv:
 @if libiconv
@@ -31172,6 +32003,33 @@
 
 @endif m4
 
+.PHONY: maybe-install-dvi-m4 install-dvi-m4
+maybe-install-dvi-m4:
+@if m4
+maybe-install-dvi-m4: install-dvi-m4
+
+install-dvi-m4: \
+    configure-m4 \
+    dvi-m4 
+	@: $(MAKE); $(unstage)
+	@[ -f ./m4/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in m4"; \
+	(cd $(HOST_SUBDIR)/m4 && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif m4
+
 .PHONY: maybe-install-pdf-m4 install-pdf-m4
 maybe-install-pdf-m4:
 @if m4
@@ -31613,6 +32471,33 @@
 
 @endif readline
 
+.PHONY: maybe-install-dvi-readline install-dvi-readline
+maybe-install-dvi-readline:
+@if readline
+maybe-install-dvi-readline: install-dvi-readline
+
+install-dvi-readline: \
+    configure-readline \
+    dvi-readline 
+	@: $(MAKE); $(unstage)
+	@[ -f ./readline/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in readline"; \
+	(cd $(HOST_SUBDIR)/readline && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif readline
+
 .PHONY: maybe-install-pdf-readline install-pdf-readline
 maybe-install-pdf-readline:
 @if readline
@@ -32054,6 +32939,33 @@
 
 @endif sid
 
+.PHONY: maybe-install-dvi-sid install-dvi-sid
+maybe-install-dvi-sid:
+@if sid
+maybe-install-dvi-sid: install-dvi-sid
+
+install-dvi-sid: \
+    configure-sid \
+    dvi-sid 
+	@: $(MAKE); $(unstage)
+	@[ -f ./sid/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in sid"; \
+	(cd $(HOST_SUBDIR)/sid && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif sid
+
 .PHONY: maybe-install-pdf-sid install-pdf-sid
 maybe-install-pdf-sid:
 @if sid
@@ -32495,6 +33407,33 @@
 
 @endif sim
 
+.PHONY: maybe-install-dvi-sim install-dvi-sim
+maybe-install-dvi-sim:
+@if sim
+maybe-install-dvi-sim: install-dvi-sim
+
+install-dvi-sim: \
+    configure-sim \
+    dvi-sim 
+	@: $(MAKE); $(unstage)
+	@[ -f ./sim/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in sim"; \
+	(cd $(HOST_SUBDIR)/sim && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif sim
+
 .PHONY: maybe-install-pdf-sim install-pdf-sim
 maybe-install-pdf-sim:
 @if sim
@@ -32924,6 +33863,33 @@
 
 @endif texinfo
 
+.PHONY: maybe-install-dvi-texinfo install-dvi-texinfo
+maybe-install-dvi-texinfo:
+@if texinfo
+maybe-install-dvi-texinfo: install-dvi-texinfo
+
+install-dvi-texinfo: \
+    configure-texinfo \
+    dvi-texinfo 
+	@: $(MAKE); $(unstage)
+	@[ -f ./texinfo/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in texinfo"; \
+	(cd $(HOST_SUBDIR)/texinfo && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif texinfo
+
 .PHONY: maybe-install-pdf-texinfo install-pdf-texinfo
 maybe-install-pdf-texinfo:
 @if texinfo
@@ -34036,6 +35002,32 @@
 
 @endif zlib
 
+.PHONY: maybe-install-dvi-zlib install-dvi-zlib
+maybe-install-dvi-zlib:
+@if zlib
+maybe-install-dvi-zlib: install-dvi-zlib
+
+install-dvi-zlib: \
+    configure-zlib \
+    dvi-zlib 
+	@[ -f ./zlib/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in zlib"; \
+	(cd $(HOST_SUBDIR)/zlib && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif zlib
+
 .PHONY: maybe-install-pdf-zlib install-pdf-zlib
 maybe-install-pdf-zlib:
 @if zlib
@@ -34470,6 +35462,33 @@
 
 @endif gnulib
 
+.PHONY: maybe-install-dvi-gnulib install-dvi-gnulib
+maybe-install-dvi-gnulib:
+@if gnulib
+maybe-install-dvi-gnulib: install-dvi-gnulib
+
+install-dvi-gnulib: \
+    configure-gnulib \
+    dvi-gnulib 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gnulib/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in gnulib"; \
+	(cd $(HOST_SUBDIR)/gnulib && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif gnulib
+
 .PHONY: maybe-install-pdf-gnulib install-pdf-gnulib
 maybe-install-pdf-gnulib:
 @if gnulib
@@ -34911,6 +35930,33 @@
 
 @endif gdbsupport
 
+.PHONY: maybe-install-dvi-gdbsupport install-dvi-gdbsupport
+maybe-install-dvi-gdbsupport:
+@if gdbsupport
+maybe-install-dvi-gdbsupport: install-dvi-gdbsupport
+
+install-dvi-gdbsupport: \
+    configure-gdbsupport \
+    dvi-gdbsupport 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gdbsupport/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in gdbsupport"; \
+	(cd $(HOST_SUBDIR)/gdbsupport && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif gdbsupport
+
 .PHONY: maybe-install-pdf-gdbsupport install-pdf-gdbsupport
 maybe-install-pdf-gdbsupport:
 @if gdbsupport
@@ -35352,6 +36398,33 @@
 
 @endif gdbserver
 
+.PHONY: maybe-install-dvi-gdbserver install-dvi-gdbserver
+maybe-install-dvi-gdbserver:
+@if gdbserver
+maybe-install-dvi-gdbserver: install-dvi-gdbserver
+
+install-dvi-gdbserver: \
+    configure-gdbserver \
+    dvi-gdbserver 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gdbserver/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in gdbserver"; \
+	(cd $(HOST_SUBDIR)/gdbserver && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif gdbserver
+
 .PHONY: maybe-install-pdf-gdbserver install-pdf-gdbserver
 maybe-install-pdf-gdbserver:
 @if gdbserver
@@ -35793,6 +36866,33 @@
 
 @endif gdb
 
+.PHONY: maybe-install-dvi-gdb install-dvi-gdb
+maybe-install-dvi-gdb:
+@if gdb
+maybe-install-dvi-gdb: install-dvi-gdb
+
+install-dvi-gdb: \
+    configure-gdb \
+    dvi-gdb 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gdb/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in gdb"; \
+	(cd $(HOST_SUBDIR)/gdb && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif gdb
+
 .PHONY: maybe-install-pdf-gdb install-pdf-gdb
 maybe-install-pdf-gdb:
 @if gdb
@@ -36234,6 +37334,33 @@
 
 @endif expect
 
+.PHONY: maybe-install-dvi-expect install-dvi-expect
+maybe-install-dvi-expect:
+@if expect
+maybe-install-dvi-expect: install-dvi-expect
+
+install-dvi-expect: \
+    configure-expect \
+    dvi-expect 
+	@: $(MAKE); $(unstage)
+	@[ -f ./expect/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in expect"; \
+	(cd $(HOST_SUBDIR)/expect && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif expect
+
 .PHONY: maybe-install-pdf-expect install-pdf-expect
 maybe-install-pdf-expect:
 @if expect
@@ -36675,6 +37802,33 @@
 
 @endif guile
 
+.PHONY: maybe-install-dvi-guile install-dvi-guile
+maybe-install-dvi-guile:
+@if guile
+maybe-install-dvi-guile: install-dvi-guile
+
+install-dvi-guile: \
+    configure-guile \
+    dvi-guile 
+	@: $(MAKE); $(unstage)
+	@[ -f ./guile/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in guile"; \
+	(cd $(HOST_SUBDIR)/guile && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif guile
+
 .PHONY: maybe-install-pdf-guile install-pdf-guile
 maybe-install-pdf-guile:
 @if guile
@@ -37116,6 +38270,33 @@
 
 @endif tk
 
+.PHONY: maybe-install-dvi-tk install-dvi-tk
+maybe-install-dvi-tk:
+@if tk
+maybe-install-dvi-tk: install-dvi-tk
+
+install-dvi-tk: \
+    configure-tk \
+    dvi-tk 
+	@: $(MAKE); $(unstage)
+	@[ -f ./tk/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in tk"; \
+	(cd $(HOST_SUBDIR)/tk && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif tk
+
 .PHONY: maybe-install-pdf-tk install-pdf-tk
 maybe-install-pdf-tk:
 @if tk
@@ -37551,6 +38732,33 @@
 
 @endif libtermcap
 
+.PHONY: maybe-install-dvi-libtermcap install-dvi-libtermcap
+maybe-install-dvi-libtermcap:
+@if libtermcap
+maybe-install-dvi-libtermcap: install-dvi-libtermcap
+
+install-dvi-libtermcap: \
+    configure-libtermcap \
+    dvi-libtermcap 
+	@: $(MAKE); $(unstage)
+	@[ -f ./libtermcap/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in libtermcap"; \
+	(cd $(HOST_SUBDIR)/libtermcap && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif libtermcap
+
 .PHONY: maybe-install-pdf-libtermcap install-pdf-libtermcap
 maybe-install-pdf-libtermcap:
 @if libtermcap
@@ -37926,6 +39134,33 @@
 
 @endif utils
 
+.PHONY: maybe-install-dvi-utils install-dvi-utils
+maybe-install-dvi-utils:
+@if utils
+maybe-install-dvi-utils: install-dvi-utils
+
+install-dvi-utils: \
+    configure-utils \
+    dvi-utils 
+	@: $(MAKE); $(unstage)
+	@[ -f ./utils/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in utils"; \
+	(cd $(HOST_SUBDIR)/utils && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif utils
+
 .PHONY: maybe-install-pdf-utils install-pdf-utils
 maybe-install-pdf-utils:
 @if utils
@@ -38319,24 +39554,8 @@
 @if c++tools
 maybe-TAGS-c++tools: TAGS-c++tools
 
-TAGS-c++tools: \
-    configure-c++tools 
-	@: $(MAKE); $(unstage)
-	@[ -f ./c++tools/Makefile ] || exit 0; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(HOST_EXPORTS) \
-	for flag in $(EXTRA_HOST_FLAGS) ; do \
-	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
-	done; \
-	echo "Doing TAGS in c++tools"; \
-	(cd $(HOST_SUBDIR)/c++tools && \
-	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
-	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
-	          "RANLIB=$${RANLIB}" \
-	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
-	          TAGS) \
-	  || exit 1
+# c++tools doesn't support TAGS.
+TAGS-c++tools:
 
 @endif c++tools
 
@@ -38367,6 +39586,33 @@
 
 @endif c++tools
 
+.PHONY: maybe-install-dvi-c++tools install-dvi-c++tools
+maybe-install-dvi-c++tools:
+@if c++tools
+maybe-install-dvi-c++tools: install-dvi-c++tools
+
+install-dvi-c++tools: \
+    configure-c++tools \
+    dvi-c++tools 
+	@: $(MAKE); $(unstage)
+	@[ -f ./c++tools/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in c++tools"; \
+	(cd $(HOST_SUBDIR)/c++tools && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif c++tools
+
 .PHONY: maybe-install-pdf-c++tools install-pdf-c++tools
 maybe-install-pdf-c++tools:
 @if c++tools
@@ -38808,6 +40054,33 @@
 
 @endif gnattools
 
+.PHONY: maybe-install-dvi-gnattools install-dvi-gnattools
+maybe-install-dvi-gnattools:
+@if gnattools
+maybe-install-dvi-gnattools: install-dvi-gnattools
+
+install-dvi-gnattools: \
+    configure-gnattools \
+    dvi-gnattools 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gnattools/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in gnattools"; \
+	(cd $(HOST_SUBDIR)/gnattools && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif gnattools
+
 .PHONY: maybe-install-pdf-gnattools install-pdf-gnattools
 maybe-install-pdf-gnattools:
 @if gnattools
@@ -39938,6 +41211,32 @@
 
 @endif lto-plugin
 
+.PHONY: maybe-install-dvi-lto-plugin install-dvi-lto-plugin
+maybe-install-dvi-lto-plugin:
+@if lto-plugin
+maybe-install-dvi-lto-plugin: install-dvi-lto-plugin
+
+install-dvi-lto-plugin: \
+    configure-lto-plugin \
+    dvi-lto-plugin 
+	@[ -f ./lto-plugin/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) @extra_linker_plugin_flags@; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in lto-plugin"; \
+	(cd $(HOST_SUBDIR)/lto-plugin && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif lto-plugin
+
 .PHONY: maybe-install-pdf-lto-plugin install-pdf-lto-plugin
 maybe-install-pdf-lto-plugin:
 @if lto-plugin
@@ -40372,6 +41671,33 @@
 
 @endif libcc1
 
+.PHONY: maybe-install-dvi-libcc1 install-dvi-libcc1
+maybe-install-dvi-libcc1:
+@if libcc1
+maybe-install-dvi-libcc1: install-dvi-libcc1
+
+install-dvi-libcc1: \
+    configure-libcc1 \
+    dvi-libcc1 
+	@: $(MAKE); $(unstage)
+	@[ -f ./libcc1/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in libcc1"; \
+	(cd $(HOST_SUBDIR)/libcc1 && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif libcc1
+
 .PHONY: maybe-install-pdf-libcc1 install-pdf-libcc1
 maybe-install-pdf-libcc1:
 @if libcc1
@@ -40813,6 +42139,33 @@
 
 @endif gotools
 
+.PHONY: maybe-install-dvi-gotools install-dvi-gotools
+maybe-install-dvi-gotools:
+@if gotools
+maybe-install-dvi-gotools: install-dvi-gotools
+
+install-dvi-gotools: \
+    configure-gotools \
+    dvi-gotools 
+	@: $(MAKE); $(unstage)
+	@[ -f ./gotools/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in gotools"; \
+	(cd $(HOST_SUBDIR)/gotools && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif gotools
+
 .PHONY: maybe-install-pdf-gotools install-pdf-gotools
 maybe-install-pdf-gotools:
 @if gotools
@@ -41934,6 +43287,32 @@
 
 @endif libctf
 
+.PHONY: maybe-install-dvi-libctf install-dvi-libctf
+maybe-install-dvi-libctf:
+@if libctf
+maybe-install-dvi-libctf: install-dvi-libctf
+
+install-dvi-libctf: \
+    configure-libctf \
+    dvi-libctf 
+	@[ -f ./libctf/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS) ; do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-dvi in libctf"; \
+	(cd $(HOST_SUBDIR)/libctf && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	          install-dvi) \
+	  || exit 1
+
+@endif libctf
+
 .PHONY: maybe-install-pdf-libctf install-pdf-libctf
 maybe-install-pdf-libctf:
 @if libctf
@@ -43175,6 +44554,33 @@
 
 @endif target-libstdc++-v3
 
+.PHONY: maybe-install-dvi-target-libstdc++-v3 install-dvi-target-libstdc++-v3
+maybe-install-dvi-target-libstdc++-v3:
+@if target-libstdc++-v3
+maybe-install-dvi-target-libstdc++-v3: install-dvi-target-libstdc++-v3
+
+install-dvi-target-libstdc++-v3: \
+    configure-target-libstdc++-v3 \
+    dvi-target-libstdc++-v3 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(RAW_CXX_TARGET_EXPORTS) \
+	echo "Doing install-dvi in $(TARGET_SUBDIR)/libstdc++-v3"; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libstdc++-v3 && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           install-dvi) \
+	  || exit 1
+
+@endif target-libstdc++-v3
+
 .PHONY: maybe-install-pdf-target-libstdc++-v3 install-pdf-target-libstdc++-v3
 maybe-install-pdf-target-libstdc++-v3:
 @if target-libstdc++-v3
@@ -44418,6 +45824,33 @@
 
 @endif target-libsanitizer
 
+.PHONY: maybe-install-dvi-target-libsanitizer install-dvi-target-libsanitizer
+maybe-install-dvi-target-libsanitizer:
+@if target-libsanitizer
+maybe-install-dvi-target-libsanitizer: install-dvi-target-libsanitizer
+
+install-dvi-target-libsanitizer: \
+    configure-target-libsanitizer \
+    dvi-target-libsanitizer 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libsanitizer/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(RAW_CXX_TARGET_EXPORTS) \
+	echo "Doing install-dvi in $(TARGET_SUBDIR)/libsanitizer"; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libsanitizer && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           install-dvi) \
+	  || exit 1
+
+@endif target-libsanitizer
+
 .PHONY: maybe-install-pdf-target-libsanitizer install-pdf-target-libsanitizer
 maybe-install-pdf-target-libsanitizer:
 @if target-libsanitizer
@@ -45661,6 +47094,33 @@
 
 @endif target-libvtv
 
+.PHONY: maybe-install-dvi-target-libvtv install-dvi-target-libvtv
+maybe-install-dvi-target-libvtv:
+@if target-libvtv
+maybe-install-dvi-target-libvtv: install-dvi-target-libvtv
+
+install-dvi-target-libvtv: \
+    configure-target-libvtv \
+    dvi-target-libvtv 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libvtv/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(RAW_CXX_TARGET_EXPORTS) \
+	echo "Doing install-dvi in $(TARGET_SUBDIR)/libvtv"; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libvtv && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           install-dvi) \
+	  || exit 1
+
+@endif target-libvtv
+
 .PHONY: maybe-install-pdf-target-libvtv install-pdf-target-libvtv
 maybe-install-pdf-target-libvtv:
 @if target-libvtv
@@ -46119,6 +47579,33 @@
 
 @endif target-liboffloadmic
 
+.PHONY: maybe-install-dvi-target-liboffloadmic install-dvi-target-liboffloadmic
+maybe-install-dvi-target-liboffloadmic:
+@if target-liboffloadmic
+maybe-install-dvi-target-liboffloadmic: install-dvi-target-liboffloadmic
+
+install-dvi-target-liboffloadmic: \
+    configure-target-liboffloadmic \
+    dvi-target-liboffloadmic 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/liboffloadmic/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-dvi in $(TARGET_SUBDIR)/liboffloadmic"; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/liboffloadmic && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           install-dvi) \
+	  || exit 1
+
+@endif target-liboffloadmic
+
 .PHONY: maybe-install-pdf-target-liboffloadmic install-pdf-target-liboffloadmic
 maybe-install-pdf-target-liboffloadmic:
 @if target-liboffloadmic
@@ -46577,6 +48064,33 @@
 
 @endif target-libssp
 
+.PHONY: maybe-install-dvi-target-libssp install-dvi-target-libssp
+maybe-install-dvi-target-libssp:
+@if target-libssp
+maybe-install-dvi-target-libssp: install-dvi-target-libssp
+
+install-dvi-target-libssp: \
+    configure-target-libssp \
+    dvi-target-libssp 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libssp/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-dvi in $(TARGET_SUBDIR)/libssp"; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libssp && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           install-dvi) \
+	  || exit 1
+
+@endif target-libssp
+
 .PHONY: maybe-install-pdf-target-libssp install-pdf-target-libssp
 maybe-install-pdf-target-libssp:
 @if target-libssp
@@ -47035,6 +48549,33 @@
 
 @endif target-newlib
 
+.PHONY: maybe-install-dvi-target-newlib install-dvi-target-newlib
+maybe-install-dvi-target-newlib:
+@if target-newlib
+maybe-install-dvi-target-newlib: install-dvi-target-newlib
+
+install-dvi-target-newlib: \
+    configure-target-newlib \
+    dvi-target-newlib 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-dvi in $(TARGET_SUBDIR)/newlib"; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/newlib && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           install-dvi) \
+	  || exit 1
+
+@endif target-newlib
+
 .PHONY: maybe-install-pdf-target-newlib install-pdf-target-newlib
 maybe-install-pdf-target-newlib:
 @if target-newlib
@@ -48225,24 +49766,8 @@
 @if target-libgcc
 maybe-TAGS-target-libgcc: TAGS-target-libgcc
 
-TAGS-target-libgcc: \
-    configure-target-libgcc 
-	@: $(MAKE); $(unstage)
-	@[ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(NORMAL_TARGET_EXPORTS) \
-	echo "Doing TAGS in $(TARGET_SUBDIR)/libgcc"; \
-	for flag in $(EXTRA_TARGET_FLAGS); do \
-	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
-	done; \
-	(cd $(TARGET_SUBDIR)/libgcc && \
-	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
-	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
-	          "RANLIB=$${RANLIB}" \
-	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
-	           TAGS) \
-	  || exit 1
+# libgcc doesn't support TAGS.
+TAGS-target-libgcc:
 
 @endif target-libgcc
 
@@ -48273,6 +49798,16 @@
 
 @endif target-libgcc
 
+.PHONY: maybe-install-dvi-target-libgcc install-dvi-target-libgcc
+maybe-install-dvi-target-libgcc:
+@if target-libgcc
+maybe-install-dvi-target-libgcc: install-dvi-target-libgcc
+
+# libgcc doesn't support install-dvi.
+install-dvi-target-libgcc:
+
+@endif target-libgcc
+
 .PHONY: maybe-install-pdf-target-libgcc install-pdf-target-libgcc
 maybe-install-pdf-target-libgcc:
 @if target-libgcc
@@ -48731,6 +50266,33 @@
 
 @endif target-libbacktrace
 
+.PHONY: maybe-install-dvi-target-libbacktrace install-dvi-target-libbacktrace
+maybe-install-dvi-target-libbacktrace:
+@if target-libbacktrace
+maybe-install-dvi-target-libbacktrace: install-dvi-target-libbacktrace
+
+install-dvi-target-libbacktrace: \
+    configure-target-libbacktrace \
+    dvi-target-libbacktrace 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libbacktrace/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-dvi in $(TARGET_SUBDIR)/libbacktrace"; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libbacktrace && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           install-dvi) \
+	  || exit 1
+
+@endif target-libbacktrace
+
 .PHONY: maybe-install-pdf-target-libbacktrace install-pdf-target-libbacktrace
 maybe-install-pdf-target-libbacktrace:
 @if target-libbacktrace
@@ -49189,6 +50751,33 @@
 
 @endif target-libquadmath
 
+.PHONY: maybe-install-dvi-target-libquadmath install-dvi-target-libquadmath
+maybe-install-dvi-target-libquadmath:
+@if target-libquadmath
+maybe-install-dvi-target-libquadmath: install-dvi-target-libquadmath
+
+install-dvi-target-libquadmath: \
+    configure-target-libquadmath \
+    dvi-target-libquadmath 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libquadmath/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-dvi in $(TARGET_SUBDIR)/libquadmath"; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libquadmath && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           install-dvi) \
+	  || exit 1
+
+@endif target-libquadmath
+
 .PHONY: maybe-install-pdf-target-libquadmath install-pdf-target-libquadmath
 maybe-install-pdf-target-libquadmath:
 @if target-libquadmath
@@ -49647,6 +51236,33 @@
 
 @endif target-libgfortran
 
+.PHONY: maybe-install-dvi-target-libgfortran install-dvi-target-libgfortran
+maybe-install-dvi-target-libgfortran:
+@if target-libgfortran
+maybe-install-dvi-target-libgfortran: install-dvi-target-libgfortran
+
+install-dvi-target-libgfortran: \
+    configure-target-libgfortran \
+    dvi-target-libgfortran 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-dvi in $(TARGET_SUBDIR)/libgfortran"; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libgfortran && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           install-dvi) \
+	  || exit 1
+
+@endif target-libgfortran
+
 .PHONY: maybe-install-pdf-target-libgfortran install-pdf-target-libgfortran
 maybe-install-pdf-target-libgfortran:
 @if target-libgfortran
@@ -50057,24 +51673,8 @@
 @if target-libobjc
 maybe-TAGS-target-libobjc: TAGS-target-libobjc
 
-TAGS-target-libobjc: \
-    configure-target-libobjc 
-	@: $(MAKE); $(unstage)
-	@[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(NORMAL_TARGET_EXPORTS) \
-	echo "Doing TAGS in $(TARGET_SUBDIR)/libobjc"; \
-	for flag in $(EXTRA_TARGET_FLAGS); do \
-	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
-	done; \
-	(cd $(TARGET_SUBDIR)/libobjc && \
-	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
-	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
-	          "RANLIB=$${RANLIB}" \
-	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
-	           TAGS) \
-	  || exit 1
+# libobjc doesn't support TAGS.
+TAGS-target-libobjc:
 
 @endif target-libobjc
 
@@ -50105,6 +51705,16 @@
 
 @endif target-libobjc
 
+.PHONY: maybe-install-dvi-target-libobjc install-dvi-target-libobjc
+maybe-install-dvi-target-libobjc:
+@if target-libobjc
+maybe-install-dvi-target-libobjc: install-dvi-target-libobjc
+
+# libobjc doesn't support install-dvi.
+install-dvi-target-libobjc:
+
+@endif target-libobjc
+
 .PHONY: maybe-install-pdf-target-libobjc install-pdf-target-libobjc
 maybe-install-pdf-target-libobjc:
 @if target-libobjc
@@ -50563,6 +52173,33 @@
 
 @endif target-libgo
 
+.PHONY: maybe-install-dvi-target-libgo install-dvi-target-libgo
+maybe-install-dvi-target-libgo:
+@if target-libgo
+maybe-install-dvi-target-libgo: install-dvi-target-libgo
+
+install-dvi-target-libgo: \
+    configure-target-libgo \
+    dvi-target-libgo 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libgo/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-dvi in $(TARGET_SUBDIR)/libgo"; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libgo && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           install-dvi) \
+	  || exit 1
+
+@endif target-libgo
+
 .PHONY: maybe-install-pdf-target-libgo install-pdf-target-libgo
 maybe-install-pdf-target-libgo:
 @if target-libgo
@@ -51021,6 +52658,33 @@
 
 @endif target-libphobos
 
+.PHONY: maybe-install-dvi-target-libphobos install-dvi-target-libphobos
+maybe-install-dvi-target-libphobos:
+@if target-libphobos
+maybe-install-dvi-target-libphobos: install-dvi-target-libphobos
+
+install-dvi-target-libphobos: \
+    configure-target-libphobos \
+    dvi-target-libphobos 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libphobos/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-dvi in $(TARGET_SUBDIR)/libphobos"; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libphobos && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           install-dvi) \
+	  || exit 1
+
+@endif target-libphobos
+
 .PHONY: maybe-install-pdf-target-libphobos install-pdf-target-libphobos
 maybe-install-pdf-target-libphobos:
 @if target-libphobos
@@ -51474,6 +53138,33 @@
 
 @endif target-libtermcap
 
+.PHONY: maybe-install-dvi-target-libtermcap install-dvi-target-libtermcap
+maybe-install-dvi-target-libtermcap:
+@if target-libtermcap
+maybe-install-dvi-target-libtermcap: install-dvi-target-libtermcap
+
+install-dvi-target-libtermcap: \
+    configure-target-libtermcap \
+    dvi-target-libtermcap 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-dvi in $(TARGET_SUBDIR)/libtermcap"; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libtermcap && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           install-dvi) \
+	  || exit 1
+
+@endif target-libtermcap
+
 .PHONY: maybe-install-pdf-target-libtermcap install-pdf-target-libtermcap
 maybe-install-pdf-target-libtermcap:
 @if target-libtermcap
@@ -51872,6 +53563,33 @@
 
 @endif target-winsup
 
+.PHONY: maybe-install-dvi-target-winsup install-dvi-target-winsup
+maybe-install-dvi-target-winsup:
+@if target-winsup
+maybe-install-dvi-target-winsup: install-dvi-target-winsup
+
+install-dvi-target-winsup: \
+    configure-target-winsup \
+    dvi-target-winsup 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-dvi in $(TARGET_SUBDIR)/winsup"; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/winsup && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           install-dvi) \
+	  || exit 1
+
+@endif target-winsup
+
 .PHONY: maybe-install-pdf-target-winsup install-pdf-target-winsup
 maybe-install-pdf-target-winsup:
 @if target-winsup
@@ -52325,6 +54043,33 @@
 
 @endif target-libgloss
 
+.PHONY: maybe-install-dvi-target-libgloss install-dvi-target-libgloss
+maybe-install-dvi-target-libgloss:
+@if target-libgloss
+maybe-install-dvi-target-libgloss: install-dvi-target-libgloss
+
+install-dvi-target-libgloss: \
+    configure-target-libgloss \
+    dvi-target-libgloss 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-dvi in $(TARGET_SUBDIR)/libgloss"; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libgloss && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           install-dvi) \
+	  || exit 1
+
+@endif target-libgloss
+
 .PHONY: maybe-install-pdf-target-libgloss install-pdf-target-libgloss
 maybe-install-pdf-target-libgloss:
 @if target-libgloss
@@ -52773,6 +54518,33 @@
 
 @endif target-libffi
 
+.PHONY: maybe-install-dvi-target-libffi install-dvi-target-libffi
+maybe-install-dvi-target-libffi:
+@if target-libffi
+maybe-install-dvi-target-libffi: install-dvi-target-libffi
+
+install-dvi-target-libffi: \
+    configure-target-libffi \
+    dvi-target-libffi 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-dvi in $(TARGET_SUBDIR)/libffi"; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libffi && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           install-dvi) \
+	  || exit 1
+
+@endif target-libffi
+
 .PHONY: maybe-install-pdf-target-libffi install-pdf-target-libffi
 maybe-install-pdf-target-libffi:
 @if target-libffi
@@ -53231,6 +55003,33 @@
 
 @endif target-zlib
 
+.PHONY: maybe-install-dvi-target-zlib install-dvi-target-zlib
+maybe-install-dvi-target-zlib:
+@if target-zlib
+maybe-install-dvi-target-zlib: install-dvi-target-zlib
+
+install-dvi-target-zlib: \
+    configure-target-zlib \
+    dvi-target-zlib 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-dvi in $(TARGET_SUBDIR)/zlib"; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/zlib && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           install-dvi) \
+	  || exit 1
+
+@endif target-zlib
+
 .PHONY: maybe-install-pdf-target-zlib install-pdf-target-zlib
 maybe-install-pdf-target-zlib:
 @if target-zlib
@@ -53689,6 +55488,33 @@
 
 @endif target-rda
 
+.PHONY: maybe-install-dvi-target-rda install-dvi-target-rda
+maybe-install-dvi-target-rda:
+@if target-rda
+maybe-install-dvi-target-rda: install-dvi-target-rda
+
+install-dvi-target-rda: \
+    configure-target-rda \
+    dvi-target-rda 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-dvi in $(TARGET_SUBDIR)/rda"; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/rda && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           install-dvi) \
+	  || exit 1
+
+@endif target-rda
+
 .PHONY: maybe-install-pdf-target-rda install-pdf-target-rda
 maybe-install-pdf-target-rda:
 @if target-rda
@@ -54147,6 +55973,33 @@
 
 @endif target-libada
 
+.PHONY: maybe-install-dvi-target-libada install-dvi-target-libada
+maybe-install-dvi-target-libada:
+@if target-libada
+maybe-install-dvi-target-libada: install-dvi-target-libada
+
+install-dvi-target-libada: \
+    configure-target-libada \
+    dvi-target-libada 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-dvi in $(TARGET_SUBDIR)/libada"; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libada && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           install-dvi) \
+	  || exit 1
+
+@endif target-libada
+
 .PHONY: maybe-install-pdf-target-libada install-pdf-target-libada
 maybe-install-pdf-target-libada:
 @if target-libada
@@ -55390,6 +57243,33 @@
 
 @endif target-libgomp
 
+.PHONY: maybe-install-dvi-target-libgomp install-dvi-target-libgomp
+maybe-install-dvi-target-libgomp:
+@if target-libgomp
+maybe-install-dvi-target-libgomp: install-dvi-target-libgomp
+
+install-dvi-target-libgomp: \
+    configure-target-libgomp \
+    dvi-target-libgomp 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libgomp/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-dvi in $(TARGET_SUBDIR)/libgomp"; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libgomp && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           install-dvi) \
+	  || exit 1
+
+@endif target-libgomp
+
 .PHONY: maybe-install-pdf-target-libgomp install-pdf-target-libgomp
 maybe-install-pdf-target-libgomp:
 @if target-libgomp
@@ -55848,6 +57728,33 @@
 
 @endif target-libitm
 
+.PHONY: maybe-install-dvi-target-libitm install-dvi-target-libitm
+maybe-install-dvi-target-libitm:
+@if target-libitm
+maybe-install-dvi-target-libitm: install-dvi-target-libitm
+
+install-dvi-target-libitm: \
+    configure-target-libitm \
+    dvi-target-libitm 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libitm/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-dvi in $(TARGET_SUBDIR)/libitm"; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libitm && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           install-dvi) \
+	  || exit 1
+
+@endif target-libitm
+
 .PHONY: maybe-install-pdf-target-libitm install-pdf-target-libitm
 maybe-install-pdf-target-libitm:
 @if target-libitm
@@ -56306,6 +58213,33 @@
 
 @endif target-libatomic
 
+.PHONY: maybe-install-dvi-target-libatomic install-dvi-target-libatomic
+maybe-install-dvi-target-libatomic:
+@if target-libatomic
+maybe-install-dvi-target-libatomic: install-dvi-target-libatomic
+
+install-dvi-target-libatomic: \
+    configure-target-libatomic \
+    dvi-target-libatomic 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libatomic/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-dvi in $(TARGET_SUBDIR)/libatomic"; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libatomic && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           install-dvi) \
+	  || exit 1
+
+@endif target-libatomic
+
 .PHONY: maybe-install-pdf-target-libatomic install-pdf-target-libatomic
 maybe-install-pdf-target-libatomic:
 @if target-libatomic
diff --git a/Makefile.tpl b/Makefile.tpl
index 9adf4f9..08e68e8 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -836,7 +836,7 @@
 # Here are the targets which correspond to the do-X targets.
 
 .PHONY: info installcheck dvi pdf html
-.PHONY: install-info install-pdf install-html
+.PHONY: install-info install-dvi install-pdf install-html
 .PHONY: clean distclean mostlyclean maintainer-clean realclean
 .PHONY: local-clean local-distclean local-maintainer-clean
 info: do-info
@@ -855,6 +855,8 @@
 	  $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info; \
 	else true; fi
 
+install-dvi: do-install-dvi
+
 install-pdf: do-install-pdf
 
 install-html: do-install-html
diff --git a/c++tools/ChangeLog b/c++tools/ChangeLog
index fe606e5..322b31b 100644
--- a/c++tools/ChangeLog
+++ b/c++tools/ChangeLog
@@ -1,3 +1,13 @@
+2021-10-26  Jonathan Wakely  <jwakely@redhat.com>
+
+	* resolver.cc (module_resolver::read_tuple_file): Use unique_ptr
+	to ensure memory is freed before returning.
+
+2021-10-22  Eric Gallager  <egallager@gcc.gnu.org>
+
+	PR other/102663
+	* Makefile.in: Add dummy install-dvi target.
+
 2021-09-14  Iain Sandoe  <iain@sandoe.co.uk>
 
 	* resolver.cc (module_resolver::ModuleCompiledRequest):
diff --git a/c++tools/Makefile.in b/c++tools/Makefile.in
index 83a6ae5..824840a 100644
--- a/c++tools/Makefile.in
+++ b/c++tools/Makefile.in
@@ -59,6 +59,7 @@
 info::
 install-info::
 install-pdf::
+install-dvi::
 install-man::
 install-html::
 
diff --git a/c++tools/resolver.cc b/c++tools/resolver.cc
index 421fdaa..a1837b3 100644
--- a/c++tools/resolver.cc
+++ b/c++tools/resolver.cc
@@ -23,6 +23,7 @@
 #include "resolver.h"
 // C++
 #include <algorithm>
+#include <memory>
 // C
 #include <cstring>
 // OS
@@ -114,10 +115,17 @@
   buffer = mmap (nullptr, stat.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
   if (buffer == MAP_FAILED)
     return -errno;
+  struct Deleter {
+    void operator()(void* p) const { munmap(p, size); }
+    size_t size;
+  };
+  std::unique_ptr<void, Deleter> guard(buffer, Deleter{(size_t)stat.st_size});
 #else
   buffer = xmalloc (stat.st_size);
   if (!buffer)
     return -errno;
+  struct Deleter { void operator()(void* p) const { free(p); } };
+  std::unique_ptr<void, Deleter> guard(buffer);
   if (read (fd, buffer, stat.st_size) != stat.st_size)
     return -errno;
 #endif
@@ -179,12 +187,6 @@
 	}
     }
 
-#if MAPPED_READING
-  munmap (buffer, stat.st_size);
-#else
-  free (buffer);
-#endif
-
   return 0;
 }
 
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 156a61b..d36e6f1 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,13 @@
+2021-10-20  H.J. Lu  <hjl.tools@gmail.com>
+
+	* gcc-changelog/git_commit.py (ignored_prefixes): Add libffi/.
+
+2021-10-18  Martin Liska  <mliska@suse.cz>
+
+	* gcc-changelog/git_commit.py: Update location of
+	'bad parentheses wrapping'.
+	* gcc-changelog/test_email.py: Test it.
+
 2021-10-02  Martin Liska  <mliska@suse.cz>
 
 	* filter-clang-warnings.py: Filter out -Wtautological-compare
diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py
index f26dc3b..60377b6 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -134,6 +134,7 @@
     'gcc/go/gofrontend/',
     'gcc/testsuite/gdc.test/',
     'gcc/testsuite/go.test/test/',
+    'libffi/',
     'libgo/',
     'libphobos/libdruntime/',
     'libphobos/src/',
@@ -217,7 +218,7 @@
         self.lines = []
         self.files = []
         self.file_patterns = []
-        self.opened_parentheses = 0
+        self.parentheses_stack = []
 
     def parse_file_names(self):
         # Whether the content currently processed is between a star prefix the
@@ -551,7 +552,7 @@
                     m = star_prefix_regex.match(line)
                     if m:
                         if (len(m.group('spaces')) != 1 and
-                                last_entry.opened_parentheses == 0):
+                                not last_entry.parentheses_stack):
                             msg = 'one space should follow asterisk'
                             self.errors.append(Error(msg, line))
                         else:
@@ -576,13 +577,13 @@
     def process_parentheses(self, last_entry, line):
         for c in line:
             if c == '(':
-                last_entry.opened_parentheses += 1
+                last_entry.parentheses_stack.append(line)
             elif c == ')':
-                if last_entry.opened_parentheses == 0:
+                if not last_entry.parentheses_stack:
                     msg = 'bad wrapping of parenthesis'
                     self.errors.append(Error(msg, line))
                 else:
-                    last_entry.opened_parentheses -= 1
+                    del last_entry.parentheses_stack[-1]
 
     def parse_file_names(self):
         for entry in self.changelog_entries:
@@ -608,9 +609,9 @@
 
     def check_for_broken_parentheses(self):
         for entry in self.changelog_entries:
-            if entry.opened_parentheses != 0:
+            if entry.parentheses_stack:
                 msg = 'bad parentheses wrapping'
-                self.errors.append(Error(msg, entry.lines[0]))
+                self.errors.append(Error(msg, entry.parentheses_stack[-1]))
 
     def get_file_changelog_location(self, changelog_file):
         for file in self.info.modified_files:
diff --git a/contrib/gcc-changelog/test_email.py b/contrib/gcc-changelog/test_email.py
index dae7c27..a4796db 100755
--- a/contrib/gcc-changelog/test_email.py
+++ b/contrib/gcc-changelog/test_email.py
@@ -415,6 +415,7 @@
     def test_multiline_bad_parentheses(self):
         email = self.from_patch_glob('0002-Wrong-macro-changelog.patch')
         assert email.errors[0].message == 'bad parentheses wrapping'
+        assert email.errors[0].line == '	* config/i386/i386.md (*fix_trunc<mode>_i387_1,'
 
     def test_changelog_removal(self):
         email = self.from_patch_glob('0001-ChangeLog-removal.patch')
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 425ec28..b6381ed 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,1901 @@
+2021-10-26  Martin Sebor  <msebor@redhat.com>
+
+	PR tree-optimization/102238
+	PR tree-optimization/102919
+	* gimple-ssa-sprintf.c (get_string_length): Add an argument.
+	(array_elt_at_offset): Move to pointer-query.
+	(set_aggregate_size_and_offset): New function.
+	(field_at_offset):  Move to pointer-query.
+	(get_origin_and_offset): Rename...
+	(get_origin_and_offset_r): this.  Add an argument.  Make aggregate
+	handling more robust.
+	(get_origin_and_offset): New.
+	(alias_offset): Add an argument.
+	(format_string): Use subobject size determined by get_origin_and_offset.
+	* pointer-query.cc (field_at_offset): Move from gimple-ssa-sprintf.c.
+	Improve/correct handling of aggregates.
+	(array_elt_at_offset): Same.
+	* pointer-query.h (field_at_offset): Declare.
+	(array_elt_at_offset): Declare.
+
+2021-10-26  Martin Sebor  <msebor@redhat.com>
+
+	* builtins.c (check_strncat_sizes): Pass access_data ctor additional
+	arguments.
+	(expand_builtin_memcmp): Move code to gimple-ssa-warn-access.cc.
+	(expand_builtin_fork_or_exec): Same.
+	* gimple-array-bounds.cc (array_bounds_checker::check_mem_ref): Pass
+	compute_objsize additional arguments.
+	(inbounds_memaccess_p): Same.
+	(array_bounds_checker::check_array_bounds): Add an assert.  Stash
+	statement in a member.
+	(check_array_bounds_dom_walker::before_dom_children): Same.
+	* gimple-array-bounds.h (array_bounds_checker::m_stmt): New member.
+	* gimple-ssa-sprintf.c (get_destination_size): Add an argument.
+	(handle_printf_call): Pass a new argument.
+	* gimple-ssa-warn-access.cc (get_size_range): Add an argument.
+	(check_access): Add an argument and pass it along to callees.
+	(check_read_access): Make a member function.
+	(pass_waccess::check_strcat): Pass access_data ctor additional
+	arguments.
+	(pass_waccess::check_strncat): Same.
+	(pass_waccess::check_stxcpy): Same.
+	(pass_waccess::check_stxncpy): Same.
+	(pass_waccess::check_strncmp): Same.
+	(pass_waccess::check_read_access): Same.
+	(pass_waccess::check_builtin): Same.
+	(pass_waccess::maybe_check_access_sizes): Same.
+	(pass_waccess::maybe_check_dealloc_call): Same.
+	* gimple-ssa-warn-access.h (check_read_access): Declare a new
+	member function.
+	* pointer-query.cc (compute_objsize_r): Add an argument.
+	(gimple_call_return_array): Same.
+	(gimple_call_alloc_size): Same.
+	(access_ref::access_ref): Same.
+	(access_ref::get_ref): Same.
+	(pointer_query::get_ref): Same.
+	(handle_min_max_size): Pass an arguments to callees.
+	(handle_array_ref): Add an argument.
+	(handle_mem_ref): Same.
+	(compute_objsize): Same.
+	* pointer-query.h (struct access_ref): Adjust signatures.
+	(struct access_data): Same.
+	(gimple_call_alloc_size): Add an argument.
+	(gimple_parm_array_size): Same.
+	(compute_objsize): Same.
+	* tree-ssa-strlen.c (strlen_pass::adjust_last_stmt): Pass an additional
+	argument to compute_objsize.
+	(strlen_pass::maybe_warn_overflow): Same.
+	(maybe_diag_stxncpy_trunc): Same.
+
+2021-10-26  Martin Sebor  <msebor@redhat.com>
+
+	PR middle-end/102453
+	* gimple-ssa-warn-access.cc (pass_waccess::check_atomic_builtin): New.
+	(pass_waccess::check_atomic_builtin): Call it.
+
+2021-10-26  Vladimir N. Makarov  <vmakarov@redhat.com>
+
+	PR rtl-optimization/102842
+	* lra-constraints.c (match_reload): Ignore out in checking values
+	of outs.
+	(curr_insn_transform): Collect outputs before doing reloads of operands.
+
+2021-10-26  Paul A. Clarke  <pc@us.ibm.com>
+
+	PR target/102719
+	* config/rs6000/x86intrin.h: Move some included headers to new
+	headers.  Include new immintrin.h instead of those headers.
+	* config/rs6000/immintrin.h: New.
+	* config/rs6000/x86gprintrin.h: New.
+	* config.gcc (powerpc*-*-*): Add new headers to extra_headers.
+
+2021-10-26  Richard Biener  <rguenther@suse.de>
+
+	* tree-vectorizer.h (vect_create_addr_base_for_vector_ref):
+	Remove byte_offset parameter.
+	(vect_create_data_ref_ptr): Likewise.
+	* tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref):
+	Likewise.
+	(vect_create_data_ref_ptr): Likewise.
+	* tree-vect-stmts.c (vectorizable_store): Adjust.
+	(vectorizable_load): Likewise.
+
+2021-10-26  Richard Biener  <rguenther@suse.de>
+
+	PR tree-optimization/96109
+	* tree-vectorizer.h (dr_misalignment): Add optional offset
+	parameter.
+	* tree-vect-data-refs.c (dr_misalignment): Likewise.  Remove
+	offset applied for negative stride accesses.
+	(vect_enhance_data_refs_alignment): Compute negative stride
+	access offset and pass it to dr_misalignment.
+	* tree-vect-stmts.c (get_negative_load_store_type): Pass
+	negative offset to dr_misalignment.
+	(get_group_load_store_type): Likewise.
+	(get_load_store_type): Likewise.
+	(vectorizable_store): Remove asserts about alignment.
+	(vectorizable_load): Likewise.
+
+2021-10-26  Kewen Lin  <linkw@linux.ibm.com>
+
+	PR tree-optimization/102897
+	* tree-ssa-forwprop.c (simplify_permutation): Remove a wrong assertion.
+
+2021-10-26  Richard Biener  <rguenther@suse.de>
+
+	* tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref):
+	Take offset in bytes.
+	(vect_create_data_ref_ptr): Likewise.
+	* tree-vect-loop-manip.c (get_misalign_in_elems): Multiply
+	offset by element size.
+	(vect_create_cond_for_align_checks): Likewise.
+	* tree-vect-stmts.c (get_negative_load_store_type): Likewise.
+	(vectorizable_load): Remove duplicate leftover from merge
+	conflict.
+
+2021-10-26  Roger Sayle  <roger@nextmovesoftware.com>
+
+	* config/i386/i386-expand.c (ix86_expand_v1ti_shift): New helper
+	function to expand V1TI mode logical shifts by integer constants.
+	(ix86_expand_v1ti_rotate): New helper function to expand V1TI
+	mode rotations by integer constants.
+	* config/i386/i386-protos.h (ix86_expand_v1ti_shift,
+	ix86_expand_v1ti_rotate): Prototype new functions here.
+	* config/i386/sse.md (ashlv1ti3, lshrv1ti3, rotlv1ti3, rotrv1ti3):
+	New TARGET_SSE2 expanders to implement V1TI shifts and rotations.
+
+2021-10-26  Aldy Hernandez  <aldyh@redhat.com>
+
+	* tree-ssa-threadbackward.c (back_threader::maybe_register_path):
+	Avoid threading circular paths.
+
+2021-10-26  Aldy Hernandez  <aldyh@redhat.com>
+
+	* tree-ssa-threadbackward.c (back_threader::resolve_phi):
+	Attempt to resolve all incoming paths to a PHI.
+	(back_threader::resolve_def): Always return true for PHIs.
+
+2021-10-26  Aldy Hernandez  <aldyh@redhat.com>
+
+	* tree-ssa-threadbackward.c (back_threader::find_paths_to_names):
+	Always try to resolve path without looking back.
+	* tree-ssa-threadupdate.c (dump_jump_thread): Indidicate whether
+	edge is a back edge.
+
+2021-10-26  Kewen Lin  <linkw@linux.ibm.com>
+
+	PR tree-optimization/102789
+	* tree-vect-loop-manip.c (vect_update_inits_of_drs): Do not
+	update inits of simd_lane_access.
+
+2021-10-25  Andrew MacLeod  <amacleod@redhat.com>
+
+	* tree-vrp.c (vrp_simplify_cond_using_ranges): Add return type and
+	move to vr-values.c.
+	(simplify_casted_conds): Move to vrp_folder class.
+	(execute_vrp): Call via vrp_folder now.
+	* vr-values.c (simplify_cond_using_ranges_1): Call simplify_casted_cond.
+	(simplify_using_ranges::simplify_casted_cond): Relocate from tree-vrp.c.
+	* vr-values.h (simplify_casted_cond): Add prototype.
+
+2021-10-25  Andrew MacLeod  <amacleod@redhat.com>
+
+	* tree-vrp.c (rvrp_folder::fold_stmt): If simplification fails, try
+	to fold anyway.
+
+2021-10-25  Paul A. Clarke  <pc@us.ibm.com>
+
+	* config/rs6000/smmintrin.h (_mm_testz_si128): Add "extern" to
+	function signature.
+	(_mm_testc_si128): Likewise.
+	(_mm_testnzc_si128): Likewise.
+	(_mm_blend_ps): Likewise.
+	(_mm_blendv_ps): Likewise.
+	(_mm_blend_pd): Likewise.
+	(_mm_blendv_pd): Likewise.
+	(_mm_ceil_pd): Likewise.
+	(_mm_ceil_sd): Likewise.
+	(_mm_ceil_ps): Likewise.
+	(_mm_ceil_ss): Likewise.
+	(_mm_floor_pd): Likewise.
+	(_mm_floor_sd): Likewise.
+	(_mm_floor_ps): Likewise.
+	(_mm_floor_ss): Likewise.
+	(_mm_minpos_epu16): Likewise.
+	(_mm_mul_epi32): Likewise.
+	(_mm_cvtepi8_epi16): Likewise.
+	(_mm_packus_epi32): Likewise.
+	(_mm_cmpgt_epi64): Likewise.
+
+2021-10-25  Roger Sayle  <roger@nextmovesoftware.com>
+
+	* simplify-rtx.c (simplify_binary_operation_1) [SS_ASHIFT]: Simplify
+	shifts of the mode's smin_value and smax_value when the bit count
+	operand doesn't have side-effects.
+	[US_ASHIFT]: Likewise, simplify shifts of the mode's umax_value
+	when the bit count operand doesn't have side-effects.
+	(simplify_const_binary_operation) [SS_ASHIFT, US_ASHIFT]: Perform
+	compile-time evaluation of saturating left shifts with constant
+	arguments.
+
+2021-10-25  Andrew MacLeod  <amacleod@redhat.com>
+
+	* gimple-range.cc (gimple_ranger::export_global_ranges): Remove check
+	for TDF_DETAILS.
+
+2021-10-25  Andrew MacLeod  <amacleod@redhat.com>
+
+	* flag-types.h (enum ranger_debug): Adjust values.
+	* params.opt (ranger_debug): Ditto.
+
+2021-10-25  Martin Jambor  <mjambor@suse.cz>
+
+	PR tree-optimization/102886
+	* tree-sra.c (totally_scalarize_subtree): Fix the out of
+	access-condition.
+
+2021-10-25  Andrew Pinski  <apinski@marvell.com>
+
+	* tree-ssa-dce.c (simple_dce_from_worklist):
+	Check stmt_unremovable_because_of_non_call_eh_p also
+	before removing the statement.
+
+2021-10-25  Richard Biener  <rguenther@suse.de>
+
+	PR tree-optimization/102905
+	* tree-vect-data-refs.c (vect_enhance_data_refs_alignment):
+	Use vect_supportable_dr_alignment again to determine whether
+	an access is supported when not aligned.
+
+2021-10-25  Kito Cheng  <kito.cheng@sifive.com>
+
+	* config/riscv/riscv.c (riscv_rtx_costs): Handle cost model
+	for zbs extension.
+
+2021-10-25  Jim Wilson  <jimw@sifive.com>
+	    Kito Cheng  <kito.cheng@sifive.com>
+	    Jia-Wei Chen  <jiawei@iscas.ac.cn>
+	    Shi-Hua Liao  <shihua@iscas.ac.cn>
+
+	* config/riscv/bitmanip.md (shiftm1): New.
+	(*bset<mode>): Ditto.
+	(*bset<mode>_mask): Ditto.
+	(*bset<mode>_1): Ditto.
+	(*bset<mode>_1_mask): Ditto.
+	(*bseti<mode>): Ditto.
+	(*bclr<mode>): Ditto.
+	(*bclri<mode>): Ditto.
+	(*binv<mode>): Ditto.
+	(*binvi<mode>): Ditto.
+	(*bext<mode>): Ditto.
+	(*bexti): Ditto.
+	* config/riscv/predicates.md (splittable_const_int_operand):
+	Handle bseti.
+	(single_bit_mask_operand): New.
+	(not_single_bit_mask_operand): Ditto.
+	(const31_operand): Ditto.
+	(const63_operand): Ditto.
+	* config/riscv/riscv.c (riscv_build_integer_1): Handle bseti.
+	(riscv_output_move): Ditto.
+	(riscv_print_operand): Handle new operand type: T and S.
+	* config/riscv/riscv.h (SINGLE_BIT_MASK_OPERAND): New.
+
+2021-10-25  Jim Wilson  <jimw@sifive.com>
+
+	* config/riscv/riscv.c (riscv_build_integer_1): Build integer
+	with rotate.
+
+2021-10-25  Kito Cheng  <kito.cheng@sifive.com>
+
+	* config/riscv/riscv.c (riscv_extend_cost): Handle cost model
+	for zbb extension.
+	(riscv_rtx_costs): Ditto.
+
+2021-10-25  Jim Wilson  <jimw@sifive.com>
+	    Kito Cheng  <kito.cheng@sifive.com>
+	    Jia-Wei Chen  <jiawei@iscas.ac.cn>
+
+	* config/riscv/bitmanip.md (bitmanip_bitwise): New.
+	(bitmanip_minmax): New.
+	(clz_ctz_pcnt): New.
+	(bitmanip_optab): New.
+	(bitmanip_insn): New.
+	(*<optab>_not<mode>): New.
+	(*xor_not<mode>): New.
+	(<bitmanip_optab>si2): New.
+	(*<bitmanip_optab>disi2): New.
+	(<bitmanip_optab>di2): New.
+	(*zero_extendhi<GPR:mode>2_bitmanip): New.
+	(*extend<SHORT:mode><SUPERQI:mode>2_zbb): New.
+	(*zero_extendhi<GPR:mode>2_zbb): New.
+	(rotrsi3): New.
+	(rotrdi3): New.
+	(rotrsi3_sext): New.
+	(rotlsi3): New.
+	(rotldi3): New.
+	(rotlsi3_sext): New.
+	(bswap<mode>2): New.
+	(<bitmanip_optab><mode>3): New.
+	* config/riscv/riscv.md (type): Add rotate.
+	(zero_extendhi<GPR:mode>2): Change to define_expand pattern.
+	(*zero_extendhi<GPR:mode>2): New.
+	(extend<SHORT:mode><SUPERQI:mode>2): Change to define_expand pattern.
+	(*extend<SHORT:mode><SUPERQI:mode>2): New.
+
+2021-10-25  Kito Cheng  <kito.cheng@sifive.com>
+
+	* config/riscv/riscv.c (riscv_extend_cost): Handle cost model
+	for zba extension.
+	(riscv_rtx_costs): Ditto.
+
+2021-10-25  Jim Wilson  <jimw@sifive.com>
+	    Kito Cheng  <kito.cheng@sifive.com>
+	    Jia-Wei Chen  <jiawei@iscas.ac.cn>
+
+	* config/riscv/bitmanip.md (*zero_extendsidi2_bitmanip): New.
+	(*shNadd): Ditto.
+	(*shNadduw): Ditto.
+	(*add.uw): Ditto.
+	(*slliuw): Ditto.
+	(riscv_rtx_costs): Ditto.
+	* config/riscv/riscv.md: Include bitmanip.md
+	(type): Add bitmanip bype.
+	(zero_extendsidi2): Change to define_expand pattern.
+	(*zero_extendsidi2_internal): New.
+	(zero_extendsidi2_shifted): Disable for ZBA.
+
+2021-10-25  Kito Cheng  <kito.cheng@sifive.com>
+
+	* common/config/riscv/riscv-common.c (riscv_ext_version_table):
+	Add zba, zbb, zbc and zbs.
+	(riscv_ext_flag_table): Ditto.
+	* config/riscv/riscv-opts.h (MASK_ZBA): New.
+	(MASK_ZBB): Ditto.
+	(MASK_ZBC): Ditto.
+	(MASK_ZBS): Ditto.
+	(TARGET_ZBA): Ditto.
+	(TARGET_ZBB): Ditto.
+	(TARGET_ZBC): Ditto.
+	(TARGET_ZBS): Ditto.
+	* config/riscv/riscv.opt (riscv_zb_subext): New.
+
+2021-10-25  liuhongt  <hongtao.liu@intel.com>
+
+	PR target/102464
+	* match.pd: Simplify (_Float16) sqrtf((float) a) to .SQRT(a)
+	when direct_internal_fn_supported_p, similar for sqrt/sqrtl.
+
+2021-10-25  Richard Biener  <rguenther@suse.de>
+
+	PR tree-optimization/102920
+	* tree-ssa-sccvn.h (expressions_equal_p): Add argument
+	controlling VN_TOP matching behavior.
+	* tree-ssa-sccvn.c (expressions_equal_p): Likewise.
+	(vn_phi_eq): Do not optimistically match VN_TOP.
+
+2021-10-25  konglin1  <lingling.kong@intel.com>
+
+	* config/i386/sse.md (fma_<mode>_fadd_fmul): Add new
+	define_insn_and_split.
+	(fma_<mode>_fadd_fcmul):Likewise
+	(fma_<complexopname>_<mode>_fma_zero):Likewise
+
+2021-10-24  John David Anglin  <danglin@gcc.gnu.org>
+
+	* config/pa/pa-d.c (pa_d_handle_target_float_abi): Don't check
+	TARGET_DISABLE_FPREGS.
+	* config/pa/pa.c (fix_range): Use MASK_SOFT_FLOAT instead of
+	MASK_DISABLE_FPREGS.
+	(hppa_rtx_costs): Don't check TARGET_DISABLE_FPREGS.  Adjust
+	cost of hardware integer multiplication.
+	(pa_conditional_register_usage): Don't check TARGET_DISABLE_FPREGS.
+	* config/pa/pa.h (INT14_OK_STRICT): Likewise.
+	* config/pa/pa.md: Don't check TARGET_DISABLE_FPREGS. Check
+	TARGET_SOFT_FLOAT in patterns that use xmpyu instruction.
+	* config/pa/pa.opt (mdisable-fpregs): Change target mask to
+	SOFT_FLOAT.  Revise comment.
+	(msoft-float): New option.
+
+2021-10-24  John David Anglin  <danglin@gcc.gnu.org>
+
+	* config/pa/pa.md: Don't use 'G' constraint in integer move patterns.
+
+2021-10-24  Gerald Pfeifer  <gerald@pfeifer.com>
+
+	* doc/install.texi (Specific): Remove obsolete details
+	around GNU/Linux on Itanium.
+	(Specific): Remove reference to Windows for Itanium.
+
+2021-10-23  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>
+
+	* config/i386/x86-tune-sched-bd.c (dispatch_group): Commentary
+	typo fix.
+
+2021-10-23  Jan Hubicka  <hubicka@ucw.cz>
+
+	* tree-ssa-structalias.c (compute_points_to_sets): Cleanup.
+
+2021-10-23  Roger Sayle  <roger@nextmovesoftware.com>
+
+	* config/i386/sse.md (<any_logic>v1ti3): New define_insn to
+	implement V1TImode AND, IOR and XOR on TARGET_SSE2 (and above).
+	(one_cmplv1ti2): New define expand.
+
+2021-10-22  Eric Gallager  <egallager@gcc.gnu.org>
+
+	PR other/102663
+	* Makefile.in: Handle dvidir and install-dvi target.
+	* configure: Regenerate.
+	* configure.ac: Add install-dvi to target_list.
+
+2021-10-22  Gerald Pfeifer  <gerald@pfeifer.com>
+
+	* doc/install.texi (Binaries): Convert mingw-w64.org to https.
+	(Specific): Ditto.
+
+2021-10-22  Richard Biener  <rguenther@suse.de>
+
+	PR tree-optimization/102893
+	* tree-ssa-dce.c (find_obviously_necessary_stmts): Fix the
+	test for an exit edge.
+
+2021-10-22  Aldy Hernandez  <aldyh@redhat.com>
+	    Andrew MacLeod  <amacleod@redhat.com>
+
+	* gimple-range-path.cc (path_range_query::compute_phi_relations):
+	Kill any global relations we may know before registering a new
+	one.
+	* value-relation.cc (path_oracle::killing_def): New.
+	* value-relation.h (path_oracle::killing_def): New.
+
+2021-10-22  Richard Biener  <rguenther@suse.de>
+
+	PR bootstrap/102681
+	* tree-ssa-sccvn.c (vn_phi_insert): For undefined SSA args
+	record VN_TOP.
+	(vn_phi_lookup): Likewise.
+
+2021-10-21  H.J. Lu  <hjl.tools@gmail.com>
+
+	PR target/98667
+	* doc/invoke.texi: Document -fcf-protection requires i686 or
+	new.
+
+2021-10-21  Eric Botcazou  <ebotcazou@adacore.com>
+
+	PR middle-end/102764
+	* cfgexpand.c (expand_gimple_basic_block): Robustify latest change.
+
+2021-10-21  Jonathan Wright  <jonathan.wright@arm.com>
+
+	* config/aarch64/arm_neon.h (__STRUCTN): Delete function
+	macro and all invocations.
+
+2021-10-21  Andrew MacLeod  <amacleod@redhat.com>
+
+	* doc/invoke.texi (ranger-debug): Document.
+	* flag-types.h (enum ranger_debug): New.
+	(enum evrp_mode): Remove debug values.
+	* gimple-range-cache.cc (DEBUG_RANGE_CACHE): Use new debug flag.
+	* gimple-range-gori.cc (gori_compute::gori_compute): Ditto.
+	* gimple-range.cc (gimple_ranger::gimple_ranger): Ditto.
+	* gimple-ssa-evrp.c (hybrid_folder::choose_value): Ditto.
+	(execute_early_vrp): Use evrp-mode directly.
+	* params.opt (enum evrp_mode): Remove debug values.
+	(ranger-debug): New.
+	(ranger-logical-depth): Relocate to be in alphabetical order.
+
+2021-10-21  Andrew MacLeod  <amacleod@redhat.com>
+
+	* doc/invoke.texi: (vrp1-mode, vrp2-mode): Document.
+	* flag-types.h: (enum vrp_mode): New.
+	* params.opt: (vrp1-mode, vrp2-mode): New.
+	* tree-vrp.c (vrp_pass_num): New.
+	(pass_vrp::pass_vrp): Set pass number.
+	(pass_vrp::execute): Choose which VRP mode to execute.
+
+2021-10-21  Andrew MacLeod  <amacleod@redhat.com>
+
+	* gimple-ssa-evrp.c (class rvrp_folder): Move to tree-vrp.c.
+	(execute_early_vrp): For ranger only mode, invoke ranger_vrp.
+	* tree-vrp.c (class rvrp_folder): Relocate here.
+	(execute_ranger_vrp): New.
+	* tree-vrp.h (execute_ranger_vrp): Export.
+
+2021-10-21  Martin Liska  <mliska@suse.cz>
+
+	PR debug/102585
+	PR bootstrap/102766
+	* opts.c (finish_options): Process flag_var_tracking* options
+	here as they can be adjusted by optimize attribute.
+	Process also flag_syntax_only and flag_gtoggle.
+	* toplev.c (process_options): Remove it here.
+	* common.opt: Make debug_nonbind_markers_p as PerFunction
+	attribute as it depends on optimization level.
+
+2021-10-21  Martin Jambor  <mjambor@suse.cz>
+
+	PR tree-optimization/102505
+	* tree-sra.c (totally_scalarize_subtree): Check that the
+	encountered field fits within the acces we would like to put it
+	in.
+
+2021-10-21  Aldy Hernandez  <aldyh@redhat.com>
+
+	* tree-ssa-threadbackward.c
+	(back_threader::maybe_register_path): Remove circular paths check.
+
+2021-10-21  Richard Biener  <rguenther@suse.de>
+
+	* toplev.c (process_options): Move the initial debug_hooks
+	setting ...
+	(toplev::main): ... before the call of the post_options
+	langhook.
+
+2021-10-21  Richard Biener  <rguenther@suse.de>
+
+	PR tree-optimization/102847
+	* tree-vect-stmts.c (vect_model_load_cost): Add the scalar
+	load cost in the prologue for VMAT_INVARIANT.
+
+2021-10-21  Richard Biener  <rguenther@suse.de>
+
+	PR tree-optimization/102847
+	* tree-vect-stmts.c (vect_model_load_cost): Explicitely
+	handle VMAT_INVARIANT as a splat in the prologue.
+
+2021-10-21  Hongyu Wang  <hongyu.wang@intel.com>
+
+	PR target/102812
+	* config/i386/i386.c (ix86_get_ssemov): Adjust HFmode vector
+	move to use the same logic as HImode.
+
+2021-10-21  Richard Biener  <rguenther@suse.de>
+
+	* tree-vect-slp.c (vect_build_slp_tree_1): Remove
+	superfluous gimple_call_nothrow_p check.
+
+2021-10-21  Andrew Pinski  <apinski@marvell.com>
+
+	* tree-cfg.c (maybe_remove_writeonly_store): Add dce_ssa_names argument.
+	Mark the ssa-name of the rhs as one to be removed.
+	(execute_fixup_cfg): Update call to maybe_remove_writeonly_store.
+	Call simple_dce_from_worklist at the end to a simple dce.
+
+2021-10-21  Andrew Pinski  <apinski@marvell.com>
+
+	* tree-cfg.c (maybe_remove_writeonly_store): New function
+	factored out from ...
+	(execute_fixup_cfg): Here. Call maybe_remove_writeonly_store.
+
+2021-10-21  Andrew Pinski  <apinski@marvell.com>
+
+	* tree-cfg.c (execute_fixup_cfg): Remove comment
+	about standalone pass.
+
+2021-10-21  Andrew Pinski  <apinski@marvell.com>
+
+	* tree-cfg.c (execute_fixup_cfg): Output when the statement
+	is removed when it is a write only var.
+
+2021-10-21  Aldy Hernandez  <aldyh@redhat.com>
+
+	* tree-ssa-threadbackward.c (back_threader::maybe_register_path):
+	Avoid threading circular paths.
+
+2021-10-20  Alex Coplan  <alex.coplan@arm.com>
+
+	* calls.c (initialize_argument_information): Remove some dead
+	code, remove handling for function_arg returning const_int.
+	* doc/tm.texi: Delete documentation for unused target hooks.
+	* doc/tm.texi.in: Likewise.
+	* target.def (load_bounds_for_arg): Delete.
+	(store_bounds_for_arg): Delete.
+	(load_returned_bounds): Delete.
+	(store_returned_bounds): Delete.
+	* targhooks.c (default_load_bounds_for_arg): Delete.
+	(default_store_bounds_for_arg): Delete.
+	(default_load_returned_bounds): Delete.
+	(default_store_returned_bounds): Delete.
+	* targhooks.h (default_load_bounds_for_arg): Delete.
+	(default_store_bounds_for_arg): Delete.
+	(default_load_returned_bounds): Delete.
+	(default_store_returned_bounds): Delete.
+
+2021-10-20  Jonathan Wakely  <jwakely@redhat.com>
+
+	* doc/extend.texi (Basic Asm): Clarify that asm is not an
+	extension in C++.
+	* doc/invoke.texi (-fno-asm): Fix description for C++.
+
+2021-10-20  Jonathan Wakely  <jwakely@redhat.com>
+
+	* doc/install.texi: Remove link to old.html
+
+2021-10-20  Tamar Christina  <tamar.christina@arm.com>
+
+	* config/aarch64/aarch64-simd.md (*aarch64_cmtst_same_<mode>): New.
+
+2021-10-20  Tamar Christina  <tamar.christina@arm.com>
+
+	* config/aarch64/aarch64-simd.md (*aarch64_narrow_trunc<mode>): New.
+
+2021-10-20  Tamar Christina  <tamar.christina@arm.com>
+
+	* config/aarch64/aarch64-simd.md (aarch64_simd_ashr<mode>): Add case cmp
+	case.
+	* config/aarch64/constraints.md (D1): New.
+
+2021-10-20  Tamar Christina  <tamar.christina@arm.com>
+
+	* config/aarch64/aarch64-simd.md
+	(*aarch64_<srn_op>topbits_shuffle<mode>_le): New.
+	(*aarch64_topbits_shuffle<mode>_le): New.
+	(*aarch64_<srn_op>topbits_shuffle<mode>_be): New.
+	(*aarch64_topbits_shuffle<mode>_be): New.
+	* config/aarch64/predicates.md
+	(aarch64_simd_shift_imm_vec_exact_top): New.
+
+2021-10-20  Tamar Christina  <tamar.christina@arm.com>
+
+	* config/aarch64/aarch64-simd.md (*aarch64_<srn_op>shrn<mode>_vect,
+	*aarch64_<srn_op>shrn<mode>2_vect_le,
+	*aarch64_<srn_op>shrn<mode>2_vect_be): New.
+	* config/aarch64/iterators.md (srn_op): New.
+
+2021-10-20  Chung-Lin Tang  <cltang@codesourcery.com>
+
+	* omp-low.c (omp_copy_decl_2): For !ctx, use record_vars to add new copy
+	as local variable.
+	(scan_sharing_clauses): Place copy of OMP_CLAUSE_IN_REDUCTION decl in
+	ctx->outer instead of ctx.
+
+2021-10-20  Martin Liska  <mliska@suse.cz>
+
+	Revert:
+	2021-10-19  Martin Liska  <mliska@suse.cz>
+
+	PR target/102374
+	* config/i386/i386-options.c (ix86_valid_target_attribute_inner_p): Strip whitespaces.
+	* system.h (strip_whilespaces): New function.
+
+2021-10-20  Martin Liska  <mliska@suse.cz>
+
+	Revert:
+	2021-10-19  Martin Liska  <mliska@suse.cz>
+
+	PR target/102375
+	* config/aarch64/aarch64.c (aarch64_process_one_target_attr):
+	Strip whitespaces.
+
+2021-10-20  Wilco Dijkstra  <wdijkstr@arm.com>
+
+	* config/aarch64/aarch64.c (aarch64_case_values_threshold):
+	Change to 8 with -Os, 11 otherwise.
+
+2021-10-20  Wilco Dijkstra  <wdijkstr@arm.com>
+
+	* config/aarch64/aarch64.c (neoversev1_tunings):
+	Enable AARCH64_EXTRA_TUNE_CHEAP_SHIFT_EXTEND.
+	(neoversen2_tunings): Likewise.
+
+2021-10-20  Wilco Dijkstra  <wdijkstr@arm.com>
+
+	PR target/100966
+	* config/aarch64/aarch64.md (frint_pattern): Update comment.
+	* config/aarch64/aarch64-simd-builtins.def: Change frintn to roundeven.
+	* config/aarch64/arm_fp16.h: Change frintn to roundeven.
+	* config/aarch64/arm_neon.h: Likewise.
+	* config/aarch64/iterators.md (frint_pattern): Use roundeven for FRINTN.
+
+2021-10-20  Martin Liska  <mliska@suse.cz>
+
+	* config/arm/arm.c (arm_unwind_emit_sequence): Do not declare
+	already declared global variable.
+	(arm_unwind_emit_set): Use out_file as function argument.
+	(arm_unwind_emit): Likewise.
+	* config/darwin.c (machopic_output_data_section_indirection): Likewise.
+	(machopic_output_stub_indirection): Likewise.
+	(machopic_output_indirection): Likewise.
+	(machopic_finish): Likewise.
+	* config/i386/i386.c (ix86_asm_output_function_label): Likewise.
+	* config/i386/winnt.c (i386_pe_seh_unwind_emit): Likewise.
+	* config/ia64/ia64.c (process_epilogue): Likewise.
+	(process_cfa_adjust_cfa): Likewise.
+	(process_cfa_register): Likewise.
+	(process_cfa_offset): Likewise.
+	(ia64_asm_unwind_emit): Likewise.
+	* config/s390/s390.c (s390_asm_output_function_label): Likewise.
+
+2021-10-20  Andre Simoes Dias Vieira  <andre.simoesdiasvieira@arm.com>
+
+	* config/aarch64/aarch64-builtins.c
+	(aarch64_general_gimple_fold_builtin):
+	lower vld1 and vst1 variants of the neon builtins
+	* config/aarch64/aarch64-protos.h:
+	(aarch64_general_gimple_fold_builtin): Add gsi parameter.
+	* config/aarch64/aarch64.c (aarch64_general_gimple_fold_builtin):
+	Likwise.
+
+2021-10-20  Andre Simoes Dias Vieira  <andre.simoesdiasvieira@arm.com>
+
+	* match.pd: Generate IFN_TRUNC.
+
+2021-10-20  Richard Biener  <rguenther@suse.de>
+
+	PR tree-optimization/102853
+	* tree-data-ref.c (split_constant_offset_1): Bail out
+	immediately if the expression traps on overflow.
+
+2021-10-20  Aldy Hernandez  <aldyh@redhat.com>
+
+	* tree-ssa-threadbackward.c (back_threader::~back_threader): Remove.
+
+2021-10-20  Aldy Hernandez  <aldyh@redhat.com>
+
+	* tree-ssa-threadupdate.c (back_jt_path_registry::adjust_paths_after_duplication):
+	Remove superflous debugging message.
+	(back_jt_path_registry::duplicate_thread_path): Same.
+
+2021-10-20  Aldy Hernandez  <aldyh@redhat.com>
+
+	* tree-ssa-threadbackward.c (back_threader_registry::back_threader_registry):
+	Remove.
+	(back_threader_registry::register_path): Remove m_threaded_paths.
+
+2021-10-20  Aldy Hernandez  <aldyh@redhat.com>
+
+	PR tree-optimization/102814
+	* doc/invoke.texi: Document --param=max-fsm-thread-length.
+	* params.opt: Add --param=max-fsm-thread-length.
+	* tree-ssa-threadbackward.c
+	(back_threader_profitability::profitable_path_p): Fail on paths
+	longer than max-fsm-thread-length.
+
+2021-10-20  Eric Botcazou  <ebotcazou@adacore.com>
+
+	PR middle-end/102764
+	* cfgexpand.c (expand_gimple_basic_block): Disregard a final debug
+	statement to reset the current location for the outgoing edges.
+
+2021-10-20  Aldy Hernandez  <aldyh@redhat.com>
+	    Richard Biener  <rguenther@suse.de>
+
+	* tree-ssa-threadupdate.c (cancel_thread): Dump threading reason
+	on the same line as the threading cancellation.
+	(jt_path_registry::cancel_invalid_paths): Avoid rotating loops.
+	Avoid threading through loop headers where the path remains in the
+	loop.
+
+2021-10-20  Siddhesh Poyarekar  <siddhesh@gotplt.org>
+
+	* tree-object-size.c (unknown): Make into a function.  Adjust
+	all uses.
+	(unknown_object_size): Simplify implementation.
+
+2021-10-20  Hongtao Liu  <hongtao.liu@intel.com>
+	    Kewen Lin  <linkw@linux.ibm.com>
+
+	* doc/sourcebuild.texi (Effective-Target Keywords): Document
+	vect_slp_v2qi_store, vect_slp_v4qi_store, vect_slp_v8qi_store,
+	vect_slp_v16qi_store, vect_slp_v2hi_store,
+	vect_slp_v4hi_store, vect_slp_v2si_store, vect_slp_v4si_store.
+
+2021-10-19  Jonathan Wakely  <jwakely@redhat.com>
+
+	* doc/extend.texi (Basic PowerPC Built-in Functions): Fix typo.
+
+2021-10-19  Paul A. Clarke  <pc@us.ibm.com>
+
+	PR target/101893
+	PR target/102719
+	* config/rs6000/emmintrin.h: Guard POWER8 intrinsics.
+	* config/rs6000/pmmintrin.h: Same.
+	* config/rs6000/smmintrin.h: Same.
+	* config/rs6000/tmmintrin.h: Same.
+
+2021-10-19  Paul A. Clarke  <pc@us.ibm.com>
+
+	* config.gcc (extra_headers): Add nmmintrin.h.
+
+2021-10-19  Richard Biener  <rguenther@suse.de>
+
+	* tree-vectorizer.h (vect_supportable_dr_alignment): Add
+	misalignment parameter.
+	* tree-vect-data-refs.c (vect_get_peeling_costs_all_drs):
+	Do not change DR_MISALIGNMENT in place, instead pass the
+	adjusted misalignment to vect_supportable_dr_alignment.
+	(vect_peeling_supportable): Likewise.
+	(vect_peeling_hash_get_lowest_cost): Adjust.
+	(vect_enhance_data_refs_alignment): Likewise.
+	(vect_vfa_access_size): Likewise.
+	(vect_supportable_dr_alignment): Add misalignment
+	parameter and simplify.
+	* tree-vect-stmts.c (get_negative_load_store_type): Adjust.
+	(get_group_load_store_type): Likewise.
+	(get_load_store_type): Likewise.
+
+2021-10-19  Clément Chigot  <clement.chigot@atos.net>
+
+	* config/rs6000/rs6000.c (rs6000_xcoff_file_end): Move
+	__tls_get_addr reference to .text csect.
+
+2021-10-19  Martin Liska  <mliska@suse.cz>
+
+	PR target/102375
+	* config/aarch64/aarch64.c (aarch64_process_one_target_attr):
+	Strip whitespaces.
+
+2021-10-19  Richard Biener  <rguenther@suse.de>
+
+	* tree-vectorizer.h (vect_get_store_cost): Adjust signature.
+	(vect_get_load_cost): Likewise.
+	* tree-vect-data-refs.c (vect_get_data_access_cost): Get
+	alignment support scheme and misalignment as arguments
+	and pass them down.
+	(vect_get_peeling_costs_all_drs): Compute that info here
+	and note that we shouldn't need to.
+	* tree-vect-stmts.c (vect_model_store_cost): Get
+	alignment support scheme and misalignment as arguments.
+	(vect_get_store_cost): Likewise.
+	(vect_model_load_cost): Likewise.
+	(vect_get_load_cost): Likewise.
+	(vectorizable_store): Pass down alignment support scheme
+	and misalignment to costing.
+	(vectorizable_load): Likewise.
+
+2021-10-19  Richard Biener  <rguenther@suse.de>
+
+	* tree-vect-stmts.c (get_negative_load_store_type): Add
+	offset output parameter and initialize it.
+	(get_group_load_store_type): Likewise.
+	(get_load_store_type): Likewise.
+	(vectorizable_store): Use offset as computed by
+	get_load_store_type.
+	(vectorizable_load): Likewise.
+
+2021-10-19  Richard Biener  <rguenther@suse.de>
+
+	PR tree-optimization/102827
+	* tree-if-conv.c (predicate_statements): Add pe parameter
+	and use that edge to insert invariant stmts on.
+	(combine_blocks): Pass through pe.
+	(tree_if_conversion): Compute the edge to insert invariant
+	stmts on and pass it along.
+
+2021-10-19  Roger Sayle  <roger@nextmovesoftware.com>
+
+	PR target/102785
+	* config/bfin/bfin.md (addsubv2hi3, subaddv2hi3, ssaddsubv2hi3,
+	sssubaddv2hi3):  Swap the order of operators in vec_concat.
+
+2021-10-19  Xionghu Luo  <luoxhu@linux.ibm.com>
+
+	* config/rs6000/altivec.md (*altivec_vmrghb_internal): Delete.
+	(altivec_vmrghb_direct): New.
+	(*altivec_vmrghh_internal): Delete.
+	(altivec_vmrghh_direct): New.
+	(*altivec_vmrghw_internal): Delete.
+	(altivec_vmrghw_direct_<mode>): New.
+	(altivec_vmrghw_direct): Delete.
+	(*altivec_vmrglb_internal): Delete.
+	(altivec_vmrglb_direct): New.
+	(*altivec_vmrglh_internal): Delete.
+	(altivec_vmrglh_direct): New.
+	(*altivec_vmrglw_internal): Delete.
+	(altivec_vmrglw_direct_<mode>): New.
+	(altivec_vmrglw_direct): Delete.
+	* config/rs6000/rs6000-p8swap.c (rtx_is_swappable_p): Adjust.
+	* config/rs6000/rs6000.c (altivec_expand_vec_perm_const):
+	Adjust.
+	* config/rs6000/vsx.md (vsx_xxmrghw_<mode>): Adjust.
+	(vsx_xxmrglw_<mode>): Adjust.
+
+2021-10-19  Aldy Hernandez  <aldyh@redhat.com>
+
+	* passes.def: Change threading comment before pass_ccp pass.
+
+2021-10-19  Haochen Gui  <guihaoc@gcc.gnu.org>
+
+	* config/rs6000/rs6000-call.c (altivec_expand_lxvr_builtin):
+	Modify the expansion for sign extension. All extensions are done
+	within VSX registers.
+
+2021-10-19  Richard Biener  <rguenther@suse.de>
+
+	* tree-vect-stmts.c (get_group_load_store_type): Add
+	misalignment output parameter and initialize it.
+	(get_group_load_store_type): Likewise.
+	(vectorizable_store): Remove now redundant queries.
+	(vectorizable_load): Likewise.
+
+2021-10-19  Richard Biener  <rguenther@suse.de>
+
+	* tree-vectorizer.h (vect_supportable_dr_alignment): Remove
+	check_aligned argument.
+	* tree-vect-data-refs.c (vect_supportable_dr_alignment):
+	Likewise.
+	(vect_peeling_hash_insert): Add supportable_if_not_aligned
+	argument and do not call vect_supportable_dr_alignment here.
+	(vect_peeling_supportable): Adjust.
+	(vect_enhance_data_refs_alignment): Compute whether the
+	access is supported with different alignment here and
+	pass that down to vect_peeling_hash_insert.
+	(vect_vfa_access_size): Adjust.
+	* tree-vect-stmts.c (vect_get_store_cost): Likewise.
+	(vect_get_load_cost): Likewise.
+	(get_negative_load_store_type): Likewise.
+	(get_group_load_store_type): Likewise.
+	(get_load_store_type): Likewise.
+
+2021-10-19  Martin Liska  <mliska@suse.cz>
+
+	PR target/102374
+	* config/i386/i386-options.c (ix86_valid_target_attribute_inner_p): Strip whitespaces.
+	* system.h (strip_whilespaces): New function.
+
+2021-10-19  dianhong xu  <dianhong.xu@intel.com>
+
+	* config/i386/avx512fp16intrin.h:
+	(_mm512_set1_pch): New intrinsic.
+	* config/i386/avx512fp16vlintrin.h:
+	(_mm256_set1_pch): New intrinsic.
+	(_mm_set1_pch): Ditto.
+
+2021-10-18  Andrew MacLeod  <amacleod@redhat.com>
+
+	PR tree-optimization/102796
+	* gimple-range.cc (gimple_ranger::range_on_edge): Process EH edges
+	normally.  Return get_tree_range for non gimple_range_ssa_p names.
+	(gimple_ranger::range_of_stmt): Use get_tree_range for non
+	gimple_range_ssa_p names.
+
+2021-10-18  Uroš Bizjak  <ubizjak@gmail.com>
+
+	PR target/102761
+	* config/i386/i386.c (ix86_print_operand_address):
+	Error out for non-address_operand asm operands.
+
+2021-10-18  Richard Biener  <rguenther@suse.de>
+
+	* tree-vect-data-refs.c (vect_peeling_hash_insert): Do
+	not auto-convert dr_alignment_support to bool.
+	(vect_peeling_supportable): Likewise.
+	(vect_enhance_data_refs_alignment): Likewise.
+	(vect_supportable_dr_alignment): Commonize read/write case.
+	* tree-vect-stmts.c (vect_get_store_cost): Use
+	dr_alignment_support, not int, for the vect_supportable_dr_alignment
+	result.
+	(vect_get_load_cost): Likewise.
+
+2021-10-18  Siddhesh Poyarekar  <siddhesh@gotplt.org>
+
+	* tree-object-size.c (object_sizes_execute): Consolidate LHS
+	null check and do it early.
+
+2021-10-18  Richard Biener  <rguenther@suse.de>
+
+	* tree-vect-stmts.c (vectorizable_store): Use the
+	computed alignment scheme instead of querying
+	aligned_access_p.
+
+2021-10-18  Richard Biener  <rguenther@suse.de>
+
+	* tree-vect-stmts.c (vectorizable_store): Do not recompute
+	alignment scheme already determined by get_load_store_type.
+
+2021-10-18  Aldy Hernandez  <aldyh@redhat.com>
+
+	* tree-ssa-threadbackward.c (class pass_thread_jumps_full):
+	Clone corresponding pass.
+
+2021-10-18  Roger Sayle  <roger@nextmovesoftware.com>
+
+	* combine.c (recog_for_combine): For an unrecognized move/set of
+	a constant, try force_const_mem to place it in the constant pool.
+	* cse.c (constant_pool_entries_cost, constant_pool_entries_regcost):
+	Delete global variables (that are no longer assigned a cost value).
+	(cse_insn): Simplify logic for deciding whether to place a folded
+	constant in the constant pool using force_const_mem.
+	(cse_main): Remove zero initialization of constant_pool_entries_cost
+	and constant_pool_entries_regcost.
+	* config/i386/i386.c (ix86_rtx_costs): Make memory accesses
+	fractionally more expensive, when optimizing for speed.
+
+2021-10-18  Martin Liska  <mliska@suse.cz>
+
+	PR gcov-profile/102746
+	PR gcov-profile/102747
+	* gcov.c (main): Return return_code.
+	(output_gcov_file): Mark return_code when error happens.
+	(generate_results): Likewise.
+	(read_graph_file): Likewise.
+	(read_count_file): Likewise.
+
+2021-10-18  Roger Sayle  <roger@nextmovesoftware.com>
+
+	* config/bfin/bfin.md (define_constants): Remove UNSPEC_ONES.
+	(define_insn "ones"): Replace UNSPEC_ONES with a truncate of
+	a popcount, allowing compile-time evaluation/simplification.
+	(popcountsi2, popcounthi2): New expanders using a "ones" insn.
+
+2021-10-18  Richard Biener  <rguenther@suse.de>
+
+	PR tree-optimization/102788
+	* tree-vect-patterns.c (vect_init_pattern_stmt): Allow
+	a NULL vectype.
+	(vect_pattern_recog_1): Likewise.
+	(vect_recog_bool_pattern): Continue matching the pattern
+	even if we do not have a vector type for a conversion
+	result.
+
+2021-10-18  Roger Sayle  <roger@nextmovesoftware.com>
+
+	* simplify-rtx.c (simplify_const_unary_operation) [SS_NEG, SS_ABS]:
+	Evalute SS_NEG and SS_ABS of a constant argument.
+
+2021-10-18  prathamesh.kulkarni  <prathamesh.kulkarni@linaro.org>
+
+	PR target/93183
+	* gimple-match-head.c (try_conditional_simplification): Add case for single operand.
+	* internal-fn.def: Add entry for COND_NEG internal function.
+	* internal-fn.c (FOR_EACH_CODE_MAPPING): Add entry for
+	NEGATE_EXPR, COND_NEG mapping.
+	* optabs.def: Add entry for cond_neg_optab.
+	* match.pd (UNCOND_UNARY, COND_UNARY): New operator lists.
+	(vec_cond COND (foo A) B) -> (IFN_COND_FOO COND A B): New pattern.
+	(vec_cond COND B (foo A)) -> (IFN_COND_FOO ~COND A B): Likewise.
+
+2021-10-18  Aldy Hernandez  <aldyh@redhat.com>
+
+	* tree-ssa-strlen.c (class strlen_pass): Rename from
+	strlen_dom_walker.
+	(handle_builtin_stxncpy_strncat): Move to strlen_pass.
+	(handle_assign): Same.
+	(adjust_last_stmt): Same.
+	(maybe_warn_overflow): Same.
+	(handle_builtin_strlen): Same.
+	(handle_builtin_strchr): Same.
+	(handle_builtin_strcpy): Same.
+	(handle_builtin_strncat): Same.
+	(handle_builtin_stxncpy_strncat): Same.
+	(handle_builtin_memcpy): Same.
+	(handle_builtin_strcat): Same.
+	(handle_alloc_call): Same.
+	(handle_builtin_memset): Same.
+	(handle_builtin_memcmp): Same.
+	(get_len_or_size): Same.
+	(strxcmp_eqz_result): Same.
+	(handle_builtin_string_cmp): Same.
+	(handle_pointer_plus): Same.
+	(count_nonzero_bytes_addr): Same.
+	(count_nonzero_bytes): Same.
+	(handle_store): Same.
+	(strlen_check_and_optimize_call): Same.
+	(handle_integral_assign): Same.
+	(check_and_optimize_stmt): Same.
+	(printf_strlen_execute): Rename strlen_dom_walker to strlen_pass.
+
+2021-10-18  Richard Biener  <rguenther@suse.de>
+
+	PR tree-optimization/102798
+	* tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref):
+	Only copy points-to info to newly generated SSA names.
+
+2021-10-18  Martin Liska  <mliska@suse.cz>
+
+	* dbgcnt.c (dbg_cnt_process_opt): Remove unused but set variable.
+	* gcov.c (get_cycles_count): Likewise.
+	* lto-compress.c (lto_compression_zlib): Likewise.
+	(lto_uncompression_zlib): Likewise.
+	* targhooks.c (default_pch_valid_p): Likewise.
+
+2021-10-17  Aldy Hernandez  <aldyh@redhat.com>
+
+	* tree-pass.h (make_pass_thread_jumps_full): New.
+	* tree-ssa-threadbackward.c (pass_thread_jumps::gate): Inline.
+	(try_thread_blocks): Add resolve and speed arguments.
+	(pass_thread_jumps::execute): Inline.
+	(do_early_thread_jumps): New.
+	(do_thread_jumps): New.
+	(make_pass_thread_jumps): Move.
+	(pass_early_thread_jumps::gate): Inline.
+	(pass_early_thread_jumps::execute): Inline.
+	(class pass_thread_jumps_full): New.
+
+2021-10-16  Piotr Kubaj  <pkubaj@FreeBSD.org>
+
+	* configure.ac: Treat powerpc64*-*-freebsd* the same as
+	powerpc64-*-freebsd*.
+	* configure: Regenerate.
+
+2021-10-16  H.J. Lu  <hjl.tools@gmail.com>
+
+	* value-query.cc (get_ssa_name_ptr_info_nonnull): Change
+	set_ptr_nonull to set_ptr_nonnull in comments.
+
+2021-10-16  Jan Hubicka  <hubicka@ucw.cz>
+
+	PR tree-optimization/102720
+	* tree-ssa-structalias.c (compute_points_to_sets): Fix producing
+	of call used and clobbered sets.
+
+2021-10-15  Iain Sandoe  <iain@sandoe.co.uk>
+
+	* config/darwin.h (LINK_COMMAND_SPEC_A): Update 'r' handling to
+	skip gomp and itm when r or nodefaultlibs is given.
+	(DSYMUTIL_SPEC): Do not call dsymutil for '-r' link lines.
+	Update ordering of exclusions, remove duplicate 'v' addition
+	(collect2 will add this from the main command line).
+
+2021-10-15  Iain Sandoe  <iain@sandoe.co.uk>
+
+	* config/darwin-driver.c (darwin_driver_init): Revise comments, handle
+	filelist and framework options in specs instead of code.
+	* config/darwin.h (SUBTARGET_DRIVER_SELF_SPECS): Update to handle link
+	specs that are really driver ones.
+	(DARWIN_CC1_SPEC): Likewise.
+	(CPP_SPEC): Likewise.
+	(SYSROOT_SPEC): Append space.
+	(LINK_SYSROOT_SPEC): Remove most driver link specs.
+	(STANDARD_STARTFILE_PREFIX_2): Update link-related specs.
+	(STARTFILE_SPEC): Likewise.
+	(ASM_MMACOSX_VERSION_MIN_SPEC): Fix line wrap.
+	(ASM_SPEC): Update driver-related specs.
+	(ASM_FINAL_SPEC): Likewise.
+	* config/darwin.opt: Remove now unused option aliases.
+	* config/i386/darwin.h (EXTRA_ASM_OPTS): Ensure space after opt.
+	(ASM_SPEC): Update driver-related specs.
+
+2021-10-15  Roger Sayle  <roger@nextmovesoftware.com>
+
+	* config/i386/i386.c (ix86_hardreg_mov_ok): For vector modes,
+	allow standard_sse_constant_p immediate constants.
+
+2021-10-15  Iain Sandoe  <iain@sandoe.co.uk>
+
+	* config.gcc: Add tm-dwarf2.h to tm_d-file.
+
+2021-10-15  Andrew MacLeod  <amacleod@redhat.com>
+
+	* gimple-range-fold.h (gimple_range_ssa_p): Don't process names
+	that occur in abnormal phis.
+	* gimple-range.cc (gimple_ranger::range_on_edge): Return false for
+	abnormal and EH edges.
+	* gimple-ssa-evrp.c (rvrp_folder::value_of_expr): Ditto.
+	(rvrp_folder::value_on_edge): Ditto.
+	(rvrp_folder::value_of_stmt): Ditto.
+	(hybrid_folder::value_of_expr): Ditto for ranger queries.
+	(hybrid_folder::value_on_edge): Ditto.
+	(hybrid_folder::value_of_stmt): Ditto.
+	* value-query.cc (gimple_range_global): Always return a range if
+	the type is supported.
+
+2021-10-15  John David Anglin  <danglin@gcc.gnu.org>
+
+	* config/pa/pa.md: Consistently use "rG" constraint for copy
+	instruction in move patterns.
+
+2021-10-15  Andrew Stubbs  <ams@codesourcery.com>
+
+	* config/gcn/gcn-hsa.h (S_FIJI): Set unconditionally.
+	(S_900): Likewise.
+	(S_906): Likewise.
+	* config/gcn/gcn.c: Hard code SRAM ECC settings for old architectures.
+	* config/gcn/mkoffload.c (ELFABIVERSION_AMDGPU_HSA): Rename to ...
+	(ELFABIVERSION_AMDGPU_HSA_V3): ... this.
+	(ELFABIVERSION_AMDGPU_HSA_V4): New.
+	(SET_SRAM_ECC_UNSUPPORTED): New.
+	(copy_early_debug_info): Create elf flags to match the other objects.
+	(main): Just let the attribute flags pass through.
+
+2021-10-15  Stefan Schulze Frielinghaus  <stefansf@linux.ibm.com>
+
+	* tree-loop-distribution.c (reduction_var_overflows_first):
+	Pass the type of reduction_var as first argument as it is also
+	done for the load type.
+	(loop_distribution::transform_reduction_loop): Add missing
+	TREE_TYPE while determining precission of reduction_var.
+
+2021-10-15  Richard Biener  <rguenther@suse.de>
+
+	* defaults.h (PREFERRED_DEBUGGING_TYPE): Choose DWARF2_DEBUG
+	when not set.
+	* toplev.c (process_options): Warn when STABS debugging is
+	enabled but not the preferred format.
+	* config/pa/som.h (PREFERRED_DEBUGGING_TYPE): Define to
+	DBX_DEBUG.
+	* config/pdp11/pdp11.h (PREFERRED_DEBUGGING_TYPE): Likewise.
+
+2021-10-15  Richard Biener  <rguenther@suse.de>
+
+	PR ipa/102762
+	* tree-inline.c (copy_bb): Avoid underflowing nargs.
+
+2021-10-15  Hongyu Wang  <hongyu.wang@intel.com>
+
+	* config/i386/i386-expand.c (ix86_expand_vec_perm): Convert
+	HFmode input operand to HImode.
+	(ix86_vectorize_vec_perm_const): Likewise.
+	* config/i386/sse.md (*avx512bw_permvar_truncv16siv16hi_1_hf):
+	New define_insn.
+	(*avx512f_permvar_truncv8siv8hi_1_hf):
+	Likewise.
+
+2021-10-15  Richard Biener  <rguenther@suse.de>
+
+	PR middle-end/102682
+	* expmed.c (store_bit_field_1): Ensure a LHS subreg would
+	not create a paradoxical subreg.
+
+2021-10-15  Hongyu Wang  <hongyu.wang@intel.com>
+
+	* config/i386/i386-expand.c (ix86_expand_vector_init):
+	For half_vector concat for HFmode, handle them like HImode.
+
+2021-10-14  Aldy Hernandez  <aldyh@redhat.com>
+
+	* tree-ssa-threadbackward.c (class back_threader): Add m_resolve.
+	(back_threader::back_threader): Same.
+	(back_threader::resolve_phi): Try to solve without looking back if
+	possible.
+	(back_threader::find_paths_to_names): Same.
+	(try_thread_blocks): Pass resolve argument to back threader.
+	(pass_early_thread_jumps::execute): Same.
+
+2021-10-14  Aldy Hernandez  <aldyh@redhat.com>
+
+	* doc/invoke.texi: Remove max-fsm-thread-length,
+	max-fsm-thread-paths, and fsm-maximum-phi-arguments.
+	* params.opt: Same.
+	* tree-ssa-threadbackward.c (back_threader::back_threader): Remove
+	argument.
+	(back_threader_registry::back_threader_registry): Same.
+	(back_threader_profitability::profitable_path_p): Remove
+	param_max_fsm_thread-length.
+	(back_threader_registry::register_path): Remove
+	m_max_allowable_paths.
+
+2021-10-14  Aldy Hernandez  <aldyh@redhat.com>
+
+	* tree-ssa-threadbackward.c (class back_threader): Make m_imports
+	an auto_bitmap.
+	(back_threader::~back_threader): Do not release m_path.
+
+2021-10-14  Andrew MacLeod  <amacleod@redhat.com>
+
+	PR tree-optimization/102738
+	* vr-values.c (simplify_using_ranges::simplify): Handle RSHIFT_EXPR.
+
+2021-10-14  Kwok Cheung Yeung  <kcy@codesourcery.com>
+
+	* omp-general.c (omp_check_context_selector):  Move from c-omp.c.
+	(omp_mark_declare_variant): Move from c-omp.c.
+	(omp_context_name_list_prop): Update for Fortran strings.
+	* omp-general.h (omp_check_context_selector): New prototype.
+	(omp_mark_declare_variant): New prototype.
+
+2021-10-14  Richard Sandiford  <richard.sandiford@arm.com>
+
+	* config/rs6000/rs6000.c (rs6000_density_test): Move early
+	exit test further up the function.
+
+2021-10-14  Richard Sandiford  <richard.sandiford@arm.com>
+
+	* config/arm/arm.c (arm_add_stmt_cost): Delete.
+	(TARGET_VECTORIZE_ADD_STMT_COST): Delete.
+
+2021-10-14  Martin Jambor  <mjambor@suse.cz>
+
+	* doc/invoke.texi (Optimize Options): Add entry for
+	ipa-cp-recursive-freq-factor.
+
+2021-10-14  Tamar Christina  <tamar.christina@arm.com>
+
+	* match.pd: New rule.
+
+2021-10-14  Jan Hubicka  <hubicka@ucw.cz>
+
+	PR ipa/102557
+	* ipa-modref-tree.h (modref_access_node::update2):
+	Also check that parm_offset is unchanged.
+	(modref_ref_node::insert_access): Fix updating of
+	parameter.
+
+2021-10-14  Aldy Hernandez  <aldyh@redhat.com>
+
+	* tree-ssa-threadbackward.c (back_threader::resolve_phi): Add
+	FIXME note.
+
+2021-10-14  Richard Biener  <rguenther@suse.de>
+
+	PR tree-optimization/102659
+	* tree-if-conv.c (if_convertible_gimple_assign_stmt_p): Also
+	rewrite pointer typed undefined overflow operations.
+	(predicate_statements): Likewise.  Make sure to emit invariant
+	conversions in the preheader.
+	* tree-vectorizer.c (vect_loop_vectorized_call): Look through
+	non-empty preheaders.
+	* tree-data-ref.c (dr_analyze_indices): Strip useless
+	conversions to the MEM_REF base type.
+
+2021-10-14  Martin Liska  <mliska@suse.cz>
+
+	* common.opt: Stop using AUTODETECT_VALUE
+	and use EnabledBy where possible.
+	* opts.c: Enable OPT_fvar_tracking with optimize >= 1.
+	* toplev.c (AUTODETECT_VALUE): Remove macro.
+	(process_options): Simplify by using EnabledBy and
+	OPT_fvar_tracking.  Use OPTION_SET_P macro instead of
+	AUTODETECT_VALUE.
+
+2021-10-14  Jonathan Wright  <jonathan.wright@arm.com>
+
+	* config/aarch64/arm_neon.h (vld1_s8_x3): Use signed type for
+	pointer parameter.
+	(vld1_s32_x3): Likewise.
+
+2021-10-14  Aldy Hernandez  <aldyh@redhat.com>
+
+	PR tree-optimization/102736
+	PR tree-optimization/102736
+	* gimple-range-path.cc (path_range_query::range_on_path_entry):
+	Assert that the requested range is defined outside the path.
+	(path_range_query::ssa_range_in_phi): Do not call
+	range_on_path_entry for SSA names that are defined within the
+	path.
+
+2021-10-14  Iain Sandoe  <iain@sandoe.co.uk>
+
+	* config/darwin-driver.c (darwin_find_version_from_kernel):
+	Quote internal identifiers and avoid contractions in
+	warnings.
+	(darwin_default_min_version): Likewise.
+	(darwin_driver_init): Likewise.
+
+2021-10-14  Martin Jambor  <mjambor@suse.cz>
+
+	* params.opt (ipa-cp-recursive-freq-factor): New.
+	* ipa-cp.c (ipcp_value): Switch to inline initialization.  New members
+	scc_no, self_recursion_generated_level, same_scc and
+	self_recursion_generated_p.
+	(ipcp_lattice::add_value): Replaced parameter unlimited with
+	same_lat_gen_level, usit it determine limit of values and store it to
+	the value.
+	(ipcp_lattice<valtype>::print): Dump the new fileds.
+	(allocate_and_init_ipcp_value): Take same_lat_gen_level as a new
+	parameter and store it to the new value.
+	(self_recursively_generated_p): Removed.
+	(propagate_vals_across_arith_jfunc): Use self_recursion_generated_p
+	instead of self_recursively_generated_p, store self generation level
+	to such values.
+	(value_topo_info<valtype>::add_val): Set scc_no.
+	(value_topo_info<valtype>::propagate_effects): Multiply frequencies of
+	recursively feeding values and self generated values by appropriate
+	new factors.
+
+2021-10-14  Richard Sandiford  <richard.sandiford@arm.com>
+
+	* config/aarch64/aarch64.c (aarch64_add_stmt_cost): Remove
+	redundant test for flag_vect_cost_model.
+
+2021-10-14  Aldy Hernandez  <aldyh@redhat.com>
+
+	* bitmap.c (debug): New overloaded function for auto_bitmaps.
+	* bitmap.h (debug): Same.
+
+2021-10-14  Hongyu Wang  <hongyu.wang@intel.com>
+
+	* config/i386/avx512fp16intrin.h (_mm512_mask_fcmadd_pch):
+	Adjust builtin call.
+	(_mm512_mask3_fcmadd_pch): Likewise.
+	(_mm512_mask_fmadd_pch): Likewise
+	(_mm512_mask3_fmadd_pch): Likewise
+	(_mm512_mask_fcmadd_round_pch): Likewise
+	(_mm512_mask3_fcmadd_round_pch): Likewise
+	(_mm512_mask_fmadd_round_pch): Likewise
+	(_mm512_mask3_fmadd_round_pch): Likewise
+	(_mm_mask_fcmadd_sch): Likewise
+	(_mm_mask3_fcmadd_sch): Likewise
+	(_mm_mask_fmadd_sch): Likewise
+	(_mm_mask3_fmadd_sch): Likewise
+	(_mm_mask_fcmadd_round_sch): Likewise
+	(_mm_mask3_fcmadd_round_sch): Likewise
+	(_mm_mask_fmadd_round_sch): Likewise
+	(_mm_mask3_fmadd_round_sch): Likewise
+	(_mm_fcmadd_round_sch): Likewise
+	* config/i386/avx512fp16vlintrin.h (_mm_mask_fmadd_pch):
+	Adjust builtin call.
+	(_mm_mask3_fmadd_pch): Likewise
+	(_mm256_mask_fmadd_pch): Likewise
+	(_mm256_mask3_fmadd_pch): Likewise
+	(_mm_mask_fcmadd_pch): Likewise
+	(_mm_mask3_fcmadd_pch): Likewise
+	(_mm256_mask_fcmadd_pch): Likewise
+	(_mm256_mask3_fcmadd_pch): Likewise
+	* config/i386/i386-builtin.def: Add mask3 builtin for complex
+	fma, and adjust mask_builtin to corresponding expander.
+	* config/i386/i386-expand.c (ix86_expand_round_builtin):
+	Skip eraseing embedded rounding for expanders that emits
+	multiple insns.
+	* config/i386/sse.md (complexmove): New mode_attr.
+	(<avx512>_fmaddc_<mode>_mask1<round_expand_name>): New expander.
+	(<avx512>_fcmaddc_<mode>_mask1<round_expand_name>): Likewise.
+	(avx512fp16_fmaddcsh_v8hf_mask1<round_expand_name>): Likewise.
+	(avx512fp16_fcmaddcsh_v8hf_mask1<round_expand_name>): Likewise.
+	(avx512fp16_fcmaddcsh_v8hf_mask3<round_expand_name>): Likewise.
+	(avx512fp16_fmaddcsh_v8hf_mask3<round_expand_name>): Likewise.
+	* config/i386/subst.md (round_embedded_complex): New subst.
+
+2021-10-14  John David Anglin  <danglin@gcc.gnu.org>
+
+	* config/pa/pa.md (cbranchsf4): Disable if TARGET_SOFT_FLOAT.
+	(cbranchdf4): Likewise.
+	Add missing move patterns for TARGET_SOFT_FLOAT.
+
+2021-10-13  Roger Sayle  <roger@nextmovesoftware.com>
+
+	* config/i386/i386-expand.c (ix86_expand_vector_move):  Use a
+	pseudo intermediate when moving a SUBREG into a hard register,
+	by checking ix86_hardreg_mov_ok.
+	(ix86_expand_vector_extract): Store zero-extended SImode
+	intermediate in a pseudo, then set target using a SUBREG_PROMOTED
+	annotated subreg.
+	* config/i386/sse.md (mov<VMOVE>_internal): Prevent CSE creating
+	complex (SUBREG) sets of (vector) hard registers before reload, by
+	checking ix86_hardreg_mov_ok.
+
+2021-10-13  Indu Bhagat  <indu.bhagat@oracle.com>
+
+	* ctfc.h (enum ctf_dtu_d_union_enum): Remove redundant comma.
+
+2021-10-13  Indu Bhagat  <indu.bhagat@oracle.com>
+
+	* dwarf2ctf.c (gen_ctf_array_type): Fix typo in comment.
+
+2021-10-13  Martin Sebor  <msebor@redhat.com>
+
+	PR middle-end/102630
+	* pointer-query.cc (compute_objsize_r): Handle named address spaces.
+
+2021-10-13  Iain Sandoe  <iain@sandoe.co.uk>
+
+	* collect2.c (is_lto_object_file): Release simple-object
+	resources, close files.
+
+2021-10-13  Andre Vieira  <andre.simoesdiasvieira@arm.com>
+
+	* config/arm/arm.c (thumb2_legitimate_address_p): Use VALID_MVE_MODE
+	when checking mve addressing modes.
+	(mve_vector_mem_operand): Fix the way we handle pre, post and offset
+	addressing modes.
+	(arm_print_operand): Fix printing of POST_ and PRE_MODIFY.
+	* config/arm/mve.md: Use mve_memory_operand predicate everywhere where
+	there is a single Ux constraint.
+
+2021-10-13  John David Anglin  <danglin@gcc.gnu.org>
+
+	* config/pa/pa.md (muldi3): Add support for inlining 64-bit
+	multiplication on 32-bit PA 1.1 and 2.0 targets.
+
+2021-10-13  Martin Liska  <mliska@suse.cz>
+
+	PR gcov-profile/90364
+	* coverage.c (build_info): Emit checksum to the global variable.
+	(build_info_type): Add new field for checksum.
+	(coverage_obj_finish): Pass object_checksum.
+	(coverage_init): Use 0 as checksum for .gcno files.
+	* gcov-dump.c (dump_gcov_file): Dump also new checksum field.
+	* gcov.c (read_graph_file): Read also checksum.
+	* doc/invoke.texi: Document the behaviour change.
+
+2021-10-13  Richard Biener  <rguenther@suse.de>
+
+	* gimple-iterator.h (gsi_iterator_update): Add GSI_LAST_NEW_STMT,
+	start at integer value 2.
+	* gimple-iterator.c (gsi_insert_seq_nodes_before): Update
+	the iterator for GSI_LAST_NEW_STMT.
+	(gsi_insert_seq_nodes_after): Likewise.
+	* tree-if-conv.c (predicate_statements): Use GSI_LAST_NEW_STMT.
+	* tree-ssa.c (execute_update_addresses_taken): Correct bogus
+	arguments to gsi_replace.
+
+2021-10-13  Martin Liska  <mliska@suse.cz>
+
+	PR target/102688
+	* common.opt: Use EnabledBy instead of detection in
+	finish_options and process_options.
+	* opts.c (finish_options): Remove handling of
+	x_flag_unroll_all_loops.
+	* toplev.c (process_options): Likewise for flag_web and
+	flag_rename_registers.
+
+2021-10-13  Richard Biener  <rguenther@suse.de>
+
+	PR tree-optimization/102659
+	* tree-if-conv.c (need_to_rewrite_undefined): New flag.
+	(if_convertible_gimple_assign_stmt_p): Mark the loop for
+	rewrite when stmts with undefined behavior on integer
+	overflow appear.
+	(combine_blocks): Predicate also when we need to rewrite stmts.
+	(predicate_statements): Rewrite affected stmts to something
+	with well-defined behavior on overflow.
+	(tree_if_conversion): Initialize need_to_rewrite_undefined.
+
+2021-10-13  Richard Biener  <rguenther@suse.de>
+
+	PR ipa/102714
+	* ipa-sra.c (ptr_parm_has_nonarg_uses): Fix volatileness
+	check.
+
+2021-10-13  Jose E. Marchesi  <jose.marchesi@oracle.com>
+
+	* dwarf2ctf.c: Fix typo in comment.
+
+2021-10-12  Bill Schmidt  <wschmidt@linux.ibm.com>
+
+	PR target/101985
+	* config/rs6000/altivec.h (vec_cpsgn): Swap operand order.
+	* config/rs6000/rs6000-overload.def (VEC_COPYSIGN): Use SKIP to
+	avoid generating an automatic #define of vec_cpsgn.  Use the
+	correct built-in for V4SFmode that doesn't depend on VSX.
+
+2021-10-12  Uroš Bizjak  <ubizjak@gmail.com>
+
+	PR target/85730
+	PR target/82524
+	* config/i386/i386.md (*add<mode>_1_slp): Rewrite as
+	define_insn_and_split pattern.  Add alternative 1 and split it
+	post reload to insert operand 1 into the low part of operand 0.
+	(*sub<mode>_1_slp): Ditto.
+	(*and<mode>_1_slp): Ditto.
+	(*<any_or:code><mode>_1_slp): Ditto.
+	(*ashl<mode>3_1_slp): Ditto.
+	(*<any_shiftrt:insn><mode>3_1_slp): Ditto.
+	(*<any_rotate:insn><mode>3_1_slp): Ditto.
+	(*neg<mode>_1_slp): New insn_and_split pattern.
+	(*one_cmpl<mode>_1_slp): Ditto.
+
+2021-10-12  David Edelsohn  <dje.gcc@gmail.com>
+
+	* doc/install.texi: Update MinGW and mingw-64 Binaries
+	download links.
+
+2021-10-12  Daniel Le Duc Khoi Nguyen  <greenrecyclebin@gmail.com>
+
+	* doc/extend.texi (Common Variable Attributes): Fix typos in
+	alloc_size documentation.
+
+2021-10-12  Richard Biener  <rguenther@suse.de>
+
+	PR tree-optimization/102696
+	* tree-vect-slp.c (vect_build_slp_tree_2): Properly mark
+	the tree fatally failed when we reject a BIT_FIELD_REF.
+
+2021-10-12  Richard Biener  <rguenther@suse.de>
+
+	PR tree-optimization/102572
+	* tree-vect-stmts.c (vect_build_gather_load_calls): When
+	gathering the vectorized defs for the mask pass in the
+	desired mask vector type so invariants will be handled
+	correctly.
+
+2021-10-12  Tamar Christina  <tamar.christina@arm.com>
+
+	* config/aarch64/aarch64-sve.md (*fcm<cmp_op><mode>_bic_combine,
+	*fcm<cmp_op><mode>_nor_combine, *fcmuo<mode>_bic_combine,
+	*fcmuo<mode>_nor_combine): New.
+
+2021-10-12  Eric Botcazou  <ebotcazou@adacore.com>
+
+	PR target/102588
+	* config/sparc/sparc-modes.def (OI): New integer mode.
+
+2021-10-12  Jakub Jelinek  <jakub@redhat.com>
+
+	* gimple-fold.h (clear_padding_type_may_have_padding_p): Declare.
+	* gimple-fold.c (clear_padding_type_may_have_padding_p): No longer
+	static.
+
+2021-10-12  Jakub Jelinek  <jakub@redhat.com>
+
+	* tree-vectorizer.h (loop_cost_model): New function.
+	(unlimited_cost_model): Use it.
+	* tree-vect-loop.c (vect_analyze_loop_costing): Use loop_cost_model
+	call instead of flag_vect_cost_model.
+	* tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Likewise.
+	(vect_prune_runtime_alias_test_list): Likewise.  Also use it instead
+	of flag_simd_cost_model.
+
+2021-10-12  liuhongt  <hongtao.liu@intel.com>
+
+	PR target/102483
+	* config/i386/i386-expand.c (emit_reduc_half): Handle
+	V4QImode.
+	* config/i386/mmx.md (reduc_<code>_scal_v4qi): New expander.
+	(reduc_plus_scal_v4qi): Ditto.
+
+2021-10-12  Paul A. Clarke  <pc@us.ibm.com>
+
+	* config/rs6000/smmintrin.h (_mm_cmpeq_epi64, _mm_cmpgt_epi64,
+	_mm_mullo_epi32, _mm_mul_epi32, _mm_packus_epi32): New.
+	* config/rs6000/nmmintrin.h: Copy from i386, tweak to suit.
+
+2021-10-12  Paul A. Clarke  <pc@us.ibm.com>
+
+	* config/rs6000/smmintrin.h (_mm_cvtepi8_epi16, _mm_cvtepi8_epi32,
+	_mm_cvtepi8_epi64, _mm_cvtepi16_epi32, _mm_cvtepi16_epi64,
+	_mm_cvtepi32_epi64, _mm_cvtepu8_epi16, _mm_cvtepu8_epi32,
+	_mm_cvtepu8_epi64, _mm_cvtepu16_epi32, _mm_cvtepu16_epi64,
+	_mm_cvtepu32_epi64): New.
+
+2021-10-12  Paul A. Clarke  <pc@us.ibm.com>
+
+	* config/rs6000/smmintrin.h (_mm_test_all_zeros,
+	_mm_test_all_ones, _mm_test_mix_ones_zeros): Rewrite as macro.
+
+2021-10-12  Paul A. Clarke  <pc@us.ibm.com>
+
+	* config/rs6000/smmintrin.h (_mm_min_epi8, _mm_min_epu16,
+	_mm_min_epi32, _mm_min_epu32, _mm_max_epi8, _mm_max_epu16,
+	_mm_max_epi32, _mm_max_epu32): New.
+
+2021-10-11  Jan Hubicka  <hubicka@ucw.cz>
+
+	* ipa-modref-tree.h (struct modref_access_node): Revert
+	accidental change.
+	(struct modref_ref_node): Likewise.
+
+2021-10-11  Jan Hubicka  <hubicka@ucw.cz>
+
+	* ipa-modref-tree.h (modref_tree::global_access_p): New member
+	function.
+	* ipa-modref.c:
+	(implicint_const_eaf_flags,implicit_pure_eaf_flags,
+	ignore_stores_eaf_flags): Move to ipa-modref.h
+	(remove_useless_eaf_flags): Remove early exit on NOCLOBBER.
+	(modref_summary::global_memory_read_p): New member function.
+	(modref_summary::global_memory_written_p): New member function.
+	* ipa-modref.h (modref_summary::global_memory_read_p,
+	modref_summary::global_memory_written_p): Declare.
+	(implicint_const_eaf_flags,implicit_pure_eaf_flags,
+	ignore_stores_eaf_flags): move here.
+	* tree-ssa-structalias.c: Include ipa-modref-tree.h, ipa-modref.h
+	and attr-fnspec.h.
+	(handle_rhs_call): Rewrite.
+	(handle_call_arg): New function.
+	(determine_global_memory_access): New function.
+	(handle_const_call): Remove
+	(handle_pure_call): Remove
+	(find_func_aliases_for_call): Update use of handle_rhs_call.
+	(compute_points_to_sets): Handle global memory acccesses
+	selectively
+
+2021-10-11  Diane Meirowitz  <diane.meirowitz@oracle.com>
+
+	* doc/invoke.texi: Add link to UndefinedBehaviorSanitizer
+	documentation, mention UBSAN_OPTIONS, similar to what is done
+	for AddressSanitizer.
+
+2021-10-11  Richard Biener  <rguenther@suse.de>
+
+	PR middle-end/102683
+	* internal-fn.c (expand_DEFERRED_INIT): Check for mode
+	availability before building an integer type for storage
+	purposes.
+
+2021-10-11  Richard Biener  <rguenther@suse.de>
+
+	PR middle-end/101480
+	* gimple.c (gimple_call_fnspec): Do not mark operator new/delete
+	as const.
+
+2021-10-11  Martin Liska  <mliska@suse.cz>
+
+	* common.opt: Remove Init(2) for some options.
+	* toplev.c (process_options): Do not use AUTODETECT_VALUE, but
+	use rather OPTION_SET_P.
+
+2021-10-11  Martin Liska  <mliska@suse.cz>
+
+	* common.opt: Remove usage of IRA_REGION_AUTODETECT.
+	* flag-types.h (enum ira_region): Likewise.
+	* toplev.c (process_options): Use OPTION_SET_P instead of
+	IRA_REGION_AUTODETECT.
+
+2021-10-11  Jakub Jelinek  <jakub@redhat.com>
+
+	* omp-low.c (omp_runtime_api_call): Handle omp_get_max_teams,
+	omp_[sg]et_teams_thread_limit and omp_set_num_teams.
+
+2021-10-11  Stefan Schulze Frielinghaus  <stefansf@linux.ibm.com>
+
+	* config/s390/s390-protos.h (s390_rawmemchr): Add prototype.
+	* config/s390/s390.c (s390_rawmemchr): New function.
+	* config/s390/s390.md (rawmemchr<SINT:mode>): New expander.
+	* config/s390/vector.md (@vec_vfees<mode>): Basically a copy of
+	the pattern vfees<mode> from vx-builtins.md.
+	* config/s390/vx-builtins.md (*vfees<mode>): Remove.
+
+2021-10-11  Stefan Schulze Frielinghaus  <stefansf@linux.ibm.com>
+
+	* builtins.c (get_memory_rtx): Change to external linkage.
+	* builtins.h (get_memory_rtx): Add function prototype.
+	* doc/md.texi (rawmemchr<mode>): Document.
+	* internal-fn.c (expand_RAWMEMCHR): Define.
+	* internal-fn.def (RAWMEMCHR): Add.
+	* optabs.def (rawmemchr_optab): Add.
+	* tree-loop-distribution.c (find_single_drs): Change return code
+	behaviour by also returning true if no single store was found
+	but a single load.
+	(loop_distribution::classify_partition): Respect the new return
+	code behaviour of function find_single_drs.
+	(loop_distribution::execute): Call new function
+	transform_reduction_loop in order to replace rawmemchr or strlen
+	like loops by calls into builtins.
+	(generate_reduction_builtin_1): New function.
+	(generate_rawmemchr_builtin): New function.
+	(generate_strlen_builtin_1): New function.
+	(generate_strlen_builtin): New function.
+	(generate_strlen_builtin_using_rawmemchr): New function.
+	(reduction_var_overflows_first): New function.
+	(determine_reduction_stmt_1): New function.
+	(determine_reduction_stmt): New function.
+	(loop_distribution::transform_reduction_loop): New function.
+
+2021-10-11  Martin Liska  <mliska@suse.cz>
+
+	* tree.c (cl_option_hasher::hash): Use cl_optimization_hash
+	and remove legacy hashing code.
+
+2021-10-11  Kito Cheng  <kito.cheng@sifive.com>
+
+	PR target/100316
+	* builtins.c (maybe_emit_call_builtin___clear_cache): Allow
+	CONST_INT for BEGIN and END, and use gcc_assert rather than
+	error.
+
+2021-10-10  Jakub Jelinek  <jakub@redhat.com>
+
+	PR debug/102441
+	* var-tracking.c (add_stores): For cselib_sp_derived_value_p values
+	use MO_VAL_SET if loc is not sp.
+
+2021-10-10  Andrew Pinski  <apinski@marvell.com>
+
+	PR tree-optimization/102622
+	* match.pd: Swap the order of a?pow2cst:0 and a?-1:0 transformations.
+	Swap the order of a?0:pow2cst and a?0:-1 transformations.
+
+2021-10-09  liuhongt  <hongtao.liu@intel.com>
+
+	PR target/102639
+	* config/i386/i386-expand.c (ix86_valid_mask_cmp_mode): Handle
+	HFmode.
+	(ix86_use_mask_cmp_p): Ditto.
+	(ix86_expand_sse_movcc): Ditto.
+	* config/i386/i386.md (setcc_hf_mask): New define_insn.
+	(movhf_mask): Ditto.
+	(UNSPEC_MOVCC_MASK): New unspec.
+	* config/i386/sse.md (UNSPEC_PCMP): Move to i386.md.
+
+2021-10-08  Vladimir N. Makarov  <vmakarov@redhat.com>
+
+	PR rtl-optimization/102627
+	* lra-constraints.c (split_reg): Use at least natural mode of hard reg.
+
+2021-10-08  Aldy Hernandez  <aldyh@redhat.com>
+
+	* gimple-range-cache.cc (non_null_ref::non_null_deref_p): Grow
+	bitmap if needed.
+
+2021-10-08  Aldy Hernandez  <aldyh@redhat.com>
+
+	* value-range.cc (irange::debug): New.
+	* value-range.h (irange::debug): New.
+
+2021-10-08  Richard Sandiford  <richard.sandiford@arm.com>
+
+	PR tree-optimization/102385
+	* predict.h (change_edge_frequency): Declare.
+	* predict.c (change_edge_frequency): New function.
+	* tree-ssa-loop-manip.h (tree_transform_and_unroll_loop): Remove
+	edge argument.
+	(tree_unroll_loop): Likewise.
+	* gimple-loop-jam.c (tree_loop_unroll_and_jam): Update accordingly.
+	* tree-predcom.c (pcom_worker::tree_predictive_commoning_loop):
+	Likewise.
+	* tree-ssa-loop-prefetch.c (loop_prefetch_arrays): Likewise.
+	* tree-ssa-loop-manip.c (tree_unroll_loop): Likewise.
+	(tree_transform_and_unroll_loop): Likewise.  Use single_dom_exit
+	to retrieve the exit edges.  Make all the old profile update code
+	conditional on !single_loop_p -- the case it was written for --
+	and use a different approach for the single-loop case.
+
+2021-10-08  Martin Liska  <mliska@suse.cz>
+
+	* config/alpha/alpha.c (alpha_option_override): Use new macro
+	OPTION_SET_P.
+	* config/arc/arc.c (arc_override_options): Likewise.
+	* config/arm/arm.c (arm_option_override): Likewise.
+	* config/bfin/bfin.c (bfin_load_pic_reg): Likewise.
+	* config/c6x/c6x.c (c6x_option_override): Likewise.
+	* config/csky/csky.c: Likewise.
+	* config/darwin.c (darwin_override_options): Likewise.
+	* config/frv/frv.c (frv_option_override): Likewise.
+	* config/i386/djgpp.h: Likewise.
+	* config/i386/i386.c (ix86_stack_protect_guard): Likewise.
+	(ix86_max_noce_ifcvt_seq_cost): Likewise.
+	* config/ia64/ia64.c (ia64_option_override): Likewise.
+	(ia64_override_options_after_change): Likewise.
+	* config/m32c/m32c.c (m32c_option_override): Likewise.
+	* config/m32r/m32r.c (m32r_init): Likewise.
+	* config/m68k/m68k.c (m68k_option_override): Likewise.
+	* config/microblaze/microblaze.c (microblaze_option_override): Likewise.
+	* config/mips/mips.c (mips_option_override): Likewise.
+	* config/nios2/nios2.c (nios2_option_override): Likewise.
+	* config/nvptx/nvptx.c (nvptx_option_override): Likewise.
+	* config/pa/pa.c (pa_option_override): Likewise.
+	* config/riscv/riscv.c (riscv_option_override): Likewise.
+	* config/rs6000/aix71.h: Likewise.
+	* config/rs6000/aix72.h: Likewise.
+	* config/rs6000/aix73.h: Likewise.
+	* config/rs6000/rs6000.c (darwin_rs6000_override_options): Likewise.
+	(rs6000_override_options_after_change): Likewise.
+	(rs6000_linux64_override_options): Likewise.
+	(glibc_supports_ieee_128bit): Likewise.
+	(rs6000_option_override_internal): Likewise.
+	(rs6000_file_start): Likewise.
+	(rs6000_darwin_file_start): Likewise.
+	* config/rs6000/rtems.h: Likewise.
+	* config/rs6000/sysv4.h: Likewise.
+	* config/rs6000/vxworks.h (SUB3TARGET_OVERRIDE_OPTIONS): Likewise.
+	* config/s390/s390.c (s390_option_override): Likewise.
+	* config/sh/linux.h: Likewise.
+	* config/sh/netbsd-elf.h (while): Likewise.
+	* config/sh/sh.c (sh_option_override): Likewise.
+	* config/sol2.c (solaris_override_options): Likewise.
+	* config/sparc/sparc.c (sparc_option_override): Likewise.
+	* config/tilegx/tilegx.c (tilegx_option_override): Likewise.
+	* config/visium/visium.c (visium_option_override): Likewise.
+	* config/vxworks.c (vxworks_override_options): Likewise.
+	* lto-opts.c (lto_write_options): Likewise.
+	* omp-expand.c (expand_omp_simd): Likewise.
+	* omp-general.c (omp_max_vf): Likewise.
+	* omp-offload.c (oacc_xform_loop): Likewise.
+	* opts.h (OPTION_SET_P): Likewise.
+	* targhooks.c (default_max_noce_ifcvt_seq_cost): Likewise.
+	* toplev.c (process_options): Likewise.
+	* tree-predcom.c: Likewise.
+	* tree-sra.c (analyze_all_variable_accesses): Likewise.
+
+2021-10-08  liuhongt  <hongtao.liu@intel.com>
+
+	PR target/102464
+	* config/i386/i386.c (ix86_optab_supported_p):
+	Return true for HFmode.
+	* match.pd: Simplify (_Float16) ceil ((double) x) to
+	__builtin_ceilf16 (a) when a is _Float16 type and
+	direct_internal_fn_supported_p.
+
+2021-10-08  liuhongt  <hongtao.liu@intel.com>
+
+	PR target/102494
+	* config/i386/i386-expand.c (emit_reduc_half): Hanlde V4HImode.
+	* config/i386/mmx.md (reduc_plus_scal_v4hi): New.
+	(reduc_<code>_scal_v4hi): New.
+
+2021-10-08  liuhongt  <hongtao.liu@intel.com>
+
+	* common.opt (ftree-vectorize): Add Var(flag_tree_vectorize).
+	* doc/invoke.texi (Options That Control Optimization): Update
+	documents.
+	* opts.c (default_options_table): Enable auto-vectorization at
+	O2 with very-cheap cost model.
+	(finish_options): Use cheap cost model for
+	explicit -ftree{,-loop}-vectorize.
+
 2021-10-07  Indu Bhagat  <indu.bhagat@oracle.com>
 
 	* ctfc.c (ctfc_delete_container): Free hash table contents.
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 202e0fe..3b249e4 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20211008
+20211027
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index f36ffa4..658093c 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -713,6 +713,8 @@
 
 datarootdir = @datarootdir@
 docdir = @docdir@
+# Directory in which to put DVIs
+dvidir = @dvidir@
 # Directory in which to build HTML
 build_htmldir = $(objdir)/HTML/gcc-$(version)
 # Directory in which to put HTML
@@ -3386,8 +3388,10 @@
 $(build_htmldir)/gccint/index.html: $(TEXI_GCCINT_FILES)
 $(build_htmldir)/cppinternals/index.html: $(TEXI_CPPINT_FILES)
 
-dvi:: doc/gcc.dvi doc/gccint.dvi doc/gccinstall.dvi doc/cpp.dvi \
-      doc/cppinternals.dvi lang.dvi
+DVIFILES = doc/gcc.dvi doc/gccint.dvi doc/gccinstall.dvi doc/cpp.dvi \
+           doc/cppinternals.dvi
+
+dvi:: $(DVIFILES) lang.dvi
 
 doc/%.dvi: %.texi
 	$(TEXI2DVI) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
@@ -3797,6 +3801,18 @@
 	  else true; fi; \
 	else true; fi;
 
+dvi__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+
+install-dvi: $(DVIFILES) lang.install-dvi
+	@$(NORMAL_INSTALL)
+	test -z "$(dvidir)/gcc" || $(mkinstalldirs) "$(DESTDIR)$(dvidir)/gcc"
+	@list='$(DVIFILES)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(dvi__strip_dir) \
+	  echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(dvidir)/gcc/$$f'"; \
+	  $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(dvidir)/gcc/$$f"; \
+	done
+
 pdf__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
 
 install-pdf: $(PDFFILES) lang.install-pdf
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index feadd5e..ab7c0f5 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,851 @@
+2021-10-25  Arnaud Charlet  <charlet@adacore.com>
+
+	* gcc-interface/Make-lang.in, gcc-interface/Makefile.in: Remove
+	gnatfind and gnatxref.
+
+2021-10-25  Ed Schonberg  <schonberg@adacore.com>
+
+	* sem_ch4.adb (Has_Possible_Literal_Aspects): If analysis of an
+	operator node fails to find  a possible interpretation, and one
+	of its operands is a literal or a named number, assign to the
+	node the corresponding class type (Any_Integer, Any_String,
+	etc).
+	(Operator_Check): Call it before emitting a type error.
+	* sem_res.adb (Has_Applicable_User_Defined_Literal): Given a
+	literal and a type, determine whether the type has a
+	user_defined aspect that can apply to the literal, and rewrite
+	the node as call to the corresponding function. Most of the code
+	was previously in procedure Resolve.
+	(Try_User_Defined_Literal): Check operands of a predefined
+	operator that fails to resolve, and apply
+	Has_Applicable_User_Defined_Literal to literal operands if any,
+	to find if a conversion will allow the operator to resolve
+	properly.
+	(Resolve): Call the above when a literal or an operator with a
+	literal operand fails to resolve.
+
+2021-10-25  Bob Duff  <duff@adacore.com>
+
+	* freeze.adb (Freeze_Fixed_Point_Type): Remove
+	previously-inserted test for Uint_0; no longer needed.
+	* gen_il-gen.ads: Improve comments.
+	* repinfo.adb (Rep_Value): Use Ubool type for B.
+	* repinfo.ads (Node_Ref): Use Unegative type.
+	(Node_Ref_Or_Val): Document that values of this type can be
+	No_Uint.
+	* exp_disp.adb (Make_Disp_Requeue_Body): Minor comment fix.
+	* sem_ch3.adb: Likewise.
+	* sem_ch8.adb: Likewise.
+	* sinfo-utils.adb (End_Location): End_Span can never be No_Uint,
+	so remove the "if No (L)" test.
+	* uintp.adb (Image_String): Use "for ... of" loop.
+	* uintp.ads (Unegative): New type for negative integers.  We
+	give it a long name (unlike Unat and Upos) because it is rarely
+	used.
+
+2021-10-25  Etienne Servais  <servais@adacore.com>
+
+	* errout.adb (Skip_Msg_Insertion_Warning): Adapt and format as
+	Erroutc.Prescan_Message.Parse_Message_Class.
+	(Warn_Insertion): Adapt to new format.
+	* errout.ads: Update documentation.
+	* erroutc.adb (Get_Warning_Tag): Adapt to new format.
+	(Prescan_Message): Introduce Parse_Message_Class function.
+	(Validate_Specific_Warnings): Update ?W? to ?.w?.
+	* erroutc.ads: Update type and documentation.
+	* checks.adb (Validity_Check_Range): Update ?X? to ?.x?.
+	* exp_ch11.adb (Possible_Local_Raise): Update ?X? to ?.x?.
+	(Warn_If_No_Local_Raise): Likewise.
+	(Warn_If_No_Propagation): Likewise.
+	(Warn_No_Exception_Propagation_Active): Likewise.
+	* exp_ch4.adb (Expand_N_Allocator): Attach warning message to
+	-gnatw_a.
+	* exp_prag.adb (Expand_Pragma_Check): Update ?A? to ?.a?.
+	* exp_util.adb (Activate_Atomic_Synchronization): Update ?N? to
+	?.n?.
+	(Add_Invariant_Check): Update ?L? to ?.l?.
+	* freeze.adb (Check_Suspicious_Modulus): Update ?M? to ?.m?.
+	(Freeze_Entity): Update ?T? to ?.t?, ?Z? to ?.z?.
+	* par-util.adb (Warn_If_Standard_Redefinition): Update ?K? to
+	?.k?.
+	* sem_attr.adb (Min_Max): Update ?U? to ?.u?.
+	* sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order): Update ?V?
+	to ?.v?.
+	(Adjust_Record_For_Reverse_Bit_Order_Ada_95): Update ?V? to ?.v?.
+	(Component_Size_Case): Update ?S? to ?.s?.
+	(Analyze_Record_Representation_Clause): Update ?S? to ?.s? and
+	?C? to ?.c?.
+	(Add_Call): Update ?L? to ?.l?.
+	(Component_Order_Check): Attach warning message to -gnatw_r.
+	(Check_Component_List): Update ?H? to ?.h?.
+	(Set_Biased): Update ?B? to ?.b?.
+	* sem_ch3.adb (Modular_Type_Declaration): Update ?M? to ?.m?.
+	* sem_ch4.adb (Analyze_Mod): Update ?M? to ?.m?.
+	(Analyze_Quantified_Expression): Update ?T? to ?.t?.
+	* sem_ch6.adb (Check_Conformance): Attach warning message to
+	-gnatw_p.
+	(List_Inherited_Pre_Post_Aspects): Update ?L? to ?.l?.
+	* sem_ch7.adb (Unit_Requires_Body_Info): Update ?Y? to ?.y?.
+	* sem_ch8.adb (Analyze_Object_Renaming): Update ?R? to ?.r?.
+	* sem_prag.adb (Validate_Compile_Time_Warning_Or_Error): Attach
+	warning message to -gnatw_c.
+	* sem_res.adb (Check_Argument_Order): Update ?P? to ?.p?.
+	(Resolve_Comparison_Op): Update ?U? to ?.u?.
+	(Resolve_Range): Update ?U? to ?.u?.
+	(Resolve_Short_Circuit): Update ?A? to ?.a?.
+	(Resolve_Unary_Op): Update ?M? to ?.m?.
+	* sem_util.adb (Check_Result_And_Post_State): Update ?T? to ?.t?.
+	* sem_warn.adb (Output_Unused_Warnings_Off_Warnings): Update ?W?
+	to ?.w?.
+	* warnsw.ads: Update documentation for -gnatw_c.
+
+2021-10-25  Bob Duff  <duff@adacore.com>
+
+	* inline.adb (Establish_Actual_Mapping_For_Inlined_Call): Fix
+	comment.
+
+2021-10-25  Bob Duff  <duff@adacore.com>
+
+	* gen_il-gen.adb (Put_Seinfo): Generate type
+	Seinfo.Type_Only_Enum based on type
+	Gen_IL.Internals.Type_Only_Enum. Automatically generating a copy
+	of the type will help keep them in sync.  (Note that there are
+	no Ada compiler packages imported into Gen_IL.)  Add a Type_Only
+	field to Field_Descriptor, so this information is available in
+	the Ada compiler (as opposed to just in the Gen_IL "compiler").
+	(One_Comp): Add initialization of the Type_Only field of
+	Field_Descriptor.
+	* gen_il-internals.ads (Image): Image function for
+	Type_Only_Enum.
+	* atree.ads (Node_To_Fetch_From): New function to compute which
+	node to fetch from, based on the Type_Only aspect.
+	* atree.adb (Get_Field_Value): Call Node_To_Fetch_From.
+	* treepr.adb (Print_Entity_Field): Call Node_To_Fetch_From.
+	(Print_Node_Field): Assert.
+	* sinfo-utils.adb (Walk_Sinfo_Fields,
+	Walk_Sinfo_Fields_Pairwise): Asserts.
+
+2021-10-25  Piotr Trojanek  <trojanek@adacore.com>
+
+	* exp_ch4.adb (Expand_Composite_Equality): Fix style.
+	(Element_To_Compare): Simplify loop.
+	(Expand_Record_Equality): Adapt calls to Element_To_Compare.
+
+2021-10-25  Steve Baird  <baird@adacore.com>
+
+	* sem_case.adb (Composite_Case_Ops.Box_Value_Required): A new
+	function which takes a component type and returns a Boolean.
+	Returns True for the cases which were formerly forbidden as
+	components (these checks were formerly performed in the
+	now-deleted procedure
+	Check_Composite_Case_Selector.Check_Component_Subtype).
+	(Composite_Case_Ops.Normalized_Case_Expr_Type): Hoist this
+	function out of the Array_Case_Ops package because it has been
+	generalized to also do the analogous thing in the case of a
+	discriminated type.
+	(Composite_Case_Ops.Scalar_Part_Count): Return 0 if
+	Box_Value_Required returns True for the given type/subtype.
+	(Composite_Case_Ops.Choice_Analysis.Choice_Analysis.Component_Bounds_Info.
+	Traverse_Discrete_Parts): Return without doing anything if
+	Box_Value_Required returns True for the given type/subtype.
+	(Composite_Case_Ops.Choice_Analysis.Parse_Choice.Traverse_Choice):
+	If Box_Value_Required yields True for a given component type,
+	then check that the value of that component in a choice
+	expression is indeed a box (in which case the component is
+	ignored).
+	* doc/gnat_rm/implementation_defined_pragmas.rst: Update
+	documentation.
+	* gnat_rm.texi: Regenerate.
+
+2021-10-25  Piotr Trojanek  <trojanek@adacore.com>
+
+	* libgnat/a-nbnbin__gmp.adb (From_String): Fix predicate
+	mismatch between subprogram declaration and body.
+
+2021-10-25  Bob Duff  <duff@adacore.com>
+
+	* einfo-utils.adb (Declaration_Node): Avoid returning the
+	following node kinds: N_Assignment_Statement, N_Integer_Literal,
+	N_Procedure_Call_Statement, N_Subtype_Indication, and
+	N_Type_Conversion.  Assert that the result is in N_Is_Decl or
+	empty.
+	* gen_il-gen-gen_nodes.adb (N_Is_Decl): Modify to match the
+	things that Declaration_Node can return.
+
+2021-10-25  Piotr Trojanek  <trojanek@adacore.com>
+
+	* libgnat/a-strsup.ads (Super_Length, Super_Element,
+	Super_Slice): Add Global contracts.
+
+2021-10-25  Piotr Trojanek  <trojanek@adacore.com>
+
+	* exp_ch3.adb (Predefined_Primitive_Bodies): Simplify detection
+	of existing equality operator.
+
+2021-10-25  Piotr Trojanek  <trojanek@adacore.com>
+
+	* exp_ch3.adb (Predefined_Primitive_Bodies): Remove redundant
+	conditions related to interface types.
+
+2021-10-25  Piotr Trojanek  <trojanek@adacore.com>
+
+	* adaint.c (__gnat_portable_spawn): Do not expect execv to
+	return 0.
+	(__gnat_portable_no_block_spawn): Likewise.
+
+2021-10-25  Ghjuvan Lacambre  <lacambre@adacore.com>
+
+	* sem_ch8.adb (Analyze_Subprogram_Renaming): Set New_S to Empty.
+
+2021-10-25  Piotr Trojanek  <trojanek@adacore.com>
+
+	* libgnat/a-strunb.ads (Unbounded_String): Reference is never
+	null.
+	* libgnat/a-strunb.adb (Finalize): Copy reference while it needs
+	to be deallocated.
+
+2021-10-25  Piotr Trojanek  <trojanek@adacore.com>
+
+	* lib-xref.adb (Get_Through_Renamings): Exit loop when an
+	enumeration literal is found.
+
+2021-10-25  Arnaud Charlet  <charlet@adacore.com>
+
+	* libgnat/s-widthu.adb: Add pragma Annotate.
+
+2021-10-25  Javier Miranda  <miranda@adacore.com>
+
+	* sem_ch8.adb (Build_Class_Wide_Wrapper): Previous version split
+	in two subprograms to factorize its functionality:
+	Find_Suitable_Candidate, and Build_Class_Wide_Wrapper. These
+	routines are also placed in the new subprogram
+	Handle_Instance_With_Class_Wide_Type.
+	(Handle_Instance_With_Class_Wide_Type): New subprogram that
+	encapsulates all the code that handles instantiations with
+	class-wide types.
+	(Analyze_Subprogram_Renaming): Adjust code to invoke the new
+	nested subprogram Handle_Instance_With_Class_Wide_Type; adjust
+	documentation.
+
+2021-10-25  Bob Duff  <duff@adacore.com>
+
+	* einfo-utils.ads, einfo-utils.adb (Alias, Set_Alias,
+	Renamed_Entity, Set_Renamed_Entity, Renamed_Object,
+	Set_Renamed_Object): Add assertions that reflect how these are
+	supposed to be used and what they are supposed to return.
+	(Renamed_Entity_Or_Object): New getter.
+	(Set_Renamed_Object_Of_Possibly_Void): Setter that allows N to
+	be E_Void.
+	* checks.adb (Ensure_Valid): Use Renamed_Entity_Or_Object
+	because this is called for both cases.
+	* exp_dbug.adb (Debug_Renaming_Declaration): Use
+	Renamed_Entity_Or_Object because this is called for both cases.
+	Add assertions.
+	* exp_util.adb (Possible_Bit_Aligned_Component): Likewise.
+	* freeze.adb (Freeze_All_Ent): Likewise.
+	* sem_ch5.adb (Within_Function): Likewise.
+	* exp_attr.adb (Calculate_Header_Size): Call Renamed_Entity
+	instead of Renamed_Object.
+	* exp_ch11.adb (Expand_N_Raise_Statement): Likewise.
+	* repinfo.adb (Find_Declaration): Likewise.
+	* sem_ch10.adb (Same_Unit, Process_Spec_Clauses,
+	Analyze_With_Clause, Install_Parents): Likewise.
+	* sem_ch12.adb (Build_Local_Package, Needs_Body_Instantiated,
+	Build_Subprogram_Renaming, Check_Formal_Package_Instance,
+	Check_Generic_Actuals, In_Enclosing_Instance,
+	Denotes_Formal_Package, Process_Nested_Formal,
+	Check_Initialized_Types, Map_Formal_Package_Entities,
+	Restore_Nested_Formal): Likewise.
+	* sem_ch6.adb (Report_Conflict): Likewise.
+	* sem_ch8.adb (Analyze_Exception_Renaming,
+	Analyze_Generic_Renaming, Analyze_Package_Renaming,
+	Is_Primitive_Operator_In_Use, Declared_In_Actual,
+	Note_Redundant_Use): Likewise.
+	* sem_warn.adb (Find_Package_Renaming): Likewise.
+	* sem_elab.adb (Ultimate_Variable): Call Renamed_Object instead
+	of Renamed_Entity.
+	* exp_ch6.adb (Get_Function_Id): Call
+	Set_Renamed_Object_Of_Possibly_Void, because the defining
+	identifer is still E_Void at this point.
+	* sem_util.adb (Function_Call_Or_Allocator_Level): Likewise.
+	Remove redundant (unreachable) code.
+	(Is_Object_Renaming, Is_Valid_Renaming): Call Renamed_Object
+	instead of Renamed_Entity.
+	(Get_Fullest_View): Call Renamed_Entity instead of
+	Renamed_Object.
+	(Copy_Node_With_Replacement): Call
+	Set_Renamed_Object_Of_Possibly_Void because the defining entity
+	is sometimes E_Void.
+	* exp_ch5.adb (Expand_N_Assignment_Statement): Protect a call to
+	Renamed_Object with Is_Object to avoid assertion failure.
+	* einfo.ads: Minor comment fixes.
+	* inline.adb: Minor comment fixes.
+	* tbuild.ads: Minor comment fixes.
+
+2021-10-25  Arnaud Charlet  <charlet@adacore.com>
+
+	* sem_ch13.adb (Build_Discrete_Static_Predicate): Remove use of
+	exception propagation since this code is exercised during the
+	bootstrap.
+
+2021-10-25  Yannick Moy  <moy@adacore.com>
+
+	* sem_ch13.adb (Freeze_Entity_Checks): Perform same check on
+	predicate expression inside pragma as inside aspect.
+	* sem_util.adb (Is_Current_Instance): Recognize possible
+	occurrence of subtype as current instance inside the pragma
+	Predicate.
+
+2021-10-25  Ghjuvan Lacambre  <lacambre@adacore.com>
+
+	* erroutc.adb (Count_Compile_Time_Pragma_Warnings): Don't count
+	deleted warnings.
+
+2021-10-22  Eric Gallager  <egallager@gcc.gnu.org>
+
+	PR other/102663
+	* gcc-interface/Make-lang.in: Allow dvi-formatted
+	documentation to be installed.
+
+2021-10-20  Bob Duff  <duff@adacore.com>
+
+	* gcc-interface/decl.c (gnat_to_gnu_entity): Remove unnecessary
+	call to No_Uint_To_0.
+
+2021-10-20  Richard Kenner  <kenner@adacore.com>
+
+	* exp_unst.adb (Visit_Node, when N_Subprogram_Call): Never treat
+	instrinsic subprograms as nested.
+
+2021-10-20  Yannick Moy  <moy@adacore.com>
+
+	* libgnat/s-widlllu.ads: Mark in SPARK.
+	* libgnat/s-widllu.ads: Likewise.
+	* libgnat/s-widuns.ads: Likewise.
+	* libgnat/s-widthu.adb: Add ghost code and a
+	pseudo-postcondition.
+
+2021-10-20  Yannick Moy  <moy@adacore.com>
+
+	* libgnat/a-nbnbin__ghost.adb (Signed_Conversions,
+	Unsigned_Conversions): Mark subprograms as not imported.
+	* libgnat/a-nbnbin__ghost.ads: Provide a dummy body.
+
+2021-10-20  Eric Botcazou  <ebotcazou@adacore.com>
+
+	* sem_eval.adb (Eval_Type_Conversion): If the target subtype is
+	a static floating-point subtype and the result is a real literal,
+	consider its machine-rounded value to raise Constraint_Error.
+	(Test_In_Range): Turn local variables into constants.
+
+2021-10-20  Doug Rupp  <rupp@adacore.com>
+
+	* libgnat/g-io-put__vxworks.adb: Remove (unused)
+	* libgnat/s-parame__ae653.ads: Likewise.
+	* libgnat/s-thread.ads: Likewise.
+	* libgnat/s-thread__ae653.adb: Likewise.
+
+2021-10-20  Eric Botcazou  <ebotcazou@adacore.com>
+
+	* sem_eval.ads (Machine_Number): New inline function.
+	* sem_eval.adb (Machine_Number): New function body implementing
+	the machine rounding operation specified by RM 4.9(38/2).
+	(Check_Non_Static_Context): Call Machine_Number and set the
+	Is_Machine_Number flag consistently on the resulting node.
+	* sem_attr.adb (Eval_Attribute) <Attribute_Machine>: Likewise.
+	* checks.adb (Apply_Float_Conversion_Check): Call Machine_Number.
+	(Round_Machine): Likewise.
+
+2021-10-20  Johannes Kliemann  <kliemann@adacore.com>
+
+	* vxworks7-cert-rtp-link.spec: Add the definition of
+	__wrs_rtp_base.
+
+2021-10-20  Piotr Trojanek  <trojanek@adacore.com>
+
+	* sem_aggr.adb (Resolve_Delta_Record_Aggregate): Reject boxes in
+	record delta aggregates.
+
+2021-10-20  Justin Squirek  <squirek@adacore.com>
+
+	* sem_ch6.adb (Check_Return_Construct_Accessibility): Modify
+	generation of accessibility checks to be more consolidated and
+	get triggered properly in required cases.
+	* sem_util.adb (Accessibility_Level): Add extra check within
+	condition to handle aliased formals properly in more cases.
+
+2021-10-20  Justin Squirek  <squirek@adacore.com>
+
+	* exp_ch7.adb (Make_Final_Call): Detect expanded protected types
+	and use original protected type in order to calculate
+	appropriate finalization routine.
+
+2021-10-20  Johannes Kliemann  <kliemann@adacore.com>
+
+	* libgnat/a-nbnbin__ghost.ads: Add ghost package.
+
+2021-10-20  Piotr Trojanek  <trojanek@adacore.com>
+
+	* sem_aggr.adb (Variant_Depth): Refine type from Integer to
+	Natural.
+
+2021-10-20  Bob Duff  <duff@adacore.com>
+
+	* atree.ads: Comment improvements. How is a "completely new
+	node" different from a "new node"? Document default values
+	corresponding to field types.
+	* exp_ch7.adb (Process_Tagged_Type_Declaration): Use
+	higher-level Scope_Depth instead of Scope_Depth_Value.  Remove
+	confusing comment: not clear what a "true" library level package
+	is.
+	* uintp.adb (Image_Out): Print No_Uint in a more readable way.
+	* gen_il-gen.adb, gen_il-gen-gen_entities.adb,
+	gen_il-gen-gen_nodes.adb, gen_il-types.ads: Tighten up the
+	subtypes of fields whose type is Uint, where possible; use
+	more-constrained subtypes such as Unat.
+	* einfo-utils.adb, einfo-utils.ads, exp_attr.adb,
+	exp_ch3.adb, exp_intr.adb, exp_unst.adb, exp_util.adb,
+	freeze.adb, repinfo.adb, sem.adb, sem_ch12.adb, sem_ch13.adb,
+	sem_ch3.adb, sem_ch8.adb, sem_util.adb, sprint.adb, treepr.adb:
+	No longer use Uint_0 to indicate "unknown" or "not yet known"
+	for various fields whose type is Uint. Use No_Uint for that,
+	except in a small number of legacy cases that cause test
+	failures. Protect many queries of such fields with calls to
+	Known_... functions. Improve comments.
+	* exp_aggr.adb: Likewise.
+	(Is_OK_Aggregate): Check whether Csiz is present.
+	(Aggr_Assignment_OK_For_Backend): Ensure we do not access an
+	uninitialized size.
+	* exp_strm.adb (Build_Elementary_Input_Call,
+	Build_Elementary_Write_Call): Check whether P_Size is present.
+	* cstand.adb: Leave Component_Size of Any_Composite unknown.
+	Similar for RM_Size of Standard_Exception_Type.  These should
+	not be used.
+	* einfo.ads: Comment improvements.
+	* exp_disp.ads: Minor.
+	* gen_il-internals.ads, gen_il-internals.adb: Minor.
+	* sinfo-utils.adb: Take advantage of full-coverage rules.
+	* types.h: Minor.
+
+2021-10-20  Gary Dismukes  <dismukes@adacore.com>
+
+	* sem_ch6.adb: Add with and use of Warnsw.
+	(Check_Conformance): Report a warning when subtypes or
+	designated subtypes of formal parameters or result subtypes
+	denote different declarations between the spec and body of the
+	(Subprogram_Subtypes_Have_Same_Declaration): New function nested
+	within Check_Conformance that determines whether two subtype
+	entities referenced in a subprogram come from the same
+	declaration. Returns True immediately if the subprogram is in a
+	generic instantiation, or the subprogram is marked Is_Internal
+	or is declared in an internal (GNAT library) unit, or GNAT_Mode
+	is enabled, otherwise compares the nonlimited views of the
+	entities (or their designated subtypes' nonlimited views in the
+	anonymous access cases).
+	(Nonlimited_View_Of_Subtype): New function nested within
+	function Subprogram_Subtypes_Have_Same_Declaration that returns
+	Non_Limited_View of a type or subtype that is an incomplete or
+	class-wide type that comes from a limited of a
+	package (From_Limited_With is True for the entity), or returns
+	Full_View when the nonlimited view is an incomplete type.
+	Otherwise returns the entity passed in.
+	* warnsw.ads (Warn_On_Pedantic_Checks): New warning flag.
+	(type Warning_Record): New component Warn_On_Pedantic_Checks.
+	* warnsw.adb (All_Warnings): Set Warn_On_Pedantic_Checks from
+	parameter Setting.
+	(Restore_Warnings): Restore the value of the
+	Warn_On_Pedantic_Checks flag.
+	(Save_Warnings): Save the value of the Warn_On_Pedantic_Checks
+	flag.
+	(Set_Underscore_Warning_Switch): Add settings of the
+	Warn_On_Pedantic flag according to the switch ("-gnatw_p" vs.
+	"-gnatw_P").
+	* doc/gnat_ugn/building_executable_programs_with_gnat.rst: Add
+	documentation of new switches -gnatw_p and -gnatw_P (warnings
+	for pedantic checks).
+	* gnat_ugn.texi: Regenerate.
+	* usage.adb: Add Warn_On_Pedantic_Checks.
+
+2021-10-20  Piotr Trojanek  <trojanek@adacore.com>
+
+	* exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Guard
+	against equality of an uninitialized RM_Size field.
+
+2021-10-20  Eric Botcazou  <ebotcazou@adacore.com>
+
+	* sem_ch12.adb (Analyze_Subprogram_Instantiation): Also propagate an
+	interface name on an intrinsic subprogram.  Remove obsolete comment.
+	* libgnat/s-atopri.ads (Atomic_Load): New generic intrinsic function
+	(Atomic_Load_8): Rewrite into instantiation.
+	(Atomic_Load_16): Likewise.
+	(Atomic_Load_32): Likewise.
+	(Atomic_Load_64): Likewise.
+	(Sync_Compare_And_Swap): New generic intrinsic function.
+	(Sync_Compare_And_Swap_8): Rewrite into instantiation.
+	(Sync_Compare_And_Swap_16): Likewise.
+	(Sync_Compare_And_Swap_32): Likewise.
+	(Sync_Compare_And_Swap_64): Likewise.
+	(Lock_Free_Read): New generic inline function.
+	(Lock_Free_Read_8): Rewrite into instantiation.
+	(Lock_Free_Read_16): Likewise.
+	(Lock_Free_Read_32): Likewise.
+	(Lock_Free_Read_64): Likewise.
+	(Lock_Free_Try_Write): New generic inline function.
+	(Lock_Free_Try_Write_8): Rewrite into instantiation.
+	(Lock_Free_Try_Write_16): Likewise.
+	(Lock_Free_Try_Write_32): Likewise.
+	(Lock_Free_Try_Write_64): Likewise.
+	* libgnat/s-atopri.adb (Lock_Free_Read): New function body.
+	(Lock_Free_Read_8): Delete.
+	(Lock_Free_Read_16): Likewise.
+	(Lock_Free_Read_32): Likewise.
+	(Lock_Free_Read_64): Likewise.
+	(Lock_Free_Try_Write): New function body.
+	(Lock_Free_Try_Write_8): Delete.
+	(Lock_Free_Try_Write_16): Likewise.
+	(Lock_Free_Try_Write_32): Likewise.
+	(Lock_Free_Try_Write_64): Likewise.
+	* libgnat/s-aoinar.adb (Atomic_Fetch_And_Add): Use type-generic GCC
+	atomic builtin and tidy up implementation.
+	(Atomic_Fetch_And_Subtract): Likewise.
+	* libgnat/s-aomoar.adb (Atomic_Fetch_And_Add): Likewise.
+	(Atomic_Fetch_And_Subtract): Likewise.
+	* libgnat/s-atopex.adb (Atomic_Exchange): Likewise.
+	(Atomic_Compare_And_Exchange): Likewise.
+
+2021-10-20  Eric Botcazou  <ebotcazou@adacore.com>
+
+	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Subprogram_Type>:
+	Replace test on Convention_Intrinsic with Is_Intrinsic_Subprogram.
+	(gnat_to_gnu_param): Likewise.
+	(gnat_to_gnu_subprog_type): Likewise.
+	* gcc-interface/trans.c (elaborate_all_entities_for_package): Ditto.
+
+2021-10-20  Eric Botcazou  <ebotcazou@adacore.com>
+
+	* sem_eval.ads (Check_Non_Static_Context): Update documentation.
+	* sem_eval.adb (In_Any_Integer_Context): Change parameter type,
+	adjust accordingly and remove unreachable case.
+	(Eval_Integer_Literal): Consider the node kind throughout and
+	trim down verbose condition.
+
+2021-10-20  Doug Rupp  <rupp@adacore.com>
+
+	* Makefile.rtl: Remove references to system-vxworks-ppc.ads
+	and system-vxworks-x86.ads.
+	* libgnat/system-vxworks-ppc.ads: Remove.
+	* libgnat/system-vxworks-ppc-ravenscar.ads: Likewise.
+	* libgnat/system-vxworks-x86.ads: Likewise.
+
+2021-10-20  Yannick Moy  <moy@adacore.com>
+
+	* sem_ch4.adb (Analyze_QUantified_Expression): Issue warning on
+	conjunct/disjunct sub-expression of the full expression inside a
+	quantified expression, when it does not reference the quantified
+	variable.
+
+2021-10-20  Marc Poulhiès  <poulhies@adacore.com>
+
+	* checks.adb (Insert_Valid_Check): in case of checked type
+	conversion, update Typ to match Exp's type and add call to
+	Analyze_And_Resolve.
+
+2021-10-20  Arnaud Charlet  <charlet@adacore.com>
+
+	PR ada/100486
+	* sem_prag.adb (Check_Valid_Library_Unit_Pragma): Do not raise an
+	exception as part of the bootstrap.
+
+2021-10-15  Richard Biener  <rguenther@suse.de>
+
+	* gcc-interface/misc.c (gnat_post_options): Do not warn
+	about DBX_DEBUG use here.
+
+2021-10-14  Alexandre Oliva  <oliva@adacore.com>
+
+	* par-ch10.adb (P_Compilation_Unit): Reenable ada83 library
+	unit renaming test and error.
+
+2021-10-11  Eric Botcazou  <ebotcazou@adacore.com>
+
+	* gcc-interface/gigi.h (resolve_atomic_size): Declare.
+	(list_third): New inline function.
+	* gcc-interface/decl.c (type_for_atomic_builtin_p): New function.
+	(resolve_atomic_builtin): Likewise.
+	(gnat_to_gnu_subprog_type): Perform type resolution for most of
+	type-generic GCC atomic builtins and give an error for the rest.
+	* gcc-interface/utils2.c (resolve_atomic_size): Make public.
+
+2021-10-11  Eric Botcazou  <ebotcazou@adacore.com>
+
+	* gcc-interface/trans.c (gnat_to_gnu) <N_Pop_Constraint_Error_Label>:
+	Given the warning only if No_Exception_Propagation is active.
+	<N_Pop_Storage_Error_Label>: Likewise.
+	<N_Pop_Program_Error_Label>: Likewise.
+
+2021-10-11  Eric Botcazou  <ebotcazou@adacore.com>
+
+	* gcc-interface/decl.c (promote_object_alignment): Add GNU_SIZE
+	parameter and use it for the size of the object if not null.
+	(gnat_to_gnu_entity) <E_Variable>: Perform the automatic alignment
+	promotion for objects whose nominal subtype is of variable size.
+	(gnat_to_gnu_field): Adjust call to promote_object_alignment.
+
+2021-10-11  Eric Botcazou  <ebotcazou@adacore.com>
+
+	* gcc-interface/decl.c (gnat_to_gnu_param): Strip padding types
+	only if the size does not change in the process.  Rename local
+	variable and add bypass for initialization procedures.
+
+2021-10-11  Doug Rupp  <rupp@adacore.com>
+
+	* libgnat/s-thread.ads: Fix comments.  Remove unused package
+	imports.
+	(Thread_Body_Exception_Exit): Remove Exception_Occurrence
+	parameter.
+	(ATSD): Declare type locally.
+	* libgnat/s-thread__ae653.adb: Fix comments.  Remove unused
+	package imports.  Remove package references to Stack_Limit
+	checking.
+	(Install_Handler): Remove.
+	(Set_Sec_Stack): Likewise.
+	(Thread_Body_Enter): Remove calls to Install_Handler and
+	Stack_Limit checking.
+	(Thread_Body_Exception_Exit): Remove Exception_Occurrence
+	parameter.
+	(Init_RTS): Call local Get_Sec_Stack.  Remove call to
+	Install_Handler.  Remove references to accessors for
+	Get_Sec_Stack and Set_Sec_Stack.  Remove OS check.
+	(Set_Sec_Stack): Remove.
+
+2021-10-11  Piotr Trojanek  <trojanek@adacore.com>
+
+	* exp_ch3.adb (Make_Predefined_Primitive_Specs,
+	Predefined_Primitive_Bodies): Remove guard with restriction
+	No_Dispatching_Calls.
+
+2021-10-11  Steve Baird  <baird@adacore.com>
+
+	* sem_attr.adb (Analyze_Attribute_Old_Result): Permit an
+	attribute reference inside a compiler-generated _Postconditions
+	procedure. In this case, Subp_Decl is assigned the declaration
+	of the enclosing subprogram.
+	* exp_util.adb (Insert_Actions): When climbing up the tree
+	looking for an insertion point, do not climb past an
+	N_Iterated_Component/Element_Association, since this could
+	result in inserting a reference to a loop parameter at a
+	location outside of the scope of that loop parameter. On the
+	other hand, be careful to preserve existing behavior in the case
+	of an N_Component_Association node.
+
+2021-10-11  Steve Baird  <baird@adacore.com>
+
+	* exp_ch6.adb (Can_Fold_Predicate_Call): Do not attempt folding
+	if there is more than one predicate involved. Recall that
+	predicate aspect specification are additive, not overriding, and
+	that there are three different predicate
+	aspects (Dynamic_Predicate, Static_Predicate, and the
+	GNAT-defined Predicate aspect). These various ways of
+	introducing multiple predicates are all checked for.  A new
+	nested function, Augments_Other_Dynamic_Predicate, is
+	introduced.
+	* sem_ch4.adb
+	(Analyze_Indexed_Component_Form.Process_Function_Call): When
+	determining whether a name like "X (Some_Discrete_Type)" might
+	be interpreted as a slice, the answer should be "no" if the
+	type/subtype name denotes the current instance of type/subtype.
+
+2021-10-11  Patrick Bernardi  <bernardi@adacore.com>
+
+	* libgnarl/s-osinte__rtems.ads: Change sigset_t to an unsigned
+	long.
+
+2021-10-11  Patrick Bernardi  <bernardi@adacore.com>
+
+	* libgnat/s-parame__rtems.adb: use
+	_POSIX_Threads_Minimum_stack_size instead of
+	ada_pthread_minimum_stack_size.
+
+2021-10-11  Eric Botcazou  <ebotcazou@adacore.com>
+
+	* fe.h (No_Exception_Propagation_Active): Declare.
+	* restrict.ads (No_Exception_Propagation_Active): Add WARNING line.
+
+2021-10-11  Piotr Trojanek  <trojanek@adacore.com>
+
+	* sem_ch13.adb (Validate_Unchecked_Conversion): Simplify code
+	for detecting conversions with Ada.Calendar.Time type and extend
+	it to similar types in the Ada.Real_Time package.
+
+2021-10-11  Piotr Trojanek  <trojanek@adacore.com>
+
+	* sem_ch10.adb, sem_prag.adb, sem_util.adb: Use
+	N_Generic_Declaration in membership tests.
+
+2021-10-11  Etienne Servais  <servais@adacore.com>
+
+	* ali.adb (Get_Name): Ignore_Spaces is always False.
+	* bindo-graphs.adb (Set_Is_Existing_Source_Target_Relation): Val
+	is always True.
+	* cstand.adb (New_Standard_Entity): New_Node_Kind is always
+	N_Defininig_Identifier.
+	* exp_ch3.adb (Predef_Stream_Attr_Spec): For_Body is always
+	False.
+	* exp_dist.adb (Add_Parameter_To_NVList): RACW_Ctrl is always
+	False.
+	* gnatls.adb (Add_Directories): Prepend is always False.
+	* sem_ch10.adb, sem_ch10.ads (Load_Needed_Body): Do_Analyze is
+	always True.
+	* sem_ch3.adb, sem_ch3.ads (Process_Range_Expr_In_Decl):
+	R_Check_Off is always False.
+	* sem_elab.adb: (Info_Variable_Reference): Info_Msg is always
+	False, In_SPARK is always True.
+	(Set_Is_Traversed_Body, Set_Is_Saved_Construct,
+	Set_Is_Saved_Relation): Val is always True.
+	* treepr.adb (Visit_Descendant): No_Indent is always False.
+	(Print_Node): Fmt does not need such a big scope.
+
+2021-10-11  Etienne Servais  <servais@adacore.com>
+
+	* sem_ch4.adb (Analyze_Membership_Op): Finds interpretation for
+	the case of a membership test with a singleton value in case of
+	overloading.
+
+2021-10-11  Patrick Bernardi  <bernardi@adacore.com>
+
+	* Makefile.rtl (VxWorks): Rename s-inmaop__vxworks.adb to
+	s-inmaop__hwint.adb.
+	(RTEMS): Use s-inmaop__hwint.adb, s-intman__rtems.adb/s,
+	s-taprop__rtems.adb.
+	* libgnarl/a-intnam__rtems.ads: Remove signals definitions and
+	replace with Hardware_Interrupts.
+	* libgnarl/s-inmaop__vxworks.adb: Rename as...
+	* libgnarl/s-inmaop__hwint.adb: ... this.
+	* libgnarl/s-interr__hwint.adb: Remove unnecessary comments.
+	* libgnarl/s-intman__rtems.ads, libgnarl/s-intman__rtems.adb:
+	New files.
+	* libgnarl/s-osinte__rtems.adb: Add RTEMS API bindings.
+	(Binary_Semaphore_Create, Binary_Semaphore_Delete,
+	Binary_Semaphore_Obtain, Binary_Semaphore_Release,
+	Binary_Semaphore_Flush, Interrupt_Connect,
+	Interrupt_Number_To_Vector): New functions.
+	* libgnarl/s-osinte__rtems.ads (Num_HW_Interrupts, Signal):
+	Removed.
+	(NSIG, Interrupt_Range): New.
+	(Binary_Semaphore_Create, Binary_Semaphore_Delete,
+	Binary_Semaphore_Obtain, Binary_Semaphore_Release,
+	Binary_Semaphore_Flush, Interrupt_Connect,
+	Interrupt_Number_To_Vector): Remove Import pragma.
+	* libgnarl/s-taprop__rtems.adb: New file.
+
+2021-10-11  Eric Botcazou  <ebotcazou@adacore.com>
+
+	* exp_fixd.adb (Get_Size_For_Value): New function returning a size
+	suitable for a non-negative integer value.
+	(Get_Type_For_Size): New function returning a standard type suitable
+	for a size.
+	(Build_Divide): Call both functions to compute the result type, but
+	make sure to pass a non-negative value to the first.
+	(Build_Multiply): Likewise.
+	(Do_Multiply_Fixed_Universal): Minor consistency tweak.
+	(Integer_Literal): Call both functions to compute the type.
+
+2021-10-11  Etienne Servais  <servais@adacore.com>
+
+	* sem_ch4.adb (Analyze_Membership_Op): Reorder subprogram spec
+	and bodies in alphabetical order.
+
+2021-10-11  Piotr Trojanek  <trojanek@adacore.com>
+
+	* exp_util.adb (Build_Class_Wide_Expression): Replace entities
+	of both simple and extended names.
+
+2021-10-11  Ghjuvan Lacambre  <lacambre@adacore.com>
+
+	* libgnarl/s-intman__android.adb, libgnarl/s-intman__lynxos.adb,
+	libgnarl/s-intman__posix.adb, libgnarl/s-intman__qnx.adb,
+	libgnarl/s-intman__solaris.adb, libgnarl/s-intman__susv3.adb,
+	libgnarl/s-taprob.adb, libgnarl/s-taprop__hpux-dce.adb,
+	libgnarl/s-taprop__linux.adb, libgnarl/s-taprop__mingw.adb,
+	libgnarl/s-taprop__posix.adb, libgnarl/s-taprop__qnx.adb,
+	libgnarl/s-taprop__solaris.adb, libgnarl/s-taprop__vxworks.adb,
+	libgnarl/s-taskin.adb, libgnarl/s-tasque.adb,
+	libgnarl/s-tpoben.adb, libgnat/a-calend.adb,
+	libgnat/a-excach.adb, libgnat/a-except.adb, libgnat/a-tags.adb,
+	libgnat/a-textio.adb, libgnat/a-witeio.adb,
+	libgnat/a-ztexio.adb, libgnat/g-binenv.adb,
+	libgnat/s-parame.adb, libgnat/s-parame__vxworks.adb,
+	libgnat/s-stratt.adb, libgnat/s-trasym__dwarf.adb: Mark imported
+	binder globals as constant.
+
+2021-10-11  Piotr Trojanek  <trojanek@adacore.com>
+
+	* exp_aggr.adb (Initialize_Record_Component): Add assertion
+	about one of the parameters, so that illegal attempts to
+	initialize record components with Empty node are detected early
+	on.
+	(Build_Record_Aggr_Code): Handle boxes in aggregate component
+	associations just the components with no initialization in
+	Build_Record_Init_Proc.
+	* sem_aggr.adb (Resolve_Record_Aggregate): For components that
+	require simple initialization carry boxes from resolution to
+	expansion.
+	* sem_util.adb (Needs_Simple_Initialization): Remove redundant
+	paren.
+
+2021-10-11  Piotr Trojanek  <trojanek@adacore.com>
+
+	* exp_ch3.adb (Build_Init_Statements): Simplify detection of
+	concurrent record types.
+
+2021-10-11  Piotr Trojanek  <trojanek@adacore.com>
+
+	* exp_aggr.adb (Is_Delayed_Aggregate): Simplify.
+
+2021-10-11  Piotr Trojanek  <trojanek@adacore.com>
+
+	* exp_aggr.adb (Has_Default_Init_Comps): Simplify.
+
+2021-10-11  Piotr Trojanek  <trojanek@adacore.com>
+
+	* exp_aggr.adb (Component_OK_For_Backend): Remove redundant
+	guard.
+
+2021-10-11  Patrick Bernardi  <bernardi@adacore.com>
+
+	* Makefile.rtl (RTEMS): Add s-stchop.o to
+	EXTRA_GNATRTL_NONTASKING_OBJS, remove s-stchop__rtems.adb.
+	* libgnat/s-stchop__rtems.adb: Removed.
+
+2021-10-11  Marc Poulhiès  <poulhies@adacore.com>
+
+	* expander.adb (Expand): Skip clearing of Analyzed flag if
+	already set for N_Real_Literal.
+
+2021-10-11  Piotr Trojanek  <trojanek@adacore.com>
+
+	* sem_util.adb (Compile_Time_Constraint_Error): Simplify getting
+	the type of the first formal parameter.
+
+2021-10-11  Piotr Trojanek  <trojanek@adacore.com>
+
+	* exp_util.adb (Inside_Init_Proc): Simplify.
+	* sem_aggr.adb (Resolve_Record_Aggregate): Fix style.
+	* sem_util.adb (Compile_Time_Constraint_Error): Guard against
+	calling Corresponding_Concurrent_Type with an array type entity.
+
+2021-10-11  Doug Rupp  <rupp@adacore.com>
+
+	* libgnat/s-parame__ae653.ads (time_t_bits): Change to
+	Long_Long_Integer'Size.  Add some comments to explain.
+
+2021-10-08  Martin Liska  <mliska@suse.cz>
+
+	* gcc-interface/misc.c (gnat_post_options): Use new macro
+	OPTION_SET_P.
+	(gnat_init_gcc_eh): Likewise.
+	(gnat_init_gcc_fp): Likewise.
+
 2021-10-05  Eric Botcazou  <ebotcazou@adacore.com>
 
 	* gcc-interface/trans.c (gnat_to_gnu): Do not wrap boolean values
diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl
index db21f01..ebfbe95 100644
--- a/gcc/ada/Makefile.rtl
+++ b/gcc/ada/Makefile.rtl
@@ -1084,7 +1084,7 @@
   a-nuaufl.ads<libgnat/a-nuaufl__wraplf.ads \
   a-nashfl.ads<libgnat/a-nashfl__wraplf.ads \
   s-dorepr.adb<libgnat/s-dorepr__fma.adb \
-  s-inmaop.adb<libgnarl/s-inmaop__vxworks.adb \
+  s-inmaop.adb<libgnarl/s-inmaop__hwint.adb \
   s-intman.ads<libgnarl/s-intman__vxworks.ads \
   s-intman.adb<libgnarl/s-intman__vxworks.adb \
   s-osinte.ads<libgnarl/s-osinte__vxworks.ads \
@@ -1166,9 +1166,6 @@
           s-vxwext.ads<libgnarl/s-vxwext__kernel.ads \
           s-vxwext.adb<libgnarl/s-vxwext__kernel.adb \
           system.ads<libgnat/$(SVX)-$(ARCH_STR)-kernel.ads
-        else
-          LIBGNAT_TARGET_PAIRS += \
-          system.ads<libgnat/system-vxworks-ppc.ads
         endif
       endif
       EXTRA_GNATRTL_NONTASKING_OBJS+=i-vxinco.o i-vxwork.o i-vxwoio.o
@@ -1207,7 +1204,7 @@
   a-nashfl.ads<libgnat/a-nashfl__wraplf.ads \
   s-osinte.adb<libgnarl/s-osinte__vxworks.adb \
   s-osinte.ads<libgnarl/s-osinte__vxworks.ads \
-  s-inmaop.adb<libgnarl/s-inmaop__vxworks.adb \
+  s-inmaop.adb<libgnarl/s-inmaop__hwint.adb \
   s-intman.ads<libgnarl/s-intman__vxworks.ads \
   s-intman.adb<libgnarl/s-intman__vxworks.adb \
   s-osprim.adb<libgnat/s-osprim__posix.adb \
@@ -1315,9 +1312,6 @@
           s-vxwext.ads<libgnarl/s-vxwext__kernel.ads \
           s-vxwext.adb<libgnarl/s-vxwext__kernel.adb \
           system.ads<libgnat/$(SVX)-x86-kernel.ads
-        else
-          LIBGNAT_TARGET_PAIRS += \
-          system.ads<libgnat/system-vxworks-x86.ads
         endif
       endif
 
@@ -1351,7 +1345,7 @@
   a-naliop.ads<libgnat/a-naliop__nolibm.ads \
   a-nuaufl.ads<libgnat/a-nuaufl__wraplf.ads \
   a-nashfl.ads<libgnat/a-nashfl__wraplf.ads \
-  s-inmaop.adb<libgnarl/s-inmaop__vxworks.adb \
+  s-inmaop.adb<libgnarl/s-inmaop__hwint.adb \
   s-interr.adb<libgnarl/s-interr__vxworks.adb \
   s-intman.ads<libgnarl/s-intman__vxworks.ads \
   s-intman.adb<libgnarl/s-intman__vxworks.adb \
@@ -2047,19 +2041,21 @@
   LIBGNAT_TARGET_PAIRS = \
   system.ads<libgnat/system-rtems.ads \
   a-intnam.ads<libgnarl/a-intnam__rtems.ads \
-  s-inmaop.adb<libgnarl/s-inmaop__posix.adb \
-  s-intman.adb<libgnarl/s-intman__posix.adb \
+  s-inmaop.adb<libgnarl/s-inmaop__hwint.adb \
+  s-intman.adb<libgnarl/s-intman__rtems.adb \
+  s-intman.ads<libgnarl/s-intman__rtems.ads \
   s-osinte.adb<libgnarl/s-osinte__rtems.adb \
   s-osinte.ads<libgnarl/s-osinte__rtems.ads \
   s-osprim.adb<libgnat/s-osprim__rtems.adb \
   s-parame.adb<libgnat/s-parame__rtems.adb \
   s-parame.ads<libgnat/s-parame__posix2008.ads \
-  s-taprop.adb<libgnarl/s-taprop__posix.adb \
+  s-taprop.adb<libgnarl/s-taprop__rtems.adb \
   s-taspri.ads<libgnarl/s-taspri__posix.ads \
   s-tpopsp.adb<libgnarl/s-tpopsp__tls.adb \
-  s-stchop.adb<libgnat/s-stchop__rtems.adb \
   s-interr.adb<libgnarl/s-interr__hwint.adb
 
+  EXTRA_GNATRTL_NONTASKING_OBJS += s-stchop.o
+
   ifeq ($(strip $(filter-out arm%, $(target_cpu))),)
     EH_MECHANISM=-arm
   else
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index 60cfa93..6781728 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -2424,8 +2424,10 @@
   if (pid == 0)
     {
       /* The child. */
-      if (execv (args[0], MAYBE_TO_PTR32 (args)) != 0)
-	_exit (1);
+      execv (args[0], MAYBE_TO_PTR32 (args));
+
+      /* execv() returns only on error */
+      _exit (1);
     }
 
   /* The parent.  */
@@ -2822,8 +2824,10 @@
   if (pid == 0)
     {
       /* The child.  */
-      if (execv (args[0], MAYBE_TO_PTR32 (args)) != 0)
-	_exit (1);
+      execv (args[0], MAYBE_TO_PTR32 (args));
+
+      /* execv() returns only on error */
+      _exit (1);
     }
 
   return pid;
diff --git a/gcc/ada/ali.adb b/gcc/ada/ali.adb
index 3815a70..88cc247 100644
--- a/gcc/ada/ali.adb
+++ b/gcc/ada/ali.adb
@@ -963,19 +963,18 @@
       --  special characters are included in the returned name.
 
       function Get_Name
-        (Ignore_Spaces  : Boolean := False;
-         Ignore_Special : Boolean := False;
+        (Ignore_Special : Boolean := False;
          May_Be_Quoted  : Boolean := False) return Name_Id;
       --  Skip blanks, then scan out a name (name is left in Name_Buffer with
       --  length in Name_Len, as well as being returned in Name_Id form).
       --  If Lower is set to True then the Name_Buffer will be converted to
       --  all lower case, for systems where file names are not case sensitive.
       --  This ensures that gnatbind works correctly regardless of the case
-      --  of the file name on all systems. The termination condition depends
-      --  on the settings of Ignore_Spaces and Ignore_Special:
+      --  of the file name on all systems.
       --
-      --    If Ignore_Spaces is False (normal case), then scan is terminated
-      --    by the normal end of field condition (EOL, space, horizontal tab)
+      --  The scan is terminated by the normal end of field condition
+      --  (EOL, space, horizontal tab). Furthermore, the termination condition
+      --  depends on the setting of Ignore_Special:
       --
       --    If Ignore_Special is False (normal case), the scan is terminated by
       --    a typeref bracket or an equal sign except for the special case of
@@ -986,7 +985,6 @@
       --    the name is 'unquoted'. In this case Ignore_Special is ignored and
       --    assumed to be True.
       --
-      --  It is an error to set both Ignore_Spaces and Ignore_Special to True.
       --  This function handles wide characters properly.
 
       function Get_Nat return Nat;
@@ -1240,8 +1238,7 @@
       --------------
 
       function Get_Name
-        (Ignore_Spaces  : Boolean := False;
-         Ignore_Special : Boolean := False;
+        (Ignore_Special : Boolean := False;
          May_Be_Quoted  : Boolean := False) return Name_Id
       is
          Char : Character;
@@ -1298,7 +1295,7 @@
             loop
                Add_Char_To_Name_Buffer (Getc);
 
-               exit when At_End_Of_Field and then not Ignore_Spaces;
+               exit when At_End_Of_Field;
 
                if not Ignore_Special then
                   if Name_Buffer (1) = '"' then
diff --git a/gcc/ada/atree.adb b/gcc/ada/atree.adb
index 98614e8..88d766a 100644
--- a/gcc/ada/atree.adb
+++ b/gcc/ada/atree.adb
@@ -854,14 +854,15 @@
      (N : Node_Id; Field : Node_Or_Entity_Field) return Field_Size_32_Bit
    is
       Desc : Field_Descriptor renames Field_Descriptors (Field);
+      NN : constant Node_Or_Entity_Id := Node_To_Fetch_From (N, Field);
 
    begin
       case Field_Size (Desc.Kind) is
-         when 1 => return Field_Size_32_Bit (Get_1_Bit_Val (N, Desc.Offset));
-         when 2 => return Field_Size_32_Bit (Get_2_Bit_Val (N, Desc.Offset));
-         when 4 => return Field_Size_32_Bit (Get_4_Bit_Val (N, Desc.Offset));
-         when 8 => return Field_Size_32_Bit (Get_8_Bit_Val (N, Desc.Offset));
-         when others => return Get_32_Bit_Val (N, Desc.Offset);  -- 32
+         when 1 => return Field_Size_32_Bit (Get_1_Bit_Val (NN, Desc.Offset));
+         when 2 => return Field_Size_32_Bit (Get_2_Bit_Val (NN, Desc.Offset));
+         when 4 => return Field_Size_32_Bit (Get_4_Bit_Val (NN, Desc.Offset));
+         when 8 => return Field_Size_32_Bit (Get_8_Bit_Val (NN, Desc.Offset));
+         when others => return Get_32_Bit_Val (NN, Desc.Offset);  -- 32
       end case;
    end Get_Field_Value;
 
diff --git a/gcc/ada/atree.ads b/gcc/ada/atree.ads
index 2f3ca40..c239507 100644
--- a/gcc/ada/atree.ads
+++ b/gcc/ada/atree.ads
@@ -47,6 +47,7 @@
 with Alloc;
 with Sinfo.Nodes;    use Sinfo.Nodes;
 with Einfo.Entities; use Einfo.Entities;
+with Einfo.Utils;    use Einfo.Utils;
 with Types;          use Types;
 with Seinfo;         use Seinfo;
 with System;         use System;
@@ -230,11 +231,18 @@
    function New_Node
      (New_Node_Kind : Node_Kind;
       New_Sloc      : Source_Ptr) return Node_Id;
-   --  Allocates a completely new node with the given node type and source
-   --  location values. All other fields are set to their standard defaults:
+   --  Allocates a new node with the given node type and source location
+   --  values. Fields have defaults depending on their type:
+
+   --    Flag: False
+   --    Node_Id: Empty
+   --    List_Id: Empty
+   --    Elist_Id: No_Elist
+   --    Uint: No_Uint
    --
-   --    Empty for all FieldN fields
-   --    False for all FlagN fields
+   --    Name_Id, String_Id, Valid_Uint, Unat, Upos, Nonzero_Uint, Ureal:
+   --      No default. This means it is an error to call the getter before
+   --      calling the setter.
    --
    --  The usual approach is to build a new node using this function and
    --  then, using the value returned, use the Set_xxx functions to set
@@ -288,16 +296,16 @@
    --  with copying aspect specifications where this is required.
 
    function New_Copy (Source : Node_Id) return Node_Id;
-   --  This function allocates a completely new node, and then initializes
-   --  it by copying the contents of the source node into it. The contents of
-   --  the source node is not affected. The target node is always marked as
-   --  not being in a list (even if the source is a list member), and not
-   --  overloaded. The new node will have an extension if the source has
-   --  an extension. New_Copy (Empty) returns Empty, and New_Copy (Error)
-   --  returns Error. Note that, unlike Copy_Separate_Tree, New_Copy does not
-   --  recursively copy any descendants, so in general parent pointers are not
-   --  set correctly for the descendants of the copied node. Both normal and
-   --  extended nodes (entities) may be copied using New_Copy.
+   --  This function allocates a new node, and then initializes it by copying
+   --  the contents of the source node into it. The contents of the source node
+   --  is not affected. The target node is always marked as not being in a list
+   --  (even if the source is a list member), and not overloaded. The new node
+   --  will have an extension if the source has an extension. New_Copy (Empty)
+   --  returns Empty, and New_Copy (Error) returns Error. Note that, unlike
+   --  Copy_Separate_Tree, New_Copy does not recursively copy any descendants,
+   --  so in general parent pointers are not set correctly for the descendants
+   --  of the copied node. Both normal and extended nodes (entities) may be
+   --  copied using New_Copy.
 
    function Relocate_Node (Source : Node_Id) return Node_Id;
    --  Source is a non-entity node that is to be relocated. A new node is
@@ -340,11 +348,11 @@
    --  Exchange the contents of two entities. The parent pointers are switched
    --  as well as the Defining_Identifier fields in the parents, so that the
    --  entities point correctly to their original parents. The effect is thus
-   --  to leave the tree completely unchanged in structure, except that the
-   --  entity ID values of the two entities are interchanged. Neither of the
-   --  two entities may be list members. Note that entities appear on two
-   --  semantic chains: Homonym and Next_Entity: the corresponding links must
-   --  be adjusted by the caller, according to context.
+   --  to leave the tree unchanged in structure, except that the entity ID
+   --  values of the two entities are interchanged. Neither of the two entities
+   --  may be list members. Note that entities appear on two semantic chains:
+   --  Homonym and Next_Entity: the corresponding links must be adjusted by the
+   --  caller, according to context.
 
    procedure Extend_Node (Source : Node_Id);
    --  This turns a node into an entity; it function is used only by Sinfo.CN.
@@ -609,6 +617,20 @@
    --  always the same; for example we change from E_Void, to E_Variable, to
    --  E_Void, to E_Constant.
 
+   function Node_To_Fetch_From
+     (N : Node_Or_Entity_Id; Field : Node_Or_Entity_Field)
+     return Node_Or_Entity_Id is
+      (case Field_Descriptors (Field).Type_Only is
+         when No_Type_Only => N,
+         when Base_Type_Only => Base_Type (N),
+         when Impl_Base_Type_Only => Implementation_Base_Type (N),
+         when Root_Type_Only => Root_Type (N));
+   --  This is analogous to the same-named function in Gen_IL.Gen. Normally,
+   --  Type_Only is No_Type_Only, and we fetch the field from the node N. But
+   --  if Type_Only = Base_Type_Only, we need to go to the Base_Type, and
+   --  similarly for the other two cases. This can return something other
+   --  than N only if N is an Entity.
+
    -----------------------------
    -- Private Part Subpackage --
    -----------------------------
diff --git a/gcc/ada/bindo-graphs.adb b/gcc/ada/bindo-graphs.adb
index 011b0f4..0989981 100644
--- a/gcc/ada/bindo-graphs.adb
+++ b/gcc/ada/bindo-graphs.adb
@@ -4903,11 +4903,10 @@
 
       procedure Set_Is_Existing_Source_Target_Relation
         (G   : Invocation_Graph;
-         Rel : Source_Target_Relation;
-         Val : Boolean := True);
+         Rel : Source_Target_Relation);
       pragma Inline (Set_Is_Existing_Source_Target_Relation);
       --  Mark a source vertex and a target vertex described by relation Rel as
-      --  already related in invocation graph G depending on value Val.
+      --  already related in invocation graph G.
 
       procedure Set_IGE_Attributes
         (G    : Invocation_Graph;
@@ -5636,19 +5635,14 @@
 
       procedure Set_Is_Existing_Source_Target_Relation
         (G   : Invocation_Graph;
-         Rel : Source_Target_Relation;
-         Val : Boolean := True)
+         Rel : Source_Target_Relation)
       is
       begin
          pragma Assert (Present (G));
          pragma Assert (Present (Rel.Source));
          pragma Assert (Present (Rel.Target));
 
-         if Val then
-            Relation_Sets.Insert (G.Relations, Rel);
-         else
-            Relation_Sets.Delete (G.Relations, Rel);
-         end if;
+         Relation_Sets.Insert (G.Relations, Rel);
       end Set_Is_Existing_Source_Target_Relation;
 
       ------------------------
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index a58a495..bbccab7 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -847,7 +847,7 @@
             else
                Error_Msg_N
                  ("\address value may be incompatible with alignment of "
-                  & "object?X?", AC);
+                  & "object?.x?", AC);
             end if;
          end if;
 
@@ -2171,7 +2171,7 @@
          Lo_OK := (Ifirst > 0);
 
       else
-         Lo := Machine (Expr_Type, UR_From_Uint (Ifirst), Round_Even, Expr);
+         Lo := Machine_Number (Expr_Type, UR_From_Uint (Ifirst), Expr);
          Lo_OK := (Lo >= UR_From_Uint (Ifirst));
       end if;
 
@@ -2214,7 +2214,7 @@
          Hi := UR_From_Uint (Ilast) + Ureal_Half;
          Hi_OK := (Ilast < 0);
       else
-         Hi := Machine (Expr_Type, UR_From_Uint (Ilast), Round_Even, Expr);
+         Hi := Machine_Number (Expr_Type, UR_From_Uint (Ilast), Expr);
          Hi_OK := (Hi <= UR_From_Uint (Ilast));
       end if;
 
@@ -5563,7 +5563,7 @@
       --  the results in Lo_Right, Hi_Right, Lo_Left, Hi_Left.
 
       function Round_Machine (B : Ureal) return Ureal;
-      --  B is a real bound. Round it using mode Round_Even.
+      --  B is a real bound. Round it to the nearest machine number.
 
       -----------------
       -- OK_Operands --
@@ -5589,7 +5589,7 @@
 
       function Round_Machine (B : Ureal) return Ureal is
       begin
-         return Machine (Typ, B, Round_Even, N);
+         return Machine_Number (Typ, B, N);
       end Round_Machine;
 
    --  Start of processing for Determine_Range_R
@@ -6676,8 +6676,9 @@
       elsif not Comes_From_Source (Expr)
         and then not
           (Nkind (Expr) = N_Identifier
-            and then Present (Renamed_Object (Entity (Expr)))
-            and then Comes_From_Source (Renamed_Object (Entity (Expr))))
+            and then Present (Renamed_Entity_Or_Object (Entity (Expr)))
+            and then
+              Comes_From_Source (Renamed_Entity_Or_Object (Entity (Expr))))
         and then not Force_Validity_Checks
         and then (Nkind (Expr) /= N_Unchecked_Type_Conversion
                     or else Kill_Range_Check (Expr))
@@ -8077,7 +8078,7 @@
       Is_High_Bound : Boolean   := False)
    is
       Loc : constant Source_Ptr := Sloc (Expr);
-      Typ : constant Entity_Id  := Etype (Expr);
+      Typ : Entity_Id           := Etype (Expr);
       Exp : Node_Id;
 
    begin
@@ -8137,6 +8138,7 @@
       while Nkind (Exp) = N_Type_Conversion loop
          Exp := Expression (Exp);
       end loop;
+      Typ := Etype (Exp);
 
       --  Do not generate a check for a variable which already validates the
       --  value of an assignable object.
@@ -8217,6 +8219,14 @@
                Set_Do_Range_Check (Validated_Object (Var_Id), False);
             end if;
 
+            --  In case of a type conversion, an expansion of the expr may be
+            --  needed (eg. fixed-point as actual).
+
+            if Exp /= Expr then
+               pragma Assert (Nkind (Expr) = N_Type_Conversion);
+               Analyze_And_Resolve (Expr);
+            end if;
+
             PV := New_Occurrence_Of (Var_Id, Loc);
 
          --  Otherwise the expression does not denote a variable. Force its
diff --git a/gcc/ada/cstand.adb b/gcc/ada/cstand.adb
index 409944c..3822d93 100644
--- a/gcc/ada/cstand.adb
+++ b/gcc/ada/cstand.adb
@@ -149,8 +149,7 @@
    function New_Operator (Op : Name_Id; Typ : Entity_Id) return Entity_Id;
    --  Build entity for standard operator with given name and type
 
-   function New_Standard_Entity
-     (New_Node_Kind : Node_Kind := N_Defining_Identifier) return Entity_Id;
+   function New_Standard_Entity return Entity_Id;
    --  Builds a new entity for Standard
 
    function New_Standard_Entity (Nam : String) return Entity_Id;
@@ -1234,10 +1233,11 @@
       Mutate_Ekind          (Any_Composite, E_Array_Type);
       Set_Scope             (Any_Composite, Standard_Standard);
       Set_Etype             (Any_Composite, Any_Composite);
-      Set_Component_Size    (Any_Composite, Uint_0);
       Set_Component_Type    (Any_Composite, Standard_Integer);
       Reinit_Size_Align     (Any_Composite);
 
+      pragma Assert (not Known_Component_Size (Any_Composite));
+
       Any_Discrete := New_Standard_Entity ("a discrete type");
       Mutate_Ekind          (Any_Discrete, E_Signed_Integer_Type);
       Set_Scope             (Any_Discrete, Standard_Standard);
@@ -1509,10 +1509,11 @@
          Set_Scope       (Standard_Exception_Type, Standard_Standard);
          Set_Stored_Constraint
                          (Standard_Exception_Type, No_Elist);
-         Set_RM_Size (Standard_Exception_Type, Uint_0);
          Set_Size_Known_At_Compile_Time
                          (Standard_Exception_Type, True);
 
+         pragma Assert (not Known_RM_Size (Standard_Exception_Type));
+
          Make_Aliased_Component (Standard_Exception_Type, Standard_Boolean,
                          "Not_Handled_By_Others");
          Make_Aliased_Component (Standard_Exception_Type, Standard_Character,
@@ -1793,10 +1794,9 @@
    -- New_Standard_Entity --
    -------------------------
 
-   function New_Standard_Entity
-     (New_Node_Kind : Node_Kind := N_Defining_Identifier) return Entity_Id
+   function New_Standard_Entity return Entity_Id
    is
-      E : constant Entity_Id := New_Entity (New_Node_Kind, Stloc);
+      E : constant Entity_Id := New_Entity (N_Defining_Identifier, Stloc);
 
    begin
       --  All standard entities are Pure and Public
diff --git a/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst b/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst
index 0375982..768dd66 100644
--- a/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst
+++ b/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst
@@ -2268,9 +2268,24 @@
   set shall be a proper subset of the second (and the later alternative
   will not be executed if the earlier alternative "matches"). All possible
   values of the composite type shall be covered. The composite type of the
-  selector shall be a nonlimited untagged (but possibly discriminated)
-  record type, all of whose subcomponent subtypes are either static discrete
-  subtypes or record types that meet the same restrictions.
+  selector shall be an array or record type that is neither limited
+  class-wide.
+
+  If a subcomponent's subtype does not meet certain restrictions, then
+  the only value that can be specified for that subcomponent in a case
+  choice expression is a "box" component association (which matches all
+  possible values for the subcomponent). This restriction applies if
+
+  - the component subtype is not a record, array, or discrete type; or
+
+  - the component subtype is subject to a non-static constraint or
+    has a predicate; or
+
+  - the component type is an enumeration type that is subject to an
+    enumeration representation clause; or
+
+  - the component type is a multidimensional array type or an
+    array type with a nonstatic index subtype.
 
   Support for casing on arrays (and on records that contain arrays) is
   currently subject to some restrictions. Non-positional
diff --git a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst
index 67fd130..48b7623 100644
--- a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst
+++ b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst
@@ -3582,6 +3582,25 @@
   ordering.
 
 
+.. index:: -gnatw_p  (gcc)
+
+:switch:`-gnatw_p`
+  *Activate warnings for pedantic checks.*
+
+  This switch activates warnings for the failure of certain pedantic checks.
+  The only case currently supported is a check that the subtype_marks given
+  for corresponding formal parameter and function results in a subprogram
+  declaration and its body denote the same subtype declaration. The default
+  is that such warnings are not given.
+
+.. index:: -gnatw_P  (gcc)
+
+:switch:`-gnatw_P`
+  *Suppress warnings for pedantic checks.*
+
+  This switch suppresses warnings on violations of pedantic checks.
+
+
 .. index:: -gnatwq  (gcc)
 .. index:: Parentheses, warnings
 
diff --git a/gcc/ada/einfo-utils.adb b/gcc/ada/einfo-utils.adb
index 0274e6b..763b646 100644
--- a/gcc/ada/einfo-utils.adb
+++ b/gcc/ada/einfo-utils.adb
@@ -43,24 +43,87 @@
    --  Determine whether abstract state State_Id has particular option denoted
    --  by the name Option_Nam.
 
-   -----------------------------------
-   -- Renamings of Renamed_Or_Alias --
-   -----------------------------------
+   -------------------------------------------
+   -- Aliases/Renamings of Renamed_Or_Alias --
+   -------------------------------------------
 
    function Alias (N : Entity_Id) return Node_Id is
    begin
-      pragma Assert
-        (Is_Overloadable (N) or else Ekind (N) = E_Subprogram_Type);
-      return Renamed_Or_Alias (N);
+      return Val : constant Node_Id := Renamed_Or_Alias (N) do
+         pragma Assert
+           (Is_Overloadable (N) or else Ekind (N) = E_Subprogram_Type);
+         pragma Assert (Val in N_Entity_Id | N_Empty_Id);
+      end return;
    end Alias;
 
    procedure Set_Alias (N : Entity_Id; Val : Node_Id) is
    begin
       pragma Assert
         (Is_Overloadable (N) or else Ekind (N) = E_Subprogram_Type);
+      pragma Assert (Val in N_Entity_Id | N_Empty_Id);
+
       Set_Renamed_Or_Alias (N, Val);
    end Set_Alias;
 
+   function Renamed_Entity (N : Entity_Id) return Node_Id is
+   begin
+      return Val : constant Node_Id := Renamed_Or_Alias (N) do
+         pragma Assert (not Is_Object (N) or else Etype (N) = Any_Type);
+         pragma Assert (Val in N_Entity_Id | N_Empty_Id);
+      end return;
+   end Renamed_Entity;
+
+   procedure Set_Renamed_Entity (N : Entity_Id; Val : Node_Id) is
+   begin
+      pragma Assert (not Is_Object (N));
+      pragma Assert (Val in N_Entity_Id);
+
+      Set_Renamed_Or_Alias (N, Val);
+   end Set_Renamed_Entity;
+
+   function Renamed_Object (N : Entity_Id) return Node_Id is
+   begin
+      return Val : constant Node_Id := Renamed_Or_Alias (N) do
+         --  Formal_Kind uses the entity, not a name of it. This happens
+         --  in front-end inlining, which also sets to Empty. Also in
+         --  Exp_Ch9, where formals are renamed for the benefit of gdb.
+
+         if Ekind (N) not in Formal_Kind then
+            pragma Assert (Is_Object (N));
+            pragma Assert (Val in N_Subexpr_Id | N_Empty_Id);
+            null;
+         end if;
+      end return;
+   end Renamed_Object;
+
+   procedure Set_Renamed_Object (N : Entity_Id; Val : Node_Id) is
+   begin
+      if Ekind (N) not in Formal_Kind then
+         pragma Assert (Is_Object (N));
+         pragma Assert (Val in N_Subexpr_Id | N_Empty_Id);
+         null;
+      end if;
+
+      Set_Renamed_Or_Alias (N, Val);
+   end Set_Renamed_Object;
+
+   function Renamed_Entity_Or_Object (N : Entity_Id) return Node_Id is
+   begin
+      if Is_Object (N) then
+         return Renamed_Object (N);
+      else
+         return Renamed_Entity (N);
+      end if;
+   end Renamed_Entity_Or_Object;
+
+   procedure Set_Renamed_Object_Of_Possibly_Void
+     (N : Entity_Id; Val : Node_Id)
+   is
+   begin
+      pragma Assert (Val in N_Subexpr_Id);
+      Set_Renamed_Or_Alias (N, Val);
+   end Set_Renamed_Object_Of_Possibly_Void;
+
    ----------------
    -- Has_Option --
    ----------------
@@ -390,34 +453,23 @@
 
    function Known_Static_Component_Bit_Offset (E : Entity_Id) return B is
    begin
-      return Present (Component_Bit_Offset (E))
+      return Known_Component_Bit_Offset (E)
         and then Component_Bit_Offset (E) >= Uint_0;
    end Known_Static_Component_Bit_Offset;
 
    function Known_Component_Size (E : Entity_Id) return B is
    begin
-      return Component_Size (E) /= Uint_0
-        and then Present (Component_Size (E));
+      return Present (Component_Size (E));
    end Known_Component_Size;
 
    function Known_Static_Component_Size (E : Entity_Id) return B is
    begin
-      return Component_Size (E) > Uint_0;
+      return Known_Component_Size (E) and then Component_Size (E) >= Uint_0;
    end Known_Static_Component_Size;
 
-   Use_New_Unknown_Rep : constant Boolean := False;
-   --  If False, we represent "unknown" as Uint_0, which is wrong.
-   --  We intend to make it True (and remove it), and represent
-   --  "unknown" as Field_Is_Initial_Zero. We also need to change
-   --  the type of Esize and RM_Size from Uint to Valid_Uint.
-
    function Known_Esize (E : Entity_Id) return B is
    begin
-      if Use_New_Unknown_Rep then
-         return not Field_Is_Initial_Zero (E, F_Esize);
-      else
-         return Present (Esize (E)) and then Esize (E) /= Uint_0;
-      end if;
+      return Present (Esize (E));
    end Known_Esize;
 
    function Known_Static_Esize (E : Entity_Id) return B is
@@ -429,11 +481,7 @@
 
    procedure Reinit_Esize (Id : E) is
    begin
-      if Use_New_Unknown_Rep then
-         Reinit_Field_To_Zero (Id, F_Esize);
-      else
-         Set_Esize (Id, Uint_0);
-      end if;
+      Reinit_Field_To_Zero (Id, F_Esize);
    end Reinit_Esize;
 
    procedure Copy_Esize (To, From : E) is
@@ -452,7 +500,7 @@
 
    function Known_Static_Normalized_First_Bit (E : Entity_Id) return B is
    begin
-      return Present (Normalized_First_Bit (E))
+      return Known_Normalized_First_Bit (E)
         and then Normalized_First_Bit (E) >= Uint_0;
    end Known_Static_Normalized_First_Bit;
 
@@ -463,43 +511,25 @@
 
    function Known_Static_Normalized_Position (E : Entity_Id) return B is
    begin
-      return Present (Normalized_Position (E))
+      return Known_Normalized_Position (E)
         and then Normalized_Position (E) >= Uint_0;
    end Known_Static_Normalized_Position;
 
    function Known_RM_Size (E : Entity_Id) return B is
    begin
-      if Use_New_Unknown_Rep then
-         return not Field_Is_Initial_Zero (E, F_RM_Size);
-      else
-         return Present (RM_Size (E))
-           and then (RM_Size (E) /= Uint_0
-                       or else Is_Discrete_Type (E)
-                       or else Is_Fixed_Point_Type (E));
-      end if;
+      return Present (RM_Size (E));
    end Known_RM_Size;
 
    function Known_Static_RM_Size (E : Entity_Id) return B is
    begin
-      if Use_New_Unknown_Rep then
-         return Known_RM_Size (E)
-           and then RM_Size (E) >= Uint_0
-           and then not Is_Generic_Type (E);
-      else
-         return (RM_Size (E) > Uint_0
-                   or else Is_Discrete_Type (E)
-                   or else Is_Fixed_Point_Type (E))
-           and then not Is_Generic_Type (E);
-      end if;
+      return Known_RM_Size (E)
+        and then RM_Size (E) >= Uint_0
+        and then not Is_Generic_Type (E);
    end Known_Static_RM_Size;
 
    procedure Reinit_RM_Size (Id : E) is
    begin
-      if Use_New_Unknown_Rep then
-         Reinit_Field_To_Zero (Id, F_RM_Size);
-      else
-         Set_RM_Size (Id, Uint_0);
-      end if;
+      Reinit_Field_To_Zero (Id, F_RM_Size);
    end Reinit_RM_Size;
 
    procedure Copy_RM_Size (To, From : E) is
@@ -541,9 +571,8 @@
    begin
       pragma Assert (Is_Type (Id));
       pragma Assert (not Known_Esize (Id) or else Esize (Id) = V);
-      if Use_New_Unknown_Rep then
-         pragma Assert (not Known_RM_Size (Id) or else RM_Size (Id) = V);
-      end if;
+      pragma Assert (not Known_RM_Size (Id) or else RM_Size (Id) = V);
+
       Set_Esize (Id, UI_From_Int (V));
       Set_RM_Size (Id, UI_From_Int (V));
    end Init_Size;
@@ -669,6 +698,30 @@
          P := Empty;
       end if;
 
+      --  Declarations are sometimes removed by replacing them with other
+      --  irrelevant nodes. For example, a declare expression can be turned
+      --  into a literal by constant folding. In these cases we want to
+      --  return Empty.
+
+      if Nkind (P) in
+          N_Assignment_Statement
+        | N_Integer_Literal
+        | N_Procedure_Call_Statement
+        | N_Subtype_Indication
+        | N_Type_Conversion
+      then
+         P := Empty;
+      end if;
+
+      --  The following Assert indicates what kinds of nodes can be returned;
+      --  they are not all "declarations".
+
+      if Serious_Errors_Detected = 0 then
+         pragma Assert
+           (Nkind (P) in N_Is_Decl | N_Empty,
+            "Declaration_Node incorrect kind: " & Node_Kind'Image (Nkind (P)));
+      end if;
+
       return P;
    end Declaration_Node;
 
@@ -2593,6 +2646,16 @@
       return Scope_Depth_Value (Scop);
    end Scope_Depth;
 
+   function Scope_Depth_Default_0 (Id : E) return U is
+   begin
+      if Scope_Depth_Set (Id) then
+         return Scope_Depth (Id);
+
+      else
+         return Uint_0;
+      end if;
+   end Scope_Depth_Default_0;
+
    ---------------------
    -- Scope_Depth_Set --
    ---------------------
diff --git a/gcc/ada/einfo-utils.ads b/gcc/ada/einfo-utils.ads
index 8046722..c82b469 100644
--- a/gcc/ada/einfo-utils.ads
+++ b/gcc/ada/einfo-utils.ads
@@ -27,25 +27,37 @@
 
 package Einfo.Utils is
 
-   -----------------------------------
-   -- Renamings of Renamed_Or_Alias --
-   -----------------------------------
+   -------------------------------------------
+   -- Aliases/Renamings of Renamed_Or_Alias --
+   -------------------------------------------
 
    --  See the comment in einfo.ads, "Renaming and Aliasing", which is somewhat
-   --  incorrect. In fact, the compiler uses Alias, Renamed_Entity, and
-   --  Renamed_Object more-or-less interchangeably, so we rename them here.
-   --  Alias isn't really renamed, because we want an assertion in the body.
+   --  incorrect. Each of the following calls [Set_]Renamed_Or_Alias. Alias and
+   --  Renamed_Entity are fields of nonobject Entity_Ids, and the value of the
+   --  field is Entity_Id. Alias is only for callable entities and subprogram
+   --  types. We sometimes call Set_Renamed_Entity and then expect Alias to
+   --  return the value set. Renamed_Object is a field of Entity_Ids that are
+   --  objects, and it returns an expression, because you can rename things
+   --  like "X.all(J).Y". Renamings of entries and subprograms can also be
+   --  expressions, but those use different mechanisms; the fields here are not
+   --  used.
 
    function Alias (N : Entity_Id) return Node_Id;
    procedure Set_Alias (N : Entity_Id; Val : Node_Id);
-   function Renamed_Entity
-     (N : Entity_Id) return Node_Id renames Renamed_Or_Alias;
-   procedure Set_Renamed_Entity
-     (N : Entity_Id; Val : Node_Id) renames Set_Renamed_Or_Alias;
-   function Renamed_Object
-     (N : Entity_Id) return Node_Id renames Renamed_Or_Alias;
-   procedure Set_Renamed_Object
-     (N : Entity_Id; Val : Node_Id) renames Set_Renamed_Or_Alias;
+   function Renamed_Entity (N : Entity_Id) return Node_Id;
+   procedure Set_Renamed_Entity (N : Entity_Id; Val : Node_Id);
+   function Renamed_Object (N : Entity_Id) return Node_Id;
+   procedure Set_Renamed_Object (N : Entity_Id; Val : Node_Id);
+
+   function Renamed_Entity_Or_Object (N : Entity_Id) return Node_Id;
+   --  This getter is used when we don't know statically whether we want to
+   --  call Renamed_Entity or Renamed_Object.
+
+   procedure Set_Renamed_Object_Of_Possibly_Void
+     (N : Entity_Id; Val : Node_Id);
+   --  Set_Renamed_Object doesn't allow Void; this is used in the rare cases
+   --  where we set the field of an entity that might be Void. It might be a
+   --  good idea to get rid of calls to this.
 
    pragma Inline (Alias);
    pragma Inline (Set_Alias);
@@ -53,6 +65,8 @@
    pragma Inline (Set_Renamed_Entity);
    pragma Inline (Renamed_Object);
    pragma Inline (Set_Renamed_Object);
+   pragma Inline (Renamed_Entity_Or_Object);
+   pragma Inline (Set_Renamed_Object_Of_Possibly_Void);
 
    -------------------
    -- Type Synonyms --
@@ -274,14 +288,21 @@
    function Safe_Emax_Value                     (Id : E) return U;
    function Safe_First_Value                    (Id : E) return R;
    function Safe_Last_Value                     (Id : E) return R;
-   function Scope_Depth                         (Id : E) return U;
-   function Scope_Depth_Set                     (Id : E) return B;
    function Size_Clause                         (Id : E) return N;
    function Stream_Size_Clause                  (Id : E) return N;
    function Type_High_Bound                     (Id : E) return N;
    function Type_Low_Bound                      (Id : E) return N;
    function Underlying_Type                     (Id : E) return E;
 
+   function Scope_Depth                         (Id : E) return U;
+   function Scope_Depth_Set                     (Id : E) return B;
+
+   function Scope_Depth_Default_0               (Id : E) return U;
+   --  In rare cases, the Scope_Depth_Value (queried by Scope_Depth) is
+   --  not correctly set before querying it; this may be used instead of
+   --  Scope_Depth in such cases. It returns Uint_0 if the Scope_Depth_Value
+   --  has not been set. See documentation in Einfo.
+
    pragma Inline (Address_Clause);
    pragma Inline (Alignment_Clause);
    pragma Inline (Base_Type);
@@ -314,63 +335,6 @@
    -- Type Representation Attribute Fields --
    ------------------------------------------
 
-   --  Each of the following fields can be in a "known" or "unknown" state:
-
-   --    Alignment
-   --    Component_Size
-   --    Component_Bit_Offset
-   --    Digits_Value
-   --    Esize
-   --    Normalized_First_Bit
-   --    Normalized_Position
-   --    RM_Size
-   --
-   --  NOTE: "known" here does not mean "known at compile time". It means that
-   --  the compiler has computed the value of the field (either by default, or
-   --  by noting some representation clauses), and the field has not been
-   --  reinitialized.
-   --
-   --  We document the Esize functions here; the others are analogous:
-   --
-   --     Known_Esize: True if Set_Esize has been called without a subsequent
-   --     Reinit_Esize.
-   --
-   --     Known_Static_Esize: True if Known_Esize and the Esize is known at
-   --     compile time. (We're not using "static" in the Ada RM sense here. We
-   --     are using it to mean "known at compile time.)
-   --
-   --     Reinit_Esize: Set the Esize field to its initial unknown state.
-   --
-   --     Copy_Esize: Copies the Esize from From to To; Known_Esize (From) may
-   --     be False, in which case Known_Esize (To) becomes False.
-   --
-   --     Esize: This is the normal automatially-generated getter for Esize,
-   --     declared elsewhere. It is an error to call this if Set_Esize has not
-   --     yet been called, or if Reinit_Esize has been called subsequently.
-   --
-   --     Set_Esize: This is the normal automatially-generated setter for
-   --     Esize. After a call to this, Known_Esize is True. It is an error
-   --     to call this with a No_Uint value.
-   --
-   --  Normally, we call Set_Esize first, and then query Esize (and similarly
-   --  for other fields). However in some cases, we need to check Known_Esize
-   --  before calling Esize, because the code is written in such a way that we
-   --  don't know whether Set_Esize has already been called.
-   --
-   --  We intend to use the initial zero value to represent "unknown". Note
-   --  that this value is different from No_Uint, and different from Uint_0.
-   --  However, this is work in progress; we are still using No_Uint or Uint_0
-   --  to represent "unknown" in some cases. Using Uint_0 leads to several
-   --  bugs, because zero is a legitimate value (T'Size can be zero bits) --
-   --  Uint_0 shouldn't mean two different things.
-   --
-   --  In two cases, Known_Static_Esize and Known_Static_RM_Size, there is one
-   --  more consideration, which is that we always return False for generic
-   --  types. Within a template, the size can look Known_Static, because of the
-   --  fake size values we put in template types, but they are not really
-   --  Known_Static and anyone testing if they are Known_Static within the
-   --  template should get False as a result to prevent incorrect assumptions.
-
    function Known_Alignment (E : Entity_Id) return B with Inline;
    procedure Reinit_Alignment (Id : E) with Inline;
    procedure Copy_Alignment (To, From : E);
@@ -400,6 +364,44 @@
    procedure Reinit_RM_Size (Id : E) with Inline;
    procedure Copy_RM_Size (To, From : E);
 
+   --  NOTE: "known" here does not mean "known at compile time". It means that
+   --  the compiler has computed the value of the field (either by default, or
+   --  by noting some representation clauses), and the field has not been
+   --  reinitialized.
+   --
+   --  We document the Esize functions here; the others above are analogous:
+   --
+   --     Known_Esize: True if Set_Esize has been called without a subsequent
+   --     Reinit_Esize.
+   --
+   --     Known_Static_Esize: True if Known_Esize and the Esize is known at
+   --     compile time. (We're not using "static" in the Ada RM sense here. We
+   --     are using it to mean "known at compile time".)
+   --
+   --     Reinit_Esize: Set the Esize field to its initial unknown state.
+   --
+   --     Copy_Esize: Copies the Esize from From to To; Known_Esize (From) may
+   --     be False, in which case Known_Esize (To) becomes False.
+   --
+   --     Esize: This is the normal automatically-generated getter for Esize,
+   --     declared elsewhere. Returns No_Uint if not Known_Esize.
+   --
+   --     Set_Esize: This is the normal automatically-generated setter for
+   --     Esize. After a call to this, Known_Esize is True. It is an error
+   --     to call this with a No_Uint value.
+   --
+   --  Normally, we call Set_Esize first, and then query Esize (and similarly
+   --  for other fields). However in some cases, we need to check Known_Esize
+   --  before calling Esize, because the code is written in such a way that we
+   --  don't know whether Set_Esize has already been called.
+   --
+   --  In two cases, Known_Static_Esize and Known_Static_RM_Size, there is one
+   --  more consideration, which is that we always return False for generic
+   --  types. Within a template, the size can look Known_Static, because of the
+   --  fake size values we put in template types, but they are not really
+   --  Known_Static and anyone testing if they are Known_Static within the
+   --  template should get False as a result to prevent incorrect assumptions.
+
    ---------------------------------------------------------
    -- Procedures for setting multiple of the above fields --
    ---------------------------------------------------------
diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads
index 0239a70..51cb014 100644
--- a/gcc/ada/einfo.ads
+++ b/gcc/ada/einfo.ads
@@ -4323,7 +4323,8 @@
 --       Indicates the number of scopes that statically enclose the declaration
 --       of the unit or type. Library units have a depth of zero. Note that
 --       record types can act as scopes but do NOT have this field set (see
---       Scope_Depth above).
+--       Scope_Depth above). Queries should normally be via Scope_Depth,
+--       and not call Scope_Depth_Value directly.
 
 --    Scope_Depth_Set (synthesized)
 --       Applies to a special predicate function that returns a Boolean value
@@ -4555,7 +4556,7 @@
 --       in inheritance of subprograms between views of the same type.
 
 --    Subps_Index
---       Present in subprogram entries. Set if the subprogram contains nested
+--       Present in subprogram entities. Set if the subprogram contains nested
 --       subprograms, or is a subprogram nested within such a subprogram. Holds
 --       the index in the Exp_Unst.Subps table for the subprogram. Note that
 --       for the outer level subprogram, this is the starting index in the Subp
@@ -4761,7 +4762,7 @@
 
 --  Several entity attributes relate to renaming constructs, and to the use of
 --  different names to refer to the same entity. The following is a summary of
---  these constructs and their prefered uses.
+--  these constructs and their preferred uses.
 
 --  There are three related attributes:
 
@@ -4774,7 +4775,7 @@
 
 --  a) Renamed_Entity applies to entities in renaming declarations that rename
 --  an entity, so the value of the attribute IS an entity. This applies to
---  generic renamings, package renamings, exception renamings, and subprograms
+--  generic renamings, package renamings, exception renamings, and subprogram
 --  renamings that rename a subprogram (rather than an attribute, an entry, a
 --  protected operation, etc).
 
@@ -4796,9 +4797,9 @@
 --  in a few cases we need to use a loop to trace a chain of object renamings
 --  where all of them happen to be entities. So:
 
---    X : integer;
---    Y : integer renames X;   -- renamed object is the identifier X
---    Z : integer renames Y;   -- renamed object is the identifier Y
+--    X : Integer;
+--    Y : Integer renames X;   -- renamed object is the identifier X
+--    Z : Integer renames Y;   -- renamed object is the identifier Y
 
 --  The front-end does not store explicitly the fact that Z renames X.
 
diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb
index 05a8266..76a8268 100644
--- a/gcc/ada/errout.adb
+++ b/gcc/ada/errout.adb
@@ -211,12 +211,9 @@
    --  This is called for warning messages only (so Warning_Msg_Char is set)
    --  and returns a corresponding string to use at the beginning of generated
    --  auxiliary messages, such as "in instantiation at ...".
-   --    'a' .. 'z'   returns "?x?"
-   --    'A' .. 'Z'   returns "?X?"
-   --    '*'          returns "?*?"
-   --    '$'          returns "?$?info: "
-   --    ' '          returns " "
-   --  No other settings are valid
+   --    "?"     returns "??"
+   --    " "     returns "?"
+   --    other   trimmed, prefixed and suffixed with "?".
 
    -----------------------
    -- Change_Error_Text --
@@ -1177,7 +1174,7 @@
                   Errors.Table (Cur_Msg).Warn := True;
                   Errors.Table (Cur_Msg).Warn_Chr := Warning_Msg_Char;
 
-               elsif Warning_Msg_Char /= ' ' then
+               elsif Warning_Msg_Char /= "  " then
                   Errors.Table (Cur_Msg).Warn_Chr := Warning_Msg_Char;
                end if;
             end if;
@@ -3927,12 +3924,15 @@
       P : Natural;     -- Current index;
 
       procedure Skip_Msg_Insertion_Warning (C : Character);
-      --  Deal with ? ?? ?x? ?X? ?*? ?$? insertion sequences (and the same
+      --  Skip the ? ?? ?x? ?*? ?$? insertion sequences (and the same
       --  sequences using < instead of ?). The caller has already bumped
       --  the pointer past the initial ? or < and C is set to this initial
       --  character (? or <). This procedure skips past the rest of the
       --  sequence. We do not need to set Msg_Insertion_Char, since this
       --  was already done during the message prescan.
+      --  No validity check is performed as the insertion sequence is
+      --  supposed to be sane. See Prescan_Message.Parse_Message_Class in
+      --  erroutc.adb for the validity checks.
 
       --------------------------------
       -- Skip_Msg_Insertion_Warning --
@@ -3943,17 +3943,16 @@
          if P <= Text'Last and then Text (P) = C then
             P := P + 1;
 
-         elsif P + 1 <= Text'Last
-           and then (Text (P) in 'a' .. 'z'
-                       or else
-                     Text (P) in 'A' .. 'Z'
-                       or else
-                     Text (P) = '*'
-                       or else
-                     Text (P) = '$')
-           and then Text (P + 1) = C
+         elsif P < Text'Last and then Text (P + 1) = C
+           and then Text (P) in 'a' .. 'z' | '*' | '$'
          then
             P := P + 2;
+
+         elsif P + 1 < Text'Last and then Text (P + 2) = C
+           and then Text (P) in '.' | '_'
+           and then Text (P + 1) in 'a' .. 'z'
+         then
+            P := P + 3;
          end if;
       end Skip_Msg_Insertion_Warning;
 
@@ -4404,19 +4403,15 @@
 
    function Warn_Insertion return String is
    begin
-      case Warning_Msg_Char is
-         when '?' =>
-            return "??";
-
-         when 'a' .. 'z' | 'A' .. 'Z' | '*' | '$' =>
-            return '?' & Warning_Msg_Char & '?';
-
-         when ' ' =>
-            return "?";
-
-         when others =>
-            raise Program_Error;
-      end case;
+      if Warning_Msg_Char = "? " then
+         return "??";
+      elsif Warning_Msg_Char = "  " then
+         return "?";
+      elsif Warning_Msg_Char (2) = ' ' then
+         return '?' & Warning_Msg_Char (1) & '?';
+      else
+         return '?' & Warning_Msg_Char & '?';
+      end if;
    end Warn_Insertion;
 
 end Errout;
diff --git a/gcc/ada/errout.ads b/gcc/ada/errout.ads
index 9b2e08d..60b1b4f 100644
--- a/gcc/ada/errout.ads
+++ b/gcc/ada/errout.ads
@@ -60,13 +60,13 @@
    --  Exception raised if Raise_Exception_On_Error is true
 
    Warning_Doc_Switch : Boolean renames Err_Vars.Warning_Doc_Switch;
-   --  If this is set True, then the ??/?*?/?$?/?x?/?X? insertion sequences in
-   --  error messages generate appropriate tags for the output error messages.
-   --  If this switch is False, then these sequences are still recognized (for
-   --  the purposes of implementing the pattern matching in pragmas Warnings
-   --  (Off,..) and Warning_As_Pragma(...) but do not result in adding the
-   --  error message tag. The -gnatw.d switch sets this flag True, -gnatw.D
-   --  sets this flag False.
+   --  If this is set True, then the ??/?*?/?$?/?x?/?.x?/?_x? insertion
+   --  sequences in error messages generate appropriate tags for the output
+   --  error messages. If this switch is False, then these sequences are still
+   --  recognized (for the purposes of implementing the pattern matching in
+   --  pragmas Warnings (Off,..) and Warning_As_Pragma(...) but do not result
+   --  in adding the error message tag. The -gnatw.d switch sets this flag
+   --  True, -gnatw.D sets this flag False.
 
    Current_Node : Node_Id := Empty;
    --  Used by Error_Msg as a default Node_Id.
@@ -302,28 +302,23 @@
    --      clear that the continuation is part of a warning message, but it is
    --      not necessary to go through any computational effort to include it.
    --
-   --      Note: this usage is obsolete, use ?? ?*? ?$? ?x? ?X? to specify
-   --      the string to be added when Warn_Doc_Switch is set to True. If this
-   --      switch is True, then for simple ? messages it has no effect. This
-   --      simple form is to ease transition and may be removed later except
-   --      for GNATprove-specific messages (info and warnings) which are not
-   --      subject to the same GNAT warning switches.
+   --      Note: this usage is obsolete, use ?? ?*? ?$? ?x? ?.x? ?_x? to
+   --      specify the string to be added when Warn_Doc_Switch is set to True.
+   --      If this switch is True, then for simple ? messages it has no effect.
+   --      This simple form is to ease transition and may be removed later
+   --      except for GNATprove-specific messages (info and warnings) which are
+   --      not subject to the same GNAT warning switches.
 
    --    Insertion character ?? (Two question marks: default warning)
    --      Like ?, but if the flag Warn_Doc_Switch is True, adds the string
    --      "[enabled by default]" at the end of the warning message. For
    --      continuations, use this in each continuation message.
 
-   --    Insertion character ?x? (warning with switch)
+   --    Insertion character ?x? ?.x? ?_x? (warning with switch)
    --      Like ?, but if the flag Warn_Doc_Switch is True, adds the string
-   --      "[-gnatwx]" at the end of the warning message. x is a lower case
-   --      letter. For continuations, use this on each continuation message.
-
-   --    Insertion character ?X? (warning with dot switch)
-   --      Like ?, but if the flag Warn_Doc_Switch is True, adds the string
-   --      "[-gnatw.x]" at the end of the warning message. X is an upper case
-   --      letter corresponding to the lower case letter x in the message.
-   --      For continuations, use this on each continuation message.
+   --      "[-gnatwx]", "[-gnatw.x]", or "[-gnatw_x]", at the end of the
+   --      warning message. x must be lower case. For continuations, use this
+   --      on each continuation message.
 
    --    Insertion character ?*? (restriction warning)
    --      Like ?, but if the flag Warn_Doc_Switch is True, adds the string
@@ -339,8 +334,8 @@
    --    Insertion character < (Less Than: conditional warning message)
    --      The character < appearing anywhere in a message is used for a
    --      conditional error message. If Error_Msg_Warn is True, then the
-   --      effect is the same as ? described above, and in particular << <X<
-   --      <x< <$< <*< have the effect of ?? ?X? ?x? ?$? ?*? respectively. If
+   --      effect is the same as ? described above, and in particular << <x<
+   --      <$< <*< have the effect of ?? ?x? ?$? ?*? respectively. If
    --      Error_Msg_Warn is False, then the < << or <X< sequence is ignored
    --      and the message is treated as a error rather than a warning.
 
diff --git a/gcc/ada/erroutc.adb b/gcc/ada/erroutc.adb
index 9e67b92..8225fd4 100644
--- a/gcc/ada/erroutc.adb
+++ b/gcc/ada/erroutc.adb
@@ -277,7 +277,9 @@
    begin
       for J in 1 .. Errors.Last loop
          begin
-            if Errors.Table (J).Warn and Errors.Table (J).Compile_Time_Pragma
+            if Errors.Table (J).Warn
+               and then Errors.Table (J).Compile_Time_Pragma
+               and then not Errors.Table (J).Deleted
             then
                Result := Result + 1;
             end if;
@@ -362,20 +364,20 @@
    ---------------------
 
    function Get_Warning_Tag (Id : Error_Msg_Id) return String is
-      Warn     : constant Boolean    := Errors.Table (Id).Warn;
-      Warn_Chr : constant Character  := Errors.Table (Id).Warn_Chr;
+      Warn     : constant Boolean         := Errors.Table (Id).Warn;
+      Warn_Chr : constant String (1 .. 2) := Errors.Table (Id).Warn_Chr;
    begin
-      if Warn and then Warn_Chr /= ' ' then
-         if Warn_Chr = '?' then
+      if Warn and then Warn_Chr /= "  " then
+         if Warn_Chr = "? " then
             return "[enabled by default]";
-         elsif Warn_Chr = '*' then
+         elsif Warn_Chr = "* " then
             return "[restriction warning]";
-         elsif Warn_Chr = '$' then
+         elsif Warn_Chr = "$ " then
             return "[-gnatel]";
-         elsif Warn_Chr in 'a' .. 'z' then
+         elsif Warn_Chr (2) = ' ' then
+            return "[-gnatw" & Warn_Chr (1) & ']';
+         else
             return "[-gnatw" & Warn_Chr & ']';
-         else pragma Assert (Warn_Chr in 'A' .. 'Z');
-            return "[-gnatw." & Fold_Lower (Warn_Chr) & ']';
          end if;
       else
          return "";
@@ -839,6 +841,51 @@
    procedure Prescan_Message (Msg : String) is
       J : Natural;
 
+      function Parse_Message_Class return String;
+      --  Convert the warning insertion sequence to a warning class represented
+      --  as a length-two string padded, if necessary, with spaces.
+      --  Return the Message class and set the iterator J to the character
+      --  following the sequence.
+      --  Raise a Program_Error if the insertion sequence is not valid.
+
+      -------------------------
+      -- Parse_Message_Class --
+      -------------------------
+
+      function Parse_Message_Class return String is
+         C : constant Character := Msg (J - 1);
+         Message_Class : String (1 .. 2) := "  ";
+      begin
+         if J <= Msg'Last and then Msg (J) = C then
+            Message_Class := "? ";
+            J := J + 1;
+
+         elsif J < Msg'Last and then Msg (J + 1) = C
+           and then Msg (J) in 'a' .. 'z' | '*' | '$'
+         then
+            Message_Class := Msg (J) & " ";
+            J := J + 2;
+
+         elsif J + 1 < Msg'Last and then Msg (J + 2) = C
+           and then Msg (J) in '.' | '_'
+           and then Msg (J + 1) in 'a' .. 'z'
+         then
+            Message_Class := Msg (J .. J + 1);
+            J := J + 3;
+         elsif (J < Msg'Last and then Msg (J + 1) = C) or else
+            (J + 1 < Msg'Last and then Msg (J + 2) = C)
+         then
+            raise Program_Error;
+         end if;
+
+         --  In any other cases, this is not a warning insertion sequence
+         --  and the default "  " value is returned.
+
+         return Message_Class;
+      end Parse_Message_Class;
+
+   --  Start of processing for Prescan_Message
+
    begin
       --  Nothing to do for continuation line, unless -gnatdF is set
 
@@ -846,7 +893,7 @@
          return;
 
       --  Some global variables are not set for continuation messages, as they
-      --  only make sense for the initial mesage.
+      --  only make sense for the initial message.
 
       elsif Msg (Msg'First) /= '\' then
 
@@ -898,29 +945,10 @@
 
          elsif Msg (J) = '?' or else Msg (J) = '<' then
             Is_Warning_Msg := Msg (J) = '?' or else Error_Msg_Warn;
-            Warning_Msg_Char := ' ';
             J := J + 1;
 
             if Is_Warning_Msg then
-               declare
-                  C : constant Character := Msg (J - 1);
-               begin
-                  if J <= Msg'Last then
-                     if Msg (J) = C then
-                        Warning_Msg_Char := '?';
-                        J := J + 1;
-
-                     elsif J < Msg'Last and then Msg (J + 1) = C
-                       and then (Msg (J) in 'a' .. 'z' or else
-                                 Msg (J) in 'A' .. 'Z' or else
-                                 Msg (J) = '*'         or else
-                                 Msg (J) = '$')
-                     then
-                        Warning_Msg_Char := Msg (J);
-                        J := J + 2;
-                     end if;
-                  end if;
-               end;
+               Warning_Msg_Char := Parse_Message_Class;
             end if;
 
             --  Bomb if untagged warning message. This code can be uncommented
@@ -1685,7 +1713,7 @@
 
                if SWE.Open then
                   Eproc.all
-                    ("?W?pragma Warnings Off with no matching Warnings On",
+                    ("?.w?pragma Warnings Off with no matching Warnings On",
                      SWE.Start);
 
                --  Warn for ineffective Warnings (Off, ..)
@@ -1700,7 +1728,7 @@
                    (SWE.Msg'Length > 3 and then SWE.Msg (2 .. 3) = "-W")
                then
                   Eproc.all
-                    ("?W?no warning suppressed by this pragma", SWE.Start);
+                    ("?.w?no warning suppressed by this pragma", SWE.Start);
                end if;
             end if;
          end;
diff --git a/gcc/ada/erroutc.ads b/gcc/ada/erroutc.ads
index 891391c..0c194e8 100644
--- a/gcc/ada/erroutc.ads
+++ b/gcc/ada/erroutc.ads
@@ -80,14 +80,14 @@
    --  Set True to indicate that the current message starts with one of
    --  "high: ", "medium: ", "low: " and is to be treated as a check message.
 
-   Warning_Msg_Char : Character;
-   --  Warning character, valid only if Is_Warning_Msg is True
-   --    ' '      -- ?   or <   appeared on its own in message
-   --    '?'      -- ??  or <<  appeared in message
-   --    'x'      -- ?x? or <x< appeared in message (x = a .. z)
-   --    'X'      -- ?X? or <X< appeared in message (X = A .. Z)
-   --    '*'      -- ?*? or <*< appeared in message
-   --    '$'      -- ?$? or <$< appeared in message
+   Warning_Msg_Char : String (1 .. 2);
+   --  Warning switch, valid only if Is_Warning_Msg is True
+   --    "  "      -- ?   or <   appeared on its own in message
+   --    "? "      -- ??  or <<  appeared in message
+   --    "x "      -- ?x? or <x< appeared in message
+   --              -- (x = a .. z | A .. Z | * | $)
+   --    ".x"      -- ?.x? appeared in message (x = a .. z | A .. Z)
+   --    "_x"      -- ?_x? appeared in message (x = a .. z | A .. Z)
    --  In the case of the < sequences, this is set only if the message is
    --  actually a warning, i.e. if Error_Msg_Warn is True
 
@@ -239,16 +239,8 @@
       --  True if this is a warning message which is to be treated as an error
       --  as a result of a match with a Warning_As_Error pragma.
 
-      Warn_Chr : Character;
-      --  Warning character (note: set even if Warning_Doc_Switch is False)
-      --    ' '      -- ?   or <   appeared on its own in message
-      --    '?'      -- ??  or <<  appeared in message
-      --    'x'      -- ?x? or <x< appeared in message (x = a .. z)
-      --    'X'      -- ?X? or <X< appeared in message (X = A .. Z)
-      --    '*'      -- ?*? or <*< appeared in message
-      --    '$'      -- ?$? or <$< appeared in message
-      --  In the case of the < sequences, this is set only if the message is
-      --  actually a warning, i.e. if Error_Msg_Warn is True
+      Warn_Chr : String (1 .. 2);
+      --  See Warning_Msg_Char
 
       Style : Boolean;
       --  True if style message (starts with "(style)")
diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb
index 71bad3c..f3d83a5 100644
--- a/gcc/ada/exp_aggr.adb
+++ b/gcc/ada/exp_aggr.adb
@@ -490,7 +490,7 @@
          --  Fat pointers are rejected as they are not really elementary
          --  for the backend.
 
-         if Csiz /= System_Address_Size then
+         if No (Csiz) or else Csiz /= System_Address_Size then
             return False;
          end if;
 
@@ -504,8 +504,7 @@
 
       --  Scalar types are OK if their size is a multiple of Storage_Unit
 
-      elsif Is_Scalar_Type (Ctyp) then
-         pragma Assert (Present (Csiz));
+      elsif Is_Scalar_Type (Ctyp) and then Present (Csiz) then
 
          if Csiz mod System_Storage_Unit /= 0 then
             return False;
@@ -3209,6 +3208,8 @@
          Init_Stmt : Node_Id;
 
       begin
+         pragma Assert (Nkind (Init_Expr) in N_Subexpr);
+
          --  Protect the initialization statements from aborts. Generate:
 
          --    Abort_Defer;
@@ -3793,6 +3794,26 @@
                 With_Default_Init => True,
                 Constructor_Ref   => Expression (Comp)));
 
+         elsif Box_Present (Comp)
+           and then Needs_Simple_Initialization (Etype (Selector))
+         then
+            Comp_Expr :=
+              Make_Selected_Component (Loc,
+                Prefix        => New_Copy_Tree (Target),
+                Selector_Name => New_Occurrence_Of (Selector, Loc));
+
+            Initialize_Record_Component
+              (Rec_Comp  => Comp_Expr,
+               Comp_Typ  => Etype (Selector),
+               Init_Expr => Get_Simple_Init_Val
+                              (Typ  => Etype (Selector),
+                               N    => Comp,
+                               Size =>
+                                 (if Known_Esize (Selector)
+                                  then Esize (Selector)
+                                  else Uint_0)),
+               Stmts     => L);
+
          --  Ada 2005 (AI-287): For each default-initialized component generate
          --  a call to the corresponding IP subprogram if available.
 
@@ -8547,10 +8568,6 @@
          Expr_Q : Node_Id;
 
       begin
-         if No (Comps) then
-            return True;
-         end if;
-
          C := First (Comps);
          while Present (C) loop
 
@@ -8901,46 +8918,41 @@
    ----------------------------
 
    function Has_Default_Init_Comps (N : Node_Id) return Boolean is
-      Comps : constant List_Id := Component_Associations (N);
-      C     : Node_Id;
+      Assoc : Node_Id;
       Expr  : Node_Id;
+      --  Component association and expression, respectively
 
    begin
       pragma Assert (Nkind (N) in N_Aggregate | N_Extension_Aggregate);
 
-      if No (Comps) then
-         return False;
-      end if;
-
       if Has_Self_Reference (N) then
          return True;
       end if;
 
-      --  Check if any direct component has default initialized components
+      Assoc := First (Component_Associations (N));
+      while Present (Assoc) loop
+         --  Each component association has either a box or an expression
 
-      C := First (Comps);
-      while Present (C) loop
-         if Box_Present (C) then
+         pragma Assert (Box_Present (Assoc) xor Present (Expression (Assoc)));
+
+         --  Check if any direct component has default initialized components
+
+         if Box_Present (Assoc) then
             return True;
+
+         --  Recursive call in case of aggregate expression
+
+         else
+            Expr := Expression (Assoc);
+
+            if Nkind (Expr) in N_Aggregate | N_Extension_Aggregate
+              and then Has_Default_Init_Comps (Expr)
+            then
+               return True;
+            end if;
          end if;
 
-         Next (C);
-      end loop;
-
-      --  Recursive call in case of aggregate expression
-
-      C := First (Comps);
-      while Present (C) loop
-         Expr := Expression (C);
-
-         if Present (Expr)
-           and then Nkind (Expr) in N_Aggregate | N_Extension_Aggregate
-           and then Has_Default_Init_Comps (Expr)
-         then
-            return True;
-         end if;
-
-         Next (C);
+         Next (Assoc);
       end loop;
 
       return False;
@@ -8987,11 +8999,8 @@
          Kind := Nkind (Node);
       end if;
 
-      if Kind not in N_Aggregate | N_Extension_Aggregate then
-         return False;
-      else
-         return Expansion_Delayed (Node);
-      end if;
+      return Kind in N_Aggregate | N_Extension_Aggregate
+        and then Expansion_Delayed (Node);
    end Is_Delayed_Aggregate;
 
    --------------------------------
@@ -9088,11 +9097,11 @@
    -----------------------------
 
    function Is_Two_Dim_Packed_Array (Typ : Entity_Id) return Boolean is
-      C : constant Int := UI_To_Int (Component_Size (Typ));
+      C : constant Uint := Component_Size (Typ);
    begin
       return Number_Dimensions (Typ) = 2
         and then Is_Bit_Packed_Array (Typ)
-        and then (C = 1 or else C = 2 or else C = 4);
+        and then C in Uint_1 | Uint_2 | Uint_4; -- False if No_Uint
    end Is_Two_Dim_Packed_Array;
 
    --------------------
diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb
index 096671f..19d8286 100644
--- a/gcc/ada/exp_attr.adb
+++ b/gcc/ada/exp_attr.adb
@@ -3898,8 +3898,8 @@
          if Ptyp = Standard_Exception_Type then
             Id_Kind := RTE (RE_Exception_Id);
 
-            if Present (Renamed_Object (Entity (Pref))) then
-               Set_Entity (Pref, Renamed_Object (Entity (Pref)));
+            if Present (Renamed_Entity (Entity (Pref))) then
+               Set_Entity (Pref, Renamed_Entity (Entity (Pref)));
             end if;
 
             Rewrite (N,
@@ -6294,7 +6294,7 @@
                --  size. This applies to both types and objects. The size of an
                --  object can be specified in the following ways:
 
-               --    An explicit size object is given for an object
+               --    An explicit size clause is given for an object
                --    A component size is specified for an indexed component
                --    A component clause is specified for a selected component
                --    The object is a component of a packed composite object
@@ -6310,7 +6310,7 @@
                                 or else Is_Packed (Etype (Prefix (Pref)))))
                  or else
                    (Nkind (Pref) = N_Indexed_Component
-                     and then (Component_Size (Etype (Prefix (Pref))) /= 0
+                     and then (Known_Component_Size (Etype (Prefix (Pref)))
                                 or else Is_Packed (Etype (Prefix (Pref)))))
                then
                   Set_Attribute_Name (N, Name_Size);
@@ -7970,7 +7970,6 @@
       elsif Id = Attribute_Size
         and then Is_Entity_Name (Pref)
         and then Is_Object (Entity (Pref))
-        and then Known_Esize (Entity (Pref))
         and then Known_Static_Esize (Entity (Pref))
       then
          Siz := Esize (Entity (Pref));
diff --git a/gcc/ada/exp_ch11.adb b/gcc/ada/exp_ch11.adb
index 40288e4..b8a9a8d 100644
--- a/gcc/ada/exp_ch11.adb
+++ b/gcc/ada/exp_ch11.adb
@@ -1667,8 +1667,8 @@
             --  If the exception is a renaming, use the exception that it
             --  renames (which might be a predefined exception, e.g.).
 
-            if Present (Renamed_Object (Id)) then
-               Id := Renamed_Object (Id);
+            if Present (Renamed_Entity (Id)) then
+               Id := Renamed_Entity (Id);
             end if;
 
             --  Build a C-compatible string in case of no exception handlers,
@@ -1861,10 +1861,10 @@
 
             if Configurable_Run_Time_Mode then
                Error_Msg_NE
-                 ("\?X?& may call Last_Chance_Handler", N, E);
+                 ("\?.x?& may call Last_Chance_Handler", N, E);
             else
                Error_Msg_NE
-                 ("\?X?& may result in unhandled exception", N, E);
+                 ("\?.x?& may result in unhandled exception", N, E);
             end if;
          end if;
       end;
@@ -2163,7 +2163,7 @@
          Warn_No_Exception_Propagation_Active (N);
 
          Error_Msg_N
-           ("\?X?this handler can never be entered, and has been removed", N);
+           ("\?.x?this handler can never be entered, and has been removed", N);
       end if;
    end Warn_If_No_Local_Raise;
 
@@ -2180,10 +2180,10 @@
 
          if Configurable_Run_Time_Mode then
             Error_Msg_N
-              ("\?X?Last_Chance_Handler will be called on exception", N);
+              ("\?.x?Last_Chance_Handler will be called on exception", N);
          else
             Error_Msg_N
-              ("\?X?execution may raise unhandled exception", N);
+              ("\?.x?execution may raise unhandled exception", N);
          end if;
       end if;
    end Warn_If_No_Propagation;
@@ -2195,7 +2195,7 @@
    procedure Warn_No_Exception_Propagation_Active (N : Node_Id) is
    begin
       Error_Msg_N
-        ("?X?pragma Restrictions (No_Exception_Propagation) in effect", N);
+        ("?.x?pragma Restrictions (No_Exception_Propagation) in effect", N);
    end Warn_No_Exception_Propagation_Active;
 
 end Exp_Ch11;
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index 418306f..00a6b6c 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -332,10 +332,9 @@
    --  no declarations and no statements.
 
    function Predef_Stream_Attr_Spec
-     (Loc      : Source_Ptr;
-      Tag_Typ  : Entity_Id;
-      Name     : TSS_Name_Type;
-      For_Body : Boolean := False) return Node_Id;
+     (Loc     : Source_Ptr;
+      Tag_Typ : Entity_Id;
+      Name    : TSS_Name_Type) return Node_Id;
    --  Specialized version of Predef_Spec_Or_Body that apply to read, write,
    --  input and output attribute whose specs are constructed in Exp_Strm.
 
@@ -943,11 +942,11 @@
         (Case_Id : Entity_Id;
          Variant : Node_Id) return Node_Id;
       --  Build a case statement containing only two alternatives. The first
-      --  alternative corresponds exactly to the discrete choices given on the
-      --  variant with contains the components that we are generating the
-      --  checks for. If the discriminant is one of these return False. The
-      --  second alternative is an OTHERS choice that will return True
-      --  indicating the discriminant did not match.
+      --  alternative corresponds to the discrete choices given on the variant
+      --  that contains the components that we are generating the checks
+      --  for. If the discriminant is one of these return False. The second
+      --  alternative is an OTHERS choice that returns True indicating the
+      --  discriminant did not match.
 
       function Build_Dcheck_Function
         (Case_Id : Entity_Id;
@@ -977,6 +976,7 @@
 
       begin
          Case_Node := New_Node (N_Case_Statement, Loc);
+         Set_End_Span (Case_Node, Uint_0);
 
          --  Replace the discriminant which controls the variant with the name
          --  of the formal of the checking function.
@@ -3206,9 +3206,7 @@
          --  types moving any expanded code from the spec to the body of the
          --  init procedure.
 
-         if Is_Task_Record_Type (Rec_Type)
-           or else Is_Protected_Record_Type (Rec_Type)
-         then
+         if Is_Concurrent_Record_Type (Rec_Type) then
             declare
                Decl : constant Node_Id :=
                         Parent (Corresponding_Concurrent_Type (Rec_Type));
@@ -3589,12 +3587,11 @@
                   end loop;
                end if;
             end;
-         end if;
 
          --  For a protected type, add statements generated by
          --  Make_Initialize_Protection.
 
-         if Is_Protected_Record_Type (Rec_Type) then
+         elsif Is_Protected_Record_Type (Rec_Type) then
             Append_List_To (Stmts,
               Make_Initialize_Protection (Rec_Type));
          end if;
@@ -10615,11 +10612,9 @@
       --    Disp_Requeue
       --    Disp_Timed_Select
 
-      --  Disable the generation of these bodies if No_Dispatching_Calls,
-      --  Ravenscar or ZFP is active.
+      --  Disable the generation of these bodies if Ravenscar or ZFP is active
 
       if Ada_Version >= Ada_2005
-        and then not Restriction_Active (No_Dispatching_Calls)
         and then not Restriction_Active (No_Select_Statements)
         and then RTE_Available (RE_Select_Specific_Data)
       then
@@ -10910,10 +10905,9 @@
    -----------------------------
 
    function Predef_Stream_Attr_Spec
-     (Loc      : Source_Ptr;
-      Tag_Typ  : Entity_Id;
-      Name     : TSS_Name_Type;
-      For_Body : Boolean := False) return Node_Id
+     (Loc     : Source_Ptr;
+      Tag_Typ : Entity_Id;
+      Name    : TSS_Name_Type) return Node_Id
    is
       Ret_Type : Entity_Id;
 
@@ -10931,7 +10925,7 @@
            Tag_Typ  => Tag_Typ,
            Profile  => Build_Stream_Attr_Profile (Loc, Tag_Typ, Name),
            Ret_Type => Ret_Type,
-           For_Body => For_Body);
+           For_Body => False);
    end Predef_Stream_Attr_Spec;
 
    ---------------------------------
@@ -10978,16 +10972,13 @@
          while Present (Prim) loop
             if Chars (Node (Prim)) = Name_Op_Eq
               and then not Is_Internal (Node (Prim))
-              and then Present (First_Entity (Node (Prim)))
 
               --  The predefined equality primitive must have exactly two
-              --  formals whose type is this tagged type
+              --  formals whose type is this tagged type.
 
-              and then Present (Last_Entity (Node (Prim)))
-              and then Next_Entity (First_Entity (Node (Prim)))
-                         = Last_Entity (Node (Prim))
-              and then Etype (First_Entity (Node (Prim))) = Tag_Typ
-              and then Etype (Last_Entity (Node (Prim))) = Tag_Typ
+              and then Number_Formals (Node (Prim)) = 2
+              and then Etype (First_Formal (Node (Prim))) = Tag_Typ
+              and then Etype (Last_Formal (Node (Prim))) = Tag_Typ
             then
                Eq_Needed := False;
                Eq_Name := No_Name;
@@ -11099,8 +11090,7 @@
 
       --  The interface versions will have null bodies
 
-      --  Disable the generation of these bodies if No_Dispatching_Calls,
-      --  Ravenscar or ZFP is active.
+      --  Disable the generation of these bodies if Ravenscar or ZFP is active
 
       --  In VM targets we define these primitives in all root tagged types
       --  that are not interface types. Done because in VM targets we don't
@@ -11109,7 +11099,6 @@
       --  they may be ancestors of synchronized interface types).
 
       if Ada_Version >= Ada_2005
-        and then not Is_Interface (Tag_Typ)
         and then
           ((Is_Interface (Etype (Tag_Typ))
              and then Is_Limited_Record (Etype (Tag_Typ)))
@@ -11119,7 +11108,6 @@
            or else
              (not Tagged_Type_Expansion
                and then Tag_Typ = Root_Type (Tag_Typ)))
-        and then not Restriction_Active (No_Dispatching_Calls)
         and then not Restriction_Active (No_Select_Statements)
         and then RTE_Available (RE_Select_Specific_Data)
       then
@@ -11131,7 +11119,7 @@
          Append_To (Res, Make_Disp_Timed_Select_Body        (Tag_Typ));
       end if;
 
-      if not Is_Limited_Type (Tag_Typ) and then not Is_Interface (Tag_Typ) then
+      if not Is_Limited_Type (Tag_Typ) then
 
          --  Body for equality
 
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index 8dcfa85..1eebde4 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -2583,7 +2583,7 @@
 
          return
            Make_Function_Call (Loc,
-             Name => New_Occurrence_Of (Eq_Op, Loc),
+             Name                   => New_Occurrence_Of (Eq_Op, Loc),
              Parameter_Associations =>
                New_List
                  (Unchecked_Convert_To (Etype (First_Formal (Eq_Op)), Lhs),
@@ -2606,7 +2606,7 @@
                begin
                   return
                     Make_Function_Call (Loc,
-                      Name                  => New_Occurrence_Of (Eq_Op, Loc),
+                      Name                   => New_Occurrence_Of (Eq_Op, Loc),
                       Parameter_Associations => New_List (
                         OK_Convert_To (T, Lhs),
                         OK_Convert_To (T, Rhs)));
@@ -4592,7 +4592,7 @@
                        and then Nkind (Associated_Node_For_Itype (PtrT)) =
                                   N_Object_Declaration)
       then
-         Error_Msg_N ("??use of an anonymous access type allocator", N);
+         Error_Msg_N ("?_a?use of an anonymous access type allocator", N);
       end if;
 
       --  RM E.2.2(17). We enforce that the expected type of an allocator
@@ -13116,41 +13116,35 @@
       ------------------------
 
       function Element_To_Compare (C : Entity_Id) return Entity_Id is
-         Comp : Entity_Id;
+         Comp : Entity_Id := C;
 
       begin
-         Comp := C;
-         loop
-            --  Exit loop when the next element to be compared is found, or
-            --  there is no more such element.
+         while Present (Comp) loop
+            --  Skip inherited components
 
-            exit when No (Comp);
+            --  Note: for a tagged type, we always generate the "=" primitive
+            --  for the base type (not on the first subtype), so the test for
+            --  Comp /= Original_Record_Component (Comp) is True for inherited
+            --  components only.
 
-            exit when Ekind (Comp) in E_Discriminant | E_Component
-              and then not (
-
-              --  Skip inherited components
-
-              --  Note: for a tagged type, we always generate the "=" primitive
-              --  for the base type (not on the first subtype), so the test for
-              --  Comp /= Original_Record_Component (Comp) is True for
-              --  inherited components only.
-
-              (Is_Tagged_Type (Typ)
+            if (Is_Tagged_Type (Typ)
                 and then Comp /= Original_Record_Component (Comp))
 
-              --  Skip _Tag
+            --  Skip _Tag
 
               or else Chars (Comp) = Name_uTag
 
-              --  Skip interface elements (secondary tags???)
+            --  Skip interface elements (secondary tags???)
 
-              or else Is_Interface (Etype (Comp)));
-
-            Next_Entity (Comp);
+              or else Is_Interface (Etype (Comp))
+            then
+               Next_Component_Or_Discriminant (Comp);
+            else
+               return Comp;
+            end if;
          end loop;
 
-         return Comp;
+         return Empty;
       end Element_To_Compare;
 
    --  Start of processing for Expand_Record_Equality
@@ -13166,7 +13160,7 @@
       --    and then Lhs.Cmpn = Rhs.Cmpn
 
       Result := New_Occurrence_Of (Standard_True, Loc);
-      C := Element_To_Compare (First_Entity (Typ));
+      C := Element_To_Compare (First_Component_Or_Discriminant (Typ));
       while Present (C) loop
          declare
             New_Lhs : Node_Id;
@@ -13224,7 +13218,7 @@
          end;
 
          First_Time := False;
-         C := Element_To_Compare (Next_Entity (C));
+         C := Element_To_Compare (Next_Component_Or_Discriminant (C));
       end loop;
 
       return Result;
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
index 21ac2a2..47c6b80 100644
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -2387,6 +2387,7 @@
             Ent := Name (N);
             while Nkind (Ent) in N_Has_Entity
               and then Present (Entity (Ent))
+              and then Is_Object (Entity (Ent))
               and then Present (Renamed_Object (Entity (Ent)))
             loop
                Ent := Renamed_Object (Entity (Ent));
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index ce0bb80..6015993 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -3143,6 +3143,13 @@
       function Can_Fold_Predicate_Call (P : Entity_Id) return Boolean is
          Actual : Node_Id;
 
+         function Augments_Other_Dynamic_Predicate (DP_Aspect_Spec : Node_Id)
+           return Boolean;
+         --  Given a Dynamic_Predicate aspect aspecification for a
+         --  discrete type, returns True iff another DP specification
+         --  applies (indirectly, via a subtype type or a derived type)
+         --  to the same entity that this aspect spec applies to.
+
          function May_Fold (N : Node_Id) return Traverse_Result;
          --  The predicate expression is foldable if it only contains operators
          --  and literals. During this check, we also replace occurrences of
@@ -3150,6 +3157,36 @@
          --  value of the actual. This is done on a copy of the analyzed
          --  expression for the predicate.
 
+         --------------------------------------
+         -- Augments_Other_Dynamic_Predicate --
+         --------------------------------------
+
+         function Augments_Other_Dynamic_Predicate (DP_Aspect_Spec : Node_Id)
+           return Boolean
+         is
+            Aspect_Bearer : Entity_Id := Entity (DP_Aspect_Spec);
+         begin
+            loop
+               Aspect_Bearer := Nearest_Ancestor (Aspect_Bearer);
+
+               if not Present (Aspect_Bearer) then
+                  return False;
+               end if;
+
+               declare
+                  Aspect_Spec : constant Node_Id :=
+                    Find_Aspect (Aspect_Bearer, Aspect_Dynamic_Predicate);
+               begin
+                  if Present (Aspect_Spec)
+                    and then Aspect_Spec /= DP_Aspect_Spec
+                  then
+                     --  Found another Dynamic_Predicate aspect spec
+                     return True;
+                  end if;
+               end;
+            end loop;
+         end Augments_Other_Dynamic_Predicate;
+
          --------------
          -- May_Fold --
          --------------
@@ -3192,7 +3229,7 @@
 
          function Try_Fold is new Traverse_Func (May_Fold);
 
-         --  Other lLocal variables
+         --  Other Local variables
 
          Subt   : constant Entity_Id := Etype (First_Entity (P));
          Aspect : Node_Id;
@@ -3220,6 +3257,11 @@
            or else Nkind (Actual) /= N_Integer_Literal
            or else not Has_Dynamic_Predicate_Aspect (Subt)
            or else No (Aspect)
+
+           --  Do not fold if multiple applicable predicate aspects
+           or else Present (Find_Aspect (Subt, Aspect_Static_Predicate))
+           or else Present (Find_Aspect (Subt, Aspect_Predicate))
+           or else Augments_Other_Dynamic_Predicate (Aspect)
            or else CodePeer_Mode
          then
             return False;
@@ -9665,7 +9707,9 @@
          --  At this point, Defining_Identifier (Obj_Decl) is no longer equal
          --  to Obj_Def_Id.
 
-         Set_Renamed_Object (Defining_Identifier (Obj_Decl), Call_Deref);
+         pragma Assert (Ekind (Defining_Identifier (Obj_Decl)) = E_Void);
+         Set_Renamed_Object_Of_Possibly_Void
+           (Defining_Identifier (Obj_Decl), Call_Deref);
 
          --  If the original entity comes from source, then mark the new
          --  entity as needing debug information, even though it's defined
diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb
index 71cad98..cd9ff21 100644
--- a/gcc/ada/exp_ch7.adb
+++ b/gcc/ada/exp_ch7.adb
@@ -3613,11 +3613,10 @@
         and then
           (not Is_Library_Level_Entity (Spec_Id)
 
-            --  Nested packages are considered to be library level entities,
-            --  but do not need to be processed separately. True library level
-            --  packages have a scope value of 1.
+            --  Nested packages are library level entities, but do not need to
+            --  be processed separately.
 
-            or else Scope_Depth_Value (Spec_Id) /= Uint_1
+            or else Scope_Depth (Spec_Id) /= Uint_1
             or else (Is_Generic_Instance (Spec_Id)
                       and then Package_Instantiation (Spec_Id) /= N))
 
@@ -8954,11 +8953,12 @@
       Typ       : Entity_Id;
       Skip_Self : Boolean := False) return Node_Id
    is
-      Loc    : constant Source_Ptr := Sloc (Obj_Ref);
-      Atyp   : Entity_Id;
-      Fin_Id : Entity_Id := Empty;
-      Ref    : Node_Id;
-      Utyp   : Entity_Id;
+      Loc      : constant Source_Ptr := Sloc (Obj_Ref);
+      Atyp     : Entity_Id;
+      Prot_Typ : Entity_Id := Empty;
+      Fin_Id   : Entity_Id := Empty;
+      Ref      : Node_Id;
+      Utyp     : Entity_Id;
 
    begin
       Ref := Obj_Ref;
@@ -9036,6 +9036,19 @@
          Set_Assignment_OK (Ref);
       end if;
 
+      --  Detect if Typ is a protected type or an expanded protected type and
+      --  store the relevant type within Prot_Typ for later processing.
+
+      if Is_Protected_Type (Typ) then
+         Prot_Typ := Typ;
+
+      elsif Ekind (Typ) = E_Record_Type
+        and then Present (Corresponding_Concurrent_Type (Typ))
+        and then Is_Protected_Type (Corresponding_Concurrent_Type (Typ))
+      then
+         Prot_Typ := Corresponding_Concurrent_Type (Typ);
+      end if;
+
       --  The underlying type may not be present due to a missing full view. In
       --  this case freezing did not take place and there is no [Deep_]Finalize
       --  primitive to call.
@@ -9081,7 +9094,7 @@
       --  Protected types: these also require finalization even though they
       --  are not marked controlled explicitly.
 
-      elsif Is_Protected_Type (Typ) then
+      elsif Present (Prot_Typ) then
          --  Protected objects do not need to be finalized on restricted
          --  runtimes.
 
@@ -9091,7 +9104,7 @@
          --  ??? Only handle the simple case for now. Will not support a record
          --  or array containing protected objects.
 
-         elsif Is_Simple_Protected_Type (Typ) then
+         elsif Is_Simple_Protected_Type (Prot_Typ) then
             Fin_Id := RTE (RE_Finalize_Protection);
          else
             raise Program_Error;
diff --git a/gcc/ada/exp_dbug.adb b/gcc/ada/exp_dbug.adb
index 96d78cc..19d546e 100644
--- a/gcc/ada/exp_dbug.adb
+++ b/gcc/ada/exp_dbug.adb
@@ -290,6 +290,11 @@
    --------------------------------
 
    function Debug_Renaming_Declaration (N : Node_Id) return Node_Id is
+      pragma Assert
+        (Nkind (N) in N_Object_Renaming_Declaration
+                    | N_Package_Renaming_Declaration
+                    | N_Exception_Renaming_Declaration);
+
       Loc : constant Source_Ptr := Sloc (N);
       Ent : constant Node_Id    := Defining_Entity (N);
       Nam : constant Node_Id    := Name (N);
@@ -410,7 +415,7 @@
                | N_Identifier
             =>
                if No (Entity (Ren))
-                 or else not Present (Renamed_Object (Entity (Ren)))
+                 or else not Present (Renamed_Entity_Or_Object (Entity (Ren)))
                then
                   exit;
                end if;
@@ -418,7 +423,7 @@
                --  This is a renaming of a renaming: traverse until the final
                --  renaming to see if anything is packed along the way.
 
-               Ren := Renamed_Object (Entity (Ren));
+               Ren := Renamed_Entity_Or_Object (Entity (Ren));
 
             when N_Selected_Component =>
                declare
diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb
index 6ade54b..88f11b2 100644
--- a/gcc/ada/exp_disp.adb
+++ b/gcc/ada/exp_disp.adb
@@ -3037,7 +3037,7 @@
    begin
       pragma Assert (not Restriction_Active (No_Dispatching_Calls));
 
-      --  Null body is generated for interface types and non-concurrent
+      --  Null body is generated for interface types and nonconcurrent
       --  tagged types.
 
       if Is_Interface (Typ)
diff --git a/gcc/ada/exp_disp.ads b/gcc/ada/exp_disp.ads
index 9d9811b..f286763 100644
--- a/gcc/ada/exp_disp.ads
+++ b/gcc/ada/exp_disp.ads
@@ -373,9 +373,9 @@
    --  target object in its first argument; such implicit argument is explicit
    --  in the IP procedures built here.
 
-   procedure Set_DT_Position_Value (Prim  : Entity_Id; Value : Uint);
-   --  Set the position of a dispatching primitive its dispatch table. For
-   --  subprogram wrappers propagate the value to the wrapped subprogram.
+   procedure Set_DT_Position_Value (Prim : Entity_Id; Value : Uint);
+   --  Set the position of a dispatching primitive in its dispatch table.
+   --  For subprogram wrappers propagate the value to the wrapped subprogram.
 
    procedure Set_DTC_Entity_Value (Tagged_Type : Entity_Id; Prim : Entity_Id);
    --  Set the definite value of the DTC_Entity value associated with a given
diff --git a/gcc/ada/exp_dist.adb b/gcc/ada/exp_dist.adb
index 5cb8fb5..41c0aea 100644
--- a/gcc/ada/exp_dist.adb
+++ b/gcc/ada/exp_dist.adb
@@ -300,12 +300,9 @@
       NVList      : Entity_Id;
       Parameter   : Entity_Id;
       Constrained : Boolean;
-      RACW_Ctrl   : Boolean := False;
       Any         : Entity_Id) return Node_Id;
    --  Return a call to Add_Item to add the Any corresponding to the designated
    --  formal Parameter (with the indicated Constrained status) to NVList.
-   --  RACW_Ctrl must be set to True for controlling formals of distributed
-   --  object primitive operations.
 
    --------------------
    -- Stub_Structure --
@@ -1089,7 +1086,6 @@
       NVList      : Entity_Id;
       Parameter   : Entity_Id;
       Constrained : Boolean;
-      RACW_Ctrl   : Boolean := False;
       Any         : Entity_Id) return Node_Id
    is
       Parameter_Name_String : String_Id;
@@ -1146,7 +1142,7 @@
 
       Parameter_Name_String := String_From_Name_Buffer;
 
-      if RACW_Ctrl or else Nkind (Parameter) = N_Defining_Identifier then
+      if Nkind (Parameter) = N_Defining_Identifier then
 
          --  When the parameter passed to Add_Parameter_To_NVList is an
          --  Extra_Constrained parameter, Parameter is an N_Defining_
diff --git a/gcc/ada/exp_fixd.adb b/gcc/ada/exp_fixd.adb
index 8d7624f..94a61df 100644
--- a/gcc/ada/exp_fixd.adb
+++ b/gcc/ada/exp_fixd.adb
@@ -190,6 +190,15 @@
    --  The expression returned is neither analyzed nor resolved. The Etype
    --  of the result is properly set (to Universal_Real).
 
+   function Get_Size_For_Value (V : Uint) return Pos;
+   --  Given a non-negative universal integer value, return the size of a small
+   --  signed integer type covering -V .. V, or Pos'Max if no such type exists.
+
+   function Get_Type_For_Size (Siz : Pos; Force : Boolean) return Entity_Id;
+   --  Return the smallest signed integer type containing at least Siz bits.
+   --  If no such type exists, return Empty if Force is False or the largest
+   --  signed integer type if Force is True.
+
    function Integer_Literal
      (N        : Node_Id;
       V        : Uint;
@@ -324,7 +333,6 @@
       Right_Type  : constant Entity_Id  := Base_Type (Etype (R));
       Left_Size   : Int;
       Right_Size  : Int;
-      Rsize       : Int;
       Result_Type : Entity_Id;
       Rnode       : Node_Id;
 
@@ -354,20 +362,17 @@
          --  the effective size of an operand is the RM_Size of the operand.
          --  But a special case arises with operands whose size is known at
          --  compile time. In this case, we can use the actual value of the
-         --  operand to get its size if it would fit in signed 8/16/32 bits.
+         --  operand to get a size if it would fit in a small signed integer.
 
          Left_Size := UI_To_Int (RM_Size (Left_Type));
 
          if Compile_Time_Known_Value (L) then
             declare
-               Val : constant Uint := Expr_Value (L);
+               Siz : constant Int :=
+                       Get_Size_For_Value (UI_Abs (Expr_Value (L)));
             begin
-               if Val < Uint_2 ** 7 then
-                  Left_Size := 8;
-               elsif Val < Uint_2 ** 15 then
-                  Left_Size := 16;
-               elsif Val < Uint_2 ** 31 then
-                  Left_Size := 32;
+               if Siz < Left_Size then
+                  Left_Size := Siz;
                end if;
             end;
          end if;
@@ -376,35 +381,19 @@
 
          if Compile_Time_Known_Value (R) then
             declare
-               Val : constant Uint := Expr_Value (R);
+               Siz : constant Int :=
+                       Get_Size_For_Value (UI_Abs (Expr_Value (R)));
             begin
-               if Val <= Int'(2 ** 7) then
-                  Right_Size := 8;
-               elsif Val <= Int'(2 ** 15) then
-                  Right_Size := 16;
+               if Siz < Right_Size then
+                  Right_Size := Siz;
                end if;
             end;
          end if;
 
          --  Do the operation using the longer of the two sizes
 
-         Rsize := Int'Max (Left_Size, Right_Size);
-
-         if Rsize <= 8 then
-            Result_Type := Standard_Integer_8;
-
-         elsif Rsize <= 16 then
-            Result_Type := Standard_Integer_16;
-
-         elsif Rsize <= 32 then
-            Result_Type := Standard_Integer_32;
-
-         elsif Rsize <= 64 or else System_Max_Integer_Size < 128 then
-            Result_Type := Standard_Integer_64;
-
-         else
-            Result_Type := Standard_Integer_128;
-         end if;
+         Result_Type :=
+           Get_Type_For_Size (Int'Max (Left_Size, Right_Size), Force => True);
 
          Rnode :=
             Make_Op_Divide (Loc,
@@ -664,7 +653,6 @@
       Right_Type  : constant Entity_Id  := Etype (R);
       Left_Size   : Int;
       Right_Size  : Int;
-      Rsize       : Int;
       Result_Type : Entity_Id;
       Rnode       : Node_Id;
 
@@ -697,20 +685,17 @@
          --  the effective size of an operand is the RM_Size of the operand.
          --  But a special case arises with operands whose size is known at
          --  compile time. In this case, we can use the actual value of the
-         --  operand to get its size if it would fit in signed 8/16/32 bits.
+         --  operand to get a size if it would fit in a small signed integer.
 
          Left_Size := UI_To_Int (RM_Size (Left_Type));
 
          if Compile_Time_Known_Value (L) then
             declare
-               Val : constant Uint := Expr_Value (L);
+               Siz : constant Int :=
+                       Get_Size_For_Value (UI_Abs (Expr_Value (L)));
             begin
-               if Val < Uint_2 ** 7 then
-                  Left_Size := 8;
-               elsif Val < Uint_2 ** 15 then
-                  Left_Size := 16;
-               elsif Val < Uint_2 ** 31 then
-                  Left_Size := 32;
+               if Siz < Left_Size then
+                  Left_Size := Siz;
                end if;
             end;
          end if;
@@ -719,12 +704,11 @@
 
          if Compile_Time_Known_Value (R) then
             declare
-               Val : constant Uint := Expr_Value (R);
+               Siz : constant Int :=
+                       Get_Size_For_Value (UI_Abs (Expr_Value (R)));
             begin
-               if Val <= Int'(2 ** 7) then
-                  Right_Size := 8;
-               elsif Val <= Int'(2 ** 15) then
-                  Right_Size := 16;
+               if Siz < Right_Size then
+                  Right_Size := Siz;
                end if;
             end;
          end if;
@@ -732,23 +716,8 @@
          --  Now the result size must be at least the sum of the two sizes,
          --  to accommodate all possible results.
 
-         Rsize := Left_Size + Right_Size;
-
-         if Rsize <= 8 then
-            Result_Type := Standard_Integer_8;
-
-         elsif Rsize <= 16 then
-            Result_Type := Standard_Integer_16;
-
-         elsif Rsize <= 32 then
-            Result_Type := Standard_Integer_32;
-
-         elsif Rsize <= 64 or else System_Max_Integer_Size < 128 then
-            Result_Type := Standard_Integer_64;
-
-         else
-            Result_Type := Standard_Integer_128;
-         end if;
+         Result_Type :=
+           Get_Type_For_Size (Left_Size + Right_Size, Force => True);
 
          Rnode :=
             Make_Op_Multiply (Loc,
@@ -1542,7 +1511,7 @@
 
       else
          Lit_Int := Integer_Literal (N, Frac_Den, UR_Is_Negative (Frac));
-         Lit_K   := Integer_Literal (N, Frac_Num);
+         Lit_K   := Integer_Literal (N, Frac_Num, False);
 
          if Present (Lit_Int) and then Present (Lit_K) then
             Set_Result (N, Build_Scaled_Divide (N, Left, Lit_K, Lit_Int));
@@ -2422,6 +2391,64 @@
       return Build_Conversion (N, Universal_Real, N);
    end Fpt_Value;
 
+   ------------------------
+   -- Get_Size_For_Value --
+   ------------------------
+
+   function Get_Size_For_Value (V : Uint) return Pos is
+   begin
+      pragma Assert (V >= Uint_0);
+
+      if V < Uint_2 ** 7 then
+         return 8;
+
+      elsif V < Uint_2 ** 15 then
+         return 16;
+
+      elsif V < Uint_2 ** 31 then
+         return 32;
+
+      elsif V < Uint_2 ** 63 then
+         return 64;
+
+      elsif V < Uint_2 ** 127 then
+         return 128;
+
+      else
+         return Pos'Last;
+      end if;
+   end Get_Size_For_Value;
+
+   -----------------------
+   -- Get_Type_For_Size --
+   -----------------------
+
+   function Get_Type_For_Size (Siz : Pos; Force : Boolean) return Entity_Id is
+   begin
+      if Siz <= 8 then
+         return Standard_Integer_8;
+
+      elsif Siz <= 16 then
+         return Standard_Integer_16;
+
+      elsif Siz <= 32 then
+         return Standard_Integer_32;
+
+      elsif Siz <= 64
+        or else (Force and then System_Max_Integer_Size < 128)
+      then
+         return Standard_Integer_64;
+
+      elsif (Siz <= 128 and then System_Max_Integer_Size = 128)
+        or else Force
+      then
+         return Standard_Integer_128;
+
+      else
+         return Empty;
+      end if;
+   end Get_Type_For_Size;
+
    ---------------------
    -- Integer_Literal --
    ---------------------
@@ -2435,22 +2462,8 @@
       L : Node_Id;
 
    begin
-      if V < Uint_2 ** 7 then
-         T := Standard_Integer_8;
-
-      elsif V < Uint_2 ** 15 then
-         T := Standard_Integer_16;
-
-      elsif V < Uint_2 ** 31 then
-         T := Standard_Integer_32;
-
-      elsif V < Uint_2 ** 63 then
-         T := Standard_Integer_64;
-
-      elsif V < Uint_2 ** 127 and then System_Max_Integer_Size = 128 then
-         T := Standard_Integer_128;
-
-      else
+      T := Get_Type_For_Size (Get_Size_For_Value (V), Force => False);
+      if No (T) then
          return Empty;
       end if;
 
diff --git a/gcc/ada/exp_intr.adb b/gcc/ada/exp_intr.adb
index 86cb702..c139bb4 100644
--- a/gcc/ada/exp_intr.adb
+++ b/gcc/ada/exp_intr.adb
@@ -325,7 +325,7 @@
       Result_Typ := Class_Wide_Type (Etype (Act_Constr));
 
       --  Check that the accessibility level of the tag is no deeper than that
-      --  of the constructor function (unless CodePeer_Mode)
+      --  of the constructor function (unless CodePeer_Mode).
 
       if not CodePeer_Mode then
          Insert_Action (N,
@@ -335,7 +335,8 @@
                  Left_Opnd  =>
                    Build_Get_Access_Level (Loc, New_Copy_Tree (Tag_Arg)),
                  Right_Opnd =>
-                   Make_Integer_Literal (Loc, Scope_Depth (Act_Constr))),
+                   Make_Integer_Literal
+                     (Loc, Scope_Depth_Default_0 (Act_Constr))),
 
              Then_Statements => New_List (
                Make_Raise_Statement (Loc,
diff --git a/gcc/ada/exp_prag.adb b/gcc/ada/exp_prag.adb
index 27b4e7d..f0b4b0b 100644
--- a/gcc/ada/exp_prag.adb
+++ b/gcc/ada/exp_prag.adb
@@ -563,9 +563,9 @@
             null;
 
          elsif Nam = Name_Assert then
-            Error_Msg_N ("?A?assertion will fail at run time", N);
+            Error_Msg_N ("?.a?assertion will fail at run time", N);
          else
-            Error_Msg_N ("?A?check will fail at run time", N);
+            Error_Msg_N ("?.a?check will fail at run time", N);
          end if;
       end if;
    end Expand_Pragma_Check;
diff --git a/gcc/ada/exp_spark.adb b/gcc/ada/exp_spark.adb
index bbfee62..bce745b 100644
--- a/gcc/ada/exp_spark.adb
+++ b/gcc/ada/exp_spark.adb
@@ -451,6 +451,7 @@
                Apply_Universal_Integer_Attribute_Checks (N);
 
                if Present (Typ)
+                 and then Known_RM_Size (Typ)
                  and then RM_Size (Typ) = RM_Size (Standard_Long_Long_Integer)
                then
                   --  ??? This should rather be a range check, but this would
diff --git a/gcc/ada/exp_strm.adb b/gcc/ada/exp_strm.adb
index c87b881..8983dab1c 100644
--- a/gcc/ada/exp_strm.adb
+++ b/gcc/ada/exp_strm.adb
@@ -624,7 +624,7 @@
          end if;
 
       else pragma Assert (Is_Access_Type (U_Type));
-         if P_Size > System_Address_Size then
+         if Present (P_Size) and then P_Size > System_Address_Size then
             Lib_RE := RE_I_AD;
          else
             Lib_RE := RE_I_AS;
@@ -868,7 +868,7 @@
 
       else pragma Assert (Is_Access_Type (U_Type));
 
-         if P_Size > System_Address_Size then
+         if Present (P_Size) and then P_Size > System_Address_Size then
             Lib_RE := RE_W_AD;
          else
             Lib_RE := RE_W_AS;
diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb
index c071a9c..be06580 100644
--- a/gcc/ada/exp_unst.adb
+++ b/gcc/ada/exp_unst.adb
@@ -270,7 +270,9 @@
    begin
       pragma Assert (Is_Subprogram (E));
 
-      if Subps_Index (E) = Uint_0 then
+      if Field_Is_Initial_Zero (E, F_Subps_Index)
+        or else Subps_Index (E) = Uint_0
+      then
          E := Ultimate_Alias (E);
 
          --  The body of a protected operation has a different name and
@@ -886,6 +888,7 @@
                      if Is_Subprogram (Ent)
                        and then not Is_Generic_Subprogram (Ent)
                        and then not Is_Imported (Ent)
+                       and then not Is_Intrinsic_Subprogram (Ent)
                        and then Scope_Within (Ultimate_Alias (Ent), Subp)
                      then
                         Append_Unique_Call ((N, Current_Subprogram, Ent));
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index cb18096..b0ea44a 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -315,10 +315,10 @@
 
          if Present (Msg_Node) then
             Error_Msg_N
-              ("info: atomic synchronization set for &?N?", Msg_Node);
+              ("info: atomic synchronization set for &?.n?", Msg_Node);
          else
             Error_Msg_N
-              ("info: atomic synchronization set?N?", N);
+              ("info: atomic synchronization set?.n?", N);
          end if;
       end if;
    end Activate_Atomic_Synchronization;
@@ -1293,7 +1293,7 @@
             Adjust_Inherited_Pragma_Sloc (N);
          end if;
 
-         if Nkind (N) in N_Identifier | N_Operator_Symbol
+         if Nkind (N) in N_Identifier | N_Expanded_Name | N_Operator_Symbol
            and then Present (Entity (N))
            and then
              (Is_Formal (Entity (N)) or else Is_Subprogram (Entity (N)))
@@ -2849,7 +2849,7 @@
          if Inherited and Opt.List_Inherited_Aspects then
             Error_Msg_Sloc := Sloc (Prag);
             Error_Msg_N
-              ("info: & inherits `Invariant''Class` aspect from #?L?", Typ);
+              ("info: & inherits `Invariant''Class` aspect from #?.l?", Typ);
          end if;
 
          --  Add the pragma to the list of processed pragmas
@@ -4784,7 +4784,8 @@
       --  record or bit-packed array, then everything is fine, since the back
       --  end can handle these cases correctly.
 
-      elsif Esize (Comp) <= System_Max_Integer_Size
+      elsif Known_Esize (Comp)
+        and then Esize (Comp) <= System_Max_Integer_Size
         and then (Is_Record_Type (UT) or else Is_Bit_Packed_Array (UT))
       then
          return False;
@@ -7619,8 +7620,18 @@
                | N_Iterated_Component_Association
                | N_Iterated_Element_Association
             =>
-               if Nkind (Parent (P)) = N_Aggregate
-                 and then Present (Loop_Actions (P))
+               if Nkind (Parent (P)) in N_Aggregate | N_Delta_Aggregate
+
+                 --  We must not climb up out of an N_Iterated_xxx_Association
+                 --  because the actions might contain references to the loop
+                 --  parameter. But it turns out that setting the Loop_Actions
+                 --  attribute in the case of an N_Component_Association
+                 --  when the attribute was not already set can lead to
+                 --  (as yet not understood) bugboxes (gcc failures that are
+                 --  presumably due to malformed trees). So we don't do that.
+
+                 and then (Nkind (P) /= N_Component_Association
+                            or else Present (Loop_Actions (P)))
                then
                   if Is_Empty_List (Loop_Actions (P)) then
                      Set_Loop_Actions (P, Ins_Actions);
@@ -7994,10 +8005,8 @@
    ----------------------
 
    function Inside_Init_Proc return Boolean is
-      Proc : constant Entity_Id := Enclosing_Init_Proc;
-
    begin
-      return Proc /= Empty;
+      return Present (Enclosing_Init_Proc);
    end Inside_Init_Proc;
 
    ----------------------
@@ -11248,6 +11257,7 @@
 
          when others =>
             if Is_Entity_Name (N)
+              and then Is_Object (Entity (N))
               and then Present (Renamed_Object (Entity (N)))
             then
                return
diff --git a/gcc/ada/expander.adb b/gcc/ada/expander.adb
index e0483b7..75c0edb 100644
--- a/gcc/ada/expander.adb
+++ b/gcc/ada/expander.adb
@@ -49,6 +49,7 @@
 with Sem_Util;       use Sem_Util;
 with Sinfo;          use Sinfo;
 with Sinfo.Nodes;    use Sinfo.Nodes;
+with Stand;          use Stand;
 with Table;
 
 package body Expander is
@@ -152,7 +153,19 @@
       --  not take place. This prevents cascaded errors due to stack mismatch.
 
       elsif not Expander_Active then
-         Set_Analyzed (N, Full_Analysis);
+
+         --  Do not clear the Analyzed flag if it has been set on purpose
+         --  during preanalysis in Fold_Ureal. In that case, the Etype field
+         --  in N_Real_Literal will be set to something different than
+         --  Universal_Real.
+
+         if Full_Analysis
+           or else not (Nkind (N) = N_Real_Literal
+                          and then Present (Etype (N))
+                          and then Etype (N) /= Universal_Real)
+         then
+            Set_Analyzed (N, Full_Analysis);
+         end if;
 
          if Serious_Errors_Detected > 0 and then Scope_Is_Transient then
             Scope_Stack.Table
diff --git a/gcc/ada/fe.h b/gcc/ada/fe.h
index 957f40b..67cc218 100644
--- a/gcc/ada/fe.h
+++ b/gcc/ada/fe.h
@@ -260,6 +260,8 @@
   restrict__check_no_implicit_task_alloc
 #define No_Exception_Handlers_Set	\
   restrict__no_exception_handlers_set
+#define No_Exception_Propagation_Active	\
+  restrict__no_exception_propagation_active
 
 extern void Check_Elaboration_Code_Allowed	(Node_Id);
 extern void Check_Implicit_Dynamic_Code_Allowed	(Node_Id);
@@ -267,6 +269,7 @@
 extern void Check_No_Implicit_Protected_Alloc	(Node_Id);
 extern void Check_No_Implicit_Task_Alloc	(Node_Id);
 extern Boolean No_Exception_Handlers_Set	(void);
+extern Boolean No_Exception_Propagation_Active	(void);
 
 /* sem_aggr:  */
 
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
index 5f81d9e..97a51db 100644
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -865,9 +865,12 @@
                Error_Msg_NE (Size_Too_Small_Message, Size_Clause (T), T);
             end if;
 
-         --  Set size if not set already
+         --  Set size if not set already. Do not set it to Uint_0, because in
+         --  some cases (notably array-of-record), the Component_Size is
+         --  No_Uint, which causes S to be Uint_0. Presumably the RM_Size and
+         --  Component_Size will eventually be set correctly by the back end.
 
-         elsif not Known_RM_Size (T) then
+         elsif not Known_RM_Size (T) and then S /= Uint_0 then
             Set_RM_Size (T, S);
          end if;
       end Set_Small_Size;
@@ -899,8 +902,17 @@
             --  String literals always have known size, and we can set it
 
             if Ekind (T) = E_String_Literal_Subtype then
-               Set_Small_Size
-                 (T, Component_Size (T) * String_Literal_Length (T));
+               if Known_Component_Size (T) then
+                  Set_Small_Size
+                    (T, Component_Size (T) * String_Literal_Length (T));
+
+               else
+                  --  The following is wrong, but does what previous versions
+                  --  did. The Component_Size is unknown for the string in a
+                  --  pragma Warnings.
+                  Set_Small_Size (T, Uint_0);
+               end if;
+
                return True;
 
             --  Unconstrained types never have known at compile time size
@@ -932,6 +944,12 @@
                Dim   : Uint;
 
             begin
+               --  See comment in Set_Small_Size above
+
+               if No (Size) then
+                  Size := Uint_0;
+               end if;
+
                Index := First_Index (T);
                while Present (Index) loop
                   if Nkind (Index) = N_Range then
@@ -954,7 +972,7 @@
                   else
                      Dim := Expr_Value (High) - Expr_Value (Low) + 1;
 
-                     if Dim >= 0 then
+                     if Dim > Uint_0 then
                         Size := Size * Dim;
                      else
                         Size := Uint_0;
@@ -2319,7 +2337,7 @@
             --  created for entry parameters must be frozen.
 
             if Ekind (E) = E_Package
-              and then No (Renamed_Object (E))
+              and then No (Renamed_Entity (E))
               and then not Is_Child_Unit (E)
               and then not Is_Frozen (E)
             then
@@ -3353,7 +3371,7 @@
 
                            Error_Msg_Uint_1 := Modv;
                            Error_Msg_N
-                             ("?M?2 '*'*^' may have been intended here",
+                             ("?.m?2 '*'*^' may have been intended here",
                               Modulus);
                         end;
                      end if;
@@ -3703,6 +3721,7 @@
                      if Has_Pragma_Pack (Arr)
                        and then not Present (Comp_Size_C)
                        and then (Csiz = 7 or else Csiz = 15 or else Csiz = 31)
+                       and then Known_Esize (Base_Type (Ctyp))
                        and then Esize (Base_Type (Ctyp)) = Csiz + 1
                      then
                         Error_Msg_Uint_1 := Csiz;
@@ -6393,7 +6412,7 @@
                         then
                            Error_Msg_NE
                              ("useless postcondition, & is marked "
-                              & "No_Return?T?", Exp, E);
+                              & "No_Return?.t?", Exp, E);
                         end if;
                      end if;
 
@@ -6646,7 +6665,7 @@
 
                         Dim := Expr_Value (Hi) - Expr_Value (Lo) + 1;
 
-                        if Dim >= 0 then
+                        if Dim > Uint_0 then
                            Num_Elmts := Num_Elmts * Dim;
                         else
                            Num_Elmts := Uint_0;
@@ -6668,9 +6687,12 @@
                         if Implicit_Packing then
                            Set_Component_Size (Btyp, Rsiz);
 
-                        --  Otherwise give an error message
+                        --  Otherwise give an error message, except that if the
+                        --  specified Size is zero, there is no need for pragma
+                        --  Pack. Note that size zero is not considered
+                        --  Addressable.
 
-                        else
+                        elsif RM_Size (E) /= Uint_0 then
                            Error_Msg_NE
                              ("size given for& too small", SZ, E);
                            Error_Msg_N -- CODEFIX
@@ -6771,24 +6793,24 @@
                   if Sloc (SC) > Sloc (AC) then
                      Loc := SC;
                      Error_Msg_NE
-                       ("?Z?size is not a multiple of alignment for &",
+                       ("?.z?size is not a multiple of alignment for &",
                         Loc, E);
                      Error_Msg_Sloc := Sloc (AC);
                      Error_Msg_Uint_1 := Alignment (E);
-                     Error_Msg_N ("\?Z?alignment of ^ specified #", Loc);
+                     Error_Msg_N ("\?.z?alignment of ^ specified #", Loc);
 
                   else
                      Loc := AC;
                      Error_Msg_NE
-                       ("?Z?size is not a multiple of alignment for &",
+                       ("?.z?size is not a multiple of alignment for &",
                         Loc, E);
                      Error_Msg_Sloc := Sloc (SC);
                      Error_Msg_Uint_1 := RM_Size (E);
-                     Error_Msg_N ("\?Z?size of ^ specified #", Loc);
+                     Error_Msg_N ("\?.z?size of ^ specified #", Loc);
                   end if;
 
                   Error_Msg_Uint_1 := ((RM_Size (E) / Abits) + 1) * Abits;
-                  Error_Msg_N ("\?Z?Object_Size will be increased to ^", Loc);
+                  Error_Msg_N ("\?.z?Object_Size will be increased to ^", Loc);
                end if;
             end;
          end if;
@@ -9478,9 +9500,7 @@
          Minsiz : constant Uint := UI_From_Int (Minimum_Size (Typ));
 
       begin
-         if Known_RM_Size (Typ)
-           and then RM_Size (Typ) /= Uint_0
-         then
+         if Known_RM_Size (Typ) then
             if RM_Size (Typ) < Minsiz then
                Error_Msg_Uint_1 := RM_Size (Typ);
                Error_Msg_Uint_2 := Minsiz;
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index 61a627f..ba194d1 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -116,7 +116,7 @@
 
 # List of Ada tools to build and install
 ADA_TOOLS=gnatbind gnatchop gnat gnatkr gnatlink gnatls gnatmake \
-          gnatname gnatprep gnatxref gnatfind gnatclean
+          gnatname gnatprep gnatclean
 
 # Say how to compile Ada programs.
 .SUFFIXES: .ada .adb .ads
@@ -838,8 +838,20 @@
 	$(DESTDIR)$(infodir)/gnat_rm.info \
 	$(DESTDIR)$(infodir)/gnat-style.info
 
-ada.dvi: doc/gnat_ugn.dvi \
-      doc/gnat_rm.dvi doc/gnat-style.dvi
+ADA_DVIFILES = doc/gnat_ugn.dvi \
+               doc/gnat_rm.dvi doc/gnat-style.dvi
+
+ada.dvi: $(ADA_DVIFILES)
+
+ada.install-dvi: $(ADA_DVIFILES)
+	@$(NORMAL_INSTALL)
+	test -z "$(dvidir)/gcc" || $(mkinstalldirs) "$(DESTDIR)$(dvidir)/gcc"
+	@list='$(ADA_DVIFILES)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(dvi__strip_dir) \
+	  echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(dvidir)/gcc/$$f'"; \
+	  $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(dvidir)/gcc/$$f"; \
+	done
 
 ADA_PDFFILES = doc/gnat_ugn.pdf \
                doc/gnat_rm.pdf doc/gnat-style.pdf
@@ -891,8 +903,7 @@
 # (cross). $(prefix) comes from the --program-prefix configure option,
 # or from the --target option if the former is not specified.
 # Do the same for the rest of the Ada tools (gnatchop, gnat, gnatkr,
-# gnatlink, gnatls, gnatmake, gnatname, gnatprep, gnatxref, gnatfind,
-# gnatclean).
+# gnatlink, gnatls, gnatmake, gnatname, gnatprep, gnatclean).
 # gnatdll is only used on Windows.
 ada.install-common: $(gnat_install_lib) gnat-install-tools
 
@@ -963,8 +974,6 @@
 	-$(RM) gnatmake$(exeext)
 	-$(RM) gnatname$(exeext)
 	-$(RM) gnatprep$(exeext)
-	-$(RM) gnatfind$(exeext)
-	-$(RM) gnatxref$(exeext)
 	-$(RM) gnatclean$(exeext)
 	-$(RM) ada/rts/*
 	-$(RMDIR) ada/rts
diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
index 4ab71977..9df8809 100644
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -449,7 +449,7 @@
 common-tools: ../stamp-tools
 	$(GNATMAKE) -j0 -c -b $(ADA_INCLUDES) \
 	  --GNATBIND="$(GNATBIND)" --GCC="$(CC) $(ALL_ADAFLAGS)" \
-	  gnatchop gnatcmd gnatkr gnatls gnatprep gnatxref gnatfind gnatname \
+	  gnatchop gnatcmd gnatkr gnatls gnatprep gnatname \
 	  gnatclean -bargs $(ADA_INCLUDES) $(GNATBIND_FLAGS)
 	$(GNATLINK) -v gnatcmd -o ../../gnat$(exeext) \
 	  --GCC="$(CC) $(ADA_INCLUDES)" --LINK="$(GCC_LINK)" $(TOOLS_LIBS)
@@ -461,10 +461,6 @@
 	  --GCC="$(CC) $(ADA_INCLUDES)" --LINK="$(GCC_LINK)" $(TOOLS_LIBS)
 	$(GNATLINK) -v gnatprep -o ../../gnatprep$(exeext) \
 	  --GCC="$(CC) $(ADA_INCLUDES)" --LINK="$(GCC_LINK)" $(TOOLS_LIBS)
-	$(GNATLINK) -v gnatxref -o ../../gnatxref$(exeext) \
-	  --GCC="$(CC) $(ADA_INCLUDES)" --LINK="$(GCC_LINK)" $(TOOLS_LIBS)
-	$(GNATLINK) -v gnatfind -o ../../gnatfind$(exeext) \
-	  --GCC="$(CC) $(ADA_INCLUDES)" --LINK="$(GCC_LINK)" $(TOOLS_LIBS)
 	$(GNATLINK) -v gnatname -o ../../gnatname$(exeext) \
 	  --GCC="$(CC) $(ADA_INCLUDES)" --LINK="$(GCC_LINK)" $(TOOLS_LIBS)
 	$(GNATLINK) -v gnatclean -o ../../gnatclean$(exeext) \
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 13e9004..98b4aaf 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -239,8 +239,10 @@
 			   const char *, const char *);
 static void set_rm_size (Uint, tree, Entity_Id);
 static unsigned int validate_alignment (Uint, Entity_Id, unsigned int);
-static unsigned int promote_object_alignment (tree, Entity_Id);
+static unsigned int promote_object_alignment (tree, tree, Entity_Id);
 static void check_ok_for_atomic_type (tree, Entity_Id, bool);
+static bool type_for_atomic_builtin_p (tree);
+static tree resolve_atomic_builtin (enum built_in_function, tree);
 static tree create_field_decl_from (tree, tree, tree, tree, tree,
 				    vec<subst_pair>);
 static tree create_rep_part (tree, tree, tree);
@@ -897,7 +899,8 @@
 	   or a reference to another object, and the size of its type is a
 	   constant, set the alignment to the smallest one which is not
 	   smaller than the size, with an appropriate cap.  */
-	if (!gnu_size && align == 0
+	if (!Known_Esize (gnat_entity)
+	    && !Known_Alignment (gnat_entity)
 	    && (Is_Full_Access (gnat_entity)
 		|| (!Optimize_Alignment_Space (gnat_entity)
 		    && kind != E_Exception
@@ -908,8 +911,8 @@
 		    && !imported_p
 		    && No (gnat_renamed_obj)
 		    && No (Address_Clause (gnat_entity))))
-	    && TREE_CODE (TYPE_SIZE (gnu_type)) == INTEGER_CST)
-	  align = promote_object_alignment (gnu_type, gnat_entity);
+	    && (TREE_CODE (TYPE_SIZE (gnu_type)) == INTEGER_CST || gnu_size))
+	  align = promote_object_alignment (gnu_type, gnu_size, gnat_entity);
 
 	/* If the object is set to have atomic components, find the component
 	   type and validate it.
@@ -3943,7 +3946,7 @@
 	bool extern_flag
 	  = ((Is_Public (gnat_entity) && !definition)
 	     || imported_p
-	     || (Convention (gnat_entity) == Convention_Intrinsic
+	     || (Is_Intrinsic_Subprogram (gnat_entity)
 		 && Has_Pragma_Inline_Always (gnat_entity)));
 	tree gnu_param_list;
 
@@ -4487,7 +4490,7 @@
       /* Likewise for the RM size, if any.  */
       if (!Known_RM_Size (gnat_entity) && TYPE_SIZE (gnu_type))
 	Set_RM_Size (gnat_entity,
-		     No_Uint_To_0 (annotate_value (rm_size (gnu_type))));
+		     annotate_value (rm_size (gnu_type)));
 
       /* If we are at global level, GCC applied variable_size to the size but
 	 this has done nothing.  So, if it's not constant or self-referential,
@@ -5363,7 +5366,7 @@
   /* Builtins are expanded inline and there is no real call sequence involved.
      So the type expected by the underlying expander is always the type of the
      argument "as is".  */
-  if (Convention (gnat_subprog) == Convention_Intrinsic
+  if (Is_Intrinsic_Subprogram (gnat_subprog)
       && Present (Interface_Name (gnat_subprog)))
     mech = By_Copy;
 
@@ -5403,19 +5406,21 @@
       mech = Default;
     }
 
-  /* If this is either a foreign function or if the underlying type won't
-     be passed by reference and is as aligned as the original type, strip
-     off possible padding type.  */
+  /* Either for foreign conventions, or if the underlying type is not passed
+     by reference and is as large and aligned as the original type, strip off
+     a possible padding type.  */
   if (TYPE_IS_PADDING_P (gnu_param_type))
     {
-      tree unpadded_type = TREE_TYPE (TYPE_FIELDS (gnu_param_type));
+      tree inner_type = TREE_TYPE (TYPE_FIELDS (gnu_param_type));
 
       if (foreign
 	  || (mech != By_Reference
-	      && !must_pass_by_ref (unpadded_type)
-	      && (mech == By_Copy || !default_pass_by_ref (unpadded_type))
-	      && TYPE_ALIGN (unpadded_type) >= TYPE_ALIGN (gnu_param_type)))
-	gnu_param_type = unpadded_type;
+	      && !must_pass_by_ref (inner_type)
+	      && (mech == By_Copy || !default_pass_by_ref (inner_type))
+	      && ((TYPE_SIZE (inner_type) == TYPE_SIZE (gnu_param_type)
+		   && TYPE_ALIGN (inner_type) >= TYPE_ALIGN (gnu_param_type))
+		  || Is_Init_Proc (gnat_subprog))))
+	gnu_param_type = inner_type;
     }
 
   /* For foreign conventions, pass arrays as pointers to the element type.
@@ -5818,9 +5823,10 @@
 
   else
     {
-      /* For foreign convention subprograms, return System.Address as void *
-	 or equivalent.  Note that this comprises GCC builtins.  */
-      if (Has_Foreign_Convention (gnat_subprog)
+      /* For foreign convention/intrinsic subprograms, return System.Address
+	 as void * or equivalent; this comprises GCC builtins.  */
+      if ((Has_Foreign_Convention (gnat_subprog)
+	   || Is_Intrinsic_Subprogram (gnat_subprog))
 	  && Is_Descendant_Of_Address (Underlying_Type (gnat_return_type)))
 	gnu_return_type = ptr_type_node;
       else
@@ -5990,9 +5996,10 @@
 	{
 	  Entity_Id gnat_param_type = Etype (gnat_param);
 
-	  /* For foreign convention subprograms, pass System.Address as void *
-	     or equivalent.  Note that this comprises GCC builtins.  */
-	  if (Has_Foreign_Convention (gnat_subprog)
+	  /* For foreign convention/intrinsic subprograms, pass System.Address
+	     as void * or equivalent; this comprises GCC builtins.  */
+	  if ((Has_Foreign_Convention (gnat_subprog)
+	       || Is_Intrinsic_Subprogram (gnat_subprog))
 	      && Is_Descendant_Of_Address (Underlying_Type (gnat_param_type)))
 	    gnu_param_type = ptr_type_node;
 	  else
@@ -6298,7 +6305,7 @@
 
       /* If this subprogram is expectedly bound to a GCC builtin, fetch the
 	 corresponding DECL node and check the parameter association.  */
-      if (Convention (gnat_subprog) == Convention_Intrinsic
+      if (Is_Intrinsic_Subprogram (gnat_subprog)
 	  && Present (Interface_Name (gnat_subprog)))
 	{
 	  tree gnu_ext_name = create_concat_name (gnat_subprog, NULL);
@@ -6309,14 +6316,106 @@
 	     the checker is expected to post diagnostics in this case.  */
 	  if (gnu_builtin_decl)
 	    {
-	      const intrin_binding_t inb
-		= { gnat_subprog, gnu_type, TREE_TYPE (gnu_builtin_decl) };
+	      if (fndecl_built_in_p (gnu_builtin_decl, BUILT_IN_NORMAL))
+		{
+		  const enum built_in_function fncode
+		    = DECL_FUNCTION_CODE (gnu_builtin_decl);
 
-	      if (!intrin_profiles_compatible_p (&inb))
-		post_error
-		  ("??profile of& doesn''t match the builtin it binds!",
-		   gnat_subprog);
-	      return gnu_builtin_decl;
+		  switch (fncode)
+		  {
+		    case BUILT_IN_SYNC_FETCH_AND_ADD_N:
+		    case BUILT_IN_SYNC_FETCH_AND_SUB_N:
+		    case BUILT_IN_SYNC_FETCH_AND_OR_N:
+		    case BUILT_IN_SYNC_FETCH_AND_AND_N:
+		    case BUILT_IN_SYNC_FETCH_AND_XOR_N:
+		    case BUILT_IN_SYNC_FETCH_AND_NAND_N:
+		    case BUILT_IN_SYNC_ADD_AND_FETCH_N:
+		    case BUILT_IN_SYNC_SUB_AND_FETCH_N:
+		    case BUILT_IN_SYNC_OR_AND_FETCH_N:
+		    case BUILT_IN_SYNC_AND_AND_FETCH_N:
+		    case BUILT_IN_SYNC_XOR_AND_FETCH_N:
+		    case BUILT_IN_SYNC_NAND_AND_FETCH_N:
+		    case BUILT_IN_SYNC_VAL_COMPARE_AND_SWAP_N:
+		    case BUILT_IN_SYNC_LOCK_TEST_AND_SET_N:
+		    case BUILT_IN_ATOMIC_EXCHANGE_N:
+		    case BUILT_IN_ATOMIC_LOAD_N:
+		    case BUILT_IN_ATOMIC_ADD_FETCH_N:
+		    case BUILT_IN_ATOMIC_SUB_FETCH_N:
+		    case BUILT_IN_ATOMIC_AND_FETCH_N:
+		    case BUILT_IN_ATOMIC_NAND_FETCH_N:
+		    case BUILT_IN_ATOMIC_XOR_FETCH_N:
+		    case BUILT_IN_ATOMIC_OR_FETCH_N:
+		    case BUILT_IN_ATOMIC_FETCH_ADD_N:
+		    case BUILT_IN_ATOMIC_FETCH_SUB_N:
+		    case BUILT_IN_ATOMIC_FETCH_AND_N:
+		    case BUILT_IN_ATOMIC_FETCH_NAND_N:
+		    case BUILT_IN_ATOMIC_FETCH_XOR_N:
+		    case BUILT_IN_ATOMIC_FETCH_OR_N:
+		      /* This is a generic builtin overloaded on its return
+			 type, so do type resolution based on it.  */
+		      if (!VOID_TYPE_P (gnu_return_type)
+			  && type_for_atomic_builtin_p (gnu_return_type))
+			gnu_builtin_decl
+			  = resolve_atomic_builtin (fncode, gnu_return_type);
+		      else
+			{
+			  post_error
+			    ("??cannot import type-generic 'G'C'C builtin!",
+			     gnat_subprog);
+			  post_error
+			    ("\\?use a supported result type",
+			     gnat_subprog);
+			  gnu_builtin_decl = NULL_TREE;
+			}
+		      break;
+
+		    case BUILT_IN_ATOMIC_COMPARE_EXCHANGE_N:
+		      /* This is a generic builtin overloaded on its third
+			 parameter type, so do type resolution based on it.  */
+		      if (list_length (gnu_param_type_list) >= 4
+			  && type_for_atomic_builtin_p
+			       (list_third (gnu_param_type_list)))
+			gnu_builtin_decl
+			  = resolve_atomic_builtin
+			      (fncode, list_third (gnu_param_type_list));
+		      else
+			{
+			  post_error
+			    ("??cannot import type-generic 'G'C'C builtin!",
+			     gnat_subprog);
+			  post_error
+			    ("\\?use a supported third parameter type",
+			     gnat_subprog);
+			  gnu_builtin_decl = NULL_TREE;
+			}
+		      break;
+
+		    case BUILT_IN_SYNC_BOOL_COMPARE_AND_SWAP_N:
+		    case BUILT_IN_SYNC_LOCK_RELEASE_N:
+		    case BUILT_IN_ATOMIC_STORE_N:
+		      post_error
+			("??unsupported type-generic 'G'C'C builtin!",
+			 gnat_subprog);
+		      gnu_builtin_decl = NULL_TREE;
+		      break;
+
+		    default:
+		      break;
+		  }
+		}
+
+	      if (gnu_builtin_decl)
+		{
+		  const intrin_binding_t inb
+		    = { gnat_subprog, gnu_type, TREE_TYPE (gnu_builtin_decl) };
+
+		  if (!intrin_profiles_compatible_p (&inb))
+		    post_error
+		      ("??profile of& doesn''t match the builtin it binds!",
+		       gnat_subprog);
+
+		  return gnu_builtin_decl;
+		}
 	    }
 
 	  /* Inability to find the builtin DECL most often indicates a genuine
@@ -6326,7 +6425,7 @@
 	     on demand without risking false positives with common default sets
 	     of options.  */
 	  if (warn_shadow)
-	    post_error ("'G'C'C intrinsic not found for&!??", gnat_subprog);
+	    post_error ("'G'C'C builtin not found for&!??", gnat_subprog);
 	}
     }
 
@@ -7320,7 +7419,7 @@
   if (Is_Full_Access (gnat_field))
     {
       const unsigned int align
-	= promote_object_alignment (gnu_field_type, gnat_field);
+	= promote_object_alignment (gnu_field_type, NULL_TREE, gnat_field);
       if (align > 0)
 	gnu_field_type
 	  = maybe_pad_type (gnu_field_type, NULL_TREE, align, gnat_field,
@@ -9391,11 +9490,11 @@
   return align;
 }
 
-/* Promote the alignment of GNU_TYPE corresponding to GNAT_ENTITY.  Return
-   a positive value on success or zero on failure.  */
+/* Promote the alignment of GNU_TYPE for an object with GNU_SIZE corresponding
+   to GNAT_ENTITY.  Return a positive value on success or zero on failure.  */
 
 static unsigned int
-promote_object_alignment (tree gnu_type, Entity_Id gnat_entity)
+promote_object_alignment (tree gnu_type, tree gnu_size, Entity_Id gnat_entity)
 {
   unsigned int align, size_cap, align_cap;
 
@@ -9416,14 +9515,17 @@
       align_cap = get_mode_alignment (ptr_mode);
     }
 
+  if (!gnu_size)
+    gnu_size = TYPE_SIZE (gnu_type);
+
   /* Do the promotion within the above limits.  */
-  if (!tree_fits_uhwi_p (TYPE_SIZE (gnu_type))
-      || compare_tree_int (TYPE_SIZE (gnu_type), size_cap) > 0)
+  if (!tree_fits_uhwi_p (gnu_size)
+      || compare_tree_int (gnu_size, size_cap) > 0)
     align = 0;
-  else if (compare_tree_int (TYPE_SIZE (gnu_type), align_cap) > 0)
+  else if (compare_tree_int (gnu_size, align_cap) > 0)
     align = align_cap;
   else
-    align = ceil_pow2 (tree_to_uhwi (TYPE_SIZE (gnu_type)));
+    align = ceil_pow2 (tree_to_uhwi (gnu_size));
 
   /* But make sure not to under-align the object.  */
   if (align <= TYPE_ALIGN (gnu_type))
@@ -9506,6 +9608,33 @@
 		   gnat_error_point, gnat_entity);
 }
 
+/* Return true if TYPE is suitable for a type-generic atomic builtin.  */
+
+static bool
+type_for_atomic_builtin_p (tree type)
+{
+  const enum machine_mode mode = TYPE_MODE (type);
+  if (GET_MODE_CLASS (mode) == MODE_FLOAT)
+    return true;
+
+  scalar_int_mode imode;
+  if (is_a <scalar_int_mode> (mode, &imode) && GET_MODE_SIZE (imode) <= 16)
+    return true;
+
+  return false;
+}
+
+/* Return the GCC atomic builtin based on CODE and sized for TYPE.  */
+
+static tree
+resolve_atomic_builtin (enum built_in_function code, tree type)
+{
+  const unsigned int size = resolve_atomic_size (type);
+  code = (enum built_in_function) ((int) code + exact_log2 (size) + 1);
+
+  return builtin_decl_implicit (code);
+}
+
 /* Helper for intrin_profiles_compatible_p, to perform compatibility checks
    on the Ada/builtin argument lists for the INB binding.  */
 
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h
index 692ef44..1b55ec5 100644
--- a/gcc/ada/gcc-interface/gigi.h
+++ b/gcc/ada/gcc-interface/gigi.h
@@ -1026,6 +1026,9 @@
    should be synchronized with Exp_Dbug.Debug_Renaming_Declaration.  */
 extern bool can_materialize_object_renaming_p (Node_Id expr);
 
+/* Return the size of TYPE, which must be a positive power of 2.  */
+extern unsigned int resolve_atomic_size (tree type);
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -1223,3 +1226,11 @@
 {
   return TREE_TYPE (TREE_OPERAND (expr, 0));
 }
+
+/* Return the third value of a list.  */
+
+static inline tree
+list_third (tree list)
+{
+  return TREE_VALUE (TREE_CHAIN (TREE_CHAIN (list)));
+}
diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c
index 96199bd..2caa83f 100644
--- a/gcc/ada/gcc-interface/misc.c
+++ b/gcc/ada/gcc-interface/misc.c
@@ -271,15 +271,9 @@
   warn_stringop_overflow = 0;
 
   /* No caret by default for Ada.  */
-  if (!global_options_set.x_flag_diagnostics_show_caret)
+  if (!OPTION_SET_P (flag_diagnostics_show_caret))
     global_dc->show_caret = false;
 
-  /* Warn only if STABS is not the default: we don't want to emit a warning if
-     the user did not use a -gstabs option.  */
-  if (PREFERRED_DEBUGGING_TYPE != DBX_DEBUG && write_symbols == DBX_DEBUG)
-    warning (0, "STABS debugging information for Ada is obsolete and not "
-		"supported anymore");
-
   /* Copy global settings to local versions.  */
   gnat_encodings = global_options.x_gnat_encodings;
   optimize = global_options.x_optimize;
@@ -422,12 +416,12 @@
   flag_delete_dead_exceptions = 1;
   if (Suppress_Checks)
     {
-      if (!global_options_set.x_flag_non_call_exceptions)
+      if (!OPTION_SET_P (flag_non_call_exceptions))
 	flag_non_call_exceptions = Machine_Overflows_On_Target && GNAT_Mode;
     }
   else
     {
-      if (!global_options_set.x_flag_non_call_exceptions)
+      if (!OPTION_SET_P (flag_non_call_exceptions))
         flag_non_call_exceptions = 1;
       flag_aggressive_loop_optimizations = 0;
       warn_aggressive_loop_optimizations = 0;
@@ -445,14 +439,14 @@
      S'Signed_Zeros is true, but don't override the user if not.  */
   if (Signed_Zeros_On_Target)
     flag_signed_zeros = 1;
-  else if (!global_options_set.x_flag_signed_zeros)
+  else if (!OPTION_SET_P (flag_signed_zeros))
     flag_signed_zeros = 0;
 
   /* Assume that FP operations can trap if S'Machine_Overflow is true,
      but don't override the user if not.  */
   if (Machine_Overflows_On_Target)
     flag_trapping_math = 1;
-  else if (!global_options_set.x_flag_trapping_math)
+  else if (!OPTION_SET_P (flag_trapping_math))
     flag_trapping_math = 0;
 }
 
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 3fec060..dc2a03c 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -7872,21 +7872,24 @@
     case N_Pop_Constraint_Error_Label:
       gnat_temp = gnu_constraint_error_label_stack.pop ();
       if (Present (gnat_temp)
-	  && !TREE_USED (gnat_to_gnu_entity (gnat_temp, NULL_TREE, false)))
+	  && !TREE_USED (gnat_to_gnu_entity (gnat_temp, NULL_TREE, false))
+	  && No_Exception_Propagation_Active ())
 	Warn_If_No_Local_Raise (gnat_temp);
       break;
 
     case N_Pop_Storage_Error_Label:
       gnat_temp = gnu_storage_error_label_stack.pop ();
       if (Present (gnat_temp)
-	  && !TREE_USED (gnat_to_gnu_entity (gnat_temp, NULL_TREE, false)))
+	  && !TREE_USED (gnat_to_gnu_entity (gnat_temp, NULL_TREE, false))
+	  && No_Exception_Propagation_Active ())
 	Warn_If_No_Local_Raise (gnat_temp);
       break;
 
     case N_Pop_Program_Error_Label:
       gnat_temp = gnu_program_error_label_stack.pop ();
       if (Present (gnat_temp)
-	  && !TREE_USED (gnat_to_gnu_entity (gnat_temp, NULL_TREE, false)))
+	  && !TREE_USED (gnat_to_gnu_entity (gnat_temp, NULL_TREE, false))
+	  && No_Exception_Propagation_Active ())
 	Warn_If_No_Local_Raise (gnat_temp);
       break;
 
@@ -9076,7 +9079,7 @@
 	continue;
 
       /* Skip stuff internal to the compiler.  */
-      if (Convention (gnat_entity) == Convention_Intrinsic)
+      if (Is_Intrinsic_Subprogram (gnat_entity))
 	continue;
       if (kind == E_Operator)
 	continue;
diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c
index e8ed4b2..06d8203 100644
--- a/gcc/ada/gcc-interface/utils2.c
+++ b/gcc/ada/gcc-interface/utils2.c
@@ -663,7 +663,7 @@
 
 /* Return the size of TYPE, which must be a positive power of 2.  */
 
-static unsigned int
+unsigned int
 resolve_atomic_size (tree type)
 {
   unsigned HOST_WIDE_INT size = tree_to_uhwi (TYPE_SIZE_UNIT (type));
diff --git a/gcc/ada/gen_il-gen-gen_entities.adb b/gcc/ada/gen_il-gen-gen_entities.adb
index 1fa7f0b..d91faaa 100644
--- a/gcc/ada/gen_il-gen-gen_entities.adb
+++ b/gcc/ada/gen_il-gen-gen_entities.adb
@@ -252,7 +252,7 @@
         Sm (Contract, Node_Id),
         Sm (Is_Elaboration_Warnings_OK_Id, Flag),
         Sm (Original_Record_Component, Node_Id),
-        Sm (Scope_Depth_Value, Uint),
+        Sm (Scope_Depth_Value, Unat),
         Sm (SPARK_Pragma, Node_Id),
         Sm (SPARK_Pragma_Inherited, Flag),
         Sm (Current_Value, Node_Id), -- setter only
@@ -607,7 +607,7 @@
        --  this is the first named subtype).
 
    Ab (Decimal_Fixed_Point_Kind, Fixed_Point_Kind,
-       (Sm (Digits_Value, Uint),
+       (Sm (Digits_Value, Upos),
         Sm (Has_Machine_Radix_Clause, Flag),
         Sm (Machine_Radix_10, Flag),
         Sm (Scale_Value, Uint)));
@@ -623,7 +623,7 @@
        --  first named subtype).
 
    Ab (Float_Kind, Real_Kind,
-       (Sm (Digits_Value, Uint)));
+       (Sm (Digits_Value, Upos)));
 
    Cc (E_Floating_Point_Type, Float_Kind);
        --  Floating point type, used for the anonymous base type of the
@@ -866,23 +866,23 @@
        --  A private type, created by a private type declaration that has
        --  neither the keyword limited nor the keyword tagged.
        (Sm (Scalar_Range, Node_Id),
-        Sm (Scope_Depth_Value, Uint)));
+        Sm (Scope_Depth_Value, Unat)));
 
    Cc (E_Private_Subtype, Private_Kind,
        --  A subtype of a private type, created by a subtype declaration used
        --  to declare a subtype of a private type.
-       (Sm (Scope_Depth_Value, Uint)));
+       (Sm (Scope_Depth_Value, Unat)));
 
    Cc (E_Limited_Private_Type, Private_Kind,
        --  A limited private type, created by a private type declaration that
        --  has the keyword limited, but not the keyword tagged.
        (Sm (Scalar_Range, Node_Id),
-        Sm (Scope_Depth_Value, Uint)));
+        Sm (Scope_Depth_Value, Unat)));
 
    Cc (E_Limited_Private_Subtype, Private_Kind,
        --  A subtype of a limited private type, created by a subtype declaration
        --  used to declare a subtype of a limited private type.
-       (Sm (Scope_Depth_Value, Uint)));
+       (Sm (Scope_Depth_Value, Unat)));
 
    Ab (Incomplete_Kind, Incomplete_Or_Private_Kind,
        (Sm (Non_Limited_View, Node_Id)));
@@ -900,7 +900,7 @@
         Sm (First_Entity, Node_Id),
         Sm (First_Private_Entity, Node_Id),
         Sm (Last_Entity, Node_Id),
-        Sm (Scope_Depth_Value, Uint),
+        Sm (Scope_Depth_Value, Unat),
         Sm (Stored_Constraint, Elist_Id)));
 
    Ab (Task_Kind, Concurrent_Kind,
@@ -1005,11 +1005,11 @@
         Sm (Linker_Section_Pragma, Node_Id),
         Sm (Overridden_Operation, Node_Id),
         Sm (Protected_Body_Subprogram, Node_Id),
-        Sm (Scope_Depth_Value, Uint),
+        Sm (Scope_Depth_Value, Unat),
         Sm (Static_Call_Helper, Node_Id),
         Sm (SPARK_Pragma, Node_Id),
         Sm (SPARK_Pragma_Inherited, Flag),
-        Sm (Subps_Index, Uint)));
+        Sm (Subps_Index, Unat)));
 
    Cc (E_Function, Subprogram_Kind,
        --  A function, created by a function declaration or a function body
@@ -1137,7 +1137,7 @@
         Sm (Postconditions_Proc, Node_Id),
         Sm (Protected_Body_Subprogram, Node_Id),
         Sm (Protection_Object, Node_Id),
-        Sm (Scope_Depth_Value, Uint),
+        Sm (Scope_Depth_Value, Unat),
         Sm (SPARK_Pragma, Node_Id),
         Sm (SPARK_Pragma_Inherited, Flag)));
 
@@ -1164,7 +1164,7 @@
         Sm (Protected_Body_Subprogram, Node_Id),
         Sm (Protection_Object, Node_Id),
         Sm (Renamed_Or_Alias, Node_Id),
-        Sm (Scope_Depth_Value, Uint),
+        Sm (Scope_Depth_Value, Unat),
         Sm (SPARK_Pragma, Node_Id),
         Sm (SPARK_Pragma_Inherited, Flag)));
 
@@ -1178,7 +1178,7 @@
         Sm (Last_Entity, Node_Id),
         Sm (Renamed_Or_Alias, Node_Id),
         Sm (Return_Applies_To, Node_Id),
-        Sm (Scope_Depth_Value, Uint)));
+        Sm (Scope_Depth_Value, Unat)));
 
    Cc (E_Entry_Index_Parameter, Entity_Kind,
        --  An entry index parameter created by an entry index specification
@@ -1209,7 +1209,7 @@
         Sm (Is_Elaboration_Warnings_OK_Id, Flag),
         Sm (Last_Entity, Node_Id),
         Sm (Renamed_Or_Alias, Node_Id),
-        Sm (Scope_Depth_Value, Uint),
+        Sm (Scope_Depth_Value, Unat),
         Sm (SPARK_Pragma, Node_Id),
         Sm (SPARK_Pragma_Inherited, Flag)));
 
@@ -1254,7 +1254,7 @@
         Sm (Has_Loop_Entry_Attributes, Flag),
         Sm (Last_Entity, Node_Id),
         Sm (Renamed_Or_Alias, Node_Id),
-        Sm (Scope_Depth_Value, Uint)));
+        Sm (Scope_Depth_Value, Unat)));
 
    Cc (E_Return_Statement, Entity_Kind,
        --  A dummy entity created for each return statement. Used to hold
@@ -1266,7 +1266,7 @@
        (Sm (First_Entity, Node_Id),
         Sm (Last_Entity, Node_Id),
         Sm (Return_Applies_To, Node_Id),
-        Sm (Scope_Depth_Value, Uint)));
+        Sm (Scope_Depth_Value, Unat)));
 
    Cc (E_Package, Entity_Kind,
        --  A package, created by a package declaration
@@ -1303,7 +1303,7 @@
         Sm (Related_Instance, Node_Id),
         Sm (Renamed_In_Spec, Flag),
         Sm (Renamed_Or_Alias, Node_Id),
-        Sm (Scope_Depth_Value, Uint),
+        Sm (Scope_Depth_Value, Unat),
         Sm (SPARK_Aux_Pragma, Node_Id),
         Sm (SPARK_Aux_Pragma_Inherited, Flag),
         Sm (SPARK_Pragma, Node_Id),
@@ -1323,7 +1323,7 @@
         Sm (Last_Entity, Node_Id),
         Sm (Related_Instance, Node_Id),
         Sm (Renamed_Or_Alias, Node_Id),
-        Sm (Scope_Depth_Value, Uint),
+        Sm (Scope_Depth_Value, Unat),
         Sm (SPARK_Aux_Pragma, Node_Id),
         Sm (SPARK_Aux_Pragma_Inherited, Flag),
         Sm (SPARK_Pragma, Node_Id),
@@ -1358,7 +1358,7 @@
         Sm (Interface_Name, Node_Id),
         Sm (Last_Entity, Node_Id),
         Sm (Renamed_Or_Alias, Node_Id),
-        Sm (Scope_Depth_Value, Uint),
+        Sm (Scope_Depth_Value, Unat),
         Sm (SPARK_Pragma, Node_Id),
         Sm (SPARK_Pragma_Inherited, Flag)));
 
diff --git a/gcc/ada/gen_il-gen-gen_nodes.adb b/gcc/ada/gen_il-gen-gen_nodes.adb
index 20d25ea..7125773 100644
--- a/gcc/ada/gen_il-gen-gen_nodes.adb
+++ b/gcc/ada/gen_il-gen-gen_nodes.adb
@@ -984,7 +984,7 @@
    Cc (N_Case_Statement, N_Statement_Other_Than_Procedure_Call,
        (Sy (Expression, Node_Id, Default_Empty),
         Sy (Alternatives, List_Id, Default_No_List),
-        Sy (End_Span, Uint, Default_Uint_0),
+        Sy (End_Span, Unat, Default_Uint_0),
         Sm (From_Conditional_Expression, Flag)));
 
    Cc (N_Code_Statement, N_Statement_Other_Than_Procedure_Call,
@@ -1094,7 +1094,7 @@
         Sy (Then_Statements, List_Id),
         Sy (Elsif_Parts, List_Id, Default_No_List),
         Sy (Else_Statements, List_Id, Default_No_List),
-        Sy (End_Span, Uint, Default_Uint_0),
+        Sy (End_Span, Unat, Default_Uint_0),
         Sm (From_Conditional_Expression, Flag)));
 
    Cc (N_Accept_Alternative, Node_Kind,
@@ -1594,7 +1594,7 @@
         Sm (Dcheck_Function, Node_Id),
         Sm (Enclosing_Variant, Node_Id),
         Sm (Has_SP_Choice, Flag),
-        Sm (Present_Expr, Uint)));
+        Sm (Present_Expr, Valid_Uint)));
 
    Cc (N_Variant_Part, Node_Kind,
        (Sy (Name, Node_Id, Default_Empty),
@@ -1675,16 +1675,29 @@
 
    Union (N_Is_Decl,
           Children =>
-            (N_Declaration,
+            (N_Aggregate,
+             N_Block_Statement,
+             N_Declaration,
              N_Discriminant_Specification,
+             N_Entry_Index_Specification,
              N_Enumeration_Type_Definition,
              N_Exception_Handler,
+             N_Explicit_Dereference,
+             N_Expression_With_Actions,
+             N_Extension_Aggregate,
+             N_Identifier,
+             N_Iterated_Component_Association,
              N_Later_Decl_Item,
+             N_Loop_Statement,
+             N_Null_Statement,
+             N_Number_Declaration,
              N_Package_Specification,
              N_Parameter_Specification,
              N_Renaming_Declaration,
-             N_Subprogram_Specification));
-   --  Nodes that can be returned by Declaration_Node
+             N_Quantified_Expression));
+   --  Nodes that can be returned by Declaration_Node; it can also return
+   --  Empty. Not all of these are true "declarations", but Declaration_Node
+   --  can return them in some cases.
 
    Union (N_Is_Range,
           Children =>
diff --git a/gcc/ada/gen_il-gen.adb b/gcc/ada/gen_il-gen.adb
index e786251..f058c5a 100644
--- a/gcc/ada/gen_il-gen.adb
+++ b/gcc/ada/gen_il-gen.adb
@@ -1197,6 +1197,12 @@
          for F in First .. Last loop
             if Field_Table (F).Field_Type in Node_Or_Entity_Type then
                Result (Node_Id) := True;
+
+            --  Subtypes of Uint all use the same Cast for Uint
+
+            elsif Field_Table (F).Field_Type in Uint_Subtype then
+               Result (Uint) := True;
+
             else
                Result (Field_Table (F).Field_Type) := True;
             end if;
@@ -1767,6 +1773,7 @@
          end if;
 
          Put_Get_Set_Incr (S, F, "Set");
+
          Decrease_Indent (S, 3);
          Put (S, "end Set_" & Image (F) & ";" & LF & LF);
       end Put_Setter_Body;
@@ -2150,7 +2157,8 @@
 
                   Put (S, F_Image (F) & " => (" &
                        Image (Field_Table (F).Field_Type) & "_Field, " &
-                       Image (Offset) & ")");
+                       Image (Offset) & ", " &
+                       Image (Field_Table (F).Type_Only) & ")");
 
                   FS := Field_Size (F);
                   FB := First_Bit (F, Offset);
@@ -2245,10 +2253,32 @@
          Decrease_Indent (S, 2);
          Put (S, ");" & LF & LF);
 
+         Put (S, "type Type_Only_Enum is" & LF);
+         Increase_Indent (S, 2);
+         Put (S, "(");
+
+         declare
+            First_Time : Boolean := True;
+         begin
+            for TO in Type_Only_Enum loop
+               if First_Time then
+                  First_Time := False;
+               else
+                  Put (S, ", ");
+               end if;
+
+               Put (S, Image (TO));
+            end loop;
+         end;
+
+         Decrease_Indent (S, 2);
+         Put (S, ");" & LF & LF);
+
          Put (S, "type Field_Descriptor is record" & LF);
          Increase_Indent (S, 3);
          Put (S, "Kind : Field_Kind;" & LF);
          Put (S, "Offset : Field_Offset;" & LF);
+         Put (S, "Type_Only : Type_Only_Enum;" & LF);
          Decrease_Indent (S, 3);
          Put (S, "end record;" & LF & LF);
 
diff --git a/gcc/ada/gen_il-gen.ads b/gcc/ada/gen_il-gen.ads
index 1d24ebf..56b0606 100644
--- a/gcc/ada/gen_il-gen.ads
+++ b/gcc/ada/gen_il-gen.ads
@@ -204,9 +204,22 @@
    --  Gen_IL.Fields, and delete all occurrences from Gen_IL.Gen.Gen_Entities.
 
    --  If a field is not set, it is initialized by default to whatever value is
-   --  represented by all-zero bits, with two exceptions: Elist fields default
-   --  to No_Elist, and Uint fields default to Uint_0. In retrospect, it would
-   --  have been better to use No_Uint instead of Uint_0.
+   --  represented by all-zero bits, with some exceptions. This means Flags are
+   --  initialized to False, Node_Ids and List_Ids are initialized to Empty,
+   --  and enumeration fields are initialized to 'First of the type (assuming
+   --  there is no representation clause).
+   --
+   --  Elists default to No_Elist.
+   --
+   --  Fields of type Uint (but not its subtypes) are initialized to No_Uint.
+   --  Fields of subtypes Valid_Uint, Unat, Upos, Nonzero_Uint, and Ureal have
+   --  no default; it is an error to call a getter before calling the setter.
+   --  Likewise, other types whose range does not include zero have no default
+   --  (see package Types for the ranges).
+   --
+   --  If a node is created by a function in Nmake, then the defaults are
+   --  different from what is specified above. The parameters of Make_...
+   --  functions can have defaults specified; see Create_Syntactic_Field.
 
    procedure Create_Node_Union_Type
      (T : Abstract_Node; Children : Type_Array);
diff --git a/gcc/ada/gen_il-internals.adb b/gcc/ada/gen_il-internals.adb
index fe1af78..a1a8062 100644
--- a/gcc/ada/gen_il-internals.adb
+++ b/gcc/ada/gen_il-internals.adb
@@ -370,7 +370,7 @@
          return Image (Default);
 
       else
-         --  Strip off the prefix and capitalize it
+         --  Strip off the prefix
 
          declare
             Im : constant String := Image (Default);
diff --git a/gcc/ada/gen_il-internals.ads b/gcc/ada/gen_il-internals.ads
index a811e0b..3febf7f 100644
--- a/gcc/ada/gen_il-internals.ads
+++ b/gcc/ada/gen_il-internals.ads
@@ -133,7 +133,7 @@
       Default_Uint_0); -- Uint
    --  Default value for a field in the Nmake functions. No_Default if the
    --  field parameter has no default value. Otherwise this indicates the
-   --  default value used, which must matcht the type of the field.
+   --  default value used, which must match the type of the field.
 
    function Image (Default : Field_Default_Value) return String;
    --  This will be something like "Default_Empty".
@@ -147,6 +147,9 @@
    --  The default is No_Type_Only, indicating the field is not one of
    --  these special "[... only]" ones.
 
+   function Image (Type_Only : Type_Only_Enum) return String is
+     (Capitalize (Type_Only'Img));
+
    Unknown_Offset : constant := -1;
    --  Initial value of Offset, so we can tell whether it has been set
 
@@ -191,7 +194,10 @@
 
    function Special_Default
      (Field_Type : Type_Enum) return String is
-      (if Field_Type = Elist_Id then "No_Elist" else "Uint_0");
+      (case Field_Type is
+         when Elist_Id => "No_Elist",
+         when Uint => "No_Uint",
+         when others => "can't happen");
 
    ----------------
 
diff --git a/gcc/ada/gen_il-types.ads b/gcc/ada/gen_il-types.ads
index 97b9dd2..9395e00 100644
--- a/gcc/ada/gen_il-types.ads
+++ b/gcc/ada/gen_il-types.ads
@@ -589,5 +589,7 @@
 
    subtype Uint_Subtype is Type_Enum with
      Predicate => Uint_Subtype in Valid_Uint | Unat | Upos | Nonzero_Uint;
+   --  These are the subtypes of Uint that have predicates restricting their
+   --  values.
 
 end Gen_IL.Types;
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index 0a962ee..129da89 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -21,7 +21,7 @@
 
 @copying
 @quotation
-GNAT Reference Manual , Sep 28, 2021
+GNAT Reference Manual , Oct 25, 2021
 
 AdaCore
 
@@ -3707,9 +3707,32 @@
 set shall be a proper subset of the second (and the later alternative
 will not be executed if the earlier alternative “matches”). All possible
 values of the composite type shall be covered. The composite type of the
-selector shall be a nonlimited untagged (but possibly discriminated)
-record type, all of whose subcomponent subtypes are either static discrete
-subtypes or record types that meet the same restrictions.
+selector shall be an array or record type that is neither limited
+class-wide.
+
+If a subcomponent’s subtype does not meet certain restrictions, then
+the only value that can be specified for that subcomponent in a case
+choice expression is a “box” component association (which matches all
+possible values for the subcomponent). This restriction applies if
+
+
+@itemize -
+
+@item 
+the component subtype is not a record, array, or discrete type; or
+
+@item 
+the component subtype is subject to a non-static constraint or
+has a predicate; or
+
+@item 
+the component type is an enumeration type that is subject to an
+enumeration representation clause; or
+
+@item 
+the component type is a multidimensional array type or an
+array type with a nonstatic index subtype.
+@end itemize
 
 Support for casing on arrays (and on records that contain arrays) is
 currently subject to some restrictions. Non-positional
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index 28f2f19..cae1fad 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -21,7 +21,7 @@
 
 @copying
 @quotation
-GNAT User's Guide for Native Platforms , Sep 28, 2021
+GNAT User's Guide for Native Platforms , Oct 19, 2021
 
 AdaCore
 
@@ -11800,6 +11800,34 @@
 ordering.
 @end table
 
+@geindex -gnatw_p (gcc)
+
+
+@table @asis
+
+@item @code{-gnatw_p}
+
+@emph{Activate warnings for pedantic checks.}
+
+This switch activates warnings for the failure of certain pedantic checks.
+The only case currently supported is a check that the subtype_marks given
+for corresponding formal parameter and function results in a subprogram
+declaration and its body denote the same subtype declaration. The default
+is that such warnings are not given.
+@end table
+
+@geindex -gnatw_P (gcc)
+
+
+@table @asis
+
+@item @code{-gnatw_P}
+
+@emph{Suppress warnings for pedantic checks.}
+
+This switch suppresses warnings on violations of pedantic checks.
+@end table
+
 @geindex -gnatwq (gcc)
 
 @geindex Parentheses
diff --git a/gcc/ada/gnatls.adb b/gcc/ada/gnatls.adb
index c676996..68990e1 100644
--- a/gcc/ada/gnatls.adb
+++ b/gcc/ada/gnatls.adb
@@ -234,9 +234,8 @@
       --  already been initialized.
 
       procedure Add_Directories
-        (Self    : in out String_Access;
-         Path    : String;
-         Prepend : Boolean := False);
+        (Self : in out String_Access;
+         Path : String);
       --  Add one or more directories to the path. Directories added with this
       --  procedure are added in order after the current directory and before
       --  the path given by the environment variable GPR_PROJECT_PATH. A value
@@ -1239,9 +1238,8 @@
       ---------------------
 
       procedure Add_Directories
-        (Self    : in out String_Access;
-         Path    : String;
-         Prepend : Boolean := False)
+        (Self : in out String_Access;
+         Path : String)
       is
          Tmp : String_Access;
 
@@ -1250,11 +1248,7 @@
             Self := new String'(Uninitialized_Prefix & Path);
          else
             Tmp := Self;
-            if Prepend then
-               Self := new String'(Path & Path_Separator & Tmp.all);
-            else
-               Self := new String'(Tmp.all & Path_Separator & Path);
-            end if;
+            Self := new String'(Tmp.all & Path_Separator & Path);
             Free (Tmp);
          end if;
       end Add_Directories;
diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb
index 773b376..08c454d 100644
--- a/gcc/ada/inline.adb
+++ b/gcc/ada/inline.adb
@@ -327,8 +327,8 @@
    --    Unreferenced
 
    procedure Reset_Actual_Mapping_For_Inlined_Call (Subp : Entity_Id);
-   --  Reset the Renamed_Object flags on the formals of Subp, which can be set
-   --  by a call to Establish_Actual_Mapping_For_Inlined_Call.
+   --  Reset the Renamed_Object field to Empty on all formals of Subp, which
+   --  can be set by a call to Establish_Actual_Mapping_For_Inlined_Call.
 
    ------------------------------
    -- Deferred Cleanup Actions --
@@ -2894,7 +2894,7 @@
          if Present (Renamed_Object (F)) then
 
             --  If expander is active, it is an error to try to inline a
-            --  recursive program. In GNATprove mode, just indicate that the
+            --  recursive subprogram. In GNATprove mode, just indicate that the
             --  inlining will not happen, and mark the subprogram as not always
             --  inlined.
 
diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb
index 17de886..2c3c372 100644
--- a/gcc/ada/lib-xref.adb
+++ b/gcc/ada/lib-xref.adb
@@ -481,7 +481,9 @@
                            --  e.g. function call, slicing of a function call,
                            --  pointer dereference, etc.
 
-                           if No (Obj) then
+                           if No (Obj)
+                             or else Ekind (Obj) = E_Enumeration_Literal
+                           then
                               return Empty;
                            end if;
                         else
diff --git a/gcc/ada/libgnarl/a-intnam__rtems.ads b/gcc/ada/libgnarl/a-intnam__rtems.ads
index 89618f6..4654f00 100644
--- a/gcc/ada/libgnarl/a-intnam__rtems.ads
+++ b/gcc/ada/libgnarl/a-intnam__rtems.ads
@@ -34,81 +34,17 @@
 ------------------------------------------------------------------------------
 
 --  This is a RTEMS version of this package
---
---  The following signals are reserved by the run time:
---
---  SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGTRAP, SIGABRT, SIGINT,
---  SIGALRM, SIGEMT, SIGKILL
---
---  The pragma Unreserve_All_Interrupts affects the following signal(s):
---
---  SIGINT: made available for Ada handlers
-
---  This target-dependent package spec contains names of interrupts
---  supported by the local system.
 
 with System.OS_Interface;
---  used for names of interrupts
 
 package Ada.Interrupts.Names is
 
-   --  Beware that the mapping of names to signals may be
-   --  many-to-one.  There may be aliases.  Also, for all
-   --  signal names that are not supported on the current system
-   --  the value of the corresponding constant will be zero.
+   --  All identifiers in this unit are implementation defined
 
-   SIGHUP : constant Interrupt_ID :=
-     System.OS_Interface.SIGHUP;      --  hangup
+   pragma Implementation_Defined;
 
-   SIGINT : constant Interrupt_ID :=
-     System.OS_Interface.SIGINT;      --  interrupt (rubout)
-
-   SIGQUIT : constant Interrupt_ID :=
-     System.OS_Interface.SIGQUIT;     --  quit (ASCD FS)
-
-   SIGILL : constant Interrupt_ID :=
-     System.OS_Interface.SIGILL;      --  illegal instruction (not reset)
-
-   SIGTRAP : constant Interrupt_ID :=
-     System.OS_Interface.SIGTRAP;     --  trace trap (not reset)
-
-   SIGIOT : constant Interrupt_ID :=
-     System.OS_Interface.SIGIOT;      --  IOT instruction
-
-   SIGABRT : constant Interrupt_ID := --  used by abort,
-     System.OS_Interface.SIGABRT;     --  replace SIGIOT in the  future
-
-   SIGEMT : constant Interrupt_ID :=
-     System.OS_Interface.SIGEMT;      --  EMT instruction
-
-   SIGFPE : constant Interrupt_ID :=
-     System.OS_Interface.SIGFPE;      --  floating point exception
-
-   SIGKILL : constant Interrupt_ID :=
-     System.OS_Interface.SIGKILL;     --  kill (cannot be caught or ignored)
-
-   SIGBUS : constant Interrupt_ID :=
-     System.OS_Interface.SIGBUS;      --  bus error
-
-   SIGSEGV : constant Interrupt_ID :=
-     System.OS_Interface.SIGSEGV;     --  segmentation violation
-
-   SIGSYS : constant Interrupt_ID :=
-     System.OS_Interface.SIGSYS;      --  bad argument to system call
-
-   SIGPIPE : constant Interrupt_ID := --  write on a pipe with
-     System.OS_Interface.SIGPIPE;     --  no one to read it
-
-   SIGALRM : constant Interrupt_ID :=
-     System.OS_Interface.SIGALRM;     --  alarm clock
-
-   SIGTERM : constant Interrupt_ID :=
-     System.OS_Interface.SIGTERM;     --  software termination signal from kill
-
-   SIGUSR1 : constant Interrupt_ID :=
-     System.OS_Interface.SIGUSR1;     --  user defined signal 1
-
-   SIGUSR2 : constant Interrupt_ID :=
-     System.OS_Interface.SIGUSR2;     --  user defined signal 2
+   subtype Hardware_Interrupts is Interrupt_ID
+     range Interrupt_ID'First .. System.OS_Interface.Max_HW_Interrupt;
+   --  Range of values that can be used for hardware interrupts
 
 end Ada.Interrupts.Names;
diff --git a/gcc/ada/libgnarl/s-inmaop__vxworks.adb b/gcc/ada/libgnarl/s-inmaop__hwint.adb
similarity index 96%
rename from gcc/ada/libgnarl/s-inmaop__vxworks.adb
rename to gcc/ada/libgnarl/s-inmaop__hwint.adb
index 8496c82..52a92ac 100644
--- a/gcc/ada/libgnarl/s-inmaop__vxworks.adb
+++ b/gcc/ada/libgnarl/s-inmaop__hwint.adb
@@ -30,9 +30,10 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
---  This is a VxWorks version of this package. Many operations are null as this
---  package supports the use of Ada interrupt handling facilities for signals,
---  while those facilities are used for hardware interrupts on these targets.
+--  This is a hardware interrupt version of this package. Many operations are
+--  null as this package supports the use of Ada interrupt handling facilities
+--  for signals, while those facilities are used for hardware interrupts on
+--  these targets.
 
 with Ada.Exceptions;
 
diff --git a/gcc/ada/libgnarl/s-interr__hwint.adb b/gcc/ada/libgnarl/s-interr__hwint.adb
index be6b559..5f80174 100644
--- a/gcc/ada/libgnarl/s-interr__hwint.adb
+++ b/gcc/ada/libgnarl/s-interr__hwint.adb
@@ -29,29 +29,15 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
+--  This is reasonably generic version of this package, supporting vectored
+--  hardware interrupts using non-RTOS specific adapter routines which should
+--  easily implemented on any RTOS capable of supporting GNAT.
+
 --  Invariants:
 
---  All user-handlable signals are masked at all times in all tasks/threads
---  except possibly for the Interrupt_Manager task.
-
---  When a user task wants to have the effect of masking/unmasking an signal,
---  it must call Block_Interrupt/Unblock_Interrupt, which will have the effect
---  of unmasking/masking the signal in the Interrupt_Manager task. These
---  comments do not apply to vectored hardware interrupts, which may be masked
---  or unmasked using routined interfaced to the relevant embedded RTOS system
---  calls.
-
---  Once we associate a Signal_Server_Task with an signal, the task never goes
---  away, and we never remove the association. On the other hand, it is more
---  convenient to terminate an associated Interrupt_Server_Task for a vectored
---  hardware interrupt (since we use a binary semaphore for synchronization
---  with the umbrella handler).
-
---  There is no more than one signal per Signal_Server_Task and no more than
---  one Signal_Server_Task per signal. The same relation holds for hardware
---  interrupts and Interrupt_Server_Task's at any given time. That is, only
---  one non-terminated Interrupt_Server_Task exists for a give interrupt at
---  any time.
+--  There is no more than one interrupt per Interrupt_Server_Task and no more
+--  than one Interrupt_Server_Task per interrupt. If an interrupt handler is
+--  detached, the corresponding Interrupt_Server_Task is terminated.
 
 --  Within this package, the lock L is used to protect the various status
 --  tables. If there is a Server_Task associated with a signal or interrupt,
@@ -59,10 +45,6 @@
 --  status between Interrupt_Manager and Server_Task. Protection among service
 --  requests are ensured via user calls to the Interrupt_Manager entries.
 
---  This is reasonably generic version of this package, supporting vectored
---  hardware interrupts using non-RTOS specific adapter routines which should
---  easily implemented on any RTOS capable of supporting GNAT.
-
 with Ada.Unchecked_Conversion;
 with Ada.Task_Identification;
 
@@ -151,13 +133,13 @@
      (others => (null, Static => False));
    pragma Volatile_Components (User_Handler);
    --  Holds the protected procedure handler (if any) and its Static
-   --  information for each interrupt or signal. A handler is static iff it
+   --  information for each interrupt. A handler is static if and only if it
    --  is specified through the pragma Attach_Handler.
 
    User_Entry : array (Interrupt_ID) of Entry_Assoc :=
                   (others => (T => Null_Task, E => Null_Task_Entry));
    pragma Volatile_Components (User_Entry);
-   --  Holds the task and entry index (if any) for each interrupt / signal
+   --  Holds the task and entry index (if any) for each interrupt
 
    --  Type and Head, Tail of the list containing Registered Interrupt
    --  Handlers. These definitions are used to register the handlers
diff --git a/gcc/ada/libgnarl/s-intman__android.adb b/gcc/ada/libgnarl/s-intman__android.adb
index 6364ead..be9c50e 100644
--- a/gcc/ada/libgnarl/s-intman__android.adb
+++ b/gcc/ada/libgnarl/s-intman__android.adb
@@ -68,7 +68,7 @@
    Exception_Interrupts : constant Interrupt_List :=
      (SIGFPE, SIGILL, SIGSEGV, SIGBUS);
 
-   Unreserve_All_Interrupts : Interfaces.C.int;
+   Unreserve_All_Interrupts : constant Interfaces.C.int;
    pragma Import
      (C, Unreserve_All_Interrupts, "__gl_unreserve_all_interrupts");
 
diff --git a/gcc/ada/libgnarl/s-intman__lynxos.adb b/gcc/ada/libgnarl/s-intman__lynxos.adb
index c2e8f8a..2a1f9c8 100644
--- a/gcc/ada/libgnarl/s-intman__lynxos.adb
+++ b/gcc/ada/libgnarl/s-intman__lynxos.adb
@@ -68,7 +68,7 @@
    Exception_Interrupts : constant Interrupt_List :=
      (SIGFPE, SIGILL, SIGSEGV, SIGBUS);
 
-   Unreserve_All_Interrupts : Interfaces.C.int;
+   Unreserve_All_Interrupts : constant Interfaces.C.int;
    pragma Import
      (C, Unreserve_All_Interrupts, "__gl_unreserve_all_interrupts");
 
diff --git a/gcc/ada/libgnarl/s-intman__posix.adb b/gcc/ada/libgnarl/s-intman__posix.adb
index b0b0146..ae3d77e 100644
--- a/gcc/ada/libgnarl/s-intman__posix.adb
+++ b/gcc/ada/libgnarl/s-intman__posix.adb
@@ -68,7 +68,7 @@
    Exception_Interrupts : constant Interrupt_List :=
      (SIGFPE, SIGILL, SIGSEGV, SIGBUS);
 
-   Unreserve_All_Interrupts : Interfaces.C.int;
+   Unreserve_All_Interrupts : constant Interfaces.C.int;
    pragma Import
      (C, Unreserve_All_Interrupts, "__gl_unreserve_all_interrupts");
 
diff --git a/gcc/ada/libgnarl/s-intman__qnx.adb b/gcc/ada/libgnarl/s-intman__qnx.adb
index e983a9e..8934bdf 100644
--- a/gcc/ada/libgnarl/s-intman__qnx.adb
+++ b/gcc/ada/libgnarl/s-intman__qnx.adb
@@ -68,7 +68,7 @@
    Exception_Interrupts : constant Interrupt_List :=
      (SIGFPE, SIGILL, SIGSEGV, SIGBUS);
 
-   Unreserve_All_Interrupts : Interfaces.C.int;
+   Unreserve_All_Interrupts : constant Interfaces.C.int;
    pragma Import
      (C, Unreserve_All_Interrupts, "__gl_unreserve_all_interrupts");
 
diff --git a/gcc/ada/libgnarl/s-intman__rtems.adb b/gcc/ada/libgnarl/s-intman__rtems.adb
new file mode 100644
index 0000000..dedc67c
--- /dev/null
+++ b/gcc/ada/libgnarl/s-intman__rtems.adb
@@ -0,0 +1,93 @@
+------------------------------------------------------------------------------
+--                                                                          --
+--                 GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS                 --
+--                                                                          --
+--           S Y S T E M . I N T E R R U P T _ M A N A G E M E N T          --
+--                                                                          --
+--                                  B o d y                                 --
+--                                                                          --
+--          Copyright (C) 1992-2021, Free Software Foundation, Inc.         --
+--                                                                          --
+-- GNARL is free software; you can  redistribute it  and/or modify it under --
+-- terms of the  GNU General Public License as published  by the Free Soft- --
+-- ware  Foundation;  either version 3,  or (at your option) any later ver- --
+-- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE.                                     --
+--                                                                          --
+-- As a special exception under Section 7 of GPL version 3, you are granted --
+-- additional permissions described in the GCC Runtime Library Exception,   --
+-- version 3.1, as published by the Free Software Foundation.               --
+--                                                                          --
+-- You should have received a copy of the GNU General Public License and    --
+-- a copy of the GCC Runtime Library Exception along with this program;     --
+-- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
+-- <http://www.gnu.org/licenses/>.                                          --
+--                                                                          --
+-- GNARL was developed by the GNARL team at Florida State University.       --
+-- Extensive contributions were provided by Ada Core Technologies, Inc.     --
+--                                                                          --
+------------------------------------------------------------------------------
+
+--  This is the RTEMS version of this package
+
+--  It is simpler than other versions because the Ada interrupt handling
+--  mechanisms are used for hardware interrupts rather than signals.
+
+package body System.Interrupt_Management is
+
+   use System.OS_Interface;
+
+   -----------------------
+   -- Local Subprograms --
+   -----------------------
+
+   function State (Int : Interrupt_ID) return Character;
+   pragma Import (C, State, "__gnat_get_interrupt_state");
+   --  Get interrupt state. Defined in init.c The input argument is the
+   --  hardware interrupt number, and the result is one of the following:
+
+   Runtime : constant Character := 'r';
+   Default : constant Character := 's';
+   --    'n'   this interrupt not set by any Interrupt_State pragma
+   --    'u'   Interrupt_State pragma set state to User
+   --    'r'   Interrupt_State pragma set state to Runtime
+   --    's'   Interrupt_State pragma set state to System (use "default"
+   --           system handler)
+
+   ----------------
+   -- Initialize --
+   ----------------
+
+   Initialized : Boolean := False;
+   --  Set to True once Initialize is called, further calls have no effect
+
+   procedure Initialize is
+
+   begin
+      if Initialized then
+         return;
+      end if;
+
+      Initialized := True;
+
+      --  Set the signal used to signal an abort to another task as defined in
+      --  System.OS_Interface.
+
+      Abort_Task_Interrupt := SIGADAABORT;
+
+      --  Initialize hardware interrupt handling
+
+      pragma Assert (Reserve = (Interrupt_ID'Range => False));
+
+      --  Check all interrupts for state that requires keeping them reserved
+
+      for J in Interrupt_ID'Range loop
+         if State (J) = Default or else State (J) = Runtime then
+            Reserve (J) := True;
+         end if;
+      end loop;
+
+   end Initialize;
+
+end System.Interrupt_Management;
diff --git a/gcc/ada/libgnarl/s-intman__rtems.ads b/gcc/ada/libgnarl/s-intman__rtems.ads
new file mode 100644
index 0000000..f3d53ec
--- /dev/null
+++ b/gcc/ada/libgnarl/s-intman__rtems.ads
@@ -0,0 +1,99 @@
+------------------------------------------------------------------------------
+--                                                                          --
+--                 GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS                 --
+--                                                                          --
+--            S Y S T E M . I N T E R R U P T _ M A N A G E M E N T         --
+--                                                                          --
+--                                  S p e c                                 --
+--                                                                          --
+--          Copyright (C) 1992-2021, Free Software Foundation, Inc.         --
+--                                                                          --
+-- GNARL is free software; you can  redistribute it  and/or modify it under --
+-- terms of the  GNU General Public License as published  by the Free Soft- --
+-- ware  Foundation;  either version 3,  or (at your option) any later ver- --
+-- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE.                                     --
+--                                                                          --
+-- As a special exception under Section 7 of GPL version 3, you are granted --
+-- additional permissions described in the GCC Runtime Library Exception,   --
+-- version 3.1, as published by the Free Software Foundation.               --
+--                                                                          --
+-- You should have received a copy of the GNU General Public License and    --
+-- a copy of the GCC Runtime Library Exception along with this program;     --
+-- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
+-- <http://www.gnu.org/licenses/>.                                          --
+--                                                                          --
+-- GNARL was developed by the GNARL team at Florida State University.       --
+-- Extensive contributions were provided by Ada Core Technologies, Inc.     --
+--                                                                          --
+------------------------------------------------------------------------------
+
+--  This is the RTEMS version of this package
+
+--  This package encapsulates and centralizes information about all
+--  uses of interrupts (or signals), including the target-dependent
+--  mapping of interrupts (or signals) to exceptions.
+
+--  Unlike the original design, System.Interrupt_Management can only
+--  be used for tasking systems.
+
+--  PLEASE DO NOT put any subprogram declarations with arguments of
+--  type Interrupt_ID into the visible part of this package. The type
+--  Interrupt_ID is used to derive the type in Ada.Interrupts, and
+--  adding more operations to that type would be illegal according
+--  to the Ada Reference Manual. This is the reason why the signals
+--  sets are implemented using visible arrays rather than functions.
+
+with System.OS_Interface;
+
+with Interfaces.C;
+
+package System.Interrupt_Management is
+   pragma Preelaborate;
+
+   type Interrupt_Mask is limited private;
+
+   type Interrupt_ID is new Interfaces.C.int
+     range 0 .. System.OS_Interface.Max_Interrupt;
+
+   type Interrupt_Set is array (Interrupt_ID) of Boolean;
+
+   subtype Signal_ID is Interrupt_ID range 0 .. System.OS_Interface.NSIG - 1;
+
+   type Signal_Set is array (Signal_ID) of Boolean;
+
+   --  The following objects serve as constants, but are initialized in the
+   --  body to aid portability. This permits us to use more portable names for
+   --  interrupts, where distinct names may map to the same interrupt ID
+   --  value.
+
+   --  For example, suppose SIGRARE is a signal that is not defined on all
+   --  systems, but is always reserved when it is defined. If we have the
+   --  convention that ID zero is not used for any "real" signals, and SIGRARE
+   --  = 0 when SIGRARE is not one of the locally supported signals, we can
+   --  write:
+   --     Reserved (SIGRARE) := True;
+   --  and the initialization code will be portable.
+
+   Abort_Task_Interrupt : Signal_ID;
+   --  The signal that is used to implement task abort if an interrupt is used
+   --  for that purpose. This is one of the reserved signals.
+
+   Reserve : Interrupt_Set := (others => False);
+   --  Reserve (I) is true iff the interrupt I is one that cannot be permitted
+   --  to be attached to a user handler. The possible reasons are many. For
+   --  example, it may be mapped to an exception used to implement task abort,
+   --  or used to implement time delays.
+
+   procedure Initialize;
+   --  Initialize the various variables defined in this package. This procedure
+   --  must be called before accessing any object from this package and can be
+   --  called multiple times (only the first call has any effect).
+
+private
+   type Interrupt_Mask is new System.OS_Interface.sigset_t;
+   --  In some implementation Interrupt_Mask can be represented as a linked
+   --  list.
+
+end System.Interrupt_Management;
diff --git a/gcc/ada/libgnarl/s-intman__solaris.adb b/gcc/ada/libgnarl/s-intman__solaris.adb
index 3871457..76002a7 100644
--- a/gcc/ada/libgnarl/s-intman__solaris.adb
+++ b/gcc/ada/libgnarl/s-intman__solaris.adb
@@ -47,7 +47,7 @@
    Exception_Interrupts : constant Interrupt_List :=
      (SIGFPE, SIGILL, SIGSEGV, SIGBUS);
 
-   Unreserve_All_Interrupts : Interfaces.C.int;
+   Unreserve_All_Interrupts : constant Interfaces.C.int;
    pragma Import
      (C, Unreserve_All_Interrupts, "__gl_unreserve_all_interrupts");
 
diff --git a/gcc/ada/libgnarl/s-intman__susv3.adb b/gcc/ada/libgnarl/s-intman__susv3.adb
index b33d76d..f2870cb 100644
--- a/gcc/ada/libgnarl/s-intman__susv3.adb
+++ b/gcc/ada/libgnarl/s-intman__susv3.adb
@@ -56,7 +56,7 @@
    use Interfaces.C;
    use System.OS_Interface;
 
-   Unreserve_All_Interrupts : Interfaces.C.int;
+   Unreserve_All_Interrupts : constant Interfaces.C.int;
    pragma Import
      (C, Unreserve_All_Interrupts, "__gl_unreserve_all_interrupts");
 
diff --git a/gcc/ada/libgnarl/s-osinte__rtems.adb b/gcc/ada/libgnarl/s-osinte__rtems.adb
index cd977d0..96883af 100644
--- a/gcc/ada/libgnarl/s-osinte__rtems.adb
+++ b/gcc/ada/libgnarl/s-osinte__rtems.adb
@@ -44,6 +44,54 @@
 
 package body System.OS_Interface is
 
+   ---------------
+   -- RTEMS API --
+   ---------------
+
+   type RTEMS_Attributes is new unsigned;
+
+   RTEMS_SIMPLE_BINARY_SEMAPHORE : constant := 16#00000020#;
+   RTEMS_FIFO                    : constant := 16#00000000#;
+
+   type RTEMS_Interval is new unsigned;
+
+   RTEMS_NO_TIMEOUT : constant := 0;
+
+   type RTEMS_Options is new unsigned;
+
+   RTEMS_WAIT             : constant := 16#00000000#;
+   RTEMS_INTERRUPT_UNIQUE : constant := 16#00000001#;
+
+   type RTEMS_Name is new unsigned;
+
+   function RTEMS_Build_Name (C1, C2, C3, C4 : Character) return RTEMS_Name
+     with Import, External_Name => "rtems_build_name", Convention => C;
+
+   function RTEMS_Semaphore_Create
+     (Name             : RTEMS_Name;
+      Count            : unsigned;
+      Attributes       : RTEMS_Attributes;
+      Priority_Ceiling : unsigned;
+      Semaphore        : out Binary_Semaphore_Id) return int
+     with Import, External_Name => "rtems_semaphore_create", Convention => C;
+
+   function RTEMS_Semaphore_Delete (Semaphore : Binary_Semaphore_Id) return int
+     with Import, External_Name => "rtems_semaphore_delete", Convention => C;
+
+   function RTEMS_Semaphore_Flush (Semaphore : Binary_Semaphore_Id)
+     return int
+     with Import, External_Name => "rtems_semaphore_flush", Convention => C;
+
+   function RTEMS_Semaphore_Obtain
+     (Semaphore : Binary_Semaphore_Id;
+      Options   : RTEMS_Options;
+      Timeout   : RTEMS_Interval) return int
+     with Import, External_Name => "rtems_semaphore_obtain", Convention => C;
+
+   function RTEMS_Semaphore_Release (Semaphore : Binary_Semaphore_Id)
+     return int
+     with Import, External_Name => "rtems_semaphore_release", Convention => C;
+
    -----------------
    -- To_Duration --
    -----------------
@@ -85,6 +133,108 @@
                        tv_nsec => long (Long_Long_Integer (F * 10#1#E9)));
    end To_Timespec;
 
+   -----------------------------
+   -- Binary_Semaphore_Create --
+   -----------------------------
+
+   function Binary_Semaphore_Create return Binary_Semaphore_Id is
+      Semaphore : Binary_Semaphore_Id;
+      Status    : int;
+   begin
+      Status :=
+        RTEMS_Semaphore_Create
+          (Name             => RTEMS_Build_Name ('G', 'N', 'A', 'T'),
+           Count            => 0,
+           Attributes       => RTEMS_SIMPLE_BINARY_SEMAPHORE or RTEMS_FIFO,
+           Priority_Ceiling => 0,
+           Semaphore        => Semaphore);
+
+      pragma Assert (Status = 0);
+
+      return Semaphore;
+   end Binary_Semaphore_Create;
+
+   -----------------------------
+   -- Binary_Semaphore_Delete --
+   -----------------------------
+
+   function Binary_Semaphore_Delete (ID : Binary_Semaphore_Id)
+     return int is
+   begin
+      return RTEMS_Semaphore_Delete (ID);
+   end Binary_Semaphore_Delete;
+
+   -----------------------------
+   -- Binary_Semaphore_Obtain --
+   -----------------------------
+
+   function Binary_Semaphore_Obtain (ID : Binary_Semaphore_Id)
+     return int is
+   begin
+      return RTEMS_Semaphore_Obtain (ID, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
+   end Binary_Semaphore_Obtain;
+
+   ------------------------------
+   -- Binary_Semaphore_Release --
+   ------------------------------
+
+   function Binary_Semaphore_Release (ID : Binary_Semaphore_Id)
+     return int is
+   begin
+      return RTEMS_Semaphore_Release (ID);
+   end Binary_Semaphore_Release;
+
+   ----------------------------
+   -- Binary_Semaphore_Flush --
+   ----------------------------
+
+   function Binary_Semaphore_Flush (ID : Binary_Semaphore_Id) return int is
+   begin
+      return RTEMS_Semaphore_Flush (ID);
+   end Binary_Semaphore_Flush;
+
+   -----------------------
+   -- Interrupt_Connect --
+   -----------------------
+
+   function Interrupt_Connect
+     (Vector    : Interrupt_Vector;
+      Handler   : Interrupt_Handler;
+      Parameter : System.Address := System.Null_Address) return int
+   is
+      function RTEMS_Interrupt_Handler_Install
+         (Vector    : Interrupt_Vector;
+          Info      : char_array;
+          Options   : RTEMS_Options;
+          Handler   : Interrupt_Handler;
+          Parameter : System.Address) return int
+        with Import,
+             External_Name => "rtems_interrupt_handler_install",
+             Convention => C;
+
+      Info_String : constant char_array := To_C ("GNAT Interrupt Handler");
+      --  Handler name that is registered with RTEMS
+   begin
+      return
+        RTEMS_Interrupt_Handler_Install
+          (Vector    => Vector,
+           Info      => Info_String,
+           Options   => RTEMS_INTERRUPT_UNIQUE,
+           Handler   => Handler,
+           Parameter => Parameter);
+   end Interrupt_Connect;
+
+   --------------------------------
+   -- Interrupt_Number_To_Vector --
+   --------------------------------
+
+   function Interrupt_Number_To_Vector (intNum : int)
+     return Interrupt_Vector
+   is
+   begin
+      return Interrupt_Vector (intNum);
+   end Interrupt_Number_To_Vector;
+
    ------------------
    -- pthread_init --
    ------------------
diff --git a/gcc/ada/libgnarl/s-osinte__rtems.ads b/gcc/ada/libgnarl/s-osinte__rtems.ads
index ffbfc3a..9a0561f 100644
--- a/gcc/ada/libgnarl/s-osinte__rtems.ads
+++ b/gcc/ada/libgnarl/s-osinte__rtems.ads
@@ -85,18 +85,20 @@
    ENOMEM    : constant := System.OS_Constants.ENOMEM;
    ETIMEDOUT : constant := System.OS_Constants.ETIMEDOUT;
 
-   -------------
-   -- Signals --
-   -------------
+   ----------------------------
+   -- Signals and Interrupts --
+   ----------------------------
 
-   Num_HW_Interrupts : constant := 256;
+   NSIG : constant := 64;
+   --  Number of signals on the target OS
+   type Signal is new int range 0 .. Interfaces.C."-" (NSIG, 1);
 
-   Max_HW_Interrupt : constant := Num_HW_Interrupts - 1;
+   Max_HW_Interrupt : constant := 255;
    type HW_Interrupt is new int range 0 .. Max_HW_Interrupt;
 
    Max_Interrupt : constant := Max_HW_Interrupt;
-
-   type Signal is new int range 0 .. Max_Interrupt;
+   subtype Interrupt_Range is Natural range 0 .. Max_HW_Interrupt;
+   --  For s-interr
 
    SIGXCPU     : constant := 0; --  XCPU
    SIGHUP      : constant := 1; --  hangup
@@ -546,34 +548,19 @@
    type Binary_Semaphore_Id is new rtems_id;
 
    function Binary_Semaphore_Create return Binary_Semaphore_Id;
-   pragma Import (
-      C,
-      Binary_Semaphore_Create,
-      "__gnat_binary_semaphore_create");
+   pragma Inline (Binary_Semaphore_Create);
 
    function Binary_Semaphore_Delete (ID : Binary_Semaphore_Id) return int;
-   pragma Import (
-      C,
-      Binary_Semaphore_Delete,
-      "__gnat_binary_semaphore_delete");
+   pragma Inline (Binary_Semaphore_Delete);
 
    function Binary_Semaphore_Obtain (ID : Binary_Semaphore_Id) return int;
-   pragma Import (
-      C,
-      Binary_Semaphore_Obtain,
-      "__gnat_binary_semaphore_obtain");
+   pragma Inline (Binary_Semaphore_Obtain);
 
    function Binary_Semaphore_Release (ID : Binary_Semaphore_Id) return int;
-   pragma Import (
-      C,
-      Binary_Semaphore_Release,
-      "__gnat_binary_semaphore_release");
+   pragma Inline (Binary_Semaphore_Release);
 
    function Binary_Semaphore_Flush (ID : Binary_Semaphore_Id) return int;
-   pragma Import (
-      C,
-      Binary_Semaphore_Flush,
-      "__gnat_binary_semaphore_flush");
+   pragma Inline (Binary_Semaphore_Flush);
 
    ------------------------------------------------------------
    -- Hardware Interrupt Wrappers to Support Interrupt Tasks --
@@ -581,40 +568,24 @@
 
    type Interrupt_Handler is access procedure (parameter : System.Address);
    pragma Convention (C, Interrupt_Handler);
+
    type Interrupt_Vector is new System.Address;
 
    function Interrupt_Connect
-     (vector    : Interrupt_Vector;
-      handler   : Interrupt_Handler;
-      parameter : System.Address := System.Null_Address) return int;
-   pragma Import (C, Interrupt_Connect, "__gnat_interrupt_connect");
+     (Vector    : Interrupt_Vector;
+      Handler   : Interrupt_Handler;
+      Parameter : System.Address := System.Null_Address) return int;
    --  Use this to set up an user handler. The routine installs a
    --  a user handler which is invoked after RTEMS has saved enough
    --  context for a high-level language routine to be safely invoked.
 
-   function Interrupt_Vector_Get
-     (Vector : Interrupt_Vector) return Interrupt_Handler;
-   pragma Import (C, Interrupt_Vector_Get, "__gnat_interrupt_get");
-   --  Use this to get the existing handler for later restoral.
-
-   procedure Interrupt_Vector_Set
-     (Vector  : Interrupt_Vector;
-      Handler : Interrupt_Handler);
-   pragma Import (C, Interrupt_Vector_Set, "__gnat_interrupt_set");
-   --  Use this to restore a handler obtained using Interrupt_Vector_Get.
-
    function Interrupt_Number_To_Vector (intNum : int) return Interrupt_Vector;
    --  Convert a logical interrupt number to the hardware interrupt vector
    --  number used to connect the interrupt.
-   pragma Import (
-      C,
-      Interrupt_Number_To_Vector,
-      "__gnat_interrupt_number_to_vector"
-   );
 
 private
 
-   type sigset_t is new int;
+   type sigset_t is new unsigned_long;
 
    type pid_t is new int;
 
diff --git a/gcc/ada/libgnarl/s-taprob.adb b/gcc/ada/libgnarl/s-taprob.adb
index 754d175..1f304d9 100644
--- a/gcc/ada/libgnarl/s-taprob.adb
+++ b/gcc/ada/libgnarl/s-taprob.adb
@@ -47,7 +47,7 @@
    -- Local Data --
    ----------------
 
-   Locking_Policy : Character;
+   Locking_Policy : constant Character;
    pragma Import (C, Locking_Policy, "__gl_locking_policy");
 
    -------------------------
diff --git a/gcc/ada/libgnarl/s-taprop__hpux-dce.adb b/gcc/ada/libgnarl/s-taprop__hpux-dce.adb
index ebd8941..9bded3a 100644
--- a/gcc/ada/libgnarl/s-taprop__hpux-dce.adb
+++ b/gcc/ada/libgnarl/s-taprop__hpux-dce.adb
@@ -87,10 +87,10 @@
    Unblocked_Signal_Mask : aliased sigset_t;
    --  The set of signals that should unblocked in all tasks
 
-   Time_Slice_Val : Integer;
+   Time_Slice_Val : constant Integer;
    pragma Import (C, Time_Slice_Val, "__gl_time_slice_val");
 
-   Dispatching_Policy : Character;
+   Dispatching_Policy : constant Character;
    pragma Import (C, Dispatching_Policy, "__gl_task_dispatching_policy");
 
    --  Note: the reason that Locking_Policy is not needed is that this
diff --git a/gcc/ada/libgnarl/s-taprop__linux.adb b/gcc/ada/libgnarl/s-taprop__linux.adb
index 93ffb3a..1c8c6bd 100644
--- a/gcc/ada/libgnarl/s-taprop__linux.adb
+++ b/gcc/ada/libgnarl/s-taprop__linux.adb
@@ -84,13 +84,13 @@
    Next_Serial_Number : Task_Serial_Number := 100;
    --  We start at 100 (reserve some special values for using in error checks)
 
-   Time_Slice_Val : Integer;
+   Time_Slice_Val : constant Integer;
    pragma Import (C, Time_Slice_Val, "__gl_time_slice_val");
 
-   Dispatching_Policy : Character;
+   Dispatching_Policy : constant Character;
    pragma Import (C, Dispatching_Policy, "__gl_task_dispatching_policy");
 
-   Locking_Policy : Character;
+   Locking_Policy : constant Character;
    pragma Import (C, Locking_Policy, "__gl_locking_policy");
 
    Foreign_Task_Elaborated : aliased Boolean := True;
diff --git a/gcc/ada/libgnarl/s-taprop__mingw.adb b/gcc/ada/libgnarl/s-taprop__mingw.adb
index 4d9b163..33d5977 100644
--- a/gcc/ada/libgnarl/s-taprop__mingw.adb
+++ b/gcc/ada/libgnarl/s-taprop__mingw.adb
@@ -109,10 +109,10 @@
    --  a time; it is used to execute in mutual exclusion from all other tasks.
    --  Used to protect All_Tasks_List
 
-   Time_Slice_Val : Integer;
+   Time_Slice_Val : constant Integer;
    pragma Import (C, Time_Slice_Val, "__gl_time_slice_val");
 
-   Dispatching_Policy : Character;
+   Dispatching_Policy : constant Character;
    pragma Import (C, Dispatching_Policy, "__gl_task_dispatching_policy");
 
    function Get_Policy (Prio : System.Any_Priority) return Character;
diff --git a/gcc/ada/libgnarl/s-taprop__posix.adb b/gcc/ada/libgnarl/s-taprop__posix.adb
index 3dc12c8..c0766a0 100644
--- a/gcc/ada/libgnarl/s-taprop__posix.adb
+++ b/gcc/ada/libgnarl/s-taprop__posix.adb
@@ -83,7 +83,7 @@
    Environment_Task_Id : Task_Id;
    --  A variable to hold Task_Id for the environment task
 
-   Locking_Policy : Character;
+   Locking_Policy : constant Character;
    pragma Import (C, Locking_Policy, "__gl_locking_policy");
    --  Value of the pragma Locking_Policy:
    --    'C' for Ceiling_Locking
@@ -99,10 +99,10 @@
    --  We start at 100, to reserve some special values for
    --  using in error checking.
 
-   Time_Slice_Val : Integer;
+   Time_Slice_Val : constant Integer;
    pragma Import (C, Time_Slice_Val, "__gl_time_slice_val");
 
-   Dispatching_Policy : Character;
+   Dispatching_Policy : constant Character;
    pragma Import (C, Dispatching_Policy, "__gl_task_dispatching_policy");
 
    Foreign_Task_Elaborated : aliased Boolean := True;
diff --git a/gcc/ada/libgnarl/s-taprop__qnx.adb b/gcc/ada/libgnarl/s-taprop__qnx.adb
index 9446e37..e7faf08 100644
--- a/gcc/ada/libgnarl/s-taprop__qnx.adb
+++ b/gcc/ada/libgnarl/s-taprop__qnx.adb
@@ -83,7 +83,7 @@
    Environment_Task_Id : Task_Id;
    --  A variable to hold Task_Id for the environment task
 
-   Locking_Policy : Character;
+   Locking_Policy : constant Character;
    pragma Import (C, Locking_Policy, "__gl_locking_policy");
    --  Value of the pragma Locking_Policy:
    --    'C' for Ceiling_Locking
@@ -99,10 +99,10 @@
    --  We start at 100, to reserve some special values for
    --  using in error checking.
 
-   Time_Slice_Val : Integer;
+   Time_Slice_Val : constant Integer;
    pragma Import (C, Time_Slice_Val, "__gl_time_slice_val");
 
-   Dispatching_Policy : Character;
+   Dispatching_Policy : constant Character;
    pragma Import (C, Dispatching_Policy, "__gl_task_dispatching_policy");
 
    Foreign_Task_Elaborated : aliased Boolean := True;
diff --git a/gcc/ada/libgnarl/s-taprop__rtems.adb b/gcc/ada/libgnarl/s-taprop__rtems.adb
new file mode 100644
index 0000000..9153032
--- /dev/null
+++ b/gcc/ada/libgnarl/s-taprop__rtems.adb
@@ -0,0 +1,1347 @@
+------------------------------------------------------------------------------
+--                                                                          --
+--                 GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS                 --
+--                                                                          --
+--     S Y S T E M . T A S K _ P R I M I T I V E S . O P E R A T I O N S    --
+--                                                                          --
+--                                  B o d y                                 --
+--                                                                          --
+--          Copyright (C) 1992-2021, Free Software Foundation, Inc.         --
+--                                                                          --
+-- GNARL is free software; you can  redistribute it  and/or modify it under --
+-- terms of the  GNU General Public License as published  by the Free Soft- --
+-- ware  Foundation;  either version 3,  or (at your option) any later ver- --
+-- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE.                                     --
+--                                                                          --
+-- As a special exception under Section 7 of GPL version 3, you are granted --
+-- additional permissions described in the GCC Runtime Library Exception,   --
+-- version 3.1, as published by the Free Software Foundation.               --
+--                                                                          --
+-- You should have received a copy of the GNU General Public License and    --
+-- a copy of the GCC Runtime Library Exception along with this program;     --
+-- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
+-- <http://www.gnu.org/licenses/>.                                          --
+--                                                                          --
+-- GNARL was developed by the GNARL team at Florida State University.       --
+-- Extensive contributions were provided by Ada Core Technologies, Inc.     --
+--                                                                          --
+------------------------------------------------------------------------------
+
+--  This is the RTEMS version of this package
+
+--  This package contains all the GNULL primitives that interface directly with
+--  the underlying OS.
+
+with Ada.Unchecked_Conversion;
+
+with Interfaces.C;
+
+with System.Tasking.Debug;
+with System.Interrupt_Management;
+with System.OS_Constants;
+with System.OS_Primitives;
+with System.Task_Info;
+
+with System.Soft_Links;
+--  We use System.Soft_Links instead of System.Tasking.Initialization
+--  because the later is a higher level package that we shouldn't depend on.
+--  For example when using the restricted run time, it is replaced by
+--  System.Tasking.Restricted.Stages.
+
+package body System.Task_Primitives.Operations is
+
+   package OSC renames System.OS_Constants;
+   package SSL renames System.Soft_Links;
+
+   use System.Tasking.Debug;
+   use System.Tasking;
+   use Interfaces.C;
+   use System.OS_Interface;
+   use System.Parameters;
+   use System.OS_Primitives;
+
+   ----------------
+   -- Local Data --
+   ----------------
+
+   --  The followings are logically constants, but need to be initialized
+   --  at run time.
+
+   Single_RTS_Lock : aliased RTS_Lock;
+   --  This is a lock to allow only one thread of control in the RTS at
+   --  a time; it is used to execute in mutual exclusion from all other tasks.
+   --  Used to protect All_Tasks_List
+
+   Environment_Task_Id : Task_Id;
+   --  A variable to hold Task_Id for the environment task
+
+   Locking_Policy : constant Character;
+   pragma Import (C, Locking_Policy, "__gl_locking_policy");
+   --  Value of the pragma Locking_Policy:
+   --    'C' for Ceiling_Locking
+   --    'I' for Inherit_Locking
+   --    ' ' for none.
+
+   --  The followings are internal configuration constants needed
+
+   Next_Serial_Number : Task_Serial_Number := 100;
+   --  We start at 100, to reserve some special values for
+   --  using in error checking.
+
+   Time_Slice_Val : constant Integer;
+   pragma Import (C, Time_Slice_Val, "__gl_time_slice_val");
+
+   Dispatching_Policy : constant Character;
+   pragma Import (C, Dispatching_Policy, "__gl_task_dispatching_policy");
+
+   Foreign_Task_Elaborated : aliased Boolean := True;
+   --  Used to identified fake tasks (i.e., non-Ada Threads)
+
+   Use_Alternate_Stack : constant Boolean := Alternate_Stack_Size /= 0;
+   --  Whether to use an alternate signal stack for stack overflows
+
+   Abort_Handler_Installed : Boolean := False;
+   --  True if a handler for the abort signal is installed
+
+   --------------------
+   -- Local Packages --
+   --------------------
+
+   package Specific is
+
+      procedure Initialize (Environment_Task : Task_Id);
+      pragma Inline (Initialize);
+      --  Initialize various data needed by this package
+
+      function Is_Valid_Task return Boolean;
+      pragma Inline (Is_Valid_Task);
+      --  Does executing thread have a TCB?
+
+      procedure Set (Self_Id : Task_Id);
+      pragma Inline (Set);
+      --  Set the self id for the current task
+
+      function Self return Task_Id;
+      pragma Inline (Self);
+      --  Return a pointer to the Ada Task Control Block of the calling task
+
+   end Specific;
+
+   package body Specific is separate;
+   --  The body of this package is target specific
+
+   package Monotonic is
+
+      function Monotonic_Clock return Duration;
+      pragma Inline (Monotonic_Clock);
+      --  Returns an absolute time, represented as an offset relative to some
+      --  unspecified starting point, typically system boot time.  This clock
+      --  is not affected by discontinuous jumps in the system time.
+
+      function RT_Resolution return Duration;
+      pragma Inline (RT_Resolution);
+      --  Returns resolution of the underlying clock used to implement RT_Clock
+
+      procedure Timed_Sleep
+        (Self_ID  : ST.Task_Id;
+         Time     : Duration;
+         Mode     : ST.Delay_Modes;
+         Reason   : System.Tasking.Task_States;
+         Timedout : out Boolean;
+         Yielded  : out Boolean);
+      --  Combination of Sleep (above) and Timed_Delay
+
+      procedure Timed_Delay
+        (Self_ID : ST.Task_Id;
+         Time    : Duration;
+         Mode    : ST.Delay_Modes);
+      --  Implement the semantics of the delay statement.
+      --  The caller should be abort-deferred and should not hold any locks.
+
+   end Monotonic;
+
+   package body Monotonic is separate;
+
+   ----------------------------------
+   -- ATCB allocation/deallocation --
+   ----------------------------------
+
+   package body ATCB_Allocation is separate;
+   --  The body of this package is shared across several targets
+
+   ---------------------------------
+   -- Support for foreign threads --
+   ---------------------------------
+
+   function Register_Foreign_Thread
+     (Thread         : Thread_Id;
+      Sec_Stack_Size : Size_Type := Unspecified_Size) return Task_Id;
+   --  Allocate and initialize a new ATCB for the current Thread. The size of
+   --  the secondary stack can be optionally specified.
+
+   function Register_Foreign_Thread
+     (Thread         : Thread_Id;
+      Sec_Stack_Size : Size_Type := Unspecified_Size)
+     return Task_Id is separate;
+
+   -----------------------
+   -- Local Subprograms --
+   -----------------------
+
+   procedure Abort_Handler (Sig : Signal);
+   --  Signal handler used to implement asynchronous abort.
+   --  See also comment before body, below.
+
+   function To_Address is
+     new Ada.Unchecked_Conversion (Task_Id, System.Address);
+
+   function GNAT_pthread_condattr_setup
+     (attr : access pthread_condattr_t) return int;
+   pragma Import (C,
+     GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
+
+   -------------------
+   -- Abort_Handler --
+   -------------------
+
+   --  Target-dependent binding of inter-thread Abort signal to the raising of
+   --  the Abort_Signal exception.
+
+   --  The technical issues and alternatives here are essentially the
+   --  same as for raising exceptions in response to other signals
+   --  (e.g. Storage_Error). See code and comments in the package body
+   --  System.Interrupt_Management.
+
+   --  Some implementations may not allow an exception to be propagated out of
+   --  a handler, and others might leave the signal or interrupt that invoked
+   --  this handler masked after the exceptional return to the application
+   --  code.
+
+   --  GNAT exceptions are originally implemented using setjmp()/longjmp(). On
+   --  most UNIX systems, this will allow transfer out of a signal handler,
+   --  which is usually the only mechanism available for implementing
+   --  asynchronous handlers of this kind. However, some systems do not
+   --  restore the signal mask on longjmp(), leaving the abort signal masked.
+
+   procedure Abort_Handler (Sig : Signal) is
+      pragma Unreferenced (Sig);
+
+      T              : constant Task_Id := Self;
+      Old_Set        : aliased sigset_t;
+      Unblocked_Mask : aliased sigset_t;
+      Result         : Interfaces.C.int;
+      pragma Warnings (Off, Result);
+
+   begin
+      --  It's not safe to raise an exception when using GCC ZCX mechanism.
+      --  Note that we still need to install a signal handler, since in some
+      --  cases (e.g. shutdown of the Server_Task in System.Interrupts) we
+      --  need to send the Abort signal to a task.
+
+      if ZCX_By_Default then
+         return;
+      end if;
+
+      if T.Deferral_Level = 0
+        and then T.Pending_ATC_Level < T.ATC_Nesting_Level and then
+        not T.Aborting
+      then
+         T.Aborting := True;
+
+         --  Make sure signals used for RTS internal purpose are unmasked
+
+         Result := sigemptyset (Unblocked_Mask'Access);
+         pragma Assert (Result = 0);
+         Result :=
+           sigaddset
+           (Unblocked_Mask'Access,
+            Signal (Interrupt_Management.Abort_Task_Interrupt));
+         pragma Assert (Result = 0);
+         Result := sigaddset (Unblocked_Mask'Access, SIGBUS);
+         pragma Assert (Result = 0);
+         Result := sigaddset (Unblocked_Mask'Access, SIGFPE);
+         pragma Assert (Result = 0);
+         Result := sigaddset (Unblocked_Mask'Access, SIGILL);
+         pragma Assert (Result = 0);
+         Result := sigaddset (Unblocked_Mask'Access, SIGSEGV);
+         pragma Assert (Result = 0);
+
+         Result :=
+           pthread_sigmask
+             (SIG_UNBLOCK,
+              Unblocked_Mask'Access,
+              Old_Set'Access);
+         pragma Assert (Result = 0);
+
+         raise Standard'Abort_Signal;
+      end if;
+   end Abort_Handler;
+
+   -----------------
+   -- Stack_Guard --
+   -----------------
+
+   procedure Stack_Guard (T : ST.Task_Id; On : Boolean) is
+      Stack_Base : constant Address := Get_Stack_Base (T.Common.LL.Thread);
+      Page_Size  : Address;
+      Res        : Interfaces.C.int;
+
+   begin
+      if Stack_Base_Available then
+
+         --  Compute the guard page address
+
+         Page_Size := Address (Get_Page_Size);
+         Res :=
+           mprotect
+             (Stack_Base - (Stack_Base mod Page_Size) + Page_Size,
+              size_t (Page_Size),
+              prot => (if On then PROT_ON else PROT_OFF));
+         pragma Assert (Res = 0);
+      end if;
+   end Stack_Guard;
+
+   --------------------
+   -- Get_Thread_Id  --
+   --------------------
+
+   function Get_Thread_Id (T : ST.Task_Id) return OSI.Thread_Id is
+   begin
+      return T.Common.LL.Thread;
+   end Get_Thread_Id;
+
+   ----------
+   -- Self --
+   ----------
+
+   function Self return Task_Id renames Specific.Self;
+
+   ---------------------
+   -- Initialize_Lock --
+   ---------------------
+
+   --  Note: mutexes and cond_variables needed per-task basis are initialized
+   --  in Initialize_TCB and the Storage_Error is handled. Other mutexes (such
+   --  as RTS_Lock, Memory_Lock...) used in RTS is initialized before any
+   --  status change of RTS. Therefore raising Storage_Error in the following
+   --  routines should be able to be handled safely.
+
+   procedure Initialize_Lock
+     (Prio : System.Any_Priority;
+      L    : not null access Lock)
+   is
+      Attributes : aliased pthread_mutexattr_t;
+      Result : Interfaces.C.int;
+
+   begin
+      Result := pthread_mutexattr_init (Attributes'Access);
+      pragma Assert (Result = 0 or else Result = ENOMEM);
+
+      if Result = ENOMEM then
+         raise Storage_Error;
+      end if;
+
+      if Locking_Policy = 'C' then
+         Result := pthread_mutexattr_setprotocol
+           (Attributes'Access, PTHREAD_PRIO_PROTECT);
+         pragma Assert (Result = 0);
+
+         Result := pthread_mutexattr_setprioceiling
+            (Attributes'Access, Interfaces.C.int (Prio));
+         pragma Assert (Result = 0);
+
+      elsif Locking_Policy = 'I' then
+         Result := pthread_mutexattr_setprotocol
+           (Attributes'Access, PTHREAD_PRIO_INHERIT);
+         pragma Assert (Result = 0);
+      end if;
+
+      Result := pthread_mutex_init (L.WO'Access, Attributes'Access);
+      pragma Assert (Result = 0 or else Result = ENOMEM);
+
+      if Result = ENOMEM then
+         Result := pthread_mutexattr_destroy (Attributes'Access);
+         raise Storage_Error;
+      end if;
+
+      Result := pthread_mutexattr_destroy (Attributes'Access);
+      pragma Assert (Result = 0);
+   end Initialize_Lock;
+
+   procedure Initialize_Lock
+     (L : not null access RTS_Lock; Level : Lock_Level)
+   is
+      pragma Unreferenced (Level);
+
+      Attributes : aliased pthread_mutexattr_t;
+      Result     : Interfaces.C.int;
+
+   begin
+      Result := pthread_mutexattr_init (Attributes'Access);
+      pragma Assert (Result = 0 or else Result = ENOMEM);
+
+      if Result = ENOMEM then
+         raise Storage_Error;
+      end if;
+
+      if Locking_Policy = 'C' then
+         Result := pthread_mutexattr_setprotocol
+           (Attributes'Access, PTHREAD_PRIO_PROTECT);
+         pragma Assert (Result = 0);
+
+         Result := pthread_mutexattr_setprioceiling
+            (Attributes'Access, Interfaces.C.int (System.Any_Priority'Last));
+         pragma Assert (Result = 0);
+
+      elsif Locking_Policy = 'I' then
+         Result := pthread_mutexattr_setprotocol
+           (Attributes'Access, PTHREAD_PRIO_INHERIT);
+         pragma Assert (Result = 0);
+      end if;
+
+      Result := pthread_mutex_init (L, Attributes'Access);
+      pragma Assert (Result = 0 or else Result = ENOMEM);
+
+      if Result = ENOMEM then
+         Result := pthread_mutexattr_destroy (Attributes'Access);
+         raise Storage_Error;
+      end if;
+
+      Result := pthread_mutexattr_destroy (Attributes'Access);
+      pragma Assert (Result = 0);
+   end Initialize_Lock;
+
+   -------------------
+   -- Finalize_Lock --
+   -------------------
+
+   procedure Finalize_Lock (L : not null access Lock) is
+      Result : Interfaces.C.int;
+   begin
+      Result := pthread_mutex_destroy (L.WO'Access);
+      pragma Assert (Result = 0);
+   end Finalize_Lock;
+
+   procedure Finalize_Lock (L : not null access RTS_Lock) is
+      Result : Interfaces.C.int;
+   begin
+      Result := pthread_mutex_destroy (L);
+      pragma Assert (Result = 0);
+   end Finalize_Lock;
+
+   ----------------
+   -- Write_Lock --
+   ----------------
+
+   procedure Write_Lock
+     (L : not null access Lock; Ceiling_Violation : out Boolean)
+   is
+      Result : Interfaces.C.int;
+
+   begin
+      Result := pthread_mutex_lock (L.WO'Access);
+
+      --  The cause of EINVAL is a priority ceiling violation
+
+      Ceiling_Violation := Result = EINVAL;
+      pragma Assert (Result = 0 or else Ceiling_Violation);
+   end Write_Lock;
+
+   procedure Write_Lock (L : not null access RTS_Lock) is
+      Result : Interfaces.C.int;
+   begin
+      Result := pthread_mutex_lock (L);
+      pragma Assert (Result = 0);
+   end Write_Lock;
+
+   procedure Write_Lock (T : Task_Id) is
+      Result : Interfaces.C.int;
+   begin
+      Result := pthread_mutex_lock (T.Common.LL.L'Access);
+      pragma Assert (Result = 0);
+   end Write_Lock;
+
+   ---------------
+   -- Read_Lock --
+   ---------------
+
+   procedure Read_Lock
+     (L : not null access Lock; Ceiling_Violation : out Boolean) is
+   begin
+      Write_Lock (L, Ceiling_Violation);
+   end Read_Lock;
+
+   ------------
+   -- Unlock --
+   ------------
+
+   procedure Unlock (L : not null access Lock) is
+      Result : Interfaces.C.int;
+   begin
+      Result := pthread_mutex_unlock (L.WO'Access);
+      pragma Assert (Result = 0);
+   end Unlock;
+
+   procedure Unlock (L : not null access RTS_Lock) is
+      Result : Interfaces.C.int;
+   begin
+      Result := pthread_mutex_unlock (L);
+      pragma Assert (Result = 0);
+   end Unlock;
+
+   procedure Unlock (T : Task_Id) is
+      Result : Interfaces.C.int;
+   begin
+      Result := pthread_mutex_unlock (T.Common.LL.L'Access);
+      pragma Assert (Result = 0);
+   end Unlock;
+
+   -----------------
+   -- Set_Ceiling --
+   -----------------
+
+   --  Dynamic priority ceilings are not supported by the underlying system
+
+   procedure Set_Ceiling
+     (L    : not null access Lock;
+      Prio : System.Any_Priority)
+   is
+      pragma Unreferenced (L, Prio);
+   begin
+      null;
+   end Set_Ceiling;
+
+   -----------
+   -- Sleep --
+   -----------
+
+   procedure Sleep
+     (Self_ID : Task_Id;
+      Reason  : System.Tasking.Task_States)
+   is
+      pragma Unreferenced (Reason);
+
+      Result : Interfaces.C.int;
+
+   begin
+      Result :=
+        pthread_cond_wait
+          (cond  => Self_ID.Common.LL.CV'Access,
+           mutex => Self_ID.Common.LL.L'Access);
+
+      --  EINTR is not considered a failure
+
+      pragma Assert (Result = 0 or else Result = EINTR);
+   end Sleep;
+
+   -----------------
+   -- Timed_Sleep --
+   -----------------
+
+   --  This is for use within the run-time system, so abort is
+   --  assumed to be already deferred, and the caller should be
+   --  holding its own ATCB lock.
+
+   procedure Timed_Sleep
+     (Self_ID  : Task_Id;
+      Time     : Duration;
+      Mode     : ST.Delay_Modes;
+      Reason   : Task_States;
+      Timedout : out Boolean;
+      Yielded  : out Boolean) renames Monotonic.Timed_Sleep;
+
+   -----------------
+   -- Timed_Delay --
+   -----------------
+
+   --  This is for use in implementing delay statements, so we assume the
+   --  caller is abort-deferred but is holding no locks.
+
+   procedure Timed_Delay
+     (Self_ID : Task_Id;
+      Time    : Duration;
+      Mode    : ST.Delay_Modes) renames Monotonic.Timed_Delay;
+
+   ---------------------
+   -- Monotonic_Clock --
+   ---------------------
+
+   function Monotonic_Clock return Duration renames Monotonic.Monotonic_Clock;
+
+   -------------------
+   -- RT_Resolution --
+   -------------------
+
+   function RT_Resolution return Duration renames Monotonic.RT_Resolution;
+
+   ------------
+   -- Wakeup --
+   ------------
+
+   procedure Wakeup (T : Task_Id; Reason : System.Tasking.Task_States) is
+      pragma Unreferenced (Reason);
+      Result : Interfaces.C.int;
+   begin
+      Result := pthread_cond_signal (T.Common.LL.CV'Access);
+      pragma Assert (Result = 0);
+   end Wakeup;
+
+   -----------
+   -- Yield --
+   -----------
+
+   procedure Yield (Do_Yield : Boolean := True) is
+      Result : Interfaces.C.int;
+      pragma Unreferenced (Result);
+   begin
+      if Do_Yield then
+         Result := sched_yield;
+      end if;
+   end Yield;
+
+   ------------------
+   -- Set_Priority --
+   ------------------
+
+   procedure Set_Priority
+     (T                   : Task_Id;
+      Prio                : System.Any_Priority;
+      Loss_Of_Inheritance : Boolean := False)
+   is
+      pragma Unreferenced (Loss_Of_Inheritance);
+
+      Result : Interfaces.C.int;
+      Param  : aliased struct_sched_param;
+
+      function Get_Policy (Prio : System.Any_Priority) return Character;
+      pragma Import (C, Get_Policy, "__gnat_get_specific_dispatching");
+      --  Get priority specific dispatching policy
+
+      Priority_Specific_Policy : constant Character := Get_Policy (Prio);
+      --  Upper case first character of the policy name corresponding to the
+      --  task as set by a Priority_Specific_Dispatching pragma.
+
+   begin
+      T.Common.Current_Priority := Prio;
+      Param.sched_priority := To_Target_Priority (Prio);
+
+      if Time_Slice_Supported
+        and then (Dispatching_Policy = 'R'
+                  or else Priority_Specific_Policy = 'R'
+                  or else Time_Slice_Val > 0)
+      then
+         Result := pthread_setschedparam
+           (T.Common.LL.Thread, SCHED_RR, Param'Access);
+
+      elsif Dispatching_Policy = 'F'
+        or else Priority_Specific_Policy = 'F'
+        or else Time_Slice_Val = 0
+      then
+         Result := pthread_setschedparam
+           (T.Common.LL.Thread, SCHED_FIFO, Param'Access);
+
+      else
+         Result := pthread_setschedparam
+           (T.Common.LL.Thread, SCHED_OTHER, Param'Access);
+      end if;
+
+      pragma Assert (Result = 0);
+   end Set_Priority;
+
+   ------------------
+   -- Get_Priority --
+   ------------------
+
+   function Get_Priority (T : Task_Id) return System.Any_Priority is
+   begin
+      return T.Common.Current_Priority;
+   end Get_Priority;
+
+   ----------------
+   -- Enter_Task --
+   ----------------
+
+   procedure Enter_Task (Self_ID : Task_Id) is
+   begin
+      Self_ID.Common.LL.Thread := pthread_self;
+      Self_ID.Common.LL.LWP := lwp_self;
+
+      Specific.Set (Self_ID);
+
+      if Use_Alternate_Stack then
+         declare
+            Stack  : aliased stack_t;
+            Result : Interfaces.C.int;
+         begin
+            Stack.ss_sp    := Self_ID.Common.Task_Alternate_Stack;
+            Stack.ss_size  := Alternate_Stack_Size;
+            Stack.ss_flags := 0;
+            Result := sigaltstack (Stack'Access, null);
+            pragma Assert (Result = 0);
+         end;
+      end if;
+   end Enter_Task;
+
+   -------------------
+   -- Is_Valid_Task --
+   -------------------
+
+   function Is_Valid_Task return Boolean renames Specific.Is_Valid_Task;
+
+   -----------------------------
+   -- Register_Foreign_Thread --
+   -----------------------------
+
+   function Register_Foreign_Thread return Task_Id is
+   begin
+      if Is_Valid_Task then
+         return Self;
+      else
+         return Register_Foreign_Thread (pthread_self);
+      end if;
+   end Register_Foreign_Thread;
+
+   --------------------
+   -- Initialize_TCB --
+   --------------------
+
+   procedure Initialize_TCB (Self_ID : Task_Id; Succeeded : out Boolean) is
+      Mutex_Attr : aliased pthread_mutexattr_t;
+      Result     : Interfaces.C.int;
+      Cond_Attr  : aliased pthread_condattr_t;
+
+   begin
+      --  Give the task a unique serial number
+
+      Self_ID.Serial_Number := Next_Serial_Number;
+      Next_Serial_Number := Next_Serial_Number + 1;
+      pragma Assert (Next_Serial_Number /= 0);
+
+      Result := pthread_mutexattr_init (Mutex_Attr'Access);
+      pragma Assert (Result = 0 or else Result = ENOMEM);
+
+      if Result = 0 then
+         if Locking_Policy = 'C' then
+            Result :=
+              pthread_mutexattr_setprotocol
+                (Mutex_Attr'Access,
+                 PTHREAD_PRIO_PROTECT);
+            pragma Assert (Result = 0);
+
+            Result :=
+              pthread_mutexattr_setprioceiling
+                (Mutex_Attr'Access,
+                 Interfaces.C.int (System.Any_Priority'Last));
+            pragma Assert (Result = 0);
+
+         elsif Locking_Policy = 'I' then
+            Result :=
+              pthread_mutexattr_setprotocol
+                (Mutex_Attr'Access,
+                 PTHREAD_PRIO_INHERIT);
+            pragma Assert (Result = 0);
+         end if;
+
+         Result :=
+           pthread_mutex_init
+                (Self_ID.Common.LL.L'Access,
+              Mutex_Attr'Access);
+         pragma Assert (Result = 0 or else Result = ENOMEM);
+      end if;
+
+      if Result /= 0 then
+         Succeeded := False;
+         return;
+      end if;
+
+      Result := pthread_mutexattr_destroy (Mutex_Attr'Access);
+      pragma Assert (Result = 0);
+
+      Result := pthread_condattr_init (Cond_Attr'Access);
+      pragma Assert (Result = 0 or else Result = ENOMEM);
+
+      if Result = 0 then
+         Result := GNAT_pthread_condattr_setup (Cond_Attr'Access);
+         pragma Assert (Result = 0);
+
+         Result :=
+           pthread_cond_init
+             (Self_ID.Common.LL.CV'Access, Cond_Attr'Access);
+         pragma Assert (Result = 0 or else Result = ENOMEM);
+      end if;
+
+      if Result = 0 then
+         Succeeded := True;
+      else
+         Result := pthread_mutex_destroy (Self_ID.Common.LL.L'Access);
+         pragma Assert (Result = 0);
+         Succeeded := False;
+      end if;
+
+      Result := pthread_condattr_destroy (Cond_Attr'Access);
+      pragma Assert (Result = 0);
+   end Initialize_TCB;
+
+   -----------------
+   -- Create_Task --
+   -----------------
+
+   procedure Create_Task
+     (T          : Task_Id;
+      Wrapper    : System.Address;
+      Stack_Size : System.Parameters.Size_Type;
+      Priority   : System.Any_Priority;
+      Succeeded  : out Boolean)
+   is
+      Attributes          : aliased pthread_attr_t;
+      Adjusted_Stack_Size : Interfaces.C.size_t;
+      Page_Size           : constant Interfaces.C.size_t :=
+                              Interfaces.C.size_t (Get_Page_Size);
+      Result              : Interfaces.C.int;
+
+      function Thread_Body_Access is new
+        Ada.Unchecked_Conversion (System.Address, Thread_Body);
+
+      use System.Task_Info;
+
+   begin
+      Adjusted_Stack_Size :=
+         Interfaces.C.size_t (Stack_Size + Alternate_Stack_Size);
+
+      if Stack_Base_Available then
+
+         --  If Stack Checking is supported then allocate 2 additional pages:
+
+         --  In the worst case, stack is allocated at something like
+         --  N * Get_Page_Size - epsilon, we need to add the size for 2 pages
+         --  to be sure the effective stack size is greater than what
+         --  has been asked.
+
+         Adjusted_Stack_Size := Adjusted_Stack_Size + 2 * Page_Size;
+      end if;
+
+      --  Round stack size as this is required by some OSes (Darwin)
+
+      Adjusted_Stack_Size := Adjusted_Stack_Size + Page_Size - 1;
+      Adjusted_Stack_Size :=
+        Adjusted_Stack_Size - Adjusted_Stack_Size mod Page_Size;
+
+      Result := pthread_attr_init (Attributes'Access);
+      pragma Assert (Result = 0 or else Result = ENOMEM);
+
+      if Result /= 0 then
+         Succeeded := False;
+         return;
+      end if;
+
+      Result :=
+        pthread_attr_setdetachstate
+          (Attributes'Access, PTHREAD_CREATE_DETACHED);
+      pragma Assert (Result = 0);
+
+      Result :=
+        pthread_attr_setstacksize
+          (Attributes'Access, Adjusted_Stack_Size);
+      pragma Assert (Result = 0);
+
+      if T.Common.Task_Info /= Default_Scope then
+         case T.Common.Task_Info is
+            when System.Task_Info.Process_Scope =>
+               Result :=
+                 pthread_attr_setscope
+                   (Attributes'Access, PTHREAD_SCOPE_PROCESS);
+
+            when System.Task_Info.System_Scope =>
+               Result :=
+                 pthread_attr_setscope
+                   (Attributes'Access, PTHREAD_SCOPE_SYSTEM);
+
+            when System.Task_Info.Default_Scope =>
+               Result := 0;
+         end case;
+
+         pragma Assert (Result = 0);
+      end if;
+
+      --  Since the initial signal mask of a thread is inherited from the
+      --  creator, and the Environment task has all its signals masked, we
+      --  do not need to manipulate caller's signal mask at this point.
+      --  All tasks in RTS will have All_Tasks_Mask initially.
+
+      --  Note: the use of Unrestricted_Access in the following call is needed
+      --  because otherwise we have an error of getting a access-to-volatile
+      --  value which points to a non-volatile object. But in this case it is
+      --  safe to do this, since we know we have no problems with aliasing and
+      --  Unrestricted_Access bypasses this check.
+
+      Result := pthread_create
+        (T.Common.LL.Thread'Unrestricted_Access,
+         Attributes'Access,
+         Thread_Body_Access (Wrapper),
+         To_Address (T));
+      pragma Assert (Result = 0 or else Result = EAGAIN);
+
+      Succeeded := Result = 0;
+
+      Result := pthread_attr_destroy (Attributes'Access);
+      pragma Assert (Result = 0);
+
+      if Succeeded then
+         Set_Priority (T, Priority);
+      end if;
+   end Create_Task;
+
+   ------------------
+   -- Finalize_TCB --
+   ------------------
+
+   procedure Finalize_TCB (T : Task_Id) is
+      Result : Interfaces.C.int;
+
+   begin
+      Result := pthread_mutex_destroy (T.Common.LL.L'Access);
+      pragma Assert (Result = 0);
+
+      Result := pthread_cond_destroy (T.Common.LL.CV'Access);
+      pragma Assert (Result = 0);
+
+      if T.Known_Tasks_Index /= -1 then
+         Known_Tasks (T.Known_Tasks_Index) := null;
+      end if;
+
+      ATCB_Allocation.Free_ATCB (T);
+   end Finalize_TCB;
+
+   ---------------
+   -- Exit_Task --
+   ---------------
+
+   procedure Exit_Task is
+   begin
+      --  Mark this task as unknown, so that if Self is called, it won't
+      --  return a dangling pointer.
+
+      Specific.Set (null);
+   end Exit_Task;
+
+   ----------------
+   -- Abort_Task --
+   ----------------
+
+   procedure Abort_Task (T : Task_Id) is
+      Result : Interfaces.C.int;
+   begin
+      if Abort_Handler_Installed then
+         Result :=
+           pthread_kill
+             (T.Common.LL.Thread,
+              Signal (System.Interrupt_Management.Abort_Task_Interrupt));
+         pragma Assert (Result = 0);
+      end if;
+   end Abort_Task;
+
+   ----------------
+   -- Initialize --
+   ----------------
+
+   procedure Initialize (S : in out Suspension_Object) is
+      Mutex_Attr : aliased pthread_mutexattr_t;
+      Cond_Attr  : aliased pthread_condattr_t;
+      Result     : Interfaces.C.int;
+
+   begin
+      --  Initialize internal state (always to False (RM D.10 (6)))
+
+      S.State := False;
+      S.Waiting := False;
+
+      --  Initialize internal mutex
+
+      Result := pthread_mutexattr_init (Mutex_Attr'Access);
+      pragma Assert (Result = 0 or else Result = ENOMEM);
+
+      if Result = ENOMEM then
+         raise Storage_Error;
+      end if;
+
+      Result := pthread_mutex_init (S.L'Access, Mutex_Attr'Access);
+      pragma Assert (Result = 0 or else Result = ENOMEM);
+
+      if Result = ENOMEM then
+         Result := pthread_mutexattr_destroy (Mutex_Attr'Access);
+         pragma Assert (Result = 0);
+
+         raise Storage_Error;
+      end if;
+
+      Result := pthread_mutexattr_destroy (Mutex_Attr'Access);
+      pragma Assert (Result = 0);
+
+      --  Initialize internal condition variable
+
+      Result := pthread_condattr_init (Cond_Attr'Access);
+      pragma Assert (Result = 0 or else Result = ENOMEM);
+
+      if Result /= 0 then
+         Result := pthread_mutex_destroy (S.L'Access);
+         pragma Assert (Result = 0);
+
+         --  Storage_Error is propagated as intended if the allocation of the
+         --  underlying OS entities fails.
+
+         raise Storage_Error;
+
+      else
+         Result := GNAT_pthread_condattr_setup (Cond_Attr'Access);
+         pragma Assert (Result = 0);
+      end if;
+
+      Result := pthread_cond_init (S.CV'Access, Cond_Attr'Access);
+      pragma Assert (Result = 0 or else Result = ENOMEM);
+
+      if Result /= 0 then
+         Result := pthread_mutex_destroy (S.L'Access);
+         pragma Assert (Result = 0);
+
+         Result := pthread_condattr_destroy (Cond_Attr'Access);
+         pragma Assert (Result = 0);
+
+         --  Storage_Error is propagated as intended if the allocation of the
+         --  underlying OS entities fails.
+
+         raise Storage_Error;
+      end if;
+
+      Result := pthread_condattr_destroy (Cond_Attr'Access);
+      pragma Assert (Result = 0);
+   end Initialize;
+
+   --------------
+   -- Finalize --
+   --------------
+
+   procedure Finalize (S : in out Suspension_Object) is
+      Result : Interfaces.C.int;
+
+   begin
+      --  Destroy internal mutex
+
+      Result := pthread_mutex_destroy (S.L'Access);
+      pragma Assert (Result = 0);
+
+      --  Destroy internal condition variable
+
+      Result := pthread_cond_destroy (S.CV'Access);
+      pragma Assert (Result = 0);
+   end Finalize;
+
+   -------------------
+   -- Current_State --
+   -------------------
+
+   function Current_State (S : Suspension_Object) return Boolean is
+   begin
+      --  We do not want to use lock on this read operation. State is marked
+      --  as Atomic so that we ensure that the value retrieved is correct.
+
+      return S.State;
+   end Current_State;
+
+   ---------------
+   -- Set_False --
+   ---------------
+
+   procedure Set_False (S : in out Suspension_Object) is
+      Result : Interfaces.C.int;
+
+   begin
+      SSL.Abort_Defer.all;
+
+      Result := pthread_mutex_lock (S.L'Access);
+      pragma Assert (Result = 0);
+
+      S.State := False;
+
+      Result := pthread_mutex_unlock (S.L'Access);
+      pragma Assert (Result = 0);
+
+      SSL.Abort_Undefer.all;
+   end Set_False;
+
+   --------------
+   -- Set_True --
+   --------------
+
+   procedure Set_True (S : in out Suspension_Object) is
+      Result : Interfaces.C.int;
+
+   begin
+      SSL.Abort_Defer.all;
+
+      Result := pthread_mutex_lock (S.L'Access);
+      pragma Assert (Result = 0);
+
+      --  If there is already a task waiting on this suspension object then
+      --  we resume it, leaving the state of the suspension object to False,
+      --  as it is specified in (RM D.10(9)). Otherwise, it just leaves
+      --  the state to True.
+
+      if S.Waiting then
+         S.Waiting := False;
+         S.State := False;
+
+         Result := pthread_cond_signal (S.CV'Access);
+         pragma Assert (Result = 0);
+
+      else
+         S.State := True;
+      end if;
+
+      Result := pthread_mutex_unlock (S.L'Access);
+      pragma Assert (Result = 0);
+
+      SSL.Abort_Undefer.all;
+   end Set_True;
+
+   ------------------------
+   -- Suspend_Until_True --
+   ------------------------
+
+   procedure Suspend_Until_True (S : in out Suspension_Object) is
+      Result : Interfaces.C.int;
+
+   begin
+      SSL.Abort_Defer.all;
+
+      Result := pthread_mutex_lock (S.L'Access);
+      pragma Assert (Result = 0);
+
+      if S.Waiting then
+
+         --  Program_Error must be raised upon calling Suspend_Until_True
+         --  if another task is already waiting on that suspension object
+         --  (RM D.10(10)).
+
+         Result := pthread_mutex_unlock (S.L'Access);
+         pragma Assert (Result = 0);
+
+         SSL.Abort_Undefer.all;
+
+         raise Program_Error;
+
+      else
+         --  Suspend the task if the state is False. Otherwise, the task
+         --  continues its execution, and the state of the suspension object
+         --  is set to False (ARM D.10 par. 9).
+
+         if S.State then
+            S.State := False;
+         else
+            S.Waiting := True;
+
+            loop
+               --  Loop in case pthread_cond_wait returns earlier than expected
+               --  (e.g. in case of EINTR caused by a signal).
+
+               Result := pthread_cond_wait (S.CV'Access, S.L'Access);
+               pragma Assert (Result = 0 or else Result = EINTR);
+
+               exit when not S.Waiting;
+            end loop;
+         end if;
+
+         Result := pthread_mutex_unlock (S.L'Access);
+         pragma Assert (Result = 0);
+
+         SSL.Abort_Undefer.all;
+      end if;
+   end Suspend_Until_True;
+
+   ----------------
+   -- Check_Exit --
+   ----------------
+
+   --  Dummy version
+
+   function Check_Exit (Self_ID : ST.Task_Id) return Boolean is
+      pragma Unreferenced (Self_ID);
+   begin
+      return True;
+   end Check_Exit;
+
+   --------------------
+   -- Check_No_Locks --
+   --------------------
+
+   function Check_No_Locks (Self_ID : ST.Task_Id) return Boolean is
+      pragma Unreferenced (Self_ID);
+   begin
+      return True;
+   end Check_No_Locks;
+
+   ----------------------
+   -- Environment_Task --
+   ----------------------
+
+   function Environment_Task return Task_Id is
+   begin
+      return Environment_Task_Id;
+   end Environment_Task;
+
+   --------------
+   -- Lock_RTS --
+   --------------
+
+   procedure Lock_RTS is
+   begin
+      Write_Lock (Single_RTS_Lock'Access);
+   end Lock_RTS;
+
+   ----------------
+   -- Unlock_RTS --
+   ----------------
+
+   procedure Unlock_RTS is
+   begin
+      Unlock (Single_RTS_Lock'Access);
+   end Unlock_RTS;
+
+   ------------------
+   -- Suspend_Task --
+   ------------------
+
+   function Suspend_Task
+     (T           : ST.Task_Id;
+      Thread_Self : Thread_Id) return Boolean
+   is
+      pragma Unreferenced (T, Thread_Self);
+   begin
+      return False;
+   end Suspend_Task;
+
+   -----------------
+   -- Resume_Task --
+   -----------------
+
+   function Resume_Task
+     (T           : ST.Task_Id;
+      Thread_Self : Thread_Id) return Boolean
+   is
+      pragma Unreferenced (T, Thread_Self);
+   begin
+      return False;
+   end Resume_Task;
+
+   --------------------
+   -- Stop_All_Tasks --
+   --------------------
+
+   procedure Stop_All_Tasks is
+   begin
+      null;
+   end Stop_All_Tasks;
+
+   ---------------
+   -- Stop_Task --
+   ---------------
+
+   function Stop_Task (T : ST.Task_Id) return Boolean is
+      pragma Unreferenced (T);
+   begin
+      return False;
+   end Stop_Task;
+
+   -------------------
+   -- Continue_Task --
+   -------------------
+
+   function Continue_Task (T : ST.Task_Id) return Boolean is
+      pragma Unreferenced (T);
+   begin
+      return False;
+   end Continue_Task;
+
+   ----------------
+   -- Initialize --
+   ----------------
+
+   procedure Initialize (Environment_Task : Task_Id) is
+      act     : aliased struct_sigaction;
+      old_act : aliased struct_sigaction;
+      Tmp_Set : aliased sigset_t;
+      Result  : Interfaces.C.int;
+
+      function State
+        (Int : System.Interrupt_Management.Interrupt_ID) return Character;
+      pragma Import (C, State, "__gnat_get_interrupt_state");
+      --  Get interrupt state.  Defined in a-init.c
+      --  The input argument is the interrupt number,
+      --  and the result is one of the following:
+
+      Default : constant Character := 's';
+      --    'n'   this interrupt not set by any Interrupt_State pragma
+      --    'u'   Interrupt_State pragma set state to User
+      --    'r'   Interrupt_State pragma set state to Runtime
+      --    's'   Interrupt_State pragma set state to System (use "default"
+      --           system handler)
+
+   begin
+      Environment_Task_Id := Environment_Task;
+
+      Interrupt_Management.Initialize;
+
+      --  Initialize the lock used to synchronize chain of all ATCBs
+
+      Initialize_Lock (Single_RTS_Lock'Access, RTS_Lock_Level);
+
+      Specific.Initialize (Environment_Task);
+
+      if Use_Alternate_Stack then
+         Environment_Task.Common.Task_Alternate_Stack :=
+           Alternate_Stack'Address;
+      end if;
+
+      --  Make environment task known here because it doesn't go through
+      --  Activate_Tasks, which does it for all other tasks.
+
+      Known_Tasks (Known_Tasks'First) := Environment_Task;
+      Environment_Task.Known_Tasks_Index := Known_Tasks'First;
+
+      Enter_Task (Environment_Task);
+
+      if State
+          (System.Interrupt_Management.Abort_Task_Interrupt) /= Default
+      then
+         act.sa_flags := 0;
+         act.sa_handler := Abort_Handler'Address;
+
+         Result := sigemptyset (Tmp_Set'Access);
+         pragma Assert (Result = 0);
+         act.sa_mask := Tmp_Set;
+
+         Result :=
+           sigaction
+             (Signal (System.Interrupt_Management.Abort_Task_Interrupt),
+              act'Unchecked_Access,
+              old_act'Unchecked_Access);
+         pragma Assert (Result = 0);
+         Abort_Handler_Installed := True;
+      end if;
+   end Initialize;
+
+   -----------------------
+   -- Set_Task_Affinity --
+   -----------------------
+
+   procedure Set_Task_Affinity (T : ST.Task_Id) is
+      pragma Unreferenced (T);
+
+   begin
+      --  Setting task affinity is not supported by the underlying system
+
+      null;
+   end Set_Task_Affinity;
+
+end System.Task_Primitives.Operations;
diff --git a/gcc/ada/libgnarl/s-taprop__solaris.adb b/gcc/ada/libgnarl/s-taprop__solaris.adb
index 4c449b6..faaaeea 100644
--- a/gcc/ada/libgnarl/s-taprop__solaris.adb
+++ b/gcc/ada/libgnarl/s-taprop__solaris.adb
@@ -128,13 +128,13 @@
    -- External Configuration Values --
    -----------------------------------
 
-   Time_Slice_Val : Integer;
+   Time_Slice_Val : constant Integer;
    pragma Import (C, Time_Slice_Val, "__gl_time_slice_val");
 
-   Locking_Policy : Character;
+   Locking_Policy : constant Character;
    pragma Import (C, Locking_Policy, "__gl_locking_policy");
 
-   Dispatching_Policy : Character;
+   Dispatching_Policy : constant Character;
    pragma Import (C, Dispatching_Policy, "__gl_task_dispatching_policy");
 
    Foreign_Task_Elaborated : aliased Boolean := True;
diff --git a/gcc/ada/libgnarl/s-taprop__vxworks.adb b/gcc/ada/libgnarl/s-taprop__vxworks.adb
index 273aca8..ff21410 100644
--- a/gcc/ada/libgnarl/s-taprop__vxworks.adb
+++ b/gcc/ada/libgnarl/s-taprop__vxworks.adb
@@ -88,13 +88,13 @@
 
    --  The followings are internal configuration constants needed
 
-   Dispatching_Policy : Character;
+   Dispatching_Policy : constant Character;
    pragma Import (C, Dispatching_Policy, "__gl_task_dispatching_policy");
 
    Foreign_Task_Elaborated : aliased Boolean := True;
    --  Used to identified fake tasks (i.e., non-Ada Threads)
 
-   Locking_Policy : Character;
+   Locking_Policy : constant Character;
    pragma Import (C, Locking_Policy, "__gl_locking_policy");
 
    Mutex_Protocol : Priority_Type;
@@ -104,7 +104,7 @@
    --  time; it is used to execute in mutual exclusion from all other tasks.
    --  Used to protect All_Tasks_List
 
-   Time_Slice_Val : Integer;
+   Time_Slice_Val : constant Integer;
    pragma Import (C, Time_Slice_Val, "__gl_time_slice_val");
 
    Null_Thread_Id : constant Thread_Id := 0;
diff --git a/gcc/ada/libgnarl/s-taskin.adb b/gcc/ada/libgnarl/s-taskin.adb
index 0090964..ab50af1 100644
--- a/gcc/ada/libgnarl/s-taskin.adb
+++ b/gcc/ada/libgnarl/s-taskin.adb
@@ -173,13 +173,13 @@
    Main_Task_Image : constant String := "main_task";
    --  Image of environment task
 
-   Main_Priority : Integer;
+   Main_Priority : constant Integer;
    pragma Import (C, Main_Priority, "__gl_main_priority");
    --  Priority for main task. Note that this is of type Integer, not Priority,
    --  because we use the value -1 to indicate the default main priority, and
    --  that is of course not in Priority'range.
 
-   Main_CPU : Integer;
+   Main_CPU : constant Integer;
    pragma Import (C, Main_CPU, "__gl_main_cpu");
    --  Affinity for main task. Note that this is of type Integer, not
    --  CPU_Range, because we use the value -1 to indicate the unassigned
diff --git a/gcc/ada/libgnarl/s-tasque.adb b/gcc/ada/libgnarl/s-tasque.adb
index 28f033a..79382c4 100644
--- a/gcc/ada/libgnarl/s-tasque.adb
+++ b/gcc/ada/libgnarl/s-tasque.adb
@@ -44,7 +44,7 @@
 
    --  Entry Queues implemented as doubly linked list
 
-   Queuing_Policy : Character;
+   Queuing_Policy : constant Character;
    pragma Import (C, Queuing_Policy, "__gl_queuing_policy");
 
    Priority_Queuing : constant Boolean := Queuing_Policy = 'P';
diff --git a/gcc/ada/libgnarl/s-tpoben.adb b/gcc/ada/libgnarl/s-tpoben.adb
index 896ee0c..0cb3677 100644
--- a/gcc/ada/libgnarl/s-tpoben.adb
+++ b/gcc/ada/libgnarl/s-tpoben.adb
@@ -58,7 +58,7 @@
    -- Local Data --
    ----------------
 
-   Locking_Policy : Character;
+   Locking_Policy : constant Character;
    pragma Import (C, Locking_Policy, "__gl_locking_policy");
 
    --------------
diff --git a/gcc/ada/libgnat/a-calend.adb b/gcc/ada/libgnat/a-calend.adb
index 5dedfc5..b24e95d 100644
--- a/gcc/ada/libgnat/a-calend.adb
+++ b/gcc/ada/libgnat/a-calend.adb
@@ -149,7 +149,7 @@
    -- Leap seconds control --
    --------------------------
 
-   Flag : Integer;
+   Flag : constant Integer;
    pragma Import (C, Flag, "__gl_leap_seconds_support");
    --  This imported value is used to determine whether the compilation had
    --  binder flag "-y" present which enables leap seconds. A value of zero
diff --git a/gcc/ada/libgnat/a-excach.adb b/gcc/ada/libgnat/a-excach.adb
index 3939287..a8e6a58 100644
--- a/gcc/ada/libgnat/a-excach.adb
+++ b/gcc/ada/libgnat/a-excach.adb
@@ -41,7 +41,7 @@
 separate (Ada.Exceptions)
 procedure Call_Chain (Excep : EOA) is
 
-   Exception_Tracebacks : Integer;
+   Exception_Tracebacks : constant Integer;
    pragma Import (C, Exception_Tracebacks, "__gl_exception_tracebacks");
    --  Boolean indicating whether tracebacks should be stored in exception
    --  occurrences.
diff --git a/gcc/ada/libgnat/a-except.adb b/gcc/ada/libgnat/a-except.adb
index 5933928..631c35a 100644
--- a/gcc/ada/libgnat/a-except.adb
+++ b/gcc/ada/libgnat/a-except.adb
@@ -1760,7 +1760,7 @@
    -- Wide_Exception_Name --
    -------------------------
 
-   WC_Encoding : Character;
+   WC_Encoding : constant Character;
    pragma Import (C, WC_Encoding, "__gl_wc_encoding");
    --  Encoding method for source, as exported by binder
 
diff --git a/gcc/ada/libgnat/g-io-put__vxworks.adb b/gcc/ada/libgnat/a-nbnbin__ghost.adb
similarity index 62%
rename from gcc/ada/libgnat/g-io-put__vxworks.adb
rename to gcc/ada/libgnat/a-nbnbin__ghost.adb
index 29307f9..7d22086 100644
--- a/gcc/ada/libgnat/g-io-put__vxworks.adb
+++ b/gcc/ada/libgnat/a-nbnbin__ghost.adb
@@ -2,11 +2,11 @@
 --                                                                          --
 --                         GNAT RUN-TIME COMPONENTS                         --
 --                                                                          --
---                              G N A T . I O                               --
+--                  ADA.NUMERICS.BIG_NUMBERS.BIG_INTEGERS                   --
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---                     Copyright (C) 1995-2021, AdaCore                     --
+--            Copyright (C) 2021, Free Software Foundation, Inc.            --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -29,25 +29,48 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
---  vxworks zfp version of Put (C : Character)
+--  This body is provided as a work-around for a GNAT compiler bug, as GNAT
+--  currently does not compile instantiations of the spec with imported ghost
+--  generics for packages Signed_Conversions and Unsigned_Conversions.
 
-with Interfaces.C; use Interfaces.C;
+package body Ada.Numerics.Big_Numbers.Big_Integers with
+   SPARK_Mode => Off
+is
 
-separate (GNAT.IO)
-procedure Put (C : Character) is
+   package body Signed_Conversions with
+     SPARK_Mode => Off
+   is
 
-   function ioGlobalStdGet
-     (File : int) return int;
-   pragma Import (C, ioGlobalStdGet, "ioGlobalStdGet");
+      function To_Big_Integer (Arg : Int) return Valid_Big_Integer is
+      begin
+         raise Program_Error;
+         return (null record);
+      end To_Big_Integer;
 
-   procedure fdprintf
-     (File   : int;
-      Format : String;
-      Value  : Character);
-   pragma Import (C, fdprintf, "fdprintf");
+      function From_Big_Integer (Arg : Valid_Big_Integer) return Int is
+      begin
+         raise Program_Error;
+         return 0;
+      end From_Big_Integer;
 
-   Stdout_ID : constant int := 1;
+   end Signed_Conversions;
 
-begin
-   fdprintf (ioGlobalStdGet (Stdout_ID), "%c" & ASCII.NUL, C);
-end Put;
+   package body Unsigned_Conversions with
+     SPARK_Mode => Off
+   is
+
+      function To_Big_Integer (Arg : Int) return Valid_Big_Integer is
+      begin
+         raise Program_Error;
+         return (null record);
+      end To_Big_Integer;
+
+      function From_Big_Integer (Arg : Valid_Big_Integer) return Int is
+      begin
+         raise Program_Error;
+         return 0;
+      end From_Big_Integer;
+
+   end Unsigned_Conversions;
+
+end Ada.Numerics.Big_Numbers.Big_Integers;
diff --git a/gcc/ada/libgnat/a-nbnbin__ghost.ads b/gcc/ada/libgnat/a-nbnbin__ghost.ads
new file mode 100644
index 0000000..3663dd7
--- /dev/null
+++ b/gcc/ada/libgnat/a-nbnbin__ghost.ads
@@ -0,0 +1,202 @@
+------------------------------------------------------------------------------
+--                                                                          --
+--                         GNAT RUN-TIME COMPONENTS                         --
+--                                                                          --
+--                  ADA.NUMERICS.BIG_NUMBERS.BIG_INTEGERS                   --
+--                                                                          --
+--                                 S p e c                                  --
+--                                                                          --
+-- This specification is derived from the Ada Reference Manual for use with --
+-- GNAT.  In accordance with the copyright of that document, you can freely --
+-- copy and modify this specification,  provided that if you redistribute a --
+-- modified version,  any changes that you have made are clearly indicated. --
+--                                                                          --
+------------------------------------------------------------------------------
+
+package Ada.Numerics.Big_Numbers.Big_Integers with
+   SPARK_Mode,
+   Ghost,
+   Preelaborate
+is
+   type Big_Integer is private
+     with Integer_Literal => From_Universal_Image;
+
+   function Is_Valid (Arg : Big_Integer) return Boolean
+   with
+     Import,
+     Global => null;
+
+   subtype Valid_Big_Integer is Big_Integer
+     with Dynamic_Predicate => Is_Valid (Valid_Big_Integer),
+          Predicate_Failure => raise Program_Error;
+
+   function "=" (L, R : Valid_Big_Integer) return Boolean with
+      Import,
+      Global => null;
+
+   function "<" (L, R : Valid_Big_Integer) return Boolean with
+      Import,
+      Global => null;
+
+   function "<=" (L, R : Valid_Big_Integer) return Boolean with
+      Import,
+      Global => null;
+
+   function ">" (L, R : Valid_Big_Integer) return Boolean with
+      Import,
+      Global => null;
+
+   function ">=" (L, R : Valid_Big_Integer) return Boolean with
+      Import,
+      Global => null;
+
+   function To_Big_Integer (Arg : Integer) return Valid_Big_Integer
+     with
+       Import,
+       Global => null;
+
+   subtype Big_Positive is Big_Integer
+     with Dynamic_Predicate =>
+            (if Is_Valid (Big_Positive)
+             then Big_Positive > To_Big_Integer (0)),
+          Predicate_Failure => (raise Constraint_Error);
+
+   subtype Big_Natural is Big_Integer
+     with Dynamic_Predicate =>
+            (if Is_Valid (Big_Natural)
+             then Big_Natural >= To_Big_Integer (0)),
+          Predicate_Failure => (raise Constraint_Error);
+
+   function In_Range
+     (Arg : Valid_Big_Integer; Low, High : Big_Integer) return Boolean
+   is (Low <= Arg and Arg <= High)
+   with
+     Import,
+     Global => null;
+
+   function To_Integer (Arg : Valid_Big_Integer) return Integer
+   with
+     Import,
+     Pre    => In_Range (Arg,
+                         Low  => To_Big_Integer (Integer'First),
+                         High => To_Big_Integer (Integer'Last))
+                or else (raise Constraint_Error),
+     Global => null;
+
+   generic
+      type Int is range <>;
+   package Signed_Conversions is
+
+      function To_Big_Integer (Arg : Int) return Valid_Big_Integer
+      with
+        Global => null;
+
+      function From_Big_Integer (Arg : Valid_Big_Integer) return Int
+      with
+        Pre    => In_Range (Arg,
+                            Low  => To_Big_Integer (Int'First),
+                            High => To_Big_Integer (Int'Last))
+                   or else (raise Constraint_Error),
+        Global => null;
+   end Signed_Conversions;
+
+   generic
+      type Int is mod <>;
+   package Unsigned_Conversions is
+
+      function To_Big_Integer (Arg : Int) return Valid_Big_Integer
+      with
+        Global => null;
+
+      function From_Big_Integer (Arg : Valid_Big_Integer) return Int
+      with
+        Pre    => In_Range (Arg,
+                            Low  => To_Big_Integer (Int'First),
+                            High => To_Big_Integer (Int'Last))
+                   or else (raise Constraint_Error),
+        Global => null;
+
+   end Unsigned_Conversions;
+
+   function From_String (Arg : String) return Valid_Big_Integer
+   with
+     Import,
+     Global => null;
+
+   function From_Universal_Image (Arg : String) return Valid_Big_Integer
+     renames From_String;
+
+   function "+" (L : Valid_Big_Integer) return Valid_Big_Integer
+   with
+     Import,
+     Global => null;
+
+   function "-" (L : Valid_Big_Integer) return Valid_Big_Integer
+   with
+     Import,
+     Global => null;
+
+   function "abs" (L : Valid_Big_Integer) return Valid_Big_Integer
+   with
+     Import,
+     Global => null;
+
+   function "+" (L, R : Valid_Big_Integer) return Valid_Big_Integer
+   with
+     Import,
+     Global => null;
+
+   function "-" (L, R : Valid_Big_Integer) return Valid_Big_Integer
+   with
+     Import,
+     Global => null;
+
+   function "*" (L, R : Valid_Big_Integer) return Valid_Big_Integer
+   with
+     Import,
+     Global => null;
+
+   function "/" (L, R : Valid_Big_Integer) return Valid_Big_Integer
+   with
+     Import,
+     Global => null;
+
+   function "mod" (L, R : Valid_Big_Integer) return Valid_Big_Integer
+   with
+     Import,
+     Global => null;
+
+   function "rem" (L, R : Valid_Big_Integer) return Valid_Big_Integer
+   with
+     Import,
+     Global => null;
+
+   function "**" (L : Valid_Big_Integer; R : Natural) return Valid_Big_Integer
+   with
+     Import,
+     Global => null;
+
+   function Min (L, R : Valid_Big_Integer) return Valid_Big_Integer
+   with
+     Import,
+     Global => null;
+
+   function Max (L, R : Valid_Big_Integer) return Valid_Big_Integer
+   with
+     Import,
+     Global => null;
+
+   function Greatest_Common_Divisor
+     (L, R : Valid_Big_Integer) return Big_Positive
+   with
+     Import,
+     Pre    => (L /= To_Big_Integer (0) and R /= To_Big_Integer (0))
+             or else (raise Constraint_Error),
+     Global => null;
+
+private
+   pragma SPARK_Mode (Off);
+
+   type Big_Integer is null record;
+
+end Ada.Numerics.Big_Numbers.Big_Integers;
diff --git a/gcc/ada/libgnat/a-nbnbin__gmp.adb b/gcc/ada/libgnat/a-nbnbin__gmp.adb
index 880e9a3..1516f49 100644
--- a/gcc/ada/libgnat/a-nbnbin__gmp.adb
+++ b/gcc/ada/libgnat/a-nbnbin__gmp.adb
@@ -327,7 +327,7 @@
    -- From_String --
    -----------------
 
-   function From_String (Arg : String) return Big_Integer is
+   function From_String (Arg : String) return Valid_Big_Integer is
       function mpz_set_str
         (this : access mpz_t;
          str  : System.Address;
diff --git a/gcc/ada/libgnat/a-strsup.ads b/gcc/ada/libgnat/a-strsup.ads
index 7428e9c..ae4339f 100644
--- a/gcc/ada/libgnat/a-strsup.ads
+++ b/gcc/ada/libgnat/a-strsup.ads
@@ -76,7 +76,8 @@
    --  that they can be renamed in Ada.Strings.Bounded.Generic_Bounded_Length.
 
    function Super_Length (Source : Super_String) return Natural
-   is (Source.Current_Length);
+   is (Source.Current_Length)
+   with Global => null;
 
    --------------------------------------------------------
    -- Conversion, Concatenation, and Selection Functions --
@@ -620,7 +621,8 @@
    is (if Index <= Source.Current_Length
        then Source.Data (Index)
        else raise Index_Error)
-   with Pre => Index <= Super_Length (Source);
+   with Pre    => Index <= Super_Length (Source),
+        Global => null;
 
    procedure Super_Replace_Element
      (Source : in out Super_String;
@@ -649,8 +651,9 @@
           --  get the null string in accordance with normal Ada slice rules.
 
           String (Source.Data (Low .. High)))
-   with Pre => Low - 1 <= Super_Length (Source)
-                 and then High <= Super_Length (Source);
+   with Pre    => Low - 1 <= Super_Length (Source)
+                    and then High <= Super_Length (Source),
+        Global => null;
 
    function Super_Slice
      (Source : Super_String;
diff --git a/gcc/ada/libgnat/a-strunb.adb b/gcc/ada/libgnat/a-strunb.adb
index 4727f965..0d62e4b 100644
--- a/gcc/ada/libgnat/a-strunb.adb
+++ b/gcc/ada/libgnat/a-strunb.adb
@@ -505,8 +505,14 @@
       --  Note: Don't try to free statically allocated null string
 
       if Object.Reference /= Null_String'Access then
-         Deallocate (Object.Reference);
-         Object.Reference := Null_Unbounded_String.Reference;
+         declare
+            Reference_Copy : String_Access := Object.Reference;
+            --  The original reference cannot be null, so we must create a
+            --  copy which will become null when deallocated.
+         begin
+            Deallocate (Reference_Copy);
+            Object.Reference := Null_Unbounded_String.Reference;
+         end;
          Object.Last := 0;
       end if;
    end Finalize;
diff --git a/gcc/ada/libgnat/a-strunb.ads b/gcc/ada/libgnat/a-strunb.ads
index b3050fd..2f5bd94 100644
--- a/gcc/ada/libgnat/a-strunb.ads
+++ b/gcc/ada/libgnat/a-strunb.ads
@@ -746,8 +746,8 @@
      renames To_Unbounded_String;
 
    type Unbounded_String is new AF.Controlled with record
-      Reference : String_Access := Null_String'Access;
-      Last      : Natural       := 0;
+      Reference : not null String_Access := Null_String'Access;
+      Last      : Natural                := 0;
    end record with Put_Image => Put_Image;
 
    procedure Put_Image
diff --git a/gcc/ada/libgnat/a-tags.adb b/gcc/ada/libgnat/a-tags.adb
index c6a9d25..170d16a 100644
--- a/gcc/ada/libgnat/a-tags.adb
+++ b/gcc/ada/libgnat/a-tags.adb
@@ -1032,7 +1032,7 @@
    -- Wide_Expanded_Name --
    ------------------------
 
-   WC_Encoding : Character;
+   WC_Encoding : constant Character;
    pragma Import (C, WC_Encoding, "__gl_wc_encoding");
    --  Encoding method for source, as exported by binder
 
diff --git a/gcc/ada/libgnat/a-textio.adb b/gcc/ada/libgnat/a-textio.adb
index 8667360..1bdab6e 100644
--- a/gcc/ada/libgnat/a-textio.adb
+++ b/gcc/ada/libgnat/a-textio.adb
@@ -67,7 +67,7 @@
 
    use type System.CRTL.size_t;
 
-   WC_Encoding : Character;
+   WC_Encoding : constant Character;
    pragma Import (C, WC_Encoding, "__gl_wc_encoding");
    --  Default wide character encoding
 
diff --git a/gcc/ada/libgnat/a-witeio.adb b/gcc/ada/libgnat/a-witeio.adb
index 7dbd3b3..dbc0f2a 100644
--- a/gcc/ada/libgnat/a-witeio.adb
+++ b/gcc/ada/libgnat/a-witeio.adb
@@ -55,7 +55,7 @@
 
    use type System.CRTL.size_t;
 
-   WC_Encoding : Character;
+   WC_Encoding : constant Character;
    pragma Import (C, WC_Encoding, "__gl_wc_encoding");
    --  Default wide character encoding
 
diff --git a/gcc/ada/libgnat/a-ztexio.adb b/gcc/ada/libgnat/a-ztexio.adb
index 71d733e..b72a1d4 100644
--- a/gcc/ada/libgnat/a-ztexio.adb
+++ b/gcc/ada/libgnat/a-ztexio.adb
@@ -55,7 +55,7 @@
 
    use type System.CRTL.size_t;
 
-   WC_Encoding : Character;
+   WC_Encoding : constant Character;
    pragma Import (C, WC_Encoding, "__gl_wc_encoding");
    --  Default wide character encoding
 
diff --git a/gcc/ada/libgnat/g-binenv.adb b/gcc/ada/libgnat/g-binenv.adb
index e10fb96..4bf39cd 100644
--- a/gcc/ada/libgnat/g-binenv.adb
+++ b/gcc/ada/libgnat/g-binenv.adb
@@ -40,7 +40,7 @@
    function Get (Key : String) return String is
       use type System.Address;
 
-      Bind_Env_Addr : System.Address;
+      Bind_Env_Addr : constant System.Address;
       pragma Import (C, Bind_Env_Addr, "__gl_bind_env_addr");
       --  Variable provided by init.c/s-init.ads, and initialized by
       --  the binder generated file.
diff --git a/gcc/ada/libgnat/s-aoinar.adb b/gcc/ada/libgnat/s-aoinar.adb
index 2f430ed..41d0cda 100644
--- a/gcc/ada/libgnat/s-aoinar.adb
+++ b/gcc/ada/libgnat/s-aoinar.adb
@@ -72,22 +72,10 @@
       Value : Atomic_Type) return Atomic_Type
    is
       pragma Warnings (Off);
-      function Atomic_Fetch_Add_1
+      function Atomic_Fetch_Add
         (Ptr : System.Address; Val : Atomic_Type; Model : Mem_Model := Seq_Cst)
         return Atomic_Type;
-      pragma Import (Intrinsic, Atomic_Fetch_Add_1, "__atomic_fetch_add_1");
-      function Atomic_Fetch_Add_2
-        (Ptr : System.Address; Val : Atomic_Type; Model : Mem_Model := Seq_Cst)
-        return Atomic_Type;
-      pragma Import (Intrinsic, Atomic_Fetch_Add_2, "__atomic_fetch_add_2");
-      function Atomic_Fetch_Add_4
-        (Ptr : System.Address; Val : Atomic_Type; Model : Mem_Model := Seq_Cst)
-        return Atomic_Type;
-      pragma Import (Intrinsic, Atomic_Fetch_Add_4, "__atomic_fetch_add_4");
-      function Atomic_Fetch_Add_8
-        (Ptr : System.Address; Val : Atomic_Type; Model : Mem_Model := Seq_Cst)
-        return Atomic_Type;
-      pragma Import (Intrinsic, Atomic_Fetch_Add_8, "__atomic_fetch_add_8");
+      pragma Import (Intrinsic, Atomic_Fetch_Add, "__atomic_fetch_add");
       pragma Warnings (On);
 
    begin
@@ -96,21 +84,14 @@
 
       if Atomic_Type'Base'Last = Atomic_Type'Last
         and then Atomic_Type'Base'First = Atomic_Type'First
-        and then Atomic_Type'Last
-                  in 2 ** 7 - 1 | 2 ** 15 - 1 | 2 ** 31 - 1 | 2 ** 63 - 1
+        and then Atomic_Type'Last = 2**(Atomic_Type'Object_Size - 1) - 1
       then
-         case Long_Long_Integer (Atomic_Type'Last) is
-            when 2 ** 7 - 1  =>
-               return Atomic_Fetch_Add_1 (Item'Address, Value);
-            when 2 ** 15 - 1 =>
-               return Atomic_Fetch_Add_2 (Item'Address, Value);
-            when 2 ** 31 - 1 =>
-               return Atomic_Fetch_Add_4 (Item'Address, Value);
-            when 2 ** 63 - 1 =>
-               return Atomic_Fetch_Add_8 (Item'Address, Value);
-            when others      =>
-               raise Program_Error;
-         end case;
+         if Atomic_Type'Object_Size in 8 | 16 | 32 | 64 then
+            return Atomic_Fetch_Add (Item'Address, Value);
+         else
+            raise Program_Error;
+         end if;
+
       else
          declare
             Old_Value : aliased Atomic_Type := Item;
@@ -138,22 +119,10 @@
       Value : Atomic_Type) return Atomic_Type
    is
       pragma Warnings (Off);
-      function Atomic_Fetch_Sub_1
+      function Atomic_Fetch_Sub
         (Ptr : System.Address; Val : Atomic_Type; Model : Mem_Model := Seq_Cst)
         return Atomic_Type;
-      pragma Import (Intrinsic, Atomic_Fetch_Sub_1, "__atomic_fetch_sub_1");
-      function Atomic_Fetch_Sub_2
-        (Ptr : System.Address; Val : Atomic_Type; Model : Mem_Model := Seq_Cst)
-        return Atomic_Type;
-      pragma Import (Intrinsic, Atomic_Fetch_Sub_2, "__atomic_fetch_sub_2");
-      function Atomic_Fetch_Sub_4
-        (Ptr : System.Address; Val : Atomic_Type; Model : Mem_Model := Seq_Cst)
-        return Atomic_Type;
-      pragma Import (Intrinsic, Atomic_Fetch_Sub_4, "__atomic_fetch_sub_4");
-      function Atomic_Fetch_Sub_8
-        (Ptr : System.Address; Val : Atomic_Type; Model : Mem_Model := Seq_Cst)
-        return Atomic_Type;
-      pragma Import (Intrinsic, Atomic_Fetch_Sub_8, "__atomic_fetch_sub_8");
+      pragma Import (Intrinsic, Atomic_Fetch_Sub, "__atomic_fetch_sub");
       pragma Warnings (On);
 
    begin
@@ -162,21 +131,14 @@
 
       if Atomic_Type'Base'Last = Atomic_Type'Last
         and then Atomic_Type'Base'First = Atomic_Type'First
-        and then Atomic_Type'Last
-                  in 2 ** 7 - 1 | 2 ** 15 - 1 | 2 ** 31 - 1 | 2 ** 63 - 1
+        and then Atomic_Type'Last = 2**(Atomic_Type'Object_Size - 1) - 1
       then
-         case Long_Long_Integer (Atomic_Type'Last) is
-            when 2 ** 7 - 1  =>
-               return Atomic_Fetch_Sub_1 (Item'Address, Value);
-            when 2 ** 15 - 1 =>
-               return Atomic_Fetch_Sub_2 (Item'Address, Value);
-            when 2 ** 31 - 1 =>
-               return Atomic_Fetch_Sub_4 (Item'Address, Value);
-            when 2 ** 63 - 1 =>
-               return Atomic_Fetch_Sub_8 (Item'Address, Value);
-            when others      =>
-               raise Program_Error;
-         end case;
+         if Atomic_Type'Object_Size in 8 | 16 | 32 | 64 then
+            return Atomic_Fetch_Sub (Item'Address, Value);
+         else
+            raise Program_Error;
+         end if;
+
       else
          declare
             Old_Value : aliased Atomic_Type := Item;
diff --git a/gcc/ada/libgnat/s-aomoar.adb b/gcc/ada/libgnat/s-aomoar.adb
index a6f4b0e..617a5b3 100644
--- a/gcc/ada/libgnat/s-aomoar.adb
+++ b/gcc/ada/libgnat/s-aomoar.adb
@@ -72,48 +72,26 @@
       Value : Atomic_Type) return Atomic_Type
    is
       pragma Warnings (Off);
-      function Atomic_Fetch_Add_1
+      function Atomic_Fetch_Add
         (Ptr : System.Address; Val : Atomic_Type; Model : Mem_Model := Seq_Cst)
         return Atomic_Type;
-      pragma Import (Intrinsic, Atomic_Fetch_Add_1, "__atomic_fetch_add_1");
-      function Atomic_Fetch_Add_2
-        (Ptr : System.Address; Val : Atomic_Type; Model : Mem_Model := Seq_Cst)
-        return Atomic_Type;
-      pragma Import (Intrinsic, Atomic_Fetch_Add_2, "__atomic_fetch_add_2");
-      function Atomic_Fetch_Add_4
-        (Ptr : System.Address; Val : Atomic_Type; Model : Mem_Model := Seq_Cst)
-        return Atomic_Type;
-      pragma Import (Intrinsic, Atomic_Fetch_Add_4, "__atomic_fetch_add_4");
-      function Atomic_Fetch_Add_8
-        (Ptr : System.Address; Val : Atomic_Type; Model : Mem_Model := Seq_Cst)
-        return Atomic_Type;
-      pragma Import (Intrinsic, Atomic_Fetch_Add_8, "__atomic_fetch_add_8");
+      pragma Import (Intrinsic, Atomic_Fetch_Add, "__atomic_fetch_add");
       pragma Warnings (On);
 
    begin
       --  Use the direct intrinsics when possible, and fallback to
       --  compare-and-exchange otherwise.
-      --  Also suppress spurious warnings.
 
-      pragma Warnings (Off);
       if Atomic_Type'Base'Last = Atomic_Type'Last
         and then Atomic_Type'First = 0
-        and then Atomic_Type'Last
-                  in 2 ** 8 - 1 | 2 ** 16 - 1 | 2 ** 32 - 1 | 2 ** 64 - 1
+        and then Atomic_Type'Last = 2**Atomic_Type'Object_Size - 1
       then
-         pragma Warnings (On);
-         case Unsigned_64 (Atomic_Type'Last) is
-            when 2 ** 8 - 1  =>
-               return Atomic_Fetch_Add_1 (Item'Address, Value);
-            when 2 ** 16 - 1 =>
-               return Atomic_Fetch_Add_2 (Item'Address, Value);
-            when 2 ** 32 - 1 =>
-               return Atomic_Fetch_Add_4 (Item'Address, Value);
-            when 2 ** 64 - 1 =>
-               return Atomic_Fetch_Add_8 (Item'Address, Value);
-            when others      =>
-               raise Program_Error;
-         end case;
+         if Atomic_Type'Object_Size in 8 | 16 | 32 | 64 then
+            return Atomic_Fetch_Add (Item'Address, Value);
+         else
+            raise Program_Error;
+         end if;
+
       else
          declare
             Old_Value : aliased Atomic_Type := Item;
@@ -141,48 +119,26 @@
       Value : Atomic_Type) return Atomic_Type
    is
       pragma Warnings (Off);
-      function Atomic_Fetch_Sub_1
+      function Atomic_Fetch_Sub
         (Ptr : System.Address; Val : Atomic_Type; Model : Mem_Model := Seq_Cst)
         return Atomic_Type;
-      pragma Import (Intrinsic, Atomic_Fetch_Sub_1, "__atomic_fetch_sub_1");
-      function Atomic_Fetch_Sub_2
-        (Ptr : System.Address; Val : Atomic_Type; Model : Mem_Model := Seq_Cst)
-        return Atomic_Type;
-      pragma Import (Intrinsic, Atomic_Fetch_Sub_2, "__atomic_fetch_sub_2");
-      function Atomic_Fetch_Sub_4
-        (Ptr : System.Address; Val : Atomic_Type; Model : Mem_Model := Seq_Cst)
-        return Atomic_Type;
-      pragma Import (Intrinsic, Atomic_Fetch_Sub_4, "__atomic_fetch_sub_4");
-      function Atomic_Fetch_Sub_8
-        (Ptr : System.Address; Val : Atomic_Type; Model : Mem_Model := Seq_Cst)
-        return Atomic_Type;
-      pragma Import (Intrinsic, Atomic_Fetch_Sub_8, "__atomic_fetch_sub_8");
+      pragma Import (Intrinsic, Atomic_Fetch_Sub, "__atomic_fetch_sub");
       pragma Warnings (On);
 
    begin
       --  Use the direct intrinsics when possible, and fallback to
       --  compare-and-exchange otherwise.
-      --  Also suppress spurious warnings.
 
-      pragma Warnings (Off);
       if Atomic_Type'Base'Last = Atomic_Type'Last
         and then Atomic_Type'First = 0
-        and then Atomic_Type'Last
-                  in 2 ** 8 - 1 | 2 ** 16 - 1 | 2 ** 32 - 1 | 2 ** 64 - 1
+        and then Atomic_Type'Last = 2**Atomic_Type'Object_Size - 1
       then
-         pragma Warnings (On);
-         case Unsigned_64 (Atomic_Type'Last) is
-            when 2 ** 8 - 1  =>
-               return Atomic_Fetch_Sub_1 (Item'Address, Value);
-            when 2 ** 16 - 1 =>
-               return Atomic_Fetch_Sub_2 (Item'Address, Value);
-            when 2 ** 32 - 1 =>
-               return Atomic_Fetch_Sub_4 (Item'Address, Value);
-            when 2 ** 64 - 1 =>
-               return Atomic_Fetch_Sub_8 (Item'Address, Value);
-            when others      =>
-               raise Program_Error;
-         end case;
+         if Atomic_Type'Object_Size in 8 | 16 | 32 | 64 then
+            return Atomic_Fetch_Sub (Item'Address, Value);
+         else
+            raise Program_Error;
+         end if;
+
       else
          declare
             Old_Value : aliased Atomic_Type := Item;
diff --git a/gcc/ada/libgnat/s-atopex.adb b/gcc/ada/libgnat/s-atopex.adb
index b0aa9e5..65e9433 100644
--- a/gcc/ada/libgnat/s-atopex.adb
+++ b/gcc/ada/libgnat/s-atopex.adb
@@ -43,36 +43,19 @@
       Value : Atomic_Type) return Atomic_Type
    is
       pragma Warnings (Off);
-      function Atomic_Exchange_1
+      function Atomic_Exchange
         (Ptr   : System.Address;
          Val   : Atomic_Type;
          Model : Mem_Model := Seq_Cst) return Atomic_Type;
-      pragma Import (Intrinsic, Atomic_Exchange_1, "__atomic_exchange_1");
-      function Atomic_Exchange_2
-        (Ptr   : System.Address;
-         Val   : Atomic_Type;
-         Model : Mem_Model := Seq_Cst) return Atomic_Type;
-      pragma Import (Intrinsic, Atomic_Exchange_2, "__atomic_exchange_2");
-      function Atomic_Exchange_4
-        (Ptr   : System.Address;
-         Val   : Atomic_Type;
-         Model : Mem_Model := Seq_Cst) return Atomic_Type;
-      pragma Import (Intrinsic, Atomic_Exchange_4, "__atomic_exchange_4");
-      function Atomic_Exchange_8
-        (Ptr   : System.Address;
-         Val   : Atomic_Type;
-         Model : Mem_Model := Seq_Cst) return Atomic_Type;
-      pragma Import (Intrinsic, Atomic_Exchange_8, "__atomic_exchange_8");
+      pragma Import (Intrinsic, Atomic_Exchange, "__atomic_exchange_n");
       pragma Warnings (On);
 
    begin
-      case Atomic_Type'Object_Size is
-         when 8      => return Atomic_Exchange_1 (Item'Address, Value);
-         when 16     => return Atomic_Exchange_2 (Item'Address, Value);
-         when 32     => return Atomic_Exchange_4 (Item'Address, Value);
-         when 64     => return Atomic_Exchange_8 (Item'Address, Value);
-         when others => raise Program_Error;
-      end case;
+      if Atomic_Type'Object_Size in 8 | 16 | 32 | 64 then
+         return Atomic_Exchange (Item'Address, Value);
+      else
+         raise Program_Error;
+      end if;
    end Atomic_Exchange;
 
    ---------------------------------
@@ -85,7 +68,7 @@
       Desired : Atomic_Type) return Boolean
    is
       pragma Warnings (Off);
-      function Atomic_Compare_Exchange_1
+      function Atomic_Compare_Exchange
         (Ptr           : System.Address;
          Expected      : System.Address;
          Desired       : Atomic_Type;
@@ -93,53 +76,15 @@
          Success_Model : Mem_Model := Seq_Cst;
          Failure_Model : Mem_Model := Seq_Cst) return Boolean;
       pragma Import
-        (Intrinsic, Atomic_Compare_Exchange_1, "__atomic_compare_exchange_1");
-      function Atomic_Compare_Exchange_2
-        (Ptr           : System.Address;
-         Expected      : System.Address;
-         Desired       : Atomic_Type;
-         Weak          : Boolean := False;
-         Success_Model : Mem_Model := Seq_Cst;
-         Failure_Model : Mem_Model := Seq_Cst) return Boolean;
-      pragma Import
-        (Intrinsic, Atomic_Compare_Exchange_2, "__atomic_compare_exchange_2");
-      function Atomic_Compare_Exchange_4
-        (Ptr           : System.Address;
-         Expected      : System.Address;
-         Desired       : Atomic_Type;
-         Weak          : Boolean := False;
-         Success_Model : Mem_Model := Seq_Cst;
-         Failure_Model : Mem_Model := Seq_Cst) return Boolean;
-      pragma Import
-        (Intrinsic, Atomic_Compare_Exchange_4, "__atomic_compare_exchange_4");
-      function Atomic_Compare_Exchange_8
-        (Ptr           : System.Address;
-         Expected      : System.Address;
-         Desired       : Atomic_Type;
-         Weak          : Boolean := False;
-         Success_Model : Mem_Model := Seq_Cst;
-         Failure_Model : Mem_Model := Seq_Cst) return Boolean;
-      pragma Import
-        (Intrinsic, Atomic_Compare_Exchange_8, "__atomic_compare_exchange_8");
+        (Intrinsic, Atomic_Compare_Exchange, "__atomic_compare_exchange_n");
       pragma Warnings (On);
 
    begin
-      case Atomic_Type'Object_Size is
-         when 8 =>
-            return
-              Atomic_Compare_Exchange_1 (Item'Address, Prior'Address, Desired);
-         when 16 =>
-            return
-              Atomic_Compare_Exchange_2 (Item'Address, Prior'Address, Desired);
-         when 32 =>
-            return
-              Atomic_Compare_Exchange_4 (Item'Address, Prior'Address, Desired);
-         when 64 =>
-            return
-              Atomic_Compare_Exchange_8 (Item'Address, Prior'Address, Desired);
-         when others =>
-            raise Program_Error;
-      end case;
+      if Atomic_Type'Object_Size in 8 | 16 | 32 | 64 then
+         return Atomic_Compare_Exchange (Item'Address, Prior'Address, Desired);
+      else
+         raise Program_Error;
+      end if;
    end Atomic_Compare_And_Exchange;
 
    ------------------
diff --git a/gcc/ada/libgnat/s-atopri.adb b/gcc/ada/libgnat/s-atopri.adb
index ba284f0..20aa666 100644
--- a/gcc/ada/libgnat/s-atopri.adb
+++ b/gcc/ada/libgnat/s-atopri.adb
@@ -31,74 +31,39 @@
 
 package body System.Atomic_Primitives is
 
-   ----------------------
-   -- Lock_Free_Read_8 --
-   ----------------------
+   --------------------
+   -- Lock_Free_Read --
+   --------------------
 
-   function Lock_Free_Read_8 (Ptr : Address) return uint8 is
+   function Lock_Free_Read (Ptr : Address) return Atomic_Type is
+      function My_Atomic_Load is new Atomic_Load (Atomic_Type);
+
    begin
-      if uint8'Atomic_Always_Lock_Free then
-         return Atomic_Load_8 (Ptr, Acquire);
+      if Atomic_Type'Atomic_Always_Lock_Free then
+         return My_Atomic_Load (Ptr, Acquire);
       else
          raise Program_Error;
       end if;
-   end Lock_Free_Read_8;
+   end Lock_Free_Read;
 
-   -----------------------
-   -- Lock_Free_Read_16 --
-   -----------------------
+   -------------------------
+   -- Lock_Free_Try_Write --
+   -------------------------
 
-   function Lock_Free_Read_16 (Ptr : Address) return uint16 is
-   begin
-      if uint16'Atomic_Always_Lock_Free then
-         return Atomic_Load_16 (Ptr, Acquire);
-      else
-         raise Program_Error;
-      end if;
-   end Lock_Free_Read_16;
-
-   -----------------------
-   -- Lock_Free_Read_32 --
-   -----------------------
-
-   function Lock_Free_Read_32 (Ptr : Address) return uint32 is
-   begin
-      if uint32'Atomic_Always_Lock_Free then
-         return Atomic_Load_32 (Ptr, Acquire);
-      else
-         raise Program_Error;
-      end if;
-   end Lock_Free_Read_32;
-
-   -----------------------
-   -- Lock_Free_Read_64 --
-   -----------------------
-
-   function Lock_Free_Read_64 (Ptr : Address) return uint64 is
-   begin
-      if uint64'Atomic_Always_Lock_Free then
-         return Atomic_Load_64 (Ptr, Acquire);
-      else
-         raise Program_Error;
-      end if;
-   end Lock_Free_Read_64;
-
-   ---------------------------
-   -- Lock_Free_Try_Write_8 --
-   ---------------------------
-
-   function Lock_Free_Try_Write_8
+   function Lock_Free_Try_Write
       (Ptr      : Address;
-       Expected : in out uint8;
-       Desired  : uint8) return Boolean
+       Expected : in out Atomic_Type;
+       Desired  : Atomic_Type) return Boolean
    is
-      Actual : uint8;
+      function My_Sync_Compare_And_Swap is
+        new Sync_Compare_And_Swap (Atomic_Type);
+
+      Actual : Atomic_Type;
 
    begin
       if Expected /= Desired then
-
-         if uint8'Atomic_Always_Lock_Free then
-            Actual := Sync_Compare_And_Swap_8 (Ptr, Expected, Desired);
+         if Atomic_Type'Atomic_Always_Lock_Free then
+            Actual := My_Sync_Compare_And_Swap (Ptr, Expected, Desired);
          else
             raise Program_Error;
          end if;
@@ -110,92 +75,6 @@
       end if;
 
       return True;
-   end Lock_Free_Try_Write_8;
+   end Lock_Free_Try_Write;
 
-   ----------------------------
-   -- Lock_Free_Try_Write_16 --
-   ----------------------------
-
-   function Lock_Free_Try_Write_16
-      (Ptr      : Address;
-       Expected : in out uint16;
-       Desired  : uint16) return Boolean
-   is
-      Actual : uint16;
-
-   begin
-      if Expected /= Desired then
-
-         if uint16'Atomic_Always_Lock_Free then
-            Actual := Sync_Compare_And_Swap_16 (Ptr, Expected, Desired);
-         else
-            raise Program_Error;
-         end if;
-
-         if Actual /= Expected then
-            Expected := Actual;
-            return False;
-         end if;
-      end if;
-
-      return True;
-   end Lock_Free_Try_Write_16;
-
-   ----------------------------
-   -- Lock_Free_Try_Write_32 --
-   ----------------------------
-
-   function Lock_Free_Try_Write_32
-      (Ptr      : Address;
-       Expected : in out uint32;
-       Desired  : uint32) return Boolean
-   is
-      Actual : uint32;
-
-   begin
-      if Expected /= Desired then
-
-         if uint32'Atomic_Always_Lock_Free then
-            Actual := Sync_Compare_And_Swap_32 (Ptr, Expected, Desired);
-         else
-            raise Program_Error;
-         end if;
-
-         if Actual /= Expected then
-            Expected := Actual;
-            return False;
-         end if;
-      end if;
-
-      return True;
-   end Lock_Free_Try_Write_32;
-
-   ----------------------------
-   -- Lock_Free_Try_Write_64 --
-   ----------------------------
-
-   function Lock_Free_Try_Write_64
-      (Ptr      : Address;
-       Expected : in out uint64;
-       Desired  : uint64) return Boolean
-   is
-      Actual : uint64;
-
-   begin
-      if Expected /= Desired then
-
-         if uint64'Atomic_Always_Lock_Free then
-            Actual := Sync_Compare_And_Swap_64 (Ptr, Expected, Desired);
-         else
-            raise Program_Error;
-         end if;
-
-         if Actual /= Expected then
-            Expected := Actual;
-            return False;
-         end if;
-      end if;
-
-      return True;
-   end Lock_Free_Try_Write_64;
 end System.Atomic_Primitives;
diff --git a/gcc/ada/libgnat/s-atopri.ads b/gcc/ada/libgnat/s-atopri.ads
index 891b2ed..ea03f1a 100644
--- a/gcc/ada/libgnat/s-atopri.ads
+++ b/gcc/ada/libgnat/s-atopri.ads
@@ -29,7 +29,7 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
---  This package contains both atomic primitives defined from gcc built-in
+--  This package contains both atomic primitives defined from GCC built-in
 --  functions and operations used by the compiler to generate the lock-free
 --  implementation of protected objects.
 
@@ -66,71 +66,31 @@
    -- GCC built-in atomic primitives --
    ------------------------------------
 
-   function Atomic_Load_8
+   generic
+      type Atomic_Type is mod <>;
+   function Atomic_Load
      (Ptr   : Address;
-      Model : Mem_Model := Seq_Cst) return uint8;
-   pragma Import (Intrinsic, Atomic_Load_8, "__atomic_load_1");
+      Model : Mem_Model := Seq_Cst) return Atomic_Type;
+   pragma Import (Intrinsic, Atomic_Load, "__atomic_load_n");
 
-   function Atomic_Load_16
-     (Ptr   : Address;
-      Model : Mem_Model := Seq_Cst) return uint16;
-   pragma Import (Intrinsic, Atomic_Load_16, "__atomic_load_2");
+   function Atomic_Load_8  is new Atomic_Load (uint8);
+   function Atomic_Load_16 is new Atomic_Load (uint16);
+   function Atomic_Load_32 is new Atomic_Load (uint32);
+   function Atomic_Load_64 is new Atomic_Load (uint64);
 
-   function Atomic_Load_32
-     (Ptr   : Address;
-      Model : Mem_Model := Seq_Cst) return uint32;
-   pragma Import (Intrinsic, Atomic_Load_32, "__atomic_load_4");
-
-   function Atomic_Load_64
-     (Ptr   : Address;
-      Model : Mem_Model := Seq_Cst) return uint64;
-   pragma Import (Intrinsic, Atomic_Load_64, "__atomic_load_8");
-
-   function Sync_Compare_And_Swap_8
+   generic
+      type Atomic_Type is mod <>;
+   function Sync_Compare_And_Swap
      (Ptr      : Address;
-      Expected : uint8;
-      Desired  : uint8) return uint8;
-   pragma Import (Intrinsic,
-                  Sync_Compare_And_Swap_8,
-                  "__sync_val_compare_and_swap_1");
+      Expected : Atomic_Type;
+      Desired  : Atomic_Type) return Atomic_Type;
+   pragma Import
+     (Intrinsic, Sync_Compare_And_Swap, "__sync_val_compare_and_swap");
 
-   function Sync_Compare_And_Swap_16
-     (Ptr      : Address;
-      Expected : uint16;
-      Desired  : uint16) return uint16;
-   pragma Import (Intrinsic,
-                  Sync_Compare_And_Swap_16,
-                  "__sync_val_compare_and_swap_2");
-
-   function Sync_Compare_And_Swap_32
-     (Ptr      : Address;
-      Expected : uint32;
-      Desired  : uint32) return uint32;
-   pragma Import (Intrinsic,
-                  Sync_Compare_And_Swap_32,
-                  "__sync_val_compare_and_swap_4");
-
-   function Sync_Compare_And_Swap_64
-     (Ptr      : Address;
-      Expected : uint64;
-      Desired  : uint64) return uint64;
-   pragma Import (Intrinsic,
-                  Sync_Compare_And_Swap_64,
-                  "__sync_val_compare_and_swap_8");
-
-   --  ??? We might want to switch to the __atomic series of builtins for
-   --  compare-and-swap operations at some point.
-
-   --  function Atomic_Compare_Exchange_8
-   --    (Ptr           : Address;
-   --     Expected      : Address;
-   --     Desired       : uint8;
-   --     Weak          : Boolean   := False;
-   --     Success_Model : Mem_Model := Seq_Cst;
-   --     Failure_Model : Mem_Model := Seq_Cst) return Boolean;
-   --  pragma Import (Intrinsic,
-   --                 Atomic_Compare_Exchange_8,
-   --                 "__atomic_compare_exchange_1");
+   function Sync_Compare_And_Swap_8  is new Sync_Compare_And_Swap (uint8);
+   function Sync_Compare_And_Swap_16 is new Sync_Compare_And_Swap (uint16);
+   function Sync_Compare_And_Swap_32 is new Sync_Compare_And_Swap (uint32);
+   function Sync_Compare_And_Swap_64 is new Sync_Compare_And_Swap (uint64);
 
    function Atomic_Test_And_Set
      (Ptr   : System.Address;
@@ -155,46 +115,37 @@
    --  The lock-free implementation uses two atomic instructions for the
    --  expansion of protected operations:
 
-   --  * Lock_Free_Read_N atomically loads the value of the protected component
-   --    accessed by the current protected operation.
+   --  * Lock_Free_Read atomically loads the value contained in Ptr (with the
+   --    Acquire synchronization mode).
 
-   --  * Lock_Free_Try_Write_N tries to write the Desired value into Ptr only
-   --    if Expected and Desired mismatch.
+   --  * Lock_Free_Try_Write atomically tries to write the Desired value into
+   --    Ptr if Ptr contains the Expected value. It returns true if the value
+   --    in Ptr was changed, or False if it was not, in which case Expected is
+   --    updated to the unexpected value in Ptr. Note that it does nothing and
+   --    returns true if Desired and Expected are equal.
 
-   function Lock_Free_Read_8 (Ptr : Address) return uint8;
+   generic
+      type Atomic_Type is mod <>;
+   function Lock_Free_Read (Ptr : Address) return Atomic_Type;
 
-   function Lock_Free_Read_16 (Ptr : Address) return uint16;
+   function Lock_Free_Read_8  is new Lock_Free_Read (uint8);
+   function Lock_Free_Read_16 is new Lock_Free_Read (uint16);
+   function Lock_Free_Read_32 is new Lock_Free_Read (uint32);
+   function Lock_Free_Read_64 is new Lock_Free_Read (uint64);
 
-   function Lock_Free_Read_32 (Ptr : Address) return uint32;
+   generic
+      type Atomic_Type is mod <>;
+   function Lock_Free_Try_Write
+     (Ptr      : Address;
+      Expected : in out Atomic_Type;
+      Desired  : Atomic_Type) return Boolean;
 
-   function Lock_Free_Read_64 (Ptr : Address) return uint64;
+   function Lock_Free_Try_Write_8  is new Lock_Free_Try_Write (uint8);
+   function Lock_Free_Try_Write_16 is new Lock_Free_Try_Write (uint16);
+   function Lock_Free_Try_Write_32 is new Lock_Free_Try_Write (uint32);
+   function Lock_Free_Try_Write_64 is new Lock_Free_Try_Write (uint64);
 
-   function Lock_Free_Try_Write_8
-      (Ptr      : Address;
-       Expected : in out uint8;
-       Desired  : uint8) return Boolean;
-
-   function Lock_Free_Try_Write_16
-      (Ptr      : Address;
-       Expected : in out uint16;
-       Desired  : uint16) return Boolean;
-
-   function Lock_Free_Try_Write_32
-      (Ptr      : Address;
-       Expected : in out uint32;
-       Desired  : uint32) return Boolean;
-
-   function Lock_Free_Try_Write_64
-      (Ptr      : Address;
-       Expected : in out uint64;
-       Desired  : uint64) return Boolean;
-
-   pragma Inline (Lock_Free_Read_8);
-   pragma Inline (Lock_Free_Read_16);
-   pragma Inline (Lock_Free_Read_32);
-   pragma Inline (Lock_Free_Read_64);
-   pragma Inline (Lock_Free_Try_Write_8);
-   pragma Inline (Lock_Free_Try_Write_16);
-   pragma Inline (Lock_Free_Try_Write_32);
-   pragma Inline (Lock_Free_Try_Write_64);
+private
+   pragma Inline (Lock_Free_Read);
+   pragma Inline (Lock_Free_Try_Write);
 end System.Atomic_Primitives;
diff --git a/gcc/ada/libgnat/s-parame.adb b/gcc/ada/libgnat/s-parame.adb
index 9001626..09a65ee 100644
--- a/gcc/ada/libgnat/s-parame.adb
+++ b/gcc/ada/libgnat/s-parame.adb
@@ -55,7 +55,7 @@
    ------------------------
 
    function Default_Stack_Size return Size_Type is
-      Default_Stack_Size : Integer;
+      Default_Stack_Size : constant Integer;
       pragma Import (C, Default_Stack_Size, "__gl_default_stack_size");
    begin
       if Default_Stack_Size = -1 then
diff --git a/gcc/ada/libgnat/s-parame__ae653.ads b/gcc/ada/libgnat/s-parame__ae653.ads
deleted file mode 100644
index f838b41..0000000
--- a/gcc/ada/libgnat/s-parame__ae653.ads
+++ /dev/null
@@ -1,192 +0,0 @@
-------------------------------------------------------------------------------
---                                                                          --
---                         GNAT COMPILER COMPONENTS                         --
---                                                                          --
---                    S Y S T E M . P A R A M E T E R S                     --
---                                                                          --
---                                 S p e c                                  --
---                                                                          --
---          Copyright (C) 1992-2021, Free Software Foundation, Inc.         --
---                                                                          --
--- GNAT is free software;  you can  redistribute it  and/or modify it under --
--- terms of the  GNU General Public License as published  by the Free Soft- --
--- ware  Foundation;  either version 3,  or (at your option) any later ver- --
--- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE.                                     --
---                                                                          --
--- As a special exception under Section 7 of GPL version 3, you are granted --
--- additional permissions described in the GCC Runtime Library Exception,   --
--- version 3.1, as published by the Free Software Foundation.               --
---                                                                          --
--- You should have received a copy of the GNU General Public License and    --
--- a copy of the GCC Runtime Library Exception along with this program;     --
--- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
--- <http://www.gnu.org/licenses/>.                                          --
---                                                                          --
--- GNAT was originally developed  by the GNAT team at  New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc.      --
---                                                                          --
-------------------------------------------------------------------------------
-
---  Version is used by VxWorks 653, VxWorks MILS, and VxWorks6 cert Ravenscar
-
---  This package defines some system dependent parameters for GNAT. These
---  are values that are referenced by the runtime library and are therefore
---  relevant to the target machine.
-
---  The parameters whose value is defined in the spec are not generally
---  expected to be changed. If they are changed, it will be necessary to
---  recompile the run-time library.
-
---  The parameters which are defined by functions can be changed by modifying
---  the body of System.Parameters in file s-parame.adb. A change to this body
---  requires only rebinding and relinking of the application.
-
---  Note: do not introduce any pragma Inline statements into this unit, since
---  otherwise the relinking and rebinding capability would be deactivated.
-
-package System.Parameters is
-   pragma Pure;
-
-   ---------------------------------------
-   -- Task And Stack Allocation Control --
-   ---------------------------------------
-
-   type Size_Type is range
-     -(2 ** (Integer'(Standard'Address_Size) - 1)) ..
-     +(2 ** (Integer'(Standard'Address_Size) - 1)) - 1;
-   --  Type used to provide task stack sizes to the runtime. Sized to permit
-   --  stack sizes of up to half the total addressable memory space. This may
-   --  seem excessively large (even for 32-bit systems), however there are many
-   --  instances of users requiring large stack sizes (for example string
-   --  processing).
-
-   Unspecified_Size : constant Size_Type := Size_Type'First;
-   --  Value used to indicate that no size type is set
-
-   function Default_Stack_Size return Size_Type;
-   --  Default task stack size used if none is specified
-
-   function Minimum_Stack_Size return Size_Type;
-   --  Minimum task stack size permitted
-
-   function Adjust_Storage_Size (Size : Size_Type) return Size_Type;
-   --  Given the storage size stored in the TCB, return the Storage_Size
-   --  value required by the RM for the Storage_Size attribute. The
-   --  required adjustment is as follows:
-   --
-   --    when Size = Unspecified_Size, return Default_Stack_Size
-   --    when Size < Minimum_Stack_Size, return Minimum_Stack_Size
-   --    otherwise return given Size
-
-   Default_Env_Stack_Size : constant Size_Type := 14_336;
-   --  Assumed size of the environment task, if no other information
-   --  is available. This value is used when stack checking is
-   --  enabled and no GNAT_STACK_LIMIT environment variable is set.
-   --  This value is chosen as the VxWorks default stack size is 20kB,
-   --  and a little more than 4kB is necessary for the run time.
-
-   Stack_Grows_Down  : constant Boolean := True;
-   --  This constant indicates whether the stack grows up (False) or
-   --  down (True) in memory as functions are called. It is used for
-   --  proper implementation of the stack overflow check.
-
-   Runtime_Default_Sec_Stack_Size : constant Size_Type := 10 * 1024;
-   --  The run-time chosen default size for secondary stacks that may be
-   --  overridden by the user with the use of binder -D switch.
-
-   Sec_Stack_Dynamic : constant Boolean := False;
-   --  Indicates if secondary stacks can grow and shrink at run-time. If False,
-   --  the size of a secondary stack is fixed at the point of its creation.
-
-   ------------------------------------
-   -- Characteristics of time_t type --
-   ------------------------------------
-
-   time_t_bits : constant := Long_Integer'Size;
-   --  Number of bits in type time_t
-
-   ----------------------------------------------
-   -- Characteristics of types in Interfaces.C --
-   ----------------------------------------------
-
-   long_bits : constant := Long_Integer'Size;
-   --  Number of bits in type long and unsigned_long. The normal convention
-   --  is that this is the same as type Long_Integer, but this may not be true
-   --  of all targets.
-
-   ptr_bits  : constant := Standard'Address_Size;
-   subtype C_Address is System.Address;
-   --  Number of bits in Interfaces.C pointers, normally a standard address
-
-   C_Malloc_Linkname : constant String := "__gnat_malloc";
-   --  Name of runtime function used to allocate such a pointer
-
-   ----------------------------------------------
-   -- Behavior of Pragma Finalize_Storage_Only --
-   ----------------------------------------------
-
-   --  Garbage_Collected is a Boolean constant whose value indicates the
-   --  effect of the pragma Finalize_Storage_Entry on a controlled type.
-
-   --    Garbage_Collected = False
-
-   --      The system releases all storage on program termination only,
-   --      but not other garbage collection occurs, so finalization calls
-   --      are omitted only for outer level objects can be omitted if
-   --      pragma Finalize_Storage_Only is used.
-
-   --    Garbage_Collected = True
-
-   --      The system provides full garbage collection, so it is never
-   --      necessary to release storage for controlled objects for which
-   --      a pragma Finalize_Storage_Only is used.
-
-   Garbage_Collected : constant Boolean := False;
-   --  The storage mode for this system (release on program exit)
-
-   ---------------------
-   -- Tasking Profile --
-   ---------------------
-
-   --  In the following sections, constant parameters are defined to
-   --  allow some optimizations and fine tuning within the tasking run time
-   --  based on restrictions on the tasking features.
-
-   -------------------
-   -- Task Abortion --
-   -------------------
-
-   No_Abort : constant Boolean := False;
-   --  This constant indicates whether abort statements and asynchronous
-   --  transfer of control (ATC) are disallowed. If set to True, it is
-   --  assumed that neither construct is used, and the run time does not
-   --  need to defer/undefer abort and check for pending actions at
-   --  completion points. A value of True for No_Abort corresponds to:
-   --  pragma Restrictions (No_Abort_Statements);
-   --  pragma Restrictions (Max_Asynchronous_Select_Nesting => 0);
-
-   ---------------------
-   -- Task Attributes --
-   ---------------------
-
-   Max_Attribute_Count : constant := 8;
-   --  Number of task attributes stored in the task control block
-
-   -----------------------
-   -- Task Image Length --
-   -----------------------
-
-   Max_Task_Image_Length : constant := 32;
-   --  This constant specifies the maximum length of a task's image
-
-   ------------------------------
-   -- Exception Message Length --
-   ------------------------------
-
-   Default_Exception_Msg_Max_Length : constant := 200;
-   --  This constant specifies the default number of characters to allow
-   --  in an exception message (200 is minimum required by RM 11.4.1(18)).
-
-end System.Parameters;
diff --git a/gcc/ada/libgnat/s-parame__rtems.adb b/gcc/ada/libgnat/s-parame__rtems.adb
index 1a6d577..ae88a2c 100644
--- a/gcc/ada/libgnat/s-parame__rtems.adb
+++ b/gcc/ada/libgnat/s-parame__rtems.adb
@@ -35,10 +35,6 @@
 
 package body System.Parameters is
 
-   function ada_pthread_minimum_stack_size return Interfaces.C.size_t;
-   pragma Import (C, ada_pthread_minimum_stack_size,
-     "_ada_pthread_minimum_stack_size");
-
    -------------------------
    -- Adjust_Storage_Size --
    -------------------------
@@ -61,8 +57,15 @@
    ------------------------
 
    function Default_Stack_Size return Size_Type is
+      Default_Stack_Size : constant Integer
+        with Import, Convention => C,
+             External_Name => "__gl_default_stack_size";
    begin
-      return Size_Type (ada_pthread_minimum_stack_size);
+      if Default_Stack_Size = -1 then
+         return 32 * 1024;
+      else
+         return Size_Type (Default_Stack_Size);
+      end if;
    end Default_Stack_Size;
 
    ------------------------
@@ -70,9 +73,11 @@
    ------------------------
 
    function Minimum_Stack_Size return Size_Type is
-
+      POSIX_Threads_Minimum_stack_size : constant Interfaces.C.size_t
+        with Import, Convention => C,
+             External_Name => "_POSIX_Threads_Minimum_stack_size";
    begin
-      return Size_Type (ada_pthread_minimum_stack_size);
+      return Size_Type (POSIX_Threads_Minimum_stack_size);
    end Minimum_Stack_Size;
 
 end System.Parameters;
diff --git a/gcc/ada/libgnat/s-parame__vxworks.adb b/gcc/ada/libgnat/s-parame__vxworks.adb
index 5970eb0..45ee0a9 100644
--- a/gcc/ada/libgnat/s-parame__vxworks.adb
+++ b/gcc/ada/libgnat/s-parame__vxworks.adb
@@ -53,7 +53,7 @@
    ------------------------
 
    function Default_Stack_Size return Size_Type is
-      Default_Stack_Size : Integer;
+      Default_Stack_Size : constant Integer;
       pragma Import (C, Default_Stack_Size, "__gl_default_stack_size");
    begin
       if Default_Stack_Size = -1 then
diff --git a/gcc/ada/libgnat/s-stchop__rtems.adb b/gcc/ada/libgnat/s-stchop__rtems.adb
deleted file mode 100644
index f273f29..0000000
--- a/gcc/ada/libgnat/s-stchop__rtems.adb
+++ /dev/null
@@ -1,113 +0,0 @@
-------------------------------------------------------------------------------
---                                                                          --
---                 GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS                 --
---                                                                          --
---     S Y S T E M . S T A C K _ C H E C K I N G . O P E R A T I O N S      --
---                                                                          --
---                                  B o d y                                 --
---                                                                          --
---          Copyright (C) 1999-2021, Free Software Foundation, Inc.         --
---                                                                          --
--- GNARL is free software; you can  redistribute it  and/or modify it under --
--- terms of the  GNU General Public License as published  by the Free Soft- --
--- ware  Foundation;  either version 3,  or (at your option) any later ver- --
--- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE.                                     --
---                                                                          --
--- As a special exception under Section 7 of GPL version 3, you are granted --
--- additional permissions described in the GCC Runtime Library Exception,   --
--- version 3.1, as published by the Free Software Foundation.               --
---                                                                          --
--- You should have received a copy of the GNU General Public License and    --
--- a copy of the GCC Runtime Library Exception along with this program;     --
--- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
--- <http://www.gnu.org/licenses/>.                                          --
---                                                                          --
--- GNARL was developed by the GNARL team at Florida State University.       --
--- Extensive contributions were provided by Ada Core Technologies, Inc.     --
---                                                                          --
-------------------------------------------------------------------------------
-
---  This is the RTEMS version of this package.
---  This file should be kept synchronized with the general implementation
---  provided by s-stchop.adb.
-
-pragma Restrictions (No_Elaboration_Code);
---  We want to guarantee the absence of elaboration code because the
---  binder does not handle references to this package.
-
-with Ada.Exceptions;
-
-with Interfaces.C; use Interfaces.C;
-
-package body System.Stack_Checking.Operations is
-
-   ----------------------------
-   -- Invalidate_Stack_Cache --
-   ----------------------------
-
-   procedure Invalidate_Stack_Cache (Any_Stack : Stack_Access) is
-      pragma Warnings (Off, Any_Stack);
-   begin
-      Cache := Null_Stack;
-   end Invalidate_Stack_Cache;
-
-   -----------------------------
-   -- Notify_Stack_Attributes --
-   -----------------------------
-
-   procedure Notify_Stack_Attributes
-     (Initial_SP : System.Address;
-      Size       : System.Storage_Elements.Storage_Offset)
-   is
-
-      --  RTEMS keeps all the information we need.
-
-      pragma Unreferenced (Size);
-      pragma Unreferenced (Initial_SP);
-
-   begin
-      null;
-   end Notify_Stack_Attributes;
-
-   -----------------
-   -- Stack_Check --
-   -----------------
-
-   function Stack_Check
-     (Stack_Address : System.Address) return Stack_Access
-   is
-      pragma Unreferenced (Stack_Address);
-
-      --  RTEMS has a routine to check if the stack is blown.
-      --  It returns a C99 bool.
-      function rtems_stack_checker_is_blown return Interfaces.C.unsigned_char;
-      pragma Import (C,
-         rtems_stack_checker_is_blown, "rtems_stack_checker_is_blown");
-
-   begin
-      --  RTEMS has a routine to check this.  So use it.
-
-      if rtems_stack_checker_is_blown /= 0 then
-         Ada.Exceptions.Raise_Exception
-           (E       => Storage_Error'Identity,
-            Message => "stack overflow detected");
-      end if;
-
-      return null;
-
-   end Stack_Check;
-
-   ------------------------
-   -- Update_Stack_Cache --
-   ------------------------
-
-   procedure Update_Stack_Cache (Stack : Stack_Access) is
-   begin
-      if not Multi_Processor then
-         Cache := Stack;
-      end if;
-   end Update_Stack_Cache;
-
-end System.Stack_Checking.Operations;
diff --git a/gcc/ada/libgnat/s-stratt.adb b/gcc/ada/libgnat/s-stratt.adb
index 5f04153..d7f572e 100644
--- a/gcc/ada/libgnat/s-stratt.adb
+++ b/gcc/ada/libgnat/s-stratt.adb
@@ -36,13 +36,13 @@
 
 package body System.Stream_Attributes is
 
-   XDR_Flag : Integer;
-   pragma Import (C, XDR_Flag, "__gl_xdr_stream");
+   XDR_Stream : constant Integer;
+   pragma Import (C, XDR_Stream, "__gl_xdr_stream");
    --  This imported value is used to determine whether the build had the
    --  binder switch "-xdr" present which enables XDR streaming and sets this
    --  flag to 1.
 
-   function XDR_Support return Boolean;
+   function XDR_Support return Boolean is (XDR_Stream = 1);
    pragma Inline (XDR_Support);
    --  Return True if XDR streaming should be used. Note that 128-bit integers
    --  are not supported by the XDR protocol and will raise Device_Error.
@@ -142,15 +142,6 @@
    function To_WWC  is new UC (S_WWC,  Wide_Wide_Character);
 
    -----------------
-   -- XDR_Support --
-   -----------------
-
-   function XDR_Support return Boolean is
-   begin
-      return XDR_Flag = 1;
-   end XDR_Support;
-
-   -----------------
    -- Block_IO_OK --
    -----------------
 
diff --git a/gcc/ada/libgnat/s-thread.ads b/gcc/ada/libgnat/s-thread.ads
deleted file mode 100644
index 5d0a3c1..0000000
--- a/gcc/ada/libgnat/s-thread.ads
+++ /dev/null
@@ -1,92 +0,0 @@
-------------------------------------------------------------------------------
---                                                                          --
---                         GNAT COMPILER COMPONENTS                         --
---                                                                          --
---                       S Y S T E M . T H R E A D S                        --
---                                                                          --
---                                 S p e c                                  --
---                                                                          --
---          Copyright (C) 1992-2021, Free Software Foundation, Inc.         --
---                                                                          --
--- GNAT is free software;  you can  redistribute it  and/or modify it under --
--- terms of the  GNU General Public License as published  by the Free Soft- --
--- ware  Foundation;  either version 3,  or (at your option) any later ver- --
--- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE.                                     --
---                                                                          --
--- As a special exception under Section 7 of GPL version 3, you are granted --
--- additional permissions described in the GCC Runtime Library Exception,   --
--- version 3.1, as published by the Free Software Foundation.               --
---                                                                          --
--- You should have received a copy of the GNU General Public License and    --
--- a copy of the GCC Runtime Library Exception along with this program;     --
--- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
--- <http://www.gnu.org/licenses/>.                                          --
---                                                                          --
--- GNAT was originally developed  by the GNAT team at  New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc.      --
---                                                                          --
-------------------------------------------------------------------------------
-
---  This package provides facilities to register a thread to the runtime,
---  and allocate its task specific datas.
-
---  This package is currently implemented for:
-
---    VxWorks AE653 rts-cert
---    VxWorks AE653 rts-full (not rts-kernel)
-
-with Ada.Exceptions;
-with Ada.Unchecked_Conversion;
-
-with Interfaces.C;
-
-with System.Secondary_Stack;
-with System.Soft_Links;
-
-package System.Threads is
-
-   package SST renames System.Secondary_Stack;
-
-   type ATSD is limited private;
-   --  Type of the Ada thread specific data. It contains datas needed
-   --  by the GNAT runtime.
-
-   type ATSD_Access is access ATSD;
-   function From_Address is
-     new Ada.Unchecked_Conversion (Address, ATSD_Access);
-
-   subtype STATUS is Interfaces.C.int;
-   --  Equivalent of the C type STATUS
-
-   type t_id is new Interfaces.C.long;
-   subtype Thread_Id is t_id;
-
-   function Register (T : Thread_Id) return STATUS;
-   --  Create the task specific data necessary for Ada language support
-
-   --------------------------
-   -- Thread Body Handling --
-   --------------------------
-
-   --  The subprograms in this section are called from the process body
-   --  wrapper in the APEX process registration package.
-
-   procedure Thread_Body_Enter
-     (Sec_Stack_Ptr        : SST.SS_Stack_Ptr;
-      Process_ATSD_Address : System.Address);
-   --  Enter thread body, see above for details
-
-   procedure Thread_Body_Leave;
-   --  Leave thread body (normally), see above for details
-
-   procedure Thread_Body_Exceptional_Exit
-     (EO : Ada.Exceptions.Exception_Occurrence);
-   --  Leave thread body (abnormally on exception), see above for details
-
-private
-
-   type ATSD is new System.Soft_Links.TSD;
-
-end System.Threads;
diff --git a/gcc/ada/libgnat/s-thread__ae653.adb b/gcc/ada/libgnat/s-thread__ae653.adb
deleted file mode 100644
index ecbd415..0000000
--- a/gcc/ada/libgnat/s-thread__ae653.adb
+++ /dev/null
@@ -1,227 +0,0 @@
-------------------------------------------------------------------------------
---                                                                          --
---                         GNAT COMPILER COMPONENTS                         --
---                                                                          --
---                       S Y S T E M . T H R E A D S                        --
---                                                                          --
---                                 B o d y                                  --
---                                                                          --
---          Copyright (C) 1992-2021, Free Software Foundation, Inc.         --
---                                                                          --
--- GNAT is free software;  you can  redistribute it  and/or modify it under --
--- terms of the  GNU General Public License as published  by the Free Soft- --
--- ware  Foundation;  either version 3,  or (at your option) any later ver- --
--- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE.                                     --
---                                                                          --
--- As a special exception under Section 7 of GPL version 3, you are granted --
--- additional permissions described in the GCC Runtime Library Exception,   --
--- version 3.1, as published by the Free Software Foundation.               --
---                                                                          --
--- You should have received a copy of the GNU General Public License and    --
--- a copy of the GCC Runtime Library Exception along with this program;     --
--- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
--- <http://www.gnu.org/licenses/>.                                          --
---                                                                          --
--- GNAT was originally developed  by the GNAT team at  New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc.      --
---                                                                          --
-------------------------------------------------------------------------------
-
---  This is the VxWorks 653 version of this package
-
-pragma Restrictions (No_Tasking);
---  The VxWorks 653 version of this package is intended only for programs
---  which do not use Ada tasking. This restriction ensures that this
---  will be checked by the binder.
-
-with System.Storage_Elements; use System.Storage_Elements;
-with System.OS_Versions; use System.OS_Versions;
-
-package body System.Threads is
-
-   use Interfaces.C;
-
-   package SSL renames System.Soft_Links;
-
-   Main_ATSD : aliased ATSD;
-   --  TSD for environment task
-
-   Current_ATSD : aliased System.Address := System.Null_Address;
-   pragma Thread_Local_Storage (Current_ATSD);
-   --  pragma TLS needed since TaskVarAdd no longer available
-
-   --  Assume guard pages for Helix APEX partitions, but leave
-   --  checking mechanism in for now, in case of surprises. ???
-   Stack_Limit : Address;
-   pragma Import (C, Stack_Limit, "__gnat_stack_limit");
-
-   type Set_Stack_Limit_Proc_Acc is access procedure;
-   pragma Convention (C, Set_Stack_Limit_Proc_Acc);
-
-   Set_Stack_Limit_Hook : Set_Stack_Limit_Proc_Acc;
-   pragma Import (C, Set_Stack_Limit_Hook, "__gnat_set_stack_limit_hook");
-   --  Procedure to be called when a task is created to set stack limit if
-   --  limit checking is used.
-
-   --  VxWorks specific API
-
-   ERROR : constant STATUS := Interfaces.C.int (-1);
-   OK    : constant STATUS := Interfaces.C.int (0);
-
-   function taskIdVerify (tid : t_id) return STATUS;
-   pragma Import (C, taskIdVerify, "taskIdVerify");
-
-   function taskIdSelf return t_id;
-   pragma Import (C, taskIdSelf, "taskIdSelf");
-
-   -----------------------
-   -- Local Subprograms --
-   -----------------------
-
-   procedure Init_RTS;
-   --  This procedure performs the initialization of the run-time lib.
-   --  It installs System.Threads versions of certain operations of the
-   --  run-time lib.
-
-   procedure Install_Handler;
-   pragma Import (C, Install_Handler, "__gnat_install_handler");
-
-   function  Get_Sec_Stack return SST.SS_Stack_Ptr;
-
-   procedure Set_Sec_Stack (Stack : SST.SS_Stack_Ptr);
-
-   -----------------------
-   -- Thread_Body_Enter --
-   -----------------------
-
-   procedure Thread_Body_Enter
-     (Sec_Stack_Ptr        : SST.SS_Stack_Ptr;
-      Process_ATSD_Address : System.Address)
-   is
-
-      ATSD : constant ATSD_Access := From_Address (Process_ATSD_Address);
-
-   begin
-
-      ATSD.Sec_Stack_Ptr := Sec_Stack_Ptr;
-      SST.SS_Init (ATSD.Sec_Stack_Ptr);
-      Current_ATSD := Process_ATSD_Address;
-      Install_Handler;
-
-      --  Assume guard pages for Helix/Vx7, but leave in for now ???
-      --  Initialize stack limit if needed.
-
-      if Current_ATSD /= Main_ATSD'Address
-        and then Set_Stack_Limit_Hook /= null
-      then
-         Set_Stack_Limit_Hook.all;
-      end if;
-   end Thread_Body_Enter;
-
-   ----------------------------------
-   -- Thread_Body_Exceptional_Exit --
-   ----------------------------------
-
-   procedure Thread_Body_Exceptional_Exit
-     (EO : Ada.Exceptions.Exception_Occurrence)
-   is
-      pragma Unreferenced (EO);
-
-   begin
-      --  No action for this target
-
-      null;
-   end Thread_Body_Exceptional_Exit;
-
-   -----------------------
-   -- Thread_Body_Leave --
-   -----------------------
-
-   procedure Thread_Body_Leave is
-   begin
-      --  No action for this target
-
-      null;
-   end Thread_Body_Leave;
-
-   --------------
-   -- Init_RTS --
-   --------------
-
-   procedure Init_RTS is
-      --  Register environment task
-      Result : constant Interfaces.C.int := Register (taskIdSelf);
-      pragma Assert (Result /= ERROR);
-
-   begin
-      Main_ATSD.Sec_Stack_Ptr := SSL.Get_Sec_Stack_NT;
-      Current_ATSD := Main_ATSD'Address;
-      Install_Handler;
-      SSL.Get_Sec_Stack := Get_Sec_Stack'Access;
-      SSL.Set_Sec_Stack := Set_Sec_Stack'Access;
-   end Init_RTS;
-
-   -------------------
-   -- Get_Sec_Stack --
-   -------------------
-
-   function  Get_Sec_Stack return SST.SS_Stack_Ptr is
-      CTSD : constant ATSD_Access := From_Address (Current_ATSD);
-   begin
-      pragma Assert (CTSD /= null);
-      return CTSD.Sec_Stack_Ptr;
-   end Get_Sec_Stack;
-
-   --------------
-   -- Register --
-   --------------
-
-   function Register (T : Thread_Id) return STATUS is
-   begin
-      --  It cannot be assumed that the caller of this routine has a ATSD;
-      --  so neither this procedure nor the procedures that it calls should
-      --  raise or handle exceptions, or make use of a secondary stack.
-
-      if taskIdVerify (T) = ERROR then
-         return ERROR;
-      end if;
-
-      Current_ATSD := To_Address (Integer_Address (T));
-
-      --  The same issue applies to the task variable that contains the stack
-      --  limit when that overflow checking mechanism is used instead of
-      --  probing. If stack checking is enabled and limit checking is used,
-      --  allocate the limit for this task. The environment task has this
-      --  initialized by the binder-generated main when
-      --  System.Stack_Check_Limits = True.
-
-      pragma Warnings (Off);
-
-      --  OS is a constant
-      if OS /= VxWorks_653 and then Set_Stack_Limit_Hook /= null then
-         --  Check that this is correct if limit checking left in. ???
-         Stack_Limit := To_Address (Integer_Address (T));
-      end if;
-      pragma Warnings (On);
-
-      return OK;
-   end Register;
-
-   -------------------
-   -- Set_Sec_Stack --
-   -------------------
-
-   procedure Set_Sec_Stack (Stack : SST.SS_Stack_Ptr) is
-      CTSD : constant ATSD_Access := From_Address (Current_ATSD);
-   begin
-      pragma Assert (CTSD /= null);
-      CTSD.Sec_Stack_Ptr := Stack;
-   end Set_Sec_Stack;
-
-begin
-   --  Initialize run-time library
-
-   Init_RTS;
-end System.Threads;
diff --git a/gcc/ada/libgnat/s-trasym__dwarf.adb b/gcc/ada/libgnat/s-trasym__dwarf.adb
index 61e7a1c..fb26d77 100644
--- a/gcc/ada/libgnat/s-trasym__dwarf.adb
+++ b/gcc/ada/libgnat/s-trasym__dwarf.adb
@@ -691,7 +691,7 @@
       return Symbolic_Traceback (E, Suppress_Hex => True);
    end Symbolic_Traceback_No_Hex;
 
-   Exception_Tracebacks_Symbolic : Integer;
+   Exception_Tracebacks_Symbolic : constant Integer;
    pragma Import
      (C,
       Exception_Tracebacks_Symbolic,
diff --git a/gcc/ada/libgnat/s-widlllu.ads b/gcc/ada/libgnat/s-widlllu.ads
index 018e740..10a0c9c 100644
--- a/gcc/ada/libgnat/s-widlllu.ads
+++ b/gcc/ada/libgnat/s-widlllu.ads
@@ -34,8 +34,9 @@
 with System.Width_U;
 with System.Unsigned_Types;
 
-package System.Wid_LLLU is
-
+package System.Wid_LLLU
+  with SPARK_Mode
+is
    subtype Long_Long_Long_Unsigned is Unsigned_Types.Long_Long_Long_Unsigned;
 
    function Width_Long_Long_Long_Unsigned is
diff --git a/gcc/ada/libgnat/s-widllu.ads b/gcc/ada/libgnat/s-widllu.ads
index ab7ec58..7eaf966 100644
--- a/gcc/ada/libgnat/s-widllu.ads
+++ b/gcc/ada/libgnat/s-widllu.ads
@@ -34,8 +34,9 @@
 with System.Width_U;
 with System.Unsigned_Types;
 
-package System.Wid_LLU is
-
+package System.Wid_LLU
+  with SPARK_Mode
+is
    subtype Long_Long_Unsigned is Unsigned_Types.Long_Long_Unsigned;
 
    function Width_Long_Long_Unsigned is new Width_U (Long_Long_Unsigned);
diff --git a/gcc/ada/libgnat/s-widthu.adb b/gcc/ada/libgnat/s-widthu.adb
index a91baec..fce8c7a 100644
--- a/gcc/ada/libgnat/s-widthu.adb
+++ b/gcc/ada/libgnat/s-widthu.adb
@@ -29,10 +29,87 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
+with Ada.Numerics.Big_Numbers.Big_Integers;
+use Ada.Numerics.Big_Numbers.Big_Integers;
+
 function System.Width_U (Lo, Hi : Uns) return Natural is
+
+   --  Ghost code, loop invariants and assertions in this unit are meant for
+   --  analysis only, not for run-time checking, as it would be too costly
+   --  otherwise. This is enforced by setting the assertion policy to Ignore.
+
+   pragma Assertion_Policy (Ghost          => Ignore,
+                            Loop_Invariant => Ignore,
+                            Assert         => Ignore);
+
    W : Natural;
    T : Uns;
 
+   package Unsigned_Conversion is new Unsigned_Conversions (Int => Uns);
+
+   function Big (Arg : Uns) return Big_Integer is
+     (Unsigned_Conversion.To_Big_Integer (Arg))
+   with Ghost;
+
+   --  Maximum value of exponent for 10 that fits in Uns'Base
+   function Max_Log10 return Natural is
+     (case Uns'Base'Size is
+        when 8   => 2,
+        when 16  => 4,
+        when 32  => 9,
+        when 64  => 19,
+        when 128 => 38,
+        when others => raise Program_Error)
+   with Ghost;
+
+   Max_W  : constant Natural := Max_Log10 with Ghost;
+   Big_10 : constant Big_Integer := Big (10) with Ghost;
+
+   procedure Lemma_Lower_Mult (A, B, C : Big_Natural)
+   with
+     Ghost,
+     Pre  => A <= B,
+     Post => A * C <= B * C;
+
+   procedure Lemma_Div_Commutation (X, Y : Uns)
+   with
+     Ghost,
+     Pre  => Y /= 0,
+     Post => Big (X) / Big (Y) = Big (X / Y);
+
+   procedure Lemma_Div_Twice (X : Big_Natural; Y, Z : Big_Positive)
+   with
+     Ghost,
+     Post => X / Y / Z = X / (Y * Z);
+
+   procedure Lemma_Lower_Mult (A, B, C : Big_Natural) is
+   begin
+      null;
+   end Lemma_Lower_Mult;
+
+   procedure Lemma_Div_Commutation (X, Y : Uns) is
+   begin
+      null;
+   end Lemma_Div_Commutation;
+
+   procedure Lemma_Div_Twice (X : Big_Natural; Y, Z : Big_Positive) is
+      XY  : constant Big_Natural := X / Y;
+      YZ  : constant Big_Natural := Y * Z;
+      XYZ : constant Big_Natural := X / Y / Z;
+      R   : constant Big_Natural := (XY rem Z) * Y + (X rem Y);
+   begin
+      pragma Assert (X = XY * Y + (X rem Y));
+      pragma Assert (XY = XY / Z * Z + (XY rem Z));
+      pragma Assert (X = XYZ * YZ + R);
+      pragma Assert ((XY rem Z) * Y <= (Z - 1) * Y);
+      pragma Assert (R <= YZ - 1);
+      pragma Assert (X / YZ = (XYZ * YZ + R) / YZ);
+      pragma Assert (X / YZ = XYZ + R / YZ);
+   end Lemma_Div_Twice;
+
+   Pow    : Big_Integer := 1 with Ghost;
+   T_Init : constant Uns := Uns'Max (Lo, Hi) with Ghost;
+
 begin
    if Lo > Hi then
       return 0;
@@ -50,10 +127,43 @@
       --  Increase value if more digits required
 
       while T >= 10 loop
+         Lemma_Div_Commutation (T, 10);
+         Lemma_Div_Twice (Big (T_Init), Big_10 ** (W - 2), Big_10);
+
          T := T / 10;
          W := W + 1;
+         Pow := Pow * 10;
+
+         pragma Loop_Invariant (W in 3 .. Max_W + 3);
+         pragma Loop_Invariant (Pow = Big_10 ** (W - 2));
+         pragma Loop_Invariant (Big (T) = Big (T_Init) / Pow);
+         pragma Loop_Variant (Decreases => T);
+         pragma Annotate
+           (CodePeer, False_Positive,
+            "validity check", "confusion on generated code");
       end loop;
 
+      declare
+         F : constant Big_Integer := Big_10 ** (W - 2) with Ghost;
+         Q : constant Big_Integer := Big (T_Init) / F with Ghost;
+         R : constant Big_Integer := Big (T_Init) rem F with Ghost;
+      begin
+         pragma Assert (Q < Big_10);
+         pragma Assert (Big (T_Init) = Q * F + R);
+         Lemma_Lower_Mult (Q, Big (9), F);
+         pragma Assert (Big (T_Init) <= Big (9) * F + F - 1);
+         pragma Assert (Big (T_Init) < Big_10 * F);
+         pragma Assert (Big_10 * F = Big_10 ** (W - 1));
+      end;
+
+      --  This is an expression of the functional postcondition for Width_U,
+      --  which cannot be expressed readily as a postcondition as this would
+      --  require making the instantiation Unsigned_Conversion and function
+      --  Big available from the spec.
+
+      pragma Assert (Big (Lo) < Big_10 ** (W - 1));
+      pragma Assert (Big (Hi) < Big_10 ** (W - 1));
+
       return W;
    end if;
 
diff --git a/gcc/ada/libgnat/s-widuns.ads b/gcc/ada/libgnat/s-widuns.ads
index 0528456..713532e 100644
--- a/gcc/ada/libgnat/s-widuns.ads
+++ b/gcc/ada/libgnat/s-widuns.ads
@@ -34,8 +34,9 @@
 with System.Width_U;
 with System.Unsigned_Types;
 
-package System.Wid_Uns is
-
+package System.Wid_Uns
+  with SPARK_Mode
+is
    subtype Unsigned is Unsigned_Types.Unsigned;
 
    function Width_Unsigned is new Width_U (Unsigned);
diff --git a/gcc/ada/libgnat/system-vxworks-ppc-ravenscar.ads b/gcc/ada/libgnat/system-vxworks-ppc-ravenscar.ads
deleted file mode 100644
index b918c18..0000000
--- a/gcc/ada/libgnat/system-vxworks-ppc-ravenscar.ads
+++ /dev/null
@@ -1,185 +0,0 @@
-------------------------------------------------------------------------------
---                                                                          --
---                        GNAT RUN-TIME COMPONENTS                          --
---                                                                          --
---                               S Y S T E M                                --
---                                                                          --
---                                 S p e c                                  --
---                   (VxWorks/HIE Ravenscar Version PPC)                    --
---                                                                          --
---          Copyright (C) 1992-2021, Free Software Foundation, Inc.         --
---                                                                          --
--- This specification is derived from the Ada Reference Manual for use with --
--- GNAT. The copyright notice above, and the license provisions that follow --
--- apply solely to the  contents of the part following the private keyword. --
---                                                                          --
--- GNAT is free software;  you can  redistribute it  and/or modify it under --
--- terms of the  GNU General Public License as published  by the Free Soft- --
--- ware  Foundation;  either version 3,  or (at your option) any later ver- --
--- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE.                                     --
---                                                                          --
--- As a special exception under Section 7 of GPL version 3, you are granted --
--- additional permissions described in the GCC Runtime Library Exception,   --
--- version 3.1, as published by the Free Software Foundation.               --
---                                                                          --
--- You should have received a copy of the GNU General Public License and    --
--- a copy of the GCC Runtime Library Exception along with this program;     --
--- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
--- <http://www.gnu.org/licenses/>.                                          --
---                                                                          --
--- GNAT was originally developed  by the GNAT team at  New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc.      --
---                                                                          --
-------------------------------------------------------------------------------
-
---  This is a Ravenscar VxWorks version of this package for PowerPC targets
-
-pragma Restrictions (No_Exception_Propagation);
---  Only local exception handling is supported in this profile
-
-pragma Restrictions (No_Exception_Registration);
---  Disable exception name registration. This capability is not used because
---  it is only required by exception stream attributes which are not supported
---  in this run time.
-
-pragma Restrictions (No_Implicit_Dynamic_Code);
---  Pointers to nested subprograms are not allowed in this run time, in order
---  to prevent the compiler from building "trampolines".
-
-pragma Restrictions (No_Finalization);
---  Controlled types are not supported in this run time
-
-pragma Profile (Ravenscar);
---  This is a Ravenscar run time
-
-pragma Discard_Names;
---  Disable explicitly the generation of names associated with entities in
---  order to reduce the amount of storage used. These names are not used anyway
---  (attributes such as 'Image and 'Value are not supported in this run time).
-
-package System is
-   pragma Pure;
-   --  Note that we take advantage of the implementation permission to make
-   --  this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada
-   --  2005, this is Pure in any case (AI-362).
-
-   pragma No_Elaboration_Code_All;
-   --  Allow the use of that restriction in units that WITH this unit
-
-   type Name is (SYSTEM_NAME_GNAT);
-   System_Name : constant Name := SYSTEM_NAME_GNAT;
-
-   --  System-Dependent Named Numbers
-
-   Min_Int             : constant := -2 ** (Standard'Max_Integer_Size - 1);
-   Max_Int             : constant :=  2 ** (Standard'Max_Integer_Size - 1) - 1;
-
-   Max_Binary_Modulus    : constant := 2 ** Standard'Max_Integer_Size;
-   Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1;
-
-   Max_Base_Digits       : constant := Long_Long_Float'Digits;
-   Max_Digits            : constant := Long_Long_Float'Digits;
-
-   Max_Mantissa          : constant := Standard'Max_Integer_Size - 1;
-   Fine_Delta            : constant := 2.0 ** (-Max_Mantissa);
-
-   Tick                  : constant := 1.0 / 60.0;
-
-   --  Storage-related Declarations
-
-   type Address is private;
-   pragma Preelaborable_Initialization (Address);
-   Null_Address : constant Address;
-
-   Storage_Unit : constant := 8;
-   Word_Size    : constant := 32;
-   Memory_Size  : constant := 2 ** 32;
-
-   --  Address comparison
-
-   function "<"  (Left, Right : Address) return Boolean;
-   function "<=" (Left, Right : Address) return Boolean;
-   function ">"  (Left, Right : Address) return Boolean;
-   function ">=" (Left, Right : Address) return Boolean;
-   function "="  (Left, Right : Address) return Boolean;
-
-   pragma Import (Intrinsic, "<");
-   pragma Import (Intrinsic, "<=");
-   pragma Import (Intrinsic, ">");
-   pragma Import (Intrinsic, ">=");
-   pragma Import (Intrinsic, "=");
-
-   --  Other System-Dependent Declarations
-
-   type Bit_Order is (High_Order_First, Low_Order_First);
-   Default_Bit_Order : constant Bit_Order := High_Order_First;
-   pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning
-
-   --  Priority-related Declarations (RM D.1)
-
-   --  Ada priorities are mapped to VxWorks priorities using the following
-   --  transformation: 255 - Ada Priority
-
-   --  Ada priorities are used as follows:
-
-   --  256        is reserved for the VxWorks kernel
-   --  248 - 255  correspond to hardware interrupt levels 0 .. 7
-   --  247        is a catchall default "interrupt" priority for signals,
-   --             allowing higher priority than normal tasks, but lower than
-   --             hardware priority levels.  Protected Object ceilings can
-   --             override these values.
-   --  246        is used by the Interrupt_Manager task
-
-   Max_Priority           : constant Positive := 245;
-   Max_Interrupt_Priority : constant Positive := 255;
-
-   subtype Any_Priority       is Integer      range   0 .. 255;
-   subtype Priority           is Any_Priority range   0 .. 245;
-   subtype Interrupt_Priority is Any_Priority range 246 .. 255;
-
-   Default_Priority : constant Priority := 122;
-
-private
-
-   type Address is mod Memory_Size;
-   Null_Address : constant Address := 0;
-
-   --------------------------------------
-   -- System Implementation Parameters --
-   --------------------------------------
-
-   --  These parameters provide information about the target that is used
-   --  by the compiler. They are in the private part of System, where they
-   --  can be accessed using the special circuitry in the Targparm unit
-   --  whose source should be consulted for more detailed descriptions
-   --  of the individual switch values.
-
-   Backend_Divide_Checks     : constant Boolean := False;
-   Backend_Overflow_Checks   : constant Boolean := True;
-   Command_Line_Args         : constant Boolean := False;
-   Configurable_Run_Time     : constant Boolean := True;
-   Denorm                    : constant Boolean := True;
-   Duration_32_Bits          : constant Boolean := True;
-   Exit_Status_Supported     : constant Boolean := True;
-   Machine_Overflows         : constant Boolean := True;
-   Machine_Rounds            : consta