diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000000..e5e9997f44fa --- /dev/null +++ b/.editorconfig @@ -0,0 +1,142 @@ +# Copyright 2025 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# This file helps editors auto-configure whitespace settings. +# +# See here for more information about the format and editor support: +# +# https://editorconfig.org/ + +# This file is common to the GCC and GDB/Binutils projects. If you +# update one, please sync it with the other. + +# top-most EditorConfig file +root = true + +[*] +end_of_line = lf +insert_final_newline = true +tab_width = 8 + +# EditorConfig files +[.editorconfig] +charset = utf-8 +trim_trailing_whitespace = true + +# Makefile +[{Makefile,*.mk,*.am}*] +indent_style = tab +indent_size = 8 +trim_trailing_whitespace = true + +# ChangeLogs +[ChangeLog*] +indent_style = tab +indent_size = 8 +trim_trailing_whitespace = true +charset = utf-8 + +# C/C++ +[*.{c,h,cc}] +charset = utf-8 +indent_style = tab +indent_size = 2 +trim_trailing_whitespace = true + +# GCC .def files. These are generally C fragments that get included +# one or more times +[gcc/**.def] +charset = utf-8 +indent_style = tab +indent_size = 2 +trim_trailing_whitespace = true + +# Texinfo files +[*.texi] +charset = utf-8 +indent_size = 2 +trim_trailing_whitespace = true + +# Expect / TCL +[*.{exp,tcl}] +indent_style = tab +indent_size = 4 +trim_trailing_whitespace = true + +# Python +[*.py] +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +# Assembler +[*.{s,S,asm}] +indent_style = tab +indent_size = 8 +trim_trailing_whitespace = true + +# GCC Machine description files +[gcc/config/**.md] +indent_style = tab +indent_size = 2 +trim_trailing_whitespace = true + +# Awk +[*.awk] +indent_style = tab +indent_size = 2 +trim_trailing_whitespace = true + +# Autoconf +[*.{ac,m4}] +indent_style = tab +indent_size = 2 +trim_trailing_whitespace = true + +# Shell scripts +[*.sh] +indent_style = tab +indent_size = 4 +trim_trailing_whitespace = true + +# Ada +[*.ad[bs]] +indent_style = space +indent_size = 3 +trim_trailing_whitespace = true + +# D +[*.d] +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +# Go +[*.go] +indent_style = tab +indent_size = 8 +trim_trailing_whitespace = true + +# Fortran +[*.[Ff]90] +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true + +# Cobol +[*.cbl] +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true diff --git a/.forgejo/workflows/sanity-checks.yaml b/.forgejo/workflows/sanity-checks.yaml new file mode 100644 index 000000000000..361c497e9905 --- /dev/null +++ b/.forgejo/workflows/sanity-checks.yaml @@ -0,0 +1,49 @@ +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + testjob: + runs-on: sourceware-runner + outputs: + styleoutput: ${{ steps.check_gnu_style.outputs.styleresult }} + verifyoutput: ${{ steps.gcc_verify.outputs.verifyresult }} + steps: + - name: install dependencies + run: | + echo "Installing node.js" + apt-get update + apt-get install -qq -y nodejs git python3 python3-git python3-termcolor python3-unidiff + + # Checkout GCC sources, request an history depth of 100, + # hopefully sufficient for all patch series (the default is 1) + - uses: actions/checkout@v4 + with: + fetch-depth: 100 + + - name: check GNU style + id: check_gnu_style + continue-on-error: true + run: | + echo "Running check_GNU_style.py" + git fetch origin ${FORGEJO_BASE_REF}:${FORGEJO_BASE_REF} + for sha in $(git rev-list ${FORGEJO_BASE_REF}..${FORGEJO_SHA}) + do + echo "Checking GNU style for $sha" + git show $sha | ./contrib/check_GNU_style.py - + done + echo "styleresult=pass" | tee -a $FORGEJO_OUTPUT + + - name: gcc-verify + id: gcc_verify + continue-on-error: true + run: | + echo "Running gcc-verify check" + ./contrib/gcc-changelog/git_check_commit.py ${FORGEJO_BASE_REF}..${FORGEJO_SHA} + echo "verifyresult=pass" | tee -a $FORGEJO_OUTPUT + + - name: final-result + run: | + echo "Computing final result" + test "${{ steps.check_gnu_style.outputs.styleresult }}" = "pass" + test "${{ steps.gcc_verify.outputs.verifyresult }}" = "pass" diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 5159505ce813..abf4a1581560 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -392,7 +392,7 @@ jobs: git fetch arm-ian; GIT_AUTHOR_NAME=CI \ GIT_AUTHOR_EMAIL='ci@invalid' \ - git merge --no-edit e110b7b04a6df1275330455aa886a6e283d06e48; + git merge --no-edit 5335688e426583c2f4703e25cc24c69cf74280ed; - name: Install Deps run: | diff --git a/ChangeLog b/ChangeLog index 18cc0d32e4e6..5b28068bacad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,69 @@ +2025-10-24 Thomas Schwinge + + PR driver/81358 + * Makefile.tpl: Move generation of dependencies for libatomic out + of loop over 'target_modules'. + * Makefile.in: Regenerate. + +2025-10-22 Josef Melcr + + * MAINTAINERS: Update my contact information. + +2025-10-20 Tamar Christina + + * MAINTAINERS (Various Maintainers): Add myself for the vectorizer. + +2025-10-20 Christophe Lyon + + * .forgejo/workflows/sanity-checks.yaml: New file. + +2025-10-20 Richard Biener + + * MAINTAINERS (auto-vectorizer): Change attribution to + vectorizer (+ tree-if-conv). + +2025-10-15 Basil Milanich + + * Makefile.tpl (distclean): Remove extraenous semicolon. + * Makefile.in: Rebuilt. + +2025-10-11 Ben Boeckel + + * config-ml.in: Update patch email address. + * symlink-tree: Ditto. + +2025-10-09 Prathamesh Kulkarni + Matthew Malcolmson + + PR driver/81358 + * Makefile.def: Add no_atomic=true for libraries that don't depend on + libatomic. + * Makefile.tpl: Export TARGET_CONFIGDIRS and create rule to + add dependencies for libatomic. + * configure.ac: Add libatomic to bootstrap_target_libs. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2025-10-02 H.J. Lu + + * Makefile.in: Regenerated. + * configure: Likewise. + * Makefile.tpl: Synced from binutils-gdb. + * configure.ac: Likewise. + * libtool.m4: Likewise. + +2025-10-01 Richard Earnshaw + + * .editorconfig: Unify the GCC and GDB/binutils root config. + +2025-09-23 Richard Earnshaw + + * .editorconfig: Fix glob patterns. + +2025-09-22 Jonathan Wakely + + * .editorconfig: New file. + 2025-09-04 Wilco Dijkstra * MAINTAINERS (Reviewers): Add myself for the aarch64 port. diff --git a/MAINTAINERS b/MAINTAINERS index 05598811322b..984e906fc61c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -252,8 +252,9 @@ reload Ulrich Weigand RTL optimizers Eric Botcazou instruction combiner Segher Boessenkool pair fusion Alex Coplan -auto-vectorizer Richard Biener -auto-vectorizer Zdenek Dvorak +vectorizer (+ tree-if-conv) Richard Biener +vectorizer (+ tree-if-conv) Tamar Christina +vectorizer (+ tree-if-conv) Zdenek Dvorak loop infrastructure Zdenek Dvorak loop ivopts Bin Cheng loop optimizer Bin Cheng @@ -678,7 +679,7 @@ Bryce McKinlay bryce Adam Megacz - Bingfeng Mei meibf Michael Meissner meissner -Josef Melcr - +Josef Melcr jmelcr Jason Merrill jason Jim Meyering - Martin Michlmayr tbm @@ -791,7 +792,7 @@ Roger Sayle sayle Tobias Schlüter tobi Bernd Schmidt bernds Will Schmidt willschm -Jennifer Schmitz jschmitz +Jennifer Schmitz jschmitz Stefan Schulze Frielinghaus stefansf Andreas Schwab schwab Tilo Schwarz tiloschwarz @@ -972,7 +973,6 @@ Navid Rahimi Rishi Raj Trevor Saunders Bill Schmidt -Jennifer Schmitz Nathaniel Shead Nathan Sidwell Edward Smith-Rowland diff --git a/Makefile.def b/Makefile.def index fa60f6ea0b90..e7f33345aa82 100644 --- a/Makefile.def +++ b/Makefile.def @@ -313,7 +313,6 @@ flags_to_pass = { flag= GNATBIND ; }; flags_to_pass = { flag= GNATMAKE ; }; flags_to_pass = { flag= GDC ; }; flags_to_pass = { flag= GDCFLAGS ; }; -flags_to_pass = { flag= GUILE ; }; // Target tools flags_to_pass = { flag= AR_FOR_TARGET ; }; @@ -463,9 +462,11 @@ dependencies = { module=all-gdb; on=all-libbacktrace; }; // Host modules specific to gdbserver. dependencies = { module=configure-gdbserver; on=all-gnulib; }; +dependencies = { module=configure-gdbserver; on=all-libiconv; }; dependencies = { module=all-gdbserver; on=all-gdbsupport; }; dependencies = { module=all-gdbserver; on=all-gnulib; }; dependencies = { module=all-gdbserver; on=all-libiberty; }; +dependencies = { module=all-gdbserver; on=all-libiconv; }; dependencies = { module=configure-libgui; on=configure-tcl; }; dependencies = { module=configure-libgui; on=configure-tk; }; @@ -524,7 +525,7 @@ dependencies = { module=install-bfd; on=install-libsframe; }; dependencies = { module=install-strip-bfd; on=install-strip-libsframe; }; // libopcodes depends on libbfd -dependencies = { module=configure-opcodes; on=configure-bfd; hard=true; }; +dependencies = { module=configure-opcodes; on=all-bfd; hard=true; }; dependencies = { module=install-opcodes; on=install-bfd; }; dependencies = { module=install-strip-opcodes; on=install-strip-bfd; }; @@ -550,8 +551,8 @@ dependencies = { module=install-gprofng; on=install-opcodes; }; dependencies = { module=install-gprofng; on=install-bfd; }; dependencies = { module=configure-ld; on=configure-gettext; }; +dependencies = { module=configure-ld; on=all-bfd; }; dependencies = { module=all-ld; on=all-libiberty; }; -dependencies = { module=all-ld; on=all-bfd; }; dependencies = { module=all-ld; on=all-opcodes; }; dependencies = { module=all-ld; on=all-build-bison; }; dependencies = { module=all-ld; on=all-build-flex; }; @@ -649,14 +650,15 @@ dependencies = { module=all-m4; on=all-build-texinfo; }; // on libgcc and newlib/libgloss. lang_env_dependencies = { module=libitm; cxx=true; }; lang_env_dependencies = { module=libffi; cxx=true; }; -lang_env_dependencies = { module=newlib; no_c=true; }; -lang_env_dependencies = { module=libgloss; no_c=true; }; -lang_env_dependencies = { module=libgcc; no_gcc=true; no_c=true; }; +lang_env_dependencies = { module=newlib; no_c=true; no_atomic=true; }; +lang_env_dependencies = { module=libgloss; no_c=true; no_atomic=true; }; +lang_env_dependencies = { module=libgcc; no_gcc=true; no_c=true; no_atomic=true; }; // libiberty does not depend on newlib or libgloss because it must be // built newlib on some targets (e.g. Cygwin). It still needs // a dependency on libgcc for native targets to configure. -lang_env_dependencies = { module=libiberty; no_c=true; }; -lang_env_dependencies = { module=libgcobol; cxx=true; }; +lang_env_dependencies = { module=libiberty; no_c=true; no_atomic=true; }; +lang_env_dependencies = { module=libgcobol; cxx=true; no_atomic=true; }; +lang_env_dependencies = { module=libatomic; no_atomic=true; }; dependencies = { module=configure-target-fastjar; on=configure-target-zlib; }; dependencies = { module=all-target-fastjar; on=all-target-zlib; }; diff --git a/Makefile.in b/Makefile.in index 12d4395d8e2f..15f7413e9973 100644 --- a/Makefile.in +++ b/Makefile.in @@ -3,7 +3,7 @@ # # Makefile for directory with subdirs to build. # Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, -# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2023 +# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 # Free Software Foundation # # This file is free software; you can redistribute it and/or modify @@ -144,8 +144,7 @@ BASE_EXPORTS = \ M4="$(M4)"; export M4; \ SED="$(SED)"; export SED; \ AWK="$(AWK)"; export AWK; \ - MAKEINFO="$(MAKEINFO)"; export MAKEINFO; \ - GUILE="$(GUILE)"; export GUILE; + MAKEINFO="$(MAKEINFO)"; export MAKEINFO; # This is the list of variables to export in the environment when # configuring subdirectories for the build system. @@ -244,6 +243,7 @@ HOST_EXPORTS = \ GMPINC="$(HOST_GMPINC)"; export GMPINC; \ ISLLIBS="$(HOST_ISLLIBS)"; export ISLLIBS; \ ISLINC="$(HOST_ISLINC)"; export ISLINC; \ + TARGET_CONFIGDIRS="$(TARGET_CONFIGDIRS)"; export TARGET_CONFIGDIRS; \ XGCC_FLAGS_FOR_TARGET="$(XGCC_FLAGS_FOR_TARGET)"; export XGCC_FLAGS_FOR_TARGET; \ @if gcc-bootstrap $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ @@ -434,7 +434,7 @@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ LD = @LD@ LIPO = @LIPO@ -NM = @NM@ +NM = @NM@ @NM_PLUGIN_OPTION@ OBJDUMP = @OBJDUMP@ OTOOL = @OTOOL@ RANLIB = @RANLIB@ @RANLIB_PLUGIN_OPTION@ @@ -460,8 +460,6 @@ CRAB1_LIBS = @CRAB1_LIBS@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -GUILE = guile - # Pass additional PGO and LTO compiler options to the PGO build. BUILD_CFLAGS = $(PGO_BUILD_CFLAGS) $(PGO_BUILD_LTO_CFLAGS) override CFLAGS += $(BUILD_CFLAGS) @@ -667,7 +665,7 @@ do-compare3 = $(do-compare) # Programs producing files for the TARGET machine # ----------------------------------------------- -AR_FOR_TARGET=@AR_FOR_TARGET@ +AR_FOR_TARGET=@AR_FOR_TARGET@ @AR_PLUGIN_OPTION_FOR_TARGET@ AS_FOR_TARGET=@AS_FOR_TARGET@ CC_FOR_TARGET=$(STAGE_CC_WRAPPER) @CC_FOR_TARGET@ @@ -687,11 +685,11 @@ DSYMUTIL_FOR_TARGET=@DSYMUTIL_FOR_TARGET@ LD_FOR_TARGET=@LD_FOR_TARGET@ LIPO_FOR_TARGET=@LIPO_FOR_TARGET@ -NM_FOR_TARGET=@NM_FOR_TARGET@ +NM_FOR_TARGET=@NM_FOR_TARGET@ @NM_PLUGIN_OPTION_FOR_TARGET@ OBJDUMP_FOR_TARGET=@OBJDUMP_FOR_TARGET@ OBJCOPY_FOR_TARGET=@OBJCOPY_FOR_TARGET@ OTOOL_FOR_TARGET=@OTOOL_FOR_TARGET@ -RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@ +RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@ @RANLIB_PLUGIN_OPTION_FOR_TARGET@ READELF_FOR_TARGET=@READELF_FOR_TARGET@ STRIP_FOR_TARGET=@STRIP_FOR_TARGET@ WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@ @@ -891,7 +889,6 @@ BASE_FLAGS_TO_PASS = \ "GNATMAKE=$(GNATMAKE)" \ "GDC=$(GDC)" \ "GDCFLAGS=$(GDCFLAGS)" \ - "GUILE=$(GUILE)" \ "AR_FOR_TARGET=$(AR_FOR_TARGET)" \ "AS_FOR_TARGET=$(AS_FOR_TARGET)" \ "CC_FOR_TARGET=$(CC_FOR_TARGET)" \ @@ -2743,7 +2740,7 @@ local-distclean: -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null -rmdir c++tools fastjar gcc gnattools gotools 2>/dev/null -rmdir libcc1 libiberty texinfo zlib 2>/dev/null - -find . -name config.cache -exec rm -f {} \; \; 2>/dev/null + -find . -name config.cache -exec rm -f {} \; 2>/dev/null local-maintainer-clean: @echo "This command is intended for maintainers to use;" @@ -68682,16 +68679,16 @@ install-strip-ld: maybe-install-strip-bfd install-strip-ld: maybe-install-strip-libctf install-bfd: maybe-install-libsframe install-strip-bfd: maybe-install-strip-libsframe -configure-opcodes: configure-bfd -configure-stage1-opcodes: configure-stage1-bfd -configure-stage2-opcodes: configure-stage2-bfd -configure-stage3-opcodes: configure-stage3-bfd -configure-stage4-opcodes: configure-stage4-bfd -configure-stageprofile-opcodes: configure-stageprofile-bfd -configure-stagetrain-opcodes: configure-stagetrain-bfd -configure-stagefeedback-opcodes: configure-stagefeedback-bfd -configure-stageautoprofile-opcodes: configure-stageautoprofile-bfd -configure-stageautofeedback-opcodes: configure-stageautofeedback-bfd +configure-opcodes: all-bfd +configure-stage1-opcodes: all-stage1-bfd +configure-stage2-opcodes: all-stage2-bfd +configure-stage3-opcodes: all-stage3-bfd +configure-stage4-opcodes: all-stage4-bfd +configure-stageprofile-opcodes: all-stageprofile-bfd +configure-stagetrain-opcodes: all-stagetrain-bfd +configure-stagefeedback-opcodes: all-stagefeedback-bfd +configure-stageautoprofile-opcodes: all-stageautoprofile-bfd +configure-stageautofeedback-opcodes: all-stageautofeedback-bfd install-opcodes: maybe-install-bfd install-strip-opcodes: maybe-install-strip-bfd configure-gas: maybe-configure-gettext @@ -68756,6 +68753,16 @@ configure-stagetrain-ld: maybe-configure-stagetrain-gettext configure-stagefeedback-ld: maybe-configure-stagefeedback-gettext configure-stageautoprofile-ld: maybe-configure-stageautoprofile-gettext configure-stageautofeedback-ld: maybe-configure-stageautofeedback-gettext +configure-ld: maybe-all-bfd +configure-stage1-ld: maybe-all-stage1-bfd +configure-stage2-ld: maybe-all-stage2-bfd +configure-stage3-ld: maybe-all-stage3-bfd +configure-stage4-ld: maybe-all-stage4-bfd +configure-stageprofile-ld: maybe-all-stageprofile-bfd +configure-stagetrain-ld: maybe-all-stagetrain-bfd +configure-stagefeedback-ld: maybe-all-stagefeedback-bfd +configure-stageautoprofile-ld: maybe-all-stageautoprofile-bfd +configure-stageautofeedback-ld: maybe-all-stageautofeedback-bfd all-ld: maybe-all-libiberty all-stage1-ld: maybe-all-stage1-libiberty all-stage2-ld: maybe-all-stage2-libiberty @@ -68766,16 +68773,6 @@ all-stagetrain-ld: maybe-all-stagetrain-libiberty all-stagefeedback-ld: maybe-all-stagefeedback-libiberty all-stageautoprofile-ld: maybe-all-stageautoprofile-libiberty all-stageautofeedback-ld: maybe-all-stageautofeedback-libiberty -all-ld: maybe-all-bfd -all-stage1-ld: maybe-all-stage1-bfd -all-stage2-ld: maybe-all-stage2-bfd -all-stage3-ld: maybe-all-stage3-bfd -all-stage4-ld: maybe-all-stage4-bfd -all-stageprofile-ld: maybe-all-stageprofile-bfd -all-stagetrain-ld: maybe-all-stagetrain-bfd -all-stagefeedback-ld: maybe-all-stagefeedback-bfd -all-stageautoprofile-ld: maybe-all-stageautoprofile-bfd -all-stageautofeedback-ld: maybe-all-stageautofeedback-bfd all-ld: maybe-all-opcodes all-stage1-ld: maybe-all-stage1-opcodes all-stage2-ld: maybe-all-stage2-opcodes @@ -69249,7 +69246,9 @@ all-gdb: maybe-all-opcodes all-gdb: maybe-all-libdecnumber all-gdb: maybe-all-libctf all-gdb: maybe-all-libbacktrace +configure-gdbserver: maybe-all-libiconv all-gdbserver: maybe-all-libiberty +all-gdbserver: maybe-all-libiconv configure-gdbsupport: maybe-configure-gettext all-gdbsupport: maybe-all-gettext configure-gprof: maybe-configure-gettext @@ -69450,6 +69449,95 @@ configure-target-libgcobol: maybe-all-target-newlib maybe-all-target-libgloss configure-target-libgcobol: maybe-all-target-libstdc++-v3 +@if gcc-bootstrap +configure-stage1-target-libstdc++-v3: maybe-all-stage1-target-libatomic +configure-stage2-target-libstdc++-v3: maybe-all-stage2-target-libatomic +configure-stage3-target-libstdc++-v3: maybe-all-stage3-target-libatomic +configure-stage4-target-libstdc++-v3: maybe-all-stage4-target-libatomic +configure-stageprofile-target-libstdc++-v3: maybe-all-stageprofile-target-libatomic +configure-stagetrain-target-libstdc++-v3: maybe-all-stagetrain-target-libatomic +configure-stagefeedback-target-libstdc++-v3: maybe-all-stagefeedback-target-libatomic +configure-stageautoprofile-target-libstdc++-v3: maybe-all-stageautoprofile-target-libatomic +configure-stageautofeedback-target-libstdc++-v3: maybe-all-stageautofeedback-target-libatomic +configure-stage1-target-libsanitizer: maybe-all-stage1-target-libatomic +configure-stage2-target-libsanitizer: maybe-all-stage2-target-libatomic +configure-stage3-target-libsanitizer: maybe-all-stage3-target-libatomic +configure-stage4-target-libsanitizer: maybe-all-stage4-target-libatomic +configure-stageprofile-target-libsanitizer: maybe-all-stageprofile-target-libatomic +configure-stagetrain-target-libsanitizer: maybe-all-stagetrain-target-libatomic +configure-stagefeedback-target-libsanitizer: maybe-all-stagefeedback-target-libatomic +configure-stageautoprofile-target-libsanitizer: maybe-all-stageautoprofile-target-libatomic +configure-stageautofeedback-target-libsanitizer: maybe-all-stageautofeedback-target-libatomic +configure-stage1-target-libvtv: maybe-all-stage1-target-libatomic +configure-stage2-target-libvtv: maybe-all-stage2-target-libatomic +configure-stage3-target-libvtv: maybe-all-stage3-target-libatomic +configure-stage4-target-libvtv: maybe-all-stage4-target-libatomic +configure-stageprofile-target-libvtv: maybe-all-stageprofile-target-libatomic +configure-stagetrain-target-libvtv: maybe-all-stagetrain-target-libatomic +configure-stagefeedback-target-libvtv: maybe-all-stagefeedback-target-libatomic +configure-stageautoprofile-target-libvtv: maybe-all-stageautoprofile-target-libatomic +configure-stageautofeedback-target-libvtv: maybe-all-stageautofeedback-target-libatomic +configure-stage1-target-libbacktrace: maybe-all-stage1-target-libatomic +configure-stage2-target-libbacktrace: maybe-all-stage2-target-libatomic +configure-stage3-target-libbacktrace: maybe-all-stage3-target-libatomic +configure-stage4-target-libbacktrace: maybe-all-stage4-target-libatomic +configure-stageprofile-target-libbacktrace: maybe-all-stageprofile-target-libatomic +configure-stagetrain-target-libbacktrace: maybe-all-stagetrain-target-libatomic +configure-stagefeedback-target-libbacktrace: maybe-all-stagefeedback-target-libatomic +configure-stageautoprofile-target-libbacktrace: maybe-all-stageautoprofile-target-libatomic +configure-stageautofeedback-target-libbacktrace: maybe-all-stageautofeedback-target-libatomic +configure-stage1-target-libphobos: maybe-all-stage1-target-libatomic +configure-stage2-target-libphobos: maybe-all-stage2-target-libatomic +configure-stage3-target-libphobos: maybe-all-stage3-target-libatomic +configure-stage4-target-libphobos: maybe-all-stage4-target-libatomic +configure-stageprofile-target-libphobos: maybe-all-stageprofile-target-libatomic +configure-stagetrain-target-libphobos: maybe-all-stagetrain-target-libatomic +configure-stagefeedback-target-libphobos: maybe-all-stagefeedback-target-libatomic +configure-stageautoprofile-target-libphobos: maybe-all-stageautoprofile-target-libatomic +configure-stageautofeedback-target-libphobos: maybe-all-stageautofeedback-target-libatomic +configure-stage1-target-zlib: maybe-all-stage1-target-libatomic +configure-stage2-target-zlib: maybe-all-stage2-target-libatomic +configure-stage3-target-zlib: maybe-all-stage3-target-libatomic +configure-stage4-target-zlib: maybe-all-stage4-target-libatomic +configure-stageprofile-target-zlib: maybe-all-stageprofile-target-libatomic +configure-stagetrain-target-zlib: maybe-all-stagetrain-target-libatomic +configure-stagefeedback-target-zlib: maybe-all-stagefeedback-target-libatomic +configure-stageautoprofile-target-zlib: maybe-all-stageautoprofile-target-libatomic +configure-stageautofeedback-target-zlib: maybe-all-stageautofeedback-target-libatomic +configure-stage1-target-libgomp: maybe-all-stage1-target-libatomic +configure-stage2-target-libgomp: maybe-all-stage2-target-libatomic +configure-stage3-target-libgomp: maybe-all-stage3-target-libatomic +configure-stage4-target-libgomp: maybe-all-stage4-target-libatomic +configure-stageprofile-target-libgomp: maybe-all-stageprofile-target-libatomic +configure-stagetrain-target-libgomp: maybe-all-stagetrain-target-libatomic +configure-stagefeedback-target-libgomp: maybe-all-stagefeedback-target-libatomic +configure-stageautoprofile-target-libgomp: maybe-all-stageautoprofile-target-libatomic +configure-stageautofeedback-target-libgomp: maybe-all-stageautofeedback-target-libatomic +@endif gcc-bootstrap + +@if gcc-no-bootstrap +configure-target-libstdc++-v3: maybe-all-target-libatomic +configure-target-libsanitizer: maybe-all-target-libatomic +configure-target-libvtv: maybe-all-target-libatomic +configure-target-libssp: maybe-all-target-libatomic +configure-target-libbacktrace: maybe-all-target-libatomic +configure-target-libquadmath: maybe-all-target-libatomic +configure-target-libgfortran: maybe-all-target-libatomic +configure-target-libobjc: maybe-all-target-libatomic +configure-target-libgo: maybe-all-target-libatomic +configure-target-libphobos: maybe-all-target-libatomic +configure-target-libtermcap: maybe-all-target-libatomic +configure-target-winsup: maybe-all-target-libatomic +configure-target-libffi: maybe-all-target-libatomic +configure-target-zlib: maybe-all-target-libatomic +configure-target-rda: maybe-all-target-libatomic +configure-target-libada: maybe-all-target-libatomic +configure-target-libgm2: maybe-all-target-libatomic +configure-target-libgomp: maybe-all-target-libatomic +configure-target-libitm: maybe-all-target-libatomic +configure-target-libgrust: maybe-all-target-libatomic +@endif gcc-no-bootstrap + CONFIGURE_GDB_TK = @CONFIGURE_GDB_TK@ GDB_TK = @GDB_TK@ INSTALL_GDB_TK = @INSTALL_GDB_TK@ diff --git a/Makefile.tpl b/Makefile.tpl index ddcca5589137..f4f0fc58df4f 100644 --- a/Makefile.tpl +++ b/Makefile.tpl @@ -6,7 +6,7 @@ in # # Makefile for directory with subdirs to build. # Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, -# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2023 +# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 # Free Software Foundation # # This file is free software; you can redistribute it and/or modify @@ -147,8 +147,7 @@ BASE_EXPORTS = \ M4="$(M4)"; export M4; \ SED="$(SED)"; export SED; \ AWK="$(AWK)"; export AWK; \ - MAKEINFO="$(MAKEINFO)"; export MAKEINFO; \ - GUILE="$(GUILE)"; export GUILE; + MAKEINFO="$(MAKEINFO)"; export MAKEINFO; # This is the list of variables to export in the environment when # configuring subdirectories for the build system. @@ -247,6 +246,7 @@ HOST_EXPORTS = \ GMPINC="$(HOST_GMPINC)"; export GMPINC; \ ISLLIBS="$(HOST_ISLLIBS)"; export ISLLIBS; \ ISLINC="$(HOST_ISLINC)"; export ISLINC; \ + TARGET_CONFIGDIRS="$(TARGET_CONFIGDIRS)"; export TARGET_CONFIGDIRS; \ XGCC_FLAGS_FOR_TARGET="$(XGCC_FLAGS_FOR_TARGET)"; export XGCC_FLAGS_FOR_TARGET; \ @if gcc-bootstrap $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ @@ -437,7 +437,7 @@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ LD = @LD@ LIPO = @LIPO@ -NM = @NM@ +NM = @NM@ @NM_PLUGIN_OPTION@ OBJDUMP = @OBJDUMP@ OTOOL = @OTOOL@ RANLIB = @RANLIB@ @RANLIB_PLUGIN_OPTION@ @@ -463,8 +463,6 @@ CRAB1_LIBS = @CRAB1_LIBS@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -GUILE = guile - # Pass additional PGO and LTO compiler options to the PGO build. BUILD_CFLAGS = $(PGO_BUILD_CFLAGS) $(PGO_BUILD_LTO_CFLAGS) override CFLAGS += $(BUILD_CFLAGS) @@ -590,7 +588,7 @@ do-compare3 = $(do-compare) # Programs producing files for the TARGET machine # ----------------------------------------------- -AR_FOR_TARGET=@AR_FOR_TARGET@ +AR_FOR_TARGET=@AR_FOR_TARGET@ @AR_PLUGIN_OPTION_FOR_TARGET@ AS_FOR_TARGET=@AS_FOR_TARGET@ CC_FOR_TARGET=$(STAGE_CC_WRAPPER) @CC_FOR_TARGET@ @@ -610,11 +608,11 @@ DSYMUTIL_FOR_TARGET=@DSYMUTIL_FOR_TARGET@ LD_FOR_TARGET=@LD_FOR_TARGET@ LIPO_FOR_TARGET=@LIPO_FOR_TARGET@ -NM_FOR_TARGET=@NM_FOR_TARGET@ +NM_FOR_TARGET=@NM_FOR_TARGET@ @NM_PLUGIN_OPTION_FOR_TARGET@ OBJDUMP_FOR_TARGET=@OBJDUMP_FOR_TARGET@ OBJCOPY_FOR_TARGET=@OBJCOPY_FOR_TARGET@ OTOOL_FOR_TARGET=@OTOOL_FOR_TARGET@ -RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@ +RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@ @RANLIB_PLUGIN_OPTION_FOR_TARGET@ READELF_FOR_TARGET=@READELF_FOR_TARGET@ STRIP_FOR_TARGET=@STRIP_FOR_TARGET@ WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@ @@ -981,7 +979,7 @@ local-distclean: -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null -rmdir c++tools fastjar gcc gnattools gotools 2>/dev/null -rmdir libcc1 libiberty texinfo zlib 2>/dev/null - -find . -name config.cache -exec rm -f {} \; \; 2>/dev/null + -find . -name config.cache -exec rm -f {} \; 2>/dev/null local-maintainer-clean: @echo "This command is intended for maintainers to use;" @@ -2101,6 +2099,11 @@ ENDFOR dependencies +]@endif gcc-bootstrap (if (exist? "no_gcc") (hash-create-handle! lang-env-deps (string-append (get "module") "-" "no_gcc") #t)) + + (if (exist? "no_atomic") + (hash-create-handle! lang-env-deps + (string-append (get "module") "-" "no_atomic") #t)) + "" +][+ ENDFOR lang_env_dependencies +] @if gcc-bootstrap[+ FOR target_modules +][+ IF (not (lang-dep "no_gcc")) @@ -2121,6 +2124,17 @@ configure-target-[+module+]: maybe-all-target-libstdc++-v3[+ ENDIF +] [+ ENDFOR target_modules +] +@if gcc-bootstrap[+ FOR target_modules +][+ IF (not (lang-dep "no_atomic")) + +][+ IF bootstrap +][+ FOR bootstrap_stage +] +configure-stage[+id+]-target-[+module+]: maybe-all-stage[+id+]-target-libatomic[+ + ENDFOR +][+ ENDIF bootstrap +][+ ENDIF +][+ ENDFOR target_modules +] +@endif gcc-bootstrap + +@if gcc-no-bootstrap[+ FOR target_modules +][+ IF (not (lang-dep "no_atomic")) +] +configure-target-[+module+]: maybe-all-target-libatomic[+ + ENDIF +][+ ENDFOR target_modules +] +@endif gcc-no-bootstrap + CONFIGURE_GDB_TK = @CONFIGURE_GDB_TK@ GDB_TK = @GDB_TK@ INSTALL_GDB_TK = @INSTALL_GDB_TK@ diff --git a/config-ml.in b/config-ml.in index 7934a1ddf4bd..a0f384f5c819 100644 --- a/config-ml.in +++ b/config-ml.in @@ -25,7 +25,7 @@ # the same distribution terms that you use for the rest of that program. # # Please report bugs to -# and send patches to . +# and send patches to . # It is advisable to support a few --enable/--disable options to let the # user select which libraries s/he really wants. diff --git a/config/ChangeLog b/config/ChangeLog index 10bce27d8e91..473d9a0a1826 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,8 @@ +2025-10-02 H.J. Lu + + * clang-plugin.m4: Synced from binutils-gdb. + * gcc-plugin.m4: Likewise. + 2025-08-10 Ijaz, Abdul B * lib-link.m4: Handle dash in the library name for diff --git a/config/acx.m4 b/config/acx.m4 index c45e55e7f517..db54ccf1c7c1 100644 --- a/config/acx.m4 +++ b/config/acx.m4 @@ -107,9 +107,9 @@ AC_SUBST([target_subdir]) []dnl #### -# _NCN_TOOL_PREFIXES: Some stuff that oughtta be done in AC_CANONICAL_SYSTEM +# _NCN_TOOL_PREFIXES: Some stuff that oughtta be done in AC_CANONICAL_TARGET # or AC_INIT. -# These demand that AC_CANONICAL_SYSTEM be called beforehand. +# These demand that AC_CANONICAL_HOST and AC_CANONICAL_TARGET be called beforehand. AC_DEFUN([_NCN_TOOL_PREFIXES], [ncn_tool_prefix= test -n "$host_alias" && ncn_tool_prefix=$host_alias- diff --git a/config/clang-plugin.m4 b/config/clang-plugin.m4 new file mode 100644 index 000000000000..cc051fe48e32 --- /dev/null +++ b/config/clang-plugin.m4 @@ -0,0 +1,114 @@ +# clang-plugin.m4 -*- Autoconf -*- +# Check clang plugin file. + +dnl Copyright (C) 2025 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl +dnl +dnl CLANG_PLUGIN_FILE +dnl (SHELL-CODE_HANDLER) +dnl +AC_DEFUN([CLANG_PLUGIN_FILE],[dnl + AC_CACHE_CHECK([for clang], clang_cv_is_clang, [ + AC_EGREP_CPP(yes, [ +#ifdef __clang__ + yes +#endif + ], clang_cv_is_clang=yes, clang_cv_is_clang=no)]) + plugin_file= + if test $clang_cv_is_clang = yes; then + AC_MSG_CHECKING([for clang plugin file]) + plugin_names="LLVMgold.so" + for plugin in $plugin_names; do + plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin` + if test x$plugin_file = x$plugin; then + AC_CHECK_TOOL(LLVM_CONFIG, llvm-config) + if test "$?" != 0; then + AC_MSG_ERROR([Required tool 'llvm-config' not found on PATH.]) + fi + clang_lib_dir=`$LLVM_CONFIG --libdir` + if test -f $clang_lib_dir/$plugin; then + plugin_file=$clang_lib_dir/$plugin + fi + if test x$plugin_file != x$plugin; then + break; + fi + fi + done + if test -z $plugin_file; then + AC_MSG_ERROR([Couldn't find clang plugin file for $CC.]) + fi + dnl Check if ${AR} $plugin_option rc works. + AC_CHECK_TOOL(AR, ar) + if test "${AR}" = "" ; then + AC_MSG_ERROR([Required archive tool 'ar' not found on PATH.]) + fi + plugin_option="--plugin $plugin_file" + touch conftest.c + ${AR} $plugin_option rc conftest.a conftest.c + if test "$?" != 0; then + AC_MSG_WARN([Failed: $AR $plugin_option rc]) + plugin_file= + fi + rm -f conftest.* + AC_MSG_RESULT($plugin_file) + fi + $1="$plugin_file" +]) + +dnl +dnl +dnl CLANG_PLUGIN_FILE_FOR_TARGET +dnl (SHELL-CODE_HANDLER) +dnl +AC_DEFUN([CLANG_PLUGIN_FILE_FOR_TARGET],[dnl + COMPILER_FOR_TARGET="${CC_FOR_TARGET}" + if test x"${COMPILER_FOR_TARGET}" = x"\$(CC)"; then + COMPILER_FOR_TARGET="$CC" + fi + saved_CC="$CC" + CC="$COMPILER_FOR_TARGET" + AC_CACHE_CHECK([for clang for target], clang_target_cv_working, [ + AC_TRY_COMPILE([ +#ifndef __clang__ +#error Not clang +#endif + ], + [], + clang_target_cv_working=yes, clang_target_cv_working=no)]) + CC="$saved_CC" + plugin_file= + if test $clang_target_cv_working = yes; then + AC_MSG_CHECKING([for clang plugin file for target]) + plugin_names="LLVMgold.so" + dnl Check if the host compiler is used. + for plugin in $plugin_names; do + plugin_file=`${COMPILER_FOR_TARGET} ${CFLAGS_FOR_TARGET} --print-file-name $plugin` + if test x$plugin_file = x$plugin; then + GCC_TARGET_TOOL(llvm-config, LLVM_CONFIG_FOR_TARGET, LLVM_CONFIG) + if test "$?" != 0; then + AC_MSG_ERROR([Required target tool 'llvm-config' not found.]) + fi + clang_lib_dir=`$LLVM_CONFIG_FOR_TARGET --libdir` + if test -f $clang_lib_dir/$plugin; then + plugin_file=$clang_lib_dir/$plugin + fi + fi + if test x$plugin_file != x$plugin; then + break; + fi + plugin_file= + done + if test -n $plugin_file; then + AC_MSG_RESULT($plugin_file) + else + AC_MSG_RESULT([no]) + fi + fi + $1="$plugin_file" +]) diff --git a/config/gcc-plugin.m4 b/config/gcc-plugin.m4 index c30cfdd8fadb..0382147b3818 100644 --- a/config/gcc-plugin.m4 +++ b/config/gcc-plugin.m4 @@ -169,3 +169,46 @@ else AC_MSG_RESULT([no]) fi ]) + +dnl +dnl +dnl GCC_PLUGIN_OPTION_FOR_TARGET +dnl (SHELL-CODE_HANDLER) +dnl +AC_DEFUN([GCC_PLUGIN_OPTION_FOR_TARGET],[dnl +COMPILER_FOR_TARGET="${CC_FOR_TARGET}" +dnl Check if the host compiler is used. +if test x"${COMPILER_FOR_TARGET}" = x"\$(CC)"; then + COMPILER_FOR_TARGET="$CC" +fi +saved_CC="$CC" +CC="$COMPILER_FOR_TARGET" +AC_CACHE_CHECK([for gcc for target], gcc_target_cv_working, [ + AC_TRY_COMPILE( + [], + [], + gcc_target_cv_working=yes, + gcc_target_cv_working=no)]) +CC="$saved_CC" +AC_MSG_CHECKING([for -plugin option]) +plugin_option= +if test $gcc_target_cv_working = yes; then + plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" + for plugin in $plugin_names; do + plugin_so=`${COMPILER_FOR_TARGET} ${CFLAGS_FOR_TARGET} --print-prog-name $plugin` + if test x$plugin_so = x$plugin; then + plugin_so=`${COMPILER_FOR_TARGET} ${CFLAGS_FOR_TARGET} --print-file-name $plugin` + fi + if test x$plugin_so != x$plugin; then + plugin_option="--plugin $plugin_so" + break + fi + done +fi +if test -n "$plugin_option"; then + $1="$plugin_option" + AC_MSG_RESULT($plugin_option) +else + AC_MSG_RESULT([no]) +fi +]) diff --git a/config/lthostflags.m4 b/config/lthostflags.m4 index bc0f59ee79e0..4a389a75ea83 100644 --- a/config/lthostflags.m4 +++ b/config/lthostflags.m4 @@ -10,7 +10,7 @@ dnl Defines and AC_SUBSTs lt_host_flags AC_DEFUN([ACX_LT_HOST_FLAGS], [ -AC_REQUIRE([AC_CANONICAL_SYSTEM]) +AC_REQUIRE([AC_CANONICAL_HOST]) case $host in *-cygwin* | *-mingw*) diff --git a/configure b/configure index ccec3f21cd85..4f2ba5e8a056 100755 --- a/configure +++ b/configure @@ -596,6 +596,10 @@ MAINTAINER_MODE_TRUE COMPILER_NM_FOR_TARGET COMPILER_LD_FOR_TARGET COMPILER_AS_FOR_TARGET +RANLIB_PLUGIN_OPTION_FOR_TARGET +NM_PLUGIN_OPTION_FOR_TARGET +AR_PLUGIN_OPTION_FOR_TARGET +LLVM_CONFIG_FOR_TARGET FLAGS_FOR_TARGET RAW_CXX_FOR_TARGET WINDMC_FOR_TARGET @@ -621,7 +625,12 @@ GCC_FOR_TARGET CXX_FOR_TARGET CC_FOR_TARGET RANLIB_PLUGIN_OPTION +NM_PLUGIN_OPTION AR_PLUGIN_OPTION +LLVM_CONFIG +EGREP +GREP +CPP PKG_CONFIG_PATH GDCFLAGS READELF @@ -893,6 +902,7 @@ OBJCOPY OBJDUMP OTOOL READELF +CPP CC_FOR_TARGET CXX_FOR_TARGET GCC_FOR_TARGET @@ -1693,6 +1703,7 @@ Some influential environment variables: OBJDUMP OBJDUMP for the host OTOOL OTOOL for the host READELF READELF for the host + CPP C preprocessor CC_FOR_TARGET CC for the target CXX_FOR_TARGET @@ -1985,6 +1996,43 @@ fi as_fn_set_status $ac_retval } # ac_fn_c_try_link + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. @@ -2343,6 +2391,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + progname=$0 # if PWD already has a value, it is probably wrong. if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi @@ -2538,7 +2587,6 @@ test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- - test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. @@ -4104,10 +4152,6 @@ case "${target}" in # always build newlib. skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;; - # This is temporary until we can link against shared libraries - powerpcle-*-solaris*) - noconfigdirs="$noconfigdirs gdb sim tcl tk itcl" - ;; powerpc-*-beos*) noconfigdirs="$noconfigdirs gdb" ;; @@ -11031,6 +11075,11 @@ if echo " ${target_configdirs} " | grep " libgomp " > /dev/null 2>&1 ; then bootstrap_target_libs=${bootstrap_target_libs}target-libgomp, fi +# If we are building libatomic, bootstrap it. +if echo " ${target_configdirs} " | grep " libatomic " > /dev/null 2>&1 ; then + bootstrap_target_libs=${bootstrap_target_libs}target-libatomic, +fi + # If we are building libsanitizer and $BUILD_CONFIG contains bootstrap-asan # or bootstrap-ubsan, bootstrap it. if echo " ${target_configdirs} " | grep " libsanitizer " > /dev/null 2>&1; then @@ -14221,7 +14270,529 @@ fi GDCFLAGS=${GDCFLAGS-${CFLAGS}} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5 +# Try CLANG_PLUGIN_FILE first since GCC_PLUGIN_OPTION may return the +# wrong PLUGIN_OPTION with clang. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang" >&5 +$as_echo_n "checking for clang... " >&6; } +if ${clang_cv_is_clang+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __clang__ + yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + clang_cv_is_clang=yes +else + clang_cv_is_clang=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_cv_is_clang" >&5 +$as_echo "$clang_cv_is_clang" >&6; } + plugin_file= + if test $clang_cv_is_clang = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5 +$as_echo_n "checking for clang plugin file... " >&6; } + plugin_names="LLVMgold.so" + for plugin in $plugin_names; do + plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin` + if test x$plugin_file = x$plugin; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}llvm-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}llvm-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LLVM_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LLVM_CONFIG"; then + ac_cv_prog_LLVM_CONFIG="$LLVM_CONFIG" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LLVM_CONFIG="${ac_tool_prefix}llvm-config" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LLVM_CONFIG=$ac_cv_prog_LLVM_CONFIG +if test -n "$LLVM_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LLVM_CONFIG" >&5 +$as_echo "$LLVM_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LLVM_CONFIG"; then + ac_ct_LLVM_CONFIG=$LLVM_CONFIG + # Extract the first word of "llvm-config", so it can be a program name with args. +set dummy llvm-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_LLVM_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LLVM_CONFIG"; then + ac_cv_prog_ac_ct_LLVM_CONFIG="$ac_ct_LLVM_CONFIG" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LLVM_CONFIG="llvm-config" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LLVM_CONFIG=$ac_cv_prog_ac_ct_LLVM_CONFIG +if test -n "$ac_ct_LLVM_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LLVM_CONFIG" >&5 +$as_echo "$ac_ct_LLVM_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LLVM_CONFIG" = x; then + LLVM_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LLVM_CONFIG=$ac_ct_LLVM_CONFIG + fi +else + LLVM_CONFIG="$ac_cv_prog_LLVM_CONFIG" +fi + + if test "$?" != 0; then + as_fn_error $? "Required tool 'llvm-config' not found on PATH." "$LINENO" 5 + fi + clang_lib_dir=`$LLVM_CONFIG --libdir` + if test -f $clang_lib_dir/$plugin; then + plugin_file=$clang_lib_dir/$plugin + fi + if test x$plugin_file != x$plugin; then + break; + fi + fi + done + if test -z $plugin_file; then + as_fn_error $? "Couldn't find clang plugin file for $CC." "$LINENO" 5 + fi + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + + if test "${AR}" = "" ; then + as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5 + fi + plugin_option="--plugin $plugin_file" + touch conftest.c + ${AR} $plugin_option rc conftest.a conftest.c + if test "$?" != 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5 +$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;} + plugin_file= + fi + rm -f conftest.* + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5 +$as_echo "$plugin_file" >&6; } + fi + PLUGIN_FILE="$plugin_file" + +if test -n "$PLUGIN_FILE"; then + PLUGIN_OPTION="--plugin $PLUGIN_FILE" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5 $as_echo_n "checking for -plugin option... " >&6; } plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" @@ -14348,12 +14919,17 @@ else $as_echo "no" >&6; } fi +fi AR_PLUGIN_OPTION= +NM_PLUGIN_OPTION= RANLIB_PLUGIN_OPTION= if test -n "$PLUGIN_OPTION"; then if $AR --help 2>&1 | grep -q "\--plugin"; then AR_PLUGIN_OPTION="$PLUGIN_OPTION" fi + if $NM --help 2>&1 | grep -q "\--plugin"; then + NM_PLUGIN_OPTION="$PLUGIN_OPTION" + fi if $RANLIB --help 2>&1 | grep -q "\--plugin"; then RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION" fi @@ -14361,6 +14937,7 @@ fi + # Target tools. # Check whether --with-build-time-tools was given. @@ -20024,6 +20601,182 @@ AR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target} RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target} NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target} +# Try CLANG_PLUGIN_FILE_FOR_TARGET first since GCC_PLUGIN_OPTION_FOR_TARGET +# may return the wrong PLUGIN_OPTION_FOR_TARGET with clang. + COMPILER_FOR_TARGET="${CC_FOR_TARGET}" + if test x"${COMPILER_FOR_TARGET}" = x"\$(CC)"; then + COMPILER_FOR_TARGET="$CC" + fi + saved_CC="$CC" + CC="$COMPILER_FOR_TARGET" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang for target" >&5 +$as_echo_n "checking for clang for target... " >&6; } +if ${clang_target_cv_working+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifndef __clang__ +#error Not clang +#endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + clang_target_cv_working=yes +else + clang_target_cv_working=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_target_cv_working" >&5 +$as_echo "$clang_target_cv_working" >&6; } + CC="$saved_CC" + plugin_file= + if test $clang_target_cv_working = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file for target" >&5 +$as_echo_n "checking for clang plugin file for target... " >&6; } + plugin_names="LLVMgold.so" + for plugin in $plugin_names; do + plugin_file=`${COMPILER_FOR_TARGET} ${CFLAGS_FOR_TARGET} --print-file-name $plugin` + if test x$plugin_file = x$plugin; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target llvm-config" >&5 +$as_echo_n "checking where to find the target llvm-config... " >&6; } +if test "x${build}" != "x${host}" ; then + if expr "x$LLVM_CONFIG_FOR_TARGET" : "x/" > /dev/null; then + # We already found the complete path + ac_dir=`dirname $LLVM_CONFIG_FOR_TARGET` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: pre-installed in $ac_dir" >&5 +$as_echo "pre-installed in $ac_dir" >&6; } + else + # Canadian cross, just use what we found + { $as_echo "$as_me:${as_lineno-$LINENO}: result: pre-installed" >&5 +$as_echo "pre-installed" >&6; } + fi +else + if expr "x$LLVM_CONFIG_FOR_TARGET" : "x/" > /dev/null; then + # We already found the complete path + ac_dir=`dirname $LLVM_CONFIG_FOR_TARGET` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: pre-installed in $ac_dir" >&5 +$as_echo "pre-installed in $ac_dir" >&6; } + elif test "x$target" = "x$host"; then + # We can use an host tool + LLVM_CONFIG_FOR_TARGET='$(LLVM_CONFIG)' + { $as_echo "$as_me:${as_lineno-$LINENO}: result: host tool" >&5 +$as_echo "host tool" >&6; } + else + # We need a cross tool + { $as_echo "$as_me:${as_lineno-$LINENO}: result: pre-installed" >&5 +$as_echo "pre-installed" >&6; } + fi +fi + + if test "$?" != 0; then + as_fn_error $? "Required target tool 'llvm-config' not found." "$LINENO" 5 + fi + clang_lib_dir=`$LLVM_CONFIG_FOR_TARGET --libdir` + if test -f $clang_lib_dir/$plugin; then + plugin_file=$clang_lib_dir/$plugin + fi + fi + if test x$plugin_file != x$plugin; then + break; + fi + plugin_file= + done + if test -n $plugin_file; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5 +$as_echo "$plugin_file" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + fi + PLUGIN_FILE_FOR_TARGET="$plugin_file" + +if test -n "$PLUGIN_FILE_FOR_TARGET"; then + PLUGIN_OPTION_FOR_TARGET="--plugin $PLUGIN_FILE_FOR_TARGET" +else + COMPILER_FOR_TARGET="${CC_FOR_TARGET}" +if test x"${COMPILER_FOR_TARGET}" = x"\$(CC)"; then + COMPILER_FOR_TARGET="$CC" +fi +saved_CC="$CC" +CC="$COMPILER_FOR_TARGET" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc for target" >&5 +$as_echo_n "checking for gcc for target... " >&6; } +if ${gcc_target_cv_working+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gcc_target_cv_working=yes +else + gcc_target_cv_working=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_target_cv_working" >&5 +$as_echo "$gcc_target_cv_working" >&6; } +CC="$saved_CC" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5 +$as_echo_n "checking for -plugin option... " >&6; } +plugin_option= +if test $gcc_target_cv_working = yes; then + plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" + for plugin in $plugin_names; do + plugin_so=`${COMPILER_FOR_TARGET} ${CFLAGS_FOR_TARGET} --print-prog-name $plugin` + if test x$plugin_so = x$plugin; then + plugin_so=`${COMPILER_FOR_TARGET} ${CFLAGS_FOR_TARGET} --print-file-name $plugin` + fi + if test x$plugin_so != x$plugin; then + plugin_option="--plugin $plugin_so" + break + fi + done +fi +if test -n "$plugin_option"; then + PLUGIN_OPTION_FOR_TARGET="$plugin_option" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5 +$as_echo "$plugin_option" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +fi +if test -n "$PLUGIN_OPTION_FOR_TARGET"; then + AR_PLUGIN_OPTION_FOR_TARGET="$PLUGIN_OPTION_FOR_TARGET" + NM_PLUGIN_OPTION_FOR_TARGET="$PLUGIN_OPTION_FOR_TARGET" + RANLIB_PLUGIN_OPTION_FOR_TARGET="$PLUGIN_OPTION_FOR_TARGET" +else + AR_PLUGIN_OPTION_FOR_TARGET= + NM_PLUGIN_OPTION_FOR_TARGET= + RANLIB_PLUGIN_OPTION_FOR_TARGET= +fi + + + + # When building target libraries, except in a Canadian cross, we use # the same toolchain as the compiler we just built. COMPILER_AS_FOR_TARGET='$(AS_FOR_TARGET)' diff --git a/configure.ac b/configure.ac index 89ebe4041b61..94321ffd20ab 100644 --- a/configure.ac +++ b/configure.ac @@ -24,6 +24,7 @@ m4_include(config/override.m4) m4_include(config/proginstall.m4) m4_include(config/elf.m4) m4_include(config/ax_cxx_compile_stdcxx.m4) +m4_include(config/clang-plugin.m4) m4_include(config/gcc-plugin.m4) m4_include([libtool.m4]) m4_include([ltoptions.m4]) @@ -32,7 +33,8 @@ m4_include([ltversion.m4]) m4_include([lt~obsolete.m4]) m4_include([config/isl.m4]) -AC_INIT(move-if-change) +AC_INIT +AC_CONFIG_SRCDIR([move-if-change]) AC_DISABLE_OPTION_CHECKING progname=$0 @@ -70,14 +72,14 @@ ACX_NONCANONICAL_TARGET dnl Autoconf 2.5x and later will set a default program prefix if dnl --target was used, even if it was the same as --host. Disable -dnl that behavior. This must be done before AC_CANONICAL_SYSTEM +dnl that behavior. This must be done before AC_CANONICAL_TARGET dnl to take effect. test "$host_noncanonical" = "$target_noncanonical" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_transform_name=s,y,y, -AC_CANONICAL_SYSTEM +AC_CANONICAL_TARGET AC_ARG_PROGRAM m4_pattern_allow([^AS_FOR_TARGET$])dnl @@ -1319,10 +1321,6 @@ case "${target}" in # always build newlib. skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;; - # This is temporary until we can link against shared libraries - powerpcle-*-solaris*) - noconfigdirs="$noconfigdirs gdb sim tcl tk itcl" - ;; powerpc-*-beos*) noconfigdirs="$noconfigdirs gdb" ;; @@ -3253,6 +3251,11 @@ if echo " ${target_configdirs} " | grep " libgomp " > /dev/null 2>&1 ; then bootstrap_target_libs=${bootstrap_target_libs}target-libgomp, fi +# If we are building libatomic, bootstrap it. +if echo " ${target_configdirs} " | grep " libatomic " > /dev/null 2>&1 ; then + bootstrap_target_libs=${bootstrap_target_libs}target-libatomic, +fi + # If we are building libsanitizer and $BUILD_CONFIG contains bootstrap-asan # or bootstrap-ubsan, bootstrap it. if echo " ${target_configdirs} " | grep " libsanitizer " > /dev/null 2>&1; then @@ -4015,18 +4018,30 @@ AC_SUBST(GDCFLAGS) GDCFLAGS=${GDCFLAGS-${CFLAGS}} AC_SUBST(PKG_CONFIG_PATH) -GCC_PLUGIN_OPTION(PLUGIN_OPTION) +# Try CLANG_PLUGIN_FILE first since GCC_PLUGIN_OPTION may return the +# wrong PLUGIN_OPTION with clang. +CLANG_PLUGIN_FILE(PLUGIN_FILE) +if test -n "$PLUGIN_FILE"; then + PLUGIN_OPTION="--plugin $PLUGIN_FILE" +else + GCC_PLUGIN_OPTION(PLUGIN_OPTION) +fi AR_PLUGIN_OPTION= +NM_PLUGIN_OPTION= RANLIB_PLUGIN_OPTION= if test -n "$PLUGIN_OPTION"; then if $AR --help 2>&1 | grep -q "\--plugin"; then AR_PLUGIN_OPTION="$PLUGIN_OPTION" fi + if $NM --help 2>&1 | grep -q "\--plugin"; then + NM_PLUGIN_OPTION="$PLUGIN_OPTION" + fi if $RANLIB --help 2>&1 | grep -q "\--plugin"; then RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION" fi fi AC_SUBST(AR_PLUGIN_OPTION) +AC_SUBST(NM_PLUGIN_OPTION) AC_SUBST(RANLIB_PLUGIN_OPTION) # Target tools. @@ -4121,6 +4136,27 @@ AR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target} RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target} NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target} +# Try CLANG_PLUGIN_FILE_FOR_TARGET first since GCC_PLUGIN_OPTION_FOR_TARGET +# may return the wrong PLUGIN_OPTION_FOR_TARGET with clang. +CLANG_PLUGIN_FILE_FOR_TARGET(PLUGIN_FILE_FOR_TARGET) +if test -n "$PLUGIN_FILE_FOR_TARGET"; then + PLUGIN_OPTION_FOR_TARGET="--plugin $PLUGIN_FILE_FOR_TARGET" +else + GCC_PLUGIN_OPTION_FOR_TARGET(PLUGIN_OPTION_FOR_TARGET) +fi +if test -n "$PLUGIN_OPTION_FOR_TARGET"; then + AR_PLUGIN_OPTION_FOR_TARGET="$PLUGIN_OPTION_FOR_TARGET" + NM_PLUGIN_OPTION_FOR_TARGET="$PLUGIN_OPTION_FOR_TARGET" + RANLIB_PLUGIN_OPTION_FOR_TARGET="$PLUGIN_OPTION_FOR_TARGET" +else + AR_PLUGIN_OPTION_FOR_TARGET= + NM_PLUGIN_OPTION_FOR_TARGET= + RANLIB_PLUGIN_OPTION_FOR_TARGET= +fi +AC_SUBST(AR_PLUGIN_OPTION_FOR_TARGET) +AC_SUBST(NM_PLUGIN_OPTION_FOR_TARGET) +AC_SUBST(RANLIB_PLUGIN_OPTION_FOR_TARGET) + # When building target libraries, except in a Canadian cross, we use # the same toolchain as the compiler we just built. COMPILER_AS_FOR_TARGET='$(AS_FOR_TARGET)' diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 691203f9036b..8a1d884d7c35 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,63 @@ +2025-10-16 David Malcolm + + * gcc.doxy (INPUT): Add gcc/custom-sarif-properties + +2025-10-08 Jakub Jelinek + + * unicode/README: Add HangulSyllableType.txt file to the + list as newest utf8_gen.py from glibc now needs it. Adjust + git commit hash and change unicode 16 version to 17. + * unicode/from_glibc/utf8_gen.py: Updated from glibc. + * unicode/DerivedCoreProperties.txt: Updated from Unicode 17.0.0. + * unicode/emoji-data.txt: Likewise. + * unicode/PropList.txt: Likewise. + * unicode/GraphemeBreakProperty.txt: Likewise. + * unicode/DerivedNormalizationProps.txt: Likewise. + * unicode/NameAliases.txt: Likewise. + * unicode/UnicodeData.txt: Likewise. + * unicode/EastAsianWidth.txt: Likewise. + * unicode/DerivedGeneralCategory.txt: Likewise. + * unicode/HangulSyllableType.txt: New file. + +2025-10-05 Mark Wielaard + + * gcc-changelog/git_update_version.py (ignored_commits): Add + commit b40ef6e9dc096c8c19399e94947a1965258a6942. + +2025-10-03 David Malcolm + + Revert: + 2025-10-02 David Malcolm + + * gcc.doxy (INPUT): Add gcc/custom-sarif-properties + +2025-10-02 David Malcolm + + * gcc.doxy (INPUT): Add gcc/custom-sarif-properties + +2025-09-23 Jonathan Wakely + + * unicode/gen_libstdcxx_unicode_data.py: Fix comment type. + +2025-09-22 Jonathan Wakely + + * unicode/gen_libstdcxx_unicode_data.py: Update comment at the + top of the file to mention DerivedGeneralCategory.txt + prerequisite. + +2025-09-17 Andrew Pinski + + * uninclude: Add `lib/gcc//include`. + +2025-09-10 Christophe Lyon + + * compare_tests: Improve non-unique tests report when testing + several configurations. + +2025-09-08 Christophe Lyon + + * compare_tests: Report non-unique test names. + 2025-08-17 Filip Kastl * check-MAINTAINERS.py: Document the way the script sorts diff --git a/contrib/compare_tests b/contrib/compare_tests index 152957bc3247..8efd15e903f1 100755 --- a/contrib/compare_tests +++ b/contrib/compare_tests @@ -126,10 +126,18 @@ fi sort -t ':' $skip1 "$now" > "$now_s" sort -t ':' $skip1 "$before" > "$before_s" -# Report non-unique test names, but print the two lists only if they -# are different. -sed '/^$/d' "$now_s" | uniq -cd > "$now_u" -sed '/^$/d' "$before_s" | uniq -cd > "$before_u" +# Report non-unique test names and print the diff between the two +# lists if they are different. +# +# If the results include several configurations (schedule of +# variations), we report duplicates several times with different +# target/tool prefixes because at this stage we do not know if the +# target and/or tool prefix was inserted. +# If we used the input files (so generally several times the same +# results in one section per target), we would incorreclty detect +# duplicates (as many as targets) +grep -E '^(PASS|XPASS|FAIL|XFAIL|UNRESOLVED|UNSUPPORTED|UNTESTED|ERROR):' "$now_s" | uniq -cd > "$now_u" +grep -E '^(PASS|XPASS|FAIL|XFAIL|UNRESOLVED|UNSUPPORTED|UNTESTED|ERROR):' "$before_s" | uniq -cd > "$before_u" same_uniq=" now" cmp -s "$before_u" "$now_u" && same_uniq="" @@ -142,8 +150,8 @@ if [ -s "$now_u" ]; then fi if [ -s "$before_u" -a "x$same_uniq" != "x" ]; then - echo "Non-unique test names before: (Eeek!)" - cat "$before_u" + echo "Changes to non-unique test names:" + diff -u "$before_u" "$now_u" | grep -E '^[-\\+] ' echo exit_status=1 fi diff --git a/contrib/gcc-changelog/git_update_version.py b/contrib/gcc-changelog/git_update_version.py index b3ea33bb5161..09a42520624f 100755 --- a/contrib/gcc-changelog/git_update_version.py +++ b/contrib/gcc-changelog/git_update_version.py @@ -47,7 +47,8 @@ '72677e1119dc40aa680755d009e079ad49446c46', '10d76b7f1e5b63ad6d2b92940c39007913ced037', 'de3b277247ce98d189f121155b75f490725a42f6', - '13cf22eb557eb5e3d796822247d8d4957bdb25da'} + '13cf22eb557eb5e3d796822247d8d4957bdb25da', + 'b40ef6e9dc096c8c19399e94947a1965258a6942'} FORMAT = '%(asctime)s:%(levelname)s:%(name)s:%(message)s' logging.basicConfig(level=logging.INFO, format=FORMAT, diff --git a/contrib/gcc.doxy b/contrib/gcc.doxy index 15952046f256..56e3845d00d4 100644 --- a/contrib/gcc.doxy +++ b/contrib/gcc.doxy @@ -478,7 +478,7 @@ WARN_LOGFILE = # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = gcc gcc/analyzer gcc/diagnostics gcc/text-art +INPUT = gcc gcc/analyzer gcc/custom-sarif-properties gcc/diagnostics gcc/text-art # This tag can be used to specify the character encoding of the source files that # doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default diff --git a/contrib/unicode/DerivedCoreProperties.txt b/contrib/unicode/DerivedCoreProperties.txt index 1075638f1a65..f327784bf395 100644 --- a/contrib/unicode/DerivedCoreProperties.txt +++ b/contrib/unicode/DerivedCoreProperties.txt @@ -1,6 +1,6 @@ -# DerivedCoreProperties-16.0.0.txt -# Date: 2024-05-31, 18:09:32 GMT -# © 2024 Unicode®, Inc. +# DerivedCoreProperties-17.0.0.txt +# Date: 2025-07-30, 23:55:08 GMT +# © 2025 Unicode®, Inc. # Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries. # For terms of use and license, see https://www.unicode.org/terms_of_use.html # @@ -178,6 +178,7 @@ FF5E ; Math # Sm FULLWIDTH TILDE FFE2 ; Math # Sm FULLWIDTH NOT SIGN FFE9..FFEC ; Math # Sm [4] HALFWIDTH LEFTWARDS ARROW..HALFWIDTH DOWNWARDS ARROW 10D8E..10D8F ; Math # Sm [2] GARAY PLUS SIGN..GARAY MINUS SIGN +1CEF0 ; Math # Sm MEDIUM SMALL WHITE CIRCLE WITH HORIZONTAL BAR 1D400..1D454 ; Math # L& [85] MATHEMATICAL BOLD CAPITAL A..MATHEMATICAL ITALIC SMALL G 1D456..1D49C ; Math # L& [71] MATHEMATICAL ITALIC SMALL I..MATHEMATICAL SCRIPT CAPITAL A 1D49E..1D49F ; Math # L& [2] MATHEMATICAL SCRIPT CAPITAL C..MATHEMATICAL SCRIPT CAPITAL D @@ -253,8 +254,9 @@ FFE9..FFEC ; Math # Sm [4] HALFWIDTH LEFTWARDS ARROW..HALFWIDTH DOWNWARDS A 1EEA5..1EEA9 ; Math # Lo [5] ARABIC MATHEMATICAL DOUBLE-STRUCK WAW..ARABIC MATHEMATICAL DOUBLE-STRUCK YEH 1EEAB..1EEBB ; Math # Lo [17] ARABIC MATHEMATICAL DOUBLE-STRUCK LAM..ARABIC MATHEMATICAL DOUBLE-STRUCK GHAIN 1EEF0..1EEF1 ; Math # Sm [2] ARABIC MATHEMATICAL OPERATOR MEEM WITH HAH WITH TATWEEL..ARABIC MATHEMATICAL OPERATOR HAH WITH DAL +1F8D0..1F8D8 ; Math # Sm [9] LONG RIGHTWARDS ARROW OVER LONG LEFTWARDS ARROW..LONG LEFT RIGHT ARROW WITH DEPENDENT LOBE -# Total code points: 2312 +# Total code points: 2322 # ================================================ @@ -273,8 +275,8 @@ FFE9..FFEC ; Math # Sm [4] HALFWIDTH LEFTWARDS ARROW..HALFWIDTH DOWNWARDS A 01BC..01BF ; Alphabetic # L& [4] LATIN CAPITAL LETTER TONE FIVE..LATIN LETTER WYNN 01C0..01C3 ; Alphabetic # Lo [4] LATIN LETTER DENTAL CLICK..LATIN LETTER RETROFLEX CLICK 01C4..0293 ; Alphabetic # L& [208] LATIN CAPITAL LETTER DZ WITH CARON..LATIN SMALL LETTER EZH WITH CURL -0294 ; Alphabetic # Lo LATIN LETTER GLOTTAL STOP -0295..02AF ; Alphabetic # L& [27] LATIN LETTER PHARYNGEAL VOICED FRICATIVE..LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL +0294..0295 ; Alphabetic # Lo [2] LATIN LETTER GLOTTAL STOP..LATIN LETTER PHARYNGEAL VOICED FRICATIVE +0296..02AF ; Alphabetic # L& [26] LATIN LETTER INVERTED GLOTTAL STOP..LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL 02B0..02C1 ; Alphabetic # Lm [18] MODIFIER LETTER SMALL H..MODIFIER LETTER REVERSED GLOTTAL STOP 02C6..02D1 ; Alphabetic # Lm [12] MODIFIER LETTER CIRCUMFLEX ACCENT..MODIFIER LETTER HALF TRIANGULAR COLON 02E0..02E4 ; Alphabetic # Lm [5] MODIFIER LETTER SMALL GAMMA..MODIFIER LETTER SMALL REVERSED GLOTTAL STOP @@ -344,7 +346,7 @@ FFE9..FFEC ; Math # Sm [4] HALFWIDTH LEFTWARDS ARROW..HALFWIDTH DOWNWARDS A 0840..0858 ; Alphabetic # Lo [25] MANDAIC LETTER HALQA..MANDAIC LETTER AIN 0860..086A ; Alphabetic # Lo [11] SYRIAC LETTER MALAYALAM NGA..SYRIAC LETTER MALAYALAM SSA 0870..0887 ; Alphabetic # Lo [24] ARABIC LETTER ALEF WITH ATTACHED FATHA..ARABIC BASELINE ROUND DOT -0889..088E ; Alphabetic # Lo [6] ARABIC LETTER NOON WITH INVERTED SMALL V..ARABIC VERTICAL TAIL +0889..088F ; Alphabetic # Lo [7] ARABIC LETTER NOON WITH INVERTED SMALL V..ARABIC LETTER NOON WITH RING ABOVE 0897 ; Alphabetic # Mn ARABIC PEPET 08A0..08C8 ; Alphabetic # Lo [41] ARABIC LETTER BEH WITH SMALL V BELOW..ARABIC LETTER GRAF 08C9 ; Alphabetic # Lm ARABIC SMALL FARSI YEH @@ -477,7 +479,7 @@ FFE9..FFEC ; Math # Sm [4] HALFWIDTH LEFTWARDS ARROW..HALFWIDTH DOWNWARDS A 0C4A..0C4C ; Alphabetic # Mn [3] TELUGU VOWEL SIGN O..TELUGU VOWEL SIGN AU 0C55..0C56 ; Alphabetic # Mn [2] TELUGU LENGTH MARK..TELUGU AI LENGTH MARK 0C58..0C5A ; Alphabetic # Lo [3] TELUGU LETTER TSA..TELUGU LETTER RRRA -0C5D ; Alphabetic # Lo TELUGU LETTER NAKAARA POLLU +0C5C..0C5D ; Alphabetic # Lo [2] TELUGU ARCHAIC SHRII..TELUGU LETTER NAKAARA POLLU 0C60..0C61 ; Alphabetic # Lo [2] TELUGU LETTER VOCALIC RR..TELUGU LETTER VOCALIC LL 0C62..0C63 ; Alphabetic # Mn [2] TELUGU VOWEL SIGN VOCALIC L..TELUGU VOWEL SIGN VOCALIC LL 0C80 ; Alphabetic # Lo KANNADA SIGN SPACING CANDRABINDU @@ -497,7 +499,7 @@ FFE9..FFEC ; Math # Sm [4] HALFWIDTH LEFTWARDS ARROW..HALFWIDTH DOWNWARDS A 0CCA..0CCB ; Alphabetic # Mc [2] KANNADA VOWEL SIGN O..KANNADA VOWEL SIGN OO 0CCC ; Alphabetic # Mn KANNADA VOWEL SIGN AU 0CD5..0CD6 ; Alphabetic # Mc [2] KANNADA LENGTH MARK..KANNADA AI LENGTH MARK -0CDD..0CDE ; Alphabetic # Lo [2] KANNADA LETTER NAKAARA POLLU..KANNADA LETTER FA +0CDC..0CDE ; Alphabetic # Lo [3] KANNADA ARCHAIC SHRII..KANNADA LETTER FA 0CE0..0CE1 ; Alphabetic # Lo [2] KANNADA LETTER VOCALIC RR..KANNADA LETTER VOCALIC LL 0CE2..0CE3 ; Alphabetic # Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL 0CF1..0CF2 ; Alphabetic # Lo [2] KANNADA SIGN JIHVAMULIYA..KANNADA SIGN UPADHMANIYA @@ -833,11 +835,8 @@ A771..A787 ; Alphabetic # L& [23] LATIN SMALL LETTER DUM..LATIN SMALL LETTER A788 ; Alphabetic # Lm MODIFIER LETTER LOW CIRCUMFLEX ACCENT A78B..A78E ; Alphabetic # L& [4] LATIN CAPITAL LETTER SALTILLO..LATIN SMALL LETTER L WITH RETROFLEX HOOK AND BELT A78F ; Alphabetic # Lo LATIN LETTER SINOLOGICAL DOT -A790..A7CD ; Alphabetic # L& [62] LATIN CAPITAL LETTER N WITH DESCENDER..LATIN SMALL LETTER S WITH DIAGONAL STROKE -A7D0..A7D1 ; Alphabetic # L& [2] LATIN CAPITAL LETTER CLOSED INSULAR G..LATIN SMALL LETTER CLOSED INSULAR G -A7D3 ; Alphabetic # L& LATIN SMALL LETTER DOUBLE THORN -A7D5..A7DC ; Alphabetic # L& [8] LATIN SMALL LETTER DOUBLE WYNN..LATIN CAPITAL LETTER LAMBDA WITH STROKE -A7F2..A7F4 ; Alphabetic # Lm [3] MODIFIER LETTER CAPITAL C..MODIFIER LETTER CAPITAL Q +A790..A7DC ; Alphabetic # L& [77] LATIN CAPITAL LETTER N WITH DESCENDER..LATIN CAPITAL LETTER LAMBDA WITH STROKE +A7F1..A7F4 ; Alphabetic # Lm [4] MODIFIER LETTER CAPITAL S..MODIFIER LETTER CAPITAL Q A7F5..A7F6 ; Alphabetic # L& [2] LATIN CAPITAL LETTER REVERSED HALF H..LATIN SMALL LETTER REVERSED HALF H A7F7 ; Alphabetic # Lo LATIN EPIGRAPHIC LETTER SIDEWAYS I A7F8..A7F9 ; Alphabetic # Lm [2] MODIFIER LETTER CAPITAL H WITH STROKE..MODIFIER LETTER SMALL LIGATURE OE @@ -1020,6 +1019,7 @@ FFDA..FFDC ; Alphabetic # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANG 108F4..108F5 ; Alphabetic # Lo [2] HATRAN LETTER SHIN..HATRAN LETTER TAW 10900..10915 ; Alphabetic # Lo [22] PHOENICIAN LETTER ALF..PHOENICIAN LETTER TAU 10920..10939 ; Alphabetic # Lo [26] LYDIAN LETTER A..LYDIAN LETTER C +10940..10959 ; Alphabetic # Lo [26] SIDETIC LETTER N01..SIDETIC LETTER N26 10980..109B7 ; Alphabetic # Lo [56] MEROITIC HIEROGLYPHIC LETTER A..MEROITIC CURSIVE LETTER DA 109BE..109BF ; Alphabetic # Lo [2] MEROITIC CURSIVE LOGOGRAM RMT..MEROITIC CURSIVE LOGOGRAM IMN 10A00 ; Alphabetic # Lo KHAROSHTHI LETTER A @@ -1053,7 +1053,9 @@ FFDA..FFDC ; Alphabetic # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANG 10EAB..10EAC ; Alphabetic # Mn [2] YEZIDI COMBINING HAMZA MARK..YEZIDI COMBINING MADDA MARK 10EB0..10EB1 ; Alphabetic # Lo [2] YEZIDI LETTER LAM WITH DOT ABOVE..YEZIDI LETTER YOT WITH CIRCUMFLEX ABOVE 10EC2..10EC4 ; Alphabetic # Lo [3] ARABIC LETTER DAL WITH TWO DOTS VERTICALLY BELOW..ARABIC LETTER KAF WITH TWO DOTS VERTICALLY BELOW -10EFC ; Alphabetic # Mn ARABIC COMBINING ALEF OVERLAY +10EC5 ; Alphabetic # Lm ARABIC SMALL YEH BARREE WITH TWO DOTS BELOW +10EC6..10EC7 ; Alphabetic # Lo [2] ARABIC LETTER THIN NOON..ARABIC LETTER YEH WITH FOUR DOTS BELOW +10EFA..10EFC ; Alphabetic # Mn [3] ARABIC DOUBLE VERTICAL BAR BELOW..ARABIC COMBINING ALEF OVERLAY 10F00..10F1C ; Alphabetic # Lo [29] OLD SOGDIAN LETTER ALEPH..OLD SOGDIAN LETTER FINAL TAW WITH VERTICAL TAIL 10F27 ; Alphabetic # Lo OLD SOGDIAN LIGATURE AYIN-DALETH 10F30..10F45 ; Alphabetic # Lo [22] SOGDIAN LETTER ALEPH..SOGDIAN INDEPENDENT SHIN @@ -1239,6 +1241,12 @@ FFDA..FFDC ; Alphabetic # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANG 11A97 ; Alphabetic # Mc SOYOMBO SIGN VISARGA 11A9D ; Alphabetic # Lo SOYOMBO MARK PLUTA 11AB0..11AF8 ; Alphabetic # Lo [73] CANADIAN SYLLABICS NATTILIK HI..PAU CIN HAU GLOTTAL STOP FINAL +11B60 ; Alphabetic # Mn SHARADA VOWEL SIGN OE +11B61 ; Alphabetic # Mc SHARADA VOWEL SIGN OOE +11B62..11B64 ; Alphabetic # Mn [3] SHARADA VOWEL SIGN UE..SHARADA VOWEL SIGN SHORT E +11B65 ; Alphabetic # Mc SHARADA VOWEL SIGN SHORT O +11B66 ; Alphabetic # Mn SHARADA VOWEL SIGN CANDRA E +11B67 ; Alphabetic # Mc SHARADA VOWEL SIGN CANDRA O 11BC0..11BE0 ; Alphabetic # Lo [33] SUNUWAR LETTER DEVI..SUNUWAR LETTER KLOKO 11C00..11C08 ; Alphabetic # Lo [9] BHAIKSUKI LETTER A..BHAIKSUKI LETTER VOCALIC L 11C0A..11C2E ; Alphabetic # Lo [37] BHAIKSUKI LETTER E..BHAIKSUKI LETTER HA @@ -1274,6 +1282,9 @@ FFDA..FFDC ; Alphabetic # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANG 11D95 ; Alphabetic # Mn GUNJALA GONDI SIGN ANUSVARA 11D96 ; Alphabetic # Mc GUNJALA GONDI SIGN VISARGA 11D98 ; Alphabetic # Lo GUNJALA GONDI OM +11DB0..11DD8 ; Alphabetic # Lo [41] TOLONG SIKI LETTER I..TOLONG SIKI LETTER RRH +11DD9 ; Alphabetic # Lm TOLONG SIKI SIGN SELA +11DDA..11DDB ; Alphabetic # Lo [2] TOLONG SIKI SIGN HECAKA..TOLONG SIKI UNGGA 11EE0..11EF2 ; Alphabetic # Lo [19] MAKASAR LETTER KA..MAKASAR ANGKA 11EF3..11EF4 ; Alphabetic # Mn [2] MAKASAR VOWEL SIGN I..MAKASAR VOWEL SIGN U 11EF5..11EF6 ; Alphabetic # Mc [2] MAKASAR VOWEL SIGN E..MAKASAR VOWEL SIGN O @@ -1311,6 +1322,8 @@ FFDA..FFDC ; Alphabetic # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANG 16D43..16D6A ; Alphabetic # Lo [40] KIRAT RAI LETTER A..KIRAT RAI VOWEL SIGN AU 16D6B..16D6C ; Alphabetic # Lm [2] KIRAT RAI SIGN VIRAMA..KIRAT RAI SIGN SAAT 16E40..16E7F ; Alphabetic # L& [64] MEDEFAIDRIN CAPITAL LETTER M..MEDEFAIDRIN SMALL LETTER Y +16EA0..16EB8 ; Alphabetic # L& [25] BERIA ERFE CAPITAL LETTER ARKAB..BERIA ERFE CAPITAL LETTER AY +16EBB..16ED3 ; Alphabetic # L& [25] BERIA ERFE SMALL LETTER ARKAB..BERIA ERFE SMALL LETTER AY 16F00..16F4A ; Alphabetic # Lo [75] MIAO LETTER PA..MIAO LETTER RTE 16F4F ; Alphabetic # Mn MIAO SIGN CONSONANT MODIFIER BAR 16F50 ; Alphabetic # Lo MIAO LETTER NASALIZATION @@ -1320,9 +1333,11 @@ FFDA..FFDC ; Alphabetic # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANG 16FE0..16FE1 ; Alphabetic # Lm [2] TANGUT ITERATION MARK..NUSHU ITERATION MARK 16FE3 ; Alphabetic # Lm OLD CHINESE ITERATION MARK 16FF0..16FF1 ; Alphabetic # Mc [2] VIETNAMESE ALTERNATE READING MARK CA..VIETNAMESE ALTERNATE READING MARK NHAY -17000..187F7 ; Alphabetic # Lo [6136] TANGUT IDEOGRAPH-17000..TANGUT IDEOGRAPH-187F7 -18800..18CD5 ; Alphabetic # Lo [1238] TANGUT COMPONENT-001..KHITAN SMALL SCRIPT CHARACTER-18CD5 -18CFF..18D08 ; Alphabetic # Lo [10] KHITAN SMALL SCRIPT CHARACTER-18CFF..TANGUT IDEOGRAPH-18D08 +16FF2..16FF3 ; Alphabetic # Lm [2] CHINESE SMALL SIMPLIFIED ER..CHINESE SMALL TRADITIONAL ER +16FF4..16FF6 ; Alphabetic # Nl [3] YANGQIN SIGN SLOW ONE BEAT..YANGQIN SIGN SLOW TWO BEATS +17000..18CD5 ; Alphabetic # Lo [7382] TANGUT IDEOGRAPH-17000..KHITAN SMALL SCRIPT CHARACTER-18CD5 +18CFF..18D1E ; Alphabetic # Lo [32] KHITAN SMALL SCRIPT CHARACTER-18CFF..TANGUT IDEOGRAPH-18D1E +18D80..18DF2 ; Alphabetic # Lo [115] TANGUT COMPONENT-769..TANGUT COMPONENT-883 1AFF0..1AFF3 ; Alphabetic # Lm [4] KATAKANA LETTER MINNAN TONE-2..KATAKANA LETTER MINNAN TONE-5 1AFF5..1AFFB ; Alphabetic # Lm [7] KATAKANA LETTER MINNAN TONE-7..KATAKANA LETTER MINNAN NASALIZED TONE-5 1AFFD..1AFFE ; Alphabetic # Lm [2] KATAKANA LETTER MINNAN NASALIZED TONE-7..KATAKANA LETTER MINNAN NASALIZED TONE-8 @@ -1387,6 +1402,17 @@ FFDA..FFDC ; Alphabetic # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANG 1E4EB ; Alphabetic # Lm NAG MUNDARI SIGN OJOD 1E5D0..1E5ED ; Alphabetic # Lo [30] OL ONAL LETTER O..OL ONAL LETTER EG 1E5F0 ; Alphabetic # Lo OL ONAL SIGN HODDOND +1E6C0..1E6DE ; Alphabetic # Lo [31] TAI YO LETTER LOW KO..TAI YO LETTER HIGH KVO +1E6E0..1E6E2 ; Alphabetic # Lo [3] TAI YO LETTER AA..TAI YO LETTER UE +1E6E3 ; Alphabetic # Mn TAI YO SIGN UE +1E6E4..1E6E5 ; Alphabetic # Lo [2] TAI YO LETTER U..TAI YO LETTER AE +1E6E6 ; Alphabetic # Mn TAI YO SIGN AU +1E6E7..1E6ED ; Alphabetic # Lo [7] TAI YO LETTER O..TAI YO LETTER AUE +1E6EE..1E6EF ; Alphabetic # Mn [2] TAI YO SIGN AY..TAI YO SIGN ANG +1E6F0..1E6F4 ; Alphabetic # Lo [5] TAI YO LETTER AN..TAI YO LETTER AP +1E6F5 ; Alphabetic # Mn TAI YO SIGN OM +1E6FE ; Alphabetic # Lo TAI YO SYMBOL MUEANG +1E6FF ; Alphabetic # Lm TAI YO XAM LAI 1E7E0..1E7E6 ; Alphabetic # Lo [7] ETHIOPIC SYLLABLE HHYA..ETHIOPIC SYLLABLE HHYO 1E7E8..1E7EB ; Alphabetic # Lo [4] ETHIOPIC SYLLABLE GURAGE HHWA..ETHIOPIC SYLLABLE HHWE 1E7ED..1E7EE ; Alphabetic # Lo [2] ETHIOPIC SYLLABLE GURAGE MWI..ETHIOPIC SYLLABLE GURAGE MWEE @@ -1432,16 +1458,15 @@ FFDA..FFDC ; Alphabetic # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANG 1F150..1F169 ; Alphabetic # So [26] NEGATIVE CIRCLED LATIN CAPITAL LETTER A..NEGATIVE CIRCLED LATIN CAPITAL LETTER Z 1F170..1F189 ; Alphabetic # So [26] NEGATIVE SQUARED LATIN CAPITAL LETTER A..NEGATIVE SQUARED LATIN CAPITAL LETTER Z 20000..2A6DF ; Alphabetic # Lo [42720] CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6DF -2A700..2B739 ; Alphabetic # Lo [4154] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B739 -2B740..2B81D ; Alphabetic # Lo [222] CJK UNIFIED IDEOGRAPH-2B740..CJK UNIFIED IDEOGRAPH-2B81D -2B820..2CEA1 ; Alphabetic # Lo [5762] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEA1 +2A700..2B81D ; Alphabetic # Lo [4382] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B81D +2B820..2CEAD ; Alphabetic # Lo [5774] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEAD 2CEB0..2EBE0 ; Alphabetic # Lo [7473] CJK UNIFIED IDEOGRAPH-2CEB0..CJK UNIFIED IDEOGRAPH-2EBE0 2EBF0..2EE5D ; Alphabetic # Lo [622] CJK UNIFIED IDEOGRAPH-2EBF0..CJK UNIFIED IDEOGRAPH-2EE5D 2F800..2FA1D ; Alphabetic # Lo [542] CJK COMPATIBILITY IDEOGRAPH-2F800..CJK COMPATIBILITY IDEOGRAPH-2FA1D 30000..3134A ; Alphabetic # Lo [4939] CJK UNIFIED IDEOGRAPH-30000..CJK UNIFIED IDEOGRAPH-3134A -31350..323AF ; Alphabetic # Lo [4192] CJK UNIFIED IDEOGRAPH-31350..CJK UNIFIED IDEOGRAPH-323AF +31350..33479 ; Alphabetic # Lo [8490] CJK UNIFIED IDEOGRAPH-31350..CJK UNIFIED IDEOGRAPH-33479 -# Total code points: 142759 +# Total code points: 147421 # ================================================ @@ -1595,7 +1620,7 @@ FFDA..FFDC ; Alphabetic # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANG 024B ; Lowercase # L& LATIN SMALL LETTER Q WITH HOOK TAIL 024D ; Lowercase # L& LATIN SMALL LETTER R WITH STROKE 024F..0293 ; Lowercase # L& [69] LATIN SMALL LETTER Y WITH STROKE..LATIN SMALL LETTER EZH WITH CURL -0295..02AF ; Lowercase # L& [27] LATIN LETTER PHARYNGEAL VOICED FRICATIVE..LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL +0296..02AF ; Lowercase # L& [26] LATIN LETTER INVERTED GLOTTAL STOP..LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL 02B0..02B8 ; Lowercase # Lm [9] MODIFIER LETTER SMALL H..MODIFIER LETTER SMALL Y 02C0..02C1 ; Lowercase # Lm [2] MODIFIER LETTER GLOTTAL STOP..MODIFIER LETTER REVERSED GLOTTAL STOP 02E0..02E4 ; Lowercase # Lm [5] MODIFIER LETTER SMALL GAMMA..MODIFIER LETTER SMALL REVERSED GLOTTAL STOP @@ -2073,13 +2098,14 @@ A7C3 ; Lowercase # L& LATIN SMALL LETTER ANGLICANA W A7C8 ; Lowercase # L& LATIN SMALL LETTER D WITH SHORT STROKE OVERLAY A7CA ; Lowercase # L& LATIN SMALL LETTER S WITH SHORT STROKE OVERLAY A7CD ; Lowercase # L& LATIN SMALL LETTER S WITH DIAGONAL STROKE +A7CF ; Lowercase # L& LATIN SMALL LETTER PHARYNGEAL VOICED FRICATIVE A7D1 ; Lowercase # L& LATIN SMALL LETTER CLOSED INSULAR G A7D3 ; Lowercase # L& LATIN SMALL LETTER DOUBLE THORN A7D5 ; Lowercase # L& LATIN SMALL LETTER DOUBLE WYNN A7D7 ; Lowercase # L& LATIN SMALL LETTER MIDDLE SCOTS S A7D9 ; Lowercase # L& LATIN SMALL LETTER SIGMOID S A7DB ; Lowercase # L& LATIN SMALL LETTER LAMBDA -A7F2..A7F4 ; Lowercase # Lm [3] MODIFIER LETTER CAPITAL C..MODIFIER LETTER CAPITAL Q +A7F1..A7F4 ; Lowercase # Lm [4] MODIFIER LETTER CAPITAL S..MODIFIER LETTER CAPITAL Q A7F6 ; Lowercase # L& LATIN SMALL LETTER REVERSED HALF H A7F8..A7F9 ; Lowercase # Lm [2] MODIFIER LETTER CAPITAL H WITH STROKE..MODIFIER LETTER SMALL LIGATURE OE A7FA ; Lowercase # L& LATIN LETTER SMALL CAPITAL TURNED M @@ -2105,6 +2131,7 @@ FF41..FF5A ; Lowercase # L& [26] FULLWIDTH LATIN SMALL LETTER A..FULLWIDTH L 10D70..10D85 ; Lowercase # L& [22] GARAY SMALL LETTER A..GARAY SMALL LETTER OLD NA 118C0..118DF ; Lowercase # L& [32] WARANG CITI SMALL LETTER NGAA..WARANG CITI SMALL LETTER VIYO 16E60..16E7F ; Lowercase # L& [32] MEDEFAIDRIN SMALL LETTER M..MEDEFAIDRIN SMALL LETTER Y +16EBB..16ED3 ; Lowercase # L& [25] BERIA ERFE SMALL LETTER ARKAB..BERIA ERFE SMALL LETTER AY 1D41A..1D433 ; Lowercase # L& [26] MATHEMATICAL BOLD SMALL A..MATHEMATICAL BOLD SMALL Z 1D44E..1D454 ; Lowercase # L& [7] MATHEMATICAL ITALIC SMALL A..MATHEMATICAL ITALIC SMALL G 1D456..1D467 ; Lowercase # L& [18] MATHEMATICAL ITALIC SMALL I..MATHEMATICAL ITALIC SMALL Z @@ -2139,7 +2166,7 @@ FF41..FF5A ; Lowercase # L& [26] FULLWIDTH LATIN SMALL LETTER A..FULLWIDTH L 1E030..1E06D ; Lowercase # Lm [62] MODIFIER LETTER CYRILLIC SMALL A..MODIFIER LETTER CYRILLIC SMALL STRAIGHT U WITH STROKE 1E922..1E943 ; Lowercase # L& [34] ADLAM SMALL LETTER ALIF..ADLAM SMALL LETTER SHA -# Total code points: 2569 +# Total code points: 2595 # ================================================ @@ -2750,7 +2777,10 @@ A7C2 ; Uppercase # L& LATIN CAPITAL LETTER ANGLICANA W A7C4..A7C7 ; Uppercase # L& [4] LATIN CAPITAL LETTER C WITH PALATAL HOOK..LATIN CAPITAL LETTER D WITH SHORT STROKE OVERLAY A7C9 ; Uppercase # L& LATIN CAPITAL LETTER S WITH SHORT STROKE OVERLAY A7CB..A7CC ; Uppercase # L& [2] LATIN CAPITAL LETTER RAMS HORN..LATIN CAPITAL LETTER S WITH DIAGONAL STROKE +A7CE ; Uppercase # L& LATIN CAPITAL LETTER PHARYNGEAL VOICED FRICATIVE A7D0 ; Uppercase # L& LATIN CAPITAL LETTER CLOSED INSULAR G +A7D2 ; Uppercase # L& LATIN CAPITAL LETTER DOUBLE THORN +A7D4 ; Uppercase # L& LATIN CAPITAL LETTER DOUBLE WYNN A7D6 ; Uppercase # L& LATIN CAPITAL LETTER MIDDLE SCOTS S A7D8 ; Uppercase # L& LATIN CAPITAL LETTER SIGMOID S A7DA ; Uppercase # L& LATIN CAPITAL LETTER LAMBDA @@ -2767,6 +2797,7 @@ FF21..FF3A ; Uppercase # L& [26] FULLWIDTH LATIN CAPITAL LETTER A..FULLWIDTH 10D50..10D65 ; Uppercase # L& [22] GARAY CAPITAL LETTER A..GARAY CAPITAL LETTER OLD NA 118A0..118BF ; Uppercase # L& [32] WARANG CITI CAPITAL LETTER NGAA..WARANG CITI CAPITAL LETTER VIYO 16E40..16E5F ; Uppercase # L& [32] MEDEFAIDRIN CAPITAL LETTER M..MEDEFAIDRIN CAPITAL LETTER Y +16EA0..16EB8 ; Uppercase # L& [25] BERIA ERFE CAPITAL LETTER ARKAB..BERIA ERFE CAPITAL LETTER AY 1D400..1D419 ; Uppercase # L& [26] MATHEMATICAL BOLD CAPITAL A..MATHEMATICAL BOLD CAPITAL Z 1D434..1D44D ; Uppercase # L& [26] MATHEMATICAL ITALIC CAPITAL A..MATHEMATICAL ITALIC CAPITAL Z 1D468..1D481 ; Uppercase # L& [26] MATHEMATICAL BOLD ITALIC CAPITAL A..MATHEMATICAL BOLD ITALIC CAPITAL Z @@ -2803,7 +2834,7 @@ FF21..FF3A ; Uppercase # L& [26] FULLWIDTH LATIN CAPITAL LETTER A..FULLWIDTH 1F150..1F169 ; Uppercase # So [26] NEGATIVE CIRCLED LATIN CAPITAL LETTER A..NEGATIVE CIRCLED LATIN CAPITAL LETTER Z 1F170..1F189 ; Uppercase # So [26] NEGATIVE SQUARED LATIN CAPITAL LETTER A..NEGATIVE SQUARED LATIN CAPITAL LETTER Z -# Total code points: 1978 +# Total code points: 2006 # ================================================ @@ -2821,7 +2852,7 @@ FF21..FF3A ; Uppercase # L& [26] FULLWIDTH LATIN CAPITAL LETTER A..FULLWIDTH 00F8..01BA ; Cased # L& [195] LATIN SMALL LETTER O WITH STROKE..LATIN SMALL LETTER EZH WITH TAIL 01BC..01BF ; Cased # L& [4] LATIN CAPITAL LETTER TONE FIVE..LATIN LETTER WYNN 01C4..0293 ; Cased # L& [208] LATIN CAPITAL LETTER DZ WITH CARON..LATIN SMALL LETTER EZH WITH CURL -0295..02AF ; Cased # L& [27] LATIN LETTER PHARYNGEAL VOICED FRICATIVE..LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL +0296..02AF ; Cased # L& [26] LATIN LETTER INVERTED GLOTTAL STOP..LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL 02B0..02B8 ; Cased # Lm [9] MODIFIER LETTER SMALL H..MODIFIER LETTER SMALL Y 02C0..02C1 ; Cased # Lm [2] MODIFIER LETTER GLOTTAL STOP..MODIFIER LETTER REVERSED GLOTTAL STOP 02E0..02E4 ; Cased # Lm [5] MODIFIER LETTER SMALL GAMMA..MODIFIER LETTER SMALL REVERSED GLOTTAL STOP @@ -2911,11 +2942,8 @@ A722..A76F ; Cased # L& [78] LATIN CAPITAL LETTER EGYPTOLOGICAL ALEF..LATIN A770 ; Cased # Lm MODIFIER LETTER US A771..A787 ; Cased # L& [23] LATIN SMALL LETTER DUM..LATIN SMALL LETTER INSULAR T A78B..A78E ; Cased # L& [4] LATIN CAPITAL LETTER SALTILLO..LATIN SMALL LETTER L WITH RETROFLEX HOOK AND BELT -A790..A7CD ; Cased # L& [62] LATIN CAPITAL LETTER N WITH DESCENDER..LATIN SMALL LETTER S WITH DIAGONAL STROKE -A7D0..A7D1 ; Cased # L& [2] LATIN CAPITAL LETTER CLOSED INSULAR G..LATIN SMALL LETTER CLOSED INSULAR G -A7D3 ; Cased # L& LATIN SMALL LETTER DOUBLE THORN -A7D5..A7DC ; Cased # L& [8] LATIN SMALL LETTER DOUBLE WYNN..LATIN CAPITAL LETTER LAMBDA WITH STROKE -A7F2..A7F4 ; Cased # Lm [3] MODIFIER LETTER CAPITAL C..MODIFIER LETTER CAPITAL Q +A790..A7DC ; Cased # L& [77] LATIN CAPITAL LETTER N WITH DESCENDER..LATIN CAPITAL LETTER LAMBDA WITH STROKE +A7F1..A7F4 ; Cased # Lm [4] MODIFIER LETTER CAPITAL S..MODIFIER LETTER CAPITAL Q A7F5..A7F6 ; Cased # L& [2] LATIN CAPITAL LETTER REVERSED HALF H..LATIN SMALL LETTER REVERSED HALF H A7F8..A7F9 ; Cased # Lm [2] MODIFIER LETTER CAPITAL H WITH STROKE..MODIFIER LETTER SMALL LIGATURE OE A7FA ; Cased # L& LATIN LETTER SMALL CAPITAL TURNED M @@ -2949,6 +2977,8 @@ FF41..FF5A ; Cased # L& [26] FULLWIDTH LATIN SMALL LETTER A..FULLWIDTH LATIN 10D70..10D85 ; Cased # L& [22] GARAY SMALL LETTER A..GARAY SMALL LETTER OLD NA 118A0..118DF ; Cased # L& [64] WARANG CITI CAPITAL LETTER NGAA..WARANG CITI SMALL LETTER VIYO 16E40..16E7F ; Cased # L& [64] MEDEFAIDRIN CAPITAL LETTER M..MEDEFAIDRIN SMALL LETTER Y +16EA0..16EB8 ; Cased # L& [25] BERIA ERFE CAPITAL LETTER ARKAB..BERIA ERFE CAPITAL LETTER AY +16EBB..16ED3 ; Cased # L& [25] BERIA ERFE SMALL LETTER ARKAB..BERIA ERFE SMALL LETTER AY 1D400..1D454 ; Cased # L& [85] MATHEMATICAL BOLD CAPITAL A..MATHEMATICAL ITALIC SMALL G 1D456..1D49C ; Cased # L& [71] MATHEMATICAL ITALIC SMALL I..MATHEMATICAL SCRIPT CAPITAL A 1D49E..1D49F ; Cased # L& [2] MATHEMATICAL SCRIPT CAPITAL C..MATHEMATICAL SCRIPT CAPITAL D @@ -2988,7 +3018,7 @@ FF41..FF5A ; Cased # L& [26] FULLWIDTH LATIN SMALL LETTER A..FULLWIDTH LATIN 1F150..1F169 ; Cased # So [26] NEGATIVE CIRCLED LATIN CAPITAL LETTER A..NEGATIVE CIRCLED LATIN CAPITAL LETTER Z 1F170..1F189 ; Cased # So [26] NEGATIVE SQUARED LATIN CAPITAL LETTER A..NEGATIVE SQUARED LATIN CAPITAL LETTER Z -# Total code points: 4578 +# Total code points: 4632 # ================================================ @@ -3194,7 +3224,8 @@ FF41..FF5A ; Cased # L& [26] FULLWIDTH LATIN SMALL LETTER A..FULLWIDTH LATIN 1AA7 ; Case_Ignorable # Lm TAI THAM SIGN MAI YAMOK 1AB0..1ABD ; Case_Ignorable # Mn [14] COMBINING DOUBLED CIRCUMFLEX ACCENT..COMBINING PARENTHESES BELOW 1ABE ; Case_Ignorable # Me COMBINING PARENTHESES OVERLAY -1ABF..1ACE ; Case_Ignorable # Mn [16] COMBINING LATIN SMALL LETTER W BELOW..COMBINING LATIN SMALL LETTER INSULAR T +1ABF..1ADD ; Case_Ignorable # Mn [31] COMBINING LATIN SMALL LETTER W BELOW..COMBINING DOT-AND-RING BELOW +1AE0..1AEB ; Case_Ignorable # Mn [12] COMBINING LEFT TACK ABOVE..COMBINING DOUBLE RIGHTWARDS ARROW ABOVE 1B00..1B03 ; Case_Ignorable # Mn [4] BALINESE SIGN ULU RICEM..BALINESE SIGN SURANG 1B34 ; Case_Ignorable # Mn BALINESE SIGN REREKAN 1B36..1B3A ; Case_Ignorable # Mn [5] BALINESE VOWEL SIGN ULU..BALINESE VOWEL SIGN RA REPA @@ -3274,7 +3305,7 @@ A720..A721 ; Case_Ignorable # Sk [2] MODIFIER LETTER STRESS AND HIGH TONE.. A770 ; Case_Ignorable # Lm MODIFIER LETTER US A788 ; Case_Ignorable # Lm MODIFIER LETTER LOW CIRCUMFLEX ACCENT A789..A78A ; Case_Ignorable # Sk [2] MODIFIER LETTER COLON..MODIFIER LETTER SHORT EQUALS SIGN -A7F2..A7F4 ; Case_Ignorable # Lm [3] MODIFIER LETTER CAPITAL C..MODIFIER LETTER CAPITAL Q +A7F1..A7F4 ; Case_Ignorable # Lm [4] MODIFIER LETTER CAPITAL S..MODIFIER LETTER CAPITAL Q A7F8..A7F9 ; Case_Ignorable # Lm [2] MODIFIER LETTER CAPITAL H WITH STROKE..MODIFIER LETTER SMALL LIGATURE OE A802 ; Case_Ignorable # Mn SYLOTI NAGRI SIGN DVISVARA A806 ; Case_Ignorable # Mn SYLOTI NAGRI SIGN HASANTA @@ -3350,7 +3381,8 @@ FFF9..FFFB ; Case_Ignorable # Cf [3] INTERLINEAR ANNOTATION ANCHOR..INTERLI 10D69..10D6D ; Case_Ignorable # Mn [5] GARAY VOWEL SIGN E..GARAY CONSONANT NASALIZATION MARK 10D6F ; Case_Ignorable # Lm GARAY REDUPLICATION MARK 10EAB..10EAC ; Case_Ignorable # Mn [2] YEZIDI COMBINING HAMZA MARK..YEZIDI COMBINING MADDA MARK -10EFC..10EFF ; Case_Ignorable # Mn [4] ARABIC COMBINING ALEF OVERLAY..ARABIC SMALL LOW WORD MADDA +10EC5 ; Case_Ignorable # Lm ARABIC SMALL YEH BARREE WITH TWO DOTS BELOW +10EFA..10EFF ; Case_Ignorable # Mn [6] ARABIC DOUBLE VERTICAL BAR BELOW..ARABIC SMALL LOW WORD MADDA 10F46..10F50 ; Case_Ignorable # Mn [11] SOGDIAN COMBINING DOT BELOW..SOGDIAN COMBINING STROKE BELOW 10F82..10F85 ; Case_Ignorable # Mn [4] OLD UYGHUR COMBINING DOT ABOVE..OLD UYGHUR COMBINING TWO DOTS BELOW 11001 ; Case_Ignorable # Mn BRAHMI SIGN ANUSVARA @@ -3427,6 +3459,9 @@ FFF9..FFFB ; Case_Ignorable # Cf [3] INTERLINEAR ANNOTATION ANCHOR..INTERLI 11A59..11A5B ; Case_Ignorable # Mn [3] SOYOMBO VOWEL SIGN VOCALIC R..SOYOMBO VOWEL LENGTH MARK 11A8A..11A96 ; Case_Ignorable # Mn [13] SOYOMBO FINAL CONSONANT SIGN G..SOYOMBO SIGN ANUSVARA 11A98..11A99 ; Case_Ignorable # Mn [2] SOYOMBO GEMINATION MARK..SOYOMBO SUBJOINER +11B60 ; Case_Ignorable # Mn SHARADA VOWEL SIGN OE +11B62..11B64 ; Case_Ignorable # Mn [3] SHARADA VOWEL SIGN UE..SHARADA VOWEL SIGN SHORT E +11B66 ; Case_Ignorable # Mn SHARADA VOWEL SIGN CANDRA E 11C30..11C36 ; Case_Ignorable # Mn [7] BHAIKSUKI VOWEL SIGN I..BHAIKSUKI VOWEL SIGN VOCALIC L 11C38..11C3D ; Case_Ignorable # Mn [6] BHAIKSUKI VOWEL SIGN E..BHAIKSUKI SIGN ANUSVARA 11C3F ; Case_Ignorable # Mn BHAIKSUKI SIGN VIRAMA @@ -3442,6 +3477,7 @@ FFF9..FFFB ; Case_Ignorable # Cf [3] INTERLINEAR ANNOTATION ANCHOR..INTERLI 11D90..11D91 ; Case_Ignorable # Mn [2] GUNJALA GONDI VOWEL SIGN EE..GUNJALA GONDI VOWEL SIGN AI 11D95 ; Case_Ignorable # Mn GUNJALA GONDI SIGN ANUSVARA 11D97 ; Case_Ignorable # Mn GUNJALA GONDI VIRAMA +11DD9 ; Case_Ignorable # Lm TOLONG SIKI SIGN SELA 11EF3..11EF4 ; Case_Ignorable # Mn [2] MAKASAR VOWEL SIGN I..MAKASAR VOWEL SIGN U 11F00..11F01 ; Case_Ignorable # Mn [2] KAWI SIGN CANDRABINDU..KAWI SIGN ANUSVARA 11F36..11F3A ; Case_Ignorable # Mn [5] KAWI VOWEL SIGN I..KAWI VOWEL SIGN VOCALIC R @@ -3464,6 +3500,7 @@ FFF9..FFFB ; Case_Ignorable # Cf [3] INTERLINEAR ANNOTATION ANCHOR..INTERLI 16FE0..16FE1 ; Case_Ignorable # Lm [2] TANGUT ITERATION MARK..NUSHU ITERATION MARK 16FE3 ; Case_Ignorable # Lm OLD CHINESE ITERATION MARK 16FE4 ; Case_Ignorable # Mn KHITAN SMALL SCRIPT FILLER +16FF2..16FF3 ; Case_Ignorable # Lm [2] CHINESE SMALL SIMPLIFIED ER..CHINESE SMALL TRADITIONAL ER 1AFF0..1AFF3 ; Case_Ignorable # Lm [4] KATAKANA LETTER MINNAN TONE-2..KATAKANA LETTER MINNAN TONE-5 1AFF5..1AFFB ; Case_Ignorable # Lm [7] KATAKANA LETTER MINNAN TONE-7..KATAKANA LETTER MINNAN NASALIZED TONE-5 1AFFD..1AFFE ; Case_Ignorable # Lm [2] KATAKANA LETTER MINNAN NASALIZED TONE-7..KATAKANA LETTER MINNAN NASALIZED TONE-8 @@ -3497,6 +3534,11 @@ FFF9..FFFB ; Case_Ignorable # Cf [3] INTERLINEAR ANNOTATION ANCHOR..INTERLI 1E4EB ; Case_Ignorable # Lm NAG MUNDARI SIGN OJOD 1E4EC..1E4EF ; Case_Ignorable # Mn [4] NAG MUNDARI SIGN MUHOR..NAG MUNDARI SIGN SUTUH 1E5EE..1E5EF ; Case_Ignorable # Mn [2] OL ONAL SIGN MU..OL ONAL SIGN IKIR +1E6E3 ; Case_Ignorable # Mn TAI YO SIGN UE +1E6E6 ; Case_Ignorable # Mn TAI YO SIGN AU +1E6EE..1E6EF ; Case_Ignorable # Mn [2] TAI YO SIGN AY..TAI YO SIGN ANG +1E6F5 ; Case_Ignorable # Mn TAI YO SIGN OM +1E6FF ; Case_Ignorable # Lm TAI YO XAM LAI 1E8D0..1E8D6 ; Case_Ignorable # Mn [7] MENDE KIKAKUI COMBINING NUMBER TEENS..MENDE KIKAKUI COMBINING NUMBER MILLIONS 1E944..1E94A ; Case_Ignorable # Mn [7] ADLAM ALIF LENGTHENER..ADLAM NUKTA 1E94B ; Case_Ignorable # Lm ADLAM NASALIZATION MARK @@ -3505,13 +3547,14 @@ E0001 ; Case_Ignorable # Cf LANGUAGE TAG E0020..E007F ; Case_Ignorable # Cf [96] TAG SPACE..CANCEL TAG E0100..E01EF ; Case_Ignorable # Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256 -# Total code points: 2749 +# Total code points: 2794 # ================================================ # Derived Property: Changes_When_Lowercased (CWL) # Characters whose normalized forms are not stable under a toLowercase mapping. -# For more information, see D139 in Section 3.13, "Default Case Algorithms". +# For more information, see the definition of "isLowercase(X)" +# in the "Conformance" / "Default Case Algorithms" section of the core specification. # Changes_When_Lowercased(X) is true when toLowercase(toNFD(X)) != toNFD(X) 0041..005A ; Changes_When_Lowercased # L& [26] LATIN CAPITAL LETTER A..LATIN CAPITAL LETTER Z @@ -4110,7 +4153,10 @@ A7C2 ; Changes_When_Lowercased # L& LATIN CAPITAL LETTER ANGLICAN A7C4..A7C7 ; Changes_When_Lowercased # L& [4] LATIN CAPITAL LETTER C WITH PALATAL HOOK..LATIN CAPITAL LETTER D WITH SHORT STROKE OVERLAY A7C9 ; Changes_When_Lowercased # L& LATIN CAPITAL LETTER S WITH SHORT STROKE OVERLAY A7CB..A7CC ; Changes_When_Lowercased # L& [2] LATIN CAPITAL LETTER RAMS HORN..LATIN CAPITAL LETTER S WITH DIAGONAL STROKE +A7CE ; Changes_When_Lowercased # L& LATIN CAPITAL LETTER PHARYNGEAL VOICED FRICATIVE A7D0 ; Changes_When_Lowercased # L& LATIN CAPITAL LETTER CLOSED INSULAR G +A7D2 ; Changes_When_Lowercased # L& LATIN CAPITAL LETTER DOUBLE THORN +A7D4 ; Changes_When_Lowercased # L& LATIN CAPITAL LETTER DOUBLE WYNN A7D6 ; Changes_When_Lowercased # L& LATIN CAPITAL LETTER MIDDLE SCOTS S A7D8 ; Changes_When_Lowercased # L& LATIN CAPITAL LETTER SIGMOID S A7DA ; Changes_When_Lowercased # L& LATIN CAPITAL LETTER LAMBDA @@ -4127,15 +4173,17 @@ FF21..FF3A ; Changes_When_Lowercased # L& [26] FULLWIDTH LATIN CAPITAL LETTE 10D50..10D65 ; Changes_When_Lowercased # L& [22] GARAY CAPITAL LETTER A..GARAY CAPITAL LETTER OLD NA 118A0..118BF ; Changes_When_Lowercased # L& [32] WARANG CITI CAPITAL LETTER NGAA..WARANG CITI CAPITAL LETTER VIYO 16E40..16E5F ; Changes_When_Lowercased # L& [32] MEDEFAIDRIN CAPITAL LETTER M..MEDEFAIDRIN CAPITAL LETTER Y +16EA0..16EB8 ; Changes_When_Lowercased # L& [25] BERIA ERFE CAPITAL LETTER ARKAB..BERIA ERFE CAPITAL LETTER AY 1E900..1E921 ; Changes_When_Lowercased # L& [34] ADLAM CAPITAL LETTER ALIF..ADLAM CAPITAL LETTER SHA -# Total code points: 1460 +# Total code points: 1488 # ================================================ # Derived Property: Changes_When_Uppercased (CWU) # Characters whose normalized forms are not stable under a toUppercase mapping. -# For more information, see D140 in Section 3.13, "Default Case Algorithms". +# For more information, see the definition of "isUppercase(X)" +# in the "Conformance" / "Default Case Algorithms" section of the core specification. # Changes_When_Uppercased(X) is true when toUppercase(toNFD(X)) != toNFD(X) 0061..007A ; Changes_When_Uppercased # L& [26] LATIN SMALL LETTER A..LATIN SMALL LETTER Z @@ -4747,7 +4795,10 @@ A7C3 ; Changes_When_Uppercased # L& LATIN SMALL LETTER ANGLICANA A7C8 ; Changes_When_Uppercased # L& LATIN SMALL LETTER D WITH SHORT STROKE OVERLAY A7CA ; Changes_When_Uppercased # L& LATIN SMALL LETTER S WITH SHORT STROKE OVERLAY A7CD ; Changes_When_Uppercased # L& LATIN SMALL LETTER S WITH DIAGONAL STROKE +A7CF ; Changes_When_Uppercased # L& LATIN SMALL LETTER PHARYNGEAL VOICED FRICATIVE A7D1 ; Changes_When_Uppercased # L& LATIN SMALL LETTER CLOSED INSULAR G +A7D3 ; Changes_When_Uppercased # L& LATIN SMALL LETTER DOUBLE THORN +A7D5 ; Changes_When_Uppercased # L& LATIN SMALL LETTER DOUBLE WYNN A7D7 ; Changes_When_Uppercased # L& LATIN SMALL LETTER MIDDLE SCOTS S A7D9 ; Changes_When_Uppercased # L& LATIN SMALL LETTER SIGMOID S A7DB ; Changes_When_Uppercased # L& LATIN SMALL LETTER LAMBDA @@ -4767,15 +4818,17 @@ FF41..FF5A ; Changes_When_Uppercased # L& [26] FULLWIDTH LATIN SMALL LETTER 10D70..10D85 ; Changes_When_Uppercased # L& [22] GARAY SMALL LETTER A..GARAY SMALL LETTER OLD NA 118C0..118DF ; Changes_When_Uppercased # L& [32] WARANG CITI SMALL LETTER NGAA..WARANG CITI SMALL LETTER VIYO 16E60..16E7F ; Changes_When_Uppercased # L& [32] MEDEFAIDRIN SMALL LETTER M..MEDEFAIDRIN SMALL LETTER Y +16EBB..16ED3 ; Changes_When_Uppercased # L& [25] BERIA ERFE SMALL LETTER ARKAB..BERIA ERFE SMALL LETTER AY 1E922..1E943 ; Changes_When_Uppercased # L& [34] ADLAM SMALL LETTER ALIF..ADLAM SMALL LETTER SHA -# Total code points: 1552 +# Total code points: 1580 # ================================================ # Derived Property: Changes_When_Titlecased (CWT) # Characters whose normalized forms are not stable under a toTitlecase mapping. -# For more information, see D141 in Section 3.13, "Default Case Algorithms". +# For more information, see the definition of "isTitlecase(X)" +# in the "Conformance" / "Default Case Algorithms" section of the core specification. # Changes_When_Titlecased(X) is true when toTitlecase(toNFD(X)) != toNFD(X) 0061..007A ; Changes_When_Titlecased # L& [26] LATIN SMALL LETTER A..LATIN SMALL LETTER Z @@ -5386,7 +5439,10 @@ A7C3 ; Changes_When_Titlecased # L& LATIN SMALL LETTER ANGLICANA A7C8 ; Changes_When_Titlecased # L& LATIN SMALL LETTER D WITH SHORT STROKE OVERLAY A7CA ; Changes_When_Titlecased # L& LATIN SMALL LETTER S WITH SHORT STROKE OVERLAY A7CD ; Changes_When_Titlecased # L& LATIN SMALL LETTER S WITH DIAGONAL STROKE +A7CF ; Changes_When_Titlecased # L& LATIN SMALL LETTER PHARYNGEAL VOICED FRICATIVE A7D1 ; Changes_When_Titlecased # L& LATIN SMALL LETTER CLOSED INSULAR G +A7D3 ; Changes_When_Titlecased # L& LATIN SMALL LETTER DOUBLE THORN +A7D5 ; Changes_When_Titlecased # L& LATIN SMALL LETTER DOUBLE WYNN A7D7 ; Changes_When_Titlecased # L& LATIN SMALL LETTER MIDDLE SCOTS S A7D9 ; Changes_When_Titlecased # L& LATIN SMALL LETTER SIGMOID S A7DB ; Changes_When_Titlecased # L& LATIN SMALL LETTER LAMBDA @@ -5406,15 +5462,17 @@ FF41..FF5A ; Changes_When_Titlecased # L& [26] FULLWIDTH LATIN SMALL LETTER 10D70..10D85 ; Changes_When_Titlecased # L& [22] GARAY SMALL LETTER A..GARAY SMALL LETTER OLD NA 118C0..118DF ; Changes_When_Titlecased # L& [32] WARANG CITI SMALL LETTER NGAA..WARANG CITI SMALL LETTER VIYO 16E60..16E7F ; Changes_When_Titlecased # L& [32] MEDEFAIDRIN SMALL LETTER M..MEDEFAIDRIN SMALL LETTER Y +16EBB..16ED3 ; Changes_When_Titlecased # L& [25] BERIA ERFE SMALL LETTER ARKAB..BERIA ERFE SMALL LETTER AY 1E922..1E943 ; Changes_When_Titlecased # L& [34] ADLAM SMALL LETTER ALIF..ADLAM SMALL LETTER SHA -# Total code points: 1479 +# Total code points: 1507 # ================================================ # Derived Property: Changes_When_Casefolded (CWCF) # Characters whose normalized forms are not stable under case folding. -# For more information, see D142 in Section 3.13, "Default Case Algorithms". +# For more information, see the definition of "isCasefolded(X)" +# in the "Conformance" / "Default Case Algorithms" section of the core specification. # Changes_When_Casefolded(X) is true when toCasefold(toNFD(X)) != toNFD(X) 0041..005A ; Changes_When_Casefolded # L& [26] LATIN CAPITAL LETTER A..LATIN CAPITAL LETTER Z @@ -6022,7 +6080,10 @@ A7C2 ; Changes_When_Casefolded # L& LATIN CAPITAL LETTER ANGLICAN A7C4..A7C7 ; Changes_When_Casefolded # L& [4] LATIN CAPITAL LETTER C WITH PALATAL HOOK..LATIN CAPITAL LETTER D WITH SHORT STROKE OVERLAY A7C9 ; Changes_When_Casefolded # L& LATIN CAPITAL LETTER S WITH SHORT STROKE OVERLAY A7CB..A7CC ; Changes_When_Casefolded # L& [2] LATIN CAPITAL LETTER RAMS HORN..LATIN CAPITAL LETTER S WITH DIAGONAL STROKE +A7CE ; Changes_When_Casefolded # L& LATIN CAPITAL LETTER PHARYNGEAL VOICED FRICATIVE A7D0 ; Changes_When_Casefolded # L& LATIN CAPITAL LETTER CLOSED INSULAR G +A7D2 ; Changes_When_Casefolded # L& LATIN CAPITAL LETTER DOUBLE THORN +A7D4 ; Changes_When_Casefolded # L& LATIN CAPITAL LETTER DOUBLE WYNN A7D6 ; Changes_When_Casefolded # L& LATIN CAPITAL LETTER MIDDLE SCOTS S A7D8 ; Changes_When_Casefolded # L& LATIN CAPITAL LETTER SIGMOID S A7DA ; Changes_When_Casefolded # L& LATIN CAPITAL LETTER LAMBDA @@ -6042,15 +6103,17 @@ FF21..FF3A ; Changes_When_Casefolded # L& [26] FULLWIDTH LATIN CAPITAL LETTE 10D50..10D65 ; Changes_When_Casefolded # L& [22] GARAY CAPITAL LETTER A..GARAY CAPITAL LETTER OLD NA 118A0..118BF ; Changes_When_Casefolded # L& [32] WARANG CITI CAPITAL LETTER NGAA..WARANG CITI CAPITAL LETTER VIYO 16E40..16E5F ; Changes_When_Casefolded # L& [32] MEDEFAIDRIN CAPITAL LETTER M..MEDEFAIDRIN CAPITAL LETTER Y +16EA0..16EB8 ; Changes_When_Casefolded # L& [25] BERIA ERFE CAPITAL LETTER ARKAB..BERIA ERFE CAPITAL LETTER AY 1E900..1E921 ; Changes_When_Casefolded # L& [34] ADLAM CAPITAL LETTER ALIF..ADLAM CAPITAL LETTER SHA -# Total code points: 1533 +# Total code points: 1561 # ================================================ # Derived Property: Changes_When_Casemapped (CWCM) # Characters whose normalized forms are not stable under case mapping. -# For more information, see D143 in Section 3.13, "Default Case Algorithms". +# For more information, see the definition of "isCased(X)" +# in the "Conformance" / "Default Case Algorithms" section of the core specification. # Changes_When_Casemapped(X) is true when CWL(X), or CWT(X), or CWU(X) 0041..005A ; Changes_When_Casemapped # L& [26] LATIN CAPITAL LETTER A..LATIN CAPITAL LETTER Z @@ -6156,9 +6219,7 @@ A779..A787 ; Changes_When_Casemapped # L& [15] LATIN CAPITAL LETTER INSULAR A78B..A78D ; Changes_When_Casemapped # L& [3] LATIN CAPITAL LETTER SALTILLO..LATIN CAPITAL LETTER TURNED H A790..A794 ; Changes_When_Casemapped # L& [5] LATIN CAPITAL LETTER N WITH DESCENDER..LATIN SMALL LETTER C WITH PALATAL HOOK A796..A7AE ; Changes_When_Casemapped # L& [25] LATIN CAPITAL LETTER B WITH FLOURISH..LATIN CAPITAL LETTER SMALL CAPITAL I -A7B0..A7CD ; Changes_When_Casemapped # L& [30] LATIN CAPITAL LETTER TURNED K..LATIN SMALL LETTER S WITH DIAGONAL STROKE -A7D0..A7D1 ; Changes_When_Casemapped # L& [2] LATIN CAPITAL LETTER CLOSED INSULAR G..LATIN SMALL LETTER CLOSED INSULAR G -A7D6..A7DC ; Changes_When_Casemapped # L& [7] LATIN CAPITAL LETTER MIDDLE SCOTS S..LATIN CAPITAL LETTER LAMBDA WITH STROKE +A7B0..A7DC ; Changes_When_Casemapped # L& [45] LATIN CAPITAL LETTER TURNED K..LATIN CAPITAL LETTER LAMBDA WITH STROKE A7F5..A7F6 ; Changes_When_Casemapped # L& [2] LATIN CAPITAL LETTER REVERSED HALF H..LATIN SMALL LETTER REVERSED HALF H AB53 ; Changes_When_Casemapped # L& LATIN SMALL LETTER CHI AB70..ABBF ; Changes_When_Casemapped # L& [80] CHEROKEE SMALL LETTER A..CHEROKEE SMALL LETTER YA @@ -6183,9 +6244,11 @@ FF41..FF5A ; Changes_When_Casemapped # L& [26] FULLWIDTH LATIN SMALL LETTER 10D70..10D85 ; Changes_When_Casemapped # L& [22] GARAY SMALL LETTER A..GARAY SMALL LETTER OLD NA 118A0..118DF ; Changes_When_Casemapped # L& [64] WARANG CITI CAPITAL LETTER NGAA..WARANG CITI SMALL LETTER VIYO 16E40..16E7F ; Changes_When_Casemapped # L& [64] MEDEFAIDRIN CAPITAL LETTER M..MEDEFAIDRIN SMALL LETTER Y +16EA0..16EB8 ; Changes_When_Casemapped # L& [25] BERIA ERFE CAPITAL LETTER ARKAB..BERIA ERFE CAPITAL LETTER AY +16EBB..16ED3 ; Changes_When_Casemapped # L& [25] BERIA ERFE SMALL LETTER ARKAB..BERIA ERFE SMALL LETTER AY 1E900..1E943 ; Changes_When_Casemapped # L& [68] ADLAM CAPITAL LETTER ALIF..ADLAM SMALL LETTER SHA -# Total code points: 2981 +# Total code points: 3037 # ================================================ @@ -6210,8 +6273,8 @@ FF41..FF5A ; Changes_When_Casemapped # L& [26] FULLWIDTH LATIN SMALL LETTER 01BC..01BF ; ID_Start # L& [4] LATIN CAPITAL LETTER TONE FIVE..LATIN LETTER WYNN 01C0..01C3 ; ID_Start # Lo [4] LATIN LETTER DENTAL CLICK..LATIN LETTER RETROFLEX CLICK 01C4..0293 ; ID_Start # L& [208] LATIN CAPITAL LETTER DZ WITH CARON..LATIN SMALL LETTER EZH WITH CURL -0294 ; ID_Start # Lo LATIN LETTER GLOTTAL STOP -0295..02AF ; ID_Start # L& [27] LATIN LETTER PHARYNGEAL VOICED FRICATIVE..LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL +0294..0295 ; ID_Start # Lo [2] LATIN LETTER GLOTTAL STOP..LATIN LETTER PHARYNGEAL VOICED FRICATIVE +0296..02AF ; ID_Start # L& [26] LATIN LETTER INVERTED GLOTTAL STOP..LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL 02B0..02C1 ; ID_Start # Lm [18] MODIFIER LETTER SMALL H..MODIFIER LETTER REVERSED GLOTTAL STOP 02C6..02D1 ; ID_Start # Lm [12] MODIFIER LETTER CIRCUMFLEX ACCENT..MODIFIER LETTER HALF TRIANGULAR COLON 02E0..02E4 ; ID_Start # Lm [5] MODIFIER LETTER SMALL GAMMA..MODIFIER LETTER SMALL REVERSED GLOTTAL STOP @@ -6259,7 +6322,7 @@ FF41..FF5A ; Changes_When_Casemapped # L& [26] FULLWIDTH LATIN SMALL LETTER 0840..0858 ; ID_Start # Lo [25] MANDAIC LETTER HALQA..MANDAIC LETTER AIN 0860..086A ; ID_Start # Lo [11] SYRIAC LETTER MALAYALAM NGA..SYRIAC LETTER MALAYALAM SSA 0870..0887 ; ID_Start # Lo [24] ARABIC LETTER ALEF WITH ATTACHED FATHA..ARABIC BASELINE ROUND DOT -0889..088E ; ID_Start # Lo [6] ARABIC LETTER NOON WITH INVERTED SMALL V..ARABIC VERTICAL TAIL +0889..088F ; ID_Start # Lo [7] ARABIC LETTER NOON WITH INVERTED SMALL V..ARABIC LETTER NOON WITH RING ABOVE 08A0..08C8 ; ID_Start # Lo [41] ARABIC LETTER BEH WITH SMALL V BELOW..ARABIC LETTER GRAF 08C9 ; ID_Start # Lm ARABIC SMALL FARSI YEH 0904..0939 ; ID_Start # Lo [54] DEVANAGARI LETTER SHORT A..DEVANAGARI LETTER HA @@ -6327,7 +6390,7 @@ FF41..FF5A ; Changes_When_Casemapped # L& [26] FULLWIDTH LATIN SMALL LETTER 0C2A..0C39 ; ID_Start # Lo [16] TELUGU LETTER PA..TELUGU LETTER HA 0C3D ; ID_Start # Lo TELUGU SIGN AVAGRAHA 0C58..0C5A ; ID_Start # Lo [3] TELUGU LETTER TSA..TELUGU LETTER RRRA -0C5D ; ID_Start # Lo TELUGU LETTER NAKAARA POLLU +0C5C..0C5D ; ID_Start # Lo [2] TELUGU ARCHAIC SHRII..TELUGU LETTER NAKAARA POLLU 0C60..0C61 ; ID_Start # Lo [2] TELUGU LETTER VOCALIC RR..TELUGU LETTER VOCALIC LL 0C80 ; ID_Start # Lo KANNADA SIGN SPACING CANDRABINDU 0C85..0C8C ; ID_Start # Lo [8] KANNADA LETTER A..KANNADA LETTER VOCALIC L @@ -6336,7 +6399,7 @@ FF41..FF5A ; Changes_When_Casemapped # L& [26] FULLWIDTH LATIN SMALL LETTER 0CAA..0CB3 ; ID_Start # Lo [10] KANNADA LETTER PA..KANNADA LETTER LLA 0CB5..0CB9 ; ID_Start # Lo [5] KANNADA LETTER VA..KANNADA LETTER HA 0CBD ; ID_Start # Lo KANNADA SIGN AVAGRAHA -0CDD..0CDE ; ID_Start # Lo [2] KANNADA LETTER NAKAARA POLLU..KANNADA LETTER FA +0CDC..0CDE ; ID_Start # Lo [3] KANNADA ARCHAIC SHRII..KANNADA LETTER FA 0CE0..0CE1 ; ID_Start # Lo [2] KANNADA LETTER VOCALIC RR..KANNADA LETTER VOCALIC LL 0CF1..0CF2 ; ID_Start # Lo [2] KANNADA SIGN JIHVAMULIYA..KANNADA SIGN UPADHMANIYA 0D04..0D0C ; ID_Start # Lo [9] MALAYALAM LETTER VEDIC ANUSVARA..MALAYALAM LETTER VOCALIC L @@ -6561,11 +6624,8 @@ A771..A787 ; ID_Start # L& [23] LATIN SMALL LETTER DUM..LATIN SMALL LETTER I A788 ; ID_Start # Lm MODIFIER LETTER LOW CIRCUMFLEX ACCENT A78B..A78E ; ID_Start # L& [4] LATIN CAPITAL LETTER SALTILLO..LATIN SMALL LETTER L WITH RETROFLEX HOOK AND BELT A78F ; ID_Start # Lo LATIN LETTER SINOLOGICAL DOT -A790..A7CD ; ID_Start # L& [62] LATIN CAPITAL LETTER N WITH DESCENDER..LATIN SMALL LETTER S WITH DIAGONAL STROKE -A7D0..A7D1 ; ID_Start # L& [2] LATIN CAPITAL LETTER CLOSED INSULAR G..LATIN SMALL LETTER CLOSED INSULAR G -A7D3 ; ID_Start # L& LATIN SMALL LETTER DOUBLE THORN -A7D5..A7DC ; ID_Start # L& [8] LATIN SMALL LETTER DOUBLE WYNN..LATIN CAPITAL LETTER LAMBDA WITH STROKE -A7F2..A7F4 ; ID_Start # Lm [3] MODIFIER LETTER CAPITAL C..MODIFIER LETTER CAPITAL Q +A790..A7DC ; ID_Start # L& [77] LATIN CAPITAL LETTER N WITH DESCENDER..LATIN CAPITAL LETTER LAMBDA WITH STROKE +A7F1..A7F4 ; ID_Start # Lm [4] MODIFIER LETTER CAPITAL S..MODIFIER LETTER CAPITAL Q A7F5..A7F6 ; ID_Start # L& [2] LATIN CAPITAL LETTER REVERSED HALF H..LATIN SMALL LETTER REVERSED HALF H A7F7 ; ID_Start # Lo LATIN EPIGRAPHIC LETTER SIDEWAYS I A7F8..A7F9 ; ID_Start # Lm [2] MODIFIER LETTER CAPITAL H WITH STROKE..MODIFIER LETTER SMALL LIGATURE OE @@ -6702,6 +6762,7 @@ FFDA..FFDC ; ID_Start # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL 108F4..108F5 ; ID_Start # Lo [2] HATRAN LETTER SHIN..HATRAN LETTER TAW 10900..10915 ; ID_Start # Lo [22] PHOENICIAN LETTER ALF..PHOENICIAN LETTER TAU 10920..10939 ; ID_Start # Lo [26] LYDIAN LETTER A..LYDIAN LETTER C +10940..10959 ; ID_Start # Lo [26] SIDETIC LETTER N01..SIDETIC LETTER N26 10980..109B7 ; ID_Start # Lo [56] MEROITIC HIEROGLYPHIC LETTER A..MEROITIC CURSIVE LETTER DA 109BE..109BF ; ID_Start # Lo [2] MEROITIC CURSIVE LOGOGRAM RMT..MEROITIC CURSIVE LOGOGRAM IMN 10A00 ; ID_Start # Lo KHAROSHTHI LETTER A @@ -6729,6 +6790,8 @@ FFDA..FFDC ; ID_Start # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL 10E80..10EA9 ; ID_Start # Lo [42] YEZIDI LETTER ELIF..YEZIDI LETTER ET 10EB0..10EB1 ; ID_Start # Lo [2] YEZIDI LETTER LAM WITH DOT ABOVE..YEZIDI LETTER YOT WITH CIRCUMFLEX ABOVE 10EC2..10EC4 ; ID_Start # Lo [3] ARABIC LETTER DAL WITH TWO DOTS VERTICALLY BELOW..ARABIC LETTER KAF WITH TWO DOTS VERTICALLY BELOW +10EC5 ; ID_Start # Lm ARABIC SMALL YEH BARREE WITH TWO DOTS BELOW +10EC6..10EC7 ; ID_Start # Lo [2] ARABIC LETTER THIN NOON..ARABIC LETTER YEH WITH FOUR DOTS BELOW 10F00..10F1C ; ID_Start # Lo [29] OLD SOGDIAN LETTER ALEPH..OLD SOGDIAN LETTER FINAL TAW WITH VERTICAL TAIL 10F27 ; ID_Start # Lo OLD SOGDIAN LIGATURE AYIN-DALETH 10F30..10F45 ; ID_Start # Lo [22] SOGDIAN LETTER ALEPH..SOGDIAN INDEPENDENT SHIN @@ -6821,6 +6884,9 @@ FFDA..FFDC ; ID_Start # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL 11D67..11D68 ; ID_Start # Lo [2] GUNJALA GONDI LETTER EE..GUNJALA GONDI LETTER AI 11D6A..11D89 ; ID_Start # Lo [32] GUNJALA GONDI LETTER OO..GUNJALA GONDI LETTER SA 11D98 ; ID_Start # Lo GUNJALA GONDI OM +11DB0..11DD8 ; ID_Start # Lo [41] TOLONG SIKI LETTER I..TOLONG SIKI LETTER RRH +11DD9 ; ID_Start # Lm TOLONG SIKI SIGN SELA +11DDA..11DDB ; ID_Start # Lo [2] TOLONG SIKI SIGN HECAKA..TOLONG SIKI UNGGA 11EE0..11EF2 ; ID_Start # Lo [19] MAKASAR LETTER KA..MAKASAR ANGKA 11F02 ; ID_Start # Lo KAWI SIGN REPHA 11F04..11F10 ; ID_Start # Lo [13] KAWI LETTER A..KAWI LETTER O @@ -6847,14 +6913,18 @@ FFDA..FFDC ; ID_Start # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL 16D43..16D6A ; ID_Start # Lo [40] KIRAT RAI LETTER A..KIRAT RAI VOWEL SIGN AU 16D6B..16D6C ; ID_Start # Lm [2] KIRAT RAI SIGN VIRAMA..KIRAT RAI SIGN SAAT 16E40..16E7F ; ID_Start # L& [64] MEDEFAIDRIN CAPITAL LETTER M..MEDEFAIDRIN SMALL LETTER Y +16EA0..16EB8 ; ID_Start # L& [25] BERIA ERFE CAPITAL LETTER ARKAB..BERIA ERFE CAPITAL LETTER AY +16EBB..16ED3 ; ID_Start # L& [25] BERIA ERFE SMALL LETTER ARKAB..BERIA ERFE SMALL LETTER AY 16F00..16F4A ; ID_Start # Lo [75] MIAO LETTER PA..MIAO LETTER RTE 16F50 ; ID_Start # Lo MIAO LETTER NASALIZATION 16F93..16F9F ; ID_Start # Lm [13] MIAO LETTER TONE-2..MIAO LETTER REFORMED TONE-8 16FE0..16FE1 ; ID_Start # Lm [2] TANGUT ITERATION MARK..NUSHU ITERATION MARK 16FE3 ; ID_Start # Lm OLD CHINESE ITERATION MARK -17000..187F7 ; ID_Start # Lo [6136] TANGUT IDEOGRAPH-17000..TANGUT IDEOGRAPH-187F7 -18800..18CD5 ; ID_Start # Lo [1238] TANGUT COMPONENT-001..KHITAN SMALL SCRIPT CHARACTER-18CD5 -18CFF..18D08 ; ID_Start # Lo [10] KHITAN SMALL SCRIPT CHARACTER-18CFF..TANGUT IDEOGRAPH-18D08 +16FF2..16FF3 ; ID_Start # Lm [2] CHINESE SMALL SIMPLIFIED ER..CHINESE SMALL TRADITIONAL ER +16FF4..16FF6 ; ID_Start # Nl [3] YANGQIN SIGN SLOW ONE BEAT..YANGQIN SIGN SLOW TWO BEATS +17000..18CD5 ; ID_Start # Lo [7382] TANGUT IDEOGRAPH-17000..KHITAN SMALL SCRIPT CHARACTER-18CD5 +18CFF..18D1E ; ID_Start # Lo [32] KHITAN SMALL SCRIPT CHARACTER-18CFF..TANGUT IDEOGRAPH-18D1E +18D80..18DF2 ; ID_Start # Lo [115] TANGUT COMPONENT-769..TANGUT COMPONENT-883 1AFF0..1AFF3 ; ID_Start # Lm [4] KATAKANA LETTER MINNAN TONE-2..KATAKANA LETTER MINNAN TONE-5 1AFF5..1AFFB ; ID_Start # Lm [7] KATAKANA LETTER MINNAN TONE-7..KATAKANA LETTER MINNAN NASALIZED TONE-5 1AFFD..1AFFE ; ID_Start # Lm [2] KATAKANA LETTER MINNAN NASALIZED TONE-7..KATAKANA LETTER MINNAN NASALIZED TONE-8 @@ -6912,6 +6982,13 @@ FFDA..FFDC ; ID_Start # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL 1E4EB ; ID_Start # Lm NAG MUNDARI SIGN OJOD 1E5D0..1E5ED ; ID_Start # Lo [30] OL ONAL LETTER O..OL ONAL LETTER EG 1E5F0 ; ID_Start # Lo OL ONAL SIGN HODDOND +1E6C0..1E6DE ; ID_Start # Lo [31] TAI YO LETTER LOW KO..TAI YO LETTER HIGH KVO +1E6E0..1E6E2 ; ID_Start # Lo [3] TAI YO LETTER AA..TAI YO LETTER UE +1E6E4..1E6E5 ; ID_Start # Lo [2] TAI YO LETTER U..TAI YO LETTER AE +1E6E7..1E6ED ; ID_Start # Lo [7] TAI YO LETTER O..TAI YO LETTER AUE +1E6F0..1E6F4 ; ID_Start # Lo [5] TAI YO LETTER AN..TAI YO LETTER AP +1E6FE ; ID_Start # Lo TAI YO SYMBOL MUEANG +1E6FF ; ID_Start # Lm TAI YO XAM LAI 1E7E0..1E7E6 ; ID_Start # Lo [7] ETHIOPIC SYLLABLE HHYA..ETHIOPIC SYLLABLE HHYO 1E7E8..1E7EB ; ID_Start # Lo [4] ETHIOPIC SYLLABLE GURAGE HHWA..ETHIOPIC SYLLABLE HHWE 1E7ED..1E7EE ; ID_Start # Lo [2] ETHIOPIC SYLLABLE GURAGE MWI..ETHIOPIC SYLLABLE GURAGE MWEE @@ -6953,16 +7030,15 @@ FFDA..FFDC ; ID_Start # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL 1EEA5..1EEA9 ; ID_Start # Lo [5] ARABIC MATHEMATICAL DOUBLE-STRUCK WAW..ARABIC MATHEMATICAL DOUBLE-STRUCK YEH 1EEAB..1EEBB ; ID_Start # Lo [17] ARABIC MATHEMATICAL DOUBLE-STRUCK LAM..ARABIC MATHEMATICAL DOUBLE-STRUCK GHAIN 20000..2A6DF ; ID_Start # Lo [42720] CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6DF -2A700..2B739 ; ID_Start # Lo [4154] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B739 -2B740..2B81D ; ID_Start # Lo [222] CJK UNIFIED IDEOGRAPH-2B740..CJK UNIFIED IDEOGRAPH-2B81D -2B820..2CEA1 ; ID_Start # Lo [5762] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEA1 +2A700..2B81D ; ID_Start # Lo [4382] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B81D +2B820..2CEAD ; ID_Start # Lo [5774] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEAD 2CEB0..2EBE0 ; ID_Start # Lo [7473] CJK UNIFIED IDEOGRAPH-2CEB0..CJK UNIFIED IDEOGRAPH-2EBE0 2EBF0..2EE5D ; ID_Start # Lo [622] CJK UNIFIED IDEOGRAPH-2EBF0..CJK UNIFIED IDEOGRAPH-2EE5D 2F800..2FA1D ; ID_Start # Lo [542] CJK COMPATIBILITY IDEOGRAPH-2F800..CJK COMPATIBILITY IDEOGRAPH-2FA1D 30000..3134A ; ID_Start # Lo [4939] CJK UNIFIED IDEOGRAPH-30000..CJK UNIFIED IDEOGRAPH-3134A -31350..323AF ; ID_Start # Lo [4192] CJK UNIFIED IDEOGRAPH-31350..CJK UNIFIED IDEOGRAPH-323AF +31350..33479 ; ID_Start # Lo [8490] CJK UNIFIED IDEOGRAPH-31350..CJK UNIFIED IDEOGRAPH-33479 -# Total code points: 141269 +# Total code points: 145916 # ================================================ @@ -6991,8 +7067,8 @@ FFDA..FFDC ; ID_Start # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL 01BC..01BF ; ID_Continue # L& [4] LATIN CAPITAL LETTER TONE FIVE..LATIN LETTER WYNN 01C0..01C3 ; ID_Continue # Lo [4] LATIN LETTER DENTAL CLICK..LATIN LETTER RETROFLEX CLICK 01C4..0293 ; ID_Continue # L& [208] LATIN CAPITAL LETTER DZ WITH CARON..LATIN SMALL LETTER EZH WITH CURL -0294 ; ID_Continue # Lo LATIN LETTER GLOTTAL STOP -0295..02AF ; ID_Continue # L& [27] LATIN LETTER PHARYNGEAL VOICED FRICATIVE..LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL +0294..0295 ; ID_Continue # Lo [2] LATIN LETTER GLOTTAL STOP..LATIN LETTER PHARYNGEAL VOICED FRICATIVE +0296..02AF ; ID_Continue # L& [26] LATIN LETTER INVERTED GLOTTAL STOP..LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL 02B0..02C1 ; ID_Continue # Lm [18] MODIFIER LETTER SMALL H..MODIFIER LETTER REVERSED GLOTTAL STOP 02C6..02D1 ; ID_Continue # Lm [12] MODIFIER LETTER CIRCUMFLEX ACCENT..MODIFIER LETTER HALF TRIANGULAR COLON 02E0..02E4 ; ID_Continue # Lm [5] MODIFIER LETTER SMALL GAMMA..MODIFIER LETTER SMALL REVERSED GLOTTAL STOP @@ -7068,7 +7144,7 @@ FFDA..FFDC ; ID_Start # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL 0859..085B ; ID_Continue # Mn [3] MANDAIC AFFRICATION MARK..MANDAIC GEMINATION MARK 0860..086A ; ID_Continue # Lo [11] SYRIAC LETTER MALAYALAM NGA..SYRIAC LETTER MALAYALAM SSA 0870..0887 ; ID_Continue # Lo [24] ARABIC LETTER ALEF WITH ATTACHED FATHA..ARABIC BASELINE ROUND DOT -0889..088E ; ID_Continue # Lo [6] ARABIC LETTER NOON WITH INVERTED SMALL V..ARABIC VERTICAL TAIL +0889..088F ; ID_Continue # Lo [7] ARABIC LETTER NOON WITH INVERTED SMALL V..ARABIC LETTER NOON WITH RING ABOVE 0897..089F ; ID_Continue # Mn [9] ARABIC PEPET..ARABIC HALF MADDA OVER MADDA 08A0..08C8 ; ID_Continue # Lo [41] ARABIC LETTER BEH WITH SMALL V BELOW..ARABIC LETTER GRAF 08C9 ; ID_Continue # Lm ARABIC SMALL FARSI YEH @@ -7218,7 +7294,7 @@ FFDA..FFDC ; ID_Start # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL 0C4A..0C4D ; ID_Continue # Mn [4] TELUGU VOWEL SIGN O..TELUGU SIGN VIRAMA 0C55..0C56 ; ID_Continue # Mn [2] TELUGU LENGTH MARK..TELUGU AI LENGTH MARK 0C58..0C5A ; ID_Continue # Lo [3] TELUGU LETTER TSA..TELUGU LETTER RRRA -0C5D ; ID_Continue # Lo TELUGU LETTER NAKAARA POLLU +0C5C..0C5D ; ID_Continue # Lo [2] TELUGU ARCHAIC SHRII..TELUGU LETTER NAKAARA POLLU 0C60..0C61 ; ID_Continue # Lo [2] TELUGU LETTER VOCALIC RR..TELUGU LETTER VOCALIC LL 0C62..0C63 ; ID_Continue # Mn [2] TELUGU VOWEL SIGN VOCALIC L..TELUGU VOWEL SIGN VOCALIC LL 0C66..0C6F ; ID_Continue # Nd [10] TELUGU DIGIT ZERO..TELUGU DIGIT NINE @@ -7240,7 +7316,7 @@ FFDA..FFDC ; ID_Start # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL 0CCA..0CCB ; ID_Continue # Mc [2] KANNADA VOWEL SIGN O..KANNADA VOWEL SIGN OO 0CCC..0CCD ; ID_Continue # Mn [2] KANNADA VOWEL SIGN AU..KANNADA SIGN VIRAMA 0CD5..0CD6 ; ID_Continue # Mc [2] KANNADA LENGTH MARK..KANNADA AI LENGTH MARK -0CDD..0CDE ; ID_Continue # Lo [2] KANNADA LETTER NAKAARA POLLU..KANNADA LETTER FA +0CDC..0CDE ; ID_Continue # Lo [3] KANNADA ARCHAIC SHRII..KANNADA LETTER FA 0CE0..0CE1 ; ID_Continue # Lo [2] KANNADA LETTER VOCALIC RR..KANNADA LETTER VOCALIC LL 0CE2..0CE3 ; ID_Continue # Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL 0CE6..0CEF ; ID_Continue # Nd [10] KANNADA DIGIT ZERO..KANNADA DIGIT NINE @@ -7457,7 +7533,8 @@ FFDA..FFDC ; ID_Start # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL 1A90..1A99 ; ID_Continue # Nd [10] TAI THAM THAM DIGIT ZERO..TAI THAM THAM DIGIT NINE 1AA7 ; ID_Continue # Lm TAI THAM SIGN MAI YAMOK 1AB0..1ABD ; ID_Continue # Mn [14] COMBINING DOUBLED CIRCUMFLEX ACCENT..COMBINING PARENTHESES BELOW -1ABF..1ACE ; ID_Continue # Mn [16] COMBINING LATIN SMALL LETTER W BELOW..COMBINING LATIN SMALL LETTER INSULAR T +1ABF..1ADD ; ID_Continue # Mn [31] COMBINING LATIN SMALL LETTER W BELOW..COMBINING DOT-AND-RING BELOW +1AE0..1AEB ; ID_Continue # Mn [12] COMBINING LEFT TACK ABOVE..COMBINING DOUBLE RIGHTWARDS ARROW ABOVE 1B00..1B03 ; ID_Continue # Mn [4] BALINESE SIGN ULU RICEM..BALINESE SIGN SURANG 1B04 ; ID_Continue # Mc BALINESE SIGN BISAH 1B05..1B33 ; ID_Continue # Lo [47] BALINESE LETTER AKARA..BALINESE LETTER HA @@ -7646,11 +7723,8 @@ A771..A787 ; ID_Continue # L& [23] LATIN SMALL LETTER DUM..LATIN SMALL LETTE A788 ; ID_Continue # Lm MODIFIER LETTER LOW CIRCUMFLEX ACCENT A78B..A78E ; ID_Continue # L& [4] LATIN CAPITAL LETTER SALTILLO..LATIN SMALL LETTER L WITH RETROFLEX HOOK AND BELT A78F ; ID_Continue # Lo LATIN LETTER SINOLOGICAL DOT -A790..A7CD ; ID_Continue # L& [62] LATIN CAPITAL LETTER N WITH DESCENDER..LATIN SMALL LETTER S WITH DIAGONAL STROKE -A7D0..A7D1 ; ID_Continue # L& [2] LATIN CAPITAL LETTER CLOSED INSULAR G..LATIN SMALL LETTER CLOSED INSULAR G -A7D3 ; ID_Continue # L& LATIN SMALL LETTER DOUBLE THORN -A7D5..A7DC ; ID_Continue # L& [8] LATIN SMALL LETTER DOUBLE WYNN..LATIN CAPITAL LETTER LAMBDA WITH STROKE -A7F2..A7F4 ; ID_Continue # Lm [3] MODIFIER LETTER CAPITAL C..MODIFIER LETTER CAPITAL Q +A790..A7DC ; ID_Continue # L& [77] LATIN CAPITAL LETTER N WITH DESCENDER..LATIN CAPITAL LETTER LAMBDA WITH STROKE +A7F1..A7F4 ; ID_Continue # Lm [4] MODIFIER LETTER CAPITAL S..MODIFIER LETTER CAPITAL Q A7F5..A7F6 ; ID_Continue # L& [2] LATIN CAPITAL LETTER REVERSED HALF H..LATIN SMALL LETTER REVERSED HALF H A7F7 ; ID_Continue # Lo LATIN EPIGRAPHIC LETTER SIDEWAYS I A7F8..A7F9 ; ID_Continue # Lm [2] MODIFIER LETTER CAPITAL H WITH STROKE..MODIFIER LETTER SMALL LIGATURE OE @@ -7857,6 +7931,7 @@ FFDA..FFDC ; ID_Continue # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HAN 108F4..108F5 ; ID_Continue # Lo [2] HATRAN LETTER SHIN..HATRAN LETTER TAW 10900..10915 ; ID_Continue # Lo [22] PHOENICIAN LETTER ALF..PHOENICIAN LETTER TAU 10920..10939 ; ID_Continue # Lo [26] LYDIAN LETTER A..LYDIAN LETTER C +10940..10959 ; ID_Continue # Lo [26] SIDETIC LETTER N01..SIDETIC LETTER N26 10980..109B7 ; ID_Continue # Lo [56] MEROITIC HIEROGLYPHIC LETTER A..MEROITIC CURSIVE LETTER DA 109BE..109BF ; ID_Continue # Lo [2] MEROITIC CURSIVE LOGOGRAM RMT..MEROITIC CURSIVE LOGOGRAM IMN 10A00 ; ID_Continue # Lo KHAROSHTHI LETTER A @@ -7895,7 +7970,9 @@ FFDA..FFDC ; ID_Continue # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HAN 10EAB..10EAC ; ID_Continue # Mn [2] YEZIDI COMBINING HAMZA MARK..YEZIDI COMBINING MADDA MARK 10EB0..10EB1 ; ID_Continue # Lo [2] YEZIDI LETTER LAM WITH DOT ABOVE..YEZIDI LETTER YOT WITH CIRCUMFLEX ABOVE 10EC2..10EC4 ; ID_Continue # Lo [3] ARABIC LETTER DAL WITH TWO DOTS VERTICALLY BELOW..ARABIC LETTER KAF WITH TWO DOTS VERTICALLY BELOW -10EFC..10EFF ; ID_Continue # Mn [4] ARABIC COMBINING ALEF OVERLAY..ARABIC SMALL LOW WORD MADDA +10EC5 ; ID_Continue # Lm ARABIC SMALL YEH BARREE WITH TWO DOTS BELOW +10EC6..10EC7 ; ID_Continue # Lo [2] ARABIC LETTER THIN NOON..ARABIC LETTER YEH WITH FOUR DOTS BELOW +10EFA..10EFF ; ID_Continue # Mn [6] ARABIC DOUBLE VERTICAL BAR BELOW..ARABIC SMALL LOW WORD MADDA 10F00..10F1C ; ID_Continue # Lo [29] OLD SOGDIAN LETTER ALEPH..OLD SOGDIAN LETTER FINAL TAW WITH VERTICAL TAIL 10F27 ; ID_Continue # Lo OLD SOGDIAN LIGATURE AYIN-DALETH 10F30..10F45 ; ID_Continue # Lo [22] SOGDIAN LETTER ALEPH..SOGDIAN INDEPENDENT SHIN @@ -8122,6 +8199,12 @@ FFDA..FFDC ; ID_Continue # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HAN 11A98..11A99 ; ID_Continue # Mn [2] SOYOMBO GEMINATION MARK..SOYOMBO SUBJOINER 11A9D ; ID_Continue # Lo SOYOMBO MARK PLUTA 11AB0..11AF8 ; ID_Continue # Lo [73] CANADIAN SYLLABICS NATTILIK HI..PAU CIN HAU GLOTTAL STOP FINAL +11B60 ; ID_Continue # Mn SHARADA VOWEL SIGN OE +11B61 ; ID_Continue # Mc SHARADA VOWEL SIGN OOE +11B62..11B64 ; ID_Continue # Mn [3] SHARADA VOWEL SIGN UE..SHARADA VOWEL SIGN SHORT E +11B65 ; ID_Continue # Mc SHARADA VOWEL SIGN SHORT O +11B66 ; ID_Continue # Mn SHARADA VOWEL SIGN CANDRA E +11B67 ; ID_Continue # Mc SHARADA VOWEL SIGN CANDRA O 11BC0..11BE0 ; ID_Continue # Lo [33] SUNUWAR LETTER DEVI..SUNUWAR LETTER KLOKO 11BF0..11BF9 ; ID_Continue # Nd [10] SUNUWAR DIGIT ZERO..SUNUWAR DIGIT NINE 11C00..11C08 ; ID_Continue # Lo [9] BHAIKSUKI LETTER A..BHAIKSUKI LETTER VOCALIC L @@ -8162,6 +8245,10 @@ FFDA..FFDC ; ID_Continue # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HAN 11D97 ; ID_Continue # Mn GUNJALA GONDI VIRAMA 11D98 ; ID_Continue # Lo GUNJALA GONDI OM 11DA0..11DA9 ; ID_Continue # Nd [10] GUNJALA GONDI DIGIT ZERO..GUNJALA GONDI DIGIT NINE +11DB0..11DD8 ; ID_Continue # Lo [41] TOLONG SIKI LETTER I..TOLONG SIKI LETTER RRH +11DD9 ; ID_Continue # Lm TOLONG SIKI SIGN SELA +11DDA..11DDB ; ID_Continue # Lo [2] TOLONG SIKI SIGN HECAKA..TOLONG SIKI UNGGA +11DE0..11DE9 ; ID_Continue # Nd [10] TOLONG SIKI DIGIT ZERO..TOLONG SIKI DIGIT NINE 11EE0..11EF2 ; ID_Continue # Lo [19] MAKASAR LETTER KA..MAKASAR ANGKA 11EF3..11EF4 ; ID_Continue # Mn [2] MAKASAR VOWEL SIGN I..MAKASAR VOWEL SIGN U 11EF5..11EF6 ; ID_Continue # Mc [2] MAKASAR VOWEL SIGN E..MAKASAR VOWEL SIGN O @@ -8212,6 +8299,8 @@ FFDA..FFDC ; ID_Continue # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HAN 16D6B..16D6C ; ID_Continue # Lm [2] KIRAT RAI SIGN VIRAMA..KIRAT RAI SIGN SAAT 16D70..16D79 ; ID_Continue # Nd [10] KIRAT RAI DIGIT ZERO..KIRAT RAI DIGIT NINE 16E40..16E7F ; ID_Continue # L& [64] MEDEFAIDRIN CAPITAL LETTER M..MEDEFAIDRIN SMALL LETTER Y +16EA0..16EB8 ; ID_Continue # L& [25] BERIA ERFE CAPITAL LETTER ARKAB..BERIA ERFE CAPITAL LETTER AY +16EBB..16ED3 ; ID_Continue # L& [25] BERIA ERFE SMALL LETTER ARKAB..BERIA ERFE SMALL LETTER AY 16F00..16F4A ; ID_Continue # Lo [75] MIAO LETTER PA..MIAO LETTER RTE 16F4F ; ID_Continue # Mn MIAO SIGN CONSONANT MODIFIER BAR 16F50 ; ID_Continue # Lo MIAO LETTER NASALIZATION @@ -8222,9 +8311,11 @@ FFDA..FFDC ; ID_Continue # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HAN 16FE3 ; ID_Continue # Lm OLD CHINESE ITERATION MARK 16FE4 ; ID_Continue # Mn KHITAN SMALL SCRIPT FILLER 16FF0..16FF1 ; ID_Continue # Mc [2] VIETNAMESE ALTERNATE READING MARK CA..VIETNAMESE ALTERNATE READING MARK NHAY -17000..187F7 ; ID_Continue # Lo [6136] TANGUT IDEOGRAPH-17000..TANGUT IDEOGRAPH-187F7 -18800..18CD5 ; ID_Continue # Lo [1238] TANGUT COMPONENT-001..KHITAN SMALL SCRIPT CHARACTER-18CD5 -18CFF..18D08 ; ID_Continue # Lo [10] KHITAN SMALL SCRIPT CHARACTER-18CFF..TANGUT IDEOGRAPH-18D08 +16FF2..16FF3 ; ID_Continue # Lm [2] CHINESE SMALL SIMPLIFIED ER..CHINESE SMALL TRADITIONAL ER +16FF4..16FF6 ; ID_Continue # Nl [3] YANGQIN SIGN SLOW ONE BEAT..YANGQIN SIGN SLOW TWO BEATS +17000..18CD5 ; ID_Continue # Lo [7382] TANGUT IDEOGRAPH-17000..KHITAN SMALL SCRIPT CHARACTER-18CD5 +18CFF..18D1E ; ID_Continue # Lo [32] KHITAN SMALL SCRIPT CHARACTER-18CFF..TANGUT IDEOGRAPH-18D1E +18D80..18DF2 ; ID_Continue # Lo [115] TANGUT COMPONENT-769..TANGUT COMPONENT-883 1AFF0..1AFF3 ; ID_Continue # Lm [4] KATAKANA LETTER MINNAN TONE-2..KATAKANA LETTER MINNAN TONE-5 1AFF5..1AFFB ; ID_Continue # Lm [7] KATAKANA LETTER MINNAN TONE-7..KATAKANA LETTER MINNAN NASALIZED TONE-5 1AFFD..1AFFE ; ID_Continue # Lm [2] KATAKANA LETTER MINNAN NASALIZED TONE-7..KATAKANA LETTER MINNAN NASALIZED TONE-8 @@ -8315,6 +8406,17 @@ FFDA..FFDC ; ID_Continue # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HAN 1E5EE..1E5EF ; ID_Continue # Mn [2] OL ONAL SIGN MU..OL ONAL SIGN IKIR 1E5F0 ; ID_Continue # Lo OL ONAL SIGN HODDOND 1E5F1..1E5FA ; ID_Continue # Nd [10] OL ONAL DIGIT ZERO..OL ONAL DIGIT NINE +1E6C0..1E6DE ; ID_Continue # Lo [31] TAI YO LETTER LOW KO..TAI YO LETTER HIGH KVO +1E6E0..1E6E2 ; ID_Continue # Lo [3] TAI YO LETTER AA..TAI YO LETTER UE +1E6E3 ; ID_Continue # Mn TAI YO SIGN UE +1E6E4..1E6E5 ; ID_Continue # Lo [2] TAI YO LETTER U..TAI YO LETTER AE +1E6E6 ; ID_Continue # Mn TAI YO SIGN AU +1E6E7..1E6ED ; ID_Continue # Lo [7] TAI YO LETTER O..TAI YO LETTER AUE +1E6EE..1E6EF ; ID_Continue # Mn [2] TAI YO SIGN AY..TAI YO SIGN ANG +1E6F0..1E6F4 ; ID_Continue # Lo [5] TAI YO LETTER AN..TAI YO LETTER AP +1E6F5 ; ID_Continue # Mn TAI YO SIGN OM +1E6FE ; ID_Continue # Lo TAI YO SYMBOL MUEANG +1E6FF ; ID_Continue # Lm TAI YO XAM LAI 1E7E0..1E7E6 ; ID_Continue # Lo [7] ETHIOPIC SYLLABLE HHYA..ETHIOPIC SYLLABLE HHYO 1E7E8..1E7EB ; ID_Continue # Lo [4] ETHIOPIC SYLLABLE GURAGE HHWA..ETHIOPIC SYLLABLE HHWE 1E7ED..1E7EE ; ID_Continue # Lo [2] ETHIOPIC SYLLABLE GURAGE MWI..ETHIOPIC SYLLABLE GURAGE MWEE @@ -8360,17 +8462,16 @@ FFDA..FFDC ; ID_Continue # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HAN 1EEAB..1EEBB ; ID_Continue # Lo [17] ARABIC MATHEMATICAL DOUBLE-STRUCK LAM..ARABIC MATHEMATICAL DOUBLE-STRUCK GHAIN 1FBF0..1FBF9 ; ID_Continue # Nd [10] SEGMENTED DIGIT ZERO..SEGMENTED DIGIT NINE 20000..2A6DF ; ID_Continue # Lo [42720] CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6DF -2A700..2B739 ; ID_Continue # Lo [4154] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B739 -2B740..2B81D ; ID_Continue # Lo [222] CJK UNIFIED IDEOGRAPH-2B740..CJK UNIFIED IDEOGRAPH-2B81D -2B820..2CEA1 ; ID_Continue # Lo [5762] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEA1 +2A700..2B81D ; ID_Continue # Lo [4382] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B81D +2B820..2CEAD ; ID_Continue # Lo [5774] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEAD 2CEB0..2EBE0 ; ID_Continue # Lo [7473] CJK UNIFIED IDEOGRAPH-2CEB0..CJK UNIFIED IDEOGRAPH-2EBE0 2EBF0..2EE5D ; ID_Continue # Lo [622] CJK UNIFIED IDEOGRAPH-2EBF0..CJK UNIFIED IDEOGRAPH-2EE5D 2F800..2FA1D ; ID_Continue # Lo [542] CJK COMPATIBILITY IDEOGRAPH-2F800..CJK COMPATIBILITY IDEOGRAPH-2FA1D 30000..3134A ; ID_Continue # Lo [4939] CJK UNIFIED IDEOGRAPH-30000..CJK UNIFIED IDEOGRAPH-3134A -31350..323AF ; ID_Continue # Lo [4192] CJK UNIFIED IDEOGRAPH-31350..CJK UNIFIED IDEOGRAPH-323AF +31350..33479 ; ID_Continue # Lo [8490] CJK UNIFIED IDEOGRAPH-31350..CJK UNIFIED IDEOGRAPH-33479 E0100..E01EF ; ID_Continue # Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256 -# Total code points: 144541 +# Total code points: 149240 # ================================================ @@ -8393,8 +8494,8 @@ E0100..E01EF ; ID_Continue # Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR 01BC..01BF ; XID_Start # L& [4] LATIN CAPITAL LETTER TONE FIVE..LATIN LETTER WYNN 01C0..01C3 ; XID_Start # Lo [4] LATIN LETTER DENTAL CLICK..LATIN LETTER RETROFLEX CLICK 01C4..0293 ; XID_Start # L& [208] LATIN CAPITAL LETTER DZ WITH CARON..LATIN SMALL LETTER EZH WITH CURL -0294 ; XID_Start # Lo LATIN LETTER GLOTTAL STOP -0295..02AF ; XID_Start # L& [27] LATIN LETTER PHARYNGEAL VOICED FRICATIVE..LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL +0294..0295 ; XID_Start # Lo [2] LATIN LETTER GLOTTAL STOP..LATIN LETTER PHARYNGEAL VOICED FRICATIVE +0296..02AF ; XID_Start # L& [26] LATIN LETTER INVERTED GLOTTAL STOP..LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL 02B0..02C1 ; XID_Start # Lm [18] MODIFIER LETTER SMALL H..MODIFIER LETTER REVERSED GLOTTAL STOP 02C6..02D1 ; XID_Start # Lm [12] MODIFIER LETTER CIRCUMFLEX ACCENT..MODIFIER LETTER HALF TRIANGULAR COLON 02E0..02E4 ; XID_Start # Lm [5] MODIFIER LETTER SMALL GAMMA..MODIFIER LETTER SMALL REVERSED GLOTTAL STOP @@ -8441,7 +8542,7 @@ E0100..E01EF ; ID_Continue # Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR 0840..0858 ; XID_Start # Lo [25] MANDAIC LETTER HALQA..MANDAIC LETTER AIN 0860..086A ; XID_Start # Lo [11] SYRIAC LETTER MALAYALAM NGA..SYRIAC LETTER MALAYALAM SSA 0870..0887 ; XID_Start # Lo [24] ARABIC LETTER ALEF WITH ATTACHED FATHA..ARABIC BASELINE ROUND DOT -0889..088E ; XID_Start # Lo [6] ARABIC LETTER NOON WITH INVERTED SMALL V..ARABIC VERTICAL TAIL +0889..088F ; XID_Start # Lo [7] ARABIC LETTER NOON WITH INVERTED SMALL V..ARABIC LETTER NOON WITH RING ABOVE 08A0..08C8 ; XID_Start # Lo [41] ARABIC LETTER BEH WITH SMALL V BELOW..ARABIC LETTER GRAF 08C9 ; XID_Start # Lm ARABIC SMALL FARSI YEH 0904..0939 ; XID_Start # Lo [54] DEVANAGARI LETTER SHORT A..DEVANAGARI LETTER HA @@ -8509,7 +8610,7 @@ E0100..E01EF ; ID_Continue # Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR 0C2A..0C39 ; XID_Start # Lo [16] TELUGU LETTER PA..TELUGU LETTER HA 0C3D ; XID_Start # Lo TELUGU SIGN AVAGRAHA 0C58..0C5A ; XID_Start # Lo [3] TELUGU LETTER TSA..TELUGU LETTER RRRA -0C5D ; XID_Start # Lo TELUGU LETTER NAKAARA POLLU +0C5C..0C5D ; XID_Start # Lo [2] TELUGU ARCHAIC SHRII..TELUGU LETTER NAKAARA POLLU 0C60..0C61 ; XID_Start # Lo [2] TELUGU LETTER VOCALIC RR..TELUGU LETTER VOCALIC LL 0C80 ; XID_Start # Lo KANNADA SIGN SPACING CANDRABINDU 0C85..0C8C ; XID_Start # Lo [8] KANNADA LETTER A..KANNADA LETTER VOCALIC L @@ -8518,7 +8619,7 @@ E0100..E01EF ; ID_Continue # Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR 0CAA..0CB3 ; XID_Start # Lo [10] KANNADA LETTER PA..KANNADA LETTER LLA 0CB5..0CB9 ; XID_Start # Lo [5] KANNADA LETTER VA..KANNADA LETTER HA 0CBD ; XID_Start # Lo KANNADA SIGN AVAGRAHA -0CDD..0CDE ; XID_Start # Lo [2] KANNADA LETTER NAKAARA POLLU..KANNADA LETTER FA +0CDC..0CDE ; XID_Start # Lo [3] KANNADA ARCHAIC SHRII..KANNADA LETTER FA 0CE0..0CE1 ; XID_Start # Lo [2] KANNADA LETTER VOCALIC RR..KANNADA LETTER VOCALIC LL 0CF1..0CF2 ; XID_Start # Lo [2] KANNADA SIGN JIHVAMULIYA..KANNADA SIGN UPADHMANIYA 0D04..0D0C ; XID_Start # Lo [9] MALAYALAM LETTER VEDIC ANUSVARA..MALAYALAM LETTER VOCALIC L @@ -8742,11 +8843,8 @@ A771..A787 ; XID_Start # L& [23] LATIN SMALL LETTER DUM..LATIN SMALL LETTER A788 ; XID_Start # Lm MODIFIER LETTER LOW CIRCUMFLEX ACCENT A78B..A78E ; XID_Start # L& [4] LATIN CAPITAL LETTER SALTILLO..LATIN SMALL LETTER L WITH RETROFLEX HOOK AND BELT A78F ; XID_Start # Lo LATIN LETTER SINOLOGICAL DOT -A790..A7CD ; XID_Start # L& [62] LATIN CAPITAL LETTER N WITH DESCENDER..LATIN SMALL LETTER S WITH DIAGONAL STROKE -A7D0..A7D1 ; XID_Start # L& [2] LATIN CAPITAL LETTER CLOSED INSULAR G..LATIN SMALL LETTER CLOSED INSULAR G -A7D3 ; XID_Start # L& LATIN SMALL LETTER DOUBLE THORN -A7D5..A7DC ; XID_Start # L& [8] LATIN SMALL LETTER DOUBLE WYNN..LATIN CAPITAL LETTER LAMBDA WITH STROKE -A7F2..A7F4 ; XID_Start # Lm [3] MODIFIER LETTER CAPITAL C..MODIFIER LETTER CAPITAL Q +A790..A7DC ; XID_Start # L& [77] LATIN CAPITAL LETTER N WITH DESCENDER..LATIN CAPITAL LETTER LAMBDA WITH STROKE +A7F1..A7F4 ; XID_Start # Lm [4] MODIFIER LETTER CAPITAL S..MODIFIER LETTER CAPITAL Q A7F5..A7F6 ; XID_Start # L& [2] LATIN CAPITAL LETTER REVERSED HALF H..LATIN SMALL LETTER REVERSED HALF H A7F7 ; XID_Start # Lo LATIN EPIGRAPHIC LETTER SIDEWAYS I A7F8..A7F9 ; XID_Start # Lm [2] MODIFIER LETTER CAPITAL H WITH STROKE..MODIFIER LETTER SMALL LIGATURE OE @@ -8888,6 +8986,7 @@ FFDA..FFDC ; XID_Start # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGU 108F4..108F5 ; XID_Start # Lo [2] HATRAN LETTER SHIN..HATRAN LETTER TAW 10900..10915 ; XID_Start # Lo [22] PHOENICIAN LETTER ALF..PHOENICIAN LETTER TAU 10920..10939 ; XID_Start # Lo [26] LYDIAN LETTER A..LYDIAN LETTER C +10940..10959 ; XID_Start # Lo [26] SIDETIC LETTER N01..SIDETIC LETTER N26 10980..109B7 ; XID_Start # Lo [56] MEROITIC HIEROGLYPHIC LETTER A..MEROITIC CURSIVE LETTER DA 109BE..109BF ; XID_Start # Lo [2] MEROITIC CURSIVE LOGOGRAM RMT..MEROITIC CURSIVE LOGOGRAM IMN 10A00 ; XID_Start # Lo KHAROSHTHI LETTER A @@ -8915,6 +9014,8 @@ FFDA..FFDC ; XID_Start # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGU 10E80..10EA9 ; XID_Start # Lo [42] YEZIDI LETTER ELIF..YEZIDI LETTER ET 10EB0..10EB1 ; XID_Start # Lo [2] YEZIDI LETTER LAM WITH DOT ABOVE..YEZIDI LETTER YOT WITH CIRCUMFLEX ABOVE 10EC2..10EC4 ; XID_Start # Lo [3] ARABIC LETTER DAL WITH TWO DOTS VERTICALLY BELOW..ARABIC LETTER KAF WITH TWO DOTS VERTICALLY BELOW +10EC5 ; XID_Start # Lm ARABIC SMALL YEH BARREE WITH TWO DOTS BELOW +10EC6..10EC7 ; XID_Start # Lo [2] ARABIC LETTER THIN NOON..ARABIC LETTER YEH WITH FOUR DOTS BELOW 10F00..10F1C ; XID_Start # Lo [29] OLD SOGDIAN LETTER ALEPH..OLD SOGDIAN LETTER FINAL TAW WITH VERTICAL TAIL 10F27 ; XID_Start # Lo OLD SOGDIAN LIGATURE AYIN-DALETH 10F30..10F45 ; XID_Start # Lo [22] SOGDIAN LETTER ALEPH..SOGDIAN INDEPENDENT SHIN @@ -9007,6 +9108,9 @@ FFDA..FFDC ; XID_Start # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGU 11D67..11D68 ; XID_Start # Lo [2] GUNJALA GONDI LETTER EE..GUNJALA GONDI LETTER AI 11D6A..11D89 ; XID_Start # Lo [32] GUNJALA GONDI LETTER OO..GUNJALA GONDI LETTER SA 11D98 ; XID_Start # Lo GUNJALA GONDI OM +11DB0..11DD8 ; XID_Start # Lo [41] TOLONG SIKI LETTER I..TOLONG SIKI LETTER RRH +11DD9 ; XID_Start # Lm TOLONG SIKI SIGN SELA +11DDA..11DDB ; XID_Start # Lo [2] TOLONG SIKI SIGN HECAKA..TOLONG SIKI UNGGA 11EE0..11EF2 ; XID_Start # Lo [19] MAKASAR LETTER KA..MAKASAR ANGKA 11F02 ; XID_Start # Lo KAWI SIGN REPHA 11F04..11F10 ; XID_Start # Lo [13] KAWI LETTER A..KAWI LETTER O @@ -9033,14 +9137,18 @@ FFDA..FFDC ; XID_Start # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGU 16D43..16D6A ; XID_Start # Lo [40] KIRAT RAI LETTER A..KIRAT RAI VOWEL SIGN AU 16D6B..16D6C ; XID_Start # Lm [2] KIRAT RAI SIGN VIRAMA..KIRAT RAI SIGN SAAT 16E40..16E7F ; XID_Start # L& [64] MEDEFAIDRIN CAPITAL LETTER M..MEDEFAIDRIN SMALL LETTER Y +16EA0..16EB8 ; XID_Start # L& [25] BERIA ERFE CAPITAL LETTER ARKAB..BERIA ERFE CAPITAL LETTER AY +16EBB..16ED3 ; XID_Start # L& [25] BERIA ERFE SMALL LETTER ARKAB..BERIA ERFE SMALL LETTER AY 16F00..16F4A ; XID_Start # Lo [75] MIAO LETTER PA..MIAO LETTER RTE 16F50 ; XID_Start # Lo MIAO LETTER NASALIZATION 16F93..16F9F ; XID_Start # Lm [13] MIAO LETTER TONE-2..MIAO LETTER REFORMED TONE-8 16FE0..16FE1 ; XID_Start # Lm [2] TANGUT ITERATION MARK..NUSHU ITERATION MARK 16FE3 ; XID_Start # Lm OLD CHINESE ITERATION MARK -17000..187F7 ; XID_Start # Lo [6136] TANGUT IDEOGRAPH-17000..TANGUT IDEOGRAPH-187F7 -18800..18CD5 ; XID_Start # Lo [1238] TANGUT COMPONENT-001..KHITAN SMALL SCRIPT CHARACTER-18CD5 -18CFF..18D08 ; XID_Start # Lo [10] KHITAN SMALL SCRIPT CHARACTER-18CFF..TANGUT IDEOGRAPH-18D08 +16FF2..16FF3 ; XID_Start # Lm [2] CHINESE SMALL SIMPLIFIED ER..CHINESE SMALL TRADITIONAL ER +16FF4..16FF6 ; XID_Start # Nl [3] YANGQIN SIGN SLOW ONE BEAT..YANGQIN SIGN SLOW TWO BEATS +17000..18CD5 ; XID_Start # Lo [7382] TANGUT IDEOGRAPH-17000..KHITAN SMALL SCRIPT CHARACTER-18CD5 +18CFF..18D1E ; XID_Start # Lo [32] KHITAN SMALL SCRIPT CHARACTER-18CFF..TANGUT IDEOGRAPH-18D1E +18D80..18DF2 ; XID_Start # Lo [115] TANGUT COMPONENT-769..TANGUT COMPONENT-883 1AFF0..1AFF3 ; XID_Start # Lm [4] KATAKANA LETTER MINNAN TONE-2..KATAKANA LETTER MINNAN TONE-5 1AFF5..1AFFB ; XID_Start # Lm [7] KATAKANA LETTER MINNAN TONE-7..KATAKANA LETTER MINNAN NASALIZED TONE-5 1AFFD..1AFFE ; XID_Start # Lm [2] KATAKANA LETTER MINNAN NASALIZED TONE-7..KATAKANA LETTER MINNAN NASALIZED TONE-8 @@ -9098,6 +9206,13 @@ FFDA..FFDC ; XID_Start # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGU 1E4EB ; XID_Start # Lm NAG MUNDARI SIGN OJOD 1E5D0..1E5ED ; XID_Start # Lo [30] OL ONAL LETTER O..OL ONAL LETTER EG 1E5F0 ; XID_Start # Lo OL ONAL SIGN HODDOND +1E6C0..1E6DE ; XID_Start # Lo [31] TAI YO LETTER LOW KO..TAI YO LETTER HIGH KVO +1E6E0..1E6E2 ; XID_Start # Lo [3] TAI YO LETTER AA..TAI YO LETTER UE +1E6E4..1E6E5 ; XID_Start # Lo [2] TAI YO LETTER U..TAI YO LETTER AE +1E6E7..1E6ED ; XID_Start # Lo [7] TAI YO LETTER O..TAI YO LETTER AUE +1E6F0..1E6F4 ; XID_Start # Lo [5] TAI YO LETTER AN..TAI YO LETTER AP +1E6FE ; XID_Start # Lo TAI YO SYMBOL MUEANG +1E6FF ; XID_Start # Lm TAI YO XAM LAI 1E7E0..1E7E6 ; XID_Start # Lo [7] ETHIOPIC SYLLABLE HHYA..ETHIOPIC SYLLABLE HHYO 1E7E8..1E7EB ; XID_Start # Lo [4] ETHIOPIC SYLLABLE GURAGE HHWA..ETHIOPIC SYLLABLE HHWE 1E7ED..1E7EE ; XID_Start # Lo [2] ETHIOPIC SYLLABLE GURAGE MWI..ETHIOPIC SYLLABLE GURAGE MWEE @@ -9139,16 +9254,15 @@ FFDA..FFDC ; XID_Start # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGU 1EEA5..1EEA9 ; XID_Start # Lo [5] ARABIC MATHEMATICAL DOUBLE-STRUCK WAW..ARABIC MATHEMATICAL DOUBLE-STRUCK YEH 1EEAB..1EEBB ; XID_Start # Lo [17] ARABIC MATHEMATICAL DOUBLE-STRUCK LAM..ARABIC MATHEMATICAL DOUBLE-STRUCK GHAIN 20000..2A6DF ; XID_Start # Lo [42720] CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6DF -2A700..2B739 ; XID_Start # Lo [4154] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B739 -2B740..2B81D ; XID_Start # Lo [222] CJK UNIFIED IDEOGRAPH-2B740..CJK UNIFIED IDEOGRAPH-2B81D -2B820..2CEA1 ; XID_Start # Lo [5762] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEA1 +2A700..2B81D ; XID_Start # Lo [4382] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B81D +2B820..2CEAD ; XID_Start # Lo [5774] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEAD 2CEB0..2EBE0 ; XID_Start # Lo [7473] CJK UNIFIED IDEOGRAPH-2CEB0..CJK UNIFIED IDEOGRAPH-2EBE0 2EBF0..2EE5D ; XID_Start # Lo [622] CJK UNIFIED IDEOGRAPH-2EBF0..CJK UNIFIED IDEOGRAPH-2EE5D 2F800..2FA1D ; XID_Start # Lo [542] CJK COMPATIBILITY IDEOGRAPH-2F800..CJK COMPATIBILITY IDEOGRAPH-2FA1D 30000..3134A ; XID_Start # Lo [4939] CJK UNIFIED IDEOGRAPH-30000..CJK UNIFIED IDEOGRAPH-3134A -31350..323AF ; XID_Start # Lo [4192] CJK UNIFIED IDEOGRAPH-31350..CJK UNIFIED IDEOGRAPH-323AF +31350..33479 ; XID_Start # Lo [8490] CJK UNIFIED IDEOGRAPH-31350..CJK UNIFIED IDEOGRAPH-33479 -# Total code points: 141246 +# Total code points: 145893 # ================================================ @@ -9174,8 +9288,8 @@ FFDA..FFDC ; XID_Start # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGU 01BC..01BF ; XID_Continue # L& [4] LATIN CAPITAL LETTER TONE FIVE..LATIN LETTER WYNN 01C0..01C3 ; XID_Continue # Lo [4] LATIN LETTER DENTAL CLICK..LATIN LETTER RETROFLEX CLICK 01C4..0293 ; XID_Continue # L& [208] LATIN CAPITAL LETTER DZ WITH CARON..LATIN SMALL LETTER EZH WITH CURL -0294 ; XID_Continue # Lo LATIN LETTER GLOTTAL STOP -0295..02AF ; XID_Continue # L& [27] LATIN LETTER PHARYNGEAL VOICED FRICATIVE..LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL +0294..0295 ; XID_Continue # Lo [2] LATIN LETTER GLOTTAL STOP..LATIN LETTER PHARYNGEAL VOICED FRICATIVE +0296..02AF ; XID_Continue # L& [26] LATIN LETTER INVERTED GLOTTAL STOP..LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL 02B0..02C1 ; XID_Continue # Lm [18] MODIFIER LETTER SMALL H..MODIFIER LETTER REVERSED GLOTTAL STOP 02C6..02D1 ; XID_Continue # Lm [12] MODIFIER LETTER CIRCUMFLEX ACCENT..MODIFIER LETTER HALF TRIANGULAR COLON 02E0..02E4 ; XID_Continue # Lm [5] MODIFIER LETTER SMALL GAMMA..MODIFIER LETTER SMALL REVERSED GLOTTAL STOP @@ -9250,7 +9364,7 @@ FFDA..FFDC ; XID_Start # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGU 0859..085B ; XID_Continue # Mn [3] MANDAIC AFFRICATION MARK..MANDAIC GEMINATION MARK 0860..086A ; XID_Continue # Lo [11] SYRIAC LETTER MALAYALAM NGA..SYRIAC LETTER MALAYALAM SSA 0870..0887 ; XID_Continue # Lo [24] ARABIC LETTER ALEF WITH ATTACHED FATHA..ARABIC BASELINE ROUND DOT -0889..088E ; XID_Continue # Lo [6] ARABIC LETTER NOON WITH INVERTED SMALL V..ARABIC VERTICAL TAIL +0889..088F ; XID_Continue # Lo [7] ARABIC LETTER NOON WITH INVERTED SMALL V..ARABIC LETTER NOON WITH RING ABOVE 0897..089F ; XID_Continue # Mn [9] ARABIC PEPET..ARABIC HALF MADDA OVER MADDA 08A0..08C8 ; XID_Continue # Lo [41] ARABIC LETTER BEH WITH SMALL V BELOW..ARABIC LETTER GRAF 08C9 ; XID_Continue # Lm ARABIC SMALL FARSI YEH @@ -9400,7 +9514,7 @@ FFDA..FFDC ; XID_Start # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGU 0C4A..0C4D ; XID_Continue # Mn [4] TELUGU VOWEL SIGN O..TELUGU SIGN VIRAMA 0C55..0C56 ; XID_Continue # Mn [2] TELUGU LENGTH MARK..TELUGU AI LENGTH MARK 0C58..0C5A ; XID_Continue # Lo [3] TELUGU LETTER TSA..TELUGU LETTER RRRA -0C5D ; XID_Continue # Lo TELUGU LETTER NAKAARA POLLU +0C5C..0C5D ; XID_Continue # Lo [2] TELUGU ARCHAIC SHRII..TELUGU LETTER NAKAARA POLLU 0C60..0C61 ; XID_Continue # Lo [2] TELUGU LETTER VOCALIC RR..TELUGU LETTER VOCALIC LL 0C62..0C63 ; XID_Continue # Mn [2] TELUGU VOWEL SIGN VOCALIC L..TELUGU VOWEL SIGN VOCALIC LL 0C66..0C6F ; XID_Continue # Nd [10] TELUGU DIGIT ZERO..TELUGU DIGIT NINE @@ -9422,7 +9536,7 @@ FFDA..FFDC ; XID_Start # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGU 0CCA..0CCB ; XID_Continue # Mc [2] KANNADA VOWEL SIGN O..KANNADA VOWEL SIGN OO 0CCC..0CCD ; XID_Continue # Mn [2] KANNADA VOWEL SIGN AU..KANNADA SIGN VIRAMA 0CD5..0CD6 ; XID_Continue # Mc [2] KANNADA LENGTH MARK..KANNADA AI LENGTH MARK -0CDD..0CDE ; XID_Continue # Lo [2] KANNADA LETTER NAKAARA POLLU..KANNADA LETTER FA +0CDC..0CDE ; XID_Continue # Lo [3] KANNADA ARCHAIC SHRII..KANNADA LETTER FA 0CE0..0CE1 ; XID_Continue # Lo [2] KANNADA LETTER VOCALIC RR..KANNADA LETTER VOCALIC LL 0CE2..0CE3 ; XID_Continue # Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL 0CE6..0CEF ; XID_Continue # Nd [10] KANNADA DIGIT ZERO..KANNADA DIGIT NINE @@ -9639,7 +9753,8 @@ FFDA..FFDC ; XID_Start # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGU 1A90..1A99 ; XID_Continue # Nd [10] TAI THAM THAM DIGIT ZERO..TAI THAM THAM DIGIT NINE 1AA7 ; XID_Continue # Lm TAI THAM SIGN MAI YAMOK 1AB0..1ABD ; XID_Continue # Mn [14] COMBINING DOUBLED CIRCUMFLEX ACCENT..COMBINING PARENTHESES BELOW -1ABF..1ACE ; XID_Continue # Mn [16] COMBINING LATIN SMALL LETTER W BELOW..COMBINING LATIN SMALL LETTER INSULAR T +1ABF..1ADD ; XID_Continue # Mn [31] COMBINING LATIN SMALL LETTER W BELOW..COMBINING DOT-AND-RING BELOW +1AE0..1AEB ; XID_Continue # Mn [12] COMBINING LEFT TACK ABOVE..COMBINING DOUBLE RIGHTWARDS ARROW ABOVE 1B00..1B03 ; XID_Continue # Mn [4] BALINESE SIGN ULU RICEM..BALINESE SIGN SURANG 1B04 ; XID_Continue # Mc BALINESE SIGN BISAH 1B05..1B33 ; XID_Continue # Lo [47] BALINESE LETTER AKARA..BALINESE LETTER HA @@ -9827,11 +9942,8 @@ A771..A787 ; XID_Continue # L& [23] LATIN SMALL LETTER DUM..LATIN SMALL LETT A788 ; XID_Continue # Lm MODIFIER LETTER LOW CIRCUMFLEX ACCENT A78B..A78E ; XID_Continue # L& [4] LATIN CAPITAL LETTER SALTILLO..LATIN SMALL LETTER L WITH RETROFLEX HOOK AND BELT A78F ; XID_Continue # Lo LATIN LETTER SINOLOGICAL DOT -A790..A7CD ; XID_Continue # L& [62] LATIN CAPITAL LETTER N WITH DESCENDER..LATIN SMALL LETTER S WITH DIAGONAL STROKE -A7D0..A7D1 ; XID_Continue # L& [2] LATIN CAPITAL LETTER CLOSED INSULAR G..LATIN SMALL LETTER CLOSED INSULAR G -A7D3 ; XID_Continue # L& LATIN SMALL LETTER DOUBLE THORN -A7D5..A7DC ; XID_Continue # L& [8] LATIN SMALL LETTER DOUBLE WYNN..LATIN CAPITAL LETTER LAMBDA WITH STROKE -A7F2..A7F4 ; XID_Continue # Lm [3] MODIFIER LETTER CAPITAL C..MODIFIER LETTER CAPITAL Q +A790..A7DC ; XID_Continue # L& [77] LATIN CAPITAL LETTER N WITH DESCENDER..LATIN CAPITAL LETTER LAMBDA WITH STROKE +A7F1..A7F4 ; XID_Continue # Lm [4] MODIFIER LETTER CAPITAL S..MODIFIER LETTER CAPITAL Q A7F5..A7F6 ; XID_Continue # L& [2] LATIN CAPITAL LETTER REVERSED HALF H..LATIN SMALL LETTER REVERSED HALF H A7F7 ; XID_Continue # Lo LATIN EPIGRAPHIC LETTER SIDEWAYS I A7F8..A7F9 ; XID_Continue # Lm [2] MODIFIER LETTER CAPITAL H WITH STROKE..MODIFIER LETTER SMALL LIGATURE OE @@ -10044,6 +10156,7 @@ FFDA..FFDC ; XID_Continue # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HA 108F4..108F5 ; XID_Continue # Lo [2] HATRAN LETTER SHIN..HATRAN LETTER TAW 10900..10915 ; XID_Continue # Lo [22] PHOENICIAN LETTER ALF..PHOENICIAN LETTER TAU 10920..10939 ; XID_Continue # Lo [26] LYDIAN LETTER A..LYDIAN LETTER C +10940..10959 ; XID_Continue # Lo [26] SIDETIC LETTER N01..SIDETIC LETTER N26 10980..109B7 ; XID_Continue # Lo [56] MEROITIC HIEROGLYPHIC LETTER A..MEROITIC CURSIVE LETTER DA 109BE..109BF ; XID_Continue # Lo [2] MEROITIC CURSIVE LOGOGRAM RMT..MEROITIC CURSIVE LOGOGRAM IMN 10A00 ; XID_Continue # Lo KHAROSHTHI LETTER A @@ -10082,7 +10195,9 @@ FFDA..FFDC ; XID_Continue # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HA 10EAB..10EAC ; XID_Continue # Mn [2] YEZIDI COMBINING HAMZA MARK..YEZIDI COMBINING MADDA MARK 10EB0..10EB1 ; XID_Continue # Lo [2] YEZIDI LETTER LAM WITH DOT ABOVE..YEZIDI LETTER YOT WITH CIRCUMFLEX ABOVE 10EC2..10EC4 ; XID_Continue # Lo [3] ARABIC LETTER DAL WITH TWO DOTS VERTICALLY BELOW..ARABIC LETTER KAF WITH TWO DOTS VERTICALLY BELOW -10EFC..10EFF ; XID_Continue # Mn [4] ARABIC COMBINING ALEF OVERLAY..ARABIC SMALL LOW WORD MADDA +10EC5 ; XID_Continue # Lm ARABIC SMALL YEH BARREE WITH TWO DOTS BELOW +10EC6..10EC7 ; XID_Continue # Lo [2] ARABIC LETTER THIN NOON..ARABIC LETTER YEH WITH FOUR DOTS BELOW +10EFA..10EFF ; XID_Continue # Mn [6] ARABIC DOUBLE VERTICAL BAR BELOW..ARABIC SMALL LOW WORD MADDA 10F00..10F1C ; XID_Continue # Lo [29] OLD SOGDIAN LETTER ALEPH..OLD SOGDIAN LETTER FINAL TAW WITH VERTICAL TAIL 10F27 ; XID_Continue # Lo OLD SOGDIAN LIGATURE AYIN-DALETH 10F30..10F45 ; XID_Continue # Lo [22] SOGDIAN LETTER ALEPH..SOGDIAN INDEPENDENT SHIN @@ -10309,6 +10424,12 @@ FFDA..FFDC ; XID_Continue # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HA 11A98..11A99 ; XID_Continue # Mn [2] SOYOMBO GEMINATION MARK..SOYOMBO SUBJOINER 11A9D ; XID_Continue # Lo SOYOMBO MARK PLUTA 11AB0..11AF8 ; XID_Continue # Lo [73] CANADIAN SYLLABICS NATTILIK HI..PAU CIN HAU GLOTTAL STOP FINAL +11B60 ; XID_Continue # Mn SHARADA VOWEL SIGN OE +11B61 ; XID_Continue # Mc SHARADA VOWEL SIGN OOE +11B62..11B64 ; XID_Continue # Mn [3] SHARADA VOWEL SIGN UE..SHARADA VOWEL SIGN SHORT E +11B65 ; XID_Continue # Mc SHARADA VOWEL SIGN SHORT O +11B66 ; XID_Continue # Mn SHARADA VOWEL SIGN CANDRA E +11B67 ; XID_Continue # Mc SHARADA VOWEL SIGN CANDRA O 11BC0..11BE0 ; XID_Continue # Lo [33] SUNUWAR LETTER DEVI..SUNUWAR LETTER KLOKO 11BF0..11BF9 ; XID_Continue # Nd [10] SUNUWAR DIGIT ZERO..SUNUWAR DIGIT NINE 11C00..11C08 ; XID_Continue # Lo [9] BHAIKSUKI LETTER A..BHAIKSUKI LETTER VOCALIC L @@ -10349,6 +10470,10 @@ FFDA..FFDC ; XID_Continue # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HA 11D97 ; XID_Continue # Mn GUNJALA GONDI VIRAMA 11D98 ; XID_Continue # Lo GUNJALA GONDI OM 11DA0..11DA9 ; XID_Continue # Nd [10] GUNJALA GONDI DIGIT ZERO..GUNJALA GONDI DIGIT NINE +11DB0..11DD8 ; XID_Continue # Lo [41] TOLONG SIKI LETTER I..TOLONG SIKI LETTER RRH +11DD9 ; XID_Continue # Lm TOLONG SIKI SIGN SELA +11DDA..11DDB ; XID_Continue # Lo [2] TOLONG SIKI SIGN HECAKA..TOLONG SIKI UNGGA +11DE0..11DE9 ; XID_Continue # Nd [10] TOLONG SIKI DIGIT ZERO..TOLONG SIKI DIGIT NINE 11EE0..11EF2 ; XID_Continue # Lo [19] MAKASAR LETTER KA..MAKASAR ANGKA 11EF3..11EF4 ; XID_Continue # Mn [2] MAKASAR VOWEL SIGN I..MAKASAR VOWEL SIGN U 11EF5..11EF6 ; XID_Continue # Mc [2] MAKASAR VOWEL SIGN E..MAKASAR VOWEL SIGN O @@ -10399,6 +10524,8 @@ FFDA..FFDC ; XID_Continue # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HA 16D6B..16D6C ; XID_Continue # Lm [2] KIRAT RAI SIGN VIRAMA..KIRAT RAI SIGN SAAT 16D70..16D79 ; XID_Continue # Nd [10] KIRAT RAI DIGIT ZERO..KIRAT RAI DIGIT NINE 16E40..16E7F ; XID_Continue # L& [64] MEDEFAIDRIN CAPITAL LETTER M..MEDEFAIDRIN SMALL LETTER Y +16EA0..16EB8 ; XID_Continue # L& [25] BERIA ERFE CAPITAL LETTER ARKAB..BERIA ERFE CAPITAL LETTER AY +16EBB..16ED3 ; XID_Continue # L& [25] BERIA ERFE SMALL LETTER ARKAB..BERIA ERFE SMALL LETTER AY 16F00..16F4A ; XID_Continue # Lo [75] MIAO LETTER PA..MIAO LETTER RTE 16F4F ; XID_Continue # Mn MIAO SIGN CONSONANT MODIFIER BAR 16F50 ; XID_Continue # Lo MIAO LETTER NASALIZATION @@ -10409,9 +10536,11 @@ FFDA..FFDC ; XID_Continue # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HA 16FE3 ; XID_Continue # Lm OLD CHINESE ITERATION MARK 16FE4 ; XID_Continue # Mn KHITAN SMALL SCRIPT FILLER 16FF0..16FF1 ; XID_Continue # Mc [2] VIETNAMESE ALTERNATE READING MARK CA..VIETNAMESE ALTERNATE READING MARK NHAY -17000..187F7 ; XID_Continue # Lo [6136] TANGUT IDEOGRAPH-17000..TANGUT IDEOGRAPH-187F7 -18800..18CD5 ; XID_Continue # Lo [1238] TANGUT COMPONENT-001..KHITAN SMALL SCRIPT CHARACTER-18CD5 -18CFF..18D08 ; XID_Continue # Lo [10] KHITAN SMALL SCRIPT CHARACTER-18CFF..TANGUT IDEOGRAPH-18D08 +16FF2..16FF3 ; XID_Continue # Lm [2] CHINESE SMALL SIMPLIFIED ER..CHINESE SMALL TRADITIONAL ER +16FF4..16FF6 ; XID_Continue # Nl [3] YANGQIN SIGN SLOW ONE BEAT..YANGQIN SIGN SLOW TWO BEATS +17000..18CD5 ; XID_Continue # Lo [7382] TANGUT IDEOGRAPH-17000..KHITAN SMALL SCRIPT CHARACTER-18CD5 +18CFF..18D1E ; XID_Continue # Lo [32] KHITAN SMALL SCRIPT CHARACTER-18CFF..TANGUT IDEOGRAPH-18D1E +18D80..18DF2 ; XID_Continue # Lo [115] TANGUT COMPONENT-769..TANGUT COMPONENT-883 1AFF0..1AFF3 ; XID_Continue # Lm [4] KATAKANA LETTER MINNAN TONE-2..KATAKANA LETTER MINNAN TONE-5 1AFF5..1AFFB ; XID_Continue # Lm [7] KATAKANA LETTER MINNAN TONE-7..KATAKANA LETTER MINNAN NASALIZED TONE-5 1AFFD..1AFFE ; XID_Continue # Lm [2] KATAKANA LETTER MINNAN NASALIZED TONE-7..KATAKANA LETTER MINNAN NASALIZED TONE-8 @@ -10502,6 +10631,17 @@ FFDA..FFDC ; XID_Continue # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HA 1E5EE..1E5EF ; XID_Continue # Mn [2] OL ONAL SIGN MU..OL ONAL SIGN IKIR 1E5F0 ; XID_Continue # Lo OL ONAL SIGN HODDOND 1E5F1..1E5FA ; XID_Continue # Nd [10] OL ONAL DIGIT ZERO..OL ONAL DIGIT NINE +1E6C0..1E6DE ; XID_Continue # Lo [31] TAI YO LETTER LOW KO..TAI YO LETTER HIGH KVO +1E6E0..1E6E2 ; XID_Continue # Lo [3] TAI YO LETTER AA..TAI YO LETTER UE +1E6E3 ; XID_Continue # Mn TAI YO SIGN UE +1E6E4..1E6E5 ; XID_Continue # Lo [2] TAI YO LETTER U..TAI YO LETTER AE +1E6E6 ; XID_Continue # Mn TAI YO SIGN AU +1E6E7..1E6ED ; XID_Continue # Lo [7] TAI YO LETTER O..TAI YO LETTER AUE +1E6EE..1E6EF ; XID_Continue # Mn [2] TAI YO SIGN AY..TAI YO SIGN ANG +1E6F0..1E6F4 ; XID_Continue # Lo [5] TAI YO LETTER AN..TAI YO LETTER AP +1E6F5 ; XID_Continue # Mn TAI YO SIGN OM +1E6FE ; XID_Continue # Lo TAI YO SYMBOL MUEANG +1E6FF ; XID_Continue # Lm TAI YO XAM LAI 1E7E0..1E7E6 ; XID_Continue # Lo [7] ETHIOPIC SYLLABLE HHYA..ETHIOPIC SYLLABLE HHYO 1E7E8..1E7EB ; XID_Continue # Lo [4] ETHIOPIC SYLLABLE GURAGE HHWA..ETHIOPIC SYLLABLE HHWE 1E7ED..1E7EE ; XID_Continue # Lo [2] ETHIOPIC SYLLABLE GURAGE MWI..ETHIOPIC SYLLABLE GURAGE MWEE @@ -10547,17 +10687,16 @@ FFDA..FFDC ; XID_Continue # Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HA 1EEAB..1EEBB ; XID_Continue # Lo [17] ARABIC MATHEMATICAL DOUBLE-STRUCK LAM..ARABIC MATHEMATICAL DOUBLE-STRUCK GHAIN 1FBF0..1FBF9 ; XID_Continue # Nd [10] SEGMENTED DIGIT ZERO..SEGMENTED DIGIT NINE 20000..2A6DF ; XID_Continue # Lo [42720] CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6DF -2A700..2B739 ; XID_Continue # Lo [4154] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B739 -2B740..2B81D ; XID_Continue # Lo [222] CJK UNIFIED IDEOGRAPH-2B740..CJK UNIFIED IDEOGRAPH-2B81D -2B820..2CEA1 ; XID_Continue # Lo [5762] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEA1 +2A700..2B81D ; XID_Continue # Lo [4382] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B81D +2B820..2CEAD ; XID_Continue # Lo [5774] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEAD 2CEB0..2EBE0 ; XID_Continue # Lo [7473] CJK UNIFIED IDEOGRAPH-2CEB0..CJK UNIFIED IDEOGRAPH-2EBE0 2EBF0..2EE5D ; XID_Continue # Lo [622] CJK UNIFIED IDEOGRAPH-2EBF0..CJK UNIFIED IDEOGRAPH-2EE5D 2F800..2FA1D ; XID_Continue # Lo [542] CJK COMPATIBILITY IDEOGRAPH-2F800..CJK COMPATIBILITY IDEOGRAPH-2FA1D 30000..3134A ; XID_Continue # Lo [4939] CJK UNIFIED IDEOGRAPH-30000..CJK UNIFIED IDEOGRAPH-3134A -31350..323AF ; XID_Continue # Lo [4192] CJK UNIFIED IDEOGRAPH-31350..CJK UNIFIED IDEOGRAPH-323AF +31350..33479 ; XID_Continue # Lo [8490] CJK UNIFIED IDEOGRAPH-31350..CJK UNIFIED IDEOGRAPH-33479 E0100..E01EF ; XID_Continue # Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256 -# Total code points: 144522 +# Total code points: 149221 # ================================================ @@ -10778,7 +10917,8 @@ E01F0..E0FFF ; Default_Ignorable_Code_Point # Cn [3600] .... 085F ; Cn # 086B..086F ; Cn # [5] .. -088F ; Cn # 0892..0896 ; Cn # [5] .. 0984 ; Cn # 098D..098E ; Cn # [2] .. @@ -120,7 +119,7 @@ 0C49 ; Cn # 0C4E..0C54 ; Cn # [7] .. 0C57 ; Cn # -0C5B..0C5C ; Cn # [2] .. +0C5B ; Cn # 0C5E..0C5F ; Cn # [2] .. 0C64..0C65 ; Cn # [2] .. 0C70..0C76 ; Cn # [7] .. @@ -132,7 +131,7 @@ 0CC5 ; Cn # 0CC9 ; Cn # 0CCE..0CD4 ; Cn # [7] .. -0CD7..0CDC ; Cn # [6] .. +0CD7..0CDB ; Cn # [5] .. 0CDF ; Cn # 0CE4..0CE5 ; Cn # [2] .. 0CF0 ; Cn # @@ -228,7 +227,8 @@ 1A8A..1A8F ; Cn # [6] .. 1A9A..1A9F ; Cn # [6] .. 1AAE..1AAF ; Cn # [2] .. -1ACF..1AFF ; Cn # [49] .. +1ADE..1ADF ; Cn # [2] .. +1AEC..1AFF ; Cn # [20] .. 1B4D ; Cn # 1BF4..1BFB ; Cn # [8] .. 1C38..1C3A ; Cn # [3] .. @@ -257,13 +257,12 @@ 2072..2073 ; Cn # [2] .. 208F ; Cn # 209D..209F ; Cn # [3] .. -20C1..20CF ; Cn # [15] .. +20C2..20CF ; Cn # [14] .. 20F1..20FF ; Cn # [15] .. 218C..218F ; Cn # [4] .. 242A..243F ; Cn # [22] .. 244B..245F ; Cn # [21] .. 2B74..2B75 ; Cn # [2] .. -2B96 ; Cn # 2CF4..2CF8 ; Cn # [5] .. 2D26 ; Cn # 2D28..2D2C ; Cn # [5] .. @@ -294,10 +293,7 @@ A48D..A48F ; Cn # [3] .. A4C7..A4CF ; Cn # [9] .. A62C..A63F ; Cn # [20] .. A6F8..A6FF ; Cn # [8] .. -A7CE..A7CF ; Cn # [2] .. -A7D2 ; Cn # -A7D4 ; Cn # -A7DD..A7F1 ; Cn # [21] .. +A7DD..A7F0 ; Cn # [20] .. A82D..A82F ; Cn # [3] .. A83A..A83F ; Cn # [6] .. A878..A87F ; Cn # [8] .. @@ -333,9 +329,6 @@ FB3D ; Cn # FB3F ; Cn # FB42 ; Cn # FB45 ; Cn # -FBC3..FBD2 ; Cn # [16] .. -FD90..FD91 ; Cn # [2] .. -FDC8..FDCE ; Cn # [7] .. FDD0..FDEF ; Cn # [32] .. FE1A..FE1F ; Cn # [6] .. FE53 ; Cn # @@ -407,7 +400,7 @@ FFFE..FFFF ; Cn # [2] .. 108F6..108FA ; Cn # [5] .. 1091C..1091E ; Cn # [3] .. 1093A..1093E ; Cn # [5] .. -10940..1097F ; Cn # [64] .. +1095A..1097F ; Cn # [38] .. 109B8..109BB ; Cn # [4] .. 109D0..109D1 ; Cn # [2] .. 10A04 ; Cn # @@ -439,7 +432,8 @@ FFFE..FFFF ; Cn # [2] .. 10EAA ; Cn # 10EAE..10EAF ; Cn # [2] .. 10EB2..10EC1 ; Cn # [16] .. -10EC5..10EFB ; Cn # [55] .. +10EC8..10ECF ; Cn # [8] .. +10ED9..10EF9 ; Cn # [33] .. 10F28..10F2F ; Cn # [8] .. 10F5A..10F6F ; Cn # [22] .. 10F8A..10FAF ; Cn # [38] .. @@ -522,7 +516,8 @@ FFFE..FFFF ; Cn # [2] .. 11A48..11A4F ; Cn # [8] .. 11AA3..11AAF ; Cn # [13] .. 11AF9..11AFF ; Cn # [7] .. -11B0A..11BBF ; Cn # [182] .. +11B0A..11B5F ; Cn # [86] .. +11B68..11BBF ; Cn # [88] .. 11BE2..11BEF ; Cn # [14] .. 11BFA..11BFF ; Cn # [6] .. 11C09 ; Cn # @@ -544,7 +539,9 @@ FFFE..FFFF ; Cn # [2] .. 11D8F ; Cn # 11D92 ; Cn # 11D99..11D9F ; Cn # [7] .. -11DAA..11EDF ; Cn # [310] .. +11DAA..11DAF ; Cn # [6] .. +11DDC..11DDF ; Cn # [4] .. +11DEA..11EDF ; Cn # [246] .. 11EF9..11EFF ; Cn # [7] .. 11F11 ; Cn # 11F3B..11F3D ; Cn # [3] .. @@ -573,15 +570,17 @@ FFFE..FFFF ; Cn # [2] .. 16B78..16B7C ; Cn # [5] .. 16B90..16D3F ; Cn # [432] .. 16D7A..16E3F ; Cn # [198] .. -16E9B..16EFF ; Cn # [101] .. +16E9B..16E9F ; Cn # [5] .. +16EB9..16EBA ; Cn # [2] .. +16ED4..16EFF ; Cn # [44] .. 16F4B..16F4E ; Cn # [4] .. 16F88..16F8E ; Cn # [7] .. 16FA0..16FDF ; Cn # [64] .. 16FE5..16FEF ; Cn # [11] .. -16FF2..16FFF ; Cn # [14] .. -187F8..187FF ; Cn # [8] .. +16FF7..16FFF ; Cn # [9] .. 18CD6..18CFE ; Cn # [41] .. -18D09..1AFEF ; Cn # [8935] .. +18D1F..18D7F ; Cn # [97] .. +18DF3..1AFEF ; Cn # [8701] .. 1AFF4 ; Cn # 1AFFC ; Cn # 1AFFF ; Cn # @@ -596,8 +595,10 @@ FFFE..FFFF ; Cn # [2] .. 1BC89..1BC8F ; Cn # [7] .. 1BC9A..1BC9B ; Cn # [2] .. 1BCA4..1CBFF ; Cn # [3932] .. -1CCFA..1CCFF ; Cn # [6] .. -1CEB4..1CEFF ; Cn # [76] .. +1CCFD..1CCFF ; Cn # [3] .. +1CEB4..1CEB9 ; Cn # [6] .. +1CED1..1CEDF ; Cn # [15] .. +1CEF1..1CEFF ; Cn # [15] .. 1CF2E..1CF2F ; Cn # [2] .. 1CF47..1CF4F ; Cn # [9] .. 1CFC4..1CFFF ; Cn # [60] .. @@ -650,7 +651,10 @@ FFFE..FFFF ; Cn # [2] .. 1E300..1E4CF ; Cn # [464] .. 1E4FA..1E5CF ; Cn # [214] .. 1E5FB..1E5FE ; Cn # [4] .. -1E600..1E7DF ; Cn # [480] .. +1E600..1E6BF ; Cn # [192] .. +1E6DF ; Cn # +1E6F6..1E6FD ; Cn # [8] .. +1E700..1E7DF ; Cn # [224] .. 1E7E7 ; Cn # 1E7EC ; Cn # 1E7EF ; Cn # @@ -708,10 +712,9 @@ FFFE..FFFF ; Cn # [2] .. 1F249..1F24F ; Cn # [7] .. 1F252..1F25F ; Cn # [14] .. 1F266..1F2FF ; Cn # [154] .. -1F6D8..1F6DB ; Cn # [4] .. +1F6D9..1F6DB ; Cn # [3] .. 1F6ED..1F6EF ; Cn # [3] .. 1F6FD..1F6FF ; Cn # [3] .. -1F777..1F77A ; Cn # [4] .. 1F7DA..1F7DF ; Cn # [6] .. 1F7EC..1F7EF ; Cn # [4] .. 1F7F1..1F7FF ; Cn # [15] .. @@ -721,33 +724,34 @@ FFFE..FFFF ; Cn # [2] .. 1F888..1F88F ; Cn # [8] .. 1F8AE..1F8AF ; Cn # [2] .. 1F8BC..1F8BF ; Cn # [4] .. -1F8C2..1F8FF ; Cn # [62] .. -1FA54..1FA5F ; Cn # [12] .. +1F8C2..1F8CF ; Cn # [14] .. +1F8D9..1F8FF ; Cn # [39] .. +1FA58..1FA5F ; Cn # [8] .. 1FA6E..1FA6F ; Cn # [2] .. 1FA7D..1FA7F ; Cn # [3] .. -1FA8A..1FA8E ; Cn # [5] .. -1FAC7..1FACD ; Cn # [7] .. +1FA8B..1FA8D ; Cn # [3] .. +1FAC7 ; Cn # +1FAC9..1FACC ; Cn # [4] .. 1FADD..1FADE ; Cn # [2] .. -1FAEA..1FAEF ; Cn # [6] .. +1FAEB..1FAEE ; Cn # [4] .. 1FAF9..1FAFF ; Cn # [7] .. 1FB93 ; Cn # -1FBFA..1FFFF ; Cn # [1030] .. +1FBFB..1FFFF ; Cn # [1029] .. 2A6E0..2A6FF ; Cn # [32] .. -2B73A..2B73F ; Cn # [6] .. 2B81E..2B81F ; Cn # [2] .. -2CEA2..2CEAF ; Cn # [14] .. +2CEAE..2CEAF ; Cn # [2] .. 2EBE1..2EBEF ; Cn # [15] .. 2EE5E..2F7FF ; Cn # [2466] .. 2FA1E..2FFFF ; Cn # [1506] .. 3134B..3134F ; Cn # [5] .. -323B0..E0000 ; Cn # [711761] .. +3347A..E0000 ; Cn # [707463] .. E0002..E001F ; Cn # [30] .. E0080..E00FF ; Cn # [128] .. E01F0..EFFFF ; Cn # [65040] .. FFFFE..FFFFF ; Cn # [2] .. 10FFFE..10FFFF; Cn # [2] .. -# Total code points: 819533 +# Total code points: 814730 # ================================================ @@ -1355,7 +1359,10 @@ A7C2 ; Lu # LATIN CAPITAL LETTER ANGLICANA W A7C4..A7C7 ; Lu # [4] LATIN CAPITAL LETTER C WITH PALATAL HOOK..LATIN CAPITAL LETTER D WITH SHORT STROKE OVERLAY A7C9 ; Lu # LATIN CAPITAL LETTER S WITH SHORT STROKE OVERLAY A7CB..A7CC ; Lu # [2] LATIN CAPITAL LETTER RAMS HORN..LATIN CAPITAL LETTER S WITH DIAGONAL STROKE +A7CE ; Lu # LATIN CAPITAL LETTER PHARYNGEAL VOICED FRICATIVE A7D0 ; Lu # LATIN CAPITAL LETTER CLOSED INSULAR G +A7D2 ; Lu # LATIN CAPITAL LETTER DOUBLE THORN +A7D4 ; Lu # LATIN CAPITAL LETTER DOUBLE WYNN A7D6 ; Lu # LATIN CAPITAL LETTER MIDDLE SCOTS S A7D8 ; Lu # LATIN CAPITAL LETTER SIGMOID S A7DA ; Lu # LATIN CAPITAL LETTER LAMBDA @@ -1372,6 +1379,7 @@ FF21..FF3A ; Lu # [26] FULLWIDTH LATIN CAPITAL LETTER A..FULLWIDTH LATIN CAP 10D50..10D65 ; Lu # [22] GARAY CAPITAL LETTER A..GARAY CAPITAL LETTER OLD NA 118A0..118BF ; Lu # [32] WARANG CITI CAPITAL LETTER NGAA..WARANG CITI CAPITAL LETTER VIYO 16E40..16E5F ; Lu # [32] MEDEFAIDRIN CAPITAL LETTER M..MEDEFAIDRIN CAPITAL LETTER Y +16EA0..16EB8 ; Lu # [25] BERIA ERFE CAPITAL LETTER ARKAB..BERIA ERFE CAPITAL LETTER AY 1D400..1D419 ; Lu # [26] MATHEMATICAL BOLD CAPITAL A..MATHEMATICAL BOLD CAPITAL Z 1D434..1D44D ; Lu # [26] MATHEMATICAL ITALIC CAPITAL A..MATHEMATICAL ITALIC CAPITAL Z 1D468..1D481 ; Lu # [26] MATHEMATICAL BOLD ITALIC CAPITAL A..MATHEMATICAL BOLD ITALIC CAPITAL Z @@ -1405,7 +1413,7 @@ FF21..FF3A ; Lu # [26] FULLWIDTH LATIN CAPITAL LETTER A..FULLWIDTH LATIN CAP 1D7CA ; Lu # MATHEMATICAL BOLD CAPITAL DIGAMMA 1E900..1E921 ; Lu # [34] ADLAM CAPITAL LETTER ALIF..ADLAM CAPITAL LETTER SHA -# Total code points: 1858 +# Total code points: 1886 # ================================================ @@ -1556,7 +1564,7 @@ FF21..FF3A ; Lu # [26] FULLWIDTH LATIN CAPITAL LETTER A..FULLWIDTH LATIN CAP 024B ; Ll # LATIN SMALL LETTER Q WITH HOOK TAIL 024D ; Ll # LATIN SMALL LETTER R WITH STROKE 024F..0293 ; Ll # [69] LATIN SMALL LETTER Y WITH STROKE..LATIN SMALL LETTER EZH WITH CURL -0295..02AF ; Ll # [27] LATIN LETTER PHARYNGEAL VOICED FRICATIVE..LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL +0296..02AF ; Ll # [26] LATIN LETTER INVERTED GLOTTAL STOP..LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL 0371 ; Ll # GREEK SMALL LETTER HETA 0373 ; Ll # GREEK SMALL LETTER ARCHAIC SAMPI 0377 ; Ll # GREEK SMALL LETTER PAMPHYLIAN DIGAMMA @@ -2017,6 +2025,7 @@ A7C3 ; Ll # LATIN SMALL LETTER ANGLICANA W A7C8 ; Ll # LATIN SMALL LETTER D WITH SHORT STROKE OVERLAY A7CA ; Ll # LATIN SMALL LETTER S WITH SHORT STROKE OVERLAY A7CD ; Ll # LATIN SMALL LETTER S WITH DIAGONAL STROKE +A7CF ; Ll # LATIN SMALL LETTER PHARYNGEAL VOICED FRICATIVE A7D1 ; Ll # LATIN SMALL LETTER CLOSED INSULAR G A7D3 ; Ll # LATIN SMALL LETTER DOUBLE THORN A7D5 ; Ll # LATIN SMALL LETTER DOUBLE WYNN @@ -2041,6 +2050,7 @@ FF41..FF5A ; Ll # [26] FULLWIDTH LATIN SMALL LETTER A..FULLWIDTH LATIN SMALL 10D70..10D85 ; Ll # [22] GARAY SMALL LETTER A..GARAY SMALL LETTER OLD NA 118C0..118DF ; Ll # [32] WARANG CITI SMALL LETTER NGAA..WARANG CITI SMALL LETTER VIYO 16E60..16E7F ; Ll # [32] MEDEFAIDRIN SMALL LETTER M..MEDEFAIDRIN SMALL LETTER Y +16EBB..16ED3 ; Ll # [25] BERIA ERFE SMALL LETTER ARKAB..BERIA ERFE SMALL LETTER AY 1D41A..1D433 ; Ll # [26] MATHEMATICAL BOLD SMALL A..MATHEMATICAL BOLD SMALL Z 1D44E..1D454 ; Ll # [7] MATHEMATICAL ITALIC SMALL A..MATHEMATICAL ITALIC SMALL G 1D456..1D467 ; Ll # [18] MATHEMATICAL ITALIC SMALL I..MATHEMATICAL ITALIC SMALL Z @@ -2074,7 +2084,7 @@ FF41..FF5A ; Ll # [26] FULLWIDTH LATIN SMALL LETTER A..FULLWIDTH LATIN SMALL 1DF25..1DF2A ; Ll # [6] LATIN SMALL LETTER D WITH MID-HEIGHT LEFT HOOK..LATIN SMALL LETTER T WITH MID-HEIGHT LEFT HOOK 1E922..1E943 ; Ll # [34] ADLAM SMALL LETTER ALIF..ADLAM SMALL LETTER SHA -# Total code points: 2258 +# Total code points: 2283 # ================================================ @@ -2143,7 +2153,7 @@ A69C..A69D ; Lm # [2] MODIFIER LETTER CYRILLIC HARD SIGN..MODIFIER LETTER C A717..A71F ; Lm # [9] MODIFIER LETTER DOT VERTICAL BAR..MODIFIER LETTER LOW INVERTED EXCLAMATION MARK A770 ; Lm # MODIFIER LETTER US A788 ; Lm # MODIFIER LETTER LOW CIRCUMFLEX ACCENT -A7F2..A7F4 ; Lm # [3] MODIFIER LETTER CAPITAL C..MODIFIER LETTER CAPITAL Q +A7F1..A7F4 ; Lm # [4] MODIFIER LETTER CAPITAL S..MODIFIER LETTER CAPITAL Q A7F8..A7F9 ; Lm # [2] MODIFIER LETTER CAPITAL H WITH STROKE..MODIFIER LETTER SMALL LIGATURE OE A9CF ; Lm # JAVANESE PANGRANGKEP A9E6 ; Lm # MYANMAR MODIFIER LETTER SHAN REDUPLICATION @@ -2159,21 +2169,25 @@ FF9E..FF9F ; Lm # [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAK 107B2..107BA ; Lm # [9] MODIFIER LETTER SMALL CAPITAL Y..MODIFIER LETTER SMALL S WITH CURL 10D4E ; Lm # GARAY VOWEL LENGTH MARK 10D6F ; Lm # GARAY REDUPLICATION MARK +10EC5 ; Lm # ARABIC SMALL YEH BARREE WITH TWO DOTS BELOW +11DD9 ; Lm # TOLONG SIKI SIGN SELA 16B40..16B43 ; Lm # [4] PAHAWH HMONG SIGN VOS SEEV..PAHAWH HMONG SIGN IB YAM 16D40..16D42 ; Lm # [3] KIRAT RAI SIGN ANUSVARA..KIRAT RAI SIGN VISARGA 16D6B..16D6C ; Lm # [2] KIRAT RAI SIGN VIRAMA..KIRAT RAI SIGN SAAT 16F93..16F9F ; Lm # [13] MIAO LETTER TONE-2..MIAO LETTER REFORMED TONE-8 16FE0..16FE1 ; Lm # [2] TANGUT ITERATION MARK..NUSHU ITERATION MARK 16FE3 ; Lm # OLD CHINESE ITERATION MARK +16FF2..16FF3 ; Lm # [2] CHINESE SMALL SIMPLIFIED ER..CHINESE SMALL TRADITIONAL ER 1AFF0..1AFF3 ; Lm # [4] KATAKANA LETTER MINNAN TONE-2..KATAKANA LETTER MINNAN TONE-5 1AFF5..1AFFB ; Lm # [7] KATAKANA LETTER MINNAN TONE-7..KATAKANA LETTER MINNAN NASALIZED TONE-5 1AFFD..1AFFE ; Lm # [2] KATAKANA LETTER MINNAN NASALIZED TONE-7..KATAKANA LETTER MINNAN NASALIZED TONE-8 1E030..1E06D ; Lm # [62] MODIFIER LETTER CYRILLIC SMALL A..MODIFIER LETTER CYRILLIC SMALL STRAIGHT U WITH STROKE 1E137..1E13D ; Lm # [7] NYIAKENG PUACHUE HMONG SIGN FOR PERSON..NYIAKENG PUACHUE HMONG SYLLABLE LENGTHENER 1E4EB ; Lm # NAG MUNDARI SIGN OJOD +1E6FF ; Lm # TAI YO XAM LAI 1E94B ; Lm # ADLAM NASALIZATION MARK -# Total code points: 404 +# Total code points: 410 # ================================================ @@ -2183,7 +2197,7 @@ FF9E..FF9F ; Lm # [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAK 00BA ; Lo # MASCULINE ORDINAL INDICATOR 01BB ; Lo # LATIN LETTER TWO WITH STROKE 01C0..01C3 ; Lo # [4] LATIN LETTER DENTAL CLICK..LATIN LETTER RETROFLEX CLICK -0294 ; Lo # LATIN LETTER GLOTTAL STOP +0294..0295 ; Lo # [2] LATIN LETTER GLOTTAL STOP..LATIN LETTER PHARYNGEAL VOICED FRICATIVE 05D0..05EA ; Lo # [27] HEBREW LETTER ALEF..HEBREW LETTER TAV 05EF..05F2 ; Lo # [4] HEBREW YOD TRIANGLE..HEBREW LIGATURE YIDDISH DOUBLE YOD 0620..063F ; Lo # [32] ARABIC LETTER KASHMIRI YEH..ARABIC LETTER FARSI YEH WITH THREE DOTS ABOVE @@ -2203,7 +2217,7 @@ FF9E..FF9F ; Lm # [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAK 0840..0858 ; Lo # [25] MANDAIC LETTER HALQA..MANDAIC LETTER AIN 0860..086A ; Lo # [11] SYRIAC LETTER MALAYALAM NGA..SYRIAC LETTER MALAYALAM SSA 0870..0887 ; Lo # [24] ARABIC LETTER ALEF WITH ATTACHED FATHA..ARABIC BASELINE ROUND DOT -0889..088E ; Lo # [6] ARABIC LETTER NOON WITH INVERTED SMALL V..ARABIC VERTICAL TAIL +0889..088F ; Lo # [7] ARABIC LETTER NOON WITH INVERTED SMALL V..ARABIC LETTER NOON WITH RING ABOVE 08A0..08C8 ; Lo # [41] ARABIC LETTER BEH WITH SMALL V BELOW..ARABIC LETTER GRAF 0904..0939 ; Lo # [54] DEVANAGARI LETTER SHORT A..DEVANAGARI LETTER HA 093D ; Lo # DEVANAGARI SIGN AVAGRAHA @@ -2269,7 +2283,7 @@ FF9E..FF9F ; Lm # [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAK 0C2A..0C39 ; Lo # [16] TELUGU LETTER PA..TELUGU LETTER HA 0C3D ; Lo # TELUGU SIGN AVAGRAHA 0C58..0C5A ; Lo # [3] TELUGU LETTER TSA..TELUGU LETTER RRRA -0C5D ; Lo # TELUGU LETTER NAKAARA POLLU +0C5C..0C5D ; Lo # [2] TELUGU ARCHAIC SHRII..TELUGU LETTER NAKAARA POLLU 0C60..0C61 ; Lo # [2] TELUGU LETTER VOCALIC RR..TELUGU LETTER VOCALIC LL 0C80 ; Lo # KANNADA SIGN SPACING CANDRABINDU 0C85..0C8C ; Lo # [8] KANNADA LETTER A..KANNADA LETTER VOCALIC L @@ -2278,7 +2292,7 @@ FF9E..FF9F ; Lm # [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAK 0CAA..0CB3 ; Lo # [10] KANNADA LETTER PA..KANNADA LETTER LLA 0CB5..0CB9 ; Lo # [5] KANNADA LETTER VA..KANNADA LETTER HA 0CBD ; Lo # KANNADA SIGN AVAGRAHA -0CDD..0CDE ; Lo # [2] KANNADA LETTER NAKAARA POLLU..KANNADA LETTER FA +0CDC..0CDE ; Lo # [3] KANNADA ARCHAIC SHRII..KANNADA LETTER FA 0CE0..0CE1 ; Lo # [2] KANNADA LETTER VOCALIC RR..KANNADA LETTER VOCALIC LL 0CF1..0CF2 ; Lo # [2] KANNADA SIGN JIHVAMULIYA..KANNADA SIGN UPADHMANIYA 0D04..0D0C ; Lo # [9] MALAYALAM LETTER VEDIC ANUSVARA..MALAYALAM LETTER VOCALIC L @@ -2504,6 +2518,7 @@ FFDA..FFDC ; Lo # [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL LETTER I 108F4..108F5 ; Lo # [2] HATRAN LETTER SHIN..HATRAN LETTER TAW 10900..10915 ; Lo # [22] PHOENICIAN LETTER ALF..PHOENICIAN LETTER TAU 10920..10939 ; Lo # [26] LYDIAN LETTER A..LYDIAN LETTER C +10940..10959 ; Lo # [26] SIDETIC LETTER N01..SIDETIC LETTER N26 10980..109B7 ; Lo # [56] MEROITIC HIEROGLYPHIC LETTER A..MEROITIC CURSIVE LETTER DA 109BE..109BF ; Lo # [2] MEROITIC CURSIVE LOGOGRAM RMT..MEROITIC CURSIVE LOGOGRAM IMN 10A00 ; Lo # KHAROSHTHI LETTER A @@ -2525,6 +2540,7 @@ FFDA..FFDC ; Lo # [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL LETTER I 10E80..10EA9 ; Lo # [42] YEZIDI LETTER ELIF..YEZIDI LETTER ET 10EB0..10EB1 ; Lo # [2] YEZIDI LETTER LAM WITH DOT ABOVE..YEZIDI LETTER YOT WITH CIRCUMFLEX ABOVE 10EC2..10EC4 ; Lo # [3] ARABIC LETTER DAL WITH TWO DOTS VERTICALLY BELOW..ARABIC LETTER KAF WITH TWO DOTS VERTICALLY BELOW +10EC6..10EC7 ; Lo # [2] ARABIC LETTER THIN NOON..ARABIC LETTER YEH WITH FOUR DOTS BELOW 10F00..10F1C ; Lo # [29] OLD SOGDIAN LETTER ALEPH..OLD SOGDIAN LETTER FINAL TAW WITH VERTICAL TAIL 10F27 ; Lo # OLD SOGDIAN LIGATURE AYIN-DALETH 10F30..10F45 ; Lo # [22] SOGDIAN LETTER ALEPH..SOGDIAN INDEPENDENT SHIN @@ -2616,6 +2632,8 @@ FFDA..FFDC ; Lo # [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL LETTER I 11D67..11D68 ; Lo # [2] GUNJALA GONDI LETTER EE..GUNJALA GONDI LETTER AI 11D6A..11D89 ; Lo # [32] GUNJALA GONDI LETTER OO..GUNJALA GONDI LETTER SA 11D98 ; Lo # GUNJALA GONDI OM +11DB0..11DD8 ; Lo # [41] TOLONG SIKI LETTER I..TOLONG SIKI LETTER RRH +11DDA..11DDB ; Lo # [2] TOLONG SIKI SIGN HECAKA..TOLONG SIKI UNGGA 11EE0..11EF2 ; Lo # [19] MAKASAR LETTER KA..MAKASAR ANGKA 11F02 ; Lo # KAWI SIGN REPHA 11F04..11F10 ; Lo # [13] KAWI LETTER A..KAWI LETTER O @@ -2639,9 +2657,9 @@ FFDA..FFDC ; Lo # [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL LETTER I 16D43..16D6A ; Lo # [40] KIRAT RAI LETTER A..KIRAT RAI VOWEL SIGN AU 16F00..16F4A ; Lo # [75] MIAO LETTER PA..MIAO LETTER RTE 16F50 ; Lo # MIAO LETTER NASALIZATION -17000..187F7 ; Lo # [6136] TANGUT IDEOGRAPH-17000..TANGUT IDEOGRAPH-187F7 -18800..18CD5 ; Lo # [1238] TANGUT COMPONENT-001..KHITAN SMALL SCRIPT CHARACTER-18CD5 -18CFF..18D08 ; Lo # [10] KHITAN SMALL SCRIPT CHARACTER-18CFF..TANGUT IDEOGRAPH-18D08 +17000..18CD5 ; Lo # [7382] TANGUT IDEOGRAPH-17000..KHITAN SMALL SCRIPT CHARACTER-18CD5 +18CFF..18D1E ; Lo # [32] KHITAN SMALL SCRIPT CHARACTER-18CFF..TANGUT IDEOGRAPH-18D1E +18D80..18DF2 ; Lo # [115] TANGUT COMPONENT-769..TANGUT COMPONENT-883 1B000..1B122 ; Lo # [291] KATAKANA LETTER ARCHAIC E..KATAKANA LETTER ARCHAIC WU 1B132 ; Lo # HIRAGANA LETTER SMALL KO 1B150..1B152 ; Lo # [3] HIRAGANA LETTER SMALL WI..HIRAGANA LETTER SMALL WO @@ -2660,6 +2678,12 @@ FFDA..FFDC ; Lo # [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL LETTER I 1E4D0..1E4EA ; Lo # [27] NAG MUNDARI LETTER O..NAG MUNDARI LETTER ELL 1E5D0..1E5ED ; Lo # [30] OL ONAL LETTER O..OL ONAL LETTER EG 1E5F0 ; Lo # OL ONAL SIGN HODDOND +1E6C0..1E6DE ; Lo # [31] TAI YO LETTER LOW KO..TAI YO LETTER HIGH KVO +1E6E0..1E6E2 ; Lo # [3] TAI YO LETTER AA..TAI YO LETTER UE +1E6E4..1E6E5 ; Lo # [2] TAI YO LETTER U..TAI YO LETTER AE +1E6E7..1E6ED ; Lo # [7] TAI YO LETTER O..TAI YO LETTER AUE +1E6F0..1E6F4 ; Lo # [5] TAI YO LETTER AN..TAI YO LETTER AP +1E6FE ; Lo # TAI YO SYMBOL MUEANG 1E7E0..1E7E6 ; Lo # [7] ETHIOPIC SYLLABLE HHYA..ETHIOPIC SYLLABLE HHYO 1E7E8..1E7EB ; Lo # [4] ETHIOPIC SYLLABLE GURAGE HHWA..ETHIOPIC SYLLABLE HHWE 1E7ED..1E7EE ; Lo # [2] ETHIOPIC SYLLABLE GURAGE MWI..ETHIOPIC SYLLABLE GURAGE MWEE @@ -2699,16 +2723,15 @@ FFDA..FFDC ; Lo # [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL LETTER I 1EEA5..1EEA9 ; Lo # [5] ARABIC MATHEMATICAL DOUBLE-STRUCK WAW..ARABIC MATHEMATICAL DOUBLE-STRUCK YEH 1EEAB..1EEBB ; Lo # [17] ARABIC MATHEMATICAL DOUBLE-STRUCK LAM..ARABIC MATHEMATICAL DOUBLE-STRUCK GHAIN 20000..2A6DF ; Lo # [42720] CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6DF -2A700..2B739 ; Lo # [4154] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B739 -2B740..2B81D ; Lo # [222] CJK UNIFIED IDEOGRAPH-2B740..CJK UNIFIED IDEOGRAPH-2B81D -2B820..2CEA1 ; Lo # [5762] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEA1 +2A700..2B81D ; Lo # [4382] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B81D +2B820..2CEAD ; Lo # [5774] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEAD 2CEB0..2EBE0 ; Lo # [7473] CJK UNIFIED IDEOGRAPH-2CEB0..CJK UNIFIED IDEOGRAPH-2EBE0 2EBF0..2EE5D ; Lo # [622] CJK UNIFIED IDEOGRAPH-2EBF0..CJK UNIFIED IDEOGRAPH-2EE5D 2F800..2FA1D ; Lo # [542] CJK COMPATIBILITY IDEOGRAPH-2F800..CJK COMPATIBILITY IDEOGRAPH-2FA1D 30000..3134A ; Lo # [4939] CJK UNIFIED IDEOGRAPH-30000..CJK UNIFIED IDEOGRAPH-3134A -31350..323AF ; Lo # [4192] CJK UNIFIED IDEOGRAPH-31350..CJK UNIFIED IDEOGRAPH-323AF +31350..33479 ; Lo # [8490] CJK UNIFIED IDEOGRAPH-31350..CJK UNIFIED IDEOGRAPH-33479 -# Total code points: 136477 +# Total code points: 141062 # ================================================ @@ -2856,7 +2879,8 @@ FFDA..FFDC ; Lo # [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL LETTER I 1A73..1A7C ; Mn # [10] TAI THAM VOWEL SIGN OA ABOVE..TAI THAM SIGN KHUEN-LUE KARAN 1A7F ; Mn # TAI THAM COMBINING CRYPTOGRAMMIC DOT 1AB0..1ABD ; Mn # [14] COMBINING DOUBLED CIRCUMFLEX ACCENT..COMBINING PARENTHESES BELOW -1ABF..1ACE ; Mn # [16] COMBINING LATIN SMALL LETTER W BELOW..COMBINING LATIN SMALL LETTER INSULAR T +1ABF..1ADD ; Mn # [31] COMBINING LATIN SMALL LETTER W BELOW..COMBINING DOT-AND-RING BELOW +1AE0..1AEB ; Mn # [12] COMBINING LEFT TACK ABOVE..COMBINING DOUBLE RIGHTWARDS ARROW ABOVE 1B00..1B03 ; Mn # [4] BALINESE SIGN ULU RICEM..BALINESE SIGN SURANG 1B34 ; Mn # BALINESE SIGN REREKAN 1B36..1B3A ; Mn # [5] BALINESE VOWEL SIGN ULU..BALINESE VOWEL SIGN RA REPA @@ -2938,7 +2962,7 @@ FE20..FE2F ; Mn # [16] COMBINING LIGATURE LEFT HALF..COMBINING CYRILLIC TITL 10D24..10D27 ; Mn # [4] HANIFI ROHINGYA SIGN HARBAHAY..HANIFI ROHINGYA SIGN TASSI 10D69..10D6D ; Mn # [5] GARAY VOWEL SIGN E..GARAY CONSONANT NASALIZATION MARK 10EAB..10EAC ; Mn # [2] YEZIDI COMBINING HAMZA MARK..YEZIDI COMBINING MADDA MARK -10EFC..10EFF ; Mn # [4] ARABIC COMBINING ALEF OVERLAY..ARABIC SMALL LOW WORD MADDA +10EFA..10EFF ; Mn # [6] ARABIC DOUBLE VERTICAL BAR BELOW..ARABIC SMALL LOW WORD MADDA 10F46..10F50 ; Mn # [11] SOGDIAN COMBINING DOT BELOW..SOGDIAN COMBINING STROKE BELOW 10F82..10F85 ; Mn # [4] OLD UYGHUR COMBINING DOT ABOVE..OLD UYGHUR COMBINING TWO DOTS BELOW 11001 ; Mn # BRAHMI SIGN ANUSVARA @@ -3013,6 +3037,9 @@ FE20..FE2F ; Mn # [16] COMBINING LIGATURE LEFT HALF..COMBINING CYRILLIC TITL 11A59..11A5B ; Mn # [3] SOYOMBO VOWEL SIGN VOCALIC R..SOYOMBO VOWEL LENGTH MARK 11A8A..11A96 ; Mn # [13] SOYOMBO FINAL CONSONANT SIGN G..SOYOMBO SIGN ANUSVARA 11A98..11A99 ; Mn # [2] SOYOMBO GEMINATION MARK..SOYOMBO SUBJOINER +11B60 ; Mn # SHARADA VOWEL SIGN OE +11B62..11B64 ; Mn # [3] SHARADA VOWEL SIGN UE..SHARADA VOWEL SIGN SHORT E +11B66 ; Mn # SHARADA VOWEL SIGN CANDRA E 11C30..11C36 ; Mn # [7] BHAIKSUKI VOWEL SIGN I..BHAIKSUKI VOWEL SIGN VOCALIC L 11C38..11C3D ; Mn # [6] BHAIKSUKI VOWEL SIGN E..BHAIKSUKI SIGN ANUSVARA 11C3F ; Mn # BHAIKSUKI SIGN VIRAMA @@ -3068,11 +3095,15 @@ FE20..FE2F ; Mn # [16] COMBINING LIGATURE LEFT HALF..COMBINING CYRILLIC TITL 1E2EC..1E2EF ; Mn # [4] WANCHO TONE TUP..WANCHO TONE KOINI 1E4EC..1E4EF ; Mn # [4] NAG MUNDARI SIGN MUHOR..NAG MUNDARI SIGN SUTUH 1E5EE..1E5EF ; Mn # [2] OL ONAL SIGN MU..OL ONAL SIGN IKIR +1E6E3 ; Mn # TAI YO SIGN UE +1E6E6 ; Mn # TAI YO SIGN AU +1E6EE..1E6EF ; Mn # [2] TAI YO SIGN AY..TAI YO SIGN ANG +1E6F5 ; Mn # TAI YO SIGN OM 1E8D0..1E8D6 ; Mn # [7] MENDE KIKAKUI COMBINING NUMBER TEENS..MENDE KIKAKUI COMBINING NUMBER MILLIONS 1E944..1E94A ; Mn # [7] ADLAM ALIF LENGTHENER..ADLAM NUKTA E0100..E01EF ; Mn # [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256 -# Total code points: 2020 +# Total code points: 2059 # ================================================ @@ -3262,6 +3293,9 @@ ABEC ; Mc # MEETEI MAYEK LUM IYEK 11A39 ; Mc # ZANABAZAR SQUARE SIGN VISARGA 11A57..11A58 ; Mc # [2] SOYOMBO VOWEL SIGN AI..SOYOMBO VOWEL SIGN AU 11A97 ; Mc # SOYOMBO SIGN VISARGA +11B61 ; Mc # SHARADA VOWEL SIGN OOE +11B65 ; Mc # SHARADA VOWEL SIGN SHORT O +11B67 ; Mc # SHARADA VOWEL SIGN CANDRA O 11C2F ; Mc # BHAIKSUKI VOWEL SIGN AA 11C3E ; Mc # BHAIKSUKI SIGN VISARGA 11CA9 ; Mc # MARCHEN SUBJOINED LETTER YA @@ -3281,7 +3315,7 @@ ABEC ; Mc # MEETEI MAYEK LUM IYEK 1D165..1D166 ; Mc # [2] MUSICAL SYMBOL COMBINING STEM..MUSICAL SYMBOL COMBINING SPRECHGESANG STEM 1D16D..1D172 ; Mc # [6] MUSICAL SYMBOL COMBINING AUGMENTATION DOT..MUSICAL SYMBOL COMBINING FLAG-5 -# Total code points: 468 +# Total code points: 471 # ================================================ @@ -3344,6 +3378,7 @@ FF10..FF19 ; Nd # [10] FULLWIDTH DIGIT ZERO..FULLWIDTH DIGIT NINE 11C50..11C59 ; Nd # [10] BHAIKSUKI DIGIT ZERO..BHAIKSUKI DIGIT NINE 11D50..11D59 ; Nd # [10] MASARAM GONDI DIGIT ZERO..MASARAM GONDI DIGIT NINE 11DA0..11DA9 ; Nd # [10] GUNJALA GONDI DIGIT ZERO..GUNJALA GONDI DIGIT NINE +11DE0..11DE9 ; Nd # [10] TOLONG SIKI DIGIT ZERO..TOLONG SIKI DIGIT NINE 11F50..11F59 ; Nd # [10] KAWI DIGIT ZERO..KAWI DIGIT NINE 16130..16139 ; Nd # [10] GURUNG KHEMA DIGIT ZERO..GURUNG KHEMA DIGIT NINE 16A60..16A69 ; Nd # [10] MRO DIGIT ZERO..MRO DIGIT NINE @@ -3359,7 +3394,7 @@ FF10..FF19 ; Nd # [10] FULLWIDTH DIGIT ZERO..FULLWIDTH DIGIT NINE 1E950..1E959 ; Nd # [10] ADLAM DIGIT ZERO..ADLAM DIGIT NINE 1FBF0..1FBF9 ; Nd # [10] SEGMENTED DIGIT ZERO..SEGMENTED DIGIT NINE -# Total code points: 760 +# Total code points: 770 # ================================================ @@ -3377,8 +3412,9 @@ A6E6..A6EF ; Nl # [10] BAMUM LETTER MO..BAMUM LETTER KOGHOM 1034A ; Nl # GOTHIC LETTER NINE HUNDRED 103D1..103D5 ; Nl # [5] OLD PERSIAN NUMBER ONE..OLD PERSIAN NUMBER HUNDRED 12400..1246E ; Nl # [111] CUNEIFORM NUMERIC SIGN TWO ASH..CUNEIFORM NUMERIC SIGN NINE U VARIANT FORM +16FF4..16FF6 ; Nl # [3] YANGQIN SIGN SLOW ONE BEAT..YANGQIN SIGN SLOW TWO BEATS -# Total code points: 236 +# Total code points: 239 # ================================================ @@ -3900,6 +3936,7 @@ FF64..FF65 ; Po # [2] HALFWIDTH IDEOGRAPHIC COMMA..HALFWIDTH KATAKANA MIDDL 10AF0..10AF6 ; Po # [7] MANICHAEAN PUNCTUATION STAR..MANICHAEAN PUNCTUATION LINE FILLER 10B39..10B3F ; Po # [7] AVESTAN ABBREVIATION MARK..LARGE ONE RING OVER TWO RINGS PUNCTUATION 10B99..10B9C ; Po # [4] PSALTER PAHLAVI SECTION MARK..PSALTER PAHLAVI FOUR DOTS WITH DOT +10ED0 ; Po # ARABIC BIBLICAL END OF VERSE 10F55..10F59 ; Po # [5] SOGDIAN PUNCTUATION TWO VERTICAL BARS..SOGDIAN PUNCTUATION HALF CIRCLE WITH DOT 10F86..10F89 ; Po # [4] OLD UYGHUR PUNCTUATION BAR..OLD UYGHUR PUNCTUATION FOUR DOTS 11047..1104D ; Po # [7] BRAHMI DANDA..BRAHMI PUNCTUATION LOTUS @@ -3951,7 +3988,7 @@ FF64..FF65 ; Po # [2] HALFWIDTH IDEOGRAPHIC COMMA..HALFWIDTH KATAKANA MIDDL 1E5FF ; Po # OL ONAL ABBREVIATION SIGN 1E95E..1E95F ; Po # [2] ADLAM INITIAL EXCLAMATION MARK..ADLAM INITIAL QUESTION MARK -# Total code points: 640 +# Total code points: 641 # ================================================ @@ -4011,6 +4048,7 @@ FF5E ; Sm # FULLWIDTH TILDE FFE2 ; Sm # FULLWIDTH NOT SIGN FFE9..FFEC ; Sm # [4] HALFWIDTH LEFTWARDS ARROW..HALFWIDTH DOWNWARDS ARROW 10D8E..10D8F ; Sm # [2] GARAY PLUS SIGN..GARAY MINUS SIGN +1CEF0 ; Sm # MEDIUM SMALL WHITE CIRCLE WITH HORIZONTAL BAR 1D6C1 ; Sm # MATHEMATICAL BOLD NABLA 1D6DB ; Sm # MATHEMATICAL BOLD PARTIAL DIFFERENTIAL 1D6FB ; Sm # MATHEMATICAL ITALIC NABLA @@ -4022,8 +4060,9 @@ FFE9..FFEC ; Sm # [4] HALFWIDTH LEFTWARDS ARROW..HALFWIDTH DOWNWARDS ARROW 1D7A9 ; Sm # MATHEMATICAL SANS-SERIF BOLD ITALIC NABLA 1D7C3 ; Sm # MATHEMATICAL SANS-SERIF BOLD ITALIC PARTIAL DIFFERENTIAL 1EEF0..1EEF1 ; Sm # [2] ARABIC MATHEMATICAL OPERATOR MEEM WITH HAH WITH TATWEEL..ARABIC MATHEMATICAL OPERATOR HAH WITH DAL +1F8D0..1F8D8 ; Sm # [9] LONG RIGHTWARDS ARROW OVER LONG LEFTWARDS ARROW..LONG LEFT RIGHT ARROW WITH DEPENDENT LOBE -# Total code points: 950 +# Total code points: 960 # ================================================ @@ -4040,7 +4079,7 @@ FFE9..FFEC ; Sm # [4] HALFWIDTH LEFTWARDS ARROW..HALFWIDTH DOWNWARDS ARROW 0BF9 ; Sc # TAMIL RUPEE SIGN 0E3F ; Sc # THAI CURRENCY SYMBOL BAHT 17DB ; Sc # KHMER CURRENCY SYMBOL RIEL -20A0..20C0 ; Sc # [33] EURO-CURRENCY SIGN..SOM SIGN +20A0..20C1 ; Sc # [34] EURO-CURRENCY SIGN..SAUDI RIYAL SIGN A838 ; Sc # NORTH INDIC RUPEE MARK FDFC ; Sc # RIAL SIGN FE69 ; Sc # SMALL DOLLAR SIGN @@ -4051,7 +4090,7 @@ FFE5..FFE6 ; Sc # [2] FULLWIDTH YEN SIGN..FULLWIDTH WON SIGN 1E2FF ; Sc # WANCHO NGUN SIGN 1ECB0 ; Sc # INDIC SIYAQ RUPEE MARK -# Total code points: 63 +# Total code points: 64 # ================================================ @@ -4174,8 +4213,7 @@ FFE3 ; Sk # FULLWIDTH MACRON 2B00..2B2F ; So # [48] NORTH EAST WHITE ARROW..WHITE VERTICAL ELLIPSE 2B45..2B46 ; So # [2] LEFTWARDS QUADRUPLE ARROW..RIGHTWARDS QUADRUPLE ARROW 2B4D..2B73 ; So # [39] DOWNWARDS TRIANGLE-HEADED ZIGZAG ARROW..DOWNWARDS TRIANGLE-HEADED ARROW TO BAR -2B76..2B95 ; So # [32] NORTH WEST TRIANGLE-HEADED ARROW TO BAR..RIGHTWARDS BLACK ARROW -2B97..2BFF ; So # [105] SYMBOL FOR TYPE A ELECTRONICS..HELLSCHREIBER PAUSE SYMBOL +2B76..2BFF ; So # [138] NORTH WEST TRIANGLE-HEADED ARROW TO BAR..HELLSCHREIBER PAUSE SYMBOL 2CE5..2CEA ; So # [6] COPTIC SYMBOL MI RO..COPTIC SYMBOL SHIMA SIMA 2E50..2E51 ; So # [2] CROSS PATTY WITH RIGHT CROSSBAR..CROSS PATTY WITH LEFT CROSSBAR 2E80..2E99 ; So # [26] CJK RADICAL REPEAT..CJK RADICAL RAP @@ -4203,8 +4241,10 @@ A828..A82B ; So # [4] SYLOTI NAGRI POETRY MARK-1..SYLOTI NAGRI POETRY MARK- A836..A837 ; So # [2] NORTH INDIC QUARTER MARK..NORTH INDIC PLACEHOLDER MARK A839 ; So # NORTH INDIC QUANTITY MARK AA77..AA79 ; So # [3] MYANMAR SYMBOL AITON EXCLAMATION..MYANMAR SYMBOL AITON TWO +FBC3..FBD2 ; So # [16] ARABIC LIGATURE JALLA WA-ALAA..ARABIC LIGATURE ALAYHI AR-RAHMAH FD40..FD4F ; So # [16] ARABIC LIGATURE RAHIMAHU ALLAAH..ARABIC LIGATURE RAHIMAHUM ALLAAH -FDCF ; So # ARABIC LIGATURE SALAAMUHU ALAYNAA +FD90..FD91 ; So # [2] ARABIC LIGATURE RAHMATU ALLAAHI ALAYH..ARABIC LIGATURE RAHMATU ALLAAHI ALAYHAA +FDC8..FDCF ; So # [8] ARABIC LIGATURE RAHIMAHU ALLAAH TAAALAA..ARABIC LIGATURE SALAAMUHU ALAYNAA FDFD..FDFF ; So # [3] ARABIC LIGATURE BISMILLAH AR-RAHMAN AR-RAHEEM..ARABIC LIGATURE AZZA WA JALL FFE4 ; So # FULLWIDTH BROKEN BAR FFE8 ; So # HALFWIDTH FORMS LIGHT VERTICAL @@ -4218,6 +4258,7 @@ FFFC..FFFD ; So # [2] OBJECT REPLACEMENT CHARACTER..REPLACEMENT CHARACTER 101D0..101FC ; So # [45] PHAISTOS DISC SIGN PEDESTRIAN..PHAISTOS DISC SIGN WAVY BAND 10877..10878 ; So # [2] PALMYRENE LEFT-POINTING FLEURON..PALMYRENE RIGHT-POINTING FLEURON 10AC8 ; So # MANICHAEAN SIGN UD +10ED1..10ED8 ; So # [8] ARABIC LIGATURE ALAYHAA AS-SALAATU WAS-SALAAM..ARABIC LIGATURE NAWWARA ALLAAHU MARQADAH 1173F ; So # AHOM SYMBOL VI 11FD5..11FDC ; So # [8] TAMIL SIGN NEL..TAMIL SIGN MUKKURUNI 11FE1..11FF1 ; So # [17] TAMIL SIGN PAARAM..TAMIL SIGN VAKAIYARAA @@ -4225,7 +4266,10 @@ FFFC..FFFD ; So # [2] OBJECT REPLACEMENT CHARACTER..REPLACEMENT CHARACTER 16B45 ; So # PAHAWH HMONG SIGN CIM TSOV ROG 1BC9C ; So # DUPLOYAN SIGN O WITH CROSS 1CC00..1CCEF ; So # [240] UP-POINTING GO-KART..OUTLINED LATIN CAPITAL LETTER Z +1CCFA..1CCFC ; So # [3] SNAKE SYMBOL..NOSE SYMBOL 1CD00..1CEB3 ; So # [436] BLOCK OCTANT-3..BLACK RIGHT TRIANGLE CARET +1CEBA..1CED0 ; So # [23] FRAGILE SYMBOL..LEUKOTHEA +1CEE0..1CEEF ; So # [16] GEOMANTIC FIGURE POPULUS..GEOMANTIC FIGURE VIA 1CF50..1CFC3 ; So # [116] ZNAMENNY NEUME KRYUK..ZNAMENNY NEUME PAUK 1D000..1D0F5 ; So # [246] BYZANTINE MUSICAL SYMBOL PSILI..BYZANTINE MUSICAL SYMBOL GORGON NEO KATO 1D100..1D126 ; So # [39] MUSICAL SYMBOL SINGLE BARLINE..MUSICAL SYMBOL DRUM CLEF-2 @@ -4258,11 +4302,10 @@ FFFC..FFFD ; So # [2] OBJECT REPLACEMENT CHARACTER..REPLACEMENT CHARACTER 1F250..1F251 ; So # [2] CIRCLED IDEOGRAPH ADVANTAGE..CIRCLED IDEOGRAPH ACCEPT 1F260..1F265 ; So # [6] ROUNDED SYMBOL FOR FU..ROUNDED SYMBOL FOR CAI 1F300..1F3FA ; So # [251] CYCLONE..AMPHORA -1F400..1F6D7 ; So # [728] RAT..ELEVATOR +1F400..1F6D8 ; So # [729] RAT..LANDSLIDE 1F6DC..1F6EC ; So # [17] WIRELESS..AIRPLANE ARRIVING 1F6F0..1F6FC ; So # [13] SATELLITE..ROLLER SKATE -1F700..1F776 ; So # [119] ALCHEMICAL SYMBOL FOR QUINTESSENCE..LUNAR ECLIPSE -1F77B..1F7D9 ; So # [95] HAUMEA..NINE POINTED WHITE STAR +1F700..1F7D9 ; So # [218] ALCHEMICAL SYMBOL FOR QUINTESSENCE..NINE POINTED WHITE STAR 1F7E0..1F7EB ; So # [12] LARGE ORANGE CIRCLE..LARGE BROWN SQUARE 1F7F0 ; So # HEAVY EQUALS SIGN 1F800..1F80B ; So # [12] LEFTWARDS ARROW WITH SMALL TRIANGLE ARROWHEAD..DOWNWARDS ARROW WITH LARGE TRIANGLE ARROWHEAD @@ -4272,18 +4315,20 @@ FFFC..FFFD ; So # [2] OBJECT REPLACEMENT CHARACTER..REPLACEMENT CHARACTER 1F890..1F8AD ; So # [30] LEFTWARDS TRIANGLE ARROWHEAD..WHITE ARROW SHAFT WIDTH TWO THIRDS 1F8B0..1F8BB ; So # [12] ARROW POINTING UPWARDS THEN NORTH WEST..SOUTH WEST ARROW FROM BAR 1F8C0..1F8C1 ; So # [2] LEFTWARDS ARROW FROM DOWNWARDS ARROW..RIGHTWARDS ARROW FROM DOWNWARDS ARROW -1F900..1FA53 ; So # [340] CIRCLED CROSS FORMEE WITH FOUR DOTS..BLACK CHESS KNIGHT-BISHOP +1F900..1FA57 ; So # [344] CIRCLED CROSS FORMEE WITH FOUR DOTS..BLACK CHESS ALFIL 1FA60..1FA6D ; So # [14] XIANGQI RED GENERAL..XIANGQI BLACK SOLDIER 1FA70..1FA7C ; So # [13] BALLET SHOES..CRUTCH -1FA80..1FA89 ; So # [10] YO-YO..HARP -1FA8F..1FAC6 ; So # [56] SHOVEL..FINGERPRINT -1FACE..1FADC ; So # [15] MOOSE..ROOT VEGETABLE -1FADF..1FAE9 ; So # [11] SPLATTER..FACE WITH BAGS UNDER EYES -1FAF0..1FAF8 ; So # [9] HAND WITH INDEX FINGER AND THUMB CROSSED..RIGHTWARDS PUSHING HAND +1FA80..1FA8A ; So # [11] YO-YO..TROMBONE +1FA8E..1FAC6 ; So # [57] TREASURE CHEST..FINGERPRINT +1FAC8 ; So # HAIRY CREATURE +1FACD..1FADC ; So # [16] ORCA..ROOT VEGETABLE +1FADF..1FAEA ; So # [12] SPLATTER..DISTORTED FACE +1FAEF..1FAF8 ; So # [10] FIGHT CLOUD..RIGHTWARDS PUSHING HAND 1FB00..1FB92 ; So # [147] BLOCK SEXTANT-1..UPPER HALF INVERSE MEDIUM SHADE AND LOWER HALF BLOCK 1FB94..1FBEF ; So # [92] LEFT HALF INVERSE MEDIUM SHADE AND RIGHT HALF BLOCK..TOP LEFT JUSTIFIED LOWER RIGHT QUARTER BLACK CIRCLE +1FBFA ; So # ALARM BELL SYMBOL -# Total code points: 7376 +# Total code points: 7468 # ================================================ diff --git a/contrib/unicode/DerivedNormalizationProps.txt b/contrib/unicode/DerivedNormalizationProps.txt index ce636abb537a..448ba69d6399 100644 --- a/contrib/unicode/DerivedNormalizationProps.txt +++ b/contrib/unicode/DerivedNormalizationProps.txt @@ -1,6 +1,6 @@ -# DerivedNormalizationProps-16.0.0.txt -# Date: 2024-04-30, 21:48:18 GMT -# © 2024 Unicode®, Inc. +# DerivedNormalizationProps-17.0.0.txt +# Date: 2025-01-27, 18:09:14 GMT +# © 2025 Unicode®, Inc. # Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries. # For terms of use and license, see https://www.unicode.org/terms_of_use.html # @@ -132,6 +132,7 @@ 33DD ; FC_NFKC; 0077 0062 # So SQUARE WB 33DE ; FC_NFKC; 0076 2215 006D # So SQUARE V OVER M 33DF ; FC_NFKC; 0061 2215 006D # So SQUARE A OVER M +A7F1 ; FC_NFKC; 0073 # Lm MODIFIER LETTER CAPITAL S A7F2 ; FC_NFKC; 0063 # Lm MODIFIER LETTER CAPITAL C A7F3 ; FC_NFKC; 0066 # Lm MODIFIER LETTER CAPITAL F A7F4 ; FC_NFKC; 0071 # Lm MODIFIER LETTER CAPITAL Q @@ -679,7 +680,7 @@ A7F8 ; FC_NFKC; 0127 # Lm MODIFIER LETTER CAPITAL H WITH STROKE 1F16C ; FC_NFKC; 006D 0072 # So RAISED MR SIGN 1F190 ; FC_NFKC; 0064 006A # So SQUARE DJ -# Total code points: 663 +# Total code points: 664 # ================================================ @@ -1515,7 +1516,7 @@ FB46..FB4E ; NFC_QC; N # Lo [9] HEBREW LETTER TSADI WITH DAGESH..HEBREW LET 32C0..33FF ; NFKD_QC; N # So [320] IDEOGRAPHIC TELEGRAPH SYMBOL FOR JANUARY..SQUARE GAL A69C..A69D ; NFKD_QC; N # Lm [2] MODIFIER LETTER CYRILLIC HARD SIGN..MODIFIER LETTER CYRILLIC SOFT SIGN A770 ; NFKD_QC; N # Lm MODIFIER LETTER US -A7F2..A7F4 ; NFKD_QC; N # Lm [3] MODIFIER LETTER CAPITAL C..MODIFIER LETTER CAPITAL Q +A7F1..A7F4 ; NFKD_QC; N # Lm [4] MODIFIER LETTER CAPITAL S..MODIFIER LETTER CAPITAL Q A7F8..A7F9 ; NFKD_QC; N # Lm [2] MODIFIER LETTER CAPITAL H WITH STROKE..MODIFIER LETTER SMALL LIGATURE OE AB5C..AB5F ; NFKD_QC; N # Lm [4] MODIFIER LETTER SMALL HENG..MODIFIER LETTER SMALL U WITH LEFT HOOK AB69 ; NFKD_QC; N # Lm MODIFIER LETTER SMALL TURNED W @@ -1753,7 +1754,7 @@ FFED..FFEE ; NFKD_QC; N # So [2] HALFWIDTH BLACK SQUARE..HALFWIDTH WHITE CI 1FBF0..1FBF9 ; NFKD_QC; N # Nd [10] SEGMENTED DIGIT ZERO..SEGMENTED DIGIT NINE 2F800..2FA1D ; NFKD_QC; N # Lo [542] CJK COMPATIBILITY IDEOGRAPH-2F800..CJK COMPATIBILITY IDEOGRAPH-2FA1D -# Total code points: 17085 +# Total code points: 17086 # ================================================ @@ -1946,7 +1947,7 @@ FFED..FFEE ; NFKD_QC; N # So [2] HALFWIDTH BLACK SQUARE..HALFWIDTH WHITE CI 32C0..33FF ; NFKC_QC; N # So [320] IDEOGRAPHIC TELEGRAPH SYMBOL FOR JANUARY..SQUARE GAL A69C..A69D ; NFKC_QC; N # Lm [2] MODIFIER LETTER CYRILLIC HARD SIGN..MODIFIER LETTER CYRILLIC SOFT SIGN A770 ; NFKC_QC; N # Lm MODIFIER LETTER US -A7F2..A7F4 ; NFKC_QC; N # Lm [3] MODIFIER LETTER CAPITAL C..MODIFIER LETTER CAPITAL Q +A7F1..A7F4 ; NFKC_QC; N # Lm [4] MODIFIER LETTER CAPITAL S..MODIFIER LETTER CAPITAL Q A7F8..A7F9 ; NFKC_QC; N # Lm [2] MODIFIER LETTER CAPITAL H WITH STROKE..MODIFIER LETTER SMALL LIGATURE OE AB5C..AB5F ; NFKC_QC; N # Lm [4] MODIFIER LETTER SMALL HENG..MODIFIER LETTER SMALL U WITH LEFT HOOK AB69 ; NFKC_QC; N # Lm MODIFIER LETTER SMALL TURNED W @@ -2164,7 +2165,7 @@ FFED..FFEE ; NFKC_QC; N # So [2] HALFWIDTH BLACK SQUARE..HALFWIDTH WHITE CI 1FBF0..1FBF9 ; NFKC_QC; N # Nd [10] SEGMENTED DIGIT ZERO..SEGMENTED DIGIT NINE 2F800..2FA1D ; NFKC_QC; N # Lo [542] CJK COMPATIBILITY IDEOGRAPH-2F800..CJK COMPATIBILITY IDEOGRAPH-2FA1D -# Total code points: 4964 +# Total code points: 4965 # ================================================ @@ -5448,11 +5449,15 @@ A7C7 ; NFKC_CF; A7C8 # L& LATIN CAPITAL LETTER D WITH S A7C9 ; NFKC_CF; A7CA # L& LATIN CAPITAL LETTER S WITH SHORT STROKE OVERLAY A7CB ; NFKC_CF; 0264 # L& LATIN CAPITAL LETTER RAMS HORN A7CC ; NFKC_CF; A7CD # L& LATIN CAPITAL LETTER S WITH DIAGONAL STROKE +A7CE ; NFKC_CF; A7CF # L& LATIN CAPITAL LETTER PHARYNGEAL VOICED FRICATIVE A7D0 ; NFKC_CF; A7D1 # L& LATIN CAPITAL LETTER CLOSED INSULAR G +A7D2 ; NFKC_CF; A7D3 # L& LATIN CAPITAL LETTER DOUBLE THORN +A7D4 ; NFKC_CF; A7D5 # L& LATIN CAPITAL LETTER DOUBLE WYNN A7D6 ; NFKC_CF; A7D7 # L& LATIN CAPITAL LETTER MIDDLE SCOTS S A7D8 ; NFKC_CF; A7D9 # L& LATIN CAPITAL LETTER SIGMOID S A7DA ; NFKC_CF; A7DB # L& LATIN CAPITAL LETTER LAMBDA A7DC ; NFKC_CF; 019B # L& LATIN CAPITAL LETTER LAMBDA WITH STROKE +A7F1 ; NFKC_CF; 0073 # Lm MODIFIER LETTER CAPITAL S A7F2 ; NFKC_CF; 0063 # Lm MODIFIER LETTER CAPITAL C A7F3 ; NFKC_CF; 0066 # Lm MODIFIER LETTER CAPITAL F A7F4 ; NFKC_CF; 0071 # Lm MODIFIER LETTER CAPITAL Q @@ -7184,6 +7189,31 @@ FFF0..FFF8 ; NFKC_CF; # Cn [9] ...... -# Total code points: 10554 +# Total code points: 10583 # ================================================ @@ -11582,11 +11612,15 @@ A7C7 ; NFKC_SCF; A7C8 # L& LATIN CAPITAL LETTER D WITH A7C9 ; NFKC_SCF; A7CA # L& LATIN CAPITAL LETTER S WITH SHORT STROKE OVERLAY A7CB ; NFKC_SCF; 0264 # L& LATIN CAPITAL LETTER RAMS HORN A7CC ; NFKC_SCF; A7CD # L& LATIN CAPITAL LETTER S WITH DIAGONAL STROKE +A7CE ; NFKC_SCF; A7CF # L& LATIN CAPITAL LETTER PHARYNGEAL VOICED FRICATIVE A7D0 ; NFKC_SCF; A7D1 # L& LATIN CAPITAL LETTER CLOSED INSULAR G +A7D2 ; NFKC_SCF; A7D3 # L& LATIN CAPITAL LETTER DOUBLE THORN +A7D4 ; NFKC_SCF; A7D5 # L& LATIN CAPITAL LETTER DOUBLE WYNN A7D6 ; NFKC_SCF; A7D7 # L& LATIN CAPITAL LETTER MIDDLE SCOTS S A7D8 ; NFKC_SCF; A7D9 # L& LATIN CAPITAL LETTER SIGMOID S A7DA ; NFKC_SCF; A7DB # L& LATIN CAPITAL LETTER LAMBDA A7DC ; NFKC_SCF; 019B # L& LATIN CAPITAL LETTER LAMBDA WITH STROKE +A7F1 ; NFKC_SCF; 0073 # Lm MODIFIER LETTER CAPITAL S A7F2 ; NFKC_SCF; 0063 # Lm MODIFIER LETTER CAPITAL C A7F3 ; NFKC_SCF; 0066 # Lm MODIFIER LETTER CAPITAL F A7F4 ; NFKC_SCF; 0071 # Lm MODIFIER LETTER CAPITAL Q @@ -13318,6 +13352,31 @@ FFF0..FFF8 ; NFKC_SCF; # Cn [9] ...... -# Total code points: 10516 +# Total code points: 10545 # ================================================ @@ -16052,12 +16111,15 @@ A7C2 ; Changes_When_NFKC_Casefolded # L& LATIN CAPITAL LETTER ANG A7C4..A7C7 ; Changes_When_NFKC_Casefolded # L& [4] LATIN CAPITAL LETTER C WITH PALATAL HOOK..LATIN CAPITAL LETTER D WITH SHORT STROKE OVERLAY A7C9 ; Changes_When_NFKC_Casefolded # L& LATIN CAPITAL LETTER S WITH SHORT STROKE OVERLAY A7CB..A7CC ; Changes_When_NFKC_Casefolded # L& [2] LATIN CAPITAL LETTER RAMS HORN..LATIN CAPITAL LETTER S WITH DIAGONAL STROKE +A7CE ; Changes_When_NFKC_Casefolded # L& LATIN CAPITAL LETTER PHARYNGEAL VOICED FRICATIVE A7D0 ; Changes_When_NFKC_Casefolded # L& LATIN CAPITAL LETTER CLOSED INSULAR G +A7D2 ; Changes_When_NFKC_Casefolded # L& LATIN CAPITAL LETTER DOUBLE THORN +A7D4 ; Changes_When_NFKC_Casefolded # L& LATIN CAPITAL LETTER DOUBLE WYNN A7D6 ; Changes_When_NFKC_Casefolded # L& LATIN CAPITAL LETTER MIDDLE SCOTS S A7D8 ; Changes_When_NFKC_Casefolded # L& LATIN CAPITAL LETTER SIGMOID S A7DA ; Changes_When_NFKC_Casefolded # L& LATIN CAPITAL LETTER LAMBDA A7DC ; Changes_When_NFKC_Casefolded # L& LATIN CAPITAL LETTER LAMBDA WITH STROKE -A7F2..A7F4 ; Changes_When_NFKC_Casefolded # Lm [3] MODIFIER LETTER CAPITAL C..MODIFIER LETTER CAPITAL Q +A7F1..A7F4 ; Changes_When_NFKC_Casefolded # Lm [4] MODIFIER LETTER CAPITAL S..MODIFIER LETTER CAPITAL Q A7F5 ; Changes_When_NFKC_Casefolded # L& LATIN CAPITAL LETTER REVERSED HALF H A7F8..A7F9 ; Changes_When_NFKC_Casefolded # Lm [2] MODIFIER LETTER CAPITAL H WITH STROKE..MODIFIER LETTER SMALL LIGATURE OE AB5C..AB5F ; Changes_When_NFKC_Casefolded # Lm [4] MODIFIER LETTER SMALL HENG..MODIFIER LETTER SMALL U WITH LEFT HOOK @@ -16199,6 +16261,7 @@ FFF0..FFF8 ; Changes_When_NFKC_Casefolded # Cn [9] ...... -# Total code points: 10554 +# Total code points: 10583 # EOF diff --git a/contrib/unicode/EastAsianWidth.txt b/contrib/unicode/EastAsianWidth.txt index 99f7a31ea5d8..3e46eb65df2e 100644 --- a/contrib/unicode/EastAsianWidth.txt +++ b/contrib/unicode/EastAsianWidth.txt @@ -1,6 +1,6 @@ -# EastAsianWidth-16.0.0.txt -# Date: 2024-04-30, 21:48:20 GMT -# © 2024 Unicode®, Inc. +# EastAsianWidth-17.0.0.txt +# Date: 2025-07-24, 00:12:54 GMT +# © 2025 Unicode®, Inc. # Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries. # For terms of use and license, see https://www.unicode.org/terms_of_use.html # @@ -180,8 +180,8 @@ 0252..0260 ; N # Ll [15] LATIN SMALL LETTER TURNED ALPHA..LATIN SMALL LETTER G WITH HOOK 0261 ; A # Ll LATIN SMALL LETTER SCRIPT G 0262..0293 ; N # Ll [50] LATIN LETTER SMALL CAPITAL G..LATIN SMALL LETTER EZH WITH CURL -0294 ; N # Lo LATIN LETTER GLOTTAL STOP -0295..02AF ; N # Ll [27] LATIN LETTER PHARYNGEAL VOICED FRICATIVE..LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL +0294..0295 ; N # Lo [2] LATIN LETTER GLOTTAL STOP..LATIN LETTER PHARYNGEAL VOICED FRICATIVE +0296..02AF ; N # Ll [26] LATIN LETTER INVERTED GLOTTAL STOP..LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL 02B0..02C1 ; N # Lm [18] MODIFIER LETTER SMALL H..MODIFIER LETTER REVERSED GLOTTAL STOP 02C2..02C3 ; N # Sk [2] MODIFIER LETTER LEFT ARROWHEAD..MODIFIER LETTER RIGHT ARROWHEAD 02C4 ; A # Sk MODIFIER LETTER UP ARROWHEAD @@ -332,7 +332,7 @@ 0860..086A ; N # Lo [11] SYRIAC LETTER MALAYALAM NGA..SYRIAC LETTER MALAYALAM SSA 0870..0887 ; N # Lo [24] ARABIC LETTER ALEF WITH ATTACHED FATHA..ARABIC BASELINE ROUND DOT 0888 ; N # Sk ARABIC RAISED ROUND DOT -0889..088E ; N # Lo [6] ARABIC LETTER NOON WITH INVERTED SMALL V..ARABIC VERTICAL TAIL +0889..088F ; N # Lo [7] ARABIC LETTER NOON WITH INVERTED SMALL V..ARABIC LETTER NOON WITH RING ABOVE 0890..0891 ; N # Cf [2] ARABIC POUND MARK ABOVE..ARABIC PIASTRE MARK ABOVE 0897..089F ; N # Mn [9] ARABIC PEPET..ARABIC HALF MADDA OVER MADDA 08A0..08C8 ; N # Lo [41] ARABIC LETTER BEH WITH SMALL V BELOW..ARABIC LETTER GRAF @@ -502,7 +502,7 @@ 0C4A..0C4D ; N # Mn [4] TELUGU VOWEL SIGN O..TELUGU SIGN VIRAMA 0C55..0C56 ; N # Mn [2] TELUGU LENGTH MARK..TELUGU AI LENGTH MARK 0C58..0C5A ; N # Lo [3] TELUGU LETTER TSA..TELUGU LETTER RRRA -0C5D ; N # Lo TELUGU LETTER NAKAARA POLLU +0C5C..0C5D ; N # Lo [2] TELUGU ARCHAIC SHRII..TELUGU LETTER NAKAARA POLLU 0C60..0C61 ; N # Lo [2] TELUGU LETTER VOCALIC RR..TELUGU LETTER VOCALIC LL 0C62..0C63 ; N # Mn [2] TELUGU VOWEL SIGN VOCALIC L..TELUGU VOWEL SIGN VOCALIC LL 0C66..0C6F ; N # Nd [10] TELUGU DIGIT ZERO..TELUGU DIGIT NINE @@ -528,7 +528,7 @@ 0CCA..0CCB ; N # Mc [2] KANNADA VOWEL SIGN O..KANNADA VOWEL SIGN OO 0CCC..0CCD ; N # Mn [2] KANNADA VOWEL SIGN AU..KANNADA SIGN VIRAMA 0CD5..0CD6 ; N # Mc [2] KANNADA LENGTH MARK..KANNADA AI LENGTH MARK -0CDD..0CDE ; N # Lo [2] KANNADA LETTER NAKAARA POLLU..KANNADA LETTER FA +0CDC..0CDE ; N # Lo [3] KANNADA ARCHAIC SHRII..KANNADA LETTER FA 0CE0..0CE1 ; N # Lo [2] KANNADA LETTER VOCALIC RR..KANNADA LETTER VOCALIC LL 0CE2..0CE3 ; N # Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL 0CE6..0CEF ; N # Nd [10] KANNADA DIGIT ZERO..KANNADA DIGIT NINE @@ -806,7 +806,8 @@ 1AA8..1AAD ; N # Po [6] TAI THAM SIGN KAAN..TAI THAM SIGN CAANG 1AB0..1ABD ; N # Mn [14] COMBINING DOUBLED CIRCUMFLEX ACCENT..COMBINING PARENTHESES BELOW 1ABE ; N # Me COMBINING PARENTHESES OVERLAY -1ABF..1ACE ; N # Mn [16] COMBINING LATIN SMALL LETTER W BELOW..COMBINING LATIN SMALL LETTER INSULAR T +1ABF..1ADD ; N # Mn [31] COMBINING LATIN SMALL LETTER W BELOW..COMBINING DOT-AND-RING BELOW +1AE0..1AEB ; N # Mn [12] COMBINING LEFT TACK ABOVE..COMBINING DOUBLE RIGHTWARDS ARROW ABOVE 1B00..1B03 ; N # Mn [4] BALINESE SIGN ULU RICEM..BALINESE SIGN SURANG 1B04 ; N # Mc BALINESE SIGN BISAH 1B05..1B33 ; N # Lo [47] BALINESE LETTER AKARA..BALINESE LETTER HA @@ -976,7 +977,7 @@ 20A9 ; H # Sc WON SIGN 20AA..20AB ; N # Sc [2] NEW SHEQEL SIGN..DONG SIGN 20AC ; A # Sc EURO SIGN -20AD..20C0 ; N # Sc [20] KIP SIGN..SOM SIGN +20AD..20C1 ; N # Sc [21] KIP SIGN..SAUDI RIYAL SIGN 20D0..20DC ; N # Mn [13] COMBINING LEFT HARPOON ABOVE..COMBINING FOUR DOTS ABOVE 20DD..20E0 ; N # Me [4] COMBINING ENCLOSING CIRCLE..COMBINING ENCLOSING CIRCLE BACKSLASH 20E1 ; N # Mn COMBINING LEFT RIGHT ARROW ABOVE @@ -1351,8 +1352,7 @@ 2B55 ; W # So HEAVY LARGE CIRCLE 2B56..2B59 ; A # So [4] HEAVY OVAL WITH OVAL INSIDE..HEAVY CIRCLED SALTIRE 2B5A..2B73 ; N # So [26] SLANTED NORTH ARROW WITH HOOKED HEAD..DOWNWARDS TRIANGLE-HEADED ARROW TO BAR -2B76..2B95 ; N # So [32] NORTH WEST TRIANGLE-HEADED ARROW TO BAR..RIGHTWARDS BLACK ARROW -2B97..2BFF ; N # So [105] SYMBOL FOR TYPE A ELECTRONICS..HELLSCHREIBER PAUSE SYMBOL +2B76..2BFF ; N # So [138] NORTH WEST TRIANGLE-HEADED ARROW TO BAR..HELLSCHREIBER PAUSE SYMBOL 2C00..2C5F ; N # L& [96] GLAGOLITIC CAPITAL LETTER AZU..GLAGOLITIC SMALL LETTER CAUDATE CHRIVI 2C60..2C7B ; N # L& [28] LATIN CAPITAL LETTER L WITH DOUBLE BAR..LATIN LETTER SMALL CAPITAL TURNED E 2C7C..2C7D ; N # Lm [2] LATIN SUBSCRIPT SMALL LETTER J..MODIFIER LETTER CAPITAL V @@ -1548,11 +1548,8 @@ A788 ; N # Lm MODIFIER LETTER LOW CIRCUMFLEX ACCENT A789..A78A ; N # Sk [2] MODIFIER LETTER COLON..MODIFIER LETTER SHORT EQUALS SIGN A78B..A78E ; N # L& [4] LATIN CAPITAL LETTER SALTILLO..LATIN SMALL LETTER L WITH RETROFLEX HOOK AND BELT A78F ; N # Lo LATIN LETTER SINOLOGICAL DOT -A790..A7CD ; N # L& [62] LATIN CAPITAL LETTER N WITH DESCENDER..LATIN SMALL LETTER S WITH DIAGONAL STROKE -A7D0..A7D1 ; N # L& [2] LATIN CAPITAL LETTER CLOSED INSULAR G..LATIN SMALL LETTER CLOSED INSULAR G -A7D3 ; N # Ll LATIN SMALL LETTER DOUBLE THORN -A7D5..A7DC ; N # L& [8] LATIN SMALL LETTER DOUBLE WYNN..LATIN CAPITAL LETTER LAMBDA WITH STROKE -A7F2..A7F4 ; N # Lm [3] MODIFIER LETTER CAPITAL C..MODIFIER LETTER CAPITAL Q +A790..A7DC ; N # L& [77] LATIN CAPITAL LETTER N WITH DESCENDER..LATIN CAPITAL LETTER LAMBDA WITH STROKE +A7F1..A7F4 ; N # Lm [4] MODIFIER LETTER CAPITAL S..MODIFIER LETTER CAPITAL Q A7F5..A7F6 ; N # L& [2] LATIN CAPITAL LETTER REVERSED HALF H..LATIN SMALL LETTER REVERSED HALF H A7F7 ; N # Lo LATIN EPIGRAPHIC LETTER SIDEWAYS I A7F8..A7F9 ; N # Lm [2] MODIFIER LETTER CAPITAL H WITH STROKE..MODIFIER LETTER SMALL LIGATURE OE @@ -1709,13 +1706,15 @@ FB43..FB44 ; N # Lo [2] HEBREW LETTER FINAL PE WITH DAGESH..HEBREW LETT FB46..FB4F ; N # Lo [10] HEBREW LETTER TSADI WITH DAGESH..HEBREW LIGATURE ALEF LAMED FB50..FBB1 ; N # Lo [98] ARABIC LETTER ALEF WASLA ISOLATED FORM..ARABIC LETTER YEH BARREE WITH HAMZA ABOVE FINAL FORM FBB2..FBC2 ; N # Sk [17] ARABIC SYMBOL DOT ABOVE..ARABIC SYMBOL WASLA ABOVE +FBC3..FBD2 ; N # So [16] ARABIC LIGATURE JALLA WA-ALAA..ARABIC LIGATURE ALAYHI AR-RAHMAH FBD3..FD3D ; N # Lo [363] ARABIC LETTER NG ISOLATED FORM..ARABIC LIGATURE ALEF WITH FATHATAN ISOLATED FORM FD3E ; N # Pe ORNATE LEFT PARENTHESIS FD3F ; N # Ps ORNATE RIGHT PARENTHESIS FD40..FD4F ; N # So [16] ARABIC LIGATURE RAHIMAHU ALLAAH..ARABIC LIGATURE RAHIMAHUM ALLAAH FD50..FD8F ; N # Lo [64] ARABIC LIGATURE TEH WITH JEEM WITH MEEM INITIAL FORM..ARABIC LIGATURE MEEM WITH KHAH WITH MEEM INITIAL FORM +FD90..FD91 ; N # So [2] ARABIC LIGATURE RAHMATU ALLAAHI ALAYH..ARABIC LIGATURE RAHMATU ALLAAHI ALAYHAA FD92..FDC7 ; N # Lo [54] ARABIC LIGATURE MEEM WITH JEEM WITH KHAH INITIAL FORM..ARABIC LIGATURE NOON WITH JEEM WITH YEH FINAL FORM -FDCF ; N # So ARABIC LIGATURE SALAAMUHU ALAYNAA +FDC8..FDCF ; N # So [8] ARABIC LIGATURE RAHIMAHU ALLAAH TAAALAA..ARABIC LIGATURE SALAAMUHU ALAYNAA FDF0..FDFB ; N # Lo [12] ARABIC LIGATURE SALLA USED AS KORANIC STOP SIGN ISOLATED FORM..ARABIC LIGATURE JALLAJALALOUHOU FDFC ; N # Sc RIAL SIGN FDFD..FDFF ; N # So [3] ARABIC LIGATURE BISMILLAH AR-RAHMAN AR-RAHEEM..ARABIC LIGATURE AZZA WA JALL @@ -1904,6 +1903,7 @@ FFFD ; A # So REPLACEMENT CHARACTER 1091F ; N # Po PHOENICIAN WORD SEPARATOR 10920..10939 ; N # Lo [26] LYDIAN LETTER A..LYDIAN LETTER C 1093F ; N # Po LYDIAN TRIANGULAR MARK +10940..10959 ; N # Lo [26] SIDETIC LETTER N01..SIDETIC LETTER N26 10980..1099F ; N # Lo [32] MEROITIC HIEROGLYPHIC LETTER A..MEROITIC HIEROGLYPHIC SYMBOL VIDJ-2 109A0..109B7 ; N # Lo [24] MEROITIC CURSIVE LETTER A..MEROITIC CURSIVE LETTER DA 109BC..109BD ; N # No [2] MEROITIC CURSIVE FRACTION ELEVEN TWELFTHS..MEROITIC CURSIVE FRACTION ONE HALF @@ -1964,7 +1964,11 @@ FFFD ; A # So REPLACEMENT CHARACTER 10EAD ; N # Pd YEZIDI HYPHENATION MARK 10EB0..10EB1 ; N # Lo [2] YEZIDI LETTER LAM WITH DOT ABOVE..YEZIDI LETTER YOT WITH CIRCUMFLEX ABOVE 10EC2..10EC4 ; N # Lo [3] ARABIC LETTER DAL WITH TWO DOTS VERTICALLY BELOW..ARABIC LETTER KAF WITH TWO DOTS VERTICALLY BELOW -10EFC..10EFF ; N # Mn [4] ARABIC COMBINING ALEF OVERLAY..ARABIC SMALL LOW WORD MADDA +10EC5 ; N # Lm ARABIC SMALL YEH BARREE WITH TWO DOTS BELOW +10EC6..10EC7 ; N # Lo [2] ARABIC LETTER THIN NOON..ARABIC LETTER YEH WITH FOUR DOTS BELOW +10ED0 ; N # Po ARABIC BIBLICAL END OF VERSE +10ED1..10ED8 ; N # So [8] ARABIC LIGATURE ALAYHAA AS-SALAATU WAS-SALAAM..ARABIC LIGATURE NAWWARA ALLAAHU MARQADAH +10EFA..10EFF ; N # Mn [6] ARABIC DOUBLE VERTICAL BAR BELOW..ARABIC SMALL LOW WORD MADDA 10F00..10F1C ; N # Lo [29] OLD SOGDIAN LETTER ALEPH..OLD SOGDIAN LETTER FINAL TAW WITH VERTICAL TAIL 10F1D..10F26 ; N # No [10] OLD SOGDIAN NUMBER ONE..OLD SOGDIAN FRACTION ONE HALF 10F27 ; N # Lo OLD SOGDIAN LIGATURE AYIN-DALETH @@ -2235,6 +2239,12 @@ FFFD ; A # So REPLACEMENT CHARACTER 11AB0..11ABF ; N # Lo [16] CANADIAN SYLLABICS NATTILIK HI..CANADIAN SYLLABICS SPA 11AC0..11AF8 ; N # Lo [57] PAU CIN HAU LETTER PA..PAU CIN HAU GLOTTAL STOP FINAL 11B00..11B09 ; N # Po [10] DEVANAGARI HEAD MARK..DEVANAGARI SIGN MINDU +11B60 ; N # Mn SHARADA VOWEL SIGN OE +11B61 ; N # Mc SHARADA VOWEL SIGN OOE +11B62..11B64 ; N # Mn [3] SHARADA VOWEL SIGN UE..SHARADA VOWEL SIGN SHORT E +11B65 ; N # Mc SHARADA VOWEL SIGN SHORT O +11B66 ; N # Mn SHARADA VOWEL SIGN CANDRA E +11B67 ; N # Mc SHARADA VOWEL SIGN CANDRA O 11BC0..11BE0 ; N # Lo [33] SUNUWAR LETTER DEVI..SUNUWAR LETTER KLOKO 11BE1 ; N # Po SUNUWAR SIGN PVO 11BF0..11BF9 ; N # Nd [10] SUNUWAR DIGIT ZERO..SUNUWAR DIGIT NINE @@ -2279,6 +2289,10 @@ FFFD ; A # So REPLACEMENT CHARACTER 11D97 ; N # Mn GUNJALA GONDI VIRAMA 11D98 ; N # Lo GUNJALA GONDI OM 11DA0..11DA9 ; N # Nd [10] GUNJALA GONDI DIGIT ZERO..GUNJALA GONDI DIGIT NINE +11DB0..11DD8 ; N # Lo [41] TOLONG SIKI LETTER I..TOLONG SIKI LETTER RRH +11DD9 ; N # Lm TOLONG SIKI SIGN SELA +11DDA..11DDB ; N # Lo [2] TOLONG SIKI SIGN HECAKA..TOLONG SIKI UNGGA +11DE0..11DE9 ; N # Nd [10] TOLONG SIKI DIGIT ZERO..TOLONG SIKI DIGIT NINE 11EE0..11EF2 ; N # Lo [19] MAKASAR LETTER KA..MAKASAR ANGKA 11EF3..11EF4 ; N # Mn [2] MAKASAR VOWEL SIGN I..MAKASAR VOWEL SIGN U 11EF5..11EF6 ; N # Mc [2] MAKASAR VOWEL SIGN E..MAKASAR VOWEL SIGN O @@ -2349,6 +2363,8 @@ FFFD ; A # So REPLACEMENT CHARACTER 16E40..16E7F ; N # L& [64] MEDEFAIDRIN CAPITAL LETTER M..MEDEFAIDRIN SMALL LETTER Y 16E80..16E96 ; N # No [23] MEDEFAIDRIN DIGIT ZERO..MEDEFAIDRIN DIGIT THREE ALTERNATE FORM 16E97..16E9A ; N # Po [4] MEDEFAIDRIN COMMA..MEDEFAIDRIN EXCLAMATION OH +16EA0..16EB8 ; N # Lu [25] BERIA ERFE CAPITAL LETTER ARKAB..BERIA ERFE CAPITAL LETTER AY +16EBB..16ED3 ; N # Ll [25] BERIA ERFE SMALL LETTER ARKAB..BERIA ERFE SMALL LETTER AY 16F00..16F4A ; N # Lo [75] MIAO LETTER PA..MIAO LETTER RTE 16F4F ; N # Mn MIAO SIGN CONSONANT MODIFIER BAR 16F50 ; N # Lo MIAO LETTER NASALIZATION @@ -2360,11 +2376,14 @@ FFFD ; A # So REPLACEMENT CHARACTER 16FE3 ; W # Lm OLD CHINESE ITERATION MARK 16FE4 ; W # Mn KHITAN SMALL SCRIPT FILLER 16FF0..16FF1 ; W # Mc [2] VIETNAMESE ALTERNATE READING MARK CA..VIETNAMESE ALTERNATE READING MARK NHAY -17000..187F7 ; W # Lo [6136] TANGUT IDEOGRAPH-17000..TANGUT IDEOGRAPH-187F7 +16FF2..16FF3 ; W # Lm [2] CHINESE SMALL SIMPLIFIED ER..CHINESE SMALL TRADITIONAL ER +16FF4..16FF6 ; W # Nl [3] YANGQIN SIGN SLOW ONE BEAT..YANGQIN SIGN SLOW TWO BEATS +17000..187FF ; W # Lo [6144] TANGUT IDEOGRAPH-17000..TANGUT IDEOGRAPH-187FF 18800..18AFF ; W # Lo [768] TANGUT COMPONENT-001..TANGUT COMPONENT-768 18B00..18CD5 ; W # Lo [470] KHITAN SMALL SCRIPT CHARACTER-18B00..KHITAN SMALL SCRIPT CHARACTER-18CD5 18CFF ; W # Lo KHITAN SMALL SCRIPT CHARACTER-18CFF -18D00..18D08 ; W # Lo [9] TANGUT IDEOGRAPH-18D00..TANGUT IDEOGRAPH-18D08 +18D00..18D1E ; W # Lo [31] TANGUT IDEOGRAPH-18D00..TANGUT IDEOGRAPH-18D1E +18D80..18DF2 ; W # Lo [115] TANGUT COMPONENT-769..TANGUT COMPONENT-883 1AFF0..1AFF3 ; W # Lm [4] KATAKANA LETTER MINNAN TONE-2..KATAKANA LETTER MINNAN TONE-5 1AFF5..1AFFB ; W # Lm [7] KATAKANA LETTER MINNAN TONE-7..KATAKANA LETTER MINNAN NASALIZED TONE-5 1AFFD..1AFFE ; W # Lm [2] KATAKANA LETTER MINNAN NASALIZED TONE-7..KATAKANA LETTER MINNAN NASALIZED TONE-8 @@ -2385,7 +2404,12 @@ FFFD ; A # So REPLACEMENT CHARACTER 1BCA0..1BCA3 ; N # Cf [4] SHORTHAND FORMAT LETTER OVERLAP..SHORTHAND FORMAT UP STEP 1CC00..1CCEF ; N # So [240] UP-POINTING GO-KART..OUTLINED LATIN CAPITAL LETTER Z 1CCF0..1CCF9 ; N # Nd [10] OUTLINED DIGIT ZERO..OUTLINED DIGIT NINE +1CCFA..1CCFC ; N # So [3] SNAKE SYMBOL..NOSE SYMBOL 1CD00..1CEB3 ; N # So [436] BLOCK OCTANT-3..BLACK RIGHT TRIANGLE CARET +1CEBA..1CEBF ; N # So [6] FRAGILE SYMBOL..STRAWBERRY SYMBOL +1CEC0..1CED0 ; N # So [17] HEBE..LEUKOTHEA +1CEE0..1CEEF ; N # So [16] GEOMANTIC FIGURE POPULUS..GEOMANTIC FIGURE VIA +1CEF0 ; N # Sm MEDIUM SMALL WHITE CIRCLE WITH HORIZONTAL BAR 1CF00..1CF2D ; N # Mn [46] ZNAMENNY COMBINING MARK GORAZDO NIZKO S KRYZHEM ON LEFT..ZNAMENNY COMBINING MARK KRYZH ON LEFT 1CF30..1CF46 ; N # Mn [23] ZNAMENNY COMBINING TONAL RANGE MARK MRACHNO..ZNAMENNY PRIZNAK MODIFIER ROG 1CF50..1CFC3 ; N # So [116] ZNAMENNY NEUME KRYUK..ZNAMENNY NEUME PAUK @@ -2496,6 +2520,17 @@ FFFD ; A # So REPLACEMENT CHARACTER 1E5F0 ; N # Lo OL ONAL SIGN HODDOND 1E5F1..1E5FA ; N # Nd [10] OL ONAL DIGIT ZERO..OL ONAL DIGIT NINE 1E5FF ; N # Po OL ONAL ABBREVIATION SIGN +1E6C0..1E6DE ; N # Lo [31] TAI YO LETTER LOW KO..TAI YO LETTER HIGH KVO +1E6E0..1E6E2 ; N # Lo [3] TAI YO LETTER AA..TAI YO LETTER UE +1E6E3 ; N # Mn TAI YO SIGN UE +1E6E4..1E6E5 ; N # Lo [2] TAI YO LETTER U..TAI YO LETTER AE +1E6E6 ; N # Mn TAI YO SIGN AU +1E6E7..1E6ED ; N # Lo [7] TAI YO LETTER O..TAI YO LETTER AUE +1E6EE..1E6EF ; N # Mn [2] TAI YO SIGN AY..TAI YO SIGN ANG +1E6F0..1E6F4 ; N # Lo [5] TAI YO LETTER AN..TAI YO LETTER AP +1E6F5 ; N # Mn TAI YO SIGN OM +1E6FE ; N # Lo TAI YO SYMBOL MUEANG +1E6FF ; N # Lm TAI YO XAM LAI 1E7E0..1E7E6 ; N # Lo [7] ETHIOPIC SYLLABLE HHYA..ETHIOPIC SYLLABLE HHYO 1E7E8..1E7EB ; N # Lo [4] ETHIOPIC SYLLABLE GURAGE HHWA..ETHIOPIC SYLLABLE HHWE 1E7ED..1E7EE ; N # Lo [2] ETHIOPIC SYLLABLE GURAGE MWI..ETHIOPIC SYLLABLE GURAGE MWEE @@ -2623,14 +2658,13 @@ FFFD ; A # So REPLACEMENT CHARACTER 1F6CD..1F6CF ; N # So [3] SHOPPING BAGS..BED 1F6D0..1F6D2 ; W # So [3] PLACE OF WORSHIP..SHOPPING TROLLEY 1F6D3..1F6D4 ; N # So [2] STUPA..PAGODA -1F6D5..1F6D7 ; W # So [3] HINDU TEMPLE..ELEVATOR +1F6D5..1F6D8 ; W # So [4] HINDU TEMPLE..LANDSLIDE 1F6DC..1F6DF ; W # So [4] WIRELESS..RING BUOY 1F6E0..1F6EA ; N # So [11] HAMMER AND WRENCH..NORTHEAST-POINTING AIRPLANE 1F6EB..1F6EC ; W # So [2] AIRPLANE DEPARTURE..AIRPLANE ARRIVING 1F6F0..1F6F3 ; N # So [4] SATELLITE..PASSENGER SHIP 1F6F4..1F6FC ; W # So [9] SCOOTER..ROLLER SKATE -1F700..1F776 ; N # So [119] ALCHEMICAL SYMBOL FOR QUINTESSENCE..LUNAR ECLIPSE -1F77B..1F77F ; N # So [5] HAUMEA..ORCUS +1F700..1F77F ; N # So [128] ALCHEMICAL SYMBOL FOR QUINTESSENCE..ORCUS 1F780..1F7D9 ; N # So [90] BLACK LEFT-POINTING ISOSCELES RIGHT TRIANGLE..NINE POINTED WHITE STAR 1F7E0..1F7EB ; W # So [12] LARGE ORANGE CIRCLE..LARGE BROWN SQUARE 1F7F0 ; W # So HEAVY EQUALS SIGN @@ -2641,31 +2675,32 @@ FFFD ; A # So REPLACEMENT CHARACTER 1F890..1F8AD ; N # So [30] LEFTWARDS TRIANGLE ARROWHEAD..WHITE ARROW SHAFT WIDTH TWO THIRDS 1F8B0..1F8BB ; N # So [12] ARROW POINTING UPWARDS THEN NORTH WEST..SOUTH WEST ARROW FROM BAR 1F8C0..1F8C1 ; N # So [2] LEFTWARDS ARROW FROM DOWNWARDS ARROW..RIGHTWARDS ARROW FROM DOWNWARDS ARROW +1F8D0..1F8D8 ; N # Sm [9] LONG RIGHTWARDS ARROW OVER LONG LEFTWARDS ARROW..LONG LEFT RIGHT ARROW WITH DEPENDENT LOBE 1F900..1F90B ; N # So [12] CIRCLED CROSS FORMEE WITH FOUR DOTS..DOWNWARD FACING NOTCHED HOOK WITH DOT 1F90C..1F93A ; W # So [47] PINCHED FINGERS..FENCER 1F93B ; N # So MODERN PENTATHLON 1F93C..1F945 ; W # So [10] WRESTLERS..GOAL NET 1F946 ; N # So RIFLE 1F947..1F9FF ; W # So [185] FIRST PLACE MEDAL..NAZAR AMULET -1FA00..1FA53 ; N # So [84] NEUTRAL CHESS KING..BLACK CHESS KNIGHT-BISHOP +1FA00..1FA57 ; N # So [88] NEUTRAL CHESS KING..BLACK CHESS ALFIL 1FA60..1FA6D ; N # So [14] XIANGQI RED GENERAL..XIANGQI BLACK SOLDIER 1FA70..1FA7C ; W # So [13] BALLET SHOES..CRUTCH -1FA80..1FA89 ; W # So [10] YO-YO..HARP -1FA8F..1FAC6 ; W # So [56] SHOVEL..FINGERPRINT -1FACE..1FADC ; W # So [15] MOOSE..ROOT VEGETABLE -1FADF..1FAE9 ; W # So [11] SPLATTER..FACE WITH BAGS UNDER EYES -1FAF0..1FAF8 ; W # So [9] HAND WITH INDEX FINGER AND THUMB CROSSED..RIGHTWARDS PUSHING HAND +1FA80..1FA8A ; W # So [11] YO-YO..TROMBONE +1FA8E..1FAC6 ; W # So [57] TREASURE CHEST..FINGERPRINT +1FAC8 ; W # So HAIRY CREATURE +1FACD..1FADC ; W # So [16] ORCA..ROOT VEGETABLE +1FADF..1FAEA ; W # So [12] SPLATTER..DISTORTED FACE +1FAEF..1FAF8 ; W # So [10] FIGHT CLOUD..RIGHTWARDS PUSHING HAND 1FB00..1FB92 ; N # So [147] BLOCK SEXTANT-1..UPPER HALF INVERSE MEDIUM SHADE AND LOWER HALF BLOCK 1FB94..1FBEF ; N # So [92] LEFT HALF INVERSE MEDIUM SHADE AND RIGHT HALF BLOCK..TOP LEFT JUSTIFIED LOWER RIGHT QUARTER BLACK CIRCLE 1FBF0..1FBF9 ; N # Nd [10] SEGMENTED DIGIT ZERO..SEGMENTED DIGIT NINE +1FBFA ; N # So ALARM BELL SYMBOL 20000..2A6DF ; W # Lo [42720] CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6DF 2A6E0..2A6FF ; W # Cn [32] .. -2A700..2B739 ; W # Lo [4154] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B739 -2B73A..2B73F ; W # Cn [6] .. -2B740..2B81D ; W # Lo [222] CJK UNIFIED IDEOGRAPH-2B740..CJK UNIFIED IDEOGRAPH-2B81D +2A700..2B81D ; W # Lo [4382] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B81D 2B81E..2B81F ; W # Cn [2] .. -2B820..2CEA1 ; W # Lo [5762] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEA1 -2CEA2..2CEAF ; W # Cn [14] .. +2B820..2CEAD ; W # Lo [5774] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEAD +2CEAE..2CEAF ; W # Cn [2] .. 2CEB0..2EBE0 ; W # Lo [7473] CJK UNIFIED IDEOGRAPH-2CEB0..CJK UNIFIED IDEOGRAPH-2EBE0 2EBE1..2EBEF ; W # Cn [15] .. 2EBF0..2EE5D ; W # Lo [622] CJK UNIFIED IDEOGRAPH-2EBF0..CJK UNIFIED IDEOGRAPH-2EE5D @@ -2675,8 +2710,8 @@ FFFD ; A # So REPLACEMENT CHARACTER 2FA20..2FFFD ; W # Cn [1502] .. 30000..3134A ; W # Lo [4939] CJK UNIFIED IDEOGRAPH-30000..CJK UNIFIED IDEOGRAPH-3134A 3134B..3134F ; W # Cn [5] .. -31350..323AF ; W # Lo [4192] CJK UNIFIED IDEOGRAPH-31350..CJK UNIFIED IDEOGRAPH-323AF -323B0..3FFFD ; W # Cn [56398] .. +31350..33479 ; W # Lo [8490] CJK UNIFIED IDEOGRAPH-31350..CJK UNIFIED IDEOGRAPH-33479 +3347A..3FFFD ; W # Cn [52100] .. E0001 ; N # Cf LANGUAGE TAG E0020..E007F ; N # Cf [96] TAG SPACE..CANCEL TAG E0100..E01EF ; A # Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256 diff --git a/contrib/unicode/GraphemeBreakProperty.txt b/contrib/unicode/GraphemeBreakProperty.txt index a863397ddaba..19b13571f347 100644 --- a/contrib/unicode/GraphemeBreakProperty.txt +++ b/contrib/unicode/GraphemeBreakProperty.txt @@ -1,6 +1,6 @@ -# GraphemeBreakProperty-16.0.0.txt -# Date: 2024-05-31, 18:09:38 GMT -# © 2024 Unicode®, Inc. +# GraphemeBreakProperty-17.0.0.txt +# Date: 2025-06-30, 06:20:23 GMT +# © 2025 Unicode®, Inc. # Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries. # For terms of use and license, see https://www.unicode.org/terms_of_use.html # @@ -30,12 +30,11 @@ 113D1 ; Prepend # Lo TULU-TIGALARI REPHA 1193F ; Prepend # Lo DIVES AKURU PREFIXED NASAL SIGN 11941 ; Prepend # Lo DIVES AKURU INITIAL RA -11A3A ; Prepend # Lo ZANABAZAR SQUARE CLUSTER-INITIAL LETTER RA 11A84..11A89 ; Prepend # Lo [6] SOYOMBO SIGN JIHVAMULIYA..SOYOMBO CLUSTER-INITIAL LETTER SA 11D46 ; Prepend # Lo MASARAM GONDI REPHA 11F02 ; Prepend # Lo KAWI SIGN REPHA -# Total code points: 28 +# Total code points: 27 # ================================================ @@ -243,7 +242,8 @@ E01F0..E0FFF ; Control # Cn [3600] .. 1A7F ; Extend # Mn TAI THAM COMBINING CRYPTOGRAMMIC DOT 1AB0..1ABD ; Extend # Mn [14] COMBINING DOUBLED CIRCUMFLEX ACCENT..COMBINING PARENTHESES BELOW 1ABE ; Extend # Me COMBINING PARENTHESES OVERLAY -1ABF..1ACE ; Extend # Mn [16] COMBINING LATIN SMALL LETTER W BELOW..COMBINING LATIN SMALL LETTER INSULAR T +1ABF..1ADD ; Extend # Mn [31] COMBINING LATIN SMALL LETTER W BELOW..COMBINING DOT-AND-RING BELOW +1AE0..1AEB ; Extend # Mn [12] COMBINING LEFT TACK ABOVE..COMBINING DOUBLE RIGHTWARDS ARROW ABOVE 1B00..1B03 ; Extend # Mn [4] BALINESE SIGN ULU RICEM..BALINESE SIGN SURANG 1B34 ; Extend # Mn BALINESE SIGN REREKAN 1B35 ; Extend # Mc BALINESE VOWEL SIGN TEDUNG @@ -339,7 +339,7 @@ FF9E..FF9F ; Extend # Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDT 10D24..10D27 ; Extend # Mn [4] HANIFI ROHINGYA SIGN HARBAHAY..HANIFI ROHINGYA SIGN TASSI 10D69..10D6D ; Extend # Mn [5] GARAY VOWEL SIGN E..GARAY CONSONANT NASALIZATION MARK 10EAB..10EAC ; Extend # Mn [2] YEZIDI COMBINING HAMZA MARK..YEZIDI COMBINING MADDA MARK -10EFC..10EFF ; Extend # Mn [4] ARABIC COMBINING ALEF OVERLAY..ARABIC SMALL LOW WORD MADDA +10EFA..10EFF ; Extend # Mn [6] ARABIC DOUBLE VERTICAL BAR BELOW..ARABIC SMALL LOW WORD MADDA 10F46..10F50 ; Extend # Mn [11] SOGDIAN COMBINING DOT BELOW..SOGDIAN COMBINING STROKE BELOW 10F82..10F85 ; Extend # Mn [4] OLD UYGHUR COMBINING DOT ABOVE..OLD UYGHUR COMBINING TWO DOTS BELOW 11001 ; Extend # Mn BRAHMI SIGN ANUSVARA @@ -430,6 +430,9 @@ FF9E..FF9F ; Extend # Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDT 11A59..11A5B ; Extend # Mn [3] SOYOMBO VOWEL SIGN VOCALIC R..SOYOMBO VOWEL LENGTH MARK 11A8A..11A96 ; Extend # Mn [13] SOYOMBO FINAL CONSONANT SIGN G..SOYOMBO SIGN ANUSVARA 11A98..11A99 ; Extend # Mn [2] SOYOMBO GEMINATION MARK..SOYOMBO SUBJOINER +11B60 ; Extend # Mn SHARADA VOWEL SIGN OE +11B62..11B64 ; Extend # Mn [3] SHARADA VOWEL SIGN UE..SHARADA VOWEL SIGN SHORT E +11B66 ; Extend # Mn SHARADA VOWEL SIGN CANDRA E 11C30..11C36 ; Extend # Mn [7] BHAIKSUKI VOWEL SIGN I..BHAIKSUKI VOWEL SIGN VOCALIC L 11C38..11C3D ; Extend # Mn [6] BHAIKSUKI VOWEL SIGN E..BHAIKSUKI SIGN ANUSVARA 11C3F ; Extend # Mn BHAIKSUKI SIGN VIRAMA @@ -489,13 +492,17 @@ FF9E..FF9F ; Extend # Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDT 1E2EC..1E2EF ; Extend # Mn [4] WANCHO TONE TUP..WANCHO TONE KOINI 1E4EC..1E4EF ; Extend # Mn [4] NAG MUNDARI SIGN MUHOR..NAG MUNDARI SIGN SUTUH 1E5EE..1E5EF ; Extend # Mn [2] OL ONAL SIGN MU..OL ONAL SIGN IKIR +1E6E3 ; Extend # Mn TAI YO SIGN UE +1E6E6 ; Extend # Mn TAI YO SIGN AU +1E6EE..1E6EF ; Extend # Mn [2] TAI YO SIGN AY..TAI YO SIGN ANG +1E6F5 ; Extend # Mn TAI YO SIGN OM 1E8D0..1E8D6 ; Extend # Mn [7] MENDE KIKAKUI COMBINING NUMBER TEENS..MENDE KIKAKUI COMBINING NUMBER MILLIONS 1E944..1E94A ; Extend # Mn [7] ADLAM ALIF LENGTHENER..ADLAM NUKTA 1F3FB..1F3FF ; Extend # Sk [5] EMOJI MODIFIER FITZPATRICK TYPE-1-2..EMOJI MODIFIER FITZPATRICK TYPE-6 E0020..E007F ; Extend # Cf [96] TAG SPACE..CANCEL TAG E0100..E01EF ; Extend # Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256 -# Total code points: 2198 +# Total code points: 2237 # ================================================ @@ -646,6 +653,9 @@ ABEC ; SpacingMark # Mc MEETEI MAYEK LUM IYEK 11A39 ; SpacingMark # Mc ZANABAZAR SQUARE SIGN VISARGA 11A57..11A58 ; SpacingMark # Mc [2] SOYOMBO VOWEL SIGN AI..SOYOMBO VOWEL SIGN AU 11A97 ; SpacingMark # Mc SOYOMBO SIGN VISARGA +11B61 ; SpacingMark # Mc SHARADA VOWEL SIGN OOE +11B65 ; SpacingMark # Mc SHARADA VOWEL SIGN SHORT O +11B67 ; SpacingMark # Mc SHARADA VOWEL SIGN CANDRA O 11C2F ; SpacingMark # Mc BHAIKSUKI VOWEL SIGN AA 11C3E ; SpacingMark # Mc BHAIKSUKI SIGN VISARGA 11CA9 ; SpacingMark # Mc MARCHEN SUBJOINED LETTER YA @@ -661,7 +671,7 @@ ABEC ; SpacingMark # Mc MEETEI MAYEK LUM IYEK 1612A..1612C ; SpacingMark # Mc [3] GURUNG KHEMA CONSONANT SIGN MEDIAL YA..GURUNG KHEMA CONSONANT SIGN MEDIAL HA 16F51..16F87 ; SpacingMark # Mc [55] MIAO SIGN ASPIRATION..MIAO VOWEL SIGN UI -# Total code points: 378 +# Total code points: 381 # ================================================ diff --git a/contrib/unicode/HangulSyllableType.txt b/contrib/unicode/HangulSyllableType.txt new file mode 100644 index 000000000000..8c3cf4a73672 --- /dev/null +++ b/contrib/unicode/HangulSyllableType.txt @@ -0,0 +1,858 @@ +# HangulSyllableType-17.0.0.txt +# Date: 2025-01-27, 18:09:16 GMT +# © 2025 Unicode®, Inc. +# Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries. +# For terms of use and license, see https://www.unicode.org/terms_of_use.html +# +# Unicode Character Database +# For documentation, see https://www.unicode.org/reports/tr44/ + +# ================================================ + +# Property: Hangul_Syllable_Type + +# All code points not explicitly listed for Hangul_Syllable_Type +# have the value Not_Applicable (NA). + +# @missing: 0000..10FFFF; Not_Applicable + +# ================================================ + +# Hangul_Syllable_Type=Leading_Jamo + +1100..115F ; L # Lo [96] HANGUL CHOSEONG KIYEOK..HANGUL CHOSEONG FILLER +A960..A97C ; L # Lo [29] HANGUL CHOSEONG TIKEUT-MIEUM..HANGUL CHOSEONG SSANGYEORINHIEUH + +# Total code points: 125 + +# ================================================ + +# Hangul_Syllable_Type=Vowel_Jamo + +1160..11A7 ; V # Lo [72] HANGUL JUNGSEONG FILLER..HANGUL JUNGSEONG O-YAE +D7B0..D7C6 ; V # Lo [23] HANGUL JUNGSEONG O-YEO..HANGUL JUNGSEONG ARAEA-E + +# Total code points: 95 + +# ================================================ + +# Hangul_Syllable_Type=Trailing_Jamo + +11A8..11FF ; T # Lo [88] HANGUL JONGSEONG KIYEOK..HANGUL JONGSEONG SSANGNIEUN +D7CB..D7FB ; T # Lo [49] HANGUL JONGSEONG NIEUN-RIEUL..HANGUL JONGSEONG PHIEUPH-THIEUTH + +# Total code points: 137 + +# ================================================ + +# Hangul_Syllable_Type=LV_Syllable + +AC00 ; LV # Lo HANGUL SYLLABLE GA +AC1C ; LV # Lo HANGUL SYLLABLE GAE +AC38 ; LV # Lo HANGUL SYLLABLE GYA +AC54 ; LV # Lo HANGUL SYLLABLE GYAE +AC70 ; LV # Lo HANGUL SYLLABLE GEO +AC8C ; LV # Lo HANGUL SYLLABLE GE +ACA8 ; LV # Lo HANGUL SYLLABLE GYEO +ACC4 ; LV # Lo HANGUL SYLLABLE GYE +ACE0 ; LV # Lo HANGUL SYLLABLE GO +ACFC ; LV # Lo HANGUL SYLLABLE GWA +AD18 ; LV # Lo HANGUL SYLLABLE GWAE +AD34 ; LV # Lo HANGUL SYLLABLE GOE +AD50 ; LV # Lo HANGUL SYLLABLE GYO +AD6C ; LV # Lo HANGUL SYLLABLE GU +AD88 ; LV # Lo HANGUL SYLLABLE GWEO +ADA4 ; LV # Lo HANGUL SYLLABLE GWE +ADC0 ; LV # Lo HANGUL SYLLABLE GWI +ADDC ; LV # Lo HANGUL SYLLABLE GYU +ADF8 ; LV # Lo HANGUL SYLLABLE GEU +AE14 ; LV # Lo HANGUL SYLLABLE GYI +AE30 ; LV # Lo HANGUL SYLLABLE GI +AE4C ; LV # Lo HANGUL SYLLABLE GGA +AE68 ; LV # Lo HANGUL SYLLABLE GGAE +AE84 ; LV # Lo HANGUL SYLLABLE GGYA +AEA0 ; LV # Lo HANGUL SYLLABLE GGYAE +AEBC ; LV # Lo HANGUL SYLLABLE GGEO +AED8 ; LV # Lo HANGUL SYLLABLE GGE +AEF4 ; LV # Lo HANGUL SYLLABLE GGYEO +AF10 ; LV # Lo HANGUL SYLLABLE GGYE +AF2C ; LV # Lo HANGUL SYLLABLE GGO +AF48 ; LV # Lo HANGUL SYLLABLE GGWA +AF64 ; LV # Lo HANGUL SYLLABLE GGWAE +AF80 ; LV # Lo HANGUL SYLLABLE GGOE +AF9C ; LV # Lo HANGUL SYLLABLE GGYO +AFB8 ; LV # Lo HANGUL SYLLABLE GGU +AFD4 ; LV # Lo HANGUL SYLLABLE GGWEO +AFF0 ; LV # Lo HANGUL SYLLABLE GGWE +B00C ; LV # Lo HANGUL SYLLABLE GGWI +B028 ; LV # Lo HANGUL SYLLABLE GGYU +B044 ; LV # Lo HANGUL SYLLABLE GGEU +B060 ; LV # Lo HANGUL SYLLABLE GGYI +B07C ; LV # Lo HANGUL SYLLABLE GGI +B098 ; LV # Lo HANGUL SYLLABLE NA +B0B4 ; LV # Lo HANGUL SYLLABLE NAE +B0D0 ; LV # Lo HANGUL SYLLABLE NYA +B0EC ; LV # Lo HANGUL SYLLABLE NYAE +B108 ; LV # Lo HANGUL SYLLABLE NEO +B124 ; LV # Lo HANGUL SYLLABLE NE +B140 ; LV # Lo HANGUL SYLLABLE NYEO +B15C ; LV # Lo HANGUL SYLLABLE NYE +B178 ; LV # Lo HANGUL SYLLABLE NO +B194 ; LV # Lo HANGUL SYLLABLE NWA +B1B0 ; LV # Lo HANGUL SYLLABLE NWAE +B1CC ; LV # Lo HANGUL SYLLABLE NOE +B1E8 ; LV # Lo HANGUL SYLLABLE NYO +B204 ; LV # Lo HANGUL SYLLABLE NU +B220 ; LV # Lo HANGUL SYLLABLE NWEO +B23C ; LV # Lo HANGUL SYLLABLE NWE +B258 ; LV # Lo HANGUL SYLLABLE NWI +B274 ; LV # Lo HANGUL SYLLABLE NYU +B290 ; LV # Lo HANGUL SYLLABLE NEU +B2AC ; LV # Lo HANGUL SYLLABLE NYI +B2C8 ; LV # Lo HANGUL SYLLABLE NI +B2E4 ; LV # Lo HANGUL SYLLABLE DA +B300 ; LV # Lo HANGUL SYLLABLE DAE +B31C ; LV # Lo HANGUL SYLLABLE DYA +B338 ; LV # Lo HANGUL SYLLABLE DYAE +B354 ; LV # Lo HANGUL SYLLABLE DEO +B370 ; LV # Lo HANGUL SYLLABLE DE +B38C ; LV # Lo HANGUL SYLLABLE DYEO +B3A8 ; LV # Lo HANGUL SYLLABLE DYE +B3C4 ; LV # Lo HANGUL SYLLABLE DO +B3E0 ; LV # Lo HANGUL SYLLABLE DWA +B3FC ; LV # Lo HANGUL SYLLABLE DWAE +B418 ; LV # Lo HANGUL SYLLABLE DOE +B434 ; LV # Lo HANGUL SYLLABLE DYO +B450 ; LV # Lo HANGUL SYLLABLE DU +B46C ; LV # Lo HANGUL SYLLABLE DWEO +B488 ; LV # Lo HANGUL SYLLABLE DWE +B4A4 ; LV # Lo HANGUL SYLLABLE DWI +B4C0 ; LV # Lo HANGUL SYLLABLE DYU +B4DC ; LV # Lo HANGUL SYLLABLE DEU +B4F8 ; LV # Lo HANGUL SYLLABLE DYI +B514 ; LV # Lo HANGUL SYLLABLE DI +B530 ; LV # Lo HANGUL SYLLABLE DDA +B54C ; LV # Lo HANGUL SYLLABLE DDAE +B568 ; LV # Lo HANGUL SYLLABLE DDYA +B584 ; LV # Lo HANGUL SYLLABLE DDYAE +B5A0 ; LV # Lo HANGUL SYLLABLE DDEO +B5BC ; LV # Lo HANGUL SYLLABLE DDE +B5D8 ; LV # Lo HANGUL SYLLABLE DDYEO +B5F4 ; LV # Lo HANGUL SYLLABLE DDYE +B610 ; LV # Lo HANGUL SYLLABLE DDO +B62C ; LV # Lo HANGUL SYLLABLE DDWA +B648 ; LV # Lo HANGUL SYLLABLE DDWAE +B664 ; LV # Lo HANGUL SYLLABLE DDOE +B680 ; LV # Lo HANGUL SYLLABLE DDYO +B69C ; LV # Lo HANGUL SYLLABLE DDU +B6B8 ; LV # Lo HANGUL SYLLABLE DDWEO +B6D4 ; LV # Lo HANGUL SYLLABLE DDWE +B6F0 ; LV # Lo HANGUL SYLLABLE DDWI +B70C ; LV # Lo HANGUL SYLLABLE DDYU +B728 ; LV # Lo HANGUL SYLLABLE DDEU +B744 ; LV # Lo HANGUL SYLLABLE DDYI +B760 ; LV # Lo HANGUL SYLLABLE DDI +B77C ; LV # Lo HANGUL SYLLABLE RA +B798 ; LV # Lo HANGUL SYLLABLE RAE +B7B4 ; LV # Lo HANGUL SYLLABLE RYA +B7D0 ; LV # Lo HANGUL SYLLABLE RYAE +B7EC ; LV # Lo HANGUL SYLLABLE REO +B808 ; LV # Lo HANGUL SYLLABLE RE +B824 ; LV # Lo HANGUL SYLLABLE RYEO +B840 ; LV # Lo HANGUL SYLLABLE RYE +B85C ; LV # Lo HANGUL SYLLABLE RO +B878 ; LV # Lo HANGUL SYLLABLE RWA +B894 ; LV # Lo HANGUL SYLLABLE RWAE +B8B0 ; LV # Lo HANGUL SYLLABLE ROE +B8CC ; LV # Lo HANGUL SYLLABLE RYO +B8E8 ; LV # Lo HANGUL SYLLABLE RU +B904 ; LV # Lo HANGUL SYLLABLE RWEO +B920 ; LV # Lo HANGUL SYLLABLE RWE +B93C ; LV # Lo HANGUL SYLLABLE RWI +B958 ; LV # Lo HANGUL SYLLABLE RYU +B974 ; LV # Lo HANGUL SYLLABLE REU +B990 ; LV # Lo HANGUL SYLLABLE RYI +B9AC ; LV # Lo HANGUL SYLLABLE RI +B9C8 ; LV # Lo HANGUL SYLLABLE MA +B9E4 ; LV # Lo HANGUL SYLLABLE MAE +BA00 ; LV # Lo HANGUL SYLLABLE MYA +BA1C ; LV # Lo HANGUL SYLLABLE MYAE +BA38 ; LV # Lo HANGUL SYLLABLE MEO +BA54 ; LV # Lo HANGUL SYLLABLE ME +BA70 ; LV # Lo HANGUL SYLLABLE MYEO +BA8C ; LV # Lo HANGUL SYLLABLE MYE +BAA8 ; LV # Lo HANGUL SYLLABLE MO +BAC4 ; LV # Lo HANGUL SYLLABLE MWA +BAE0 ; LV # Lo HANGUL SYLLABLE MWAE +BAFC ; LV # Lo HANGUL SYLLABLE MOE +BB18 ; LV # Lo HANGUL SYLLABLE MYO +BB34 ; LV # Lo HANGUL SYLLABLE MU +BB50 ; LV # Lo HANGUL SYLLABLE MWEO +BB6C ; LV # Lo HANGUL SYLLABLE MWE +BB88 ; LV # Lo HANGUL SYLLABLE MWI +BBA4 ; LV # Lo HANGUL SYLLABLE MYU +BBC0 ; LV # Lo HANGUL SYLLABLE MEU +BBDC ; LV # Lo HANGUL SYLLABLE MYI +BBF8 ; LV # Lo HANGUL SYLLABLE MI +BC14 ; LV # Lo HANGUL SYLLABLE BA +BC30 ; LV # Lo HANGUL SYLLABLE BAE +BC4C ; LV # Lo HANGUL SYLLABLE BYA +BC68 ; LV # Lo HANGUL SYLLABLE BYAE +BC84 ; LV # Lo HANGUL SYLLABLE BEO +BCA0 ; LV # Lo HANGUL SYLLABLE BE +BCBC ; LV # Lo HANGUL SYLLABLE BYEO +BCD8 ; LV # Lo HANGUL SYLLABLE BYE +BCF4 ; LV # Lo HANGUL SYLLABLE BO +BD10 ; LV # Lo HANGUL SYLLABLE BWA +BD2C ; LV # Lo HANGUL SYLLABLE BWAE +BD48 ; LV # Lo HANGUL SYLLABLE BOE +BD64 ; LV # Lo HANGUL SYLLABLE BYO +BD80 ; LV # Lo HANGUL SYLLABLE BU +BD9C ; LV # Lo HANGUL SYLLABLE BWEO +BDB8 ; LV # Lo HANGUL SYLLABLE BWE +BDD4 ; LV # Lo HANGUL SYLLABLE BWI +BDF0 ; LV # Lo HANGUL SYLLABLE BYU +BE0C ; LV # Lo HANGUL SYLLABLE BEU +BE28 ; LV # Lo HANGUL SYLLABLE BYI +BE44 ; LV # Lo HANGUL SYLLABLE BI +BE60 ; LV # Lo HANGUL SYLLABLE BBA +BE7C ; LV # Lo HANGUL SYLLABLE BBAE +BE98 ; LV # Lo HANGUL SYLLABLE BBYA +BEB4 ; LV # Lo HANGUL SYLLABLE BBYAE +BED0 ; LV # Lo HANGUL SYLLABLE BBEO +BEEC ; LV # Lo HANGUL SYLLABLE BBE +BF08 ; LV # Lo HANGUL SYLLABLE BBYEO +BF24 ; LV # Lo HANGUL SYLLABLE BBYE +BF40 ; LV # Lo HANGUL SYLLABLE BBO +BF5C ; LV # Lo HANGUL SYLLABLE BBWA +BF78 ; LV # Lo HANGUL SYLLABLE BBWAE +BF94 ; LV # Lo HANGUL SYLLABLE BBOE +BFB0 ; LV # Lo HANGUL SYLLABLE BBYO +BFCC ; LV # Lo HANGUL SYLLABLE BBU +BFE8 ; LV # Lo HANGUL SYLLABLE BBWEO +C004 ; LV # Lo HANGUL SYLLABLE BBWE +C020 ; LV # Lo HANGUL SYLLABLE BBWI +C03C ; LV # Lo HANGUL SYLLABLE BBYU +C058 ; LV # Lo HANGUL SYLLABLE BBEU +C074 ; LV # Lo HANGUL SYLLABLE BBYI +C090 ; LV # Lo HANGUL SYLLABLE BBI +C0AC ; LV # Lo HANGUL SYLLABLE SA +C0C8 ; LV # Lo HANGUL SYLLABLE SAE +C0E4 ; LV # Lo HANGUL SYLLABLE SYA +C100 ; LV # Lo HANGUL SYLLABLE SYAE +C11C ; LV # Lo HANGUL SYLLABLE SEO +C138 ; LV # Lo HANGUL SYLLABLE SE +C154 ; LV # Lo HANGUL SYLLABLE SYEO +C170 ; LV # Lo HANGUL SYLLABLE SYE +C18C ; LV # Lo HANGUL SYLLABLE SO +C1A8 ; LV # Lo HANGUL SYLLABLE SWA +C1C4 ; LV # Lo HANGUL SYLLABLE SWAE +C1E0 ; LV # Lo HANGUL SYLLABLE SOE +C1FC ; LV # Lo HANGUL SYLLABLE SYO +C218 ; LV # Lo HANGUL SYLLABLE SU +C234 ; LV # Lo HANGUL SYLLABLE SWEO +C250 ; LV # Lo HANGUL SYLLABLE SWE +C26C ; LV # Lo HANGUL SYLLABLE SWI +C288 ; LV # Lo HANGUL SYLLABLE SYU +C2A4 ; LV # Lo HANGUL SYLLABLE SEU +C2C0 ; LV # Lo HANGUL SYLLABLE SYI +C2DC ; LV # Lo HANGUL SYLLABLE SI +C2F8 ; LV # Lo HANGUL SYLLABLE SSA +C314 ; LV # Lo HANGUL SYLLABLE SSAE +C330 ; LV # Lo HANGUL SYLLABLE SSYA +C34C ; LV # Lo HANGUL SYLLABLE SSYAE +C368 ; LV # Lo HANGUL SYLLABLE SSEO +C384 ; LV # Lo HANGUL SYLLABLE SSE +C3A0 ; LV # Lo HANGUL SYLLABLE SSYEO +C3BC ; LV # Lo HANGUL SYLLABLE SSYE +C3D8 ; LV # Lo HANGUL SYLLABLE SSO +C3F4 ; LV # Lo HANGUL SYLLABLE SSWA +C410 ; LV # Lo HANGUL SYLLABLE SSWAE +C42C ; LV # Lo HANGUL SYLLABLE SSOE +C448 ; LV # Lo HANGUL SYLLABLE SSYO +C464 ; LV # Lo HANGUL SYLLABLE SSU +C480 ; LV # Lo HANGUL SYLLABLE SSWEO +C49C ; LV # Lo HANGUL SYLLABLE SSWE +C4B8 ; LV # Lo HANGUL SYLLABLE SSWI +C4D4 ; LV # Lo HANGUL SYLLABLE SSYU +C4F0 ; LV # Lo HANGUL SYLLABLE SSEU +C50C ; LV # Lo HANGUL SYLLABLE SSYI +C528 ; LV # Lo HANGUL SYLLABLE SSI +C544 ; LV # Lo HANGUL SYLLABLE A +C560 ; LV # Lo HANGUL SYLLABLE AE +C57C ; LV # Lo HANGUL SYLLABLE YA +C598 ; LV # Lo HANGUL SYLLABLE YAE +C5B4 ; LV # Lo HANGUL SYLLABLE EO +C5D0 ; LV # Lo HANGUL SYLLABLE E +C5EC ; LV # Lo HANGUL SYLLABLE YEO +C608 ; LV # Lo HANGUL SYLLABLE YE +C624 ; LV # Lo HANGUL SYLLABLE O +C640 ; LV # Lo HANGUL SYLLABLE WA +C65C ; LV # Lo HANGUL SYLLABLE WAE +C678 ; LV # Lo HANGUL SYLLABLE OE +C694 ; LV # Lo HANGUL SYLLABLE YO +C6B0 ; LV # Lo HANGUL SYLLABLE U +C6CC ; LV # Lo HANGUL SYLLABLE WEO +C6E8 ; LV # Lo HANGUL SYLLABLE WE +C704 ; LV # Lo HANGUL SYLLABLE WI +C720 ; LV # Lo HANGUL SYLLABLE YU +C73C ; LV # Lo HANGUL SYLLABLE EU +C758 ; LV # Lo HANGUL SYLLABLE YI +C774 ; LV # Lo HANGUL SYLLABLE I +C790 ; LV # Lo HANGUL SYLLABLE JA +C7AC ; LV # Lo HANGUL SYLLABLE JAE +C7C8 ; LV # Lo HANGUL SYLLABLE JYA +C7E4 ; LV # Lo HANGUL SYLLABLE JYAE +C800 ; LV # Lo HANGUL SYLLABLE JEO +C81C ; LV # Lo HANGUL SYLLABLE JE +C838 ; LV # Lo HANGUL SYLLABLE JYEO +C854 ; LV # Lo HANGUL SYLLABLE JYE +C870 ; LV # Lo HANGUL SYLLABLE JO +C88C ; LV # Lo HANGUL SYLLABLE JWA +C8A8 ; LV # Lo HANGUL SYLLABLE JWAE +C8C4 ; LV # Lo HANGUL SYLLABLE JOE +C8E0 ; LV # Lo HANGUL SYLLABLE JYO +C8FC ; LV # Lo HANGUL SYLLABLE JU +C918 ; LV # Lo HANGUL SYLLABLE JWEO +C934 ; LV # Lo HANGUL SYLLABLE JWE +C950 ; LV # Lo HANGUL SYLLABLE JWI +C96C ; LV # Lo HANGUL SYLLABLE JYU +C988 ; LV # Lo HANGUL SYLLABLE JEU +C9A4 ; LV # Lo HANGUL SYLLABLE JYI +C9C0 ; LV # Lo HANGUL SYLLABLE JI +C9DC ; LV # Lo HANGUL SYLLABLE JJA +C9F8 ; LV # Lo HANGUL SYLLABLE JJAE +CA14 ; LV # Lo HANGUL SYLLABLE JJYA +CA30 ; LV # Lo HANGUL SYLLABLE JJYAE +CA4C ; LV # Lo HANGUL SYLLABLE JJEO +CA68 ; LV # Lo HANGUL SYLLABLE JJE +CA84 ; LV # Lo HANGUL SYLLABLE JJYEO +CAA0 ; LV # Lo HANGUL SYLLABLE JJYE +CABC ; LV # Lo HANGUL SYLLABLE JJO +CAD8 ; LV # Lo HANGUL SYLLABLE JJWA +CAF4 ; LV # Lo HANGUL SYLLABLE JJWAE +CB10 ; LV # Lo HANGUL SYLLABLE JJOE +CB2C ; LV # Lo HANGUL SYLLABLE JJYO +CB48 ; LV # Lo HANGUL SYLLABLE JJU +CB64 ; LV # Lo HANGUL SYLLABLE JJWEO +CB80 ; LV # Lo HANGUL SYLLABLE JJWE +CB9C ; LV # Lo HANGUL SYLLABLE JJWI +CBB8 ; LV # Lo HANGUL SYLLABLE JJYU +CBD4 ; LV # Lo HANGUL SYLLABLE JJEU +CBF0 ; LV # Lo HANGUL SYLLABLE JJYI +CC0C ; LV # Lo HANGUL SYLLABLE JJI +CC28 ; LV # Lo HANGUL SYLLABLE CA +CC44 ; LV # Lo HANGUL SYLLABLE CAE +CC60 ; LV # Lo HANGUL SYLLABLE CYA +CC7C ; LV # Lo HANGUL SYLLABLE CYAE +CC98 ; LV # Lo HANGUL SYLLABLE CEO +CCB4 ; LV # Lo HANGUL SYLLABLE CE +CCD0 ; LV # Lo HANGUL SYLLABLE CYEO +CCEC ; LV # Lo HANGUL SYLLABLE CYE +CD08 ; LV # Lo HANGUL SYLLABLE CO +CD24 ; LV # Lo HANGUL SYLLABLE CWA +CD40 ; LV # Lo HANGUL SYLLABLE CWAE +CD5C ; LV # Lo HANGUL SYLLABLE COE +CD78 ; LV # Lo HANGUL SYLLABLE CYO +CD94 ; LV # Lo HANGUL SYLLABLE CU +CDB0 ; LV # Lo HANGUL SYLLABLE CWEO +CDCC ; LV # Lo HANGUL SYLLABLE CWE +CDE8 ; LV # Lo HANGUL SYLLABLE CWI +CE04 ; LV # Lo HANGUL SYLLABLE CYU +CE20 ; LV # Lo HANGUL SYLLABLE CEU +CE3C ; LV # Lo HANGUL SYLLABLE CYI +CE58 ; LV # Lo HANGUL SYLLABLE CI +CE74 ; LV # Lo HANGUL SYLLABLE KA +CE90 ; LV # Lo HANGUL SYLLABLE KAE +CEAC ; LV # Lo HANGUL SYLLABLE KYA +CEC8 ; LV # Lo HANGUL SYLLABLE KYAE +CEE4 ; LV # Lo HANGUL SYLLABLE KEO +CF00 ; LV # Lo HANGUL SYLLABLE KE +CF1C ; LV # Lo HANGUL SYLLABLE KYEO +CF38 ; LV # Lo HANGUL SYLLABLE KYE +CF54 ; LV # Lo HANGUL SYLLABLE KO +CF70 ; LV # Lo HANGUL SYLLABLE KWA +CF8C ; LV # Lo HANGUL SYLLABLE KWAE +CFA8 ; LV # Lo HANGUL SYLLABLE KOE +CFC4 ; LV # Lo HANGUL SYLLABLE KYO +CFE0 ; LV # Lo HANGUL SYLLABLE KU +CFFC ; LV # Lo HANGUL SYLLABLE KWEO +D018 ; LV # Lo HANGUL SYLLABLE KWE +D034 ; LV # Lo HANGUL SYLLABLE KWI +D050 ; LV # Lo HANGUL SYLLABLE KYU +D06C ; LV # Lo HANGUL SYLLABLE KEU +D088 ; LV # Lo HANGUL SYLLABLE KYI +D0A4 ; LV # Lo HANGUL SYLLABLE KI +D0C0 ; LV # Lo HANGUL SYLLABLE TA +D0DC ; LV # Lo HANGUL SYLLABLE TAE +D0F8 ; LV # Lo HANGUL SYLLABLE TYA +D114 ; LV # Lo HANGUL SYLLABLE TYAE +D130 ; LV # Lo HANGUL SYLLABLE TEO +D14C ; LV # Lo HANGUL SYLLABLE TE +D168 ; LV # Lo HANGUL SYLLABLE TYEO +D184 ; LV # Lo HANGUL SYLLABLE TYE +D1A0 ; LV # Lo HANGUL SYLLABLE TO +D1BC ; LV # Lo HANGUL SYLLABLE TWA +D1D8 ; LV # Lo HANGUL SYLLABLE TWAE +D1F4 ; LV # Lo HANGUL SYLLABLE TOE +D210 ; LV # Lo HANGUL SYLLABLE TYO +D22C ; LV # Lo HANGUL SYLLABLE TU +D248 ; LV # Lo HANGUL SYLLABLE TWEO +D264 ; LV # Lo HANGUL SYLLABLE TWE +D280 ; LV # Lo HANGUL SYLLABLE TWI +D29C ; LV # Lo HANGUL SYLLABLE TYU +D2B8 ; LV # Lo HANGUL SYLLABLE TEU +D2D4 ; LV # Lo HANGUL SYLLABLE TYI +D2F0 ; LV # Lo HANGUL SYLLABLE TI +D30C ; LV # Lo HANGUL SYLLABLE PA +D328 ; LV # Lo HANGUL SYLLABLE PAE +D344 ; LV # Lo HANGUL SYLLABLE PYA +D360 ; LV # Lo HANGUL SYLLABLE PYAE +D37C ; LV # Lo HANGUL SYLLABLE PEO +D398 ; LV # Lo HANGUL SYLLABLE PE +D3B4 ; LV # Lo HANGUL SYLLABLE PYEO +D3D0 ; LV # Lo HANGUL SYLLABLE PYE +D3EC ; LV # Lo HANGUL SYLLABLE PO +D408 ; LV # Lo HANGUL SYLLABLE PWA +D424 ; LV # Lo HANGUL SYLLABLE PWAE +D440 ; LV # Lo HANGUL SYLLABLE POE +D45C ; LV # Lo HANGUL SYLLABLE PYO +D478 ; LV # Lo HANGUL SYLLABLE PU +D494 ; LV # Lo HANGUL SYLLABLE PWEO +D4B0 ; LV # Lo HANGUL SYLLABLE PWE +D4CC ; LV # Lo HANGUL SYLLABLE PWI +D4E8 ; LV # Lo HANGUL SYLLABLE PYU +D504 ; LV # Lo HANGUL SYLLABLE PEU +D520 ; LV # Lo HANGUL SYLLABLE PYI +D53C ; LV # Lo HANGUL SYLLABLE PI +D558 ; LV # Lo HANGUL SYLLABLE HA +D574 ; LV # Lo HANGUL SYLLABLE HAE +D590 ; LV # Lo HANGUL SYLLABLE HYA +D5AC ; LV # Lo HANGUL SYLLABLE HYAE +D5C8 ; LV # Lo HANGUL SYLLABLE HEO +D5E4 ; LV # Lo HANGUL SYLLABLE HE +D600 ; LV # Lo HANGUL SYLLABLE HYEO +D61C ; LV # Lo HANGUL SYLLABLE HYE +D638 ; LV # Lo HANGUL SYLLABLE HO +D654 ; LV # Lo HANGUL SYLLABLE HWA +D670 ; LV # Lo HANGUL SYLLABLE HWAE +D68C ; LV # Lo HANGUL SYLLABLE HOE +D6A8 ; LV # Lo HANGUL SYLLABLE HYO +D6C4 ; LV # Lo HANGUL SYLLABLE HU +D6E0 ; LV # Lo HANGUL SYLLABLE HWEO +D6FC ; LV # Lo HANGUL SYLLABLE HWE +D718 ; LV # Lo HANGUL SYLLABLE HWI +D734 ; LV # Lo HANGUL SYLLABLE HYU +D750 ; LV # Lo HANGUL SYLLABLE HEU +D76C ; LV # Lo HANGUL SYLLABLE HYI +D788 ; LV # Lo HANGUL SYLLABLE HI + +# Total code points: 399 + +# ================================================ + +# Hangul_Syllable_Type=LVT_Syllable + +AC01..AC1B ; LVT # Lo [27] HANGUL SYLLABLE GAG..HANGUL SYLLABLE GAH +AC1D..AC37 ; LVT # Lo [27] HANGUL SYLLABLE GAEG..HANGUL SYLLABLE GAEH +AC39..AC53 ; LVT # Lo [27] HANGUL SYLLABLE GYAG..HANGUL SYLLABLE GYAH +AC55..AC6F ; LVT # Lo [27] HANGUL SYLLABLE GYAEG..HANGUL SYLLABLE GYAEH +AC71..AC8B ; LVT # Lo [27] HANGUL SYLLABLE GEOG..HANGUL SYLLABLE GEOH +AC8D..ACA7 ; LVT # Lo [27] HANGUL SYLLABLE GEG..HANGUL SYLLABLE GEH +ACA9..ACC3 ; LVT # Lo [27] HANGUL SYLLABLE GYEOG..HANGUL SYLLABLE GYEOH +ACC5..ACDF ; LVT # Lo [27] HANGUL SYLLABLE GYEG..HANGUL SYLLABLE GYEH +ACE1..ACFB ; LVT # Lo [27] HANGUL SYLLABLE GOG..HANGUL SYLLABLE GOH +ACFD..AD17 ; LVT # Lo [27] HANGUL SYLLABLE GWAG..HANGUL SYLLABLE GWAH +AD19..AD33 ; LVT # Lo [27] HANGUL SYLLABLE GWAEG..HANGUL SYLLABLE GWAEH +AD35..AD4F ; LVT # Lo [27] HANGUL SYLLABLE GOEG..HANGUL SYLLABLE GOEH +AD51..AD6B ; LVT # Lo [27] HANGUL SYLLABLE GYOG..HANGUL SYLLABLE GYOH +AD6D..AD87 ; LVT # Lo [27] HANGUL SYLLABLE GUG..HANGUL SYLLABLE GUH +AD89..ADA3 ; LVT # Lo [27] HANGUL SYLLABLE GWEOG..HANGUL SYLLABLE GWEOH +ADA5..ADBF ; LVT # Lo [27] HANGUL SYLLABLE GWEG..HANGUL SYLLABLE GWEH +ADC1..ADDB ; LVT # Lo [27] HANGUL SYLLABLE GWIG..HANGUL SYLLABLE GWIH +ADDD..ADF7 ; LVT # Lo [27] HANGUL SYLLABLE GYUG..HANGUL SYLLABLE GYUH +ADF9..AE13 ; LVT # Lo [27] HANGUL SYLLABLE GEUG..HANGUL SYLLABLE GEUH +AE15..AE2F ; LVT # Lo [27] HANGUL SYLLABLE GYIG..HANGUL SYLLABLE GYIH +AE31..AE4B ; LVT # Lo [27] HANGUL SYLLABLE GIG..HANGUL SYLLABLE GIH +AE4D..AE67 ; LVT # Lo [27] HANGUL SYLLABLE GGAG..HANGUL SYLLABLE GGAH +AE69..AE83 ; LVT # Lo [27] HANGUL SYLLABLE GGAEG..HANGUL SYLLABLE GGAEH +AE85..AE9F ; LVT # Lo [27] HANGUL SYLLABLE GGYAG..HANGUL SYLLABLE GGYAH +AEA1..AEBB ; LVT # Lo [27] HANGUL SYLLABLE GGYAEG..HANGUL SYLLABLE GGYAEH +AEBD..AED7 ; LVT # Lo [27] HANGUL SYLLABLE GGEOG..HANGUL SYLLABLE GGEOH +AED9..AEF3 ; LVT # Lo [27] HANGUL SYLLABLE GGEG..HANGUL SYLLABLE GGEH +AEF5..AF0F ; LVT # Lo [27] HANGUL SYLLABLE GGYEOG..HANGUL SYLLABLE GGYEOH +AF11..AF2B ; LVT # Lo [27] HANGUL SYLLABLE GGYEG..HANGUL SYLLABLE GGYEH +AF2D..AF47 ; LVT # Lo [27] HANGUL SYLLABLE GGOG..HANGUL SYLLABLE GGOH +AF49..AF63 ; LVT # Lo [27] HANGUL SYLLABLE GGWAG..HANGUL SYLLABLE GGWAH +AF65..AF7F ; LVT # Lo [27] HANGUL SYLLABLE GGWAEG..HANGUL SYLLABLE GGWAEH +AF81..AF9B ; LVT # Lo [27] HANGUL SYLLABLE GGOEG..HANGUL SYLLABLE GGOEH +AF9D..AFB7 ; LVT # Lo [27] HANGUL SYLLABLE GGYOG..HANGUL SYLLABLE GGYOH +AFB9..AFD3 ; LVT # Lo [27] HANGUL SYLLABLE GGUG..HANGUL SYLLABLE GGUH +AFD5..AFEF ; LVT # Lo [27] HANGUL SYLLABLE GGWEOG..HANGUL SYLLABLE GGWEOH +AFF1..B00B ; LVT # Lo [27] HANGUL SYLLABLE GGWEG..HANGUL SYLLABLE GGWEH +B00D..B027 ; LVT # Lo [27] HANGUL SYLLABLE GGWIG..HANGUL SYLLABLE GGWIH +B029..B043 ; LVT # Lo [27] HANGUL SYLLABLE GGYUG..HANGUL SYLLABLE GGYUH +B045..B05F ; LVT # Lo [27] HANGUL SYLLABLE GGEUG..HANGUL SYLLABLE GGEUH +B061..B07B ; LVT # Lo [27] HANGUL SYLLABLE GGYIG..HANGUL SYLLABLE GGYIH +B07D..B097 ; LVT # Lo [27] HANGUL SYLLABLE GGIG..HANGUL SYLLABLE GGIH +B099..B0B3 ; LVT # Lo [27] HANGUL SYLLABLE NAG..HANGUL SYLLABLE NAH +B0B5..B0CF ; LVT # Lo [27] HANGUL SYLLABLE NAEG..HANGUL SYLLABLE NAEH +B0D1..B0EB ; LVT # Lo [27] HANGUL SYLLABLE NYAG..HANGUL SYLLABLE NYAH +B0ED..B107 ; LVT # Lo [27] HANGUL SYLLABLE NYAEG..HANGUL SYLLABLE NYAEH +B109..B123 ; LVT # Lo [27] HANGUL SYLLABLE NEOG..HANGUL SYLLABLE NEOH +B125..B13F ; LVT # Lo [27] HANGUL SYLLABLE NEG..HANGUL SYLLABLE NEH +B141..B15B ; LVT # Lo [27] HANGUL SYLLABLE NYEOG..HANGUL SYLLABLE NYEOH +B15D..B177 ; LVT # Lo [27] HANGUL SYLLABLE NYEG..HANGUL SYLLABLE NYEH +B179..B193 ; LVT # Lo [27] HANGUL SYLLABLE NOG..HANGUL SYLLABLE NOH +B195..B1AF ; LVT # Lo [27] HANGUL SYLLABLE NWAG..HANGUL SYLLABLE NWAH +B1B1..B1CB ; LVT # Lo [27] HANGUL SYLLABLE NWAEG..HANGUL SYLLABLE NWAEH +B1CD..B1E7 ; LVT # Lo [27] HANGUL SYLLABLE NOEG..HANGUL SYLLABLE NOEH +B1E9..B203 ; LVT # Lo [27] HANGUL SYLLABLE NYOG..HANGUL SYLLABLE NYOH +B205..B21F ; LVT # Lo [27] HANGUL SYLLABLE NUG..HANGUL SYLLABLE NUH +B221..B23B ; LVT # Lo [27] HANGUL SYLLABLE NWEOG..HANGUL SYLLABLE NWEOH +B23D..B257 ; LVT # Lo [27] HANGUL SYLLABLE NWEG..HANGUL SYLLABLE NWEH +B259..B273 ; LVT # Lo [27] HANGUL SYLLABLE NWIG..HANGUL SYLLABLE NWIH +B275..B28F ; LVT # Lo [27] HANGUL SYLLABLE NYUG..HANGUL SYLLABLE NYUH +B291..B2AB ; LVT # Lo [27] HANGUL SYLLABLE NEUG..HANGUL SYLLABLE NEUH +B2AD..B2C7 ; LVT # Lo [27] HANGUL SYLLABLE NYIG..HANGUL SYLLABLE NYIH +B2C9..B2E3 ; LVT # Lo [27] HANGUL SYLLABLE NIG..HANGUL SYLLABLE NIH +B2E5..B2FF ; LVT # Lo [27] HANGUL SYLLABLE DAG..HANGUL SYLLABLE DAH +B301..B31B ; LVT # Lo [27] HANGUL SYLLABLE DAEG..HANGUL SYLLABLE DAEH +B31D..B337 ; LVT # Lo [27] HANGUL SYLLABLE DYAG..HANGUL SYLLABLE DYAH +B339..B353 ; LVT # Lo [27] HANGUL SYLLABLE DYAEG..HANGUL SYLLABLE DYAEH +B355..B36F ; LVT # Lo [27] HANGUL SYLLABLE DEOG..HANGUL SYLLABLE DEOH +B371..B38B ; LVT # Lo [27] HANGUL SYLLABLE DEG..HANGUL SYLLABLE DEH +B38D..B3A7 ; LVT # Lo [27] HANGUL SYLLABLE DYEOG..HANGUL SYLLABLE DYEOH +B3A9..B3C3 ; LVT # Lo [27] HANGUL SYLLABLE DYEG..HANGUL SYLLABLE DYEH +B3C5..B3DF ; LVT # Lo [27] HANGUL SYLLABLE DOG..HANGUL SYLLABLE DOH +B3E1..B3FB ; LVT # Lo [27] HANGUL SYLLABLE DWAG..HANGUL SYLLABLE DWAH +B3FD..B417 ; LVT # Lo [27] HANGUL SYLLABLE DWAEG..HANGUL SYLLABLE DWAEH +B419..B433 ; LVT # Lo [27] HANGUL SYLLABLE DOEG..HANGUL SYLLABLE DOEH +B435..B44F ; LVT # Lo [27] HANGUL SYLLABLE DYOG..HANGUL SYLLABLE DYOH +B451..B46B ; LVT # Lo [27] HANGUL SYLLABLE DUG..HANGUL SYLLABLE DUH +B46D..B487 ; LVT # Lo [27] HANGUL SYLLABLE DWEOG..HANGUL SYLLABLE DWEOH +B489..B4A3 ; LVT # Lo [27] HANGUL SYLLABLE DWEG..HANGUL SYLLABLE DWEH +B4A5..B4BF ; LVT # Lo [27] HANGUL SYLLABLE DWIG..HANGUL SYLLABLE DWIH +B4C1..B4DB ; LVT # Lo [27] HANGUL SYLLABLE DYUG..HANGUL SYLLABLE DYUH +B4DD..B4F7 ; LVT # Lo [27] HANGUL SYLLABLE DEUG..HANGUL SYLLABLE DEUH +B4F9..B513 ; LVT # Lo [27] HANGUL SYLLABLE DYIG..HANGUL SYLLABLE DYIH +B515..B52F ; LVT # Lo [27] HANGUL SYLLABLE DIG..HANGUL SYLLABLE DIH +B531..B54B ; LVT # Lo [27] HANGUL SYLLABLE DDAG..HANGUL SYLLABLE DDAH +B54D..B567 ; LVT # Lo [27] HANGUL SYLLABLE DDAEG..HANGUL SYLLABLE DDAEH +B569..B583 ; LVT # Lo [27] HANGUL SYLLABLE DDYAG..HANGUL SYLLABLE DDYAH +B585..B59F ; LVT # Lo [27] HANGUL SYLLABLE DDYAEG..HANGUL SYLLABLE DDYAEH +B5A1..B5BB ; LVT # Lo [27] HANGUL SYLLABLE DDEOG..HANGUL SYLLABLE DDEOH +B5BD..B5D7 ; LVT # Lo [27] HANGUL SYLLABLE DDEG..HANGUL SYLLABLE DDEH +B5D9..B5F3 ; LVT # Lo [27] HANGUL SYLLABLE DDYEOG..HANGUL SYLLABLE DDYEOH +B5F5..B60F ; LVT # Lo [27] HANGUL SYLLABLE DDYEG..HANGUL SYLLABLE DDYEH +B611..B62B ; LVT # Lo [27] HANGUL SYLLABLE DDOG..HANGUL SYLLABLE DDOH +B62D..B647 ; LVT # Lo [27] HANGUL SYLLABLE DDWAG..HANGUL SYLLABLE DDWAH +B649..B663 ; LVT # Lo [27] HANGUL SYLLABLE DDWAEG..HANGUL SYLLABLE DDWAEH +B665..B67F ; LVT # Lo [27] HANGUL SYLLABLE DDOEG..HANGUL SYLLABLE DDOEH +B681..B69B ; LVT # Lo [27] HANGUL SYLLABLE DDYOG..HANGUL SYLLABLE DDYOH +B69D..B6B7 ; LVT # Lo [27] HANGUL SYLLABLE DDUG..HANGUL SYLLABLE DDUH +B6B9..B6D3 ; LVT # Lo [27] HANGUL SYLLABLE DDWEOG..HANGUL SYLLABLE DDWEOH +B6D5..B6EF ; LVT # Lo [27] HANGUL SYLLABLE DDWEG..HANGUL SYLLABLE DDWEH +B6F1..B70B ; LVT # Lo [27] HANGUL SYLLABLE DDWIG..HANGUL SYLLABLE DDWIH +B70D..B727 ; LVT # Lo [27] HANGUL SYLLABLE DDYUG..HANGUL SYLLABLE DDYUH +B729..B743 ; LVT # Lo [27] HANGUL SYLLABLE DDEUG..HANGUL SYLLABLE DDEUH +B745..B75F ; LVT # Lo [27] HANGUL SYLLABLE DDYIG..HANGUL SYLLABLE DDYIH +B761..B77B ; LVT # Lo [27] HANGUL SYLLABLE DDIG..HANGUL SYLLABLE DDIH +B77D..B797 ; LVT # Lo [27] HANGUL SYLLABLE RAG..HANGUL SYLLABLE RAH +B799..B7B3 ; LVT # Lo [27] HANGUL SYLLABLE RAEG..HANGUL SYLLABLE RAEH +B7B5..B7CF ; LVT # Lo [27] HANGUL SYLLABLE RYAG..HANGUL SYLLABLE RYAH +B7D1..B7EB ; LVT # Lo [27] HANGUL SYLLABLE RYAEG..HANGUL SYLLABLE RYAEH +B7ED..B807 ; LVT # Lo [27] HANGUL SYLLABLE REOG..HANGUL SYLLABLE REOH +B809..B823 ; LVT # Lo [27] HANGUL SYLLABLE REG..HANGUL SYLLABLE REH +B825..B83F ; LVT # Lo [27] HANGUL SYLLABLE RYEOG..HANGUL SYLLABLE RYEOH +B841..B85B ; LVT # Lo [27] HANGUL SYLLABLE RYEG..HANGUL SYLLABLE RYEH +B85D..B877 ; LVT # Lo [27] HANGUL SYLLABLE ROG..HANGUL SYLLABLE ROH +B879..B893 ; LVT # Lo [27] HANGUL SYLLABLE RWAG..HANGUL SYLLABLE RWAH +B895..B8AF ; LVT # Lo [27] HANGUL SYLLABLE RWAEG..HANGUL SYLLABLE RWAEH +B8B1..B8CB ; LVT # Lo [27] HANGUL SYLLABLE ROEG..HANGUL SYLLABLE ROEH +B8CD..B8E7 ; LVT # Lo [27] HANGUL SYLLABLE RYOG..HANGUL SYLLABLE RYOH +B8E9..B903 ; LVT # Lo [27] HANGUL SYLLABLE RUG..HANGUL SYLLABLE RUH +B905..B91F ; LVT # Lo [27] HANGUL SYLLABLE RWEOG..HANGUL SYLLABLE RWEOH +B921..B93B ; LVT # Lo [27] HANGUL SYLLABLE RWEG..HANGUL SYLLABLE RWEH +B93D..B957 ; LVT # Lo [27] HANGUL SYLLABLE RWIG..HANGUL SYLLABLE RWIH +B959..B973 ; LVT # Lo [27] HANGUL SYLLABLE RYUG..HANGUL SYLLABLE RYUH +B975..B98F ; LVT # Lo [27] HANGUL SYLLABLE REUG..HANGUL SYLLABLE REUH +B991..B9AB ; LVT # Lo [27] HANGUL SYLLABLE RYIG..HANGUL SYLLABLE RYIH +B9AD..B9C7 ; LVT # Lo [27] HANGUL SYLLABLE RIG..HANGUL SYLLABLE RIH +B9C9..B9E3 ; LVT # Lo [27] HANGUL SYLLABLE MAG..HANGUL SYLLABLE MAH +B9E5..B9FF ; LVT # Lo [27] HANGUL SYLLABLE MAEG..HANGUL SYLLABLE MAEH +BA01..BA1B ; LVT # Lo [27] HANGUL SYLLABLE MYAG..HANGUL SYLLABLE MYAH +BA1D..BA37 ; LVT # Lo [27] HANGUL SYLLABLE MYAEG..HANGUL SYLLABLE MYAEH +BA39..BA53 ; LVT # Lo [27] HANGUL SYLLABLE MEOG..HANGUL SYLLABLE MEOH +BA55..BA6F ; LVT # Lo [27] HANGUL SYLLABLE MEG..HANGUL SYLLABLE MEH +BA71..BA8B ; LVT # Lo [27] HANGUL SYLLABLE MYEOG..HANGUL SYLLABLE MYEOH +BA8D..BAA7 ; LVT # Lo [27] HANGUL SYLLABLE MYEG..HANGUL SYLLABLE MYEH +BAA9..BAC3 ; LVT # Lo [27] HANGUL SYLLABLE MOG..HANGUL SYLLABLE MOH +BAC5..BADF ; LVT # Lo [27] HANGUL SYLLABLE MWAG..HANGUL SYLLABLE MWAH +BAE1..BAFB ; LVT # Lo [27] HANGUL SYLLABLE MWAEG..HANGUL SYLLABLE MWAEH +BAFD..BB17 ; LVT # Lo [27] HANGUL SYLLABLE MOEG..HANGUL SYLLABLE MOEH +BB19..BB33 ; LVT # Lo [27] HANGUL SYLLABLE MYOG..HANGUL SYLLABLE MYOH +BB35..BB4F ; LVT # Lo [27] HANGUL SYLLABLE MUG..HANGUL SYLLABLE MUH +BB51..BB6B ; LVT # Lo [27] HANGUL SYLLABLE MWEOG..HANGUL SYLLABLE MWEOH +BB6D..BB87 ; LVT # Lo [27] HANGUL SYLLABLE MWEG..HANGUL SYLLABLE MWEH +BB89..BBA3 ; LVT # Lo [27] HANGUL SYLLABLE MWIG..HANGUL SYLLABLE MWIH +BBA5..BBBF ; LVT # Lo [27] HANGUL SYLLABLE MYUG..HANGUL SYLLABLE MYUH +BBC1..BBDB ; LVT # Lo [27] HANGUL SYLLABLE MEUG..HANGUL SYLLABLE MEUH +BBDD..BBF7 ; LVT # Lo [27] HANGUL SYLLABLE MYIG..HANGUL SYLLABLE MYIH +BBF9..BC13 ; LVT # Lo [27] HANGUL SYLLABLE MIG..HANGUL SYLLABLE MIH +BC15..BC2F ; LVT # Lo [27] HANGUL SYLLABLE BAG..HANGUL SYLLABLE BAH +BC31..BC4B ; LVT # Lo [27] HANGUL SYLLABLE BAEG..HANGUL SYLLABLE BAEH +BC4D..BC67 ; LVT # Lo [27] HANGUL SYLLABLE BYAG..HANGUL SYLLABLE BYAH +BC69..BC83 ; LVT # Lo [27] HANGUL SYLLABLE BYAEG..HANGUL SYLLABLE BYAEH +BC85..BC9F ; LVT # Lo [27] HANGUL SYLLABLE BEOG..HANGUL SYLLABLE BEOH +BCA1..BCBB ; LVT # Lo [27] HANGUL SYLLABLE BEG..HANGUL SYLLABLE BEH +BCBD..BCD7 ; LVT # Lo [27] HANGUL SYLLABLE BYEOG..HANGUL SYLLABLE BYEOH +BCD9..BCF3 ; LVT # Lo [27] HANGUL SYLLABLE BYEG..HANGUL SYLLABLE BYEH +BCF5..BD0F ; LVT # Lo [27] HANGUL SYLLABLE BOG..HANGUL SYLLABLE BOH +BD11..BD2B ; LVT # Lo [27] HANGUL SYLLABLE BWAG..HANGUL SYLLABLE BWAH +BD2D..BD47 ; LVT # Lo [27] HANGUL SYLLABLE BWAEG..HANGUL SYLLABLE BWAEH +BD49..BD63 ; LVT # Lo [27] HANGUL SYLLABLE BOEG..HANGUL SYLLABLE BOEH +BD65..BD7F ; LVT # Lo [27] HANGUL SYLLABLE BYOG..HANGUL SYLLABLE BYOH +BD81..BD9B ; LVT # Lo [27] HANGUL SYLLABLE BUG..HANGUL SYLLABLE BUH +BD9D..BDB7 ; LVT # Lo [27] HANGUL SYLLABLE BWEOG..HANGUL SYLLABLE BWEOH +BDB9..BDD3 ; LVT # Lo [27] HANGUL SYLLABLE BWEG..HANGUL SYLLABLE BWEH +BDD5..BDEF ; LVT # Lo [27] HANGUL SYLLABLE BWIG..HANGUL SYLLABLE BWIH +BDF1..BE0B ; LVT # Lo [27] HANGUL SYLLABLE BYUG..HANGUL SYLLABLE BYUH +BE0D..BE27 ; LVT # Lo [27] HANGUL SYLLABLE BEUG..HANGUL SYLLABLE BEUH +BE29..BE43 ; LVT # Lo [27] HANGUL SYLLABLE BYIG..HANGUL SYLLABLE BYIH +BE45..BE5F ; LVT # Lo [27] HANGUL SYLLABLE BIG..HANGUL SYLLABLE BIH +BE61..BE7B ; LVT # Lo [27] HANGUL SYLLABLE BBAG..HANGUL SYLLABLE BBAH +BE7D..BE97 ; LVT # Lo [27] HANGUL SYLLABLE BBAEG..HANGUL SYLLABLE BBAEH +BE99..BEB3 ; LVT # Lo [27] HANGUL SYLLABLE BBYAG..HANGUL SYLLABLE BBYAH +BEB5..BECF ; LVT # Lo [27] HANGUL SYLLABLE BBYAEG..HANGUL SYLLABLE BBYAEH +BED1..BEEB ; LVT # Lo [27] HANGUL SYLLABLE BBEOG..HANGUL SYLLABLE BBEOH +BEED..BF07 ; LVT # Lo [27] HANGUL SYLLABLE BBEG..HANGUL SYLLABLE BBEH +BF09..BF23 ; LVT # Lo [27] HANGUL SYLLABLE BBYEOG..HANGUL SYLLABLE BBYEOH +BF25..BF3F ; LVT # Lo [27] HANGUL SYLLABLE BBYEG..HANGUL SYLLABLE BBYEH +BF41..BF5B ; LVT # Lo [27] HANGUL SYLLABLE BBOG..HANGUL SYLLABLE BBOH +BF5D..BF77 ; LVT # Lo [27] HANGUL SYLLABLE BBWAG..HANGUL SYLLABLE BBWAH +BF79..BF93 ; LVT # Lo [27] HANGUL SYLLABLE BBWAEG..HANGUL SYLLABLE BBWAEH +BF95..BFAF ; LVT # Lo [27] HANGUL SYLLABLE BBOEG..HANGUL SYLLABLE BBOEH +BFB1..BFCB ; LVT # Lo [27] HANGUL SYLLABLE BBYOG..HANGUL SYLLABLE BBYOH +BFCD..BFE7 ; LVT # Lo [27] HANGUL SYLLABLE BBUG..HANGUL SYLLABLE BBUH +BFE9..C003 ; LVT # Lo [27] HANGUL SYLLABLE BBWEOG..HANGUL SYLLABLE BBWEOH +C005..C01F ; LVT # Lo [27] HANGUL SYLLABLE BBWEG..HANGUL SYLLABLE BBWEH +C021..C03B ; LVT # Lo [27] HANGUL SYLLABLE BBWIG..HANGUL SYLLABLE BBWIH +C03D..C057 ; LVT # Lo [27] HANGUL SYLLABLE BBYUG..HANGUL SYLLABLE BBYUH +C059..C073 ; LVT # Lo [27] HANGUL SYLLABLE BBEUG..HANGUL SYLLABLE BBEUH +C075..C08F ; LVT # Lo [27] HANGUL SYLLABLE BBYIG..HANGUL SYLLABLE BBYIH +C091..C0AB ; LVT # Lo [27] HANGUL SYLLABLE BBIG..HANGUL SYLLABLE BBIH +C0AD..C0C7 ; LVT # Lo [27] HANGUL SYLLABLE SAG..HANGUL SYLLABLE SAH +C0C9..C0E3 ; LVT # Lo [27] HANGUL SYLLABLE SAEG..HANGUL SYLLABLE SAEH +C0E5..C0FF ; LVT # Lo [27] HANGUL SYLLABLE SYAG..HANGUL SYLLABLE SYAH +C101..C11B ; LVT # Lo [27] HANGUL SYLLABLE SYAEG..HANGUL SYLLABLE SYAEH +C11D..C137 ; LVT # Lo [27] HANGUL SYLLABLE SEOG..HANGUL SYLLABLE SEOH +C139..C153 ; LVT # Lo [27] HANGUL SYLLABLE SEG..HANGUL SYLLABLE SEH +C155..C16F ; LVT # Lo [27] HANGUL SYLLABLE SYEOG..HANGUL SYLLABLE SYEOH +C171..C18B ; LVT # Lo [27] HANGUL SYLLABLE SYEG..HANGUL SYLLABLE SYEH +C18D..C1A7 ; LVT # Lo [27] HANGUL SYLLABLE SOG..HANGUL SYLLABLE SOH +C1A9..C1C3 ; LVT # Lo [27] HANGUL SYLLABLE SWAG..HANGUL SYLLABLE SWAH +C1C5..C1DF ; LVT # Lo [27] HANGUL SYLLABLE SWAEG..HANGUL SYLLABLE SWAEH +C1E1..C1FB ; LVT # Lo [27] HANGUL SYLLABLE SOEG..HANGUL SYLLABLE SOEH +C1FD..C217 ; LVT # Lo [27] HANGUL SYLLABLE SYOG..HANGUL SYLLABLE SYOH +C219..C233 ; LVT # Lo [27] HANGUL SYLLABLE SUG..HANGUL SYLLABLE SUH +C235..C24F ; LVT # Lo [27] HANGUL SYLLABLE SWEOG..HANGUL SYLLABLE SWEOH +C251..C26B ; LVT # Lo [27] HANGUL SYLLABLE SWEG..HANGUL SYLLABLE SWEH +C26D..C287 ; LVT # Lo [27] HANGUL SYLLABLE SWIG..HANGUL SYLLABLE SWIH +C289..C2A3 ; LVT # Lo [27] HANGUL SYLLABLE SYUG..HANGUL SYLLABLE SYUH +C2A5..C2BF ; LVT # Lo [27] HANGUL SYLLABLE SEUG..HANGUL SYLLABLE SEUH +C2C1..C2DB ; LVT # Lo [27] HANGUL SYLLABLE SYIG..HANGUL SYLLABLE SYIH +C2DD..C2F7 ; LVT # Lo [27] HANGUL SYLLABLE SIG..HANGUL SYLLABLE SIH +C2F9..C313 ; LVT # Lo [27] HANGUL SYLLABLE SSAG..HANGUL SYLLABLE SSAH +C315..C32F ; LVT # Lo [27] HANGUL SYLLABLE SSAEG..HANGUL SYLLABLE SSAEH +C331..C34B ; LVT # Lo [27] HANGUL SYLLABLE SSYAG..HANGUL SYLLABLE SSYAH +C34D..C367 ; LVT # Lo [27] HANGUL SYLLABLE SSYAEG..HANGUL SYLLABLE SSYAEH +C369..C383 ; LVT # Lo [27] HANGUL SYLLABLE SSEOG..HANGUL SYLLABLE SSEOH +C385..C39F ; LVT # Lo [27] HANGUL SYLLABLE SSEG..HANGUL SYLLABLE SSEH +C3A1..C3BB ; LVT # Lo [27] HANGUL SYLLABLE SSYEOG..HANGUL SYLLABLE SSYEOH +C3BD..C3D7 ; LVT # Lo [27] HANGUL SYLLABLE SSYEG..HANGUL SYLLABLE SSYEH +C3D9..C3F3 ; LVT # Lo [27] HANGUL SYLLABLE SSOG..HANGUL SYLLABLE SSOH +C3F5..C40F ; LVT # Lo [27] HANGUL SYLLABLE SSWAG..HANGUL SYLLABLE SSWAH +C411..C42B ; LVT # Lo [27] HANGUL SYLLABLE SSWAEG..HANGUL SYLLABLE SSWAEH +C42D..C447 ; LVT # Lo [27] HANGUL SYLLABLE SSOEG..HANGUL SYLLABLE SSOEH +C449..C463 ; LVT # Lo [27] HANGUL SYLLABLE SSYOG..HANGUL SYLLABLE SSYOH +C465..C47F ; LVT # Lo [27] HANGUL SYLLABLE SSUG..HANGUL SYLLABLE SSUH +C481..C49B ; LVT # Lo [27] HANGUL SYLLABLE SSWEOG..HANGUL SYLLABLE SSWEOH +C49D..C4B7 ; LVT # Lo [27] HANGUL SYLLABLE SSWEG..HANGUL SYLLABLE SSWEH +C4B9..C4D3 ; LVT # Lo [27] HANGUL SYLLABLE SSWIG..HANGUL SYLLABLE SSWIH +C4D5..C4EF ; LVT # Lo [27] HANGUL SYLLABLE SSYUG..HANGUL SYLLABLE SSYUH +C4F1..C50B ; LVT # Lo [27] HANGUL SYLLABLE SSEUG..HANGUL SYLLABLE SSEUH +C50D..C527 ; LVT # Lo [27] HANGUL SYLLABLE SSYIG..HANGUL SYLLABLE SSYIH +C529..C543 ; LVT # Lo [27] HANGUL SYLLABLE SSIG..HANGUL SYLLABLE SSIH +C545..C55F ; LVT # Lo [27] HANGUL SYLLABLE AG..HANGUL SYLLABLE AH +C561..C57B ; LVT # Lo [27] HANGUL SYLLABLE AEG..HANGUL SYLLABLE AEH +C57D..C597 ; LVT # Lo [27] HANGUL SYLLABLE YAG..HANGUL SYLLABLE YAH +C599..C5B3 ; LVT # Lo [27] HANGUL SYLLABLE YAEG..HANGUL SYLLABLE YAEH +C5B5..C5CF ; LVT # Lo [27] HANGUL SYLLABLE EOG..HANGUL SYLLABLE EOH +C5D1..C5EB ; LVT # Lo [27] HANGUL SYLLABLE EG..HANGUL SYLLABLE EH +C5ED..C607 ; LVT # Lo [27] HANGUL SYLLABLE YEOG..HANGUL SYLLABLE YEOH +C609..C623 ; LVT # Lo [27] HANGUL SYLLABLE YEG..HANGUL SYLLABLE YEH +C625..C63F ; LVT # Lo [27] HANGUL SYLLABLE OG..HANGUL SYLLABLE OH +C641..C65B ; LVT # Lo [27] HANGUL SYLLABLE WAG..HANGUL SYLLABLE WAH +C65D..C677 ; LVT # Lo [27] HANGUL SYLLABLE WAEG..HANGUL SYLLABLE WAEH +C679..C693 ; LVT # Lo [27] HANGUL SYLLABLE OEG..HANGUL SYLLABLE OEH +C695..C6AF ; LVT # Lo [27] HANGUL SYLLABLE YOG..HANGUL SYLLABLE YOH +C6B1..C6CB ; LVT # Lo [27] HANGUL SYLLABLE UG..HANGUL SYLLABLE UH +C6CD..C6E7 ; LVT # Lo [27] HANGUL SYLLABLE WEOG..HANGUL SYLLABLE WEOH +C6E9..C703 ; LVT # Lo [27] HANGUL SYLLABLE WEG..HANGUL SYLLABLE WEH +C705..C71F ; LVT # Lo [27] HANGUL SYLLABLE WIG..HANGUL SYLLABLE WIH +C721..C73B ; LVT # Lo [27] HANGUL SYLLABLE YUG..HANGUL SYLLABLE YUH +C73D..C757 ; LVT # Lo [27] HANGUL SYLLABLE EUG..HANGUL SYLLABLE EUH +C759..C773 ; LVT # Lo [27] HANGUL SYLLABLE YIG..HANGUL SYLLABLE YIH +C775..C78F ; LVT # Lo [27] HANGUL SYLLABLE IG..HANGUL SYLLABLE IH +C791..C7AB ; LVT # Lo [27] HANGUL SYLLABLE JAG..HANGUL SYLLABLE JAH +C7AD..C7C7 ; LVT # Lo [27] HANGUL SYLLABLE JAEG..HANGUL SYLLABLE JAEH +C7C9..C7E3 ; LVT # Lo [27] HANGUL SYLLABLE JYAG..HANGUL SYLLABLE JYAH +C7E5..C7FF ; LVT # Lo [27] HANGUL SYLLABLE JYAEG..HANGUL SYLLABLE JYAEH +C801..C81B ; LVT # Lo [27] HANGUL SYLLABLE JEOG..HANGUL SYLLABLE JEOH +C81D..C837 ; LVT # Lo [27] HANGUL SYLLABLE JEG..HANGUL SYLLABLE JEH +C839..C853 ; LVT # Lo [27] HANGUL SYLLABLE JYEOG..HANGUL SYLLABLE JYEOH +C855..C86F ; LVT # Lo [27] HANGUL SYLLABLE JYEG..HANGUL SYLLABLE JYEH +C871..C88B ; LVT # Lo [27] HANGUL SYLLABLE JOG..HANGUL SYLLABLE JOH +C88D..C8A7 ; LVT # Lo [27] HANGUL SYLLABLE JWAG..HANGUL SYLLABLE JWAH +C8A9..C8C3 ; LVT # Lo [27] HANGUL SYLLABLE JWAEG..HANGUL SYLLABLE JWAEH +C8C5..C8DF ; LVT # Lo [27] HANGUL SYLLABLE JOEG..HANGUL SYLLABLE JOEH +C8E1..C8FB ; LVT # Lo [27] HANGUL SYLLABLE JYOG..HANGUL SYLLABLE JYOH +C8FD..C917 ; LVT # Lo [27] HANGUL SYLLABLE JUG..HANGUL SYLLABLE JUH +C919..C933 ; LVT # Lo [27] HANGUL SYLLABLE JWEOG..HANGUL SYLLABLE JWEOH +C935..C94F ; LVT # Lo [27] HANGUL SYLLABLE JWEG..HANGUL SYLLABLE JWEH +C951..C96B ; LVT # Lo [27] HANGUL SYLLABLE JWIG..HANGUL SYLLABLE JWIH +C96D..C987 ; LVT # Lo [27] HANGUL SYLLABLE JYUG..HANGUL SYLLABLE JYUH +C989..C9A3 ; LVT # Lo [27] HANGUL SYLLABLE JEUG..HANGUL SYLLABLE JEUH +C9A5..C9BF ; LVT # Lo [27] HANGUL SYLLABLE JYIG..HANGUL SYLLABLE JYIH +C9C1..C9DB ; LVT # Lo [27] HANGUL SYLLABLE JIG..HANGUL SYLLABLE JIH +C9DD..C9F7 ; LVT # Lo [27] HANGUL SYLLABLE JJAG..HANGUL SYLLABLE JJAH +C9F9..CA13 ; LVT # Lo [27] HANGUL SYLLABLE JJAEG..HANGUL SYLLABLE JJAEH +CA15..CA2F ; LVT # Lo [27] HANGUL SYLLABLE JJYAG..HANGUL SYLLABLE JJYAH +CA31..CA4B ; LVT # Lo [27] HANGUL SYLLABLE JJYAEG..HANGUL SYLLABLE JJYAEH +CA4D..CA67 ; LVT # Lo [27] HANGUL SYLLABLE JJEOG..HANGUL SYLLABLE JJEOH +CA69..CA83 ; LVT # Lo [27] HANGUL SYLLABLE JJEG..HANGUL SYLLABLE JJEH +CA85..CA9F ; LVT # Lo [27] HANGUL SYLLABLE JJYEOG..HANGUL SYLLABLE JJYEOH +CAA1..CABB ; LVT # Lo [27] HANGUL SYLLABLE JJYEG..HANGUL SYLLABLE JJYEH +CABD..CAD7 ; LVT # Lo [27] HANGUL SYLLABLE JJOG..HANGUL SYLLABLE JJOH +CAD9..CAF3 ; LVT # Lo [27] HANGUL SYLLABLE JJWAG..HANGUL SYLLABLE JJWAH +CAF5..CB0F ; LVT # Lo [27] HANGUL SYLLABLE JJWAEG..HANGUL SYLLABLE JJWAEH +CB11..CB2B ; LVT # Lo [27] HANGUL SYLLABLE JJOEG..HANGUL SYLLABLE JJOEH +CB2D..CB47 ; LVT # Lo [27] HANGUL SYLLABLE JJYOG..HANGUL SYLLABLE JJYOH +CB49..CB63 ; LVT # Lo [27] HANGUL SYLLABLE JJUG..HANGUL SYLLABLE JJUH +CB65..CB7F ; LVT # Lo [27] HANGUL SYLLABLE JJWEOG..HANGUL SYLLABLE JJWEOH +CB81..CB9B ; LVT # Lo [27] HANGUL SYLLABLE JJWEG..HANGUL SYLLABLE JJWEH +CB9D..CBB7 ; LVT # Lo [27] HANGUL SYLLABLE JJWIG..HANGUL SYLLABLE JJWIH +CBB9..CBD3 ; LVT # Lo [27] HANGUL SYLLABLE JJYUG..HANGUL SYLLABLE JJYUH +CBD5..CBEF ; LVT # Lo [27] HANGUL SYLLABLE JJEUG..HANGUL SYLLABLE JJEUH +CBF1..CC0B ; LVT # Lo [27] HANGUL SYLLABLE JJYIG..HANGUL SYLLABLE JJYIH +CC0D..CC27 ; LVT # Lo [27] HANGUL SYLLABLE JJIG..HANGUL SYLLABLE JJIH +CC29..CC43 ; LVT # Lo [27] HANGUL SYLLABLE CAG..HANGUL SYLLABLE CAH +CC45..CC5F ; LVT # Lo [27] HANGUL SYLLABLE CAEG..HANGUL SYLLABLE CAEH +CC61..CC7B ; LVT # Lo [27] HANGUL SYLLABLE CYAG..HANGUL SYLLABLE CYAH +CC7D..CC97 ; LVT # Lo [27] HANGUL SYLLABLE CYAEG..HANGUL SYLLABLE CYAEH +CC99..CCB3 ; LVT # Lo [27] HANGUL SYLLABLE CEOG..HANGUL SYLLABLE CEOH +CCB5..CCCF ; LVT # Lo [27] HANGUL SYLLABLE CEG..HANGUL SYLLABLE CEH +CCD1..CCEB ; LVT # Lo [27] HANGUL SYLLABLE CYEOG..HANGUL SYLLABLE CYEOH +CCED..CD07 ; LVT # Lo [27] HANGUL SYLLABLE CYEG..HANGUL SYLLABLE CYEH +CD09..CD23 ; LVT # Lo [27] HANGUL SYLLABLE COG..HANGUL SYLLABLE COH +CD25..CD3F ; LVT # Lo [27] HANGUL SYLLABLE CWAG..HANGUL SYLLABLE CWAH +CD41..CD5B ; LVT # Lo [27] HANGUL SYLLABLE CWAEG..HANGUL SYLLABLE CWAEH +CD5D..CD77 ; LVT # Lo [27] HANGUL SYLLABLE COEG..HANGUL SYLLABLE COEH +CD79..CD93 ; LVT # Lo [27] HANGUL SYLLABLE CYOG..HANGUL SYLLABLE CYOH +CD95..CDAF ; LVT # Lo [27] HANGUL SYLLABLE CUG..HANGUL SYLLABLE CUH +CDB1..CDCB ; LVT # Lo [27] HANGUL SYLLABLE CWEOG..HANGUL SYLLABLE CWEOH +CDCD..CDE7 ; LVT # Lo [27] HANGUL SYLLABLE CWEG..HANGUL SYLLABLE CWEH +CDE9..CE03 ; LVT # Lo [27] HANGUL SYLLABLE CWIG..HANGUL SYLLABLE CWIH +CE05..CE1F ; LVT # Lo [27] HANGUL SYLLABLE CYUG..HANGUL SYLLABLE CYUH +CE21..CE3B ; LVT # Lo [27] HANGUL SYLLABLE CEUG..HANGUL SYLLABLE CEUH +CE3D..CE57 ; LVT # Lo [27] HANGUL SYLLABLE CYIG..HANGUL SYLLABLE CYIH +CE59..CE73 ; LVT # Lo [27] HANGUL SYLLABLE CIG..HANGUL SYLLABLE CIH +CE75..CE8F ; LVT # Lo [27] HANGUL SYLLABLE KAG..HANGUL SYLLABLE KAH +CE91..CEAB ; LVT # Lo [27] HANGUL SYLLABLE KAEG..HANGUL SYLLABLE KAEH +CEAD..CEC7 ; LVT # Lo [27] HANGUL SYLLABLE KYAG..HANGUL SYLLABLE KYAH +CEC9..CEE3 ; LVT # Lo [27] HANGUL SYLLABLE KYAEG..HANGUL SYLLABLE KYAEH +CEE5..CEFF ; LVT # Lo [27] HANGUL SYLLABLE KEOG..HANGUL SYLLABLE KEOH +CF01..CF1B ; LVT # Lo [27] HANGUL SYLLABLE KEG..HANGUL SYLLABLE KEH +CF1D..CF37 ; LVT # Lo [27] HANGUL SYLLABLE KYEOG..HANGUL SYLLABLE KYEOH +CF39..CF53 ; LVT # Lo [27] HANGUL SYLLABLE KYEG..HANGUL SYLLABLE KYEH +CF55..CF6F ; LVT # Lo [27] HANGUL SYLLABLE KOG..HANGUL SYLLABLE KOH +CF71..CF8B ; LVT # Lo [27] HANGUL SYLLABLE KWAG..HANGUL SYLLABLE KWAH +CF8D..CFA7 ; LVT # Lo [27] HANGUL SYLLABLE KWAEG..HANGUL SYLLABLE KWAEH +CFA9..CFC3 ; LVT # Lo [27] HANGUL SYLLABLE KOEG..HANGUL SYLLABLE KOEH +CFC5..CFDF ; LVT # Lo [27] HANGUL SYLLABLE KYOG..HANGUL SYLLABLE KYOH +CFE1..CFFB ; LVT # Lo [27] HANGUL SYLLABLE KUG..HANGUL SYLLABLE KUH +CFFD..D017 ; LVT # Lo [27] HANGUL SYLLABLE KWEOG..HANGUL SYLLABLE KWEOH +D019..D033 ; LVT # Lo [27] HANGUL SYLLABLE KWEG..HANGUL SYLLABLE KWEH +D035..D04F ; LVT # Lo [27] HANGUL SYLLABLE KWIG..HANGUL SYLLABLE KWIH +D051..D06B ; LVT # Lo [27] HANGUL SYLLABLE KYUG..HANGUL SYLLABLE KYUH +D06D..D087 ; LVT # Lo [27] HANGUL SYLLABLE KEUG..HANGUL SYLLABLE KEUH +D089..D0A3 ; LVT # Lo [27] HANGUL SYLLABLE KYIG..HANGUL SYLLABLE KYIH +D0A5..D0BF ; LVT # Lo [27] HANGUL SYLLABLE KIG..HANGUL SYLLABLE KIH +D0C1..D0DB ; LVT # Lo [27] HANGUL SYLLABLE TAG..HANGUL SYLLABLE TAH +D0DD..D0F7 ; LVT # Lo [27] HANGUL SYLLABLE TAEG..HANGUL SYLLABLE TAEH +D0F9..D113 ; LVT # Lo [27] HANGUL SYLLABLE TYAG..HANGUL SYLLABLE TYAH +D115..D12F ; LVT # Lo [27] HANGUL SYLLABLE TYAEG..HANGUL SYLLABLE TYAEH +D131..D14B ; LVT # Lo [27] HANGUL SYLLABLE TEOG..HANGUL SYLLABLE TEOH +D14D..D167 ; LVT # Lo [27] HANGUL SYLLABLE TEG..HANGUL SYLLABLE TEH +D169..D183 ; LVT # Lo [27] HANGUL SYLLABLE TYEOG..HANGUL SYLLABLE TYEOH +D185..D19F ; LVT # Lo [27] HANGUL SYLLABLE TYEG..HANGUL SYLLABLE TYEH +D1A1..D1BB ; LVT # Lo [27] HANGUL SYLLABLE TOG..HANGUL SYLLABLE TOH +D1BD..D1D7 ; LVT # Lo [27] HANGUL SYLLABLE TWAG..HANGUL SYLLABLE TWAH +D1D9..D1F3 ; LVT # Lo [27] HANGUL SYLLABLE TWAEG..HANGUL SYLLABLE TWAEH +D1F5..D20F ; LVT # Lo [27] HANGUL SYLLABLE TOEG..HANGUL SYLLABLE TOEH +D211..D22B ; LVT # Lo [27] HANGUL SYLLABLE TYOG..HANGUL SYLLABLE TYOH +D22D..D247 ; LVT # Lo [27] HANGUL SYLLABLE TUG..HANGUL SYLLABLE TUH +D249..D263 ; LVT # Lo [27] HANGUL SYLLABLE TWEOG..HANGUL SYLLABLE TWEOH +D265..D27F ; LVT # Lo [27] HANGUL SYLLABLE TWEG..HANGUL SYLLABLE TWEH +D281..D29B ; LVT # Lo [27] HANGUL SYLLABLE TWIG..HANGUL SYLLABLE TWIH +D29D..D2B7 ; LVT # Lo [27] HANGUL SYLLABLE TYUG..HANGUL SYLLABLE TYUH +D2B9..D2D3 ; LVT # Lo [27] HANGUL SYLLABLE TEUG..HANGUL SYLLABLE TEUH +D2D5..D2EF ; LVT # Lo [27] HANGUL SYLLABLE TYIG..HANGUL SYLLABLE TYIH +D2F1..D30B ; LVT # Lo [27] HANGUL SYLLABLE TIG..HANGUL SYLLABLE TIH +D30D..D327 ; LVT # Lo [27] HANGUL SYLLABLE PAG..HANGUL SYLLABLE PAH +D329..D343 ; LVT # Lo [27] HANGUL SYLLABLE PAEG..HANGUL SYLLABLE PAEH +D345..D35F ; LVT # Lo [27] HANGUL SYLLABLE PYAG..HANGUL SYLLABLE PYAH +D361..D37B ; LVT # Lo [27] HANGUL SYLLABLE PYAEG..HANGUL SYLLABLE PYAEH +D37D..D397 ; LVT # Lo [27] HANGUL SYLLABLE PEOG..HANGUL SYLLABLE PEOH +D399..D3B3 ; LVT # Lo [27] HANGUL SYLLABLE PEG..HANGUL SYLLABLE PEH +D3B5..D3CF ; LVT # Lo [27] HANGUL SYLLABLE PYEOG..HANGUL SYLLABLE PYEOH +D3D1..D3EB ; LVT # Lo [27] HANGUL SYLLABLE PYEG..HANGUL SYLLABLE PYEH +D3ED..D407 ; LVT # Lo [27] HANGUL SYLLABLE POG..HANGUL SYLLABLE POH +D409..D423 ; LVT # Lo [27] HANGUL SYLLABLE PWAG..HANGUL SYLLABLE PWAH +D425..D43F ; LVT # Lo [27] HANGUL SYLLABLE PWAEG..HANGUL SYLLABLE PWAEH +D441..D45B ; LVT # Lo [27] HANGUL SYLLABLE POEG..HANGUL SYLLABLE POEH +D45D..D477 ; LVT # Lo [27] HANGUL SYLLABLE PYOG..HANGUL SYLLABLE PYOH +D479..D493 ; LVT # Lo [27] HANGUL SYLLABLE PUG..HANGUL SYLLABLE PUH +D495..D4AF ; LVT # Lo [27] HANGUL SYLLABLE PWEOG..HANGUL SYLLABLE PWEOH +D4B1..D4CB ; LVT # Lo [27] HANGUL SYLLABLE PWEG..HANGUL SYLLABLE PWEH +D4CD..D4E7 ; LVT # Lo [27] HANGUL SYLLABLE PWIG..HANGUL SYLLABLE PWIH +D4E9..D503 ; LVT # Lo [27] HANGUL SYLLABLE PYUG..HANGUL SYLLABLE PYUH +D505..D51F ; LVT # Lo [27] HANGUL SYLLABLE PEUG..HANGUL SYLLABLE PEUH +D521..D53B ; LVT # Lo [27] HANGUL SYLLABLE PYIG..HANGUL SYLLABLE PYIH +D53D..D557 ; LVT # Lo [27] HANGUL SYLLABLE PIG..HANGUL SYLLABLE PIH +D559..D573 ; LVT # Lo [27] HANGUL SYLLABLE HAG..HANGUL SYLLABLE HAH +D575..D58F ; LVT # Lo [27] HANGUL SYLLABLE HAEG..HANGUL SYLLABLE HAEH +D591..D5AB ; LVT # Lo [27] HANGUL SYLLABLE HYAG..HANGUL SYLLABLE HYAH +D5AD..D5C7 ; LVT # Lo [27] HANGUL SYLLABLE HYAEG..HANGUL SYLLABLE HYAEH +D5C9..D5E3 ; LVT # Lo [27] HANGUL SYLLABLE HEOG..HANGUL SYLLABLE HEOH +D5E5..D5FF ; LVT # Lo [27] HANGUL SYLLABLE HEG..HANGUL SYLLABLE HEH +D601..D61B ; LVT # Lo [27] HANGUL SYLLABLE HYEOG..HANGUL SYLLABLE HYEOH +D61D..D637 ; LVT # Lo [27] HANGUL SYLLABLE HYEG..HANGUL SYLLABLE HYEH +D639..D653 ; LVT # Lo [27] HANGUL SYLLABLE HOG..HANGUL SYLLABLE HOH +D655..D66F ; LVT # Lo [27] HANGUL SYLLABLE HWAG..HANGUL SYLLABLE HWAH +D671..D68B ; LVT # Lo [27] HANGUL SYLLABLE HWAEG..HANGUL SYLLABLE HWAEH +D68D..D6A7 ; LVT # Lo [27] HANGUL SYLLABLE HOEG..HANGUL SYLLABLE HOEH +D6A9..D6C3 ; LVT # Lo [27] HANGUL SYLLABLE HYOG..HANGUL SYLLABLE HYOH +D6C5..D6DF ; LVT # Lo [27] HANGUL SYLLABLE HUG..HANGUL SYLLABLE HUH +D6E1..D6FB ; LVT # Lo [27] HANGUL SYLLABLE HWEOG..HANGUL SYLLABLE HWEOH +D6FD..D717 ; LVT # Lo [27] HANGUL SYLLABLE HWEG..HANGUL SYLLABLE HWEH +D719..D733 ; LVT # Lo [27] HANGUL SYLLABLE HWIG..HANGUL SYLLABLE HWIH +D735..D74F ; LVT # Lo [27] HANGUL SYLLABLE HYUG..HANGUL SYLLABLE HYUH +D751..D76B ; LVT # Lo [27] HANGUL SYLLABLE HEUG..HANGUL SYLLABLE HEUH +D76D..D787 ; LVT # Lo [27] HANGUL SYLLABLE HYIG..HANGUL SYLLABLE HYIH +D789..D7A3 ; LVT # Lo [27] HANGUL SYLLABLE HIG..HANGUL SYLLABLE HIH + +# Total code points: 10773 + +# EOF diff --git a/contrib/unicode/NameAliases.txt b/contrib/unicode/NameAliases.txt index 45744de96ac3..09df7d666f12 100644 --- a/contrib/unicode/NameAliases.txt +++ b/contrib/unicode/NameAliases.txt @@ -1,6 +1,6 @@ -# NameAliases-16.0.0.txt -# Date: 2024-04-24 -# © 2024 Unicode®, Inc. +# NameAliases-17.0.0.txt +# Date: 2025-04-23 +# © 2025 Unicode®, Inc. # Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries. # For terms of use and license, see https://www.unicode.org/terms_of_use.html # @@ -323,6 +323,10 @@ FEFF;ZWNBSP;abbreviation 122D5;CUNEIFORM SIGN NU11 OVER NU11 BUR OVER BUR;correction 12327;CUNEIFORM SIGN KALAM;correction 1680B;BAMUM LETTER PHASE-A MAEMGBIEE;correction +16881;BAMUM LETTER PHASE-B PUNGGAAM;correction +1688E;BAMUM LETTER PHASE-B NGGOM;correction +168DC;BAMUM LETTER PHASE-C SHETFON;correction +1697D;BAMUM LETTER PHASE-E NGGOP;correction 16E56;MEDEFAIDRIN CAPITAL LETTER H;correction 16E57;MEDEFAIDRIN CAPITAL LETTER NG;correction 16E76;MEDEFAIDRIN SMALL LETTER H;correction diff --git a/contrib/unicode/PropList.txt b/contrib/unicode/PropList.txt index fae2831e7a5f..e64b4224d727 100644 --- a/contrib/unicode/PropList.txt +++ b/contrib/unicode/PropList.txt @@ -1,6 +1,6 @@ -# PropList-16.0.0.txt -# Date: 2024-05-31, 18:09:48 GMT -# © 2024 Unicode®, Inc. +# PropList-17.0.0.txt +# Date: 2025-06-30, 06:19:01 GMT +# © 2025 Unicode®, Inc. # Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries. # For terms of use and license, see https://www.unicode.org/terms_of_use.html # @@ -702,7 +702,7 @@ FB1E ; Other_Alphabetic # Mn HEBREW POINT JUDEO-SPANISH VARIKA 10D24..10D27 ; Other_Alphabetic # Mn [4] HANIFI ROHINGYA SIGN HARBAHAY..HANIFI ROHINGYA SIGN TASSI 10D69 ; Other_Alphabetic # Mn GARAY VOWEL SIGN E 10EAB..10EAC ; Other_Alphabetic # Mn [2] YEZIDI COMBINING HAMZA MARK..YEZIDI COMBINING MADDA MARK -10EFC ; Other_Alphabetic # Mn ARABIC COMBINING ALEF OVERLAY +10EFA..10EFC ; Other_Alphabetic # Mn [3] ARABIC DOUBLE VERTICAL BAR BELOW..ARABIC COMBINING ALEF OVERLAY 11000 ; Other_Alphabetic # Mc BRAHMI SIGN CANDRABINDU 11001 ; Other_Alphabetic # Mn BRAHMI SIGN ANUSVARA 11002 ; Other_Alphabetic # Mc BRAHMI SIGN VISARGA @@ -809,6 +809,12 @@ FB1E ; Other_Alphabetic # Mn HEBREW POINT JUDEO-SPANISH VARIKA 11A59..11A5B ; Other_Alphabetic # Mn [3] SOYOMBO VOWEL SIGN VOCALIC R..SOYOMBO VOWEL LENGTH MARK 11A8A..11A96 ; Other_Alphabetic # Mn [13] SOYOMBO FINAL CONSONANT SIGN G..SOYOMBO SIGN ANUSVARA 11A97 ; Other_Alphabetic # Mc SOYOMBO SIGN VISARGA +11B60 ; Other_Alphabetic # Mn SHARADA VOWEL SIGN OE +11B61 ; Other_Alphabetic # Mc SHARADA VOWEL SIGN OOE +11B62..11B64 ; Other_Alphabetic # Mn [3] SHARADA VOWEL SIGN UE..SHARADA VOWEL SIGN SHORT E +11B65 ; Other_Alphabetic # Mc SHARADA VOWEL SIGN SHORT O +11B66 ; Other_Alphabetic # Mn SHARADA VOWEL SIGN CANDRA E +11B67 ; Other_Alphabetic # Mc SHARADA VOWEL SIGN CANDRA O 11C2F ; Other_Alphabetic # Mc BHAIKSUKI VOWEL SIGN AA 11C30..11C36 ; Other_Alphabetic # Mn [7] BHAIKSUKI VOWEL SIGN I..BHAIKSUKI VOWEL SIGN VOCALIC L 11C38..11C3D ; Other_Alphabetic # Mn [6] BHAIKSUKI VOWEL SIGN E..BHAIKSUKI SIGN ANUSVARA @@ -853,12 +859,16 @@ FB1E ; Other_Alphabetic # Mn HEBREW POINT JUDEO-SPANISH VARIKA 1E023..1E024 ; Other_Alphabetic # Mn [2] COMBINING GLAGOLITIC LETTER YU..COMBINING GLAGOLITIC LETTER SMALL YUS 1E026..1E02A ; Other_Alphabetic # Mn [5] COMBINING GLAGOLITIC LETTER YO..COMBINING GLAGOLITIC LETTER FITA 1E08F ; Other_Alphabetic # Mn COMBINING CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I +1E6E3 ; Other_Alphabetic # Mn TAI YO SIGN UE +1E6E6 ; Other_Alphabetic # Mn TAI YO SIGN AU +1E6EE..1E6EF ; Other_Alphabetic # Mn [2] TAI YO SIGN AY..TAI YO SIGN ANG +1E6F5 ; Other_Alphabetic # Mn TAI YO SIGN OM 1E947 ; Other_Alphabetic # Mn ADLAM HAMZA 1F130..1F149 ; Other_Alphabetic # So [26] SQUARED LATIN CAPITAL LETTER A..SQUARED LATIN CAPITAL LETTER Z 1F150..1F169 ; Other_Alphabetic # So [26] NEGATIVE CIRCLED LATIN CAPITAL LETTER A..NEGATIVE CIRCLED LATIN CAPITAL LETTER Z 1F170..1F189 ; Other_Alphabetic # So [26] NEGATIVE SQUARED LATIN CAPITAL LETTER A..NEGATIVE SQUARED LATIN CAPITAL LETTER Z -# Total code points: 1495 +# Total code points: 1510 # ================================================ @@ -871,21 +881,22 @@ FB1E ; Other_Alphabetic # Mn HEBREW POINT JUDEO-SPANISH VARIKA F900..FA6D ; Ideographic # Lo [366] CJK COMPATIBILITY IDEOGRAPH-F900..CJK COMPATIBILITY IDEOGRAPH-FA6D FA70..FAD9 ; Ideographic # Lo [106] CJK COMPATIBILITY IDEOGRAPH-FA70..CJK COMPATIBILITY IDEOGRAPH-FAD9 16FE4 ; Ideographic # Mn KHITAN SMALL SCRIPT FILLER -17000..187F7 ; Ideographic # Lo [6136] TANGUT IDEOGRAPH-17000..TANGUT IDEOGRAPH-187F7 -18800..18CD5 ; Ideographic # Lo [1238] TANGUT COMPONENT-001..KHITAN SMALL SCRIPT CHARACTER-18CD5 -18CFF..18D08 ; Ideographic # Lo [10] KHITAN SMALL SCRIPT CHARACTER-18CFF..TANGUT IDEOGRAPH-18D08 +16FF2..16FF3 ; Ideographic # Lm [2] CHINESE SMALL SIMPLIFIED ER..CHINESE SMALL TRADITIONAL ER +16FF4..16FF6 ; Ideographic # Nl [3] YANGQIN SIGN SLOW ONE BEAT..YANGQIN SIGN SLOW TWO BEATS +17000..18CD5 ; Ideographic # Lo [7382] TANGUT IDEOGRAPH-17000..KHITAN SMALL SCRIPT CHARACTER-18CD5 +18CFF..18D1E ; Ideographic # Lo [32] KHITAN SMALL SCRIPT CHARACTER-18CFF..TANGUT IDEOGRAPH-18D1E +18D80..18DF2 ; Ideographic # Lo [115] TANGUT COMPONENT-769..TANGUT COMPONENT-883 1B170..1B2FB ; Ideographic # Lo [396] NUSHU CHARACTER-1B170..NUSHU CHARACTER-1B2FB 20000..2A6DF ; Ideographic # Lo [42720] CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6DF -2A700..2B739 ; Ideographic # Lo [4154] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B739 -2B740..2B81D ; Ideographic # Lo [222] CJK UNIFIED IDEOGRAPH-2B740..CJK UNIFIED IDEOGRAPH-2B81D -2B820..2CEA1 ; Ideographic # Lo [5762] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEA1 +2A700..2B81D ; Ideographic # Lo [4382] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B81D +2B820..2CEAD ; Ideographic # Lo [5774] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEAD 2CEB0..2EBE0 ; Ideographic # Lo [7473] CJK UNIFIED IDEOGRAPH-2CEB0..CJK UNIFIED IDEOGRAPH-2EBE0 2EBF0..2EE5D ; Ideographic # Lo [622] CJK UNIFIED IDEOGRAPH-2EBF0..CJK UNIFIED IDEOGRAPH-2EE5D 2F800..2FA1D ; Ideographic # Lo [542] CJK COMPATIBILITY IDEOGRAPH-2F800..CJK COMPATIBILITY IDEOGRAPH-2FA1D 30000..3134A ; Ideographic # Lo [4939] CJK UNIFIED IDEOGRAPH-30000..CJK UNIFIED IDEOGRAPH-3134A -31350..323AF ; Ideographic # Lo [4192] CJK UNIFIED IDEOGRAPH-31350..CJK UNIFIED IDEOGRAPH-323AF +31350..33479 ; Ideographic # Lo [8490] CJK UNIFIED IDEOGRAPH-31350..CJK UNIFIED IDEOGRAPH-33479 -# Total code points: 106477 +# Total code points: 110943 # ================================================ @@ -915,11 +926,11 @@ FA70..FAD9 ; Ideographic # Lo [106] CJK COMPATIBILITY IDEOGRAPH-FA70..CJK COM 0384..0385 ; Diacritic # Sk [2] GREEK TONOS..GREEK DIALYTIKA TONOS 0483..0487 ; Diacritic # Mn [5] COMBINING CYRILLIC TITLO..COMBINING CYRILLIC POKRYTIE 0559 ; Diacritic # Lm ARMENIAN MODIFIER LETTER LEFT HALF RING -0591..05A1 ; Diacritic # Mn [17] HEBREW ACCENT ETNAHTA..HEBREW ACCENT PAZER -05A3..05BD ; Diacritic # Mn [27] HEBREW ACCENT MUNAH..HEBREW POINT METEG +0591..05BD ; Diacritic # Mn [45] HEBREW ACCENT ETNAHTA..HEBREW POINT METEG 05BF ; Diacritic # Mn HEBREW POINT RAFE 05C1..05C2 ; Diacritic # Mn [2] HEBREW POINT SHIN DOT..HEBREW POINT SIN DOT -05C4 ; Diacritic # Mn HEBREW MARK UPPER DOT +05C4..05C5 ; Diacritic # Mn [2] HEBREW MARK UPPER DOT..HEBREW MARK LOWER DOT +05C7 ; Diacritic # Mn HEBREW POINT QAMATS QATAN 064B..0652 ; Diacritic # Mn [8] ARABIC FATHATAN..ARABIC SUKUN 0657..0658 ; Diacritic # Mn [2] ARABIC INVERTED DAMMA..ARABIC MARK NOON GHUNNA 06DF..06E0 ; Diacritic # Mn [2] ARABIC SMALL HIGH ROUNDED ZERO..ARABIC SMALL HIGH UPRIGHT RECTANGULAR ZERO @@ -990,6 +1001,8 @@ FA70..FAD9 ; Ideographic # Lo [106] CJK COMPATIBILITY IDEOGRAPH-FA70..CJK COM 1AB0..1ABD ; Diacritic # Mn [14] COMBINING DOUBLED CIRCUMFLEX ACCENT..COMBINING PARENTHESES BELOW 1ABE ; Diacritic # Me COMBINING PARENTHESES OVERLAY 1AC1..1ACB ; Diacritic # Mn [11] COMBINING LEFT PARENTHESIS ABOVE LEFT..COMBINING TRIPLE ACUTE ACCENT +1ACF..1ADD ; Diacritic # Mn [15] COMBINING DOUBLE CARON..COMBINING DOT-AND-RING BELOW +1AE0..1AEB ; Diacritic # Mn [12] COMBINING LEFT TACK ABOVE..COMBINING DOUBLE RIGHTWARDS ARROW ABOVE 1B34 ; Diacritic # Mn BALINESE SIGN REREKAN 1B44 ; Diacritic # Mc BALINESE ADEG ADEG 1B6B..1B73 ; Diacritic # Mn [9] BALINESE MUSICAL SYMBOL COMBINING TEGEH..BALINESE MUSICAL SYMBOL COMBINING GONG @@ -1009,6 +1022,7 @@ FA70..FAD9 ; Ideographic # Lo [106] CJK COMPATIBILITY IDEOGRAPH-FA70..CJK COM 1CF7 ; Diacritic # Mc VEDIC SIGN ATIKRAMA 1CF8..1CF9 ; Diacritic # Mn [2] VEDIC TONE RING ABOVE..VEDIC TONE DOUBLE RING ABOVE 1D2C..1D6A ; Diacritic # Lm [63] MODIFIER LETTER CAPITAL A..GREEK SUBSCRIPT SMALL LETTER CHI +1D9B..1DBE ; Diacritic # Lm [36] MODIFIER LETTER SMALL TURNED ALPHA..MODIFIER LETTER SMALL EZH 1DC4..1DCF ; Diacritic # Mn [12] COMBINING MACRON-ACUTE..COMBINING ZIGZAG BELOW 1DF5..1DFF ; Diacritic # Mn [11] COMBINING UP TACK ABOVE..COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW 1FBD ; Diacritic # Sk GREEK KORONIS @@ -1034,6 +1048,7 @@ A717..A71F ; Diacritic # Lm [9] MODIFIER LETTER DOT VERTICAL BAR..MODIFIER A720..A721 ; Diacritic # Sk [2] MODIFIER LETTER STRESS AND HIGH TONE..MODIFIER LETTER STRESS AND LOW TONE A788 ; Diacritic # Lm MODIFIER LETTER LOW CIRCUMFLEX ACCENT A789..A78A ; Diacritic # Sk [2] MODIFIER LETTER COLON..MODIFIER LETTER SHORT EQUALS SIGN +A7F1 ; Diacritic # Lm MODIFIER LETTER CAPITAL S A7F8..A7F9 ; Diacritic # Lm [2] MODIFIER LETTER CAPITAL H WITH STROKE..MODIFIER LETTER SMALL LIGATURE OE A806 ; Diacritic # Mn SYLOTI NAGRI SIGN HASANTA A82C ; Diacritic # Mn SYLOTI NAGRI SIGN ALTERNATE HASANTA @@ -1077,6 +1092,7 @@ FFE3 ; Diacritic # Sk FULLWIDTH MACRON 10D24..10D27 ; Diacritic # Mn [4] HANIFI ROHINGYA SIGN HARBAHAY..HANIFI ROHINGYA SIGN TASSI 10D4E ; Diacritic # Lm GARAY VOWEL LENGTH MARK 10D69..10D6D ; Diacritic # Mn [5] GARAY VOWEL SIGN E..GARAY CONSONANT NASALIZATION MARK +10EFA ; Diacritic # Mn ARABIC DOUBLE VERTICAL BAR BELOW 10EFD..10EFF ; Diacritic # Mn [3] ARABIC SMALL LOW WORD SAKTA..ARABIC SMALL LOW WORD MADDA 10F46..10F50 ; Diacritic # Mn [11] SOGDIAN COMBINING DOT BELOW..SOGDIAN COMBINING STROKE BELOW 10F82..10F85 ; Diacritic # Mn [4] OLD UYGHUR COMBINING DOT ABOVE..OLD UYGHUR COMBINING TWO DOTS BELOW @@ -1120,6 +1136,7 @@ FFE3 ; Diacritic # Sk FULLWIDTH MACRON 11D42 ; Diacritic # Mn MASARAM GONDI SIGN NUKTA 11D44..11D45 ; Diacritic # Mn [2] MASARAM GONDI SIGN HALANTA..MASARAM GONDI VIRAMA 11D97 ; Diacritic # Mn GUNJALA GONDI VIRAMA +11DD9 ; Diacritic # Lm TOLONG SIKI SIGN SELA 11F41 ; Diacritic # Mc KAWI SIGN KILLER 11F42 ; Diacritic # Mn KAWI CONJOINER 11F5A ; Diacritic # Mn KAWI SIGN NUKTA @@ -1150,7 +1167,7 @@ FFE3 ; Diacritic # Sk FULLWIDTH MACRON 1E944..1E946 ; Diacritic # Mn [3] ADLAM ALIF LENGTHENER..ADLAM GEMINATION MARK 1E948..1E94A ; Diacritic # Mn [3] ADLAM CONSONANT MODIFIER..ADLAM NUKTA -# Total code points: 1178 +# Total code points: 1247 # ================================================ @@ -1190,14 +1207,16 @@ FF70 ; Extender # Lm HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND 113D3 ; Extender # Lo TULU-TIGALARI SIGN PLUTA 115C6..115C8 ; Extender # Po [3] SIDDHAM REPETITION MARK-1..SIDDHAM REPETITION MARK-3 11A98 ; Extender # Mn SOYOMBO GEMINATION MARK +11DD9 ; Extender # Lm TOLONG SIKI SIGN SELA 16B42..16B43 ; Extender # Lm [2] PAHAWH HMONG SIGN VOS NRUA..PAHAWH HMONG SIGN IB YAM 16FE0..16FE1 ; Extender # Lm [2] TANGUT ITERATION MARK..NUSHU ITERATION MARK 16FE3 ; Extender # Lm OLD CHINESE ITERATION MARK +16FF2..16FF3 ; Extender # Lm [2] CHINESE SMALL SIMPLIFIED ER..CHINESE SMALL TRADITIONAL ER 1E13C..1E13D ; Extender # Lm [2] NYIAKENG PUACHUE HMONG SIGN XW XW..NYIAKENG PUACHUE HMONG SYLLABLE LENGTHENER 1E5EF ; Extender # Mn OL ONAL SIGN IKIR 1E944..1E946 ; Extender # Mn [3] ADLAM ALIF LENGTHENER..ADLAM GEMINATION MARK -# Total code points: 59 +# Total code points: 62 # ================================================ @@ -1220,7 +1239,7 @@ FF70 ; Extender # Lm HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND 2C7C..2C7D ; Other_Lowercase # Lm [2] LATIN SUBSCRIPT SMALL LETTER J..MODIFIER LETTER CAPITAL V A69C..A69D ; Other_Lowercase # Lm [2] MODIFIER LETTER CYRILLIC HARD SIGN..MODIFIER LETTER CYRILLIC SOFT SIGN A770 ; Other_Lowercase # Lm MODIFIER LETTER US -A7F2..A7F4 ; Other_Lowercase # Lm [3] MODIFIER LETTER CAPITAL C..MODIFIER LETTER CAPITAL Q +A7F1..A7F4 ; Other_Lowercase # Lm [4] MODIFIER LETTER CAPITAL S..MODIFIER LETTER CAPITAL Q A7F8..A7F9 ; Other_Lowercase # Lm [2] MODIFIER LETTER CAPITAL H WITH STROKE..MODIFIER LETTER SMALL LIGATURE OE AB5C..AB5F ; Other_Lowercase # Lm [4] MODIFIER LETTER SMALL HENG..MODIFIER LETTER SMALL U WITH LEFT HOOK AB69 ; Other_Lowercase # Lm MODIFIER LETTER SMALL TURNED W @@ -1230,7 +1249,7 @@ AB69 ; Other_Lowercase # Lm MODIFIER LETTER SMALL TURNED W 107B2..107BA ; Other_Lowercase # Lm [9] MODIFIER LETTER SMALL CAPITAL Y..MODIFIER LETTER SMALL S WITH CURL 1E030..1E06D ; Other_Lowercase # Lm [62] MODIFIER LETTER CYRILLIC SMALL A..MODIFIER LETTER CYRILLIC SMALL STRAIGHT U WITH STROKE -# Total code points: 311 +# Total code points: 312 # ================================================ @@ -1359,15 +1378,14 @@ FA21 ; Unified_Ideograph # Lo CJK COMPATIBILITY IDEOGRAPH-FA21 FA23..FA24 ; Unified_Ideograph # Lo [2] CJK COMPATIBILITY IDEOGRAPH-FA23..CJK COMPATIBILITY IDEOGRAPH-FA24 FA27..FA29 ; Unified_Ideograph # Lo [3] CJK COMPATIBILITY IDEOGRAPH-FA27..CJK COMPATIBILITY IDEOGRAPH-FA29 20000..2A6DF ; Unified_Ideograph # Lo [42720] CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6DF -2A700..2B739 ; Unified_Ideograph # Lo [4154] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B739 -2B740..2B81D ; Unified_Ideograph # Lo [222] CJK UNIFIED IDEOGRAPH-2B740..CJK UNIFIED IDEOGRAPH-2B81D -2B820..2CEA1 ; Unified_Ideograph # Lo [5762] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEA1 +2A700..2B81D ; Unified_Ideograph # Lo [4382] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B81D +2B820..2CEAD ; Unified_Ideograph # Lo [5774] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEAD 2CEB0..2EBE0 ; Unified_Ideograph # Lo [7473] CJK UNIFIED IDEOGRAPH-2CEB0..CJK UNIFIED IDEOGRAPH-2EBE0 2EBF0..2EE5D ; Unified_Ideograph # Lo [622] CJK UNIFIED IDEOGRAPH-2EBF0..CJK UNIFIED IDEOGRAPH-2EE5D 30000..3134A ; Unified_Ideograph # Lo [4939] CJK UNIFIED IDEOGRAPH-30000..CJK UNIFIED IDEOGRAPH-3134A -31350..323AF ; Unified_Ideograph # Lo [4192] CJK UNIFIED IDEOGRAPH-31350..CJK UNIFIED IDEOGRAPH-323AF +31350..33479 ; Unified_Ideograph # Lo [8490] CJK UNIFIED IDEOGRAPH-31350..CJK UNIFIED IDEOGRAPH-33479 -# Total code points: 97680 +# Total code points: 101996 # ================================================ @@ -1809,9 +1827,7 @@ E0100..E01EF ; Variation_Selector # Mn [240] VARIATION SELECTOR-17..VARIATION S 2B47..2B4C ; Pattern_Syntax # Sm [6] REVERSE TILDE OPERATOR ABOVE RIGHTWARDS ARROW..RIGHTWARDS ARROW ABOVE REVERSE TILDE OPERATOR 2B4D..2B73 ; Pattern_Syntax # So [39] DOWNWARDS TRIANGLE-HEADED ZIGZAG ARROW..DOWNWARDS TRIANGLE-HEADED ARROW TO BAR 2B74..2B75 ; Pattern_Syntax # Cn [2] .. -2B76..2B95 ; Pattern_Syntax # So [32] NORTH WEST TRIANGLE-HEADED ARROW TO BAR..RIGHTWARDS BLACK ARROW -2B96 ; Pattern_Syntax # Cn -2B97..2BFF ; Pattern_Syntax # So [105] SYMBOL FOR TYPE A ELECTRONICS..HELLSCHREIBER PAUSE SYMBOL +2B76..2BFF ; Pattern_Syntax # So [138] NORTH WEST TRIANGLE-HEADED ARROW TO BAR..HELLSCHREIBER PAUSE SYMBOL 2E00..2E01 ; Pattern_Syntax # Po [2] RIGHT ANGLE SUBSTITUTION MARKER..RIGHT ANGLE DOTTED SUBSTITUTION MARKER 2E02 ; Pattern_Syntax # Pi LEFT SUBSTITUTION BRACKET 2E03 ; Pattern_Syntax # Pf RIGHT SUBSTITUTION BRACKET diff --git a/contrib/unicode/README b/contrib/unicode/README index a459f3496e08..a9840647f689 100644 --- a/contrib/unicode/README +++ b/contrib/unicode/README @@ -15,6 +15,7 @@ ftp://ftp.unicode.org/Public/UNIDATA/PropList.txt ftp://ftp.unicode.org/Public/UNIDATA/DerivedNormalizationProps.txt ftp://ftp.unicode.org/Public/UNIDATA/DerivedCoreProperties.txt ftp://ftp.unicode.org/Public/UNIDATA/NameAliases.txt +ftp://ftp.unicode.org/Public/UNIDATA/HangulSyllableType.txt Three additional files are needed for lookup tables in libstdc++: @@ -36,7 +37,7 @@ localedata/unicode-gen/unicode_utils.py localedata/unicode-gen/utf8_gen.py And the most recent versions added to GCC are from glibc git commit: -064c708c78cc2a6b5802dce73108fc0c1c6bfc80 +2642002380aafb71a1d3b569b6d7ebeab3284816 The script gen_wcwidth.py found here contains the GCC-specific code to map glibc's output to the lookup tables we require. This script should not need @@ -53,7 +54,7 @@ The procedure to update GCC's Unicode support is the following: 3. Run ./gen_wcwidth.py X.Y > ../../libcpp/generated_cpp_wcwidth.h (where X.Y is the version of the Unicode standard corresponding to the - Unicode data files being used, most recently, 16.0.0). + Unicode data files being used, most recently, 17.0.0). 4. Update Unicode Copyright years in libcpp/makeucnid.cc and in libcpp/makeuname2c.cc up to the year in which the Unicode @@ -68,7 +69,7 @@ The procedure to update GCC's Unicode support is the following: > ../../libcpp/ucnid.h 7. Read the corresponding Unicode's standard and update correspondingly - generated_ranges table in libcpp/makeuname2c.cc (in Unicode 16 all + generated_ranges table in libcpp/makeuname2c.cc (in Unicode 17 all the needed information was in Table 4-8). 8. Compile makeuname2c, e.g. with: diff --git a/contrib/unicode/UnicodeData.txt b/contrib/unicode/UnicodeData.txt index 64258a373953..fca68e3e154e 100644 --- a/contrib/unicode/UnicodeData.txt +++ b/contrib/unicode/UnicodeData.txt @@ -659,7 +659,7 @@ 0292;LATIN SMALL LETTER EZH;Ll;0;L;;;;;N;LATIN SMALL LETTER YOGH;;01B7;;01B7 0293;LATIN SMALL LETTER EZH WITH CURL;Ll;0;L;;;;;N;LATIN SMALL LETTER YOGH CURL;;;; 0294;LATIN LETTER GLOTTAL STOP;Lo;0;L;;;;;N;;;;; -0295;LATIN LETTER PHARYNGEAL VOICED FRICATIVE;Ll;0;L;;;;;N;LATIN LETTER REVERSED GLOTTAL STOP;;;; +0295;LATIN LETTER PHARYNGEAL VOICED FRICATIVE;Lo;0;L;;;;;N;LATIN LETTER REVERSED GLOTTAL STOP;;;; 0296;LATIN LETTER INVERTED GLOTTAL STOP;Ll;0;L;;;;;N;;;;; 0297;LATIN LETTER STRETCHED C;Ll;0;L;;;;;N;;;;; 0298;LATIN LETTER BILABIAL CLICK;Ll;0;L;;;;;N;LATIN LETTER BULLSEYE;;;; @@ -2121,6 +2121,7 @@ 088C;ARABIC LETTER TAH WITH THREE DOTS BELOW;Lo;0;AL;;;;;N;;;;; 088D;ARABIC LETTER KEHEH WITH TWO DOTS VERTICALLY BELOW;Lo;0;AL;;;;;N;;;;; 088E;ARABIC VERTICAL TAIL;Lo;0;AL;;;;;N;;;;; +088F;ARABIC LETTER NOON WITH RING ABOVE;Lo;0;AL;;;;;N;;;;; 0890;ARABIC POUND MARK ABOVE;Cf;0;AN;;;;;N;;;;; 0891;ARABIC PIASTRE MARK ABOVE;Cf;0;AN;;;;;N;;;;; 0897;ARABIC PEPET;Mn;230;NSM;;;;;N;;;;; @@ -2862,6 +2863,7 @@ 0C58;TELUGU LETTER TSA;Lo;0;L;;;;;N;;;;; 0C59;TELUGU LETTER DZA;Lo;0;L;;;;;N;;;;; 0C5A;TELUGU LETTER RRRA;Lo;0;L;;;;;N;;;;; +0C5C;TELUGU ARCHAIC SHRII;Lo;0;L;;;;;N;;;;; 0C5D;TELUGU LETTER NAKAARA POLLU;Lo;0;L;;;;;N;;;;; 0C60;TELUGU LETTER VOCALIC RR;Lo;0;L;;;;;N;;;;; 0C61;TELUGU LETTER VOCALIC LL;Lo;0;L;;;;;N;;;;; @@ -2958,6 +2960,7 @@ 0CCD;KANNADA SIGN VIRAMA;Mn;9;NSM;;;;;N;;;;; 0CD5;KANNADA LENGTH MARK;Mc;0;L;;;;;N;;;;; 0CD6;KANNADA AI LENGTH MARK;Mc;0;L;;;;;N;;;;; +0CDC;KANNADA ARCHAIC SHRII;Lo;0;L;;;;;N;;;;; 0CDD;KANNADA LETTER NAKAARA POLLU;Lo;0;L;;;;;N;;;;; 0CDE;KANNADA LETTER FA;Lo;0;L;;;;;N;;;;; 0CE0;KANNADA LETTER VOCALIC RR;Lo;0;L;;;;;N;;;;; @@ -6137,6 +6140,33 @@ 1ACC;COMBINING LATIN SMALL LETTER INSULAR G;Mn;230;NSM;;;;;N;;;;; 1ACD;COMBINING LATIN SMALL LETTER INSULAR R;Mn;230;NSM;;;;;N;;;;; 1ACE;COMBINING LATIN SMALL LETTER INSULAR T;Mn;230;NSM;;;;;N;;;;; +1ACF;COMBINING DOUBLE CARON;Mn;230;NSM;;;;;N;;;;; +1AD0;COMBINING VERTICAL-LINE-ACUTE;Mn;230;NSM;;;;;N;;;;; +1AD1;COMBINING GRAVE-VERTICAL-LINE;Mn;230;NSM;;;;;N;;;;; +1AD2;COMBINING VERTICAL-LINE-GRAVE;Mn;230;NSM;;;;;N;;;;; +1AD3;COMBINING ACUTE-VERTICAL-LINE;Mn;230;NSM;;;;;N;;;;; +1AD4;COMBINING VERTICAL-LINE-MACRON;Mn;230;NSM;;;;;N;;;;; +1AD5;COMBINING MACRON-VERTICAL-LINE;Mn;230;NSM;;;;;N;;;;; +1AD6;COMBINING VERTICAL-LINE-ACUTE-GRAVE;Mn;230;NSM;;;;;N;;;;; +1AD7;COMBINING VERTICAL-LINE-GRAVE-ACUTE;Mn;230;NSM;;;;;N;;;;; +1AD8;COMBINING MACRON-ACUTE-GRAVE;Mn;230;NSM;;;;;N;;;;; +1AD9;COMBINING SHARP SIGN;Mn;230;NSM;;;;;N;;;;; +1ADA;COMBINING FLAT SIGN;Mn;230;NSM;;;;;N;;;;; +1ADB;COMBINING DOWN TACK ABOVE;Mn;230;NSM;;;;;N;;;;; +1ADC;COMBINING DIAERESIS WITH RAISED LEFT DOT;Mn;230;NSM;;;;;N;;;;; +1ADD;COMBINING DOT-AND-RING BELOW;Mn;220;NSM;;;;;N;;;;; +1AE0;COMBINING LEFT TACK ABOVE;Mn;230;NSM;;;;;N;;;;; +1AE1;COMBINING RIGHT TACK ABOVE;Mn;230;NSM;;;;;N;;;;; +1AE2;COMBINING MINUS SIGN ABOVE;Mn;230;NSM;;;;;N;;;;; +1AE3;COMBINING INVERTED BRIDGE ABOVE;Mn;230;NSM;;;;;N;;;;; +1AE4;COMBINING SQUARE ABOVE;Mn;230;NSM;;;;;N;;;;; +1AE5;COMBINING SEAGULL ABOVE;Mn;230;NSM;;;;;N;;;;; +1AE6;COMBINING DOUBLE ARCH BELOW;Mn;220;NSM;;;;;N;;;;; +1AE7;COMBINING DOUBLE ARCH ABOVE;Mn;230;NSM;;;;;N;;;;; +1AE8;COMBINING EQUALS SIGN ABOVE;Mn;230;NSM;;;;;N;;;;; +1AE9;COMBINING LEFT ANGLE CENTRED ABOVE;Mn;230;NSM;;;;;N;;;;; +1AEA;COMBINING UPWARDS ARROW ABOVE;Mn;230;NSM;;;;;N;;;;; +1AEB;COMBINING DOUBLE RIGHTWARDS ARROW ABOVE;Mn;234;NSM;;;;;N;;;;; 1B00;BALINESE SIGN ULU RICEM;Mn;0;NSM;;;;;N;;;;; 1B01;BALINESE SIGN ULU CANDRA;Mn;0;NSM;;;;;N;;;;; 1B02;BALINESE SIGN CECEK;Mn;0;NSM;;;;;N;;;;; @@ -7545,6 +7575,7 @@ 20BE;LARI SIGN;Sc;0;ET;;;;;N;;;;; 20BF;BITCOIN SIGN;Sc;0;ET;;;;;N;;;;; 20C0;SOM SIGN;Sc;0;ET;;;;;N;;;;; +20C1;SAUDI RIYAL SIGN;Sc;0;ET;;;;;N;;;;; 20D0;COMBINING LEFT HARPOON ABOVE;Mn;230;NSM;;;;;N;NON-SPACING LEFT HARPOON ABOVE;;;; 20D1;COMBINING RIGHT HARPOON ABOVE;Mn;230;NSM;;;;;N;NON-SPACING RIGHT HARPOON ABOVE;;;; 20D2;COMBINING LONG VERTICAL LINE OVERLAY;Mn;1;NSM;;;;;N;NON-SPACING LONG VERTICAL BAR OVERLAY;;;; @@ -10239,6 +10270,7 @@ 2B93;NEWLINE RIGHT;So;0;ON;;;;;N;;;;; 2B94;FOUR CORNER ARROWS CIRCLING ANTICLOCKWISE;So;0;ON;;;;;N;;;;; 2B95;RIGHTWARDS BLACK ARROW;So;0;ON;;;;;N;;;;; +2B96;EQUALS SIGN WITH INFINITY ABOVE;So;0;ON;;;;;N;;;;; 2B97;SYMBOL FOR TYPE A ELECTRONICS;So;0;ON;;;;;N;;;;; 2B98;THREE-D TOP-LIGHTED LEFTWARDS EQUILATERAL ARROWHEAD;So;0;ON;;;;;N;;;;; 2B99;THREE-D RIGHT-LIGHTED UPWARDS EQUILATERAL ARROWHEAD;So;0;ON;;;;;N;;;;; @@ -14274,10 +14306,14 @@ A7CA;LATIN SMALL LETTER S WITH SHORT STROKE OVERLAY;Ll;0;L;;;;;N;;;A7C9;;A7C9 A7CB;LATIN CAPITAL LETTER RAMS HORN;Lu;0;L;;;;;N;;;;0264; A7CC;LATIN CAPITAL LETTER S WITH DIAGONAL STROKE;Lu;0;L;;;;;N;;;;A7CD; A7CD;LATIN SMALL LETTER S WITH DIAGONAL STROKE;Ll;0;L;;;;;N;;;A7CC;;A7CC +A7CE;LATIN CAPITAL LETTER PHARYNGEAL VOICED FRICATIVE;Lu;0;L;;;;;N;;;;A7CF; +A7CF;LATIN SMALL LETTER PHARYNGEAL VOICED FRICATIVE;Ll;0;L;;;;;N;;;A7CE;;A7CE A7D0;LATIN CAPITAL LETTER CLOSED INSULAR G;Lu;0;L;;;;;N;;;;A7D1; A7D1;LATIN SMALL LETTER CLOSED INSULAR G;Ll;0;L;;;;;N;;;A7D0;;A7D0 -A7D3;LATIN SMALL LETTER DOUBLE THORN;Ll;0;L;;;;;N;;;;; -A7D5;LATIN SMALL LETTER DOUBLE WYNN;Ll;0;L;;;;;N;;;;; +A7D2;LATIN CAPITAL LETTER DOUBLE THORN;Lu;0;L;;;;;N;;;;A7D3; +A7D3;LATIN SMALL LETTER DOUBLE THORN;Ll;0;L;;;;;N;;;A7D2;;A7D2 +A7D4;LATIN CAPITAL LETTER DOUBLE WYNN;Lu;0;L;;;;;N;;;;A7D5; +A7D5;LATIN SMALL LETTER DOUBLE WYNN;Ll;0;L;;;;;N;;;A7D4;;A7D4 A7D6;LATIN CAPITAL LETTER MIDDLE SCOTS S;Lu;0;L;;;;;N;;;;A7D7; A7D7;LATIN SMALL LETTER MIDDLE SCOTS S;Ll;0;L;;;;;N;;;A7D6;;A7D6 A7D8;LATIN CAPITAL LETTER SIGMOID S;Lu;0;L;;;;;N;;;;A7D9; @@ -14285,6 +14321,7 @@ A7D9;LATIN SMALL LETTER SIGMOID S;Ll;0;L;;;;;N;;;A7D8;;A7D8 A7DA;LATIN CAPITAL LETTER LAMBDA;Lu;0;L;;;;;N;;;;A7DB; A7DB;LATIN SMALL LETTER LAMBDA;Ll;0;L;;;;;N;;;A7DA;;A7DA A7DC;LATIN CAPITAL LETTER LAMBDA WITH STROKE;Lu;0;L;;;;;N;;;;019B; +A7F1;MODIFIER LETTER CAPITAL S;Lm;0;L; 0053;;;;N;;;;; A7F2;MODIFIER LETTER CAPITAL C;Lm;0;L; 0043;;;;N;;;;; A7F3;MODIFIER LETTER CAPITAL F;Lm;0;L; 0046;;;;N;;;;; A7F4;MODIFIER LETTER CAPITAL Q;Lm;0;L; 0051;;;;N;;;;; @@ -15925,6 +15962,22 @@ FBBF;ARABIC SYMBOL RING;Sk;0;AL;;;;;N;;;;; FBC0;ARABIC SYMBOL SMALL TAH ABOVE;Sk;0;AL;;;;;N;;;;; FBC1;ARABIC SYMBOL SMALL TAH BELOW;Sk;0;AL;;;;;N;;;;; FBC2;ARABIC SYMBOL WASLA ABOVE;Sk;0;AL;;;;;N;;;;; +FBC3;ARABIC LIGATURE JALLA WA-ALAA;So;0;ON;;;;;N;;;;; +FBC4;ARABIC LIGATURE DAAMAT BARAKAATUHUM;So;0;ON;;;;;N;;;;; +FBC5;ARABIC LIGATURE RAHMATU ALLAAHI TAAALAA ALAYH;So;0;ON;;;;;N;;;;; +FBC6;ARABIC LIGATURE RAHMATU ALLAAHI ALAYHIM;So;0;ON;;;;;N;;;;; +FBC7;ARABIC LIGATURE RAHMATU ALLAAHI ALAYHIMAA;So;0;ON;;;;;N;;;;; +FBC8;ARABIC LIGATURE RAHIMAHUM ALLAAHU TAAALAA;So;0;ON;;;;;N;;;;; +FBC9;ARABIC LIGATURE RAHIMAHUMAA ALLAAH;So;0;ON;;;;;N;;;;; +FBCA;ARABIC LIGATURE RAHIMAHUMAA ALLAAHU TAAALAA;So;0;ON;;;;;N;;;;; +FBCB;ARABIC LIGATURE RADI ALLAAHU TAAALAA ANHUM;So;0;ON;;;;;N;;;;; +FBCC;ARABIC LIGATURE HAFIZAHU ALLAAH;So;0;ON;;;;;N;;;;; +FBCD;ARABIC LIGATURE HAFIZAHU ALLAAHU TAAALAA;So;0;ON;;;;;N;;;;; +FBCE;ARABIC LIGATURE HAFIZAHUM ALLAAHU TAAALAA;So;0;ON;;;;;N;;;;; +FBCF;ARABIC LIGATURE HAFIZAHUMAA ALLAAHU TAAALAA;So;0;ON;;;;;N;;;;; +FBD0;ARABIC LIGATURE SALLALLAAHU TAAALAA ALAYHI WA-SALLAM;So;0;ON;;;;;N;;;;; +FBD1;ARABIC LIGATURE AJJAL ALLAAHU FARAJAHU ASH-SHAREEF;So;0;ON;;;;;N;;;;; +FBD2;ARABIC LIGATURE ALAYHI AR-RAHMAH;So;0;ON;;;;;N;;;;; FBD3;ARABIC LETTER NG ISOLATED FORM;Lo;0;AL; 06AD;;;;N;;;;; FBD4;ARABIC LETTER NG FINAL FORM;Lo;0;AL; 06AD;;;;N;;;;; FBD5;ARABIC LETTER NG INITIAL FORM;Lo;0;AL; 06AD;;;;N;;;;; @@ -16370,6 +16423,8 @@ FD8C;ARABIC LIGATURE MEEM WITH JEEM WITH HAH INITIAL FORM;Lo;0;AL; 0645 FD8D;ARABIC LIGATURE MEEM WITH JEEM WITH MEEM INITIAL FORM;Lo;0;AL; 0645 062C 0645;;;;N;;;;; FD8E;ARABIC LIGATURE MEEM WITH KHAH WITH JEEM INITIAL FORM;Lo;0;AL; 0645 062E 062C;;;;N;;;;; FD8F;ARABIC LIGATURE MEEM WITH KHAH WITH MEEM INITIAL FORM;Lo;0;AL; 0645 062E 0645;;;;N;;;;; +FD90;ARABIC LIGATURE RAHMATU ALLAAHI ALAYH;So;0;ON;;;;;N;;;;; +FD91;ARABIC LIGATURE RAHMATU ALLAAHI ALAYHAA;So;0;ON;;;;;N;;;;; FD92;ARABIC LIGATURE MEEM WITH JEEM WITH KHAH INITIAL FORM;Lo;0;AL; 0645 062C 062E;;;;N;;;;; FD93;ARABIC LIGATURE HEH WITH MEEM WITH JEEM INITIAL FORM;Lo;0;AL; 0647 0645 062C;;;;N;;;;; FD94;ARABIC LIGATURE HEH WITH MEEM WITH MEEM INITIAL FORM;Lo;0;AL; 0647 0645 0645;;;;N;;;;; @@ -16424,6 +16479,13 @@ FDC4;ARABIC LIGATURE AIN WITH JEEM WITH MEEM INITIAL FORM;Lo;0;AL; 0639 FDC5;ARABIC LIGATURE SAD WITH MEEM WITH MEEM INITIAL FORM;Lo;0;AL; 0635 0645 0645;;;;N;;;;; FDC6;ARABIC LIGATURE SEEN WITH KHAH WITH YEH FINAL FORM;Lo;0;AL; 0633 062E 064A;;;;N;;;;; FDC7;ARABIC LIGATURE NOON WITH JEEM WITH YEH FINAL FORM;Lo;0;AL; 0646 062C 064A;;;;N;;;;; +FDC8;ARABIC LIGATURE RAHIMAHU ALLAAH TAAALAA;So;0;ON;;;;;N;;;;; +FDC9;ARABIC LIGATURE RADI ALLAAHU TAAALAA ANH;So;0;ON;;;;;N;;;;; +FDCA;ARABIC LIGATURE RADI ALLAAHU TAAALAA ANHAA;So;0;ON;;;;;N;;;;; +FDCB;ARABIC LIGATURE RADI ALLAAHU TAAALAA ANHUMAA;So;0;ON;;;;;N;;;;; +FDCC;ARABIC LIGATURE SALLALLAHU ALAYHI WA-ALAA AALIHEE WA-SALLAM;So;0;ON;;;;;N;;;;; +FDCD;ARABIC LIGATURE AJJAL ALLAAHU TAAALAA FARAJAHU ASH-SHAREEF;So;0;ON;;;;;N;;;;; +FDCE;ARABIC LIGATURE KARRAMA ALLAAHU WAJHAH;So;0;ON;;;;;N;;;;; FDCF;ARABIC LIGATURE SALAAMUHU ALAYNAA;So;0;ON;;;;;N;;;;; FDF0;ARABIC LIGATURE SALLA USED AS KORANIC STOP SIGN ISOLATED FORM;Lo;0;AL; 0635 0644 06D2;;;;N;;;;; FDF1;ARABIC LIGATURE QALA USED AS KORANIC STOP SIGN ISOLATED FORM;Lo;0;AL; 0642 0644 06D2;;;;N;;;;; @@ -18708,6 +18770,32 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 10938;LYDIAN LETTER NN;Lo;0;R;;;;;N;;;;; 10939;LYDIAN LETTER C;Lo;0;R;;;;;N;;;;; 1093F;LYDIAN TRIANGULAR MARK;Po;0;R;;;;;N;;;;; +10940;SIDETIC LETTER N01;Lo;0;R;;;;;N;;;;; +10941;SIDETIC LETTER N02;Lo;0;R;;;;;N;;;;; +10942;SIDETIC LETTER N03;Lo;0;R;;;;;N;;;;; +10943;SIDETIC LETTER N04;Lo;0;R;;;;;N;;;;; +10944;SIDETIC LETTER N05;Lo;0;R;;;;;N;;;;; +10945;SIDETIC LETTER N06;Lo;0;R;;;;;N;;;;; +10946;SIDETIC LETTER N07;Lo;0;R;;;;;N;;;;; +10947;SIDETIC LETTER N08;Lo;0;R;;;;;N;;;;; +10948;SIDETIC LETTER N09;Lo;0;R;;;;;N;;;;; +10949;SIDETIC LETTER N10;Lo;0;R;;;;;N;;;;; +1094A;SIDETIC LETTER N11;Lo;0;R;;;;;N;;;;; +1094B;SIDETIC LETTER N12;Lo;0;R;;;;;N;;;;; +1094C;SIDETIC LETTER N13;Lo;0;R;;;;;N;;;;; +1094D;SIDETIC LETTER N14;Lo;0;R;;;;;N;;;;; +1094E;SIDETIC LETTER N15;Lo;0;R;;;;;N;;;;; +1094F;SIDETIC LETTER N16;Lo;0;R;;;;;N;;;;; +10950;SIDETIC LETTER N17;Lo;0;R;;;;;N;;;;; +10951;SIDETIC LETTER N18;Lo;0;R;;;;;N;;;;; +10952;SIDETIC LETTER N19;Lo;0;R;;;;;N;;;;; +10953;SIDETIC LETTER N20;Lo;0;R;;;;;N;;;;; +10954;SIDETIC LETTER N21;Lo;0;R;;;;;N;;;;; +10955;SIDETIC LETTER N22;Lo;0;R;;;;;N;;;;; +10956;SIDETIC LETTER N23;Lo;0;R;;;;;N;;;;; +10957;SIDETIC LETTER N24;Lo;0;R;;;;;N;;;;; +10958;SIDETIC LETTER N25;Lo;0;R;;;;;N;;;;; +10959;SIDETIC LETTER N26;Lo;0;R;;;;;N;;;;; 10980;MEROITIC HIEROGLYPHIC LETTER A;Lo;0;R;;;;;N;;;;; 10981;MEROITIC HIEROGLYPHIC LETTER E;Lo;0;R;;;;;N;;;;; 10982;MEROITIC HIEROGLYPHIC LETTER I;Lo;0;R;;;;;N;;;;; @@ -19541,6 +19629,20 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 10EC2;ARABIC LETTER DAL WITH TWO DOTS VERTICALLY BELOW;Lo;0;AL;;;;;N;;;;; 10EC3;ARABIC LETTER TAH WITH TWO DOTS VERTICALLY BELOW;Lo;0;AL;;;;;N;;;;; 10EC4;ARABIC LETTER KAF WITH TWO DOTS VERTICALLY BELOW;Lo;0;AL;;;;;N;;;;; +10EC5;ARABIC SMALL YEH BARREE WITH TWO DOTS BELOW;Lm;0;AL;;;;;N;;;;; +10EC6;ARABIC LETTER THIN NOON;Lo;0;AL;;;;;N;;;;; +10EC7;ARABIC LETTER YEH WITH FOUR DOTS BELOW;Lo;0;AL;;;;;N;;;;; +10ED0;ARABIC BIBLICAL END OF VERSE;Po;0;ON;;;;;N;;;;; +10ED1;ARABIC LIGATURE ALAYHAA AS-SALAATU WAS-SALAAM;So;0;ON;;;;;N;;;;; +10ED2;ARABIC LIGATURE ALAYHIM AS-SALAATU WAS-SALAAM;So;0;ON;;;;;N;;;;; +10ED3;ARABIC LIGATURE ALAYHIMAA AS-SALAATU WAS-SALAAM;So;0;ON;;;;;N;;;;; +10ED4;ARABIC LIGATURE QADDASA ALLAAHU SIRRAH;So;0;ON;;;;;N;;;;; +10ED5;ARABIC LIGATURE QUDDISA SIRRUHUM;So;0;ON;;;;;N;;;;; +10ED6;ARABIC LIGATURE QUDDISA SIRRUHUMAA;So;0;ON;;;;;N;;;;; +10ED7;ARABIC LIGATURE QUDDISAT ASRAARUHUM;So;0;ON;;;;;N;;;;; +10ED8;ARABIC LIGATURE NAWWARA ALLAAHU MARQADAH;So;0;ON;;;;;N;;;;; +10EFA;ARABIC DOUBLE VERTICAL BAR BELOW;Mn;220;NSM;;;;;N;;;;; +10EFB;ARABIC SMALL LOW NOON;Mn;220;NSM;;;;;N;;;;; 10EFC;ARABIC COMBINING ALEF OVERLAY;Mn;0;NSM;;;;;N;;;;; 10EFD;ARABIC SMALL LOW WORD SAKTA;Mn;220;NSM;;;;;N;;;;; 10EFE;ARABIC SMALL LOW WORD QASR;Mn;220;NSM;;;;;N;;;;; @@ -21521,6 +21623,14 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 11B07;DEVANAGARI SIGN WESTERN NINE-LIKE BHALE;Po;0;L;;;;;N;;;;; 11B08;DEVANAGARI SIGN REVERSED NINE-LIKE BHALE;Po;0;L;;;;;N;;;;; 11B09;DEVANAGARI SIGN MINDU;Po;0;L;;;;;N;;;;; +11B60;SHARADA VOWEL SIGN OE;Mn;0;NSM;;;;;N;;;;; +11B61;SHARADA VOWEL SIGN OOE;Mc;0;L;;;;;N;;;;; +11B62;SHARADA VOWEL SIGN UE;Mn;0;NSM;;;;;N;;;;; +11B63;SHARADA VOWEL SIGN UUE;Mn;0;NSM;;;;;N;;;;; +11B64;SHARADA VOWEL SIGN SHORT E;Mn;0;NSM;;;;;N;;;;; +11B65;SHARADA VOWEL SIGN SHORT O;Mc;0;L;;;;;N;;;;; +11B66;SHARADA VOWEL SIGN CANDRA E;Mn;0;NSM;;;;;N;;;;; +11B67;SHARADA VOWEL SIGN CANDRA O;Mc;0;L;;;;;N;;;;; 11BC0;SUNUWAR LETTER DEVI;Lo;0;L;;;;;N;;;;; 11BC1;SUNUWAR LETTER TASLA;Lo;0;L;;;;;N;;;;; 11BC2;SUNUWAR LETTER EKO;Lo;0;L;;;;;N;;;;; @@ -21868,6 +21978,60 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 11DA7;GUNJALA GONDI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; 11DA8;GUNJALA GONDI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 11DA9;GUNJALA GONDI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; +11DB0;TOLONG SIKI LETTER I;Lo;0;L;;;;;N;;;;; +11DB1;TOLONG SIKI LETTER E;Lo;0;L;;;;;N;;;;; +11DB2;TOLONG SIKI LETTER U;Lo;0;L;;;;;N;;;;; +11DB3;TOLONG SIKI LETTER O;Lo;0;L;;;;;N;;;;; +11DB4;TOLONG SIKI LETTER A;Lo;0;L;;;;;N;;;;; +11DB5;TOLONG SIKI LETTER AA;Lo;0;L;;;;;N;;;;; +11DB6;TOLONG SIKI LETTER P;Lo;0;L;;;;;N;;;;; +11DB7;TOLONG SIKI LETTER PH;Lo;0;L;;;;;N;;;;; +11DB8;TOLONG SIKI LETTER B;Lo;0;L;;;;;N;;;;; +11DB9;TOLONG SIKI LETTER BH;Lo;0;L;;;;;N;;;;; +11DBA;TOLONG SIKI LETTER M;Lo;0;L;;;;;N;;;;; +11DBB;TOLONG SIKI LETTER T;Lo;0;L;;;;;N;;;;; +11DBC;TOLONG SIKI LETTER TH;Lo;0;L;;;;;N;;;;; +11DBD;TOLONG SIKI LETTER D;Lo;0;L;;;;;N;;;;; +11DBE;TOLONG SIKI LETTER DH;Lo;0;L;;;;;N;;;;; +11DBF;TOLONG SIKI LETTER N;Lo;0;L;;;;;N;;;;; +11DC0;TOLONG SIKI LETTER TT;Lo;0;L;;;;;N;;;;; +11DC1;TOLONG SIKI LETTER TTH;Lo;0;L;;;;;N;;;;; +11DC2;TOLONG SIKI LETTER DD;Lo;0;L;;;;;N;;;;; +11DC3;TOLONG SIKI LETTER DDH;Lo;0;L;;;;;N;;;;; +11DC4;TOLONG SIKI LETTER NN;Lo;0;L;;;;;N;;;;; +11DC5;TOLONG SIKI LETTER C;Lo;0;L;;;;;N;;;;; +11DC6;TOLONG SIKI LETTER CH;Lo;0;L;;;;;N;;;;; +11DC7;TOLONG SIKI LETTER J;Lo;0;L;;;;;N;;;;; +11DC8;TOLONG SIKI LETTER JH;Lo;0;L;;;;;N;;;;; +11DC9;TOLONG SIKI LETTER NY;Lo;0;L;;;;;N;;;;; +11DCA;TOLONG SIKI LETTER K;Lo;0;L;;;;;N;;;;; +11DCB;TOLONG SIKI LETTER KH;Lo;0;L;;;;;N;;;;; +11DCC;TOLONG SIKI LETTER G;Lo;0;L;;;;;N;;;;; +11DCD;TOLONG SIKI LETTER GH;Lo;0;L;;;;;N;;;;; +11DCE;TOLONG SIKI LETTER NG;Lo;0;L;;;;;N;;;;; +11DCF;TOLONG SIKI LETTER Y;Lo;0;L;;;;;N;;;;; +11DD0;TOLONG SIKI LETTER R;Lo;0;L;;;;;N;;;;; +11DD1;TOLONG SIKI LETTER L;Lo;0;L;;;;;N;;;;; +11DD2;TOLONG SIKI LETTER V;Lo;0;L;;;;;N;;;;; +11DD3;TOLONG SIKI LETTER NNY;Lo;0;L;;;;;N;;;;; +11DD4;TOLONG SIKI LETTER S;Lo;0;L;;;;;N;;;;; +11DD5;TOLONG SIKI LETTER H;Lo;0;L;;;;;N;;;;; +11DD6;TOLONG SIKI LETTER X;Lo;0;L;;;;;N;;;;; +11DD7;TOLONG SIKI LETTER RR;Lo;0;L;;;;;N;;;;; +11DD8;TOLONG SIKI LETTER RRH;Lo;0;L;;;;;N;;;;; +11DD9;TOLONG SIKI SIGN SELA;Lm;0;L;;;;;N;;;;; +11DDA;TOLONG SIKI SIGN HECAKA;Lo;0;L;;;;;N;;;;; +11DDB;TOLONG SIKI UNGGA;Lo;0;L;;;;;N;;;;; +11DE0;TOLONG SIKI DIGIT ZERO;Nd;0;L;;0;0;0;N;;;;; +11DE1;TOLONG SIKI DIGIT ONE;Nd;0;L;;1;1;1;N;;;;; +11DE2;TOLONG SIKI DIGIT TWO;Nd;0;L;;2;2;2;N;;;;; +11DE3;TOLONG SIKI DIGIT THREE;Nd;0;L;;3;3;3;N;;;;; +11DE4;TOLONG SIKI DIGIT FOUR;Nd;0;L;;4;4;4;N;;;;; +11DE5;TOLONG SIKI DIGIT FIVE;Nd;0;L;;5;5;5;N;;;;; +11DE6;TOLONG SIKI DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; +11DE7;TOLONG SIKI DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; +11DE8;TOLONG SIKI DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; +11DE9;TOLONG SIKI DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 11EE0;MAKASAR LETTER KA;Lo;0;L;;;;;N;;;;; 11EE1;MAKASAR LETTER GA;Lo;0;L;;;;;N;;;;; 11EE2;MAKASAR LETTER NGA;Lo;0;L;;;;;N;;;;; @@ -22088,8 +22252,8 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 12035;CUNEIFORM SIGN ARAD TIMES KUR;Lo;0;L;;;;;N;;;;; 12036;CUNEIFORM SIGN ARKAB;Lo;0;L;;;;;N;;;;; 12037;CUNEIFORM SIGN ASAL2;Lo;0;L;;;;;N;;;;; -12038;CUNEIFORM SIGN ASH;Lo;0;L;;;;;N;;;;; -12039;CUNEIFORM SIGN ASH ZIDA TENU;Lo;0;L;;;;;N;;;;; +12038;CUNEIFORM SIGN ASH;Lo;0;L;;;;1;N;;;;; +12039;CUNEIFORM SIGN ASH ZIDA TENU;Lo;0;L;;;;1;N;;;;; 1203A;CUNEIFORM SIGN ASH KABA TENU;Lo;0;L;;;;;N;;;;; 1203B;CUNEIFORM SIGN ASH OVER ASH TUG2 OVER TUG2 TUG2 OVER TUG2 PAP;Lo;0;L;;;;;N;;;;; 1203C;CUNEIFORM SIGN ASH OVER ASH OVER ASH;Lo;0;L;;;;;N;;;;; @@ -22153,7 +22317,7 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 12076;CUNEIFORM SIGN DIM2;Lo;0;L;;;;;N;;;;; 12077;CUNEIFORM SIGN DIN;Lo;0;L;;;;;N;;;;; 12078;CUNEIFORM SIGN DIN KASKAL U GUNU DISH;Lo;0;L;;;;;N;;;;; -12079;CUNEIFORM SIGN DISH;Lo;0;L;;;;;N;;;;; +12079;CUNEIFORM SIGN DISH;Lo;0;L;;;;1;N;;;;; 1207A;CUNEIFORM SIGN DU;Lo;0;L;;;;;N;;;;; 1207B;CUNEIFORM SIGN DU OVER DU;Lo;0;L;;;;;N;;;;; 1207C;CUNEIFORM SIGN DU GUNU;Lo;0;L;;;;;N;;;;; @@ -22582,12 +22746,12 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 12223;CUNEIFORM SIGN MA2;Lo;0;L;;;;;N;;;;; 12224;CUNEIFORM SIGN MAH;Lo;0;L;;;;;N;;;;; 12225;CUNEIFORM SIGN MAR;Lo;0;L;;;;;N;;;;; -12226;CUNEIFORM SIGN MASH;Lo;0;L;;;;;N;;;;; +12226;CUNEIFORM SIGN MASH;Lo;0;L;;;;1/2;N;;;;; 12227;CUNEIFORM SIGN MASH2;Lo;0;L;;;;;N;;;;; 12228;CUNEIFORM SIGN ME;Lo;0;L;;;;;N;;;;; 12229;CUNEIFORM SIGN MES;Lo;0;L;;;;;N;;;;; 1222A;CUNEIFORM SIGN MI;Lo;0;L;;;;;N;;;;; -1222B;CUNEIFORM SIGN MIN;Lo;0;L;;;;;N;;;;; +1222B;CUNEIFORM SIGN MIN;Lo;0;L;;;;2;N;;;;; 1222C;CUNEIFORM SIGN MU;Lo;0;L;;;;;N;;;;; 1222D;CUNEIFORM SIGN MU OVER MU;Lo;0;L;;;;;N;;;;; 1222E;CUNEIFORM SIGN MUG;Lo;0;L;;;;;N;;;;; @@ -22811,9 +22975,9 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 12308;CUNEIFORM SIGN TUM;Lo;0;L;;;;;N;;;;; 12309;CUNEIFORM SIGN TUR;Lo;0;L;;;;;N;;;;; 1230A;CUNEIFORM SIGN TUR OVER TUR ZA OVER ZA;Lo;0;L;;;;;N;;;;; -1230B;CUNEIFORM SIGN U;Lo;0;L;;;;;N;;;;; +1230B;CUNEIFORM SIGN U;Lo;0;L;;;;1;N;;;;; 1230C;CUNEIFORM SIGN U GUD;Lo;0;L;;;;;N;;;;; -1230D;CUNEIFORM SIGN U U U;Lo;0;L;;;;;N;;;;; +1230D;CUNEIFORM SIGN U U U;Lo;0;L;;;;3;N;;;;; 1230E;CUNEIFORM SIGN U OVER U PA OVER PA GAR OVER GAR;Lo;0;L;;;;;N;;;;; 1230F;CUNEIFORM SIGN U OVER U SUR OVER SUR;Lo;0;L;;;;;N;;;;; 12310;CUNEIFORM SIGN U OVER U U REVERSED OVER U REVERSED;Lo;0;L;;;;;N;;;;; @@ -22953,7 +23117,7 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 12396;CUNEIFORM SIGN SAG TIMES IGI GUNU;Lo;0;L;;;;;N;;;;; 12397;CUNEIFORM SIGN TI2;Lo;0;L;;;;;N;;;;; 12398;CUNEIFORM SIGN UM TIMES ME;Lo;0;L;;;;;N;;;;; -12399;CUNEIFORM SIGN U U;Lo;0;L;;;;;N;;;;; +12399;CUNEIFORM SIGN U U;Lo;0;L;;;;2;N;;;;; 12400;CUNEIFORM NUMERIC SIGN TWO ASH;Nl;0;L;;;;2;N;;;;; 12401;CUNEIFORM NUMERIC SIGN THREE ASH;Nl;0;L;;;;3;N;;;;; 12402;CUNEIFORM NUMERIC SIGN FOUR ASH;Nl;0;L;;;;4;N;;;;; @@ -30124,6 +30288,56 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 16E98;MEDEFAIDRIN FULL STOP;Po;0;L;;;;;N;;;;; 16E99;MEDEFAIDRIN SYMBOL AIVA;Po;0;L;;;;;N;;;;; 16E9A;MEDEFAIDRIN EXCLAMATION OH;Po;0;L;;;;;N;;;;; +16EA0;BERIA ERFE CAPITAL LETTER ARKAB;Lu;0;L;;;;;N;;;;16EBB; +16EA1;BERIA ERFE CAPITAL LETTER BASIGNA;Lu;0;L;;;;;N;;;;16EBC; +16EA2;BERIA ERFE CAPITAL LETTER DARBAI;Lu;0;L;;;;;N;;;;16EBD; +16EA3;BERIA ERFE CAPITAL LETTER EH;Lu;0;L;;;;;N;;;;16EBE; +16EA4;BERIA ERFE CAPITAL LETTER FITKO;Lu;0;L;;;;;N;;;;16EBF; +16EA5;BERIA ERFE CAPITAL LETTER GOWAY;Lu;0;L;;;;;N;;;;16EC0; +16EA6;BERIA ERFE CAPITAL LETTER HIRDEABO;Lu;0;L;;;;;N;;;;16EC1; +16EA7;BERIA ERFE CAPITAL LETTER I;Lu;0;L;;;;;N;;;;16EC2; +16EA8;BERIA ERFE CAPITAL LETTER DJAI;Lu;0;L;;;;;N;;;;16EC3; +16EA9;BERIA ERFE CAPITAL LETTER KOBO;Lu;0;L;;;;;N;;;;16EC4; +16EAA;BERIA ERFE CAPITAL LETTER LAKKO;Lu;0;L;;;;;N;;;;16EC5; +16EAB;BERIA ERFE CAPITAL LETTER MERI;Lu;0;L;;;;;N;;;;16EC6; +16EAC;BERIA ERFE CAPITAL LETTER NINI;Lu;0;L;;;;;N;;;;16EC7; +16EAD;BERIA ERFE CAPITAL LETTER GNA;Lu;0;L;;;;;N;;;;16EC8; +16EAE;BERIA ERFE CAPITAL LETTER NGAY;Lu;0;L;;;;;N;;;;16EC9; +16EAF;BERIA ERFE CAPITAL LETTER OI;Lu;0;L;;;;;N;;;;16ECA; +16EB0;BERIA ERFE CAPITAL LETTER PI;Lu;0;L;;;;;N;;;;16ECB; +16EB1;BERIA ERFE CAPITAL LETTER ERIGO;Lu;0;L;;;;;N;;;;16ECC; +16EB2;BERIA ERFE CAPITAL LETTER ERIGO TAMURA;Lu;0;L;;;;;N;;;;16ECD; +16EB3;BERIA ERFE CAPITAL LETTER SERI;Lu;0;L;;;;;N;;;;16ECE; +16EB4;BERIA ERFE CAPITAL LETTER SHEP;Lu;0;L;;;;;N;;;;16ECF; +16EB5;BERIA ERFE CAPITAL LETTER TATASOUE;Lu;0;L;;;;;N;;;;16ED0; +16EB6;BERIA ERFE CAPITAL LETTER UI;Lu;0;L;;;;;N;;;;16ED1; +16EB7;BERIA ERFE CAPITAL LETTER WASSE;Lu;0;L;;;;;N;;;;16ED2; +16EB8;BERIA ERFE CAPITAL LETTER AY;Lu;0;L;;;;;N;;;;16ED3; +16EBB;BERIA ERFE SMALL LETTER ARKAB;Ll;0;L;;;;;N;;;16EA0;;16EA0 +16EBC;BERIA ERFE SMALL LETTER BASIGNA;Ll;0;L;;;;;N;;;16EA1;;16EA1 +16EBD;BERIA ERFE SMALL LETTER DARBAI;Ll;0;L;;;;;N;;;16EA2;;16EA2 +16EBE;BERIA ERFE SMALL LETTER EH;Ll;0;L;;;;;N;;;16EA3;;16EA3 +16EBF;BERIA ERFE SMALL LETTER FITKO;Ll;0;L;;;;;N;;;16EA4;;16EA4 +16EC0;BERIA ERFE SMALL LETTER GOWAY;Ll;0;L;;;;;N;;;16EA5;;16EA5 +16EC1;BERIA ERFE SMALL LETTER HIRDEABO;Ll;0;L;;;;;N;;;16EA6;;16EA6 +16EC2;BERIA ERFE SMALL LETTER I;Ll;0;L;;;;;N;;;16EA7;;16EA7 +16EC3;BERIA ERFE SMALL LETTER DJAI;Ll;0;L;;;;;N;;;16EA8;;16EA8 +16EC4;BERIA ERFE SMALL LETTER KOBO;Ll;0;L;;;;;N;;;16EA9;;16EA9 +16EC5;BERIA ERFE SMALL LETTER LAKKO;Ll;0;L;;;;;N;;;16EAA;;16EAA +16EC6;BERIA ERFE SMALL LETTER MERI;Ll;0;L;;;;;N;;;16EAB;;16EAB +16EC7;BERIA ERFE SMALL LETTER NINI;Ll;0;L;;;;;N;;;16EAC;;16EAC +16EC8;BERIA ERFE SMALL LETTER GNA;Ll;0;L;;;;;N;;;16EAD;;16EAD +16EC9;BERIA ERFE SMALL LETTER NGAY;Ll;0;L;;;;;N;;;16EAE;;16EAE +16ECA;BERIA ERFE SMALL LETTER OI;Ll;0;L;;;;;N;;;16EAF;;16EAF +16ECB;BERIA ERFE SMALL LETTER PI;Ll;0;L;;;;;N;;;16EB0;;16EB0 +16ECC;BERIA ERFE SMALL LETTER ERIGO;Ll;0;L;;;;;N;;;16EB1;;16EB1 +16ECD;BERIA ERFE SMALL LETTER ERIGO TAMURA;Ll;0;L;;;;;N;;;16EB2;;16EB2 +16ECE;BERIA ERFE SMALL LETTER SERI;Ll;0;L;;;;;N;;;16EB3;;16EB3 +16ECF;BERIA ERFE SMALL LETTER SHEP;Ll;0;L;;;;;N;;;16EB4;;16EB4 +16ED0;BERIA ERFE SMALL LETTER TATASOUE;Ll;0;L;;;;;N;;;16EB5;;16EB5 +16ED1;BERIA ERFE SMALL LETTER UI;Ll;0;L;;;;;N;;;16EB6;;16EB6 +16ED2;BERIA ERFE SMALL LETTER WASSE;Ll;0;L;;;;;N;;;16EB7;;16EB7 +16ED3;BERIA ERFE SMALL LETTER AY;Ll;0;L;;;;;N;;;16EB8;;16EB8 16F00;MIAO LETTER PA;Lo;0;L;;;;;N;;;;; 16F01;MIAO LETTER BA;Lo;0;L;;;;;N;;;;; 16F02;MIAO LETTER YI PA;Lo;0;L;;;;;N;;;;; @@ -30280,8 +30494,13 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 16FE4;KHITAN SMALL SCRIPT FILLER;Mn;0;NSM;;;;;N;;;;; 16FF0;VIETNAMESE ALTERNATE READING MARK CA;Mc;6;L;;;;;N;;;;; 16FF1;VIETNAMESE ALTERNATE READING MARK NHAY;Mc;6;L;;;;;N;;;;; +16FF2;CHINESE SMALL SIMPLIFIED ER;Lm;0;L;;;;;N;;;;; +16FF3;CHINESE SMALL TRADITIONAL ER;Lm;0;L;;;;;N;;;;; +16FF4;YANGQIN SIGN SLOW ONE BEAT;Nl;0;L;;;;1;N;;;;; +16FF5;YANGQIN SIGN SLOW THREE HALF BEATS;Nl;0;L;;;;3/2;N;;;;; +16FF6;YANGQIN SIGN SLOW TWO BEATS;Nl;0;L;;;;2;N;;;;; 17000;;Lo;0;L;;;;;N;;;;; -187F7;;Lo;0;L;;;;;N;;;;; +187FF;;Lo;0;L;;;;;N;;;;; 18800;TANGUT COMPONENT-001;Lo;0;L;;;;;N;;;;; 18801;TANGUT COMPONENT-002;Lo;0;L;;;;;N;;;;; 18802;TANGUT COMPONENT-003;Lo;0;L;;;;;N;;;;; @@ -31522,7 +31741,122 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 18CD5;KHITAN SMALL SCRIPT CHARACTER-18CD5;Lo;0;L;;;;;N;;;;; 18CFF;KHITAN SMALL SCRIPT CHARACTER-18CFF;Lo;0;L;;;;;N;;;;; 18D00;;Lo;0;L;;;;;N;;;;; -18D08;;Lo;0;L;;;;;N;;;;; +18D1E;;Lo;0;L;;;;;N;;;;; +18D80;TANGUT COMPONENT-769;Lo;0;L;;;;;N;;;;; +18D81;TANGUT COMPONENT-770;Lo;0;L;;;;;N;;;;; +18D82;TANGUT COMPONENT-771;Lo;0;L;;;;;N;;;;; +18D83;TANGUT COMPONENT-772;Lo;0;L;;;;;N;;;;; +18D84;TANGUT COMPONENT-773;Lo;0;L;;;;;N;;;;; +18D85;TANGUT COMPONENT-774;Lo;0;L;;;;;N;;;;; +18D86;TANGUT COMPONENT-775;Lo;0;L;;;;;N;;;;; +18D87;TANGUT COMPONENT-776;Lo;0;L;;;;;N;;;;; +18D88;TANGUT COMPONENT-777;Lo;0;L;;;;;N;;;;; +18D89;TANGUT COMPONENT-778;Lo;0;L;;;;;N;;;;; +18D8A;TANGUT COMPONENT-779;Lo;0;L;;;;;N;;;;; +18D8B;TANGUT COMPONENT-780;Lo;0;L;;;;;N;;;;; +18D8C;TANGUT COMPONENT-781;Lo;0;L;;;;;N;;;;; +18D8D;TANGUT COMPONENT-782;Lo;0;L;;;;;N;;;;; +18D8E;TANGUT COMPONENT-783;Lo;0;L;;;;;N;;;;; +18D8F;TANGUT COMPONENT-784;Lo;0;L;;;;;N;;;;; +18D90;TANGUT COMPONENT-785;Lo;0;L;;;;;N;;;;; +18D91;TANGUT COMPONENT-786;Lo;0;L;;;;;N;;;;; +18D92;TANGUT COMPONENT-787;Lo;0;L;;;;;N;;;;; +18D93;TANGUT COMPONENT-788;Lo;0;L;;;;;N;;;;; +18D94;TANGUT COMPONENT-789;Lo;0;L;;;;;N;;;;; +18D95;TANGUT COMPONENT-790;Lo;0;L;;;;;N;;;;; +18D96;TANGUT COMPONENT-791;Lo;0;L;;;;;N;;;;; +18D97;TANGUT COMPONENT-792;Lo;0;L;;;;;N;;;;; +18D98;TANGUT COMPONENT-793;Lo;0;L;;;;;N;;;;; +18D99;TANGUT COMPONENT-794;Lo;0;L;;;;;N;;;;; +18D9A;TANGUT COMPONENT-795;Lo;0;L;;;;;N;;;;; +18D9B;TANGUT COMPONENT-796;Lo;0;L;;;;;N;;;;; +18D9C;TANGUT COMPONENT-797;Lo;0;L;;;;;N;;;;; +18D9D;TANGUT COMPONENT-798;Lo;0;L;;;;;N;;;;; +18D9E;TANGUT COMPONENT-799;Lo;0;L;;;;;N;;;;; +18D9F;TANGUT COMPONENT-800;Lo;0;L;;;;;N;;;;; +18DA0;TANGUT COMPONENT-801;Lo;0;L;;;;;N;;;;; +18DA1;TANGUT COMPONENT-802;Lo;0;L;;;;;N;;;;; +18DA2;TANGUT COMPONENT-803;Lo;0;L;;;;;N;;;;; +18DA3;TANGUT COMPONENT-804;Lo;0;L;;;;;N;;;;; +18DA4;TANGUT COMPONENT-805;Lo;0;L;;;;;N;;;;; +18DA5;TANGUT COMPONENT-806;Lo;0;L;;;;;N;;;;; +18DA6;TANGUT COMPONENT-807;Lo;0;L;;;;;N;;;;; +18DA7;TANGUT COMPONENT-808;Lo;0;L;;;;;N;;;;; +18DA8;TANGUT COMPONENT-809;Lo;0;L;;;;;N;;;;; +18DA9;TANGUT COMPONENT-810;Lo;0;L;;;;;N;;;;; +18DAA;TANGUT COMPONENT-811;Lo;0;L;;;;;N;;;;; +18DAB;TANGUT COMPONENT-812;Lo;0;L;;;;;N;;;;; +18DAC;TANGUT COMPONENT-813;Lo;0;L;;;;;N;;;;; +18DAD;TANGUT COMPONENT-814;Lo;0;L;;;;;N;;;;; +18DAE;TANGUT COMPONENT-815;Lo;0;L;;;;;N;;;;; +18DAF;TANGUT COMPONENT-816;Lo;0;L;;;;;N;;;;; +18DB0;TANGUT COMPONENT-817;Lo;0;L;;;;;N;;;;; +18DB1;TANGUT COMPONENT-818;Lo;0;L;;;;;N;;;;; +18DB2;TANGUT COMPONENT-819;Lo;0;L;;;;;N;;;;; +18DB3;TANGUT COMPONENT-820;Lo;0;L;;;;;N;;;;; +18DB4;TANGUT COMPONENT-821;Lo;0;L;;;;;N;;;;; +18DB5;TANGUT COMPONENT-822;Lo;0;L;;;;;N;;;;; +18DB6;TANGUT COMPONENT-823;Lo;0;L;;;;;N;;;;; +18DB7;TANGUT COMPONENT-824;Lo;0;L;;;;;N;;;;; +18DB8;TANGUT COMPONENT-825;Lo;0;L;;;;;N;;;;; +18DB9;TANGUT COMPONENT-826;Lo;0;L;;;;;N;;;;; +18DBA;TANGUT COMPONENT-827;Lo;0;L;;;;;N;;;;; +18DBB;TANGUT COMPONENT-828;Lo;0;L;;;;;N;;;;; +18DBC;TANGUT COMPONENT-829;Lo;0;L;;;;;N;;;;; +18DBD;TANGUT COMPONENT-830;Lo;0;L;;;;;N;;;;; +18DBE;TANGUT COMPONENT-831;Lo;0;L;;;;;N;;;;; +18DBF;TANGUT COMPONENT-832;Lo;0;L;;;;;N;;;;; +18DC0;TANGUT COMPONENT-833;Lo;0;L;;;;;N;;;;; +18DC1;TANGUT COMPONENT-834;Lo;0;L;;;;;N;;;;; +18DC2;TANGUT COMPONENT-835;Lo;0;L;;;;;N;;;;; +18DC3;TANGUT COMPONENT-836;Lo;0;L;;;;;N;;;;; +18DC4;TANGUT COMPONENT-837;Lo;0;L;;;;;N;;;;; +18DC5;TANGUT COMPONENT-838;Lo;0;L;;;;;N;;;;; +18DC6;TANGUT COMPONENT-839;Lo;0;L;;;;;N;;;;; +18DC7;TANGUT COMPONENT-840;Lo;0;L;;;;;N;;;;; +18DC8;TANGUT COMPONENT-841;Lo;0;L;;;;;N;;;;; +18DC9;TANGUT COMPONENT-842;Lo;0;L;;;;;N;;;;; +18DCA;TANGUT COMPONENT-843;Lo;0;L;;;;;N;;;;; +18DCB;TANGUT COMPONENT-844;Lo;0;L;;;;;N;;;;; +18DCC;TANGUT COMPONENT-845;Lo;0;L;;;;;N;;;;; +18DCD;TANGUT COMPONENT-846;Lo;0;L;;;;;N;;;;; +18DCE;TANGUT COMPONENT-847;Lo;0;L;;;;;N;;;;; +18DCF;TANGUT COMPONENT-848;Lo;0;L;;;;;N;;;;; +18DD0;TANGUT COMPONENT-849;Lo;0;L;;;;;N;;;;; +18DD1;TANGUT COMPONENT-850;Lo;0;L;;;;;N;;;;; +18DD2;TANGUT COMPONENT-851;Lo;0;L;;;;;N;;;;; +18DD3;TANGUT COMPONENT-852;Lo;0;L;;;;;N;;;;; +18DD4;TANGUT COMPONENT-853;Lo;0;L;;;;;N;;;;; +18DD5;TANGUT COMPONENT-854;Lo;0;L;;;;;N;;;;; +18DD6;TANGUT COMPONENT-855;Lo;0;L;;;;;N;;;;; +18DD7;TANGUT COMPONENT-856;Lo;0;L;;;;;N;;;;; +18DD8;TANGUT COMPONENT-857;Lo;0;L;;;;;N;;;;; +18DD9;TANGUT COMPONENT-858;Lo;0;L;;;;;N;;;;; +18DDA;TANGUT COMPONENT-859;Lo;0;L;;;;;N;;;;; +18DDB;TANGUT COMPONENT-860;Lo;0;L;;;;;N;;;;; +18DDC;TANGUT COMPONENT-861;Lo;0;L;;;;;N;;;;; +18DDD;TANGUT COMPONENT-862;Lo;0;L;;;;;N;;;;; +18DDE;TANGUT COMPONENT-863;Lo;0;L;;;;;N;;;;; +18DDF;TANGUT COMPONENT-864;Lo;0;L;;;;;N;;;;; +18DE0;TANGUT COMPONENT-865;Lo;0;L;;;;;N;;;;; +18DE1;TANGUT COMPONENT-866;Lo;0;L;;;;;N;;;;; +18DE2;TANGUT COMPONENT-867;Lo;0;L;;;;;N;;;;; +18DE3;TANGUT COMPONENT-868;Lo;0;L;;;;;N;;;;; +18DE4;TANGUT COMPONENT-869;Lo;0;L;;;;;N;;;;; +18DE5;TANGUT COMPONENT-870;Lo;0;L;;;;;N;;;;; +18DE6;TANGUT COMPONENT-871;Lo;0;L;;;;;N;;;;; +18DE7;TANGUT COMPONENT-872;Lo;0;L;;;;;N;;;;; +18DE8;TANGUT COMPONENT-873;Lo;0;L;;;;;N;;;;; +18DE9;TANGUT COMPONENT-874;Lo;0;L;;;;;N;;;;; +18DEA;TANGUT COMPONENT-875;Lo;0;L;;;;;N;;;;; +18DEB;TANGUT COMPONENT-876;Lo;0;L;;;;;N;;;;; +18DEC;TANGUT COMPONENT-877;Lo;0;L;;;;;N;;;;; +18DED;TANGUT COMPONENT-878;Lo;0;L;;;;;N;;;;; +18DEE;TANGUT COMPONENT-879;Lo;0;L;;;;;N;;;;; +18DEF;TANGUT COMPONENT-880;Lo;0;L;;;;;N;;;;; +18DF0;TANGUT COMPONENT-881;Lo;0;L;;;;;N;;;;; +18DF1;TANGUT COMPONENT-882;Lo;0;L;;;;;N;;;;; +18DF2;TANGUT COMPONENT-883;Lo;0;L;;;;;N;;;;; 1AFF0;KATAKANA LETTER MINNAN TONE-2;Lm;0;L;;;;;N;;;;; 1AFF1;KATAKANA LETTER MINNAN TONE-3;Lm;0;L;;;;;N;;;;; 1AFF2;KATAKANA LETTER MINNAN TONE-4;Lm;0;L;;;;;N;;;;; @@ -32629,6 +32963,9 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 1CCF7;OUTLINED DIGIT SEVEN;Nd;0;EN; 0037;7;7;7;N;;;;; 1CCF8;OUTLINED DIGIT EIGHT;Nd;0;EN; 0038;8;8;8;N;;;;; 1CCF9;OUTLINED DIGIT NINE;Nd;0;EN; 0039;9;9;9;N;;;;; +1CCFA;SNAKE SYMBOL;So;0;ON;;;;;N;;;;; +1CCFB;FLYING SAUCER SYMBOL;So;0;ON;;;;;N;;;;; +1CCFC;NOSE SYMBOL;So;0;ON;;;;;N;;;;; 1CD00;BLOCK OCTANT-3;So;0;ON;;;;;N;;;;; 1CD01;BLOCK OCTANT-23;So;0;ON;;;;;N;;;;; 1CD02;BLOCK OCTANT-123;So;0;ON;;;;;N;;;;; @@ -33065,6 +33402,46 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 1CEB1;KEYHOLE;So;0;ON;;;;;N;;;;; 1CEB2;OLD PERSONAL COMPUTER WITH MONITOR IN PORTRAIT ORIENTATION;So;0;ON;;;;;N;;;;; 1CEB3;BLACK RIGHT TRIANGLE CARET;So;0;ON;;;;;N;;;;; +1CEBA;FRAGILE SYMBOL;So;0;ON;;;;;N;;;;; +1CEBB;OFFICE BUILDING SYMBOL;So;0;ON;;;;;N;;;;; +1CEBC;TREE SYMBOL;So;0;ON;;;;;N;;;;; +1CEBD;APPLE SYMBOL;So;0;ON;;;;;N;;;;; +1CEBE;CHERRY SYMBOL;So;0;ON;;;;;N;;;;; +1CEBF;STRAWBERRY SYMBOL;So;0;ON;;;;;N;;;;; +1CEC0;HEBE;So;0;ON;;;;;N;;;;; +1CEC1;IRIS;So;0;ON;;;;;N;;;;; +1CEC2;FLORA;So;0;ON;;;;;N;;;;; +1CEC3;METIS;So;0;ON;;;;;N;;;;; +1CEC4;PARTHENOPE;So;0;ON;;;;;N;;;;; +1CEC5;VICTORIA;So;0;ON;;;;;N;;;;; +1CEC6;EGERIA;So;0;ON;;;;;N;;;;; +1CEC7;IRENE;So;0;ON;;;;;N;;;;; +1CEC8;EUNOMIA;So;0;ON;;;;;N;;;;; +1CEC9;PSYCHE;So;0;ON;;;;;N;;;;; +1CECA;THETIS;So;0;ON;;;;;N;;;;; +1CECB;MELPOMENE;So;0;ON;;;;;N;;;;; +1CECC;FORTUNA;So;0;ON;;;;;N;;;;; +1CECD;ASTRONOMICAL SYMBOL FOR ASTEROID PROSERPINA;So;0;ON;;;;;N;;;;; +1CECE;BELLONA;So;0;ON;;;;;N;;;;; +1CECF;AMPHITRITE;So;0;ON;;;;;N;;;;; +1CED0;LEUKOTHEA;So;0;ON;;;;;N;;;;; +1CEE0;GEOMANTIC FIGURE POPULUS;So;0;ON;;;;;N;;;;; +1CEE1;GEOMANTIC FIGURE TRISTITIA;So;0;ON;;;;;N;;;;; +1CEE2;GEOMANTIC FIGURE ALBUS;So;0;ON;;;;;N;;;;; +1CEE3;GEOMANTIC FIGURE FORTUNA MAJOR;So;0;ON;;;;;N;;;;; +1CEE4;GEOMANTIC FIGURE RUBEUS;So;0;ON;;;;;N;;;;; +1CEE5;GEOMANTIC FIGURE ACQUISITIO;So;0;ON;;;;;N;;;;; +1CEE6;GEOMANTIC FIGURE CONJUNCTIO;So;0;ON;;;;;N;;;;; +1CEE7;GEOMANTIC FIGURE CAPUT DRACONIS;So;0;ON;;;;;N;;;;; +1CEE8;GEOMANTIC FIGURE LAETITIA;So;0;ON;;;;;N;;;;; +1CEE9;GEOMANTIC FIGURE CARCER;So;0;ON;;;;;N;;;;; +1CEEA;GEOMANTIC FIGURE AMISSIO;So;0;ON;;;;;N;;;;; +1CEEB;GEOMANTIC FIGURE PUELLA;So;0;ON;;;;;N;;;;; +1CEEC;GEOMANTIC FIGURE FORTUNA MINOR;So;0;ON;;;;;N;;;;; +1CEED;GEOMANTIC FIGURE PUER;So;0;ON;;;;;N;;;;; +1CEEE;GEOMANTIC FIGURE CAUDA DRACONIS;So;0;ON;;;;;N;;;;; +1CEEF;GEOMANTIC FIGURE VIA;So;0;ON;;;;;N;;;;; +1CEF0;MEDIUM SMALL WHITE CIRCLE WITH HORIZONTAL BAR;Sm;0;ON;;;;;N;;;;; 1CF00;ZNAMENNY COMBINING MARK GORAZDO NIZKO S KRYZHEM ON LEFT;Mn;0;NSM;;;;;N;;;;; 1CF01;ZNAMENNY COMBINING MARK NIZKO S KRYZHEM ON LEFT;Mn;0;NSM;;;;;N;;;;; 1CF02;ZNAMENNY COMBINING MARK TSATA ON LEFT;Mn;0;NSM;;;;;N;;;;; @@ -36004,6 +36381,61 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 1E5F9;OL ONAL DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; 1E5FA;OL ONAL DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; 1E5FF;OL ONAL ABBREVIATION SIGN;Po;0;L;;;;;N;;;;; +1E6C0;TAI YO LETTER LOW KO;Lo;0;L;;;;;N;;;;; +1E6C1;TAI YO LETTER HIGH KO;Lo;0;L;;;;;N;;;;; +1E6C2;TAI YO LETTER LOW KHO;Lo;0;L;;;;;N;;;;; +1E6C3;TAI YO LETTER HIGH KHO;Lo;0;L;;;;;N;;;;; +1E6C4;TAI YO LETTER GO;Lo;0;L;;;;;N;;;;; +1E6C5;TAI YO LETTER NGO;Lo;0;L;;;;;N;;;;; +1E6C6;TAI YO LETTER CO;Lo;0;L;;;;;N;;;;; +1E6C7;TAI YO LETTER LOW XO;Lo;0;L;;;;;N;;;;; +1E6C8;TAI YO LETTER HIGH XO;Lo;0;L;;;;;N;;;;; +1E6C9;TAI YO LETTER LOW NYO;Lo;0;L;;;;;N;;;;; +1E6CA;TAI YO LETTER HIGH NYO;Lo;0;L;;;;;N;;;;; +1E6CB;TAI YO LETTER DO;Lo;0;L;;;;;N;;;;; +1E6CC;TAI YO LETTER LOW TO;Lo;0;L;;;;;N;;;;; +1E6CD;TAI YO LETTER HIGH TO;Lo;0;L;;;;;N;;;;; +1E6CE;TAI YO LETTER THO;Lo;0;L;;;;;N;;;;; +1E6CF;TAI YO LETTER NO;Lo;0;L;;;;;N;;;;; +1E6D0;TAI YO LETTER BO;Lo;0;L;;;;;N;;;;; +1E6D1;TAI YO LETTER LOW PO;Lo;0;L;;;;;N;;;;; +1E6D2;TAI YO LETTER HIGH PO;Lo;0;L;;;;;N;;;;; +1E6D3;TAI YO LETTER PHO;Lo;0;L;;;;;N;;;;; +1E6D4;TAI YO LETTER LOW FO;Lo;0;L;;;;;N;;;;; +1E6D5;TAI YO LETTER HIGH FO;Lo;0;L;;;;;N;;;;; +1E6D6;TAI YO LETTER MO;Lo;0;L;;;;;N;;;;; +1E6D7;TAI YO LETTER YO;Lo;0;L;;;;;N;;;;; +1E6D8;TAI YO LETTER LO;Lo;0;L;;;;;N;;;;; +1E6D9;TAI YO LETTER VO;Lo;0;L;;;;;N;;;;; +1E6DA;TAI YO LETTER LOW HO;Lo;0;L;;;;;N;;;;; +1E6DB;TAI YO LETTER HIGH HO;Lo;0;L;;;;;N;;;;; +1E6DC;TAI YO LETTER QO;Lo;0;L;;;;;N;;;;; +1E6DD;TAI YO LETTER LOW KVO;Lo;0;L;;;;;N;;;;; +1E6DE;TAI YO LETTER HIGH KVO;Lo;0;L;;;;;N;;;;; +1E6E0;TAI YO LETTER AA;Lo;0;L;;;;;N;;;;; +1E6E1;TAI YO LETTER I;Lo;0;L;;;;;N;;;;; +1E6E2;TAI YO LETTER UE;Lo;0;L;;;;;N;;;;; +1E6E3;TAI YO SIGN UE;Mn;230;NSM;;;;;N;;;;; +1E6E4;TAI YO LETTER U;Lo;0;L;;;;;N;;;;; +1E6E5;TAI YO LETTER AE;Lo;0;L;;;;;N;;;;; +1E6E6;TAI YO SIGN AU;Mn;230;NSM;;;;;N;;;;; +1E6E7;TAI YO LETTER O;Lo;0;L;;;;;N;;;;; +1E6E8;TAI YO LETTER E;Lo;0;L;;;;;N;;;;; +1E6E9;TAI YO LETTER IA;Lo;0;L;;;;;N;;;;; +1E6EA;TAI YO LETTER UEA;Lo;0;L;;;;;N;;;;; +1E6EB;TAI YO LETTER UA;Lo;0;L;;;;;N;;;;; +1E6EC;TAI YO LETTER OO;Lo;0;L;;;;;N;;;;; +1E6ED;TAI YO LETTER AUE;Lo;0;L;;;;;N;;;;; +1E6EE;TAI YO SIGN AY;Mn;230;NSM;;;;;N;;;;; +1E6EF;TAI YO SIGN ANG;Mn;230;NSM;;;;;N;;;;; +1E6F0;TAI YO LETTER AN;Lo;0;L;;;;;N;;;;; +1E6F1;TAI YO LETTER AM;Lo;0;L;;;;;N;;;;; +1E6F2;TAI YO LETTER AK;Lo;0;L;;;;;N;;;;; +1E6F3;TAI YO LETTER AT;Lo;0;L;;;;;N;;;;; +1E6F4;TAI YO LETTER AP;Lo;0;L;;;;;N;;;;; +1E6F5;TAI YO SIGN OM;Mn;230;NSM;;;;;N;;;;; +1E6FE;TAI YO SYMBOL MUEANG;Lo;0;L;;;;;N;;;;; +1E6FF;TAI YO XAM LAI;Lm;0;L;;;;;N;;;;; 1E7E0;ETHIOPIC SYLLABLE HHYA;Lo;0;L;;;;;N;;;;; 1E7E1;ETHIOPIC SYLLABLE HHYU;Lo;0;L;;;;;N;;;;; 1E7E2;ETHIOPIC SYLLABLE HHYI;Lo;0;L;;;;;N;;;;; @@ -38079,6 +38511,7 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 1F6D5;HINDU TEMPLE;So;0;ON;;;;;N;;;;; 1F6D6;HUT;So;0;ON;;;;;N;;;;; 1F6D7;ELEVATOR;So;0;ON;;;;;N;;;;; +1F6D8;LANDSLIDE;So;0;ON;;;;;N;;;;; 1F6DC;WIRELESS;So;0;ON;;;;;N;;;;; 1F6DD;PLAYGROUND SLIDE;So;0;ON;;;;;N;;;;; 1F6DE;WHEEL;So;0;ON;;;;;N;;;;; @@ -38228,6 +38661,10 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 1F774;LOT OF FORTUNE;So;0;ON;;;;;N;;;;; 1F775;OCCULTATION;So;0;ON;;;;;N;;;;; 1F776;LUNAR ECLIPSE;So;0;ON;;;;;N;;;;; +1F777;VESTA FORM TWO;So;0;ON;;;;;N;;;;; +1F778;ASTRAEA FORM TWO;So;0;ON;;;;;N;;;;; +1F779;HYGIEA FORM TWO;So;0;ON;;;;;N;;;;; +1F77A;PARTHENOPE FORM TWO;So;0;ON;;;;;N;;;;; 1F77B;HAUMEA;So;0;ON;;;;;N;;;;; 1F77C;MAKEMAKE;So;0;ON;;;;;N;;;;; 1F77D;GONGGONG;So;0;ON;;;;;N;;;;; @@ -38498,6 +38935,15 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 1F8BB;SOUTH WEST ARROW FROM BAR;So;0;ON;;;;;N;;;;; 1F8C0;LEFTWARDS ARROW FROM DOWNWARDS ARROW;So;0;ON;;;;;N;;;;; 1F8C1;RIGHTWARDS ARROW FROM DOWNWARDS ARROW;So;0;ON;;;;;N;;;;; +1F8D0;LONG RIGHTWARDS ARROW OVER LONG LEFTWARDS ARROW;Sm;0;ON;;;;;N;;;;; +1F8D1;LONG RIGHTWARDS HARPOON OVER LONG LEFTWARDS HARPOON;Sm;0;ON;;;;;N;;;;; +1F8D2;LONG RIGHTWARDS HARPOON ABOVE SHORT LEFTWARDS HARPOON;Sm;0;ON;;;;;N;;;;; +1F8D3;SHORT RIGHTWARDS HARPOON ABOVE LONG LEFTWARDS HARPOON;Sm;0;ON;;;;;N;;;;; +1F8D4;LONG LEFTWARDS HARPOON ABOVE SHORT RIGHTWARDS HARPOON;Sm;0;ON;;;;;N;;;;; +1F8D5;SHORT LEFTWARDS HARPOON ABOVE LONG RIGHTWARDS HARPOON;Sm;0;ON;;;;;N;;;;; +1F8D6;LONG RIGHTWARDS ARROW THROUGH X;Sm;0;ON;;;;;N;;;;; +1F8D7;LONG RIGHTWARDS ARROW WITH DOUBLE SLASH;Sm;0;ON;;;;;N;;;;; +1F8D8;LONG LEFT RIGHT ARROW WITH DEPENDENT LOBE;Sm;0;ON;;;;;N;;;;; 1F900;CIRCLED CROSS FORMEE WITH FOUR DOTS;So;0;ON;;;;;N;;;;; 1F901;CIRCLED CROSS FORMEE WITH TWO DOTS;So;0;ON;;;;;N;;;;; 1F902;CIRCLED CROSS FORMEE;So;0;ON;;;;;N;;;;; @@ -38838,6 +39284,10 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 1FA51;BLACK CHESS KNIGHT-QUEEN;So;0;ON;;;;;N;;;;; 1FA52;BLACK CHESS KNIGHT-ROOK;So;0;ON;;;;;N;;;;; 1FA53;BLACK CHESS KNIGHT-BISHOP;So;0;ON;;;;;N;;;;; +1FA54;WHITE CHESS FERZ;So;0;ON;;;;;N;;;;; +1FA55;WHITE CHESS ALFIL;So;0;ON;;;;;N;;;;; +1FA56;BLACK CHESS FERZ;So;0;ON;;;;;N;;;;; +1FA57;BLACK CHESS ALFIL;So;0;ON;;;;;N;;;;; 1FA60;XIANGQI RED GENERAL;So;0;ON;;;;;N;;;;; 1FA61;XIANGQI RED MANDARIN;So;0;ON;;;;;N;;;;; 1FA62;XIANGQI RED ELEPHANT;So;0;ON;;;;;N;;;;; @@ -38875,6 +39325,8 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 1FA87;MARACAS;So;0;ON;;;;;N;;;;; 1FA88;FLUTE;So;0;ON;;;;;N;;;;; 1FA89;HARP;So;0;ON;;;;;N;;;;; +1FA8A;TROMBONE;So;0;ON;;;;;N;;;;; +1FA8E;TREASURE CHEST;So;0;ON;;;;;N;;;;; 1FA8F;SHOVEL;So;0;ON;;;;;N;;;;; 1FA90;RINGED PLANET;So;0;ON;;;;;N;;;;; 1FA91;CHAIR;So;0;ON;;;;;N;;;;; @@ -38931,6 +39383,8 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 1FAC4;PREGNANT PERSON;So;0;ON;;;;;N;;;;; 1FAC5;PERSON WITH CROWN;So;0;ON;;;;;N;;;;; 1FAC6;FINGERPRINT;So;0;ON;;;;;N;;;;; +1FAC8;HAIRY CREATURE;So;0;ON;;;;;N;;;;; +1FACD;ORCA;So;0;ON;;;;;N;;;;; 1FACE;MOOSE;So;0;ON;;;;;N;;;;; 1FACF;DONKEY;So;0;ON;;;;;N;;;;; 1FAD0;BLUEBERRIES;So;0;ON;;;;;N;;;;; @@ -38957,6 +39411,8 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 1FAE7;BUBBLES;So;0;ON;;;;;N;;;;; 1FAE8;SHAKING FACE;So;0;ON;;;;;N;;;;; 1FAE9;FACE WITH BAGS UNDER EYES;So;0;ON;;;;;N;;;;; +1FAEA;DISTORTED FACE;So;0;ON;;;;;N;;;;; +1FAEF;FIGHT CLOUD;So;0;ON;;;;;N;;;;; 1FAF0;HAND WITH INDEX FINGER AND THUMB CROSSED;So;0;ON;;;;;N;;;;; 1FAF1;RIGHTWARDS HAND;So;0;ON;;;;;N;;;;; 1FAF2;LEFTWARDS HAND;So;0;ON;;;;;N;;;;; @@ -39215,14 +39671,15 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 1FBF7;SEGMENTED DIGIT SEVEN;Nd;0;EN; 0037;7;7;7;N;;;;; 1FBF8;SEGMENTED DIGIT EIGHT;Nd;0;EN; 0038;8;8;8;N;;;;; 1FBF9;SEGMENTED DIGIT NINE;Nd;0;EN; 0039;9;9;9;N;;;;; +1FBFA;ALARM BELL SYMBOL;So;0;ON;;;;;N;;;;; 20000;;Lo;0;L;;;;;N;;;;; 2A6DF;;Lo;0;L;;;;;N;;;;; 2A700;;Lo;0;L;;;;;N;;;;; -2B739;;Lo;0;L;;;;;N;;;;; +2B73F;;Lo;0;L;;;;;N;;;;; 2B740;;Lo;0;L;;;;;N;;;;; 2B81D;;Lo;0;L;;;;;N;;;;; 2B820;;Lo;0;L;;;;;N;;;;; -2CEA1;;Lo;0;L;;;;;N;;;;; +2CEAD;;Lo;0;L;;;;;N;;;;; 2CEB0;;Lo;0;L;;;;;N;;;;; 2EBE0;;Lo;0;L;;;;;N;;;;; 2EBF0;;Lo;0;L;;;;;N;;;;; @@ -39773,6 +40230,8 @@ FFFD;REPLACEMENT CHARACTER;So;0;ON;;;;;N;;;;; 3134A;;Lo;0;L;;;;;N;;;;; 31350;;Lo;0;L;;;;;N;;;;; 323AF;;Lo;0;L;;;;;N;;;;; +323B0;;Lo;0;L;;;;;N;;;;; +33479;;Lo;0;L;;;;;N;;;;; E0001;LANGUAGE TAG;Cf;0;BN;;;;;N;;;;; E0020;TAG SPACE;Cf;0;BN;;;;;N;;;;; E0021;TAG EXCLAMATION MARK;Cf;0;BN;;;;;N;;;;; diff --git a/contrib/unicode/emoji-data.txt b/contrib/unicode/emoji-data.txt index ff99028248b5..450252c4df3f 100644 --- a/contrib/unicode/emoji-data.txt +++ b/contrib/unicode/emoji-data.txt @@ -1,11 +1,11 @@ # emoji-data.txt -# Date: 2024-05-01, 21:25:24 GMT -# © 2024 Unicode®, Inc. +# Date: 2025-07-25, 17:54:31 GMT +# © 2025 Unicode®, Inc. # Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries. # For terms of use and license, see https://www.unicode.org/terms_of_use.html # # Emoji Data for UTS #51 -# Used with Emoji Version 16.0 and subsequent minor revisions (if any) +# Version: 17.0 # # For documentation and usage, see https://www.unicode.org/reports/tr51 # @@ -340,6 +340,7 @@ 1F6D1..1F6D2 ; Emoji # E3.0 [2] (🛑..🛒) stop sign..shopping cart 1F6D5 ; Emoji # E12.0 [1] (🛕) hindu temple 1F6D6..1F6D7 ; Emoji # E13.0 [2] (🛖..🛗) hut..elevator +1F6D8 ; Emoji # E17.0 [1] (🛘) landslide 1F6DC ; Emoji # E15.0 [1] (🛜) wireless 1F6DD..1F6DF ; Emoji # E14.0 [3] (🛝..🛟) playground slide..ring buoy 1F6E0..1F6E5 ; Emoji # E0.7 [6] (🛠️..🛥️) hammer and wrench..motor boat @@ -408,6 +409,8 @@ 1FA83..1FA86 ; Emoji # E13.0 [4] (🪃..🪆) boomerang..nesting dolls 1FA87..1FA88 ; Emoji # E15.0 [2] (🪇..🪈) maracas..flute 1FA89 ; Emoji # E16.0 [1] (🪉) harp +1FA8A ; Emoji # E17.0 [1] (🪊) trombone +1FA8E ; Emoji # E17.0 [1] (🪎) treasure chest 1FA8F ; Emoji # E16.0 [1] (🪏) shovel 1FA90..1FA95 ; Emoji # E12.0 [6] (🪐..🪕) ringed planet..banjo 1FA96..1FAA8 ; Emoji # E13.0 [19] (🪖..🪨) military helmet..rock @@ -421,6 +424,8 @@ 1FAC0..1FAC2 ; Emoji # E13.0 [3] (🫀..🫂) anatomical heart..people hugging 1FAC3..1FAC5 ; Emoji # E14.0 [3] (🫃..🫅) pregnant man..person with crown 1FAC6 ; Emoji # E16.0 [1] (🫆) fingerprint +1FAC8 ; Emoji # E17.0 [1] (🫈) hairy creature +1FACD ; Emoji # E17.0 [1] (🫍) orca 1FACE..1FACF ; Emoji # E15.0 [2] (🫎..🫏) moose..donkey 1FAD0..1FAD6 ; Emoji # E13.0 [7] (🫐..🫖) blueberries..teapot 1FAD7..1FAD9 ; Emoji # E14.0 [3] (🫗..🫙) pouring liquid..jar @@ -430,10 +435,12 @@ 1FAE0..1FAE7 ; Emoji # E14.0 [8] (🫠..🫧) melting face..bubbles 1FAE8 ; Emoji # E15.0 [1] (🫨) shaking face 1FAE9 ; Emoji # E16.0 [1] (🫩) face with bags under eyes +1FAEA ; Emoji # E17.0 [1] (🫪) distorted face +1FAEF ; Emoji # E17.0 [1] (🫯) fight cloud 1FAF0..1FAF6 ; Emoji # E14.0 [7] (🫰..🫶) hand with index finger and thumb crossed..heart hands 1FAF7..1FAF8 ; Emoji # E15.0 [2] (🫷..🫸) leftwards pushing hand..rightwards pushing hand -# Total elements: 1431 +# Total elements: 1438 # ================================================ @@ -640,6 +647,7 @@ 1F6D1..1F6D2 ; Emoji_Presentation # E3.0 [2] (🛑..🛒) stop sign..shopping cart 1F6D5 ; Emoji_Presentation # E12.0 [1] (🛕) hindu temple 1F6D6..1F6D7 ; Emoji_Presentation # E13.0 [2] (🛖..🛗) hut..elevator +1F6D8 ; Emoji_Presentation # E17.0 [1] (🛘) landslide 1F6DC ; Emoji_Presentation # E15.0 [1] (🛜) wireless 1F6DD..1F6DF ; Emoji_Presentation # E14.0 [3] (🛝..🛟) playground slide..ring buoy 1F6EB..1F6EC ; Emoji_Presentation # E1.0 [2] (🛫..🛬) airplane departure..airplane arrival @@ -704,6 +712,8 @@ 1FA83..1FA86 ; Emoji_Presentation # E13.0 [4] (🪃..🪆) boomerang..nesting dolls 1FA87..1FA88 ; Emoji_Presentation # E15.0 [2] (🪇..🪈) maracas..flute 1FA89 ; Emoji_Presentation # E16.0 [1] (🪉) harp +1FA8A ; Emoji_Presentation # E17.0 [1] (🪊) trombone +1FA8E ; Emoji_Presentation # E17.0 [1] (🪎) treasure chest 1FA8F ; Emoji_Presentation # E16.0 [1] (🪏) shovel 1FA90..1FA95 ; Emoji_Presentation # E12.0 [6] (🪐..🪕) ringed planet..banjo 1FA96..1FAA8 ; Emoji_Presentation # E13.0 [19] (🪖..🪨) military helmet..rock @@ -717,6 +727,8 @@ 1FAC0..1FAC2 ; Emoji_Presentation # E13.0 [3] (🫀..🫂) anatomical heart..people hugging 1FAC3..1FAC5 ; Emoji_Presentation # E14.0 [3] (🫃..🫅) pregnant man..person with crown 1FAC6 ; Emoji_Presentation # E16.0 [1] (🫆) fingerprint +1FAC8 ; Emoji_Presentation # E17.0 [1] (🫈) hairy creature +1FACD ; Emoji_Presentation # E17.0 [1] (🫍) orca 1FACE..1FACF ; Emoji_Presentation # E15.0 [2] (🫎..🫏) moose..donkey 1FAD0..1FAD6 ; Emoji_Presentation # E13.0 [7] (🫐..🫖) blueberries..teapot 1FAD7..1FAD9 ; Emoji_Presentation # E14.0 [3] (🫗..🫙) pouring liquid..jar @@ -726,10 +738,12 @@ 1FAE0..1FAE7 ; Emoji_Presentation # E14.0 [8] (🫠..🫧) melting face..bubbles 1FAE8 ; Emoji_Presentation # E15.0 [1] (🫨) shaking face 1FAE9 ; Emoji_Presentation # E16.0 [1] (🫩) face with bags under eyes +1FAEA ; Emoji_Presentation # E17.0 [1] (🫪) distorted face +1FAEF ; Emoji_Presentation # E17.0 [1] (🫯) fight cloud 1FAF0..1FAF6 ; Emoji_Presentation # E14.0 [7] (🫰..🫶) hand with index finger and thumb crossed..heart hands 1FAF7..1FAF8 ; Emoji_Presentation # E15.0 [2] (🫷..🫸) leftwards pushing hand..rightwards pushing hand -# Total elements: 1212 +# Total elements: 1219 # ================================================ @@ -827,7 +841,6 @@ E0020..E007F ; Emoji_Component # E0.0 [96] (󠀠..󠁿) tag space..c 21A9..21AA ; Extended_Pictographic# E0.6 [2] (↩️..↪️) right arrow curving left..left arrow curving right 231A..231B ; Extended_Pictographic# E0.6 [2] (⌚..⌛) watch..hourglass done 2328 ; Extended_Pictographic# E1.0 [1] (⌨️) keyboard -2388 ; Extended_Pictographic# E0.0 [1] (⎈) HELM SYMBOL 23CF ; Extended_Pictographic# E1.0 [1] (⏏️) eject button 23E9..23EC ; Extended_Pictographic# E0.6 [4] (⏩..⏬) fast-forward button..fast down button 23ED..23EE ; Extended_Pictographic# E0.7 [2] (⏭️..⏮️) next track button..last track button @@ -844,106 +857,63 @@ E0020..E007F ; Emoji_Component # E0.0 [96] (󠀠..󠁿) tag space..c 2600..2601 ; Extended_Pictographic# E0.6 [2] (☀️..☁️) sun..cloud 2602..2603 ; Extended_Pictographic# E0.7 [2] (☂️..☃️) umbrella..snowman 2604 ; Extended_Pictographic# E1.0 [1] (☄️) comet -2605 ; Extended_Pictographic# E0.0 [1] (★) BLACK STAR -2607..260D ; Extended_Pictographic# E0.0 [7] (☇..☍) LIGHTNING..OPPOSITION 260E ; Extended_Pictographic# E0.6 [1] (☎️) telephone -260F..2610 ; Extended_Pictographic# E0.0 [2] (☏..☐) WHITE TELEPHONE..BALLOT BOX 2611 ; Extended_Pictographic# E0.6 [1] (☑️) check box with check -2612 ; Extended_Pictographic# E0.0 [1] (☒) BALLOT BOX WITH X 2614..2615 ; Extended_Pictographic# E0.6 [2] (☔..☕) umbrella with rain drops..hot beverage -2616..2617 ; Extended_Pictographic# E0.0 [2] (☖..☗) WHITE SHOGI PIECE..BLACK SHOGI PIECE 2618 ; Extended_Pictographic# E1.0 [1] (☘️) shamrock -2619..261C ; Extended_Pictographic# E0.0 [4] (☙..☜) REVERSED ROTATED FLORAL HEART BULLET..WHITE LEFT POINTING INDEX 261D ; Extended_Pictographic# E0.6 [1] (☝️) index pointing up -261E..261F ; Extended_Pictographic# E0.0 [2] (☞..☟) WHITE RIGHT POINTING INDEX..WHITE DOWN POINTING INDEX 2620 ; Extended_Pictographic# E1.0 [1] (☠️) skull and crossbones -2621 ; Extended_Pictographic# E0.0 [1] (☡) CAUTION SIGN 2622..2623 ; Extended_Pictographic# E1.0 [2] (☢️..☣️) radioactive..biohazard -2624..2625 ; Extended_Pictographic# E0.0 [2] (☤..☥) CADUCEUS..ANKH 2626 ; Extended_Pictographic# E1.0 [1] (☦️) orthodox cross -2627..2629 ; Extended_Pictographic# E0.0 [3] (☧..☩) CHI RHO..CROSS OF JERUSALEM 262A ; Extended_Pictographic# E0.7 [1] (☪️) star and crescent -262B..262D ; Extended_Pictographic# E0.0 [3] (☫..☭) FARSI SYMBOL..HAMMER AND SICKLE 262E ; Extended_Pictographic# E1.0 [1] (☮️) peace symbol 262F ; Extended_Pictographic# E0.7 [1] (☯️) yin yang -2630..2637 ; Extended_Pictographic# E0.0 [8] (☰..☷) TRIGRAM FOR HEAVEN..TRIGRAM FOR EARTH 2638..2639 ; Extended_Pictographic# E0.7 [2] (☸️..☹️) wheel of dharma..frowning face 263A ; Extended_Pictographic# E0.6 [1] (☺️) smiling face -263B..263F ; Extended_Pictographic# E0.0 [5] (☻..☿) BLACK SMILING FACE..MERCURY 2640 ; Extended_Pictographic# E4.0 [1] (♀️) female sign -2641 ; Extended_Pictographic# E0.0 [1] (♁) EARTH 2642 ; Extended_Pictographic# E4.0 [1] (♂️) male sign -2643..2647 ; Extended_Pictographic# E0.0 [5] (♃..♇) JUPITER..PLUTO 2648..2653 ; Extended_Pictographic# E0.6 [12] (♈..♓) Aries..Pisces -2654..265E ; Extended_Pictographic# E0.0 [11] (♔..♞) WHITE CHESS KING..BLACK CHESS KNIGHT 265F ; Extended_Pictographic# E11.0 [1] (♟️) chess pawn 2660 ; Extended_Pictographic# E0.6 [1] (♠️) spade suit -2661..2662 ; Extended_Pictographic# E0.0 [2] (♡..♢) WHITE HEART SUIT..WHITE DIAMOND SUIT 2663 ; Extended_Pictographic# E0.6 [1] (♣️) club suit -2664 ; Extended_Pictographic# E0.0 [1] (♤) WHITE SPADE SUIT 2665..2666 ; Extended_Pictographic# E0.6 [2] (♥️..♦️) heart suit..diamond suit -2667 ; Extended_Pictographic# E0.0 [1] (♧) WHITE CLUB SUIT 2668 ; Extended_Pictographic# E0.6 [1] (♨️) hot springs -2669..267A ; Extended_Pictographic# E0.0 [18] (♩..♺) QUARTER NOTE..RECYCLING SYMBOL FOR GENERIC MATERIALS 267B ; Extended_Pictographic# E0.6 [1] (♻️) recycling symbol -267C..267D ; Extended_Pictographic# E0.0 [2] (♼..♽) RECYCLED PAPER SYMBOL..PARTIALLY-RECYCLED PAPER SYMBOL 267E ; Extended_Pictographic# E11.0 [1] (♾️) infinity 267F ; Extended_Pictographic# E0.6 [1] (♿) wheelchair symbol -2680..2685 ; Extended_Pictographic# E0.0 [6] (⚀..⚅) DIE FACE-1..DIE FACE-6 -2690..2691 ; Extended_Pictographic# E0.0 [2] (⚐..⚑) WHITE FLAG..BLACK FLAG 2692 ; Extended_Pictographic# E1.0 [1] (⚒️) hammer and pick 2693 ; Extended_Pictographic# E0.6 [1] (⚓) anchor 2694 ; Extended_Pictographic# E1.0 [1] (⚔️) crossed swords 2695 ; Extended_Pictographic# E4.0 [1] (⚕️) medical symbol 2696..2697 ; Extended_Pictographic# E1.0 [2] (⚖️..⚗️) balance scale..alembic -2698 ; Extended_Pictographic# E0.0 [1] (⚘) FLOWER 2699 ; Extended_Pictographic# E1.0 [1] (⚙️) gear -269A ; Extended_Pictographic# E0.0 [1] (⚚) STAFF OF HERMES 269B..269C ; Extended_Pictographic# E1.0 [2] (⚛️..⚜️) atom symbol..fleur-de-lis -269D..269F ; Extended_Pictographic# E0.0 [3] (⚝..⚟) OUTLINED WHITE STAR..THREE LINES CONVERGING LEFT 26A0..26A1 ; Extended_Pictographic# E0.6 [2] (⚠️..⚡) warning..high voltage -26A2..26A6 ; Extended_Pictographic# E0.0 [5] (⚢..⚦) DOUBLED FEMALE SIGN..MALE WITH STROKE SIGN 26A7 ; Extended_Pictographic# E13.0 [1] (⚧️) transgender symbol -26A8..26A9 ; Extended_Pictographic# E0.0 [2] (⚨..⚩) VERTICAL MALE WITH STROKE SIGN..HORIZONTAL MALE WITH STROKE SIGN 26AA..26AB ; Extended_Pictographic# E0.6 [2] (⚪..⚫) white circle..black circle -26AC..26AF ; Extended_Pictographic# E0.0 [4] (⚬..⚯) MEDIUM SMALL WHITE CIRCLE..UNMARRIED PARTNERSHIP SYMBOL 26B0..26B1 ; Extended_Pictographic# E1.0 [2] (⚰️..⚱️) coffin..funeral urn -26B2..26BC ; Extended_Pictographic# E0.0 [11] (⚲..⚼) NEUTER..SESQUIQUADRATE 26BD..26BE ; Extended_Pictographic# E0.6 [2] (⚽..⚾) soccer ball..baseball -26BF..26C3 ; Extended_Pictographic# E0.0 [5] (⚿..⛃) SQUARED KEY..BLACK DRAUGHTS KING 26C4..26C5 ; Extended_Pictographic# E0.6 [2] (⛄..⛅) snowman without snow..sun behind cloud -26C6..26C7 ; Extended_Pictographic# E0.0 [2] (⛆..⛇) RAIN..BLACK SNOWMAN 26C8 ; Extended_Pictographic# E0.7 [1] (⛈️) cloud with lightning and rain -26C9..26CD ; Extended_Pictographic# E0.0 [5] (⛉..⛍) TURNED WHITE SHOGI PIECE..DISABLED CAR 26CE ; Extended_Pictographic# E0.6 [1] (⛎) Ophiuchus 26CF ; Extended_Pictographic# E0.7 [1] (⛏️) pick -26D0 ; Extended_Pictographic# E0.0 [1] (⛐) CAR SLIDING 26D1 ; Extended_Pictographic# E0.7 [1] (⛑️) rescue worker’s helmet -26D2 ; Extended_Pictographic# E0.0 [1] (⛒) CIRCLED CROSSING LANES 26D3 ; Extended_Pictographic# E0.7 [1] (⛓️) chains 26D4 ; Extended_Pictographic# E0.6 [1] (⛔) no entry -26D5..26E8 ; Extended_Pictographic# E0.0 [20] (⛕..⛨) ALTERNATE ONE-WAY LEFT WAY TRAFFIC..BLACK CROSS ON SHIELD 26E9 ; Extended_Pictographic# E0.7 [1] (⛩️) shinto shrine 26EA ; Extended_Pictographic# E0.6 [1] (⛪) church -26EB..26EF ; Extended_Pictographic# E0.0 [5] (⛫..⛯) CASTLE..MAP SYMBOL FOR LIGHTHOUSE 26F0..26F1 ; Extended_Pictographic# E0.7 [2] (⛰️..⛱️) mountain..umbrella on ground 26F2..26F3 ; Extended_Pictographic# E0.6 [2] (⛲..⛳) fountain..flag in hole 26F4 ; Extended_Pictographic# E0.7 [1] (⛴️) ferry 26F5 ; Extended_Pictographic# E0.6 [1] (⛵) sailboat -26F6 ; Extended_Pictographic# E0.0 [1] (⛶) SQUARE FOUR CORNERS 26F7..26F9 ; Extended_Pictographic# E0.7 [3] (⛷️..⛹️) skier..person bouncing ball 26FA ; Extended_Pictographic# E0.6 [1] (⛺) tent -26FB..26FC ; Extended_Pictographic# E0.0 [2] (⛻..⛼) JAPANESE BANK SYMBOL..HEADSTONE GRAVEYARD SYMBOL 26FD ; Extended_Pictographic# E0.6 [1] (⛽) fuel pump -26FE..2701 ; Extended_Pictographic# E0.0 [4] (⛾..✁) CUP ON BLACK SQUARE..UPPER BLADE SCISSORS 2702 ; Extended_Pictographic# E0.6 [1] (✂️) scissors -2703..2704 ; Extended_Pictographic# E0.0 [2] (✃..✄) LOWER BLADE SCISSORS..WHITE SCISSORS 2705 ; Extended_Pictographic# E0.6 [1] (✅) check mark button 2708..270C ; Extended_Pictographic# E0.6 [5] (✈️..✌️) airplane..victory hand 270D ; Extended_Pictographic# E0.7 [1] (✍️) writing hand -270E ; Extended_Pictographic# E0.0 [1] (✎) LOWER RIGHT PENCIL 270F ; Extended_Pictographic# E0.6 [1] (✏️) pencil -2710..2711 ; Extended_Pictographic# E0.0 [2] (✐..✑) UPPER RIGHT PENCIL..WHITE NIB 2712 ; Extended_Pictographic# E0.6 [1] (✒️) black nib 2714 ; Extended_Pictographic# E0.6 [1] (✔️) check mark 2716 ; Extended_Pictographic# E0.6 [1] (✖️) multiply @@ -959,7 +929,6 @@ E0020..E007F ; Emoji_Component # E0.0 [96] (󠀠..󠁿) tag space..c 2757 ; Extended_Pictographic# E0.6 [1] (❗) red exclamation mark 2763 ; Extended_Pictographic# E1.0 [1] (❣️) heart exclamation 2764 ; Extended_Pictographic# E0.6 [1] (❤️) red heart -2765..2767 ; Extended_Pictographic# E0.0 [3] (❥..❧) ROTATED HEAVY BLACK HEART BULLET..ROTATED FLORAL HEART BULLET 2795..2797 ; Extended_Pictographic# E0.6 [3] (➕..➗) plus..divide 27A1 ; Extended_Pictographic# E0.6 [1] (➡️) right arrow 27B0 ; Extended_Pictographic# E0.6 [1] (➰) curly loop @@ -973,19 +942,19 @@ E0020..E007F ; Emoji_Component # E0.0 [96] (󠀠..󠁿) tag space..c 303D ; Extended_Pictographic# E0.6 [1] (〽️) part alternation mark 3297 ; Extended_Pictographic# E0.6 [1] (㊗️) Japanese “congratulations” button 3299 ; Extended_Pictographic# E0.6 [1] (㊙️) Japanese “secret” button -1F000..1F003 ; Extended_Pictographic# E0.0 [4] (🀀..🀃) MAHJONG TILE EAST WIND..MAHJONG TILE NORTH WIND 1F004 ; Extended_Pictographic# E0.6 [1] (🀄) mahjong red dragon -1F005..1F0CE ; Extended_Pictographic# E0.0 [202] (🀅..🃎) MAHJONG TILE GREEN DRAGON..PLAYING CARD KING OF DIAMONDS +1F02C..1F02F ; Extended_Pictographic# E0.0 [4] (🀬..🀯) .. +1F094..1F09F ; Extended_Pictographic# E0.0 [12] (🂔..🂟) .. +1F0AF..1F0B0 ; Extended_Pictographic# E0.0 [2] (🂯..🂰) .. +1F0C0 ; Extended_Pictographic# E0.0 [1] (🃀) 1F0CF ; Extended_Pictographic# E0.6 [1] (🃏) joker -1F0D0..1F0FF ; Extended_Pictographic# E0.0 [48] (🃐..🃿) .. -1F10D..1F10F ; Extended_Pictographic# E0.0 [3] (🄍..🄏) CIRCLED ZERO WITH SLASH..CIRCLED DOLLAR SIGN WITH OVERLAID BACKSLASH -1F12F ; Extended_Pictographic# E0.0 [1] (🄯) COPYLEFT SYMBOL -1F16C..1F16F ; Extended_Pictographic# E0.0 [4] (🅬..🅯) RAISED MR SIGN..CIRCLED HUMAN FIGURE +1F0D0 ; Extended_Pictographic# E0.0 [1] (🃐) +1F0F6..1F0FF ; Extended_Pictographic# E0.0 [10] (🃶..🃿) .. 1F170..1F171 ; Extended_Pictographic# E0.6 [2] (🅰️..🅱️) A button (blood type)..B button (blood type) 1F17E..1F17F ; Extended_Pictographic# E0.6 [2] (🅾️..🅿️) O button (blood type)..P button 1F18E ; Extended_Pictographic# E0.6 [1] (🆎) AB button (blood type) 1F191..1F19A ; Extended_Pictographic# E0.6 [10] (🆑..🆚) CL button..VS button -1F1AD..1F1E5 ; Extended_Pictographic# E0.0 [57] (🆭..🇥) MASK WORK SYMBOL.. +1F1AE..1F1E5 ; Extended_Pictographic# E0.0 [56] (🆮..🇥) .. 1F201..1F202 ; Extended_Pictographic# E0.6 [2] (🈁..🈂️) Japanese “here” button..Japanese “service charge” button 1F203..1F20F ; Extended_Pictographic# E0.0 [13] (🈃..🈏) .. 1F21A ; Extended_Pictographic# E0.6 [1] (🈚) Japanese “free of charge” button @@ -994,7 +963,8 @@ E0020..E007F ; Emoji_Component # E0.0 [96] (󠀠..󠁿) tag space..c 1F23C..1F23F ; Extended_Pictographic# E0.0 [4] (🈼..🈿) .. 1F249..1F24F ; Extended_Pictographic# E0.0 [7] (🉉..🉏) .. 1F250..1F251 ; Extended_Pictographic# E0.6 [2] (🉐..🉑) Japanese “bargain” button..Japanese “acceptable” button -1F252..1F2FF ; Extended_Pictographic# E0.0 [174] (🉒..🋿) .. +1F252..1F25F ; Extended_Pictographic# E0.0 [14] (🉒..🉟) .. +1F266..1F2FF ; Extended_Pictographic# E0.0 [154] (🉦..🋿) .. 1F300..1F30C ; Extended_Pictographic# E0.6 [13] (🌀..🌌) cyclone..milky way 1F30D..1F30E ; Extended_Pictographic# E0.7 [2] (🌍..🌎) globe showing Europe-Africa..globe showing Americas 1F30F ; Extended_Pictographic# E0.6 [1] (🌏) globe showing Asia-Australia @@ -1010,7 +980,6 @@ E0020..E007F ; Emoji_Component # E0.0 [96] (󠀠..󠁿) tag space..c 1F31D..1F31E ; Extended_Pictographic# E1.0 [2] (🌝..🌞) full moon face..sun with face 1F31F..1F320 ; Extended_Pictographic# E0.6 [2] (🌟..🌠) glowing star..shooting star 1F321 ; Extended_Pictographic# E0.7 [1] (🌡️) thermometer -1F322..1F323 ; Extended_Pictographic# E0.0 [2] (🌢..🌣) BLACK DROPLET..WHITE SUN 1F324..1F32C ; Extended_Pictographic# E0.7 [9] (🌤️..🌬️) sun behind small cloud..wind face 1F32D..1F32F ; Extended_Pictographic# E1.0 [3] (🌭..🌯) hot dog..burrito 1F330..1F331 ; Extended_Pictographic# E0.6 [2] (🌰..🌱) chestnut..seedling @@ -1026,11 +995,8 @@ E0020..E007F ; Emoji_Component # E0.0 [96] (󠀠..󠁿) tag space..c 1F37D ; Extended_Pictographic# E0.7 [1] (🍽️) fork and knife with plate 1F37E..1F37F ; Extended_Pictographic# E1.0 [2] (🍾..🍿) bottle with popping cork..popcorn 1F380..1F393 ; Extended_Pictographic# E0.6 [20] (🎀..🎓) ribbon..graduation cap -1F394..1F395 ; Extended_Pictographic# E0.0 [2] (🎔..🎕) HEART WITH TIP ON THE LEFT..BOUQUET OF FLOWERS 1F396..1F397 ; Extended_Pictographic# E0.7 [2] (🎖️..🎗️) military medal..reminder ribbon -1F398 ; Extended_Pictographic# E0.0 [1] (🎘) MUSICAL KEYBOARD WITH JACKS 1F399..1F39B ; Extended_Pictographic# E0.7 [3] (🎙️..🎛️) studio microphone..control knobs -1F39C..1F39D ; Extended_Pictographic# E0.0 [2] (🎜..🎝) BEAMED ASCENDING MUSICAL NOTES..BEAMED DESCENDING MUSICAL NOTES 1F39E..1F39F ; Extended_Pictographic# E0.7 [2] (🎞️..🎟️) film frames..admission tickets 1F3A0..1F3C4 ; Extended_Pictographic# E0.6 [37] (🎠..🏄) carousel horse..person surfing 1F3C5 ; Extended_Pictographic# E1.0 [1] (🏅) sports medal @@ -1045,11 +1011,9 @@ E0020..E007F ; Emoji_Component # E0.0 [96] (󠀠..󠁿) tag space..c 1F3E0..1F3E3 ; Extended_Pictographic# E0.6 [4] (🏠..🏣) house..Japanese post office 1F3E4 ; Extended_Pictographic# E1.0 [1] (🏤) post office 1F3E5..1F3F0 ; Extended_Pictographic# E0.6 [12] (🏥..🏰) hospital..castle -1F3F1..1F3F2 ; Extended_Pictographic# E0.0 [2] (🏱..🏲) WHITE PENNANT..BLACK PENNANT 1F3F3 ; Extended_Pictographic# E0.7 [1] (🏳️) white flag 1F3F4 ; Extended_Pictographic# E1.0 [1] (🏴) black flag 1F3F5 ; Extended_Pictographic# E0.7 [1] (🏵️) rosette -1F3F6 ; Extended_Pictographic# E0.0 [1] (🏶) BLACK ROSETTE 1F3F7 ; Extended_Pictographic# E0.7 [1] (🏷️) label 1F3F8..1F3FA ; Extended_Pictographic# E1.0 [3] (🏸..🏺) badminton..amphora 1F400..1F407 ; Extended_Pictographic# E1.0 [8] (🐀..🐇) rat..rabbit @@ -1086,7 +1050,6 @@ E0020..E007F ; Emoji_Component # E0.0 [96] (󠀠..󠁿) tag space..c 1F4F8 ; Extended_Pictographic# E1.0 [1] (📸) camera with flash 1F4F9..1F4FC ; Extended_Pictographic# E0.6 [4] (📹..📼) video camera..videocassette 1F4FD ; Extended_Pictographic# E0.7 [1] (📽️) film projector -1F4FE ; Extended_Pictographic# E0.0 [1] (📾) PORTABLE STEREO 1F4FF..1F502 ; Extended_Pictographic# E1.0 [4] (📿..🔂) prayer beads..repeat single button 1F503 ; Extended_Pictographic# E0.6 [1] (🔃) clockwise vertical arrows 1F504..1F507 ; Extended_Pictographic# E1.0 [4] (🔄..🔇) counterclockwise arrows button..muted speaker @@ -1097,51 +1060,30 @@ E0020..E007F ; Emoji_Component # E0.0 [96] (󠀠..󠁿) tag space..c 1F516..1F52B ; Extended_Pictographic# E0.6 [22] (🔖..🔫) bookmark..water pistol 1F52C..1F52D ; Extended_Pictographic# E1.0 [2] (🔬..🔭) microscope..telescope 1F52E..1F53D ; Extended_Pictographic# E0.6 [16] (🔮..🔽) crystal ball..downwards button -1F546..1F548 ; Extended_Pictographic# E0.0 [3] (🕆..🕈) WHITE LATIN CROSS..CELTIC CROSS 1F549..1F54A ; Extended_Pictographic# E0.7 [2] (🕉️..🕊️) om..dove 1F54B..1F54E ; Extended_Pictographic# E1.0 [4] (🕋..🕎) kaaba..menorah -1F54F ; Extended_Pictographic# E0.0 [1] (🕏) BOWL OF HYGIEIA 1F550..1F55B ; Extended_Pictographic# E0.6 [12] (🕐..🕛) one o’clock..twelve o’clock 1F55C..1F567 ; Extended_Pictographic# E0.7 [12] (🕜..🕧) one-thirty..twelve-thirty -1F568..1F56E ; Extended_Pictographic# E0.0 [7] (🕨..🕮) RIGHT SPEAKER..BOOK 1F56F..1F570 ; Extended_Pictographic# E0.7 [2] (🕯️..🕰️) candle..mantelpiece clock -1F571..1F572 ; Extended_Pictographic# E0.0 [2] (🕱..🕲) BLACK SKULL AND CROSSBONES..NO PIRACY 1F573..1F579 ; Extended_Pictographic# E0.7 [7] (🕳️..🕹️) hole..joystick 1F57A ; Extended_Pictographic# E3.0 [1] (🕺) man dancing -1F57B..1F586 ; Extended_Pictographic# E0.0 [12] (🕻..🖆) LEFT HAND TELEPHONE RECEIVER..PEN OVER STAMPED ENVELOPE 1F587 ; Extended_Pictographic# E0.7 [1] (🖇️) linked paperclips -1F588..1F589 ; Extended_Pictographic# E0.0 [2] (🖈..🖉) BLACK PUSHPIN..LOWER LEFT PENCIL 1F58A..1F58D ; Extended_Pictographic# E0.7 [4] (🖊️..🖍️) pen..crayon -1F58E..1F58F ; Extended_Pictographic# E0.0 [2] (🖎..🖏) LEFT WRITING HAND..TURNED OK HAND SIGN 1F590 ; Extended_Pictographic# E0.7 [1] (🖐️) hand with fingers splayed -1F591..1F594 ; Extended_Pictographic# E0.0 [4] (🖑..🖔) REVERSED RAISED HAND WITH FINGERS SPLAYED..REVERSED VICTORY HAND 1F595..1F596 ; Extended_Pictographic# E1.0 [2] (🖕..🖖) middle finger..vulcan salute -1F597..1F5A3 ; Extended_Pictographic# E0.0 [13] (🖗..🖣) WHITE DOWN POINTING LEFT HAND INDEX..BLACK DOWN POINTING BACKHAND INDEX 1F5A4 ; Extended_Pictographic# E3.0 [1] (🖤) black heart 1F5A5 ; Extended_Pictographic# E0.7 [1] (🖥️) desktop computer -1F5A6..1F5A7 ; Extended_Pictographic# E0.0 [2] (🖦..🖧) KEYBOARD AND MOUSE..THREE NETWORKED COMPUTERS 1F5A8 ; Extended_Pictographic# E0.7 [1] (🖨️) printer -1F5A9..1F5B0 ; Extended_Pictographic# E0.0 [8] (🖩..🖰) POCKET CALCULATOR..TWO BUTTON MOUSE 1F5B1..1F5B2 ; Extended_Pictographic# E0.7 [2] (🖱️..🖲️) computer mouse..trackball -1F5B3..1F5BB ; Extended_Pictographic# E0.0 [9] (🖳..🖻) OLD PERSONAL COMPUTER..DOCUMENT WITH PICTURE 1F5BC ; Extended_Pictographic# E0.7 [1] (🖼️) framed picture -1F5BD..1F5C1 ; Extended_Pictographic# E0.0 [5] (🖽..🗁) FRAME WITH TILES..OPEN FOLDER 1F5C2..1F5C4 ; Extended_Pictographic# E0.7 [3] (🗂️..🗄️) card index dividers..file cabinet -1F5C5..1F5D0 ; Extended_Pictographic# E0.0 [12] (🗅..🗐) EMPTY NOTE..PAGES 1F5D1..1F5D3 ; Extended_Pictographic# E0.7 [3] (🗑️..🗓️) wastebasket..spiral calendar -1F5D4..1F5DB ; Extended_Pictographic# E0.0 [8] (🗔..🗛) DESKTOP WINDOW..DECREASE FONT SIZE SYMBOL 1F5DC..1F5DE ; Extended_Pictographic# E0.7 [3] (🗜️..🗞️) clamp..rolled-up newspaper -1F5DF..1F5E0 ; Extended_Pictographic# E0.0 [2] (🗟..🗠) PAGE WITH CIRCLED TEXT..STOCK CHART 1F5E1 ; Extended_Pictographic# E0.7 [1] (🗡️) dagger -1F5E2 ; Extended_Pictographic# E0.0 [1] (🗢) LIPS 1F5E3 ; Extended_Pictographic# E0.7 [1] (🗣️) speaking head -1F5E4..1F5E7 ; Extended_Pictographic# E0.0 [4] (🗤..🗧) THREE RAYS ABOVE..THREE RAYS RIGHT 1F5E8 ; Extended_Pictographic# E2.0 [1] (🗨️) left speech bubble -1F5E9..1F5EE ; Extended_Pictographic# E0.0 [6] (🗩..🗮) RIGHT SPEECH BUBBLE..LEFT ANGER BUBBLE 1F5EF ; Extended_Pictographic# E0.7 [1] (🗯️) right anger bubble -1F5F0..1F5F2 ; Extended_Pictographic# E0.0 [3] (🗰..🗲) MOOD BUBBLE..LIGHTNING MOOD 1F5F3 ; Extended_Pictographic# E0.7 [1] (🗳️) ballot box with ballot -1F5F4..1F5F9 ; Extended_Pictographic# E0.0 [6] (🗴..🗹) BALLOT SCRIPT X..BALLOT BOX WITH BOLD CHECK 1F5FA ; Extended_Pictographic# E0.7 [1] (🗺️) world map 1F5FB..1F5FF ; Extended_Pictographic# E0.6 [5] (🗻..🗿) mount fuji..moai 1F600 ; Extended_Pictographic# E1.0 [1] (😀) grinning face @@ -1210,26 +1152,22 @@ E0020..E007F ; Emoji_Component # E0.0 [96] (󠀠..󠁿) tag space..c 1F6BF ; Extended_Pictographic# E1.0 [1] (🚿) shower 1F6C0 ; Extended_Pictographic# E0.6 [1] (🛀) person taking bath 1F6C1..1F6C5 ; Extended_Pictographic# E1.0 [5] (🛁..🛅) bathtub..left luggage -1F6C6..1F6CA ; Extended_Pictographic# E0.0 [5] (🛆..🛊) TRIANGLE WITH ROUNDED CORNERS..GIRLS SYMBOL 1F6CB ; Extended_Pictographic# E0.7 [1] (🛋️) couch and lamp 1F6CC ; Extended_Pictographic# E1.0 [1] (🛌) person in bed 1F6CD..1F6CF ; Extended_Pictographic# E0.7 [3] (🛍️..🛏️) shopping bags..bed 1F6D0 ; Extended_Pictographic# E1.0 [1] (🛐) place of worship 1F6D1..1F6D2 ; Extended_Pictographic# E3.0 [2] (🛑..🛒) stop sign..shopping cart -1F6D3..1F6D4 ; Extended_Pictographic# E0.0 [2] (🛓..🛔) STUPA..PAGODA 1F6D5 ; Extended_Pictographic# E12.0 [1] (🛕) hindu temple 1F6D6..1F6D7 ; Extended_Pictographic# E13.0 [2] (🛖..🛗) hut..elevator -1F6D8..1F6DB ; Extended_Pictographic# E0.0 [4] (🛘..🛛) .. +1F6D8 ; Extended_Pictographic# E17.0 [1] (🛘) landslide +1F6D9..1F6DB ; Extended_Pictographic# E0.0 [3] (🛙..🛛) .. 1F6DC ; Extended_Pictographic# E15.0 [1] (🛜) wireless 1F6DD..1F6DF ; Extended_Pictographic# E14.0 [3] (🛝..🛟) playground slide..ring buoy 1F6E0..1F6E5 ; Extended_Pictographic# E0.7 [6] (🛠️..🛥️) hammer and wrench..motor boat -1F6E6..1F6E8 ; Extended_Pictographic# E0.0 [3] (🛦..🛨) UP-POINTING MILITARY AIRPLANE..UP-POINTING SMALL AIRPLANE 1F6E9 ; Extended_Pictographic# E0.7 [1] (🛩️) small airplane -1F6EA ; Extended_Pictographic# E0.0 [1] (🛪) NORTHEAST-POINTING AIRPLANE 1F6EB..1F6EC ; Extended_Pictographic# E1.0 [2] (🛫..🛬) airplane departure..airplane arrival 1F6ED..1F6EF ; Extended_Pictographic# E0.0 [3] (🛭..🛯) .. 1F6F0 ; Extended_Pictographic# E0.7 [1] (🛰️) satellite -1F6F1..1F6F2 ; Extended_Pictographic# E0.0 [2] (🛱..🛲) ONCOMING FIRE ENGINE..DIESEL LOCOMOTIVE 1F6F3 ; Extended_Pictographic# E0.7 [1] (🛳️) passenger ship 1F6F4..1F6F6 ; Extended_Pictographic# E3.0 [3] (🛴..🛶) kick scooter..canoe 1F6F7..1F6F8 ; Extended_Pictographic# E5.0 [2] (🛷..🛸) sled..flying saucer @@ -1237,8 +1175,7 @@ E0020..E007F ; Emoji_Component # E0.0 [96] (󠀠..󠁿) tag space..c 1F6FA ; Extended_Pictographic# E12.0 [1] (🛺) auto rickshaw 1F6FB..1F6FC ; Extended_Pictographic# E13.0 [2] (🛻..🛼) pickup truck..roller skate 1F6FD..1F6FF ; Extended_Pictographic# E0.0 [3] (🛽..🛿) .. -1F774..1F77F ; Extended_Pictographic# E0.0 [12] (🝴..🝿) LOT OF FORTUNE..ORCUS -1F7D5..1F7DF ; Extended_Pictographic# E0.0 [11] (🟕..🟟) CIRCLED TRIANGLE.. +1F7DA..1F7DF ; Extended_Pictographic# E0.0 [6] (🟚..🟟) .. 1F7E0..1F7EB ; Extended_Pictographic# E12.0 [12] (🟠..🟫) orange circle..brown square 1F7EC..1F7EF ; Extended_Pictographic# E0.0 [4] (🟬..🟯) .. 1F7F0 ; Extended_Pictographic# E14.0 [1] (🟰) heavy equals sign @@ -1247,7 +1184,10 @@ E0020..E007F ; Emoji_Component # E0.0 [96] (󠀠..󠁿) tag space..c 1F848..1F84F ; Extended_Pictographic# E0.0 [8] (🡈..🡏) .. 1F85A..1F85F ; Extended_Pictographic# E0.0 [6] (🡚..🡟) .. 1F888..1F88F ; Extended_Pictographic# E0.0 [8] (🢈..🢏) .. -1F8AE..1F8FF ; Extended_Pictographic# E0.0 [82] (🢮..🣿) .. +1F8AE..1F8AF ; Extended_Pictographic# E0.0 [2] (🢮..🢯) .. +1F8BC..1F8BF ; Extended_Pictographic# E0.0 [4] (🢼..🢿) .. +1F8C2..1F8CF ; Extended_Pictographic# E0.0 [14] (🣂..🣏) .. +1F8D9..1F8FF ; Extended_Pictographic# E0.0 [39] (🣙..🣿) .. 1F90C ; Extended_Pictographic# E13.0 [1] (🤌) pinched fingers 1F90D..1F90F ; Extended_Pictographic# E12.0 [3] (🤍..🤏) white heart..pinching hand 1F910..1F918 ; Extended_Pictographic# E1.0 [9] (🤐..🤘) zipper-mouth face..sign of the horns @@ -1293,7 +1233,8 @@ E0020..E007F ; Emoji_Component # E0.0 [96] (󠀠..󠁿) tag space..c 1F9CD..1F9CF ; Extended_Pictographic# E12.0 [3] (🧍..🧏) person standing..deaf person 1F9D0..1F9E6 ; Extended_Pictographic# E5.0 [23] (🧐..🧦) face with monocle..socks 1F9E7..1F9FF ; Extended_Pictographic# E11.0 [25] (🧧..🧿) red envelope..nazar amulet -1FA00..1FA6F ; Extended_Pictographic# E0.0 [112] (🨀..🩯) NEUTRAL CHESS KING.. +1FA58..1FA5F ; Extended_Pictographic# E0.0 [8] (🩘..🩟) .. +1FA6E..1FA6F ; Extended_Pictographic# E0.0 [2] (🩮..🩯) .. 1FA70..1FA73 ; Extended_Pictographic# E12.0 [4] (🩰..🩳) ballet shoes..shorts 1FA74 ; Extended_Pictographic# E13.0 [1] (🩴) thong sandal 1FA75..1FA77 ; Extended_Pictographic# E15.0 [3] (🩵..🩷) light blue heart..pink heart @@ -1304,7 +1245,9 @@ E0020..E007F ; Emoji_Component # E0.0 [96] (󠀠..󠁿) tag space..c 1FA83..1FA86 ; Extended_Pictographic# E13.0 [4] (🪃..🪆) boomerang..nesting dolls 1FA87..1FA88 ; Extended_Pictographic# E15.0 [2] (🪇..🪈) maracas..flute 1FA89 ; Extended_Pictographic# E16.0 [1] (🪉) harp -1FA8A..1FA8E ; Extended_Pictographic# E0.0 [5] (🪊..🪎) .. +1FA8A ; Extended_Pictographic# E17.0 [1] (🪊) trombone +1FA8B..1FA8D ; Extended_Pictographic# E0.0 [3] (🪋..🪍) .. +1FA8E ; Extended_Pictographic# E17.0 [1] (🪎) treasure chest 1FA8F ; Extended_Pictographic# E16.0 [1] (🪏) shovel 1FA90..1FA95 ; Extended_Pictographic# E12.0 [6] (🪐..🪕) ringed planet..banjo 1FA96..1FAA8 ; Extended_Pictographic# E13.0 [19] (🪖..🪨) military helmet..rock @@ -1318,7 +1261,10 @@ E0020..E007F ; Emoji_Component # E0.0 [96] (󠀠..󠁿) tag space..c 1FAC0..1FAC2 ; Extended_Pictographic# E13.0 [3] (🫀..🫂) anatomical heart..people hugging 1FAC3..1FAC5 ; Extended_Pictographic# E14.0 [3] (🫃..🫅) pregnant man..person with crown 1FAC6 ; Extended_Pictographic# E16.0 [1] (🫆) fingerprint -1FAC7..1FACD ; Extended_Pictographic# E0.0 [7] (🫇..🫍) .. +1FAC7 ; Extended_Pictographic# E0.0 [1] (🫇) +1FAC8 ; Extended_Pictographic# E17.0 [1] (🫈) hairy creature +1FAC9..1FACC ; Extended_Pictographic# E0.0 [4] (🫉..🫌) .. +1FACD ; Extended_Pictographic# E17.0 [1] (🫍) orca 1FACE..1FACF ; Extended_Pictographic# E15.0 [2] (🫎..🫏) moose..donkey 1FAD0..1FAD6 ; Extended_Pictographic# E13.0 [7] (🫐..🫖) blueberries..teapot 1FAD7..1FAD9 ; Extended_Pictographic# E14.0 [3] (🫗..🫙) pouring liquid..jar @@ -1329,12 +1275,14 @@ E0020..E007F ; Emoji_Component # E0.0 [96] (󠀠..󠁿) tag space..c 1FAE0..1FAE7 ; Extended_Pictographic# E14.0 [8] (🫠..🫧) melting face..bubbles 1FAE8 ; Extended_Pictographic# E15.0 [1] (🫨) shaking face 1FAE9 ; Extended_Pictographic# E16.0 [1] (🫩) face with bags under eyes -1FAEA..1FAEF ; Extended_Pictographic# E0.0 [6] (🫪..🫯) .. +1FAEA ; Extended_Pictographic# E17.0 [1] (🫪) distorted face +1FAEB..1FAEE ; Extended_Pictographic# E0.0 [4] (🫫..🫮) .. +1FAEF ; Extended_Pictographic# E17.0 [1] (🫯) fight cloud 1FAF0..1FAF6 ; Extended_Pictographic# E14.0 [7] (🫰..🫶) hand with index finger and thumb crossed..heart hands 1FAF7..1FAF8 ; Extended_Pictographic# E15.0 [2] (🫷..🫸) leftwards pushing hand..rightwards pushing hand 1FAF9..1FAFF ; Extended_Pictographic# E0.0 [7] (🫹..🫿) .. 1FC00..1FFFD ; Extended_Pictographic# E0.0[1022] (🰀..🿽) .. -# Total elements: 3537 +# Total elements: 2848 #EOF diff --git a/contrib/unicode/from_glibc/utf8_gen.py b/contrib/unicode/from_glibc/utf8_gen.py index 59cd9bbfa9d8..2e01fab96586 100755 --- a/contrib/unicode/from_glibc/utf8_gen.py +++ b/contrib/unicode/from_glibc/utf8_gen.py @@ -1,6 +1,7 @@ #!/usr/bin/python3 # -*- coding: utf-8 -*- # Copyright (C) 2014-2025 Free Software Foundation, Inc. +# Copyright The GNU Toolchain Authors. # This file is part of the GNU C Library. # # The GNU C Library is free software; you can redistribute it and/or @@ -10,7 +11,7 @@ # # The GNU C Library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public @@ -28,7 +29,6 @@ ''' import argparse -import sys import re import unicode_utils @@ -200,30 +200,40 @@ def write_header_charmap(outfile): def write_header_width(outfile, unicode_version): '''Writes the header on top of the WIDTH section to the output file''' - outfile.write('% Character width according to Unicode ' - + '{:s}.\n'.format(unicode_version)) - outfile.write('% - Default width is 1.\n') + outfile.write('% Character width according to Unicode {:s}.\n'.format(unicode_version)) + outfile.write('% Width is determined by the following rules, in order of decreasing precedence:\n') + outfile.write('% - U+00AD SOFT HYPHEN has width 1, as a special case for compatibility (https://archive.is/b5Ck).\n') + outfile.write('% - U+115F HANGUL CHOSEONG FILLER has width 2.\n') + outfile.write('% This character stands in for an intentionally omitted leading consonant\n') + outfile.write('% in a Hangul syllable block; as such it must be assigned width 2 despite its lack\n') + outfile.write('% of visible display to ensure that the complete block has the correct width.\n') + outfile.write('% (See below for more information on Hangul syllables.)\n') + outfile.write('% - Combining jungseong and jongseong Hangul jamo have width 0; generated from\n') + outfile.write('% "grep \'^[^;]*;[VT]\' HangulSyllableType.txt".\n') + outfile.write('% One composed Hangul "syllable block" like 퓛 is made up of\n') + outfile.write('% two to three individual component characters called "jamo".\n') + outfile.write('% The complete block must have total width 2;\n') + outfile.write('% to achieve this, we assign a width of 2 to leading "choseong" jamo,\n') + outfile.write('% and of 0 to medial vowel "jungseong" and trailing "jongseong" jamo.\n') + outfile.write('% - Non-spacing and enclosing marks have width 0; generated from\n') + outfile.write('% "grep -E \'^[^;]*;[^;]*;(Mn|Me);\' UnicodeData.txt".\n') + outfile.write('% - "Default_Ignorable_Code_Point"s have width 0; generated from\n') + outfile.write('% "grep \'^[^;]*;\\s*Default_Ignorable_Code_Point\' DerivedCoreProperties.txt".\n') outfile.write('% - Double-width characters have width 2; generated from\n') - outfile.write('% "grep \'^[^;]*;\\s*[WF]\' EastAsianWidth.txt"\n') - outfile.write('% - Non-spacing characters have width 0; ' - + 'generated from PropList.txt or\n') - outfile.write('% "grep \'^[^;]*;[^;]*;[^;]*;[^;]*;NSM;\' ' - + 'UnicodeData.txt"\n') - outfile.write('% - Format control characters have width 0; ' - + 'generated from\n') - outfile.write("% \"grep '^[^;]*;[^;]*;Cf;' UnicodeData.txt\"\n") -# Not needed covered by Cf -# outfile.write("% - Zero width characters have width 0; generated from\n") -# outfile.write("% \"grep '^[^;]*;ZERO WIDTH ' UnicodeData.txt\"\n") + outfile.write('% "grep \'^[^;]*;[WF]\' EastAsianWidth.txt".\n') + outfile.write('% - Default width for all other characters is 1.\n') outfile.write("WIDTH\n") -def process_width(outfile, ulines, elines, plines): - '''ulines are lines from UnicodeData.txt, elines are lines from - EastAsianWidth.txt containing characters with width “W” or “F”, - plines are lines from PropList.txt which contain characters - with the property “Prepended_Concatenation_Mark”. - +def process_width(outfile, ulines, dlines, elines, klines): + '''ulines are lines from UnicodeData.txt. + elines are lines from EastAsianWidth.txt containing characters with width + “W” or “F”. + dlines are lines from DerivedCoreProperties.txt which contain + characters with the property “Default_Ignorable_Code_Point”. + klines are lines from HangulSyllableType.txt which contain characters + with syllable type “V” or “T”. ''' + # Wide and fullwidth characters have width 1 width_dict = {} for line in elines: fields = line.split(";") @@ -235,14 +245,14 @@ def process_width(outfile, ulines, elines, plines): int(code_points[1], 16)+1): width_dict[key] = 2 + # Nonspacing and enclosing marks have width 0 for line in ulines: fields = line.split(";") - if fields[4] == "NSM" or fields[2] in ("Cf", "Me", "Mn"): + if fields[4] == "NSM" or fields[2] in ("Me", "Mn"): width_dict[int(fields[0], 16)] = 0 - for line in plines: - # Characters with the property “Prepended_Concatenation_Mark” - # should have the width 1: + # Conjoining vowel and trailing jamo have width 0 + for line in klines: fields = line.split(";") if not '..' in fields[0]: code_points = (fields[0], fields[0]) @@ -250,21 +260,26 @@ def process_width(outfile, ulines, elines, plines): code_points = fields[0].split("..") for key in range(int(code_points[0], 16), int(code_points[1], 16)+1): - del width_dict[key] # default width is 1 - - # handle special cases for compatibility - for key in list((0x00AD,)): - # https://www.cs.tut.fi/~jkorpela/shy.html - if key in width_dict: - del width_dict[key] # default width is 1 - for key in list(range(0x1160, 0x1200)): - # Hangul jungseong and jongseong: - if key in unicode_utils.UNICODE_ATTRIBUTES: - width_dict[key] = 0 - for key in list(range(0xD7B0, 0xD800)): - # Hangul jungseong and jongseong: - if key in unicode_utils.UNICODE_ATTRIBUTES: width_dict[key] = 0 + + # “Default_Ignorable_Code_Point”s have width 0 + for line in dlines: + fields = line.split(";") + if not '..' in fields[0]: + code_points = (fields[0], fields[0]) + else: + code_points = fields[0].split("..") + for key in range(int(code_points[0], 16), + int(code_points[1], 16)+1): + width_dict[key] = 0 # default width is 1 + + + # Special case: U+00AD SOFT HYPHEN + del width_dict[0x00AD] + + # Special case: U+115F HANGUL CHOSEONG FILLER + width_dict[0x115F] = 2 + for key in list(range(0x3248, 0x3250)): # These are “A” which means we can decide whether to treat them # as “W” or “N” based on context: @@ -302,7 +317,7 @@ def process_width(outfile, ulines, elines, plines): if __name__ == "__main__": PARSER = argparse.ArgumentParser( description=''' - Generate a UTF-8 file from UnicodeData.txt, EastAsianWidth.txt, and PropList.txt. + Generate a UTF-8 file from UnicodeData.txt, DerivedCoreProperties.txt, EastAsianWidth.txt, and HangulSyllableType.txt ''') PARSER.add_argument( '-u', '--unicode_data_file', @@ -311,6 +326,13 @@ def process_width(outfile, ulines, elines, plines): default='UnicodeData.txt', help=('The UnicodeData.txt file to read, ' + 'default: %(default)s')) + PARSER.add_argument( + '-d', '--derived_core_properties_file', + nargs='?', + type=str, + default='DerivedCoreProperties.txt', + help=('The DerivedCoreProperties.txt file to read, ' + + 'default: %(default)s')) PARSER.add_argument( '-e', '--east_asian_with_file', nargs='?', @@ -319,11 +341,11 @@ def process_width(outfile, ulines, elines, plines): help=('The EastAsianWidth.txt file to read, ' + 'default: %(default)s')) PARSER.add_argument( - '-p', '--prop_list_file', + '-k', '--hangul_syllable_type_file', nargs='?', type=str, - default='PropList.txt', - help=('The PropList.txt file to read, ' + default='HangulSyllableType.txt', + help=('The HangulSyllableType.txt file to read, ' + 'default: %(default)s')) PARSER.add_argument( '--unicode_version', @@ -336,27 +358,35 @@ def process_width(outfile, ulines, elines, plines): unicode_utils.fill_attributes(ARGS.unicode_data_file) with open(ARGS.unicode_data_file, mode='r') as UNIDATA_FILE: UNICODE_DATA_LINES = UNIDATA_FILE.readlines() - with open(ARGS.east_asian_with_file, mode='r') as EAST_ASIAN_WIDTH_FILE: - EAST_ASIAN_WIDTH_LINES = [] - for LINE in EAST_ASIAN_WIDTH_FILE: - # If characters from EastAsianWidth.txt which are from - # reserved ranges (i.e. not yet assigned code points) + with open(ARGS.derived_core_properties_file, mode='r') as DERIVED_CORE_PROPERTIES_FILE: + DERIVED_CORE_PROPERTIES_LINES = [] + for LINE in DERIVED_CORE_PROPERTIES_FILE: + # If characters which are from reserved ranges + # (i.e. not yet assigned code points) # are added to the WIDTH section of the UTF-8 file, then # “make check” produces “Unknown Character” errors for # these code points because such unassigned code points # are not in the CHARMAP section of the UTF-8 file. # - # Therefore, we skip all reserved code points when reading - # the EastAsianWidth.txt file. - if re.match(r'.*\.\..*', LINE): + # Therefore, we skip all reserved code points. + if re.match(r'.*', LINE): + continue + if re.match(r'^[^;]*;\s*Default_Ignorable_Code_Point', LINE): + DERIVED_CORE_PROPERTIES_LINES.append(LINE.strip()) + with open(ARGS.east_asian_with_file, mode='r') as EAST_ASIAN_WIDTH_FILE: + EAST_ASIAN_WIDTH_LINES = [] + for LINE in EAST_ASIAN_WIDTH_FILE: + if re.match(r'.*', LINE): continue if re.match(r'^[^;]*;\s*[WF]', LINE): EAST_ASIAN_WIDTH_LINES.append(LINE.strip()) - with open(ARGS.prop_list_file, mode='r') as PROP_LIST_FILE: - PROP_LIST_LINES = [] - for LINE in PROP_LIST_FILE: - if re.match(r'^[^;]*;[\s]*Prepended_Concatenation_Mark', LINE): - PROP_LIST_LINES.append(LINE.strip()) + with open(ARGS.hangul_syllable_type_file, mode='r') as HANGUL_SYLLABLE_TYPE_FILE: + HANGUL_SYLLABLE_TYPE_LINES = [] + for LINE in HANGUL_SYLLABLE_TYPE_FILE: + if re.match(r'.*', LINE): + continue + if re.match(r'^[^;]*;\s*[VT]', LINE): + HANGUL_SYLLABLE_TYPE_LINES.append(LINE.strip()) with open('UTF-8', mode='w') as OUTFILE: # Processing UnicodeData.txt and write CHARMAP to UTF-8 file write_header_charmap(OUTFILE) @@ -366,6 +396,7 @@ def process_width(outfile, ulines, elines, plines): write_header_width(OUTFILE, ARGS.unicode_version) process_width(OUTFILE, UNICODE_DATA_LINES, + DERIVED_CORE_PROPERTIES_LINES, EAST_ASIAN_WIDTH_LINES, - PROP_LIST_LINES) + HANGUL_SYLLABLE_TYPE_LINES) OUTFILE.write("END WIDTH\n") diff --git a/contrib/unicode/gen_libstdcxx_unicode_data.py b/contrib/unicode/gen_libstdcxx_unicode_data.py index c50884d91dea..f5f3ab282481 100755 --- a/contrib/unicode/gen_libstdcxx_unicode_data.py +++ b/contrib/unicode/gen_libstdcxx_unicode_data.py @@ -23,6 +23,7 @@ # ftp://ftp.unicode.org/Public/UNIDATA/DerivedCoreProperties.txt # ftp://ftp.unicode.org/Public/UNIDATA/auxiliary/GraphemeBreakProperty.txt # ftp://ftp.unicode.org/Public/UNIDATA/emoji/emoji-data.txt +# ftp://ftp.unicode.org/Public/UNIDATA/extracted/DerivedGeneralCategory.txt # Then run this script and save the output to # ../../libstdc++-v3/include/bits/unicode-data.h @@ -148,7 +149,7 @@ def process_code_points(code_points, val): "Cc", "Cf", "Cs", "Co", "Cn", } -# Extract General_Category and detrmine if it should be escaped +# Extract General_Category and determine if it should be escaped # for all code points. for line in open("DerivedGeneralCategory.txt", "r"): # Example lines: diff --git a/contrib/uninclude b/contrib/uninclude index 5612e655a985..f445bfeeb050 100755 --- a/contrib/uninclude +++ b/contrib/uninclude @@ -27,13 +27,14 @@ # Header files whose pathnames contain any of the following patterns # are considered as standard headers: usr/include, g++-include, -# include/g++, include/c++/, gcc-lib//include. +# include/g++, include/c++/, gcc-lib//include, +# lib/gcc//include. gawk ${EXCLUDEPATT+-vexclude="$EXCLUDEPATT"} \ ${INCLUDEPATT+-vinclude="$INCLUDEPATT"} ' BEGIN { skipping = 0; - cppline = "^# [0-9]+ \"[^\"]*/(usr/include|g\\+\\+-include|include/g\\+\\+|include/c\\+\\+/[^/]+|gcc-lib/[^\"]+/include|gcc/include)/([^\"]+)\"( [1-4])*$" + cppline = "^# [0-9]+ \"[^\"]*/(usr/include|g\\+\\+-include|include/g\\+\\+|include/c\\+\\+/[^/]+|gcc-lib/[^\"]+/include|lib/gcc/[^\"]+/include|gcc/include)/([^\"]+)\"( [1-4])*$" } !skipping && $0 ~ cppline && (exclude == "" || $3 !~ exclude) && (include == "" || $3 ~ include) { diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6a8792ab77cc..65ccd4bf58bd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,3998 @@ +2025-10-26 Andrew Pinski + + PR target/122270 + * config/riscv/riscv-vector-builtins-bases.cc (vset::fold): Use the + unshare_expr for the statement that will be added seperately rather + the one which will be used for the replacement. + +2025-10-26 James K. Lowden + + * doc/install.texi: Add libxml2 dependency for COBOL + library. Clarify 128-bit numeric dependency. + +2025-10-26 Gerald Pfeifer + + * poly-int.h: Change struct poly_int to class poly_int. + +2025-10-26 LIU Hao + + PR target/119079 + * config/i386/i386.md: Use `movsxd` to perform SI-to-DI extension in Intel + syntax. + +2025-10-26 Kuan-Lin Chen + + * config/riscv/riscv.cc (riscv_legitimize_move): Append extend. + +2025-10-26 Osama Abdelkader + + * wide-int.h: Fix typo "accomodate" to "accommodate" in comment. + * value-range-storage.h: Likewise. + * tree-vectorizer.h (dr_set_safe_speculative_read_required): + Fix duplicate "the the" to "the" in comment. + +2025-10-25 Sam James + + * doc/extend.texi (nocf_check): Fix syntax errors in example. + +2025-10-25 Jiahao Xu + + * config/loongarch/lasx.md (vec_extract): New define_expand. + (vec_extract_lo_): New define_insn_and_split. + (vec_extract_hi_): New define_insn. + * config/loongarch/loongarch-protos.h (loongarch_check_vect_par_cnst_half) + New function prototype. + * config/loongarch/loongarch.cc (loongarch_split_reduction): + Implement TARGET_VECTORIZE_SPLIT_REDUCTION. + (loongarch_check_vect_par_cnst_half): New function. + * config/loongarch/predicates.md + (vect_par_cnst_low_half): New predicate. + (vect_par_cnst_high_half): New predicate. + +2025-10-24 Andrew MacLeod + + PR tree-optimization/114025 + * gimple-range-fold.cc (fold_using_range::condexpr_adjust): Handle + the same ssa_name in the condition and the COND_EXPR better. + +2025-10-24 Andrew MacLeod + + * range-op.cc (operator_bitwise_and::wi_fold): Split signed + operations crossing zero into 2 operations. + +2025-10-24 Andrew MacLeod + + PR tree-optimization/118254 + PR tree-optimization/114331 + * range-op.cc (operator_cast::fold_range): When VARYING is + reached, update the bitmask if we reach VARYING. + (operator_cast::op1_range): For truncating casts, create a + bitmask bit in LHS. + +2025-10-24 Takayuki 'January June' Suwa + + * config/xtensa/xtensa.md (call_internal, call_value_internal, + sibcall_internal, sibcall_value_internal): Remove 'n'-constraint. + +2025-10-24 Takayuki 'January June' Suwa + + * config/xtensa/xtensa.md (*addsubx, *subsi3_from_const, + *xtensa_clamps, *andsi3_const_pow2_minus_one, + *andsi3_const_negative_pow2, *andsi3_const_shifted_mask, + *splice_bits, extvsi_internal, extzvsi_internal, + *extzvsi-1bit_ashlsi3, *extzvsi-1bit_addsubx, insvsi, *lsiu, *ssiu, + *lsip, *ssip, *shift_per_byte_omit_AND_0, *shift_per_byte_omit_AND_1, + *shlrd_const, *shlrd_per_byte_omit_AND, *masktrue_const_bitcmpl, + *masktrue_const_pow2_minus_one, *masktrue_const_negative_pow2, + *masktrue_const_shifted_mask, call_internal, call_value_internal, + sibcall_internal, sibcall_value_internal, entry, + *eqne_zero_masked_bits, *eqne_in_range): Remove 'i'-constraint. + +2025-10-24 Josef Melcr + + PR middle-end/122392 + * attr-callback.cc (callback_build_attr): Remove erroneous + annotation. + +2025-10-24 Richard Biener + + * tree-vect-loop.cc (vectorizable_reduction): SLP-ify reduction + operation processing a bit more. + +2025-10-24 Richard Biener + + PR tree-optimization/122406 + * tree-vect-slp.cc (vect_analyze_slp_reduc_chain): Create + the SLP nodes for the conversions around the reduction + operation if required. + +2025-10-24 Paul-Antoine Arras + + PR fortran/121452 + * omp-low.cc (check_omp_nesting_restrictions): Accept an + OMP_STRUCTURED_BLOCK in a collapsed simd region and in an ordered loop. + +2025-10-24 Pengfei Li + + * match.pd: Fold VEC_PERM_EXPR chains implementing vector + concat-and-extract. + +2025-10-24 Olivier Hainque + + * config/rs6000/vxworks.h (SET_CMODEL): Undefine before + (re)defining. + +2025-10-23 Andrew Pinski + + * match.pd (`(type1)x CMP CST1 ? (type2)x : CST2`): Better handling + of `((signed)x) < 0`. + +2025-10-23 Andrew Pinski + + PR tree-optimization/101024 + * tree-ssa-phiopt.cc (match_simplify_replacement): Special + case fp `a CMP b ? a : b` when not creating a min/max. + (strip_bit_not): Remove. + (invert_minmax_code): Remove. + (minmax_replacement): Remove. + (pass_phiopt::execute): Update pass comment. + Don't call minmax_replacement. + +2025-10-23 Andrew Pinski + + PR tree-optimization/101024 + * fold-const.cc (minmax_from_comparison): New version that takes widest_int + instead of tree. + (minmax_from_comparison): Call minmax_from_comparison for integer cst case. + * fold-const.h (minmax_from_comparison): New declaration. + * match.pd (`((signed)a = 0) ? min/max (a, c) : b`): New pattern. + +2025-10-23 Alfie Richards + + * config/aarch64/aarch64-c.cc (aarch64_update_cpp_builtins): Add + __HAVE_FUNCTION_MULTI_VERSIONING macro. + +2025-10-23 Alfie Richards + + * config/aarch64/aarch64.cc (dispatch_function_versions): Remove + unnecessary sorting and data structure. + +2025-10-23 Alfie Richards + + PR target/122190 + * config/aarch64/aarch64.cc (compare_feature_masks): Fix version rules. + +2025-10-23 Alfie Richards + + * config/aarch64/aarch64.cc (aarch64_generate_version_dispatcher_body): + Dump function versions and the ordering. + +2025-10-23 zhaozhou + + * match.pd: Add new pattern for round. + +2025-10-23 Richard Biener + + * tree-vectorizer.h (_loop_vec_info::slp_unrolling_factor): Remove. + (LOOP_VINFO_SLP_UNROLLING_FACTOR): Likewise. + * tree-vect-loop.cc (_loop_vec_info::_loop_vec_info): Adjust. + (vect_analyze_loop_2): Likewise. + * tree-vect-slp.cc (vect_make_slp_decision): Set + LOOP_VINFO_VECT_FACTOR directly. + +2025-10-23 Richard Biener + + * tree-vect-loop.cc (vect_analyze_loop_2): Move vect_optimize_slp + after applying suggested_unroll_factor. + +2025-10-23 Richard Biener + + * tree-vect-loop.cc (vect_analyze_loop_2): Deal with NULL + element in SLP_TREE_SCALAR_STMTS. + +2025-10-23 liuhongt + + PR target/101639 + * config/i386/sse.md + (VI_AVX): New mode iterator. + (VI_AVX_CMP): Ditto. + (ssebytemode): Add V16HI, V32QI, V16QI. + (reduc_sbool_and_scal_): New expander. + (reduc_sbool_ior_scal_): Ditto. + (reduc_sbool_xor_scal_): Ditto. + (*eq3_2_negate): New pre_reload splitter. + (*ptest_ccz): Ditto. + +2025-10-23 liuhongt + + PR target/101639 + * config/i386/sse.md + (reduc_sbool_and_scal_): New expander. + (reduc_sbool_ior_scal_): Ditto. + (reduc_sbool_xor_scal_): Ditto. + +2025-10-22 H.J. Lu + + * config/i386/i386-expand.cc (ix86_expand_set_or_cpymem): Use + HOST_WIDE_INT_0U and HOST_WIDE_INT_M1U to initialize unsigned + HOST_WIDE_INT. + +2025-10-22 Tamar Christina + + * config/aarch64/aarch64-simd.md (reduc_sbool_and_scal_, + reduc_sbool_ior_scal_, reduc_sbool_xor_scal_): Use SVE if + available. + * config/aarch64/aarch64-sve.md (*cmp_ptest): Rename ... + (@aarch64_pred_cmp_ptest): ... To this. + (reduc_sbool_xor_scal_): Rename ... + (@reduc_sbool_xor_scal_): ... To this. + +2025-10-22 Tamar Christina + + * config/aarch64/aarch64-simd.md (reduc_sbool_and_scal_, + reduc_sbool_ior_scal_, reduc_sbool_xor_scal_): New. + * config/aarch64/iterators.md (VALLI): New. + +2025-10-22 Tamar Christina + + * config/aarch64/aarch64-sve.md (reduc_sbool_and_scal_, + reduc_sbool_ior_scal_, reduc_sbool_xor_scal_): New. + +2025-10-22 Tamar Christina + + * tree-vect-loop.cc (vectorizable_reduction): Don't always require + IFN_VEC_SHL_INSERT when using reduc sbool optabs. + +2025-10-22 Srinath Parvathaneni + + * config/aarch64/aarch64.opt.urls: Regenerate. + +2025-10-22 Richard Biener + + PR tree-optimization/122364 + * tree-vect-slp.cc (vect_analyze_slp_reduc_chain): Re-try + linearization on a conversion source. + +2025-10-22 Richard Biener + + PR tree-optimization/122370 + * tree-vect-loop.cc (vect_create_epilog_for_reduction): + Also update compute_vectype when demoting masks to an + integer vector. + +2025-10-22 Richard Biener + + PR tree-optimization/122371 + * tree-vect-loop.cc (vectorize_fold_left_reduction): Get + to the scalar def to replace via the scalar PHI backedge def. + * tree-vect-slp.cc (vect_analyze_slp_reduc_chain): Do not + re-associate to for a reduction chain if a fold-left + reduction is required. + +2025-10-22 Richard Biener + + PR tree-optimization/122365 + * tree-vect-loop.cc (vect_create_epilog_for_reduction): + Convert all inputs. Use the proper vector element sizes + for the elementwise reduction. + +2025-10-22 Haochen Jiang + + * common/config/i386/cpuinfo.h + (get_intel_cpu): Handle Nova Lake. + * common/config/i386/i386-common.cc (processor_name): + Add Nova Lake. + (processor_alias_table): Ditto. + * common/config/i386/i386-cpuinfo.h (enum processor_types): + Add INTEL_COREI7_NOVALAKE. + * config.gcc: Add -march=novalake. + * config/i386/driver-i386.cc (host_detect_local_cpu): Handle + novalake. + * config/i386/i386-c.cc (ix86_target_macros_internal): Ditto. + * config/i386/i386-options.cc (processor_cost_table): Ditto. + (m_NOVALAKE): New. + (m_CORE_HYBRID): Add novalake. + * config/i386/i386.h (enum processor_type): Ditto. + * doc/extend.texi: Ditto. + * doc/invoke.texi: Ditto. + +2025-10-22 Haochen Jiang + + * config/i386/driver-i386.cc (host_detect_local_cpu): Correct + the logic for unknown model number cpu guess value. + +2025-10-22 liuhongt + + PR target/122320 + * config/i386/sse.md (*_cmp3_dup_op): New define_insn_and_split. + +2025-10-22 Antoni Boucher + + * config/i386/i386-jit.cc: Mark new float types as supported. + +2025-10-21 Antoni Boucher + + * config.gcc (jit_target_objs): Don't set this variable since + the object files don't exist. + +2025-10-21 Roger Sayle + + * config/i386/i386-features.cc (timode_concatdi_p): New + function to recognize the various variants of *concatditi3_[1-7]. + (scalar_chain::add_insn): Like VEC_SELECT, ZERO_EXTEND and + timode_concatdi_p instructions don't require their input + operands to be converted (to TImode). + (timode_scalar_chain::compute_convert_gain): Split/clone XOR and + IOR cases from AND case, to handle timode_concatdi_p costs. + : Handle timode_concatdi_p conversion costs. + : Provide costs of DImode to TImode extension. + (timode_convert_concatdi): Helper function to transform + a *concatditi3 instruction into a vec_concatv2di instruction. + (timode_scalar_chain::convert_insn): Split/clone XOR and IOR + cases from ANS case, to handle timode_concatdi_p using the new + timode_convert_concatdi helper function. + : Convert zero_extendditi2 to *vec_concatv2di_0. + : Handle timode_concatdi_p using the new + timode_convert_concatdi helper function. + (timode_scalar_to_vector_candidate_p): Support timode_concatdi_p + instructions in IOR, XOR and PLUS cases. + : Consider zero extension of a register from + DImode to TImode to be a candidate. + +2025-10-21 Richard Biener + + PR tree-optimization/120687 + * tree-vect-slp.cc (vect_analyze_slp_reduc_chain): When + there's no natural reduction chain see if vect_slp_linearize_chain + can recover one and built the SLP instance manually in that + case. + (vect_schedule_slp): Deal with NULL lanes when looking for + stores to remove. + * tree-vect-loop.cc (vect_transform_cycle_phi): Dump when we + are successfully transforming a reduction chain. + +2025-10-21 Richard Biener + + * tree-vect-loop.cc (vect_create_partial_epilog): Pun back + to the requested type if necessary. + +2025-10-21 Andrew Pinski + + PR tree-optimization/95699 + PR tree-optimization/101024 + PR tree-optimization/110068 + * match.pd (`(type1)x CMP CST1 ? (type2)x : CST2`): Treat + `(signed)x = 0` as `x >=/< SIGNED_TYPE_MIN` + +2025-10-21 Olivier Hainque + + * config/rs6000/vxworks.h (ASM_PREFERRED_EH_DATA_FORMAT): + Redefine. + +2025-10-21 Olivier Hainque + + * config/vxworks.h (VXWORKS_ADDITIONAL_CPP_SPEC): + Remove guard on -fself-tests and replace %:getenv(VSB_DIR) by + sysroot references. + +2025-10-20 Josef Melcr + + * ipa-fnsummary.cc (redirect_to_unreachable): Purge callback + edges when redirecting the carrying edge. + (analyze_function_body): Fix typo. + +2025-10-20 Svante Signell + + PR go/104290 + * config/gnu.h (OPTION_GLIBC_P, OPTION_GLIBC): Define. + +2025-10-20 Takayuki 'January June' Suwa + + * config/xtensa/constraints.md (R, U): + Change define_memory_constraint to define_special_memory_constraint. + * config/xtensa/xtensa.md + (movsi_internal, movhi_internal, movqi_internal): + Rearrange their alternatives in the order of constant assignment, register- + register move, load, store and special. And also consolidate overlapping + alternatives. + (movsf_internal): Rearrange the alternatives as above, and remove the '^' + alternative character which is no longer needed. + +2025-10-20 Takayuki 'January June' Suwa + + * config/xtensa/xtensa.cc + (constantsynth_method_const16): New. + (constantsynth_methods): Append constantsynth_method_const16(). + (constantsynth_info): Add cost calculation for full-word constant + assignment when TARGET_CONST16 is enabled. + (constantsynth_pass1): Change it so that it works regardless of + TARGET_CONST16. + * config/xtensa/xtensa.md (*xtensa_const16): New. + +2025-10-20 Takayuki 'January June' Suwa + + * config/xtensa/xtensa.cc (do_largeconst): + Change split_DI_SF_DF_const() to be called unconditionally. + +2025-10-20 Olivier Hainque + + * config.gcc (powerpc*-wrs-vxworks7r*): Add linux-protos.h + to tm_p_file. + +2025-10-20 Olivier Hainque + + * config/vxworks.h (VXWORKS_OS_CPP_BUILTINS): Only + builtin_define TOOL and TOOL_FAMILY for !TARGET_VXWORKS7. + Augment comment on VXWORKS_PERSONALITY. + * config/vxworks/vxworks-predef.h: Infer TOOL and TOOL_FAMILY + from the VSB autoconf.h when we have one, determined by the presence + of a _VSB_CONFIG_FILE definition. + +2025-10-20 Srinath Parvathaneni + + * config/aarch64/aarch64-elf.h (ASM_SPEC): Update the macro. + * config/aarch64/aarch64.cc (aarch64_valid_sysreg_name_p): + Add feature check condition. + (aarch64_retrieve_sysreg): Likewise. + * config/aarch64/aarch64.opt (menable-sysreg-checking): + Define new flag. + * doc/invoke.texi (menable-sysreg-checking): Document new flag. + +2025-10-20 Richard Biener + + PR tree-optimization/121631 + * tree-vect-loop.cc (vect_create_epilog_for_reduction): + When the reduction operation invokes UB on signed overflow + make sure to perform operations with it on an unsigned type. + +2025-10-20 Richard Biener + + PR tree-optimization/101639 + PR tree-optimization/103495 + * tree-vectorizer.h (vect_reduc_info_s): Add reduc_type_for_mask. + (VECT_REDUC_INFO_VECTYPE_FOR_MASK): New. + * tree-vect-patterns.cc (vect_determine_mask_precision): + Return whether the mask precision changed. + (vect_determine_precisions): Iterate mask precision computation + for loop vectorization. + * tree-vect-loop.cc (get_initial_defs_for_reduction): Properly + convert non-mask initial values to a mask initial def for + the reduction. + (sbool_reduction_fn_for_fn): New function. + (vect_create_epilog_for_reduction): For a mask input convert + it to the vector type analysis decided to use. Use a regular + conversion for the final convert to the scalar code type. + (vectorizable_reduction): Support mask reductions. Verify + we can compute a data vector from the mask result or a direct + maks reduction is provided by the target. + +2025-10-20 Richard Biener + + * doc/md.texi (reduc_sbool_{and,ior,xor}_scal_): Document. + * optabs.def (reduc_sbool_and_scal_optab, + reduc_sbool_ior_scal_optab, reduc_sbool_xor_scal_optab): New. + * internal-fn.def (REDUC_SBOOL_AND, REDUC_SBOOL_IOR, + REDUC_SBOO_XOR): Likewise. + * internal-fn.cc (reduc_sbool_direct): New initializer. + (expand_reduc_sbool_optab_fn): New expander. + (direct_reduc_sbool_optab_supported_p): New. + +2025-10-20 H.J. Lu + + PR target/99930 + PR target/122323 + * config/i386/i386-expand.cc (ix86_expand_copysign): Swap + operands[1] with operands[2]. Optimize copysign (x, const_double) + instead of copysign (const_double, x). + * config/i386/i386.md (copysign3): Swap constraints for + operands[1] and operands[2]. + +2025-10-19 Georg-Johann Lay + + * config/avr/avr.cc (avr_nonzero_bits_lsr_operands_p): Also + handle PLUS. + * config/avr/avr.md (pixaop): New code iterator for PLUS, + IOR, XOR, AND. + (nzb=1 insns): Use pixaop instead of bitop code iterator. + Handle PLUS in outputs. + +2025-10-18 Mark Wielaard + + * common.opt.urls: Regenerate. + +2025-10-18 Iain Sandoe + + PR c++/119060 + * builtins.cc (expand_builtin): Handle BUILT_IN_OBSERVABLE_CHKPT. + * builtins.def (BUILT_IN_OBSERVABLE_CHKPT): New. + * tree.cc (build_common_builtin_nodes): Build observable + checkpoint builtin. + +2025-10-18 Tamar Christina + + PR middle-end/122069 + * config/aarch64/aarch64-sve2.md + (widen_ssum3): Update. + (widen_usum3): Update. + +2025-10-18 Tamar Christina + + PR middle-end/122069 + * config/aarch64/aarch64-sve2.md: (widen_ssum3): New. + (widen_usum3): New. + * config/aarch64/iterators.md (Vnarrow): New, to match VNARROW. + +2025-10-18 Tamar Christina + + PR middle-end/122069 + * config/aarch64/aarch64-sve.md (widen_sum3): New. + +2025-10-18 Tamar Christina + + PR middle-end/122069 + * config/rs6000/altivec.md (widen_usum3): Rename ... + (widen_usumv4si3): ... to this. + (widen_ssumv16qi3): Rename ... + (widen_ssumv4siv16qi3): ... to this. + (widen_ssumv8hi3): Rename ... + (widen_ssumv4siv8hi3): ... to this. + +2025-10-18 Tamar Christina + + PR middle-end/122069 + * config/ia64/vect.md (widen_usumv8qi3): Renamed ... + (widen_usumv4hiv8qi3): ... into this. + (widen_usumv4hi3): Renamed ... + (widen_usumv2siv4hi3): ... into this. + (widen_ssumv8qi3): Renamed ... + (widen_ssumv4hiv8qi3): ... into this. + (widen_ssumv4hi3): Renamed ... + (widen_ssumv2siv4hi3): ... into this. + +2025-10-18 Tamar Christina + + PR middle-end/122069 + * config/arm/iterators.md (v_double_width): New, matching + V_double_width. + * config/arm/neon.md (widen_ssum3): Renamed ... + (widen_ssum3, widen_ssum3): ... + into these. + (widen_usum3): Renamed ... + (widen_usum3, widen_usum3): ... + into these. + +2025-10-18 Tamar Christina + + PR middle-end/122069 + * config/aarch64/aarch64-simd.md (widen_ssum3): New. + (widen_usum3): New. + +2025-10-18 Tamar Christina + + PR middle-end/122069 + * config/aarch64/aarch64-simd.md (widen_ssum3): Change into.. + (widen_ssum3, widen_ssum3): ... these. + (widen_usum3): Change into ... + (widen_usum3, widen_usum3): ... these. + * config/aarch64/iterators.md (Vdblw): New. + (Vwide): Extend to match VWIDE. + +2025-10-18 Tamar Christina + + PR middle-end/122069 + * doc/md.texi (widen_ssum@var{n}@var{m}3, widen_usum@var{n}@var{m}3): + Update docs. + * optabs.cc (expand_widen_pattern_expr): Add WIDEN_SUM_EXPR as widening. + * optabs.def (ssum_widen_optab, usum_widen_optab): Convert from direct + to a conversion optab. + * tree-vect-patterns.cc (vect_recog_widen_sum_pattern): Change + vect_supportable_direct_optab_p into vect_supportable_conv_optab_p. + +2025-10-18 Linsen Zhou + + PR tree-optimization/122012 + * tree-object-size.cc (check_for_plus_in_loops): Skip check + for the variable offset + +2025-10-17 David Faust + + PR target/122139 + * config/bpf/bpf.cc (bpf_expand_setmem): Duplicate byte value + across to new mode when using larger modes for store. + +2025-10-17 Tamar Christina + Jennifer Schmitz + + PR target/121604 + * config/aarch64/aarch64-sve-builtins-shapes.cc (apply_predication): + Store gp_index. + (struct pmov_to_vector_lane_def): Mark instruction as has no GP. + * config/aarch64/aarch64-sve-builtins.h (function_instance::gp_value, + function_instance::inactive_values, function_instance::gp_index, + function_shape::has_gp_argument_p): New. + * config/aarch64/aarch64-sve-builtins.cc (gimple_folder::fold_pfalse): + Simplify code and use GP helpers. + +2025-10-17 Richard Biener + + PR tree-optimization/122308 + * gimple-loop-jam.cc (tree_loop_unroll_and_jam): Do LIM + after applying unroll-and-jam. + +2025-10-17 Josef Melcr + + * Makefile.in: Add attr-callback.o to OBJS. + * builtin-attrs.def (ATTR_CALLBACK): Callback attr identifier. + (DEF_CALLBACK_ATTRIBUTE): Macro for callback attr creation. + (GOMP): Attr for libgomp functions. + (ATTR_CALLBACK_GOMP_LIST): ATTR_NOTHROW_LIST with GOMP callback + attr added. + * cgraph.cc (cgraph_add_edge_to_call_site_hash): Always hash the + callback-carrying edge. + (cgraph_node::get_edge): Always return the callback-carrying + edge. + (cgraph_edge::set_call_stmt): Add cascade for callback edges. + (symbol_table::create_edge): Allow callback edges to share call + stmts, initialize new flags. + (cgraph_edge::make_callback): New method, derives a new callback + edge. + (cgraph_edge::get_callback_carrying_edge): New method. + (cgraph_edge::first_callback_edge): Likewise. + (cgraph_edge::next_callback_edge): Likewise. + (cgraph_edge::purge_callback_edges): Likewise. + (cgraph_edge::redirect_callee): When redirecting a callback + edge, redirect its ref as well. + (cgraph_edge::redirect_call_stmt_to_callee): Add callback edge + redirection logic, set update_derived_edges to true hwne + redirecting the carrying edge. + (cgraph_node::remove_callers): Add cascade for callback edges. + (cgraph_edge::dump_edge_flags): Print callback flags. + (cgraph_node::verify_node): Add sanity checks for callback + edges. + * cgraph.h: Add new 1 bit flags and 16 bit callback_id to + cgraph_edge class. + * cgraphclones.cc (cgraph_edge::clone): Copy over callback data. + * cif-code.def (CALLBACK_EDGE): Add CIF_CALLBACK_EDGE code. + * ipa-cp.cc (purge_useless_callback_edges): New function, + deletes callback edges when necessary. + (ipcp_decision_stage): Call purge_useless_callback_edges. + * ipa-fnsummary.cc (ipa_call_summary_t::duplicate): Add + an exception for callback edges. + (analyze_function_body): Copy over summary from carrying to + callback edge. + * ipa-inline-analysis.cc (do_estimate_growth_1): Skip callback + edges when estimating growth. + * ipa-inline-transform.cc (inline_transform): Add redirection + cascade for callback edges. + * ipa-param-manipulation.cc + (drop_decl_attribute_if_params_changed_p): New function. + (ipa_param_adjustments::build_new_function_type): Add + args_modified out param. + (ipa_param_adjustments::adjust_decl): Drop callback attrs when + modifying args. + * ipa-param-manipulation.h: Adjust decl of + build_new_function_type. + * ipa-prop.cc (ipa_duplicate_jump_function): Add decl. + (init_callback_edge_summary): New function. + (ipa_compute_jump_functions_for_edge): Add callback edge + creation logic. + * lto-cgraph.cc (lto_output_edge): Stream out callback data. + (input_edge): Input callback data. + * omp-builtins.def (BUILT_IN_GOMP_PARALLEL_LOOP_STATIC): Use new + attr list. + (BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED): Likewise. + (BUILT_IN_GOMP_PARALLEL_LOOP_NONMONOTONIC_DYNAMIC): Likewise. + (BUILT_IN_GOMP_PARALLEL_LOOP_NONMONOTONIC_RUNTIME): Likewise. + (BUILT_IN_GOMP_PARALLEL): Likewise. + (BUILT_IN_GOMP_PARALLEL_SECTIONS): Likewise. + (BUILT_IN_GOMP_TEAMS_REG): Likewise. + * tree-core.h (ECF_CB_1_2): New constant for callback(1,2). + * tree-inline.cc (copy_bb): Copy callback edges when copying the + carrying edge. + (redirect_all_calls): Redirect callback edges. + * tree.cc (set_call_expr_flags): Create callback attr according + to the ECF_CB flag. + * attr-callback.cc: New file. + * attr-callback.h: New file. + +2025-10-17 Richard Biener + + PR tree-optimization/122301 + * tree-vect-patterns.cc (vect_recog_over_widening_pattern): + Fix reduction guard. + (vect_mark_pattern_stmts): Fix reduction def check. + +2025-10-17 Avinash Jayakar + + PR tree-optimization/104116 + * tree-vect-patterns.cc (add_code_for_floorceilround_divmod): patt recog + for {FLOOR,ROUND,CEIL}_{DIV,MOD}_EXPR. + (vect_recog_divmod_pattern): Call add_code_for_floorceilround_divmod + after computing div/mod for each control path. + +2025-10-17 Andrew Pinski + + PR tree-optimization/122296 + * match.pd (`(a != b) | ((a|b) != 0)`): Reuse both + the ior and zero instead of recreating them. + (`(a == b) & ((a|b) == 0)`): Likewise + +2025-10-17 Andrew Pinski + + PR tree-optimization/122296 + * match.pd (`(a == b) | ((a|b) != 0)`): Fix true value. + +2025-10-17 Hu, Lin1 + + PR target/122119 + * config/i386/amxmovrsintrin.h + (_tile_loaddrs_internal): Use __PTRDIFF_TYPE__ instead of long. + (_tile_loaddrst1_internal): Ditto. + +2025-10-16 David Malcolm + + * Makefile.in (OBJS-libcommon): Add + custom-sarif-properties/digraphs.o and + custom-sarif-properties/state-graphs.o. Remove + diagnostics/state-graphs.o. + * configure: Regenerate. + * configure.ac: Add custom-sarif-properties to subdir iteration. + * custom-sarif-properties/digraphs.cc: New file. + * custom-sarif-properties/digraphs.h: New file. + * custom-sarif-properties/state-graphs.cc: New file. + * custom-sarif-properties/state-graphs.h: New file. + * diagnostics/diagnostics-selftests.cc + (run_diagnostics_selftests): Drop call of state_graphs_cc_tests. + * diagnostics/diagnostics-selftests.h (state_graphs_cc_tests): + Delete decl. + * diagnostics/digraphs.cc: Include + "custom-sarif-properties/digraphs.h". Move include of + "selftest.h" to within CHECKING_P section. + (using digraph_object): New. + (namespace properties): New. + (diagnostics::digraphs::object::get_attr): Delete. + (diagnostics::digraphs::object::set_attr): Delete. + (diagnostics::digraphs::object::set_json_attr): Delete. + (digraph_object::get_property): New definitions, for various + property types. + (digraph_object::set_property): Likewise. + (digraph_object::maybe_get_property): New. + (digraph_object::get_property_as_tristate): New. + (digraph_object::ensure_property_bag): New. + (digraph::get_graph_kind): New. + (digraph::set_graph_kind): New. + Add include of "custom-sarif-properties/state-graphs.h". + (selftest::test_simple_graph): Rewrite to use json::property + instances rather than string attribute names. + (selftest::test_property_objects): New test. + (selftest::digraphs_cc_tests): Call it. + * diagnostics/digraphs.h: Include "tristate.h". + (object::get_attr): Delete. + (object::set_attr): Delete. + (object::get_property): New decls. + (object::set_property): New decls. + (object::maybe_get_property): New. + (object::get_property_as_tristate): New. + (object::set_json_attr): Delete. + (object::ensure_property_bag): New. + (graph::get_graph_kind): New. + (graph::set_graph_kind): New. + * diagnostics/html-sink.cc + (html_generation_options::html_generation_options): Update for + field renamings. + (html_generation_options::dump): Likewise. + (html_builder::maybe_make_state_diagram): Likewise. + (html_builder::add_graph): Show SARIF and .dot src inline, if + requested. + * diagnostics/html-sink.h + (html_generation_options::m_show_state_diagrams_sarif): Rename + to... + (html_generation_options::m_show_graph_sarif): ...this. + (html_generation_options::m_show_state_diagrams_dot_src): Rename + to... + (html_generation_options::m_show_graph_dot_src0): ...this. + * diagnostics/output-spec.cc + (html_scheme_handler::maybe_handle_kv): Rename keys. + (html_scheme_handler::get_keys): Likewise. + * diagnostics/state-graphs-to-dot.cc: : Reimplement throughout to + use json::property instances found within custom_sarif_properties + throughout, rather than types in diagnostics::state_graphs. + * diagnostics/state-graphs.cc: Deleted file. + * diagnostics/state-graphs.h: Delete almost all, except decl of + diagnostics::state_graphs::make_dot_graph. + * doc/invoke.texi: Update for changes to "experimental-html" sink + keys. + * json.cc (json::object::set_string): New. + (json::object::set_integer): New. + (json::object::set_bool): New. + (json::object::set_array_of_string): New. + * json.h: Include "label-text.h". + (struct json::property): New template. + (json::string_property): New. + (json::integer_property): New. + (json::bool_property): New. + (json::json_property): New. + (using json::array_of_string_property): New. + (struct json::enum_traits): New. + (enum_json::property): New. + (json::value::dyn_cast_array): New vfunc. + (json::value::dyn_cast_integer_number): New vfunc. + (json::value::set_string): New. + (json::value::set_integer): New. + (json::value::set_bool): New. + (json::value::set_array_of_string): New. + (json::value::maybe_get_enum): New. + (json::value::set_enum): New. + (json::array::dyn_cast_array): New. + (json::integer_number::dyn_cast_integer_number): New. + (object::maybe_get_enum): New. + (object::set_enum): New. + +2025-10-16 Ayappan Perumal + + * config/rs6000/aix.h (SUBTARGET_DRIVER_SELF_SPECS): + Error out when stack-protector option is used in AIX + as it is not supported on AIX + Approved By: Segher Boessenkool + +2025-10-16 Richard Biener + + PR tree-optimization/122292 + * tree-vect-loop.cc (vect_transform_reduction): Compute the + input vector type the same way the analysis phase does. + +2025-10-15 Andrew MacLeod + + PR tree-optimization/121468 + PR tree-optimization/121206 + PR tree-optimization/122200 + * value-range.cc (irange_bitmask::range_from_mask): New. + (irange::snap): Add explicit overflow flag. + (irange::snap_subranges): Use overflow flag. + (irange::set_range_from_bitmask): Use range_from_mask. + (test_irange_snap_bounds): Adjust for improved ranges. + * value-range.h (irange::range_from_mask): Add prototype. + (irange::snap): Adjust prototype. + +2025-10-15 Tobias Burnus + + * config/gcn/gcn-devices.def (gfx942, gfx950): Set generic name + to GFX9_4_GENERIC. + * config/gcn/t-omp-device: Include generic names for OpenMP's + ISA trait. + +2025-10-15 Andrew Pinski + + * print-tree.cc (print_node): Print out clique/base + for MEM_REF and TARGET_MEM_REF. + +2025-10-15 Richard Earnshaw + + PR target/118460 + * config/arm/arm.cc (arm_canonicalize_comparison): For floating- + point comparisons, swap the operand order if that will be more + likely to produce a comparison that can be used with VSEL. + (arm_validize_comparison): Make sure that HFmode comparisons + are compatible with VSEL. + +2025-10-15 Andrew Pinski + + PR tree-optimization/122037 + * tree-ssa-dce.cc (eliminate_unnecessary_stmts): Remove + __builtin_stack_save when the lhs is unused. + +2025-10-15 Alice Carlotti + + * config/aarch64/aarch64-sys-regs.def: Copy from Binutils. + * config/aarch64/aarch64.cc (F_ARCHEXT): Delete flag. + * config/aarch64/aarch64.h + (AARCH64_FL_AMU): Delete unused macro. + (AARCH64_FL_SCXTNUM): Ditto. + (AARCH64_FL_ID_PFR2): Ditto. + (AARCH64_FL_AIE): Ditto. + (AARCH64_FL_DEBUGv8p9): Ditto. + (AARCH64_FL_FGT2): Ditto. + (AARCH64_FL_PFAR): Ditto. + (AARCH64_FL_PMUv3_ICNTR): Ditto. + (AARCH64_FL_PMUv3_SS): Ditto. + (AARCH64_FL_PMUv3p9): Ditto. + (AARCH64_FL_S1PIE): Ditto. + (AARCH64_FL_S1POE): Ditto. + (AARCH64_FL_S2PIE): Ditto. + (AARCH64_FL_S2POE): Ditto. + (AARCH64_FL_SCTLR2): Ditto. + (AARCH64_FL_SEBEP): Ditto. + (AARCH64_FL_SPE_FDS): Ditto. + (AARCH64_FL_TCR2): Ditto. + +2025-10-15 Sebastian Pop + + * doc/invoke.texi (ftree-parallelize-loops): Update. + * common.opt (ftree-parallelize-loops): Add alias that maps to + special value INT_MAX for runtime thread detection. + * tree-parloops.cc (create_parallel_loop): Use INT_MAX for runtime + detection. Call gimple_build_omp_parallel without building a + OMP_CLAUSE_NUM_THREADS clause. + (gen_parallel_loop): For auto-detection, use a conservative + estimate of 2 threads. + (parallelize_loops): Same. + +2025-10-15 Christophe Lyon + + PR target/122189 + * config/arm/iterators.md (VxCIQ_carry, VxCIQ_M_carry, VxCQ_carry) + (VxCQ_M_carry): New iterators. + * config/arm/mve.md (get_fpscr_nzcvqc, set_fpscr_nzcvqc): Use + unspec instead of unspec_volatile. + (vadciq, vadciq_m, vadcq, vadcq_m): Use vfpcc in operation. Use a + different unspec code for carry calcultation. + * config/arm/unspecs.md (VADCQ_U_carry, VADCQ_M_U_carry) + (VADCQ_S_carry, VADCQ_M_S_carry, VSBCIQ_U_carry ,VSBCIQ_S_carry + ,VSBCIQ_M_U_carry ,VSBCIQ_M_S_carry ,VSBCQ_U_carry ,VSBCQ_S_carry + ,VSBCQ_M_U_carry ,VSBCQ_M_S_carry ,VADCIQ_U_carry + ,VADCIQ_M_U_carry ,VADCIQ_S_carry ,VADCIQ_M_S_carry): New unspec + codes. + +2025-10-15 Roger Sayle + + PR rtl-optimization/122266 + * combine.cc (struct reg_stat_type): Change types of sign_bit_copies + and last_set_sign_bit_copies to unsigned short, to avoid overflows + on TImode (and wider) values. + +2025-10-15 Jan Hubicka + + * auto-profile.cc (scale_bb_profile): Use + profile_count::max_prefer_initialized. + (afdo_adjust_guessed_profile): Likewise. + * bb-reorder.cc (edge_order): Do not use max. + * cfghooks.cc (merge_blocks): Likewise. + * ipa-fnsummary.cc (param_change_prob): Likewise. + * ipa-inline-transform.cc (inline_transform): Likewise. + * predict.cc (update_max_bb_count): Likewise. + (estimate_bb_frequencies): Likewise. + (rebuild_frequencies): Likewise. + * tree-ssa-loop-unswitch.cc (struct unswitch_predicate): Likewise. + * profile-count.h (profile_count::max): Rename to + (profile_count::max_prefer_initialized): this; update handling + of qualities. + +2025-10-15 Haochen Jiang + + * common/config/i386/cpuinfo.h + (get_intel_cpu): Handle Wildcat Lake. + * common/config/i386/i386-common.cc (processor_name): + Add Wildcat Lake. + * doc/invoke.texi: Ditto. + +2025-10-15 Haochen Jiang + + * config/i386/i386.h + (PTA_PANTHERLAKE): Remove PREFETCHI. + (PTA_DIAMONDRAPIDS): Remove USER_MSR. + * doc/invoke.texi: Correct documentation. + +2025-10-15 Pan Li + + * config/riscv/autovec-opt.md: Take concrete op instead + of any_widen_binop for vwaddu/vwsubu wx combine. + +2025-10-14 Richard Biener + + * tree-vectorizer.h (REDUC_GROUP_FIRST_ELEMENT, + REDUC_GROUP_NEXT_ELEMENT, REDUC_GROUP_SIZE): Remove. + * tree-vect-slp.cc (REDUC_GROUP_FIRST_ELEMENT): Re-instantiate + here. + +2025-10-14 Richard Biener + + * tree-vect-slp.cc (vect_analyze_slp_reduction): Move + reduction chain discovery ... + (vect_analyze_slp_reduc_chain): ... here. + +2025-10-14 Richard Biener + + * tree-vect-loop.cc (vect_create_epilog_for_reduction): Move + bitsize compute down to where it is used and consistently + use vectype1 for element extraction. + +2025-10-14 Tamar Christina + + PR tree-optimization/121949 + * tree-vect-patterns.cc (vect_recog_vector_vector_shift_pattern): Remove + restriction on internal_def. + +2025-10-14 Robin Dapp + + * tree-vect-stmts.cc (get_load_store_type): Add load-permutation + checks and setting of slp_perm. + (vectorizable_store): Remove perm_ok argument. + (vectorizable_load): Ditto and replace slp_perm by ls.slp_perm. + * tree-vectorizer.h (struct vect_load_store_data): Add slp_perm. + +2025-10-14 Richard Biener + + * tree-vectorizer.h (vect_reduc_info_s::is_reduc_chain): New. + (_loop_vec_info::reduction_chains): Remove. + (LOOP_VINFO_REDUCTION_CHAINS): Likewise. + * tree-vect-patterns.cc (vect_reassociating_reduction_p): + Do not special-case reduction group stmts. + * tree-vect-loop.cc (vect_is_simple_reduction): Remove + reduction chain handling. + (vect_analyze_scalar_cycles_1): Remove slp parameter and adjust. + (vect_analyze_scalar_cycles): Likewise. + (vect_fixup_reduc_chain): Remove. + (vect_fixup_scalar_cycles_with_patterns): Likewise. + (vect_analyze_loop_2): Adjust. + (vect_create_epilog_for_reduction): Check the reduction info + for whether this is a reduction chain. + (vect_transform_cycle_phi): Likewise. + (vectorizable_reduction): Likewise. Simplify code for all-SLP. + * tree-vect-slp.cc (vect_analyze_slp_reduc_chain): Simplify. + (vect_analyze_slp_reduction): New function, perform reduction + chain discovery here. + (vect_analyze_slp): Remove reduction chain handling. + Use vect_analyze_slp_reduction for possible reduction chain + processing. + +2025-10-14 Haochen Jiang + + * common/config/i386/cpuinfo.h + (get_available_features): Remove AMX-TRANSPOSE. + * common/config/i386/i386-common.cc + (OPTION_MASK_ISA2_AMX_TRANSPOSE_SET): Removed. + (OPTION_MASK_ISA2_AMX_TRANSPOSE_UNSET): Ditto. + (ix86_handle_option): Remove amx-transpose handle. + * common/config/i386/i386-cpuinfo.h + (enum processor_features): Remove FEATURE_AMX_TRANSPOSE. + Set FEATURE_AMX_MOVRS value. + * common/config/i386/i386-isas.h: Remove AMX-TRANSPOSE. + * config.gcc: Do not include amxtransposeintrin.h. + * config/i386/amxmovrsintrin.h: Remove AMX-TRANSPOSE intrins. + * config/i386/amxtransposeintrin.h: Ditto. + * config/i386/cpuid.h (bit_AMX_TRANSPOSE): Removed. + * config/i386/i386.h (PTA_DIAMONDRAPIDS): Remove AMX-TRANSPOSE. + * config/i386/i386-c.cc (ix86_target_macros_internal): Remove + AMX_TRANSPOSE. + * config/i386/i386-isa.def (AMX_TRANSPOSE): Removed. + * config/i386/i386-options.cc + (ix86_valid_target_attribute_inner_p): Remove AMX-TRANSPOSE. + * config/i386/i386.opt: Ditto. + * config/i386/i386.opt.urls: Ditto. + * config/i386/immintrin.h: Remove amxtransposeintrin.h. + * doc/extend.texi: Remove amx-transpose. + * doc/invoke.texi: Ditto. + * doc/sourcebuild.texi: Ditto. + +2025-10-14 Andrew Pinski + + * tree-ssa-phiopt.cc (pass_phiopt::execute): Disable + cselim-limited and factor out operations for -Og. + +2025-10-14 Andrew Pinski + + PR tree-optimization/122178 + * tree-ssa-phiopt.cc (cond_if_else_store_replacement_1): Handle + clobber statements. + +2025-10-14 Andrew Pinski + + PR tree-optimization/122182 + * tree-ssa-dom.cc (cprop_operand): Don't check may_propagate_copy_into_asm. + * tree-ssa-propagate.cc (substitute_and_fold_engine::replace_uses_in): Don't + check may_propagate_copy_into_asm. + (may_propagate_copy_into_asm): Remove. + * tree-ssa-propagate.h (may_propagate_copy_into_asm): Remove. + +2025-10-14 Zhongyao Chen + + * common/config/riscv/riscv-common.cc (riscv_subset_list::get_profile_name): + New function. + * config/riscv/riscv-c.cc (riscv_cpu_cpp_builtins): Define + profile macro if a profile is detected. + * config/riscv/riscv-subset.h (riscv_subset_list::get_profile_name): Declare. + +2025-10-13 Shreya Munnangi + + PR target/120811 + * config/riscv/riscv.cc (synthesize_add): Exchange constant terms when + generating addi pairs. + (synthesize_addsi): Similarly. + * config/riscv/riscv.md (addptr3): New define_expand. + (*add3_const_sum_of_two_s12): Remove pattern. + +2025-10-13 Jeff Law + + PR target/120674 + * config/riscv/riscv.cc (riscv_dwarf_poly_indeterminite_value): Do not + set FACTOR to zero, for that case use one instead. + +2025-10-13 Pan Li + + * match.pd: Add simplifed pattern for widen_mul based unsigned + SAT_MUL. + +2025-10-13 Jan Hubicka + + * ipa-inline.cc (max_count): Remove. + (has_nonzero_ipa_profile): New. + (inline_small_functions): Update. + (dump_inline_stats): Update. + +2025-10-13 Robin Dapp + + PR target/118019 + * internal-fn.cc (get_supported_else_vals): Exit at invalid + index. + (internal_strided_fn_supported_p): New funtion. + * internal-fn.h (internal_strided_fn_supported_p): Declare. + * tree-vect-stmts.cc (vector_vector_composition_type): + Add vector_only argument. + (vect_use_grouped_gather): New function. + (vect_get_store_rhs): Adjust docs of + vector_vector_composition_type. + (get_load_store_type): Try grouped gather. + (vectorizable_store): Use punned vectype. + (vectorizable_load): Ditto. + * tree-vectorizer.h (struct vect_load_store_data): Add punned + vectype. + +2025-10-13 Avinash Jayakar + + PR tree-optimization/122213 + * match.pd: Canonicalize unsigned pow2 div only for trunk, floor and + exact div. + +2025-10-13 Richard Biener + + * tree-vect-patterns.cc (integer_type_for_mask): Add optional + output dt argument. + (vect_recog_bool_pattern): Make sure to not apply the bitwise + binary pattern to an external operand. + +2025-10-11 Bohan Lei + + PR target/119587 + * config/riscv/thead.md (*th_memidx_operand): New splitter. + +2025-10-11 Georg-Johann Lay + + * coretypes.h (enum artificial_rodata): New enum type. + * doc/tm.texi: Rebuild. + * doc/tm.texi.in (TARGET_ADDR_SPACE_FOR_ARTIFICIAL_RODATA): + New hook. + * target.def (addr_sapce.for_artificial_rodata): New DEFHOOK. + * targhooks.cc (default_addr_space_convert): New function. + * targhooks.h (default_addr_space_convert): New prototype. + * tree-switch-conversion.cc (build_one_array) : + Set type_quals address-space according to + targetm.addr_space.for_artificial_rodata(). + * config/avr/avr.cc (avr_rodata_in_flash_p): Move up. + (TARGET_ADDR_SPACE_FOR_ARTIFICIAL_RODATA): Define to... + (avr_addr_space_for_artificial_rodata): ...this new function. + * common/config/avr/avr-common.cc (avr_option_optimization_table): + Adjust -ftree-switch-conversion comment. + +2025-10-11 Austin Law + + * config/riscv/sync.md (lrsc_atomic_fetch_): + Adjust operand predicate/constraint to allow simm12 operands + where valid. Adjust output template accordingly. + (subword_atomic_fech_strong_): Likewise. + (subword_atomic_fetch_strong_nand): Likewise. + (subword_atomic_exchange_strong): Likewise. + (subword_atomic_cas_strong): Likewise. + +2025-10-10 David Faust + + PR target/122141 + * config/bpf/bpf.cc (bpf_expand_cbranch): Use swap_condition + rather than reverse_condition when reversing jump condition to + work around missing instructions in very old BPF ISAs. + +2025-10-10 Andrew Pinski + + * tree-ssa-forwprop.cc (do_simple_agr_dse): New function. + (pass_forwprop::execute): Call do_simple_agr_dse for clobbers. + +2025-10-10 Umesh Kalvakuntla + + * common/config/i386/cpuinfo.h (get_amd_cpu): Fix znver5 family + model numbers. + (get_available_features): Set FEATURE_PREFETCHI for bit_AMD_PREFETCHI. + * config/i386/cpuid.h (bit_AMD_PREFETCHI): New Macro. + +2025-10-10 Pan Li + + * config/riscv/autovec-opt.md (*widen_wsubu_wx_): Add new + pattern to match vwsubu.wx. + +2025-10-10 Juergen Christ + + * config/s390/vector.md (fmax3): Restrict to no trapping + math. + (fmin3): Ditto. + +2025-10-10 Segher Boessenkool + + * config/rs6000/rs6000.md (mode_iterator CCANY): Add CCFP and CCEQ. + +2025-10-10 Christophe Lyon + + PR target/122223 + * config/arm/mve.md (@mve_vbicq_f): Fix operands order. + +2025-10-10 Andrew Stubbs + + * tree-vect-stmts.cc: Fix VEC_STMT parameter comments throughout. + +2025-10-10 Francois-Xavier Coudert + + * config/aarch64/aarch64-cores.def (AARCH64_CORE): Improve Apple + M3 and add Apple M4 cores. + * config/aarch64/aarch64-tune.md: Regenerate. + * doc/invoke.texi: Add apple-m4 core to the ones listed + for arch and tune selections. + +2025-10-10 Richard Biener + + PR tree-optimization/122111 + * tree-ssa-math-opts.cc (build_and_insert_cast): Remove + conversion simplification, instead use gimple_convert. + +2025-10-10 Robin Dapp + + * config/arm/arm.cc (arm_builtin_support_vector_misalignment): + Remove use of type. + +2025-10-10 Richard Biener + + PR tree-optimization/122225 + * tree-cfg.cc (verify_gimple_return): Look at DECL_RESULT + for DECL_BY_REFERENCE. + +2025-10-10 YunQiang Su + + Revert: + 2025-09-27 Jie Mei + + * config/mips/mips.cc(mips_option_override):Add conditions + for use of the -mmips16e2 and -mips16 option. + +2025-10-09 David Faust + + * doc/extend.texi (Common Function Attributes) + (Common Variable Attributes): Document btf_decl_tag attribute. + (Common Type Attributes): Document btf_type_tag attribute. + +2025-10-09 David Faust + + * btfout.cc (get_btf_kind): Handle DECL_TAG and TYPE_TAG kinds. + (btf_calc_num_vbytes): Likewise. + (btf_asm_type): Likewise. + (output_asm_btf_vlen_bytes): Likewise. + (output_btf_tags): New. + (btf_output): Call it here. + (btf_add_used_type): Replace with simple wrapper around... + (btf_add_used_type_1): ...the implementation. Handle + BTF_KIND_DECL_TAG and BTF_KIND_TYPE_TAG. + (btf_add_vars): Update btf_add_used_type call. + (btf_assign_tag_ids): New. + (btf_mark_type_used): Update btf_add_used_type call. + (btf_collect_pruned_types): Likewise. Handle type and decl tags. + (btf_finish): Call btf_assign_tag_ids. + +2025-10-09 David Faust + + * ctfc.cc (ctf_dtu_d_union_selector): Handle CTF_K_DECL_TAG and + CTF_K_TYPE_TAG. + (ctf_add_type_tag, ctf_add_decl_tag): New. + (ctf_add_variable): Return the new ctf_dvdef_ref rather than zero. + (new_ctf_container): Initialize new members. + (ctfc_delete_container): Deallocate new members. + * ctfc.h (ctf_dvdef, ctf_dvdef_t, ctf_dvdef_ref): Move forward + declarations earlier in file. + (ctf_decl_tag_t): New typedef. + (ctf_dtdef): Add ctf_decl_tag_t member to dtd_u union. + (ctf_dtu_d_union_enum): Add new CTF_DTU_D_TAG enumerator. + (ctf_container): Add ctfc_tags vector and ctfc_type_tags_map hash_map + members. + (ctf_add_type_tag, ctf_add_decl_tag): New function protos. + (ctf_add_variable): Change prototype return type to ctf_dvdef_ref. + * dwarf2ctf.cc (gen_ctf_type_tags, gen_ctf_decl_tags) + (gen_ctf_decl_tags_for_var): New static functions. + (gen_ctf_pointer_type): Handle type tags. + (gen_ctf_sou_type): Handle decl tags. + (gen_ctf_function_type): Likewise. + (gen_ctf_variable): Likewise. + (gen_ctf_function): Likewise. + (gen_ctf_type): Handle TAG_GNU_annotation DIEs. + +2025-10-09 David Faust + + * dwarf2out.cc (struct annotation_node, struct annotation_node_hasher) + (btf_tag_htab): New ancillary structures and hash table. + (annotation_node_hasher::hash, annotation_node_hasher::equal): New. + (hash_btf_tag, gen_btf_tag_dies, maybe_gen_btf_type_tag_dies) + (maybe_gen_btf_decl_tag_dies): New functions. + (modified_type_die): Add new argument to pass type attributes. + Handle btf_type_tag, and update recursive calls. + (base_type_for_mode): Add new arg for modified_type_die call. + (add_type_attribute): Likewise. + (gen_array_type_die): Call maybe_gen_btf_type_tag_dies for the type. + (gen_formal_parameter_die): Call maybe_gen_btf_decl_tag_dies for the + parameter. + (override_type_for_decl_p): Add new arg for modified_type_die call. + (force_type_die): Likewise. + (gen_tagged_type_die): Call maybe_gen_btf_type_tag_dies for the type. + (gen_decl_die): Call maybe_gen_btf_decl_tag_dies for the decl. + (dwarf2out_finish): Empty btf_tag_htab. + (dwarf2out_cc_finalize): Delete btf_tag_htab hash table. + +2025-10-09 Jakub Jelinek + + * ginclude/stdarg.h (va_start): Use __builtin_c23_va_start + also for C++26. + (__STDC_VERSION_STDARG_H__): Also define for C++26. + +2025-10-09 David Malcolm + + * diagnostic-global-context.cc: Define INCLUDE_VECTOR. + * diagnostics/buffering.cc: Likewise. + * diagnostics/context.cc (context::finish): Call + finalize_extensions on each sink. + (sink::dump): Dump any extensions. + (sink::finalize_extensions): New. + * diagnostics/macro-unwinding.cc: Define INCLUDE_VECTOR. + * diagnostics/selftest-context.cc: Likewise. + * diagnostics/sink.h (class sink::extension): New. + (sink::add_extension): New. + (sink::finalize_extensions): New decl. + (sink::m_extensions): New member. + * gcc.cc: Define INCLUDE_VECTOR. + * langhooks.cc: Likewise. + * opts.cc: Likewise. + * tree-diagnostic-client-data-hooks.cc: Likewise. + * tree-diagnostic.cc: Likewise. + +2025-10-09 Filip Kastl + + * Makefile.in: Add gimple-ssa-pta-constraints.cc. + * tree-ssa-structalias.cc (determine_global_memory_access): + External linkage, move to namespace pointer_analysis. + (fndecl_maybe_in_other_partition): External linkage, move to + namespace pointer_analysis. + (new_var_info): External linkage, move to namespace + pointer_analysis. + (create_variable_info_for): Move to + gimple-ssa-pta-constraints.cc. + (lookup_vi_for_tree): External linkage, move to namespace + pointer_analysis, move to gimple-ssa-pta-constraints.cc. + (type_can_have_subvars): Move to gimple-ssa-pta-constraints.cc. + (make_param_constraints): Move to gimple-ssa-pta-constraints.cc. + (get_call_vi): Move to gimple-ssa-pta-constraints.cc. + (lookup_call_use_vi): External linkage, move to namespace + pointer_analysis, move to gimple-ssa-pta-constraints.cc. + (lookup_call_clobber_vi): External linkage, move to namespace + pointer_analysis, move to gimple-ssa-pta-constraints.cc. + (get_call_use_vi): Move to gimple-ssa-pta-constraints.cc. + (get_call_clobber_vi): Move to gimple-ssa-pta-constraints.cc. + (get_constraint_for_1): Move to gimple-ssa-pta-constraints.cc. + (get_constraint_for): Move to gimple-ssa-pta-constraints.cc. + (get_constraint_for_rhs): Move to gimple-ssa-pta-constraints.cc. + (do_deref): Move to gimple-ssa-pta-constraints.cc. + (constraint_pool): Move to gimple-ssa-pta-constraints.cc. + (new_constraint): Move to gimple-ssa-pta-constraints.cc. + (insert_vi_for_tree): Move to gimple-ssa-pta-constraints.cc. + (alias_get_name): Move to gimple-ssa-pta-constraints.cc. + (get_vi_for_tree): Move to gimple-ssa-pta-constraints.cc. + (new_scalar_tmp_constraint_exp): Move to + gimple-ssa-pta-constraints.cc. + (get_constraint_for_ssa_var): Move to + gimple-ssa-pta-constraints.cc. + (process_constraint): Move to gimple-ssa-pta-constraints.cc. + (bitpos_of_field): Move to gimple-ssa-pta-constraints.cc. + (get_constraint_for_ptr_offset): Move to + gimple-ssa-pta-constraints.cc. + (get_constraint_for_component_ref): Move to + gimple-ssa-pta-constraints.cc. + (get_constraint_for_address_of): Move to + gimple-ssa-pta-constraints.cc. + (process_all_all_constraints): Move to + gimple-ssa-pta-constraints.cc. + (do_structure_copy): Move to gimple-ssa-pta-constraints.cc. + (make_constraints_to): Move to gimple-ssa-pta-constraints.cc. + (make_constraint_to): Move to gimple-ssa-pta-constraints.cc. + (make_constraint_from): Move to gimple-ssa-pta-constraints.cc. + (make_copy_constraint): Move to gimple-ssa-pta-constraints.cc. + (make_escape_constraint): Move to gimple-ssa-pta-constraints.cc. + (make_indirect_escape_constraint): Move to + gimple-ssa-pta-constraints.cc. + (make_transitive_closure_constraints): Move to + gimple-ssa-pta-constraints.cc. + (make_any_offset_constraints): Move to + gimple-ssa-pta-constraints.cc. + (struct obstack fake_var_decl_obstack): Move to + gimple-ssa-pta-constraints.cc. + (build_fake_var_decl): Move to gimple-ssa-pta-constraints.cc. + (make_heapvar): Move to gimple-ssa-pta-constraints.cc. + (make_constraint_from_restrict): Move to + gimple-ssa-pta-constraints.cc. + (make_constraint_from_global_restrict): Move to + gimple-ssa-pta-constraints.cc. + (get_function_part_constraint): Move to + gimple-ssa-pta-constraints.cc. + (handle_call_arg): Move to gimple-ssa-pta-constraints.cc. + (handle_rhs_call): Move to gimple-ssa-pta-constraints.cc. + (handle_lhs_call): Move to gimple-ssa-pta-constraints.cc. + (get_fi_for_callee): Move to gimple-ssa-pta-constraints.cc. + (find_func_aliases_for_call_arg): Move to + gimple-ssa-pta-constraints.cc. + (find_func_aliases_for_builtin_call): Move to + gimple-ssa-pta-constraints.cc. + (find_func_aliases_for_call): Move to + gimple-ssa-pta-constraints.cc. + (find_func_aliases): Move to gimple-ssa-pta-constraints.cc. + (process_ipa_clobber): Move to gimple-ssa-pta-constraints.cc. + (find_func_clobbers): Move to gimple-ssa-pta-constraints.cc. + (struct fieldoff): Move to gimple-ssa-pta-constraints.cc. + (fieldoff_compare): Move to gimple-ssa-pta-constraints.cc. + (sort_fieldstack): Move to gimple-ssa-pta-constraints.cc. + (var_can_have_subvars): Move to gimple-ssa-pta-constraints.cc. + (type_must_have_pointers): Move to + gimple-ssa-pta-constraints.cc. + (field_must_have_pointers): Move to + gimple-ssa-pta-constraints.cc. + (push_fields_onto_fieldstack): Move to + gimple-ssa-pta-constraints.cc. + (count_num_arguments): Move to gimple-ssa-pta-constraints.cc. + (create_function_info_for): Move to + gimple-ssa-pta-constraints.cc. + (check_for_overlaps): Move to gimple-ssa-pta-constraints.cc. + (create_variable_info_for_1): Move to + gimple-ssa-pta-constraints.cc. + (intra_create_variable_infos): Move to + gimple-ssa-pta-constraints.cc. + (init_base_vars): Move to gimple-ssa-pta-constraints.cc. + (init_constraint_builder): Move to + gimple-ssa-pta-constraints.cc. + (delete_constraint_builder): Move to + gimple-ssa-pta-constraints.cc. + (intra_build_constraints): Move to + gimple-ssa-pta-constraints.cc. + (delete_points_to_sets): Move to gimple-ssa-pta-constraints.cc. + (associate_varinfo_to_alias): Move to + gimple-ssa-pta-constraints.cc + (refered_from_nonlocal_fn): Move to + gimple-ssa-pta-constraints.cc + (refered_from_nonlocal_var): Move to + gimple-ssa-pta-constraints.cc + (ipa_create_function_infos): Move to + gimple-ssa-pta-constraints.cc + (ipa_create_global_variable_infos): Move to + gimple-ssa-pta-constraints.cc + (ipa_build_constraints): Move to gimple-ssa-pta-constraints.cc + * tree-ssa-structalias.h (struct constraint_stats): + (determine_global_memory_access): External linkage, move to + namespace pointer_analysis. + (fndecl_maybe_in_other_partition): External linkage, move to + namespace pointer_analysis. + (new_var_info): External linkage, move to namespace + pointer_analysis. + * gimple-ssa-pta-constraints.cc: New file. + * gimple-ssa-pta-constraints.h: New file. + +2025-10-09 Filip Kastl + + * tree-ssa-structalias.cc (init_constraint_builder): New + function. + (delete_constraint_builder): New function. + (compute_points_to_sets): Put constraint building into + intra_build_constraints and call it. + (intra_build_constraints): New function. + (delete_points_to_sets): Put cleanup of constraint builder + global vars into delete_constraint_builder and call it. + (ipa_pta_execute): Put constraint building into + ipa_build_constraints and call it. + (ipa_create_function_infos): New function. + (ipa_create_global_variable_infos): New function. + (ipa_build_constraints): New function. + +2025-10-09 Takayuki 'January June' Suwa + + * config/xtensa/xtensa-protos.h (xtensa_constantsynth): Remove. + * config/xtensa/xtensa.cc + (#include): Remove "context.h" and "pass_manager.h". + (machine_function): Remove "litpool_usage" member. + (xtensa_constantsynth_2insn, xtensa_constantsynth_rtx_SLLI, + xtensa_constantsynth_rtx_ADDSUBX, xtensa_constantsynth): Remove. + (constantsynth_method_lshr_m1, split_hwi_to_MOVI_ADDMI, + constantsynth_method_16bits, constantsynth_method_32bits, + constantsynth_method_square): New worker function related to + constant synthesis methods. + (constantsynth_method_info, constantsynth_methods): + New structure representing the list of all constant synthesis + methods. + (constantsynth_info): New structure that stores internal + information for "constantsynth". + (constantsynth_pass1, verify_synth_seq, constantsynth_pass2): + New functions that are the core of "constantsynth". + (do_largeconst): Add a call to constantsynth_pass1() to the insn + enumeration loop, and add a call to constantsynth_pass2() to the + end of this function. + * config/xtensa/xtensa.md (SHI): Remove. + (The two auxiliary define_splits for mov[sh]i_internal): Remove. + (The two auxiliary define_splits for movsf_internal): Remove. + +2025-10-09 Takayuki 'January June' Suwa + + * config/xtensa/xtensa-protos.h + (xtensa_split_DI_reg_imm): Remove. + * config/xtensa/xtensa.cc (xtensa_split_DI_reg_imm): Remove. + (split_DI_SF_DF_const): New worker function. + (do_largeconst): Add a call to split_DI_SF_DF_const() to the insn + enumeration loop. + * config/xtensa/xtensa.md (movdi): Remove split code when the + source is constant. + (movdi_internal): Add a new constraint pair (a, Y) to the second + of the existing constraint alternatives. + (The auxiliary define_split for movdi_internal): Remove. + +2025-10-09 Takayuki 'January June' Suwa + + * config/xtensa/xtensa.cc (xt_full_rtx_costs): + New struct, derived from full_rtx_costs. + (FPreg_neg_scaled_simm12b_1, FPreg_neg_scaled_simm12b): + New worker functions. + (do_largeconst): Add a call to FPreg_neg_scaled_simm12b() to the + insn enumeration loop. + +2025-10-09 Takayuki 'January June' Suwa + + * config/xtensa/constraints.md (Y): + Change to reference xtensa_postreload_completed_p() instead of + xtensa_split1_finished_p(). + * config/xtensa/predicates.md (move_operand): Ditto. + * config/xtensa/t-xtensa (PASSES_EXTRA): + Add xtensa-passes.def as target-specific pass description. + * config/xtensa/xtensa-passes.def: + New definition file that inserts pass_xtensa_largeconst after + pass_postreload_cse. + * config/xtensa/xtensa-protos.h (xtensa_split1_finished_p): Remove. + (xtensa_postreload_completed_p, make_pass_xtensa_largeconst): + New function prototypes. + * config/xtensa/xtensa.cc (machine_function): + Add a new member "postreload_completed". + (xtensa_emit_move_sequence): + Change to reference xtensa_postreload_completed_p() instead of + can_create_pseudo_p(). + (xtensa_split1_finished_p): Remove. + (xtensa_postreload_completed_p): New function. + (xtensa_legitimate_constant_p): Change to also consider + xtensa_postreload_completed_p(). + (litpool_set_src_1, litpool_set_src, do_largeconst, + rest_of_handle_largeconst): + New sub-functions for pass_xtensa_largeconst. + (pass_data_xtensa_largeconst, pass_xtensa_largeconst): + New target-specific pass definition. + (make_pass_xtensa_largeconst): + New function called by the pass manager. + * config/xtensa/xtensa.md + (The auxiliary define_split for movdi_internal): + Change to reference xtensa_postreload_completed_p() instead of + xtensa_split1_finished_p(). + (The first of three auxiliary define_splits for mov[sh]i_internal): + Remove. + +2025-10-09 Takayuki 'January June' Suwa + + * config/xtensa/xtensa.cc + (TARGET_MD_ASM_ADJUST): New macro definition. + (xtensa_md_asm_adjust): New function prototype and definition, that + prepends all 'g'-constraints in the "constraints" vector with 'n', + if neither TARGET_CONST16 nor TARGET_AUTO_LITPOOLS is enabled. + +2025-10-09 Richard Biener + + PR tree-optimization/122212 + * tree-ssa-forwprop.cc (simplify_count_zeroes): Apply + bias for CLZ after dealing with the zero special value. + +2025-10-09 Kito Cheng + + * config/riscv/riscv-protos.h (vls_mode_valid_p): New argument + allow_up_to_lmul_8. + * config/riscv/riscv-v.cc (autovectorize_vector_modes): Set + allow_up_to_lmul_8 to false. + (vls_mode_valid_p): Add new argument allow_up_to_lmul_8, and use + it to determine whether to allow LMUL 8. + +2025-10-09 Prathamesh Kulkarni + Matthew Malcolmson + + PR driver/81358 + * common.opt: New option -flink-libatomic. + * gcc.cc (LINK_LIBATOMIC_SPEC): New macro. + * config/alpha/linux.h (LINK_GCC_C_SEQUENCE_SPEC): Use LINK_LIBATOMIC_SPEC. + * config/arm/uclinux-elf.h: Likewise. + * config/arm/unknown-elf.h: Likewise. + * config/avr/avrlibc.h: Likewise. + * config/bfin/linux.h: Likewise. + * config/darwin.h: Likewise. + * config/gnu-user.h: Likewise. + * config/lm32/uclinux-elf.h: Likewise. + * config/rs6000/linux64.h: Likewise. + * config/rs6000/rtems.h: Likewise. + * config/sparc/sparc.h: Likewise. + * doc/invoke.texi: Document -flink-libatomic. + * configure.ac: Define TARGET_PROVIDES_LIBATOMIC. + * configure: Regenerate. + * config.in: Regenerate. + * common.opt.urls: Regenerate. + +2025-10-09 Robin Dapp + + * config/aarch64/aarch64.cc (aarch64_builtin_support_vector_misalignment): + Remove type. + * config/arm/arm.cc (arm_builtin_support_vector_misalignment): + Ditto. + * config/epiphany/epiphany.cc (epiphany_support_vector_misalignment): + Ditto. + * config/gcn/gcn.cc (gcn_vectorize_support_vector_misalignment): + Ditto. + * config/loongarch/loongarch.cc (loongarch_builtin_support_vector_misalignment): + Ditto. + * config/riscv/riscv.cc (riscv_support_vector_misalignment): + Ditto. + * config/rs6000/rs6000.cc (rs6000_builtin_support_vector_misalignment): + Ditto. + * config/s390/s390.cc (s390_support_vector_misalignment): + Ditto. + * doc/tm.texi: Adjust vector misalignment docs. + * target.def: Ditto. + * targhooks.cc (default_builtin_support_vector_misalignment): + Remove type. + * targhooks.h (default_builtin_support_vector_misalignment): + Ditto. + * tree-vect-data-refs.cc (vect_can_force_dr_alignment_p): + Set misalignment for gather/scatter and remove type. + (vect_supportable_dr_alignment): Ditto. + +2025-10-09 Sam James + + PR c++/117219 + * doc/invoke.texi (-fstrict-aliasing): Explain that type-punning + through a union in C++ is supported as a GNU extension. + +2025-10-09 Sam James + + * doc/invoke.texi: Add missing full stop. + +2025-10-09 Sam James + + PR tree-optimization/18501 + * doc/invoke.texi (-Wmaybe-uninitialized): Mention interaction with + CCP. + +2025-10-08 Antoni Boucher + + * configure: Regenerate. + +2025-10-08 Trevor Gross + + PR target/115054 + * config/i386/i386.cc (function_arg_ms_64, + function_value_ms_64): Pass and return _Float16 in vector + registers on Windows. + +2025-10-08 Richard Biener + + PR tree-optimization/110223 + PR tree-optimization/122128 + * tree-vect-patterns.cc (vect_recog_bool_pattern): Add + compensation for mixed mask/data bitwise operations. + +2025-10-08 Richard Biener + + * tree-vect-patterns.cc (integer_type_for_mask): Only + reject vect_external_defs. + +2025-10-08 Richard Biener + + * doc/tm.texi.in (JIT Language and ABI): Add menu item. + * doc/tm.texi: Re-generate. + +2025-10-08 Richard Biener + + PR tree-optimization/110223 + * tree-vect-patterns.cc (vect_recog_bool_pattern): Fix + mistakes in the store-from-mask bool pattern. Add + required mask conversions. + +2025-10-08 Richard Biener + + PR tree-optimization/105490 + * tree-vect-patterns.cc (build_mask_conversion): Move earlier. + (vect_convert_mask_for_vectype): Likewise. + (vect_recog_bool_pattern): Remove redundant truth type + construction. Add missing possibly required mask conversion. + +2025-10-08 Antoni Boucher + + PR jit/112466 + * Makefile.in (tm_jit_file_list, tm_jit_include_list, TM_JIT_H, + JIT_TARGET_DEF, JIT_TARGET_H, JIT_TARGET_OBJS): New variables. + (tm_jit.h, cs-tm_jit.h, jit/jit-target-hooks-def.h, + s-jit-target-hooks-def-h, default-jit.o): New rules. + (s-tm-texi): Also check timestamp on jit-target.def. + (generated_files): Add TM_JIT_H and jit/jit-target-hooks-def.h. + (build/genhooks.o): Also depend on JIT_TARGET_DEF. + * config.gcc (tm_jit_file, jit_target_objs, target_has_targetjitm): + New variables. + * config/i386/t-i386 (i386-jit.o): New rule. + * configure: Regenerate. + * configure.ac (tm_jit_file_list, tm_jit_include_list, + jit_target_objs): Add substitutes. + * doc/tm.texi: Regenerate. + * doc/tm.texi.in (targetjitm): Document. + (target_has_targetjitm): Document. + * genhooks.cc: Include jit/jit-target.def. + * config/default-jit.cc: New file. + * config/i386/i386-jit.cc: New file. + * config/i386/i386-jit.h: New file. + +2025-10-07 Alfie Richards + + * doc/tm.texi: Regenerate. + * doc/tm.texi.in: Add documentation for TARGET_HAS_FMV_TARGET_ATTRIBUTE. + +2025-10-07 Georg-Johann Lay + + PR target/122187 + * config/avr/avr.cc (avr_out_extr, avr_out_extr_not): + Make a local copy of the passed rtx[] operands. + +2025-10-07 Jonathan Wakely + + * config/i386/i386-features.cc + (general_scalar_chain::vector_const_cost): Fix spelling in + comment. + * ipa-prop.h (enum jump_func_type): Likewise. + * tree-vectorizer.cc (try_vectorize_loop_1): Likewise. + +2025-10-07 Robin Dapp + + PR target/121845 + * config/riscv/riscv-v.cc (shuffle_series_patterns): + Modulo indices for VLA and punt when wrapping for VLS. + +2025-10-07 Raphael Moreira Zinsly + + PR target/122124 + * config/riscv/riscv-v.cc (shuffle_slide_patterns): Check if + the second pivot is in OP1 and improve comments. + +2025-10-07 Andrew Pinski + + PR tree-optimization/121921 + * match.pd (`-(a ptrdiff b)`): Extend for a nop_convert + between the neg and ptrdiff. + +2025-10-07 Andrew Pinski + + PR tree-optimization/122083 + * tree-ssa-phiopt.cc (single_trailing_store_in_bb): Rename to ... + (trailing_store_in_bb): This and take new argument to check for + only store. + (cond_if_else_store_replacement_limited): Update to use + trailing_store_in_bb. + (cond_if_else_store_replacement): Loop until + cond_if_else_store_replacement_limited returns false. + (pass_phiopt::execute): Instead of calling cond_if_else_store_replacement_limited + once, also loop on it. + +2025-10-06 Andrew Pinski + + PR tree-optimization/122155 + * tree-ssa-phiopt.cc (cond_if_else_store_replacement_1): Don't + create a phi if the 2 rhs are the same. + +2025-10-06 Jan Hubicka + + PR middle-end/122122 + * tree-cfgcleanup.cc (tree_forwarder_block_p): Cleanup. + * tree-ssa-dce.cc (propagate_counts): New function. + (eliminate_unnecessary_stmts): Use it. + +2025-10-06 Jan Hubicka + + * params.opt (-param=auto-profile-bbs=): Add missing full stop after + description. + +2025-10-06 Andrew MacLeod + + PR tree-optimization/121206 + * value-range.cc (irange::intersect_bitmask): Always call + set_range_from_bitmask if the bitmask changes. + +2025-10-06 Sam James + + PR rtl-optimization/111619 + * doc/install.texi (Building a native compiler): Discuss STAGE1_CFLAGS. + +2025-10-06 Jennifer Schmitz + + PR target/121599 + * config/aarch64/aarch64-sve-builtins.cc + (function_expander::use_cond_insn): Use add_fixed_operand if + fallback_arg == CONST0_RTX (mode). + +2025-10-06 Richard Biener + + PR tree-optimization/122131 + * tree-vect-data-refs.cc (vect_supportable_dr_alignment): Do + not use re-align loads for gathers. + +2025-10-06 Richard Biener + + PR tree-optimization/122158 + * tree-vect-loop.cc (vect_create_epilog_for_reduction): Handle + bit-precision result. + +2025-10-06 Jakub Jelinek + + PR middle-end/122133 + * stmt.cc (resolve_asm_operand_names): Handle % and 2 letters followed + by open square. + +2025-10-06 Andrew Pinski + + PR tree-optimization/122142 + * generic-match-head.cc: Include gimple-iterator.h + and gimple-fold.h. + * gimple-fold.cc (gimple_fold_builtin_constant_p): Use + fold_before_rtl_expansion_p. + (gimple_fold_builtin_assume_aligned): Likewise. + (gimple_fold_builtin_stdarg): Likewise. + (gimple_fold_call): Likewise. + * gimple-fold.h: Include "tree-pass.h". + (fold_before_rtl_expansion_p): New function. + * match.pd: Use fold_before_rtl_expansion_p + instead of `cfun->curr_properties & PROP_last_full_fold`. + * tree-ssa-forwprop.cc (simplify_builtin_memcmp): Likewise. + (optimize_stack_restore): Likewise. + +2025-10-05 H.J. Lu + + PR target/122150 + * config/i386/i386-expand.cc (setmem_epilogue_gen_val): Duplicate + OP if its size is smaller than MODE size. + +2025-10-05 John David Anglin + + * config/pa/pa.h (FUNCTION_BOUNDARY): Set to 32. + +2025-10-05 Pan Li + + * config/riscv/autovec-opt.md (*widen_waddu_wx_): Add new + pattern to match vwaddu.wx. + +2025-10-05 Pan Li + + * match.pd: Refactor the form 1 of SAT_MUL by keyword for. + +2025-10-04 Andrew Pinski + + PR tree-optimization/122143 + * tree-ssa-forwprop.cc (pass_forwprop::execute): Restrict setting + TODO_update_address_taken only when the statement was a call before fold_stmt. + +2025-10-04 Andrew Pinski + + PR tree-optimization/122153 + * tree-ssa-phiopt.cc (cond_if_else_store_replacement_1): Handle + stores of empty constructors too. + +2025-10-04 Matteo Nicoli + + PR tree-optimization/117760 + * match.pd: Add simplifications that exploit implied values after + logical tests. + +2025-10-04 Jakub Jelinek + + PR tree-optimization/122104 + * tree-ssa-math-opts.cc (maybe_optimize_guarding_check): Call + reset_flow_sensitive_info_in_bb on bb when optimizing out the + guarding condition. + +2025-10-04 Raphael Moreira Zinsly + + PR target/122114 + * config/riscv/riscv.cc + (riscv_allocate_and_probe_stack_space): Change initial_cfa_offset + type. + +2025-10-04 Jeff Law + + PR target/122147 + * config/riscv/predicates.md (move_operand): Only allow a REG as the + operand of a SUBREG. + +2025-10-04 Zhongyao Chen + + PR target/118945 + * config/riscv/riscv.cc (riscv_prefer_agnostic_p): New function. + (riscv_tune_param): Add prefer_agnostic member. + (various tune info structures): Initialize prefer_agnostic. + * config/riscv/riscv-protos.h (riscv_prefer_agnostic_p): Add + prototype. + * config/riscv/riscv-v.cc (get_prefer_tail_policy, + get_prefer_mask_policy): Use riscv_prefer_agnostic_p. + * config/riscv/riscv-vsetvl.cc (vsetvl_info::get_demand_flags): + demand policy for agnostic when prefer_agnostic is true. + +2025-10-04 Jakub Jelinek + + PR c++/114457 + * flag-types.h (enum auto_init_type): Add AUTO_INIT_CXX26. + * tree.h (VACUOUS_INIT_LABEL_P): Define. + * gimplify.cc (is_var_need_auto_init): Renamed to ... + (var_needs_auto_init_p): ... this. Don't return true for + vars with "indeterminate" attribute. Formatting fixes. + (gimplify_decl_expr): Use var_needs_auto_init_p instead of + is_var_need_auto_init. + (emit_warn_switch_unreachable): Remove the flag_auto_var_init + special cases. + (warn_switch_unreachable_and_auto_init_r): Handle them here + by doing just returning NULL. + (last_stmt_in_scope): Don't skip just debug stmts to find + the last stmt in seq, skip for + flag_auto_var_init > AUTO_INIT_UNINITIALIZED also IFN_DEFERRED_INIT + calls. + (collect_fallthrough_labels): For + flag_auto_var_init > AUTO_INIT_UNINITIALIZED ignore + IFN_DEFERRED_INIT calls and GIMPLE_GOTOs to + VACUOUS_INIT_LABEL_P. + (should_warn_for_implicit_fallthrough): For + flag_auto_var_init > AUTO_INIT_UNINITIALIZED also skip over + IFN_DEFERRED_INIT calls. + (expand_FALLTHROUGH_r): Likewise, and handle GIMPLE_GOTOs + to VACUOUS_INIT_LABEL_P. + (gimplify_init_constructor): Use var_needs_auto_init_p instead + of is_var_need_auto_init and for flag_auto_var_init + AUTO_INIT_CXX26 don't call gimple_add_padding_init_for_auto_var. + (gimplify_target_expr): If var_needs_auto_init_p and init has + void type, call gimple_add_init_for_auto_var and for + AUTO_INIT_PATTERN also gimple_add_padding_init_for_auto_var. + * tree-ssa-uninit.cc (maybe_warn_operand): Handle loads from *this + at the start of the function with "clobber *this" attribute on the + PARM_DECL. + * ipa-split.cc (split_function): Remove "clobber *this" attribute + from the first PARM_DECL (if any). + * doc/invoke.texi (ftrivial-auto-var-init=): Adjust documentation. + +2025-10-04 Nathaniel Shead + + PR c++/117658 + * doc/invoke.texi: Document '-Wno-external-tu-local'. + +2025-10-03 David Malcolm + + Revert: + 2025-10-03 David Malcolm + + * Makefile.in (OBJS-libcommon): Add + custom-sarif-properties/digraphs.o and + custom-sarif-properties/state-graphs.o. Remove + diagnostics/state-graphs.o. + * configure: Regenerate. + * configure.ac: Add custom-sarif-properties to subdir iteration. + * custom-sarif-properties/digraphs.cc: New file. + * custom-sarif-properties/digraphs.h: New file. + * custom-sarif-properties/state-graphs.cc: New file. + * custom-sarif-properties/state-graphs.h: New file. + * diagnostics/diagnostics-selftests.cc + (run_diagnostics_selftests): Drop call of state_graphs_cc_tests. + * diagnostics/diagnostics-selftests.h (state_graphs_cc_tests): + Delete decl. + * diagnostics/digraphs.cc: Include + "custom-sarif-properties/digraphs.h". Move include of + "selftest.h" to within CHECKING_P section. + (using digraph_object): New. + (namespace properties): New. + (diagnostics::digraphs::object::get_attr): Delete. + (diagnostics::digraphs::object::set_attr): Delete. + (diagnostics::digraphs::object::set_json_attr): Delete. + (digraph_object::get_property): New definitions, for various + property types. + (digraph_object::set_property): Likewise. + (digraph_object::maybe_get_property): New. + (digraph_object::get_property_as_tristate): New. + (digraph_object::ensure_property_bag): New. + (digraph::get_graph_kind): New. + (digraph::set_graph_kind): New. + Add include of "custom-sarif-properties/state-graphs.h". + (selftest::test_simple_graph): Rewrite to use json::property + instances rather than string attribute names. + (selftest::test_property_objects): New test. + (selftest::digraphs_cc_tests): Call it. + * diagnostics/digraphs.h: Include "tristate.h". + (object::get_attr): Delete. + (object::set_attr): Delete. + (object::get_property): New decls. + (object::set_property): New decls. + (object::maybe_get_property): New. + (object::get_property_as_tristate): New. + (object::set_json_attr): Delete. + (object::ensure_property_bag): New. + (graph::get_graph_kind): New. + (graph::set_graph_kind): New. + * diagnostics/html-sink.cc + (html_generation_options::html_generation_options): Update for + field renamings. + (html_generation_options::dump): Likewise. + (html_builder::maybe_make_state_diagram): Likewise. + (html_builder::add_graph): Show SARIF and .dot src inline, if + requested. + * diagnostics/html-sink.h + (html_generation_options::m_show_state_diagrams_sarif): Rename + to... + (html_generation_options::m_show_graph_sarif): ...this. + (html_generation_options::m_show_state_diagrams_dot_src): Rename + to... + (html_generation_options::m_show_graph_dot_src0): ...this. + * diagnostics/output-spec.cc + (html_scheme_handler::maybe_handle_kv): Rename keys. + (html_scheme_handler::get_keys): Likewise. + * diagnostics/state-graphs-to-dot.cc: : Reimplement throughout to + use json::property instances found within custom_sarif_properties + throughout, rather than types in diagnostics::state_graphs. + * diagnostics/state-graphs.cc: Deleted file. + * diagnostics/state-graphs.h: Delete almost all, except decl of + diagnostics::state_graphs::make_dot_graph. + * doc/invoke.texi: Update for changes to "experimental-html" sink + keys. + * json.cc (json::object::set_string): New. + (json::object::set_integer): New. + (json::object::set_bool): New. + (json::object::set_array_of_string): New. + * json.h: Include "label-text.h". + (struct json::property): New template. + (json::string_property): New. + (json::integer_property): New. + (json::bool_property): New. + (json::json_property): New. + (using json::array_of_string_property): New. + (struct json::enum_traits): New. + (enum_json::property): New. + (json::value::dyn_cast_array): New vfunc. + (json::value::dyn_cast_integer_number): New vfunc. + (json::value::set_string): New. + (json::value::set_integer): New. + (json::value::set_bool): New. + (json::value::set_array_of_string): New. + (json::value::maybe_get_enum): New. + (json::value::set_enum): New. + (json::array::dyn_cast_array): New. + (json::integer_number::dyn_cast_integer_number): New. + (object::maybe_get_enum): New. + (object::set_enum): New. + +2025-10-03 Jeff Law + + PR rtl-optimization/121937 + * simplify-rtx.cc (simplify_context::simplify_binary_operation_1): Make + sure we've got a scalar_int_mode before calling neg_poly_int_rtx. + +2025-10-03 Andrew Pinski + + PR tree-optimization/121762 + * passes.def: Remove both pass_fold_builtin. + Swap out pass_copy_prop for pass_forwprop with + full_walk = false and last=true. + * tree-pass.h (make_pass_fold_builtins): Remove. + * tree-ssa-ccp.cc (class pass_fold_builtins): Delete. + (pass_fold_builtins::execute): Delete. + (make_pass_fold_builtins): Remove. + * doc/passes.texi (Folding built-in functions): Remove. + +2025-10-03 Andrew Pinski + + PR tree-optimization/121762 + * gimple-isel.cc (gimple_nop_atomic_bit_test_and_p): New decl. + (gimple_nop_convert): Likewise. + (convert_atomic_bit_not): Moved from tree-ssa-ccp.cc. + (optimize_atomic_bit_test_and): Likewise. + (optimize_atomic_op_fetch_cmp_0): Likewise. + (gimple_isel_builtin_call): New function. + (CASE_ATOMIC): Moved from tree-ssa-ccp.cc. + (CASE_ATOMIC_CMP0): Likewise. + (CASE_ATOMIC_BIT_TEST_AND): Likewise. + (pass_gimple_isel::execute): For calls just call gimple_isel_builtin_call. + * tree-ssa-ccp.cc (convert_atomic_bit_not): Move to gimple-isel.cc. + (gimple_nop_atomic_bit_test_and_p): Likewise. + (gimple_nop_convert): Likewise. + (optimize_atomic_bit_test_and): Likewise. + (optimize_atomic_op_fetch_cmp_0): Likewise. + (pass_fold_builtins::execute): Just call fold_stmt for internal + or normal bultin calls. + (CASE_ATOMIC): Move to gimple-isel.cc. + (CASE_ATOMIC_CMP0): Likewise. + (CASE_ATOMIC_BIT_TEST_AND): Likewise. + +2025-10-03 Andrew Pinski + + * tree-ssa-ccp.cc (CASE_ATOMIC): New defined. + (CASE_ATOMIC_CMP0): New define. + (CASE_ATOMIC_BIT_TEST_AND): New defined. + (pass_fold_builtins::execute): Use CASE_ATOMIC, CASE_ATOMIC_CMP0, + and CASE_ATOMIC_BIT_TEST_AND. + +2025-10-03 Andrew Pinski + + PR tree-optimization/121762 + * gimple-fold.cc (gimple_fold_builtin_stdarg): New function, + moved from tree-ssa-ccp.cc (optimize_stdarg_builtin). + (gimple_fold_builtin): Call gimple_fold_builtin_stdarg for + va_start, va_copy and va_end. + * tree-ssa-ccp.cc (optimize_stdarg_builtin): Remove. + (pass_fold_builtins::execute): Remove handling of + va_start, va_copy and va_end. + * tree-ssa-forwprop.cc (pass_forwprop::execute): Update + todos if fold_stmt return true if last forwprop to include + TODO_update_address_taken. + +2025-10-03 Andrew Pinski + + PR tree-optimization/121762 + * tree-ssa-ccp.cc (optimize_unreachable): Move to tree-ssa-forwprop.cc + (pass_fold_builtins::execute): Remove handling of __builtin_unreachable. + * tree-ssa-forwprop.cc (optimize_unreachable): New function from + tree-ssa-ccp.cc. Change argument to bb. Remove check on first statement + being the __builtin_unreachable since it is handled already. + (pass_forwprop::execute): Handle first statement as being __builtin_unreachable + by calling optimize_unreachable. + +2025-10-03 Andrew Pinski + + PR tree-optimization/121762 + * tree-ssa-ccp.cc (optimize_stack_restore): Move to tree-ssa-forwprop.cc. + (pass_fold_builtins::execute): Don't call optimize_stack_restore. + * tree-ssa-forwprop.cc (optimize_stack_restore): New function from + tree-ssa-ccp.cc. Return bool instead of value, use replace_call_with_value + istead of returning integer_zero_node. + (simplify_builtin_call): Call optimize_stack_restore. + +2025-10-03 Andrew Pinski + + PR tree-optimization/122033 + * tree-ssa-ccp.cc (optimize_stack_restore): Rewrite the call check. + Update comment in the front to new rules on calls. + * tree.h (fndecl_builtin_alloc_p): New function. + +2025-10-03 Andrew Pinski + + PR tree-optimization/121762 + * gimple-fold.cc (gimple_fold_call): Remove ASSUME internal function + calls when PROP_last_full_fold is set. + * tree-ssa-ccp.cc (pass_fold_builtins::execute): Handling folding + of all internal functions. + +2025-10-03 Andrew Pinski + + * tree-ssa-ccp.cc (optimize_stdarg_builtin): Mannually create the + gimple statements instead of depending on the gimplifier. + (pass_fold_builtins::execute): Handle updated call to optimize_stdarg_builtin. + +2025-10-03 Andrew Pinski + + * tree-ssa-ccp.cc (optimize_memcmp_eq): Remove. + (pass_fold_builtins::execute): Remove handling of memcmp. + * tree-ssa-forwprop.cc (simplify_builtin_memcmp): Add folding + of memcmp to memcmp_eq for PROP_last_full_fold. + +2025-10-02 David Malcolm + + * Makefile.in (OBJS-libcommon): Add + custom-sarif-properties/digraphs.o and + custom-sarif-properties/state-graphs.o. Remove + diagnostics/state-graphs.o. + * configure: Regenerate. + * configure.ac: Add custom-sarif-properties to subdir iteration. + * custom-sarif-properties/digraphs.cc: New file. + * custom-sarif-properties/digraphs.h: New file. + * custom-sarif-properties/state-graphs.cc: New file. + * custom-sarif-properties/state-graphs.h: New file. + * diagnostics/diagnostics-selftests.cc + (run_diagnostics_selftests): Drop call of state_graphs_cc_tests. + * diagnostics/diagnostics-selftests.h (state_graphs_cc_tests): + Delete decl. + * diagnostics/digraphs.cc: Include + "custom-sarif-properties/digraphs.h". Move include of + "selftest.h" to within CHECKING_P section. + (using digraph_object): New. + (namespace properties): New. + (diagnostics::digraphs::object::get_attr): Delete. + (diagnostics::digraphs::object::set_attr): Delete. + (diagnostics::digraphs::object::set_json_attr): Delete. + (digraph_object::get_property): New definitions, for various + property types. + (digraph_object::set_property): Likewise. + (digraph_object::maybe_get_property): New. + (digraph_object::get_property_as_tristate): New. + (digraph_object::ensure_property_bag): New. + (digraph::get_graph_kind): New. + (digraph::set_graph_kind): New. + Add include of "custom-sarif-properties/state-graphs.h". + (selftest::test_simple_graph): Rewrite to use json::property + instances rather than string attribute names. + (selftest::test_property_objects): New test. + (selftest::digraphs_cc_tests): Call it. + * diagnostics/digraphs.h: Include "tristate.h". + (object::get_attr): Delete. + (object::set_attr): Delete. + (object::get_property): New decls. + (object::set_property): New decls. + (object::maybe_get_property): New. + (object::get_property_as_tristate): New. + (object::set_json_attr): Delete. + (object::ensure_property_bag): New. + (graph::get_graph_kind): New. + (graph::set_graph_kind): New. + * diagnostics/html-sink.cc + (html_generation_options::html_generation_options): Update for + field renamings. + (html_generation_options::dump): Likewise. + (html_builder::maybe_make_state_diagram): Likewise. + (html_builder::add_graph): Show SARIF and .dot src inline, if + requested. + * diagnostics/html-sink.h + (html_generation_options::m_show_state_diagrams_sarif): Rename + to... + (html_generation_options::m_show_graph_sarif): ...this. + (html_generation_options::m_show_state_diagrams_dot_src): Rename + to... + (html_generation_options::m_show_graph_dot_src0): ...this. + * diagnostics/output-spec.cc + (html_scheme_handler::maybe_handle_kv): Rename keys. + (html_scheme_handler::get_keys): Likewise. + * diagnostics/state-graphs-to-dot.cc: : Reimplement throughout to + use json::property instances found within custom_sarif_properties + throughout, rather than types in diagnostics::state_graphs. + * diagnostics/state-graphs.cc: Deleted file. + * diagnostics/state-graphs.h: Delete almost all, except decl of + diagnostics::state_graphs::make_dot_graph. + * doc/invoke.texi: Update for changes to "experimental-html" sink + keys. + * json.cc (json::object::set_string): New. + (json::object::set_integer): New. + (json::object::set_bool): New. + (json::object::set_array_of_string): New. + * json.h: Include "label-text.h". + (struct json::property): New template. + (json::string_property): New. + (json::integer_property): New. + (json::bool_property): New. + (json::json_property): New. + (using json::array_of_string_property): New. + (struct json::enum_traits): New. + (enum_json::property): New. + (json::value::dyn_cast_array): New vfunc. + (json::value::dyn_cast_integer_number): New vfunc. + (json::value::set_string): New. + (json::value::set_integer): New. + (json::value::set_bool): New. + (json::value::set_array_of_string): New. + (json::value::maybe_get_enum): New. + (json::value::set_enum): New. + (json::array::dyn_cast_array): New. + (json::integer_number::dyn_cast_integer_number): New. + (object::maybe_get_enum): New. + (object::set_enum): New. + +2025-10-02 Aurelien Jarno + + PR target/121652 + * config/riscv/riscv.md (round_pattern): special case NaN input + instead of saving/restoring fflags. + +2025-10-02 David Malcolm + + * diagnostics/output-spec.cc: (scheme_handler::parse_bool_value): + Convert to... + (key_handler::parse_bool_value): ...this. + (scheme_handler::parse_enum_value): Convert to... + (key_handler::parse_enum_value): ...this. + (struct text_scheme_handler::decoded_args): Eliminate, moving + fields into class text_scheme_handler. + (text_scheme_handler::text_scheme_handler): Initialize the new + fields. + Add a "dc" param and use it to initialize m_show_color. + (struct sarif_scheme_handler::decoded_args): Eliminate, moving + fields into class sarif_scheme_handler. + (sarif_scheme_handler::sarif_scheme_handler): Initialize the new + fields. + (struct html_scheme_handler::decoded_args): Eliminate, moving + fields into class html_scheme_handler. + (html_scheme_handler::html_scheme_handler): Initialize the new + fields. + (context::report_unknown_key): Get keys from scheme rather than + passing them in. Support client keys. + (context::parse_and_make_sink): Pass dc to output_factory ctor. + (output_factory::output_factory): Pass dc to text_scheme_handler. + (output_factory::get_scheme_handler): Make return non-const. + (output_factory::make_sink): Move key-handling here, rather than + in individual sinks. + (context::handle_kv): New. + (text_scheme_handler::make_sink): Eliminate key decoding. + (text_scheme_handler::decode_kv): Convert to... + (text_scheme_handler::maybe_handle_kv): ...this... + (text_scheme_handler::get_keys): ...and this. + (sarif_scheme_handler::make_sink): Eliminate key decoding. + (sarif_scheme_handler::decode_kv): Convert to... + (sarif_scheme_handler::maybe_handle_kv): ...this... + (sarif_scheme_handler::get_keys): ...and this. + (html_scheme_handler::make_sink): Eliminate key decoding. + (html_scheme_handler::decode_kv): Convert to... + (html_scheme_handler::maybe_handle_kv): ...this... + (html_scheme_handler::get_keys): ...and this. + (struct selftest::parser_test): Add "client_keys" arg, and update + for new param ordering. + (selftest::parser_test::parse_and_make_sink): New. + (selftest::test_output_arg_parsing): Move auto-fixes to caller. + (class selftest::test_key_handler): New. + (selftest::test_client_arg_parsing): New test. + (selftest::output_spec_cc_tests): Call it. + * diagnostics/output-spec.h (class key_handler): New. + (class scheme_handler): Move here from output-spec.cc. + (context::report_unknown_key): Simplify params. + (context::handle_kv): Update params. + (context::context): Add "client_keys" param. + (context::m_client_keys): New field. + (struct dc_spec_context): Update order of params. Add + "client_keys" param. + * libgdiagnostics.cc (spec_context::spec_context): Pass nullptr + for client keys. + * opts-diagnostic.cc (opt_spec_context::opt_spec_context): + Likewise. Update for new param ordering. + +2025-10-02 Richard Biener + + * tree-vect-loop.cc (vectorizable_reduction): Do not allow + mask reductions. + +2025-10-02 Jan Hubicka + H.J. Lu + + * cfghooks.cc (merge_blocks): Fix typo in the previous change. + +2025-10-02 Jeff Law + + PR target/122051 + * config/riscv/predicates.md (pmode_reg_or_uimm5_operand): Implement + directly rather than using vector_length_operand. + +2025-10-02 H.J. Lu + + * aclocal.m4: Regenerated. + * configure: Likewise. + +2025-10-02 Richard Biener + + PR tree-optimization/122079 + * tree-ssa-pre.cc (compute_antic_aux): Re-instantiate + ANTIC_IN value pruning by the old solution. + +2025-10-02 Richard Biener + + PR tree-optimization/122079 + * tree-ssa-pre.cc (prune_clobbered_mems): Do not prune + values when the maximum expression set is involved. + +2025-10-01 Jeff Law + + PR target/122106 + * config/riscv/bitmanip.md (crc expanders): Add predicate for + polynomial argument. Drop unnecessary constraints. + +2025-10-01 Andreas Schwab + + PR target/122066 + * config/m68k/m68k.md (adddi3, subdi3): Strip POST_INC and PRE_DEC + when generating high part of the destination operand. + +2025-10-01 Jan Hubicka + + * auto-profile.cc (afdo_calculate_branch_prob): Improve dump file. + +2025-10-01 Jan Hubicka + + * auto-profile.cc (determine_scale): Break out from ... + (afdo_adjust_guessed_profile): ... here. + (scale_bb_profile): New function. + (afdo_annotate_cfg): Use it. + * params.opt (auto-profile-bbs): New parmaeter. + * doc/invoke.texi (auto-profile-bbs): Document. + +2025-10-01 Jan Hubicka + + * auto-profile.cc (afdo_unscaled_edge_count): New function based on + part of ... + (afdo_set_bb_count): ... this function; use it here. + (afdo_calculate_branch_prob): Try to determine edge counts using + phi args and goto locuses. + +2025-10-01 Jan Hubicka + + * Makefile.in (ALL_FDAS): New variable. + (ALL_HOST_BACKEND_OBJ): Use all.fda instead of cc1plus.fda + (all.fda): New target + +2025-10-01 Jan Hubicka + + * cfghooks.cc (merge_blocks): Choose more reliable or higher BB + count. + +2025-10-01 Jan Hubicka + + * predict.cc (unlikely_executed_stmt_p): Remove redundant check. + (rebuild_frequencies): Also recompute unlikely bbs when profile is + present or consistent. + +2025-10-01 Andrew MacLeod + + PR tree-optimization/120560 + * vr-values.cc (range_from_loop_direction): Use wi::ge_p rather + than wi::gt_p. + +2025-10-01 Richard Biener + + PR tree-optimization/122110 + * tree-vect-loop.cc (vectorizable_reduction): Relax restriction + to mode-precision operations. + +2025-09-30 David Malcolm + + * diagnostics/output-spec.cc (text_scheme_handler::make_sink): Use + the value of the "color" to determine if the sink's printer is + colorized. + +2025-09-30 David Malcolm + + * diagnostics/output-spec.cc: Add comments. Introduce a + "struct decoded_args" within each scheme_handler subclass, + and split out per-scheme key-value parsing from each make_sink + implementation into new per-scheme decode_kv member functions. + +2025-09-30 David Malcolm + + * diagnostics/output-spec.cc: Move class scheme_handler out from + inside class output_factory. + +2025-09-30 David Malcolm + + * diagnostics/output-spec.cc: Rename "parsed_arg" to + "scheme_and_kvs" throughout. Rename "unparsed_arg" to + "unparsed_spec" throughout, and make a member of + output_spec::context rather than passing it around. + * diagnostics/output-spec.h: Likewise. + * libgdiagnostics.cc: Likewise. + * opts-diagnostic.cc: Likewise. + +2025-09-30 Alfie Richards + + * config/aarch64/aarch64.cc (aarch64_functions_b_resolvable_from_a): New + function. + (TARGET_OPTION_FUNCTIONS_B_RESOLVABLE_FROM_A): New define. + * doc/tm.texi: Regenerate. + * doc/tm.texi.in: Add documentation for + TARGET_OPTION_FUNCTIONS_B_RESOLVABLE_FROM_A. + * multiple_target.cc (redirect_to_specific_clone): Add new optimisation + logic. + (ipa_target_clone): Remove check for TARGET_HAS_FMV_TARGET_ATTRIBUTE. + * target.def: Document new hook.. + * attribs.cc: (functions_b_resolvable_from_a) New function. + * attribs.h: (functions_b_resolvable_from_a) New function. + +2025-09-30 Jakub Jelinek + + * auto-profile.h (maybe_hot_afdo_count_p): Fix comment typos, + possiby -> possibly and ture -> true. + * gimplify.cc (build_asan_poison_call_expr): Change "of a for" + to "memory of the" in a comment. + * ipa-devirt.cc (add_type_duplicate): Fix comment typo, + mangles -> mangled. + * auto-profile.cc: Fix comment typo, -fauto-profile-inlinig + -> -fauto-profile-inlining. + (maybe_hot_afdo_count_p): Fix comment typos, possiby -> possibly + and ture -> true. + (function_instance::removed_icall_target): Fix comment typo, + Reutrn -> Return. + (function_instance::in_worklist_): Fix comment typo, Ture -> True. + (function_instance::offline): Fix comment typo, tolevel -> toplevel. + (function_instance::match): Fix comment typo, craeate_gcov -> + create_gcov. + (autofdo_source_profile::offline_external_functions): Fix comment + typos, tolevel -> toplevel and porfile -> profile. + (autofdo_source_profile::get_function_instance_by_inline_stack): Fix + comment typo, chekcing -> checking. + (struct scale): Fix comment typo, scalle -> scale. + * gimple.h (currently_expanding_gimple_stmt): Fix comment typo, + comminucating -> communicating. + * tree.h (canonical_type_used_p): Fix comment typo, ture -> true. + * tree-ssa-alias.cc (types_equal_for_same_type_for_tbaa_p): Likewise. + * ipa-profile.cc (contains_hot_call_p): Likewise. + * cfgexpand.cc (add_scope_conflicts_2): Fix comment typos, + Querry -> Query, referendd -> referenced and Querrying -> Querying. + * ipa-param-manipulation.cc (currently_expanding_gimple_stmt): Fix + comment typo, comminucating -> communicating. + * ipa-prop.cc (ipa_cst_ref_desc::refcount): Fix comment typo, + if -> is. + * tree-if-conv.cc (version_loop_for_if_conversion): Fix comment typos, + porfile -> profile and confistency -> consistency. + * fold-const.cc: Change size_int_wide in comment to size_int as + size_int_wide doesn't exit for 21 years. + +2025-09-30 Jan Hubicka + + * auto-profile.cc (function_instance::match): Sanity check + that gimple PHI has no location. + * tree-cfg.cc (assign_discriminators): Also remap locations + of gimple PHI arguments. + +2025-09-30 Jan Hubicka + + * basic-block.h (GCOV_COMPUTE_SCALE): Remove. + * ipa-profile.cc (ipa_profile_generate_summary): Use + profile-count scaling. + * sched-rgn.cc (compute_trg_info): Likewise. + +2025-09-30 Jan Hubicka + + * auto-profile.cc (stmt_loc_used_by_debug_info): New function. + (autofdo_source_profile::get_count_info): Use it. + (afdo_set_bb_count): Likewise. + (afdo_vpt_for_early_inline): Likewise. + +2025-09-30 Andre Vieira + + * gimple-lower-bitint.cc (bitint_precision_kind): Fix inconsistency in + results between first and consecutive calls to this function. + +2025-09-28 liuhongt + + PR target/121970 + * config/i386/i386-options.cc (ix86_target_string): Remove + store_max. + (ix86_debug_options): Ditto. + (ix86_function_specific_print): Ditto. + (ix86_valid_target_attribute_tree): Ditto. + (ix86_option_override_internal): Ditto. + * config/i386/i386-expand.cc (ix86_expand_builtin): Ditto. + * config/i386/i386-options.h (ix86_target_string): Ditto. + * config/i386/i386.h (MOVE_MAX): Ditto. + (STORE_MAX_PIECES): Set by move_max. + * config/i386/i386.opt: Deprecate mmove-max=. + * config/i386/x86-tune.def (X86_TUNE_AVX256_STORE_BY_PIECES): + Removed. + (X86_TUNE_AVX512_STORE_BY_PIECES): Ditto. + +2025-09-28 Peter Damianov + + * pretty-print.cc (decode_utf8_char): Move forward declaration. + (mingw_utf8_str_to_utf16_str): New function to convert UTF-8 to UTF-16. + (is_console_handle): New function to detect Windows console handles. + (write_all): Add UTF-8 to UTF-16 conversion for console output, + falling back to WriteFile for ASCII strings and regular files. + +2025-09-27 ChengLulu + + PR target/99217 + * config/mips/mips.cc (mips_start_function_definition): + Implements the functionality of '-fpatchable-function-entry='. + (mips_print_patchable_function_entry): Define empty function. + (TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY): Define macro. + +2025-09-27 Jie Mei + + * config/mips/mips.cc(mips_option_override):Add conditions + for use of the -mmips16e2 and -mips16 option. + +2025-09-27 Jie Mei + + * config/mips/mips.md (fms4): Generates MSUBF.fmt + instructions. + (*fms4_msubf): Same as above. + (fnma4): Same as above. + (*fnma4_msubf): Same as above. + +2025-09-26 Alejandro Colomar + + * doc/extend.texi: Clarify documentation about lists of + parameter forward declarations, and mention that more than one + of them are unnecessary. + * doc/invoke.texi: Document the new + -Wmultiple-parameter-fwd-decl-lists. + +2025-09-26 Jan Hubicka + + * auto-profile.cc (afdo_propagate_edge): Fix handling of precize 0 + counts. + +2025-09-26 Andrew Stubbs + + * config/gcn/gcn.cc + (gcn_vectorize_support_vector_misalignment): Allow any alignment, as + long as it's not packed. + +2025-09-26 Jan Hubicka + + * profile-count.h (profile_probability::operator/): Do not cap + twice. + (profile_probability::operator/=): Likewise. + (profile_probability::apply_scale): Do not watch for overflow. + (profile_count::probability_in): Watch overflow. + +2025-09-26 Lulu Cheng + + PR target/121875 + * config/loongarch/loongarch.cc + (loongarch_can_inline_p): New function. + (TARGET_CAN_INLINE_P): Define. + +2025-09-25 Gerald Pfeifer + + * doc/invoke.texi (Warning Options): Use "bitwise" over + "bit-wise". + * doc/extend.texi (Vector Extensions): Use "elementwise" + over "element-wise". + * doc/md.texi (Standard Names): Ditto. + +2025-09-25 Gerald Pfeifer + + * doc/extend.texi (Vector Extensions): Fix grammar. + +2025-09-25 Xi Ruoyao + + * doc/invoke.texi (-ffp-int-builtin-inexact): Reword to match + the default value with the default C standard. + +2025-09-24 Dusan Stojkovic + + PR target/121778 + * config/riscv/riscv.md: Add define_split pattern. + +2025-09-24 Andrew Pinski + + PR tree-optimization/121762 + * gimple-fold.cc (gimple_fold_builtin_assume_aligned): New function. + (gimple_fold_builtin): Call gimple_fold_builtin_assume_aligned + for BUILT_IN_ASSUME_ALIGNED. + * tree-ssa-ccp.cc (pass_fold_builtins::execute): Remove handling + of BUILT_IN_ASSUME_ALIGNED. + +2025-09-24 Jennifer Schmitz + + * config/aarch64/aarch64.md: Include neoversev2.md. + * config/aarch64/tuning_models/neoversev2.h: Enable dispatch + scheduling and add dispatch constraints. + * config/aarch64/neoversev2.md: New file and new instruction attribute + neoversev2_dispatch. + +2025-09-24 Jennifer Schmitz + + * config.gcc: Add aarch64-sched-dispatch.o to extra_objs. + * config/aarch64/aarch64-protos.h (struct tune_params): New + field for dispatch scheduling. + (struct dispatch_constraint_info): New struct for dispatch scheduling. + * config/aarch64/aarch64-tuning-flags.def + (AARCH64_EXTRA_TUNING_OPTION): New flag to enable dispatch scheduling. + * config/aarch64/aarch64.cc (TARGET_SCHED_DISPATCH): Implement + target hook. + (TARGET_SCHED_DISPATCH_DO): Likewise. + (aarch64_override_options_internal): Add check for definition of + dispatch constraints if dispatch-scheduling tune flag is set. + * config/aarch64/t-aarch64: Add aarch64-sched-dispatch.o. + * config/aarch64/tuning_models/a64fx.h: Initialize fields for + dispatch scheduling in tune_params. + * config/aarch64/tuning_models/ampere1.h: Likewise. + * config/aarch64/tuning_models/ampere1a.h: Likewise. + * config/aarch64/tuning_models/ampere1b.h: Likewise. + * config/aarch64/tuning_models/cortexa35.h: Likewise. + * config/aarch64/tuning_models/cortexa53.h: Likewise. + * config/aarch64/tuning_models/cortexa57.h: Likewise. + * config/aarch64/tuning_models/cortexa72.h: Likewise. + * config/aarch64/tuning_models/cortexa73.h: Likewise. + * config/aarch64/tuning_models/cortexx925.h: Likewise. + * config/aarch64/tuning_models/emag.h: Likewise. + * config/aarch64/tuning_models/exynosm1.h: Likewise. + * config/aarch64/tuning_models/fujitsu_monaka.h: Likewise. + * config/aarch64/tuning_models/generic.h: Likewise. + * config/aarch64/tuning_models/generic_armv8_a.h: Likewise. + * config/aarch64/tuning_models/generic_armv9_a.h: Likewise. + * config/aarch64/tuning_models/neoverse512tvb.h: Likewise. + * config/aarch64/tuning_models/neoversen1.h: Likewise. + * config/aarch64/tuning_models/neoversen2.h: Likewise. + * config/aarch64/tuning_models/neoversen3.h: Likewise. + * config/aarch64/tuning_models/neoversev1.h: Likewise. + * config/aarch64/tuning_models/neoversev2.h: Likewise. + * config/aarch64/tuning_models/neoversev3.h: Likewise. + * config/aarch64/tuning_models/neoversev3ae.h: Likewise. + * config/aarch64/tuning_models/olympus.h: Likewise. + * config/aarch64/tuning_models/qdf24xx.h: Likewise. + * config/aarch64/tuning_models/saphira.h: Likewise. + * config/aarch64/tuning_models/thunderx.h: Likewise. + * config/aarch64/tuning_models/thunderx2t99.h: Likewise. + * config/aarch64/tuning_models/thunderx3t110.h: Likewise. + * config/aarch64/tuning_models/thunderxt88.h: Likewise. + * config/aarch64/tuning_models/tsv110.h: Likewise. + * config/aarch64/tuning_models/xgene1.h: Likewise. + * config/aarch64/aarch64-sched-dispatch.cc: New file for + dispatch scheduling for aarch64. + * config/aarch64/aarch64-sched-dispatch.h: New header file. + +2025-09-24 Jennifer Schmitz + + * config/aarch64/aarch64-sve.md: Annotate instructions with + attribute sve_type. + * config/aarch64/aarch64-sve2.md: Likewise. + * config/aarch64/aarch64.md (sve_type): New attribute sve_type. + * config/aarch64/iterators.md (sve_type_unspec): New int attribute. + (sve_type_int): New code attribute. + (sve_type_fp): New int attribute. + +2025-09-24 Richard Biener + + PR tree-optimization/116816 + * tree-vect-stmts.cc (get_load_store_type): Allow multi-lane + single-element interleaving to fall back to VMAT_ELEMENTWISE. + Fall back to VMAT_ELEMENTWISE when we cannot handle a load + permutation. + (vectorizable_load): Do not check a load permutation + for VMAT_ELEMENTWISE. Handle grouped loads with + VMAT_ELEMENTWISE and directly apply a load permutation. + +2025-09-24 Richard Biener + + * tree-vect-stmts.cc (get_load_store_type): Explicitly fail + when we end up with VMAT_ELEMENTWISE for BB vectorization. + +2025-09-24 Xi Ruoyao + + PR tree-optimization/122040 + * doc/invoke.texi (-fisolate-erroneous-paths-dereference): + Mention it also turns division by zero into a trap in addition + to null dereference. + +2025-09-24 Xi Ruoyao + + PR middle-end/66462 + * config/loongarch/loongarch.md (FCLASS_MASK): Add 3. + (fclass_optab): Assign isnan for 3. + (2): If FCLASS_MASK is 3, + only enable when -fsignaling-nans. + +2025-09-24 Pan Li + + * match.pd: Add pattern of mult and reuse the widen-mul + by for keyword. + +2025-09-23 David Malcolm + + PR diagnostics/121986 + * diagnostics/sarif-sink.cc: Include "intl.h". + (sarif_builder::make_message_describing_fix_it_hint): New. + (sarif_builder::make_fix_object): Attempt to auto-generate a + description for fix-it hints. + +2025-09-23 Richard Earnshaw + + PR target/121810 + * config/arm/mve.md (mve_mov): Move the Ui constraint + and pool_range attributes to the final alternative. Fix + the forward range value and correctly name the negative + range. + +2025-09-23 Pan Li + + PR middle-end/122031 + * tree-ssa-math-opts.cc (build_and_insert_cast): Fix the typo + of self assignment. + +2025-09-23 Alfie Richards + + * config/aarch64/aarch64.cc (aarch64_process_target_version_attr): + Remove warning. + * config/aarch64/aarch64.opt: Mark -Wno-experimental-fmv-target + deprecated. + * doc/invoke.texi: Ditto. + +2025-09-23 Alfie Richards + + * attribs.cc (is_function_default_version): Update to handle + target_clones. + * cgraph.h (FOR_EACH_FUNCTION_REMOVABLE): New macro. + * multiple_target.cc (expand_target_clones): Update logic to delete + empty target_clones and modify diagnostic. + (ipa_target_clone): Update to use FOR_EACH_FUNCTION_REMOVABLE. + +2025-09-23 Alfie Richards + + * attribs.h (common_function_versions): Removed. + * attribs.cc (common_function_versions): Removed. + * config/aarch64/aarch64.cc (aarch64_common_function_versions): Removed. + (aarch64_same_function_versions): New function to check if two version + strings imply the same version. + (TARGET_OPTION_FUNCTION_VERSIONS): Removed. + (TARGET_OPTION_SAME_FUNCTION_VERSIONS): New macro. + * config/i386/i386.cc (TARGET_OPTION_FUNCTION_VERSIONS): Removed. + * config/rs6000/rs6000.cc (TARGET_OPTION_FUNCTION_VERSIONS): Removed. + * config/riscv/riscv.cc (riscv_same_function_versions): New function + to check if two version strings imply the same version. + (riscv_common_function_versions): Removed. + (TARGET_OPTION_FUNCTION_VERSIONS): Removed. + (TARGET_OPTION_SAME_FUNCTION_VERSIONS): New macro. + * doc/tm.texi: Regenerated. + * target.def: Remove common_version hook and add same_function_version + hook. + * doc/tm.texi.in: Ditto. + * tree.cc (distinct_version_decls): New function. + (mergeable_version_decls): Ditto. + * tree.h (distinct_version_decls): New function. + (mergeable_version_decls): Ditto. + * hooks.h (hook_stringslice_stringslice_unreachable): New function. + * hooks.cc (hook_stringslice_stringslice_unreachable): New function. + +2025-09-23 Alfie Richards + + PR target/118313 + * cgraph.cc (delete_function_version): Made public static member of + cgraph_node. + * cgraph.h (delete_function_version): Ditto. + * cgraphunit.cc (analyze_functions): Add logic for target version + dependencies. + * ipa.cc (symbol_table::remove_unreachable_nodes): Ditto. + * multiple_target.cc (create_dispatcher_calls): Change to support + target version semantics. + (ipa_target_clone): Change to dispatch all function sets in + target_version semantics, and to have early and late pass. + (expand_target_clones): Add logic for cases of target_clones with no + defaults. + (is_simple_target_clones_case): New function. + (class pass_target_clone): New parameter for early or late pass. + * config/aarch64/aarch64.cc: (aarch64_get_function_versions_dispatcher): + Refactor with the assumption that the DECL node will be default. + * config/riscv/riscv.cc: (riscv_get_function_versions_dispatcher): + Refactor with the assumption that the DECL node will be default. + * passes.def: Split target_clones pass into early and late version. + +2025-09-23 Alfie Richards + + PR target/118339 + * target.def: Add check_target_clone_version hook. + * tree.cc (get_clone_attr_versions): Add filter argument. + (get_clone_versions): Add filter argument. + * tree.h (get_clone_attr_versions): Add filter. + (get_clone_versions): Add filter argument. + * config/aarch64/aarch64.cc (aarch64_check_target_clone_version): + New function + (TARGET_CHECK_TARGET_CLONE_VERSION): New define. + * config/riscv/riscv.cc (riscv_check_target_clone_version): + New function. + (TARGET_CHECK_TARGET_CLONE_VERSION): New define. + * doc/tm.texi: Regenerated. + * doc/tm.texi.in: Add documentation for new hook. + * hooks.h (hook_stringslice_locationtptr_true): New function. + * hooks.cc (hook_stringslice_locationtptr_true): New function. + +2025-09-23 Alfie Richards + + * config/riscv/riscv-protos.h (riscv_process_target_version_str): New function.. + * config/riscv/riscv-target-attr.cc (riscv_process_target_attr): Refactor to take + string_slice. + (riscv_process_target_version_str): New function. + * config/riscv/riscv.cc (parse_features_for_version): Refactor to take + string_slice. + (riscv_compare_version_priority): Ditto. + (dispatch_function_versions): Change to pass location. + +2025-09-23 Alfie Richards + + * attribs.cc (make_dispatcher_decl): Move duplicated cgraph logic into + this function and change to use targetm.mangle_decl_assembler_name for + mangling. + * cgraph.cc (cgraph_node::insert_new_function_version): Record + assembler_name. + * cgraph.h (struct cgraph_function_version_info): Add assembler_name. + (struct cgraph_node): Add dispatcher_resolver_function and + is_target_clone. + * config/aarch64/aarch64.cc (aarch64_parse_fmv_features): Change to + support string_slice. + (aarch64_process_target_version_attr): Ditto. + (get_feature_mask_for_version): Ditto. + (aarch64_mangle_decl_assembler_name): Add logic for mangling dispatched + symbol and resolver. + (get_suffixed_assembler_name): Removed. + (make_resolver_func): Refactor to use + aarch64_mangle_decl_assembler_name for mangling. + (aarch64_generate_version_dispatcher_body): Remove remangling. + (aarch64_get_function_versions_dispatcher): Refactor to remove + duplicated cgraph logic. + * config/i386/i386-features.cc + (ix86_mangle_function_version_assembler_name): Refactor to use + clone_identifier and to mangle default. + (ix86_mangle_decl_assembler_name): Add logic for mangling dispatched + symbol and resolver. + (ix86_get_function_versions_dispatcher): Remove duplicated cgraph + logic. + (make_resolver_func): Refactor to use ix86_mangle_decl_assembler_name + for mangling. + * config/riscv/riscv.cc (riscv_mangle_decl_assembler_name): Add logic + for FMV mangling. + (get_suffixed_assembler_name): Removed. + (make_resolver_func): Refactor to use riscv_mangle_decl_assembler_name + for mangling. + (riscv_generate_version_dispatcher_body): Remove unnecessary remangling. + (riscv_get_function_versions_dispatcher): Remove duplicated cgraph + logic. + * config/rs6000/rs6000.cc (rs6000_mangle_decl_assembler_name): New + function. + (rs6000_get_function_versions_dispatcher): Remove duplicated cgraph + logic. + (make_resolver_func): Refactor to use rs6000_mangle_decl_assembler_name + for mangling. + (rs6000_mangle_function_version_assembler_name): New function. + * multiple_target.cc (create_dispatcher_calls): Remove mangling code. + (get_attr_str): Removed. + (separate_attrs): Ditto. + (is_valid_asm_symbol): Removed. + (create_new_asm_name): Ditto. + (expand_target_clones): Refactor to use + targetm.mangle_decl_assembler_name for mangling and be more general. + * tree.cc (get_target_clone_attr_len): Removed. + * tree.h (get_target_clone_attr_len): Removed. + +2025-09-23 Alfie Richards + + * cgraph.h (clone_identifier): New function. + * cgraphclones.cc (clone_identifier): New function. + (clone_function_name): Refactored to use clone_identifier. + (is_valid_asm_symbol): New helper function. + +2025-09-23 liuhongt + + PR target/121994 + * config/i386/x86-tune-costs.h (znver2_cost): Set + vect_unroll_limit to 1. + (znver1_cost): Ditto. + * config/i386/i386.cc (ix86_vector_costs::add_stmt_cost): + Adjust count number for {AVX256,AVX512}_SPLIT_REGS. + +2025-09-22 Peter Bergner + + PR target/121982 + * config/riscv/tt-ascalon-d8.md (tt_ascalon_d8_vec_idiv_byte): New + define_insn_reservation. + +2025-09-22 Andrew Pinski + + PR tree-optimization/121762 + * builtins.cc (fold_builtin_constant_p): Make non-static. + * builtins.h (fold_builtin_constant_p): New declaration. + * gimple-fold.cc (gimple_fold_builtin_constant_p): New function. + (gimple_fold_builtin): Call gimple_fold_builtin_constant_p + for BUILT_IN_CONSTANT_P. + * tree-ssa-ccp.cc (pass_fold_builtins::execute): Set PROP_last_full_fold + on curr_properties. Remove handling of BUILT_IN_CONSTANT_P. + +2025-09-22 Gerald Pfeifer + + * doc/libgdiagnostics/index.rst: Drop broken reference to + `modindex`. + +2025-09-22 Pan Li + + PR middle-end/122021 + * tree-ssa-math-opts.cc (build_and_insert_cast): Add sign-extend + check before prop. + +2025-09-22 Richard Biener + + PR tree-optimization/122016 + * tree-ssa-sccvn.cc (vn_nary_simplify): Do not use the + simplified expression when it references abnormals. + +2025-09-22 Richard Biener + + PR tree-optimization/122023 + * tree-vect-patterns.cc (vect_recog_rotate_pattern): Disable + for rotates. + +2025-09-22 Dimitar Dimitrov + + PR target/116205 + * config/pru/pru-passes.cc (class pass_pru_tiabi_check): Make + this an IPA pass. + (chkp_type_has_function_pointer): Remove. + (check_type_tiabi_compatibility): New function. + (chk_function_decl): Rename. + (check_function_decl): Simplify. + (check_op_callback): Rework to use + check_type_tiabi_compatibility. + (pass_pru_tiabi_check::execute): Rework to scan all symbols and + gimple contents of all defined functions. + * config/pru/pru-passes.def (INSERT_PASS_AFTER): Move after + pass_ipa_auto_profile_offline. + * config/pru/pru-protos.h (make_pru_tiabi_check): New + declaration to mark as IPA pass. + (make_pru_minrt_check): Specify it is making a gimple pass. + * doc/invoke.texi: Document that bit-fields are now rejected for + TI ABI. + +2025-09-21 Andrew Pinski + + * tree-ssa-ccp.cc (optimize_unreachable): Don't check for forced labels. + +2025-09-21 Jan Hubicka + + * cgraphclones.cc (cgraph_node::create_version_clone): Recompute + calls_comdat_local + +2025-09-21 Jan Hubicka + + * cgraph.cc (cgraph_edge::maybe_hot_p): For AFDO profiles force + count to be non-zero. + +2025-09-21 Jan Hubicka + + * auto-profile.cc (autofdo_source_profile::read): Scale profile up to + profile_count::n_bits - 10. + +2025-09-21 Jan Hubicka + + * ipa-inline-transform.cc (clone_inlined_nodes): Add KEEP_OFFLINE_COPY + parameter. + (inline_call): Sanity check profile and if it is clearly broken do + not subtract profile from original function. + * ipa-inline.cc (recursive_inlining): Update. + * ipa-inline.h (clone_inlined_nodes): Update. + +2025-09-20 Jan Hubicka + + * doc/invoke.texi (--param max-devirt-targets) Document. + * ipa-devirt.cc (ipa_devirt): Implement muti-target + devirtualization. + * params.opt (max-devirt-targets): New parameter. + +2025-09-19 Alexandre Oliva + + * ira.cc (setup_reg_equiv): Retain function invariant + equivalences. + +2025-09-19 Andrew Pinski + + * tree-ssa-forwprop.cc (optimize_aggr_zeroprop): Take gimple* + instead of iterator. + (optimize_agr_copyprop): Likewise. + (simplify_builtin_call): Update call to optimize_aggr_zeroprop. + (pass_forwprop::execute): Update calls to optimize_aggr_zeroprop + and optimize_agr_copyprop. + +2025-09-19 Andrew Pinski + + * tree-ssa-forwprop.cc (optimize_aggr_zeroprop_1): Change return type + to void. + (optimize_aggr_zeroprop): Likewise. + (optimize_agr_copyprop_1): Likewise. + (optimize_agr_copyprop_arg): Likewise. + (optimize_agr_copyprop): Likewise. + (simplify_builtin_call): Handle update of the return type + of optimize_aggr_zeroprop. + (pass_forwprop::execute): Likewise and optimize_agr_copyprop. + +2025-09-19 Michael Eager + + PR target/118280 + * config/microblaze/iterators.md: New. + * config/microblaze/microblaze-protos.h: Add + microblaze_subword_address. + * config/microblaze/microblaze.cc: Ditto. + * config/microblaze/microblaze.md: constants: Add UNSPECV_CAS_BOOL, + UNSPECV_CAS_MEM, UNSPECV_CAS_VAL, UNSPECV_ATOMIC_FETCH_OP + type: add atomic + * config/microblaze/sync.md: Add atomic_fetch_si + atomic_test_and_set + +2025-09-19 Jan Hubicka + + * ipa-fnsummary.cc (estimate_edge_devirt_benefit): Handle speculative + edges correctly. + (estimate_edge_size_and_time): Even when not collecting hints, + devirtualization affects function size. + (estimate_calls_size_and_time): Do not use tables when devirtualization + is possible. + +2025-09-19 Jan Hubicka + + * cgraph.cc (cgraph_edge::make_direct): Do not ICE when there are + multiple speculations to comptaible targets + (cgraph_edge::combined_sreal_frequency): New member function. + * cgraph.h (cgraph_edge::combined_sreal_frequency): Declare. + * ipa-cp.cc (devirtualization_time_bonus): Return sreal; consider + profile. + (estimate_local_effects): Likewise. + +2025-09-19 Gaius Mulley + + PR modula2/121856 + * doc/gm2.texi (Compiler options): New item -fwideset. + +2025-09-19 Jeff Law + + PR target/121983 + * config/riscv/riscv.cc (riscv_macro_fusion_pair_p): Make sure + object is a REG before asking for its REGNO. Fix a trivial + whitespace nit. + +2025-09-19 Raphael Moreira Zinsly + + * config/riscv/riscv-v.cc + (shuffle_slide_patterns): Cover more permutations. + +2025-09-19 Jim Lin + + * config/riscv/riscv.cc (riscv_compute_frame_info): Remove the + dedicated calculation for RVE. + +2025-09-19 Jeff Law + + * config.gcc (riscv*); Add riscv-bclr-lowest-set-bit.o to extra_objs. + * config/riscv/riscv-bclr-lowest-set-bit.cc: New file. + * config/riscv/riscv-passes.def: Add new pass after combine. + * config/riscv/riscv-protos.h (make_pass_bclr_lowest_set_bit): Add + prototype. + * config/riscv/t-riscv: Add rules to build riscv-bclr-lowest-set-bit.o. + +2025-09-19 Richard Biener + + * tree-ssa-pre.cc (compute_antic_aux): Remove dead code. + +2025-09-19 Richard Biener + + * tree-vectorizer.h (_stmt_vec_info::store_count): Remove. + (DR_GROUP_STORE_COUNT): Likewise. + * tree-vect-stmts.cc (vect_transform_stmt): Remove non-SLP + path. + +2025-09-19 Richard Biener + + * tree-vectorizer.h (vect_get_num_copies): Remove unused + overload. Remove defaulted vectype argument and always + use the vector type of the SLP node. + * tree-vect-loop.cc (vect_reduction_update_partial_vector_usage): + Adjust. + (vectorizable_lane_reducing): Likewise. + (vect_transform_reduction): Likewise. + (vectorizable_nonlinear_induction): Likewise. + * tree-vect-stmts.cc (check_load_store_for_partial_vectors): + Likewise. + +2025-09-19 Richard Biener + + * tree-vectorizer.h (_slp_tree::vec_stmts_size): Remove. + (SLP_TREE_NUMBER_OF_VEC_STMTS): Likewise. + * tree-vect-loop.cc (vectorizable_reduction): Adjust. + (vect_transform_cycle_phi): Likewise. + (vect_transform_lc_phi): Likewise. + (vectorizable_recurr): Likewise. + (vectorizable_induction): Likewise. + (vectorizable_live_operation): Likewise. + * tree-vect-slp.cc (_slp_tree::_slp_tree): Do not set + SLP_TREE_NUMBER_OF_VEC_STMTS. + (vect_slp_analyze_node_operations_1): Likewise. + (vect_slp_analyze_node_operations): Likewise. + (vect_prologue_cost_for_slp): Adjust. + (vect_create_constant_vectors): Likewise. + (vect_get_slp_vect_def): Likewise. + (vect_transform_slp_perm_load_1): Likewise. + (vectorizable_slp_permutation_1): Likewise. + (vect_schedule_slp_node): Likewise. + (vectorize_slp_instance_root_stmt): Likewise. + * tree-vect-stmts.cc (vect_model_simple_cost): Likewise. + (vectorizable_bswap): Likewise. + (vectorizable_call): Likewise. + (vectorizable_conversion): Likewise. + (vectorizable_shift): Likewise. + (vectorizable_operation): Likewise. + (vectorizable_store): Likewise. + (vectorizable_load): Likewise. + (vectorizable_condition): Likewise. + (vectorizable_early_exit): Likewise. + +2025-09-18 David Malcolm + + * diagnostics/client-data-hooks.h (client_data_hooks::dump): New. + * diagnostics/context.cc (context::dump): Dump + m_client_data_hooks. + (client_data_hooks::dump): New. + * diagnostics/logical-locations.h + (logical_locations::manager::dump): New. + * diagnostics/selftest-logical-locations.cc: Include + "diagnostics/dumping.h". + (test_manager::dump): New. + * diagnostics/selftest-logical-locations.h (test_manager::dump): + New decl. + * libgdiagnostics.cc: Include "diagnostics/dumping.h". + (impl_logical_location_manager::dump): New. + * tree-logical-location.cc: Include "diagnostics/dumping.h". + (tree_logical_location_manager::dump): New. + * tree-logical-location.h (tree_logical_location_manager::dump): + New decl. + +2025-09-18 David Malcolm + + * diagnostics/paths-output.cc: Update for conversion of + location_aspect to enum class. + * diagnostics/source-printing.cc: Likewise. + * input.cc: Likewise. + * input.h: Likewise. + +2025-09-18 David Malcolm + + * diagnostics/buffering.cc: Drop include of "diagnostic.h". + * diagnostics/buffering.h: Likewise. + * diagnostics/context.h (diagnostics::metadata): Add forward decl. + * diagnostics/html-sink.cc: Drop include of "diagnostic.h". + * diagnostics/lazy-paths.cc: Likewise. + * diagnostics/macro-unwinding.cc: Likewise. + * diagnostics/macro-unwinding.h (diagnostics:diagnostic_info): Add + forward decl. + * diagnostics/option-classifier.h: Include + "diagnostics/option-id.h" and "diagnostics/kinds.h". + (diagnostics:diagnostic_info): Add forward decl. + * diagnostics/output-spec.cc: Drop include of "diagnostic.h". + * diagnostics/paths-output.cc: Likewise. + * diagnostics/paths.cc: Likewise. + * diagnostics/sarif-sink.cc: Likewise. + * diagnostics/selftest-context.cc: Likewise. + * diagnostics/selftest-paths.cc: Likewise. + * diagnostics/source-printing-options.h: Include + "rich-location.h". + * diagnostics/text-sink.cc: Drop include of "diagnostic.h". + +2025-09-18 Qing Zhao + + PR tree-optimization/121894 + * tree-sra.cc (scan_function): Set grp_assignment_write to 1 when + specially handle call to .DEFERRED_INIT. + +2025-09-18 Zhongyao Chen + + PR target/121910 + * config/riscv/riscv-vector-costs.cc (compute_estimated_lmul): + Return RVV_M8 when estimated lmul is too large. + +2025-09-18 Jakub Jelinek + + PR c++/121977 + * omp-low.cc (lower_omp_regimplify_operands_p): If maybe_lookup_decl + returns NULL, use maybe_lookup_decl_in_outer_ctx as fallback. + +2025-09-18 Karl Meakin + + * config/aarch64/aarch64-sme.md (@aarch64_sme_write_zt): New insn. + (aarch64_sme_lut_zt): Likewise. + * config/aarch64/aarch64-sve-builtins-shapes.cc (parse_type): New type format "%T". + (struct luti_lane_zt_base): New function shape. + (SHAPE): Likewise. + (struct write_zt_def): Likewise. + (struct write_lane_zt_def): Likewise. + * config/aarch64/aarch64-sve-builtins-shapes.h: New function shape. + * config/aarch64/aarch64-sve-builtins-sme.cc (class svluti_zt_impl): New function expander. + (class svwrite_zt_impl): Likewise. + (class svwrite_lane_zt_impl): Likewise. + (FUNCTION): Likewise + * config/aarch64/aarch64-sve-builtins-sme.def (svwrite_zt): New function shape. + (svwrite_lane_zt): Likewise. + (svluti4_zt): Likewise. + * config/aarch64/aarch64-sve-builtins-sme.h: New function base. + * config/aarch64/aarch64-sve-builtins.h: Mention the arrays of function_group_info by name. + +2025-09-18 Karl Meakin + + * config/aarch64/aarch64-c.cc (aarch64_update_cpp_builtins): Conditonally define + `__ARM_FEATURE_SME_LUTv2" macro. + * config/aarch64/aarch64-option-extensions.def (AARCH64_OPT_EXTENSION("sme-lutv2")): New + optional architecture extension. + * config/aarch64/aarch64.h (TARGET_SME_LUTv2): New macro. + * doc/invoke.texi: Document `+sme-lutv2` flag. + +2025-09-18 Pan Li + + * match.pd: Add pattern for SAT_MUL form 5. + * tree-ssa-math-opts.cc (math_opts_dom_walker::after_dom_children): + Try match pattern for IOR. + +2025-09-18 Jan Hubicka + + * ipa-cp.cc (update_counts_for_self_gen_clones): Do not update + call frequency for local profiles. + +2025-09-18 Richard Biener + + PR tree-optimization/87615 + * tree-ssa-sccvn.cc (vn_nary_op_insert_into): When inserting + a new predicate or location into an existing predicate list + make sure to not exceed 8 locations. Avoid copying things + when we later eventually throw them away. + (vn_nary_op_insert_pieces_predicated): Avoid expensive check + when not checking. + (dominated_by_p_w_unex): Apply the limit on a single successors + predecessor count consistently. + +2025-09-18 Tobias Burnus + Sandra Loosemore + + PR middle-end/121922 + * omp-general.cc (omp_dynamic_cond): Use 'unshare_expr' for + the user condition. + +2025-09-18 Richard Biener + + PR tree-optimization/121720 + * tree-ssa-pre.cc (bitmap_set_subtract_expressions): Add + flag to tell whether we should copy instead of prune the + value set. + (compute_antic_aux): Remove intersection of ANTIC_IN with + the old solution. When subtracting TMP_GEN from + ANTIC_OUT do not prune the value set when MAX was involved + in the ANTIC_OUT computation. + +2025-09-18 hongtao.liu + + * config/i386/x86-tune.def (X86_TUNE_AVX512_MOVE_BY_PIECES): + Remove SPR/GNR/DMR. + (X86_TUNE_AVX512_STORE_BY_PIECES): Ditto. + +2025-09-17 David Malcolm + + * sarif-replay.cc (set_defaults): Initialize + m_debug_physical_locations. + +2025-09-17 Andrew Pinski + + PR tree-optimization/121962 + * tree-ssa-forwprop.cc (same_for_assignment): New function. + (optimize_agr_copyprop_1): Use same_for_assignment to check for + nop copies. + (optimize_agr_copyprop): Likewise. + +2025-09-17 Andrew Pinski + + * tree-ssa-forwprop.cc (new_src_based_on_copy): An early out + if both are decls. + +2025-09-17 Andrew Pinski + + * tree-ssa-forwprop.cc (optimize_agr_copyprop_1): Split out + the case where `operand_equal_p (dest, src2)` is false into ... + (new_src_based_on_copy): This. New function. + (optimize_agr_copyprop_arg): Use new_src_based_on_copy + instead of operand_equal_p to find the new src. + +2025-09-17 Shreya Munnangi + + PR tree-optimization/58727 + * simplify-rtx.cc (simplify_context::simplify_binary_operation_1): + In (A & C1) | C2, if (C1|C2) results in a constant with a single bit + clear, then adjust C1 appropriately. + +2025-09-17 Eric Botcazou + + * tree-inline.cc (maybe_copy_this_notrap): New function. Also copy + the TREE_THIS_NOTRAP flag for parameters when the argument is a full + object and the parameter's type is self-referential. + (remap_gimple_op_r): Call maybe_copy_this_notrap. + (copy_tree_body_r): Likewise. + +2025-09-17 Pan Li + + * config/riscv/autovec-opt.md (*widen_first__vx_): + Add helper bridge pattern for vwaddu.vx combine. + (*widen___vx_): Add + new pattern to match vwaddu.vx combine. + * config/riscv/iterators.md: Add code attr to get extend CODE. + * config/riscv/vector-iterators.md: Add Dmode iterator for + widen. + +2025-09-16 Jakub Jelinek + + * doc/invoke.texi (Wimplicit-fallthrough=): Document that also C23 + provides a standard way to suppress the warning with [[fallthrough]];. + +2025-09-16 Takayuki 'January June' Suwa + + * config/xtensa/xtensa.cc (#include): + Add "addresses.h". + * config/xtensa/xtensa.h (REGNO_OK_FOR_BASE_P): + Simplify to just a call to GP_REG_P(). + (BASE_REG_P): Replace REGNO_OK_FOR_BASE_P() with the equivalent + call to regno_ok_for_base_p(). + +2025-09-16 Wilco Dijkstra + + PR middle-end/66462 + * config/aarch64/aarch64.md (isnan2): Add new expander. + +2025-09-16 Richard Biener + + * tree-vect-stmts.cc (get_load_store_type): Get in a flag + whether a SLP_TREE_LOAD_PERMUTATION on the node can be + code generated and use it. Fix the condition on using + strided gather/scatter to avoid dropping a meaningful + permutation. + (vectorizable_store): Adjust. + (vectorizable_load): Analyze the permutation early and + pass the result down to get_load_store_type. Fix the + condition on when we are allowed to elide a load permutation. + +2025-09-16 Jennifer Schmitz + + PR target/121602 + * config/aarch64/aarch64-sve-builtins.cc + (gimple_folder::fold_active_lanes_to): Add force_vector + statement. + +2025-09-16 Jiawei + + * config.gcc: Accept RISC-V profiles in `--with-arch`. + * config/riscv/arch-canonicalize: Add profile detection and + skip canonicalization for profiles. + +2025-09-16 Jiawei + + * common/config/riscv/riscv-common.cc (struct riscv_profiles): Add comments. + (RISCV_PROFILE): Removed. + * config/riscv/riscv-profiles.def: New file. + +2025-09-16 Dongyan Chen + + * config/riscv/riscv-ext.def: Imply zicsr. + +2025-09-16 liuhongt + + * config/i386/predicates.md (avx_vbroadcast128_operand): New + predicate. + * config/i386/sse.md (*avx_vbroadcastf128__perm): New + pre_reload splitter. + +2025-09-15 Alexandre Oliva + + * config/rs6000/vxworks.h (TARGET_CMODEL, SET_CMODEL): Define. + +2025-09-15 Alexandre Oliva + + * configure.ac: Adjust base register in linker test for large + TOC support. + * configure: Rebuild. + +2025-09-15 Pan Li + + * match.pd: Remove unnecessary cast of unsigned + SAT_MUL for widen-mul. + +2025-09-15 Pan Li + + * tree-ssa-math-opts.cc (build_and_insert_cast): Refine + the cast insert by check the rhs of val. + +2025-09-15 David Faust + + PR debug/121411 + PR debug/121903 + * ctfc.h (ctf_add_sou): Change size arg from size_t to uHWI. + * ctfc.cc (ctf_add_sou): Likewise. + +2025-09-15 Andrew Pinski + + PR tree-optimization/121751 + PR tree-optimization/121418 + PR tree-optimization/121417 + * tree-ssa-forwprop.cc (split_core_and_offset_size): New function. + (optimize_agr_copyprop_1): Allow for the same + address but different type accesses via a VCE. + +2025-09-15 Alex Coplan + + PR tree-optimization/121772 + * match.pd: Add type check to reduc(ctor) pattern. + +2025-09-15 Georg-Johann Lay + + * config/avr/avr-mcus.def: Add avr32eb14, avr32eb20, + avr32eb28, avr32eb32. + * doc/avr-mmcu.texi: Rebuild. + +2025-09-15 H.J. Lu + + PR target/121934 + * config/i386/i386-expand.cc (ix86_expand_set_or_cpymem): If a + single instruction can store or move the whole block of memory, + use vector instruction and don't align destination. + +2025-09-15 Xi Ruoyao + + PR target/121906 + * config/loongarch/loongarch.md (*bstrins__for_ior_mask): + Always create a new pseudo for the input register of the bstrins + instruction. + +2025-09-15 Jakub Jelinek + + PR middle-end/121904 + * tree.cc (get_range_pos_neg): Return 3 if arg doesn't have + scalar integral type. + * expr.cc (expand_expr_real_2) : Only choose between + sign and zero extension based on costs for scalar integral inner + types. + +2025-09-15 Stefan Schulze Frielinghaus + + PR middle-end/121391 + * gimplify.cc (gimplify_asm_expr): In case an asm operand is an + error node, bail out early. + +2025-09-14 Richard Biener + + PR lto/121935 + * ipa-free-lang-data.cc (find_decls_types_r): Visit DECL_ARGUMENTS + chain manually. + +2025-09-14 Richard Biener + + * tree-vectorizer.h (stmt_vec_info_type::permute_info_type): Add. + (vectorizable_slp_permutation): Declare. + * tree-vect-slp.cc (vectorizable_slp_permutation): Export. + (vect_slp_analyze_node_operations_1): Set permute_info_type + on permute nodes successfully analyzed. + (vect_schedule_slp_node): Dispatch to vect_transform_stmt + for all nodes. + * tree-vect-stmts.cc (vect_transform_stmt): Remove redundant + dump, handle permute_info_type. + +2025-09-14 Richard Biener + + * tree-vect-stmts.cc (get_load_store_type): Use VMAT_STRIDED_SLP + for negative stride accesses when VMAT_CONTIGUOUS_REVERSE + isn't applicable. + +2025-09-14 Richard Biener + + * tree-vectorizer.h (vect_load_store_data::n_perms): New. + * tree-vect-stmts.cc (vectorizable_load): Analyze + SLP_TREE_LOAD_PERMUTATION only once and remember n_perms. + Verify the transform-time n_perms against the value stored + during analysis. + +2025-09-13 Gerald Pfeifer + + * target.def (dtors_from_cxa_atexit): Properly mark up + __cxa_atexit as code. + * doc/tm.texi: Regenerate. + +2025-09-13 Stefan Schulze Frielinghaus + + PR rtl-optimization/121205 + * lra-constraints.cc (curr_insn_transform): Stop processing on + error. + +2025-09-13 Gerald Pfeifer + + * doc/invoke.texi (Optimize Options): Editorial changes around + -fprofile-partial-training. + +2025-09-12 Jeff Law + + * lra-constraints.cc (get_equiv): Bounds check before accessing + data in ira_reg_equiv. + +2025-09-12 Edwin Lu + + * match.pd: New NARROW_CLIP variant for SAT_TRUNC. + * tree-vect-patterns.cc (gimple_unsigned_integer_narrow_clip): + Add new decl for NARROW_CLIP. + (vect_recog_sat_trunc_pattern): Add NARROW_CLIP check. + +2025-09-12 David Malcolm + + PR diagnostics/120063 + * diagnostics/context.cc (context::execution_failed_p): Also treat + any kind::fatal errors as leading to failed execution. + * diagnostics/sarif-sink.cc (maybe_get_sarif_level): Handle + kind::fatal as SARIF level "error". + +2025-09-12 David Malcolm + + PR diagnostics/121876 + * diagnostics/buffering.cc (context::set_diagnostic_buffer): Add + early reject of the no-op case. + +2025-09-12 Nathaniel Shead + + PR c++/121865 + * ipa-free-lang-data.cc (find_decls_types_r): Don't walk into + DECL_CHAIN for any DECL. + +2025-09-12 Eric Botcazou + + * ipa-pure-const.cc (check_stmt): Minor formatting tweaks. + (pass_data_nothrow): Fix pasto in description. + +2025-09-12 Tamar Christina + + * internal-fn.def (VEC_TRUNC_ADD_HIGH): New. + * doc/generic.texi: Document it. + * optabs.def (vec_trunc_add_high): New. + * doc/md.texi: Document it. + * tree-vect-stmts.cc (vectorizable_early_exit): Use addhn if supported. + +2025-09-12 Tamar Christina + + * config/aarch64/aarch64-simd.md (vec_addh_narrow): New. + +2025-09-12 Tamar Christina + + * tree-vect-loop.cc (vect_analyze_loop_1): If the unroll pragma was set + mark it as handled. + * doc/extend.texi (pragma GCC unroll): Update documentation. + +2025-09-11 Trevor Gross + + * doc/libgcc.texi (Comparison functions): Document functions as + returning CMPtype. + +2025-09-11 Wilco Dijkstra + + PR middle-end/66462 + * config/aarch64/aarch64.md (isfinite2): Add new expander. + +2025-09-11 Matteo Nicoli + + PR tree-optimization/121595 + * match.pd (fabs(a + 0.0) -> fabs (a)): Optimization pattern limited to + the -fno-trapping-math case. + +2025-09-11 Xi Ruoyao + + * config/loongarch/sync.md (atomic_compare_and_swapti_scq): + Require LSX. Change the operands for the output, the memory, + and the expected value to LSX vector modes. Add a FCCmode + output to indicate if CAS has written the desired value into + memory. Use LSX to atomically load both words of the 16B value + in memory. + (atomic_compare_and_swapti): Pun the modes to satisify + the new atomic_compare_and_swapti_scq implementation. Read the + bool return value from the FCC instead of performing a + comparision. + +2025-09-11 Xi Ruoyao + + * config/loongarch/loongarch.cc (loongarch_print_operand): Call + reg_or_0_operand for checking the sanity of %t. + +2025-09-11 Richard Biener + + PR tree-optimization/121703 + * tree-vect-stmts.cc (vectorizable_store): Value-initialize ls. + (vectorizable_load): Likewise. + +2025-09-11 Tsukasa OI + + * config/riscv/riscv.cc (riscv_function_ok_for_sibcall): + Suppress cross calling convention sibcall optimization from + the vector calling convention variant. + +2025-09-11 Richard Biener + + PR tree-optimization/121829 + * cfgloopmanip.cc (create_preheader): Ensure we can insert + at the end of a preheader. + +2025-09-11 Richard Biener + + PR tree-optimization/121870 + * tree-ssa-propagate.cc + (substitute_and_fold_engine::substitute_and_fold): Skip + removed stmts from noreturn fixup. + +2025-09-11 Robin Dapp + + * config/riscv/bitmanip.md (*_cmp_3): + New min/max ifcvt pattern. + * config/riscv/iterators.md (minu): New iterator. + * config/riscv/riscv.cc (riscv_noce_conversion_profitable_p): + Remove riscv-specific adjustment. + +2025-09-11 Robin Dapp + + * ifcvt.cc (noce_convert_multiple_sets_1): Add use_cond_earliest + param. + (noce_convert_multiple_sets): Set use_cond_earliest. + (noce_process_if_block): Just use original cost. + (noce_find_if_block): Use insn_cost (jump_insn). + +2025-09-11 Kito Cheng + + * config/riscv/riscv-selftests.cc (riscv_run_selftests): Call + run_vectorize_related_mode_selftests. + (test_vectorize_related_mode): New function to test + vectorize_related_mode behavior. + (run_vectorize_related_mode_selftests): New function to run all + vectorize_related_mode tests. + (run_vectorize_related_mode_vla_selftests): New function to test + VLA modes. + (run_vectorize_related_mode_vls_rv64gcv_selftests): New function to + test VLS modes on rv64gcv. + (run_vectorize_related_mode_vls_rv32gc_zve32x_zvl256b_selftests): + New function to test VLS modes on rv32gc_zve32x_zvl256b. + (run_vectorize_related_mode_vls_selftests): New function to run all + VLS mode tests. + * config/riscv/riscv-v.cc (can_find_related_mode_p): Fix VLS type + handling by converting TARGET_MIN_VLEN from bits to bytes. + +2025-09-10 Georg-Johann Lay + + PR target/81540 + PR target/49857 + * common/config/avr/avr-common.cc: Disable -ftree-switch-conversion. + +2025-09-10 Takayuki 'January June' Suwa + + * config/xtensa/xtensa.h (TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P): + Change "Xtrnase" in the comment to "Xtensa". + +2025-09-10 Peter Bergner + + PR target/121878 + * config/riscv/tt-ascalon-d8.md (tt_ascalon_d8_vec_idiv_half): Test the + Selected Element Width (SEW) rather than the mode. + (tt_ascalon_d8_vec_idiv_single): Likewise. + (tt_ascalon_d8_vec_idiv_double): Likewise. + (tt_ascalon_d8_vec_float_divsqrt_half): Likewise. + (tt_ascalon_d8_vec_float_divsqrt_single): Likewise. + (tt_ascalon_d8_vec_float_divsqrt_double): Likewise. + +2025-09-10 Juergen Christ + + * tree-vect-loop.cc (vectorizable_live_operation_1): Fix + load/store bias handling. + +2025-09-10 Paul-Antoine Arras + + * config/riscv/autovec-opt.md (*vfwsub_wf_): New pattern to + combine float_extend + vec_duplicate + vfsub.vv into vfwsub.wf. + +2025-09-10 Jakub Jelinek + + PR middle-end/121828 + * gimple-lower-bitint.cc (gimple_lower_bitint): For REALPART_EXPR + consumed by store in the same bb and with REALPART_EXPR from + optimizable_arith_overflow, don't add REALPART_EXPR lhs to + the m_names bitmap only if the cast from IMAGPART_EXPR doesn't + appear in between the REALPART_EXPR and the store. + +2025-09-10 Jakub Jelinek + + PR middle-end/121831 + * expr.cc (raw_data_cst_read_str): New function. + (store_constructor) : Handle RAW_DATA_CST. + +2025-09-10 Juergen Christ + + * config/s390/s390.h (CLZ_DEFINED_VALUE_AT_ZERO): Adjust and + return 2. + (CTZ_DEFINED_VALUE_AT_ZERO): Return 2. + * config/s390/s390.md (clzsi2): Implement. + (ctzsi2): Implement. + +2025-09-10 Maximilian Immanuel Brandtner + + * config/s390/vector.md (*vec_extract_plus_zero_extend): + Fix define insn. + +2025-09-09 Andrew Stubbs + + * config/gcn/gcn-devices.def: Correct the Max ISA VGPRs counts for + GFX10 and GFX11 devices. + * config/gcn/gcn.cc (gcn_hsa_declare_function_name): Remove the wave64 + VGPR count fudge. + +2025-09-09 Andrew Stubbs + + * config/gcn/gcn.cc (gcn_expand_builtin_1): Enable the "mode" parameter + and ensure that "target" is a register for most of the builtins. + +2025-09-09 David Faust + + PR debug/121411 + * dwarf2ctf.cc (ctf_get_AT_data_member_location) Use AT_unsigned + when fetching AT_bit_offset and AT_data_member_location. Simplify. + (ctf_die_bitsize): Return unsigned HOST_WIDE_INT instead of + uint32_t. + (gen_ctf_base_type, gen_ctf_sou_type, gen_ctf_enumeration_type): + Adapt accordingly. + +2025-09-09 Paul-Antoine Arras + + * config/riscv/autovec-opt.md (*vfwsub_vf_): New pattern to + combine float_extend + vec_duplicate + vfwsub.vv into vfwsub.vf. + +2025-09-09 Jakub Jelinek + + PR c++/121678 + * tree.cc (staticp): Handle REALPART_EXPR and IMAGPART_EXPR. + +2025-09-09 Jonathan Wakely + + * doc/invoke.texi (Warning Options): Note that an option + enabled by -Wextra is for C and ObjC only. + +2025-09-09 Paul-Antoine Arras + + * config/riscv/autovec-opt.md (*vfwadd_wf_): New pattern to + combine float_extend + vec_duplicate + vfadd.vv into vfwadd.wf. + * config/riscv/vector.md + (@pred_single_widen__scalar): Swap and reorder + operands to match the RTL emitted by expand. + +2025-09-09 Kyrylo Tkachov + + Revert: + 2025-07-11 Kyrylo Tkachov + + * config/aarch64/aarch64-simd.md (*bcaxqdi4): New + define_insn_and_split. + +2025-09-09 Tamar Christina + + Revert: + 2025-09-08 Richard Biener + + PR tree-optimization/121829 + * tree-vect-loop-manip.cc (vect_remove_forwarder): New + function. + (slpeel_tree_duplicate_loop_to_edge_cfg): Use it. + +2025-09-09 H.J. Lu + + PR target/121861 + * config/i386/i386.cc (ix86_optab_supported_p): Drop + !flag_trapping_math check for floor_optab, ceil_optab and + btrunc_optab. + +2025-09-09 liuhongt + + * config/i386/i386-expand.cc (expand_vec_perm_vpermil): Extend + to handle V8SImode. + * config/i386/i386.cc (avx_vpermilp_parallel): Extend to + handle vector integer modes with same vector size and same + component size. + * config/i386/sse.md + (_vpermilp): Ditto. + (V48_AVX): New mode iterator. + (ssefltmodesuffix): Extend for V16SI/V8DI/V16SF/V8DF. + +2025-09-09 liuhongt + + * config/i386/i386.cc (ix86_vector_costs::add_stmt_cost): + Check permutation index for vec_perm, don't count it if we + know it's not a cross-lane permutation. + +2025-09-08 Richard Biener + + PR tree-optimization/107997 + PR tree-optimization/121844 + * tree-ssa-loop-ivopts.cc (allow_ip_end_pos_p): Do not allow + IP_END for latches ending with a control stmt. + (create_new_iv): Do not split the latch edge, instead assert + that's not necessary. + +2025-09-08 Paul-Antoine Arras + + * config/riscv/autovec-opt.md (*vfwadd_vf_): New pattern to + combine float_extend + vec_duplicate + vfwadd.vv into vfwadd.vf. + +2025-09-08 Anton Blanchard + + * config/riscv/riscv.cc (tt_ascalon_d8_tune_info): Increase branch_cost + from 3 to 4. + +2025-09-08 Richard Biener + + PR tree-optimization/121830 + * tree-vect-loop.cc (vect_analyze_scalar_cycles_1): Only + set STMT_VINFO_REDUC_DEF on reductions. + * tree-vect-slp.cc (vect_build_slp_tree_2): Identify reduction + PHIs by a set STMT_VINFO_REDUC_DEF instead of their def type. + +2025-09-08 Richard Biener + + PR tree-optimization/121829 + * tree-vect-loop-manip.cc (vect_remove_forwarder): New + function. + (slpeel_tree_duplicate_loop_to_edge_cfg): Use it. + +2025-09-08 Alex Coplan + + PR tree-optimization/114892 + * doc/invoke.texi (Developer Options): Document -folding option + for -fdump-tree-*. + +2025-09-08 Kugan Vivekanandarajah + + * ipa-cp.cc (gather_count_of_non_rec_edges): Check count + initialization before adding to total. + +2025-09-08 Paul-Antoine Arras + + * config/riscv/autovec-opt.md (*vfrsub_vf_): New pattern to + combine vec_duplicate + vfsub.vv into vfrsub.vf. + +2025-09-08 Paul-Antoine Arras + + * config/riscv/autovec-opt.md (*vfsub_vf_): New pattern to + combine vec_duplicate + vfsub.vv into vfsub.vf. + * config/riscv/vector.md (@pred__scalar): Allow VLS modes. + +2025-09-08 Paul-Antoine Arras + + * config/riscv/autovec-opt.md (*vfadd_vf_): New pattern to + combine vec_duplicate + vfadd.vv into vfadd.vf. + +2025-09-08 Paul-Antoine Arras + + * config/riscv/autovec-opt.md (*vfwmul_vf_): New pattern to + combine float_extend + vec_duplicate + vfmul.vv into vfmul.vf. + * config/riscv/vector.md (*@pred_dual_widen__scalar): + Swap operands to match the RTL emitted by expand, i.e. first + float_extend then vec_duplicate. + +2025-09-08 Paul-Antoine Arras + + * config/riscv/autovec-opt.md (*vfmin_vf_ieee_): Rename into... + (*v_vf_): New pattern to combine vec_duplicate + + vf{max,min}.vv (unspec) into vf{max,min}.vf. + +2025-09-08 Gerald Pfeifer + + * doc/extend.texi (SH Function Attributes): Remove reference to + GNU Binutils 2.7 requirement. + (H8/300 Variable Attributes): Ditto. + +2025-09-08 Andrew Pinski + + PR tree-optimization/87900 + * tree-ssa-strlen.cc (strlen_pass::handle_assign): Add RHS argument. + For empty constructor RHS, see if can combine with a previous malloc into + a calloc. + (strlen_pass::check_and_optimize_call): Update call to handle_assign; + passing NULL_TREE for RHS. + (strlen_pass::check_and_optimize_stmt): Update call to handle_assign. + +2025-09-08 Andrew Pinski + + PR tree-optimization/83022 + * tree-ssa-strlen.cc (last_stmt_ptr_check): New function. + (allow_memset_malloc_to_calloc): New function. + (strlen_pass::handle_builtin_memset): Check to see if it is a good + idea to do the malloc+memset->calloc optimization. + (printf_strlen_execute): Free post dom info. + +2025-09-08 Sam James + + * common.opt.urls: Regenerate. + 2025-09-07 Andrew Pinski PR tree-optimization/121841 diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 535d724e1543..6e95effb6d93 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20250908 +20251027 diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 4503dab60372..5c24a9aab00a 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -613,6 +613,8 @@ tm_d_file_list=@tm_d_file_list@ tm_d_include_list=@tm_d_include_list@ tm_rust_file_list=@tm_rust_file_list@ tm_rust_include_list=@tm_rust_include_list@ +tm_jit_file_list=@tm_jit_file_list@ +tm_jit_include_list=@tm_jit_include_list@ build_xm_file_list=@build_xm_file_list@ build_xm_include_list=@build_xm_include_list@ build_xm_defines=@build_xm_defines@ @@ -917,6 +919,7 @@ TCONFIG_H = tconfig.h $(xm_file_list) TM_P_H = tm_p.h $(tm_p_file_list) $(TREE_H) TM_D_H = tm_d.h $(tm_d_file_list) TM_RUST_H = tm_rust.h $(tm_rust_file_list) +TM_JIT_H = tm_jit.h $(tm_jit_file_list) GTM_H = tm.h $(tm_file_list) insn-constants.h TM_H = $(GTM_H) insn-flags.h $(OPTIONS_H) @@ -977,11 +980,13 @@ C_TARGET_DEF = c-family/c-target.def target-hooks-macros.h COMMON_TARGET_DEF = common/common-target.def target-hooks-macros.h D_TARGET_DEF = d/d-target.def target-hooks-macros.h RUST_TARGET_DEF = rust/rust-target.def target-hooks-macros.h +JIT_TARGET_DEF = jit/jit-target.def target-hooks-macros.h TARGET_H = $(TM_H) target.h $(TARGET_DEF) insn-modes.h insn-codes.h C_TARGET_H = c-family/c-target.h $(C_TARGET_DEF) COMMON_TARGET_H = common/common-target.h $(INPUT_H) $(COMMON_TARGET_DEF) D_TARGET_H = d/d-target.h $(D_TARGET_DEF) RUST_TARGET_H = rust/rust-target.h $(RUST_TARGET_DEF) +JIT_TARGET_H = jit/jit-target.h $(JIT_TARGET_DEF) MACHMODE_H = machmode.h mode-classes.def HOOKS_H = hooks.h HOSTHOOKS_DEF_H = hosthooks-def.h $(HOOKS_H) @@ -1297,6 +1302,9 @@ CXX_TARGET_OBJS=@cxx_target_objs@ # Target specific, D specific object file D_TARGET_OBJS=@d_target_objs@ +# Target specific, JIT specific object file +JIT_TARGET_OBJS=@jit_target_objs@ + # Target specific, Fortran specific object file FORTRAN_TARGET_OBJS=@fortran_target_objs@ @@ -1796,6 +1804,7 @@ OBJS = \ tree-ssa-strlen.o \ tree-ssa-structalias.o \ pta-andersen.o \ + gimple-ssa-pta-constraints.o \ tree-ssa-tail-merge.o \ tree-ssa-ter.o \ tree-ssa-threadbackward.o \ @@ -1844,6 +1853,7 @@ OBJS = \ web.o \ wide-int.o \ wide-int-print.o \ + attr-callback.o \ $(out_object_file) \ $(ANALYZER_OBJS) \ $(EXTRA_OBJS) \ @@ -1852,6 +1862,8 @@ OBJS = \ # Objects in libcommon.a, potentially used by all host binaries and with # no target dependencies. OBJS-libcommon = \ + custom-sarif-properties/digraphs.o \ + custom-sarif-properties/state-graphs.o \ diagnostic-global-context.o \ diagnostics/buffering.o \ diagnostics/changes.o \ @@ -1871,7 +1883,6 @@ OBJS-libcommon = \ diagnostics/paths.o \ diagnostics/paths-output.o \ diagnostics/source-printing.o \ - diagnostics/state-graphs.o \ diagnostics/state-graphs-to-dot.o \ diagnostics/selftest-context.o \ diagnostics/selftest-logical-locations.o \ @@ -1908,6 +1919,9 @@ OBJS-libcommon-target = $(common_out_object_file) prefix.o \ # This lists all host objects for the front ends. ALL_HOST_FRONTEND_OBJS = $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS)) +# All auto-profile files +ALL_FDAS = $(foreach v,$(CONFIG_LANGUAGES),$($(v)_FDAS)) + ALL_HOST_BACKEND_OBJS = $(GCC_OBJS) $(OBJS) $(OBJS-libcommon) \ $(OBJS-libcommon-target) main.o c-family/cppspec.o \ $(COLLECT2_OBJS) $(EXTRA_GCC_OBJS) $(GCOV_OBJS) $(GCOV_DUMP_OBJS) \ @@ -1918,8 +1932,8 @@ ALL_HOST_BACKEND_OBJS = $(GCC_OBJS) $(OBJS) $(OBJS-libcommon) \ # is likely the most exercised during the build ifeq ($(if $(wildcard ../stage_current),$(shell cat \ ../stage_current)),stageautofeedback) -$(ALL_HOST_BACKEND_OBJS): ALL_COMPILERFLAGS += -fauto-profile=cc1plus.fda -$(ALL_HOST_BACKEND_OBJS): cc1plus.fda +$(ALL_HOST_BACKEND_OBJS): ALL_COMPILERFLAGS += -fauto-profile=all.fda +$(ALL_HOST_BACKEND_OBJS): all.fda endif # This lists all host object files, whether they are included in this @@ -2102,6 +2116,7 @@ tm.h: cs-tm.h ; @true tm_p.h: cs-tm_p.h ; @true tm_d.h: cs-tm_d.h ; @true tm_rust.h: cs-tm_rust.h ; @true +tm_jit.h: cs-tm_jit.h ; @true cs-config.h: Makefile TARGET_CPU_DEFAULT="" \ @@ -2141,6 +2156,11 @@ cs-tm_rust.h: Makefile HEADERS="$(tm_rust_include_list)" DEFINES="" \ $(SHELL) $(srcdir)/mkconfig.sh tm_rust.h +cs-tm_jit.h: Makefile + TARGET_CPU_DEFAULT="" \ + HEADERS="$(tm_jit_include_list)" DEFINES="" \ + $(SHELL) $(srcdir)/mkconfig.sh tm_jit.h + # Don't automatically run autoconf, since configure.ac might be accidentally # newer than configure. Also, this writes into the source directory which # might be on a read-only file system. If configured for maintainer mode @@ -2608,6 +2628,12 @@ default-d.o: config/default-d.cc $(COMPILE) $< $(POSTCOMPILE) +# Files used by the JIT language front end. + +default-jit.o: config/default-jit.cc + $(COMPILE) $< + $(POSTCOMPILE) + # Files used by the Rust language front end. default-rust.o: config/default-rust.cc @@ -2960,6 +2986,15 @@ s-rust-target-hooks-def-h: build/genhooks$(build_exeext) rust/rust-target-hooks-def.h $(STAMP) s-rust-target-hooks-def-h +jit/jit-target-hooks-def.h: s-jit-target-hooks-def-h; @true + +s-jit-target-hooks-def-h: build/genhooks$(build_exeext) + $(RUN_GEN) build/genhooks$(build_exeext) "JIT Target Hook" \ + > tmp-jit-target-hooks-def.h + $(SHELL) $(srcdir)/../move-if-change tmp-jit-target-hooks-def.h \ + jit/jit-target-hooks-def.h + $(STAMP) s-jit-target-hooks-def-h + # check if someone mistakenly only changed tm.texi. # We use a different pathname here to avoid a circular dependency. s-tm-texi: $(srcdir)/doc/../doc/tm.texi @@ -3157,8 +3192,8 @@ s-gtype: $(EXTRA_GTYPE_DEPS) build/gengtype$(build_exeext) \ -r gtype.state $(STAMP) s-gtype -generated_files = config.h tm.h $(TM_P_H) $(TM_D_H) $(TM_H) multilib.h \ - $(simple_generated_h) specs.h \ +generated_files = config.h tm.h $(TM_P_H) $(TM_D_H) $(TM_JIT_H) $(TM_H) \ + multilib.h $(simple_generated_h) specs.h \ tree-check.h genrtl.h insn-modes.h insn-modes-inline.h \ tm-preds.h tm-constrs.h \ $(ALL_GTFILES_H) gtype-desc.cc gtype-desc.h version.h \ @@ -3169,6 +3204,7 @@ generated_files = config.h tm.h $(TM_P_H) $(TM_D_H) $(TM_H) multilib.h \ c-family/c-target-hooks-def.h d/d-target-hooks-def.h \ $(TM_RUST_H) rust/rust-target-hooks-def.h \ case-cfn-macros.h \ + jit/jit-target-hooks-def.h case-cfn-macros.h \ cfn-operators.pd omp-device-properties.h # @@ -3302,8 +3338,8 @@ build/genrecog.o : genrecog.cc $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H) \ $(HASH_TABLE_H) inchash.h build/genhooks.o : genhooks.cc $(TARGET_DEF) $(C_TARGET_DEF) \ - $(COMMON_TARGET_DEF) $(D_TARGET_DEF) $(RUST_TARGET_DEF) $(BCONFIG_H) \ - $(SYSTEM_H) errors.h + $(COMMON_TARGET_DEF) $(D_TARGET_DEF) $(RUST_TARGET_DEF) $(JIT_TARGET_DEF) \ + $(BCONFIG_H) $(SYSTEM_H) errors.h build/genmddump.o : genmddump.cc $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ $(CORETYPES_H) $(GTM_H) errors.h $(READ_MD_H) $(GENSUPPORT_H) build/genmatch.o : genmatch.cc $(BCONFIG_H) $(SYSTEM_H) $(CORETYPES_H) \ @@ -4744,6 +4780,9 @@ paranoia.o: $(srcdir)/../contrib/paranoia.cc $(CONFIG_H) $(SYSTEM_H) $(TREE_H) paranoia: paranoia.o real.o $(LIBIBERTY) g++ -o $@ paranoia.o real.o $(LIBIBERTY) +all.fda: $(ALL_FDAS) + $(PROFILE_MERGER) $(ALL_FDAS) --output_file all.fda -gcov_version 2 + # These exist for maintenance purposes. CTAGS=@CTAGS@ diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4 index 762e9490b6a8..e44fc5fb2ab6 100644 --- a/gcc/aclocal.m4 +++ b/gcc/aclocal.m4 @@ -69,6 +69,7 @@ m4_include([../ltversion.m4]) m4_include([../lt~obsolete.m4]) m4_include([../config/acx.m4]) m4_include([../config/cet.m4]) +m4_include([../config/clang-plugin.m4]) m4_include([../config/codeset.m4]) m4_include([../config/depstand.m4]) m4_include([../config/dfp.m4]) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 063d6a73db8b..e6dbda6646a5 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,1724 @@ +2025-10-26 Eric Botcazou + + PR ada/13370 + * sem_prag.adb (Analyze_Pragma) : Set the + Has_Delayed_Freeze flag if the argument is not a literal. + +2025-10-24 Eric Botcazou + + PR ada/80033 + * gcc-interface/Makefile.in (force): Restore. + +2025-10-24 Nicolas Boulenguez + + PR ada/80033 + * gcc-interface/Makefile.in (deftarg.o): Delete. + (init-vxsim.o): Likewise. + (force): Likewise. + +2025-10-24 Mivirl + + PR ada/122367 + * rtinit.c (__gnat_runtime_initialize) [__MINGW32__]: Fix detection + of quoted arguments. + +2025-10-24 Eric Botcazou + + PR ada/118782 + * styleg.adb (Is_Box_Comment): Also stop the loop at EOF. + +2025-10-24 Eric Botcazou + + PR ada/113516 + * s-oscons-tmplt.c [_WIN32]: Undefine POLLPRI before redefining it. + +2025-10-24 Eric Botcazou + + PR ada/98879 + * terminals.c (__gnat_setup_child_communication) [_WIN32]: Add else + blocks in the processing of the data returned by ReadFile. + +2025-10-24 Nicolas Boulenguez + + PR ada/81087 + * gnatlink.adb (Is_Prefix): Move around, streamline and return false + when the prefix is not strict. + (Gnatlink): Fix other instances of incorrect lower bound assumption. + +2025-10-20 Eric Botcazou + + PR ada/102078 + * affinity.c (__gnat_set_affinity_mask): Add U qualifier. + +2025-10-20 Eric Botcazou + + PR ada/32318 + * libgnat/g-catiio.adb (Image_Helper) <'c'>: Fix comment. + +2025-10-20 Eric Botcazou + + PR ada/68179 + * exp_ch3.adb (Expand_Freeze_Array_Type): Build an initialization + procedure for a type derived from String declared with the aspect + Default_Aspect_Component_Value. + +2025-10-20 Eric Botcazou + + PR ada/52319 + * sem_ch7.adb (Uninstall_Declarations): Use direct test on Nkind + to spot operators. + * sem_ch8.adb (End_Use_Package): Also test the Etype of operators + to spot those which are primitive operators of use-visible types. + +2025-10-20 Nicolas Boulenguez + + PR ada/87777 + * gnatchop.adb: Add with clause for Osint. + (Locate_Executable): Delete. + (Gnatchop): Use Osint.Program_Name and Locate_Exec_On_Path instead + of Locate_Executable to locate GCC's driver executable. + +2025-10-20 Eric Botcazou + + PR ada/107536 + * exp_ch2.adb (Expand_Renaming): Mark the entity as referenced. + +2025-10-17 Eric Botcazou + + PR ada/122295 + * sem_ch12.adb (Analyze_Package_Instantiation): Force Style_Check + to False only after possibly installing the parent. + * aspects.adb (UAD_Pragma_Map): Fix style violation. + * inline.adb (To_Pending_Instantiations): Likewise. + * lib.ads (Unit_Names): Likewise. + * repinfo.adb (Relevant_Entities): Likewise. + * sem_ch7.adb (Subprogram_Table): Likewise. + (Traversed_Table): Likewise. + * sem_util.adb (Interval_Sorting): Likewise. + +2025-10-07 Eric Botcazou + + Revert: + 2025-10-05 Eric Botcazou + + PR ada/118343 + * Makefile.rtl (LLVM_BUILD): Delete. + +2025-10-06 Marc Poulhiès + Éric Botcazou + + * gcc-interface/decl.cc (get_extended_unconstrained_array): Handle + array subtype. + +2025-10-06 Eric Botcazou + + * gcc-interface/utils.cc (convert): Also extract the _Parent field + to implement upcasting in the case where only the sizes match. + +2025-10-06 Marc Poulhiès + + * gcc-interface/trans.cc (Attribute_to_gnu): Handle + extended access. + +2025-10-06 Ronan Desplanques + + * fmap.adb (File_Mapping, Path_Mapping): Fix instantiations. + (Add_To_File_Map): Use Table.Table.Append. + +2025-10-06 Ronan Desplanques + + * fmap.ads (Add_Forbidden_File_Name): Remove obsolete code. + * fmap.adb (Forbidden_Names, Add_Forbidden_File_Name, + Mapped_Path_Name, Reset_Tables): Remove obsolete code. + +2025-10-06 Tonu Naks + + * doc/gnat_ugn/building_executable_programs_with_gnat.rst: refine + description of -gnatwr + * gnat_ugn.texi: Regenerate. + +2025-10-05 Franck Behaghel + + PR ada/110314 + * sem_ch4.adb (Analyze_Allocator): Add call to New_Copy_Tree. + +2025-10-05 Eric Botcazou + + PR ada/112446 + * usage.adb (Usage): Add 'z' to the list of 'g' style. + +2025-10-05 Eric Botcazou + + PR ada/118343 + * Makefile.rtl (LLVM_BUILD): Delete. + +2025-10-04 Eric Botcazou + + PR ada/64869 + * sem_ch7.adb (Install_Private_Declarations): Also propagate the + Current_Use_Clause from partial to full view. + (Uninstall_Declarations): Extend implementation of RM 8.4(8.1/3) + subclause to all primitive subprograms. + +2025-09-30 Eric Botcazou + + PR ada/117517 + * sem_attr.adb (Resolve_Attribute) : Try to + resolve the reducer first. Fix casing of error message. + +2025-09-29 Tonu Naks + + * doc/gnat_rm/implementation_advice.rst: PolyORB + * doc/gnat_rm/implementation_defined_characteristics.rst: PolyORB + * doc/gnat_rm/implementation_defined_pragmas.rst: ASIS + * doc/gnat_rm/obsolescent_features.rst: PolyORB + * doc/gnat_rm/specialized_needs_annexes.rst: PolyORB + * doc/gnat_rm/the_gnat_library.rst: PolyORB + * doc/gnat_ugn/building_executable_programs_with_gnat.rst: ASIS + * gnat_rm.texi: Regenerate. + * gnat_ugn.texi: Regenerate. + +2025-09-29 Piotr Trojanek + + * sem_prag.adb (Analyze_Pre_Post_Condition): Handle contracts on + generic formal subprograms like on declarations of access-to-subprogram + types. + +2025-09-29 Piotr Trojanek + + * exp_util.adb (Attribute_Constrained_Static_Value): Special case + stand-alone objects for GNATprove. + +2025-09-29 Ronan Desplanques + + * sem_ch3.adb (Process_Full_View): Fix error message. + +2025-09-29 Javier Miranda + + * aspects.adb (Get_Aspect_Id): Return No_Aspect for Unsigned_Base_Range + name. + * sem_prag.adb (Analyze_Pragma): Disable pragma Unsigned_Base_Range. + * par-ch4.adb (Scan_Apostrophe): Disable attribute Unsigned_Base_Range. + * doc/gnat_rm/gnat_language_extensions.rst: Remove documentation + of aspect unsigned base range. + * gnat_rm.texi: Regenerate. + +2025-09-29 Ghjuvan Lacambre + + * exp_ch6.adb (Validate_Subprogram_Calls): Do not Check_Calls in CodePeer_Mode. + (Check_Calls): Remove CodePeer_Mode special case. + +2025-09-29 Viljar Indus + + * doc/gnat_rm/implementation_defined_pragmas.rst: update + rules for pragmas affected by assertion levels. + * gnat_rm.texi: Regenerate. + +2025-09-29 Viljar Indus + + * ghost.adb (Check_Procedure_Call_Policies): Update the check + between the levels of the argument and the call. + +2025-09-23 Bob Duff + + * exp_ch6.adb (Prepend_Constructor_Procedure_Prologue): + Push/Pop the procedure scope, so that temps created herein + get the right Scope. + +2025-09-23 Jose Ruiz + + * libgnarl/s-stusta.adb (Report_Impl): Export a copy of + the current stack usage while holding the runtime lock. + (Report_For_Task): Do not compute stack usage for a task + that has not yet initialized its stack with the expected + pattern. + (Report_For_Task): The Stack_Analyzer object for the + environment task is not part of its ATCB. For the rest of + the tasks wait until we have initialized the stack pattern + before computing stack usage. + (Report_All_Tasks, Get_All_Tasks_Usage, + Get_Current_Task_Usage): Adapt to the new interface from + Report_Impl. Take into account that Result_Array can be + null. When we don't store stack results for a task we + need to compute it when requested. + (Print): Handle the case when we don't know the stack + usage to be reported. + * libgnat/s-stausa.adb (Initialize): For the environment + task, approximate the stack origin with the topmost + stack address that is known. + * libgnat/s-stausa.ads: Clarify comments. + +2025-09-23 Denis Mazzucato + + * sem_util.adb (Ultimate_Prefix): Clean-up the loop condition by using + Has_prefix instead of an explicit list of node kinds. + +2025-09-23 Denis Mazzucato + + * sem_ch10.adb (Install_Siblings): Fix condition to emit warning. + +2025-09-23 Viljar Indus + + * sem_case.adb (Is_Case_Choice_Pattern): Return False for allocators. + +2025-09-23 Douglas B Rupp + + * libgnat/system-vxworks7-aarch64-rtp-smp.ads (Linker_Options): + Remove pragma for RTP specs. + * libgnat/system-vxworks7-ppc-rtp-smp.ads: Likewise. + * libgnat/system-vxworks7-ppc64-rtp-smp.ads: Likewise. + * libgnat/system-vxworks7-x86-rtp-smp.ads: Likewise. + * libgnat/system-vxworks7-x86_64-rtp-smp.ads: Likewise. + +2025-09-23 Gary Dismukes + + * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Add doc + for addition of -gnateG options b, c, and e. + * doc/gnat_ugn/the_gnat_compilation_model.rst: Add doc for "-e" optionn + on gnatprep and integrated preprocessing. Add doc for addition of + -gnateG options b, c, and e. + * gprep.adb (Scan_Command_Line): Add 'e' to the list of allowed switch + letters in the string passed to GNAT.Command_Line.Getopt. Set the flag + Opt.Empty_Comment_Deleted_Lines to True when the "-e" switch is found. + (Usage): Output a switch description for the "-e" switch. + * opt.ads: Add new flag variable Empty_Comment_Deleted_Lines. Add + "GNAT" to the "GNATPREP" comment line for Comment_Deleted_Lines. + * prep.adb (Output_Line): Add handling for Empty_Comment_Deleted_Lines, + outputting comment lines consisting of "--!" for lines that are removed + in the preprocessed source file when Empty_Comment_Deleted_Lines is True. + * prepcomp.adb (Preproc_Data): Add Empty_Comments component (defaulting + to False). + (No_Preproc_Data): Add association for Empty_Comments component. + (Parse_Preprocessing_Data_File): Add handling for new switch -e. + (Prepare_To_Preprocess): Add logic for setting the new option + Empty_Comment_Deleted_Lines (and making it the default for + integrated preprocessing in the absence of other switches). + * switch-c.adb (Scan_Front_End_Switches): Add support adding a single + character 'b', 'c', 'e' to the "-gnateG" switch, to select any of the + three options for replacing deleted lines in preprocessing output file. + * usage.adb: Update usage info for -gnateG, to reflect the option of + appending b, c, or e to the switch. + * gnat_ugn.texi: Regenerate. + +2025-09-23 Piotr Trojanek + + * sprint.adb (Sprint_Node_Actual): Print finally statements, if + present. + +2025-09-23 Javier Miranda + + * sem_util.adb (Is_Partially_Initialized_Type): Return False + for record types with no components. + +2025-09-23 Steve Baird + + * doc/gnat_rm/implementation_defined_aspects.rst: Document the + Extended_Access aspect. + * gnat_rm.texi: Regenerate. + * gnat_ugn.texi: Regenerate. + +2025-09-22 Eric Botcazou + + PR ada/121968 + * sem_ch12.adb (Associations.Find_Assoc): Add guard for clauses. + * sem_dim.adb (Analyze_Dimension_Array_Aggregate): Add test for + N_Iterated_Component_Association nodes. + +2025-09-19 Eric Botcazou + + * gcc-interface/gigi.h (create_var_decl): Add LINKONCE_FLAG boolean + parameter. + (create_subprog_decl): Likewise. + * gcc-interface/decl.cc (gnat_to_gnu_entity): Adjust calls to + create_var_decl and create_subprog_decl. + (elaborate_expression_1): Likewise. + * gcc-interface/trans.cc (gigi): Likewise. + (build_raise_check): Likewise. + (Subprogram_Body_to_gnu): Likewise. + (create_temporary): Likewise. + (Exception_Handler_to_gnu): Likewise. + (Compilation_Unit_to_gnu): Likewise. + (gnat_to_gnu): Likewise. + (use_alias_for_thunk_p): Return false for a one-only target. + * gcc-interface/utils.cc (maybe_pad_type): Adjust call to + create_var_decl. + (create_var_decl): Add LINKONCE_FLAG boolean parameter. + (create_subprog_decl): Likewise. + +2025-09-19 Marc Poulhiès + + * gcc-interface/ada-tree.h (TYPE_EXTENDED_POINTER_P): New. + (TYPE_IS_EXTENDED_POINTER_P): New. + (TYPE_EXTENDED_UNCONSTRAINED_ARRAY): New. + (SET_TYPE_EXTENDED_UNCONSTRAINED_ARRAY): New. + (TYPE_DUMMY_EXT_POINTER_TO): New. + (SET_TYPE_DUMMY_EXT_POINTER_TO): New. + * gcc-interface/decl.cc (get_extended_unconstrained_array): New. + (gnat_to_gnu_entity): Handle extended access type. + (get_unpadded_extended_type): New. + (gnat_to_gnu_component_type): Handle extended access type. + (build_template_type): New. + (gnat_to_gnu_field): Handle extended access type. + (validate_size): Likewise. + (set_rm_size): Likewise. + (copy_and_substitute_in_layout): Likewise. + (rm_size): Likewise. + * gcc-interface/gigi.h (get_unpadded_extended_type): New. + (build_template_type): New. + (build_dummy_unc_pointer_types_ext): New. + (finish_extended_pointer_type): New. + (build_unc_object_type_from_ptr): Rename first parameter. + * gcc-interface/misc.cc (gnat_print_type): Handle extended access type. + * gcc-interface/trans.cc (Identifier_to_gnu): Likewise. + (Attribute_to_gnu): Likewise. + (gnat_to_gnu): Likewise. + * gcc-interface/utils.cc (convert_to_fat_pointer): Assert if converting an + extended pointer. + (build_dummy_unc_pointer_types_ext): New. + (finish_extended_pointer_type): New. + (finish_record_type): Handle extended access type. + (build_unc_object_type_from_ptr): Likewise. + (convert_to_extended_pointer): New. + (convert): Handle extended access type. + (gnat_pushdecl): Likewise. + (maybe_pad_type): Likewise. + * gcc-interface/utils2.cc (build_unary_op): Likewise. + (build_binary_op): Likewise. + (build_allocator): Likewise. + (gnat_save_expr): Likewise. + (gnat_protect_expr): Likewise. + (gnat_stabilize_reference_1): Likewise. + +2025-09-19 Eric Botcazou + + * sem_ch4.adb (Analyze_Selected_Component): Bail out if the prefix + has Void_Type. + +2025-09-19 Piotr Trojanek + + * sem_ch4.adb (Analyze_User_Defined_Binary_Op): Remove declare block. + +2025-09-19 Eric Botcazou + + * doc/gnat_rm/gnat_language_extensions.rst (Structural Generic + Instantiation): New entry + * einfo.ads (Is_Link_Once): New flag defined in entities. + * sinfo.ads (Is_Structural): New flag defined in instantiations. + * gen_il-fields.ads (Opt_Field_Enum): Add Is_Link_Once and + Is_Structural. + * gen_il-gen-gen_entities.adb (Entity_Kind): Add Is_Link_Once + semantic flag. + * gen_il-gen-gen_nodes.adb (N_Generic_Instantiation): Move up + Parent_Spec field and add Is_Structural semantic flag. + * frontend.adb: Add with clause for Sem_Ch12. + (Frontend): After analysis is complete and bodies are instantiated, + call Sem_Ch12.Mark_Link_Once on the declarations of the main unit. + * par.adb (P_Qualified_Simple_Name): Delete. + (P_Qualified_Simple_Name_Resync): Likewise + (P_Exception_Name): New function declaration. + (P_Label_Name): Likewise. + (P_Loop_Name): Likewise. + (P_Generic_Unit_Name): Likewise. + (P_Library_Unit_Name): Likewise. + (P_Package_Name): Likewise. + (P_Parent_Unit_Name): Likewise. + (P_Subtype_Name): Likewise. + (P_Subtype_Name_Resync): Likewise. + * par-ch3.adb (P_Subtype_Mark_Resync): Replace call to + P_Qualified_Simple_Name_Resync by P_Subtype_Name_Resync. + (P_Identifier_Declarations): Replace call to + P_Qualified_Simple_Name_Resync by P_Exception_Name. + (P_Derived_Type_Def_Or_Private_Ext_Decl): Replace call to + P_Qualified_Simple_Name by P_Subtype_Name. + (P_Interface_Type_Definition): Replace calls to + P_Qualified_Simple_Name by P_Subtype_Name. + * par-ch4.adb (P_Reduction_Attribute_Reference): Move around and + change name of parameter. + (P_Name): Document new grammar rule and make a couple of tweaks. + (P_Exception_Name): New function. + (P_Label_Name): Likewise. + (P_Loop_Name): Likewise. + (P_Generic_Unit_Name): Likewise. + (P_Library_Unit_Name): Likewise. + (P_Package_Name): Likewise. + (P_Parent_Unit_Name): Likewise. + (P_Subtype_Name): Likewise. + (P_Subtype_Name_Resync): Likewise. + (P_Qualified_Simple_Name): Rename into... + (P_Simple_Name): ...this. + (P_Qualified_Simple_Name_Resync): Rename into... + (P_Simple_Name_Resync): ...this. Accept left parenthesis and + dot as name extensions. + (P_Allocator): Replace call to P_Qualified_Simple_Name_Resync + by P_Subtype_Name_Resync. + * par-ch5.adb (P_Goto_Statement): Replace call to + P_Qualified_Simple_Name by P_Label_Name. + (Parse_Loop_Flow_Statement): Replace call to + P_Qualified_Simple_Name by P_Loop_Name. + * par-ch6.adb (P_Subprogram): Replace call to + P_Qualified_Simple_Name by P_Generic_Unit_Name. + * par-ch7.adb (P_Package): Replace calls to + P_Qualified_Simple_Name by P_Package_Name and P_Generic_Unit_Name. + * par-ch8.adb (P_Use_Package_Clause): Replace calls to + P_Qualified_Simple_Name by P_Package_Name. + * par-ch9.adb (P_Task): Replace call to + P_Qualified_Simple_Name by P_Subtype_Name. + (P_Protected): Likewise. + * par-ch10.adb (P_Context_Clause): Replace call to + P_Qualified_Simple_Name by P_Library_Unit_Name. + (P_Subunit): Replace call to P_Qualified_Simple_Name by + P_Parent_Unit_Name. + * par-ch12.adb (P_Generic): Replace call to + P_Qualified_Simple_Name by P_Generic_Unit_Name. + (P_Formal_Derived_Type_Definition): Replace call to + P_Qualified_Simple_Name by P_Subtype_Name. + (P_Formal_Package_Declaration): Replace call to + P_Qualified_Simple_Name by P_Generic_Unit_Name. + * sem_ch4.adb: Add with and use clauses for Sem_Ch12. + (Analyze_Call): Accept implicit instantiations with -gnatX0. + (Analyze_Indexed_Component_Form): Likewise. + * sem_ch8.adb (Analyze_Use_Package): Add guard before inserting + a with clause automatically when there is a use clause. + (Check_In_Previous_With_Clause): Retrieve original names. + (Check_Library_Unit_Renaming): Deal with structural instances. + (End_Use_Type): Minor tweak. + * sem_ch10.adb (Analyze_With_Clause): Remove useless test and + call Defining_Entity_Of_Instance. + * sem_ch12.ads (Build_Structural_Instantiation): New function. + (Mark_Link_Once): New procedure. + * sem_ch12.adb: Add with and use clauses for Exp_Dbug. + (Analyze_Associations): Add support for structural instantiations. + (Analyze_Package_Instantiation): Likewise. + (Analyze_Subprogram_Instantiation): Likewise. + (Analyze_Structural_Associations): New procedure. + (Need_Subprogram_Instance_Body): Return True for instantiation is + in the auxiliary declarations of the main unit. + (Build_Structural_Instantiation): New function. + (Mark_Link_Once): New procedure. + * sem_util.ads (Add_Local_Declaration): New procedure. + (Defining_Entity_Of_Instance): New function. + * sem_util.adb (Add_Local_Declaration): New procedure. + (Defining_Entity_Of_Instance): New function. + * gnat_rm.texi: Regenerate. + * gnat_ugn.texi: Regenerate. + +2025-09-19 Ronan Desplanques + + * aspects.ads: Fix comment. + +2025-09-19 Ronan Desplanques + + * aspects.ads: Remove comment. + +2025-09-19 Marc Poulhiès + + * libgnat/s-putima.ads (Ext_Access_Pointer): New. + (Put_Image_Extended_Access_Pointer): New. + * libgnat/s-putima.adb (Ext_Acc_Instance): New. + (Put_Image_Extended_Access_Pointer): New. + * rtsfind.ads (RE_Id, RE_Unit_Table): Set value for + RE_Put_Image_Extended_Access_Pointer. + * exp_put_image.adb (Build_Elementary_Put_Image_Call): Handle extended + access. + +2025-09-19 Marc Poulhiès + + * fe.h (Is_Extended_Access_Type): Add C bindings. + * sem_util.ads (Is_Extended_Access_Type): Add comment that any + change to the function must take care of the C binding. + +2025-09-19 Marc Poulhiès + + * layout.adb (Layout_Type): Adjust comment and code extended + accesses. + +2025-09-19 Ronan Desplanques + + * sem_ch3.adb (Add_Tag): Remove superfluous statements. + +2025-09-19 Steve Baird + + * exp_attr.adb (Interunit_Ref_OK): Treat a subunit like a body. + (Build_And_Insert_Type_Attr_Subp): When climbing up the + tree, go from an N_Subunit node to its stub (instead of to the + subunit's N_Compilation_Unit node). + +2025-09-19 Gary Dismukes + + * sem_attr.adb (Eval_Attribute): In the case of a VADS-specific + size attribute, only fold to the object size when the Esize field + is known. + +2025-09-16 Ronan Desplanques + + * exp_strm.ads (Get_Primitives): New function. + * exp_strm.adb (Get_Primitives): Likewise. + (Build_Elementary_Input_Call, Build_Elementary_Write_Call): use + Get_Primitives. + (Has_Stream_Standard_Rep): Add formal parameter and rename to... + (Is_Stream_Standard_Rep): New function. + * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Fix error + emission. + +2025-09-16 Gary Dismukes + + Revert: + 2025-09-15 Gary Dismukes + + * exp_ch6.ads (Make_Build_In_Place_Call_In_Allocator): Simplify comment. + * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Remove obsolete + comment about not being able to allocate fixed-size controlled results + on the caller side, and replace another obsolete comment with a simpler + comment. Call Build_Allocate_Deallocate_Proc when the function doesn't + need a BIPalloc formal to ensure that function results with controlled + parts allocated on the caller side will be chained for finalization. + (Make_Build_In_Place_Call_In_Object_Declaration): Call Needs_BIP_Collection + on the function's Entity_Id rather than the function call. + (Needs_BIP_Collection): If a BIP function doesn't need a BIPalloc formal + then it doesn't need a BIP collection either; return False in that case. + (Needs_BIP_Alloc_Form): Remove test of Needs_BIP_Collection. + * exp_ch7.adb (Expand_Cleanup_Actions): Move test of Uses_Sec_Stack + to be the first conjunct in setting of Needs_Sec_Stack_Mark, and put + the other tests in a disjunction subsidiary to that. Improve preceding + comment. + +2025-09-16 Iain Sandoe + + PR ada/114065 + * libgnarl/s-osinte__darwin.adb: Add and reference clause + for Interfaces.C, remove clause for Interfaces.C.Extensions. + +2025-09-15 Eric Botcazou + + PR ada/114065 + PR ada/121953 + * Makefile.rtl (LIBGNAT_TARGET_PAIRS) [x32-linux]: Replace + libgnarl/s-osinte__x32.adb with libgnarl/s-osinte__posix.adb. + * libgnarl/s-osinte__x32.adb: Delete. + +2025-09-15 Eric Botcazou + + * gcc-interface/trans.cc (gnat_to_gnu) + : Deal with objects whose elaboration + is deferred. + (process_freeze_entity): Deal with renamed objects whose elaboration + is deferred. + +2025-09-15 Gary Dismukes + + * exp_ch6.ads (Make_Build_In_Place_Call_In_Allocator): Simplify comment. + * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Remove obsolete + comment about not being able to allocate fixed-size controlled results + on the caller side, and replace another obsolete comment with a simpler + comment. Call Build_Allocate_Deallocate_Proc when the function doesn't + need a BIPalloc formal to ensure that function results with controlled + parts allocated on the caller side will be chained for finalization. + (Make_Build_In_Place_Call_In_Object_Declaration): Call Needs_BIP_Collection + on the function's Entity_Id rather than the function call. + (Needs_BIP_Collection): If a BIP function doesn't need a BIPalloc formal + then it doesn't need a BIP collection either; return False in that case. + (Needs_BIP_Alloc_Form): Remove test of Needs_BIP_Collection. + * exp_ch7.adb (Expand_Cleanup_Actions): Move test of Uses_Sec_Stack + to be the first conjunct in setting of Needs_Sec_Stack_Mark, and put + the other tests in a disjunction subsidiary to that. Improve preceding + comment. + +2025-09-15 Eric Botcazou + + * checks.adb (Apply_Discriminant_Check): Remove undocumented test + on Is_Aliased_View applied to the left-hand side to skip the check + in the case where the subtypes are the same, and replace it with a + test that the subtypes are constrained. + +2025-09-15 Jose Ruiz + + * doc/gnat_rm/security_hardening_features.rst: + clarify that hardening options are not supported by the + LLVM back end. + * gnat_rm.texi: Regenerate. + * gnat_ugn.texi: Regenerate. + +2025-09-15 Viljar Indus + + * sem_prag.adb (Analyze_Pragma): Disable context checks for + the preanalysis of the expression for Loop_Invariant pragmas + as the ghost region for the pragma has not been set up yet. + +2025-09-15 Viljar Indus + + * sem_prag.adb (Get_Applicable_Policy): Match assertion levels + by name. + +2025-09-15 Steve Baird + + * freeze.adb (Freeze_Entity): In the case of an anonymous + access-to-subprogram type where Do_Freeze_Profile is True, freeze + the designated subprogram type. + (Should_Freeze_Type): Do not call Unit_Declaration_Node with + a parentless argument. + * sem_ch3.adb (Analyze_Object_Declaration): When calling + Freeze_Before, override the default value for Do_Freeze_Profile. + This is needed in some cases to prevent premature freezing in the + case of an object of an anonymous access-to-subprogram type. + +2025-09-15 Viljar Indus + + * sem_prag.adb (Analyze_Pragma): Add ghost level check to + Assertion_Policy. + +2025-09-15 Viljar Indus + + * ghost.adb (Check_Assignment_Policies): The level of the assignee + should depend on the level of the region. + +2025-09-15 Viljar Indus + + * ghost.adb (Is_Ok_Pragma): Remove calls to Check_Policies. + +2025-09-15 Viljar Indus + + * contracts.adb: Update SPARK RM reference numbers. + * freeze.adb: Likewise. + * ghost.adb: Likewise. + * ghost.ads: Likewise. + * sem_ch12.adb: Likewise. + * sem_ch3.adb: Likewise. + * sem_ch6.adb: Likewise. + * sem_prag.adb: Likwise. + * sem_res.adb: Likewise. + +2025-09-15 Viljar Indus + + * sem_prag.adb (Check_Inconsistent_Argument_Ghostliness): + new method for handling the ghost constency errors between + different arguments. Use this method in the processing for + pragmas Unused, Unrefefrenced, Unreferenced_Objects, Inline and + No_Return. + * sem_prag.ads (Suppressed_Ghost_Policy_Check_Pragma): add + missing entry for pragma Inline. + +2025-09-15 Viljar Indus + + * ghost.adb (Check_Assignee_Levels): Fix the condition and improve + error message handling. + +2025-09-15 Nicolas Boulenguez + + PR ada/114065 + * Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add g-c_time$(objext) and + s-c_time$(objext). + (Aarch64/Android): Do not use s-osinte__android.adb. + (SPARC/Solaris): Do not use s-osprim__solaris.adb. + (x86/Solaris): Likewise. + (LynxOS178): Do not use s-parame__posix2008.ads. + (RTEMS): Likewise. + (x32/Linux): Likewise, as well as s-linux__x32.ads. Replace + s-osprim__x32.adb with s-osprim__posix.adb. + (LIBGNAT_OBJS): Remove cal.o. + * cal.c: Delete. + * doc/gnat_rm/the_gnat_library.rst (GNAT.C_Time): New entry. + (GNAT.Calendar): Do not mention the obsolete conversion functions. + * impunit.adb (Non_Imp_File_Names_95): Add g-c_time. + * libgnarl/a-exetim__posix.adb: Add with clause for System.C_Time + (Clock): Use type and functions from System.C_Time. + * libgnarl/s-linux.ads: Remove with clause for System.Parameters. + Remove declarations of C time types. + * libgnarl/s-linux__alpha.ads: Likewise. + * libgnarl/s-linux__android-aarch64.ads: Likewise. + * libgnarl/s-linux__android-arm.ads: Likewise. + * libgnarl/s-linux__hppa.ads: Likewise. + * libgnarl/s-linux__loongarch.ads: Likewise. + * libgnarl/s-linux__mips.ads: Likewise. + * libgnarl/s-linux__riscv.ads: Likewise. + * libgnarl/s-linux__sparc.ads: Likewise. + * libgnarl/s-osinte__aix.ads: Likewise. + * libgnarl/s-osinte__android.ads: Likewise. + * libgnarl/s-osinte__cheribsd.ads: Likewise. + * libgnarl/s-osinte__darwin.ads: Likewise. + * libgnarl/s-osinte__dragonfly.ads: Likewise. + * libgnarl/s-osinte__freebsd.ads: Likewise. + * libgnarl/s-osinte__gnu.ads: Likewise. + * libgnarl/s-osinte__hpux.ads: Likewise. + * libgnarl/s-osinte__kfreebsd-gnu.ads: Likewise. + * libgnarl/s-osinte__linux.ads: Likewise. + * libgnarl/s-osinte__lynxos178e.ads: Likewise. + * libgnarl/s-osinte__qnx.ads: Likewise. + * libgnarl/s-osinte__rtems.ads: Likewise. + * libgnarl/s-osinte__solaris.ads: Likewise. + * libgnarl/s-osinte__vxworks.ads: Likewise. + * libgnarl/s-qnx.ads: Likewise. + * libgnarl/s-linux__x32.ads: Delete. + * libgnarl/s-osinte__darwin.adb (To_Duration): Remove. + (To_Timespec): Likewise. + * libgnarl/s-osinte__aix.adb: Likewise. + * libgnarl/s-osinte__dragonfly.adb: Likewise. + * libgnarl/s-osinte__freebsd.adb: Likewise. + * libgnarl/s-osinte__gnu.adb: Likewise. + * libgnarl/s-osinte__lynxos178.adb: Likewise. + * libgnarl/s-osinte__posix.adb: Likewise. + * libgnarl/s-osinte__qnx.adb: Likewise. + * libgnarl/s-osinte__rtems.adb: Likewise. + * libgnarl/s-osinte__solaris.adb: Likewise. + * libgnarl/s-osinte__vxworks.adb: Likewise. + * libgnarl/s-osinte__x32.adb: Likewise. + * libgnarl/s-taprop__solaris.adb: Add with clause for System.C_Time. + (Monotonic_Clock): Use type and functions from System.C_Time. + (RT_Resolution): Likewise. + (Timed_Sleep): Likewise. + (Timed_Delay): Likewise. + * libgnarl/s-taprop__vxworks.adb: Likewise. + * libgnarl/s-tpopmo.adb: Likewise. + * libgnarl/s-osinte__android.adb: Delete. + * libgnat/g-c_time.ads: New file. + * libgnat/g-calend.adb: Delegate to System.C_Time. + * libgnat/g-calend.ads: Likewise. + * libgnat/g-socket.adb: Likewise. + * libgnat/g-socthi.adb: Likewise. + * libgnat/g-socthi__vxworks.adb: Likewise. + * libgnat/g-sothco.ads: Likewise. + * libgnat/g-spogwa.adb: Likewise. + * libgnat/s-c_time.adb: New file. + * libgnat/s-c_time.ads: Likewise. + * libgnat/s-optide.adb: Import nanosleep here. + * libgnat/s-os_lib.ads (time_t): Remove. + (To_Ada): Adjust. + (To_C): Likewise. + * libgnat/s-os_lib.adb: Likewise. + * libgnat/s-osprim__darwin.adb: Delegate to System.C_Time. + * libgnat/s-osprim__posix.adb: Likewise. + * libgnat/s-osprim__posix2008.adb: Likewise. + * libgnat/s-osprim__rtems.adb: Likewise. + * libgnat/s-osprim__unix.adb: Likewise. + * libgnat/s-osprim__solaris.adb: Delete. + * libgnat/s-osprim__x32.adb: Likewise. + * libgnat/s-parame.ads (time_t_bits): Remove. + * libgnat/s-parame__hpux.ads: Likewise. + * libgnat/s-parame__vxworks.ads: Likewise. + * libgnat/s-parame__posix2008.ads: Delete. + * s-oscons-tmplt.c (SIZEOF_tv_nsec): New constant. + * gnat_rm.texi: Regenerate. + +2025-09-15 Eric Botcazou + + * exp_util.adb (Finalize_Address): In an untagged derivation, call + Root_Type on the full view of the base type if the partial view is + itself not a derived type. + (Is_Untagged_Derivation): Minor formatting tweak. + +2025-09-15 Eric Botcazou + + * exp_util.ads (Unqualified_Unconditional_Parent): New function. + * exp_util.adb (Unconditional_Parent): Do not look through qualified + expressions. + (Unqualified_Unconditional_Parent): New function identical to the + original Unconditional_Parent. + * exp_aggr.adb (Convert_To_Assignments): Replace Unconditional_Parent + with Unqualified_Unconditional_Parent. + (Expand_Array_Aggregate): Likewse. + * exp_ch4.adb (Expand_N_Case_Expression): Likewise. + (Expand_N_If_Expression): Likewise. + * exp_ch6.adb (Expand_Ctrl_Function_Call): Do not bypass an enclosing + qualified expression in the parent chain. + +2025-09-15 Ronan Desplanques + + * doc/gnat_rm/gnat_language_extensions.rst: Fix section of Finalizable. + * gnat_rm.texi: Regenerate. + * gnat_ugn.texi: Regenerate. + +2025-09-15 Viljar Indus + + * sem_ch6.adb (Analyze_Expression_Function): Disable ghost + checks during the early freeze. + +2025-09-15 Steve Baird + + * aspects.ads: Define Super aspect; allow Initialize aspect + specification on a subprogram body. + * exp_attr.adb (Expand_N_Attribute_Reference): Rewrite Make + attribute implementation. + * exp_ch3.adb (Initialization_Control): Delete Initialization_Mode + and Make_Mode_Literal (those declarations were moved to the spec). + (Build_Record_Init_Proc): For a constructor type, component + initialization (other than for the tag component, if any) must be + performed by calling the single-argument constructor procedure. + (Requires_Init_Proc): Return True for a constructor type. + * exp_ch3.ads (Make_Mode_Literal, Initialization_Mode): New, moved + from the body of this package. + * exp_ch6.adb (Expand_N_Subprogram_Body): Declare, implement, and + call a new local procedure, Prepend_Constructor_Procedure_Prologue + in order to generate component initialization for a constructor + procedure. + * sem_attr.adb (Analyze_Attribute): Improve the error message + generated for a 'Make attribute reference if GNAT extensions are + not all allowed. + * sem_ch13.adb (Analyze_One_Aspect): Improved implementation of + aspect specifications for Initialize, Constructor, and Super + aspects. For Super, there was no previous implementation. + +2025-09-15 Viljar Indus + + * atree.adb (Mark_New_Ghost_Node): Set Is_Implicit_Ghost for + all newly created nodes. + * gen_il-fields.ads (Is_Implicit_Ghost): New attribute. + * gen_il-gen-gen_entities.adb (Entity_Kind): Add Is_Implicit_Ghost + attribute. + * ghost.adb (Ghost_Policy_In_Effect): Implicit_Ghost_Entities inside + pragmas get the ghost mode from the region isntead of the global + ghost policy. + (Ghost_Assertion_Level_In_Effect): New function that returns the + applicable assertion level for the given entity in a similar manner + as Ghost_Policy_In_Effect. + (Install_Ghost_Region): Set Is_Inside_Statement_Or_Pragma attribute. + (Mark_And_Set_Ghost_Body): Update the logic for deriving the ghost + region. + (Set_Ghost_Mode): Ignored pragmas attached to checked ghost entities + now create an ignored ghost region. Pragmas attached to non-ghost + entities create the ghost region based on the policy applied to the + given pragma. + * opt.ads (Ghost_Config_Type): add new attribute + Is_Inside_Statement_Or_Pragama to track whether we should take the + active ghost mode from the ghost region for implicit ghost entities. + * sem_prag.adb (Analyze_Pragma): Mark entities that have an explicit + ghost pragma as non-implicit ghost. + +2025-09-15 Sebastian Poeplau + + * doc/gnat_ugn/building_executable_programs_with_gnat.rst: + Remove the note on light runtimes. + +2025-09-15 Sebastian Poeplau + + * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Move + recommendation of Toolchain_Name up. + * gnat_ugn.texi: Regenerate. + +2025-09-15 Vadim Godunko + + * bindgen.adb (Gen_Adafinal): Don't generate call of adafinal + when use of standard library suppressed. + +2025-09-15 Vadim Godunko + + * bindgen.adb (Gen_Adafinal): Don't generate code when + use of standard library suppressed. + +2025-09-15 Vadim Godunko + + * libgnat/a-swunau.ads (Set_Wide_String): New subprogram. + * libgnat/a-swunau.adb (Set_Wide_String): Likewise. + * libgnat/a-swunau__shared.adb (Set_Wide_String): Likewise. + * libgnat/a-szunau.ads (Set_Wide_Wide_String): Likewise. + * libgnat/a-szunau.adb (Set_Wide_Wide_String): Likewise. + * libgnat/a-szunau__shared.adb (Set_Wide_Wide_String): Likewise. + +2025-09-15 Viljar Indus + + * ghost.adb (Check_Ghost_Context): Avoid context checks when they + are globally disabled. + * sem.ads (Ghost_Context_Checks_Disabled): New flag to control + whether ghost context checks are activated or not. + * sem_prag.adb (Analyze_Pragma): Disable ghost context checks for + pragmas that determine their ghostliness based on one of its arguments. + +2025-09-15 Ronan Desplanques + + * sem_util.ads (Is_Ancestor_Package): Fix documentation comment. + * sem_util.adb (Is_Ancestor_Package): Rename local object. + +2025-09-11 Marc Poulhiès + + * libgnat/g-socket.adb (Listen_Socket): Change default value. + * libgnat/g-socket.ads (Listen_Socket): Likewise. + * s-oscons-tmplt.c (BACKLOG_MAX): New. + +2025-09-11 Marc Poulhiès + + * env.c (__gnat_clearenv): Adjust comment. + * libgnarl/a-intnam__bsd.ads: Fix copyright date. + +2025-09-11 Eric Botcazou + + * gcc-interface/decl.cc (gnat_to_gnu_entity) : Give a + warning for huge imported objects as well. + +2025-09-11 Eric Botcazou + + * gcc-interface/ada-tree.h (TYPE_ALIGN_OK): Delete. + * gcc-interface/decl.cc (gnat_to_gnu_entity): Do not set it. + * gcc-interface/gigi.h (standard_datatypes): Add ADT_tag_name_id. + (tag_name_id): New macro. + (type_is_tagged_or_cw_equivalent): New inline predicate. + * gcc-interface/trans.cc (gigi): Initialize tag_name_id. + (gnat_to_gnu) : Replace tests on + TYPE_ALIGN_OK with calls to type_is_tagged_or_cw_equivalent. + (addressable_p): Likewise. + * gcc-interface/utils.cc (convert): Likewise. + * gcc-interface/utils2.cc (build_binary_op): Likewise. + +2025-09-11 Eric Botcazou + + * gcc-interface/misc.cc (gnat_get_array_descr_info): In the record + type case, bail out if the original array type cannot be retrieved. + +2025-09-11 Eric Botcazou + + * gcc-interface/gigi.h (standard_datatypes): Add ADT_uns_mulv64_decl + and ADT_uns_mulv128_decl. + (uns_mulv64_decl): New macro. + (uns_mulv128_decl): Likewise. + * gcc-interface/trans.cc (gigi): Create the uns_mulv64_decl and + uns_mulv128_decl declarations. + (gnat_to_gnu) : Perform an overflow check for unsigned + integer addition, subtraction and multiplication if required. + : Perform an overflow check for unsigned integer + negation if required. + (build_unary_op_trapv): Add support for unsigned types. + (build_binary_op_trapv): Likewise. + : Perform the check if the LHS is zero in the signed + case as well. + +2025-09-11 Steve Baird + + * exp_ch6.adb (Expand_Actuals): After building the tree for a + predicate check, call Prepend_To instead of Append_To so that the + check is performed before, instead of after, the corresponding + parameter copy-back. + +2025-09-11 Viljar Indus + + * sem_prag.adb: Create a ghost region for pragma annotate before + analyzing its arguments. + +2025-09-11 Viljar Indus + + * sem_ch5.adb (Analyze_Iterator_Specification): Check ghost context + of Iterable functions when handling iterator specifications with an + Iterable aspect. + +2025-09-11 Viljar Indus + + * ghost.adb (Check_Ghost_Policy): Update coding style. + +2025-09-11 Viljar Indus + + * ghost.adb (Check_Ghost_Policy): Avoid triggering a ghost + policy error if the policy is referenced within the Iterable + aspect. + +2025-09-11 Viljar Indus + + * ghost.adb (Is_OK_Statement): Check the levels of the + assignee with the levels of the entity are ghost level dependent. + (Check_Assignement_Levels): New function for checking the level + dependencies. + +2025-09-11 Piotr Trojanek + + * einfo.ads (Ghost_Assertion_Level): Fix comment. + +2025-09-11 Viljar Indus + + * ghost.adb (Mark_And_Set_Ghost_Assignment): Create a ghost region + for an assigment irregardless of whether the expander is active. + Relocate the Assignment validity checks from Is_OK_Statement to + this subprogram. + +2025-09-11 Gary Dismukes + + * exp_aggr.adb (Build_Container_Aggr_Code.Build_Size_Expr): In the case + of an association with a single choice, only call Update_Choices when + the choice expression is nonstatic. + +2025-09-11 Bob Duff + + * exp_ch5.adb + (Expand_Assign_With_Target_Names.Replace_Target): + Remove code setting Entity to Empty. + * sinfo.ads (Has_Target_Names): + Improve comment: add "@" to clarify what "target name" + means, and remove the content-free phrase "and must + be expanded accordingly." + +2025-09-11 Bob Duff + + * einfo-utils.adb (Root_Type): Do not deal with missing Etype. + +2025-09-11 Bob Duff + + * einfo-utils.adb (Root_Type): Deal with missing Etype. + (Root_Type_If_Set): Likewise. + +2025-09-11 Javier Miranda + + * freeze.adb (Freeze_Entity): Protect call to Associated_Storage_Pool + since it cannot be used when the Etype is not set. + * sem_ch3.adb (Access_Type_Declaration): Ditto. + * sem_aux.adb (Is_Derived_Type): Protect call to Root_Type since it + cannot be used when the Etype is not set. + +2025-09-11 Tonu Naks + + * libgnat/s-crtl.ads: define unsigned + * libgnat/s-crtl__mingw.adb (read, write): change arg type + +2025-09-11 Bob Duff + + * freeze.adb (Freeze_Entity): Change "=" to ">=" in + size comparison for Implicit_Packing mode. + Keep it as "=" for giving error messages. + * opt.ads (Implicit_Packing): Minor: correct obsolete + comment. + +2025-09-11 Javier Miranda + + * sem_aggr.adb (Report_Null_Array_Constraint_Error): Adjust code + for reporting the error on enumeration types. + (Resolve_Null_Array_Aggregate): On multidimiensional arrays, avoid + reporting the same error several times. Flag the node as raising + constraint error when the bounds are known and some of them is + known to raise constraint error. + +2025-09-11 Bob Duff + + * atree.ads (Node_To_Fetch_From_If_Set): Alternative to + Node_To_Fetch_From that returns Empty in error cases. + For use only in Treepr. + * treepr.adb (Print_Entity_Field): Avoid printing field + if Node_To_Fetch_From_If_Set returns Empty. + * einfo-utils.ads (Base_Type_If_Set): Alternative to + Base_Type that returns Empty in error cases. + (Implementation_Base_Type_If_Set): Likewise. + (Root_Type_If_Set): Likewise. + (Underlying_Type): Use more accurate result subtype. + * einfo-utils.adb (Base_Type): Add Asserts. + (Implementation_Base_Type): Add Assert; minor cleanup. + (Root_Type): Add Assert; minor cleanup. Remove Assert that + is redundant with predicate. + (Base_Type_If_Set): Body of new function. + (Implementation_Base_Type_If_Set): Body of new function. + (Root_Type_If_Set): Body of new function. + +2025-09-11 Johannes Kliemann + + * adaint.c: Add functions to disable and enable signals on QNX. + * libgnarl/s-taprop__qnx.adb (Create_Task): Disable + signals when calling pthread_create. + +2025-09-11 Gary Dismukes + + * exp_ch4.adb (Expand_N_Op_Eq): Test for absence of user-defined + equality on type being compared (for both array and record types) + as a condition for checking for abstract equality on component + types. Add a "???" comment about current limitations on issuing + the new warning. + (Warn_On_Abstract_Equality_For_Component): Remove temporary disabling + of the warning. Improve comment on declaration. + +2025-09-11 Ronan Desplanques + + * sem_ch3.adb (Process_Discriminants, Process_Full_View): Fix + comments. + +2025-09-11 Denis Mazzucato + + * sem_attr.adb (Eval_Attribute): Remove strict analysis condition. + +2025-09-11 Denis Mazzucato + + * par-load.adb (Load): Better warning message. + +2025-09-11 Tucker Taft + + * exp_attr.adb + (Build_Array_VS_Func and Build_Record_VS_Func): Pass in the + Attr as the Related_Node parametr when calling + Make_Temporary for the Func_Id for the array and record + Valid_Scalars local functions. + +2025-09-11 Ronan Desplanques + + * sem_ch3.ads (Find_Type_Name): Improve documentation comment. + +2025-09-11 Gary Dismukes + + * exp_ch4.adb (Warn_On_Abstract_Equality_For_Component): Temporarily + disable warning. + +2025-09-10 Eric Botcazou + + PR ada/121885 + * snames.ads-tmpl (Pragma_Id): Rename Unknown_Pragma to + Pragma_Unknown for the sake of XSnamesT. + * snames.adb-tmpl (Get_Pragma_Id): Adjust to above renaming. + * snames.h-tmpl (Attribute_Id): Change underlying type to Byte. + (Get_Attribute_Id): Use Byte as return value. + (Pragma_Id): Change underlying type to Word. + (Get_Pragma_Id): Use Word as return value. + * types.h (Word): New typedef. + * exp_prag.adb (Expand_N_Pragma): Remove useless comment. + * par-prag.adb (Prag): Adjust to above renaming. + * sem_prag.adb (Analyze_Pragma): Likewise. + (Sig_Flags): Likewise. + +2025-09-09 Gary Dismukes + + * exp_ch4.adb (Expand_N_Op_Eq): Check for warning about call to + the abstract equality function of a component type, for both array + and record enclosing types. + (Warn_On_Abstract_Equality_For_Component): New procedure to issue + a warning when an abstract equality function of a component type + will be called and result in Program_Error. + +2025-09-09 Ronan Desplanques + + * sem_ch5.adb (Make_Call): Mark generated nodes as coming from source. + +2025-09-09 Ronan Desplanques + + * sem_ch3.adb (Analyze_Incomplete_Type_Decl): Remove incorrect + comment. + +2025-09-09 Viljar Indus + + * ghost.adb (Is_OK_Pragma): Use the + Suppressed_Ghost_Policy_Check_Pragma list for ignoring certain + pragmas. + * sem_prag.ads (Suppressed_Ghost_Policy_Check_Pragma): New variable + to store the pragmas that could be ignored when checking for + consitant ghost policy. + +2025-09-09 Tonu Naks + Eric Botcazou + + * libgnat/s-crtl.ads (read, write): remove import + * libgnat/s-crtl__mingw.adb: body for windows + * libgnat/s-crtl.adb: body for all the other targets + * Makefile.rtl: configure s-crtl.adb/libgnat/s-crtl__mingw.adb + * gcc-interface/Make-lang.in (GNAT_ADA_OBJS): Alphabetize. + (GNATBIND_OBJS): Add ada/libgnat/s-crtl.o. + +2025-09-09 Viljar Indus + + * contracts.adb: Use the In_Codegen function instead. + * exp_ch3.adb: Likewise. + * exp_ch5.adb: Likewise. + * exp_ch6.adb: Likewise. + * exp_ch7.adb: Likewise. + * exp_ch9.adb: Likewise. + * exp_disp.adb: Likewise. + * exp_util.adb: Likewise. + * freeze.adb: Likewise. + * ghost.adb: Likewise. + * inline.adb: Likewise. + * repinfo.adb: Likewise. + * sem_ch10.adb: Likewise. + * sem_ch13.adb: Likewise. + * sem_ch3.adb: Likewise. + * sem_ch6.adb: Likewise. + * sem_elab.adb: Likewise. + * sem_res.adb: Likewise. + * sem_util.adb (Predicates_Ignored_In_Codegen): Add new function for + the Predicates_Ignored property. + (Predicates_Enabled): Use Predicates_Ignored_In_Codegen instead. + * sem_util.ads (Predicates_Ignored_In_Codegen): New function. + (Is_Ignored_In_Codegen): Add documentation on how _In_Codegen + functions should be used. + +2025-09-09 Ronan Desplanques + + * sem_ch3.adb (Copy_And_Swap): Improve comments. + +2025-09-09 Javier Miranda + + * sem_util.adb (Needs_One_Actual): Add support for untagged record + types when the sources are compiled with Core Extensions allowed. + +2025-09-09 Ronan Desplanques + + * sem_ch3.adb (Find_Type_Name): Fix comment. + +2025-09-09 Ronan Desplanques + + * sem_ch3.adb (Check_Nonoverridable_Aspects): Remove if statement. + +2025-09-09 Ronan Desplanques + + * sem_ch3.adb (Check_Nonoverridable_Aspects): Improve documentation + comment. + +2025-09-09 Viljar Indus + + * ghost.adb (Check_Ghost_Completion): Add location info + to the policy messages. + (Check_Ghost_Policy): Likwise. + +2025-09-09 Javier Miranda + + * exp_attr.adb (Rewrite_Attribute_Proc_Call): Add new parameter + to calls to Create_Extra_Formals. + (Expand_N_Attribute_Reference): Ditto. + * exp_ch3.adb (Expand_Freeze_Record_Type): Ditto. + * exp_ch6.adb (Expand_Call_Helper): Ditto. + * exp_disp.adb (Expand_Dispatching_Call): Ditto. + * freeze.adb (Check_Itype): Ditto. + (Freeze_Expression): Ditto. + * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Ditto. + (Create_Extra_Formals): Add new formal, and use it to determine + if the creation of the extra formals can be deferred. Add the + new parameter to calls to Create_Extra_Formals. + (Is_Unsupported_Extra_Actuals_Call): Adjust the code to improve + its performance when the result is known. + (Is_Unsupported_Extra_Formals_Entity): Ditto. Add new formal + * sem_ch6.ads (Create_Extra_Formals): Add new formal. + (Is_Unsupported_Extra_Formals_Entity): Ditto. + +2025-09-09 Viljar Indus + + * sem_aggr.adb (Resolve_Array_Aggregate): Indicate an out of + bounds index error also in the case of a missing index. + +2025-09-09 Viljar Indus + + * sem_ch13.adb (Analyze_Aspect_Definitions): Create a temporary + pragma for the non-task and access type cases. + +2025-09-09 Ronan Desplanques + + * sem_ch7.adb (New_Private_Type): Remove useless statements. + +2025-09-09 Denis Mazzucato + + * targparm.adb (Get_Target_Parameters): Address type declaration doesn't + ends anymore with a semicolon. + * libgnat/a-cdlili.ads: Replace Preelaborable_Initialization. + * libgnat/a-cidlli.ads: Likewise. + * libgnat/a-cihama.ads: Likewise. + * libgnat/a-cihase.ads: Likewise. + * libgnat/a-cimutr.ads: Likewise. + * libgnat/a-ciorma.ads: Likewise. + * libgnat/a-ciormu.ads: Likewise. + * libgnat/a-ciorse.ads: Likewise. + * libgnat/a-cohama.ads: Likewise. + * libgnat/a-cohase.ads: Likewise. + * libgnat/a-coinho.ads: Likewise. + * libgnat/a-coinho__shared.ads: Likewise. + * libgnat/a-coinve.ads: Likewise. + * libgnat/a-comutr.ads: Likewise. + * libgnat/a-convec.ads: Likewise. + * libgnat/a-coorma.ads: Likewise. + * libgnat/a-coormu.ads: Likewise. + * libgnat/a-coorse.ads: Likewise. + * libgnat/a-crdlli.ads: Likewise. + * libgnat/a-except.ads: Likewise. + * libgnat/a-finali.ads: Likewise. + * libgnat/a-ngcoty.ads: Likewise. + * libgnat/a-strbou.ads: Likewise. + * libgnat/a-stream.ads: Likewise. + * libgnat/a-strmap.ads: Likewise. + * libgnat/a-strunb.ads: Likewise. + * libgnat/a-strunb__shared.ads: Likewise. + * libgnat/a-ststio.ads: Likewise. + * libgnat/a-stwibo.ads: Likewise. + * libgnat/a-stwima.ads: Likewise. + * libgnat/a-stwiun.ads: Likewise. + * libgnat/a-stwiun__shared.ads: Likewise. + * libgnat/a-stzbou.ads: Likewise. + * libgnat/a-stzmap.ads: Likewise. + * libgnat/a-stzunb.ads: Likewise. + * libgnat/a-stzunb__shared.ads: Likewise. + * libgnat/a-tags.ads: Likewise. + * libgnat/i-cstrin.ads: Likewise. + * libgnat/s-stopoo.ads: Likewise. + * libgnat/s-stposu.ads: Likewise. + * libgnat/system-aix.ads: Likewise. + * libgnat/system-darwin-arm.ads: Likewise. + * libgnat/system-darwin-ppc.ads: Likewise. + * libgnat/system-darwin-x86.ads: Likewise. + * libgnat/system-djgpp.ads: Likewise. + * libgnat/system-dragonfly-x86_64.ads: Likewise. + * libgnat/system-freebsd.ads: Likewise. + * libgnat/system-gnu.ads: Likewise. + * libgnat/system-hpux-ia64.ads: Likewise. + * libgnat/system-hpux.ads: Likewise. + * libgnat/system-linux-alpha.ads: Likewise. + * libgnat/system-linux-arm.ads: Likewise. + * libgnat/system-linux-hppa.ads: Likewise. + * libgnat/system-linux-ia64.ads: Likewise. + * libgnat/system-linux-loongarch.ads: Likewise. + * libgnat/system-linux-m68k.ads: Likewise. + * libgnat/system-linux-mips.ads: Likewise. + * libgnat/system-linux-ppc.ads: Likewise. + * libgnat/system-linux-riscv.ads: Likewise. + * libgnat/system-linux-s390.ads: Likewise. + * libgnat/system-linux-sh4.ads: Likewise. + * libgnat/system-linux-sparc.ads: Likewise. + * libgnat/system-linux-x86.ads: Likewise. + * libgnat/system-lynxos178-ppc.ads: Likewise. + * libgnat/system-lynxos178-x86.ads: Likewise. + * libgnat/system-mingw.ads: Likewise. + * libgnat/system-qnx-arm.ads: Likewise. + * libgnat/system-rtems.ads: Likewise. + * libgnat/system-solaris-sparc.ads: Likewise. + * libgnat/system-solaris-x86.ads: Likewise. + * libgnat/system-vxworks-ppc-kernel.ads: Likewise. + * libgnat/system-vxworks-ppc-rtp-smp.ads: Likewise. + * libgnat/system-vxworks-ppc-rtp.ads: Likewise. + * libgnat/system-vxworks7-aarch64-rtp-smp.ads: Likewise. + * libgnat/system-vxworks7-aarch64.ads: Likewise. + * libgnat/system-vxworks7-arm-rtp-smp.ads: Likewise. + * libgnat/system-vxworks7-arm.ads: Likewise. + * libgnat/system-vxworks7-ppc-kernel.ads: Likewise. + * libgnat/system-vxworks7-ppc-rtp-smp.ads: Likewise. + * libgnat/system-vxworks7-ppc64-kernel.ads: Likewise. + * libgnat/system-vxworks7-ppc64-rtp-smp.ads: Likewise. + * libgnat/system-vxworks7-x86-kernel.ads: Likewise. + * libgnat/system-vxworks7-x86-rtp-smp.ads: Likewise. + * libgnat/system-vxworks7-x86_64-kernel.ads: Likewise. + * libgnat/system-vxworks7-x86_64-rtp-smp.ads: Likewise. + +2025-09-09 Marc Poulhiès + + * s-pack.adb.tmpl: Typo fix in comment. + +2025-09-09 Viljar Indus + + * sem_prag.adb (Analyze_Pragma): Set Mark_Ghost_Code individually + based on the semantics of each pragma. + +2025-09-09 Viljar Indus + + * ghost.adb (Mark_Ghost_Declaration_Or_Body): Mark ghost + entity explicitly as ignored or checked. + +2025-09-09 Viljar Indus + + * ghost.adb (Check_Ghost_Policy): ignore ghost policy changes + within instantiation statements. + +2025-09-09 Viljar Indus + + * ghost.adb (Check_Ghost_Policy): Use the policy in affect for + the identifier at the current moment instead of the region + around it when checking a policy change for a procedure call. + +2025-09-09 Viljar Indus + + * ghost.adb (Mark_And_Set_Ghost_Declaration): apply the + ghost policy and level from the declaration only if the declaration + has an explicit ghost aspect/pragma. + +2025-09-09 Denis Mazzucato + + * sem_ch13.adb (Check_Nonoverridable_Aspect_Subprograms): Add the new + legality check in Check_Nonoverridable_Aspect_Subprograms for + nonoverridable aspects to check whether the denoted subprograms satisfy + MR 13.1.1(18.4/6), otherwise we emit an error. Fix spacing. + * sem_ch6.adb (New_Overloaded_Entity): Set Is_Primitive flag + for inherited primitives, and filter out homonym candidates without a + function specification as parents. + +2025-09-09 Piotr Trojanek + + * sem_prag.adb (Check_Interrupt_Or_Attach_Handler): Refine test for + protected procedures; fix typo in comment. + +2025-09-09 Viljar Indus + + * ghost.adb (Is_OK_Pragma): mark the context of ignored ghost + pragmas as OK. + +2025-09-09 Viljar Indus + + * ghost.adb (Assertion_Level_From_Arg): Ensure that assertion level + is stored as the entity for its reference. + (Enables_Ghostness): Derive the result from whether or not the + an argument indicated an assertion level. + * tbuild.adb (Make_Assertion_Level): ensure that assertion levels + have a standard scope. + +2025-09-09 Piotr Trojanek + + * checks.adb (Make_Bignum_Block): Check restriction No_Secondary_Stack. + +2025-09-09 Viljar Indus + + * sem_util.adb (Policy_In_Effect): Add special handling + for Runtime and Static values. + +2025-09-09 Denis Mazzucato + + * exp_ch3.adb (Init_Formals): Remove the check on Global_No_Tasking. + * sem.adb: Fix typo. + +2025-09-09 Gary Dismukes + + * exp_aggr.adb (Build_Container_Aggr_Code.To_Int): Replace existing + conditional expression with call to Expr_Value. + +2025-09-09 Viljar Indus + + * sem_ch13.adb (Analyze_Aspect_Specifications): add default + assertion level to assertion aspects. + * sem_prag.adb (Analyze_Pragma): Likewise. + +2025-09-09 Ghjuvan Lacambre + + * exp_ch6.adb (Check_BIP_Actuals, Process_Node): Disable checks. + +2025-09-09 Javier Miranda + + * aspects.ads (Aspect_Unsigned_Base_Range): New aspect. + * checks.adb (Determine_Range): Handle types with unsigned base range aspect. + (Enable_Overflow_Check): ditto + (Apply_Arithmetic_Overflow_Strict): ditto + * debug.adb (d_o): Document new usage. + * einfo.ads (Has_Unsigned_Base_Range_Aspect): New flag. + * exp_attr.adb (Expand_N_Attribute_Reference): No action since + it has been already handled at this stage. + * exp_ch4.adb (Expand_N_Op_Add): Generate aritmetic overflow check on + unsigned base range type operands. + (Expand_N_Op_Subtract): ditto + (Expand_N_Op_Multiply): ditto + (Expand_N_Op_Minus): ditto + * gen_il-fields.ads (Has_Unsigned_Base_Range_Aspect): New flag. + * gen_il-gen-gen_entities.adb (Has_Unsigned_Base_Range_Aspect): New flag. + * gen_il-internals.adb (Has_Unsigned_Base_Range_Aspect): New flag. + * gnat1drv.adb (Adjust_Global_Switches): Handle -gnatd_o + * par-prag.adb (Pragma_Unsigned_Base_Range): No action since it will + be entirely handled by the semantic analyzer. + * rtsfind.ads (RE_Id): Add RE_Uns_[Add|Subtract|Multiply]_With_ Ovflo_Check + * sem_attr.ads (Attribute_Unsigned_Base_Range): Added to the set of + implementation defined attributes. + * sem_attr.adb (Analyze_Attribute): Analyze attribute Unsigned_Base_Range. + (Eval_Attribute): Evaluate attribute Unsigned_Base_Range. + * sem_ch13.adb (Analyze_One_Aspect): Defer checks for this aspect to + the analysis of the corresponding pragma. + * sem_ch3.ads (Unsigned_Base_Range_Type_Declaration): New subprogram. + * sem_ch3.adb (Build_Derived_Numeric_Type): Inherit flag + Has_Unsigned_Base_Range_Aspect. + (Unsigned_Base_Range_Type_Declaration): New subprogram. + (Has_Pragma_Unsigned_Base_Range): New subprogram. + * sem_prag.adb (Analyze_Pragma): Handle Pragma_Unsigned_Base_Range. + * snames.adb-tmpl (Get_Pragma_Id): Handle Name_Unsigned_Base_Range. + (Is_Pragma_Name): ditto. + * snames.ads-tmpl (Name_Unsigned_Base_Range): New name. + (Attribute_Unsigned_Base_Range): New attribute. + (Pragma_Unsigned_Base_Range): New pragma. + * libgnat/s-aridou.ads (Add_With_Ovflo_Check): New routine for Double_Uns. + (Subtract_With_Ovflo_Check): ditto. + (Multiply_With_Ovflo_Check): ditto. + * libgnat/s-aridou.adb (Add_With_Ovflo_Check): ditto. + (Subtract_With_Ovflo_Check): ditto. + (Multiply_With_Ovflo_Check): ditto. + * libgnat/s-arit64.ads (Uns_Add_With_Ovflo_Check64): New subprogram. + (Uns_Subtract_With_Ovflo_Check64): ditto. + (Uns_Multiply_With_Ovflo_Check64): ditto. + * libgnat/s-arit64.adb (Uns_Add_With_Ovflo_Check64): New subprogram. + (Uns_Subtract_With_Ovflo_Check64): ditto. + (Uns_Multiply_With_Ovflo_Check64): ditto. + * libgnat/s-arit128.ads (Uns_Add_With_Ovflo_Check128): New subprogram. + (Uns_Subtract_With_Ovflo_Check128): ditto. + (Uns_Multiply_With_Ovflo_Check128): ditto. + * libgnat/s-arit128.adb (Uns_Add_With_Ovflo_Check128): New subprogram. + (Uns_Subtract_With_Ovflo_Check128): ditto. + (Uns_Multiply_With_Ovflo_Check128): ditto. + * doc/gnat_rm/gnat_language_extensions.rst: Document unsigned + base range. + * gnat_rm.texi: Regenerate. + * gnat_ugn.texi: Regenerate. + +2025-09-09 Viljar Indus + + * atree.adb (Mark_New_Ghost_Node): Store the assertion level on the + entity. + * contracts.adb (Analyze_Package_Contract): Add support for multiple + pragma Initial_Condition orginating from multiple assertion levels. + * cstand.adb (Make_Assertion_Level_Definition): New function that + creates a new Assertion_Level and adds it to the Assertion_Levels + table. + (Create_Standard): Add definitions for assertion levels defined in + Standard. + (Print_Standard): Add assertion level pragmas do the output. + * exp_ch6.adb (Check_Subprogram_Variant): Add support for multiple + Subprogram_Variant pragmas created by assertion levels. + * einfo.ads: add info for the new nodes and attributes. + * exp_prag.adb (Consequence_Error): Fix error message string + corruption caused by another call to the internal strings during + the call to Make_Procedure_Call_Statement. + (Expand_Pragma_Initial_Condition): Ensure all ghost related + attributes are copied to the new pragma. + (Expand_Pragma_Loop_Variant): Likewise. + (Expand_Pragma_Subprogram_Variant). Likewise. Additionally + create a new Subprogram_Variant function for each pragma associated + with an assertion level. + * exp_util.adb (Add_DIC_Check): Ensure all ghost related attributes + are copied to the new pragma. + (Build_DIC_Procedure_Body): Add support for mutliple DIC pragmas + created from assertion levels. + * gen_il-fields.ads: + (Aspect_Ghost_Assertion_Level): New field. + (Original_Aspect): New field. + (Original_Pragma): New field. + (Pragma_Ghost_Assertion_Level): New field. + (Child_Levels): New field. + (Ghost_Assertion_Level): New field. + (Parent_Levels): New field. + * gen_il-gen-gen_entities.adb: + Add Ghost_Assertion_Level field for all entities + Add new E_Assertion_Level entity for storing assertion levels. + * gen_il-gen-gen_nodes.adb: + Add Aspect_Ghost_Assertion_Level for N_Aspect to store the + assertion level associated with the aspect. + Add Original_Aspect to store the original aspect where the aspect + that was transformed from an aspect with an assertion level + origninated from. + Add Pragma_Ghost_Assertion_Level and Original_Pragma to store + the same information for N_Prama nodes. + * gen_il-types.ads: Add new entity kind E_Assertion_Level + * ghost.adb (Assertion_Level_Error_Msg): Create constant for + error messages using the same main error message. + (Ghost_Policy_Error_Msg): Likewise. + (Assertion_Level_To_Name): New subprogram. + (Check_Valid_Ghost_Declaration): New subprogram. + (Get_Ghost_Aspect): New subprogram. + (Get_Ghost_Assertion_Level): New subprogram. + (Ghost_Policy_In_Effect): New subprogram. + (Install_Ghost_Region): New subprogram. + (Mark_And_Set_Ghost_Region): New subprogram. + (Mark_Ghost_Declaration_Or_Body): Add new argument for assertion + levels. + (Check_Ghost_Completion): Update ghost policy calculation with + assertion levels. Refactor error message. + (Is_OK_Statement): Add new checks for valid assertion policies and + assertion levels. + (Is_OK_Pragma): Refactor the calculation of valid ghost pragmas. + (Check_Ghost_Policy): Make the checks ghost region based. + (Check_Ghost_Context): Refactor the order of checks. + (Check_Ghost_Formal_Procedure_Or_Package): Relax the checks for + overriding procedures. Now only ignored subprograms cannot be + overridden by checked or non-ghost subprograms. + (Check_Ghost_Primitive): Relax conditions for primitve operations. + Now only checked primitive subprograms are considered invalid for + ignored tagged types. Add assertion level compatibility checks. + (Check_Ghost_Refinement): Relax conditions for ghost refinements. + Add assertion level compatibility checks for refinements. + (Install_Ghost_Region): Store the current region and the assertion + for that region in the ghost config. + (Enables_Ghostness): Refactor implementation to support assertion + levels. + (Is_Subject_To_Ghost): Simplify implementation. + (Mark_And_Set_Ghost_Assignment): Refactor implementation. + (Mark_And_Set_Ghost_Body): Add support for assertion levels. + (Mark_And_Set_Ghost_Completion): Likewise. + (Mark_And_Set_Ghost_Declaration): Likwise. + (Mark_And_Set_Ghost_Instantiation): Likwise. + (Mark_And_Set_Ghost_Procedure_Call): Refactor implementation. + (Mark_Ghost_Declaration_Or_Body): Add support for assertion levels. + (Set_Ghost_Mode): Likwise. + * ghost.ads (Assertion_Level_From_Arg): New subprogram. + (Install_Ghost_Region): Add argument Level for assertrion levels. + (Is_Assertion_Level_Dependent): New subprogram. + * lib-xref.ads: Add new mapping for E_Assertion_Level entities. + * opt.ads (Ghost_Config_Type): Add new members Ghost_Assertion_Mode + and Current_Region to the structure. + * par-prag.adb (Prag): Add new pragma name Assertion_Level. + * rtsfind.adb (Load_RTU): Update the arguments for the call to + Install_Ghost_Region. + * sem.adb (Do_Analyze): Likewise. + * sem_ch13.adb (Convert_Aspect_With_Assertion_Levels): New + subprogram. + (Make_Aitem_Pragma): Copy ghost mode attributes from the aspect to + the pragma. + (Analyze_Aspect_Specifications): Convert aspects that have an + assertion level association in the aspects without the association + and the original supported syntax and with the assertion level + stored on the aspect node. + Updated duplicate detection to avoid duplicates being called on + aspects with assertion levels that orginated from the same aspect. + * sem_prag.adb (Apply_Check_Policy): New subprogram. + (Get_Applicable_Policy): New subprogram. + (Mark_Is_Checked): New subprogram. + (Mark_Is_Disabled): New subprogram. + (Mark_Is_Ignored): New subprgram. + (Check_Arg_Is_One_Of): Remove versions that had a specific number + of arguments and replace them with a list one. + (Create_Pragma_Without_Assertion_Level): New subprogram. + (Assertion_Level_Pragma_Comes_From_Source): New subprogram. + (Analyze_Pragma): Replace aspects that have an assertion level + with aspects without them where the level is stored on the pragma + node. + (Abstract_State): Add support for assertion levels in ghost + Abstract_State pragmas. + (Assert): Update argument handling for Assert like pragmas. + (Assertion_Level): Add a new section to support the analysis of + pragma Assertion_Level. + (Assertion_Policy): Add support for setting the policy for assertion + levels. + (Check): Update argument handling. Update the assertion policy + application process. + (Check_Policy): Add support for assertion levels. Add check_policy + pragmas for assertion_level dependencis also to the stack of + known Check_Policy pragmas. + (Default_Initial_Condition): Reject the use of DIC with assertion + levels. Update duplication checks. + (Ghost): Add support for assertion levels. Fix issue where + assertion levels with Ghost => False were treated as ghost. + (Predicate): Update the policy handling of Ghost_Predicate. + (Analyze_Refined_State_In_Decl_Part): Create a new ghost region + for analyzing Refined_State. + (Check_Applicable_Policy): Refactor the implementation. Break it + down to Get_Applicable_Policy and Apply_Check_Policy. + (Check_Kind): Removed. Replaced by Get_Applicable_Policy and + Apply_Check_Policy. + (Initialize): Initialize the table storing all know assertion + levels. + * sem_prag.ads (Find_Assertion_Level): New subprogram. + (Insert_Assertion_Level): New subprogram. + (Check_Applicable_Policy): Add new argument Level. + (Check_Kind): Removed. Merged with Get_Applicable_Policy. + (Get_Assertion_Level): New subprogram. + (Is_Valid_Assertion_Level): New subprogram. + * sem_util.adb (Copy_Assertion_Policy_Attributes): New function + for copying the ghost related attributes from one pragma to + another. + (Copy_Subprogram_Spec): Additionally copy the level from the spec. + (Depends_On_Level): New function for checking if one level depends + on another level. + (From_Same_Aspect): New function for checking whether the aspects + orignate from the same original aspect. + (From_Same_Pragma): New function for checking whether the pragmas + originate from the same original aspect or pragma. + (Get_Subprogram_Entity): Avoid crash when being called when the + entity has not been set for the subprogram. + (Has_Assertion_Level_Argument): New function for checking whether + the aspect or a pragma has an argument that is using an assertion + level association. + (Policy_In_Effect): add an additional argument for the level that + should be checked along with the assertion name. + * sem_util.ads (Copy_Assertion_Policy_Attributes): New function. + (Depends_On_Level): Likewise. + (From_Same_Aspect): Likewise. + (From_Same_Pragma): Likewise. + (Has_Assertion_Level_Argument): Likewise. + (Is_Same_Or_Depends_On_Level): Likewise. + (Policy_In_Effect): Add new argument Level. + * sinfo.ads: Add documentation for all the new attributes that + were added to the nodes and entities. + * snames.ads-tmpl: Add new entries for Name_Assertion_Level, + Name_uDefault_Assertion_Level and Pragma_Assertion_Level. + * stand.ads: Add new entities for the predefined assertion levels. + (Standard_Level_Static): Definition for the predefined Static + level that is always ignored. + (Standard_Level_Runtime): Defintion for the predefined Runtime + level that is always checked. + (Standard_Level_Default): Definition for the implicit Default + level that is given for ghost entities that were not associated + with an assertion level (e.g. Ghost => True). + * tbuild.adb (Make_Assertion_Level): New function for constructin + an assertion level. + * tbuild.ads (Make_Assertion_Level): Likewise. + 2025-08-04 Viljar Indus * contracts.adb: Use Is_Ignored_In_Codegen instead of just diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl index 50e683aa80a7..0fa2c51ceb6c 100644 --- a/gcc/ada/Makefile.rtl +++ b/gcc/ada/Makefile.rtl @@ -415,6 +415,7 @@ GNATRTL_NONTASKING_OBJS= \ g-busorg$(objext) \ g-byorma$(objext) \ g-bytswa$(objext) \ + g-c_time$(objext) \ g-calend$(objext) \ g-casuti$(objext) \ g-catiio$(objext) \ @@ -535,6 +536,7 @@ GNATRTL_NONTASKING_OBJS= \ s-boarop$(objext) \ s-boustr$(objext) \ s-bytswa$(objext) \ + s-c_time$(objext) \ s-carsi8$(objext) \ s-carun8$(objext) \ s-casi16$(objext) \ @@ -1418,7 +1420,6 @@ ifeq ($(strip $(filter-out arm% aarch64 linux-android%,$(target_cpu) $(target_os s-inmaop.adb #include +#include #endif #ifdef IN_RTS @@ -3719,6 +3720,68 @@ void __gnat_killprocesstree (int pid, int sig_num) */ } +#if defined (__QNX__) + +static __thread sigset_t set; +static __thread sigset_t oset; +static __thread int signals_disabled = 0; + +int __gnat_disable_signals(void) +{ + sigemptyset(&set); + sigaddset(&set, SIGHUP); + sigaddset(&set, SIGINT); + sigaddset(&set, SIGQUIT); + sigaddset(&set, SIGILL); + sigaddset(&set, SIGTRAP); + sigaddset(&set, SIGIOT); + sigaddset(&set, SIGABRT); + sigaddset(&set, SIGEMT); + sigaddset(&set, SIGDEADLK); + sigaddset(&set, SIGFPE); + sigaddset(&set, SIGKILL); + sigaddset(&set, SIGBUS); + sigaddset(&set, SIGSEGV); + sigaddset(&set, SIGSYS); + sigaddset(&set, SIGPIPE); + sigaddset(&set, SIGALRM); + sigaddset(&set, SIGTERM); + sigaddset(&set, SIGUSR1); + sigaddset(&set, SIGUSR2); + sigaddset(&set, SIGCHLD); + sigaddset(&set, SIGCLD); + sigaddset(&set, SIGPWR); + sigaddset(&set, SIGWINCH); + sigaddset(&set, SIGURG); + sigaddset(&set, SIGPOLL); + sigaddset(&set, SIGIO); + sigaddset(&set, SIGSTOP); + sigaddset(&set, SIGTSTP); + sigaddset(&set, SIGCONT); + sigaddset(&set, SIGTTIN); + sigaddset(&set, SIGTTOU); + sigaddset(&set, SIGVTALRM); + sigaddset(&set, SIGPROF); + sigaddset(&set, SIGXCPU); + sigaddset(&set, SIGXFSZ); + sigaddset(&set, SIGDOOM); + + int ret = sigprocmask(SIG_BLOCK, &set, &oset); + signals_disabled = !ret; + return ret; +} + +int __gnat_enable_signals(void) +{ + if (!signals_disabled) { + return 0; + } + signals_disabled = 0; + return sigprocmask(SIG_SETMASK, &oset, 0); +} + +#endif + #ifdef __cplusplus } #endif diff --git a/gcc/ada/affinity.c b/gcc/ada/affinity.c index 58f491fa9e80..5b95d704ce0a 100644 --- a/gcc/ada/affinity.c +++ b/gcc/ada/affinity.c @@ -56,7 +56,7 @@ __gnat_set_affinity_mask (TASK_ID tid, unsigned mask) CPUSET_ZERO(cpuset); for (index = 0; index < sizeof (unsigned) * 8; index++) - if (mask & (1 << index)) + if (mask & (1U << index)) CPUSET_SET(cpuset, index); return taskCpuAffinitySet (tid, cpuset); diff --git a/gcc/ada/aspects.adb b/gcc/ada/aspects.adb index d1e27ce59833..c9eaea1b7f94 100644 --- a/gcc/ada/aspects.adb +++ b/gcc/ada/aspects.adb @@ -280,6 +280,12 @@ package body Aspects is function Get_Aspect_Id (Name : Name_Id) return Aspect_Id is begin + -- Aspect Unsigned_Base_Range temporarily disabled + + if Name = Name_Unsigned_Base_Range then + return No_Aspect; + end if; + return Aspect_Id_Hash_Table.Get (Name); end Get_Aspect_Id; @@ -572,7 +578,7 @@ package body Aspects is return UAD_Pragma_Map_Header is (UAD_Pragma_Map_Header (Chars mod UAD_Pragma_Map_Size)); - package UAD_Pragma_Map is new GNAT.Htable.Simple_Htable + package UAD_Pragma_Map is new GNAT.HTable.Simple_HTable (Header_Num => UAD_Pragma_Map_Header, Key => Name_Id, Element => Opt_N_Pragma_Id, diff --git a/gcc/ada/aspects.ads b/gcc/ada/aspects.ads index 737f15136062..ab87f54f20a5 100644 --- a/gcc/ada/aspects.ads +++ b/gcc/ada/aspects.ads @@ -158,6 +158,7 @@ package Aspects is Aspect_Stream_Size, Aspect_String_Literal, Aspect_Subprogram_Variant, -- GNAT + Aspect_Super, -- GNAT Aspect_Suppress, Aspect_Synchronization, Aspect_Test_Case, -- GNAT @@ -240,6 +241,7 @@ package Aspects is Aspect_Unmodified, -- GNAT Aspect_Unreferenced, -- GNAT Aspect_Unreferenced_Objects, -- GNAT + Aspect_Unsigned_Base_Range, -- GNAT Aspect_Volatile, Aspect_Volatile_Components, Aspect_Volatile_Full_Access, -- GNAT @@ -358,6 +360,7 @@ package Aspects is Aspect_Unmodified => True, Aspect_Unreferenced => True, Aspect_Unreferenced_Objects => True, + Aspect_Unsigned_Base_Range => True, Aspect_User_Aspect => True, Aspect_Value_Size => True, Aspect_Volatile_Full_Access => True, @@ -366,9 +369,7 @@ package Aspects is others => False); -- The following array indicates aspects that specify operational - -- characteristics, and thus are view-specific. Representation - -- aspects break privacy, as they are needed during expansion and - -- code generation. + -- characteristics, and thus can be specified on partial views. -- List is currently incomplete ??? Operational_Aspect : constant array (Aspect_Id) of Boolean := @@ -516,6 +517,7 @@ package Aspects is Aspect_Stream_Size => Expression, Aspect_String_Literal => Name, Aspect_Subprogram_Variant => Expression, + Aspect_Super => Expression, Aspect_Suppress => Name, Aspect_Synchronization => Name, Aspect_Test_Case => Expression, @@ -624,11 +626,13 @@ package Aspects is Aspect_Stream_Size => True, Aspect_String_Literal => False, Aspect_Subprogram_Variant => False, + Aspect_Super => False, Aspect_Suppress => False, Aspect_Synchronization => False, Aspect_Test_Case => False, Aspect_Type_Invariant => False, Aspect_Unimplemented => False, + Aspect_Unsigned_Base_Range => True, Aspect_Unsuppress => False, Aspect_User_Aspect => False, Aspect_Value_Size => True, @@ -839,6 +843,7 @@ package Aspects is Aspect_Stream_Size => Name_Stream_Size, Aspect_String_Literal => Name_String_Literal, Aspect_Subprogram_Variant => Name_Subprogram_Variant, + Aspect_Super => Name_Super, Aspect_Suppress => Name_Suppress, Aspect_Suppress_Debug_Info => Name_Suppress_Debug_Info, Aspect_Suppress_Initialization => Name_Suppress_Initialization, @@ -852,6 +857,7 @@ package Aspects is Aspect_Unmodified => Name_Unmodified, Aspect_Unreferenced => Name_Unreferenced, Aspect_Unreferenced_Objects => Name_Unreferenced_Objects, + Aspect_Unsigned_Base_Range => Name_Unsigned_Base_Range, Aspect_Unsuppress => Name_Unsuppress, Aspect_User_Aspect => Name_User_Aspect, Aspect_Value_Size => Name_Value_Size, @@ -1120,6 +1126,7 @@ package Aspects is Aspect_SPARK_Mode => Never_Delay, Aspect_Static => Never_Delay, Aspect_Subprogram_Variant => Never_Delay, + Aspect_Super => Never_Delay, Aspect_Synchronization => Never_Delay, Aspect_Test_Case => Never_Delay, Aspect_Unimplemented => Never_Delay, @@ -1145,6 +1152,7 @@ package Aspects is Aspect_Size => Rep_Aspect, Aspect_Small => Rep_Aspect, Aspect_Storage_Size => Rep_Aspect, + Aspect_Unsigned_Base_Range => Rep_Aspect, Aspect_Value_Size => Rep_Aspect, Aspect_Volatile => Rep_Aspect, Aspect_Volatile_Components => Rep_Aspect, @@ -1188,10 +1196,12 @@ package Aspects is -- Sem_Prag. Aspect_On_Body_Or_Stub_OK : constant array (Aspect_Id) of Boolean := - (Aspect_Refined_Depends => True, + (Aspect_Initialize => True, + Aspect_Refined_Depends => True, Aspect_Refined_Global => True, Aspect_Refined_Post => True, Aspect_SPARK_Mode => True, + Aspect_Super => True, Aspect_Warnings => True, others => False); diff --git a/gcc/ada/atree.adb b/gcc/ada/atree.adb index 0ff3d6e34a8f..14d9ba4bb2fd 100644 --- a/gcc/ada/atree.adb +++ b/gcc/ada/atree.adb @@ -1805,11 +1805,17 @@ package body Atree is if Ghost_Config.Ghost_Mode = Check then if Nkind (N) in N_Entity then Set_Is_Checked_Ghost_Entity (N); + Set_Ghost_Assertion_Level + (N, Ghost_Config.Ghost_Mode_Assertion_Level); + Set_Is_Implicit_Ghost (N); end if; elsif Ghost_Config.Ghost_Mode = Ignore then if Nkind (N) in N_Entity then Set_Is_Ignored_Ghost_Entity (N); + Set_Ghost_Assertion_Level + (N, Ghost_Config.Ghost_Mode_Assertion_Level); + Set_Is_Implicit_Ghost (N); end if; Set_Is_Ignored_Ghost_Node (N); diff --git a/gcc/ada/atree.ads b/gcc/ada/atree.ads index 802db8709338..f14491c2d75b 100644 --- a/gcc/ada/atree.ads +++ b/gcc/ada/atree.ads @@ -651,6 +651,20 @@ package Atree is -- similarly for the other two cases. This can return something other -- than N only if N is an Entity. + function Node_To_Fetch_From_If_Set + (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_If_Set (N), + when Impl_Base_Type_Only => Implementation_Base_Type_If_Set (N), + when Root_Type_Only => Root_Type_If_Set (N)); + -- This is a more permissive version of Node_To_Fetch_From, which + -- returns the same value, except it returns Empty in cases where + -- Node_To_Fetch_From would crash because relevant fields are not yet + -- set. This is used in Treepr, to allow it to print half-baked nodes + -- without crashing. + ----------------------------- -- Private Part Subpackage -- ----------------------------- diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb index cb39af67f9a5..24cc8dfb8990 100644 --- a/gcc/ada/bindgen.adb +++ b/gcc/ada/bindgen.adb @@ -476,7 +476,10 @@ package body Bindgen is -- but False for mains in other languages.) We do not want to do this if -- we're binding a library. - if not Bind_For_Library and not CodePeer_Mode then + if not Bind_For_Library + and not CodePeer_Mode + and not Suppress_Standard_Library_On_Target + then WBI (" procedure s_stalib_adafinal;"); Set_String (" pragma Import (Ada, s_stalib_adafinal, "); Set_String ("""system__standard_library__adafinal"");"); @@ -490,7 +493,9 @@ package body Bindgen is WBI (""); WBI (" begin"); - if not CodePeer_Mode then + if not CodePeer_Mode + and not Suppress_Standard_Library_On_Target + then WBI (" if not Is_Elaborated then"); WBI (" return;"); WBI (" end if;"); @@ -503,7 +508,9 @@ package body Bindgen is -- on whether this is the main program or a library. if not CodePeer_Mode then - if not Bind_For_Library then + if not Bind_For_Library + and not Suppress_Standard_Library_On_Target + then WBI (" s_stalib_adafinal;"); elsif Lib_Final_Built then WBI (" finalize_library;"); diff --git a/gcc/ada/cal.c b/gcc/ada/cal.c deleted file mode 100644 index 0a61e0f251ab..000000000000 --- a/gcc/ada/cal.c +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** - * * - * GNAT COMPILER COMPONENTS * - * * - * C A L * - * * - * C Implementation File * - * * - * Copyright (C) 1992-2025, 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 * - * . * - * * - * GNAT was originally developed by the GNAT team at New York University. * - * Extensive contributions were provided by Ada Core Technologies Inc. * - * * - ****************************************************************************/ - -/* This file contains routines marked with pragmas Import in package */ -/* GNAT.Calendar. It is used to do Duration to timeval conversion. */ -/* These are simple wrapper functions to abstract the fact that the C */ -/* struct timeval fields are not normalized (they are generally */ -/* defined as int or long values). */ - -#if defined (__vxworks) -#ifdef __RTP__ -#include -#include -#if (_WRS_VXWORKS_MAJOR == 7) || (_WRS_VXWORKS_MINOR != 0) -#include -#endif -#else -#include -#endif -#elif defined (__nucleus__) -#include -#else -#include -#endif - -#ifdef __MINGW32__ -#include "mingw32.h" -#include -#endif - -void -__gnat_timeval_to_duration (struct timeval *t, long long *sec, long *usec) -{ - *sec = (long long) t->tv_sec; - *usec = (long) t->tv_usec; -} - -void -__gnat_duration_to_timeval (long long sec, long usec, struct timeval *t) -{ - /* here we are doing implicit conversion to the struct timeval - fields types. */ - - t->tv_sec = sec; - t->tv_usec = usec; -} diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 0b3ae02259e3..c30e5f1bf199 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -970,15 +970,61 @@ package body Checks is -- we use a different approach, expanding to: -- typ (xxx_With_Ovflo_Check (Integer_NN (x), Integer_NN (y))) + -- or + -- typ (xxx_With_Ovflo_Check (Unsigned_NN (x), Unsigned_NN (y))) -- where xxx is Add, Multiply or Subtract as appropriate -- Find check type if one exists if Dsiz <= System_Max_Integer_Size then - Ctyp := Integer_Type_For (Dsiz, Uns => False); + Ctyp := Integer_Type_For (Dsiz, + Uns => Has_Unsigned_Base_Range_Aspect (Base_Type (Typ))); - -- No check type exists, use runtime call + -- No check type exists, and the type has the unsigned base range + -- aspect; use runtime call. + + elsif Has_Unsigned_Base_Range_Aspect (Base_Type (Typ)) then + if System_Max_Integer_Size = 64 then + Ctyp := RTE (RE_Unsigned_64); + else + Ctyp := RTE (RE_Unsigned_128); + end if; + + if Nkind (N) = N_Op_Add then + if System_Max_Integer_Size = 64 then + Cent := RE_Uns_Add_With_Ovflo_Check64; + else + Cent := RE_Uns_Add_With_Ovflo_Check128; + end if; + + elsif Nkind (N) = N_Op_Subtract then + if System_Max_Integer_Size = 64 then + Cent := RE_Uns_Subtract_With_Ovflo_Check64; + else + Cent := RE_Uns_Subtract_With_Ovflo_Check128; + end if; + + else pragma Assert (Nkind (N) = N_Op_Multiply); + if System_Max_Integer_Size = 64 then + Cent := RE_Uns_Multiply_With_Ovflo_Check64; + else + Cent := RE_Uns_Multiply_With_Ovflo_Check128; + end if; + end if; + + Rewrite (N, + OK_Convert_To (Typ, + Make_Function_Call (Loc, + Name => New_Occurrence_Of (RTE (Cent), Loc), + Parameter_Associations => New_List ( + OK_Convert_To (Ctyp, Left_Opnd (N)), + OK_Convert_To (Ctyp, Right_Opnd (N)))))); + + Analyze_And_Resolve (N, Typ); + return; + + -- No check type exists, use runtime call (common case) else if System_Max_Integer_Size = 64 then @@ -1539,21 +1585,18 @@ package body Checks is return; end if; - -- Suppress checks if the subtypes are the same. The check must be - -- preserved in an assignment to a formal, because the constraint is - -- given by the actual. + -- Suppress checks if the subtypes are the same and constrained. The + -- check must be preserved in an assignment to a formal, because the + -- constraint is given by the actual. if Nkind (Original_Node (N)) /= N_Allocator + and then (if Do_Access then Designated_Type (Typ) else Typ) = S_Typ + and then Is_Constrained (S_Typ) and then (No (Lhs) or else not Is_Entity_Name (Lhs) or else No (Param_Entity (Lhs))) then - if (Etype (N) = Typ - or else (Do_Access and then Designated_Type (Typ) = S_Typ)) - and then (No (Lhs) or else not Is_Aliased_View (Lhs)) - then - return; - end if; + return; -- We can also eliminate checks on allocators with a subtype mark that -- coincides with the context type. The context type may be a subtype @@ -5492,7 +5535,9 @@ package body Checks is -- bound, because that means the result could wrap. -- Same applies for the lower bound if it is negative. - if Is_Modular_Integer_Type (Typ) then + if Is_Modular_Integer_Type (Typ) + and then not Has_Unsigned_Base_Range_Aspect (Btyp) + then if Lor > Lo and then Hir <= Hbound then Lo := Lor; end if; @@ -6223,7 +6268,9 @@ package body Checks is -- Nothing to do for unsigned integer types, which do not overflow - elsif Is_Modular_Integer_Type (Typ) then + elsif Is_Modular_Integer_Type (Typ) + and then not Has_Unsigned_Base_Range_Aspect (Typ) + then return; end if; @@ -8114,7 +8161,9 @@ package body Checks is elsif Nkind (Expr) = N_Selected_Component and then Present (Component_Clause (Entity (Selector_Name (Expr)))) - and then Is_Modular_Integer_Type (Typ) + and then + (Is_Modular_Integer_Type (Typ) + and then not Has_Unsigned_Base_Range_Aspect (Base_Type (Typ))) and then Modulus (Typ) = 2 ** Esize (Entity (Selector_Name (Expr))) then return; @@ -8896,6 +8945,8 @@ package body Checks is function Make_Bignum_Block (Loc : Source_Ptr) return Node_Id is M : constant Entity_Id := Make_Defining_Identifier (Loc, Name_uM); begin + Check_Restriction (No_Secondary_Stack, M); + return Make_Block_Statement (Loc, Declarations => diff --git a/gcc/ada/contracts.adb b/gcc/ada/contracts.adb index 7e4e4a2077f6..d87199939837 100644 --- a/gcc/ada/contracts.adb +++ b/gcc/ada/contracts.adb @@ -1131,12 +1131,12 @@ package body Contracts is if Comes_From_Source (Obj_Id) and then Is_Ghost_Entity (Obj_Id) then -- A Ghost object cannot be of a type that yields a synchronized - -- object (SPARK RM 6.9(21)). + -- object (SPARK RM 6.9(22)). if Yields_Synchronized_Object (Obj_Typ) then Error_Msg_N ("ghost object & cannot be synchronized", Obj_Id); - -- A Ghost object cannot be imported or exported (SPARK RM 6.9(7)). + -- A Ghost object cannot be imported or exported (SPARK RM 6.9(9)). -- One exception to this is the object that represents the dispatch -- table of a Ghost tagged type, as the symbol needs to be exported. @@ -1278,7 +1278,12 @@ package body Contracts is while Present (Prag) loop Prag_Nam := Pragma_Name (Prag); - if Prag_Nam = Name_Initial_Condition then + -- When Assertion_Levels are used then the pacakage can have + -- multiple consecutive Initial_Condition pragmas. + -- Find the first one here and then iterate over all of them + -- later. + + if Prag_Nam = Name_Initial_Condition and then No (Init_Cond) then Init_Cond := Prag; elsif Prag_Nam = Name_Initializes then @@ -1295,9 +1300,12 @@ package body Contracts is Analyze_Initializes_In_Decl_Part (Init); end if; - if Present (Init_Cond) then + while Present (Init_Cond) + and then Pragma_Name (Init_Cond) = Name_Initial_Condition + loop Analyze_Initial_Condition_In_Decl_Part (Init_Cond); - end if; + Init_Cond := Next_Pragma (Init_Cond); + end loop; end if; -- Restore the SPARK_Mode of the enclosing context after all delayed @@ -3274,7 +3282,7 @@ package body Contracts is -- The contract of an ignored Ghost subprogram does not need expansion, -- because the subprogram and all calls to it will be removed. - elsif Is_Ignored_Ghost_Entity (Subp_Id) then + elsif Is_Ignored_Ghost_Entity_In_Codegen (Subp_Id) then return; -- No action needed for helpers and indirect-call wrapper built to diff --git a/gcc/ada/cstand.adb b/gcc/ada/cstand.adb index 79e7083f62bf..cdf2b5d6c306 100644 --- a/gcc/ada/cstand.adb +++ b/gcc/ada/cstand.adb @@ -41,6 +41,7 @@ with Targparm; use Targparm; with Tbuild; use Tbuild; with Ttypes; use Ttypes; with Sem_Mech; use Sem_Mech; +with Sem_Prag; use Sem_Prag; with Sem_Util; use Sem_Util; with Sinfo; use Sinfo; with Sinfo.Nodes; use Sinfo.Nodes; @@ -456,6 +457,11 @@ package body CStand is procedure Make_Dummy_Index (E : Entity_Id); -- Called to provide a dummy index field value for Any_Array/Any_String + function Make_Assertion_Level_Definition + (Nam : Name_Id) return Entity_Id; + -- Create an Assertion_Level definition with the given name in the' + -- Sandard package. + procedure Pack_String_Type (String_Type : Entity_Id); -- Generate proper tree for pragma Pack that applies to given type, and -- mark type as having the pragma. @@ -558,6 +564,18 @@ package body CStand is Set_First_Index (E, Index); end Make_Dummy_Index; + ------------------------------------- + -- Make_Assertion_Level_Definition -- + ------------------------------------- + + function Make_Assertion_Level_Definition (Nam : Name_Id) return Entity_Id + is + Level : constant Entity_Id := Make_Assertion_Level (Stloc, Nam); + begin + Insert_Assertion_Level (Level); + return Level; + end Make_Assertion_Level_Definition; + ---------------------- -- Pack_String_Type -- ---------------------- @@ -1494,6 +1512,11 @@ package body CStand is Set_Size_Known_At_Compile_Time (Standard_Duration); end Build_Duration; + Standard_Level_Static := Make_Assertion_Level_Definition (Name_Static); + Standard_Level_Runtime := Make_Assertion_Level_Definition (Name_Runtime); + Standard_Level_Default := + Make_Assertion_Level_Definition (Name_uDefault_Assertion_Level); + -- Build standard exception type. Note that the type name here is -- actually used in the generated code, so it must be set correctly. -- The type Standard_Exception_Type must be consistent with the type @@ -1935,6 +1958,10 @@ package body CStand is P ("-- characteristics of the Standard types for this compiler"); Write_Eol; + P ("pragma Assertion_Level (Runtime);"); + P ("pragma Assertion_Level (Static);"); + Write_Eol; + P ("package Standard is"); P ("pragma Pure (Standard);"); Write_Eol; diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb index f250d7429a96..b7c54a000662 100644 --- a/gcc/ada/debug.adb +++ b/gcc/ada/debug.adb @@ -152,7 +152,7 @@ package body Debug is -- d_l Disable strict alignment of array types with aliased component -- d_m Run adareducer on crash -- d_n - -- d_o + -- d_o Disable Backend_Overflow_Checks_On_Target; used for testing. -- d_p Ignore assertion pragmas for elaboration -- d_q Do not enforce freezing for equality operator of boolean subtype -- d_r Disable the use of the return slot in functions @@ -995,6 +995,9 @@ package body Debug is -- d_l The compiler does not enforce the strict alignment of array types -- that are declared with an aliased component. + -- d_o The compiler disables Backend_Overflow_Checks_On_Target; used to + -- test the frontend support on targets without overflow checks. + -- d_p The compiler ignores calls to subprograms which verify the run-time -- semantics of invariants and postconditions in both the static and -- dynamic elaboration models. diff --git a/gcc/ada/doc/gnat_rm/gnat_language_extensions.rst b/gcc/ada/doc/gnat_rm/gnat_language_extensions.rst index ff111ddd3a12..f80ea52d1a16 100644 --- a/gcc/ada/doc/gnat_rm/gnat_language_extensions.rst +++ b/gcc/ada/doc/gnat_rm/gnat_language_extensions.rst @@ -581,6 +581,136 @@ Restricting the position of controlling parameter offers several advantages: * The result of a function is never a controlling result. +Generalized Finalization +------------------------ + +The ``Finalizable`` aspect can be applied to any record type, tagged or not, +to specify that it provides the same level of control on the operations of +initialization, finalization, and assignment of objects as the controlled +types (see RM 7.6(2) for a high-level overview). The only restriction is +that the record type must be a root type, in other words not a derived type. + +The aspect additionally makes it possible to specify relaxed semantics for +the finalization operations by means of the ``Relaxed_Finalization`` setting. +Here is the archetypal example: + +.. code-block:: ada + + type T is record + ... + end record + with Finalizable => (Initialize => Initialize, + Adjust => Adjust, + Finalize => Finalize, + Relaxed_Finalization => True); + + procedure Adjust (Obj : in out T); + procedure Finalize (Obj : in out T); + procedure Initialize (Obj : in out T); + +The three procedures have the same profile, with a single ``in out`` parameter, +and also have the same dynamic semantics as for controlled types: + + - ``Initialize`` is called when an object of type ``T`` is declared without + initialization expression. + + - ``Adjust`` is called after an object of type ``T`` is assigned a new value. + + - ``Finalize`` is called when an object of type ``T`` goes out of scope (for + stack-allocated objects) or is deallocated (for heap-allocated objects). + It is also called when the value is replaced by an assignment. + +However, when ``Relaxed_Finalization`` is either ``True`` or not explicitly +specified, the following differences are implemented relative to the semantics +of controlled types: + +* The compiler has permission to perform no automatic finalization of + heap-allocated objects: ``Finalize`` is only called when such an object + is explicitly deallocated, or when the designated object is assigned a new + value. As a consequence, no runtime support is needed for performing + implicit deallocation. In particular, no per-object header data is needed + for heap-allocated objects. + + Heap-allocated objects allocated through a nested access type will therefore + **not** be deallocated either. The result is simply that memory will be leaked + in this case. + +* The ``Adjust`` and ``Finalize`` procedures are automatically considered as + having the :ref:`No_Raise_Aspect` specified for them. In particular, the + compiler has permission to enforce none of the guarantees specified by the + RM 7.6.1 (14/1) and subsequent subclauses. + +Simple example of ref-counted type: + +.. code-block:: ada + + type T is record + Value : Integer; + Ref_Count : Natural := 0; + end record; + + procedure Inc_Ref (X : in out T); + procedure Dec_Ref (X : in out T); + + type T_Access is access all T; + + type T_Ref is record + Value : T_Access; + end record + with Finalizable => (Adjust => Adjust, + Finalize => Finalize); + + procedure Adjust (Ref : in out T_Ref) is + begin + Inc_Ref (Ref.Value); + end Adjust; + + procedure Finalize (Ref : in out T_Ref) is + begin + Def_Ref (Ref.Value); + end Finalize; + +Simple file handle that ensures resources are properly released: + +.. code-block:: ada + + package P is + type File (<>) is limited private; + + function Open (Path : String) return File; + + procedure Close (F : in out File); + + private + type File is limited record + Handle : ...; + end record + with Finalizable (Finalize => Close); + end P; + +Finalizable tagged types +^^^^^^^^^^^^^^^^^^^^^^^^ + +The aspect is inherited by derived types and the primitives may be overridden +by the derivation. The compiler-generated calls to these operations are then +dispatching whenever it makes sense, i.e. when the object in question is of a +class-wide type and the class includes at least one finalizable tagged type. + +Composite types +^^^^^^^^^^^^^^^ + +When a finalizable type is used as a component of a composite type, the latter +becomes finalizable as well. The three primitives are derived automatically +in order to call the primitives of their components. The dynamic semantics is +the same as for controlled components of composite types. + +Interoperability with controlled types +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Finalizable types are fully interoperable with controlled types, in particular +it is possible for a finalizable type to have a controlled component and vice +versa, but the stricter dynamic semantics, in other words that of controlled +types, is applied in this case. .. _Experimental_Language_Extensions: @@ -1495,137 +1625,6 @@ of the call is erroneous if the tag of the actual is changed while the formal parameter exists (that is, before leaving the corresponding callable construct). This is analogous to the RM 6.4.1(18) rule about discriminated parameters. -Generalized Finalization ------------------------- - -The ``Finalizable`` aspect can be applied to any record type, tagged or not, -to specify that it provides the same level of control on the operations of -initialization, finalization, and assignment of objects as the controlled -types (see RM 7.6(2) for a high-level overview). The only restriction is -that the record type must be a root type, in other words not a derived type. - -The aspect additionally makes it possible to specify relaxed semantics for -the finalization operations by means of the ``Relaxed_Finalization`` setting. -Here is the archetypal example: - -.. code-block:: ada - - type T is record - ... - end record - with Finalizable => (Initialize => Initialize, - Adjust => Adjust, - Finalize => Finalize, - Relaxed_Finalization => True); - - procedure Adjust (Obj : in out T); - procedure Finalize (Obj : in out T); - procedure Initialize (Obj : in out T); - -The three procedures have the same profile, with a single ``in out`` parameter, -and also have the same dynamic semantics as for controlled types: - - - ``Initialize`` is called when an object of type ``T`` is declared without - initialization expression. - - - ``Adjust`` is called after an object of type ``T`` is assigned a new value. - - - ``Finalize`` is called when an object of type ``T`` goes out of scope (for - stack-allocated objects) or is deallocated (for heap-allocated objects). - It is also called when the value is replaced by an assignment. - -However, when ``Relaxed_Finalization`` is either ``True`` or not explicitly -specified, the following differences are implemented relative to the semantics -of controlled types: - -* The compiler has permission to perform no automatic finalization of - heap-allocated objects: ``Finalize`` is only called when such an object - is explicitly deallocated, or when the designated object is assigned a new - value. As a consequence, no runtime support is needed for performing - implicit deallocation. In particular, no per-object header data is needed - for heap-allocated objects. - - Heap-allocated objects allocated through a nested access type will therefore - **not** be deallocated either. The result is simply that memory will be leaked - in this case. - -* The ``Adjust`` and ``Finalize`` procedures are automatically considered as - having the :ref:`No_Raise_Aspect` specified for them. In particular, the - compiler has permission to enforce none of the guarantees specified by the - RM 7.6.1 (14/1) and subsequent subclauses. - -Simple example of ref-counted type: - -.. code-block:: ada - - type T is record - Value : Integer; - Ref_Count : Natural := 0; - end record; - - procedure Inc_Ref (X : in out T); - procedure Dec_Ref (X : in out T); - - type T_Access is access all T; - - type T_Ref is record - Value : T_Access; - end record - with Finalizable => (Adjust => Adjust, - Finalize => Finalize); - - procedure Adjust (Ref : in out T_Ref) is - begin - Inc_Ref (Ref.Value); - end Adjust; - - procedure Finalize (Ref : in out T_Ref) is - begin - Def_Ref (Ref.Value); - end Finalize; - -Simple file handle that ensures resources are properly released: - -.. code-block:: ada - - package P is - type File (<>) is limited private; - - function Open (Path : String) return File; - - procedure Close (F : in out File); - - private - type File is limited record - Handle : ...; - end record - with Finalizable (Finalize => Close); - end P; - -Finalizable tagged types -^^^^^^^^^^^^^^^^^^^^^^^^ - -The aspect is inherited by derived types and the primitives may be overridden -by the derivation. The compiler-generated calls to these operations are then -dispatching whenever it makes sense, i.e. when the object in question is of a -class-wide type and the class includes at least one finalizable tagged type. - -Composite types -^^^^^^^^^^^^^^^ - -When a finalizable type is used as a component of a composite type, the latter -becomes finalizable as well. The three primitives are derived automatically -in order to call the primitives of their components. The dynamic semantics is -the same as for controlled components of composite types. - -Interoperability with controlled types -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Finalizable types are fully interoperable with controlled types, in particular -it is possible for a finalizable type to have a controlled component and vice -versa, but the stricter dynamic semantics, in other words that of controlled -types, is applied in this case. - .. _No_Raise_Aspect: No_Raise aspect @@ -1861,3 +1860,157 @@ be private to the enclosing package. This is necessary due to the previously mentioned legality rule, to prevent breaking the privacy of the type when imposing that rule on outside types that derive from the private view of the type. + +Structural Generic Instantiation +-------------------------------- + +The compiler implements a second kind of generic instantiation, called +"structural", alongside the traditional instantiation specified by the +language, which is defined as follows: the structural instantiation of +a generic unit on given actual parameters is the anonymous instantiation +of the generic unit on the actual parameters done in the outermost scope +where it would be legal to do an identical traditional instantiation. + +There is at most one structural instantiation of a generic unit on given +actual parameters done in a partition. + +Structural generic instances (the product of structural instantiation) +are implicitly created whenever a reference to them is made in a place +where a name is accepted by the language. + +Syntax +^^^^^^ + +.. code-block:: text + + name ::= { set of productions specified in the RM } + | structural_generic_instance_name + + structural_generic_instance_name ::= name generic_actual_part + +Legality Rules +^^^^^^^^^^^^^^ + +The ``name`` in a ``structural_generic_instance_name`` shall denote a generic +unit that is preelaborated. Note that, unlike in a traditional instantiation, +there are no square brackets around the ``generic_actual_part`` in the second +production, which means that it is mandatory and, therefore, that the generic +unit shall have at least one generic formal parameter. + +The generic unit shall not take a generic formal object of mode ``in out``. +If the generic unit takes a generic formal object of mode ``in``, then the +corresponding generic actual parameter shall be a static expression. + +A ``structural_generic_instance_name`` shall not be present in a library +unit if the structural instance is also a library unit and has a semantic +dependence on the former. + +Static Semantics +^^^^^^^^^^^^^^^^ + +A ``structural_generic_instance_name`` denotes the instance that is the +product of the structural instantiation of a generic unit on the specified +actual parameters. This instance is unique to a partition. + +Example: + +.. code-block:: ada + + with Ada.Containers.Vectors; + + procedure P is + V : Ada.Containers.Vectors(Positive,Integer).Vector; + + begin + V.Append (1); + V.Append (0); + Ada.Containers.Vectors(Positive,Integer).Generic_Sorting("<").Sort (V); + end; + +This procedure references two structural instantiations of two different generic +units: ``Ada.Containers.Vectors(Positive,Integer)`` is the structural instance +of the generic unit ``Ada.Containers.Vectors`` on ``Positive`` and ``Integer`` +and ``Ada.Containers.Vectors(Positive,Integer).Generic_Sorting("<")`` is the +structural instance of the nested generic unit +``Ada.Containers.Vectors(Positive,Integer).Generic_Sorting`` on ``"<"``. + +Note that the following example is illegal: + +.. code-block:: ada + + with Ada.Containers.Vectors; + + package Q is + type T is record + I : Integer; + end record; + + V : Ada.Containers.Vectors(Positive,T).Vector; + end Q; + +The reason is that ``Ada.Containers.Vectors``, ``Positive`` and ``Q.T`` being +library-level entities, the structural instance ``Ada.Containers.Vectors(Positive,T)`` is a library unit with a dependence +on ``Q`` and, therefore, cannot be referenced from within ``Q``. The simple +way out is to declare a traditional instantiation in this case: + +.. code-block:: ada + + with Ada.Containers.Vectors; + + package Q is + type T is record + I : Integer; + end record; + + package Vectors_Of_T is new Ada.Containers.Vectors(Positive,T); + + V : Vectors_Of_T.Vector; + end Q; + +But the following example is legal: + +.. code-block:: ada + + with Ada.Containers.Vectors; + + procedure P is + type T is record + I : Integer; + end record; + + V : Ada.Containers.Vectors(Positive,T).Vector; + end; + +because the structural instance ``Ada.Containers.Vectors(Positive,T)`` is +not a library unit. + +The first example can be rewritten in a less verbose manner: + +.. code-block:: ada + + with Ada.Containers.Vectors; use Ada.Containers.Vectors(Positive,Integer); + + procedure P is + V : Vector; + + begin + V.Append (1); + V.Append (0); + Generic_Sorting("<").Sort (V); + end; + +Another example, which additionally uses the inference of dependent types: + +.. code-block:: ada + + with Ada.Unchecked_Deallocation; + + procedure P is + + type Integer_Access is access all Integer; + + A : Integer_Access := new Integer'(1); + + begin + Ada.Unchecked_Deallocation(Name => Integer_Access) (A); + end; diff --git a/gcc/ada/doc/gnat_rm/implementation_advice.rst b/gcc/ada/doc/gnat_rm/implementation_advice.rst index d4fdd09fccde..7eccbbcebe03 100644 --- a/gcc/ada/doc/gnat_rm/implementation_advice.rst +++ b/gcc/ada/doc/gnat_rm/implementation_advice.rst @@ -1218,7 +1218,8 @@ RM E.5(28-29): Partition Communication Subsystem should allow them to block until the corresponding subprogram body returns." -A separately supplied PCS that can be used with GNAT when combined with the PolyORB product. +A separately supplied PCS that can be used with GNAT when combined with the PolyORB product (NB! See the note in :ref:`polyORB` regarding the lifetime +of this product). "The ``Write`` operation on a stream of type ``Params_Stream_Type`` should raise ``Storage_Error`` if it runs out of space trying to diff --git a/gcc/ada/doc/gnat_rm/implementation_defined_aspects.rst b/gcc/ada/doc/gnat_rm/implementation_defined_aspects.rst index a36956805125..69996b49d6d3 100644 --- a/gcc/ada/doc/gnat_rm/implementation_defined_aspects.rst +++ b/gcc/ada/doc/gnat_rm/implementation_defined_aspects.rst @@ -267,6 +267,89 @@ or propagate an exception). For the syntax and semantics of this aspect, see the SPARK 2014 Reference Manual, section 6.1.10. +Aspect Extended_Access +====================== + +This nonoverridable boolean-valued type-related representation aspect can be +specified as part of a full_type_declaration for a general access type +designating an unconstrained array subtype. + +The absence of an Extended_Access aspect specification for such a +full_type_declaration is equivalent to an explicit +"Extended_Access => False" specification. This implies +that the aspect is never unspecified for an eligible access type. +An access type for which this aspect is True is said to be an extended access +type; this includes the case of a type derived from an extended access type. +Similarly, a value of such a type is said to be an extended access value. + +The representation of an extended access value is different than that of +other access values. This representation makes it possible to designate +objects that cannot be designated using the usual "thin" or "fat" access +representations for an access type designating an unconstrained array +subtype (notably slices and array objects imported from other languages). + +In particular, two rules are modified in determining the legality of an Access +or Unchecked_Access attribute reference if the expected access type is +an extended access type: + +* A slice of an aliased array object of a non-bitpacked type (more precisely, + of an array type having independently addressable components) is considered + to be aliased (and the accessibility level of a slice of an array object is + defined to be that of the array object); this also applies to renamings + of such slices, slices of such renamings, etc. + +* The requirement that the nominal subtype of the prefix shall statically + match the designated subtype of the access type need not be met. + +The Size aspect (and other aspects including Stream_Size, Object_Size, +and Alignment) of an extended access type may depend on the properties of the +designated type. Further details of this dependence are not documented. + +An extended access value is not convertible to a non-extended access type, +although conversions in the opposite direction are allowed. We don't want +to allow + +.. code-block:: ada + + type Big_Ref is access all String with Extended_Access; + type Small_Ref is access all String; + Obj : aliased String := "abcde"; + Big_Ptr : Big_Ref := Obj (2 .. 4)'Access; -- OK + Small_Ptr : Small_Ref := Small_Ref (Big_Ptr); -- ERROR: illegal conversion + +because there is no way to represent the result of such a conversion. + +A dereference of an extended access value (or a reference to a renaming +thereof) shall not occur in any of the following contexts: + +* as an operative constituent of the prefix of an Access or + Unchecked_Access attribute reference whose expected type is not extended; or + +* as an operative constituent of an actual parameter in a call where + the corresponding formal parameter is explicitly aliased. + +For the same reasons that explicit conversions from an extended access type to a +non-extended access type are forbidden, we also need to disallow getting the +same effect via a Extended_Ptr.all'Access reference; this includes the case +of passing Extended_Ptr.all as an actual parameter in a call where the +corresponding formal parameter is explicitly aliased (because the callee +could evaluate Formal_Parameter'Access). This goal is accomplished by +adjusting the definition of the term "aliased". A dereference of an extended +value occurring in one of these contexts is defined to denote +a nonaliased view. This has the desired effect because these contexts require +an aliased view. Continuing the preceding example, this rule disallows + +.. code-block:: ada + + Sneaky_1 : Small_Ptr := Big_Ptr.all'Access; -- ERROR: illegal 'Access prefix + + function Make (Str : aliased in out String) return Small_Ptr + is (Str'Access); -- OK + + Sneaky_2 : Small_Ptr := Make (Str => Big_Ptr.all); -- ERROR: bad parameter + +for the same reason given above in the case of an explicit type conversion. + Aspect Extensions_Visible ========================= .. index:: Extensions_Visible diff --git a/gcc/ada/doc/gnat_rm/implementation_defined_characteristics.rst b/gcc/ada/doc/gnat_rm/implementation_defined_characteristics.rst index f7746c8e72fe..887cc110d668 100644 --- a/gcc/ada/doc/gnat_rm/implementation_defined_characteristics.rst +++ b/gcc/ada/doc/gnat_rm/implementation_defined_characteristics.rst @@ -377,7 +377,8 @@ may have been set by a call to ``Ada.Command_Line.Set_Exit_Status``). * "The mechanisms for building and running partitions. See 10.2(24)." -GNAT itself supports programs with only a single partition. The PolyORB product (which also includes an implementation of the PCS) provides a completely flexible method for building and running programs consisting of multiple partitions. See the separate PolyORB user guide for details. +GNAT itself supports programs with only a single partition. The PolyORB product (which also includes an implementation of the PCS) provides a completely flexible method for building and running programs consisting of multiple partitions. **NB!** See the note in :ref:`polyORB` regarding the lifetime +of this product. * "The details of program execution, including program @@ -390,8 +391,7 @@ See separate section on compilation model. implementation. See 10.2(28)." Passive partitions are supported on targets where shared memory is -provided by the operating system. See the PolyORB user guide for -further details. +provided by the operating system. **NB!** See the note in :ref:`polyORB` regarding the lifetime of this product. * "The information returned by ``Exception_Message``. See 11.4.1(10)." @@ -1185,27 +1185,29 @@ Unknown. programs. See E(5)." The PolyORB product provides means creating and executing -distributed programs. See the PolyORB user guide for further details. +distributed programs. **NB!** See the note in :ref:`polyORB` regarding the lifetime of this product. * "Any events that can result in a partition becoming inaccessible. See E.1(7)." See the PolyORB user guide for full details on such events. +**NB!** Consider the note in :ref:`polyORB` regarding the lifetime +of this product. * "The scheduling policies, treatment of priorities, and management of shared resources between partitions in certain cases. See E.1(11)." See the PolyORB user guide for full details on these aspects of -multi-partition execution. +multi-partition execution. **NB!** Consider the note in :ref:`polyORB` regarding the lifetime of this product. * "Whether the execution of the remote subprogram is immediately aborted as a result of cancellation. See E.4(13)." See the PolyORB user guide for details on the effect of abort in -a distributed application. +a distributed application. **NB!** Consider the note in :ref:`polyORB` regarding the lifetime of this product. * "The range of type System.RPC.Partition_Id. See E.5(14)." @@ -1216,7 +1218,7 @@ System.RPC.Partition_ID'Last is Integer'Last. See source file :file:`s-rpc.ads`. "Implementation-defined interfaces in the PCS. See E.5(26)." See the PolyORB user guide for a full description of all -implementation defined interfaces. +implementation defined interfaces. **NB!** See the note in :ref:`polyORB` regarding the lifetime of this product. * "The values of named numbers in the package diff --git a/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst b/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst index 3986298d11e9..183b2ff26cd5 100644 --- a/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst +++ b/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst @@ -398,9 +398,8 @@ The analyzed pragma is retained in the tree, but not otherwise processed by any part of the GNAT compiler, except to generate corresponding note lines in the generated ALI file. For the format of these note lines, see the compiler source file lib-writ.ads. This pragma is intended for use by -external tools, including ASIS. The use of pragma Annotate does not -affect the compilation process in any way. This pragma may be used as -a configuration pragma. +external tools. The use of pragma Annotate does not affect the compilation +process in any way. This pragma may be used as a configuration pragma. Pragma Assert ============= @@ -466,6 +465,10 @@ of Ada from 2005 on. In GNAT, it is implemented in all versions of Ada, and the DISABLE policy is an implementation-defined addition. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + Pragma Assert_And_Cut ===================== @@ -490,6 +493,25 @@ a subprogram into sections for the purposes of testing or formal verification. The pragma also serves as useful documentation. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + +Pragma Assertion_Level +======================= + +Syntax:: + + pragma Assertion_Level (LEVEL_IDENTIFIER + [, depends => DEPENDENCY_DESCRIPTOR]); + + DEPENDENCY_DESCRIPTOR ::= LEVEL_IDENTIFIER | LEVEL_IDENTIFIER_LIST + + LEVEL_IDENTIFIER_LIST ::= '[' LEVEL_IDENTIFIER {, LEVEL_IDENTIFIER} ']' + +For the semantics of this pragma, see the SPARK 2014 Reference Manual, +section 11.4.3. + Pragma Assertion_Policy ======================= @@ -501,7 +523,7 @@ Syntax:: ASSERTION_KIND => POLICY_IDENTIFIER {, ASSERTION_KIND => POLICY_IDENTIFIER}); - ASSERTION_KIND ::= RM_ASSERTION_KIND | ID_ASSERTION_KIND + ASSERTION_KIND ::= RM_ASSERTION_KIND | ID_ASSERTION_KIND | ASSERTION_LEVEL RM_ASSERTION_KIND ::= Assert | Static_Predicate | @@ -541,6 +563,10 @@ The assertion kinds ``RM_ASSERTION_KIND`` are those defined in the Ada standard. The assertion kinds ``ID_ASSERTION_KIND`` are implementation defined additions recognized by the GNAT compiler. +Additionally the pragma can apply to an assertion level defined by the +``Assertion_Level`` pragma. For more details see the SPARK 2014 Reference +Manual, section 11.4.2. + The pragma applies in both cases to pragmas and aspects with matching names, e.g. ``Pre`` applies to the Pre aspect, and ``Precondition`` applies to both the ``Precondition`` pragma @@ -608,6 +634,10 @@ but it acts as a useful run-time check that the assumption is met, and documents the need to ensure that it is met by reference to information outside the program. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + Pragma Assume_No_Invalid_Values =============================== .. index:: Invalid representations @@ -1297,6 +1327,10 @@ call, as determined by the corresponding case guard evaluating to True, and that the consequence for this case should hold when the subprogram returns. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + Pragma Convention_Identifier ============================ .. index:: Conventions, synonyms @@ -1505,6 +1539,10 @@ pragmas can be enabled either by use of the command line switch *-gnata* or by use of the pragma ``Check_Policy`` with a first argument of ``Debug``. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + Pragma Debug_Policy =================== @@ -1534,6 +1572,10 @@ Syntax: For the semantics of this pragma, see the entry for aspect ``Default_Initial_Condition`` in the SPARK 2014 Reference Manual, section 7.3.3. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + Pragma Default_Scalar_Storage_Order =================================== .. index:: Default_Scalar_Storage_Order @@ -2922,6 +2964,10 @@ Syntax: For the semantics of this pragma, see the entry for aspect ``Initial_Condition`` in the SPARK 2014 Reference Manual, section 7.1.6. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + Pragma Initialize_Scalars ========================= .. index:: debugging with Initialize_Scalars @@ -3274,6 +3320,10 @@ invariant pragma for the same entity. For further details on the use of this pragma, see the Ada 2012 documentation of the Type_Invariant aspect. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + Pragma Keep_Names ================= @@ -3651,6 +3701,10 @@ may be used to refer to the value of an expression on entry to the loop. This attribute can only be used within the expression of a ``Loop_Invariant`` pragma. For full details, see documentation of attribute ``Loop_Entry``. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + Pragma Loop_Optimize ==================== @@ -3753,6 +3807,10 @@ statements. The ``Loop_Entry`` attribute may be used within the expressions of the ``Loop_Variant`` pragma to refer to values on entry to the loop. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + Pragma Machine_Attribute ======================== @@ -4627,6 +4685,10 @@ if there is no separate subprogram declaration, then it can appear at the start of the declarations in a subprogram body (preceded only by other pragmas). +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + Pragma Postcondition ==================== .. index:: Postcondition @@ -4799,6 +4861,10 @@ use of the pragma identifier ``Check``. Historically, pragma Ada 2012, and has been retained in its original form for compatibility purposes. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + Pragma Post_Class ================= .. index:: Post @@ -4833,6 +4899,10 @@ aspects, but is prepared to ignore the pragmas. The assertion policy that controls this pragma is ``Post'Class``, not ``Post_Class``. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + Pragma Pre ========== .. index:: Pre @@ -4857,6 +4927,10 @@ if there is no separate subprogram declaration, then it can appear at the start of the declarations in a subprogram body (preceded only by other pragmas). +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + Pragma Precondition =================== .. index:: Preconditions @@ -4917,6 +4991,10 @@ use of the pragma identifier ``Check``. Historically, pragma Ada 2012, and has been retained in its original form for compatibility purposes. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + .. _Pragma-Predicate: Pragma Predicate @@ -4977,6 +5055,10 @@ fundamentally changed (for example a membership test defined for subtype B). When following this approach, the use of predicates should be avoided. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + Pragma Predicate_Failure ======================== @@ -5074,6 +5156,10 @@ aspects, but is prepared to ignore the pragmas. The assertion policy that controls this pragma is ``Pre'Class``, not ``Pre_Class``. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + Pragma Priority_Specific_Dispatching ==================================== @@ -5562,6 +5648,10 @@ Syntax: For the semantics of this pragma, see the entry for aspect ``Refined_Post`` in the SPARK 2014 Reference Manual, section 7.2.7. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + .. _Pragma-Refined_State: Pragma Refined_State @@ -6547,6 +6637,9 @@ The ``Subprogram_Variant`` pragma is intended to be an exact replacement for the implementation-defined ``Subprogram_Variant`` aspect, and shares its restrictions and semantics. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. Pragma Subtitle =============== @@ -6975,6 +7068,10 @@ does not permit a string parameter, and it is controlled by the assertion identifier ``Type_Invariant`` rather than ``Invariant``. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + .. _Pragma-Type_Invariant_Class: Pragma Type_Invariant_Class @@ -7004,6 +7101,10 @@ aspects, but is prepared to ignore the pragmas. The assertion policy that controls this pragma is ``Type_Invariant'Class``, not ``Type_Invariant_Class``. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + Pragma Unchecked_Union ====================== .. index:: Unions in C diff --git a/gcc/ada/doc/gnat_rm/obsolescent_features.rst b/gcc/ada/doc/gnat_rm/obsolescent_features.rst index 3ba502188e03..d78d986f4051 100644 --- a/gcc/ada/doc/gnat_rm/obsolescent_features.rst +++ b/gcc/ada/doc/gnat_rm/obsolescent_features.rst @@ -5,9 +5,19 @@ Obsolescent Features ******************** This chapter describes features that are provided by GNAT, but are -considered obsolescent since there are preferred ways of achieving -the same effect. These features are provided solely for historical -compatibility purposes. +considered obsolescent since there are other, more appropriate, ways +of achieving the same effect. These features are provided solely for +historical compatibility purposes. + +.. _polyORB: + +PolyORB +======== + +AWS is a deprecated product. It will be baselined with the GNAT Pro +release 28. After this release, there will be no new versions of this +product. Contact your sales representative or send a message to +sales@adacore.com to get recommendations for replacements. .. _pragma_No_Run_Time: diff --git a/gcc/ada/doc/gnat_rm/security_hardening_features.rst b/gcc/ada/doc/gnat_rm/security_hardening_features.rst index 015b9ce35331..169d58b43ea1 100644 --- a/gcc/ada/doc/gnat_rm/security_hardening_features.rst +++ b/gcc/ada/doc/gnat_rm/security_hardening_features.rst @@ -10,6 +10,8 @@ are provided by GNAT. The features in this chapter are currently experimental and subject to change. +These features are supported only by the GCC back end, not by LLVM. + .. Register Scrubbing: Register Scrubbing diff --git a/gcc/ada/doc/gnat_rm/specialized_needs_annexes.rst b/gcc/ada/doc/gnat_rm/specialized_needs_annexes.rst index f34368c8c94d..666e0b30a71a 100644 --- a/gcc/ada/doc/gnat_rm/specialized_needs_annexes.rst +++ b/gcc/ada/doc/gnat_rm/specialized_needs_annexes.rst @@ -17,7 +17,7 @@ Ada 95, Ada 2005, Ada 2012, and Ada 2022 define a number of Specialized Needs An *Distributed Systems (Annex E)* Stub generation is fully implemented in the GNAT compiler. In addition, a complete compatible PCS is available as part of ``PolyORB``, - a separate product. Note, that PolyORB is a deprecated product and will be eventually replaced with other technologies such as ``RTI``. + a separate product. **NB!** See the note in :ref:`polyORB` regarding the lifetime of this product. *Information Systems (Annex F)* diff --git a/gcc/ada/doc/gnat_rm/the_gnat_library.rst b/gcc/ada/doc/gnat_rm/the_gnat_library.rst index d041090eab06..bd17490e5cf6 100644 --- a/gcc/ada/doc/gnat_rm/the_gnat_library.rst +++ b/gcc/ada/doc/gnat_rm/the_gnat_library.rst @@ -663,6 +663,18 @@ sequences for various UCS input formats. General routines for swapping the bytes in 2-, 4-, and 8-byte quantities. Machine-specific implementations are available in some cases. +.. _`GNAT.C_Time_(g-c_time.ads)`: + +``GNAT.C_Time`` (:file:`g-c_time.ads`) +====================================== + +.. index:: GNAT.C_Time (g-c_time.ads) + +.. index:: Time + +Provides the time_t, timeval and timespec types corresponding to the C +types defined by the OS, as well as various conversion functions. + .. _`GNAT.Calendar_(g-calend.ads)`: ``GNAT.Calendar`` (:file:`g-calend.ads`) @@ -674,8 +686,6 @@ Machine-specific implementations are available in some cases. Extends the facilities provided by ``Ada.Calendar`` to include handling of days of the week, an extended ``Split`` and ``Time_Of`` capability. -Also provides conversion of ``Ada.Calendar.Time`` values to and from the -C ``timeval`` format. .. _`GNAT.Calendar.Time_IO_(g-catiio.ads)`: @@ -2037,7 +2047,8 @@ technically an implementation-defined addition). This package provides facilities for partition interfacing. It is used primarily in a distribution context when using Annex E -with ``PolyORB``. +with ``PolyORB``. **NB!** See the note in :ref:`polyORB` regarding +the lifetime of this product. .. _`System.Pool_Global_(s-pooglo.ads)`: 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 fdf19481a6fc..9893c5b77276 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 @@ -1608,8 +1608,12 @@ Alphabetical List of All Switches .. index:: -gnateG (gcc) -:switch:`-gnateG` - Save result of preprocessing in a text file. +:switch:`-gnateG[bce]` + Save result of preprocessing in a text file. An optional character (b, c, + or e) can be appended to indicate that filtered lines are to be replaced by + blank lines, comment lines that include the filtered line, or empty comment + lines ("--!"), respectively. The default is to replace filtered lines with + blank lines. .. index:: -gnateH (gcc) @@ -1933,13 +1937,13 @@ Alphabetical List of All Switches Ignore representation clauses. When this switch is used, representation clauses are treated as comments. This is useful when initially porting code where you want to ignore rep clause - problems, and also for compiling foreign code (particularly - for use with ASIS). The representation clauses that are ignored - are: enumeration_representation_clause, record_representation_clause, - and attribute_definition_clause for the following attributes: - Address, Alignment, Bit_Order, Component_Size, Machine_Radix, - Object_Size, Scalar_Storage_Order, Size, Small, Stream_Size, - and Value_Size. Pragma Default_Scalar_Storage_Order is also ignored. + problems, and also for compiling foreign code. The representation + clauses that are ignored are: enumeration_representation_clause, + record_representation_clause, and attribute_definition_clause for the + following attributes: Address, Alignment, Bit_Order, Component_Size, + Machine_Radix, Object_Size, Scalar_Storage_Order, Size, Small, + Stream_Size, and Value_Size. + Pragma Default_Scalar_Storage_Order is also ignored. Note that this option should be used only for compiling -- the code is likely to malfunction at run time. @@ -3751,7 +3755,7 @@ of the pragma in the :title:`GNAT_Reference_manual`). * Assignment of an item to itself. - * Type conversion that converts an expression to its own type. + * Type conversion that converts an expression to its own subtype. * Use of the attribute ``Base`` where ``typ'Base`` is the same as ``typ``. @@ -8116,20 +8120,18 @@ We provide two options that you can use to build code with GNAT LLVM: * ``gprbuild`` can detect and use GNAT LLVM when it is installed. - ``gprbuild`` uses the first applicable compiler on the executable - search path, including GNAT LLVM. An easy way to build with GNAT - LLVM is to make it available on the operating system's search path - before any other Ada compiler (such as the GCC version of GNAT). To - avoid accidentally using a different compiler than the one you want - to use, we recommend generating an explicit toolchain configuration - file with ``gprconfig`` and using it with ``gprbuild``; see the - *GPRbuild and GPR Companion Tools User's Guide* for details. You - can determine from the first line of the :file:`.ali` file - which version of GNAT built that file because it contains either - :code:`GNAT` or :code:`GNAT-LLVM`. - - You can also explicitly select GNAT LLVM in your existing GPR project - file by adding :code:`for Toolchain_Name("Ada") use "GNAT_LLVM";` + ``gprbuild`` uses the first applicable compiler on the executable search + path, including GNAT LLVM. An easy way to build with GNAT LLVM is to make + it available on the operating system's search path before any other Ada + compiler (such as the GCC version of GNAT). To avoid accidentally using a + different compiler than the one you want to use, we recommend explicitly + selecting GNAT LLVM in your existing GPR project file by adding + :code:`for Toolchain_Name ("Ada") use "GNAT_LLVM";`. You can also + generate an explicit toolchain configuration file with ``gprconfig`` and + use it with ``gprbuild``; see the *GPRbuild and GPR Companion Tools + User's Guide* for details. You can determine from the first line of the + :file:`.ali` file which version of GNAT built that file because it + contains either :code:`GNAT` or :code:`GNAT-LLVM`. .. only:: PRO @@ -8145,5 +8147,4 @@ GNAT. .. only:: PRO - It provides the same runtimes with the exception that light runtimes - are not currently included with the native compilers. + It provides the same runtimes. diff --git a/gcc/ada/doc/gnat_ugn/the_gnat_compilation_model.rst b/gcc/ada/doc/gnat_ugn/the_gnat_compilation_model.rst index 891886b53601..94b41b52adf2 100644 --- a/gcc/ada/doc/gnat_ugn/the_gnat_compilation_model.rst +++ b/gcc/ada/doc/gnat_ugn/the_gnat_compilation_model.rst @@ -2931,6 +2931,18 @@ Switches for ``gnatprep`` don't specify a value, the symbol is defined to be ``True``. You can use this switch instead of providing a definition file. +.. index:: -e (gnatprep) + +:switch:`-e` + Causes both preprocessor lines and the lines deleted by + preprocessing to be replaced by empty comment lines marked + with ``"--!"`` (and no other text) in the output source file, + preserving line numbers in the output file. This option can + be useful as an alternative to :switch:`-b` and :switch:`-c` + when compilation style switches like :switch:`-gnatyu` or + :switch:`-gnatyM` are used (to avoid warnings about multiple + blank lines or lines too long). + .. index:: -r (gnatprep) :switch:`-r` @@ -3248,7 +3260,7 @@ that relate to integrated preprocessing. Causes both preprocessor lines and the lines deleted by preprocessing to be replaced by blank lines, preserving the line number. This switch is always implied; however, if specified after :switch:`-c` - it cancels the effect of :switch:`-c`. + or :switch:`-e` it cancels the effect of those switches. :switch:`-c` Causes both preprocessor lines and the lines deleted @@ -3266,6 +3278,12 @@ that relate to integrated preprocessing. name defined in a definition file. + :switch:`-e` + Causes both preprocessor lines and the lines deleted by + preprocessing to be replaced by empty comment lines marked + with '`--!`' (and no other text) in the output source file, + + :switch:`-s` Causes a sorted list of symbol names and values to be listed on the standard output file. @@ -3306,12 +3324,19 @@ that relate to integrated preprocessing. This switch is similar to switch :switch:`-D` of ``gnatprep``. -:switch:`-gnateG` +.. index:: -gnateG (gcc) + +:switch:`-gnateG[bce]` When integrated preprocessing is performed on source file :file:`filename.extension`, create or overwrite :file:`filename.extension.prep` to contain the result of the preprocessing. For example if the source file is :file:`foo.adb` then the output file is :file:`foo.adb.prep`. + An optional character (b, c, or e) can be appended to indicate that filtered + lines are to be replaced by blank lines, comments, or empty comments (see + documentation above about :switch:`-b`, :switch:`-c`, and :switch:`-e`). + If one of those switches is given in a preprocessor data file, then it + will override any option included with :switch:`-gnateG`. .. _Mixed_Language_Programming: diff --git a/gcc/ada/einfo-utils.adb b/gcc/ada/einfo-utils.adb index 417da6e828bc..290ae331d37a 100644 --- a/gcc/ada/einfo-utils.adb +++ b/gcc/ada/einfo-utils.adb @@ -669,6 +669,8 @@ package body Einfo.Utils is Result := Id; else pragma Assert (Is_Type (Id)); + -- ...because Is_Base_Type returns True for nontypes + Result := Etype (Id); if False then pragma Assert (Is_Base_Type (Result)); @@ -679,9 +681,29 @@ package body Einfo.Utils is -- expect. end if; end if; + + -- pragma Assert (Result = Base_Type_If_Set (Id)); + -- Disabled; too slow end return; end Base_Type; + ---------------------- + -- Base_Type_If_Set -- + ---------------------- + + function Base_Type_If_Set (Id : E) return Opt_N_Entity_Id is + begin + return Result : Opt_N_Entity_Id do + if Is_Base_Type (Id) then + Result := Id; + elsif Field_Is_Initial_Zero (Id, F_Etype) then + Result := Empty; + else + Result := Etype (Id); + end if; + end return; + end Base_Type_If_Set; + ---------------------- -- Declaration_Node -- ---------------------- @@ -1374,30 +1396,43 @@ package body Einfo.Utils is ------------------------------ function Implementation_Base_Type (Id : E) return E is - Bastyp : Entity_Id; Imptyp : Entity_Id; - begin - Bastyp := Base_Type (Id); - - if Is_Incomplete_Or_Private_Type (Bastyp) then - Imptyp := Underlying_Type (Bastyp); + return Result : E := Base_Type (Id) do + if Is_Incomplete_Or_Private_Type (Result) then + Imptyp := Underlying_Type (Result); - -- If we have an implementation type, then just return it, - -- otherwise we return the Base_Type anyway. This can only - -- happen in error situations and should avoid some error bombs. + -- If we have an implementation type, return its Base_Type. - if Present (Imptyp) then - return Base_Type (Imptyp); - else - return Bastyp; + if Present (Imptyp) then + Result := Base_Type (Imptyp); + end if; end if; - else - return Bastyp; - end if; + -- pragma Assert (Result = Implementation_Base_Type_If_Set (Id)); + -- Disabled; too slow + end return; end Implementation_Base_Type; + ------------------------------------- + -- Implementation_Base_Type_If_Set -- + ------------------------------------- + + function Implementation_Base_Type_If_Set (Id : E) return Opt_N_Entity_Id is + Imptyp : Entity_Id; + begin + return Result : Opt_N_Entity_Id := Base_Type_If_Set (Id) do + if Present (Result) and then Is_Incomplete_Or_Private_Type (Result) + then + Imptyp := Underlying_Type (Result); + + if Present (Imptyp) then + Result := Base_Type_If_Set (Imptyp); + end if; + end if; + end return; + end Implementation_Base_Type_If_Set; + ------------------------- -- Invariant_Procedure -- ------------------------- @@ -2540,51 +2575,74 @@ package body Einfo.Utils is --------------- function Root_Type (Id : E) return E is - T, Etyp : Entity_Id; + Etyp : Entity_Id; begin - pragma Assert (Nkind (Id) in N_Entity); + return T : E := Base_Type (Id) do + if Ekind (T) = E_Class_Wide_Type then + T := Etype (T); + else + loop + Etyp := Etype (T); - T := Base_Type (Id); + exit when T = Etyp + or else + (Is_Private_Type (T) and then Etyp = Full_View (T)) + or else + (Is_Private_Type (Etyp) and then Full_View (Etyp) = T); - if Ekind (T) = E_Class_Wide_Type then - return Etype (T); + T := Etyp; - -- Other cases + -- Quit if there is a circularity in the inheritance chain. + -- This happens in some error situations and we do not want + -- to get stuck in this loop. - else - loop - Etyp := Etype (T); + if T = Base_Type (Id) then + Check_Error_Detected; + exit; + end if; + end loop; + end if; - if T = Etyp then - return T; + -- pragma Assert (T = Root_Type_If_Set (Id)); + -- Disabled; too slow + end return; + end Root_Type; - -- Following test catches some error cases resulting from - -- previous errors. + ---------------------- + -- Root_Type_If_Set -- + ---------------------- - elsif No (Etyp) then - Check_Error_Detected; - return T; + function Root_Type_If_Set (Id : E) return Opt_N_Entity_Id is + Etyp : Entity_Id; - elsif Is_Private_Type (T) and then Etyp = Full_View (T) then - return T; + begin + return T : Opt_N_Entity_Id := Base_Type_If_Set (Id) do + if Ekind (T) = E_Class_Wide_Type then + T := Etype (T); + else + loop + Etyp := Etype (T); - elsif Is_Private_Type (Etyp) and then Full_View (Etyp) = T then - return T; - end if; + exit when No (Etyp) or else T = Etyp + or else + (Is_Private_Type (T) and then Etyp = Full_View (T)) + or else + (Is_Private_Type (Etyp) and then Full_View (Etyp) = T); - T := Etyp; + T := Etyp; - -- Return if there is a circularity in the inheritance chain. This - -- happens in some error situations and we do not want to get - -- stuck in this loop. + -- Quit if there is a circularity in the inheritance chain. + -- This happens in some error situations and we do not want + -- to get stuck in this loop. - if T = Base_Type (Id) then - return T; - end if; - end loop; - end if; - end Root_Type; + if T = Base_Type_If_Set (Id) then + exit; + end if; + end loop; + end if; + end return; + end Root_Type_If_Set; --------------------- -- Safe_Emax_Value -- @@ -3010,7 +3068,7 @@ package body Einfo.Utils is -- Underlying_Type -- --------------------- - function Underlying_Type (Id : E) return Entity_Id is + function Underlying_Type (Id : E) return Opt_N_Entity_Id is begin -- For record_with_private the underlying type is always the direct full -- view. Never try to take the full view of the parent it does not make diff --git a/gcc/ada/einfo-utils.ads b/gcc/ada/einfo-utils.ads index 78b49891f609..27cf9e670f0e 100644 --- a/gcc/ada/einfo-utils.ads +++ b/gcc/ada/einfo-utils.ads @@ -161,6 +161,15 @@ package Einfo.Utils is function First_Formal (Id : E) return Entity_Id; function First_Formal_With_Extras (Id : E) return Entity_Id; + function Base_Type_If_Set (Id : E) return Opt_N_Entity_Id; + function Implementation_Base_Type_If_Set (Id : E) return Opt_N_Entity_Id; + function Root_Type_If_Set (Id : E) return Opt_N_Entity_Id; + -- Base_Type_If_Set is a more permissive version of Base_Type, which + -- returns the same value, except it returns Empty in cases where Base_Type + -- would crash because relevant fields are not yet set. Likewise for the + -- other two. These are used in Treepr, to allow it to print half-baked + -- nodes without crashing. + function Float_Rep (N : Entity_Id) return F with Inline, Pre => N in E_Void_Id @@ -238,7 +247,7 @@ package Einfo.Utils is function Stream_Size_Clause (Id : E) return N with Inline; function Type_High_Bound (Id : E) return N with Inline; function Type_Low_Bound (Id : E) return N with Inline; - function Underlying_Type (Id : E) return Entity_Id; + function Underlying_Type (Id : E) return Opt_N_Entity_Id; function Scope_Depth (Id : Scope_Kind_Id) return U with Inline; function Scope_Depth_Set (Id : Scope_Kind_Id) return B with Inline; diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index 916d9c6f47c9..b5d9c1cde666 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -608,6 +608,10 @@ package Einfo is -- determine if there actually is an active Suppress or Unsuppress pragma -- that applies to the entity. +-- Child_Levels +-- Assrtion levels that depend on the given level are considered to be +-- the child levels of that level. + -- Class_Postconditions -- Defined on subprogram entities. Set if the subprogram has class-wide -- postconditions. Denotes the (and-then) expression built by merging @@ -1461,6 +1465,12 @@ package Einfo is -- associates generic parameters with the corresponding instances, in -- those cases where the instance is an entity. +-- Ghost_Assertion_Level +-- Assertion level associated with the declaration of the entity. Its +-- value is either Empty for non-ghost entities, Standard_Level_Default +-- for Ghost entities without an assertion level, or a user-defined +-- assertion level. + -- Has_Aliased_Components [implementation base type only] -- Defined in array type entities. Indicates that the component type -- of the array is aliased. Should this also be set for records to @@ -2164,6 +2174,11 @@ package Einfo is -- on the partial view, to ensure that discriminants are properly -- inherited in certain contexts. +-- Has_Unsigned_Base_Range_Aspect [base type only] +-- Defined in integer types. Set in the base type of an integer type for +-- which the type has an Unsigned_Base_Range of True (whether by an +-- aspect_specification, a pragma, or inheritance). + -- Has_Visible_Refinement -- Defined in E_Abstract_State entities. Set when a state has at least -- one refinement constituent and analysis is in the region between @@ -3009,6 +3024,13 @@ package Einfo is -- record is declared to be limited. Note that this flag is not set -- simply because some components of the record are limited. +-- Is_Link_Once +-- Defined in all entities. Set to indicate that an entity can be defined +-- in multiple compilation units without generating a linker error. The +-- compiler guarantees that the multiple definitions are equivalent and, +-- therefore, that the linker can freely pick one of them. If this flag +-- is set on an entity, then the Is_Public flag is also set on it. + -- Is_Local_Anonymous_Access -- Defined in access types. Set for an anonymous access type to indicate -- that the type is created for a record component with an access @@ -4008,6 +4030,10 @@ package Einfo is -- used when obtaining the formal kind of a formal parameter (the result -- is one of E_[In/Out/In_Out]_Parameter). +-- Parent_Levels +-- Assrtion levels that the given level depends on are considered to be +-- parent levels of that level. + -- Parent_Subtype [base type only] -- Defined in E_Record_Type. Set only for derived tagged types, in which -- case it points to the subtype of the parent type. This is the type @@ -4971,6 +4997,7 @@ package Einfo is -- Is_Known_Valid -- Is_Limited_Composite -- Is_Limited_Record + -- Is_Link_Once -- Is_Loop_Parameter -- Is_Obsolescent -- Is_Package_Body_Entity @@ -5243,6 +5270,10 @@ package Einfo is -- Number_Dimensions (synth) -- (plus type attributes) + -- E_Assertion_Level + -- Child_Levels + -- Parent_Levels + -- E_Block -- Renamed_Entity $$$ -- Renamed_Object $$$ @@ -6112,6 +6143,7 @@ package Einfo is -- Static_Discrete_Predicate -- Has_Biased_Representation -- Has_Shift_Operator (base type only) + -- Has_Unsigned_Base_Range_Aspect (base type only) -- No_Predicate_On_Actual -- No_Dynamic_Predicate_On_Actual -- Type_Low_Bound (synth) diff --git a/gcc/ada/env.c b/gcc/ada/env.c index 950c2696cf67..64e9aa01ef06 100644 --- a/gcc/ada/env.c +++ b/gcc/ada/env.c @@ -229,7 +229,8 @@ void __gnat_clearenv (void) || defined (__CYGWIN__) \ || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__rtems__) \ || defined (__DragonFly__) || defined (__DJGPP__) - /* On Windows, FreeBSD and MacOS there is no function to clean all the + /* On several platforms (e.g. Windows, FreeBSD, MacOS...) + there is no function to clean all the environment but there is a "clean" way to unset a variable. So go through the environ table and call __gnat_unsetenv on all entries */ char **env = __gnat_environ (); diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index cd98369a9189..d62b7351e862 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -4283,7 +4283,7 @@ package body Exp_Aggr is -- Set the Expansion_Delayed flag in the cases where the transformation -- will be done top down from above. - Parent_Node := Unconditional_Parent (N); + Parent_Node := Unqualified_Unconditional_Parent (N); if -- Internal aggregates (transformed when expanding the parent), @@ -6254,7 +6254,7 @@ package body Exp_Aggr is -- Set the Expansion_Delayed flag in the cases where the transformation -- will be done top down from above. - Parent_Node := Unconditional_Parent (N); + Parent_Node := Unqualified_Unconditional_Parent (N); if -- Internal aggregates (transformed when expanding the parent), @@ -6984,7 +6984,9 @@ package body Exp_Aggr is -- Choice is a single discrete value elsif Is_Discrete_Type (Etype (Choice)) then - Update_Choices (Choice, Choice); + if Is_Static_Expression (Choice) then + Update_Choices (Choice, Choice); + end if; Temp_Siz_Exp := Make_Integer_Literal (Loc, 1); Set_Is_Static_Expression (Temp_Siz_Exp); @@ -7208,13 +7210,11 @@ package body Exp_Aggr is -- To_Int -- ------------ - -- The bounds of the discrete range are integers or enumeration literals + -- The bounds of the discrete range are static discrete values function To_Int (Expr : N_Subexpr_Id) return Int is begin - return UI_To_Int ((if Nkind (Expr) = N_Integer_Literal - then Intval (Expr) - else Enumeration_Pos (Entity (Expr)))); + return UI_To_Int (Expr_Value (Expr)); end To_Int; -- Local variables diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb index 810248de1acd..a0a550ddbd71 100644 --- a/gcc/ada/exp_attr.adb +++ b/gcc/ada/exp_attr.adb @@ -24,7 +24,6 @@ ------------------------------------------------------------------------------ with Accessibility; use Accessibility; -with Aspects; use Aspects; with Atree; use Atree; with Checks; use Checks; with Debug; use Debug; @@ -266,6 +265,15 @@ package body Exp_Attr is -- the implementation base type of this type (Typ). If found, return the -- pragma node, otherwise return Empty if no pragma is found. + function Interunit_Ref_OK + (Subp_Unit, Attr_Ref_Unit : Node_Id) return Boolean; + -- Returns True if it is ok to refer to a cached subprogram declared in + -- Subp_Unit from the point of an attribute reference occurring in + -- Attr_Ref_Unit. Both arguments are usually N_Compilation_Nodes, + -- although there are cases where Subp_Unit might be a type declared in + -- package Standard (in which case the In_Same_Extended_Unit call will + -- return False). + function Is_Constrained_Packed_Array (Typ : Entity_Id) return Boolean; -- Utility for array attributes, returns true on packed constrained -- arrays, and on access to same. @@ -280,20 +288,6 @@ package body Exp_Attr is -- Returns True if Typ is a user-defined enumeration type, in the sense -- that its literals are declared in the source. - function Interunit_Ref_OK - (Subp_Unit, Attr_Ref_Unit : Node_Id) return Boolean is - (In_Same_Extended_Unit (Subp_Unit, Attr_Ref_Unit) - -- If subp declared in unit body, then we don't want to refer - -- to it from within unit spec so return False in that case. - and then not (not Is_Body (Unit (Attr_Ref_Unit)) - and Is_Body (Unit (Subp_Unit)))); - -- Returns True if it is ok to refer to a cached subprogram declared in - -- Subp_Unit from the point of an attribute reference occurring in - -- Attr_Ref_Unit. Both arguments are usually N_Compilation_Nodes, - -- although there are cases where Subp_Unit might be a type declared in - -- package Standard (in which case the In_Same_Extended_Unit call will - -- return False). - package body Cached_Attribute_Ops is ------------------------------- @@ -479,7 +473,8 @@ package body Exp_Attr is -- Local variables - Func_Id : constant Entity_Id := Make_Temporary (Loc, 'V'); + Func_Id : constant Entity_Id := Make_Temporary (Loc, 'V', + Related_Node => Attr); Indexes : constant List_Id := New_List; Obj_Id : constant Entity_Id := Make_Temporary (Loc, 'A'); Stmts : List_Id; @@ -836,7 +831,8 @@ package body Exp_Attr is -- Local variables - Func_Id : constant Entity_Id := Make_Temporary (Loc, 'V'); + Func_Id : constant Entity_Id := Make_Temporary (Loc, 'V', + Related_Node => Attr); Obj_Id : constant Entity_Id := Make_Temporary (Loc, 'R'); Comps : Node_Id; Stmts : List_Id; @@ -2019,7 +2015,12 @@ package body Exp_Attr is pragma Assert (Present (Insertion_Point)); end if; - Ancestor := Parent (Ancestor); + + if Nkind (Ancestor) = N_Subunit then + Ancestor := Corresponding_Stub (Ancestor); + else + Ancestor := Parent (Ancestor); + end if; end loop; if Present (Insertion_Point) then @@ -2171,7 +2172,7 @@ package body Exp_Attr is -- that it has the necessary extra formals. if not Is_Frozen (Pname) then - Create_Extra_Formals (Pname); + Create_Extra_Formals (Pname, Related_Nod => N); end if; -- And now rewrite the call @@ -2648,7 +2649,7 @@ package body Exp_Attr is Set_Extra_Formal (Extra, Empty); end if; - Create_Extra_Formals (Subp_Typ); + Create_Extra_Formals (Subp_Typ, Related_Nod => N); Set_Directly_Designated_Type (Typ, Subp_Typ); end; end if; @@ -2679,13 +2680,13 @@ package body Exp_Attr is if not Is_Frozen (Entity (Pref)) or else From_Limited_With (Etype (Entity (Pref))) then - Create_Extra_Formals (Entity (Pref)); + Create_Extra_Formals (Entity (Pref), Related_Nod => N); end if; if not Is_Frozen (Btyp_DDT) or else From_Limited_With (Etype (Btyp_DDT)) then - Create_Extra_Formals (Btyp_DDT); + Create_Extra_Formals (Btyp_DDT, Related_Nod => N); end if; pragma Assert @@ -5111,310 +5112,57 @@ package body Exp_Attr is when Attribute_Make => declare - Params : List_Id; - Param : Node_Id; - Par : Node_Id; - Construct : Entity_Id; - Obj : Node_Id := Empty; - Make_Expr : Node_Id := N; - - Formal : Entity_Id; - Replace_Expr : Node_Id; - Init_Param : Node_Id; - Construct_Call : Node_Id; - Curr_Nam : Node_Id := Empty; - - function Replace_Formal_Ref - (N : Node_Id) return Traverse_Result; - - function Replace_Formal_Ref - (N : Node_Id) return Traverse_Result is - begin - if Is_Entity_Name (N) - and then Chars (Formal) = Chars (N) - then - Rewrite (N, - New_Copy_Tree (Replace_Expr)); - end if; - - return OK; - end Replace_Formal_Ref; - - procedure Search_And_Replace_Formal is new - Traverse_Proc (Replace_Formal_Ref); - + Constructor_Params : List_Id := New_Copy_List (Expressions (N)); + Constructor_Call : Node_Id; + Constructor_EWA : Node_Id; + Result_Decl : Node_Id; + Result_Id : constant Entity_Id := + Make_Temporary (Loc, 'D', N); begin - -- Remove side effects for constructor call - - Param := First (Expressions (N)); - while Present (Param) loop - if Nkind (Param) = N_Parameter_Association then - Remove_Side_Effects (Explicit_Actual_Parameter (Param), - Check_Side_Effects => False); - else - Remove_Side_Effects (Param, Check_Side_Effects => False); - end if; - - Next (Param); - end loop; - - -- Construct the parameters list - - Params := New_Copy_List (Expressions (N)); - if Is_Empty_List (Params) then - Params := New_List; + if Is_Empty_List (Constructor_Params) then + Constructor_Params := New_List; end if; - -- Identify the enclosing parent for the non-copy cases - - Par := Parent (N); - if Nkind (Par) = N_Qualified_Expression then - Par := Parent (Par); - Make_Expr := Par; - end if; - if Nkind (Par) = N_Allocator then - Par := Parent (Par); - Curr_Nam := Make_Explicit_Dereference - (Loc, Prefix => Empty); - Obj := Curr_Nam; - end if; + Result_Decl := Make_Object_Declaration (Loc, + Defining_Identifier => Result_Id, + Object_Definition => + New_Occurrence_Of (Typ, Loc)); - declare - Base_Obj : Node_Id := Empty; - Typ_Comp : Entity_Id; - Agg_Comp : Entity_Id; - Comp_Nam : Node_Id := Empty; - begin - while Nkind (Par) not in N_Object_Declaration - | N_Assignment_Statement - loop - if Nkind (Par) = N_Aggregate then - Typ_Comp := First_Entity (Etype (Par)); - Agg_Comp := First (Expressions (Par)); - loop - if No (Agg_Comp) then - return; - end if; + -- Suppress default initialization for result object. + -- Default init (except for tag, if tagged) will instead be + -- performed in the constructor procedure. - if Agg_Comp = Make_Expr then - Comp_Nam := - Make_Selected_Component (Loc, - Prefix => Empty, - Selector_Name => - New_Occurrence_Of (Typ_Comp, Loc)); + Mutate_Ekind (Result_Id, E_Variable); + Set_Suppress_Initialization (Result_Id); - Make_Expr := Parent (Make_Expr); - Par := Parent (Par); - exit; - end if; - - Next_Entity (Typ_Comp); - Next (Agg_Comp); - end loop; - elsif Nkind (Par) = N_Component_Association then - Comp_Nam := - Make_Selected_Component (Loc, - Prefix => Empty, - Selector_Name => - Make_Identifier (Loc, - (Chars (First (Choices (Par)))))); - - Make_Expr := Parent (Parent (Make_Expr)); - Par := Parent (Parent (Par)); - else - declare - Temp : constant Entity_Id := - Make_Temporary (Loc, 'T', N); - begin - Rewrite (N, - Make_Expression_With_Actions (Loc, - Actions => New_List ( - Make_Object_Declaration (Loc, - Defining_Identifier => Temp, - Object_Definition => - New_Occurrence_Of (Typ, Loc), - Expression => - New_Copy_Tree (N))), - Expression => New_Occurrence_Of (Temp, Loc))); - Analyze_And_Resolve (N); - return; - end; - end if; - - if No (Curr_Nam) then - Curr_Nam := Comp_Nam; - Obj := Curr_Nam; - elsif Has_Prefix (Curr_Nam) then - Set_Prefix (Curr_Nam, Comp_Nam); - Curr_Nam := Comp_Nam; - end if; - end loop; - - Base_Obj := (case Nkind (Par) is - when N_Assignment_Statement => - New_Copy_Tree (Name (Par)), - when N_Object_Declaration => - New_Occurrence_Of - (Defining_Identifier (Par), Loc), - when others => (raise Program_Error)); - - if Present (Curr_Nam) then - Set_Prefix (Curr_Nam, Base_Obj); - else - Obj := Base_Obj; - end if; - end; - - Prepend_To (Params, Obj); - - -- Find the constructor we are interested in by doing a - -- pseudo-pass to resolve the constructor call. + -- Build a prefixed-notation call declare - Dummy_Params : List_Id := New_Copy_List (Expressions (N)); - Dummy_Self : Node_Id; - Dummy_Block : Node_Id; - Dummy_Call : Node_Id; - Dummy_Id : Entity_Id := Make_Temporary (Loc, 'D', N); + Proc_Name : constant Node_Id := + Make_Selected_Component (Loc, + Prefix => New_Occurrence_Of (Result_Id, Loc), + Selector_Name => Make_Identifier (Loc, + Chars (Constructor_Name (Typ)))); begin - if Is_Empty_List (Dummy_Params) then - Dummy_Params := New_List; - end if; + Set_Is_Prefixed_Call (Proc_Name); - Dummy_Self := Make_Object_Declaration (Loc, - Defining_Identifier => Dummy_Id, - Object_Definition => - New_Occurrence_Of (Typ, Loc)); - Prepend_To (Dummy_Params, New_Occurrence_Of (Dummy_Id, Loc)); - - Dummy_Call := Make_Procedure_Call_Statement (Loc, - Parameter_Associations => Dummy_Params, - Name => - (if not Has_Prefix (Pref) then - Make_Identifier (Loc, - Chars (Constructor_Name (Typ))) - else - Make_Expanded_Name (Loc, - Chars => - Chars (Constructor_Name (Typ)), - Prefix => - New_Copy_Tree (Prefix (Pref)), - Selector_Name => - Make_Identifier (Loc, - Chars (Constructor_Name (Typ)))))); - Set_Is_Expanded_Constructor_Call (Dummy_Call, True); - - Dummy_Block := Make_Block_Statement (Loc, - Declarations => New_List (Dummy_Self), - Handled_Statement_Sequence => - Make_Handled_Sequence_Of_Statements (Loc, - Statements => New_List (Dummy_Call))); - - Expander_Active := False; - - Insert_After_And_Analyze - (Enclosing_Declaration_Or_Statement (Par), Dummy_Block); - - Expander_Active := True; - - -- Finally, we can get the constructor based on our pseudo-pass - - Construct := Entity (Name (Dummy_Call)); - - -- Replace the Typ'Make attribute with an aggregate featuring - -- then relevant aggregate from the correct constructor's - -- Inializeaspect if it is present - otherwise, simply use a - -- box. - - if Has_Aspect (Construct, Aspect_Initialize) then - Rewrite (N, - New_Copy_Tree - (Find_Value_Of_Aspect (Construct, Aspect_Initialize))); - - Param := Next (First (Params)); - Formal := Next_Entity (First_Entity (Construct)); - while Present (Param) loop - if Nkind (Param) = N_Parameter_Association then - Formal := Selector_Name (Param); - Replace_Expr := Explicit_Actual_Parameter (Param); - else - Replace_Expr := Param; - end if; - - Init_Param := First (Component_Associations (N)); - while Present (Init_Param) loop - Search_And_Replace_Formal (Expression (Init_Param)); - - Next (Init_Param); - end loop; - - if Nkind (Param) /= N_Parameter_Association then - Next_Entity (Formal); - end if; - Next (Param); - end loop; - - Init_Param := First (Component_Associations (N)); - while Present (Init_Param) loop - if Nkind (Expression (Init_Param)) = N_Attribute_Reference - and then Attribute_Name - (Expression (Init_Param)) = Name_Make - then - Insert_After (Par, - Make_Assignment_Statement (Loc, - Name => - Make_Selected_Component (Loc, - Prefix => - New_Copy_Tree (First (Params)), - Selector_Name => - Make_Identifier (Loc, - Chars (First (Choices (Init_Param))))), - Expression => - New_Copy_Tree (Expression (Init_Param)))); - - Rewrite (Expression (Init_Param), - Make_Aggregate (Loc, - Expressions => New_List, - Component_Associations => New_List ( - Make_Component_Association (Loc, - Choices => - New_List (Make_Others_Choice (Loc)), - Expression => Empty, - Box_Present => True)))); - end if; - - Next (Init_Param); - end loop; - else - Rewrite (N, - Make_Aggregate (Loc, - Expressions => New_List, - Component_Associations => New_List ( - Make_Component_Association (Loc, - Choices => New_List (Make_Others_Choice (Loc)), - Expression => Empty, - Box_Present => True)))); - end if; - - -- Rewrite this block to be null and pretend it didn't happen - - Rewrite (Dummy_Block, Make_Null_Statement (Loc)); + Constructor_Call := Make_Procedure_Call_Statement (Loc, + Parameter_Associations => Constructor_Params, + Name => Proc_Name); end; - Analyze_And_Resolve (N, Typ); - - -- Finally, insert the constructor call + Set_Is_Expanded_Constructor_Call (Constructor_Call, True); - Construct_Call := - Make_Procedure_Call_Statement (Loc, - Name => - New_Occurrence_Of (Construct, Loc), - Parameter_Associations => Params); + Constructor_EWA := + Make_Expression_With_Actions (Loc, + Actions => New_List (Result_Decl, Constructor_Call), + Expression => New_Occurrence_Of (Result_Id, Loc)); - Set_Is_Expanded_Constructor_Call (Construct_Call); - Insert_After (Par, Construct_Call); + Rewrite (N, Constructor_EWA); end; + Analyze_And_Resolve (N, Typ); + -------------- -- Mantissa -- -------------- @@ -8883,6 +8631,7 @@ package body Exp_Attr is | Attribute_Type_Key | Attribute_Unconstrained_Array | Attribute_Universal_Literal_String + | Attribute_Unsigned_Base_Range | Attribute_Wchar_T_Size | Attribute_Word_Size => @@ -9851,6 +9600,31 @@ package body Exp_Attr is return Empty; end Get_Stream_Convert_Pragma; + ---------------------- + -- Interunit_Ref_OK -- + ---------------------- + + function Interunit_Ref_OK + (Subp_Unit, Attr_Ref_Unit : Node_Id) return Boolean is + + function Unit_Is_Body_Or_Subunit (U : Node_Id) return Boolean is + (Is_Body (Unit (U)) or else Nkind (Unit (U)) = N_Subunit); + begin + if not In_Same_Extended_Unit (Subp_Unit, Attr_Ref_Unit) then + return False; + + -- If subp declared in unit body, then we don't want to refer + -- to it from within unit spec so return False in that case. + + elsif Unit_Is_Body_Or_Subunit (Subp_Unit) + and then not Unit_Is_Body_Or_Subunit (Attr_Ref_Unit) + then + return False; + end if; + + return True; + end Interunit_Ref_OK; + --------------------------------- -- Is_Constrained_Packed_Array -- --------------------------------- diff --git a/gcc/ada/exp_ch2.adb b/gcc/ada/exp_ch2.adb index 612a4611c4ca..d2f3df80e002 100644 --- a/gcc/ada/exp_ch2.adb +++ b/gcc/ada/exp_ch2.adb @@ -706,9 +706,15 @@ package body Exp_Ch2 is T : constant Entity_Id := Etype (N); begin + -- Mark the entity as referenced since this reference is going away + + Set_Referenced (E); + + -- Now rewrite the reference as a copy of the renamed object + Rewrite (N, New_Copy_Tree (Renamed_Object (E))); - -- We mark the copy as unanalyzed, so that it is sure to be reanalyzed + -- Mark the copy as unanalyzed to make sure that it is reanalyzed -- at the top level. This is needed in the packed case since we -- specifically avoided expanding packed array references when the -- renaming declaration was analyzed. diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 00b3aae0bd9e..60224c19b19b 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -75,7 +75,6 @@ with Sinfo.Nodes; use Sinfo.Nodes; with Sinfo.Utils; use Sinfo.Utils; with Stand; use Stand; with Snames; use Snames; -with Tbuild; use Tbuild; with Ttypes; use Ttypes; with Validsw; use Validsw; with Warnsw; use Warnsw; @@ -211,32 +210,6 @@ package body Exp_Ch3 is -- component that requires late initialization; this includes -- components of ancestor types. - type Initialization_Mode is - (Full_Init, Full_Init_Except_Tag, Early_Init_Only, Late_Init_Only); - -- The initialization routine for a tagged type is passed in a - -- formal parameter of this type, indicating what initialization - -- is to be performed. This parameter defaults to Full_Init in all - -- cases except when the init proc of a type extension (let's call - -- that type T2) calls the init proc of its parent (let's call that - -- type T1). In that case, one of the other 3 values will - -- be passed in. In all three of those cases, the Tag component has - -- already been initialized before the call and is therefore not to be - -- modified. T2's init proc will either call T1's init proc - -- once (with Full_Init_Except_Tag as the parameter value) or twice - -- (first with Early_Init_Only, then later with Late_Init_Only), - -- depending on the result returned by Has_Late_Init_Component (T1). - -- In the latter case, the first call does not initialize any - -- components that require late initialization and the second call - -- then performs that deferred initialization. - -- Strictly speaking, the formal parameter subtype is actually Natural - -- but calls will only pass in values corresponding to literals - -- of this enumeration type. - - function Make_Mode_Literal - (Loc : Source_Ptr; Mode : Initialization_Mode) return Node_Id - is (Make_Integer_Literal (Loc, Initialization_Mode'Pos (Mode))); - -- Generate an integer literal for a given mode value. - function Tag_Init_Condition (Loc : Source_Ptr; Init_Control_Formal : Entity_Id) return Node_Id; @@ -2145,7 +2118,7 @@ package body Exp_Ch3 is end if; if Policy_In_Effect (Name_Assert) = Name_Check - and then not Predicates_Ignored (Etype (Discr)) + and then not Predicates_Ignored_In_Codegen (Etype (Discr)) then Prepend_To (Res, Make_Predicate_Check (Typ, Val)); end if; @@ -2481,14 +2454,10 @@ package body Exp_Ch3 is and then Nkind (Id_Ref) = N_Selected_Component and then Chars (Selector_Name (Id_Ref)) = Name_uParent then - declare - use Initialization_Control; - begin - Append_To (Args, - (if Present (Init_Control_Actual) - then Init_Control_Actual - else Make_Mode_Literal (Loc, Full_Init_Except_Tag))); - end; + Append_To (Args, + (if Present (Init_Control_Actual) + then Init_Control_Actual + else Make_Mode_Literal (Loc, Full_Init_Except_Tag))); elsif Present (Constructor_Ref) then Append_List_To (Args, New_Copy_List (Parameter_Associations (Constructor_Ref))); @@ -3216,6 +3185,40 @@ package body Exp_Ch3 is if Parent_Subtype_Renaming_Discrims then Append_List_To (Body_Stmts, Build_Init_Call_Thru (Parameters)); + elsif Present (Constructor_Name (Rec_Type)) then + if Present (Default_Constructor (Rec_Type)) then + -- The 'Make attribute reference (with no arguments) will + -- generate a call to the one-parameter constructor procedure. + + Append_To (Body_Stmts, + Make_Assignment_Statement (Loc, + Name => New_Occurrence_Of + (Defining_Identifier (First (Parameters)), Loc), + Expression => Make_Attribute_Reference (Loc, + Prefix => New_Occurrence_Of (Rec_Type, Loc), + Attribute_Name => Name_Make))); + else + -- No constructor procedure with an appropriate profile + -- is available, so raise Program_Error. + -- + -- We could instead do nothing here, since the absence of a + -- one-parameter constructor procedure should trigger other + -- legality checks which should statically ensure that + -- the init proc we are constructing here will never be + -- called. So a bit of "belt and suspenders" here. + -- If this raise statement is ever executed, that probably + -- means that some compile-time legality check is not + -- implemented, and that the program should have instead + -- failed to compile. + -- Because this raise statement should never be executed, it + -- seems ok to pass in a dubious Reason parameter instead of + -- declaring a new RT_Exception_Code value. + + Append_To (Body_Stmts, + Make_Raise_Program_Error (Loc, + Reason => PE_Explicit_Raise)); + end if; + elsif Nkind (Type_Definition (N)) = N_Record_Definition then Build_Discriminant_Assignments (Body_Stmts); @@ -3310,7 +3313,7 @@ package body Exp_Ch3 is end if; end if; - -- Add here the assignment to instantiate the Tag + -- Add here the assignment to initialize the Tag -- The assignment corresponds to the code: @@ -4170,7 +4173,6 @@ package body Exp_Ch3 is if Present (Parent_Id) then declare Parent_Loc : constant Source_Ptr := Sloc (Parent (Parent_Id)); - use Initialization_Control; begin -- We are building the init proc for a type extension. -- Call the parent type's init proc a second time, this @@ -4558,6 +4560,8 @@ package body Exp_Ch3 is -- since the call is generated, there had better be a routine -- at the other end of the call, even if it does nothing). + -- 10. The type has a specified Constructor aspect. + -- Note: the reason we exclude the CPP_Class case is because in this -- case the initialization is performed by the C++ constructors, and -- the IP is built by Set_CPP_Constructors. @@ -4573,6 +4577,7 @@ package body Exp_Ch3 is or else Is_Tagged_Type (Rec_Id) or else Is_Concurrent_Record_Type (Rec_Id) or else Has_Task (Rec_Id) + or else Present (Constructor_Name (Rec_Id)) then return True; end if; @@ -5532,7 +5537,9 @@ package body Exp_Ch3 is -- initialize scalars mode, and these types are treated specially -- and do not need initialization procedures. - elsif Is_Standard_String_Type (Base) then + elsif Is_Standard_String_Type (Base) + and then No (Default_Aspect_Component_Value (Base)) + then null; -- Otherwise we have to build an init proc for the subtype @@ -5878,7 +5885,7 @@ package body Exp_Ch3 is -- the subtype. if not No_Exception_Handlers_Set - and then not Predicates_Ignored (Typ) + and then not Predicates_Ignored_In_Codegen (Typ) then Append_To (Lst, Make_Case_Statement_Alternative (Loc, @@ -6592,7 +6599,7 @@ package body Exp_Ch3 is Elmt := First_Elmt (Primitive_Operations (Typ)); while Present (Elmt) loop - Create_Extra_Formals (Node (Elmt)); + Create_Extra_Formals (Node (Elmt), Related_Nod => N); Next_Elmt (Elmt); end loop; @@ -6609,7 +6616,7 @@ package body Exp_Ch3 is and then Find_Dispatching_Type (E) = Typ and then not Contains (Primitive_Operations (Typ), E) then - Create_Extra_Formals (E); + Create_Extra_Formals (E, Related_Nod => N); end if; Next_Entity (E); @@ -10786,11 +10793,9 @@ package body Exp_Ch3 is or else (Is_Record_Type (Typ) and then Is_Protected_Record_Type (Typ)); With_Task : constant Boolean := - not Global_No_Tasking - and then - (Has_Task (Typ) - or else (Is_Record_Type (Typ) - and then Is_Task_Record_Type (Typ))); + Has_Task (Typ) + or else (Is_Record_Type (Typ) + and then Is_Task_Record_Type (Typ)); Formals : List_Id; begin diff --git a/gcc/ada/exp_ch3.ads b/gcc/ada/exp_ch3.ads index 0b0a2b68642c..69e6cb4ba352 100644 --- a/gcc/ada/exp_ch3.ads +++ b/gcc/ada/exp_ch3.ads @@ -27,6 +27,7 @@ with Elists; use Elists; with Exp_Tss; use Exp_Tss; +with Tbuild; use Tbuild; with Types; use Types; with Uintp; use Uintp; @@ -194,6 +195,32 @@ package Exp_Ch3 is -- initialized; if Variable_Comps is True then tags components located at -- variable positions of Target are initialized. + type Initialization_Mode is + (Full_Init, Full_Init_Except_Tag, Early_Init_Only, Late_Init_Only); + -- The initialization routine for a tagged type is passed in a + -- formal parameter of this type, indicating what initialization + -- is to be performed. This parameter defaults to Full_Init in all + -- cases except when the init proc of a type extension (let's call + -- that type T2) calls the init proc of its parent (let's call that + -- type T1). In that case, one of the other 3 values will + -- be passed in. In all three of those cases, the Tag component has + -- already been initialized before the call and is therefore not to be + -- modified. T2's init proc will either call T1's init proc + -- once (with Full_Init_Except_Tag as the parameter value) or twice + -- (first with Early_Init_Only, then later with Late_Init_Only), + -- depending on the result returned by Has_Late_Init_Component (T1). + -- In the latter case, the first call does not initialize any + -- components that require late initialization and the second call + -- then performs that deferred initialization. + -- Strictly speaking, the formal parameter subtype is actually Natural + -- but calls will only pass in values corresponding to literals + -- of this enumeration type. + + function Make_Mode_Literal + (Loc : Source_Ptr; Mode : Initialization_Mode) return Node_Id + is (Make_Integer_Literal (Loc, Initialization_Mode'Pos (Mode))); + -- Generate an integer literal for a given mode value. + procedure Make_Controlling_Function_Wrappers (Tag_Typ : Entity_Id; Decl_List : out List_Id; diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 43c94f37ba1a..8fba1c4e71fa 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -5198,7 +5198,8 @@ package body Exp_Ch4 is if not Expansion_Delayed (N) then declare - Uncond_Par : constant Node_Id := Unconditional_Parent (N); + Uncond_Par : constant Node_Id := + Unqualified_Unconditional_Parent (N); begin if Nkind (Uncond_Par) = N_Simple_Return_Statement or else Is_Optimizable_Declaration (Uncond_Par) @@ -5807,7 +5808,8 @@ package body Exp_Ch4 is if not Expansion_Delayed (N) then declare - Uncond_Par : constant Node_Id := Unconditional_Parent (N); + Uncond_Par : constant Node_Id := + Unqualified_Unconditional_Parent (N); begin if Nkind (Uncond_Par) = N_Simple_Return_Statement or else Is_Optimizable_Declaration (Uncond_Par) @@ -7870,9 +7872,15 @@ package body Exp_Ch4 is end if; end if; - -- Arithmetic overflow checks for signed integer/fixed point types + -- Arithmetic overflow checks for signed integer/fixed point types, + -- and signed integer types with unsigned base range aspect. - if Is_Signed_Integer_Type (Typ) or else Is_Fixed_Point_Type (Typ) then + if Is_Signed_Integer_Type (Typ) + or else Is_Fixed_Point_Type (Typ) + or else + (Is_Modular_Integer_Type (Typ) + and then Has_Unsigned_Base_Range_Aspect (Base_Type (Typ))) + then Apply_Arithmetic_Overflow_Check (N); return; end if; @@ -8179,6 +8187,11 @@ package body Exp_Ch4 is -- Determines whether a type has a subcomponent of an unconstrained -- Unchecked_Union subtype. Typ is a record type. + procedure Warn_On_Abstract_Equality_For_Component + (Comp_Type : Entity_Id); + -- If Comp_Type is a record type with a user-defined abstract primitive + -- equality, then issue a warning that Program_Error will be raised. + ------------------------- -- Build_Equality_Call -- ------------------------- @@ -8403,6 +8416,27 @@ package body Exp_Ch4 is Unconstrained_UU_In_Component_List (Optional_Component_List); end Has_Unconstrained_UU_Component; + --------------------------------------------- + -- Warn_On_Abstract_Equality_For_Component -- + --------------------------------------------- + + procedure Warn_On_Abstract_Equality_For_Component + (Comp_Type : Entity_Id) + is + Eq : Entity_Id; + begin + if Is_Record_Type (Underlying_Type (Comp_Type)) then + Eq := Get_User_Defined_Equality (Comp_Type); + + if Present (Eq) and then Is_Abstract_Subprogram (Eq) then + Error_Msg_Warn := SPARK_Mode /= On; + Error_Msg_NE ("call to abstract equality function of " + & "component type &<<", N, Comp_Type); + Error_Msg_N ("\Program_Error [<<", N); + end if; + end if; + end Warn_On_Abstract_Equality_For_Component; + -- Local variables Typl : Entity_Id; @@ -8471,6 +8505,16 @@ package body Exp_Ch4 is elsif Is_Array_Type (Typl) then + -- If the outer type doesn't have a user-defined equality operation, + -- check whether its component type has an abstract equality, and + -- warn if so. Such a component equality function will raise + -- Program_Error of objects of the outer type are compared using + -- predefined equality. + + if not Present (Get_User_Defined_Equality (Typl)) then + Warn_On_Abstract_Equality_For_Component (Component_Type (Typl)); + end if; + -- If we are doing full validity checking, and it is possible for the -- array elements to be invalid then expand out array comparisons to -- make sure that we check the array elements. @@ -8540,6 +8584,36 @@ package body Exp_Ch4 is elsif Is_Record_Type (Typl) then + -- When outer type doesn't have a user-defined equality operation, + -- check whether any of its components' types have an abstract + -- equality, and warn if so. Such component equality functions will + -- raise Program_Error when objects of the outer type are compared + -- using predefined equality. + + -- ??? Note that this warning is currently only issued in cases of + -- top-level components of the type and not for deeper subcomponents. + -- Those could be handled with more work, such as by adding a flag + -- on record type entities, but it's not clear that it would be + -- worth the effort. Another limitation is that the warning check + -- is not done for tagged types in some cases, because equality + -- comparisons for those can be changed to calls at an earlier point + -- during analysis and resolution, and do not reach this code (but in + -- many cases tagged equality comparisons do reach the code below). + + if not Present (Get_User_Defined_Equality (Typl)) then + declare + Comp : Entity_Id := First_Component (Typl); + begin + while Present (Comp) loop + if Chars (Comp) /= Name_uParent then + Warn_On_Abstract_Equality_For_Component (Etype (Comp)); + end if; + + Next_Component (Comp); + end loop; + end; + end if; + -- For tagged types, use the primitive "=" if Is_Tagged_Type (Typl) then @@ -9387,7 +9461,11 @@ package body Exp_Ch4 is end if; if not Backend_Overflow_Checks_On_Target - and then Is_Signed_Integer_Type (Typ) + and then + (Is_Signed_Integer_Type (Typ) + or else + (Is_Modular_Integer_Type (Typ) + and then Has_Unsigned_Base_Range_Aspect (Base_Type (Typ)))) and then Do_Overflow_Check (N) then -- Software overflow checking expands -expr into (0 - expr) @@ -9811,7 +9889,11 @@ package body Exp_Ch4 is -- Non-fixed point cases, check software overflow checking required - elsif Is_Signed_Integer_Type (Etype (N)) then + elsif Is_Signed_Integer_Type (Etype (N)) + or else + (Is_Modular_Integer_Type (Typ) + and then Has_Unsigned_Base_Range_Aspect (Base_Type (Typ))) + then Apply_Arithmetic_Overflow_Check (N); end if; @@ -10375,9 +10457,15 @@ package body Exp_Ch4 is return; end if; - -- Arithmetic overflow checks for signed integer/fixed point types + -- Arithmetic overflow checks for signed integer/fixed point types, + -- and signed integer types with unsigned base range aspect. - if Is_Signed_Integer_Type (Typ) or else Is_Fixed_Point_Type (Typ) then + if Is_Signed_Integer_Type (Typ) + or else Is_Fixed_Point_Type (Typ) + or else + (Is_Modular_Integer_Type (Typ) + and then Has_Unsigned_Base_Range_Aspect (Base_Type (Typ))) + then Apply_Arithmetic_Overflow_Check (N); end if; diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb index 66a4fc0512b0..0949d5864bb5 100644 --- a/gcc/ada/exp_ch5.adb +++ b/gcc/ada/exp_ch5.adb @@ -2254,7 +2254,8 @@ package body Exp_Ch5 is function Replace_Target (N : Node_Id) return Traverse_Result; -- Replace occurrences of the target name by the proper entity: either -- the entity of the LHS in simple cases, or the formal of the - -- constructed procedure otherwise. + -- constructed procedure otherwise. Mark all nodes as Analyzed=False + -- so reanalysis will occur. -------------------- -- Replace_Target -- @@ -2264,20 +2265,6 @@ package body Exp_Ch5 is begin if Nkind (N) = N_Target_Name then Rewrite (N, New_Occurrence_Of (Ent, Sloc (N))); - - -- The expression will be reanalyzed when the enclosing assignment - -- is reanalyzed, so reset the entity, which may be a temporary - -- created during analysis, e.g. a loop variable for an iterated - -- component association. However, if entity is callable then - -- resolution has established its proper identity (including in - -- rewritten prefixed calls) so we must preserve it. - - elsif Is_Entity_Name (N) then - if Present (Entity (N)) - and then not Is_Overloadable (Entity (N)) - then - Set_Entity (N, Empty); - end if; end if; Set_Analyzed (N, False); @@ -4118,7 +4105,7 @@ package body Exp_Ch5 is if Compile_Time_Known_Value (Expr) and then Has_Predicates (Etype (Expr)) - and then not Predicates_Ignored (Etype (Expr)) + and then not Predicates_Ignored_In_Codegen (Etype (Expr)) and then not Is_OK_Static_Expression (Expr) then Rewrite (N, @@ -4203,7 +4190,7 @@ package body Exp_Ch5 is -- generated case statements). if Validity_Check_Default - and then not Predicates_Ignored (Etype (Expr)) + and then not Predicates_Ignored_In_Codegen (Etype (Expr)) then -- Recognize the simple case where Expr is an object reference -- and the case statement is directly preceded by an @@ -4378,7 +4365,7 @@ package body Exp_Ch5 is -- predicate, and there is no Others choice, Constraint_Error -- must be raised (RM 4.5.7 (21/3) and 5.4 (13)). - if Predicates_Ignored (Etype (Expr)) then + if Predicates_Ignored_In_Codegen (Etype (Expr)) then declare Except : constant Node_Id := Make_Raise_Constraint_Error (Loc, diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index e8774699a66a..d48b8f22ba1a 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -1423,13 +1423,6 @@ package body Exp_Ch6 is Formal : Entity_Id; begin - pragma Assert (Nkind (Subp_Call) in N_Entry_Call_Statement - | N_Function_Call - | N_Procedure_Call_Statement); - pragma Assert (Extra_Formals_Known (Subp_Id) - or else not Expander_Active - or else Is_Unsupported_Extra_Actuals_Call (Subp_Call, Subp_Id)); - -- In CodePeer_Mode, the tree for `'Elab_Spec` procedures will be -- malformed because GNAT does not perform the usual expansion that -- results in the importation of external elaboration procedure symbols. @@ -1447,6 +1440,13 @@ package body Exp_Ch6 is return True; end if; + pragma Assert (Nkind (Subp_Call) in N_Entry_Call_Statement + | N_Function_Call + | N_Procedure_Call_Statement); + pragma Assert (Extra_Formals_Known (Subp_Id) + or else not Expander_Active + or else Is_Unsupported_Extra_Actuals_Call (Subp_Call, Subp_Id)); + Formal := First_Formal_With_Extras (Subp_Id); Actual := First_Actual (Subp_Call); @@ -2946,7 +2946,11 @@ package body Exp_Ch6 is and then Predicate_Tests_On_Arguments (Subp) then - Append_To (Post_Call, + -- If Actual is a view conversion to a by-copy subtype + -- that is subject to a predicate, then the predicate + -- check must precede copy-back. So Prepend. + + Prepend_To (Post_Call, Make_Predicate_Check (Atyp, Actual)); end if; end By_Ref_Predicate_Check; @@ -4027,7 +4031,8 @@ package body Exp_Ch6 is procedure Check_Subprogram_Variant; -- Emit a call to the internally generated procedure with checks for - -- aspect Subprogram_Variant, if present and enabled. + -- aspect Subprogram_Variant, if present and enabled. Multiple calls are + -- added when the subprogram was using Assertion_Levels. function Inherited_From_Formal (S : Entity_Id) return Entity_Id; -- Within an instance, a type derived from an untagged formal derived @@ -4312,7 +4317,7 @@ package body Exp_Ch6 is -- Local variables - Variant_Prag : constant Node_Id := + Variant_Prag : Node_Id := Get_Pragma (Current_Scope, Pragma_Subprogram_Variant); New_Call : Node_Id; @@ -4320,8 +4325,10 @@ package body Exp_Ch6 is Variant_Proc : Entity_Id; begin - if Present (Variant_Prag) and then Is_Checked (Variant_Prag) then - + while Present (Variant_Prag) + and then Is_Checked (Variant_Prag) + and then Pragma_Name (Variant_Prag) = Name_Subprogram_Variant + loop Pragma_Arg1 := Expression (First (Pragma_Argument_Associations (Variant_Prag))); @@ -4330,12 +4337,13 @@ package body Exp_Ch6 is -- run-time execution. if Nkind (Pragma_Arg1) = N_Aggregate then - pragma Assert - (Chars - (First - (Choices - (First (Component_Associations (Pragma_Arg1))))) = - Name_Structural); + pragma + Assert + (Chars + (First + (Choices + (First (Component_Associations (Pragma_Arg1))))) + = Name_Structural); return; end if; @@ -4345,7 +4353,8 @@ package body Exp_Ch6 is Variant_Proc := Entity (Pragma_Arg1); New_Call := - Make_Procedure_Call_Statement (Loc, + Make_Procedure_Call_Statement + (Loc, Name => New_Occurrence_Of (Variant_Proc, Loc), Parameter_Associations => @@ -4353,9 +4362,13 @@ package body Exp_Ch6 is Insert_Action (Call_Node, New_Call); - pragma Assert (Etype (New_Call) /= Any_Type - or else Serious_Errors_Detected > 0); - end if; + pragma + Assert + (Etype (New_Call) /= Any_Type + or else Serious_Errors_Detected > 0); + + Variant_Prag := Next_Pragma (Variant_Prag); + end loop; end Check_Subprogram_Variant; --------------------------- @@ -4707,7 +4720,7 @@ package body Exp_Ch6 is -- of init procs were added when they were built. if not Extra_Formals_Known (Subp) then - Create_Extra_Formals (Subp); + Create_Extra_Formals (Subp, Related_Nod => Call_Node); -- If the previous call to Create_Extra_Formals could not add the -- extra formals, then we must defer adding the extra actuals of @@ -4776,7 +4789,7 @@ package body Exp_Ch6 is and then Extra_Formals_Known (Subp) and then Present (Extra_Formals (Subp)) then - Create_Extra_Actuals (N); + Create_Extra_Actuals (Call_Node); -- Mark the call as an expanded build-in-place call; required -- to avoid adding the extra formals twice. @@ -5219,10 +5232,10 @@ package body Exp_Ch6 is null; elsif not Defer_Extra_Actuals then - Create_Extra_Formals (Subp); + Create_Extra_Formals (Subp, Related_Nod => Call_Node); if Extra_Formals_Known (Subp) then - Create_Extra_Actuals (N); + Create_Extra_Actuals (Call_Node); end if; end if; @@ -5238,7 +5251,7 @@ package body Exp_Ch6 is -- the current subprogram is called. if Is_Subprogram (Subp) - and then not Is_Ignored_Ghost_Entity (Subp) + and then not Is_Ignored_Ghost_Entity_In_Codegen (Subp) and then Same_Or_Aliased_Subprograms (Subp, Current_Scope) then Check_Subprogram_Variant; @@ -5780,11 +5793,14 @@ package body Exp_Ch6 is is Par : constant Node_Id := Parent (N); Uncond_Par : constant Node_Id := Unconditional_Parent (N); + -- Beware that a qualified expression around a function call cannot be + -- considered as transparent (like around an aggregate) because it may + -- cause a temporary to be created. begin -- Optimization: if the returned value is returned again, then no need -- to copy/readjust/finalize, we can just pass the value through (see - -- Expand_N_Simple_Return_Statement), and thus no attachment is needed. + -- Expand_Simple_Function_Return), and thus no attachment is needed. -- Note that simple return statements are distributed into conditional -- expressions, but we may be invoked before this distribution is done. @@ -6231,6 +6247,14 @@ package body Exp_Ch6 is -- returns, since they get eliminated anyway later on. Spec_Id denotes -- the corresponding spec of the subprogram body. + procedure Prepend_Constructor_Procedure_Prologue + (Spec_Id : Entity_Id; Body_Id : Entity_Id; L : List_Id); + -- If N is the body of a constructor procedure (that is, a procedure + -- named in a Constructor aspect specification for the type of the + -- procedure's first parameter), then prepend and analyze the + -- associated initialization code for that parameter. + -- This has nothing to do with CPP constructors. + ---------------- -- Add_Return -- ---------------- @@ -6304,6 +6328,304 @@ package body Exp_Ch6 is end if; end Add_Return; + -------------------------------------------- + -- Prepend_Constructor_Procedure_Prologue -- + -------------------------------------------- + + procedure Prepend_Constructor_Procedure_Prologue + (Spec_Id : Entity_Id; Body_Id : Entity_Id; L : List_Id) + is + + function First_Param_Type return Entity_Id is + (Implementation_Base_Type (Etype (First_Formal (Spec_Id)))); + + Is_Constructor_Procedure : constant Boolean := + Nkind (Specification (N)) = N_Procedure_Specification + and then Present (First_Formal (Spec_Id)) + and then Present (Constructor_Name (First_Param_Type)) + and then Chars (Spec_Id) = Chars (Constructor_Name + (First_Param_Type)) + and then Ekind (First_Formal (Spec_Id)) = E_In_Out_Parameter + and then Scope (Spec_Id) = Scope (First_Param_Type); + begin + if not Is_Constructor_Procedure then + return; -- the usual case + end if; + + Push_Scope (Spec_Id); + + -- Initialize the first parameter. + -- First_Param_Type is a record type (tagged or untagged) or + -- a type extension. If it is a type extension, then we begin by + -- calling the appropriate constructor procedure for the _parent + -- part. In the absence of a Super aspect specification, the + -- "appropriate" constructor is the one that takes only a single + -- parameter (the object being initialized). Additional actual + -- parameters for the constructor call may be provided via a + -- Super aspect specification, in which case a different + -- constructor procedure will be invoked. + -- + -- For each remaining component we first check to see if it + -- is mentioned in the Initialize aspect specification (if any) for + -- Body_Id. If so, then evaluate the expression given for that + -- component in the aspect specification and assign it to the + -- given component of the first parameter. If not, and if an + -- explicit default initial value is provided for the given component + -- in the type declaration, then do the same thing with that + -- expression instead. Otherwise perform normal default + -- initialization for the component - invoke the init proc for the + -- component's type if one exists, and otherwise do nothing. + + -- We do not perform tag initialization here. That is dealt with + -- elsewhere. The init proc for a tagged type is + -- passed an extra parameter indicating whether to perform + -- tag initialization. + + -- In the case of a type (tagged or untagged) that is not + -- an extension, we could just generate a single assignment, + -- taking the RHS from the Initialize aspect value (which is an + -- N_Aggregate node). But that gets complicated in the case of + -- an extension, so we handle all cases one component at a time. + + declare + Initialize_Aspect : constant Node_Id := + Find_Aspect (Body_Id, Aspect_Initialize); + + First_Initialize_Comp_Assoc : constant Node_Id := + (if Present (Initialize_Aspect) + then First (Component_Associations + (Expression (Initialize_Aspect))) + else Empty); + + Component : Entity_Id := First_Entity (First_Param_Type); + Init_List : constant List_Id := New_List; + + function Init_Expression_If_Any (Component : Entity_Id) + return Node_Id; + -- If the given component is mentioned in the Initialize + -- aspect for the constructor procedure, then return the + -- initial value expression specified there. + -- Otherwise, if the component declaration includes an + -- initial value expression, then return that expression. + -- Otherwise, return Empty. + + function Make_Init_Proc_Call (Component : Entity_Id; + Component_Name : Node_Id) + return Node_Id; + -- Builds and returns a call to the init proc for the type of + -- the component in order to initialize the given component. + -- The init proc must exist. + + function Make_Parent_Constructor_Call (Parent_Type : Entity_Id) + return Node_Id; + -- Builds and returns a call to the appropriate constructor + -- procedure of the parent type. + -- This function is called only in the case of a + -- Constructor procedure for a type extension. + + ---------------------------- + -- Init_Expression_If_Any -- + ---------------------------- + + function Init_Expression_If_Any (Component : Entity_Id) + return Node_Id + is + Initialize_Comp_Assoc : Node_Id := First_Initialize_Comp_Assoc; + Choice : Node_Id; + + -- ??? Technically, this is quadratic (linear search called + -- a linear number of times). When/if we see performance + -- problems with hundreds of components mentioned in one + -- Initialize aspect specification, we can revisit this. + begin + while Present (Initialize_Comp_Assoc) loop + Choice := First (Choices (Initialize_Comp_Assoc)); + + while Present (Choice) loop + if Nkind (Choice) = N_Identifier + and then Chars (Choice) = Chars (Component) + then + return Expression (Initialize_Comp_Assoc); + end if; + Next (Choice); + end loop; + + Next (Initialize_Comp_Assoc); + end loop; + + if Present (Expression (Parent (Component))) then + return Expression (Parent (Component)); + end if; + + return Empty; + end Init_Expression_If_Any; + + ------------------------- + -- Make_Init_Proc_Call -- + ------------------------- + + function Make_Init_Proc_Call (Component : Entity_Id; + Component_Name : Node_Id) + return Node_Id + is + Params : constant List_Id := New_List (Component_Name); + Init_Proc : constant Entity_Id := + Base_Init_Proc (Etype (Component)); + begin + if Is_Tagged_Type (Etype (Component)) then + Append (Make_Mode_Literal (Loc, Full_Init), Params); + end if; + + return Init_Proc_Call : constant Node_Id := + Make_Procedure_Call_Statement (Loc, + Name => New_Occurrence_Of (Init_Proc, Loc), + Parameter_Associations => Params) + do + pragma Assert (Check_Number_Of_Actuals + (Subp_Call => Init_Proc_Call, + Subp_Id => Init_Proc)); + end return; + end Make_Init_Proc_Call; + + ---------------------------------- + -- Make_Parent_Constructor_Call -- + ---------------------------------- + + function Make_Parent_Constructor_Call (Parent_Type : Entity_Id) + return Node_Id + is + Actual_Parameters : List_Id := No_List; + Super_Aspect : constant Node_Id := + Find_Aspect (Body_Id, Aspect_Super); + + -- Do not confuse the Super aspect with the Super attribute. + -- Both are referenced here, but they are not related as + -- closely as some aspect/attribute homonym pairs are. + -- The attribute takes an object as a prefix. The aspect + -- can be specified for the body of a constructor procedure. + begin + if Present (Super_Aspect) then + declare + Super_Expr : constant Node_Id := + Expression (Super_Aspect); + Expr : Node_Id; + begin + if Nkind (Super_Expr) /= N_Aggregate then + Expr := New_Copy_Tree (Super_Expr); + Set_Paren_Count (Expr, 0); + Actual_Parameters := New_List (Expr); + else + -- Interpret this "aggregate" as a list of + -- actual parameter expressions. + + Actual_Parameters := New_List; + Expr := First (Expressions (Super_Expr)); + while Present (Expr) loop + Append (New_Copy_Tree (Expr), Actual_Parameters); + Next (Expr); + end loop; + end if; + end; + end if; + + -- Build a prefixed-notation call + declare + Proc_Name : constant Node_Id := + Make_Selected_Component (Loc, + Prefix => + Make_Attribute_Reference (Loc, + Prefix => New_Occurrence_Of + (First_Formal (Spec_Id), Loc), + Attribute_Name => Name_Super), + Selector_Name => + Make_Identifier (Loc, + Chars (Constructor_Name (Parent_Type)))); + begin + Set_Is_Prefixed_Call (Proc_Name); + + return Make_Procedure_Call_Statement (Loc, + Name => Proc_Name, + Parameter_Associations => Actual_Parameters); + end; + end Make_Parent_Constructor_Call; + + begin + while Present (Component) loop + pragma Assert (Ekind (Component) = E_Component); + + if Chars (Component) = Name_uTag then + null; + + elsif Chars (Component) = Name_uParent then + -- ??? Here is where we should be looking for a + -- Super aspect specification in order to call the + -- right constructor with the right parameters + -- (as opposed to unconditionally calling the + -- single-parameter constructor). + Append_To (Init_List, Make_Parent_Constructor_Call + (Parent_Type => Etype (Component))); + + else + declare + Maybe_Init_Exp : constant Node_Id := + Init_Expression_If_Any (Component); + + function Make_Component_Name return Node_Id is + (Make_Selected_Component (Loc, + Prefix => + New_Occurrence_Of (First_Formal (Spec_Id), Loc), + Selector_Name => + Make_Identifier (Loc, Chars (Component)))); + begin + -- Handle case where initial value for this component + -- is specified either in an Initialize aspect + -- specification or as part of the component declaration. + + if Present (Maybe_Init_Exp) then + -- ??? Should reorganize things so that + -- procedure Build_Assignment in exp_ch3.adb + -- (which is currently declared inside of + -- Build_Record_Init_Proc) can be called from here. + -- That procedure handles some corner cases + -- that are not properly handled here (e.g., + -- mapping current instance references to the + -- appropriate formal parameter). + + if Is_Tagged_Type (Etype (Component)) then + Append_To (Init_List, + Make_Tag_Assignment_From_Type (Loc, + Target => Make_Component_Name, + Typ => Etype (Component))); + end if; + + Append_To (Init_List, + Make_Assignment_Statement (Loc, + Name => Make_Component_Name, + Expression => New_Copy_Tree + (Maybe_Init_Exp, + New_Scope => Body_Id))); + + -- Handle case where component's type has an init proc + elsif Has_Non_Null_Base_Init_Proc (Etype (Component)) then + Append_To (Init_List, + Make_Init_Proc_Call ( + Component => Component, + Component_Name => Make_Component_Name)); + else + pragma Assert (not Is_Tagged_Type (Etype (Component))); + end if; + end; + end if; + + Next_Entity (Component); + end loop; + + Insert_List_Before_And_Analyze (First (L), Init_List); + end; + + Pop_Scope; + end Prepend_Constructor_Procedure_Prologue; + -- Local variables Except_H : Node_Id; @@ -6536,6 +6858,12 @@ package body Exp_Ch6 is Detect_Infinite_Recursion (N, Spec_Id); end if; + -- If the subprogram is a constructor procedure then prepend + -- and analyze initialization code. + + Prepend_Constructor_Procedure_Prologue + (Spec_Id => Spec_Id, Body_Id => Body_Id, L => L); + -- Set to encode entity names in package body before gigi is called Qualify_Entity_Names (N); @@ -7265,7 +7593,7 @@ package body Exp_Ch6 is elsif (not Needs_Secondary_Stack (R_Type) and then not Is_Secondary_Stack_Thunk (Scope_Id)) - or else Is_Ignored_Ghost_Entity (Scope_Id) + or else Is_Ignored_Ghost_Entity_In_Codegen (Scope_Id) then -- Mutable records with variable-length components are not returned -- on the sec-stack, so we need to make sure that the back end will @@ -10264,9 +10592,8 @@ package body Exp_Ch6 is begin pragma Assert (Check_BIP_Actuals (Call_Node, Subp)); - - -- Build-in-place function calls return their result by - -- reference. + -- Build-in-place function calls return their result by + -- reference. pragma Assert (not Is_Build_In_Place_Function (Subp) or else Returns_By_Ref (Subp)); @@ -10379,7 +10706,14 @@ package body Exp_Ch6 is pragma Assert (Serious_Errors_Detected = 0); - Check_Calls (N); + -- Do not attempt to verify the return type in CodePeer_Mode + -- as CodePeer_Mode is missing some expansion code that + -- results in trees that would be considered malformed for + -- GCC but aren't for GNAT2SCIL. + + if not CodePeer_Mode then + Check_Calls (N); + end if; end Validate_Subprogram_Calls; -------------- diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index dd864b7ffd36..62e9d2cbb73f 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -2429,7 +2429,7 @@ package body Exp_Ch7 is -- Do not inspect an ignored Ghost package body because all -- code found within will not appear in the final tree. - if Is_Ignored_Ghost_Entity (Defining_Entity (Decl)) then + if Is_Ignored_Ghost_Entity_In_Codegen (Defining_Entity (Decl)) then null; elsif Ekind (Corresponding_Spec (Decl)) /= E_Generic_Package then @@ -2507,7 +2507,7 @@ package body Exp_Ch7 is -- Ignored Ghost types do not need any cleanup actions because -- they will not appear in the final tree. - if Is_Ignored_Ghost_Entity (Typ) then + if Is_Ignored_Ghost_Entity_In_Codegen (Typ) then null; elsif Is_Tagged_Type (Typ) @@ -2553,7 +2553,7 @@ package body Exp_Ch7 is -- Ignored Ghost objects do not need any cleanup actions -- because they will not appear in the final tree. - elsif Is_Ignored_Ghost_Entity (Obj_Id) then + elsif Is_Ignored_Ghost_Entity_In_Codegen (Obj_Id) then null; -- Conversely, if one of the above cases created a Master_Node, @@ -2655,7 +2655,7 @@ package body Exp_Ch7 is -- Freeze nodes for ignored Ghost types do not need cleanup -- actions because they will never appear in the final tree. - if Is_Ignored_Ghost_Entity (Typ) then + if Is_Ignored_Ghost_Entity_In_Codegen (Typ) then null; elsif (Is_Access_Object_Type (Typ) @@ -2680,7 +2680,7 @@ package body Exp_Ch7 is -- Do not inspect an ignored Ghost package because all code -- found within will not appear in the final tree. - if Is_Ignored_Ghost_Entity (Pack_Id) then + if Is_Ignored_Ghost_Entity_In_Codegen (Pack_Id) then null; elsif Ekind (Pack_Id) /= E_Generic_Package then @@ -5281,7 +5281,7 @@ package body Exp_Ch7 is -- Ignored Ghost objects do not need any cleanup actions because -- they will not appear in the final tree. - if Is_Ignored_Ghost_Entity (Obj_Id) then + if Is_Ignored_Ghost_Entity_In_Codegen (Obj_Id) then return; end if; diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index c979cf6899b1..a9eac808af6f 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -4686,7 +4686,7 @@ package body Exp_Ch9 is -- by a missing activation chain entity; also skip generating it when -- it is a ghost entity. - if No (Chain) or else Is_Ignored_Ghost_Entity (Chain) then + if No (Chain) or else Is_Ignored_Ghost_Entity_In_Codegen (Chain) then return; -- The availability of the activation chain entity does not ensure diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb index 1c09e204275e..f15d5244ba8e 100644 --- a/gcc/ada/exp_disp.adb +++ b/gcc/ada/exp_disp.adb @@ -971,7 +971,7 @@ package body Exp_Disp is pragma Assert (Is_Frozen (Typ)); if Extra_Formals_Known (Subp) then - Create_Extra_Formals (Subp_Typ); + Create_Extra_Formals (Subp_Typ, Related_Nod => Call_Node); -- Extra formals were previously deferred @@ -6056,7 +6056,7 @@ package body Exp_Disp is -- Skip ignored Ghost subprograms as those will be removed -- from the executable. - and then not Is_Ignored_Ghost_Entity (E) + and then not Is_Ignored_Ghost_Entity_In_Codegen (E) then pragma Assert (UI_To_Int (DT_Position (Prim)) <= Nb_Prim); diff --git a/gcc/ada/exp_prag.adb b/gcc/ada/exp_prag.adb index 7ec963a19508..f19b9f36287d 100644 --- a/gcc/ada/exp_prag.adb +++ b/gcc/ada/exp_prag.adb @@ -191,8 +191,7 @@ package body Exp_Prag is when Pragma_Suppress_Initialization => Expand_Pragma_Suppress_Initialization (N); - -- All other pragmas need no expander action (includes - -- Unknown_Pragma). + -- All other pragmas need no expander action when others => null; end case; @@ -1520,7 +1519,7 @@ package body Exp_Prag is is Cond : Node_Id; Error : Node_Id; - + Str : String_Id; begin -- Generate: -- Flag and then not Conseq @@ -1540,12 +1539,17 @@ package body Exp_Prag is Store_String_Chars ("failed contract case at "); Store_String_Chars (Build_Location_String (Sloc (Conseq))); + -- Store the string value as the call to RTE can cause a new unit to + -- be loaded which causes new strings to be created. + + Str := End_String; + Error := Make_Procedure_Call_Statement (Loc, Name => New_Occurrence_Of (RTE (RE_Raise_Assert_Failure), Loc), Parameter_Associations => New_List ( - Make_String_Literal (Loc, End_String))); + Make_String_Literal (Loc, Str))); if No (Checks) then Checks := @@ -2516,6 +2520,7 @@ package body Exp_Prag is Call : Node_Id; Call_List : List_Id; Call_Loc : Source_Ptr; + Check_Prag : Node_Id; Expr : Node_Id; Loc : Source_Ptr; Proc_Body : Node_Id; @@ -2604,6 +2609,20 @@ package body Exp_Prag is -- pragma Check (Initial_Condition, ); -- end Initial_Condition; + Check_Prag := + Make_Pragma + (Loc, + Chars => Name_Check, + Pragma_Argument_Associations => + New_List + (Make_Pragma_Argument_Association + (Loc, + Expression => + Make_Identifier (Loc, Name_Initial_Condition)), + Make_Pragma_Argument_Association + (Loc, Expression => New_Copy_Tree (Expr)))); + Copy_Assertion_Policy_Attributes (Check_Prag, IC_Prag); + Proc_Body := Make_Subprogram_Body (Loc, Specification => @@ -2611,15 +2630,7 @@ package body Exp_Prag is Declarations => Empty_List, Handled_Statement_Sequence => Make_Handled_Sequence_Of_Statements (Loc, - Statements => New_List ( - Make_Pragma (Loc, - Chars => Name_Check, - Pragma_Argument_Associations => New_List ( - Make_Pragma_Argument_Association (Loc, - Expression => - Make_Identifier (Loc, Name_Initial_Condition)), - Make_Pragma_Argument_Association (Loc, - Expression => New_Copy_Tree (Expr))))))); + Statements => New_List (Check_Prag))); Append_To (Body_List, Proc_Body); @@ -2943,6 +2954,7 @@ package body Exp_Prag is Typ => Expr_Typ, Curr_Val => New_Occurrence_Of (Curr_Id, Loc), Old_Val => New_Occurrence_Of (Old_Id, Loc))))); + Copy_Assertion_Policy_Attributes (Prag, N); -- Generate: -- if Curr /= Old then @@ -3221,6 +3233,11 @@ package body Exp_Prag is -- Prev_Decl and is stored in this parameter for a next call to this -- routine. Is_Last is True when there are no more variants to process. + function Variants_Function_Name (Prag : Node_Id) return Name_Id; + -- The name of the variants function is either + -- * _variants: if no assertion level was associated with the pragma. + -- * _variants_ otherwise. + ---------------------- -- Formal_Param_Map -- ---------------------- @@ -3264,11 +3281,11 @@ package body Exp_Prag is Expr_Typ : constant Entity_Id := Etype (Expr); Loc : constant Source_Ptr := Sloc (Expr); - Old_Id : Entity_Id; - Old_Decl : Node_Id; - Curr_Id : Entity_Id; - Curr_Decl : Node_Id; - Prag : Node_Id; + Old_Id : Entity_Id; + Old_Decl : Node_Id; + Curr_Id : Entity_Id; + Curr_Decl : Node_Id; + Check_Prag : Node_Id; begin -- Create temporaries that store the old values of the associated @@ -3308,7 +3325,7 @@ package body Exp_Prag is -- Generate: -- pragma Check (Variant, Curr <|> Old); - Prag := + Check_Prag := Make_Pragma (Loc, Chars => Name_Check, Pragma_Argument_Associations => New_List ( @@ -3323,6 +3340,7 @@ package body Exp_Prag is Typ => Expr_Typ, Curr_Val => New_Occurrence_Of (Curr_Id, Loc), Old_Val => New_Occurrence_Of (Old_Id, Loc))))); + Copy_Assertion_Policy_Attributes (Check_Prag, Prag); -- Generate: -- if Curr /= Old then @@ -3335,7 +3353,7 @@ package body Exp_Prag is -- pragma. if Is_Last then - If_Stmt := Prag; + If_Stmt := Check_Prag; else If_Stmt := Make_If_Statement (Loc, @@ -3343,7 +3361,7 @@ package body Exp_Prag is Make_Op_Ne (Loc, Left_Opnd => New_Occurrence_Of (Curr_Id, Loc), Right_Opnd => New_Occurrence_Of (Old_Id, Loc)), - Then_Statements => New_List (Prag)); + Then_Statements => New_List (Check_Prag)); end if; -- Generate: @@ -3352,7 +3370,7 @@ package body Exp_Prag is -- end if; elsif Is_Last then - Set_Else_Statements (If_Stmt, New_List (Prag)); + Set_Else_Statements (If_Stmt, New_List (Check_Prag)); -- Generate: -- elsif Curr /= Old then @@ -3369,10 +3387,30 @@ package body Exp_Prag is Make_Op_Ne (Loc, Left_Opnd => New_Occurrence_Of (Curr_Id, Loc), Right_Opnd => New_Occurrence_Of (Old_Id, Loc)), - Then_Statements => New_List (Prag))); + Then_Statements => New_List (Check_Prag))); end if; end Process_Variant; + ---------------------------- + -- Variants_Function_Name -- + ---------------------------- + + function Variants_Function_Name (Prag : Node_Id) return Name_Id is + begin + if Present (Pragma_Ghost_Assertion_Level (Prag)) + and then Pragma_Ghost_Assertion_Level (Prag) + /= Standard_Level_Default + then + Get_Name_String (Name_uVariants); + Add_Str_To_Name_Buffer ("_"); + Get_Name_String_And_Append + (Chars (Pragma_Ghost_Assertion_Level (Prag))); + return Name_Enter; + else + return Name_uVariants; + end if; + end Variants_Function_Name; + -- Local variables Loc : constant Source_Ptr := Sloc (Prag); @@ -3386,6 +3424,7 @@ package body Exp_Prag is Proc_Bod : Node_Id; Proc_Decl : Node_Id; Proc_Id : Entity_Id; + Proc_Nam : Name_Id; Proc_Spec : Node_Id; Variant : Node_Id; @@ -3411,7 +3450,9 @@ package body Exp_Prag is -- variant expressions captured at the start of subprogram with their -- values at the recursive call of the subprogram. - Proc_Id := Make_Defining_Identifier (Loc, Name_uVariants); + Proc_Nam := Variants_Function_Name (Prag); + + Proc_Id := Make_Defining_Identifier (Loc, Proc_Nam); Proc_Spec := Make_Procedure_Specification diff --git a/gcc/ada/exp_put_image.adb b/gcc/ada/exp_put_image.adb index ce3390b50384..c11bc43cfcab 100644 --- a/gcc/ada/exp_put_image.adb +++ b/gcc/ada/exp_put_image.adb @@ -363,6 +363,9 @@ package body Exp_Put_Image is Lib_RE := RE_Put_Image_Access_Prot_Subp; elsif Is_Access_Subprogram_Type (Base_Type (U_Type)) then Lib_RE := RE_Put_Image_Access_Subp; + elsif Is_Extended_Access_Type (Base_Type (U_Type)) then + pragma Assert (No (P_Size)); + Lib_RE := RE_Put_Image_Extended_Access_Pointer; elsif P_Size = System_Address_Size then Lib_RE := RE_Put_Image_Thin_Pointer; else diff --git a/gcc/ada/exp_strm.adb b/gcc/ada/exp_strm.adb index 5e1c9134fb57..3bb6966dc1c2 100644 --- a/gcc/ada/exp_strm.adb +++ b/gcc/ada/exp_strm.adb @@ -33,7 +33,6 @@ with Mutably_Tagged; use Mutably_Tagged; with Namet; use Namet; with Nlists; use Nlists; with Nmake; use Nmake; -with Rtsfind; use Rtsfind; with Sem_Aux; use Sem_Aux; with Sem_Util; use Sem_Util; with Sinfo; use Sinfo; @@ -43,7 +42,6 @@ with Snames; use Snames; with Stand; use Stand; with Tbuild; use Tbuild; with Ttypes; use Ttypes; -with Uintp; use Uintp; package body Exp_Strm is @@ -82,13 +80,13 @@ package body Exp_Strm is -- Decls and Stms are the declarations and statements for the body and -- The parameter Fnam is the name of the constructed function. - function Has_Stream_Standard_Rep (U_Type : Entity_Id) return Boolean; - -- This function is used to test the type U_Type, to determine if it has - -- a standard representation from a streaming point of view. Standard means - -- that it has a standard representation (e.g. no enumeration rep clause), - -- and the size of the root type is the same as the streaming size (which - -- is defined as value specified by a Stream_Size clause if present, or - -- the Esize of U_Type if not). + function Is_Stream_Standard_Rep + (U_Type : Entity_Id; S_Size : Uint) return Boolean; + -- This function is used to test the type U_Type, to determine whether it + -- would have a standard representation from a streaming point of view if + -- its Stream_Size attribute was set to S_Size. Standard means that it has + -- a standard representation (e.g. no enumeration rep clause), and the size + -- of the root type is the same as the stream size. function Make_Stream_Subprogram_Name (Loc : Source_Ptr; @@ -436,51 +434,39 @@ package body Exp_Strm is Build_Array_Read_Write_Procedure (Typ, Decl, Pnam, Name_Write); end Build_Array_Write_Procedure; - --------------------------------- - -- Build_Elementary_Input_Call -- - --------------------------------- - - function Build_Elementary_Input_Call (N : Node_Id) return Node_Id is - Loc : constant Source_Ptr := Sloc (N); - P_Type : constant Entity_Id := Entity (Prefix (N)); - U_Type : constant Entity_Id := Underlying_Type (P_Type); - Rt_Type : constant Entity_Id := Root_Type (U_Type); - FST : constant Entity_Id := First_Subtype (U_Type); - Strm : constant Node_Id := First (Expressions (N)); - Targ : constant Node_Id := Next (Strm); - P_Size : constant Uint := Get_Stream_Size (FST); - Res : Node_Id; - Lib_RE : RE_Id; + function Get_Primitives + (P_Type : Entity_Id; P_Size : Uint) return Primitive_Result + is - begin - -- Check first for Boolean and Character. These are enumeration types, - -- but we treat them specially, since they may require special handling - -- in the transfer protocol. However, this special handling only applies - -- if they have standard representation, otherwise they are treated like - -- any other enumeration type. - - if Rt_Type = Standard_Boolean - and then Has_Stream_Standard_Rep (U_Type) - then - Lib_RE := RE_I_B; + function Prims (Input, Write : RE_Id) return Primitive_Result; + function Prims (Input, Write : RE_Id) return Primitive_Result is + begin + return (Primitives, 0, Input, Write); + end Prims; - elsif Rt_Type = Standard_Character - and then Has_Stream_Standard_Rep (U_Type) - then - Lib_RE := RE_I_C; + function PSizes (L : Sizes) return Primitive_Result; + function PSizes (L : Sizes) return Primitive_Result is + begin + return (Possible_Sizes, L'Length, L); + end PSizes; - elsif Rt_Type = Standard_Wide_Character - and then Has_Stream_Standard_Rep (U_Type) - then - Lib_RE := RE_I_WC; + U_Type : constant Entity_Id := Underlying_Type (P_Type); + FST : constant Entity_Id := First_Subtype (U_Type); + Rt_Type : constant Entity_Id := Root_Type (U_Type); - elsif Rt_Type = Standard_Wide_Wide_Character - and then Has_Stream_Standard_Rep (U_Type) + Rep_Is_Standard : constant Boolean := + Known_RM_Size (U_Type) + and then Is_Stream_Standard_Rep (U_Type, P_Size); + begin + if Rt_Type = Standard_Boolean and then Rep_Is_Standard then + return Prims (RE_I_B, RE_W_B); + elsif Rt_Type = Standard_Character and then Rep_Is_Standard then + return Prims (RE_I_C, RE_W_C); + elsif Rt_Type = Standard_Wide_Character and then Rep_Is_Standard then + return Prims (RE_I_WC, RE_W_WC); + elsif Rt_Type = Standard_Wide_Wide_Character and then Rep_Is_Standard then - Lib_RE := RE_I_WWC; - - -- Floating point types - + return Prims (RE_I_WWC, RE_W_WWC); elsif Is_Floating_Point_Type (U_Type) then -- Question: should we use P_Size or Rt_Type to distinguish between @@ -500,23 +486,30 @@ package body Exp_Strm is -- To deal with these two requirements we add the special checks -- on equal sizes and use the root type to distinguish. - if P_Size <= Standard_Short_Float_Size + if P_Size = Standard_Short_Float_Size and then (Standard_Short_Float_Size /= Standard_Float_Size or else Rt_Type = Standard_Short_Float) then - Lib_RE := RE_I_SF; + return Prims (RE_I_SF, RE_W_SF); - elsif P_Size <= Standard_Float_Size then - Lib_RE := RE_I_F; + elsif P_Size = Standard_Float_Size then + return Prims (RE_I_F, RE_W_F); - elsif P_Size <= Standard_Long_Float_Size + elsif P_Size = Standard_Long_Float_Size and then (Standard_Long_Float_Size /= Standard_Long_Long_Float_Size - or else Rt_Type = Standard_Long_Float) + or else Rt_Type = Standard_Long_Float) then - Lib_RE := RE_I_LF; + return Prims (RE_I_LF, RE_W_LF); + elsif P_Size = Standard_Long_Long_Float_Size then + return Prims (RE_I_LLF, RE_W_LLF); else - Lib_RE := RE_I_LLF; + return + PSizes + ((Standard_Short_Float_Size, + Standard_Float_Size, + Standard_Long_Float_Size, + Standard_Long_Long_Float_Size)); end if; -- Signed integer types. Also includes signed fixed-point types and @@ -548,35 +541,42 @@ package body Exp_Strm is -- The following set of tests gets repeated many times, we should -- have an abstraction defined ??? - and then - (Is_Fixed_Point_Type (U_Type) - or else - Is_Enumeration_Type (U_Type) - or else - (Is_Signed_Integer_Type (U_Type) - and then not Has_Biased_Representation (FST))) + and then (Is_Fixed_Point_Type (U_Type) + or else Is_Enumeration_Type (U_Type) + or else (Is_Signed_Integer_Type (U_Type) + and then not Has_Biased_Representation (FST))) then - if P_Size <= Standard_Short_Short_Integer_Size then - Lib_RE := RE_I_SSI; + if P_Size = Standard_Short_Short_Integer_Size then + return Prims (RE_I_SSI, RE_W_SSI); - elsif P_Size <= Standard_Short_Integer_Size then - Lib_RE := RE_I_SI; + elsif P_Size = Standard_Short_Integer_Size then + return Prims (RE_I_SI, RE_W_SI); elsif P_Size = 24 then - Lib_RE := RE_I_I24; + return Prims (RE_I_I24, RE_W_I24); - elsif P_Size <= Standard_Integer_Size then - Lib_RE := RE_I_I; + elsif P_Size = Standard_Integer_Size then + return Prims (RE_I_I, RE_W_I); - elsif P_Size <= Standard_Long_Integer_Size then - Lib_RE := RE_I_LI; + elsif P_Size = Standard_Long_Integer_Size then + return Prims (RE_I_LI, RE_W_LI); - elsif P_Size <= Standard_Long_Long_Integer_Size then - Lib_RE := RE_I_LLI; + elsif P_Size = Standard_Long_Long_Integer_Size then + return Prims (RE_I_LLI, RE_W_LLI); + elsif P_Size = Standard_Long_Long_Long_Integer_Size then + return Prims (RE_I_LLLI, RE_W_LLLI); else - Lib_RE := RE_I_LLLI; + return + PSizes + ((Standard_Short_Short_Integer_Size, + Standard_Short_Integer_Size, + 24, + Standard_Integer_Size, + Standard_Long_Integer_Size, + Standard_Long_Long_Integer_Size, + Standard_Long_Long_Long_Integer_Size)); end if; -- Unsigned integer types, also includes unsigned fixed-point types @@ -586,41 +586,74 @@ package body Exp_Strm is -- Also includes signed integer types that are unsigned in the sense -- that they do not include negative numbers. See above for details. - elsif Is_Modular_Integer_Type (U_Type) - or else Is_Fixed_Point_Type (U_Type) - or else Is_Enumeration_Type (U_Type) + elsif Is_Modular_Integer_Type (U_Type) + or else Is_Fixed_Point_Type (U_Type) + or else Is_Enumeration_Type (U_Type) or else Is_Signed_Integer_Type (U_Type) then - if P_Size <= Standard_Short_Short_Integer_Size then - Lib_RE := RE_I_SSU; + if P_Size = Standard_Short_Short_Integer_Size then + return Prims (RE_I_SSU, RE_W_SSU); - elsif P_Size <= Standard_Short_Integer_Size then - Lib_RE := RE_I_SU; + elsif P_Size = Standard_Short_Integer_Size then + return Prims (RE_I_SU, RE_W_SU); elsif P_Size = 24 then - Lib_RE := RE_I_U24; + return Prims (RE_I_U24, RE_W_U24); + + elsif P_Size = Standard_Integer_Size then + return Prims (RE_I_U, RE_W_U); - elsif P_Size <= Standard_Integer_Size then - Lib_RE := RE_I_U; + elsif P_Size = Standard_Long_Integer_Size then + return Prims (RE_I_LU, RE_W_LU); - elsif P_Size <= Standard_Long_Integer_Size then - Lib_RE := RE_I_LU; + elsif P_Size = Standard_Long_Long_Integer_Size then + return Prims (RE_I_LLU, RE_W_LLU); - elsif P_Size <= Standard_Long_Long_Integer_Size then - Lib_RE := RE_I_LLU; + elsif P_Size = Standard_Long_Long_Long_Integer_Size then + return Prims (RE_I_LLLU, RE_W_LLLU); else - Lib_RE := RE_I_LLLU; + return + PSizes + ((Standard_Short_Short_Integer_Size, + Standard_Short_Integer_Size, + 24, + Standard_Integer_Size, + Standard_Long_Integer_Size, + Standard_Long_Long_Integer_Size, + Standard_Long_Long_Long_Integer_Size)); end if; else pragma Assert (Is_Access_Type (U_Type)); if Present (P_Size) and then P_Size > System_Address_Size then - Lib_RE := RE_I_AD; + return Prims (RE_I_AD, RE_W_AD); else - Lib_RE := RE_I_AS; + return Prims (RE_I_AS, RE_W_AS); end if; end if; + end Get_Primitives; + + --------------------------------- + -- Build_Elementary_Input_Call -- + --------------------------------- + + function Build_Elementary_Input_Call (N : Node_Id) return Node_Id is + Loc : constant Source_Ptr := Sloc (N); + P_Type : constant Entity_Id := Entity (Prefix (N)); + U_Type : constant Entity_Id := Underlying_Type (P_Type); + FST : constant Entity_Id := First_Subtype (U_Type); + Strm : constant Node_Id := First (Expressions (N)); + Targ : constant Node_Id := Next (Strm); + P_Size : constant Uint := Get_Stream_Size (FST); + Res : Node_Id; + Prims : constant Primitive_Result := Get_Primitives (P_Type, P_Size); + + Lib_RE : constant RE_Id := + (case Prims.S is + when Primitives => Prims.Input, + when others => raise Program_Error); + begin -- Call the function, and do an unchecked conversion of the result -- to the actual type of the prefix. If the target is a discriminant, -- and we are in the body of the default implementation of a 'Read @@ -679,191 +712,22 @@ package body Exp_Strm is function Build_Elementary_Write_Call (N : Node_Id) return Node_Id is Loc : constant Source_Ptr := Sloc (N); - P_Type : constant Entity_Id := Entity (Prefix (N)); - U_Type : constant Entity_Id := Underlying_Type (P_Type); - Rt_Type : constant Entity_Id := Root_Type (U_Type); - FST : constant Entity_Id := First_Subtype (U_Type); - Strm : constant Node_Id := First (Expressions (N)); - Item : constant Node_Id := Next (Strm); - P_Size : Uint; - Lib_RE : RE_Id; + P_Type : constant Entity_Id := Entity (Prefix (N)); + U_Type : constant Entity_Id := Underlying_Type (P_Type); + FST : constant Entity_Id := First_Subtype (U_Type); + Strm : constant Node_Id := First (Expressions (N)); + Item : constant Node_Id := Next (Strm); + P_Size : constant Uint := Get_Stream_Size (FST); Libent : Entity_Id; - begin - -- Compute the size of the stream element. This is either the size of - -- the first subtype or if given the size of the Stream_Size attribute. - - if Has_Stream_Size_Clause (FST) then - P_Size := Static_Integer (Expression (Stream_Size_Clause (FST))); - else - P_Size := Esize (FST); - end if; - - -- Find the routine to be called - - -- Check for First Boolean and Character. These are enumeration types, - -- but we treat them specially, since they may require special handling - -- in the transfer protocol. However, this special handling only applies - -- if they have standard representation, otherwise they are treated like - -- any other enumeration type. - - if Rt_Type = Standard_Boolean - and then Has_Stream_Standard_Rep (U_Type) - then - Lib_RE := RE_W_B; - - elsif Rt_Type = Standard_Character - and then Has_Stream_Standard_Rep (U_Type) - then - Lib_RE := RE_W_C; - - elsif Rt_Type = Standard_Wide_Character - and then Has_Stream_Standard_Rep (U_Type) - then - Lib_RE := RE_W_WC; - - elsif Rt_Type = Standard_Wide_Wide_Character - and then Has_Stream_Standard_Rep (U_Type) - then - Lib_RE := RE_W_WWC; - - -- Floating point types - - elsif Is_Floating_Point_Type (U_Type) then - - -- Question: should we use P_Size or Rt_Type to distinguish between - -- possible floating point types? If a non-standard size or a stream - -- size is specified, then we should certainly use the size. But if - -- we have two types the same (notably Short_Float_Size = Float_Size - -- which is close to universally true, and Long_Long_Float_Size = - -- Long_Float_Size, true on most targets except the x86), then we - -- would really rather use the root type, so that if people want to - -- fiddle with System.Stream_Attributes to get inter-target portable - -- streams, they get the size they expect. Consider in particular the - -- case of a stream written on an x86, with 96-bit Long_Long_Float - -- being read into a non-x86 target with 64 bit Long_Long_Float. A - -- special version of System.Stream_Attributes can deal with this - -- provided the proper type is always used. - - -- To deal with these two requirements we add the special checks - -- on equal sizes and use the root type to distinguish. - - if P_Size <= Standard_Short_Float_Size - and then (Standard_Short_Float_Size /= Standard_Float_Size - or else Rt_Type = Standard_Short_Float) - then - Lib_RE := RE_W_SF; - - elsif P_Size <= Standard_Float_Size then - Lib_RE := RE_W_F; - - elsif P_Size <= Standard_Long_Float_Size - and then (Standard_Long_Float_Size /= Standard_Long_Long_Float_Size - or else Rt_Type = Standard_Long_Float) - then - Lib_RE := RE_W_LF; - - else - Lib_RE := RE_W_LLF; - end if; - - -- Signed integer types. Also includes signed fixed-point types and - -- signed enumeration types share this circuitry. - - -- Note on signed integer types. We do not consider types as signed for - -- this purpose if they have no negative numbers, or if they have biased - -- representation. The reason is that the value in either case basically - -- represents an unsigned value. - - -- For example, consider: - - -- type W is range 0 .. 2**32 - 1; - -- for W'Size use 32; - - -- This is a signed type, but the representation is unsigned, and may - -- be outside the range of a 32-bit signed integer, so this must be - -- treated as 32-bit unsigned. - - -- Similarly, the representation is also unsigned if we have: - - -- type W is range -1 .. +254; - -- for W'Size use 8; - - -- forcing a biased and unsigned representation - - elsif not Is_Unsigned_Type (FST) - and then - (Is_Fixed_Point_Type (U_Type) - or else - Is_Enumeration_Type (U_Type) - or else - (Is_Signed_Integer_Type (U_Type) - and then not Has_Biased_Representation (FST))) - then - if P_Size <= Standard_Short_Short_Integer_Size then - Lib_RE := RE_W_SSI; - - elsif P_Size <= Standard_Short_Integer_Size then - Lib_RE := RE_W_SI; + Prims : constant Primitive_Result := Get_Primitives (P_Type, P_Size); - elsif P_Size = 24 then - Lib_RE := RE_W_I24; - - elsif P_Size <= Standard_Integer_Size then - Lib_RE := RE_W_I; - - elsif P_Size <= Standard_Long_Integer_Size then - Lib_RE := RE_W_LI; - - elsif P_Size <= Standard_Long_Long_Integer_Size then - Lib_RE := RE_W_LLI; - - else - Lib_RE := RE_W_LLLI; - end if; - - -- Unsigned integer types, also includes unsigned fixed-point types - -- and unsigned enumeration types (note we know they are unsigned - -- because we already tested for signed above). - - -- Also includes signed integer types that are unsigned in the sense - -- that they do not include negative numbers. See above for details. - - elsif Is_Modular_Integer_Type (U_Type) - or else Is_Fixed_Point_Type (U_Type) - or else Is_Enumeration_Type (U_Type) - or else Is_Signed_Integer_Type (U_Type) - then - if P_Size <= Standard_Short_Short_Integer_Size then - Lib_RE := RE_W_SSU; - - elsif P_Size <= Standard_Short_Integer_Size then - Lib_RE := RE_W_SU; - - elsif P_Size = 24 then - Lib_RE := RE_W_U24; - - elsif P_Size <= Standard_Integer_Size then - Lib_RE := RE_W_U; - - elsif P_Size <= Standard_Long_Integer_Size then - Lib_RE := RE_W_LU; - - elsif P_Size <= Standard_Long_Long_Integer_Size then - Lib_RE := RE_W_LLU; - - else - Lib_RE := RE_W_LLLU; - end if; - - else pragma Assert (Is_Access_Type (U_Type)); - - if Present (P_Size) and then P_Size > System_Address_Size then - Lib_RE := RE_W_AD; - else - Lib_RE := RE_W_AS; - end if; - end if; + Lib_RE : constant RE_Id := + (case Prims.S is + when Primitives => Prims.Write, + when others => raise Program_Error); + begin + pragma Assert (Prims.S = Primitives); -- Unchecked-convert parameter to the required type (i.e. the type of -- the corresponding parameter, and call the appropriate routine. @@ -871,12 +735,15 @@ package body Exp_Strm is Libent := RTE (Lib_RE); return - Make_Procedure_Call_Statement (Loc, - Name => New_Occurrence_Of (Libent, Loc), - Parameter_Associations => New_List ( - Relocate_Node (Strm), - Unchecked_Convert_To (Etype (Next_Formal (First_Formal (Libent))), - Relocate_Node (Item)))); + Make_Procedure_Call_Statement + (Loc, + Name => New_Occurrence_Of (Libent, Loc), + Parameter_Associations => + New_List + (Relocate_Node (Strm), + Unchecked_Convert_To + (Etype (Next_Formal (First_Formal (Libent))), + Relocate_Node (Item)))); end Build_Elementary_Write_Call; ----------------------------------------- @@ -1766,22 +1633,15 @@ package body Exp_Strm is -- Has_Stream_Standard_Rep -- ----------------------------- - function Has_Stream_Standard_Rep (U_Type : Entity_Id) return Boolean is - Siz : Uint; - + function Is_Stream_Standard_Rep + (U_Type : Entity_Id; S_Size : Uint) return Boolean is begin if Has_Non_Standard_Rep (U_Type) then return False; end if; - if Has_Stream_Size_Clause (U_Type) then - Siz := Static_Integer (Expression (Stream_Size_Clause (U_Type))); - else - Siz := Esize (First_Subtype (U_Type)); - end if; - - return Siz = Esize (Root_Type (U_Type)); - end Has_Stream_Standard_Rep; + return S_Size = Esize (Root_Type (U_Type)); + end Is_Stream_Standard_Rep; --------------------------------- -- Make_Stream_Subprogram_Name -- @@ -1827,5 +1687,4 @@ package body Exp_Strm is return Base_Type (E); end if; end Stream_Base_Type; - end Exp_Strm; diff --git a/gcc/ada/exp_strm.ads b/gcc/ada/exp_strm.ads index 733cf9c0dd19..54eded5d61df 100644 --- a/gcc/ada/exp_strm.ads +++ b/gcc/ada/exp_strm.ads @@ -26,7 +26,9 @@ -- Routines to build stream subprograms for composite types with Exp_Tss; use Exp_Tss; +with Rtsfind; use Rtsfind; with Types; use Types; +with Uintp; use Uintp; package Exp_Strm is @@ -138,4 +140,32 @@ package Exp_Strm is -- always null), and Pnam is the name of the constructed procedure. -- Used by Exp_Dist to generate stream-oriented attributes for RACWs. + type Status is (Primitives, Possible_Sizes); + + type Sizes is array (Positive range <>) of Nat; + + type Primitive_Result + (S : Status; + Len : Natural) + is record + case S is + when Primitives => + Input : RE_Id; + Write : RE_Id; + + when Possible_Sizes => + List : Sizes (1 .. Len); + end case; + end record; + + -------------------- + -- Get_Primitives -- + -------------------- + + function Get_Primitives + (P_Type : Entity_Id; P_Size : Uint) return Primitive_Result; + -- If P_Type supports a stream size of P_Size, returns the corresponding + -- input and write primitives. Otherwise, returns a list of the stream + -- sizes P_Type supports, in nondecreasing order and with possible + -- duplicates. end Exp_Strm; diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index e9ec7b73d877..30b2461c4af6 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -638,6 +638,23 @@ package body Exp_Util is end if; else + -- For GNAT objects with indefinite nominal subtypes will have + -- an itype constrained by their initialization expression + -- (except for class-wide type). For GNATprove, those objects + -- will keep their nominal subtype unconstrained, while + -- actually those objects are constrained; see call from + -- Analyze_Object_Declaration to Expand_Subtype_From_Expr. + + if Ekind (Ent) in E_Constant | E_Variable + and then not Is_Definite_Subtype (Etype (Ent)) + and then not Is_Class_Wide_Type (Etype (Ent)) + and then No (Renamed_Object (Ent)) + then + pragma Assert + (GNATprove_Mode + and then Present (Expression (Parent (Ent)))); + return True; + end if; -- If the prefix is not a variable or is aliased, then -- definitely true; if it's a formal parameter without an @@ -1893,12 +1910,11 @@ package body Exp_Util is ------------------- procedure Add_DIC_Check - (DIC_Prag : Node_Id; - DIC_Expr : Node_Id; - Stmts : in out List_Id) + (DIC_Prag : Node_Id; DIC_Expr : Node_Id; Stmts : in out List_Id) is - Loc : constant Source_Ptr := Sloc (DIC_Prag); - Nam : constant Name_Id := Original_Aspect_Pragma_Name (DIC_Prag); + Loc : constant Source_Ptr := Sloc (DIC_Prag); + Nam : constant Name_Id := Original_Aspect_Pragma_Name (DIC_Prag); + Prag : Node_Id; begin -- The DIC pragma is ignored, nothing left to do @@ -1908,21 +1924,25 @@ package body Exp_Util is -- Otherwise the DIC expression must be checked at run time. -- Generate: - + -- -- pragma Check (, ); else - Append_New_To (Stmts, - Make_Pragma (Loc, - Pragma_Identifier => - Make_Identifier (Loc, Name_Check), + Prag := + Make_Pragma + (Loc, + Pragma_Identifier => + Make_Identifier (Loc, Name_Check), + Pragma_Argument_Associations => + New_List + (Make_Pragma_Argument_Association + (Loc, Expression => Make_Identifier (Loc, Nam)), + Make_Pragma_Argument_Association + (Loc, Expression => DIC_Expr))); - Pragma_Argument_Associations => New_List ( - Make_Pragma_Argument_Association (Loc, - Expression => Make_Identifier (Loc, Nam)), + Copy_Assertion_Policy_Attributes (Prag, DIC_Prag); - Make_Pragma_Argument_Association (Loc, - Expression => DIC_Expr)))); + Append_New_To (Stmts, Prag); end if; -- Add the pragma to the list of processed pragmas @@ -2318,6 +2338,7 @@ package body Exp_Util is DIC_Typ : Entity_Id; Dummy_1 : Entity_Id; Dummy_2 : Entity_Id; + Prag : Node_Id; Proc_Body : Node_Id; Proc_Body_Id : Entity_Id; Proc_Decl : Node_Id; @@ -2464,12 +2485,23 @@ package body Exp_Util is if Partial_DIC then pragma Assert (Present (Priv_Typ)); - if Has_Own_DIC (Work_Typ) then -- If we're testing this then maybe - Add_Own_DIC -- we shouldn't be calling Find_DIC_Typ above??? - (DIC_Prag => DIC_Prag, - DIC_Typ => DIC_Typ, -- Should this just be Work_Typ??? - Obj_Id => Obj_Id, - Stmts => Stmts); + if Has_Own_DIC (Work_Typ) then + -- If we're testing this then maybe + + Prag := DIC_Prag; + while Present (Prag) + and then Nkind (Prag) = N_Pragma + and then Pragma_Name (Prag) = Name_Default_Initial_Condition + and then (Prag = DIC_Prag + or else From_Same_Pragma (Prag, DIC_Prag)) + loop + Add_Own_DIC -- we shouldn't be calling Find_DIC_Typ above??? + (DIC_Prag => Prag, + DIC_Typ => DIC_Typ, -- Should this just be Work_Typ??? + Obj_Id => Obj_Id, + Stmts => Stmts); + Next_Rep_Item (Prag); + end loop; end if; -- Otherwise, the "full" DIC procedure verifies the DICs inherited from @@ -3229,8 +3261,9 @@ package body Exp_Util is Ploc : constant Source_Ptr := Sloc (Prag); Str_Arg : constant Node_Id := Next (Next (First (Args))); - Assoc : List_Id; - Str : String_Id; + Assoc : List_Id; + Check_Prag : Node_Id; + Str : String_Id; begin -- The invariant is ignored, nothing left to do @@ -3273,10 +3306,14 @@ package body Exp_Util is -- Generate: -- pragma Check (, , ); - Append_New_To (Checks, + Check_Prag := Make_Pragma (Ploc, - Chars => Name_Check, - Pragma_Argument_Associations => Assoc)); + Chars => Name_Check, + Pragma_Argument_Associations => Assoc); + + Copy_Assertion_Policy_Attributes (Check_Prag, Prag); + + Append_New_To (Checks, Check_Prag); end if; -- Output an info message when inheriting an invariant and the @@ -6186,7 +6223,11 @@ package body Exp_Util is Utyp := Corresponding_Record_Type (Root_Type (Btyp)); elsif Is_Implicit_Full_View (Utyp) then - Utyp := Underlying_Type (Root_Type (Btyp)); + if Is_Derived_Type (Btyp) then + Utyp := Underlying_Type (Root_Type (Btyp)); + else + Utyp := Underlying_Type (Root_Type (Full_View (Btyp))); + end if; if Is_Protected_Type (Utyp) then Utyp := Corresponding_Record_Type (Utyp); @@ -10013,7 +10054,8 @@ package body Exp_Util is begin return (not Is_Tagged_Type (T) and then Is_Derived_Type (T)) or else - (Is_Private_Type (T) and then Present (Full_View (T)) + (Is_Private_Type (T) + and then Present (Full_View (T)) and then not Is_Tagged_Type (Full_View (T)) and then Is_Derived_Type (Full_View (T)) and then Etype (Full_View (T)) /= T); @@ -13478,7 +13520,7 @@ package body Exp_Util is -- Ignored Ghost types do not need any cleanup actions because -- they will not appear in the final tree. - if Is_Ignored_Ghost_Entity (Typ) then + if Is_Ignored_Ghost_Entity_In_Codegen (Typ) then null; elsif Is_Tagged_Type (Typ) @@ -13524,7 +13566,7 @@ package body Exp_Util is -- Ignored Ghost objects do not need any cleanup actions because -- they will not appear in the final tree. - elsif Is_Ignored_Ghost_Entity (Obj_Id) then + elsif Is_Ignored_Ghost_Entity_In_Codegen (Obj_Id) then null; -- Conversely, if one of the above cases created a Master_Node, @@ -13620,7 +13662,7 @@ package body Exp_Util is -- Freeze nodes for ignored Ghost types do not need cleanup -- actions because they will never appear in the final tree. - if Is_Ignored_Ghost_Entity (Typ) then + if Is_Ignored_Ghost_Entity_In_Codegen (Typ) then null; elsif ((Is_Access_Object_Type (Typ) @@ -13643,7 +13685,7 @@ package body Exp_Util is -- Do not inspect an ignored Ghost package because all code found -- within will not appear in the final tree. - if Is_Ignored_Ghost_Entity (Pack_Id) then + if Is_Ignored_Ghost_Entity_In_Codegen (Pack_Id) then null; elsif Ekind (Pack_Id) /= E_Generic_Package @@ -13660,7 +13702,7 @@ package body Exp_Util is -- Do not inspect an ignored Ghost package body because all code -- found within will not appear in the final tree. - if Is_Ignored_Ghost_Entity (Defining_Entity (Decl)) then + if Is_Ignored_Ghost_Entity_In_Codegen (Defining_Entity (Decl)) then null; elsif Ekind (Corresponding_Spec (Decl)) /= E_Generic_Package @@ -14883,6 +14925,37 @@ package body Exp_Util is Node : Node_Id := N; Parent_Node : Node_Id := Parent (Node); + begin + loop + case Nkind (Parent_Node) is + when N_Case_Expression_Alternative => + null; + + when N_Case_Expression => + exit when Node = Expression (Parent_Node); + + when N_If_Expression => + exit when Node = First (Expressions (Parent_Node)); + + when others => + exit; + end case; + + Node := Parent_Node; + Parent_Node := Parent (Node); + end loop; + + return Parent_Node; + end Unconditional_Parent; + + -------------------------------------- + -- Unqualified_Unconditional_Parent -- + -------------------------------------- + + function Unqualified_Unconditional_Parent (N : Node_Id) return Node_Id is + Node : Node_Id := N; + Parent_Node : Node_Id := Parent (Node); + begin loop case Nkind (Parent_Node) is @@ -14907,7 +14980,7 @@ package body Exp_Util is end loop; return Parent_Node; - end Unconditional_Parent; + end Unqualified_Unconditional_Parent; ------------------------------- -- Update_Primitives_Mapping -- diff --git a/gcc/ada/exp_util.ads b/gcc/ada/exp_util.ads index 4226fcc93777..b7d8a185f4bd 100644 --- a/gcc/ada/exp_util.ads +++ b/gcc/ada/exp_util.ads @@ -1344,6 +1344,10 @@ package Exp_Util is function Unconditional_Parent (N : Node_Id) return Node_Id; -- Return the first parent of arbitrary node N that is not a conditional + -- expression, one of whose dependent expressions is N, recursively. + + function Unqualified_Unconditional_Parent (N : Node_Id) return Node_Id; + -- Return the first parent of arbitrary node N that is not a conditional -- expression, one of whose dependent expressions is N, and that is not -- a qualified expression, whose expression is N, recursively. diff --git a/gcc/ada/fe.h b/gcc/ada/fe.h index 0b80a56cf195..5cc038a4e41a 100644 --- a/gcc/ada/fe.h +++ b/gcc/ada/fe.h @@ -315,6 +315,7 @@ extern Boolean Is_Null_Range (Node_Id, Node_Id); #define First_Actual sem_util__first_actual #define Has_Storage_Model_Type_Aspect sem_util__storage_model_support__has_storage_model_type_aspect #define Has_Designated_Storage_Model_Aspect sem_util__storage_model_support__has_designated_storage_model_aspect +#define Is_Extended_Access_Type sem_util__is_extended_access_type #define Is_Expression_Function sem_util__is_expression_function #define Is_Variable_Size_Record sem_util__is_variable_size_record #define Needs_Secondary_Stack sem_util__needs_secondary_stack @@ -327,6 +328,7 @@ extern Entity_Id Defining_Entity (Node_Id); extern Node_Id First_Actual (Node_Id); extern Boolean Has_Storage_Model_Type_Aspect (Entity_Id); extern Boolean Has_Designated_Storage_Model_Aspect (Entity_Id); +extern Boolean Is_Extended_Access_Type (Entity_Id); extern Boolean Is_Expression_Function (Entity_Id); extern Boolean Is_Variable_Size_Record (Entity_Id); extern Boolean Needs_Secondary_Stack (Entity_Id); diff --git a/gcc/ada/fmap.adb b/gcc/ada/fmap.adb index 4ca4f2330875..4f20231365dd 100644 --- a/gcc/ada/fmap.adb +++ b/gcc/ada/fmap.adb @@ -58,7 +58,7 @@ package body Fmap is package File_Mapping is new Table.Table ( Table_Component_Type => Mapping, Table_Index_Type => Int, - Table_Low_Bound => 0, + Table_Low_Bound => 1, Table_Initial => 1_000, Table_Increment => 1_000, Table_Name => "Fmap.File_Mapping"); @@ -67,7 +67,7 @@ package body Fmap is package Path_Mapping is new Table.Table ( Table_Component_Type => Mapping, Table_Index_Type => Int, - Table_Low_Bound => 0, + Table_Low_Bound => 1, Table_Initial => 1_000, Table_Increment => 1_000, Table_Name => "Fmap.Path_Mapping"); @@ -106,23 +106,6 @@ package body Fmap is Last_In_Table : Int := 0; - package Forbidden_Names is new GNAT.HTable.Simple_HTable ( - Header_Num => Header_Num, - Element => Boolean, - No_Element => False, - Key => File_Name_Type, - Hash => Hash, - Equal => "="); - - ----------------------------- - -- Add_Forbidden_File_Name -- - ----------------------------- - - procedure Add_Forbidden_File_Name (Name : File_Name_Type) is - begin - Forbidden_Names.Set (Name, True); - end Add_Forbidden_File_Name; - --------------------- -- Add_To_File_Map -- --------------------- @@ -138,19 +121,15 @@ package body Fmap is if Unit_Entry = No_Entry or else File_Mapping.Table (Unit_Entry).Fname /= File_Name then - File_Mapping.Increment_Last; + File_Mapping.Append ((Uname => Unit_Name, Fname => File_Name)); Unit_Hash_Table.Set (Unit_Name, File_Mapping.Last); - File_Mapping.Table (File_Mapping.Last) := - (Uname => Unit_Name, Fname => File_Name); end if; if File_Entry = No_Entry or else Path_Mapping.Table (File_Entry).Fname /= Path_Name then - Path_Mapping.Increment_Last; + Path_Mapping.Append ((Uname => Unit_Name, Fname => Path_Name)); File_Hash_Table.Set (File_Name, Path_Mapping.Last); - Path_Mapping.Table (Path_Mapping.Last) := - (Uname => Unit_Name, Fname => Path_Name); end if; end Add_To_File_Map; @@ -401,10 +380,6 @@ package body Fmap is Index : Int := No_Entry; begin - if Forbidden_Names.Get (File) then - return Error_File_Name; - end if; - Index := File_Hash_Table.Get (File); if Index = No_Entry then @@ -424,7 +399,6 @@ package body Fmap is Path_Mapping.Init; Unit_Hash_Table.Reset; File_Hash_Table.Reset; - Forbidden_Names.Reset; Last_In_Table := 0; end Reset_Tables; diff --git a/gcc/ada/fmap.ads b/gcc/ada/fmap.ads index 9fb77d8d5453..02f45882a037 100644 --- a/gcc/ada/fmap.ads +++ b/gcc/ada/fmap.ads @@ -70,9 +70,4 @@ package Fmap is procedure Reset_Tables; -- Initialize all the internal data structures - procedure Add_Forbidden_File_Name (Name : File_Name_Type); - -- Indicate that a source file name is forbidden. This is used when there - -- are excluded sources in projects (attributes Excluded_Source_Files or - -- Locally_Removed_Files). - end Fmap; diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index 2ebffff7a5fa..d8fdc306c3a5 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -4245,7 +4245,7 @@ package body Freeze is <> -- A Ghost type cannot have a component of protected or task type - -- (SPARK RM 6.9(21)). + -- (SPARK RM 6.9(22)). if Is_Ghost_Entity (Arr) and then Is_Concurrent_Type (Ctyp) then Error_Msg_N @@ -4685,7 +4685,9 @@ package body Freeze is -- Declaring too big an array in disabled ghost code is OK - if Is_Array_Type (Typ) and then not Is_Ignored_Ghost_Entity (E) then + if Is_Array_Type (Typ) + and then not Is_Ignored_Ghost_Entity_In_Codegen (E) + then Check_Large_Modular_Array (Typ); end if; end Freeze_Object_Declaration; @@ -5180,7 +5182,7 @@ package body Freeze is and then Convention (Desig) /= Convention_Protected then Set_Is_Frozen (Desig); - Create_Extra_Formals (Desig); + Create_Extra_Formals (Desig, Related_Nod => Rec); end if; end Check_Itype; @@ -5644,14 +5646,9 @@ package body Freeze is -- If the component is an access type with an allocator as default -- value, the designated type will be frozen by the corresponding - -- expression in init_proc. In order to place the freeze node for - -- the designated type before that for the current record type, - -- freeze it now. - - -- Same process if the component is an array of access types, - -- initialized with an aggregate. If the designated type is - -- private, it cannot contain allocators, and it is premature - -- to freeze the type, so we check for this as well. + -- expression in the initialization procedure. In order to place + -- the freeze node for the designated type ahead of that for the + -- current record type, freeze the designated type right now. elsif Is_Access_Type (Etype (Comp)) and then Present (Parent (Comp)) @@ -5663,17 +5660,16 @@ package body Freeze is declare Alloc : constant Node_Id := Unqualify (Expression (Parent (Comp))); - + Desig_Typ : constant Entity_Id := + Designated_Type (Etype (Comp)); begin if Nkind (Alloc) = N_Allocator then - -- If component is pointer to a class-wide type, freeze -- the specific type in the expression being allocated. -- The expression may be a subtype indication, in which -- case freeze the subtype mark. - if Is_Class_Wide_Type (Designated_Type (Etype (Comp))) - then + if Is_Class_Wide_Type (Desig_Typ) then if Is_Entity_Name (Expression (Alloc)) then Freeze_And_Append (Entity (Expression (Alloc)), N, Result); @@ -5684,21 +5680,24 @@ package body Freeze is (Entity (Subtype_Mark (Expression (Alloc))), N, Result); end if; - elsif Is_Itype (Designated_Type (Etype (Comp))) then + elsif Is_Itype (Desig_Typ) then Check_Itype (Etype (Comp)); else - Freeze_And_Append - (Designated_Type (Etype (Comp)), N, Result); + Freeze_And_Append (Desig_Typ, N, Result); end if; end if; end; + elsif Is_Access_Type (Etype (Comp)) and then Is_Itype (Designated_Type (Etype (Comp))) then Check_Itype (Etype (Comp)); - -- Freeze the designated type when initializing a component with - -- an aggregate in case the aggregate contains allocators. + -- Likewise if the component is an array of access types that is + -- initialized with an aggregate, in case the aggregate contains + -- allocators. But if the designated type is private, it cannot + -- contain allocators, and it is premature to freeze the type, + -- so we check for this as well. -- type T is ...; -- type T_Ptr is access all T; @@ -5710,13 +5709,15 @@ package body Freeze is elsif Is_Array_Type (Etype (Comp)) and then Is_Access_Type (Component_Type (Etype (Comp))) + and then Present (Parent (Comp)) + and then Nkind (Parent (Comp)) = N_Component_Declaration + and then Present (Expression (Parent (Comp))) + and then Nkind (Expression (Parent (Comp))) = N_Aggregate then declare - Comp_Par : constant Node_Id := Parent (Comp); Desig_Typ : constant Entity_Id := Designated_Type (Component_Type (Etype (Comp))); - begin -- The only case when this sort of freezing is not done is -- when the designated type is class-wide and the root type @@ -5738,12 +5739,7 @@ package body Freeze is then null; - elsif Is_Fully_Defined (Desig_Typ) - and then Present (Comp_Par) - and then Nkind (Comp_Par) = N_Component_Declaration - and then Present (Expression (Comp_Par)) - and then Nkind (Expression (Comp_Par)) = N_Aggregate - then + elsif Is_Fully_Defined (Desig_Typ) then Freeze_And_Append (Desig_Typ, N, Result); end if; end; @@ -6788,6 +6784,27 @@ package body Freeze is Set_Is_Frozen (E); + -- Freeze profile of anonymous access-to-subprogram type + + if Do_Freeze_Profile + and then Ekind (E) = E_Anonymous_Access_Subprogram_Type + then + declare + Skip_Because_In_Generic : constant Boolean := + In_Generic_Scope (E) or else + (Is_Itype (E) + and then Nkind (Parent (Associated_Node_For_Itype (E))) + = N_Generic_Subprogram_Declaration); + begin + if not Skip_Because_In_Generic then + if not Freeze_Profile (Designated_Type (E)) then + goto Leave; + end if; + Freeze_Subprogram (Designated_Type (E)); + end if; + end; + end if; + -- Case of entity being frozen is other than a type if not Is_Type (E) then @@ -7149,31 +7166,30 @@ package body Freeze is Next_Index (Indx); end loop; - -- What we are looking for here is the situation where - -- the RM_Size given would be exactly right if there was - -- a pragma Pack, resulting in the component size being - -- the RM_Size of the component type. - - if RM_Size (E) = Num_Elmts * Rsiz then + -- In Implicit_Packing mode, if the specified RM_Size + -- would be big enough if there were a pragma Pack, + -- then set the component size as if there were Pack, + -- and Freeze_Array_Type will do the rest. - -- For implicit packing mode, just set the component - -- size and Freeze_Array_Type will do the rest. - - if Implicit_Packing then - Set_Component_Size (Btyp, Rsiz); + if Implicit_Packing + and then RM_Size (E) >= Num_Elmts * Rsiz + then + Set_Component_Size (Btyp, Rsiz); - -- 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. + -- Otherwise, if pragma Pack would result in exactly the + -- right size, give an error message suggesting packing, + -- except that if the specified Size is zero, there is no + -- need for pragma Pack. Note that size zero is not + -- considered Addressable. - elsif RM_Size (E) /= Uint_0 then - Error_Msg_NE - ("size given for& too small", SZ, E); - Error_Msg_N -- CODEFIX - ("\use explicit pragma Pack or use pragma " - & "Implicit_Packing", SZ); - end if; + elsif RM_Size (E) = Num_Elmts * Rsiz + and then RM_Size (E) /= Uint_0 + then + Error_Msg_NE + ("size given for& too small", SZ, E); + Error_Msg_N -- CODEFIX + ("\use explicit pragma Pack or use pragma " + & "Implicit_Packing", SZ); end if; end if; end; @@ -7749,7 +7765,14 @@ package body Freeze is -- Check restriction for standard storage pool - if No (Associated_Storage_Pool (E)) then + -- Skip this check when Etype (T) is unknown, since attribute + -- Associated_Storage_Pool is only available in the root type + -- of E, and in such case it cannot not be computed (thus + -- causing spurious errors). + + if Present (Etype (E)) + and then No (Associated_Storage_Pool (E)) + then Check_Restriction (No_Standard_Storage_Pools, E); end if; @@ -8786,7 +8809,7 @@ package body Freeze is and then Nkind (Parent (N)) = N_Function_Call and then not Has_Foreign_Convention (Nam) then - Create_Extra_Formals (Nam); + Create_Extra_Formals (Nam, Related_Nod => N); end if; when others => @@ -11024,7 +11047,10 @@ package body Freeze is E : Entity_Id; N : Node_Id) return Boolean is - Decl : constant Node_Id := Original_Node (Unit_Declaration_Node (E)); + Decl : constant Node_Id := + (if Ekind (E) = E_Subprogram_Type and then No (Parent (E)) + then Empty + else Original_Node (Unit_Declaration_Node (E))); function Is_Dispatching_Call_Or_Tagged_Result_Or_Aggregate (N : Node_Id) return Traverse_Result; diff --git a/gcc/ada/frontend.adb b/gcc/ada/frontend.adb index 92bc3c6029ce..bb700a9a422c 100644 --- a/gcc/ada/frontend.adb +++ b/gcc/ada/frontend.adb @@ -56,6 +56,7 @@ with Scn; use Scn; with Sem; use Sem; with Sem_Aux; with Sem_Ch8; +with Sem_Ch12; with Sem_SCIL; with Sem_Elab; use Sem_Elab; with Sem_Prag; use Sem_Prag; @@ -432,6 +433,18 @@ begin Analyze_Inlined_Bodies; end if; + -- Mark the structural instances spawned by the main unit as + -- Link Once because other units may spawn them too. + + Sem_Ch12.Mark_Link_Once + (Declarations (Aux_Decls_Node (Cunit (Main_Unit)))); + + if Nkind (Unit (Cunit (Main_Unit))) = N_Package_Body then + Sem_Ch12.Mark_Link_Once + (Declarations + (Aux_Decls_Node (Spec_Lib_Unit (Cunit (Main_Unit))))); + end if; + -- Remove entities from program that do not have any execution -- time references. diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in index bbbd697eb6f4..e768ef60ddf7 100644 --- a/gcc/ada/gcc-interface/Make-lang.in +++ b/gcc/ada/gcc-interface/Make-lang.in @@ -532,7 +532,6 @@ GNAT_ADA_OBJS+= \ ada/libgnat/s-carun8.o \ ada/libgnat/s-casuti.o \ ada/libgnat/s-cautns.o \ - ada/libgnat/s-crtl.o \ ada/libgnat/s-conca2.o \ ada/libgnat/s-conca3.o \ ada/libgnat/s-conca4.o \ @@ -542,6 +541,7 @@ GNAT_ADA_OBJS+= \ ada/libgnat/s-conca8.o \ ada/libgnat/s-conca9.o \ ada/libgnat/s-crc32.o \ + ada/libgnat/s-crtl.o \ ada/libgnat/s-excdeb.o \ ada/libgnat/s-except.o \ ada/libgnat/s-excmac.o \ @@ -690,7 +690,7 @@ GNATBIND_OBJS += \ ada/libgnat/g-cstyin.o \ ada/libgnat/g-hesora.o \ ada/libgnat/g-htable.o \ - ada/libgnat/i-c.o \ + ada/libgnat/i-c.o \ ada/libgnat/i-cstrin.o \ ada/libgnat/interfac.o \ ada/libgnat/s-addope.o \ @@ -707,6 +707,7 @@ GNATBIND_OBJS += \ ada/libgnat/s-conca8.o \ ada/libgnat/s-conca9.o \ ada/libgnat/s-crc32.o \ + ada/libgnat/s-crtl.o \ ada/libgnat/s-excdeb.o \ ada/libgnat/s-except.o \ ada/libgnat/s-excmac.o \ diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in index d456ac1966f2..964a4d1b4491 100644 --- a/gcc/ada/gcc-interface/Makefile.in +++ b/gcc/ada/gcc-interface/Makefile.in @@ -905,7 +905,6 @@ adadecode.o : adadecode.c adadecode.h aux-io.o : aux-io.c argv.o : argv.c cal.o : cal.c -deftarg.o : deftarg.c errno.o : errno.c exit.o : adaint.h exit.c expect.o : expect.c @@ -938,10 +937,6 @@ init.o : init.c adaint.h raise.h $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \ $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) -init-vxsim.o : init-vxsim.c - $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \ - $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) - initialize.o : initialize.c raise.h $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \ $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) diff --git a/gcc/ada/gcc-interface/ada-tree.h b/gcc/ada/gcc-interface/ada-tree.h index 205136bc8ef2..3e41667d19e4 100644 --- a/gcc/ada/gcc-interface/ada-tree.h +++ b/gcc/ada/gcc-interface/ada-tree.h @@ -73,6 +73,14 @@ do { \ #define TYPE_IS_FAT_POINTER_P(NODE) \ (TREE_CODE (NODE) == RECORD_TYPE && TYPE_FAT_POINTER_P (NODE)) +/* For RECORD_TYPE, UNION_TYPE, and QUAL_UNION_TYPE, nonzero if this is a + record being used as an extended access (only true for RECORD_TYPE). */ +#define TYPE_EXTENDED_POINTER_P(NODE) \ + TYPE_LANG_FLAG_7 (RECORD_OR_UNION_CHECK (NODE)) + +#define TYPE_IS_EXTENDED_POINTER_P(NODE) \ + (TREE_CODE (NODE) == RECORD_TYPE && TYPE_EXTENDED_POINTER_P (NODE)) + /* For integral types and array types, nonzero if this is an implementation type for a bit-packed array type. Such types should not be extended to a larger size or validated against a specified size. */ @@ -184,9 +192,6 @@ do { \ /* True for a dummy type if TYPE appears in a profile. */ #define TYPE_DUMMY_IN_PROFILE_P(NODE) TYPE_LANG_FLAG_6 (NODE) -/* True if objects of this type are guaranteed to be properly aligned. */ -#define TYPE_ALIGN_OK(NODE) TYPE_LANG_FLAG_7 (NODE) - /* True for types that implement a packed array and for original packed array types. */ #define TYPE_IMPL_PACKED_ARRAY_P(NODE) \ @@ -387,6 +392,25 @@ do { \ #define SET_TYPE_SCALE_FACTOR(NODE, X) \ SET_TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE), X) +/* For an UNCONSTRAINED_ARRAY_TYPE, this is the twin UNCONSTRAINED_ARRAY_TYPE + built for extended access types. */ +#define TYPE_EXTENDED_UNCONSTRAINED_ARRAY(NODE) \ + GET_TYPE_LANG_SPECIFIC (TREE_CHECK2 ((NODE), UNCONSTRAINED_ARRAY_TYPE, \ + ENUMERAL_TYPE)) +#define SET_TYPE_EXTENDED_UNCONSTRAINED_ARRAY(NODE, X) \ + SET_TYPE_LANG_SPECIFIC (TREE_CHECK2 ((NODE), UNCONSTRAINED_ARRAY_TYPE, \ + ENUMERAL_TYPE), X) + +/* When the compiler only has a dummy type for an unconstrained array type, we + don't build a duplicate dummy only to store the record type for the extended + access. Instead, we store it in the original dummy type, using the same + lang_type field that will hold the tree for the duplicated array type built + later. */ +#define TYPE_DUMMY_EXT_POINTER_TO(NODE) \ + GET_TYPE_LANG_SPECIFIC (TREE_CHECK ((NODE), ENUMERAL_TYPE)) +#define SET_TYPE_DUMMY_EXT_POINTER_TO(NODE, X) \ + SET_TYPE_LANG_SPECIFIC (TREE_CHECK ((NODE), ENUMERAL_TYPE), X) + /* For types with TYPE_CAN_HAVE_DEBUG_TYPE_P, this is the type to use in debugging information. */ #define TYPE_DEBUG_TYPE(NODE) \ diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc index 86cbf5ba4fb5..7ebd43211953 100644 --- a/gcc/ada/gcc-interface/decl.cc +++ b/gcc/ada/gcc-interface/decl.cc @@ -201,6 +201,7 @@ static tree gnat_to_gnu_component_type (Entity_Id, bool, bool); static tree gnat_to_gnu_subprog_type (Entity_Id, bool, bool, tree *); static int adjust_packed (tree, tree, int); static tree gnat_to_gnu_field (Entity_Id, tree, int, bool, bool); +static tree get_extended_unconstrained_array (Entity_Id, tree); static enum inline_status_t inline_status_for_subprog (Entity_Id); static Entity_Id Gigi_Cloned_Subtype (Entity_Id); static tree gnu_ext_name_for_subprog (Entity_Id, tree); @@ -279,6 +280,13 @@ is_artificial (Entity_Id gnat_entity) initial value (in GCC tree form). This is optional for a variable. For a renamed entity, GNU_EXPR gives the object being renamed. + If GNAT_ENTITY is an array type and GNU_EXPR is NULL_TREE, a GCC tree for a + regular fat pointer will be generated. However, if GNU_EXPR is not + NULL_TREE, it's an existing GCC tree for the fat pointer, and a GCC tree for + the extended pointer will be created instead. The caller must clear the + association between GNAT_ENTITY and GNU_EXPR before calling + gnat_to_gnu_entity with a non-NULL GNU_EXPR and restore it after the call. + DEFINITION is true if this call is intended for a definition. This is used for separate compilation where it is necessary to know whether an external declaration or a definition must be created if the GCC equivalent was not @@ -441,7 +449,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) must be specified unless it was specified by the programmer. Exceptions are for access-to-protected-subprogram types and all access subtypes, as another GNAT type is used to lay out the GCC type for them, as well as - access-to-subprogram types if front-end unnesting is enabled. */ + access-to-subprogram types if front-end unnesting is enabled, and also + extended access types. */ gcc_assert (!is_type || Known_Esize (gnat_entity) || Has_Size_Clause (gnat_entity) @@ -454,6 +463,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) || kind == E_Anonymous_Access_Subprogram_Type) && Unnest_Subprogram_Mode) || kind == E_Access_Subtype + || Is_Extended_Access_Type (gnat_entity) || type_annotate_only))); /* The RM size must be specified for all discrete and fixed-point types. */ @@ -638,7 +648,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) /* Build a CONST_DECL for debugging purposes exclusively. */ gnu_decl = create_var_decl (gnu_entity_name, gnu_ext_name, gnu_type, - gnu_expr, true, Is_Public (gnat_entity), + gnu_expr, true, + Is_Public (gnat_entity), + Is_Link_Once (gnat_entity), false, false, false, artificial_p, debug_info_p, NULL, gnat_entity); } @@ -1186,6 +1198,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) create_var_decl (gnu_entity_name, NULL_TREE, TREE_TYPE (gnu_expr), gnu_expr, const_flag, Is_Public (gnat_entity), + Is_Link_Once (gnat_entity), imported_p, static_flag, volatile_flag, artificial_p, debug_info_p, attr_list, gnat_entity, false); @@ -1254,7 +1267,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) initialize it to NULL, unless the object is declared imported as per RM B.1(24). */ if (definition - && (POINTER_TYPE_P (gnu_type) || TYPE_IS_FAT_POINTER_P (gnu_type)) + && (POINTER_TYPE_P (gnu_type) + || TYPE_IS_FAT_POINTER_P (gnu_type) + || TYPE_IS_EXTENDED_POINTER_P (gnu_type)) && !gnu_expr && !Is_Imported (gnat_entity)) gnu_expr = null_pointer_node; @@ -1388,16 +1403,15 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) } } - /* If we are at top level and this object is of variable size, - make the actual type a hidden pointer to the real type and - make the initializer be a memory allocation and initialization. - Likewise for objects we aren't defining (presumed to be - external references from other packages), but there we do - not set up an initialization. - - If the object's size overflows, make an allocator too, so that - Storage_Error gets raised. Note that we will never free - such memory, so we presume it never will get allocated. */ + /* If we are at top level and this object is of variable size, make + the actual type a reference to the real type and the initializer + be a memory allocation and initialization. Likewise for an object + that we aren't defining or is imported (presumed to be an external + reference from another package), but in this case we do not set up + an initialization. Likewise if the object's size is constant but + too large. In either case, this will also cause Storage_Error to + be raised if the size ends up overflowing. Note that we will never + free such memory, but it will be allocated only at top level. */ if (!allocatable_size_p (TYPE_SIZE_UNIT (gnu_type), global_bindings_p () || !definition @@ -1411,6 +1425,29 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) || !definition || static_flag))) { + /* Give a warning if the size is constant. */ + if ((TREE_CODE (TYPE_SIZE_UNIT (gnu_type)) == INTEGER_CST + || (gnu_size && TREE_CODE (gnu_size) == INTEGER_CST)) + && definition) + { + if (imported_p) + { + post_error + ("??too large object cannot be imported directly", + gnat_entity); + post_error ("\\??indirect import will be used instead", + gnat_entity); + } + else if (global_bindings_p () || static_flag) + { + post_error + ("??too large object cannot be allocated statically", + gnat_entity); + post_error ("\\??dynamic allocation will be used instead", + gnat_entity); + } + } + if (volatile_flag && !TYPE_VOLATILE (gnu_type)) gnu_type = change_qualified_type (gnu_type, TYPE_QUAL_VOLATILE); gnu_type = build_reference_type (gnu_type); @@ -1453,21 +1490,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) } /* Give a warning if the size is constant but too large. */ - if (TREE_CODE (TYPE_SIZE_UNIT (gnu_alloc_type)) == INTEGER_CST) - { - if (valid_constant_size_p (TYPE_SIZE_UNIT (gnu_alloc_type))) - { - post_error - ("??too large object cannot be allocated statically", - gnat_entity); - post_error ("\\??dynamic allocation will be used instead", - gnat_entity); - } - - else - post_error ("??Storage_Error will be raised at run time!", - gnat_entity); - } + if (TREE_CODE (TYPE_SIZE_UNIT (gnu_alloc_type)) == INTEGER_CST + && !valid_constant_size_p (TYPE_SIZE_UNIT (gnu_alloc_type))) + post_error ("??Storage_Error will be raised at run time!", + gnat_entity); gnu_expr = build_allocator (gnu_alloc_type, gnu_expr, gnu_type, @@ -1495,7 +1521,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) tree gnu_new_var = create_var_decl (create_concat_name (gnat_entity, "ALIGN"), NULL_TREE, gnu_new_type, NULL_TREE, - false, false, false, false, false, + false, false, false, false, false, false, true, debug_info_p && definition, NULL, gnat_entity); @@ -1557,8 +1583,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) = create_var_decl (concat_name (gnu_entity_name, "UNC"), NULL_TREE, gnu_type, gnu_expr, const_flag, Is_Public (gnat_entity), - imported_p || !definition, static_flag, - volatile_flag, true, + Is_Link_Once (gnat_entity), + imported_p || !definition, + static_flag, volatile_flag, true, debug_info_p && definition, NULL, gnat_entity); gnu_expr = build_unary_op (ADDR_EXPR, NULL_TREE, gnu_unc_var); @@ -1604,8 +1631,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) gnu_decl = create_var_decl (gnu_entity_name, gnu_ext_name, gnu_type, gnu_expr, const_flag, Is_Public (gnat_entity), - imported_p || !definition, static_flag, - volatile_flag, artificial_p, + Is_Link_Once (gnat_entity), + imported_p || !definition, + static_flag, volatile_flag, artificial_p, debug_info_p && definition, attr_list, gnat_entity); DECL_BY_REF_P (gnu_decl) = used_by_ref; @@ -1652,6 +1680,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) tree gnu_corr_var = create_var_decl (gnu_entity_name, gnu_ext_name, gnu_type, gnu_expr, true, Is_Public (gnat_entity), + Is_Link_Once (gnat_entity), !definition, static_flag, volatile_flag, artificial_p, debug_info_p && definition, attr_list, gnat_entity, false); @@ -1757,7 +1786,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) tree gnu_literal = create_var_decl (get_entity_name (gnat_literal), NULL_TREE, gnu_type, gnu_value, true, false, false, - false, false, artificial_p, false, + false, false, false, artificial_p, false, NULL, gnat_literal); save_gnu_tree (gnat_literal, gnu_literal, false); gnu_list @@ -2154,21 +2183,28 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) have are pointers to that type. In addition to the type node itself, 4 other types associated with it are built in the process: - 1. the array type (suffix XUA) containing the actual data, + 1. the array type (suffix XUA for fat pointer, XUAEA for extended + access) containing the actual data, - 2. the template type (suffix XUB) containing the bounds, + 2. the template type (suffix XUB for fat pointer, XUBEA for extended + access) containing the bounds, 3. the fat pointer type (suffix XUP) representing a pointer or a reference to the unconstrained array type: XUP = struct { XUA *, XUB * } - 4. the object record type (suffix XUT) containing bounds and data: - XUT = struct { XUB, XUA } + or the extended access type (suffix XUPEA) representing a pointer + or a reference to the unconstrained array type: + XUPEA = struct { XUAEA *, XUBEA } + + 4. the object record type (suffix XUT for fat pointer, XUTEA for + extended access) containing bounds and data: + XUT[EA] = struct { XUB[EA], XUA[EA] } The bounds of the array type XUA (de)reference the XUB * field of a PLACEHOLDER_EXPR for the fat pointer type XUP, so the array type XUA is to be interpreted in the context of the fat pointer type XUB for - debug info purposes. */ + debug info purposes. Likewise for the extended access case. */ case E_Array_Type: { @@ -2176,14 +2212,13 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) const Entity_Id PAT = Packed_Array_Impl_Type (gnat_entity); const bool convention_fortran_p = (Convention (gnat_entity) == Convention_Fortran); + const bool extended_access_p = gnu_expr != NULL_TREE; const int ndim = Number_Dimensions (gnat_entity); tree gnu_fat_type, gnu_template_type, gnu_ptr_template; - tree gnu_template_reference, gnu_template_fields; + tree gnu_template_reference; tree *gnu_index_types = XALLOCAVEC (tree, ndim); - tree *gnu_temp_fields = XALLOCAVEC (tree, ndim); tree gnu_max_size = size_one_node; tree comp_type, fld, tem, obj; - Entity_Id gnat_index; alias_set_type ptr_set = -1; int index; @@ -2203,7 +2238,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) better debugging information in DWARF by leveraging the support for incomplete declarations of "tagged" types in the DWARF back-end. */ gnu_type = get_dummy_type (gnat_entity); - if (gnu_type && TYPE_POINTER_TO (gnu_type)) + if (gnu_type && TYPE_POINTER_TO (gnu_type) && !extended_access_p) { gnu_fat_type = TYPE_MAIN_VARIANT (TYPE_POINTER_TO (gnu_type)); TYPE_NAME (gnu_fat_type) = NULL_TREE; @@ -2218,10 +2253,42 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) DECL_CHAIN (TYPE_FIELDS (TYPE_POINTER_TO (gnu_type))) = copy_node (DECL_CHAIN (TYPE_FIELDS (gnu_fat_type))); } + + /* We complete an existing dummy for extended access, but we haven't + created a specific tree yet for the array type. The extended access + type is stored directly in the original unconstrained array type, + where we will store the new array type later. */ + else if (gnu_type + && TYPE_DUMMY_EXT_POINTER_TO (gnu_type) + && extended_access_p) + { + gnu_ptr_template = NULL_TREE; + tree gnu_ext_acc_type = TYPE_DUMMY_EXT_POINTER_TO (gnu_type); + gnu_fat_type = TYPE_MAIN_VARIANT (gnu_ext_acc_type); + TYPE_NAME (gnu_fat_type) = NULL_TREE; + + /* The dummy types has a XUBEA that was only used to get the size of + the extended pointer. We now drop this type and use the XUB type + from the regular fat pointer instead. */ + gnu_template_type + = TREE_TYPE (TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (TREE_TYPE (gnu_expr))))); + + DECL_CHAIN (TYPE_FIELDS (gnu_fat_type)) + = create_field_decl (get_identifier ("BOUNDS"), + gnu_template_type, gnu_fat_type, + NULL_TREE, NULL_TREE, 0, 1); + } + else { gnu_fat_type = make_node (RECORD_TYPE); - gnu_template_type = make_node (RECORD_TYPE); + + if (extended_access_p) + gnu_template_type + = TREE_TYPE (TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (TREE_TYPE (gnu_expr))))); + else + gnu_template_type = make_node (RECORD_TYPE); + gnu_ptr_template = build_pointer_type (gnu_template_type); } @@ -2253,7 +2320,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) Var are also built later with the fields of the final type, the aliasing machinery may consider that the accesses are distinct if the FIELD_DECLs are distinct as objects. */ - if (COMPLETE_TYPE_P (gnu_fat_type)) + if (COMPLETE_TYPE_P (gnu_fat_type) && !extended_access_p) { fld = TYPE_FIELDS (gnu_fat_type); if (TYPE_ALIAS_SET_KNOWN_P (TYPE_CANONICAL (TREE_TYPE (fld)))) @@ -2264,6 +2331,39 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) for (tree t = gnu_fat_type; t; t = TYPE_NEXT_VARIANT (t)) SET_TYPE_UNCONSTRAINED_ARRAY (t, gnu_type); } + + else if (COMPLETE_TYPE_P (gnu_fat_type) && extended_access_p) + { + fld = TYPE_FIELDS (gnu_fat_type); + if (TYPE_ALIAS_SET_KNOWN_P (TYPE_CANONICAL (TREE_TYPE (fld)))) + ptr_set = TYPE_ALIAS_SET (TYPE_CANONICAL (TREE_TYPE (fld))); + TREE_TYPE (fld) = ptr_type_node; + /* For extended access, we leave the BOUNDS field alone. */ + TYPE_DECL_SUPPRESS_DEBUG (TYPE_STUB_DECL (gnu_fat_type)) = 0; + for (tree t = gnu_fat_type; t; t = TYPE_NEXT_VARIANT (t)) + SET_TYPE_UNCONSTRAINED_ARRAY (t, gnu_type); + } + + else if (extended_access_p) + { + /* We make the fields addressable for the sake of compatibility + with languages for which the regular fields are addressable. */ + fld + = create_field_decl (get_identifier ("P_ARRAY"), + ptr_type_node, gnu_fat_type, + NULL_TREE, NULL_TREE, 0, 1); + /* At this step, gnu_template_type is an empty RECORD to be + be populated later. */ + DECL_CHAIN (fld) + = create_field_decl (get_identifier ("BOUNDS"), + gnu_template_type, gnu_fat_type, + NULL_TREE, NULL_TREE, 0, 1); + /* Too early to finish the record, but set the fields so that + they are available through the type. */ + TYPE_FIELDS (gnu_fat_type) = fld; + SET_TYPE_UNCONSTRAINED_ARRAY (gnu_fat_type, gnu_type); + } + else { /* We make the fields addressable for the sake of compatibility @@ -2291,135 +2391,56 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) : gnat_entity; tree xup_name = gnat_encodings == DWARF_GNAT_ENCODINGS_ALL - ? create_concat_name (gnat_name, "XUP") + ? create_concat_name (gnat_name, + extended_access_p ? "XUPEA" : "XUP") : gnu_entity_name; create_type_decl (xup_name, gnu_fat_type, true, debug_info_p, gnat_entity, false); /* Build a reference to the template from a PLACEHOLDER_EXPR that - is the fat pointer. This will be used to access the individual - fields once we build them. */ - tem = build3 (COMPONENT_REF, gnu_ptr_template, - build0 (PLACEHOLDER_EXPR, gnu_fat_type), - DECL_CHAIN (fld), NULL_TREE); - gnu_template_reference - = build_unary_op (INDIRECT_REF, gnu_template_type, tem); - TREE_READONLY (gnu_template_reference) = 1; - TREE_THIS_NOTRAP (gnu_template_reference) = 1; - - /* Now create the GCC type for each index and add the fields for that - index to the template. */ - for (index = (convention_fortran_p ? ndim - 1 : 0), - gnat_index = First_Index (gnat_entity); - IN_RANGE (index, 0, ndim - 1); - index += (convention_fortran_p ? - 1 : 1), - gnat_index = Next_Index (gnat_index)) + is the extended/fat pointer. This will be used to access the + individual fields once we build them. */ + if (extended_access_p) { - const Entity_Id gnat_index_type = Etype (gnat_index); - const bool is_flb - = Is_Fixed_Lower_Bound_Index_Subtype (gnat_index_type); - tree gnu_index_type = get_unpadded_type (gnat_index_type); - tree gnu_orig_min = TYPE_MIN_VALUE (gnu_index_type); - tree gnu_orig_max = TYPE_MAX_VALUE (gnu_index_type); - tree gnu_index_base_type = get_base_type (gnu_index_type); - tree gnu_lb_field, gnu_hb_field; - tree gnu_min, gnu_max, gnu_high; - char field_name[16]; - - /* Update the maximum size of the array in elements. */ - if (gnu_max_size) - gnu_max_size - = update_n_elem (gnu_max_size, gnu_orig_min, gnu_orig_max); - - /* Now build the self-referential bounds of the index type. */ - gnu_index_type = maybe_character_type (gnu_index_type); - gnu_index_base_type = maybe_character_type (gnu_index_base_type); - - /* Make the FIELD_DECLs for the low and high bounds of this - type and then make extractions of these fields from the - template. */ - sprintf (field_name, "LB%d", index); - gnu_lb_field = create_field_decl (get_identifier (field_name), - gnu_index_type, - gnu_template_type, NULL_TREE, - NULL_TREE, 0, 0); - /* Mark the field specifically for INSTANTIATE_LOAD_IN_EXPR. */ - DECL_DISCRIMINANT_NUMBER (gnu_lb_field) = integer_minus_one_node; - Sloc_to_locus (Sloc (gnat_entity), - &DECL_SOURCE_LOCATION (gnu_lb_field)); - - field_name[0] = 'U'; - gnu_hb_field = create_field_decl (get_identifier (field_name), - gnu_index_type, - gnu_template_type, NULL_TREE, - NULL_TREE, 0, 0); - /* Mark the field specifically for INSTANTIATE_LOAD_IN_EXPR. */ - DECL_DISCRIMINANT_NUMBER (gnu_hb_field) = integer_minus_one_node; - Sloc_to_locus (Sloc (gnat_entity), - &DECL_SOURCE_LOCATION (gnu_hb_field)); - - gnu_temp_fields[index] = chainon (gnu_lb_field, gnu_hb_field); - - /* We can't use build_component_ref here since the template type - isn't complete yet. */ - if (!is_flb) - { - gnu_orig_min = build3 (COMPONENT_REF, TREE_TYPE (gnu_lb_field), - gnu_template_reference, gnu_lb_field, - NULL_TREE); - TREE_READONLY (gnu_orig_min) = 1; - } + /* Extended pointers reference the template directly through the + BOUNDS field, which is the second field. */ + gnu_template_reference + = build3 (COMPONENT_REF, gnu_template_type, + build0 (PLACEHOLDER_EXPR, gnu_fat_type), + DECL_CHAIN (fld), NULL_TREE); + TREE_READONLY (gnu_template_reference) = 1; + } + else + { + /* Fat pointers reference the template indirectly through the + P_BOUNDS field, which is the second field. */ + tem = build3 (COMPONENT_REF, gnu_ptr_template, + build0 (PLACEHOLDER_EXPR, gnu_fat_type), + DECL_CHAIN (fld), NULL_TREE); + gnu_template_reference + = build_unary_op (INDIRECT_REF, gnu_template_type, tem); + TREE_READONLY (gnu_template_reference) = 1; + TREE_THIS_NOTRAP (gnu_template_reference) = 1; + } - gnu_orig_max = build3 (COMPONENT_REF, TREE_TYPE (gnu_hb_field), - gnu_template_reference, gnu_hb_field, - NULL_TREE); - TREE_READONLY (gnu_orig_max) = 1; + if (!extended_access_p) + { + /* Build the template type. */ + TYPE_NAME (gnu_template_type) + = create_concat_name (gnat_entity, "XUB"); + } - gnu_min = convert (sizetype, gnu_orig_min); - gnu_max = convert (sizetype, gnu_orig_max); + build_template_type (gnat_entity, gnu_template_type, + gnu_template_reference, gnu_index_types, + gnu_max_size, debug_info_p); - /* Compute the size of this dimension. See the E_Array_Subtype - case below for the rationale. */ - if (is_flb - && Nkind (gnat_index) == N_Subtype_Indication - && flb_cannot_be_superflat (gnat_index)) - gnu_high = gnu_max; + if (!extended_access_p) + TYPE_CONTEXT (gnu_template_type) = gnu_fat_type; - else - gnu_high - = build3 (COND_EXPR, sizetype, - build2 (GE_EXPR, boolean_type_node, - gnu_orig_max, gnu_orig_min), - gnu_max, - TREE_CODE (gnu_min) == INTEGER_CST - ? int_const_binop (MINUS_EXPR, gnu_min, size_one_node) - : size_binop (MINUS_EXPR, gnu_min, size_one_node)); - - /* Make a range type with the new range in the Ada base type. - Then make an index type with the size range in sizetype. */ - gnu_index_types[index] - = create_index_type (gnu_min, gnu_high, - create_range_type (gnu_index_base_type, - gnu_orig_min, - gnu_orig_max), - gnat_entity); - - TYPE_NAME (gnu_index_types[index]) - = create_concat_name (gnat_entity, field_name); - } - - /* Install all the fields into the template. */ - TYPE_NAME (gnu_template_type) - = create_concat_name (gnat_entity, "XUB"); - TYPE_NAMELESS (gnu_template_type) - = gnat_encodings != DWARF_GNAT_ENCODINGS_ALL; - gnu_template_fields = NULL_TREE; - for (index = 0; index < ndim; index++) - gnu_template_fields - = chainon (gnu_template_fields, gnu_temp_fields[index]); - finish_record_type (gnu_template_type, gnu_template_fields, 0, - debug_info_p); - TYPE_CONTEXT (gnu_template_type) = gnu_fat_type; + /* Now that the template type has been created, the record type for + extended access can be finished. */ + if (extended_access_p) + finish_extended_pointer_type (gnu_fat_type, fld); /* If Component_Size is not already specified, annotate it with the size of the component. */ @@ -2499,9 +2520,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) TYPE_ARRAY_MAX_SIZE (tem) = gnu_max_size; /* See the above description for the rationale. */ + tree xua_name + = create_concat_name (gnat_entity, + extended_access_p ? "XUAEA" : "XUA"); tree gnu_tmp_decl - = create_type_decl (create_concat_name (gnat_entity, "XUA"), tem, - true, debug_info_p, gnat_entity); + = create_type_decl (xua_name, tem, true, debug_info_p, gnat_entity); TYPE_CONTEXT (tem) = gnu_fat_type; TYPE_CONTEXT (TYPE_POINTER_TO (tem)) = gnu_fat_type; @@ -2513,7 +2536,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) If the GNAT encodings are used, give it a name. */ tree xut_name = (gnat_encodings == DWARF_GNAT_ENCODINGS_ALL) - ? create_concat_name (gnat_name, "XUT") + ? create_concat_name (gnat_name, + extended_access_p ? "XUTEA" : "XUT") : gnu_entity_name; obj = build_unc_object_type (gnu_template_type, tem, xut_name, artificial_p, debug_info_p); @@ -2531,7 +2555,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) /* If this is a packed type implemented specially, then process the implementation type so it is elaborated in the proper scope. */ - if (Present (PAT)) + if (Present (PAT) && !extended_access_p) { /* Save the XUA type as our equivalent temporarily for the call to gnat_to_gnu_type on the OAT below. */ @@ -3731,7 +3755,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) = create_var_decl (create_concat_name (gnat_entity, "XVZ"), NULL_TREE, sizetype, gnu_size_unit, - true, false, false, false, false, + true, false, false, false, false, false, true, true, NULL, gnat_entity, false); } @@ -3940,7 +3964,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) } /* Access-to-unconstrained-array types need a special treatment. */ - if (Is_Array_Type (gnat_desig_rep) && !Is_Constrained (gnat_desig_rep)) + if (Is_Array_Type (gnat_desig_rep) + && !Is_Constrained (gnat_desig_rep) + && !Is_Extended_Access_Type (gnat_entity)) { /* If the processing above got something that has a pointer, then we are done. This could have happened either because the type @@ -3951,6 +3977,26 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) gnu_type = TYPE_POINTER_TO (gnu_desig_type); } + else if (Is_Array_Type (gnat_desig_rep) + && !Is_Constrained (gnat_desig_rep) + && Is_Extended_Access_Type (gnat_entity)) + { + if (TYPE_IS_DUMMY_P (gnu_desig_type)) + gnu_type + = build_dummy_unc_pointer_types_ext (gnat_desig_rep, + gnu_desig_type); + else + { + tree gnu_extended_type + = get_extended_unconstrained_array (gnat_desig_rep, + gnu_desig_type); + + /* We should not get a dummy type. */ + gnu_type = TYPE_POINTER_TO (gnu_extended_type); + gcc_assert (gnu_type); + } + } + /* If we haven't done it yet, build the pointer type the usual way. */ else if (!gnu_type) { @@ -4255,8 +4301,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) gnu_decl = create_var_decl (gnu_entity_name, gnu_ext_name, gnu_type, gnu_address, false, Is_Public (gnat_entity), - extern_flag, false, false, artificial_p, - debug_info_p, NULL, gnat_entity); + Is_Link_Once (gnat_entity), extern_flag, + false, false, artificial_p, debug_info_p, + NULL, gnat_entity); DECL_BY_REF_P (gnu_decl) = 1; } @@ -4285,6 +4332,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) = create_subprog_decl (gnu_entity_name, gnu_ext_name, gnu_type, gnu_param_list, inline_status, Is_Public (gnat_entity) || imported_p, + Is_Link_Once (gnat_entity), extern_flag, artificial_p, debug_info_p, definition && imported_p, attr_list, gnat_entity); @@ -4549,7 +4597,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) if (gnu_size) size = gnu_size; else if (RECORD_OR_UNION_TYPE_P (gnu_type) - && !TYPE_FAT_POINTER_P (gnu_type)) + && !TYPE_FAT_POINTER_P (gnu_type) + && !TYPE_EXTENDED_POINTER_P (gnu_type)) size = rm_size (gnu_type); else size = TYPE_SIZE (gnu_type); @@ -4821,14 +4870,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) { bool align_clause; - /* Record the property that objects of tagged types are guaranteed to - be properly aligned. This is necessary because conversions to the - class-wide type are translated into conversions to the root type, - which can be less aligned than some of its derived types. */ - if (Is_Tagged_Type (gnat_entity) - || Is_Class_Wide_Equivalent_Type (gnat_entity)) - TYPE_ALIGN_OK (gnu_type) = 1; - /* Record whether the type is passed by reference. */ if (is_by_ref && !VOID_TYPE_P (gnu_type)) TYPE_BY_REFERENCE_P (gnu_type) = 1; @@ -5134,6 +5175,22 @@ get_unpadded_type (Entity_Id gnat_entity) return type; } +/* Similar, but GNAT_ENTITY is assumed to refer to a GNAT type. Return + the extended version of the GCC type corresponding to that entity. */ + +tree +get_unpadded_extended_type (Entity_Id gnat_entity) +{ + tree type = gnat_to_gnu_type (gnat_entity); + + tree extended_type = get_extended_unconstrained_array (gnat_entity, type); + + if (TYPE_IS_PADDING_P (extended_type)) + extended_type = TREE_TYPE (TYPE_FIELDS (extended_type)); + + return extended_type; +} + /* Return whether the E_Subprogram_Type/E_Function/E_Procedure GNAT_ENTITY is a C++ imported method or equivalent. @@ -5241,6 +5298,47 @@ is_cplusplus_method (Entity_Id gnat_entity) return false; } +/* Get the UNCONSTRAINED_ARRAY_TYPE tree used for extended access handling, + for the unconstrained array type GNAT_ENTITY. + + GNU_TYPE is the UNCONSTRAINED_ARRAY_TYPE tree used for the regular + fat/thin pointers. */ + +static tree +get_extended_unconstrained_array (Entity_Id gnat_entity, tree gnu_type) +{ + gcc_assert (Is_Array_Type (gnat_entity) + && TREE_CODE (gnu_type) == UNCONSTRAINED_ARRAY_TYPE); + + + if (Ekind (gnat_entity) == E_Array_Subtype) + return get_extended_unconstrained_array (Etype (gnat_entity), gnu_type); + + tree gnu_extended_type = TYPE_EXTENDED_UNCONSTRAINED_ARRAY (gnu_type); + + /* Building the extended type is achieved by translating the array type + a second time using a special processing. */ + if (!gnu_extended_type) + { + /* To have gnat_to_gnu_entity trigger the special processing for extended + access types, we pass GNU_TYPE as second parameter, we backup the + existing association for GNAT_ENTITY and clear it before the call. */ + tree gnu_decl = get_gnu_tree (gnat_entity); + save_gnu_tree (gnat_entity, NULL_TREE, false); + + gnu_extended_type + = TREE_TYPE (gnat_to_gnu_entity (gnat_entity, gnu_type, false)); + gcc_assert (gnu_extended_type); + SET_TYPE_EXTENDED_UNCONSTRAINED_ARRAY (gnu_type, gnu_extended_type); + + /* And finally, we restore the original association for GNAT_ENTITY. */ + save_gnu_tree (gnat_entity, NULL_TREE, false); + save_gnu_tree (gnat_entity, gnu_decl, false); + } + + return gnu_extended_type; +} + /* Return the inlining status of the GNAT subprogram SUBPROG. */ static enum inline_status_t @@ -5463,6 +5561,7 @@ gnat_to_gnu_component_type (Entity_Id gnat_array, bool definition, && !Strict_Alignment (gnat_type) && RECORD_OR_UNION_TYPE_P (gnu_type) && !TYPE_FAT_POINTER_P (gnu_type) + && !TYPE_EXTENDED_POINTER_P (gnu_type) && tree_fits_uhwi_p (TYPE_SIZE (gnu_type))) { tree gnu_packable_type = make_packable_type (gnu_type, false, max_align); @@ -7154,6 +7253,155 @@ elaborate_entity (Entity_Id gnat_entity) } } +/* Build the template type GNU_TEMPLATE_TYPE for the array type GNAT_ENTITY. + GNU_TEMPLATE_REFERENCE is an expression to access the template value from + the pointer type. If GNU_INDEX_TYPES is not null, it's an array where the + index types whose bounds are the values of the template are to be stored. + If GNU_MAX_SIZE is not NULL_TREE, it's a tree where the maximum size of + the array type is computed. DEBUG_INFO_P is true if debug info needs to + be output for this type. */ + +void +build_template_type (Entity_Id gnat_entity, tree gnu_template_type, + tree gnu_template_reference, + tree *gnu_index_types, tree &gnu_max_size, + bool debug_info_p) +{ + const bool convention_fortran_p + = (Convention (gnat_entity) == Convention_Fortran); + const int ndim = Number_Dimensions (gnat_entity); + tree *gnu_temp_fields = XALLOCAVEC (tree, ndim); + Entity_Id gnat_index; + int index; + + tree template_fields = TYPE_FIELDS (gnu_template_type); + const bool template_exists_p = template_fields != NULL_TREE; + + /* Now create the GCC type for each index and add the fields for that + index to the template. */ + for (index = (convention_fortran_p ? ndim - 1 : 0), + gnat_index = First_Index (gnat_entity); + IN_RANGE (index, 0, ndim - 1); + index += (convention_fortran_p ? - 1 : 1), + gnat_index = Next_Index (gnat_index)) + { + const Entity_Id gnat_index_type = Etype (gnat_index); + const bool is_flb = Is_Fixed_Lower_Bound_Index_Subtype (gnat_index_type); + tree gnu_index_type = get_unpadded_type (gnat_index_type); + tree gnu_orig_min = TYPE_MIN_VALUE (gnu_index_type); + tree gnu_orig_max = TYPE_MAX_VALUE (gnu_index_type); + tree gnu_index_base_type = get_base_type (gnu_index_type); + tree gnu_lb_field, gnu_hb_field; + tree gnu_min, gnu_max, gnu_high; + char field_name[16]; + + /* Update the maximum size of the array in elements. */ + if (gnu_max_size) + gnu_max_size + = update_n_elem (gnu_max_size, gnu_orig_min, gnu_orig_max); + + /* Now build the self-referential bounds of the index type. */ + gnu_index_type = maybe_character_type (gnu_index_type); + gnu_index_base_type = maybe_character_type (gnu_index_base_type); + + if (template_fields != NULL_TREE) + { + gnu_lb_field = template_fields; + template_fields = DECL_CHAIN (template_fields); + gnu_hb_field = template_fields; + template_fields = DECL_CHAIN (template_fields); + } + else + { + /* Make the FIELD_DECLs for the low and high bounds of this + type and then make extractions of these fields from the + template. */ + sprintf (field_name, "LB%d", index); + gnu_lb_field = create_field_decl (get_identifier (field_name), + gnu_index_type, + gnu_template_type, NULL_TREE, + NULL_TREE, 0, 0); + /* Mark the field specifically for INSTANTIATE_LOAD_IN_EXPR. */ + DECL_DISCRIMINANT_NUMBER (gnu_lb_field) = integer_minus_one_node; + Sloc_to_locus (Sloc (gnat_entity), &DECL_SOURCE_LOCATION (gnu_lb_field)); + + field_name[0] = 'U'; + gnu_hb_field = create_field_decl (get_identifier (field_name), + gnu_index_type, + gnu_template_type, NULL_TREE, + NULL_TREE, 0, 0); + /* Mark the field specifically for INSTANTIATE_LOAD_IN_EXPR. */ + DECL_DISCRIMINANT_NUMBER (gnu_hb_field) = integer_minus_one_node; + Sloc_to_locus (Sloc (gnat_entity), &DECL_SOURCE_LOCATION (gnu_hb_field)); + + gnu_temp_fields[index] = chainon (gnu_lb_field, gnu_hb_field); + } + + if (gnu_index_types) + { + /* We can't use build_component_ref here since the template type + isn't complete yet. */ + if (!is_flb) + { + gnu_orig_min + = build3 (COMPONENT_REF, TREE_TYPE (gnu_lb_field), + gnu_template_reference, gnu_lb_field, + NULL_TREE); + TREE_READONLY (gnu_orig_min) = 1; + } + + gnu_orig_max = build3 (COMPONENT_REF, TREE_TYPE (gnu_hb_field), + gnu_template_reference, gnu_hb_field, + NULL_TREE); + TREE_READONLY (gnu_orig_max) = 1; + + gnu_min = convert (sizetype, gnu_orig_min); + gnu_max = convert (sizetype, gnu_orig_max); + + /* Compute the size of this dimension. See the E_Array_Subtype + case of gnat_to_gnu_entity for the rationale. */ + if (is_flb + && Nkind (gnat_index) == N_Subtype_Indication + && flb_cannot_be_superflat (gnat_index)) + gnu_high = gnu_max; + + else + gnu_high + = build3 (COND_EXPR, sizetype, + build2 (GE_EXPR, boolean_type_node, + gnu_orig_max, gnu_orig_min), + gnu_max, + TREE_CODE (gnu_min) == INTEGER_CST + ? int_const_binop (MINUS_EXPR, gnu_min, size_one_node) + : size_binop (MINUS_EXPR, gnu_min, size_one_node)); + + /* Make a range type with the new range in the Ada base type. + Then make an index type with the size range in sizetype. */ + gnu_index_types[index] + = create_index_type (gnu_min, gnu_high, + create_range_type (gnu_index_base_type, + gnu_orig_min, + gnu_orig_max), + gnat_entity); + + TYPE_NAME (gnu_index_types[index]) + = create_concat_name (gnat_entity, field_name); + } + } + + if (!template_exists_p) + { + TYPE_NAMELESS (gnu_template_type) + = gnat_encodings != DWARF_GNAT_ENCODINGS_ALL; + + tree gnu_template_fields = NULL_TREE; + for (index = 0; index < ndim; index++) + gnu_template_fields + = chainon (gnu_template_fields, gnu_temp_fields[index]); + finish_record_type (gnu_template_type, gnu_template_fields, 0, debug_info_p); + } +} + /* Prepend to ATTR_LIST an entry for an attribute with provided TYPE, NAME, ARGS and ERROR_POINT. */ @@ -7321,8 +7569,7 @@ static tree elaborate_expression_1 (tree gnu_expr, Entity_Id gnat_entity, const char *s, bool definition, bool need_for_debug) { - const bool expr_public_p = Is_Public (gnat_entity); - const bool expr_global_p = expr_public_p || global_bindings_p (); + const bool expr_global_p = Is_Public (gnat_entity) || global_bindings_p (); bool expr_variable_p, use_variable; /* If GNU_EXPR contains a placeholder, just return it. We rely on the fact @@ -7372,7 +7619,7 @@ elaborate_expression_1 (tree gnu_expr, Entity_Id gnat_entity, const char *s, if (need_for_debug && gnat_encodings != DWARF_GNAT_ENCODINGS_ALL && (TREE_CONSTANT (gnu_expr) - || (!expr_public_p + || (!Is_Public (gnat_entity) && DECL_P (gnu_expr) && !DECL_IGNORED_P (gnu_expr)))) need_for_debug = false; @@ -7391,7 +7638,8 @@ elaborate_expression_1 (tree gnu_expr, Entity_Id gnat_entity, const char *s, tree gnu_decl = create_var_decl (create_concat_name (gnat_entity, s), NULL_TREE, TREE_TYPE (gnu_expr), gnu_expr, true, - expr_public_p, !definition && expr_global_p, + Is_Public (gnat_entity), Is_Link_Once (gnat_entity), + !definition && expr_global_p, expr_global_p, false, true, Needs_Debug_Info (gnat_entity), NULL, gnat_entity, false); @@ -7775,6 +8023,7 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree gnu_record_type, int packed, if (!needs_strict_alignment && RECORD_OR_UNION_TYPE_P (gnu_field_type) && !TYPE_FAT_POINTER_P (gnu_field_type) + && !TYPE_EXTENDED_POINTER_P (gnu_field_type) && tree_fits_uhwi_p (TYPE_SIZE (gnu_field_type)) && (packed == 1 || is_bitfield @@ -7972,6 +8221,7 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree gnu_record_type, int packed, if (!needs_strict_alignment && RECORD_OR_UNION_TYPE_P (gnu_field_type) && !TYPE_FAT_POINTER_P (gnu_field_type) + && !TYPE_EXTENDED_POINTER_P (gnu_field_type) && TYPE_MODE (gnu_field_type) == BLKmode && is_bitfield) gnu_field_type = make_packable_type (gnu_field_type, true, 1); @@ -9698,7 +9948,9 @@ validate_size (Uint uint_size, tree gnu_type, Entity_Id gnat_object, /* If this is an access type or a fat pointer, the minimum size is that given by the default pointer mode. */ - if (TREE_CODE (gnu_type) == POINTER_TYPE || TYPE_IS_FAT_POINTER_P (gnu_type)) + if (TREE_CODE (gnu_type) == POINTER_TYPE + || TYPE_IS_FAT_POINTER_P (gnu_type) + || TYPE_IS_EXTENDED_POINTER_P (gnu_type)) old_size = bitsize_int (GET_MODE_BITSIZE (ptr_mode)); /* Issue an error either if the default size of the object isn't a constant @@ -9814,7 +10066,8 @@ set_rm_size (Uint uint_size, tree gnu_type, Entity_Id gnat_entity) /* ...or the Ada size for record and union types. */ else if (RECORD_OR_UNION_TYPE_P (gnu_type) - && !TYPE_FAT_POINTER_P (gnu_type)) + && !TYPE_FAT_POINTER_P (gnu_type) + && !TYPE_EXTENDED_POINTER_P (gnu_type)) SET_TYPE_ADA_SIZE (gnu_type, size); } @@ -10618,6 +10871,7 @@ copy_and_substitute_in_layout (Entity_Id gnat_new_type, gnu_size = DECL_SIZE (gnu_old_field); if (RECORD_OR_UNION_TYPE_P (gnu_field_type) && !TYPE_FAT_POINTER_P (gnu_field_type) + && !TYPE_EXTENDED_POINTER_P (gnu_field_type) && tree_fits_uhwi_p (TYPE_SIZE (gnu_field_type))) gnu_field_type = make_packable_type (gnu_field_type, true, 0); } @@ -10990,6 +11244,7 @@ rm_size (tree gnu_type) /* For record or union types, we store the size explicitly. */ if (RECORD_OR_UNION_TYPE_P (gnu_type) && !TYPE_FAT_POINTER_P (gnu_type) + && !TYPE_EXTENDED_POINTER_P (gnu_type) && TYPE_ADA_SIZE (gnu_type)) return TYPE_ADA_SIZE (gnu_type); diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h index 0345111fb85f..cb6a6a1a148b 100644 --- a/gcc/ada/gcc-interface/gigi.h +++ b/gcc/ada/gcc-interface/gigi.h @@ -49,6 +49,14 @@ extern tree gnat_to_gnu_field_decl (Entity_Id gnat_entity); the GCC type corresponding to that entity. */ extern tree gnat_to_gnu_type (Entity_Id gnat_entity); +/* Similar, but GNAT_ENTITY is assumed to refer to a GNAT type. Return + the unpadded version of the GCC type corresponding to that entity. */ +extern tree get_unpadded_type (Entity_Id gnat_entity); + +/* Similar, but GNAT_ENTITY is assumed to refer to a GNAT type. Return + the extended version of the GCC type corresponding to that entity. */ +extern tree get_unpadded_extended_type (Entity_Id gnat_entity); + /* Update the GCC tree previously built for the profiles involving GNU_TYPE, a dummy type which appears in profiles. */ extern void update_profiles_with (tree gnu_type); @@ -107,8 +115,17 @@ extern Entity_Id Gigi_Equivalent_Type (Entity_Id gnat_entity); be elaborated at the point of its definition, but do nothing else. */ extern void elaborate_entity (Entity_Id gnat_entity); -/* Get the unpadded version of a GNAT type. */ -extern tree get_unpadded_type (Entity_Id gnat_entity); +/* Build the template type GNU_TEMPLATE_TYPE for the array type GNAT_ENTITY. + GNU_TEMPLATE_REFERENCE is an expression to access the template value from + the pointer type. If GNU_INDEX_TYPES is not null, it's an array where the + index types whose bounds are the values of the template are to be stored. + If GNU_MAX_SIZE is not NULL_TREE, it's a tree where the maximum size of + the array type is computed. DEBUG_INFO_P is true if debug info needs to + be output for this type. */ +extern void build_template_type (Entity_Id gnat_entity, tree gnu_template_type, + tree gnu_template_reference, + tree *gnu_index_types, tree &gnu_max_size, + bool debug_info_p); /* Create a record type that contains a SIZE bytes long field of TYPE with a starting bit position so that it is aligned to ALIGN bits, and leaving at @@ -388,15 +405,20 @@ enum standard_datatypes /* Function declaration node for run-time reallocation function. */ ADT_realloc_decl, - /* Function decl node for 64-bit multiplication with overflow checking. */ + /* Function decl nodes for 64-bit multiplication with overflow checking. */ ADT_mulv64_decl, + ADT_uns_mulv64_decl, - /* Function decl node for 128-bit multiplication with overflow checking. */ + /* Function decl nodes for 128-bit multiplication with overflow checking. */ ADT_mulv128_decl, + ADT_uns_mulv128_decl, /* Identifier for the name of the _Parent field in tagged record types. */ ADT_parent_name_id, + /* Identifier for the name of the _Tag field in tagged record types. */ + ADT_tag_name_id, + /* Identifier for the name of the Not_Handled_By_Others field. */ ADT_not_handled_by_others_name_id, @@ -455,8 +477,11 @@ extern GTY(()) tree gnat_raise_decls_ext[(int) LAST_REASON_CODE + 1]; #define free_decl gnat_std_decls[(int) ADT_free_decl] #define realloc_decl gnat_std_decls[(int) ADT_realloc_decl] #define mulv64_decl gnat_std_decls[(int) ADT_mulv64_decl] +#define uns_mulv64_decl gnat_std_decls[(int) ADT_uns_mulv64_decl] #define mulv128_decl gnat_std_decls[(int) ADT_mulv128_decl] +#define uns_mulv128_decl gnat_std_decls[(int) ADT_uns_mulv128_decl] #define parent_name_id gnat_std_decls[(int) ADT_parent_name_id] +#define tag_name_id gnat_std_decls[(int) ADT_tag_name_id] #define not_handled_by_others_name_id \ gnat_std_decls[(int) ADT_not_handled_by_others_name_id] #define reraise_zcx_decl gnat_std_decls[(int) ADT_reraise_zcx_decl] @@ -570,6 +595,11 @@ extern tree get_dummy_type (Entity_Id gnat_type); extern void build_dummy_unc_pointer_types (Entity_Id gnat_desig_type, tree gnu_desig_type); +/* Build dummy extended access types whose designated type is specified by + GNAT_DESIG_TYPE/GNU_DESIG_TYPE and attach them to the latter. */ +extern tree build_dummy_unc_pointer_types_ext (Entity_Id gnat_desig_type, + tree gnu_desig_type); + /* Record TYPE as a builtin type for Ada. NAME is the name of the type. ARTIFICIAL_P is true if the type was generated by the compiler. */ extern void record_builtin_type (const char *name, tree type, @@ -582,6 +612,10 @@ extern void finish_character_type (tree char_type); finish constructing the record type as a fat pointer type. */ extern void finish_fat_pointer_type (tree record_type, tree field_list); +/* Given a record type RECORD_TYPE and a list of FIELD_DECL nodes FIELD_LIST, + finish constructing the record type as an extended access type. */ +extern void finish_extended_pointer_type (tree record_type, tree field_list); + /* Given a record type RECORD_TYPE and a list of FIELD_DECL nodes FIELD_LIST, finish constructing the record or union type. If REP_LEVEL is zero, this record has no representation clause and so will be entirely laid out here. @@ -645,6 +679,9 @@ extern tree create_type_decl (tree name, tree type, bool artificial_p, definition to be made visible outside of the current compilation unit, for instance variable definitions in a package specification. + LINKONCE_FLAG is true if the entity can be defined in multiple compilation + units without generating a linker error. + EXTERN_FLAG is true when processing an external variable declaration (as opposed to a definition: no storage is to be allocated for the variable). @@ -662,8 +699,8 @@ extern tree create_type_decl (tree name, tree type, bool artificial_p, GNAT_NODE is used for the position of the decl. */ extern tree create_var_decl (tree name, tree asm_name, tree type, tree init, bool const_flag, bool public_flag, - bool extern_flag, bool static_flag, - bool volatile_flag, + bool linkonce_flag, bool extern_flag, + bool static_flag, bool volatile_flag, bool artificial_p, bool debug_info_p, struct attrib *attr_list, Node_Id gnat_node, bool const_decl_allowed_p = true); @@ -696,6 +733,9 @@ extern tree create_label_decl (tree name, Node_Id gnat_node); PUBLIC_FLAG is true if this is for a reference to a public entity or for a definition to be made visible outside of the current compilation unit. + LINKONCE_FLAG is true if the entity can be defined in multiple compilation + units without generating a linker error. + EXTERN_FLAG is true when processing an external subprogram declaration. ARTIFICIAL_P is true if the subprogram was generated by the compiler. @@ -710,10 +750,11 @@ extern tree create_label_decl (tree name, Node_Id gnat_node); extern tree create_subprog_decl (tree name, tree asm_name, tree type, tree param_decl_list, enum inline_status_t inline_status, - bool public_flag, bool extern_flag, - bool artificial_p, bool debug_info_p, - bool definition, struct attrib *attr_list, - Node_Id gnat_node); + bool public_flag, bool linkonce_flag, + bool extern_flag, bool artificial_p, + bool debug_info_p, bool definition, + struct attrib *attr_list = NULL, + Node_Id gnat_node = Empty); /* Given a subprogram declaration DECL, its assembler name and its type, finish constructing the subprogram declaration from ASM_NAME and TYPE. */ @@ -753,11 +794,9 @@ extern tree build_unc_object_type (tree template_type, tree object_type, tree name, bool artificial_p, bool debug_info_p); -/* Same as build_unc_object_type, but taking a thin or fat pointer type - instead of the template type. */ -extern tree build_unc_object_type_from_ptr (tree thin_fat_ptr_type, - tree object_type, tree name, - bool debug_info_p); +/* Same, taking a pointer type instead of a template type. */ +extern tree build_unc_object_type_from_ptr (tree ptr_type, tree object_type, + tree name, bool debug_info_p); /* Update anything previously pointing to OLD_TYPE to point to NEW_TYPE. In the normal case this is just two adjustments, but we have more to do @@ -1120,6 +1159,28 @@ call_is_atomic_load (tree exp) return BUILT_IN_ATOMIC_LOAD_N <= code && code <= BUILT_IN_ATOMIC_LOAD_16; } +/* Return true if TYPE is a tagged type or a CW-equivalent type. */ + +static inline bool +type_is_tagged_or_cw_equivalent (tree type) +{ + if (!RECORD_OR_UNION_TYPE_P (type)) + return false; + + tree field = TYPE_FIELDS (type); + if (!field) + return false; + + /* The tag can be put into the REP part of a record type. */ + if (DECL_INTERNAL_P (field)) + return type_is_tagged_or_cw_equivalent (TREE_TYPE (field)); + + tree name = DECL_NAME (field); + + /* See Exp_Util.Make_CW_Equivalent_Type for the CW-equivalent case. */ + return name == tag_name_id || name == parent_name_id; +} + /* Return true if TYPE is padding a self-referential type. */ static inline bool diff --git a/gcc/ada/gcc-interface/misc.cc b/gcc/ada/gcc-interface/misc.cc index 7711f8b0f82a..e0890a2efc2e 100644 --- a/gcc/ada/gcc-interface/misc.cc +++ b/gcc/ada/gcc-interface/misc.cc @@ -531,7 +531,9 @@ gnat_print_type (FILE *file, tree node, int indent) break; case RECORD_TYPE: - if (TYPE_FAT_POINTER_P (node) || TYPE_CONTAINS_TEMPLATE_P (node)) + if (TYPE_EXTENDED_POINTER_P (node) + || TYPE_FAT_POINTER_P (node) + || TYPE_CONTAINS_TEMPLATE_P (node)) print_node (file, "unconstrained array", TYPE_UNCONSTRAINED_ARRAY (node), indent + 4); else @@ -837,6 +839,8 @@ gnat_get_array_descr_info (const_tree const_type, if (TYPE_IMPL_PACKED_ARRAY_P (array_type) && TYPE_ORIGINAL_PACKED_ARRAY (array_type)) array_type = TYPE_ORIGINAL_PACKED_ARRAY (array_type); + if (TREE_CODE (array_type) != ARRAY_TYPE) + return false; /* Shift back the address to get the address of the template. */ tree shift_amount diff --git a/gcc/ada/gcc-interface/trans.cc b/gcc/ada/gcc-interface/trans.cc index fd1d39cd0f55..cdbd4828c825 100644 --- a/gcc/ada/gcc-interface/trans.cc +++ b/gcc/ada/gcc-interface/trans.cc @@ -319,7 +319,7 @@ gigi (Node_Id gnat_root, { Node_Id gnat_iter; Entity_Id gnat_literal; - tree t, ftype, int64_type; + tree t, ftype; struct elab_info *info; int i; @@ -427,14 +427,14 @@ gigi (Node_Id gnat_root, gcc_assert (t == boolean_false_node); t = create_var_decl (get_entity_name (gnat_literal), NULL_TREE, boolean_type_node, t, true, false, false, false, false, - true, false, NULL, gnat_literal); + false, true, false, NULL, gnat_literal); save_gnu_tree (gnat_literal, t, false); gnat_literal = Next_Literal (gnat_literal); t = UI_To_gnu (Enumeration_Rep (gnat_literal), boolean_type_node); gcc_assert (t == boolean_true_node); t = create_var_decl (get_entity_name (gnat_literal), NULL_TREE, boolean_type_node, t, true, false, false, false, false, - true, false, NULL, gnat_literal); + false, true, false, NULL, gnat_literal); save_gnu_tree (gnat_literal, t, false); /* Declare the building blocks of function nodes. */ @@ -446,35 +446,44 @@ gigi (Node_Id gnat_root, = create_subprog_decl (get_identifier ("__gnat_malloc"), NULL_TREE, build_function_type_list (ptr_type_node, sizetype, NULL_TREE), - NULL_TREE, is_default, true, true, true, false, - false, NULL, Empty); + NULL_TREE, is_default, true, false, true, true, + false, false); DECL_IS_MALLOC (malloc_decl) = 1; free_decl = create_subprog_decl (get_identifier ("__gnat_free"), NULL_TREE, build_function_type_list (void_type_node, ptr_type_node, NULL_TREE), - NULL_TREE, is_default, true, true, true, false, - false, NULL, Empty); + NULL_TREE, is_default, true, false, true, true, + false, false); realloc_decl = create_subprog_decl (get_identifier ("__gnat_realloc"), NULL_TREE, build_function_type_list (ptr_type_node, ptr_type_node, sizetype, NULL_TREE), - NULL_TREE, is_default, true, true, true, false, - false, NULL, Empty); + NULL_TREE, is_default, true, false, true, true, + false, false); /* This is used for 64-bit multiplication with overflow checking. */ - int64_type = gnat_type_for_size (64, 0); + tree int64_type = gnat_type_for_size (64, 0); mulv64_decl = create_subprog_decl (get_identifier ("__gnat_mulv64"), NULL_TREE, build_function_type_list (int64_type, int64_type, int64_type, NULL_TREE), - NULL_TREE, is_default, true, true, true, false, - false, NULL, Empty); + NULL_TREE, is_default, true, false, true, true, + false, false); strub_make_callable (mulv64_decl); + tree uint64_type = gnat_type_for_size (64, 1); + uns_mulv64_decl + = create_subprog_decl (get_identifier ("__gnat_uns_mulv64"), NULL_TREE, + build_function_type_list (uint64_type, uint64_type, + uint64_type, NULL_TREE), + NULL_TREE, is_default, true, false, true, true, + false, false); + strub_make_callable (uns_mulv64_decl); + if (Enable_128bit_Types) { tree int128_type = gnat_type_for_size (128, 0); @@ -484,14 +493,28 @@ gigi (Node_Id gnat_root, int128_type, int128_type, NULL_TREE), - NULL_TREE, is_default, true, true, true, false, - false, NULL, Empty); + NULL_TREE, is_default, true, false, true, true, + false, false); strub_make_callable (mulv128_decl); + + tree uint128_type = gnat_type_for_size (128, 1); + uns_mulv128_decl + = create_subprog_decl (get_identifier ("__gnat_uns_mulv128"), NULL_TREE, + build_function_type_list (uint128_type, + uint128_type, + uint128_type, + NULL_TREE), + NULL_TREE, is_default, true, false, true, true, + false, false); + strub_make_callable (uns_mulv128_decl); } /* Name of the _Parent field in tagged record types. */ parent_name_id = get_identifier (Get_Name_String (Name_uParent)); + /* Name of the _Tag field in tagged record types. */ + tag_name_id = get_identifier (Get_Name_String (Name_uTag)); + /* Name of the Not_Handled_By_Others field in exception record types. */ not_handled_by_others_name_id = get_identifier ("not_handled_by_others"); @@ -503,7 +526,7 @@ gigi (Node_Id gnat_root, (get_identifier ("__gnat_set_exception_parameter"), NULL_TREE, build_function_type_list (void_type_node, ptr_type_node, ptr_type_node, NULL_TREE), - NULL_TREE, is_default, true, true, true, false, false, NULL, Empty); + NULL_TREE, is_default, true, false, true, true, false, false); /* Hooks to call when entering/leaving an exception handler. */ ftype = build_function_type_list (ptr_type_node, @@ -511,8 +534,7 @@ gigi (Node_Id gnat_root, begin_handler_decl = create_subprog_decl (get_identifier ("__gnat_begin_handler_v1"), NULL_TREE, ftype, NULL_TREE, - is_default, true, true, true, false, false, NULL, - Empty); + is_default, true, false, true, true, false, false); /* __gnat_begin_handler_v1 is not a dummy procedure, but we arrange for it not to throw. */ TREE_NOTHROW (begin_handler_decl) = 1; @@ -523,23 +545,20 @@ gigi (Node_Id gnat_root, end_handler_decl = create_subprog_decl (get_identifier ("__gnat_end_handler_v1"), NULL_TREE, ftype, NULL_TREE, - is_default, true, true, true, false, false, NULL, - Empty); + is_default, true, false, true, true, false, false); ftype = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE); unhandled_except_decl = create_subprog_decl (get_identifier ("__gnat_unhandled_except_handler"), NULL_TREE, ftype, NULL_TREE, - is_default, true, true, true, false, false, NULL, - Empty); + is_default, true, false, true, true, false, false); /* Indicate that it never returns. */ ftype = build_qualified_type (ftype, TYPE_QUAL_VOLATILE); reraise_zcx_decl = create_subprog_decl (get_identifier ("__gnat_reraise_zcx"), NULL_TREE, ftype, NULL_TREE, - is_default, true, true, true, false, false, NULL, - Empty); + is_default, true, false, true, true, false, false); set_call_expr_flags (reraise_zcx_decl, ECF_NORETURN | ECF_XTHROW); /* Dummy objects to materialize "others" and "all others" in the exception @@ -549,21 +568,21 @@ gigi (Node_Id gnat_root, = create_var_decl (get_identifier ("OTHERS"), get_identifier ("__gnat_others_value"), char_type_node, NULL_TREE, - true, false, true, false, false, true, false, + true, false, false, true, false, false, true, false, NULL, Empty); all_others_decl = create_var_decl (get_identifier ("ALL_OTHERS"), get_identifier ("__gnat_all_others_value"), char_type_node, NULL_TREE, - true, false, true, false, false, true, false, + true, false, false, true, false, false, true, false, NULL, Empty); unhandled_others_decl = create_var_decl (get_identifier ("UNHANDLED_OTHERS"), get_identifier ("__gnat_unhandled_others_value"), char_type_node, NULL_TREE, - true, false, true, false, false, true, false, + true, false, false, true, false, false, true, false, NULL, Empty); /* If in no exception handlers mode, all raise statements are redirected to @@ -578,8 +597,7 @@ gigi (Node_Id gnat_root, tree decl = create_subprog_decl (get_identifier ("__gnat_last_chance_handler"), NULL_TREE, ftype, - NULL_TREE, is_default, true, true, true, false, false, NULL, - Empty); + NULL_TREE, is_default, true, false, true, true, false, false); for (i = 0; i < (int) ARRAY_SIZE (gnat_raise_decls); i++) gnat_raise_decls[i] = decl; } @@ -741,8 +759,8 @@ build_raise_check (int check, enum exception_info_kind kind) ftype = build_qualified_type (ftype, TYPE_QUAL_VOLATILE); result = create_subprog_decl (get_identifier (Name_Buffer), NULL_TREE, ftype, - NULL_TREE, is_default, true, true, true, false, - false, NULL, Empty); + NULL_TREE, is_default, true, false, true, true, + false, false); strub_make_callable (result); set_call_expr_flags (result, ECF_NORETURN | ECF_XTHROW); @@ -1227,6 +1245,10 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p) no order-of-elaboration issue here. */ if (Is_Subprogram (gnat_entity)) gnu_result_type = NULL_TREE; + else if (Nkind (Original_Node (gnat_node)) == N_Explicit_Dereference + && Is_Extended_Access_Type + (Etype (Prefix (Original_Node (gnat_node))))) + gnu_result_type = get_unpadded_extended_type (gnat_result_type); else gnu_result_type = get_unpadded_type (gnat_result_type); @@ -1915,12 +1937,17 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_ptr = gnu_prefix; tree gnu_obj_type; - gnu_result_type = get_unpadded_type (Etype (gnat_node)); - - /* If this is fat pointer, the object must have been allocated with the - template in front of the array. So compute the template address; do - it by converting to a thin pointer. */ - if (TYPE_IS_FAT_POINTER_P (TREE_TYPE (gnu_ptr))) + if (Is_Extended_Access_Type (Etype (Prefix (gnat_node))) + && !Is_Constrained (Etype (gnat_node))) + gnu_result_type = get_unpadded_extended_type (Etype (gnat_node)); + else + gnu_result_type = get_unpadded_type (Etype (gnat_node)); + + /* If this is fat or extended pointer, the object must have been + allocated with the template in front of the array. So compute the + template address; do it by converting to a thin pointer. */ + if (TYPE_IS_FAT_POINTER_P (TREE_TYPE (gnu_ptr)) + || TYPE_IS_EXTENDED_POINTER_P (TREE_TYPE (gnu_ptr))) gnu_ptr = convert (build_pointer_type (TYPE_OBJECT_RECORD_TYPE @@ -2010,7 +2037,8 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_ptr_type = TREE_TYPE (gnat_to_gnu (Prefix (gnat_prefix))); - if (TYPE_IS_FAT_OR_THIN_POINTER_P (gnu_ptr_type)) + if (TYPE_IS_FAT_OR_THIN_POINTER_P (gnu_ptr_type) + || TYPE_IS_EXTENDED_POINTER_P (gnu_ptr_type)) gnu_type = build_unc_object_type_from_ptr (gnu_ptr_type, gnu_actual_obj_type, @@ -4026,7 +4054,7 @@ Subprogram_Body_to_gnu (Node_Id gnat_node) gnu_return_var = create_var_decl (get_identifier ("RETVAL"), NULL_TREE, gnu_return_type, NULL_TREE, - false, false, false, false, false, + false, false, false, false, false, false, true, false, NULL, gnat_subprog); TREE_VALUE (gnu_return_var_elmt) = gnu_return_var; } @@ -4562,7 +4590,7 @@ create_temporary (const char *prefix, tree type) tree gnu_temp = create_var_decl (create_tmp_var_name (prefix), NULL_TREE, type, NULL_TREE, - false, false, false, false, false, + false, false, false, false, false, false, true, false, NULL, Empty); return gnu_temp; } @@ -5845,7 +5873,7 @@ Exception_Handler_to_gnu (Node_Id gnat_node) tree exc_ptr = create_var_decl (get_identifier ("EXPTR"), NULL_TREE, ptr_type_node, gnu_current_exc_ptr, - true, false, false, false, false, true, true, + true, false, false, false, false, false, true, true, NULL, gnat_node); tree prev_gnu_incoming_exc_ptr = gnu_incoming_exc_ptr; @@ -5860,7 +5888,7 @@ Exception_Handler_to_gnu (Node_Id gnat_node) ptr_type_node, build_call_n_expr (begin_handler_decl, 1, exc_ptr), - true, false, false, false, false, + true, false, false, false, false, false, true, true, NULL, gnat_node); /* Declare and initialize the choice parameter, if present. */ @@ -5910,7 +5938,7 @@ Exception_Handler_to_gnu (Node_Id gnat_node) build_call_expr (builtin_decl_explicit (BUILT_IN_EH_POINTER), 1, integer_zero_node), - true, false, false, false, false, + true, false, false, false, false, false, true, true, NULL, gnat_node); /* CODE: __gnat_end_handler_v1 (EXPTR, EXCLN, EXPRP); */ @@ -5956,7 +5984,7 @@ Compilation_Unit_to_gnu (Node_Id gnat_node) = create_subprog_decl (create_concat_name (gnat_unit_entity, body_p ? "elabb" : "elabs"), NULL_TREE, void_ftype, NULL_TREE, - is_default, true, false, false, true, false, NULL, gnat_unit); + is_default, true, false, false, false, true, false, NULL, gnat_unit); struct elab_info *info; vec_safe_push (gnu_elab_proc_stack, gnu_elab_proc_decl); @@ -6870,9 +6898,22 @@ gnat_to_gnu (Node_Id gnat_node) && (Is_Array_Type (Etype (gnat_temp)) || Is_Record_Type (Etype (gnat_temp)) || Is_Concurrent_Type (Etype (gnat_temp))))) - gnat_to_gnu_entity (gnat_temp, - gnat_to_gnu (Renamed_Object (gnat_temp)), - true); + { + gnu_expr = gnat_to_gnu (Renamed_Object (gnat_temp)); + + /* The elaboration of object renamings present in the source code + never needs to be deferred. But regular objects may be turned + into renamings during expansion and their elaboration may need + to be deferred, in which case we expect the renamed references + to have been stabilized, so we do not do it again here. */ + if (Present (Freeze_Node (gnat_temp))) + { + gcc_assert (!Comes_From_Source (gnat_node)); + save_gnu_tree (gnat_node, gnu_expr, true); + } + else + gnat_to_gnu_entity (gnat_temp, gnu_expr, true); + } break; case N_Exception_Renaming_Declaration: @@ -6938,7 +6979,12 @@ gnat_to_gnu (Node_Id gnat_node) case N_Explicit_Dereference: /* Make sure the designated type is complete before dereferencing. */ - gnu_result_type = get_unpadded_type (Etype (gnat_node)); + if (Is_Extended_Access_Type (Etype (Prefix (gnat_node))) + && !Is_Constrained (Etype (gnat_node))) + gnu_result_type = get_unpadded_extended_type (Etype (gnat_node)); + else + gnu_result_type = get_unpadded_type (Etype (gnat_node)); + gnu_result = gnat_to_gnu (Prefix (gnat_node)); gnu_result = build_unary_op (INDIRECT_REF, NULL_TREE, gnu_result); @@ -7171,7 +7217,7 @@ gnat_to_gnu (Node_Id gnat_node) (Entity (Prefix (gnat_node)), attr == Attr_Elab_Body ? "elabb" : "elabs"), NULL_TREE, void_ftype, NULL_TREE, is_default, - true, true, true, true, false, NULL, + true, false, true, true, true, false, NULL, gnat_node); gnu_result = Attribute_to_gnu (gnat_node, &gnu_result_type, attr); @@ -7284,7 +7330,12 @@ gnat_to_gnu (Node_Id gnat_node) tree gnu_obj_type = TREE_TYPE (gnu_result_type); unsigned int oalign = TYPE_ALIGN (gnu_obj_type); - if (align != 0 && align < oalign && !TYPE_ALIGN_OK (gnu_obj_type)) + /* Skip tagged types because conversions to the class-wide type are + translated into conversions to the root type, which may be less + aligned than some of its derived types. */ + if (align != 0 + && align < oalign + && !type_is_tagged_or_cw_equivalent (gnu_obj_type)) post_error_ne_tree_2 ("??source alignment (^) '< alignment of & (^)", gnat_node, Designated_Type (Etype (gnat_node)), @@ -7504,12 +7555,11 @@ gnat_to_gnu (Node_Id gnat_node) gnu_max_shift = convert (gnu_type, gnu_max_shift); } - /* For signed integer addition, subtraction and multiplication, do an + /* For integer addition, subtraction and multiplication, perform an overflow check if required. */ - if (Do_Overflow_Check (gnat_node) - && (code == PLUS_EXPR || code == MINUS_EXPR || code == MULT_EXPR) - && !TYPE_UNSIGNED (gnu_type) - && !FLOAT_TYPE_P (gnu_type)) + if ((code == PLUS_EXPR || code == MINUS_EXPR || code == MULT_EXPR) + && !FLOAT_TYPE_P (gnu_type) + && Do_Overflow_Check (gnat_node)) gnu_result = build_binary_op_trapv (code, gnu_type, gnu_lhs, gnu_rhs, gnat_node); @@ -7590,11 +7640,11 @@ gnat_to_gnu (Node_Id gnat_node) gnu_expr = gnat_to_gnu (Right_Opnd (gnat_node)); gnu_result_type = get_unpadded_type (Etype (gnat_node)); - /* For signed integer negation and absolute value, do an overflow check + /* For integer negation and absolute value, perform an overflow check if required. */ - if (Do_Overflow_Check (gnat_node) - && !TYPE_UNSIGNED (gnu_result_type) - && !FLOAT_TYPE_P (gnu_result_type)) + if ((gnu_codes[kind] == NEGATE_EXPR || gnu_codes[kind] == ABS_EXPR) + && !FLOAT_TYPE_P (gnu_result_type) + && Do_Overflow_Check (gnat_node)) gnu_result = build_unary_op_trapv (gnu_codes[kind], gnu_result_type, gnu_expr, gnat_node); @@ -9791,10 +9841,15 @@ process_freeze_entity (Node_Id gnat_node) } else { + /* For an object whose elaboration is deferred, the GCC tree of the + declaration, if any, is the initialization expression. */ + const Node_Id gnat_decl = Declaration_Node (gnat_entity); tree gnu_init - = (Nkind (Declaration_Node (gnat_entity)) == N_Object_Declaration - && present_gnu_tree (Declaration_Node (gnat_entity))) - ? get_gnu_tree (Declaration_Node (gnat_entity)) : NULL_TREE; + = (Nkind (gnat_decl) == N_Object_Declaration + || Nkind (gnat_decl) == N_Object_Renaming_Declaration) + && Present (Freeze_Node (gnat_entity)) + && present_gnu_tree (gnat_decl) + ? get_gnu_tree (gnat_decl) : NULL_TREE; gnu_new = gnat_to_gnu_entity (gnat_entity, gnu_init, true); } @@ -9959,12 +10014,25 @@ build_unary_op_trapv (enum tree_code code, tree gnu_type, tree operand, { gcc_assert (code == NEGATE_EXPR || code == ABS_EXPR); + tree gnu_expr, check; + operand = gnat_protect_expr (operand); - return emit_check (build_binary_op (EQ_EXPR, boolean_type_node, - operand, TYPE_MIN_VALUE (gnu_type)), - build_unary_op (code, gnu_type, operand), - CE_Overflow_Check_Failed, gnat_node); + gnu_expr = build_unary_op (code, gnu_type, operand); + + if (TYPE_UNSIGNED (gnu_type)) + { + if (code == ABS_EXPR) + return gnu_expr; + else + check = build_binary_op (NE_EXPR, boolean_type_node, + operand, TYPE_MIN_VALUE (gnu_type)); + } + else + check = build_binary_op (EQ_EXPR, boolean_type_node, + operand, TYPE_MIN_VALUE (gnu_type)); + + return emit_check (check, gnu_expr, CE_Overflow_Check_Failed, gnat_node); } /* Make a binary operation of kind CODE using build_binary_op, but guard @@ -10017,21 +10085,29 @@ build_binary_op_trapv (enum tree_code code, tree gnu_type, tree left, /* Never inline a 64-bit mult for a 32-bit target, it's way too long. */ if (code == MULT_EXPR && precision == 64 && BITS_PER_WORD < 64) { - tree int64 = gnat_type_for_size (64, 0); + tree int64 = gnat_type_for_size (64, TYPE_UNSIGNED (gnu_type)); Check_Restriction_No_Dependence_On_System (Name_Arith_64, gnat_node); - return convert (gnu_type, build_call_n_expr (mulv64_decl, 2, - convert (int64, lhs), - convert (int64, rhs))); + return + convert (gnu_type, build_call_n_expr (TYPE_UNSIGNED (gnu_type) + ? uns_mulv64_decl + : mulv64_decl, + 2, + convert (int64, lhs), + convert (int64, rhs))); } /* Likewise for a 128-bit mult and a 64-bit target. */ else if (code == MULT_EXPR && precision == 128 && BITS_PER_WORD < 128) { - tree int128 = gnat_type_for_size (128, 0); + tree int128 = gnat_type_for_size (128, TYPE_UNSIGNED (gnu_type)); Check_Restriction_No_Dependence_On_System (Name_Arith_128, gnat_node); - return convert (gnu_type, build_call_n_expr (mulv128_decl, 2, - convert (int128, lhs), - convert (int128, rhs))); + return + convert (gnu_type, build_call_n_expr (TYPE_UNSIGNED (gnu_type) + ? uns_mulv128_decl + : mulv128_decl, + 2, + convert (int128, lhs), + convert (int128, rhs))); } enum internal_fn icode; @@ -10065,7 +10141,7 @@ build_binary_op_trapv (enum tree_code code, tree gnu_type, tree left, } /* If one operand is a constant, we expose the overflow condition to enable - a subsequent simplication or even elimination. */ + a subsequent simplification or even elimination. */ switch (code) { case PLUS_EXPR: @@ -10085,21 +10161,24 @@ build_binary_op_trapv (enum tree_code code, tree gnu_type, tree left, break; case MINUS_EXPR: - if (TREE_CODE (lhs) == INTEGER_CST) + if (TREE_CODE (lhs) == INTEGER_CST && TYPE_UNSIGNED (gnu_type)) + /* In the unsigned case, overflow when rhs > lhs - type_min. */ + check = build_binary_op (GT_EXPR, boolean_type_node, rhs, + build_binary_op (MINUS_EXPR, gnu_type, + lhs, type_min)); + else if (TREE_CODE (lhs) == INTEGER_CST) { sgn = tree_int_cst_sgn (lhs); - if (sgn > 0) - /* When lhs > 0, overflow when rhs < lhs - type_max. */ + if (sgn >= 0) + /* When lhs >= 0, overflow when rhs < lhs - type_max. */ check = build_binary_op (LT_EXPR, boolean_type_node, rhs, build_binary_op (MINUS_EXPR, gnu_type, lhs, type_max)); - else if (sgn < 0) + else /* When lhs < 0, overflow when rhs > lhs - type_min. */ check = build_binary_op (GT_EXPR, boolean_type_node, rhs, build_binary_op (MINUS_EXPR, gnu_type, lhs, type_min)); - else - return gnu_expr; } else { @@ -10569,8 +10648,8 @@ addressable_p (tree gnu_expr, tree gnu_type, bool compg) && (!STRICT_ALIGNMENT || TYPE_ALIGN (type) <= TYPE_ALIGN (inner_type) || TYPE_ALIGN (inner_type) >= BIGGEST_ALIGNMENT - || TYPE_ALIGN_OK (type) - || TYPE_ALIGN_OK (inner_type)))) + || type_is_tagged_or_cw_equivalent (type) + || type_is_tagged_or_cw_equivalent (inner_type)))) && addressable_p (TREE_OPERAND (gnu_expr, 0), NULL_TREE, compg)); } @@ -11253,7 +11332,7 @@ static bool use_alias_for_thunk_p (tree target) { /* We cannot generate a local call in this case. */ - if (DECL_EXTERNAL (target)) + if (DECL_EXTERNAL (target) || DECL_ONE_ONLY (target)) return false; /* The call is already local in this case. */ diff --git a/gcc/ada/gcc-interface/utils.cc b/gcc/ada/gcc-interface/utils.cc index f501915e82f5..83b9e82d2dc8 100644 --- a/gcc/ada/gcc-interface/utils.cc +++ b/gcc/ada/gcc-interface/utils.cc @@ -392,7 +392,6 @@ static tree fold_bit_position (const_tree); static tree compute_related_constant (tree, tree); static tree split_plus (tree, tree *); static tree float_type_for_precision (int, machine_mode); -static tree convert_to_fat_pointer (tree, tree); static unsigned int scale_by_factor_of (tree, unsigned int); /* Linked list used as a queue to defer the initialization of the DECL_CONTEXT @@ -616,6 +615,59 @@ build_dummy_unc_pointer_types (Entity_Id gnat_desig_type, tree gnu_desig_type) TYPE_OBJECT_RECORD_TYPE (gnu_desig_type) = gnu_object_type; } +/* Build dummy extended access types whose designated type is specified by + GNAT_DESIG_TYPE/GNU_DESIG_TYPE and attach them to the latter. */ + +tree +build_dummy_unc_pointer_types_ext (Entity_Id gnat_desig_type, tree gnu_desig_type) +{ + tree gnu_template_type, gnu_array_type, gnu_ptr_array; + tree gnu_ext_acc_type = make_node (RECORD_TYPE); + tree fields, dummy = NULL_TREE; + + gnu_template_type = make_node (RECORD_TYPE); + TYPE_NAME (gnu_template_type) = create_concat_name (gnat_desig_type, "XUBEA"); + TYPE_DUMMY_P (gnu_template_type) = 1; + + /* This will also set TYPE_POINTER_TO field for the template type, even if + we don't need it here. */ + build_pointer_type (gnu_template_type); + + /* The following call only builds the template record, but other dependent + types or other more complex expressions for bounds are NOT created. + This allows the size of an extended access to be computed, but it must be + completed later. */ + build_template_type (gnat_desig_type, gnu_template_type, NULL_TREE, NULL, + dummy, false); + + TYPE_CONTEXT (gnu_template_type) = gnu_ext_acc_type; + + gnu_array_type = make_node (ENUMERAL_TYPE); + TYPE_NAME (gnu_array_type) = create_concat_name (gnat_desig_type, "XUAEA"); + TYPE_DUMMY_P (gnu_array_type) = 1; + gnu_ptr_array = build_pointer_type (gnu_array_type); + + /* Build a stub DECL to trigger the special processing for fat pointer types + in gnat_pushdecl. */ + TYPE_NAME (gnu_ext_acc_type) + = create_type_stub_decl (create_concat_name (gnat_desig_type, "XUPEA"), + gnu_ext_acc_type); + fields = create_field_decl (get_identifier ("P_ARRAY"), gnu_ptr_array, + gnu_ext_acc_type, NULL_TREE, NULL_TREE, 0, 1); + DECL_CHAIN (fields) + = create_field_decl (get_identifier ("BOUNDS"), gnu_template_type, + gnu_ext_acc_type, NULL_TREE, NULL_TREE, 0, 1); + finish_extended_pointer_type (gnu_ext_acc_type, fields); + SET_TYPE_UNCONSTRAINED_ARRAY (gnu_ext_acc_type, gnu_desig_type); + + /* Suppress debug info until after the type is completed. */ + TYPE_DECL_SUPPRESS_DEBUG (TYPE_STUB_DECL (gnu_ext_acc_type)) = 1; + + SET_TYPE_DUMMY_EXT_POINTER_TO (gnu_desig_type, gnu_ext_acc_type); + + return gnu_ext_acc_type; +} + /* Return true if we are in the global binding level. */ bool @@ -937,11 +989,13 @@ gnat_pushdecl (tree decl, Node_Id gnat_node) } /* Pointer types aren't named types in the C sense so we need to generate a - typedef in DWARF for them. Also do that for fat pointer types because, - even though they are named types in the C sense, they are still the XUP - types created for the base array type at this point. */ -#define TYPE_IS_POINTER_P(NODE) \ - (TREE_CODE (NODE) == POINTER_TYPE || TYPE_IS_FAT_POINTER_P (NODE)) + typedef in DWARF for them. Also do that for fat and extended pointer types + because, even though they are named types in the C sense, they are still + the XUP[EA] types created for the base array type at this point. */ +#define TYPE_IS_POINTER_P(NODE) \ + (TREE_CODE (NODE) == POINTER_TYPE \ + || TYPE_IS_FAT_POINTER_P (NODE) \ + || TYPE_IS_EXTENDED_POINTER_P (NODE)) /* For the declaration of a type, set its name either if it isn't already set or if the previous type name was not derived from a source name. @@ -973,8 +1027,8 @@ gnat_pushdecl (tree decl, Node_Id gnat_node) DECL_ORIGINAL_TYPE (decl) = DECL_ORIGINAL_TYPE (TYPE_NAME (t)); else DECL_ORIGINAL_TYPE (decl) = t; - /* Remark the canonical fat pointer type as artificial. */ - if (TYPE_IS_FAT_POINTER_P (t)) + /* Remark the canonical fat or extended pointer type as artificial. */ + if (TYPE_IS_FAT_POINTER_P (t) || TYPE_IS_EXTENDED_POINTER_P (t)) TYPE_ARTIFICIAL (t) = 1; t = NULL_TREE; } @@ -1725,6 +1779,7 @@ maybe_pad_type (tree type, tree size, unsigned int align, if (align > 0 && RECORD_OR_UNION_TYPE_P (type) && !TYPE_IS_FAT_POINTER_P (type) + && !TYPE_IS_EXTENDED_POINTER_P (type) && TYPE_MODE (type) == BLKmode && !TYPE_BY_REFERENCE_P (type) && TREE_CODE (orig_size) == INTEGER_CST @@ -1795,7 +1850,7 @@ maybe_pad_type (tree type, tree size, unsigned int align, is a compilation artifact. */ size_unit = create_var_decl (concat_name (name, "XVZ"), NULL_TREE, sizetype, - size_unit, true, global_bindings_p (), + size_unit, true, global_bindings_p (), false, !definition && global_bindings_p (), false, false, true, true, NULL, gnat_entity, false); TYPE_SIZE_UNIT (record) = size_unit; @@ -2119,6 +2174,25 @@ finish_fat_pointer_type (tree record_type, tree field_list) TYPE_CONTAINS_PLACEHOLDER_INTERNAL (record_type) = 2; } +/* Given a record type RECORD_TYPE and a list of FIELD_DECL nodes FIELD_LIST, + finish constructing the record type as an extended access type. */ + +void +finish_extended_pointer_type (tree record_type, tree field_list) +{ + /* Show what it really is. */ + TYPE_EXTENDED_POINTER_P (record_type) = 1; + + /* Do not emit debug info for it since the types of its fields may still be + incomplete at this point. */ + finish_record_type (record_type, field_list, 0, false); + + /* Force type_contains_placeholder_p to return true on it. Although the + PLACEHOLDER_EXPRs are referenced only indirectly, this isn't a pointer + type but the representation of the unconstrained array. */ + TYPE_CONTAINS_PLACEHOLDER_INTERNAL (record_type) = 2; +} + /* Clear DECL_BIT_FIELD flag and associated markers on FIELD, which is a field of aggregate type TYPE. */ @@ -2219,6 +2293,7 @@ finish_record_type (tree record_type, tree field_list, int rep_level, if (RECORD_OR_UNION_TYPE_P (type) && !TYPE_FAT_POINTER_P (type) + && !TYPE_EXTENDED_POINTER_P (type) && !TYPE_CONTAINS_TEMPLATE_P (type) && TYPE_ADA_SIZE (type)) this_ada_size = TYPE_ADA_SIZE (type); @@ -2355,6 +2430,7 @@ finish_record_type (tree record_type, tree field_list, int rep_level, { /* Now set any of the values we've just computed that apply. */ if (!TYPE_FAT_POINTER_P (record_type) + && !TYPE_EXTENDED_POINTER_P (record_type) && !TYPE_CONTAINS_TEMPLATE_P (record_type)) SET_TYPE_ADA_SIZE (record_type, ada_size); } @@ -2919,6 +2995,9 @@ create_type_decl (tree name, tree type, bool artificial_p, bool debug_info_p, definition to be made visible outside of the current compilation unit, for instance variable definitions in a package specification. + LINKONCE_FLAG is true if the entity can be defined in multiple compilation + units without generating a linker error. + EXTERN_FLAG is true when processing an external variable declaration (as opposed to a definition: no storage is to be allocated for the variable). @@ -2937,10 +3016,11 @@ create_type_decl (tree name, tree type, bool artificial_p, bool debug_info_p, tree create_var_decl (tree name, tree asm_name, tree type, tree init, - bool const_flag, bool public_flag, bool extern_flag, - bool static_flag, bool volatile_flag, bool artificial_p, - bool debug_info_p, struct attrib *attr_list, - Node_Id gnat_node, bool const_decl_allowed_p) + bool const_flag, bool public_flag, bool linkonce_flag, + bool extern_flag, bool static_flag, bool volatile_flag, + bool artificial_p, bool debug_info_p, + struct attrib *attr_list, Node_Id gnat_node, + bool const_decl_allowed_p) { /* Whether the object has static storage duration, either explicitly or by virtue of being declared at the global level. */ @@ -2971,9 +3051,8 @@ create_var_decl (tree name, tree asm_name, tree type, tree init, and may be used for scalars in general but not for aggregates. */ tree var_decl = build_decl (input_location, - (constant_p - && const_decl_allowed_p - && !AGGREGATE_TYPE_P (type) ? CONST_DECL : VAR_DECL), + constant_p && const_decl_allowed_p && !AGGREGATE_TYPE_P (type) + ? CONST_DECL : VAR_DECL, name, type); /* Detect constants created by the front-end to hold 'reference to function @@ -3055,6 +3134,13 @@ create_var_decl (tree name, tree asm_name, tree type, tree init, != null_pointer_node)) DECL_IGNORED_P (var_decl) = 1; + /* Note that make_decl_one_only forces TREE_PUBLIC on the DECL. */ + if (linkonce_flag && VAR_P (var_decl)) + { + gcc_checking_assert (TREE_PUBLIC (var_decl)); + make_decl_one_only (var_decl, var_decl); + } + /* ??? Some attributes cannot be applied to CONST_DECLs. */ if (VAR_P (var_decl)) process_attributes (&var_decl, &attr_list, true, gnat_node); @@ -3140,6 +3226,9 @@ create_field_decl (tree name, tree type, tree record_type, tree size, tree pos, { tree field_decl = build_decl (input_location, FIELD_DECL, name, type); + /* The type must be frozen at this point. */ + gcc_assert (COMPLETE_TYPE_P (type)); + DECL_CONTEXT (field_decl) = record_type; TREE_READONLY (field_decl) = TYPE_READONLY (type); @@ -3591,6 +3680,9 @@ create_label_decl (tree name, Node_Id gnat_node) PUBLIC_FLAG is true if this is for a reference to a public entity or for a definition to be made visible outside of the current compilation unit. + LINKONCE_FLAG is true if the entity can be defined in multiple compilation + units without generating a linker error. + EXTERN_FLAG is true when processing an external subprogram declaration. ARTIFICIAL_P is true if the subprogram was generated by the compiler. @@ -3606,9 +3698,9 @@ create_label_decl (tree name, Node_Id gnat_node) tree create_subprog_decl (tree name, tree asm_name, tree type, tree param_decl_list, enum inline_status_t inline_status, bool public_flag, - bool extern_flag, bool artificial_p, bool debug_info_p, - bool definition, struct attrib *attr_list, - Node_Id gnat_node) + bool linkonce_flag, bool extern_flag, bool artificial_p, + bool debug_info_p, bool definition, + struct attrib *attr_list, Node_Id gnat_node) { tree subprog_decl = build_decl (input_location, FUNCTION_DECL, name, type); DECL_ARGUMENTS (subprog_decl) = param_decl_list; @@ -3661,6 +3753,13 @@ create_subprog_decl (tree name, tree asm_name, tree type, tree param_decl_list, gcc_unreachable (); } + /* Note that make_decl_one_only forces TREE_PUBLIC on the DECL. */ + if (linkonce_flag) + { + gcc_checking_assert (TREE_PUBLIC (subprog_decl)); + make_decl_one_only (subprog_decl, subprog_decl); + } + process_attributes (&subprog_decl, &attr_list, true, gnat_node); /* Once everything is processed, finish the subprogram declaration. */ @@ -4483,20 +4582,23 @@ build_unc_object_type (tree template_type, tree object_type, tree name, return type; } -/* Same, taking a thin or fat pointer type instead of a template type. */ +/* Same, taking a pointer type instead of a template type. */ tree -build_unc_object_type_from_ptr (tree thin_fat_ptr_type, tree object_type, - tree name, bool debug_info_p) +build_unc_object_type_from_ptr (tree ptr_type, tree object_type, tree name, + bool debug_info_p) { tree template_type; - gcc_assert (TYPE_IS_FAT_OR_THIN_POINTER_P (thin_fat_ptr_type)); - - template_type - = (TYPE_IS_FAT_POINTER_P (thin_fat_ptr_type) - ? TREE_TYPE (TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (thin_fat_ptr_type)))) - : TREE_TYPE (TYPE_FIELDS (TREE_TYPE (thin_fat_ptr_type)))); + if (TYPE_IS_EXTENDED_POINTER_P (ptr_type)) + template_type = TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (ptr_type))); + else if (TYPE_IS_FAT_POINTER_P (ptr_type)) + template_type + = TREE_TYPE (TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (ptr_type)))); + else if (TYPE_IS_THIN_POINTER_P (ptr_type)) + template_type = TREE_TYPE (TYPE_FIELDS (TREE_TYPE (ptr_type))); + else + gcc_unreachable (); return build_unc_object_type (template_type, object_type, name, true, @@ -4652,6 +4754,9 @@ convert_to_fat_pointer (tree type, tree expr) vec *v; vec_alloc (v, 2); + /* We don't allow conversion from extended to fat pointers. */ + gcc_assert (!TYPE_IS_EXTENDED_POINTER_P (etype)); + /* If EXPR is null, make a fat pointer that contains a null pointer to the array (compare_fat_pointers ensures that this is the full discriminant) and a valid pointer to the bounds. This latter property is necessary @@ -4743,6 +4848,101 @@ convert_to_fat_pointer (tree type, tree expr) return gnat_build_constructor (type, v); } +/* Convert EXPR, a pointer to a constrained array, into a pointer to an + unconstrained one using an extended access. This involves making or + finding a template. */ + +static tree +convert_to_extended_pointer (tree type, tree expr) +{ + tree template_type = TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (type))); + tree p_array_type = TREE_TYPE (TYPE_FIELDS (type)); + tree etype = TREE_TYPE (expr); + tree template_val; + vec *v; + vec_alloc (v, 2); + + /* If EXPR is null, make a fat pointer that contains a null pointer to the + array (compare_fat_pointers ensures that this is the full discriminant) + and a valid pointer to the bounds. This latter property is necessary + since the compiler can hoist the load of the bounds done through it. */ + if (integer_zerop (expr)) + { + tree template_type = TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (type))); + tree null_bounds, t; + + null_bounds = build_constructor (template_type, NULL); + TREE_CONSTANT (null_bounds) = TREE_STATIC (null_bounds) = 1; + + CONSTRUCTOR_APPEND_ELT (v, TYPE_FIELDS (type), + fold_convert (p_array_type, null_pointer_node)); + CONSTRUCTOR_APPEND_ELT (v, DECL_CHAIN (TYPE_FIELDS (type)) , null_bounds); + t = build_constructor (type, v); + /* Do not set TREE_CONSTANT so as to force T to static memory. */ + TREE_CONSTANT (t) = 0; + TREE_STATIC (t) = 1; + + return t; + } + + /* If EXPR is a thin pointer, make template and data from the record. */ + if (TYPE_IS_THIN_POINTER_P (etype)) + { + tree field = TYPE_FIELDS (TREE_TYPE (etype)); + + expr = gnat_protect_expr (expr); + + /* If we have a TYPE_UNCONSTRAINED_ARRAY attached to the RECORD_TYPE, + the thin pointer value has been shifted so we shift it back to get + the template address. */ + if (TYPE_UNCONSTRAINED_ARRAY (TREE_TYPE (etype))) + { + tree template_addr + = fold_convert (TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (type))), expr); + template_val = build_unary_op (INDIRECT_REF, NULL_TREE, template_addr); + } + + /* Otherwise we explicitly take the address of the fields. */ + else + { + expr = build_unary_op (INDIRECT_REF, NULL_TREE, expr); + + template_val = build_component_ref (expr, field, true); + + expr = build_unary_op (ADDR_EXPR, NULL_TREE, + build_component_ref (expr, DECL_CHAIN (field), + false)); + } + } + + else if (TYPE_IS_FAT_POINTER_P (etype)) + template_val + = build_unary_op (INDIRECT_REF, NULL_TREE, + build_component_ref (expr, + DECL_CHAIN (TYPE_FIELDS (etype)), + false)); + + /* Otherwise, build the constructor for the template. */ + else + template_val = build_template (template_type, TREE_TYPE (etype), expr); + + /* The final result is a constructor for the extended pointer. + + If EXPR is an argument of a foreign convention subprogram, the type it + points to is directly the component type. In this case, the expression + type may not match the corresponding FIELD_DECL type at this point, so we + call "convert" here to fix that up if necessary. This type consistency is + required, for instance because it ensures that possible later folding of + COMPONENT_REFs against this constructor always yields something of the + same type as the initial reference. + + Note that the call to "build_template" above is still fine because it + will only refer to the provided TEMPLATE_TYPE in this case. */ + CONSTRUCTOR_APPEND_ELT (v, TYPE_FIELDS (type), convert (p_array_type, expr)); + CONSTRUCTOR_APPEND_ELT (v, DECL_CHAIN (TYPE_FIELDS (type)), template_val); + return gnat_build_constructor (type, v); +} + /* Create an expression whose value is that of EXPR, converted to type TYPE. The TREE_TYPE of the value is always TYPE. This function implements all reasonable @@ -5122,6 +5322,8 @@ convert (tree type, tree expr) /* Check for converting to a pointer to an unconstrained array. */ if (TYPE_IS_FAT_POINTER_P (type) && !TYPE_IS_FAT_POINTER_P (etype)) return convert_to_fat_pointer (type, expr); + if (TYPE_IS_EXTENDED_POINTER_P (type) && !TYPE_IS_EXTENDED_POINTER_P (etype)) + return convert_to_extended_pointer (type, expr); /* If we are converting between two aggregate or vector types that are mere variants, just make a VIEW_CONVERT_EXPR. Likewise when we are converting @@ -5139,14 +5341,25 @@ convert (tree type, tree expr) But don't do it if we are just annotating types since tagged types aren't fully laid out in this mode. */ else if (ecode == RECORD_TYPE && code == RECORD_TYPE - && TYPE_ALIGN_OK (etype) && TYPE_ALIGN_OK (type) + && type_is_tagged_or_cw_equivalent (etype) + && type_is_tagged_or_cw_equivalent (type) && !type_annotate_only) { tree child_etype = etype; + /* Loop through the nested _Parent fields until we find one with either + directly the right type (simple record case), or only the right size + (discriminated record case), and extract it to be the new expression. + Note that build_component_ref will automatically build the chain of + COMPONENT_REFs in the case where it is not the immediate parent. */ do { tree field = TYPE_FIELDS (child_etype); - if (DECL_NAME (field) == parent_name_id && TREE_TYPE (field) == type) - return build_component_ref (expr, field, false); + if (DECL_NAME (field) == parent_name_id) + { + if (TREE_TYPE (field) == type) + return build_component_ref (expr, field, false); + if (operand_equal_p (DECL_SIZE (field), TYPE_SIZE (type), 0)) + return convert (type, build_component_ref (expr, field, false)); + } child_etype = TREE_TYPE (field); } while (TREE_CODE (child_etype) == RECORD_TYPE); } @@ -5263,7 +5476,7 @@ convert (tree type, tree expr) /* If converting fat pointer to normal or thin pointer, get the pointer to the array and then convert it. */ - if (TYPE_IS_FAT_POINTER_P (etype)) + if (TYPE_IS_FAT_POINTER_P (etype) || TYPE_IS_EXTENDED_POINTER_P (etype)) expr = build_component_ref (expr, TYPE_FIELDS (etype), false); return fold (convert_to_pointer (type, expr)); @@ -5327,20 +5540,30 @@ convert (tree type, tree expr) } /* If EXPR is a constrained array, take its address, convert it to a - fat pointer, and then dereference it. Likewise if EXPR is a - record containing both a template and a constrained array. - Note that a record representing a justified modular type - always represents a packed constrained array. */ + fat or extended pointer, and then dereference it. Likewise if + EXPR is a record containing both a template and a constrained + array. Note that a record representing a justified modular type + always represents a packed constrained array. */ if (ecode == ARRAY_TYPE || (ecode == INTEGER_TYPE && TYPE_HAS_ACTUAL_BOUNDS_P (etype)) || (ecode == RECORD_TYPE && TYPE_CONTAINS_TEMPLATE_P (etype)) || (ecode == RECORD_TYPE && TYPE_JUSTIFIED_MODULAR_P (etype))) - return - build_unary_op - (INDIRECT_REF, NULL_TREE, - convert_to_fat_pointer (TREE_TYPE (type), - build_unary_op (ADDR_EXPR, - NULL_TREE, expr))); + { + if (TYPE_IS_EXTENDED_POINTER_P (TREE_TYPE (type))) + return + build_unary_op + (INDIRECT_REF, NULL_TREE, + convert_to_extended_pointer (TREE_TYPE (type), + build_unary_op (ADDR_EXPR, + NULL_TREE, expr))); + else + return + build_unary_op + (INDIRECT_REF, NULL_TREE, + convert_to_fat_pointer (TREE_TYPE (type), + build_unary_op (ADDR_EXPR, + NULL_TREE, expr))); + } /* Do something very similar for converting one unconstrained array to another. */ diff --git a/gcc/ada/gcc-interface/utils2.cc b/gcc/ada/gcc-interface/utils2.cc index 58418ea7236b..8f2ad7b3b8ac 100644 --- a/gcc/ada/gcc-interface/utils2.cc +++ b/gcc/ada/gcc-interface/utils2.cc @@ -1041,9 +1041,7 @@ build_binary_op (enum tree_code op_code, tree result_type, } /* If a class-wide type may be involved, force use of the RHS type. */ - if ((TREE_CODE (right_type) == RECORD_TYPE - || TREE_CODE (right_type) == UNION_TYPE) - && TYPE_ALIGN_OK (right_type)) + if (type_is_tagged_or_cw_equivalent (right_type)) operation_type = right_type; /* If we are copying between padded objects with compatible types, use @@ -1118,7 +1116,7 @@ build_binary_op (enum tree_code op_code, tree result_type, == TREE_CODE (operand_type (result)) && TYPE_MODE (restype) == TYPE_MODE (operand_type (result)))) - || TYPE_ALIGN_OK (restype)))) + || type_is_tagged_or_cw_equivalent (restype)))) result = TREE_OPERAND (result, 0); else if (TREE_CODE (result) == VIEW_CONVERT_EXPR) @@ -1296,6 +1294,14 @@ build_binary_op (enum tree_code op_code, tree result_type, best_type = left_base_type; } + else if (TYPE_IS_EXTENDED_POINTER_P (left_base_type) + && TYPE_IS_EXTENDED_POINTER_P (right_base_type)) + { + gcc_assert (TYPE_MAIN_VARIANT (left_base_type) + == TYPE_MAIN_VARIANT (right_base_type)); + best_type = left_base_type; + } + else if (POINTER_TYPE_P (left_base_type) && POINTER_TYPE_P (right_base_type)) { @@ -1737,7 +1743,7 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand) /* If we want to refer to an unconstrained array, use the appropriate expression. But this will never survive down to the back-end. */ - if (TYPE_IS_FAT_POINTER_P (type)) + if (TYPE_IS_FAT_POINTER_P (type) || TYPE_IS_EXTENDED_POINTER_P (type)) { result = build1 (UNCONSTRAINED_ARRAY_REF, TYPE_UNCONSTRAINED_ARRAY (type), operand); @@ -1756,7 +1762,9 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand) TREE_READONLY (result) = TYPE_READONLY (TREE_TYPE (type)); } - if (!TYPE_IS_FAT_POINTER_P (type) && TYPE_VOLATILE (TREE_TYPE (type))) + if (!TYPE_IS_FAT_POINTER_P (type) + && !TYPE_IS_EXTENDED_POINTER_P (type) + && TYPE_VOLATILE (TREE_TYPE (type))) { TREE_SIDE_EFFECTS (result) = 1; if (INDIRECT_REF_P (result)) @@ -2609,7 +2617,8 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc, /* If RESULT_TYPE is a fat or thin pointer, set SIZE to be the sum of the sizes of the object and its template. Allocate the whole thing and fill in the parts that are known. */ - else if (TYPE_IS_FAT_OR_THIN_POINTER_P (result_type)) + else if (TYPE_IS_FAT_OR_THIN_POINTER_P (result_type) + || TYPE_IS_EXTENDED_POINTER_P (result_type)) { tree storage_type = build_unc_object_type_from_ptr (result_type, type, @@ -3055,7 +3064,8 @@ gnat_save_expr (tree exp) This may be more efficient, but will also allow us to more easily find the match for the PLACEHOLDER_EXPR. */ if (code == COMPONENT_REF - && TYPE_IS_FAT_POINTER_P (TREE_TYPE (TREE_OPERAND (exp, 0)))) + && (TYPE_IS_FAT_POINTER_P (TREE_TYPE (TREE_OPERAND (exp, 0))) + || TYPE_IS_EXTENDED_POINTER_P (TREE_TYPE (TREE_OPERAND (exp, 0))))) return build3 (code, type, gnat_save_expr (TREE_OPERAND (exp, 0)), TREE_OPERAND (exp, 1), NULL_TREE); @@ -3124,7 +3134,8 @@ gnat_protect_expr (tree exp) This may be more efficient, but will also allow us to more easily find the match for the PLACEHOLDER_EXPR. */ if (code == COMPONENT_REF - && TYPE_IS_FAT_POINTER_P (TREE_TYPE (TREE_OPERAND (exp, 0)))) + && (TYPE_IS_FAT_POINTER_P (TREE_TYPE (TREE_OPERAND (exp, 0))) + || TYPE_IS_EXTENDED_POINTER_P (TREE_TYPE (TREE_OPERAND (exp, 0))))) return build3 (code, type, gnat_protect_expr (TREE_OPERAND (exp, 0)), TREE_OPERAND (exp, 1), NULL_TREE); @@ -3132,6 +3143,7 @@ gnat_protect_expr (tree exp) for a CALL_EXPR as large objects are returned via invisible reference in most ABIs so the temporary will directly be filled by the callee. */ if (TYPE_IS_FAT_POINTER_P (type) + || TYPE_IS_EXTENDED_POINTER_P (type) || !AGGREGATE_TYPE_P (type) || code == CALL_EXPR) return save_expr (exp); @@ -3168,7 +3180,8 @@ gnat_stabilize_reference_1 (tree e, void *data) fat pointer. This may be more efficient, but will also allow us to more easily find the match for the PLACEHOLDER_EXPR. */ if (code == COMPONENT_REF - && TYPE_IS_FAT_POINTER_P (TREE_TYPE (TREE_OPERAND (e, 0)))) + && (TYPE_IS_FAT_POINTER_P (TREE_TYPE (TREE_OPERAND (e, 0))) + || TYPE_IS_EXTENDED_POINTER_P (TREE_TYPE (TREE_OPERAND (e, 0))))) result = build3 (code, type, gnat_stabilize_reference_1 (TREE_OPERAND (e, 0), data), diff --git a/gcc/ada/gen_il-fields.ads b/gcc/ada/gen_il-fields.ads index a1e284f14e46..6cd1355d1192 100644 --- a/gcc/ada/gen_il-fields.ads +++ b/gcc/ada/gen_il-fields.ads @@ -72,6 +72,7 @@ package Gen_IL.Fields is Ancestor_Part, Atomic_Sync_Required, Array_Aggregate, + Aspect_Ghost_Assertion_Level, Aspect_On_Partial_View, Aspect_Rep_Item, Aspect_Specifications, @@ -281,6 +282,7 @@ package Gen_IL.Fields is Is_SPARK_Mode_On_Node, Is_Static_Coextension, Is_Static_Expression, + Is_Structural, Is_Subprogram_Descriptor, Is_Task_Allocation_Block, Is_Task_Body_Procedure, @@ -336,8 +338,10 @@ package Gen_IL.Fields is Null_Statement, Object_Definition, Of_Present, + Original_Aspect, Original_Discriminant, Original_Entity, + Original_Pragma, Others_Discrete_Choices, Out_Present, Parameter_Associations, @@ -347,6 +351,7 @@ package Gen_IL.Fields is Parent_With, Position, Pragma_Argument_Associations, + Pragma_Ghost_Assertion_Level, Pragma_Identifier, Pragmas_After, Pragmas_Before, @@ -463,6 +468,7 @@ package Gen_IL.Fields is Can_Never_Be_Null, Can_Use_Internal_Rep, Checks_May_Be_Suppressed, + Child_Levels, Class_Postconditions, Class_Preconditions, Class_Preconditions_Subprogram, @@ -557,6 +563,7 @@ package Gen_IL.Fields is Full_View, Generic_Homonym, Generic_Renamings, + Ghost_Assertion_Level, Has_Aliased_Components, Has_Alignment_Clause, Has_All_Calls_Remote, @@ -651,6 +658,7 @@ package Gen_IL.Fields is Has_Thunks, Has_Unchecked_Union, Has_Unknown_Discriminants, + Has_Unsigned_Base_Range_Aspect, Has_Visible_Refinement, Has_Volatile_Components, Has_Xref_Entry, @@ -736,6 +744,7 @@ package Gen_IL.Fields is Is_Immediately_Visible, Is_Implementation_Defined, Is_Implicit_Full_View, + Is_Implicit_Ghost, Is_Imported, Is_Independent, Is_Initial_Condition_Procedure, @@ -755,6 +764,7 @@ package Gen_IL.Fields is Is_Limited_Composite, Is_Limited_Interface, Is_Limited_Record, + Is_Link_Once, Is_Local_Anonymous_Access, Is_Loop_Parameter, Is_Machine_Code_Subprogram, @@ -860,6 +870,7 @@ package Gen_IL.Fields is Overridden_Operation, Package_Instantiation, Packed_Array_Impl_Type, + Parent_Levels, Parent_Subtype, Part_Of_Constituents, Part_Of_References, diff --git a/gcc/ada/gen_il-gen-gen_entities.adb b/gcc/ada/gen_il-gen-gen_entities.adb index 0fedfbc60992..bd091cbe823f 100644 --- a/gcc/ada/gen_il-gen-gen_entities.adb +++ b/gcc/ada/gen_il-gen-gen_entities.adb @@ -63,6 +63,7 @@ begin -- Gen_IL.Gen.Gen_Entities Sm (First_Rep_Item, Node_Id), Sm (Freeze_Node, Node_Id), Sm (From_Limited_With, Flag), + Sm (Ghost_Assertion_Level, Node_Id), Sm (Has_Aliased_Components, Flag, Impl_Base_Type_Only), Sm (Has_Alignment_Clause, Flag), Sm (Has_All_Calls_Remote, Flag), @@ -158,6 +159,7 @@ begin -- Gen_IL.Gen.Gen_Entities Sm (Is_Ignored_Ghost_Entity, Flag), Sm (Is_Immediately_Visible, Flag), Sm (Is_Implementation_Defined, Flag), + Sm (Is_Implicit_Ghost, Flag), Sm (Is_Imported, Flag), Sm (Is_Independent, Flag), Sm (Is_Inlined, Flag), @@ -173,6 +175,7 @@ begin -- Gen_IL.Gen.Gen_Entities Sm (Is_Limited_Composite, Flag), Sm (Is_Limited_Interface, Flag), Sm (Is_Limited_Record, Flag), + Sm (Is_Link_Once, Flag), Sm (Is_Loop_Parameter, Flag), Sm (Is_Obsolescent, Flag), Sm (Is_Package_Body_Entity, Flag), @@ -496,6 +499,8 @@ begin -- Gen_IL.Gen.Gen_Entities Sm (Has_Static_Predicate, Flag), Sm (Has_Static_Predicate_Aspect, Flag), Sm (Has_Unknown_Discriminants, Flag), + Sm (Has_Unsigned_Base_Range_Aspect, Flag, + Pre => "Is_Type (N)"), Sm (Interface_Name, Node_Id), Sm (Is_Abstract_Type, Flag), Sm (Is_Actual_Subtype, Flag), @@ -1344,6 +1349,17 @@ begin -- Gen_IL.Gen.Gen_Entities Sm (SPARK_Pragma, Node_Id), Sm (SPARK_Pragma_Inherited, Flag))); + Cc (E_Assertion_Level, Entity_Kind, + -- An assertion level. Used to associate a level indicator to an + -- assertion like construct. Constructs assigned with a certain level + -- can be disabled through pragma Assertion_Policy. Levels can form a + -- hierarchy. A declaration of a level can include a list of levels + -- this level depends on known as the Parent_Levels. An opposite list + -- is also kept to store all the levels that depend on it known as the + -- Child_Levels. + (Sm (Child_Levels, Elist_Id), + Sm (Parent_Levels, Elist_Id))); + -- Union types. These don't fit into the normal parent/child hierarchy -- above. diff --git a/gcc/ada/gen_il-gen-gen_nodes.adb b/gcc/ada/gen_il-gen-gen_nodes.adb index 412565f42a8b..9ce2511a5617 100644 --- a/gcc/ada/gen_il-gen-gen_nodes.adb +++ b/gcc/ada/gen_il-gen-gen_nodes.adb @@ -687,13 +687,14 @@ begin -- Gen_IL.Gen.Gen_Nodes (Sy (Defining_Unit_Name, Node_Id), Sy (Name, Node_Id, Default_Empty), Sy (Generic_Associations, List_Id, Default_No_List), + Sm (Parent_Spec, Node_Id), Sm (Instance_Spec, Node_Id), Sm (Is_Declaration_Level_Node, Flag), Sm (Is_Elaboration_Checks_OK_Node, Flag), Sm (Is_Elaboration_Warnings_OK_Node, Flag), Sm (Is_Known_Guaranteed_ABE, Flag), Sm (Is_SPARK_Mode_On_Node, Flag), - Sm (Parent_Spec, Node_Id))); + Sm (Is_Structural, Flag))); Ab (N_Subprogram_Instantiation, N_Generic_Instantiation, (Sy (Must_Override, Flag), @@ -1127,6 +1128,7 @@ begin -- Gen_IL.Gen.Gen_Nodes (Sy (Identifier, Node_Id, Default_Empty), Sy (Expression, Node_Id, Default_Empty), Sy (Class_Present, Flag), + Sm (Aspect_Ghost_Assertion_Level, Node_Id), Sm (Aspect_On_Partial_View, Flag), Sm (Aspect_Rep_Item, Node_Id), Sm (Aspect_Subprograms, Elist_Id), @@ -1137,7 +1139,8 @@ begin -- Gen_IL.Gen.Gen_Nodes Sm (Is_Delayed_Aspect, Flag), Sm (Is_Disabled, Flag), Sm (Is_Ignored, Flag), - Sm (Next_Rep_Item, Node_Id))); + Sm (Next_Rep_Item, Node_Id), + Sm (Original_Aspect, Node_Id))); Cc (N_Call_Marker, Node_Kind, (Sm (Is_Declaration_Level_Node, Flag), @@ -1444,6 +1447,8 @@ begin -- Gen_IL.Gen.Gen_Nodes Sm (Is_Ignored_Ghost_Pragma, Flag), Sm (Next_Pragma, Node_Id), Sm (Next_Rep_Item, Node_Id), + Sm (Original_Pragma, Node_Id), + Sm (Pragma_Ghost_Assertion_Level, Node_Id), Sm (Uneval_Old_Accept, Flag), Sm (Uneval_Old_Warn, Flag))); diff --git a/gcc/ada/gen_il-internals.adb b/gcc/ada/gen_il-internals.adb index 3fa8b9405427..77685f25c6a2 100644 --- a/gcc/ada/gen_il-internals.adb +++ b/gcc/ada/gen_il-internals.adb @@ -291,6 +291,8 @@ package body Gen_IL.Internals is return "Has_RACW"; when Has_SP_Choice => return "Has_SP_Choice"; + when Has_Unsigned_Base_Range_Aspect => + return "Has_Unsigned_Base_Range_Aspect"; when Ignore_SPARK_Mode_Pragmas => return "Ignore_SPARK_Mode_Pragmas"; when Is_CPP_Class => diff --git a/gcc/ada/gen_il-types.ads b/gcc/ada/gen_il-types.ads index c3a97558f702..66d912721fa6 100644 --- a/gcc/ada/gen_il-types.ads +++ b/gcc/ada/gen_il-types.ads @@ -445,6 +445,7 @@ package Gen_IL.Types is -- Concrete entity types: E_Void, + E_Assertion_Level, E_Component, E_Constant, E_Discriminant, diff --git a/gcc/ada/ghost.adb b/gcc/ada/ghost.adb index f9c285316cd5..e7a55efb4beb 100644 --- a/gcc/ada/ghost.adb +++ b/gcc/ada/ghost.adb @@ -38,12 +38,12 @@ with Sem_Aux; use Sem_Aux; with Sem_Disp; use Sem_Disp; with Sem_Eval; use Sem_Eval; with Sem_Prag; use Sem_Prag; -with Sem_Res; use Sem_Res; with Sem_Util; use Sem_Util; with Sinfo; use Sinfo; with Sinfo.Nodes; use Sinfo.Nodes; with Sinfo.Utils; use Sinfo.Utils; with Snames; use Snames; +with Stand; use Stand; with Table; package body Ghost is @@ -63,18 +63,64 @@ package body Ghost is Table_Increment => Alloc.Ignored_Ghost_Nodes_Increment, Table_Name => "Ignored_Ghost_Nodes"); + --------------------- + -- Local variables -- + --------------------- + + Assertion_Level_Error_Msg : constant String := + "incompatible assertion levels in effect"; + + Ghost_Policy_Error_Msg : constant String := + "incompatible ghost policies in effect"; + ----------------------- -- Local subprograms -- ----------------------- - procedure Install_Ghost_Mode (Mode : Ghost_Mode_Type); - pragma Inline (Install_Ghost_Mode); - -- Install Ghost mode Mode as the Ghost mode in effect - - procedure Install_Ghost_Region (Mode : Name_Id; N : Node_Id); + function Assertion_Level_To_Name (Level : Entity_Id) return Name_Id; + -- Returns No_Name if there is no Level or the name of the Level. + + procedure Check_Valid_Ghost_Declaration (N : Node_Id); + -- Check that the declaration for a Ghost node N has a valid + -- Assertion_Policy and a valid Assertion_Level. + + function Get_Ghost_Aspect (N : Node_Id) return Node_Id; + -- Returns the Ghost aspect for a given node if it has one. + + function Get_Ghost_Pragma (N : Node_Id) return Node_Id; + -- Return the Ghost pragma following this node. + + function Get_Ghost_Assertion_Level (N : Node_Id) return Entity_Id; + -- Returns the Assertion_Level entity if the node has a Ghost aspect and + -- the Ghost aspect is using an Assertion_Level. + + function Ghost_Assertion_Level_In_Effect (Id : Entity_Id) return Entity_Id; + -- Returns the ghost level applicable for the given entity Id in a similar + -- manner as Ghost_Policy_In_Effect. + + function Ghost_Policy_In_Effect (Id : Entity_Id) return Name_Id; + -- Returns the ghost policy applicable for the given entity Id. + -- + -- SPARK RM 6.9 (3): + -- + -- An object declaration which occurs inside an expression in a ghost + -- declaration, statement, assertion pragma or specification aspect + -- declaration is a ghost declaration. + -- + -- If this declaration does not have the Ghost aspect specified, the + -- assertion policy applicable to this declaration comes from the policy + -- applicable to the enclosing declaration, statement, assertion pragma + -- or specification aspect. + -- + -- Otherwise, the assertion policy applicable to an object declaration + -- comes either from its assertion level if any, or from the ghost + -- policy at the point of declaration. + + procedure Install_Ghost_Region + (Mode : Name_Id; N : Node_Id; Level : Entity_Id); pragma Inline (Install_Ghost_Region); -- Install a Ghost region comprised of mode Mode and ignored region start - -- node N. + -- node N and Level as the Assertion_Level that was associated with it. function Is_Subject_To_Ghost (N : Node_Id) return Boolean; -- Determine whether declaration or body N is subject to aspect or pragma @@ -82,17 +128,84 @@ package body Ghost is -- been analyzed yet, but the context needs to establish the "ghostness" -- of N. + procedure Mark_And_Set_Ghost_Region (N : Node_Id; Id : Entity_Id); + -- Install a new ghost region for N based on the active policy applied for + -- Id. Additionally if the policy is ignored mark and set the node as an + -- ignored ghost region. + procedure Mark_Ghost_Declaration_Or_Body - (N : Node_Id; - Mode : Name_Id); + (N : Node_Id; + Mode : Name_Id; + Level : Entity_Id); -- Mark the defining entity of declaration or body N as Ghost depending on -- mode Mode. Mark all formals parameters when N denotes a subprogram or a - -- body. + -- body. Additionally set level as the Ghost_Assertion_Level for all of + -- them. procedure Record_Ignored_Ghost_Node (N : Node_Or_Entity_Id); -- Save ignored Ghost node or entity N in table Ignored_Ghost_Nodes for -- later elimination. + ------------------------------ + -- Assertion_Level_From_Arg -- + ------------------------------ + + function Assertion_Level_From_Arg (Arg : Node_Id) return Entity_Id is + Expr : constant Node_Id := Get_Pragma_Arg (Arg); + Level : Entity_Id; + + begin + -- Aspect Ghost without an expression uses Standard_Level_Default + + if No (Expr) then + return Standard_Level_Default; + end if; + + -- Check if the expression matches a static boolean expression first + + Preanalyze_And_Resolve_Without_Errors (Expr); + if Is_OK_Static_Expression (Expr) then + if Is_True (Expr_Value (Expr)) then + return Standard_Level_Default; + else + -- Ghost => False is considered to be non-ghost + + return Empty; + end if; + end if; + + -- Alternatively the argument could be an Assertion_Level + + if Nkind (Expr) = N_Identifier then + Level := Get_Assertion_Level (Chars (Expr)); + if Present (Level) then + -- The identifier resolved to an assertion level. Override the + -- Any_Id from a failed resolution in pre-analysis. + + Set_Entity (Expr, Level); + return Level; + end if; + end if; + + -- We are dealing with a malformed ghost argument. + -- An error will be emitted when the pragma is analyzed. + + return Empty; + end Assertion_Level_From_Arg; + + ----------------------------- + -- Assertion_Level_To_Name -- + ----------------------------- + + function Assertion_Level_To_Name (Level : Entity_Id) return Name_Id is + begin + if No (Level) then + return No_Name; + end if; + + return Chars (Level); + end Assertion_Level_To_Name; + ---------------------------- -- Check_Ghost_Completion -- ---------------------------- @@ -101,33 +214,36 @@ package body Ghost is (Prev_Id : Entity_Id; Compl_Id : Entity_Id) is - Policy : constant Name_Id := Policy_In_Effect (Name_Ghost); + Policy : Name_Id; begin -- Nothing to do if one of the views is missing if No (Prev_Id) or else No (Compl_Id) then - null; + return; + end if; + + Policy := Ghost_Policy_In_Effect (Prev_Id); -- The Ghost policy in effect at the point of declaration and at the - -- point of completion must match (SPARK RM 6.9(16)). + -- point of completion must match (SPARK RM 6.9(19)). - elsif Is_Checked_Ghost_Entity (Prev_Id) + if Is_Checked_Ghost_Entity (Prev_Id) and then Policy = Name_Ignore then + Error_Msg_N (Ghost_Policy_Error_Msg, Prev_Id); + Error_Msg_Sloc := Sloc (Prev_Id); + Error_Msg_N ("\& declared # with ghost policy `Check`", Prev_Id); Error_Msg_Sloc := Sloc (Compl_Id); - - Error_Msg_N ("incompatible ghost policies in effect", Prev_Id); - Error_Msg_N ("\& declared with ghost policy `Check`", Prev_Id); Error_Msg_N ("\& completed # with ghost policy `Ignore`", Prev_Id); elsif Is_Ignored_Ghost_Entity (Prev_Id) and then Policy = Name_Check then + Error_Msg_N (Ghost_Policy_Error_Msg, Prev_Id); + Error_Msg_Sloc := Sloc (Prev_Id); + Error_Msg_N ("\& declared # with ghost policy `Ignore`", Prev_Id); Error_Msg_Sloc := Sloc (Compl_Id); - - Error_Msg_N ("incompatible ghost policies in effect", Prev_Id); - Error_Msg_N ("\& declared with ghost policy `Ignore`", Prev_Id); Error_Msg_N ("\& completed # with ghost policy `Check`", Prev_Id); end if; end Check_Ghost_Completion; @@ -144,7 +260,7 @@ package body Ghost is function Is_OK_Ghost_Context (Context : Node_Id) return Boolean; -- Determine whether node Context denotes a Ghost-friendly context where - -- a Ghost entity can safely reside (SPARK RM 6.9(10)). + -- a Ghost entity can safely reside (SPARK RM 6.9(13)). function In_Aspect_Or_Pragma_Predicate (N : Node_Id) return Boolean; -- Return True iff N is enclosed in an aspect or pragma Predicate @@ -162,9 +278,9 @@ package body Ghost is -- -- * Be subject to pragma Ghost - function Is_OK_Pragma (Prag : Node_Id; Id : Entity_Id) return Boolean; - -- Determine whether node Prag is a suitable context for a reference - -- to a Ghost entity Id. To qualify as such, Prag must either + function Is_OK_Pragma (Prag : Node_Id) return Boolean; + -- Determine whether node Prag is a suitable context for a ghost + -- reference. To qualify as such, Prag must either -- -- * Be an assertion expression pragma -- @@ -175,7 +291,8 @@ package body Ghost is -- -- * Contain a reference to a Ghost entity - function Is_OK_Statement (Stmt : Node_Id) return Boolean; + function Is_OK_Statement + (Stmt : Node_Id; Id : Entity_Id; Call_Arg : Node_Id) return Boolean; -- Determine whether node Stmt is a suitable context for a reference -- to a Ghost entity. To qualify as such, Stmt must either -- @@ -307,119 +424,224 @@ package body Ghost is -- Is_OK_Pragma -- ------------------ - function Is_OK_Pragma (Prag : Node_Id; Id : Entity_Id) return Boolean + function Is_OK_Pragma (Prag : Node_Id) return Boolean is - procedure Check_Policies (Prag_Nam : Name_Id); - -- Verify that the Ghost policy in effect at the point of the - -- declaration of Ghost entity Id (if present) is the same as the - -- assertion policy for pragma name Prag_Nam. Emit an error if - -- this is not the case. + Prag_Id : Pragma_Id; + Prag_Nam : Name_Id; - -------------------- - -- Check_Policies -- - -------------------- + begin + if Nkind (Prag) /= N_Pragma then + return False; + end if; - procedure Check_Policies (Prag_Nam : Name_Id) is - AP : constant Name_Id := Check_Kind (Prag_Nam); + -- if the entitiy associated with the pragma is ignored then we do + -- not need to analyze the pragma. - begin - -- If the Ghost policy in effect at the point of the - -- declaration of Ghost entity Id is Ignore, then the assertion - -- policy of the pragma must be Ignore (SPARK RM 6.9(20)). + if Is_Ignored_Ghost_Pragma (Prag) then + return True; + end if; - if Present (Id) - and then not Is_Checked_Ghost_Entity (Id) - and then AP /= Name_Ignore - then - Error_Msg_N - ("incompatible ghost policies in effect", - Ghost_Ref); - Error_Msg_NE - ("\ghost entity & has policy `Ignore`", - Ghost_Ref, Ghost_Id); + Prag_Id := Get_Pragma_Id (Prag); + Prag_Nam := Original_Aspect_Pragma_Name (Prag); - Error_Msg_Name_1 := AP; - Error_Msg_N - ("\assertion expression has policy %", Ghost_Ref); - end if; - end Check_Policies; + -- A pragma may not be analyzed, so that its Ghost status is + -- not determined yet, but it is guaranteed to be Ghost when + -- referencing a Ghost entity. - -- Local variables + if Suppressed_Ghost_Policy_Check_Pragma (Prag_Id) then + return True; - Prag_Id : Pragma_Id; - Prag_Nam : Name_Id; + -- An assertion expression pragma is Ghost when it contains a + -- reference to a Ghost entity (SPARK RM 6.9(13)), except for + -- predicate pragmas (SPARK RM 6.9(14)). + + elsif Is_Valid_Assertion_Kind (Prag_Nam) + and then Assertion_Expression_Pragma (Prag_Id) + and then Prag_Id /= Pragma_Predicate + then + return True; - -- Start of processing for Is_OK_Pragma + -- A pragma that applies to a Ghost construct or specifies an + -- aspect of a Ghost entity is a Ghost pragma (SPARK RM 6.9(4)) - begin - if Nkind (Prag) = N_Pragma then - Prag_Id := Get_Pragma_Id (Prag); - Prag_Nam := Original_Aspect_Pragma_Name (Prag); + elsif Is_Ghost_Pragma (Prag) then + return True; - -- A pragma that applies to a Ghost construct or specifies an - -- aspect of a Ghost entity is a Ghost pragma (SPARK RM 6.9(3)) + -- Several pragmas that may apply to a non-Ghost entity are + -- treated as Ghost when they contain a reference to a Ghost + -- entity (SPARK RM 6.9(18)). + + elsif Prag_Nam + in Name_Global + | Name_Depends + | Name_Initializes + | Name_Refined_Global + | Name_Refined_Depends + | Name_Refined_State + then + return True; + end if; - if Is_Ghost_Pragma (Prag) then - return True; + return False; + end Is_OK_Pragma; - -- A pragma may not be analyzed, so that its Ghost status is - -- not determined yet, but it is guaranteed to be Ghost when - -- referencing a Ghost entity. + --------------------- + -- Is_OK_Statement -- + --------------------- - elsif Prag_Nam in Name_Annotate - | Name_Compile_Time_Error - | Name_Compile_Time_Warning - | Name_Unreferenced + function Is_OK_Statement + (Stmt : Node_Id; Id : Entity_Id; Call_Arg : Node_Id) return Boolean + is + procedure Check_Assignment_Levels (Assignee : Entity_Id); + -- Check that a ghost entity on the RHS of the assignment is + -- assertion level dependent on the LHS. + + procedure Check_Procedure_Call_Policies (Callee : Entity_Id); + -- Check that + -- * the a checked call argument is not modified by an ignored + -- procedure call. + -- * the level of the modified call argument depends on the level + -- of the call. + + function Is_Modified_By_Call + (Call : Node_Id; Call_Arg : Node_Id; Callee : Entity_Id) + return Boolean; + -- Check that Call_Arg was used in the call and that the formal + -- for that argument was either out or in-out. + + ----------------------------- + -- Check_Assignment_Levels -- + ----------------------------- + + procedure Check_Assignment_Levels (Assignee : Entity_Id) is + Assignee_Level : constant Entity_Id := + Ghost_Assertion_Level (Assignee); + Id_Level : constant Entity_Id := + Ghost_Assertion_Level (Id); + begin + -- SPARK RM 6.9 (13) A ghost entity E shall only be referenced + -- within an assignment statement whose target is a ghost + -- variable that is assertion-level-dependent on E. + + if not Is_Assertion_Level_Dependent (Assignee_Level, Id_Level) then - return True; + Error_Msg_N (Assertion_Level_Error_Msg, Ghost_Ref); + Error_Msg_Name_1 := Chars (Id_Level); + Error_Msg_N ("\& has assertion level %", Ghost_Ref); + Error_Msg_Name_1 := Chars (Assignee_Level); + Error_Msg_Node_2 := Assignee; + Error_Msg_NE ("\& is modifying & with %", Ghost_Ref, Id); + Error_Msg_Name_1 := Chars (Id_Level); + Error_Msg_NE + ("\assertion level of & should depend on %", + Ghost_Ref, + Assignee); + end if; + end Check_Assignment_Levels; - -- An assertion expression pragma is Ghost when it contains a - -- reference to a Ghost entity (SPARK RM 6.9(10)), except for - -- predicate pragmas (SPARK RM 6.9(11)). + ----------------------------------- + -- Check_Procedure_Call_Policies -- + ----------------------------------- - elsif Assertion_Expression_Pragma (Prag_Id) - and then Prag_Id /= Pragma_Predicate - then - -- Ensure that the assertion policy and the Ghost policy are - -- compatible (SPARK RM 6.9(20)). + procedure Check_Procedure_Call_Policies (Callee : Entity_Id) is + Id_Level : constant Entity_Id := Ghost_Assertion_Level (Id); + Id_Policy : constant Name_Id := Ghost_Policy_In_Effect (Id); - Check_Policies (Prag_Nam); - return True; + Call_Level : Entity_Id; + Call_Policy : Name_Id; + begin + if No (Callee) then + return; + end if; - -- Several pragmas that may apply to a non-Ghost entity are - -- treated as Ghost when they contain a reference to a Ghost - -- entity (SPARK RM 6.9(11)). + -- Checks apply only if we are processing a call argument that + -- is modified by the call. - elsif Prag_Nam in Name_Global - | Name_Depends - | Name_Initializes - | Name_Refined_Global - | Name_Refined_Depends - | Name_Refined_State + if No (Call_Arg) + or else not Is_Modified_By_Call (Stmt, Call_Arg, Callee) then - return True; + return; end if; - end if; - return False; - end Is_OK_Pragma; + Call_Policy := Ghost_Policy_In_Effect (Callee); + Call_Level := Ghost_Assertion_Level (Callee); - --------------------- - -- Is_OK_Statement -- - --------------------- + if Id_Policy = Name_Check + and then Call_Policy = Name_Ignore + then + Error_Msg_Sloc := Sloc (Ghost_Ref); + Error_Msg_N (Ghost_Policy_Error_Msg, Ghost_Ref); + Error_Msg_NE ("\& has ghost policy `Check`", Ghost_Ref, Id); + Error_Msg_NE + ("\& is modified # by a procedure with `Ignore`", + Ghost_Ref, + Id); + end if; + + -- An out or in out mode actual parameter and the subprogram + -- shall have matching assertion levels SPARK RM 6.9 (15). + + if Id_Level /= Call_Level then + Error_Msg_N (Assertion_Level_Error_Msg, Ghost_Ref); + Error_Msg_Name_1 := Chars (Id_Level); + Error_Msg_N ("\& has assertion level %", Ghost_Ref); + Error_Msg_Name_1 := Chars (Call_Level); + Error_Msg_Node_2 := Callee; + Error_Msg_N + ("\& is modified by & with %", Ghost_Ref); + Error_Msg_N + ("\the levels of the call and call arguments must match", + Ghost_Ref); + end if; + end Check_Procedure_Call_Policies; + + ------------------------- + -- Is_Modified_By_Call -- + ------------------------- + + function Is_Modified_By_Call + (Call : Node_Id; Call_Arg : Node_Id; Callee : Entity_Id) + return Boolean + is + Form : Node_Id; + Act : Node_Id; + begin + Act := First_Actual (Call); + Form := First_Formal (Callee); + + while Present (Form) and then Present (Act) loop + if Act = Call_Arg then + return + Ekind (Form) in E_Out_Parameter | E_In_Out_Parameter; + end if; + + Next_Formal (Form); + Next_Actual (Act); + end loop; + + return False; + end Is_Modified_By_Call; + + -- Start of processing for Is_OK_Statement - function Is_OK_Statement (Stmt : Node_Id) return Boolean is begin -- An assignment statement is Ghost when the target is a Ghost -- entity. if Nkind (Stmt) = N_Assignment_Statement then - return Is_Ghost_Assignment (Stmt); + if Is_Ghost_Assignment (Stmt) then + Check_Assignment_Levels + (Get_Enclosing_Ghost_Entity (Name (Stmt))); + return True; + end if; -- A procedure call is Ghost when it calls a Ghost procedure elsif Nkind (Stmt) = N_Procedure_Call_Statement then - return Is_Ghost_Procedure_Call (Stmt); + if Is_Ghost_Procedure_Call (Stmt) then + Check_Procedure_Call_Policies (Get_Subprogram_Entity (Stmt)); + return True; + end if; -- Special cases @@ -439,23 +661,18 @@ package body Ghost is -- Local variables - Par : Node_Id; + Par : Node_Id; + Prev : Node_Id; -- Start of processing for Is_OK_Ghost_Context begin - -- The context is Ghost when it appears within a Ghost package or - -- subprogram. - - if Ghost_Config.Ghost_Mode > None then - return True; - -- Routine Expand_Record_Extension creates a parent subtype without -- inserting it into the tree. There is no good way of recognizing -- this special case as there is no parent. Try to approximate the -- context. - elsif No (Parent (Context)) and then Is_Tagged_Type (Ghost_Id) then + if No (Parent (Context)) and then Is_Tagged_Type (Ghost_Id) then return True; -- Otherwise climb the parent chain looking for a suitable Ghost @@ -463,23 +680,21 @@ package body Ghost is else Par := Context; + Prev := Empty; while Present (Par) loop - if Is_Ignored_Ghost_Node (Par) then - return True; - -- It is not possible to check correct use of Ghost entities -- in generic instantiations until after the generic has been -- resolved. Postpone that verification to after resolution. - elsif Nkind (Par) = N_Generic_Association then + if Nkind (Par) = N_Generic_Association then return True; -- A reference to a Ghost entity can appear within an aspect - -- specification (SPARK RM 6.9(10)). The precise checking will + -- specification (SPARK RM 6.9(13)). The precise checking will -- occur when analyzing the corresponding pragma. We make an -- exception for predicate aspects other than Ghost_Predicate -- that only allow referencing a Ghost entity when the - -- corresponding type declaration is Ghost (SPARK RM 6.9(11)). + -- corresponding type declaration is Ghost (SPARK RM 6.9(14)). elsif Nkind (Par) = N_Aspect_Specification and then @@ -490,7 +705,7 @@ package body Ghost is return True; -- A Ghost type may be referenced in a use or use_type clause - -- (SPARK RM 6.9(10)). + -- (SPARK RM 6.9(13)). elsif Present (Parent (Par)) and then Nkind (Parent (Par)) in N_Use_Package_Clause @@ -528,10 +743,10 @@ package body Ghost is elsif Is_OK_Declaration (Par) then return True; - elsif Is_OK_Pragma (Par, Ghost_Id) then + elsif Is_OK_Pragma (Par) then return True; - elsif Is_OK_Statement (Par) then + elsif Is_OK_Statement (Par, Ghost_Id, Prev) then return True; -- Prevent the search from going too far @@ -540,6 +755,7 @@ package body Ghost is exit; end if; + Prev := Par; Par := Parent (Par); end loop; @@ -565,28 +781,91 @@ package body Ghost is ------------------------ procedure Check_Ghost_Policy (Id : Entity_Id; Ref : Node_Id) is - Policy : constant Name_Id := Policy_In_Effect (Name_Ghost); + function Is_From_Aspect_Iterable (Ref : Node_Id) return Boolean; + -- Returns true when the node is contained within an Iterable aspect. + + function Is_From_Aspect_Iterable (Ref : Node_Id) return Boolean is + P : Node_Id := Parent (Ref); + begin + while Present (P) loop + if Nkind (P) = N_Aspect_Specification then + return Get_Aspect_Id (P) = Aspect_Iterable; + end if; + P := Parent (P); + end loop; + return False; + end Is_From_Aspect_Iterable; + + -- Local variables + + Applic_Policy : Ghost_Mode_Type := Ghost_Config.Ghost_Mode; + Ghost_Region : constant Node_Id := Ghost_Config.Current_Region; + + -- Start of processing for Check_Ghost_Policy begin + -- The policy is allowed to change within renaming and instantiation + -- statements. + + if No (Ghost_Region) + or else Nkind (Ghost_Region) + in N_Object_Renaming_Declaration + | N_Package_Instantiation + | N_Procedure_Instantiation + | N_Subprogram_Renaming_Declaration + then + return; + end if; + + -- The applied policy for procedure calls is the policy in effect at + -- the moment of the call. + + if Ekind (Id) in E_Procedure then + Applic_Policy := Name_To_Ghost_Mode (Ghost_Policy_In_Effect (Id)); + end if; + -- The Ghost policy in effect a the point of declaration and at the - -- point of use must match (SPARK RM 6.9(15)). + -- point of use must match (SPARK RM 6.9(18)). if Is_Checked_Ghost_Entity (Id) - and then Policy = Name_Ignore + and then Applic_Policy = Ignore and then Known_To_Be_Assigned (Ref) then + Error_Msg_N (Ghost_Policy_Error_Msg, Ref); + Error_Msg_Sloc := Sloc (Id); + Error_Msg_NE ("\& declared # with ghost policy `Check`", Ref, Id); Error_Msg_Sloc := Sloc (Ref); + Error_Msg_NE ("\& used # with ghost policy `Ignore`", Ref, Id); + end if; - Error_Msg_N ("incompatible ghost policies in effect", Ref); - Error_Msg_NE ("\& declared with ghost policy `Check`", Ref, Id); - Error_Msg_NE ("\& used # with ghost policy `Ignore`", Ref, Id); + -- A ghost entity E shall not be referenced within an aspect + -- specification [(including an aspect-specifying pragma)] which + -- specifies an aspect of an entity that is either non-ghost or not + -- assertion-level-dependent on E except in the following cases the + -- specified aspect is either Global, Depends, Refined_Global, + -- Refined_Depends, Initializes, Refined_State, or Iterable (SPARK RM + -- 6.9(14)). + + if No (Ghost_Region) + or else (Nkind (Ghost_Region) = N_Pragma + and then Get_Pragma_Id (Ghost_Region) + in Pragma_Global + | Pragma_Depends + | Pragma_Refined_Global + | Pragma_Refined_Depends + | Pragma_Initializes + | Pragma_Refined_State) + or else Is_From_Aspect_Iterable (Ref) + then + return; + end if; - elsif Is_Ignored_Ghost_Entity (Id) and then Policy = Name_Check then + if Is_Ignored_Ghost_Entity (Id) and then Applic_Policy = Check then + Error_Msg_N (Ghost_Policy_Error_Msg, Ref); + Error_Msg_Sloc := Sloc (Id); + Error_Msg_NE ("\& declared # with ghost policy `Ignore`", Ref, Id); Error_Msg_Sloc := Sloc (Ref); - - Error_Msg_N ("incompatible ghost policies in effect", Ref); - Error_Msg_NE ("\& declared with ghost policy `Ignore`", Ref, Id); - Error_Msg_NE ("\& used # with ghost policy `Check`", Ref, Id); + Error_Msg_NE ("\& used # with ghost policy `Check`", Ref, Id); end if; end Check_Ghost_Policy; @@ -627,6 +906,10 @@ package body Ghost is -- Start of processing for Check_Ghost_Context begin + if Ghost_Context_Checks_Disabled then + return; + end if; + -- Class-wide pre/postconditions of ignored pragmas are preanalyzed -- to report errors on wrong conditions; however, ignored pragmas may -- also have references to ghost entities and we must disable checking @@ -643,19 +926,10 @@ package body Ghost is return; end if; - -- Once it has been established that the reference to the Ghost entity - -- is within a suitable context, ensure that the policy at the point of - -- declaration and at the point of use match. - - if Is_OK_Ghost_Context (Ghost_Ref) then - if Present (Ghost_Id) then - Check_Ghost_Policy (Ghost_Id, Ghost_Ref); - end if; - - -- Otherwise the Ghost entity appears in a non-Ghost context and affects - -- its behavior or value (SPARK RM 6.9(10,11)). + -- If the Ghost entity appears in a non-Ghost context and affects + -- its behavior or value (SPARK RM 6.9(13,14)). - else + if not Is_OK_Ghost_Context (Ghost_Ref) then Error_Msg_N ("ghost entity cannot appear in this context", Ghost_Ref); -- When the Ghost entity appears in a pragma Predicate, explain the @@ -672,6 +946,14 @@ package body Ghost is & "or use a type invariant on a private type", Ghost_Ref); end if; end if; + + -- Once it has been established that the reference to the Ghost entity + -- is within a suitable context, ensure that the policy at the point of + -- declaration and at the point of use match. + + if Present (Ghost_Id) then + Check_Ghost_Policy (Ghost_Id, Ghost_Ref); + end if; end Check_Ghost_Context; ------------------------------------------------ @@ -732,6 +1014,80 @@ package body Ghost is end if; end Check_Ghost_Context_In_Generic_Association; + ----------------------------------- + -- Check_Valid_Ghost_Declaration -- + ----------------------------------- + + procedure Check_Valid_Ghost_Declaration (N : Node_Id) is + procedure Check_Valid_Assertion_Level (Id : Entity_Id; Ref : Node_Id); + -- Check that the the assertion level of the declared entity is + -- compatible with assertion level of the ghost region. + + procedure Check_Valid_Ghost_Policy (Id : Entity_Id; Ref : Node_Id); + -- Check that the declared identifier does not have a Checked assertion + -- policy while being declared inside an ignored ghost region. + + --------------------------------- + -- Check_Valid_Assertion_Level -- + --------------------------------- + + procedure Check_Valid_Assertion_Level (Id : Entity_Id; Ref : Node_Id) is + Id_Level : constant Entity_Id := Ghost_Assertion_Level (Id); + Region_Level : constant Entity_Id := + Ghost_Config.Ghost_Mode_Assertion_Level; + begin + -- This check is not applied for generic isntantiations + + if Is_Generic_Instance (Id) then + return; + end if; + + if not Is_Assertion_Level_Dependent (Id_Level, Region_Level) then + Error_Msg_Sloc := Sloc (Ref); + + Error_Msg_N (Assertion_Level_Error_Msg, Ref); + Error_Msg_Name_1 := Chars (Id_Level); + Error_Msg_NE ("\& has assertion level %", Ref, Id); + Error_Msg_Name_1 := Chars (Region_Level); + Error_Msg_NE ("\& is declared within a region with %", Ref, Id); + Error_Msg_Name_1 := Chars (Region_Level); + Error_Msg_NE ("\assertion level of & should depend on %", Ref, Id); + end if; + end Check_Valid_Assertion_Level; + + ------------------------------ + -- Check_Valid_Ghost_Policy -- + ------------------------------ + + procedure Check_Valid_Ghost_Policy (Id : Entity_Id; Ref : Node_Id) is + Policy : constant Name_Id := Ghost_Policy_In_Effect (Id); + begin + if Ghost_Config.Ghost_Mode = Ignore and then Policy = Name_Check + then + Error_Msg_Sloc := Sloc (Ref); + + Error_Msg_N (Ghost_Policy_Error_Msg, Ref); + Error_Msg_NE ("\& has ghost policy `Check`", Ref, Id); + Error_Msg_NE + ("\& is declared # within ghost policy `Ignore`", Ref, Id); + end if; + end Check_Valid_Ghost_Policy; + + -- Local variables + + Id : constant Entity_Id := Defining_Entity (N); + + -- Start of processing for Check_Valid_Ghost_Declaration + begin + if not Is_Ghost_Entity (Id) or else Ghost_Config.Ghost_Mode = None + then + return; + end if; + + Check_Valid_Ghost_Policy (Id, N); + Check_Valid_Assertion_Level (Id, N); + end Check_Valid_Ghost_Declaration; + --------------------------------------------- -- Check_Ghost_Formal_Procedure_Or_Package -- --------------------------------------------- @@ -808,129 +1164,127 @@ package body Ghost is Over_Subp : Entity_Id; begin - if Present (Subp) and then Present (Overridden_Subp) then - Over_Subp := Ultimate_Alias (Overridden_Subp); - Deriv_Typ := Find_Dispatching_Type (Subp); - - -- A Ghost primitive of a non-Ghost type extension cannot override an - -- inherited non-Ghost primitive (SPARK RM 6.9(8)). - - if Is_Ghost_Entity (Subp) - and then Present (Deriv_Typ) - and then not Is_Ghost_Entity (Deriv_Typ) - and then not Is_Ghost_Entity (Over_Subp) - and then not Is_Abstract_Subprogram (Over_Subp) - then - Error_Msg_N ("incompatible overriding in effect", Subp); + if No (Subp) or else No (Overridden_Subp) then + return; + end if; - Error_Msg_Sloc := Sloc (Over_Subp); - Error_Msg_N ("\& declared # as non-ghost subprogram", Subp); + Over_Subp := Ultimate_Alias (Overridden_Subp); + Deriv_Typ := Find_Dispatching_Type (Subp); - Error_Msg_Sloc := Sloc (Subp); - Error_Msg_N ("\overridden # with ghost subprogram", Subp); - end if; + -- A Ghost primitive of a non-Ghost type extension cannot override an + -- inherited non-Ghost primitive (SPARK RM 6.9(10)). - -- A non-Ghost primitive of a type extension cannot override an - -- inherited Ghost primitive (SPARK RM 6.9(8)). + if Is_Ghost_Entity (Subp) + and then Present (Deriv_Typ) + and then not Is_Ghost_Entity (Deriv_Typ) + and then not Is_Ghost_Entity (Over_Subp) + and then not Is_Abstract_Subprogram (Over_Subp) + then + Error_Msg_N ("incompatible overriding in effect", Subp); - if Is_Ghost_Entity (Over_Subp) - and then not Is_Ghost_Entity (Subp) - and then not Is_Abstract_Subprogram (Subp) - then - Error_Msg_N ("incompatible overriding in effect", Subp); + Error_Msg_Sloc := Sloc (Over_Subp); + Error_Msg_N ("\& declared # as non-ghost subprogram", Subp); - Error_Msg_Sloc := Sloc (Over_Subp); - Error_Msg_N ("\& declared # as ghost subprogram", Subp); + Error_Msg_Sloc := Sloc (Subp); + Error_Msg_N ("\overridden # with ghost subprogram", Subp); + end if; - Error_Msg_Sloc := Sloc (Subp); - Error_Msg_N ("\overridden # with non-ghost subprogram", Subp); - end if; + -- A non-Ghost primitive of a type extension cannot override an + -- inherited Ghost primitive (SPARK RM 6.9(10)). - if Present (Deriv_Typ) - and then not Is_Ignored_Ghost_Entity (Deriv_Typ) - then - -- When a tagged type is either non-Ghost or checked Ghost and - -- one of its primitives overrides an inherited operation, the - -- overridden operation of the ancestor type must be ignored Ghost - -- if the primitive is ignored Ghost (SPARK RM 6.9(19)). + if Is_Ghost_Entity (Over_Subp) + and then not Is_Ghost_Entity (Subp) + and then not Is_Abstract_Subprogram (Subp) + then + Error_Msg_N ("incompatible overriding in effect", Subp); - if Is_Ignored_Ghost_Entity (Subp) then + Error_Msg_Sloc := Sloc (Over_Subp); + Error_Msg_N ("\& declared # as ghost subprogram", Subp); - -- Both the parent subprogram and overriding subprogram are - -- ignored Ghost. + Error_Msg_Sloc := Sloc (Subp); + Error_Msg_N ("\overridden # with non-ghost subprogram", Subp); + end if; - if Is_Ignored_Ghost_Entity (Over_Subp) then - null; + if Present (Deriv_Typ) + and then not Is_Ignored_Ghost_Entity (Deriv_Typ) + then + -- When a tagged type is either non-Ghost or checked Ghost and + -- one of its primitives overrides an inherited operation, the + -- overridden operation of the ancestor type must be ignored Ghost + -- if the primitive is ignored Ghost (SPARK RM 6.9(21)). - -- The parent subprogram carries policy Check + if Is_Ignored_Ghost_Entity (Subp) then - elsif Is_Checked_Ghost_Entity (Over_Subp) then - Error_Msg_N - ("incompatible ghost policies in effect", Subp); + -- Both the parent subprogram and overriding subprogram are + -- ignored Ghost. - Error_Msg_Sloc := Sloc (Over_Subp); - Error_Msg_N - ("\& declared # with ghost policy `Check`", Subp); + if Is_Ignored_Ghost_Entity (Over_Subp) then + null; - Error_Msg_Sloc := Sloc (Subp); - Error_Msg_N - ("\overridden # with ghost policy `Ignore`", Subp); + -- The parent subprogram carries policy Check - -- The parent subprogram is non-Ghost + elsif Is_Checked_Ghost_Entity (Over_Subp) then + Error_Msg_N (Ghost_Policy_Error_Msg, Subp); - else - Error_Msg_N - ("incompatible ghost policies in effect", Subp); + Error_Msg_Sloc := Sloc (Over_Subp); + Error_Msg_N + ("\& declared # with ghost policy `Check`", Subp); - Error_Msg_Sloc := Sloc (Over_Subp); - Error_Msg_N ("\& declared # as non-ghost subprogram", Subp); + Error_Msg_Sloc := Sloc (Subp); + Error_Msg_N + ("\overridden # with ghost policy `Ignore`", Subp); - Error_Msg_Sloc := Sloc (Subp); - Error_Msg_N - ("\overridden # with ghost policy `Ignore`", Subp); - end if; + -- The parent subprogram is non-Ghost + + else + Error_Msg_N (Ghost_Policy_Error_Msg, Subp); - -- When a tagged type is either non-Ghost or checked Ghost and - -- one of its primitives overrides an inherited operation, the - -- the primitive of the tagged type must be ignored Ghost if the - -- overridden operation is ignored Ghost (SPARK RM 6.9(19)). + Error_Msg_Sloc := Sloc (Over_Subp); + Error_Msg_N ("\& declared # as non-ghost subprogram", Subp); - elsif Is_Ignored_Ghost_Entity (Over_Subp) then + Error_Msg_Sloc := Sloc (Subp); + Error_Msg_N + ("\overridden # with ghost policy `Ignore`", Subp); + end if; - -- Both the parent subprogram and the overriding subprogram are - -- ignored Ghost. + -- When a tagged type is either non-Ghost or checked Ghost and + -- one of its primitives overrides an inherited operation, the + -- the primitive of the tagged type must be ignored Ghost if the + -- overridden operation is ignored Ghost (SPARK RM 6.9(21)). - if Is_Ignored_Ghost_Entity (Subp) then - null; + elsif Is_Ignored_Ghost_Entity (Over_Subp) then - -- The overriding subprogram carries policy Check + -- Both the parent subprogram and the overriding subprogram are + -- ignored Ghost. - elsif Is_Checked_Ghost_Entity (Subp) then - Error_Msg_N - ("incompatible ghost policies in effect", Subp); + if Is_Ignored_Ghost_Entity (Subp) then + null; - Error_Msg_Sloc := Sloc (Over_Subp); - Error_Msg_N - ("\& declared # with ghost policy `Ignore`", Subp); + -- The overriding subprogram carries policy Check - Error_Msg_Sloc := Sloc (Subp); - Error_Msg_N - ("\overridden # with Ghost policy `Check`", Subp); + elsif Is_Checked_Ghost_Entity (Subp) then + Error_Msg_N (Ghost_Policy_Error_Msg, Subp); - -- The overriding subprogram is non-Ghost + Error_Msg_Sloc := Sloc (Over_Subp); + Error_Msg_N + ("\& declared # with ghost policy `Ignore`", Subp); - else - Error_Msg_N - ("incompatible ghost policies in effect", Subp); + Error_Msg_Sloc := Sloc (Subp); + Error_Msg_N + ("\overridden # with Ghost policy `Check`", Subp); - Error_Msg_Sloc := Sloc (Over_Subp); - Error_Msg_N - ("\& declared # with ghost policy `Ignore`", Subp); + -- The overriding subprogram is non-Ghost - Error_Msg_Sloc := Sloc (Subp); - Error_Msg_N - ("\overridden # with non-ghost subprogram", Subp); - end if; + else + Error_Msg_N (Ghost_Policy_Error_Msg, Subp); + + Error_Msg_Sloc := Sloc (Over_Subp); + Error_Msg_N + ("\& declared # with ghost policy `Ignore`", Subp); + + Error_Msg_Sloc := Sloc (Subp); + Error_Msg_N + ("\overridden # with non-ghost subprogram", Subp); end if; end if; end if; @@ -941,41 +1295,48 @@ package body Ghost is --------------------------- procedure Check_Ghost_Primitive (Prim : Entity_Id; Typ : Entity_Id) is + Prim_Level : Entity_Id; + Typ_Level : Entity_Id; begin - -- The Ghost policy in effect at the point of declaration of a primitive - -- operation and a tagged type must match (SPARK RM 6.9(18)). + if not Is_Tagged_Type (Typ) then + return; + end if; - if Is_Tagged_Type (Typ) then - if Is_Checked_Ghost_Entity (Prim) - and then Is_Ignored_Ghost_Entity (Typ) - then - Error_Msg_N ("incompatible ghost policies in effect", Prim); + -- The Ghost policy in effect at the point of declaration of a primitive + -- operation and a tagged type must match (SPARK RM 6.9(21)). - Error_Msg_Sloc := Sloc (Typ); - Error_Msg_NE - ("\tagged type & declared # with ghost policy `Ignore`", - Prim, Typ); + if Is_Checked_Ghost_Entity (Prim) + and then Is_Ignored_Ghost_Entity (Typ) + then + Error_Msg_N (Ghost_Policy_Error_Msg, Prim); - Error_Msg_Sloc := Sloc (Prim); - Error_Msg_N - ("\primitive subprogram & declared # with ghost policy `Check`", - Prim); + Error_Msg_Sloc := Sloc (Typ); + Error_Msg_NE + ("\tagged type & declared # with ghost policy `Ignore`", + Prim, Typ); - elsif Is_Ignored_Ghost_Entity (Prim) - and then Is_Checked_Ghost_Entity (Typ) - then - Error_Msg_N ("incompatible ghost policies in effect", Prim); + Error_Msg_Sloc := Sloc (Prim); + Error_Msg_N + ("\primitive subprogram & declared # with ghost policy `Check`", + Prim); + end if; - Error_Msg_Sloc := Sloc (Typ); - Error_Msg_NE - ("\tagged type & declared # with ghost policy `Check`", - Prim, Typ); + Prim_Level := Ghost_Assertion_Level (Prim); + Typ_Level := Ghost_Assertion_Level (Typ); + + if not Is_Assertion_Level_Dependent (Prim_Level, Typ_Level) then + Error_Msg_N (Assertion_Level_Error_Msg, Prim); + Error_Msg_Name_1 := Chars (Typ_Level); + Error_Msg_Sloc := Sloc (Typ); + Error_Msg_NE ("\tagged type & declared # with %", Prim, Typ); + Error_Msg_Name_1 := Chars (Prim_Level); + Error_Msg_Sloc := Sloc (Prim); + Error_Msg_NE + ("\primitive subprogram & declared # with %", Prim, Prim); + Error_Msg_Name_1 := Chars (Typ_Level); + Error_Msg_NE + ("\assertion level of & should depend on %", Prim, Prim); - Error_Msg_Sloc := Sloc (Prim); - Error_Msg_N - ("\primitive subprogram & declared # with ghost policy `Ignore`", - Prim); - end if; end if; end Check_Ghost_Primitive; @@ -989,48 +1350,56 @@ package body Ghost is Constit : Node_Id; Constit_Id : Entity_Id) is + State_Level : Entity_Id; + Constit_Level : Entity_Id; begin - if Is_Ghost_Entity (State_Id) then - if Is_Ghost_Entity (Constit_Id) then + -- Only check ghost states + + if not Is_Ghost_Entity (State_Id) then + return; + end if; - -- The Ghost policy in effect at the point of abstract state - -- declaration and constituent must match (SPARK RM 6.9(17)). + -- A constituent of a Ghost abstract state must be a Ghost entity + -- (SPARK RM 7.2.2(12)). - if Is_Checked_Ghost_Entity (State_Id) - and then Is_Ignored_Ghost_Entity (Constit_Id) - then - Error_Msg_Sloc := Sloc (Constit); - SPARK_Msg_N ("incompatible ghost policies in effect", State); - - SPARK_Msg_NE - ("\abstract state & declared with ghost policy `Check`", - State, State_Id); - SPARK_Msg_NE - ("\constituent & declared # with ghost policy `Ignore`", - State, Constit_Id); - - elsif Is_Ignored_Ghost_Entity (State_Id) - and then Is_Checked_Ghost_Entity (Constit_Id) - then - Error_Msg_Sloc := Sloc (Constit); - SPARK_Msg_N ("incompatible ghost policies in effect", State); - - SPARK_Msg_NE - ("\abstract state & declared with ghost policy `Ignore`", - State, State_Id); - SPARK_Msg_NE - ("\constituent & declared # with ghost policy `Check`", - State, Constit_Id); - end if; + if not Is_Ghost_Entity (Constit_Id) then + SPARK_Msg_NE + ("constituent of ghost state & must be ghost", + Constit, State_Id); + end if; - -- A constituent of a Ghost abstract state must be a Ghost entity - -- (SPARK RM 7.2.2(12)). + -- The Ghost policy in effect at the point of an ignored abstract state + -- cannot be check (SPARK RM 6.9(20)). + + if Is_Ignored_Ghost_Entity (State_Id) + and then Is_Checked_Ghost_Entity (Constit_Id) + then + SPARK_Msg_N (Ghost_Policy_Error_Msg, State); + Error_Msg_Sloc := Sloc (State_Id); + SPARK_Msg_NE + ("\abstract state & declared # with ghost policy `Ignore`", + State, State_Id); + Error_Msg_Sloc := Sloc (Constit_Id); + SPARK_Msg_NE + ("\constituent & declared # with ghost policy `Check`", + State, Constit_Id); + end if; + + State_Level := Ghost_Assertion_Level (State_Id); + Constit_Level := Ghost_Assertion_Level (Constit_Id); + + if not Is_Assertion_Level_Dependent (Constit_Level, State_Level) then + SPARK_Msg_N (Assertion_Level_Error_Msg, State); + Error_Msg_Name_1 := Chars (State_Level); + Error_Msg_Sloc := Sloc (State_Id); + SPARK_Msg_NE ("\abstract state & declared # with %", State, State_Id); + Error_Msg_Name_1 := Chars (Constit_Level); + Error_Msg_Sloc := Sloc (Constit_Id); + SPARK_Msg_NE ("\constituent & declared # with %", State, Constit_Id); + Error_Msg_Name_1 := Chars (State_Level); + SPARK_Msg_NE + ("\assertion level of & should depend on %", State, Constit_Id); - else - SPARK_Msg_NE - ("constituent of ghost state & must be ghost", - Constit, State_Id); - end if; end if; end Check_Ghost_Refinement; @@ -1059,14 +1428,14 @@ package body Ghost is Conc_Typ := Typ; end if; - -- A Ghost type cannot be concurrent (SPARK RM 6.9(21)). Verify this + -- A Ghost type cannot be concurrent (SPARK RM 6.9(22)). Verify this -- legality rule first to give a finer-grained diagnostic. if Present (Conc_Typ) then Error_Msg_N ("ghost type & cannot be concurrent", Conc_Typ); end if; - -- A Ghost type cannot be effectively volatile (SPARK RM 6.9(7)) + -- A Ghost type cannot be effectively volatile (SPARK RM 6.9(9)) if Is_Effectively_Volatile (Full_Typ) then Error_Msg_N ("ghost type & cannot be volatile", Full_Typ); @@ -1074,6 +1443,141 @@ package body Ghost is end if; end Check_Ghost_Type; + ---------------------- + -- Get_Ghost_Aspect -- + ---------------------- + + function Get_Ghost_Aspect (N : Node_Id) return Node_Id is + Asp : Node_Id; + begin + if not Permits_Aspect_Specifications (N) then + return Empty; + end if; + + Asp := First (Aspect_Specifications (N)); + while Present (Asp) loop + if Chars (Identifier (Asp)) = Name_Ghost then + return Asp; + end if; + + Next (Asp); + end loop; + + return Empty; + end Get_Ghost_Aspect; + + ---------------------- + -- Get_Ghost_Pragma -- + ---------------------- + + function Get_Ghost_Pragma (N : Node_Id) return Node_Id is + Decl : Node_Id := Empty; + begin + -- When the context is a [generic] package declaration, pragma Ghost + -- resides in the visible declarations. + + if Nkind (N) in N_Generic_Package_Declaration | N_Package_Declaration + then + Decl := First (Visible_Declarations (Specification (N))); + + -- When the context is a package or a subprogram body, pragma Ghost + -- resides in the declarative part. + + elsif Nkind (N) in N_Package_Body | N_Subprogram_Body then + Decl := First (Declarations (N)); + + -- Otherwise pragma Ghost appears in the declarations following N + + elsif Is_List_Member (N) then + Decl := Next (N); + end if; + + while Present (Decl) loop + if Nkind (Decl) = N_Pragma + and then Pragma_Name (Decl) = Name_Ghost + then + return Decl; + + -- A source construct ends the region where pragma Ghost may appear, + -- stop the traversal. Check the original node as source constructs + -- may be rewritten into something else by expansion. + + elsif Comes_From_Source (Original_Node (Decl)) then + exit; + end if; + + Next (Decl); + end loop; + + return Empty; + end Get_Ghost_Pragma; + + ------------------------------- + -- Get_Ghost_Assertion_Level -- + ------------------------------- + + function Get_Ghost_Assertion_Level (N : Node_Id) return Entity_Id is + Ghost_Asp : constant Node_Id := Get_Ghost_Aspect (N); + Ghost_Prag : Node_Id; + + begin + if Present (Ghost_Asp) then + return Assertion_Level_From_Arg (Expression (Ghost_Asp)); + end if; + + Ghost_Prag := Get_Ghost_Pragma (N); + if Present (Ghost_Prag) then + return + Assertion_Level_From_Arg + (First (Pragma_Argument_Associations (Ghost_Prag))); + end if; + + return Empty; + end Get_Ghost_Assertion_Level; + + ------------------------------------- + -- Ghost_Assertion_Level_In_Effect -- + ------------------------------------- + + function Ghost_Assertion_Level_In_Effect (Id : Entity_Id) return Entity_Id + is + begin + if Ghost_Config.Is_Inside_Statement_Or_Pragma + and then Is_Implicit_Ghost (Id) + then + return Ghost_Config.Ghost_Mode_Assertion_Level; + else + return Ghost_Assertion_Level (Id); + end if; + end Ghost_Assertion_Level_In_Effect; + + ---------------------------- + -- Ghost_Policy_In_Effect -- + ---------------------------- + + function Ghost_Policy_In_Effect (Id : Entity_Id) return Name_Id is + Level : constant Entity_Id := Ghost_Assertion_Level (Id); + Level_Nam : constant Name_Id := + (if No (Level) then No_Name else Chars (Level)); + begin + if Ghost_Config.Is_Inside_Statement_Or_Pragma + and then Is_Implicit_Ghost (Id) + then + case Ghost_Config.Ghost_Mode is + when Check => + return Name_Check; + + when Ignore => + return Name_Ignore; + + when None => + return No_Name; + end case; + else + return Policy_In_Effect (Name_Ghost, Level_Nam); + end if; + end Ghost_Policy_In_Effect; + -------------------------------- -- Implements_Ghost_Interface -- -------------------------------- @@ -1112,20 +1616,15 @@ package body Ghost is Set_Ignored_Ghost_Recording_Proc (Record_Ignored_Ghost_Node'Access); end Initialize; - ------------------------ - -- Install_Ghost_Mode -- - ------------------------ - - procedure Install_Ghost_Mode (Mode : Ghost_Mode_Type) is - begin - Install_Ghost_Region (Mode, Empty); - end Install_Ghost_Mode; - -------------------------- -- Install_Ghost_Region -- -------------------------- - procedure Install_Ghost_Region (Mode : Ghost_Mode_Type; N : Node_Id) is + procedure Install_Ghost_Region + (Mode : Ghost_Mode_Type; + N : Node_Id; + Level : Entity_Id) + is begin -- The context is already within an ignored Ghost region. Maintain the -- start of the outermost ignored Ghost region. @@ -1145,14 +1644,39 @@ package body Ghost is Ghost_Config.Ignored_Ghost_Region := Empty; end if; + Ghost_Config.Current_Region := N; Ghost_Config.Ghost_Mode := Mode; + Ghost_Config.Ghost_Mode_Assertion_Level := Level; + + if Nkind (Ghost_Config.Current_Region) + in N_Statement_Other_Than_Procedure_Call + | N_Procedure_Call_Statement + | N_Pragma + then + Ghost_Config.Is_Inside_Statement_Or_Pragma := True; + end if; end Install_Ghost_Region; - procedure Install_Ghost_Region (Mode : Name_Id; N : Node_Id) is + procedure Install_Ghost_Region + (Mode : Name_Id; N : Node_Id; Level : Entity_Id) is begin - Install_Ghost_Region (Name_To_Ghost_Mode (Mode), N); + Install_Ghost_Region (Name_To_Ghost_Mode (Mode), N, Level); end Install_Ghost_Region; + ------------------------- + -- Is_Compatible_Level -- + ------------------------- + + function Is_Assertion_Level_Dependent + (Self : Entity_Id; Other : Entity_Id) return Boolean is + begin + return + Self = Standard_Level_Default + or else Other = Standard_Level_Default + or else Is_Same_Or_Depends_On_Level (Self, Other) + or else Is_Same_Or_Depends_On_Level (Self, Standard_Level_Static); + end Is_Assertion_Level_Dependent; + ------------------------- -- Is_Ghost_Assignment -- ------------------------- @@ -1262,7 +1786,7 @@ package body Ghost is return Nkind (N) = N_Compilation_Unit - and then Is_Ignored_Ghost_Entity + and then Is_Ignored_Ghost_Entity_In_Codegen (Defining_Entity (Ultimate_Original_Node (Unit (N)))); end Is_Ignored_Ghost_Unit; @@ -1279,37 +1803,18 @@ package body Ghost is ----------------------- function Enables_Ghostness (Arg : Node_Id) return Boolean is - Expr : Node_Id; - begin - Expr := Arg; - - if Nkind (Expr) = N_Pragma_Argument_Association then - Expr := Get_Pragma_Arg (Expr); - end if; - - -- Determine whether the expression of the aspect or pragma is static - -- and denotes True. - - if Present (Expr) then - Preanalyze_And_Resolve (Expr); + -- Ghostness is enabled if the argument implies a default assertion + -- level or it is explicitly a reference to an assertion level. - return - Is_OK_Static_Expression (Expr) - and then Is_True (Expr_Value (Expr)); - - -- Otherwise Ghost defaults to True - - else - return True; - end if; + return Present (Assertion_Level_From_Arg (Arg)); end Enables_Ghostness; -- Local variables Id : constant Entity_Id := Defining_Entity (N); Asp : Node_Id; - Decl : Node_Id; + Prag : Node_Id; Prev_Id : Entity_Id; -- Start of processing for Is_Subject_To_Ghost @@ -1342,56 +1847,21 @@ package body Ghost is -- Examine the aspect specifications (if any) looking for aspect Ghost - if Permits_Aspect_Specifications (N) then - Asp := First (Aspect_Specifications (N)); - while Present (Asp) loop - if Chars (Identifier (Asp)) = Name_Ghost then - return Enables_Ghostness (Expression (Asp)); - end if; + Asp := Get_Ghost_Aspect (N); - Next (Asp); - end loop; + if Present (Asp) then + return Enables_Ghostness (Expression (Asp)); end if; - Decl := Empty; + -- Examine the following pragmas for an applicable Ghost pragma - -- When the context is a [generic] package declaration, pragma Ghost - -- resides in the visible declarations. - - if Nkind (N) in N_Generic_Package_Declaration | N_Package_Declaration - then - Decl := First (Visible_Declarations (Specification (N))); + Prag := Get_Ghost_Pragma (N); - -- When the context is a package or a subprogram body, pragma Ghost - -- resides in the declarative part. - - elsif Nkind (N) in N_Package_Body | N_Subprogram_Body then - Decl := First (Declarations (N)); - - -- Otherwise pragma Ghost appears in the declarations following N - - elsif Is_List_Member (N) then - Decl := Next (N); + if Present (Prag) then + return + Enables_Ghostness (First (Pragma_Argument_Associations (Prag))); end if; - while Present (Decl) loop - if Nkind (Decl) = N_Pragma - and then Pragma_Name (Decl) = Name_Ghost - then - return - Enables_Ghostness (First (Pragma_Argument_Associations (Decl))); - - -- A source construct ends the region where pragma Ghost may appear, - -- stop the traversal. Check the original node as source constructs - -- may be rewritten into something else by expansion. - - elsif Comes_From_Source (Original_Node (Decl)) then - exit; - end if; - - Next (Decl); - end loop; - return False; end Is_Subject_To_Ghost; @@ -1416,99 +1886,136 @@ package body Ghost is -- where P is a package, X is a record, and Comp is an array, we need -- to check the ghost flags of X. - Orig_Lhs : constant Node_Id := Name (N); - begin - -- Ghost assignments are irrelevant when the expander is inactive, and - -- processing them in that mode can lead to spurious errors. + procedure Check_Assignment_Policies (Assignee : Entity_Id); + -- Check that: + -- * A checked ghost assignment is not used in an ignored ghost + -- region. + -- * The level of the ghost region depends on the level of the + -- ghost assignment. - if Expander_Active then - -- Cases where full analysis is needed, involving array indexing - -- which would otherwise be missing array-bounds checks: + ------------------------------- + -- Check_Assignment_Policies -- + ------------------------------- - if not Analyzed (Orig_Lhs) - and then - ((Nkind (Orig_Lhs) = N_Indexed_Component - and then Nkind (Prefix (Orig_Lhs)) = N_Selected_Component - and then Nkind (Prefix (Prefix (Orig_Lhs))) = - N_Indexed_Component) - or else - (Nkind (Orig_Lhs) = N_Selected_Component - and then Nkind (Prefix (Orig_Lhs)) = N_Indexed_Component - and then Nkind (Prefix (Prefix (Orig_Lhs))) = - N_Selected_Component - and then Nkind (Parent (N)) /= N_Loop_Statement)) + procedure Check_Assignment_Policies (Assignee : Entity_Id) is + Assignee_Policy : constant Name_Id := + Ghost_Policy_In_Effect (Assignee); + Assignee_Level : constant Entity_Id := + Ghost_Assertion_Level (Assignee); + Region_Policy : constant Ghost_Mode_Type := Ghost_Config.Ghost_Mode; + Region_Level : constant Entity_Id := + Ghost_Config.Ghost_Mode_Assertion_Level; + begin + if Assignee_Policy = Name_Check and then Region_Policy = Ignore then + Error_Msg_N (Ghost_Policy_Error_Msg, N); + Error_Msg_NE ("\& has ghost policy `Check`", N, Assignee); + Error_Msg_NE + ("\& is modified in a region with `Ignore`", N, Assignee); + end if; + + -- If an assignment to a part of a ghost variable occurs in a ghost + -- entity, then the variable should be assertion-level-dependent on + -- this entity (SPARK RM 6.9(18)). + + if Present (Region_Level) + and then not Is_Assertion_Level_Dependent + (Assignee_Level, Region_Level) then - Analyze (Orig_Lhs); + Error_Msg_N (Assertion_Level_Error_Msg, N); + Error_Msg_Name_1 := Chars (Assignee_Level); + Error_Msg_NE ("\& has assertion level %", N, Assignee); + Error_Msg_Name_1 := Chars (Region_Level); + Error_Msg_NE + ("\& is modified within a region with %", N, Assignee); + Error_Msg_Name_1 := Chars (Region_Level); + Error_Msg_NE + ("\assertion level of & should depend on %", N, Assignee); end if; + end Check_Assignment_Policies; - -- Make sure Lhs is at least preanalyzed, so we can tell whether - -- it denotes a ghost variable. In some cases we need to do a full - -- analysis, or else the back end gets confused. Note that in the - -- preanalysis case, we are preanalyzing a copy of the left-hand - -- side name, temporarily attached to the tree. + -- Local variables - declare - Lhs : constant Node_Id := - (if Analyzed (Orig_Lhs) then Orig_Lhs - else New_Copy_Tree (Orig_Lhs)); - begin - if not Analyzed (Lhs) then - Set_Name (N, Lhs); - Set_Parent (Lhs, N); - Preanalyze_Without_Errors (Lhs); - Set_Name (N, Orig_Lhs); - end if; + Orig_Lhs : constant Node_Id := Name (N); + Id : Entity_Id; + Lhs : Node_Id; - declare - Id : constant Entity_Id := Get_Enclosing_Ghost_Entity (Lhs); - begin - if Present (Id) then - -- Left-hand side denotes a Checked ghost entity, so install - -- the region. + -- Start of processing for Mark_And_Set_Ghost_Assignment + + begin + -- Cases where full analysis is needed, involving array indexing + -- which would otherwise be missing array-bounds checks: - if Is_Checked_Ghost_Entity (Id) then - Install_Ghost_Region (Check, N); + if not Analyzed (Orig_Lhs) + and then + ((Nkind (Orig_Lhs) = N_Indexed_Component + and then Nkind (Prefix (Orig_Lhs)) = N_Selected_Component + and then Nkind (Prefix (Prefix (Orig_Lhs))) = + N_Indexed_Component) + or else + (Nkind (Orig_Lhs) = N_Selected_Component + and then Nkind (Prefix (Orig_Lhs)) = N_Indexed_Component + and then Nkind (Prefix (Prefix (Orig_Lhs))) = + N_Selected_Component + and then Nkind (Parent (N)) /= N_Loop_Statement)) + then + Analyze (Orig_Lhs); + end if; - -- Left-hand side denotes an Ignored ghost entity, so - -- install the region, and mark the assignment statement as - -- an ignored ghost assignment, so it will be removed later. + -- Make sure Lhs is at least preanalyzed, so we can tell whether + -- it denotes a ghost variable. In some cases we need to do a full + -- analysis, or else the back end gets confused. Note that in the + -- preanalysis case, we are preanalyzing a copy of the left-hand + -- side name, temporarily attached to the tree. + + Lhs := + (if Analyzed (Orig_Lhs) then Orig_Lhs else New_Copy_Tree (Orig_Lhs)); + if not Analyzed (Lhs) then + Set_Name (N, Lhs); + Set_Parent (Lhs, N); + Preanalyze_Without_Errors (Lhs); + Set_Name (N, Orig_Lhs); + end if; - elsif Is_Ignored_Ghost_Entity (Id) then - Install_Ghost_Region (Ignore, N); - Set_Is_Ignored_Ghost_Node (N); - Record_Ignored_Ghost_Node (N); - end if; - end if; - end; - end; + Id := Get_Enclosing_Ghost_Entity (Lhs); + + if Present (Id) and then Is_Ghost_Entity (Id) then + Check_Assignment_Policies (Id); end if; + + Mark_And_Set_Ghost_Region (N, Id); end Mark_And_Set_Ghost_Assignment; ----------------------------- -- Mark_And_Set_Ghost_Body -- ----------------------------- - procedure Mark_And_Set_Ghost_Body - (N : Node_Id; - Spec_Id : Entity_Id) - is + procedure Mark_And_Set_Ghost_Body (N : Node_Id; Spec_Id : Entity_Id) is Body_Id : constant Entity_Id := Defining_Entity (N); + Level : Entity_Id := Empty; Policy : Name_Id := No_Name; begin -- A body becomes Ghost when it is subject to aspect or pragma Ghost if Is_Subject_To_Ghost (N) then - Policy := Policy_In_Effect (Name_Ghost); + if Present (Spec_Id) then + Policy := Ghost_Policy_In_Effect (Spec_Id); + Level := Ghost_Assertion_Level_In_Effect (Spec_Id); + else + Policy := Ghost_Policy_In_Effect (Body_Id); + Level := Ghost_Assertion_Level_In_Effect (Body_Id); + end if; -- A body declared within a Ghost region is automatically Ghost -- (SPARK RM 6.9(2)). elsif Ghost_Config.Ghost_Mode = Check then Policy := Name_Check; + Level := Ghost_Config.Ghost_Mode_Assertion_Level; elsif Ghost_Config.Ghost_Mode = Ignore then Policy := Name_Ignore; + Level := Ghost_Config.Ghost_Mode_Assertion_Level; -- Inherit the "ghostness" of the previous declaration when the body -- acts as a completion. @@ -1520,22 +2027,22 @@ package body Ghost is elsif Is_Ignored_Ghost_Entity (Spec_Id) then Policy := Name_Ignore; end if; + + Level := Ghost_Assertion_Level (Spec_Id); end if; -- The Ghost policy in effect at the point of declaration and at the - -- point of completion must match (SPARK RM 6.9(16)). + -- point of completion must match (SPARK RM 6.9(18)). - Check_Ghost_Completion - (Prev_Id => Spec_Id, - Compl_Id => Body_Id); + Check_Ghost_Completion (Prev_Id => Spec_Id, Compl_Id => Body_Id); -- Mark the body as its formals as Ghost - Mark_Ghost_Declaration_Or_Body (N, Policy); + Mark_Ghost_Declaration_Or_Body (N, Policy, Level); -- Install the appropriate Ghost region - Install_Ghost_Region (Policy, N); + Install_Ghost_Region (Policy, N, Level); end Mark_And_Set_Ghost_Body; ----------------------------------- @@ -1547,6 +2054,7 @@ package body Ghost is Prev_Id : Entity_Id) is Compl_Id : constant Entity_Id := Defining_Entity (N); + Level : Entity_Id := Empty; Policy : Name_Id := No_Name; begin @@ -1555,22 +2063,26 @@ package body Ghost is if Ghost_Config.Ghost_Mode = Check then Policy := Name_Check; + Level := Ghost_Config.Ghost_Mode_Assertion_Level; elsif Ghost_Config.Ghost_Mode = Ignore then Policy := Name_Ignore; + Level := Ghost_Config.Ghost_Mode_Assertion_Level; -- The completion becomes Ghost when its initial declaration is also -- Ghost. elsif Is_Checked_Ghost_Entity (Prev_Id) then Policy := Name_Check; + Level := Ghost_Assertion_Level (Prev_Id); elsif Is_Ignored_Ghost_Entity (Prev_Id) then Policy := Name_Ignore; + Level := Ghost_Assertion_Level (Prev_Id); end if; -- The Ghost policy in effect at the point of declaration and at the - -- point of completion must match (SPARK RM 6.9(16)). + -- point of completion must match (SPARK RM 6.9(18)). Check_Ghost_Completion (Prev_Id => Prev_Id, @@ -1578,11 +2090,11 @@ package body Ghost is -- Mark the completion as Ghost - Mark_Ghost_Declaration_Or_Body (N, Policy); + Mark_Ghost_Declaration_Or_Body (N, Policy, Level); -- Install the appropriate Ghost region - Install_Ghost_Region (Policy, N); + Install_Ghost_Region (Policy, N, Level); end Mark_And_Set_Ghost_Completion; ------------------------------------ @@ -1590,6 +2102,7 @@ package body Ghost is ------------------------------------ procedure Mark_And_Set_Ghost_Declaration (N : Node_Id) is + Level : Entity_Id := Empty; Par_Id : Entity_Id; Policy : Name_Id := No_Name; @@ -1597,30 +2110,41 @@ package body Ghost is -- A declaration becomes Ghost when it is subject to aspect or pragma -- Ghost. - if Is_Subject_To_Ghost (N) then - Policy := Policy_In_Effect (Name_Ghost); + Level := Get_Ghost_Assertion_Level (N); + + -- A valid assertion level from an explicit pragma or aspect ghost + -- indicates the explicit ghostlyness of the declaration. Otherwise the + -- ghostliness of the declaration should be handled by other means like + -- the region. + + if Present (Level) then + Policy := + Policy_In_Effect (Name_Ghost, Assertion_Level_To_Name (Level)); -- A declaration elaborated in a Ghost region is automatically Ghost -- (SPARK RM 6.9(2)). elsif Ghost_Config.Ghost_Mode = Check then Policy := Name_Check; + Level := Ghost_Config.Ghost_Mode_Assertion_Level; elsif Ghost_Config.Ghost_Mode = Ignore then Policy := Name_Ignore; + Level := Ghost_Config.Ghost_Mode_Assertion_Level; -- A child package or subprogram declaration becomes Ghost when its -- parent is Ghost (SPARK RM 6.9(2)). - elsif Nkind (N) in N_Generic_Function_Renaming_Declaration - | N_Generic_Package_Declaration - | N_Generic_Package_Renaming_Declaration - | N_Generic_Procedure_Renaming_Declaration - | N_Generic_Subprogram_Declaration - | N_Package_Declaration - | N_Package_Renaming_Declaration - | N_Subprogram_Declaration - | N_Subprogram_Renaming_Declaration + elsif Nkind (N) + in N_Generic_Function_Renaming_Declaration + | N_Generic_Package_Declaration + | N_Generic_Package_Renaming_Declaration + | N_Generic_Procedure_Renaming_Declaration + | N_Generic_Subprogram_Declaration + | N_Package_Declaration + | N_Package_Renaming_Declaration + | N_Subprogram_Declaration + | N_Subprogram_Renaming_Declaration and then Present (Parent_Spec (N)) then Par_Id := Defining_Entity (Unit (Parent_Spec (N))); @@ -1631,15 +2155,19 @@ package body Ghost is elsif Is_Ignored_Ghost_Entity (Par_Id) then Policy := Name_Ignore; end if; + + Level := Ghost_Assertion_Level (Par_Id); end if; -- Mark the declaration and its formals as Ghost - Mark_Ghost_Declaration_Or_Body (N, Policy); + Mark_Ghost_Declaration_Or_Body (N, Policy, Level); + + Check_Valid_Ghost_Declaration (N); -- Install the appropriate Ghost region - Install_Ghost_Region (Policy, N); + Install_Ghost_Region (Policy, N, Level); end Mark_And_Set_Ghost_Declaration; -------------------------------------- @@ -1687,43 +2215,46 @@ package body Ghost is -- Local variables + Level : Entity_Id := Empty; Policy : Name_Id := No_Name; begin -- An instantiation becomes Ghost when it is subject to pragma Ghost if Is_Subject_To_Ghost (N) then - Policy := Policy_In_Effect (Name_Ghost); + Policy := Ghost_Policy_In_Effect (Gen_Id); -- An instantiation declaration within a Ghost region is automatically -- Ghost (SPARK RM 6.9(2)). elsif Ghost_Config.Ghost_Mode = Check then Policy := Name_Check; + Level := Ghost_Config.Ghost_Mode_Assertion_Level; elsif Ghost_Config.Ghost_Mode = Ignore then Policy := Name_Ignore; + Level := Ghost_Config.Ghost_Mode_Assertion_Level; -- Inherit the "ghostness" of the generic unit, but the current Ghost -- policy is the relevant one for the instantiation. - elsif Is_Checked_Ghost_Entity (Gen_Id) - or else Is_Ignored_Ghost_Entity (Gen_Id) - then - Policy := Policy_In_Effect (Name_Ghost); + elsif Is_Ghost_Entity (Gen_Id) then + Policy := Ghost_Policy_In_Effect (Gen_Id); if Policy = No_Name then Policy := Name_Ignore; end if; + + Level := Ghost_Assertion_Level (Gen_Id); end if; -- Mark the instantiation as Ghost - Mark_Ghost_Declaration_Or_Body (N, Policy); + Mark_Ghost_Declaration_Or_Body (N, Policy, Level); -- Install the appropriate Ghost region - Install_Ghost_Region (Policy, N); + Install_Ghost_Region (Policy, N, Level); -- Check Ghost actuals. Given that this routine is unconditionally -- invoked with subprogram and package instantiations, this check @@ -1739,25 +2270,39 @@ package body Ghost is procedure Mark_And_Set_Ghost_Procedure_Call (N : Node_Id) is Id : Entity_Id; - begin -- A procedure call becomes Ghost when the procedure being invoked is -- Ghost. Install the Ghost mode of the procedure. Id := Get_Enclosing_Ghost_Entity (Name (N)); - if Present (Id) then - if Is_Checked_Ghost_Entity (Id) then - Install_Ghost_Region (Check, N); + Mark_And_Set_Ghost_Region (N, Id); + end Mark_And_Set_Ghost_Procedure_Call; - elsif Is_Ignored_Ghost_Entity (Id) then - Install_Ghost_Region (Ignore, N); + ------------------------------- + -- Mark_And_Set_Ghost_Region -- + ------------------------------- - Set_Is_Ignored_Ghost_Node (N); - Record_Ignored_Ghost_Node (N); - end if; + procedure Mark_And_Set_Ghost_Region (N : Node_Id; Id : Entity_Id) is + Id_Policy : Name_Id; + begin + -- Nothing to do if we are not dealing with a ghost entity + + if No (Id) or else not Is_Ghost_Entity (Id) then + return; end if; - end Mark_And_Set_Ghost_Procedure_Call; + + Id_Policy := Ghost_Policy_In_Effect (Id); + + if Id_Policy = Name_Check then + Install_Ghost_Region (Check, N, Ghost_Assertion_Level (Id)); + + elsif Id_Policy = Name_Ignore then + Install_Ghost_Region (Ignore, N, Ghost_Assertion_Level (Id)); + Set_Is_Ignored_Ghost_Node (N); + Record_Ignored_Ghost_Node (N); + end if; + end Mark_And_Set_Ghost_Region; ----------------------- -- Mark_Ghost_Clause -- @@ -1780,7 +2325,7 @@ package body Ghost is if Present (Nam) and then Is_Entity_Name (Nam) and then Present (Entity (Nam)) - and then Is_Ignored_Ghost_Entity (Entity (Nam)) + and then Is_Ignored_Ghost_Entity_In_Codegen (Entity (Nam)) then Set_Is_Ignored_Ghost_Node (N); Record_Ignored_Ghost_Node (N); @@ -1792,8 +2337,9 @@ package body Ghost is ------------------------------------ procedure Mark_Ghost_Declaration_Or_Body - (N : Node_Id; - Mode : Name_Id) + (N : Node_Id; + Mode : Name_Id; + Level : Entity_Id) is Id : constant Entity_Id := Defining_Entity (N); @@ -1801,16 +2347,45 @@ package body Ghost is Param : Node_Id; Param_Id : Entity_Id; + procedure Mark_And_Set_Is_Checked_Ghost_Entity (E : Entity_Id); + -- Sets Is_Checked_Ghost_Entity, unsets Is_Ignored_Ghost_Entity + + procedure Mark_And_Set_Is_Ignored_Ghost_Entity (E : Entity_Id); + -- Sets Is_Ignored_Ghost_Entity, unsets Is_Checked_Ghost_Entity + + ------------------------------------------ + -- Mark_And_Set_Is_Checked_Ghost_Entity -- + ------------------------------------------ + + procedure Mark_And_Set_Is_Checked_Ghost_Entity (E : Entity_Id) is + begin + Set_Is_Checked_Ghost_Entity (E, True); + Set_Is_Ignored_Ghost_Entity (E, False); + end Mark_And_Set_Is_Checked_Ghost_Entity; + + ------------------------------------------ + -- Mark_And_Set_Is_Ignored_Ghost_Entity -- + ------------------------------------------ + + procedure Mark_And_Set_Is_Ignored_Ghost_Entity (E : Entity_Id) is + begin + Set_Is_Checked_Ghost_Entity (E, False); + Set_Is_Ignored_Ghost_Entity (E, True); + end Mark_And_Set_Is_Ignored_Ghost_Entity; + + -- Start of processing for Mark_Ghost_Declaration_Or_Body + begin - -- Mark the related node and its entity + Set_Ghost_Assertion_Level (Id, Level); if Mode = Name_Check then Mark_Formals := True; - Set_Is_Checked_Ghost_Entity (Id); + Mark_And_Set_Is_Checked_Ghost_Entity (Id); elsif Mode = Name_Ignore then Mark_Formals := True; - Set_Is_Ignored_Ghost_Entity (Id); + Mark_And_Set_Is_Ignored_Ghost_Entity (Id); + Set_Is_Ignored_Ghost_Node (N); Record_Ignored_Ghost_Node (N); end if; @@ -1835,11 +2410,13 @@ package body Ghost is while Present (Param) loop Param_Id := Defining_Entity (Param); + Set_Ghost_Assertion_Level (Param_Id, Level); + if Mode = Name_Check then - Set_Is_Checked_Ghost_Entity (Param_Id); + Mark_And_Set_Is_Checked_Ghost_Entity (Param_Id); elsif Mode = Name_Ignore then - Set_Is_Ignored_Ghost_Entity (Param_Id); + Mark_And_Set_Is_Ignored_Ghost_Entity (Param_Id); end if; Next (Param); @@ -1867,16 +2444,15 @@ package body Ghost is end if; end Mark_Ghost_Pragma; - procedure Mark_Ghost_Pragma - (N : Node_Id; - Mode : Ghost_Mode_Type) - is + procedure Mark_Ghost_Pragma (N : Node_Id; Mode : Ghost_Mode_Type) is begin if Mode = Check then - Set_Is_Checked_Ghost_Pragma (N); + Set_Is_Checked_Ghost_Pragma (N, True); + Set_Is_Ignored_Ghost_Pragma (N, False); else - Set_Is_Ignored_Ghost_Pragma (N); + Set_Is_Checked_Ghost_Pragma (N, False); + Set_Is_Ignored_Ghost_Pragma (N, True); Set_Is_Ignored_Ghost_Node (N); Record_Ignored_Ghost_Node (N); end if; @@ -1886,12 +2462,9 @@ package body Ghost is -- Mark_Ghost_Renaming -- ------------------------- - procedure Mark_Ghost_Renaming - (N : Node_Id; - Id : Entity_Id) - is + procedure Mark_Ghost_Renaming (N : Node_Id; Id : Entity_Id) is Policy : Name_Id := No_Name; - + Level : constant Entity_Id := Ghost_Assertion_Level (Id); begin -- A renaming becomes Ghost when it renames a Ghost entity @@ -1902,7 +2475,7 @@ package body Ghost is Policy := Name_Ignore; end if; - Mark_Ghost_Declaration_Or_Body (N, Policy); + Mark_Ghost_Declaration_Or_Body (N, Policy, Level); end Mark_Ghost_Renaming; ------------------------ @@ -2036,19 +2609,21 @@ package body Ghost is -------------------------------- procedure Set_Ghost_Mode_From_Entity (Id : Entity_Id) is + Level : constant Entity_Id := Ghost_Assertion_Level (Id); begin if Is_Checked_Ghost_Entity (Id) then - Install_Ghost_Mode (Check); + Install_Ghost_Region (Check, N, Level); elsif Is_Ignored_Ghost_Entity (Id) then - Install_Ghost_Mode (Ignore); + Install_Ghost_Region (Ignore, N, Level); else - Install_Ghost_Mode (None); + Install_Ghost_Region (None, N, Level); end if; end Set_Ghost_Mode_From_Entity; -- Local variables - Id : Entity_Id; + Id : Entity_Id; + Level : Entity_Id; -- Start of processing for Set_Ghost_Mode @@ -2084,12 +2659,27 @@ package body Ghost is -- property is encoded in the pragma itself. elsif Nkind (N) = N_Pragma then + Level := Pragma_Ghost_Assertion_Level (N); + if Is_Checked_Ghost_Pragma (N) then - Install_Ghost_Mode (Check); + + -- Still install an ignored ghost region if the pragma is attached + -- to a checked ghost entity, but the pragma itself is explicitly + -- ignored. + + if Is_Ignored (N) then + Install_Ghost_Region (Ignore, N, Level); + else + Install_Ghost_Region (Check, N, Level); + end if; elsif Is_Ignored_Ghost_Pragma (N) then - Install_Ghost_Mode (Ignore); + Install_Ghost_Region (Ignore, N, Level); else - Install_Ghost_Mode (None); + if Is_Checked (N) then + Install_Ghost_Region (Check, N, Level); + else + Install_Ghost_Region (None, N, Level); + end if; end if; -- The Ghost mode of a procedure call depends on the Ghost mode of the @@ -2109,7 +2699,7 @@ package body Ghost is ------------------------- procedure Set_Is_Ghost_Entity (Id : Entity_Id) is - Policy : constant Name_Id := Policy_In_Effect (Name_Ghost); + Policy : constant Name_Id := Ghost_Policy_In_Effect (Id); begin if Policy = Name_Check then Set_Is_Checked_Ghost_Entity (Id); diff --git a/gcc/ada/ghost.ads b/gcc/ada/ghost.ads index 62c809c8fd34..87401c16a66c 100644 --- a/gcc/ada/ghost.ads +++ b/gcc/ada/ghost.ads @@ -32,6 +32,16 @@ with Types; use Types; package Ghost is + function Assertion_Level_From_Arg (Arg : Node_Id) return Entity_Id; + -- Returns the assertion level for the given pragma or aspect based on + -- the argument Arg. Which is either + -- + -- * Standard_Level_Default if there was no argument or the argument + -- evaluated to True. + -- * Assertion_Level if the argument was referencing a user defined + -- Assertion_Level. + -- * Empty othrwise since we are not dealing with a ghost entity. + procedure Check_Ghost_Completion (Prev_Id : Entity_Id; Compl_Id : Entity_Id); @@ -49,7 +59,7 @@ package Ghost is (Actual : Node_Id; Formal : Entity_Id); -- Check that if Actual contains references to ghost entities, generic - -- formal parameter Formal is ghost (SPARK RM 6.9(10)). + -- formal parameter Formal is ghost (SPARK RM 6.9(13)). procedure Check_Ghost_Formal_Procedure_Or_Package (N : Node_Id; @@ -58,7 +68,7 @@ package Ghost is Is_Default : Boolean := False); -- Verify that if generic formal procedure (resp. package) Formal is ghost, -- then Actual is not Empty and also a ghost procedure (resp. package) - -- (SPARK RM 6.9(13-14)). The error if any is located on N. If + -- (SPARK RM 6.9(16-17)). The error if any is located on N. If -- Is_Default is False, N and Actual represent the actual parameter in an -- instantiation. Otherwise, they represent the default subprogram of a -- formal subprogram declaration. @@ -69,7 +79,7 @@ package Ghost is Is_Default : Boolean := False); -- Verify that if Formal (either an IN OUT generic formal parameter, or an -- IN generic formal parameter of access-to-variable type) is ghost, then - -- Actual is a ghost object (SPARK RM 6.9(13-14)). Is_Default is True when + -- Actual is a ghost object (SPARK RM 6.9(16-17)). Is_Default is True when -- Actual is the default expression of the formal object declaration. procedure Check_Ghost_Overriding @@ -90,7 +100,9 @@ package Ghost is Constit : Node_Id; Constit_Id : Entity_Id); -- Verify that the Ghost policy of constituent Constit_Id is compatible - -- with the Ghost policy of abstract state State_I. + -- with the Ghost policy of abstract state State_Id. + -- + -- Additionally verify that the Ghost_Assertion_Levels are compatible. procedure Check_Ghost_Type (Typ : Entity_Id); -- Verify that Ghost type Typ is neither concurrent, nor effectively @@ -102,11 +114,23 @@ package Ghost is procedure Initialize; -- Initialize internal tables - procedure Install_Ghost_Region (Mode : Ghost_Mode_Type; N : Node_Id); + procedure Install_Ghost_Region + (Mode : Ghost_Mode_Type; + N : Node_Id; + Level : Entity_Id); pragma Inline (Install_Ghost_Region); -- Install a Ghost region described by mode Mode and ignored region start -- node N. + function Is_Assertion_Level_Dependent + (Self : Entity_Id; Other : Entity_Id) return Boolean; + -- Check that assertion level Self is assertion-level-dependent with Other. + -- + -- According to SPARK RM 6.9(6) this means that + -- * Either Self or Other has the default assertion level. + -- * Self either is or depends on Other + -- * Self either is or depends on Static + function Is_Ghost_Assignment (N : Node_Id) return Boolean; -- Determine whether arbitrary node N denotes an assignment statement whose -- target is a Ghost entity. @@ -238,7 +262,7 @@ package Ghost is procedure Remove_Ignored_Ghost_Code; -- Remove all code marked as ignored Ghost from the trees of all qualifying - -- units (SPARK RM 6.9(4)). + -- units (SPARK RM 6.9(5)). -- -- WARNING: this is a separate front end pass, care should be taken to keep -- it optimized. diff --git a/gcc/ada/gnat1drv.adb b/gcc/ada/gnat1drv.adb index ee2c329aed7b..176f2e2a4a23 100644 --- a/gcc/ada/gnat1drv.adb +++ b/gcc/ada/gnat1drv.adb @@ -175,6 +175,12 @@ procedure Gnat1drv is Disable_ALI_File := True; end if; + -- -gnatd_o disables backend overflow checks on target; used for testing + + if Debug_Flag_Underscore_O then + Backend_Overflow_Checks_On_Target := False; + end if; + -- -gnatd.E sets Error_To_Warning mode, causing selected error messages -- to be treated as warnings instead of errors. diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index 5d7bedc67ee0..73515157f2f8 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -19,7 +19,7 @@ @copying @quotation -GNAT Reference Manual , Jul 24, 2025 +GNAT Reference Manual , Sep 29, 2025 AdaCore @@ -110,6 +110,7 @@ Implementation Defined Pragmas * Pragma Annotate:: * Pragma Assert:: * Pragma Assert_And_Cut:: +* Pragma Assertion_Level:: * Pragma Assertion_Policy:: * Pragma Assume:: * Pragma Assume_No_Invalid_Values:: @@ -323,6 +324,7 @@ Implementation Defined Aspects * Aspect Effective_Writes:: * Aspect Exceptional_Cases:: * Aspect Exit_Cases:: +* Aspect Extended_Access:: * Aspect Extensions_Visible:: * Aspect Favor_Top_Level:: * Aspect Ghost:: @@ -755,6 +757,7 @@ The GNAT Library * GNAT.Bubble_Sort_G (g-busorg.ads): GNAT Bubble_Sort_G g-busorg ads. * GNAT.Byte_Order_Mark (g-byorma.ads): GNAT Byte_Order_Mark g-byorma ads. * GNAT.Byte_Swapping (g-bytswa.ads): GNAT Byte_Swapping g-bytswa ads. +* GNAT.C_Time (g-c_time.ads): GNAT C_Time g-c_time ads. * GNAT.Calendar (g-calend.ads): GNAT Calendar g-calend ads. * GNAT.Calendar.Time_IO (g-catiio.ads): GNAT Calendar Time_IO g-catiio ads. * GNAT.CRC32 (g-crc32.ads): GNAT CRC32 g-crc32 ads. @@ -908,6 +911,7 @@ Curated Extensions * Constrained attribute for generic objects:: * Static aspect on intrinsic functions:: * First Controlling Parameter:: +* Generalized Finalization:: Deep delta Aggregates @@ -916,6 +920,12 @@ Deep delta Aggregates * Dynamic Semantics:: * Examples:: +Generalized Finalization + +* Finalizable tagged types:: +* Composite types:: +* Interoperability with controlled types:: + Experimental Language Extensions * Conditional when constructs:: @@ -925,13 +935,13 @@ Experimental Language Extensions * Simpler Accessibility Model:: * Case pattern matching:: * Mutably Tagged Types with Size’Class Aspect:: -* Generalized Finalization:: * No_Raise aspect:: * Inference of Dependent Types in Generic Instantiations:: * External_Initialization Aspect:: * Finally construct:: * Continue statement:: * Destructors:: +* Structural Generic Instantiation:: Storage Model @@ -945,18 +955,18 @@ Simpler Accessibility Model * Subprogram parameters:: * Function results:: -Generalized Finalization - -* Finalizable tagged types:: -* Composite types:: -* Interoperability with controlled types:: - Finally construct * Syntax: Syntax<2>. * Legality Rules: Legality Rules<2>. * Dynamic Semantics: Dynamic Semantics<2>. +Structural Generic Instantiation + +* Syntax: Syntax<3>. +* Legality Rules: Legality Rules<3>. +* Static Semantics:: + Security Hardening Features * Register Scrubbing:: @@ -967,6 +977,7 @@ Security Hardening Features Obsolescent Features +* PolyORB:: * pragma No_Run_Time:: * pragma Ravenscar:: * pragma Restricted_Run_Time:: @@ -1282,6 +1293,7 @@ consideration, the use of these pragmas should be minimized. * Pragma Annotate:: * Pragma Assert:: * Pragma Assert_And_Cut:: +* Pragma Assertion_Level:: * Pragma Assertion_Policy:: * Pragma Assume:: * Pragma Assume_No_Invalid_Values:: @@ -1865,9 +1877,8 @@ The analyzed pragma is retained in the tree, but not otherwise processed by any part of the GNAT compiler, except to generate corresponding note lines in the generated ALI file. For the format of these note lines, see the compiler source file lib-writ.ads. This pragma is intended for use by -external tools, including ASIS. The use of pragma Annotate does not -affect the compilation process in any way. This pragma may be used as -a configuration pragma. +external tools. The use of pragma Annotate does not affect the compilation +process in any way. This pragma may be used as a configuration pragma. @node Pragma Assert,Pragma Assert_And_Cut,Pragma Annotate,Implementation Defined Pragmas @anchor{gnat_rm/implementation_defined_pragmas pragma-assert}@anchor{2c} @@ -1935,7 +1946,11 @@ of Ada from 2005 on. In GNAT, it is implemented in all versions of Ada, and the DISABLE policy is an implementation-defined addition. -@node Pragma Assert_And_Cut,Pragma Assertion_Policy,Pragma Assert,Implementation Defined Pragmas +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + +@node Pragma Assert_And_Cut,Pragma Assertion_Level,Pragma Assert,Implementation Defined Pragmas @anchor{gnat_rm/implementation_defined_pragmas pragma-assert-and-cut}@anchor{2d} @section Pragma Assert_And_Cut @@ -1962,8 +1977,31 @@ a subprogram into sections for the purposes of testing or formal verification. The pragma also serves as useful documentation. -@node Pragma Assertion_Policy,Pragma Assume,Pragma Assert_And_Cut,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-assertion-policy}@anchor{2e} +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + +@node Pragma Assertion_Level,Pragma Assertion_Policy,Pragma Assert_And_Cut,Implementation Defined Pragmas +@anchor{gnat_rm/implementation_defined_pragmas pragma-assertion-level}@anchor{2e} +@section Pragma Assertion_Level + + +Syntax: + +@example +pragma Assertion_Level (LEVEL_IDENTIFIER + [, depends => DEPENDENCY_DESCRIPTOR]); + +DEPENDENCY_DESCRIPTOR ::= LEVEL_IDENTIFIER | LEVEL_IDENTIFIER_LIST + +LEVEL_IDENTIFIER_LIST ::= '[' LEVEL_IDENTIFIER @{, LEVEL_IDENTIFIER@} ']' +@end example + +For the semantics of this pragma, see the SPARK 2014 Reference Manual, +section 11.4.3. + +@node Pragma Assertion_Policy,Pragma Assume,Pragma Assertion_Level,Implementation Defined Pragmas +@anchor{gnat_rm/implementation_defined_pragmas pragma-assertion-policy}@anchor{2f} @section Pragma Assertion_Policy @@ -1976,7 +2014,7 @@ pragma Assertion_Policy ( ASSERTION_KIND => POLICY_IDENTIFIER @{, ASSERTION_KIND => POLICY_IDENTIFIER@}); -ASSERTION_KIND ::= RM_ASSERTION_KIND | ID_ASSERTION_KIND +ASSERTION_KIND ::= RM_ASSERTION_KIND | ID_ASSERTION_KIND | ASSERTION_LEVEL RM_ASSERTION_KIND ::= Assert | Static_Predicate | @@ -2016,6 +2054,10 @@ The assertion kinds @code{RM_ASSERTION_KIND} are those defined in the Ada standard. The assertion kinds @code{ID_ASSERTION_KIND} are implementation defined additions recognized by the GNAT compiler. +Additionally the pragma can apply to an assertion level defined by the +@code{Assertion_Level} pragma. For more details see the SPARK 2014 Reference +Manual, section 11.4.2. + The pragma applies in both cases to pragmas and aspects with matching names, e.g. @code{Pre} applies to the Pre aspect, and @code{Precondition} applies to both the @code{Precondition} pragma @@ -2050,7 +2092,7 @@ applies to @code{Assert}, @code{Assert_And_Cut}, @code{Assume}, @code{Loop_Invariant}, and @code{Loop_Variant}. @node Pragma Assume,Pragma Assume_No_Invalid_Values,Pragma Assertion_Policy,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-assume}@anchor{2f} +@anchor{gnat_rm/implementation_defined_pragmas pragma-assume}@anchor{30} @section Pragma Assume @@ -2083,8 +2125,12 @@ but it acts as a useful run-time check that the assumption is met, and documents the need to ensure that it is met by reference to information outside the program. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + @node Pragma Assume_No_Invalid_Values,Pragma Async_Readers,Pragma Assume,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-assume-no-invalid-values}@anchor{30} +@anchor{gnat_rm/implementation_defined_pragmas pragma-assume-no-invalid-values}@anchor{31} @section Pragma Assume_No_Invalid_Values @@ -2137,7 +2183,7 @@ is erroneous so there are no guarantees that this will always be the case, and it is recommended that these two options not be used together. @node Pragma Async_Readers,Pragma Async_Writers,Pragma Assume_No_Invalid_Values,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id5}@anchor{31}@anchor{gnat_rm/implementation_defined_pragmas pragma-async-readers}@anchor{32} +@anchor{gnat_rm/implementation_defined_pragmas id5}@anchor{32}@anchor{gnat_rm/implementation_defined_pragmas pragma-async-readers}@anchor{33} @section Pragma Async_Readers @@ -2151,7 +2197,7 @@ For the semantics of this pragma, see the entry for aspect @code{Async_Readers} the SPARK 2014 Reference Manual, section 7.1.2. @node Pragma Async_Writers,Pragma Attribute_Definition,Pragma Async_Readers,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id6}@anchor{33}@anchor{gnat_rm/implementation_defined_pragmas pragma-async-writers}@anchor{34} +@anchor{gnat_rm/implementation_defined_pragmas id6}@anchor{34}@anchor{gnat_rm/implementation_defined_pragmas pragma-async-writers}@anchor{35} @section Pragma Async_Writers @@ -2165,7 +2211,7 @@ For the semantics of this pragma, see the entry for aspect @code{Async_Writers} the SPARK 2014 Reference Manual, section 7.1.2. @node Pragma Attribute_Definition,Pragma C_Pass_By_Copy,Pragma Async_Writers,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-attribute-definition}@anchor{35} +@anchor{gnat_rm/implementation_defined_pragmas pragma-attribute-definition}@anchor{36} @section Pragma Attribute_Definition @@ -2191,7 +2237,7 @@ code to be written that takes advantage of some new attribute, while remaining compilable with earlier compilers. @node Pragma C_Pass_By_Copy,Pragma Check,Pragma Attribute_Definition,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-c-pass-by-copy}@anchor{36} +@anchor{gnat_rm/implementation_defined_pragmas pragma-c-pass-by-copy}@anchor{37} @section Pragma C_Pass_By_Copy @@ -2235,7 +2281,7 @@ You can also pass records by copy by specifying the convention passing mechanisms on a parameter by parameter basis. @node Pragma Check,Pragma Check_Float_Overflow,Pragma C_Pass_By_Copy,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-check}@anchor{37} +@anchor{gnat_rm/implementation_defined_pragmas pragma-check}@anchor{38} @section Pragma Check @@ -2274,7 +2320,7 @@ of these identifiers in @code{Assertion_Policy} and @code{Check_Policy} pragmas, where they are used to refer to sets of assertions. @node Pragma Check_Float_Overflow,Pragma Check_Name,Pragma Check,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-check-float-overflow}@anchor{38} +@anchor{gnat_rm/implementation_defined_pragmas pragma-check-float-overflow}@anchor{39} @section Pragma Check_Float_Overflow @@ -2330,7 +2376,7 @@ This mode can also be set by use of the compiler switch `-gnateF'. @node Pragma Check_Name,Pragma Check_Policy,Pragma Check_Float_Overflow,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-check-name}@anchor{39} +@anchor{gnat_rm/implementation_defined_pragmas pragma-check-name}@anchor{3a} @section Pragma Check_Name @@ -2366,7 +2412,7 @@ Check names introduced by this pragma are subject to control by compiler switches (in particular -gnatp) in the usual manner. @node Pragma Check_Policy,Pragma Comment,Pragma Check_Name,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-check-policy}@anchor{3a} +@anchor{gnat_rm/implementation_defined_pragmas pragma-check-policy}@anchor{3b} @section Pragma Check_Policy @@ -2446,7 +2492,7 @@ policy setting @code{DISABLE} causes the second argument of a corresponding @code{Check} pragma to be completely ignored and not analyzed. @node Pragma Comment,Pragma Common_Object,Pragma Check_Policy,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-comment}@anchor{3b} +@anchor{gnat_rm/implementation_defined_pragmas pragma-comment}@anchor{3c} @section Pragma Comment @@ -2465,7 +2511,7 @@ anywhere in the main source unit), and if more than one pragma is used, all comments are retained. @node Pragma Common_Object,Pragma Compile_Time_Error,Pragma Comment,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-common-object}@anchor{3c} +@anchor{gnat_rm/implementation_defined_pragmas pragma-common-object}@anchor{3d} @section Pragma Common_Object @@ -2497,7 +2543,7 @@ indicating that the necessary attribute for implementation of this pragma is not available. @node Pragma Compile_Time_Error,Pragma Compile_Time_Warning,Pragma Common_Object,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas compile-time-error}@anchor{3d}@anchor{gnat_rm/implementation_defined_pragmas pragma-compile-time-error}@anchor{3e} +@anchor{gnat_rm/implementation_defined_pragmas compile-time-error}@anchor{3e}@anchor{gnat_rm/implementation_defined_pragmas pragma-compile-time-error}@anchor{3f} @section Pragma Compile_Time_Error @@ -2524,7 +2570,7 @@ the value given as the second argument. This string value may contain embedded ASCII.LF characters to break the message into multiple lines. @node Pragma Compile_Time_Warning,Pragma Complete_Representation,Pragma Compile_Time_Error,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-compile-time-warning}@anchor{3f} +@anchor{gnat_rm/implementation_defined_pragmas pragma-compile-time-warning}@anchor{40} @section Pragma Compile_Time_Warning @@ -2551,11 +2597,11 @@ for example that it is not fully implemented. In previous versions of the compiler, combining `-gnatwe' with Compile_Time_Warning resulted in a fatal error. Now the compiler always emits -a warning. You can use @ref{3d,,Pragma Compile_Time_Error} to force the generation of +a warning. You can use @ref{3e,,Pragma Compile_Time_Error} to force the generation of an error. @node Pragma Complete_Representation,Pragma Complex_Representation,Pragma Compile_Time_Warning,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-complete-representation}@anchor{40} +@anchor{gnat_rm/implementation_defined_pragmas pragma-complete-representation}@anchor{41} @section Pragma Complete_Representation @@ -2574,7 +2620,7 @@ complete, and that this invariant is maintained if fields are added to the record in the future. @node Pragma Complex_Representation,Pragma Component_Alignment,Pragma Complete_Representation,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-complex-representation}@anchor{41} +@anchor{gnat_rm/implementation_defined_pragmas pragma-complex-representation}@anchor{42} @section Pragma Complex_Representation @@ -2596,7 +2642,7 @@ records by pointer, and the use of this pragma may result in passing this type in floating-point registers. @node Pragma Component_Alignment,Pragma Constant_After_Elaboration,Pragma Complex_Representation,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-component-alignment}@anchor{42} +@anchor{gnat_rm/implementation_defined_pragmas pragma-component-alignment}@anchor{43} @section Pragma Component_Alignment @@ -2687,7 +2733,7 @@ pragma @code{Pack}, pragma @code{Component_Alignment}, or a record rep clause), the GNAT uses the default alignment as described previously. @node Pragma Constant_After_Elaboration,Pragma Contract_Cases,Pragma Component_Alignment,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id7}@anchor{43}@anchor{gnat_rm/implementation_defined_pragmas pragma-constant-after-elaboration}@anchor{44} +@anchor{gnat_rm/implementation_defined_pragmas id7}@anchor{44}@anchor{gnat_rm/implementation_defined_pragmas pragma-constant-after-elaboration}@anchor{45} @section Pragma Constant_After_Elaboration @@ -2701,7 +2747,7 @@ For the semantics of this pragma, see the entry for aspect @code{Constant_After_Elaboration} in the SPARK 2014 Reference Manual, section 3.3.1. @node Pragma Contract_Cases,Pragma Convention_Identifier,Pragma Constant_After_Elaboration,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id8}@anchor{45}@anchor{gnat_rm/implementation_defined_pragmas pragma-contract-cases}@anchor{46} +@anchor{gnat_rm/implementation_defined_pragmas id8}@anchor{46}@anchor{gnat_rm/implementation_defined_pragmas pragma-contract-cases}@anchor{47} @section Pragma Contract_Cases @@ -2785,8 +2831,12 @@ call, as determined by the corresponding case guard evaluating to True, and that the consequence for this case should hold when the subprogram returns. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + @node Pragma Convention_Identifier,Pragma CPP_Class,Pragma Contract_Cases,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-convention-identifier}@anchor{47} +@anchor{gnat_rm/implementation_defined_pragmas pragma-convention-identifier}@anchor{48} @section Pragma Convention_Identifier @@ -2822,7 +2872,7 @@ define a convention identifier @code{Library} and use a single would be used system-wide. @node Pragma CPP_Class,Pragma CPP_Constructor,Pragma Convention_Identifier,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-cpp-class}@anchor{48} +@anchor{gnat_rm/implementation_defined_pragmas pragma-cpp-class}@anchor{49} @section Pragma CPP_Class @@ -2847,14 +2897,14 @@ functions (see pragma @code{CPP_Constructor}). Such types are implicitly limited if not explicitly declared as limited or derived from a limited type, and an error is issued in that case. -See @ref{49,,Interfacing to C++} for related information. +See @ref{4a,,Interfacing to C++} for related information. Note: Pragma @code{CPP_Class} is currently obsolete. It is supported for backward compatibility but its functionality is available using pragma @code{Import} with @code{Convention} = @code{CPP}. @node Pragma CPP_Constructor,Pragma CPP_Virtual,Pragma CPP_Class,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-cpp-constructor}@anchor{4a} +@anchor{gnat_rm/implementation_defined_pragmas pragma-cpp-constructor}@anchor{4b} @section Pragma CPP_Constructor @@ -2905,7 +2955,7 @@ on the Ada side and the type is implicitly declared abstract. Pragma @code{CPP_Constructor} is intended primarily for automatic generation using an automatic binding generator tool (such as the @code{-fdump-ada-spec} GCC switch). -See @ref{49,,Interfacing to C++} for more related information. +See @ref{4a,,Interfacing to C++} for more related information. Note: The use of functions returning class-wide types for constructors is currently obsolete. They are supported for backward compatibility. The @@ -2914,7 +2964,7 @@ because the imported C++ constructors always return an object of type T; that is, they never return an object whose type is a descendant of type T. @node Pragma CPP_Virtual,Pragma CPP_Vtable,Pragma CPP_Constructor,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-cpp-virtual}@anchor{4b} +@anchor{gnat_rm/implementation_defined_pragmas pragma-cpp-virtual}@anchor{4c} @section Pragma CPP_Virtual @@ -2927,10 +2977,10 @@ purposes. It used to be required to ensure compatibility with C++, but is no longer required for that purpose because GNAT generates the same object layout as the G++ compiler by default. -See @ref{49,,Interfacing to C++} for related information. +See @ref{4a,,Interfacing to C++} for related information. @node Pragma CPP_Vtable,Pragma CPU,Pragma CPP_Virtual,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-cpp-vtable}@anchor{4c} +@anchor{gnat_rm/implementation_defined_pragmas pragma-cpp-vtable}@anchor{4d} @section Pragma CPP_Vtable @@ -2942,10 +2992,10 @@ It used to be required to ensure compatibility with C++, but is no longer required for that purpose because GNAT generates the same object layout as the G++ compiler by default. -See @ref{49,,Interfacing to C++} for related information. +See @ref{4a,,Interfacing to C++} for related information. @node Pragma CPU,Pragma Deadline_Floor,Pragma CPP_Vtable,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-cpu}@anchor{4d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-cpu}@anchor{4e} @section Pragma CPU @@ -2960,7 +3010,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Deadline_Floor,Pragma Debug,Pragma CPU,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-deadline-floor}@anchor{4e} +@anchor{gnat_rm/implementation_defined_pragmas pragma-deadline-floor}@anchor{4f} @section Pragma Deadline_Floor @@ -2975,7 +3025,7 @@ deadline inherited by a task when the task enters a protected object. It is effective only when the EDF scheduling policy is used. @node Pragma Debug,Pragma Debug_Policy,Pragma Deadline_Floor,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-debug}@anchor{4f} +@anchor{gnat_rm/implementation_defined_pragmas pragma-debug}@anchor{50} @section Pragma Debug @@ -3002,8 +3052,12 @@ pragmas can be enabled either by use of the command line switch `-gnata' or by use of the pragma @code{Check_Policy} with a first argument of @code{Debug}. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + @node Pragma Debug_Policy,Pragma Default_Initial_Condition,Pragma Debug,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-debug-policy}@anchor{50} +@anchor{gnat_rm/implementation_defined_pragmas pragma-debug-policy}@anchor{51} @section Pragma Debug_Policy @@ -3018,7 +3072,7 @@ with a first argument of @code{Debug}. It is retained for historical compatibility reasons. @node Pragma Default_Initial_Condition,Pragma Default_Scalar_Storage_Order,Pragma Debug_Policy,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id9}@anchor{51}@anchor{gnat_rm/implementation_defined_pragmas pragma-default-initial-condition}@anchor{52} +@anchor{gnat_rm/implementation_defined_pragmas id9}@anchor{52}@anchor{gnat_rm/implementation_defined_pragmas pragma-default-initial-condition}@anchor{53} @section Pragma Default_Initial_Condition @@ -3031,8 +3085,12 @@ pragma Default_Initial_Condition [ (null | boolean_EXPRESSION) ]; For the semantics of this pragma, see the entry for aspect @code{Default_Initial_Condition} in the SPARK 2014 Reference Manual, section 7.3.3. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + @node Pragma Default_Scalar_Storage_Order,Pragma Default_Storage_Pool,Pragma Default_Initial_Condition,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-default-scalar-storage-order}@anchor{53} +@anchor{gnat_rm/implementation_defined_pragmas pragma-default-scalar-storage-order}@anchor{54} @section Pragma Default_Scalar_Storage_Order @@ -3105,7 +3163,7 @@ it may significantly degrade the run-time performance of the software, instead the default scalar storage order ought to be changed only on a local basis. @node Pragma Default_Storage_Pool,Pragma Depends,Pragma Default_Scalar_Storage_Order,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-default-storage-pool}@anchor{54} +@anchor{gnat_rm/implementation_defined_pragmas pragma-default-storage-pool}@anchor{55} @section Pragma Default_Storage_Pool @@ -3122,7 +3180,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Depends,Pragma Detect_Blocking,Pragma Default_Storage_Pool,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id10}@anchor{55}@anchor{gnat_rm/implementation_defined_pragmas pragma-depends}@anchor{56} +@anchor{gnat_rm/implementation_defined_pragmas id10}@anchor{56}@anchor{gnat_rm/implementation_defined_pragmas pragma-depends}@anchor{57} @section Pragma Depends @@ -3155,7 +3213,7 @@ For the semantics of this pragma, see the entry for aspect @code{Depends} in the SPARK 2014 Reference Manual, section 6.1.5. @node Pragma Detect_Blocking,Pragma Disable_Atomic_Synchronization,Pragma Depends,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-detect-blocking}@anchor{57} +@anchor{gnat_rm/implementation_defined_pragmas pragma-detect-blocking}@anchor{58} @section Pragma Detect_Blocking @@ -3173,7 +3231,7 @@ blocking operations within a protected operation, and to raise Program_Error if that happens. @node Pragma Disable_Atomic_Synchronization,Pragma Dispatching_Domain,Pragma Detect_Blocking,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-disable-atomic-synchronization}@anchor{58} +@anchor{gnat_rm/implementation_defined_pragmas pragma-disable-atomic-synchronization}@anchor{59} @section Pragma Disable_Atomic_Synchronization @@ -3202,7 +3260,7 @@ until the end of the scope. If an @code{Entity} argument is present, the action applies only to that entity. @node Pragma Dispatching_Domain,Pragma Effective_Reads,Pragma Disable_Atomic_Synchronization,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-dispatching-domain}@anchor{59} +@anchor{gnat_rm/implementation_defined_pragmas pragma-dispatching-domain}@anchor{5a} @section Pragma Dispatching_Domain @@ -3217,7 +3275,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Effective_Reads,Pragma Effective_Writes,Pragma Dispatching_Domain,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id11}@anchor{5a}@anchor{gnat_rm/implementation_defined_pragmas pragma-effective-reads}@anchor{5b} +@anchor{gnat_rm/implementation_defined_pragmas id11}@anchor{5b}@anchor{gnat_rm/implementation_defined_pragmas pragma-effective-reads}@anchor{5c} @section Pragma Effective_Reads @@ -3231,7 +3289,7 @@ For the semantics of this pragma, see the entry for aspect @code{Effective_Reads the SPARK 2014 Reference Manual, section 7.1.2. @node Pragma Effective_Writes,Pragma Elaboration_Checks,Pragma Effective_Reads,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id12}@anchor{5c}@anchor{gnat_rm/implementation_defined_pragmas pragma-effective-writes}@anchor{5d} +@anchor{gnat_rm/implementation_defined_pragmas id12}@anchor{5d}@anchor{gnat_rm/implementation_defined_pragmas pragma-effective-writes}@anchor{5e} @section Pragma Effective_Writes @@ -3245,7 +3303,7 @@ For the semantics of this pragma, see the entry for aspect @code{Effective_Write in the SPARK 2014 Reference Manual, section 7.1.2. @node Pragma Elaboration_Checks,Pragma Eliminate,Pragma Effective_Writes,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-elaboration-checks}@anchor{5e} +@anchor{gnat_rm/implementation_defined_pragmas pragma-elaboration-checks}@anchor{5f} @section Pragma Elaboration_Checks @@ -3282,7 +3340,7 @@ effect. If the pragma argument is @code{Static}, then the static elaboration mod is in effect. @node Pragma Eliminate,Pragma Enable_Atomic_Synchronization,Pragma Elaboration_Checks,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-eliminate}@anchor{5f} +@anchor{gnat_rm/implementation_defined_pragmas pragma-eliminate}@anchor{60} @section Pragma Eliminate @@ -3449,7 +3507,7 @@ pragma Eliminate (Q, Proc, @end quotation @node Pragma Enable_Atomic_Synchronization,Pragma Exceptional_Cases,Pragma Eliminate,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-enable-atomic-synchronization}@anchor{60} +@anchor{gnat_rm/implementation_defined_pragmas pragma-enable-atomic-synchronization}@anchor{61} @section Pragma Enable_Atomic_Synchronization @@ -3465,7 +3523,7 @@ Reenables atomic synchronization; see @code{pragma Disable_Atomic_Synchronizatio for details. @node Pragma Exceptional_Cases,Pragma Exit_Cases,Pragma Enable_Atomic_Synchronization,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-exceptional-cases}@anchor{61} +@anchor{gnat_rm/implementation_defined_pragmas pragma-exceptional-cases}@anchor{62} @section Pragma Exceptional_Cases @@ -3485,7 +3543,7 @@ For the semantics of this aspect, see the SPARK 2014 Reference Manual, section 6.1.9. @node Pragma Exit_Cases,Pragma Export_Function,Pragma Exceptional_Cases,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-exit-cases}@anchor{62} +@anchor{gnat_rm/implementation_defined_pragmas pragma-exit-cases}@anchor{63} @section Pragma Exit_Cases @@ -3509,7 +3567,7 @@ For the semantics of this aspect, see the SPARK 2014 Reference Manual, section 6.1.10. @node Pragma Export_Function,Pragma Export_Object,Pragma Exit_Cases,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-export-function}@anchor{63} +@anchor{gnat_rm/implementation_defined_pragmas pragma-export-function}@anchor{64} @section Pragma Export_Function @@ -3581,7 +3639,7 @@ string. In this case, no external name is generated. This form still allows the specification of parameter mechanisms. @node Pragma Export_Object,Pragma Export_Procedure,Pragma Export_Function,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-export-object}@anchor{64} +@anchor{gnat_rm/implementation_defined_pragmas pragma-export-object}@anchor{65} @section Pragma Export_Object @@ -3606,7 +3664,7 @@ of portability), but it is not required. @code{Size} is syntax checked, but otherwise ignored by GNAT. @node Pragma Export_Procedure,Pragma Export_Valued_Procedure,Pragma Export_Object,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-export-procedure}@anchor{65} +@anchor{gnat_rm/implementation_defined_pragmas pragma-export-procedure}@anchor{66} @section Pragma Export_Procedure @@ -3659,7 +3717,7 @@ string. In this case, no external name is generated. This form still allows the specification of parameter mechanisms. @node Pragma Export_Valued_Procedure,Pragma Extend_System,Pragma Export_Procedure,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-export-valued-procedure}@anchor{66} +@anchor{gnat_rm/implementation_defined_pragmas pragma-export-valued-procedure}@anchor{67} @section Pragma Export_Valued_Procedure @@ -3717,7 +3775,7 @@ string. In this case, no external name is generated. This form still allows the specification of parameter mechanisms. @node Pragma Extend_System,Pragma Extensions_Allowed,Pragma Export_Valued_Procedure,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-extend-system}@anchor{67} +@anchor{gnat_rm/implementation_defined_pragmas pragma-extend-system}@anchor{68} @section Pragma Extend_System @@ -3768,7 +3826,7 @@ for compiling System units, as explained in the GNAT User’s Guide. @node Pragma Extensions_Allowed,Pragma Extensions_Visible,Pragma Extend_System,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id13}@anchor{68}@anchor{gnat_rm/implementation_defined_pragmas pragma-extensions-allowed}@anchor{69} +@anchor{gnat_rm/implementation_defined_pragmas id13}@anchor{69}@anchor{gnat_rm/implementation_defined_pragmas pragma-extensions-allowed}@anchor{6a} @section Pragma Extensions_Allowed @@ -3789,14 +3847,14 @@ pragma takes precedence over the @code{-gnatX} and @code{-gnatX0} command switch If an argument of @code{"On"} is specified, the latest version of the Ada language is implemented (currently Ada 2022) and, in addition, a curated set of GNAT specific extensions are recognized. (See the list here -@ref{6a,,here}) +@ref{6b,,here}) An argument of @code{"All_Extensions"} has the same effect except that some extra experimental extensions are enabled (See the list here -@ref{6b,,here}) +@ref{6c,,here}) @node Pragma Extensions_Visible,Pragma External,Pragma Extensions_Allowed,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id14}@anchor{6c}@anchor{gnat_rm/implementation_defined_pragmas pragma-extensions-visible}@anchor{6d} +@anchor{gnat_rm/implementation_defined_pragmas id14}@anchor{6d}@anchor{gnat_rm/implementation_defined_pragmas pragma-extensions-visible}@anchor{6e} @section Pragma Extensions_Visible @@ -3810,7 +3868,7 @@ For the semantics of this pragma, see the entry for aspect @code{Extensions_Visi in the SPARK 2014 Reference Manual, section 6.1.7. @node Pragma External,Pragma External_Name_Casing,Pragma Extensions_Visible,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-external}@anchor{6e} +@anchor{gnat_rm/implementation_defined_pragmas pragma-external}@anchor{6f} @section Pragma External @@ -3831,7 +3889,7 @@ used this pragma for exactly the same purposes as pragma @code{Export} before the latter was standardized. @node Pragma External_Name_Casing,Pragma Fast_Math,Pragma External,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-external-name-casing}@anchor{6f} +@anchor{gnat_rm/implementation_defined_pragmas pragma-external-name-casing}@anchor{70} @section Pragma External_Name_Casing @@ -3920,7 +3978,7 @@ pragma External_Name_Casing (Uppercase, Uppercase); to enforce the upper casing of all external symbols. @node Pragma Fast_Math,Pragma Favor_Top_Level,Pragma External_Name_Casing,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-fast-math}@anchor{70} +@anchor{gnat_rm/implementation_defined_pragmas pragma-fast-math}@anchor{71} @section Pragma Fast_Math @@ -3949,7 +4007,7 @@ under control of the pragma, rather than use the preinstantiated versions. @end table @node Pragma Favor_Top_Level,Pragma Finalize_Storage_Only,Pragma Fast_Math,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id15}@anchor{71}@anchor{gnat_rm/implementation_defined_pragmas pragma-favor-top-level}@anchor{72} +@anchor{gnat_rm/implementation_defined_pragmas id15}@anchor{72}@anchor{gnat_rm/implementation_defined_pragmas pragma-favor-top-level}@anchor{73} @section Pragma Favor_Top_Level @@ -3968,7 +4026,7 @@ When this pragma is used, dynamically generated trampolines may be used on some targets for nested subprograms. See restriction @code{No_Implicit_Dynamic_Code}. @node Pragma Finalize_Storage_Only,Pragma Float_Representation,Pragma Favor_Top_Level,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-finalize-storage-only}@anchor{73} +@anchor{gnat_rm/implementation_defined_pragmas pragma-finalize-storage-only}@anchor{74} @section Pragma Finalize_Storage_Only @@ -3988,7 +4046,7 @@ name. Note that this pragma does not suppress Finalize calls for library-level heap-allocated objects (see pragma @code{No_Heap_Finalization}). @node Pragma Float_Representation,Pragma Ghost,Pragma Finalize_Storage_Only,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-float-representation}@anchor{74} +@anchor{gnat_rm/implementation_defined_pragmas pragma-float-representation}@anchor{75} @section Pragma Float_Representation @@ -4023,7 +4081,7 @@ No other value of digits is permitted. @end itemize @node Pragma Ghost,Pragma Global,Pragma Float_Representation,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id16}@anchor{75}@anchor{gnat_rm/implementation_defined_pragmas pragma-ghost}@anchor{76} +@anchor{gnat_rm/implementation_defined_pragmas id16}@anchor{76}@anchor{gnat_rm/implementation_defined_pragmas pragma-ghost}@anchor{77} @section Pragma Ghost @@ -4037,7 +4095,7 @@ For the semantics of this pragma, see the entry for aspect @code{Ghost} in the S 2014 Reference Manual, section 6.9. @node Pragma Global,Pragma Ident,Pragma Ghost,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id17}@anchor{77}@anchor{gnat_rm/implementation_defined_pragmas pragma-global}@anchor{78} +@anchor{gnat_rm/implementation_defined_pragmas id17}@anchor{78}@anchor{gnat_rm/implementation_defined_pragmas pragma-global}@anchor{79} @section Pragma Global @@ -4062,7 +4120,7 @@ For the semantics of this pragma, see the entry for aspect @code{Global} in the SPARK 2014 Reference Manual, section 6.1.4. @node Pragma Ident,Pragma Ignore_Pragma,Pragma Global,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-ident}@anchor{79} +@anchor{gnat_rm/implementation_defined_pragmas pragma-ident}@anchor{7a} @section Pragma Ident @@ -4076,7 +4134,7 @@ This pragma is identical in effect to pragma @code{Comment}. It is provided for compatibility with other Ada compilers providing this pragma. @node Pragma Ignore_Pragma,Pragma Implementation_Defined,Pragma Ident,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-ignore-pragma}@anchor{7a} +@anchor{gnat_rm/implementation_defined_pragmas pragma-ignore-pragma}@anchor{7b} @section Pragma Ignore_Pragma @@ -4098,7 +4156,7 @@ pragma allows such pragmas to be ignored, which may be useful in CodePeer mode, or during porting of legacy code. @node Pragma Implementation_Defined,Pragma Implemented,Pragma Ignore_Pragma,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-implementation-defined}@anchor{7b} +@anchor{gnat_rm/implementation_defined_pragmas pragma-implementation-defined}@anchor{7c} @section Pragma Implementation_Defined @@ -4125,7 +4183,7 @@ for the purpose of implementing the No_Implementation_Identifiers restriction. @node Pragma Implemented,Pragma Implicit_Packing,Pragma Implementation_Defined,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-implemented}@anchor{7c} +@anchor{gnat_rm/implementation_defined_pragmas pragma-implemented}@anchor{7d} @section Pragma Implemented @@ -4171,7 +4229,7 @@ By_Any shares the behavior of By_Entry and By_Protected_Procedure depending on the target’s overriding subprogram kind. @node Pragma Implicit_Packing,Pragma Import_Function,Pragma Implemented,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-implicit-packing}@anchor{7d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-implicit-packing}@anchor{7e} @section Pragma Implicit_Packing @@ -4225,7 +4283,7 @@ sufficient. The use of pragma Implicit_Packing allows this record declaration to compile without an explicit pragma Pack. @node Pragma Import_Function,Pragma Import_Object,Pragma Implicit_Packing,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-import-function}@anchor{7e} +@anchor{gnat_rm/implementation_defined_pragmas pragma-import-function}@anchor{7f} @section Pragma Import_Function @@ -4290,7 +4348,7 @@ notation. If the mechanism is not specified, the default mechanism is used. @node Pragma Import_Object,Pragma Import_Procedure,Pragma Import_Function,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-import-object}@anchor{7f} +@anchor{gnat_rm/implementation_defined_pragmas pragma-import-object}@anchor{80} @section Pragma Import_Object @@ -4316,7 +4374,7 @@ point of view). @code{size} is syntax checked, but otherwise ignored by GNAT. @node Pragma Import_Procedure,Pragma Import_Valued_Procedure,Pragma Import_Object,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-import-procedure}@anchor{80} +@anchor{gnat_rm/implementation_defined_pragmas pragma-import-procedure}@anchor{81} @section Pragma Import_Procedure @@ -4356,7 +4414,7 @@ applies to a procedure rather than a function and the parameters @code{Result_Type} and @code{Result_Mechanism} are not permitted. @node Pragma Import_Valued_Procedure,Pragma Independent,Pragma Import_Procedure,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-import-valued-procedure}@anchor{81} +@anchor{gnat_rm/implementation_defined_pragmas pragma-import-valued-procedure}@anchor{82} @section Pragma Import_Valued_Procedure @@ -4409,7 +4467,7 @@ pragma Import that specifies the desired convention, since otherwise the default convention is Ada, which is almost certainly not what is required. @node Pragma Independent,Pragma Independent_Components,Pragma Import_Valued_Procedure,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-independent}@anchor{82} +@anchor{gnat_rm/implementation_defined_pragmas pragma-independent}@anchor{83} @section Pragma Independent @@ -4431,7 +4489,7 @@ constraints on the representation of the object (for instance prohibiting tight packing). @node Pragma Independent_Components,Pragma Initial_Condition,Pragma Independent,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-independent-components}@anchor{83} +@anchor{gnat_rm/implementation_defined_pragmas pragma-independent-components}@anchor{84} @section Pragma Independent_Components @@ -4452,7 +4510,7 @@ constraints on the representation of the object (for instance prohibiting tight packing). @node Pragma Initial_Condition,Pragma Initialize_Scalars,Pragma Independent_Components,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id18}@anchor{84}@anchor{gnat_rm/implementation_defined_pragmas pragma-initial-condition}@anchor{85} +@anchor{gnat_rm/implementation_defined_pragmas id18}@anchor{85}@anchor{gnat_rm/implementation_defined_pragmas pragma-initial-condition}@anchor{86} @section Pragma Initial_Condition @@ -4465,8 +4523,12 @@ pragma Initial_Condition (boolean_EXPRESSION); For the semantics of this pragma, see the entry for aspect @code{Initial_Condition} in the SPARK 2014 Reference Manual, section 7.1.6. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + @node Pragma Initialize_Scalars,Pragma Initializes,Pragma Initial_Condition,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-initialize-scalars}@anchor{86} +@anchor{gnat_rm/implementation_defined_pragmas pragma-initialize-scalars}@anchor{87} @section Pragma Initialize_Scalars @@ -4575,7 +4637,7 @@ good idea to turn on stack checking (see description of stack checking in the GNAT User’s Guide) when using this pragma. @node Pragma Initializes,Pragma Inline_Always,Pragma Initialize_Scalars,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id19}@anchor{87}@anchor{gnat_rm/implementation_defined_pragmas pragma-initializes}@anchor{88} +@anchor{gnat_rm/implementation_defined_pragmas id19}@anchor{88}@anchor{gnat_rm/implementation_defined_pragmas pragma-initializes}@anchor{89} @section Pragma Initializes @@ -4602,7 +4664,7 @@ For the semantics of this pragma, see the entry for aspect @code{Initializes} in SPARK 2014 Reference Manual, section 7.1.5. @node Pragma Inline_Always,Pragma Inline_Generic,Pragma Initializes,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id20}@anchor{89}@anchor{gnat_rm/implementation_defined_pragmas pragma-inline-always}@anchor{8a} +@anchor{gnat_rm/implementation_defined_pragmas id20}@anchor{8a}@anchor{gnat_rm/implementation_defined_pragmas pragma-inline-always}@anchor{8b} @section Pragma Inline_Always @@ -4621,7 +4683,7 @@ apply this pragma to a primitive operation of a tagged type. Thanks to such restrictions, the compiler is allowed to remove the out-of-line body of @code{NAME}. @node Pragma Inline_Generic,Pragma Interface,Pragma Inline_Always,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-inline-generic}@anchor{8b} +@anchor{gnat_rm/implementation_defined_pragmas pragma-inline-generic}@anchor{8c} @section Pragma Inline_Generic @@ -4639,7 +4701,7 @@ than to check that the given names are all names of generic units or generic instances. @node Pragma Interface,Pragma Interface_Name,Pragma Inline_Generic,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-interface}@anchor{8c} +@anchor{gnat_rm/implementation_defined_pragmas pragma-interface}@anchor{8d} @section Pragma Interface @@ -4666,7 +4728,7 @@ maintaining Ada 83/Ada 95 compatibility and is compatible with other Ada 83 compilers. @node Pragma Interface_Name,Pragma Interrupt_Handler,Pragma Interface,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-interface-name}@anchor{8d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-interface-name}@anchor{8e} @section Pragma Interface_Name @@ -4685,7 +4747,7 @@ for an interfaced subprogram, and is provided for compatibility with Ada least one of @code{External_Name} or @code{Link_Name}. @node Pragma Interrupt_Handler,Pragma Interrupt_State,Pragma Interface_Name,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-interrupt-handler}@anchor{8e} +@anchor{gnat_rm/implementation_defined_pragmas pragma-interrupt-handler}@anchor{8f} @section Pragma Interrupt_Handler @@ -4699,7 +4761,7 @@ This program unit pragma is supported for parameterless protected procedures as described in Annex C of the Ada Reference Manual. @node Pragma Interrupt_State,Pragma Interrupts_System_By_Default,Pragma Interrupt_Handler,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-interrupt-state}@anchor{8f} +@anchor{gnat_rm/implementation_defined_pragmas pragma-interrupt-state}@anchor{90} @section Pragma Interrupt_State @@ -4785,7 +4847,7 @@ with an application’s runtime behavior in the cases of the synchronous signals and in the case of the signal used to implement the @code{abort} statement. @node Pragma Interrupts_System_By_Default,Pragma Invariant,Pragma Interrupt_State,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-interrupts-system-by-default}@anchor{90} +@anchor{gnat_rm/implementation_defined_pragmas pragma-interrupts-system-by-default}@anchor{91} @section Pragma Interrupts_System_By_Default @@ -4799,7 +4861,7 @@ Default all interrupts to the System state as defined above in pragma @code{Interrupt_State}. This is a configuration pragma. @node Pragma Invariant,Pragma Keep_Names,Pragma Interrupts_System_By_Default,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id21}@anchor{91}@anchor{gnat_rm/implementation_defined_pragmas pragma-invariant}@anchor{92} +@anchor{gnat_rm/implementation_defined_pragmas id21}@anchor{92}@anchor{gnat_rm/implementation_defined_pragmas pragma-invariant}@anchor{93} @section Pragma Invariant @@ -4837,8 +4899,12 @@ invariant pragma for the same entity. For further details on the use of this pragma, see the Ada 2012 documentation of the Type_Invariant aspect. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + @node Pragma Keep_Names,Pragma License,Pragma Invariant,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-keep-names}@anchor{93} +@anchor{gnat_rm/implementation_defined_pragmas pragma-keep-names}@anchor{94} @section Pragma Keep_Names @@ -4858,7 +4924,7 @@ use a @code{Discard_Names} pragma in the @code{gnat.adc} file, but you want to retain the names for specific enumeration types. @node Pragma License,Pragma Link_With,Pragma Keep_Names,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-license}@anchor{94} +@anchor{gnat_rm/implementation_defined_pragmas pragma-license}@anchor{95} @section Pragma License @@ -4953,7 +5019,7 @@ GPL, but no warning for @code{GNAT.Sockets} which is part of the GNAT run time, and is therefore licensed under the modified GPL. @node Pragma Link_With,Pragma Linker_Alias,Pragma License,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-link-with}@anchor{95} +@anchor{gnat_rm/implementation_defined_pragmas pragma-link-with}@anchor{96} @section Pragma Link_With @@ -4977,7 +5043,7 @@ separate arguments to the linker. In addition pragma Link_With allows multiple arguments, with the same effect as successive pragmas. @node Pragma Linker_Alias,Pragma Linker_Constructor,Pragma Link_With,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-alias}@anchor{96} +@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-alias}@anchor{97} @section Pragma Linker_Alias @@ -5018,7 +5084,7 @@ end p; @end example @node Pragma Linker_Constructor,Pragma Linker_Destructor,Pragma Linker_Alias,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-constructor}@anchor{97} +@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-constructor}@anchor{98} @section Pragma Linker_Constructor @@ -5048,7 +5114,7 @@ listed above. Where possible, the use of Stand Alone Libraries is preferable to the use of this pragma. @node Pragma Linker_Destructor,Pragma Linker_Section,Pragma Linker_Constructor,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-destructor}@anchor{98} +@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-destructor}@anchor{99} @section Pragma Linker_Destructor @@ -5071,7 +5137,7 @@ See @code{pragma Linker_Constructor} for the set of restrictions that apply because of these specific contexts. @node Pragma Linker_Section,Pragma Lock_Free,Pragma Linker_Destructor,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id22}@anchor{99}@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-section}@anchor{9a} +@anchor{gnat_rm/implementation_defined_pragmas id22}@anchor{9a}@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-section}@anchor{9b} @section Pragma Linker_Section @@ -5145,7 +5211,7 @@ end IO_Card; @end example @node Pragma Lock_Free,Pragma Loop_Invariant,Pragma Linker_Section,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id23}@anchor{9b}@anchor{gnat_rm/implementation_defined_pragmas pragma-lock-free}@anchor{9c} +@anchor{gnat_rm/implementation_defined_pragmas id23}@anchor{9c}@anchor{gnat_rm/implementation_defined_pragmas pragma-lock-free}@anchor{9d} @section Pragma Lock_Free @@ -5208,7 +5274,7 @@ Ada RM D.3) are not performed when a protected operation of the protected unit is executed. @node Pragma Loop_Invariant,Pragma Loop_Optimize,Pragma Lock_Free,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-loop-invariant}@anchor{9d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-loop-invariant}@anchor{9e} @section Pragma Loop_Invariant @@ -5240,8 +5306,12 @@ may be used to refer to the value of an expression on entry to the loop. This attribute can only be used within the expression of a @code{Loop_Invariant} pragma. For full details, see documentation of attribute @code{Loop_Entry}. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + @node Pragma Loop_Optimize,Pragma Loop_Variant,Pragma Loop_Invariant,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-loop-optimize}@anchor{9e} +@anchor{gnat_rm/implementation_defined_pragmas pragma-loop-optimize}@anchor{9f} @section Pragma Loop_Optimize @@ -5303,7 +5373,7 @@ compiler in order to enable the relevant optimizations, that is to say vectorization. @node Pragma Loop_Variant,Pragma Machine_Attribute,Pragma Loop_Optimize,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-loop-variant}@anchor{9f} +@anchor{gnat_rm/implementation_defined_pragmas pragma-loop-variant}@anchor{a0} @section Pragma Loop_Variant @@ -5349,8 +5419,12 @@ statements. The @code{Loop_Entry} attribute may be used within the expressions of the @code{Loop_Variant} pragma to refer to values on entry to the loop. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + @node Pragma Machine_Attribute,Pragma Main,Pragma Loop_Variant,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-machine-attribute}@anchor{a0} +@anchor{gnat_rm/implementation_defined_pragmas pragma-machine-attribute}@anchor{a1} @section Pragma Machine_Attribute @@ -5376,7 +5450,7 @@ which may make this pragma unusable for some attributes. For further information see @cite{GNU Compiler Collection (GCC) Internals}. @node Pragma Main,Pragma Main_Storage,Pragma Machine_Attribute,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-main}@anchor{a1} +@anchor{gnat_rm/implementation_defined_pragmas pragma-main}@anchor{a2} @section Pragma Main @@ -5396,7 +5470,7 @@ This pragma is provided for compatibility with OpenVMS VAX Systems. It has no effect in GNAT, other than being syntax checked. @node Pragma Main_Storage,Pragma Max_Queue_Length,Pragma Main,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-main-storage}@anchor{a2} +@anchor{gnat_rm/implementation_defined_pragmas pragma-main-storage}@anchor{a3} @section Pragma Main_Storage @@ -5415,7 +5489,7 @@ This pragma is provided for compatibility with OpenVMS VAX Systems. It has no effect in GNAT, other than being syntax checked. @node Pragma Max_Queue_Length,Pragma No_Body,Pragma Main_Storage,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id24}@anchor{a3}@anchor{gnat_rm/implementation_defined_pragmas pragma-max-queue-length}@anchor{a4} +@anchor{gnat_rm/implementation_defined_pragmas id24}@anchor{a4}@anchor{gnat_rm/implementation_defined_pragmas pragma-max-queue-length}@anchor{a5} @section Pragma Max_Queue_Length @@ -5433,7 +5507,7 @@ entry. A value of -1 represents no additional restriction on queue length. @node Pragma No_Body,Pragma No_Caching,Pragma Max_Queue_Length,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-no-body}@anchor{a5} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-body}@anchor{a6} @section Pragma No_Body @@ -5456,7 +5530,7 @@ dummy body with a No_Body pragma ensures that there is no interference from earlier versions of the package body. @node Pragma No_Caching,Pragma No_Component_Reordering,Pragma No_Body,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id25}@anchor{a6}@anchor{gnat_rm/implementation_defined_pragmas pragma-no-caching}@anchor{a7} +@anchor{gnat_rm/implementation_defined_pragmas id25}@anchor{a7}@anchor{gnat_rm/implementation_defined_pragmas pragma-no-caching}@anchor{a8} @section Pragma No_Caching @@ -5470,7 +5544,7 @@ For the semantics of this pragma, see the entry for aspect @code{No_Caching} in the SPARK 2014 Reference Manual, section 7.1.2. @node Pragma No_Component_Reordering,Pragma No_Elaboration_Code_All,Pragma No_Caching,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-no-component-reordering}@anchor{a8} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-component-reordering}@anchor{a9} @section Pragma No_Component_Reordering @@ -5489,7 +5563,7 @@ declared in units to which the pragma applies and there is a requirement that this pragma be used consistently within a partition. @node Pragma No_Elaboration_Code_All,Pragma No_Heap_Finalization,Pragma No_Component_Reordering,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id26}@anchor{a9}@anchor{gnat_rm/implementation_defined_pragmas pragma-no-elaboration-code-all}@anchor{aa} +@anchor{gnat_rm/implementation_defined_pragmas id26}@anchor{aa}@anchor{gnat_rm/implementation_defined_pragmas pragma-no-elaboration-code-all}@anchor{ab} @section Pragma No_Elaboration_Code_All @@ -5508,7 +5582,7 @@ current unit, it must also have the @cite{No_Elaboration_Code_All} aspect set. It may be applied to package or subprogram specs or their generic versions. @node Pragma No_Heap_Finalization,Pragma No_Inline,Pragma No_Elaboration_Code_All,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-no-heap-finalization}@anchor{ab} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-heap-finalization}@anchor{ac} @section Pragma No_Heap_Finalization @@ -5540,7 +5614,7 @@ lose its @code{No_Heap_Finalization} pragma when the corresponding instance does appear at the library level. @node Pragma No_Inline,Pragma No_Raise,Pragma No_Heap_Finalization,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id27}@anchor{ac}@anchor{gnat_rm/implementation_defined_pragmas pragma-no-inline}@anchor{ad} +@anchor{gnat_rm/implementation_defined_pragmas id27}@anchor{ad}@anchor{gnat_rm/implementation_defined_pragmas pragma-no-inline}@anchor{ae} @section Pragma No_Inline @@ -5558,7 +5632,7 @@ in particular it is not subject to the use of option `-gnatn' or pragma @code{Inline_Always} for the same @code{NAME}. @node Pragma No_Raise,Pragma No_Return,Pragma No_Inline,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id28}@anchor{ae}@anchor{gnat_rm/implementation_defined_pragmas pragma-no-raise}@anchor{af} +@anchor{gnat_rm/implementation_defined_pragmas id28}@anchor{af}@anchor{gnat_rm/implementation_defined_pragmas pragma-no-raise}@anchor{b0} @section Pragma No_Raise @@ -5575,7 +5649,7 @@ An implementation-defined check named @cite{Raise_Check} is associated with the pragma, and @cite{Program_Error} is raised upon its failure (see RM 11.5(19/5)). @node Pragma No_Return,Pragma No_Strict_Aliasing,Pragma No_Raise,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-no-return}@anchor{b0} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-return}@anchor{b1} @section Pragma No_Return @@ -5602,7 +5676,7 @@ available in all earlier versions of Ada as an implementation-defined pragma. @node Pragma No_Strict_Aliasing,Pragma No_Tagged_Streams,Pragma No_Return,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-no-strict-aliasing}@anchor{b1} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-strict-aliasing}@anchor{b2} @section Pragma No_Strict_Aliasing @@ -5624,7 +5698,7 @@ in the @cite{GNAT User’s Guide}. This pragma currently has no effects on access to unconstrained array types. @node Pragma No_Tagged_Streams,Pragma Normalize_Scalars,Pragma No_Strict_Aliasing,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id29}@anchor{b2}@anchor{gnat_rm/implementation_defined_pragmas pragma-no-tagged-streams}@anchor{b3} +@anchor{gnat_rm/implementation_defined_pragmas id29}@anchor{b3}@anchor{gnat_rm/implementation_defined_pragmas pragma-no-tagged-streams}@anchor{b4} @section Pragma No_Tagged_Streams @@ -5663,7 +5737,7 @@ with empty strings. This is useful to avoid exposing entity names at binary level but has a negative impact on the debuggability of tagged types. @node Pragma Normalize_Scalars,Pragma Obsolescent,Pragma No_Tagged_Streams,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-normalize-scalars}@anchor{b4} +@anchor{gnat_rm/implementation_defined_pragmas pragma-normalize-scalars}@anchor{b5} @section Pragma Normalize_Scalars @@ -5745,7 +5819,7 @@ will always generate an invalid value if one exists. @end table @node Pragma Obsolescent,Pragma Optimize_Alignment,Pragma Normalize_Scalars,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id30}@anchor{b5}@anchor{gnat_rm/implementation_defined_pragmas pragma-obsolescent}@anchor{b6} +@anchor{gnat_rm/implementation_defined_pragmas id30}@anchor{b6}@anchor{gnat_rm/implementation_defined_pragmas pragma-obsolescent}@anchor{b7} @section Pragma Obsolescent @@ -5841,7 +5915,7 @@ So if you specify @code{Entity =>} for the @code{Entity} argument, and a @code{M argument is present, it must be preceded by @code{Message =>}. @node Pragma Optimize_Alignment,Pragma Ordered,Pragma Obsolescent,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-optimize-alignment}@anchor{b7} +@anchor{gnat_rm/implementation_defined_pragmas pragma-optimize-alignment}@anchor{b8} @section Pragma Optimize_Alignment @@ -5927,7 +6001,7 @@ latter are compiled by default in pragma Optimize_Alignment (Off) mode if no pragma appears at the start of the file. @node Pragma Ordered,Pragma Overflow_Mode,Pragma Optimize_Alignment,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-ordered}@anchor{b8} +@anchor{gnat_rm/implementation_defined_pragmas pragma-ordered}@anchor{b9} @section Pragma Ordered @@ -6019,7 +6093,7 @@ For additional information please refer to the description of the `-gnatw.u' switch in the GNAT User’s Guide. @node Pragma Overflow_Mode,Pragma Overriding_Renamings,Pragma Ordered,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-overflow-mode}@anchor{b9} +@anchor{gnat_rm/implementation_defined_pragmas pragma-overflow-mode}@anchor{ba} @section Pragma Overflow_Mode @@ -6058,7 +6132,7 @@ The pragma @code{Unsuppress (Overflow_Check)} unsuppresses (enables) overflow checking, but does not affect the overflow mode. @node Pragma Overriding_Renamings,Pragma Part_Of,Pragma Overflow_Mode,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-overriding-renamings}@anchor{ba} +@anchor{gnat_rm/implementation_defined_pragmas pragma-overriding-renamings}@anchor{bb} @section Pragma Overriding_Renamings @@ -6093,7 +6167,7 @@ RM 8.3 (15) stipulates that an overridden operation is not visible within the declaration of the overriding operation. @node Pragma Part_Of,Pragma Partition_Elaboration_Policy,Pragma Overriding_Renamings,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id31}@anchor{bb}@anchor{gnat_rm/implementation_defined_pragmas pragma-part-of}@anchor{bc} +@anchor{gnat_rm/implementation_defined_pragmas id31}@anchor{bc}@anchor{gnat_rm/implementation_defined_pragmas pragma-part-of}@anchor{bd} @section Pragma Part_Of @@ -6109,7 +6183,7 @@ For the semantics of this pragma, see the entry for aspect @code{Part_Of} in the SPARK 2014 Reference Manual, section 7.2.6. @node Pragma Partition_Elaboration_Policy,Pragma Passive,Pragma Part_Of,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-partition-elaboration-policy}@anchor{bd} +@anchor{gnat_rm/implementation_defined_pragmas pragma-partition-elaboration-policy}@anchor{be} @section Pragma Partition_Elaboration_Policy @@ -6126,7 +6200,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Passive,Pragma Persistent_BSS,Pragma Partition_Elaboration_Policy,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-passive}@anchor{be} +@anchor{gnat_rm/implementation_defined_pragmas pragma-passive}@anchor{bf} @section Pragma Passive @@ -6150,7 +6224,7 @@ For more information on the subject of passive tasks, see the section ‘Passive Task Optimization’ in the GNAT Users Guide. @node Pragma Persistent_BSS,Pragma Post,Pragma Passive,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id32}@anchor{bf}@anchor{gnat_rm/implementation_defined_pragmas pragma-persistent-bss}@anchor{c0} +@anchor{gnat_rm/implementation_defined_pragmas id32}@anchor{c0}@anchor{gnat_rm/implementation_defined_pragmas pragma-persistent-bss}@anchor{c1} @section Pragma Persistent_BSS @@ -6181,7 +6255,7 @@ If this pragma is used on a target where this feature is not supported, then the pragma will be ignored. See also @code{pragma Linker_Section}. @node Pragma Post,Pragma Postcondition,Pragma Persistent_BSS,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-post}@anchor{c1} +@anchor{gnat_rm/implementation_defined_pragmas pragma-post}@anchor{c2} @section Pragma Post @@ -6205,8 +6279,12 @@ if there is no separate subprogram declaration, then it can appear at the start of the declarations in a subprogram body (preceded only by other pragmas). +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + @node Pragma Postcondition,Pragma Post_Class,Pragma Post,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-postcondition}@anchor{c2} +@anchor{gnat_rm/implementation_defined_pragmas pragma-postcondition}@anchor{c3} @section Pragma Postcondition @@ -6370,8 +6448,12 @@ use of the pragma identifier @code{Check}. Historically, pragma Ada 2012, and has been retained in its original form for compatibility purposes. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + @node Pragma Post_Class,Pragma Pre,Pragma Postcondition,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-post-class}@anchor{c3} +@anchor{gnat_rm/implementation_defined_pragmas pragma-post-class}@anchor{c4} @section Pragma Post_Class @@ -6405,8 +6487,12 @@ aspects, but is prepared to ignore the pragmas. The assertion policy that controls this pragma is @code{Post'Class}, not @code{Post_Class}. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + @node Pragma Pre,Pragma Precondition,Pragma Post_Class,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-pre}@anchor{c4} +@anchor{gnat_rm/implementation_defined_pragmas pragma-pre}@anchor{c5} @section Pragma Pre @@ -6430,8 +6516,12 @@ if there is no separate subprogram declaration, then it can appear at the start of the declarations in a subprogram body (preceded only by other pragmas). +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + @node Pragma Precondition,Pragma Predicate,Pragma Pre,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-precondition}@anchor{c5} +@anchor{gnat_rm/implementation_defined_pragmas pragma-precondition}@anchor{c6} @section Pragma Precondition @@ -6489,8 +6579,12 @@ use of the pragma identifier @code{Check}. Historically, pragma Ada 2012, and has been retained in its original form for compatibility purposes. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + @node Pragma Predicate,Pragma Predicate_Failure,Pragma Precondition,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id33}@anchor{c6}@anchor{gnat_rm/implementation_defined_pragmas pragma-predicate}@anchor{c7} +@anchor{gnat_rm/implementation_defined_pragmas id33}@anchor{c7}@anchor{gnat_rm/implementation_defined_pragmas pragma-predicate}@anchor{c8} @section Pragma Predicate @@ -6543,8 +6637,12 @@ fundamentally changed (for example a membership test defined for subtype B). When following this approach, the use of predicates should be avoided. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + @node Pragma Predicate_Failure,Pragma Preelaborable_Initialization,Pragma Predicate,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-predicate-failure}@anchor{c8} +@anchor{gnat_rm/implementation_defined_pragmas pragma-predicate-failure}@anchor{c9} @section Pragma Predicate_Failure @@ -6561,7 +6659,7 @@ the language-defined @code{Predicate_Failure} aspect, and shares its restrictions and semantics. @node Pragma Preelaborable_Initialization,Pragma Prefix_Exception_Messages,Pragma Predicate_Failure,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-preelaborable-initialization}@anchor{c9} +@anchor{gnat_rm/implementation_defined_pragmas pragma-preelaborable-initialization}@anchor{ca} @section Pragma Preelaborable_Initialization @@ -6576,7 +6674,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Prefix_Exception_Messages,Pragma Pre_Class,Pragma Preelaborable_Initialization,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-prefix-exception-messages}@anchor{ca} +@anchor{gnat_rm/implementation_defined_pragmas pragma-prefix-exception-messages}@anchor{cb} @section Pragma Prefix_Exception_Messages @@ -6607,7 +6705,7 @@ prefixing in this case, you can always call @code{GNAT.Source_Info.Enclosing_Entity} and prepend the string manually. @node Pragma Pre_Class,Pragma Priority_Specific_Dispatching,Pragma Prefix_Exception_Messages,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-pre-class}@anchor{cb} +@anchor{gnat_rm/implementation_defined_pragmas pragma-pre-class}@anchor{cc} @section Pragma Pre_Class @@ -6641,8 +6739,12 @@ aspects, but is prepared to ignore the pragmas. The assertion policy that controls this pragma is @code{Pre'Class}, not @code{Pre_Class}. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + @node Pragma Priority_Specific_Dispatching,Pragma Profile,Pragma Pre_Class,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-priority-specific-dispatching}@anchor{cc} +@anchor{gnat_rm/implementation_defined_pragmas pragma-priority-specific-dispatching}@anchor{cd} @section Pragma Priority_Specific_Dispatching @@ -6666,7 +6768,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Profile,Pragma Profile_Warnings,Pragma Priority_Specific_Dispatching,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-profile}@anchor{cd} +@anchor{gnat_rm/implementation_defined_pragmas pragma-profile}@anchor{ce} @section Pragma Profile @@ -6945,7 +7047,7 @@ conforming Ada constructs. The profile enables the following three pragmas: @end itemize @node Pragma Profile_Warnings,Pragma Program_Exit,Pragma Profile,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-profile-warnings}@anchor{ce} +@anchor{gnat_rm/implementation_defined_pragmas pragma-profile-warnings}@anchor{cf} @section Pragma Profile_Warnings @@ -6963,7 +7065,7 @@ violations of the profile generate warning messages instead of error messages. @node Pragma Program_Exit,Pragma Propagate_Exceptions,Pragma Profile_Warnings,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id34}@anchor{cf}@anchor{gnat_rm/implementation_defined_pragmas pragma-program-exit}@anchor{d0} +@anchor{gnat_rm/implementation_defined_pragmas id34}@anchor{d0}@anchor{gnat_rm/implementation_defined_pragmas pragma-program-exit}@anchor{d1} @section Pragma Program_Exit @@ -6977,7 +7079,7 @@ For the semantics of this pragma, see the entry for aspect @code{Program_Exit} in the SPARK 2014 Reference Manual, section 6.1.10. @node Pragma Propagate_Exceptions,Pragma Provide_Shift_Operators,Pragma Program_Exit,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-propagate-exceptions}@anchor{d1} +@anchor{gnat_rm/implementation_defined_pragmas pragma-propagate-exceptions}@anchor{d2} @section Pragma Propagate_Exceptions @@ -6996,7 +7098,7 @@ purposes. It used to be used in connection with optimization of a now-obsolete mechanism for implementation of exceptions. @node Pragma Provide_Shift_Operators,Pragma Psect_Object,Pragma Propagate_Exceptions,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-provide-shift-operators}@anchor{d2} +@anchor{gnat_rm/implementation_defined_pragmas pragma-provide-shift-operators}@anchor{d3} @section Pragma Provide_Shift_Operators @@ -7016,7 +7118,7 @@ including the function declarations for these five operators, together with the pragma Import (Intrinsic, …) statements. @node Pragma Psect_Object,Pragma Pure_Function,Pragma Provide_Shift_Operators,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-psect-object}@anchor{d3} +@anchor{gnat_rm/implementation_defined_pragmas pragma-psect-object}@anchor{d4} @section Pragma Psect_Object @@ -7036,7 +7138,7 @@ EXTERNAL_SYMBOL ::= This pragma is identical in effect to pragma @code{Common_Object}. @node Pragma Pure_Function,Pragma Rational,Pragma Psect_Object,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id35}@anchor{d4}@anchor{gnat_rm/implementation_defined_pragmas pragma-pure-function}@anchor{d5} +@anchor{gnat_rm/implementation_defined_pragmas id35}@anchor{d5}@anchor{gnat_rm/implementation_defined_pragmas pragma-pure-function}@anchor{d6} @section Pragma Pure_Function @@ -7098,7 +7200,7 @@ unit is not a Pure unit in the categorization sense. So for example, a function thus marked is free to @code{with} non-pure units. @node Pragma Rational,Pragma Ravenscar,Pragma Pure_Function,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-rational}@anchor{d6} +@anchor{gnat_rm/implementation_defined_pragmas pragma-rational}@anchor{d7} @section Pragma Rational @@ -7116,7 +7218,7 @@ pragma Profile (Rational); @end example @node Pragma Ravenscar,Pragma Refined_Depends,Pragma Rational,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-ravenscar}@anchor{d7} +@anchor{gnat_rm/implementation_defined_pragmas pragma-ravenscar}@anchor{d8} @section Pragma Ravenscar @@ -7136,7 +7238,7 @@ pragma Profile (Ravenscar); which is the preferred method of setting the @code{Ravenscar} profile. @node Pragma Refined_Depends,Pragma Refined_Global,Pragma Ravenscar,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id36}@anchor{d8}@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-depends}@anchor{d9} +@anchor{gnat_rm/implementation_defined_pragmas id36}@anchor{d9}@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-depends}@anchor{da} @section Pragma Refined_Depends @@ -7169,7 +7271,7 @@ For the semantics of this pragma, see the entry for aspect @code{Refined_Depends the SPARK 2014 Reference Manual, section 6.1.5. @node Pragma Refined_Global,Pragma Refined_Post,Pragma Refined_Depends,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id37}@anchor{da}@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-global}@anchor{db} +@anchor{gnat_rm/implementation_defined_pragmas id37}@anchor{db}@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-global}@anchor{dc} @section Pragma Refined_Global @@ -7194,7 +7296,7 @@ For the semantics of this pragma, see the entry for aspect @code{Refined_Global} the SPARK 2014 Reference Manual, section 6.1.4. @node Pragma Refined_Post,Pragma Refined_State,Pragma Refined_Global,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id38}@anchor{dc}@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-post}@anchor{dd} +@anchor{gnat_rm/implementation_defined_pragmas id38}@anchor{dd}@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-post}@anchor{de} @section Pragma Refined_Post @@ -7207,8 +7309,12 @@ pragma Refined_Post (boolean_EXPRESSION); For the semantics of this pragma, see the entry for aspect @code{Refined_Post} in the SPARK 2014 Reference Manual, section 7.2.7. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + @node Pragma Refined_State,Pragma Relative_Deadline,Pragma Refined_Post,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id39}@anchor{de}@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-state}@anchor{df} +@anchor{gnat_rm/implementation_defined_pragmas id39}@anchor{df}@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-state}@anchor{e0} @section Pragma Refined_State @@ -7234,7 +7340,7 @@ For the semantics of this pragma, see the entry for aspect @code{Refined_State} the SPARK 2014 Reference Manual, section 7.2.2. @node Pragma Relative_Deadline,Pragma Remote_Access_Type,Pragma Refined_State,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-relative-deadline}@anchor{e0} +@anchor{gnat_rm/implementation_defined_pragmas pragma-relative-deadline}@anchor{e1} @section Pragma Relative_Deadline @@ -7249,7 +7355,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Remote_Access_Type,Pragma Rename_Pragma,Pragma Relative_Deadline,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id40}@anchor{e1}@anchor{gnat_rm/implementation_defined_pragmas pragma-remote-access-type}@anchor{e2} +@anchor{gnat_rm/implementation_defined_pragmas id40}@anchor{e2}@anchor{gnat_rm/implementation_defined_pragmas pragma-remote-access-type}@anchor{e3} @section Pragma Remote_Access_Type @@ -7275,7 +7381,7 @@ pertaining to remote access to class-wide types. At instantiation, the actual type must be a remote access to class-wide type. @node Pragma Rename_Pragma,Pragma Restricted_Run_Time,Pragma Remote_Access_Type,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-rename-pragma}@anchor{e3} +@anchor{gnat_rm/implementation_defined_pragmas pragma-rename-pragma}@anchor{e4} @section Pragma Rename_Pragma @@ -7314,7 +7420,7 @@ Pragma Inline_Only will not necessarily mean the same thing as the other Ada compiler; it’s up to you to make sure the semantics are close enough. @node Pragma Restricted_Run_Time,Pragma Restriction_Warnings,Pragma Rename_Pragma,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-restricted-run-time}@anchor{e4} +@anchor{gnat_rm/implementation_defined_pragmas pragma-restricted-run-time}@anchor{e5} @section Pragma Restricted_Run_Time @@ -7335,7 +7441,7 @@ which is the preferred method of setting the restricted run time profile. @node Pragma Restriction_Warnings,Pragma Reviewable,Pragma Restricted_Run_Time,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-restriction-warnings}@anchor{e5} +@anchor{gnat_rm/implementation_defined_pragmas pragma-restriction-warnings}@anchor{e6} @section Pragma Restriction_Warnings @@ -7373,7 +7479,7 @@ generating a warning, but any other use of implementation defined pragmas will cause a warning to be generated. @node Pragma Reviewable,Pragma Secondary_Stack_Size,Pragma Restriction_Warnings,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-reviewable}@anchor{e6} +@anchor{gnat_rm/implementation_defined_pragmas pragma-reviewable}@anchor{e7} @section Pragma Reviewable @@ -7477,7 +7583,7 @@ comprehensive messages identifying possible problems based on this information. @node Pragma Secondary_Stack_Size,Pragma Share_Generic,Pragma Reviewable,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id41}@anchor{e7}@anchor{gnat_rm/implementation_defined_pragmas pragma-secondary-stack-size}@anchor{e8} +@anchor{gnat_rm/implementation_defined_pragmas id41}@anchor{e8}@anchor{gnat_rm/implementation_defined_pragmas pragma-secondary-stack-size}@anchor{e9} @section Pragma Secondary_Stack_Size @@ -7513,7 +7619,7 @@ Note the pragma cannot appear when the restriction @code{No_Secondary_Stack} is in effect. @node Pragma Share_Generic,Pragma Shared,Pragma Secondary_Stack_Size,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-share-generic}@anchor{e9} +@anchor{gnat_rm/implementation_defined_pragmas pragma-share-generic}@anchor{ea} @section Pragma Share_Generic @@ -7531,7 +7637,7 @@ than to check that the given names are all names of generic units or generic instances. @node Pragma Shared,Pragma Short_Circuit_And_Or,Pragma Share_Generic,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id42}@anchor{ea}@anchor{gnat_rm/implementation_defined_pragmas pragma-shared}@anchor{eb} +@anchor{gnat_rm/implementation_defined_pragmas id42}@anchor{eb}@anchor{gnat_rm/implementation_defined_pragmas pragma-shared}@anchor{ec} @section Pragma Shared @@ -7539,7 +7645,7 @@ This pragma is provided for compatibility with Ada 83. The syntax and semantics are identical to pragma Atomic. @node Pragma Short_Circuit_And_Or,Pragma Short_Descriptors,Pragma Shared,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-short-circuit-and-or}@anchor{ec} +@anchor{gnat_rm/implementation_defined_pragmas pragma-short-circuit-and-or}@anchor{ed} @section Pragma Short_Circuit_And_Or @@ -7578,7 +7684,7 @@ See also the pragma @code{Unevaluated_Use_Of_Old} and the restriction with @code{Short_Circuit_And_Or}. @node Pragma Short_Descriptors,Pragma Side_Effects,Pragma Short_Circuit_And_Or,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-short-descriptors}@anchor{ed} +@anchor{gnat_rm/implementation_defined_pragmas pragma-short-descriptors}@anchor{ee} @section Pragma Short_Descriptors @@ -7592,7 +7698,7 @@ This pragma is provided for compatibility with other Ada implementations. It is recognized but ignored by all current versions of GNAT. @node Pragma Side_Effects,Pragma Simple_Storage_Pool_Type,Pragma Short_Descriptors,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id43}@anchor{ee}@anchor{gnat_rm/implementation_defined_pragmas pragma-side-effects}@anchor{ef} +@anchor{gnat_rm/implementation_defined_pragmas id43}@anchor{ef}@anchor{gnat_rm/implementation_defined_pragmas pragma-side-effects}@anchor{f0} @section Pragma Side_Effects @@ -7606,7 +7712,7 @@ For the semantics of this pragma, see the entry for aspect @code{Side_Effects} in the SPARK Reference Manual, section 6.1.12. @node Pragma Simple_Storage_Pool_Type,Pragma Source_File_Name,Pragma Side_Effects,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id44}@anchor{f0}@anchor{gnat_rm/implementation_defined_pragmas pragma-simple-storage-pool-type}@anchor{f1} +@anchor{gnat_rm/implementation_defined_pragmas id44}@anchor{f1}@anchor{gnat_rm/implementation_defined_pragmas pragma-simple-storage-pool-type}@anchor{f2} @section Pragma Simple_Storage_Pool_Type @@ -7660,7 +7766,7 @@ storage-management discipline). An object of a simple storage pool type can be associated with an access type by specifying the attribute -@ref{f2,,Simple_Storage_Pool}. For example: +@ref{f3,,Simple_Storage_Pool}. For example: @example My_Pool : My_Simple_Storage_Pool_Type; @@ -7670,11 +7776,11 @@ type Acc is access My_Data_Type; for Acc'Simple_Storage_Pool use My_Pool; @end example -See attribute @ref{f2,,Simple_Storage_Pool} +See attribute @ref{f3,,Simple_Storage_Pool} for further details. @node Pragma Source_File_Name,Pragma Source_File_Name_Project,Pragma Simple_Storage_Pool_Type,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id45}@anchor{f3}@anchor{gnat_rm/implementation_defined_pragmas pragma-source-file-name}@anchor{f4} +@anchor{gnat_rm/implementation_defined_pragmas id45}@anchor{f4}@anchor{gnat_rm/implementation_defined_pragmas pragma-source-file-name}@anchor{f5} @section Pragma Source_File_Name @@ -7766,20 +7872,20 @@ aware of these pragmas, and so other tools that use the project file would not be aware of the intended naming conventions. If you are using project files, file naming is controlled by Source_File_Name_Project pragmas, which are usually supplied automatically by the project manager. A pragma -Source_File_Name cannot appear after a @ref{f5,,Pragma Source_File_Name_Project}. +Source_File_Name cannot appear after a @ref{f6,,Pragma Source_File_Name_Project}. For more details on the use of the @code{Source_File_Name} pragma, see the sections on @cite{Using Other File Names} and @cite{Alternative File Naming Schemes} in the @cite{GNAT User’s Guide}. @node Pragma Source_File_Name_Project,Pragma Source_Reference,Pragma Source_File_Name,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id46}@anchor{f6}@anchor{gnat_rm/implementation_defined_pragmas pragma-source-file-name-project}@anchor{f5} +@anchor{gnat_rm/implementation_defined_pragmas id46}@anchor{f7}@anchor{gnat_rm/implementation_defined_pragmas pragma-source-file-name-project}@anchor{f6} @section Pragma Source_File_Name_Project This pragma has the same syntax and semantics as pragma Source_File_Name. It is only allowed as a stand-alone configuration pragma. -It cannot appear after a @ref{f4,,Pragma Source_File_Name}, and +It cannot appear after a @ref{f5,,Pragma Source_File_Name}, and most importantly, once pragma Source_File_Name_Project appears, no further Source_File_Name pragmas are allowed. @@ -7791,7 +7897,7 @@ Source_File_Name or Source_File_Name_Project pragmas (which would not be known to the project manager). @node Pragma Source_Reference,Pragma SPARK_Mode,Pragma Source_File_Name_Project,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-source-reference}@anchor{f7} +@anchor{gnat_rm/implementation_defined_pragmas pragma-source-reference}@anchor{f8} @section Pragma Source_Reference @@ -7815,7 +7921,7 @@ string expression other than a string literal. This is because its value is needed for error messages issued by all phases of the compiler. @node Pragma SPARK_Mode,Pragma Static_Elaboration_Desired,Pragma Source_Reference,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id47}@anchor{f8}@anchor{gnat_rm/implementation_defined_pragmas pragma-spark-mode}@anchor{f9} +@anchor{gnat_rm/implementation_defined_pragmas id47}@anchor{f9}@anchor{gnat_rm/implementation_defined_pragmas pragma-spark-mode}@anchor{fa} @section Pragma SPARK_Mode @@ -7897,7 +8003,7 @@ SPARK_Mode (@code{Off}), then that pragma will need to be repeated in the package body. @node Pragma Static_Elaboration_Desired,Pragma Stream_Convert,Pragma SPARK_Mode,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-static-elaboration-desired}@anchor{fa} +@anchor{gnat_rm/implementation_defined_pragmas pragma-static-elaboration-desired}@anchor{fb} @section Pragma Static_Elaboration_Desired @@ -7921,7 +8027,7 @@ construction of larger aggregates with static components that include an others choice.) @node Pragma Stream_Convert,Pragma Style_Checks,Pragma Static_Elaboration_Desired,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-stream-convert}@anchor{fb} +@anchor{gnat_rm/implementation_defined_pragmas pragma-stream-convert}@anchor{fc} @section Pragma Stream_Convert @@ -7998,7 +8104,7 @@ the pragma is silently ignored, and the default implementation of the stream attributes is used instead. @node Pragma Style_Checks,Pragma Subprogram_Variant,Pragma Stream_Convert,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-style-checks}@anchor{fc} +@anchor{gnat_rm/implementation_defined_pragmas pragma-style-checks}@anchor{fd} @section Pragma Style_Checks @@ -8144,7 +8250,7 @@ Rf2 : Integer := ARG; -- OK, no error @end example @node Pragma Subprogram_Variant,Pragma Subtitle,Pragma Style_Checks,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-subprogram-variant}@anchor{fd} +@anchor{gnat_rm/implementation_defined_pragmas pragma-subprogram-variant}@anchor{fe} @section Pragma Subprogram_Variant @@ -8175,8 +8281,12 @@ The @code{Subprogram_Variant} pragma is intended to be an exact replacement for the implementation-defined @code{Subprogram_Variant} aspect, and shares its restrictions and semantics. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + @node Pragma Subtitle,Pragma Suppress,Pragma Subprogram_Variant,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-subtitle}@anchor{fe} +@anchor{gnat_rm/implementation_defined_pragmas pragma-subtitle}@anchor{ff} @section Pragma Subtitle @@ -8190,7 +8300,7 @@ This pragma is recognized for compatibility with other Ada compilers but is ignored by GNAT. @node Pragma Suppress,Pragma Suppress_All,Pragma Subtitle,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress}@anchor{ff} +@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress}@anchor{100} @section Pragma Suppress @@ -8263,7 +8373,7 @@ Of course, run-time checks are omitted whenever the compiler can prove that they will not fail, whether or not checks are suppressed. @node Pragma Suppress_All,Pragma Suppress_Debug_Info,Pragma Suppress,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-all}@anchor{100} +@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-all}@anchor{101} @section Pragma Suppress_All @@ -8282,7 +8392,7 @@ The use of the standard Ada pragma @code{Suppress (All_Checks)} as a normal configuration pragma is the preferred usage in GNAT. @node Pragma Suppress_Debug_Info,Pragma Suppress_Exception_Locations,Pragma Suppress_All,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id48}@anchor{101}@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-debug-info}@anchor{102} +@anchor{gnat_rm/implementation_defined_pragmas id48}@anchor{102}@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-debug-info}@anchor{103} @section Pragma Suppress_Debug_Info @@ -8297,7 +8407,7 @@ for the specified entity. It is intended primarily for use in debugging the debugger, and navigating around debugger problems. @node Pragma Suppress_Exception_Locations,Pragma Suppress_Initialization,Pragma Suppress_Debug_Info,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-exception-locations}@anchor{103} +@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-exception-locations}@anchor{104} @section Pragma Suppress_Exception_Locations @@ -8320,7 +8430,7 @@ a partition, so it is fine to have some units within a partition compiled with this pragma and others compiled in normal mode without it. @node Pragma Suppress_Initialization,Pragma Task_Name,Pragma Suppress_Exception_Locations,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id49}@anchor{104}@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-initialization}@anchor{105} +@anchor{gnat_rm/implementation_defined_pragmas id49}@anchor{105}@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-initialization}@anchor{106} @section Pragma Suppress_Initialization @@ -8365,7 +8475,7 @@ is suppressed, just as though its subtype had been given in a pragma Suppress_Initialization, as described above. @node Pragma Task_Name,Pragma Task_Storage,Pragma Suppress_Initialization,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-task-name}@anchor{106} +@anchor{gnat_rm/implementation_defined_pragmas pragma-task-name}@anchor{107} @section Pragma Task_Name @@ -8421,7 +8531,7 @@ end; @end example @node Pragma Task_Storage,Pragma Test_Case,Pragma Task_Name,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-task-storage}@anchor{107} +@anchor{gnat_rm/implementation_defined_pragmas pragma-task-storage}@anchor{108} @section Pragma Task_Storage @@ -8441,7 +8551,7 @@ created, depending on the target. This pragma can appear anywhere a type. @node Pragma Test_Case,Pragma Thread_Local_Storage,Pragma Task_Storage,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id50}@anchor{108}@anchor{gnat_rm/implementation_defined_pragmas pragma-test-case}@anchor{109} +@anchor{gnat_rm/implementation_defined_pragmas id50}@anchor{109}@anchor{gnat_rm/implementation_defined_pragmas pragma-test-case}@anchor{10a} @section Pragma Test_Case @@ -8497,7 +8607,7 @@ postcondition. Mode @code{Robustness} indicates that the precondition and postcondition of the subprogram should be ignored for this test case. @node Pragma Thread_Local_Storage,Pragma Time_Slice,Pragma Test_Case,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id51}@anchor{10a}@anchor{gnat_rm/implementation_defined_pragmas pragma-thread-local-storage}@anchor{10b} +@anchor{gnat_rm/implementation_defined_pragmas id51}@anchor{10b}@anchor{gnat_rm/implementation_defined_pragmas pragma-thread-local-storage}@anchor{10c} @section Pragma Thread_Local_Storage @@ -8535,7 +8645,7 @@ If this pragma is used on a system where @code{TLS} is not supported, then an error message will be generated and the program will be rejected. @node Pragma Time_Slice,Pragma Title,Pragma Thread_Local_Storage,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-time-slice}@anchor{10c} +@anchor{gnat_rm/implementation_defined_pragmas pragma-time-slice}@anchor{10d} @section Pragma Time_Slice @@ -8551,7 +8661,7 @@ It is ignored if it is used in a system that does not allow this control, or if it appears in other than the main program unit. @node Pragma Title,Pragma Type_Invariant,Pragma Time_Slice,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-title}@anchor{10d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-title}@anchor{10e} @section Pragma Title @@ -8576,7 +8686,7 @@ notation is used, and named and positional notation can be mixed following the normal rules for procedure calls in Ada. @node Pragma Type_Invariant,Pragma Type_Invariant_Class,Pragma Title,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-type-invariant}@anchor{10e} +@anchor{gnat_rm/implementation_defined_pragmas pragma-type-invariant}@anchor{10f} @section Pragma Type_Invariant @@ -8596,8 +8706,12 @@ does not permit a string parameter, and it is controlled by the assertion identifier @code{Type_Invariant} rather than @code{Invariant}. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + @node Pragma Type_Invariant_Class,Pragma Unchecked_Union,Pragma Type_Invariant,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id52}@anchor{10f}@anchor{gnat_rm/implementation_defined_pragmas pragma-type-invariant-class}@anchor{110} +@anchor{gnat_rm/implementation_defined_pragmas id52}@anchor{110}@anchor{gnat_rm/implementation_defined_pragmas pragma-type-invariant-class}@anchor{111} @section Pragma Type_Invariant_Class @@ -8623,8 +8737,12 @@ aspects, but is prepared to ignore the pragmas. The assertion policy that controls this pragma is @code{Type_Invariant'Class}, not @code{Type_Invariant_Class}. +This is an assertion kind pragma that can associate a set of its arguments +with an assertion level. See SPARK 2014 Reference Manual, section +11.4.2. + @node Pragma Unchecked_Union,Pragma Unevaluated_Use_Of_Old,Pragma Type_Invariant_Class,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unchecked-union}@anchor{111} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unchecked-union}@anchor{112} @section Pragma Unchecked_Union @@ -8644,7 +8762,7 @@ version in all language modes (Ada 83, Ada 95, and Ada 2005). For full details, consult the Ada 2012 Reference Manual, section B.3.3. @node Pragma Unevaluated_Use_Of_Old,Pragma User_Aspect_Definition,Pragma Unchecked_Union,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unevaluated-use-of-old}@anchor{112} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unevaluated-use-of-old}@anchor{113} @section Pragma Unevaluated_Use_Of_Old @@ -8699,7 +8817,7 @@ uses up to the end of the corresponding statement sequence or sequence of package declarations. @node Pragma User_Aspect_Definition,Pragma Unimplemented_Unit,Pragma Unevaluated_Use_Of_Old,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-user-aspect-definition}@anchor{113} +@anchor{gnat_rm/implementation_defined_pragmas pragma-user-aspect-definition}@anchor{114} @section Pragma User_Aspect_Definition @@ -8731,7 +8849,7 @@ pragma. If multiple definitions are visible for some aspect at some point, then the definitions must agree. A predefined aspect cannot be redefined. @node Pragma Unimplemented_Unit,Pragma Universal_Aliasing,Pragma User_Aspect_Definition,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unimplemented-unit}@anchor{114} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unimplemented-unit}@anchor{115} @section Pragma Unimplemented_Unit @@ -8751,7 +8869,7 @@ The abort only happens if code is being generated. Thus you can use specs of unimplemented packages in syntax or semantic checking mode. @node Pragma Universal_Aliasing,Pragma Unmodified,Pragma Unimplemented_Unit,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id53}@anchor{115}@anchor{gnat_rm/implementation_defined_pragmas pragma-universal-aliasing}@anchor{116} +@anchor{gnat_rm/implementation_defined_pragmas id53}@anchor{116}@anchor{gnat_rm/implementation_defined_pragmas pragma-universal-aliasing}@anchor{117} @section Pragma Universal_Aliasing @@ -8769,7 +8887,7 @@ they need to be suppressed, see the section on @code{Optimization and Strict Aliasing} in the @cite{GNAT User’s Guide}. @node Pragma Unmodified,Pragma Unreferenced,Pragma Universal_Aliasing,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id54}@anchor{117}@anchor{gnat_rm/implementation_defined_pragmas pragma-unmodified}@anchor{118} +@anchor{gnat_rm/implementation_defined_pragmas id54}@anchor{118}@anchor{gnat_rm/implementation_defined_pragmas pragma-unmodified}@anchor{119} @section Pragma Unmodified @@ -8803,7 +8921,7 @@ Thus it is never necessary to use @code{pragma Unmodified} for such variables, though it is harmless to do so. @node Pragma Unreferenced,Pragma Unreferenced_Objects,Pragma Unmodified,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id55}@anchor{119}@anchor{gnat_rm/implementation_defined_pragmas pragma-unreferenced}@anchor{11a} +@anchor{gnat_rm/implementation_defined_pragmas id55}@anchor{11a}@anchor{gnat_rm/implementation_defined_pragmas pragma-unreferenced}@anchor{11b} @section Pragma Unreferenced @@ -8849,7 +8967,7 @@ Note that if a warning is desired for all calls to a given subprogram, regardless of whether they occur in the same unit as the subprogram declaration, then this pragma should not be used (calls from another unit would not be flagged); pragma Obsolescent can be used instead -for this purpose, see @ref{b6,,Pragma Obsolescent}. +for this purpose, see @ref{b7,,Pragma Obsolescent}. The second form of pragma @code{Unreferenced} is used within a context clause. In this case the arguments must be unit names of units previously @@ -8865,7 +8983,7 @@ Thus it is never necessary to use @code{pragma Unreferenced} for such variables, though it is harmless to do so. @node Pragma Unreferenced_Objects,Pragma Unreserve_All_Interrupts,Pragma Unreferenced,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id56}@anchor{11b}@anchor{gnat_rm/implementation_defined_pragmas pragma-unreferenced-objects}@anchor{11c} +@anchor{gnat_rm/implementation_defined_pragmas id56}@anchor{11c}@anchor{gnat_rm/implementation_defined_pragmas pragma-unreferenced-objects}@anchor{11d} @section Pragma Unreferenced_Objects @@ -8890,7 +9008,7 @@ compiler will automatically suppress unwanted warnings about these variables not being referenced. @node Pragma Unreserve_All_Interrupts,Pragma Unsuppress,Pragma Unreferenced_Objects,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unreserve-all-interrupts}@anchor{11d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unreserve-all-interrupts}@anchor{11e} @section Pragma Unreserve_All_Interrupts @@ -8926,7 +9044,7 @@ handled, see pragma @code{Interrupt_State}, which subsumes the functionality of the @code{Unreserve_All_Interrupts} pragma. @node Pragma Unsuppress,Pragma Unused,Pragma Unreserve_All_Interrupts,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unsuppress}@anchor{11e} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unsuppress}@anchor{11f} @section Pragma Unsuppress @@ -8962,7 +9080,7 @@ number of implementation-defined check names. See the description of pragma @code{Suppress} for full details. @node Pragma Unused,Pragma Use_VADS_Size,Pragma Unsuppress,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id57}@anchor{11f}@anchor{gnat_rm/implementation_defined_pragmas pragma-unused}@anchor{120} +@anchor{gnat_rm/implementation_defined_pragmas id57}@anchor{120}@anchor{gnat_rm/implementation_defined_pragmas pragma-unused}@anchor{121} @section Pragma Unused @@ -8996,7 +9114,7 @@ Thus it is never necessary to use @code{pragma Unused} for such variables, though it is harmless to do so. @node Pragma Use_VADS_Size,Pragma Validity_Checks,Pragma Unused,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-use-vads-size}@anchor{121} +@anchor{gnat_rm/implementation_defined_pragmas pragma-use-vads-size}@anchor{122} @section Pragma Use_VADS_Size @@ -9020,7 +9138,7 @@ as implemented in the VADS compiler. See description of the VADS_Size attribute for further details. @node Pragma Validity_Checks,Pragma Volatile,Pragma Use_VADS_Size,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-validity-checks}@anchor{122} +@anchor{gnat_rm/implementation_defined_pragmas pragma-validity-checks}@anchor{123} @section Pragma Validity_Checks @@ -9076,7 +9194,7 @@ A := C; -- C will be validity checked @end example @node Pragma Volatile,Pragma Volatile_Full_Access,Pragma Validity_Checks,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id58}@anchor{123}@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile}@anchor{124} +@anchor{gnat_rm/implementation_defined_pragmas id58}@anchor{124}@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile}@anchor{125} @section Pragma Volatile @@ -9094,7 +9212,7 @@ implementation of pragma Volatile is upwards compatible with the implementation in DEC Ada 83. @node Pragma Volatile_Full_Access,Pragma Volatile_Function,Pragma Volatile,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id59}@anchor{125}@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile-full-access}@anchor{126} +@anchor{gnat_rm/implementation_defined_pragmas id59}@anchor{126}@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile-full-access}@anchor{127} @section Pragma Volatile_Full_Access @@ -9120,7 +9238,7 @@ is not to the whole object; the compiler is allowed (and generally will) access only part of the object in this case. @node Pragma Volatile_Function,Pragma Warning_As_Error,Pragma Volatile_Full_Access,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id60}@anchor{127}@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile-function}@anchor{128} +@anchor{gnat_rm/implementation_defined_pragmas id60}@anchor{128}@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile-function}@anchor{129} @section Pragma Volatile_Function @@ -9134,7 +9252,7 @@ For the semantics of this pragma, see the entry for aspect @code{Volatile_Functi in the SPARK 2014 Reference Manual, section 7.1.2. @node Pragma Warning_As_Error,Pragma Warnings,Pragma Volatile_Function,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-warning-as-error}@anchor{129} +@anchor{gnat_rm/implementation_defined_pragmas pragma-warning-as-error}@anchor{12a} @section Pragma Warning_As_Error @@ -9174,7 +9292,7 @@ you can use multiple pragma Warning_As_Error. The above use of patterns to match the message applies only to warning messages generated by the front end. This pragma can also be applied to -warnings provided by the back end and mentioned in @ref{12a,,Pragma Warnings}. +warnings provided by the back end and mentioned in @ref{12b,,Pragma Warnings}. By using a single full `-Wxxx' switch in the pragma, such warnings can also be treated as errors. @@ -9224,7 +9342,7 @@ the tag is changed from “warning:” to “error:” and the string “[warning-as-error]” is appended to the end of the message. @node Pragma Warnings,Pragma Weak_External,Pragma Warning_As_Error,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id61}@anchor{12b}@anchor{gnat_rm/implementation_defined_pragmas pragma-warnings}@anchor{12a} +@anchor{gnat_rm/implementation_defined_pragmas id61}@anchor{12c}@anchor{gnat_rm/implementation_defined_pragmas pragma-warnings}@anchor{12b} @section Pragma Warnings @@ -9380,7 +9498,7 @@ selectively for each tool, and as a consequence to detect useless pragma Warnings with switch @code{-gnatw.w}. @node Pragma Weak_External,Pragma Wide_Character_Encoding,Pragma Warnings,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-weak-external}@anchor{12c} +@anchor{gnat_rm/implementation_defined_pragmas pragma-weak-external}@anchor{12d} @section Pragma Weak_External @@ -9431,7 +9549,7 @@ end External_Module; @end example @node Pragma Wide_Character_Encoding,,Pragma Weak_External,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-wide-character-encoding}@anchor{12d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-wide-character-encoding}@anchor{12e} @section Pragma Wide_Character_Encoding @@ -9462,7 +9580,7 @@ encoding within that file, and does not affect withed units, specs, or subunits. @node Implementation Defined Aspects,Implementation Defined Attributes,Implementation Defined Pragmas,Top -@anchor{gnat_rm/implementation_defined_aspects doc}@anchor{12e}@anchor{gnat_rm/implementation_defined_aspects id1}@anchor{12f}@anchor{gnat_rm/implementation_defined_aspects implementation-defined-aspects}@anchor{130} +@anchor{gnat_rm/implementation_defined_aspects doc}@anchor{12f}@anchor{gnat_rm/implementation_defined_aspects id1}@anchor{130}@anchor{gnat_rm/implementation_defined_aspects implementation-defined-aspects}@anchor{131} @chapter Implementation Defined Aspects @@ -9533,6 +9651,7 @@ or attribute definition clause. * Aspect Effective_Writes:: * Aspect Exceptional_Cases:: * Aspect Exit_Cases:: +* Aspect Extended_Access:: * Aspect Extensions_Visible:: * Aspect Favor_Top_Level:: * Aspect Ghost:: @@ -9593,7 +9712,7 @@ or attribute definition clause. @end menu @node Aspect Abstract_State,Aspect Always_Terminates,,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-abstract-state}@anchor{131} +@anchor{gnat_rm/implementation_defined_aspects aspect-abstract-state}@anchor{132} @section Aspect Abstract_State @@ -9602,7 +9721,7 @@ or attribute definition clause. This aspect is equivalent to @ref{1e,,pragma Abstract_State}. @node Aspect Always_Terminates,Aspect Annotate,Aspect Abstract_State,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-always-terminates}@anchor{132} +@anchor{gnat_rm/implementation_defined_aspects aspect-always-terminates}@anchor{133} @section Aspect Always_Terminates @@ -9611,7 +9730,7 @@ This aspect is equivalent to @ref{1e,,pragma Abstract_State}. This boolean aspect is equivalent to @ref{29,,pragma Always_Terminates}. @node Aspect Annotate,Aspect Async_Readers,Aspect Always_Terminates,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-annotate}@anchor{133} +@anchor{gnat_rm/implementation_defined_aspects aspect-annotate}@anchor{134} @section Aspect Annotate @@ -9638,63 +9757,63 @@ Equivalent to @code{pragma Annotate (ID, ID @{, ARG@}, Entity => Name);} @end table @node Aspect Async_Readers,Aspect Async_Writers,Aspect Annotate,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-async-readers}@anchor{134} +@anchor{gnat_rm/implementation_defined_aspects aspect-async-readers}@anchor{135} @section Aspect Async_Readers @geindex Async_Readers -This boolean aspect is equivalent to @ref{32,,pragma Async_Readers}. +This boolean aspect is equivalent to @ref{33,,pragma Async_Readers}. @node Aspect Async_Writers,Aspect Constant_After_Elaboration,Aspect Async_Readers,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-async-writers}@anchor{135} +@anchor{gnat_rm/implementation_defined_aspects aspect-async-writers}@anchor{136} @section Aspect Async_Writers @geindex Async_Writers -This boolean aspect is equivalent to @ref{34,,pragma Async_Writers}. +This boolean aspect is equivalent to @ref{35,,pragma Async_Writers}. @node Aspect Constant_After_Elaboration,Aspect Contract_Cases,Aspect Async_Writers,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-constant-after-elaboration}@anchor{136} +@anchor{gnat_rm/implementation_defined_aspects aspect-constant-after-elaboration}@anchor{137} @section Aspect Constant_After_Elaboration @geindex Constant_After_Elaboration -This aspect is equivalent to @ref{44,,pragma Constant_After_Elaboration}. +This aspect is equivalent to @ref{45,,pragma Constant_After_Elaboration}. @node Aspect Contract_Cases,Aspect Depends,Aspect Constant_After_Elaboration,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-contract-cases}@anchor{137} +@anchor{gnat_rm/implementation_defined_aspects aspect-contract-cases}@anchor{138} @section Aspect Contract_Cases @geindex Contract_Cases -This aspect is equivalent to @ref{46,,pragma Contract_Cases}, the sequence +This aspect is equivalent to @ref{47,,pragma Contract_Cases}, the sequence of clauses being enclosed in parentheses so that syntactically it is an aggregate. @node Aspect Depends,Aspect Default_Initial_Condition,Aspect Contract_Cases,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-depends}@anchor{138} +@anchor{gnat_rm/implementation_defined_aspects aspect-depends}@anchor{139} @section Aspect Depends @geindex Depends -This aspect is equivalent to @ref{56,,pragma Depends}. +This aspect is equivalent to @ref{57,,pragma Depends}. @node Aspect Default_Initial_Condition,Aspect Dimension,Aspect Depends,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-default-initial-condition}@anchor{139} +@anchor{gnat_rm/implementation_defined_aspects aspect-default-initial-condition}@anchor{13a} @section Aspect Default_Initial_Condition @geindex Default_Initial_Condition -This aspect is equivalent to @ref{52,,pragma Default_Initial_Condition}. +This aspect is equivalent to @ref{53,,pragma Default_Initial_Condition}. @node Aspect Dimension,Aspect Dimension_System,Aspect Default_Initial_Condition,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-dimension}@anchor{13a} +@anchor{gnat_rm/implementation_defined_aspects aspect-dimension}@anchor{13b} @section Aspect Dimension @@ -9730,7 +9849,7 @@ Note that when the dimensioned type is an integer type, then any dimension value must be an integer literal. @node Aspect Dimension_System,Aspect Disable_Controlled,Aspect Dimension,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-dimension-system}@anchor{13b} +@anchor{gnat_rm/implementation_defined_aspects aspect-dimension-system}@anchor{13c} @section Aspect Dimension_System @@ -9790,7 +9909,7 @@ See section ‘Performing Dimensionality Analysis in GNAT’ in the GNAT Users Guide for detailed examples of use of the dimension system. @node Aspect Disable_Controlled,Aspect Effective_Reads,Aspect Dimension_System,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-disable-controlled}@anchor{13c} +@anchor{gnat_rm/implementation_defined_aspects aspect-disable-controlled}@anchor{13d} @section Aspect Disable_Controlled @@ -9803,25 +9922,25 @@ where for example you might want a record to be controlled or not depending on whether some run-time check is enabled or suppressed. @node Aspect Effective_Reads,Aspect Effective_Writes,Aspect Disable_Controlled,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-effective-reads}@anchor{13d} +@anchor{gnat_rm/implementation_defined_aspects aspect-effective-reads}@anchor{13e} @section Aspect Effective_Reads @geindex Effective_Reads -This aspect is equivalent to @ref{5b,,pragma Effective_Reads}. +This aspect is equivalent to @ref{5c,,pragma Effective_Reads}. @node Aspect Effective_Writes,Aspect Exceptional_Cases,Aspect Effective_Reads,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-effective-writes}@anchor{13e} +@anchor{gnat_rm/implementation_defined_aspects aspect-effective-writes}@anchor{13f} @section Aspect Effective_Writes @geindex Effective_Writes -This aspect is equivalent to @ref{5d,,pragma Effective_Writes}. +This aspect is equivalent to @ref{5e,,pragma Effective_Writes}. @node Aspect Exceptional_Cases,Aspect Exit_Cases,Aspect Effective_Writes,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-exceptional-cases}@anchor{13f} +@anchor{gnat_rm/implementation_defined_aspects aspect-exceptional-cases}@anchor{140} @section Aspect Exceptional_Cases @@ -9835,8 +9954,8 @@ with a specific postcondition. For the syntax and semantics of this aspect, see the SPARK 2014 Reference Manual, section 6.1.9. -@node Aspect Exit_Cases,Aspect Extensions_Visible,Aspect Exceptional_Cases,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-exit-cases}@anchor{140} +@node Aspect Exit_Cases,Aspect Extended_Access,Aspect Exceptional_Cases,Implementation Defined Aspects +@anchor{gnat_rm/implementation_defined_aspects aspect-exit-cases}@anchor{141} @section Aspect Exit_Cases @@ -9850,35 +9969,132 @@ or propagate an exception). For the syntax and semantics of this aspect, see the SPARK 2014 Reference Manual, section 6.1.10. -@node Aspect Extensions_Visible,Aspect Favor_Top_Level,Aspect Exit_Cases,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-extensions-visible}@anchor{141} +@node Aspect Extended_Access,Aspect Extensions_Visible,Aspect Exit_Cases,Implementation Defined Aspects +@anchor{gnat_rm/implementation_defined_aspects aspect-extended-access}@anchor{142} +@section Aspect Extended_Access + + +This nonoverridable boolean-valued type-related representation aspect can be +specified as part of a full_type_declaration for a general access type +designating an unconstrained array subtype. + +The absence of an Extended_Access aspect specification for such a +full_type_declaration is equivalent to an explicit +“Extended_Access => False” specification. This implies +that the aspect is never unspecified for an eligible access type. +An access type for which this aspect is True is said to be an extended access +type; this includes the case of a type derived from an extended access type. +Similarly, a value of such a type is said to be an extended access value. + +The representation of an extended access value is different than that of +other access values. This representation makes it possible to designate +objects that cannot be designated using the usual “thin” or “fat” access +representations for an access type designating an unconstrained array +subtype (notably slices and array objects imported from other languages). + +In particular, two rules are modified in determining the legality of an Access +or Unchecked_Access attribute reference if the expected access type is +an extended access type: + + +@itemize * + +@item +A slice of an aliased array object of a non-bitpacked type (more precisely, +of an array type having independently addressable components) is considered +to be aliased (and the accessibility level of a slice of an array object is +defined to be that of the array object); this also applies to renamings +of such slices, slices of such renamings, etc. + +@item +The requirement that the nominal subtype of the prefix shall statically +match the designated subtype of the access type need not be met. +@end itemize + +The Size aspect (and other aspects including Stream_Size, Object_Size, +and Alignment) of an extended access type may depend on the properties of the +designated type. Further details of this dependence are not documented. + +An extended access value is not convertible to a non-extended access type, +although conversions in the opposite direction are allowed. We don’t want +to allow + +@example +type Big_Ref is access all String with Extended_Access; +type Small_Ref is access all String; +Obj : aliased String := "abcde"; +Big_Ptr : Big_Ref := Obj (2 .. 4)'Access; -- OK +Small_Ptr : Small_Ref := Small_Ref (Big_Ptr); -- ERROR: illegal conversion +@end example + +because there is no way to represent the result of such a conversion. + +A dereference of an extended access value (or a reference to a renaming +thereof) shall not occur in any of the following contexts: + + +@itemize * + +@item +as an operative constituent of the prefix of an Access or +Unchecked_Access attribute reference whose expected type is not extended; or + +@item +as an operative constituent of an actual parameter in a call where +the corresponding formal parameter is explicitly aliased. +@end itemize + +For the same reasons that explicit conversions from an extended access type to a +non-extended access type are forbidden, we also need to disallow getting the +same effect via a Extended_Ptr.all’Access reference; this includes the case +of passing Extended_Ptr.all as an actual parameter in a call where the +corresponding formal parameter is explicitly aliased (because the callee +could evaluate Formal_Parameter’Access). This goal is accomplished by +adjusting the definition of the term “aliased”. A dereference of an extended +value occurring in one of these contexts is defined to denote +a nonaliased view. This has the desired effect because these contexts require +an aliased view. Continuing the preceding example, this rule disallows + +@example +Sneaky_1 : Small_Ptr := Big_Ptr.all'Access; -- ERROR: illegal 'Access prefix + +function Make (Str : aliased in out String) return Small_Ptr + is (Str'Access); -- OK + +Sneaky_2 : Small_Ptr := Make (Str => Big_Ptr.all); -- ERROR: bad parameter +@end example + +for the same reason given above in the case of an explicit type conversion. + +@node Aspect Extensions_Visible,Aspect Favor_Top_Level,Aspect Extended_Access,Implementation Defined Aspects +@anchor{gnat_rm/implementation_defined_aspects aspect-extensions-visible}@anchor{143} @section Aspect Extensions_Visible @geindex Extensions_Visible -This aspect is equivalent to @ref{6d,,pragma Extensions_Visible}. +This aspect is equivalent to @ref{6e,,pragma Extensions_Visible}. @node Aspect Favor_Top_Level,Aspect Ghost,Aspect Extensions_Visible,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-favor-top-level}@anchor{142} +@anchor{gnat_rm/implementation_defined_aspects aspect-favor-top-level}@anchor{144} @section Aspect Favor_Top_Level @geindex Favor_Top_Level -This boolean aspect is equivalent to @ref{72,,pragma Favor_Top_Level}. +This boolean aspect is equivalent to @ref{73,,pragma Favor_Top_Level}. @node Aspect Ghost,Aspect Ghost_Predicate,Aspect Favor_Top_Level,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-ghost}@anchor{143} +@anchor{gnat_rm/implementation_defined_aspects aspect-ghost}@anchor{145} @section Aspect Ghost @geindex Ghost -This aspect is equivalent to @ref{76,,pragma Ghost}. +This aspect is equivalent to @ref{77,,pragma Ghost}. @node Aspect Ghost_Predicate,Aspect Global,Aspect Ghost,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-ghost-predicate}@anchor{144} +@anchor{gnat_rm/implementation_defined_aspects aspect-ghost-predicate}@anchor{146} @section Aspect Ghost_Predicate @@ -9891,65 +10107,65 @@ For the detailed semantics of this aspect, see the entry for subtype predicates in the SPARK Reference Manual, section 3.2.4. @node Aspect Global,Aspect Initial_Condition,Aspect Ghost_Predicate,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-global}@anchor{145} +@anchor{gnat_rm/implementation_defined_aspects aspect-global}@anchor{147} @section Aspect Global @geindex Global -This aspect is equivalent to @ref{78,,pragma Global}. +This aspect is equivalent to @ref{79,,pragma Global}. @node Aspect Initial_Condition,Aspect Initializes,Aspect Global,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-initial-condition}@anchor{146} +@anchor{gnat_rm/implementation_defined_aspects aspect-initial-condition}@anchor{148} @section Aspect Initial_Condition @geindex Initial_Condition -This aspect is equivalent to @ref{85,,pragma Initial_Condition}. +This aspect is equivalent to @ref{86,,pragma Initial_Condition}. @node Aspect Initializes,Aspect Inline_Always,Aspect Initial_Condition,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-initializes}@anchor{147} +@anchor{gnat_rm/implementation_defined_aspects aspect-initializes}@anchor{149} @section Aspect Initializes @geindex Initializes -This aspect is equivalent to @ref{88,,pragma Initializes}. +This aspect is equivalent to @ref{89,,pragma Initializes}. @node Aspect Inline_Always,Aspect Invariant,Aspect Initializes,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-inline-always}@anchor{148} +@anchor{gnat_rm/implementation_defined_aspects aspect-inline-always}@anchor{14a} @section Aspect Inline_Always @geindex Inline_Always -This boolean aspect is equivalent to @ref{8a,,pragma Inline_Always}. +This boolean aspect is equivalent to @ref{8b,,pragma Inline_Always}. @node Aspect Invariant,Aspect Invariant’Class,Aspect Inline_Always,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-invariant}@anchor{149} +@anchor{gnat_rm/implementation_defined_aspects aspect-invariant}@anchor{14b} @section Aspect Invariant @geindex Invariant -This aspect is equivalent to @ref{92,,pragma Invariant}. It is a +This aspect is equivalent to @ref{93,,pragma Invariant}. It is a synonym for the language defined aspect @code{Type_Invariant} except that it is separately controllable using pragma @code{Assertion_Policy}. @node Aspect Invariant’Class,Aspect Iterable,Aspect Invariant,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-invariant-class}@anchor{14a} +@anchor{gnat_rm/implementation_defined_aspects aspect-invariant-class}@anchor{14c} @section Aspect Invariant’Class @geindex Invariant'Class -This aspect is equivalent to @ref{110,,pragma Type_Invariant_Class}. It is a +This aspect is equivalent to @ref{111,,pragma Type_Invariant_Class}. It is a synonym for the language defined aspect @code{Type_Invariant'Class} except that it is separately controllable using pragma @code{Assertion_Policy}. @node Aspect Iterable,Aspect Linker_Section,Aspect Invariant’Class,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-iterable}@anchor{14b} +@anchor{gnat_rm/implementation_defined_aspects aspect-iterable}@anchor{14d} @section Aspect Iterable @@ -10033,16 +10249,16 @@ function Get_Element (Cont : Container; Position : Cursor) return Element_Type; This aspect is used in the GNAT-defined formal container packages. @node Aspect Linker_Section,Aspect Local_Restrictions,Aspect Iterable,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-linker-section}@anchor{14c} +@anchor{gnat_rm/implementation_defined_aspects aspect-linker-section}@anchor{14e} @section Aspect Linker_Section @geindex Linker_Section -This aspect is equivalent to @ref{9a,,pragma Linker_Section}. +This aspect is equivalent to @ref{9b,,pragma Linker_Section}. @node Aspect Local_Restrictions,Aspect Lock_Free,Aspect Linker_Section,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-local-restrictions}@anchor{14d} +@anchor{gnat_rm/implementation_defined_aspects aspect-local-restrictions}@anchor{14f} @section Aspect Local_Restrictions @@ -10096,73 +10312,73 @@ case of a declaration that occurs within nested packages that each have a Local_Restrictions specification). @node Aspect Lock_Free,Aspect Max_Queue_Length,Aspect Local_Restrictions,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-lock-free}@anchor{14e} +@anchor{gnat_rm/implementation_defined_aspects aspect-lock-free}@anchor{150} @section Aspect Lock_Free @geindex Lock_Free -This boolean aspect is equivalent to @ref{9c,,pragma Lock_Free}. +This boolean aspect is equivalent to @ref{9d,,pragma Lock_Free}. @node Aspect Max_Queue_Length,Aspect No_Caching,Aspect Lock_Free,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-max-queue-length}@anchor{14f} +@anchor{gnat_rm/implementation_defined_aspects aspect-max-queue-length}@anchor{151} @section Aspect Max_Queue_Length @geindex Max_Queue_Length -This aspect is equivalent to @ref{a4,,pragma Max_Queue_Length}. +This aspect is equivalent to @ref{a5,,pragma Max_Queue_Length}. @node Aspect No_Caching,Aspect No_Elaboration_Code_All,Aspect Max_Queue_Length,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-no-caching}@anchor{150} +@anchor{gnat_rm/implementation_defined_aspects aspect-no-caching}@anchor{152} @section Aspect No_Caching @geindex No_Caching -This boolean aspect is equivalent to @ref{a7,,pragma No_Caching}. +This boolean aspect is equivalent to @ref{a8,,pragma No_Caching}. @node Aspect No_Elaboration_Code_All,Aspect No_Inline,Aspect No_Caching,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-no-elaboration-code-all}@anchor{151} +@anchor{gnat_rm/implementation_defined_aspects aspect-no-elaboration-code-all}@anchor{153} @section Aspect No_Elaboration_Code_All @geindex No_Elaboration_Code_All -This aspect is equivalent to @ref{aa,,pragma No_Elaboration_Code_All} +This aspect is equivalent to @ref{ab,,pragma No_Elaboration_Code_All} for a program unit. @node Aspect No_Inline,Aspect No_Raise,Aspect No_Elaboration_Code_All,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-no-inline}@anchor{152} +@anchor{gnat_rm/implementation_defined_aspects aspect-no-inline}@anchor{154} @section Aspect No_Inline @geindex No_Inline -This boolean aspect is equivalent to @ref{ad,,pragma No_Inline}. +This boolean aspect is equivalent to @ref{ae,,pragma No_Inline}. @node Aspect No_Raise,Aspect No_Tagged_Streams,Aspect No_Inline,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-no-raise}@anchor{153} +@anchor{gnat_rm/implementation_defined_aspects aspect-no-raise}@anchor{155} @section Aspect No_Raise @geindex No_Raise -This boolean aspect is equivalent to @ref{af,,pragma No_Raise}. +This boolean aspect is equivalent to @ref{b0,,pragma No_Raise}. @node Aspect No_Tagged_Streams,Aspect No_Task_Parts,Aspect No_Raise,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-no-tagged-streams}@anchor{154} +@anchor{gnat_rm/implementation_defined_aspects aspect-no-tagged-streams}@anchor{156} @section Aspect No_Tagged_Streams @geindex No_Tagged_Streams -This aspect is equivalent to @ref{b3,,pragma No_Tagged_Streams} with an +This aspect is equivalent to @ref{b4,,pragma No_Tagged_Streams} with an argument specifying a root tagged type (thus this aspect can only be applied to such a type). @node Aspect No_Task_Parts,Aspect Object_Size,Aspect No_Tagged_Streams,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-no-task-parts}@anchor{155} +@anchor{gnat_rm/implementation_defined_aspects aspect-no-task-parts}@anchor{157} @section Aspect No_Task_Parts @@ -10178,45 +10394,45 @@ away certain tasking-related code that would otherwise be needed for T’Class, because descendants of T might contain tasks. @node Aspect Object_Size,Aspect Obsolescent,Aspect No_Task_Parts,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-object-size}@anchor{156} +@anchor{gnat_rm/implementation_defined_aspects aspect-object-size}@anchor{158} @section Aspect Object_Size @geindex Object_Size -This aspect is equivalent to @ref{157,,attribute Object_Size}. +This aspect is equivalent to @ref{159,,attribute Object_Size}. @node Aspect Obsolescent,Aspect Part_Of,Aspect Object_Size,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-obsolescent}@anchor{158} +@anchor{gnat_rm/implementation_defined_aspects aspect-obsolescent}@anchor{15a} @section Aspect Obsolescent @geindex Obsolescent -This aspect is equivalent to @ref{b6,,pragma Obsolescent}. Note that the +This aspect is equivalent to @ref{b7,,pragma Obsolescent}. Note that the evaluation of this aspect happens at the point of occurrence, it is not delayed until the freeze point. @node Aspect Part_Of,Aspect Persistent_BSS,Aspect Obsolescent,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-part-of}@anchor{159} +@anchor{gnat_rm/implementation_defined_aspects aspect-part-of}@anchor{15b} @section Aspect Part_Of @geindex Part_Of -This aspect is equivalent to @ref{bc,,pragma Part_Of}. +This aspect is equivalent to @ref{bd,,pragma Part_Of}. @node Aspect Persistent_BSS,Aspect Potentially_Invalid,Aspect Part_Of,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-persistent-bss}@anchor{15a} +@anchor{gnat_rm/implementation_defined_aspects aspect-persistent-bss}@anchor{15c} @section Aspect Persistent_BSS @geindex Persistent_BSS -This boolean aspect is equivalent to @ref{c0,,pragma Persistent_BSS}. +This boolean aspect is equivalent to @ref{c1,,pragma Persistent_BSS}. @node Aspect Potentially_Invalid,Aspect Predicate,Aspect Persistent_BSS,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-potentially-invalid}@anchor{15b} +@anchor{gnat_rm/implementation_defined_aspects aspect-potentially-invalid}@anchor{15d} @section Aspect Potentially_Invalid @@ -10226,13 +10442,13 @@ For the syntax and semantics of this aspect, see the SPARK 2014 Reference Manual, section 13.9.1. @node Aspect Predicate,Aspect Program_Exit,Aspect Potentially_Invalid,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-predicate}@anchor{15c} +@anchor{gnat_rm/implementation_defined_aspects aspect-predicate}@anchor{15e} @section Aspect Predicate @geindex Predicate -This aspect is equivalent to @ref{c7,,pragma Predicate}. It is thus +This aspect is equivalent to @ref{c8,,pragma Predicate}. It is thus similar to the language defined aspects @code{Dynamic_Predicate} and @code{Static_Predicate} except that whether the resulting predicate is static or dynamic is controlled by the form of the @@ -10240,61 +10456,61 @@ expression. It is also separately controllable using pragma @code{Assertion_Policy}. @node Aspect Program_Exit,Aspect Pure_Function,Aspect Predicate,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-program-exit}@anchor{15d} +@anchor{gnat_rm/implementation_defined_aspects aspect-program-exit}@anchor{15f} @section Aspect Program_Exit @geindex Program_Exit -This boolean aspect is equivalent to @ref{d0,,pragma Program_Exit}. +This boolean aspect is equivalent to @ref{d1,,pragma Program_Exit}. @node Aspect Pure_Function,Aspect Refined_Depends,Aspect Program_Exit,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-pure-function}@anchor{15e} +@anchor{gnat_rm/implementation_defined_aspects aspect-pure-function}@anchor{160} @section Aspect Pure_Function @geindex Pure_Function -This boolean aspect is equivalent to @ref{d5,,pragma Pure_Function}. +This boolean aspect is equivalent to @ref{d6,,pragma Pure_Function}. @node Aspect Refined_Depends,Aspect Refined_Global,Aspect Pure_Function,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-refined-depends}@anchor{15f} +@anchor{gnat_rm/implementation_defined_aspects aspect-refined-depends}@anchor{161} @section Aspect Refined_Depends @geindex Refined_Depends -This aspect is equivalent to @ref{d9,,pragma Refined_Depends}. +This aspect is equivalent to @ref{da,,pragma Refined_Depends}. @node Aspect Refined_Global,Aspect Refined_Post,Aspect Refined_Depends,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-refined-global}@anchor{160} +@anchor{gnat_rm/implementation_defined_aspects aspect-refined-global}@anchor{162} @section Aspect Refined_Global @geindex Refined_Global -This aspect is equivalent to @ref{db,,pragma Refined_Global}. +This aspect is equivalent to @ref{dc,,pragma Refined_Global}. @node Aspect Refined_Post,Aspect Refined_State,Aspect Refined_Global,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-refined-post}@anchor{161} +@anchor{gnat_rm/implementation_defined_aspects aspect-refined-post}@anchor{163} @section Aspect Refined_Post @geindex Refined_Post -This aspect is equivalent to @ref{dd,,pragma Refined_Post}. +This aspect is equivalent to @ref{de,,pragma Refined_Post}. @node Aspect Refined_State,Aspect Relaxed_Initialization,Aspect Refined_Post,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-refined-state}@anchor{162} +@anchor{gnat_rm/implementation_defined_aspects aspect-refined-state}@anchor{164} @section Aspect Refined_State @geindex Refined_State -This aspect is equivalent to @ref{df,,pragma Refined_State}. +This aspect is equivalent to @ref{e0,,pragma Refined_State}. @node Aspect Relaxed_Initialization,Aspect Remote_Access_Type,Aspect Refined_State,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-relaxed-initialization}@anchor{163} +@anchor{gnat_rm/implementation_defined_aspects aspect-relaxed-initialization}@anchor{165} @section Aspect Relaxed_Initialization @@ -10304,82 +10520,82 @@ For the syntax and semantics of this aspect, see the SPARK 2014 Reference Manual, section 6.10. @node Aspect Remote_Access_Type,Aspect Scalar_Storage_Order,Aspect Relaxed_Initialization,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-remote-access-type}@anchor{164} +@anchor{gnat_rm/implementation_defined_aspects aspect-remote-access-type}@anchor{166} @section Aspect Remote_Access_Type @geindex Remote_Access_Type -This aspect is equivalent to @ref{e2,,pragma Remote_Access_Type}. +This aspect is equivalent to @ref{e3,,pragma Remote_Access_Type}. @node Aspect Scalar_Storage_Order,Aspect Secondary_Stack_Size,Aspect Remote_Access_Type,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-scalar-storage-order}@anchor{165} +@anchor{gnat_rm/implementation_defined_aspects aspect-scalar-storage-order}@anchor{167} @section Aspect Scalar_Storage_Order @geindex Scalar_Storage_Order -This aspect is equivalent to a @ref{166,,attribute Scalar_Storage_Order}. +This aspect is equivalent to a @ref{168,,attribute Scalar_Storage_Order}. @node Aspect Secondary_Stack_Size,Aspect Shared,Aspect Scalar_Storage_Order,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-secondary-stack-size}@anchor{167} +@anchor{gnat_rm/implementation_defined_aspects aspect-secondary-stack-size}@anchor{169} @section Aspect Secondary_Stack_Size @geindex Secondary_Stack_Size -This aspect is equivalent to @ref{e8,,pragma Secondary_Stack_Size}. +This aspect is equivalent to @ref{e9,,pragma Secondary_Stack_Size}. @node Aspect Shared,Aspect Side_Effects,Aspect Secondary_Stack_Size,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-shared}@anchor{168} +@anchor{gnat_rm/implementation_defined_aspects aspect-shared}@anchor{16a} @section Aspect Shared @geindex Shared -This boolean aspect is equivalent to @ref{eb,,pragma Shared} +This boolean aspect is equivalent to @ref{ec,,pragma Shared} and is thus a synonym for aspect @code{Atomic}. @node Aspect Side_Effects,Aspect Simple_Storage_Pool,Aspect Shared,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-side-effects}@anchor{169} +@anchor{gnat_rm/implementation_defined_aspects aspect-side-effects}@anchor{16b} @section Aspect Side_Effects @geindex Side_Effects -This aspect is equivalent to @ref{ef,,pragma Side_Effects}. +This aspect is equivalent to @ref{f0,,pragma Side_Effects}. @node Aspect Simple_Storage_Pool,Aspect Simple_Storage_Pool_Type,Aspect Side_Effects,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-simple-storage-pool}@anchor{16a} +@anchor{gnat_rm/implementation_defined_aspects aspect-simple-storage-pool}@anchor{16c} @section Aspect Simple_Storage_Pool @geindex Simple_Storage_Pool -This aspect is equivalent to @ref{f2,,attribute Simple_Storage_Pool}. +This aspect is equivalent to @ref{f3,,attribute Simple_Storage_Pool}. @node Aspect Simple_Storage_Pool_Type,Aspect SPARK_Mode,Aspect Simple_Storage_Pool,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-simple-storage-pool-type}@anchor{16b} +@anchor{gnat_rm/implementation_defined_aspects aspect-simple-storage-pool-type}@anchor{16d} @section Aspect Simple_Storage_Pool_Type @geindex Simple_Storage_Pool_Type -This boolean aspect is equivalent to @ref{f1,,pragma Simple_Storage_Pool_Type}. +This boolean aspect is equivalent to @ref{f2,,pragma Simple_Storage_Pool_Type}. @node Aspect SPARK_Mode,Aspect Subprogram_Variant,Aspect Simple_Storage_Pool_Type,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-spark-mode}@anchor{16c} +@anchor{gnat_rm/implementation_defined_aspects aspect-spark-mode}@anchor{16e} @section Aspect SPARK_Mode @geindex SPARK_Mode -This aspect is equivalent to @ref{f9,,pragma SPARK_Mode} and +This aspect is equivalent to @ref{fa,,pragma SPARK_Mode} and may be specified for either or both of the specification and body of a subprogram or package. @node Aspect Subprogram_Variant,Aspect Suppress_Debug_Info,Aspect SPARK_Mode,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-subprogram-variant}@anchor{16d} +@anchor{gnat_rm/implementation_defined_aspects aspect-subprogram-variant}@anchor{16f} @section Aspect Subprogram_Variant @@ -10389,83 +10605,83 @@ For the syntax and semantics of this aspect, see the SPARK 2014 Reference Manual, section 6.1.8. @node Aspect Suppress_Debug_Info,Aspect Suppress_Initialization,Aspect Subprogram_Variant,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-suppress-debug-info}@anchor{16e} +@anchor{gnat_rm/implementation_defined_aspects aspect-suppress-debug-info}@anchor{170} @section Aspect Suppress_Debug_Info @geindex Suppress_Debug_Info -This boolean aspect is equivalent to @ref{102,,pragma Suppress_Debug_Info}. +This boolean aspect is equivalent to @ref{103,,pragma Suppress_Debug_Info}. @node Aspect Suppress_Initialization,Aspect Test_Case,Aspect Suppress_Debug_Info,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-suppress-initialization}@anchor{16f} +@anchor{gnat_rm/implementation_defined_aspects aspect-suppress-initialization}@anchor{171} @section Aspect Suppress_Initialization @geindex Suppress_Initialization -This boolean aspect is equivalent to @ref{105,,pragma Suppress_Initialization}. +This boolean aspect is equivalent to @ref{106,,pragma Suppress_Initialization}. @node Aspect Test_Case,Aspect Thread_Local_Storage,Aspect Suppress_Initialization,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-test-case}@anchor{170} +@anchor{gnat_rm/implementation_defined_aspects aspect-test-case}@anchor{172} @section Aspect Test_Case @geindex Test_Case -This aspect is equivalent to @ref{109,,pragma Test_Case}. +This aspect is equivalent to @ref{10a,,pragma Test_Case}. @node Aspect Thread_Local_Storage,Aspect Universal_Aliasing,Aspect Test_Case,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-thread-local-storage}@anchor{171} +@anchor{gnat_rm/implementation_defined_aspects aspect-thread-local-storage}@anchor{173} @section Aspect Thread_Local_Storage @geindex Thread_Local_Storage -This boolean aspect is equivalent to @ref{10b,,pragma Thread_Local_Storage}. +This boolean aspect is equivalent to @ref{10c,,pragma Thread_Local_Storage}. @node Aspect Universal_Aliasing,Aspect Unmodified,Aspect Thread_Local_Storage,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-universal-aliasing}@anchor{172} +@anchor{gnat_rm/implementation_defined_aspects aspect-universal-aliasing}@anchor{174} @section Aspect Universal_Aliasing @geindex Universal_Aliasing -This boolean aspect is equivalent to @ref{116,,pragma Universal_Aliasing}. +This boolean aspect is equivalent to @ref{117,,pragma Universal_Aliasing}. @node Aspect Unmodified,Aspect Unreferenced,Aspect Universal_Aliasing,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-unmodified}@anchor{173} +@anchor{gnat_rm/implementation_defined_aspects aspect-unmodified}@anchor{175} @section Aspect Unmodified @geindex Unmodified -This boolean aspect is equivalent to @ref{118,,pragma Unmodified}. +This boolean aspect is equivalent to @ref{119,,pragma Unmodified}. @node Aspect Unreferenced,Aspect Unreferenced_Objects,Aspect Unmodified,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-unreferenced}@anchor{174} +@anchor{gnat_rm/implementation_defined_aspects aspect-unreferenced}@anchor{176} @section Aspect Unreferenced @geindex Unreferenced -This boolean aspect is equivalent to @ref{11a,,pragma Unreferenced}. +This boolean aspect is equivalent to @ref{11b,,pragma Unreferenced}. When using the @code{-gnat2022} switch, this aspect is also supported on formal parameters, which is in particular the only form possible for expression functions. @node Aspect Unreferenced_Objects,Aspect User_Aspect,Aspect Unreferenced,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-unreferenced-objects}@anchor{175} +@anchor{gnat_rm/implementation_defined_aspects aspect-unreferenced-objects}@anchor{177} @section Aspect Unreferenced_Objects @geindex Unreferenced_Objects -This boolean aspect is equivalent to @ref{11c,,pragma Unreferenced_Objects}. +This boolean aspect is equivalent to @ref{11d,,pragma Unreferenced_Objects}. @node Aspect User_Aspect,Aspect Value_Size,Aspect Unreferenced_Objects,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-user-aspect}@anchor{176} +@anchor{gnat_rm/implementation_defined_aspects aspect-user-aspect}@anchor{178} @section Aspect User_Aspect @@ -10478,45 +10694,45 @@ replicating the set of aspect specifications associated with the named pragma-defined aspect. @node Aspect Value_Size,Aspect Volatile_Full_Access,Aspect User_Aspect,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-value-size}@anchor{177} +@anchor{gnat_rm/implementation_defined_aspects aspect-value-size}@anchor{179} @section Aspect Value_Size @geindex Value_Size -This aspect is equivalent to @ref{178,,attribute Value_Size}. +This aspect is equivalent to @ref{17a,,attribute Value_Size}. @node Aspect Volatile_Full_Access,Aspect Volatile_Function,Aspect Value_Size,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-volatile-full-access}@anchor{179} +@anchor{gnat_rm/implementation_defined_aspects aspect-volatile-full-access}@anchor{17b} @section Aspect Volatile_Full_Access @geindex Volatile_Full_Access -This boolean aspect is equivalent to @ref{126,,pragma Volatile_Full_Access}. +This boolean aspect is equivalent to @ref{127,,pragma Volatile_Full_Access}. @node Aspect Volatile_Function,Aspect Warnings,Aspect Volatile_Full_Access,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-volatile-function}@anchor{17a} +@anchor{gnat_rm/implementation_defined_aspects aspect-volatile-function}@anchor{17c} @section Aspect Volatile_Function @geindex Volatile_Function -This boolean aspect is equivalent to @ref{128,,pragma Volatile_Function}. +This boolean aspect is equivalent to @ref{129,,pragma Volatile_Function}. @node Aspect Warnings,,Aspect Volatile_Function,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-warnings}@anchor{17b} +@anchor{gnat_rm/implementation_defined_aspects aspect-warnings}@anchor{17d} @section Aspect Warnings @geindex Warnings -This aspect is equivalent to the two argument form of @ref{12a,,pragma Warnings}, +This aspect is equivalent to the two argument form of @ref{12b,,pragma Warnings}, where the first argument is @code{ON} or @code{OFF} and the second argument is the entity. @node Implementation Defined Attributes,Standard and Implementation Defined Restrictions,Implementation Defined Aspects,Top -@anchor{gnat_rm/implementation_defined_attributes doc}@anchor{17c}@anchor{gnat_rm/implementation_defined_attributes id1}@anchor{17d}@anchor{gnat_rm/implementation_defined_attributes implementation-defined-attributes}@anchor{8} +@anchor{gnat_rm/implementation_defined_attributes doc}@anchor{17e}@anchor{gnat_rm/implementation_defined_attributes id1}@anchor{17f}@anchor{gnat_rm/implementation_defined_attributes implementation-defined-attributes}@anchor{8} @chapter Implementation Defined Attributes @@ -10622,7 +10838,7 @@ consideration, you should minimize the use of these attributes. @end menu @node Attribute Abort_Signal,Attribute Address_Size,,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-abort-signal}@anchor{17e} +@anchor{gnat_rm/implementation_defined_attributes attribute-abort-signal}@anchor{180} @section Attribute Abort_Signal @@ -10636,7 +10852,7 @@ completely outside the normal semantics of Ada, for a user program to intercept the abort exception). @node Attribute Address_Size,Attribute Asm_Input,Attribute Abort_Signal,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-address-size}@anchor{17f} +@anchor{gnat_rm/implementation_defined_attributes attribute-address-size}@anchor{181} @section Attribute Address_Size @@ -10652,7 +10868,7 @@ reference to System.Address’Size is nonstatic because Address is a private type. @node Attribute Asm_Input,Attribute Asm_Output,Attribute Address_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-asm-input}@anchor{180} +@anchor{gnat_rm/implementation_defined_attributes attribute-asm-input}@anchor{182} @section Attribute Asm_Input @@ -10666,10 +10882,10 @@ to be a static expression, and is the constraint for the parameter, value to be used as the input argument. The possible values for the constant are the same as those used in the RTL, and are dependent on the configuration file used to built the GCC back end. -@ref{181,,Machine Code Insertions} +@ref{183,,Machine Code Insertions} @node Attribute Asm_Output,Attribute Atomic_Always_Lock_Free,Attribute Asm_Input,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-asm-output}@anchor{182} +@anchor{gnat_rm/implementation_defined_attributes attribute-asm-output}@anchor{184} @section Attribute Asm_Output @@ -10685,10 +10901,10 @@ result. The possible values for constraint are the same as those used in the RTL, and are dependent on the configuration file used to build the GCC back end. If there are no output operands, then this argument may either be omitted, or explicitly given as @code{No_Output_Operands}. -@ref{181,,Machine Code Insertions} +@ref{183,,Machine Code Insertions} @node Attribute Atomic_Always_Lock_Free,Attribute Bit,Attribute Asm_Output,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-atomic-always-lock-free}@anchor{183} +@anchor{gnat_rm/implementation_defined_attributes attribute-atomic-always-lock-free}@anchor{185} @section Attribute Atomic_Always_Lock_Free @@ -10699,7 +10915,7 @@ result indicates whether atomic operations are supported by the target for the given type. @node Attribute Bit,Attribute Bit_Position,Attribute Atomic_Always_Lock_Free,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-bit}@anchor{184} +@anchor{gnat_rm/implementation_defined_attributes attribute-bit}@anchor{186} @section Attribute Bit @@ -10730,7 +10946,7 @@ This attribute is designed to be compatible with the DEC Ada 83 definition and implementation of the @code{Bit} attribute. @node Attribute Bit_Position,Attribute Code_Address,Attribute Bit,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-bit-position}@anchor{185} +@anchor{gnat_rm/implementation_defined_attributes attribute-bit-position}@anchor{187} @section Attribute Bit_Position @@ -10745,7 +10961,7 @@ type `universal_integer'. The value depends only on the field the containing record @code{R}. @node Attribute Code_Address,Attribute Compiler_Version,Attribute Bit_Position,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-code-address}@anchor{186} +@anchor{gnat_rm/implementation_defined_attributes attribute-code-address}@anchor{188} @section Attribute Code_Address @@ -10788,7 +11004,7 @@ the same value as is returned by the corresponding @code{'Address} attribute. @node Attribute Compiler_Version,Attribute Constrained,Attribute Code_Address,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-compiler-version}@anchor{187} +@anchor{gnat_rm/implementation_defined_attributes attribute-compiler-version}@anchor{189} @section Attribute Compiler_Version @@ -10799,7 +11015,7 @@ prefix) yields a static string identifying the version of the compiler being used to compile the unit containing the attribute reference. @node Attribute Constrained,Attribute Default_Bit_Order,Attribute Compiler_Version,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-constrained}@anchor{188} +@anchor{gnat_rm/implementation_defined_attributes attribute-constrained}@anchor{18a} @section Attribute Constrained @@ -10814,7 +11030,7 @@ record type without discriminants is always @code{True}. This usage is compatible with older Ada compilers, including notably DEC Ada. @node Attribute Default_Bit_Order,Attribute Default_Scalar_Storage_Order,Attribute Constrained,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-default-bit-order}@anchor{189} +@anchor{gnat_rm/implementation_defined_attributes attribute-default-bit-order}@anchor{18b} @section Attribute Default_Bit_Order @@ -10831,7 +11047,7 @@ as a @code{Pos} value (0 for @code{High_Order_First}, 1 for @code{Default_Bit_Order} in package @code{System}. @node Attribute Default_Scalar_Storage_Order,Attribute Deref,Attribute Default_Bit_Order,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-default-scalar-storage-order}@anchor{18a} +@anchor{gnat_rm/implementation_defined_attributes attribute-default-scalar-storage-order}@anchor{18c} @section Attribute Default_Scalar_Storage_Order @@ -10848,7 +11064,7 @@ equal to @code{Default_Bit_Order} if unspecified) as a @code{System.Bit_Order} value. This is a static attribute. @node Attribute Deref,Attribute Descriptor_Size,Attribute Default_Scalar_Storage_Order,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-deref}@anchor{18b} +@anchor{gnat_rm/implementation_defined_attributes attribute-deref}@anchor{18d} @section Attribute Deref @@ -10861,7 +11077,7 @@ a named access-to-@cite{typ} type, except that it yields a variable, so it can b used on the left side of an assignment. @node Attribute Descriptor_Size,Attribute Elaborated,Attribute Deref,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-descriptor-size}@anchor{18c} +@anchor{gnat_rm/implementation_defined_attributes attribute-descriptor-size}@anchor{18e} @section Attribute Descriptor_Size @@ -10890,7 +11106,7 @@ since @code{Positive} has an alignment of 4, the size of the descriptor is which yields a size of 32 bits, i.e. including 16 bits of padding. @node Attribute Elaborated,Attribute Elab_Body,Attribute Descriptor_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-elaborated}@anchor{18d} +@anchor{gnat_rm/implementation_defined_attributes attribute-elaborated}@anchor{18f} @section Attribute Elaborated @@ -10905,7 +11121,7 @@ units has been completed. An exception is for units which need no elaboration, the value is always False for such units. @node Attribute Elab_Body,Attribute Elab_Spec,Attribute Elaborated,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-elab-body}@anchor{18e} +@anchor{gnat_rm/implementation_defined_attributes attribute-elab-body}@anchor{190} @section Attribute Elab_Body @@ -10921,7 +11137,7 @@ e.g., if it is necessary to do selective re-elaboration to fix some error. @node Attribute Elab_Spec,Attribute Elab_Subp_Body,Attribute Elab_Body,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-elab-spec}@anchor{18f} +@anchor{gnat_rm/implementation_defined_attributes attribute-elab-spec}@anchor{191} @section Attribute Elab_Spec @@ -10937,7 +11153,7 @@ Ada code, e.g., if it is necessary to do selective re-elaboration to fix some error. @node Attribute Elab_Subp_Body,Attribute Emax,Attribute Elab_Spec,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-elab-subp-body}@anchor{190} +@anchor{gnat_rm/implementation_defined_attributes attribute-elab-subp-body}@anchor{192} @section Attribute Elab_Subp_Body @@ -10951,7 +11167,7 @@ elaboration procedure by the binder in CodePeer mode only and is unrecognized otherwise. @node Attribute Emax,Attribute Enabled,Attribute Elab_Subp_Body,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-emax}@anchor{191} +@anchor{gnat_rm/implementation_defined_attributes attribute-emax}@anchor{193} @section Attribute Emax @@ -10964,7 +11180,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Enabled,Attribute Enum_Rep,Attribute Emax,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-enabled}@anchor{192} +@anchor{gnat_rm/implementation_defined_attributes attribute-enabled}@anchor{194} @section Attribute Enabled @@ -10988,7 +11204,7 @@ a @code{pragma Suppress} or @code{pragma Unsuppress} before instantiating the package or subprogram, controlling whether the check will be present. @node Attribute Enum_Rep,Attribute Enum_Val,Attribute Enabled,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-enum-rep}@anchor{193} +@anchor{gnat_rm/implementation_defined_attributes attribute-enum-rep}@anchor{195} @section Attribute Enum_Rep @@ -11028,7 +11244,7 @@ integer calculation is done at run time, then the call to @code{Enum_Rep} may raise @code{Constraint_Error}. @node Attribute Enum_Val,Attribute Epsilon,Attribute Enum_Rep,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-enum-val}@anchor{194} +@anchor{gnat_rm/implementation_defined_attributes attribute-enum-val}@anchor{196} @section Attribute Enum_Val @@ -11054,7 +11270,7 @@ absence of an enumeration representation clause. This is a static attribute (i.e., the result is static if the argument is static). @node Attribute Epsilon,Attribute Fast_Math,Attribute Enum_Val,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-epsilon}@anchor{195} +@anchor{gnat_rm/implementation_defined_attributes attribute-epsilon}@anchor{197} @section Attribute Epsilon @@ -11067,7 +11283,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Fast_Math,Attribute Finalization_Size,Attribute Epsilon,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-fast-math}@anchor{196} +@anchor{gnat_rm/implementation_defined_attributes attribute-fast-math}@anchor{198} @section Attribute Fast_Math @@ -11078,7 +11294,7 @@ prefix) yields a static Boolean value that is True if pragma @code{Fast_Math} is active, and False otherwise. @node Attribute Finalization_Size,Attribute Fixed_Value,Attribute Fast_Math,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-finalization-size}@anchor{197} +@anchor{gnat_rm/implementation_defined_attributes attribute-finalization-size}@anchor{199} @section Attribute Finalization_Size @@ -11096,7 +11312,7 @@ class-wide type whose tag denotes a type with no controlled parts. Note that only heap-allocated objects contain finalization data. @node Attribute Fixed_Value,Attribute From_Any,Attribute Finalization_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-fixed-value}@anchor{198} +@anchor{gnat_rm/implementation_defined_attributes attribute-fixed-value}@anchor{19a} @section Attribute Fixed_Value @@ -11123,7 +11339,7 @@ This attribute is primarily intended for use in implementation of the input-output functions for fixed-point values. @node Attribute From_Any,Attribute Has_Access_Values,Attribute Fixed_Value,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-from-any}@anchor{199} +@anchor{gnat_rm/implementation_defined_attributes attribute-from-any}@anchor{19b} @section Attribute From_Any @@ -11133,7 +11349,7 @@ This internal attribute is used for the generation of remote subprogram stubs in the context of the Distributed Systems Annex. @node Attribute Has_Access_Values,Attribute Has_Discriminants,Attribute From_Any,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-has-access-values}@anchor{19a} +@anchor{gnat_rm/implementation_defined_attributes attribute-has-access-values}@anchor{19c} @section Attribute Has_Access_Values @@ -11151,7 +11367,7 @@ definitions. If the attribute is applied to a generic private type, it indicates whether or not the corresponding actual type has access values. @node Attribute Has_Discriminants,Attribute Has_Tagged_Values,Attribute Has_Access_Values,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-has-discriminants}@anchor{19b} +@anchor{gnat_rm/implementation_defined_attributes attribute-has-discriminants}@anchor{19d} @section Attribute Has_Discriminants @@ -11167,7 +11383,7 @@ definitions. If the attribute is applied to a generic private type, it indicates whether or not the corresponding actual type has discriminants. @node Attribute Has_Tagged_Values,Attribute Img,Attribute Has_Discriminants,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-has-tagged-values}@anchor{19c} +@anchor{gnat_rm/implementation_defined_attributes attribute-has-tagged-values}@anchor{19e} @section Attribute Has_Tagged_Values @@ -11184,7 +11400,7 @@ definitions. If the attribute is applied to a generic private type, it indicates whether or not the corresponding actual type has access values. @node Attribute Img,Attribute Initialized,Attribute Has_Tagged_Values,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-img}@anchor{19d} +@anchor{gnat_rm/implementation_defined_attributes attribute-img}@anchor{19f} @section Attribute Img @@ -11214,7 +11430,7 @@ that returns the appropriate string when called. This means that in an instantiation as a function parameter. @node Attribute Initialized,Attribute Integer_Value,Attribute Img,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-initialized}@anchor{19e} +@anchor{gnat_rm/implementation_defined_attributes attribute-initialized}@anchor{1a0} @section Attribute Initialized @@ -11224,7 +11440,7 @@ For the syntax and semantics of this attribute, see the SPARK 2014 Reference Manual, section 6.10. @node Attribute Integer_Value,Attribute Invalid_Value,Attribute Initialized,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-integer-value}@anchor{19f} +@anchor{gnat_rm/implementation_defined_attributes attribute-integer-value}@anchor{1a1} @section Attribute Integer_Value @@ -11252,7 +11468,7 @@ This attribute is primarily intended for use in implementation of the standard input-output functions for fixed-point values. @node Attribute Invalid_Value,Attribute Large,Attribute Integer_Value,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-invalid-value}@anchor{1a0} +@anchor{gnat_rm/implementation_defined_attributes attribute-invalid-value}@anchor{1a2} @section Attribute Invalid_Value @@ -11266,7 +11482,7 @@ including the ability to modify the value with the binder -Sxx flag and relevant environment variables at run time. @node Attribute Large,Attribute Library_Level,Attribute Invalid_Value,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-large}@anchor{1a1} +@anchor{gnat_rm/implementation_defined_attributes attribute-large}@anchor{1a3} @section Attribute Large @@ -11279,7 +11495,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Library_Level,Attribute Loop_Entry,Attribute Large,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-library-level}@anchor{1a2} +@anchor{gnat_rm/implementation_defined_attributes attribute-library-level}@anchor{1a4} @section Attribute Library_Level @@ -11305,7 +11521,7 @@ end Gen; @end example @node Attribute Loop_Entry,Attribute Machine_Size,Attribute Library_Level,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-loop-entry}@anchor{1a3} +@anchor{gnat_rm/implementation_defined_attributes attribute-loop-entry}@anchor{1a5} @section Attribute Loop_Entry @@ -11338,7 +11554,7 @@ entry. This copy is not performed if the loop is not entered, or if the corresponding pragmas are ignored or disabled. @node Attribute Machine_Size,Attribute Mantissa,Attribute Loop_Entry,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-machine-size}@anchor{1a4} +@anchor{gnat_rm/implementation_defined_attributes attribute-machine-size}@anchor{1a6} @section Attribute Machine_Size @@ -11348,7 +11564,7 @@ This attribute is identical to the @code{Object_Size} attribute. It is provided for compatibility with the DEC Ada 83 attribute of this name. @node Attribute Mantissa,Attribute Maximum_Alignment,Attribute Machine_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-mantissa}@anchor{1a5} +@anchor{gnat_rm/implementation_defined_attributes attribute-mantissa}@anchor{1a7} @section Attribute Mantissa @@ -11361,7 +11577,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Maximum_Alignment,Attribute Max_Integer_Size,Attribute Mantissa,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-maximum-alignment}@anchor{1a6}@anchor{gnat_rm/implementation_defined_attributes id2}@anchor{1a7} +@anchor{gnat_rm/implementation_defined_attributes attribute-maximum-alignment}@anchor{1a8}@anchor{gnat_rm/implementation_defined_attributes id2}@anchor{1a9} @section Attribute Maximum_Alignment @@ -11377,7 +11593,7 @@ for an object, guaranteeing that it is properly aligned in all cases. @node Attribute Max_Integer_Size,Attribute Mechanism_Code,Attribute Maximum_Alignment,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-max-integer-size}@anchor{1a8} +@anchor{gnat_rm/implementation_defined_attributes attribute-max-integer-size}@anchor{1aa} @section Attribute Max_Integer_Size @@ -11388,7 +11604,7 @@ prefix) provides the size of the largest supported integer type for the target. The result is a static constant. @node Attribute Mechanism_Code,Attribute Null_Parameter,Attribute Max_Integer_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-mechanism-code}@anchor{1a9} +@anchor{gnat_rm/implementation_defined_attributes attribute-mechanism-code}@anchor{1ab} @section Attribute Mechanism_Code @@ -11419,7 +11635,7 @@ by reference @end table @node Attribute Null_Parameter,Attribute Object_Size,Attribute Mechanism_Code,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-null-parameter}@anchor{1aa} +@anchor{gnat_rm/implementation_defined_attributes attribute-null-parameter}@anchor{1ac} @section Attribute Null_Parameter @@ -11444,7 +11660,7 @@ There is no way of indicating this without the @code{Null_Parameter} attribute. @node Attribute Object_Size,Attribute Old,Attribute Null_Parameter,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-object-size}@anchor{157}@anchor{gnat_rm/implementation_defined_attributes id3}@anchor{1ab} +@anchor{gnat_rm/implementation_defined_attributes attribute-object-size}@anchor{159}@anchor{gnat_rm/implementation_defined_attributes id3}@anchor{1ad} @section Attribute Object_Size @@ -11514,7 +11730,7 @@ Similar additional checks are performed in other contexts requiring statically matching subtypes. @node Attribute Old,Attribute Passed_By_Reference,Attribute Object_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-old}@anchor{1ac} +@anchor{gnat_rm/implementation_defined_attributes attribute-old}@anchor{1ae} @section Attribute Old @@ -11529,7 +11745,7 @@ definition are allowed under control of implementation defined pragma @code{Unevaluated_Use_Of_Old}. @node Attribute Passed_By_Reference,Attribute Pool_Address,Attribute Old,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-passed-by-reference}@anchor{1ad} +@anchor{gnat_rm/implementation_defined_attributes attribute-passed-by-reference}@anchor{1af} @section Attribute Passed_By_Reference @@ -11545,7 +11761,7 @@ passed by copy in calls. For scalar types, the result is always @code{False} and is static. For non-scalar types, the result is nonstatic. @node Attribute Pool_Address,Attribute Range_Length,Attribute Passed_By_Reference,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-pool-address}@anchor{1ae} +@anchor{gnat_rm/implementation_defined_attributes attribute-pool-address}@anchor{1b0} @section Attribute Pool_Address @@ -11567,7 +11783,7 @@ For an object created by @code{new}, @code{Ptr.all'Pool_Address} is what is passed to @code{Allocate} and returned from @code{Deallocate}. @node Attribute Range_Length,Attribute Restriction_Set,Attribute Pool_Address,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-range-length}@anchor{1af} +@anchor{gnat_rm/implementation_defined_attributes attribute-range-length}@anchor{1b1} @section Attribute Range_Length @@ -11580,7 +11796,7 @@ applied to the index subtype of a one dimensional array always gives the same result as @code{Length} applied to the array itself. @node Attribute Restriction_Set,Attribute Result,Attribute Range_Length,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-restriction-set}@anchor{1b0} +@anchor{gnat_rm/implementation_defined_attributes attribute-restriction-set}@anchor{1b2} @section Attribute Restriction_Set @@ -11650,7 +11866,7 @@ Restrictions pragma, they are not analyzed semantically, so they do not have a type. @node Attribute Result,Attribute Round,Attribute Restriction_Set,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-result}@anchor{1b1} +@anchor{gnat_rm/implementation_defined_attributes attribute-result}@anchor{1b3} @section Attribute Result @@ -11663,7 +11879,7 @@ For a further discussion of the use of this attribute and examples of its use, see the description of pragma Postcondition. @node Attribute Round,Attribute Safe_Emax,Attribute Result,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-round}@anchor{1b2} +@anchor{gnat_rm/implementation_defined_attributes attribute-round}@anchor{1b4} @section Attribute Round @@ -11674,7 +11890,7 @@ also permits the use of the @code{'Round} attribute for ordinary fixed point types. @node Attribute Safe_Emax,Attribute Safe_Large,Attribute Round,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-safe-emax}@anchor{1b3} +@anchor{gnat_rm/implementation_defined_attributes attribute-safe-emax}@anchor{1b5} @section Attribute Safe_Emax @@ -11687,7 +11903,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Safe_Large,Attribute Safe_Small,Attribute Safe_Emax,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-safe-large}@anchor{1b4} +@anchor{gnat_rm/implementation_defined_attributes attribute-safe-large}@anchor{1b6} @section Attribute Safe_Large @@ -11700,7 +11916,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Safe_Small,Attribute Scalar_Storage_Order,Attribute Safe_Large,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-safe-small}@anchor{1b5} +@anchor{gnat_rm/implementation_defined_attributes attribute-safe-small}@anchor{1b7} @section Attribute Safe_Small @@ -11713,7 +11929,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Scalar_Storage_Order,Attribute Simple_Storage_Pool,Attribute Safe_Small,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-scalar-storage-order}@anchor{166}@anchor{gnat_rm/implementation_defined_attributes id4}@anchor{1b6} +@anchor{gnat_rm/implementation_defined_attributes attribute-scalar-storage-order}@anchor{168}@anchor{gnat_rm/implementation_defined_attributes id4}@anchor{1b8} @section Attribute Scalar_Storage_Order @@ -11876,7 +12092,7 @@ Note that debuggers may be unable to display the correct value of scalar components of a type for which the opposite storage order is specified. @node Attribute Simple_Storage_Pool,Attribute Small,Attribute Scalar_Storage_Order,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-simple-storage-pool}@anchor{f2}@anchor{gnat_rm/implementation_defined_attributes id5}@anchor{1b7} +@anchor{gnat_rm/implementation_defined_attributes attribute-simple-storage-pool}@anchor{f3}@anchor{gnat_rm/implementation_defined_attributes id5}@anchor{1b9} @section Attribute Simple_Storage_Pool @@ -11939,7 +12155,7 @@ as defined in section 13.11.2 of the Ada Reference Manual, except that the term `simple storage pool' is substituted for `storage pool'. @node Attribute Small,Attribute Small_Denominator,Attribute Simple_Storage_Pool,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-small}@anchor{1b8} +@anchor{gnat_rm/implementation_defined_attributes attribute-small}@anchor{1ba} @section Attribute Small @@ -11955,7 +12171,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute when applied to floating-point types. @node Attribute Small_Denominator,Attribute Small_Numerator,Attribute Small,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-small-denominator}@anchor{1b9} +@anchor{gnat_rm/implementation_defined_attributes attribute-small-denominator}@anchor{1bb} @section Attribute Small_Denominator @@ -11968,7 +12184,7 @@ denominator in the representation of @code{typ'Small} as a rational number with coprime factors (i.e. as an irreducible fraction). @node Attribute Small_Numerator,Attribute Storage_Unit,Attribute Small_Denominator,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-small-numerator}@anchor{1ba} +@anchor{gnat_rm/implementation_defined_attributes attribute-small-numerator}@anchor{1bc} @section Attribute Small_Numerator @@ -11981,7 +12197,7 @@ numerator in the representation of @code{typ'Small} as a rational number with coprime factors (i.e. as an irreducible fraction). @node Attribute Storage_Unit,Attribute Stub_Type,Attribute Small_Numerator,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-storage-unit}@anchor{1bb} +@anchor{gnat_rm/implementation_defined_attributes attribute-storage-unit}@anchor{1bd} @section Attribute Storage_Unit @@ -11991,7 +12207,7 @@ with coprime factors (i.e. as an irreducible fraction). prefix) provides the same value as @code{System.Storage_Unit}. @node Attribute Stub_Type,Attribute System_Allocator_Alignment,Attribute Storage_Unit,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-stub-type}@anchor{1bc} +@anchor{gnat_rm/implementation_defined_attributes attribute-stub-type}@anchor{1be} @section Attribute Stub_Type @@ -12015,7 +12231,7 @@ unit @code{System.Partition_Interface}. Use of this attribute will create an implicit dependency on this unit. @node Attribute System_Allocator_Alignment,Attribute Target_Name,Attribute Stub_Type,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-system-allocator-alignment}@anchor{1bd} +@anchor{gnat_rm/implementation_defined_attributes attribute-system-allocator-alignment}@anchor{1bf} @section Attribute System_Allocator_Alignment @@ -12032,7 +12248,7 @@ with alignment too large or to enable a realignment circuitry if the alignment request is larger than this value. @node Attribute Target_Name,Attribute To_Address,Attribute System_Allocator_Alignment,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-target-name}@anchor{1be} +@anchor{gnat_rm/implementation_defined_attributes attribute-target-name}@anchor{1c0} @section Attribute Target_Name @@ -12045,7 +12261,7 @@ standard gcc target name without the terminating slash (for example, GNAT 5.0 on windows yields “i586-pc-mingw32msv”). @node Attribute To_Address,Attribute To_Any,Attribute Target_Name,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-to-address}@anchor{1bf} +@anchor{gnat_rm/implementation_defined_attributes attribute-to-address}@anchor{1c1} @section Attribute To_Address @@ -12068,7 +12284,7 @@ modular manner (e.g., -1 means the same as 16#FFFF_FFFF# on a 32 bits machine). @node Attribute To_Any,Attribute Type_Class,Attribute To_Address,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-to-any}@anchor{1c0} +@anchor{gnat_rm/implementation_defined_attributes attribute-to-any}@anchor{1c2} @section Attribute To_Any @@ -12078,7 +12294,7 @@ This internal attribute is used for the generation of remote subprogram stubs in the context of the Distributed Systems Annex. @node Attribute Type_Class,Attribute Type_Key,Attribute To_Any,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-type-class}@anchor{1c1} +@anchor{gnat_rm/implementation_defined_attributes attribute-type-class}@anchor{1c3} @section Attribute Type_Class @@ -12108,7 +12324,7 @@ applies to all concurrent types. This attribute is designed to be compatible with the DEC Ada 83 attribute of the same name. @node Attribute Type_Key,Attribute TypeCode,Attribute Type_Class,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-type-key}@anchor{1c2} +@anchor{gnat_rm/implementation_defined_attributes attribute-type-key}@anchor{1c4} @section Attribute Type_Key @@ -12120,7 +12336,7 @@ about the type or subtype. This provides improved compatibility with other implementations that support this attribute. @node Attribute TypeCode,Attribute Unconstrained_Array,Attribute Type_Key,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-typecode}@anchor{1c3} +@anchor{gnat_rm/implementation_defined_attributes attribute-typecode}@anchor{1c5} @section Attribute TypeCode @@ -12130,7 +12346,7 @@ This internal attribute is used for the generation of remote subprogram stubs in the context of the Distributed Systems Annex. @node Attribute Unconstrained_Array,Attribute Universal_Literal_String,Attribute TypeCode,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-unconstrained-array}@anchor{1c4} +@anchor{gnat_rm/implementation_defined_attributes attribute-unconstrained-array}@anchor{1c6} @section Attribute Unconstrained_Array @@ -12144,7 +12360,7 @@ still static, and yields the result of applying this test to the generic actual. @node Attribute Universal_Literal_String,Attribute Unrestricted_Access,Attribute Unconstrained_Array,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-universal-literal-string}@anchor{1c5} +@anchor{gnat_rm/implementation_defined_attributes attribute-universal-literal-string}@anchor{1c7} @section Attribute Universal_Literal_String @@ -12172,7 +12388,7 @@ end; @end example @node Attribute Unrestricted_Access,Attribute Update,Attribute Universal_Literal_String,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-unrestricted-access}@anchor{1c6} +@anchor{gnat_rm/implementation_defined_attributes attribute-unrestricted-access}@anchor{1c8} @section Attribute Unrestricted_Access @@ -12359,7 +12575,7 @@ In general this is a risky approach. It may appear to “work” but such uses o of GNAT to another, so are best avoided if possible. @node Attribute Update,Attribute Valid_Value,Attribute Unrestricted_Access,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-update}@anchor{1c7} +@anchor{gnat_rm/implementation_defined_attributes attribute-update}@anchor{1c9} @section Attribute Update @@ -12440,7 +12656,7 @@ A := A'Update ((1, 2) => 20, (3, 4) => 30); which changes element (1,2) to 20 and (3,4) to 30. @node Attribute Valid_Value,Attribute Valid_Scalars,Attribute Update,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-valid-value}@anchor{1c8} +@anchor{gnat_rm/implementation_defined_attributes attribute-valid-value}@anchor{1ca} @section Attribute Valid_Value @@ -12452,7 +12668,7 @@ a function that takes a String, and returns Boolean. @code{T'Valid_Value (S)} returns True if and only if @code{T'Value (S)} would not raise Constraint_Error. @node Attribute Valid_Scalars,Attribute VADS_Size,Attribute Valid_Value,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-valid-scalars}@anchor{1c9} +@anchor{gnat_rm/implementation_defined_attributes attribute-valid-scalars}@anchor{1cb} @section Attribute Valid_Scalars @@ -12486,7 +12702,7 @@ write a function with a single use of the attribute, and then call that function from multiple places. @node Attribute VADS_Size,Attribute Value_Size,Attribute Valid_Scalars,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-vads-size}@anchor{1ca} +@anchor{gnat_rm/implementation_defined_attributes attribute-vads-size}@anchor{1cc} @section Attribute VADS_Size @@ -12506,7 +12722,7 @@ gives the result that would be obtained by applying the attribute to the corresponding type. @node Attribute Value_Size,Attribute Wchar_T_Size,Attribute VADS_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-value-size}@anchor{178}@anchor{gnat_rm/implementation_defined_attributes id6}@anchor{1cb} +@anchor{gnat_rm/implementation_defined_attributes attribute-value-size}@anchor{17a}@anchor{gnat_rm/implementation_defined_attributes id6}@anchor{1cd} @section Attribute Value_Size @@ -12520,7 +12736,7 @@ a value of the given subtype. It is the same as @code{type'Size}, but, unlike @code{Size}, may be set for non-first subtypes. @node Attribute Wchar_T_Size,Attribute Word_Size,Attribute Value_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-wchar-t-size}@anchor{1cc} +@anchor{gnat_rm/implementation_defined_attributes attribute-wchar-t-size}@anchor{1ce} @section Attribute Wchar_T_Size @@ -12532,7 +12748,7 @@ primarily for constructing the definition of this type in package @code{Interfaces.C}. The result is a static constant. @node Attribute Word_Size,,Attribute Wchar_T_Size,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-word-size}@anchor{1cd} +@anchor{gnat_rm/implementation_defined_attributes attribute-word-size}@anchor{1cf} @section Attribute Word_Size @@ -12543,7 +12759,7 @@ prefix) provides the value @code{System.Word_Size}. The result is a static constant. @node Standard and Implementation Defined Restrictions,Implementation Advice,Implementation Defined Attributes,Top -@anchor{gnat_rm/standard_and_implementation_defined_restrictions doc}@anchor{1ce}@anchor{gnat_rm/standard_and_implementation_defined_restrictions id1}@anchor{1cf}@anchor{gnat_rm/standard_and_implementation_defined_restrictions standard-and-implementation-defined-restrictions}@anchor{9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions doc}@anchor{1d0}@anchor{gnat_rm/standard_and_implementation_defined_restrictions id1}@anchor{1d1}@anchor{gnat_rm/standard_and_implementation_defined_restrictions standard-and-implementation-defined-restrictions}@anchor{9} @chapter Standard and Implementation Defined Restrictions @@ -12572,7 +12788,7 @@ language defined or GNAT-specific, are listed in the following. @end menu @node Partition-Wide Restrictions,Program Unit Level Restrictions,,Standard and Implementation Defined Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions id2}@anchor{1d0}@anchor{gnat_rm/standard_and_implementation_defined_restrictions partition-wide-restrictions}@anchor{1d1} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions id2}@anchor{1d2}@anchor{gnat_rm/standard_and_implementation_defined_restrictions partition-wide-restrictions}@anchor{1d3} @section Partition-Wide Restrictions @@ -12665,7 +12881,7 @@ then all compilation units in the partition must obey the restriction). @end menu @node Immediate_Reclamation,Max_Asynchronous_Select_Nesting,,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions immediate-reclamation}@anchor{1d2} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions immediate-reclamation}@anchor{1d4} @subsection Immediate_Reclamation @@ -12677,7 +12893,7 @@ deallocation, any storage reserved at run time for an object is immediately reclaimed when the object no longer exists. @node Max_Asynchronous_Select_Nesting,Max_Entry_Queue_Length,Immediate_Reclamation,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-asynchronous-select-nesting}@anchor{1d3} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-asynchronous-select-nesting}@anchor{1d5} @subsection Max_Asynchronous_Select_Nesting @@ -12689,7 +12905,7 @@ detected at compile time. Violations of this restriction with values other than zero cause Storage_Error to be raised. @node Max_Entry_Queue_Length,Max_Protected_Entries,Max_Asynchronous_Select_Nesting,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-entry-queue-length}@anchor{1d4} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-entry-queue-length}@anchor{1d6} @subsection Max_Entry_Queue_Length @@ -12710,7 +12926,7 @@ compatibility purposes (and a warning will be generated for its use if warnings on obsolescent features are activated). @node Max_Protected_Entries,Max_Select_Alternatives,Max_Entry_Queue_Length,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-protected-entries}@anchor{1d5} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-protected-entries}@anchor{1d7} @subsection Max_Protected_Entries @@ -12721,7 +12937,7 @@ bounds of every entry family of a protected unit shall be static, or shall be defined by a discriminant of a subtype whose corresponding bound is static. @node Max_Select_Alternatives,Max_Storage_At_Blocking,Max_Protected_Entries,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-select-alternatives}@anchor{1d6} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-select-alternatives}@anchor{1d8} @subsection Max_Select_Alternatives @@ -12730,7 +12946,7 @@ defined by a discriminant of a subtype whose corresponding bound is static. [RM D.7] Specifies the maximum number of alternatives in a selective accept. @node Max_Storage_At_Blocking,Max_Task_Entries,Max_Select_Alternatives,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-storage-at-blocking}@anchor{1d7} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-storage-at-blocking}@anchor{1d9} @subsection Max_Storage_At_Blocking @@ -12741,7 +12957,7 @@ Storage_Size that can be retained by a blocked task. A violation of this restriction causes Storage_Error to be raised. @node Max_Task_Entries,Max_Tasks,Max_Storage_At_Blocking,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-task-entries}@anchor{1d8} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-task-entries}@anchor{1da} @subsection Max_Task_Entries @@ -12754,7 +12970,7 @@ defined by a discriminant of a subtype whose corresponding bound is static. @node Max_Tasks,No_Abort_Statements,Max_Task_Entries,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-tasks}@anchor{1d9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-tasks}@anchor{1db} @subsection Max_Tasks @@ -12767,7 +12983,7 @@ time. Violations of this restriction with values other than zero cause Storage_Error to be raised. @node No_Abort_Statements,No_Access_Parameter_Allocators,Max_Tasks,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-abort-statements}@anchor{1da} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-abort-statements}@anchor{1dc} @subsection No_Abort_Statements @@ -12777,7 +12993,7 @@ Storage_Error to be raised. no calls to Task_Identification.Abort_Task. @node No_Access_Parameter_Allocators,No_Access_Subprograms,No_Abort_Statements,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-access-parameter-allocators}@anchor{1db} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-access-parameter-allocators}@anchor{1dd} @subsection No_Access_Parameter_Allocators @@ -12788,7 +13004,7 @@ occurrences of an allocator as the actual parameter to an access parameter. @node No_Access_Subprograms,No_Allocators,No_Access_Parameter_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-access-subprograms}@anchor{1dc} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-access-subprograms}@anchor{1de} @subsection No_Access_Subprograms @@ -12798,7 +13014,7 @@ parameter. declarations of access-to-subprogram types. @node No_Allocators,No_Anonymous_Allocators,No_Access_Subprograms,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-allocators}@anchor{1dd} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-allocators}@anchor{1df} @subsection No_Allocators @@ -12808,7 +13024,7 @@ declarations of access-to-subprogram types. occurrences of an allocator. @node No_Anonymous_Allocators,No_Asynchronous_Control,No_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-anonymous-allocators}@anchor{1de} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-anonymous-allocators}@anchor{1e0} @subsection No_Anonymous_Allocators @@ -12818,7 +13034,7 @@ occurrences of an allocator. occurrences of an allocator of anonymous access type. @node No_Asynchronous_Control,No_Calendar,No_Anonymous_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-asynchronous-control}@anchor{1df} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-asynchronous-control}@anchor{1e1} @subsection No_Asynchronous_Control @@ -12828,7 +13044,7 @@ occurrences of an allocator of anonymous access type. dependences on the predefined package Asynchronous_Task_Control. @node No_Calendar,No_Coextensions,No_Asynchronous_Control,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-calendar}@anchor{1e0} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-calendar}@anchor{1e2} @subsection No_Calendar @@ -12838,7 +13054,7 @@ dependences on the predefined package Asynchronous_Task_Control. dependences on package Calendar. @node No_Coextensions,No_Default_Initialization,No_Calendar,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-coextensions}@anchor{1e1} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-coextensions}@anchor{1e3} @subsection No_Coextensions @@ -12848,7 +13064,7 @@ dependences on package Calendar. coextensions. See 3.10.2. @node No_Default_Initialization,No_Delay,No_Coextensions,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-default-initialization}@anchor{1e2} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-default-initialization}@anchor{1e4} @subsection No_Default_Initialization @@ -12865,7 +13081,7 @@ is to prohibit all cases of variables declared without a specific initializer (including the case of OUT scalar parameters). @node No_Delay,No_Dependence,No_Default_Initialization,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-delay}@anchor{1e3} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-delay}@anchor{1e5} @subsection No_Delay @@ -12875,7 +13091,7 @@ initializer (including the case of OUT scalar parameters). delay statements and no semantic dependences on package Calendar. @node No_Dependence,No_Direct_Boolean_Operators,No_Delay,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dependence}@anchor{1e4} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dependence}@anchor{1e6} @subsection No_Dependence @@ -12918,7 +13134,7 @@ to support specific constructs of the language. Here are some examples: @end itemize @node No_Direct_Boolean_Operators,No_Dispatch,No_Dependence,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-direct-boolean-operators}@anchor{1e5} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-direct-boolean-operators}@anchor{1e7} @subsection No_Direct_Boolean_Operators @@ -12931,7 +13147,7 @@ protocol requires the use of short-circuit (and then, or else) forms for all composite boolean operations. @node No_Dispatch,No_Dispatching_Calls,No_Direct_Boolean_Operators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dispatch}@anchor{1e6} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dispatch}@anchor{1e8} @subsection No_Dispatch @@ -12941,7 +13157,7 @@ composite boolean operations. occurrences of @code{T'Class}, for any (tagged) subtype @code{T}. @node No_Dispatching_Calls,No_Dynamic_Attachment,No_Dispatch,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dispatching-calls}@anchor{1e7} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dispatching-calls}@anchor{1e9} @subsection No_Dispatching_Calls @@ -13002,7 +13218,7 @@ end Example; @end example @node No_Dynamic_Attachment,No_Dynamic_Priorities,No_Dispatching_Calls,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-attachment}@anchor{1e8} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-attachment}@anchor{1ea} @subsection No_Dynamic_Attachment @@ -13021,7 +13237,7 @@ compatibility purposes (and a warning will be generated for its use if warnings on obsolescent features are activated). @node No_Dynamic_Priorities,No_Entry_Calls_In_Elaboration_Code,No_Dynamic_Attachment,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-priorities}@anchor{1e9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-priorities}@anchor{1eb} @subsection No_Dynamic_Priorities @@ -13030,7 +13246,7 @@ warnings on obsolescent features are activated). [RM D.7] There are no semantic dependencies on the package Dynamic_Priorities. @node No_Entry_Calls_In_Elaboration_Code,No_Enumeration_Maps,No_Dynamic_Priorities,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-entry-calls-in-elaboration-code}@anchor{1ea} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-entry-calls-in-elaboration-code}@anchor{1ec} @subsection No_Entry_Calls_In_Elaboration_Code @@ -13042,7 +13258,7 @@ restriction, the compiler can assume that no code past an accept statement in a task can be executed at elaboration time. @node No_Enumeration_Maps,No_Exception_Handlers,No_Entry_Calls_In_Elaboration_Code,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-enumeration-maps}@anchor{1eb} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-enumeration-maps}@anchor{1ed} @subsection No_Enumeration_Maps @@ -13053,7 +13269,7 @@ enumeration maps are used (that is Image and Value attributes applied to enumeration types). @node No_Exception_Handlers,No_Exception_Propagation,No_Enumeration_Maps,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-handlers}@anchor{1ec} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-handlers}@anchor{1ee} @subsection No_Exception_Handlers @@ -13078,7 +13294,7 @@ the raise statement generated by the compiler). The Line parameter when nonzero represents the line number in the source program where the raise occurs. @node No_Exception_Propagation,No_Exception_Registration,No_Exception_Handlers,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-propagation}@anchor{1ed} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-propagation}@anchor{1ef} @subsection No_Exception_Propagation @@ -13095,7 +13311,7 @@ the package GNAT.Current_Exception is not permitted, and reraise statements (raise with no operand) are not permitted. @node No_Exception_Registration,No_Exceptions,No_Exception_Propagation,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-registration}@anchor{1ee} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-registration}@anchor{1f0} @subsection No_Exception_Registration @@ -13109,7 +13325,7 @@ code is simplified by omitting the otherwise-required global registration of exceptions when they are declared. @node No_Exceptions,No_Finalization,No_Exception_Registration,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exceptions}@anchor{1ef} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exceptions}@anchor{1f1} @subsection No_Exceptions @@ -13120,7 +13336,7 @@ raise statements and no exception handlers and also suppresses the generation of language-defined run-time checks. @node No_Finalization,No_Fixed_Point,No_Exceptions,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-finalization}@anchor{1f0} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-finalization}@anchor{1f2} @subsection No_Finalization @@ -13161,7 +13377,7 @@ object or a nested component, either declared on the stack or on the heap. The deallocation of a controlled object no longer finalizes its contents. @node No_Fixed_Point,No_Floating_Point,No_Finalization,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-fixed-point}@anchor{1f1} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-fixed-point}@anchor{1f3} @subsection No_Fixed_Point @@ -13171,7 +13387,7 @@ deallocation of a controlled object no longer finalizes its contents. occurrences of fixed point types and operations. @node No_Floating_Point,No_Implicit_Conditionals,No_Fixed_Point,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-floating-point}@anchor{1f2} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-floating-point}@anchor{1f4} @subsection No_Floating_Point @@ -13181,7 +13397,7 @@ occurrences of fixed point types and operations. occurrences of floating point types and operations. @node No_Implicit_Conditionals,No_Implicit_Dynamic_Code,No_Floating_Point,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-conditionals}@anchor{1f3} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-conditionals}@anchor{1f5} @subsection No_Implicit_Conditionals @@ -13197,7 +13413,7 @@ normal manner. Constructs generating implicit conditionals include comparisons of composite objects and the Max/Min attributes. @node No_Implicit_Dynamic_Code,No_Implicit_Heap_Allocations,No_Implicit_Conditionals,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-dynamic-code}@anchor{1f4} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-dynamic-code}@anchor{1f6} @subsection No_Implicit_Dynamic_Code @@ -13227,7 +13443,7 @@ foreign-language convention; primitive operations of nested tagged types. @node No_Implicit_Heap_Allocations,No_Implicit_Protected_Object_Allocations,No_Implicit_Dynamic_Code,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-heap-allocations}@anchor{1f5} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-heap-allocations}@anchor{1f7} @subsection No_Implicit_Heap_Allocations @@ -13236,7 +13452,7 @@ types. [RM D.7] No constructs are allowed to cause implicit heap allocation. @node No_Implicit_Protected_Object_Allocations,No_Implicit_Task_Allocations,No_Implicit_Heap_Allocations,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-protected-object-allocations}@anchor{1f6} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-protected-object-allocations}@anchor{1f8} @subsection No_Implicit_Protected_Object_Allocations @@ -13246,7 +13462,7 @@ types. protected object. @node No_Implicit_Task_Allocations,No_Initialize_Scalars,No_Implicit_Protected_Object_Allocations,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-task-allocations}@anchor{1f7} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-task-allocations}@anchor{1f9} @subsection No_Implicit_Task_Allocations @@ -13255,7 +13471,7 @@ protected object. [GNAT] No constructs are allowed to cause implicit heap allocation of a task. @node No_Initialize_Scalars,No_IO,No_Implicit_Task_Allocations,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-initialize-scalars}@anchor{1f8} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-initialize-scalars}@anchor{1fa} @subsection No_Initialize_Scalars @@ -13267,7 +13483,7 @@ code, and in particular eliminates dummy null initialization routines that are otherwise generated for some record and array types. @node No_IO,No_Local_Allocators,No_Initialize_Scalars,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-io}@anchor{1f9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-io}@anchor{1fb} @subsection No_IO @@ -13278,7 +13494,7 @@ dependences on any of the library units Sequential_IO, Direct_IO, Text_IO, Wide_Text_IO, Wide_Wide_Text_IO, or Stream_IO. @node No_Local_Allocators,No_Local_Protected_Objects,No_IO,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-allocators}@anchor{1fa} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-allocators}@anchor{1fc} @subsection No_Local_Allocators @@ -13289,7 +13505,7 @@ occurrences of an allocator in subprograms, generic subprograms, tasks, and entry bodies. @node No_Local_Protected_Objects,No_Local_Tagged_Types,No_Local_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-protected-objects}@anchor{1fb} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-protected-objects}@anchor{1fd} @subsection No_Local_Protected_Objects @@ -13299,7 +13515,7 @@ and entry bodies. only declared at the library level. @node No_Local_Tagged_Types,No_Local_Timing_Events,No_Local_Protected_Objects,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-tagged-types}@anchor{1fc} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-tagged-types}@anchor{1fe} @subsection No_Local_Tagged_Types @@ -13309,7 +13525,7 @@ only declared at the library level. declared at the library level. @node No_Local_Timing_Events,No_Long_Long_Integers,No_Local_Tagged_Types,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-timing-events}@anchor{1fd} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-timing-events}@anchor{1ff} @subsection No_Local_Timing_Events @@ -13319,7 +13535,7 @@ declared at the library level. declared at the library level. @node No_Long_Long_Integers,No_Multiple_Elaboration,No_Local_Timing_Events,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-long-long-integers}@anchor{1fe} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-long-long-integers}@anchor{200} @subsection No_Long_Long_Integers @@ -13331,7 +13547,7 @@ implicit base type is Long_Long_Integer, and modular types whose size exceeds Long_Integer’Size. @node No_Multiple_Elaboration,No_Nested_Finalization,No_Long_Long_Integers,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-multiple-elaboration}@anchor{1ff} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-multiple-elaboration}@anchor{201} @subsection No_Multiple_Elaboration @@ -13347,7 +13563,7 @@ possible, including non-Ada main programs and Stand Alone libraries, are not permitted and will be diagnosed by the binder. @node No_Nested_Finalization,No_Protected_Type_Allocators,No_Multiple_Elaboration,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-nested-finalization}@anchor{200} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-nested-finalization}@anchor{202} @subsection No_Nested_Finalization @@ -13356,7 +13572,7 @@ permitted and will be diagnosed by the binder. [RM D.7] All objects requiring finalization are declared at the library level. @node No_Protected_Type_Allocators,No_Protected_Types,No_Nested_Finalization,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-protected-type-allocators}@anchor{201} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-protected-type-allocators}@anchor{203} @subsection No_Protected_Type_Allocators @@ -13366,7 +13582,7 @@ permitted and will be diagnosed by the binder. expressions that attempt to allocate protected objects. @node No_Protected_Types,No_Recursion,No_Protected_Type_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-protected-types}@anchor{202} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-protected-types}@anchor{204} @subsection No_Protected_Types @@ -13376,7 +13592,7 @@ expressions that attempt to allocate protected objects. declarations of protected types or protected objects. @node No_Recursion,No_Reentrancy,No_Protected_Types,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-recursion}@anchor{203} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-recursion}@anchor{205} @subsection No_Recursion @@ -13386,7 +13602,7 @@ declarations of protected types or protected objects. part of its execution. @node No_Reentrancy,No_Relative_Delay,No_Recursion,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-reentrancy}@anchor{204} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-reentrancy}@anchor{206} @subsection No_Reentrancy @@ -13396,7 +13612,7 @@ part of its execution. two tasks at the same time. @node No_Relative_Delay,No_Requeue_Statements,No_Reentrancy,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-relative-delay}@anchor{205} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-relative-delay}@anchor{207} @subsection No_Relative_Delay @@ -13407,7 +13623,7 @@ relative statements and prevents expressions such as @code{delay 1.23;} from appearing in source code. @node No_Requeue_Statements,No_Secondary_Stack,No_Relative_Delay,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-requeue-statements}@anchor{206} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-requeue-statements}@anchor{208} @subsection No_Requeue_Statements @@ -13425,7 +13641,7 @@ compatibility purposes (and a warning will be generated for its use if warnings on oNobsolescent features are activated). @node No_Secondary_Stack,No_Select_Statements,No_Requeue_Statements,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-secondary-stack}@anchor{207} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-secondary-stack}@anchor{209} @subsection No_Secondary_Stack @@ -13438,7 +13654,7 @@ stack is used to implement functions returning unconstrained objects secondary stacks for tasks (excluding the environment task) at run time. @node No_Select_Statements,No_Specific_Termination_Handlers,No_Secondary_Stack,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-select-statements}@anchor{208} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-select-statements}@anchor{20a} @subsection No_Select_Statements @@ -13448,7 +13664,7 @@ secondary stacks for tasks (excluding the environment task) at run time. kind are permitted, that is the keyword @code{select} may not appear. @node No_Specific_Termination_Handlers,No_Specification_of_Aspect,No_Select_Statements,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-specific-termination-handlers}@anchor{209} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-specific-termination-handlers}@anchor{20b} @subsection No_Specific_Termination_Handlers @@ -13458,7 +13674,7 @@ kind are permitted, that is the keyword @code{select} may not appear. or to Ada.Task_Termination.Specific_Handler. @node No_Specification_of_Aspect,No_Standard_Allocators_After_Elaboration,No_Specific_Termination_Handlers,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-specification-of-aspect}@anchor{20a} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-specification-of-aspect}@anchor{20c} @subsection No_Specification_of_Aspect @@ -13469,7 +13685,7 @@ specification, attribute definition clause, or pragma is given for a given aspect. @node No_Standard_Allocators_After_Elaboration,No_Standard_Storage_Pools,No_Specification_of_Aspect,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-standard-allocators-after-elaboration}@anchor{20b} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-standard-allocators-after-elaboration}@anchor{20d} @subsection No_Standard_Allocators_After_Elaboration @@ -13481,7 +13697,7 @@ library items of the partition has completed. Otherwise, Storage_Error is raised. @node No_Standard_Storage_Pools,No_Stream_Optimizations,No_Standard_Allocators_After_Elaboration,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-standard-storage-pools}@anchor{20c} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-standard-storage-pools}@anchor{20e} @subsection No_Standard_Storage_Pools @@ -13493,7 +13709,7 @@ have an explicit Storage_Pool attribute defined specifying a user-defined storage pool. @node No_Stream_Optimizations,No_Streams,No_Standard_Storage_Pools,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-stream-optimizations}@anchor{20d} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-stream-optimizations}@anchor{20f} @subsection No_Stream_Optimizations @@ -13506,7 +13722,7 @@ due to their superior performance. When this restriction is in effect, the compiler performs all IO operations on a per-character basis. @node No_Streams,No_Tagged_Type_Registration,No_Stream_Optimizations,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-streams}@anchor{20e} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-streams}@anchor{210} @subsection No_Streams @@ -13533,7 +13749,7 @@ configuration pragmas to avoid exposing entity names at binary level for the entire partition. @node No_Tagged_Type_Registration,No_Task_Allocators,No_Streams,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-tagged-type-registration}@anchor{20f} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-tagged-type-registration}@anchor{211} @subsection No_Tagged_Type_Registration @@ -13548,7 +13764,7 @@ are declared. This restriction may be necessary in order to also apply the No_Elaboration_Code restriction. @node No_Task_Allocators,No_Task_At_Interrupt_Priority,No_Tagged_Type_Registration,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-allocators}@anchor{210} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-allocators}@anchor{212} @subsection No_Task_Allocators @@ -13558,7 +13774,7 @@ the No_Elaboration_Code restriction. or types containing task subcomponents. @node No_Task_At_Interrupt_Priority,No_Task_Attributes_Package,No_Task_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-at-interrupt-priority}@anchor{211} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-at-interrupt-priority}@anchor{213} @subsection No_Task_At_Interrupt_Priority @@ -13570,7 +13786,7 @@ a consequence, the tasks are always created with a priority below that an interrupt priority. @node No_Task_Attributes_Package,No_Task_Hierarchy,No_Task_At_Interrupt_Priority,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-attributes-package}@anchor{212} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-attributes-package}@anchor{214} @subsection No_Task_Attributes_Package @@ -13587,7 +13803,7 @@ compatibility purposes (and a warning will be generated for its use if warnings on obsolescent features are activated). @node No_Task_Hierarchy,No_Task_Termination,No_Task_Attributes_Package,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-hierarchy}@anchor{213} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-hierarchy}@anchor{215} @subsection No_Task_Hierarchy @@ -13597,7 +13813,7 @@ warnings on obsolescent features are activated). directly on the environment task of the partition. @node No_Task_Termination,No_Tasking,No_Task_Hierarchy,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-termination}@anchor{214} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-termination}@anchor{216} @subsection No_Task_Termination @@ -13606,7 +13822,7 @@ directly on the environment task of the partition. [RM D.7] Tasks that terminate are erroneous. @node No_Tasking,No_Terminate_Alternatives,No_Task_Termination,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-tasking}@anchor{215} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-tasking}@anchor{217} @subsection No_Tasking @@ -13619,7 +13835,7 @@ and cause an error message to be output either by the compiler or binder. @node No_Terminate_Alternatives,No_Unchecked_Access,No_Tasking,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-terminate-alternatives}@anchor{216} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-terminate-alternatives}@anchor{218} @subsection No_Terminate_Alternatives @@ -13628,7 +13844,7 @@ binder. [RM D.7] There are no selective accepts with terminate alternatives. @node No_Unchecked_Access,No_Unchecked_Conversion,No_Terminate_Alternatives,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-access}@anchor{217} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-access}@anchor{219} @subsection No_Unchecked_Access @@ -13638,7 +13854,7 @@ binder. occurrences of the Unchecked_Access attribute. @node No_Unchecked_Conversion,No_Unchecked_Deallocation,No_Unchecked_Access,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-conversion}@anchor{218} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-conversion}@anchor{21a} @subsection No_Unchecked_Conversion @@ -13648,7 +13864,7 @@ occurrences of the Unchecked_Access attribute. dependences on the predefined generic function Unchecked_Conversion. @node No_Unchecked_Deallocation,No_Use_Of_Attribute,No_Unchecked_Conversion,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-deallocation}@anchor{219} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-deallocation}@anchor{21b} @subsection No_Unchecked_Deallocation @@ -13658,7 +13874,7 @@ dependences on the predefined generic function Unchecked_Conversion. dependences on the predefined generic procedure Unchecked_Deallocation. @node No_Use_Of_Attribute,No_Use_Of_Entity,No_Unchecked_Deallocation,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-use-of-attribute}@anchor{21a} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-use-of-attribute}@anchor{21c} @subsection No_Use_Of_Attribute @@ -13668,7 +13884,7 @@ dependences on the predefined generic procedure Unchecked_Deallocation. earlier versions of Ada. @node No_Use_Of_Entity,No_Use_Of_Pragma,No_Use_Of_Attribute,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-use-of-entity}@anchor{21b} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-use-of-entity}@anchor{21d} @subsection No_Use_Of_Entity @@ -13688,7 +13904,7 @@ No_Use_Of_Entity => Ada.Text_IO.Put_Line @end example @node No_Use_Of_Pragma,Pure_Barriers,No_Use_Of_Entity,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-use-of-pragma}@anchor{21c} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-use-of-pragma}@anchor{21e} @subsection No_Use_Of_Pragma @@ -13698,7 +13914,7 @@ No_Use_Of_Entity => Ada.Text_IO.Put_Line earlier versions of Ada. @node Pure_Barriers,Simple_Barriers,No_Use_Of_Pragma,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions pure-barriers}@anchor{21d} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions pure-barriers}@anchor{21f} @subsection Pure_Barriers @@ -13749,7 +13965,7 @@ but still ensures absence of side effects, exceptions, and recursion during the evaluation of the barriers. @node Simple_Barriers,Static_Priorities,Pure_Barriers,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions simple-barriers}@anchor{21e} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions simple-barriers}@anchor{220} @subsection Simple_Barriers @@ -13768,7 +13984,7 @@ compatibility purposes (and a warning will be generated for its use if warnings on obsolescent features are activated). @node Static_Priorities,Static_Storage_Size,Simple_Barriers,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-priorities}@anchor{21f} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-priorities}@anchor{221} @subsection Static_Priorities @@ -13779,7 +13995,7 @@ are static, and that there are no dependences on the package @code{Ada.Dynamic_Priorities}. @node Static_Storage_Size,,Static_Priorities,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-storage-size}@anchor{220} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-storage-size}@anchor{222} @subsection Static_Storage_Size @@ -13789,7 +14005,7 @@ are static, and that there are no dependences on the package in a Storage_Size pragma or attribute definition clause is static. @node Program Unit Level Restrictions,,Partition-Wide Restrictions,Standard and Implementation Defined Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions id3}@anchor{221}@anchor{gnat_rm/standard_and_implementation_defined_restrictions program-unit-level-restrictions}@anchor{222} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions id3}@anchor{223}@anchor{gnat_rm/standard_and_implementation_defined_restrictions program-unit-level-restrictions}@anchor{224} @section Program Unit Level Restrictions @@ -13820,7 +14036,7 @@ other compilation units in the partition. @end menu @node No_Elaboration_Code,No_Dynamic_Accessibility_Checks,,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-elaboration-code}@anchor{223} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-elaboration-code}@anchor{225} @subsection No_Elaboration_Code @@ -13876,7 +14092,7 @@ associated with the unit. This counter is typically used to check for access before elaboration and to control multiple elaboration attempts. @node No_Dynamic_Accessibility_Checks,No_Dynamic_Sized_Objects,No_Elaboration_Code,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-accessibility-checks}@anchor{224} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-accessibility-checks}@anchor{226} @subsection No_Dynamic_Accessibility_Checks @@ -13925,7 +14141,7 @@ In all other cases, the level of T is as defined by the existing rules of Ada. @end itemize @node No_Dynamic_Sized_Objects,No_Entry_Queue,No_Dynamic_Accessibility_Checks,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-sized-objects}@anchor{225} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-sized-objects}@anchor{227} @subsection No_Dynamic_Sized_Objects @@ -13943,7 +14159,7 @@ access discriminants. It is often a good idea to combine this restriction with No_Secondary_Stack. @node No_Entry_Queue,No_Implementation_Aspect_Specifications,No_Dynamic_Sized_Objects,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-entry-queue}@anchor{226} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-entry-queue}@anchor{228} @subsection No_Entry_Queue @@ -13956,7 +14172,7 @@ checked at compile time. A program execution is erroneous if an attempt is made to queue a second task on such an entry. @node No_Implementation_Aspect_Specifications,No_Implementation_Attributes,No_Entry_Queue,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-aspect-specifications}@anchor{227} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-aspect-specifications}@anchor{229} @subsection No_Implementation_Aspect_Specifications @@ -13967,7 +14183,7 @@ GNAT-defined aspects are present. With this restriction, the only aspects that can be used are those defined in the Ada Reference Manual. @node No_Implementation_Attributes,No_Implementation_Identifiers,No_Implementation_Aspect_Specifications,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-attributes}@anchor{228} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-attributes}@anchor{22a} @subsection No_Implementation_Attributes @@ -13979,7 +14195,7 @@ attributes that can be used are those defined in the Ada Reference Manual. @node No_Implementation_Identifiers,No_Implementation_Pragmas,No_Implementation_Attributes,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-identifiers}@anchor{229} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-identifiers}@anchor{22b} @subsection No_Implementation_Identifiers @@ -13990,7 +14206,7 @@ implementation-defined identifiers (marked with pragma Implementation_Defined) occur within language-defined packages. @node No_Implementation_Pragmas,No_Implementation_Restrictions,No_Implementation_Identifiers,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-pragmas}@anchor{22a} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-pragmas}@anchor{22c} @subsection No_Implementation_Pragmas @@ -14001,7 +14217,7 @@ GNAT-defined pragmas are present. With this restriction, the only pragmas that can be used are those defined in the Ada Reference Manual. @node No_Implementation_Restrictions,No_Implementation_Units,No_Implementation_Pragmas,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-restrictions}@anchor{22b} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-restrictions}@anchor{22d} @subsection No_Implementation_Restrictions @@ -14013,7 +14229,7 @@ are present. With this restriction, the only other restriction identifiers that can be used are those defined in the Ada Reference Manual. @node No_Implementation_Units,No_Implicit_Aliasing,No_Implementation_Restrictions,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-units}@anchor{22c} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-units}@anchor{22e} @subsection No_Implementation_Units @@ -14024,7 +14240,7 @@ mention in the context clause of any implementation-defined descendants of packages Ada, Interfaces, or System. @node No_Implicit_Aliasing,No_Implicit_Loops,No_Implementation_Units,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-aliasing}@anchor{22d} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-aliasing}@anchor{22f} @subsection No_Implicit_Aliasing @@ -14039,7 +14255,7 @@ to be aliased, and in such cases, it can always be replaced by the standard attribute Unchecked_Access which is preferable. @node No_Implicit_Loops,No_Obsolescent_Features,No_Implicit_Aliasing,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-loops}@anchor{22e} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-loops}@anchor{230} @subsection No_Implicit_Loops @@ -14056,7 +14272,7 @@ arrays larger than about 5000 scalar components. Note that if this restriction is set in the spec of a package, it will not apply to its body. @node No_Obsolescent_Features,No_Wide_Characters,No_Implicit_Loops,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-obsolescent-features}@anchor{22f} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-obsolescent-features}@anchor{231} @subsection No_Obsolescent_Features @@ -14066,7 +14282,7 @@ is set in the spec of a package, it will not apply to its body. features are used, as defined in Annex J of the Ada Reference Manual. @node No_Wide_Characters,Static_Dispatch_Tables,No_Obsolescent_Features,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-wide-characters}@anchor{230} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-wide-characters}@anchor{232} @subsection No_Wide_Characters @@ -14080,7 +14296,7 @@ appear in the program (that is literals representing characters not in type @code{Character}). @node Static_Dispatch_Tables,SPARK_05,No_Wide_Characters,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-dispatch-tables}@anchor{231} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-dispatch-tables}@anchor{233} @subsection Static_Dispatch_Tables @@ -14090,7 +14306,7 @@ type @code{Character}). associated with dispatch tables can be placed in read-only memory. @node SPARK_05,,Static_Dispatch_Tables,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions spark-05}@anchor{232} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions spark-05}@anchor{234} @subsection SPARK_05 @@ -14113,7 +14329,7 @@ gnatprove -P project.gpr --mode=check_all @end example @node Implementation Advice,Implementation Defined Characteristics,Standard and Implementation Defined Restrictions,Top -@anchor{gnat_rm/implementation_advice doc}@anchor{233}@anchor{gnat_rm/implementation_advice id1}@anchor{234}@anchor{gnat_rm/implementation_advice implementation-advice}@anchor{a} +@anchor{gnat_rm/implementation_advice doc}@anchor{235}@anchor{gnat_rm/implementation_advice id1}@anchor{236}@anchor{gnat_rm/implementation_advice implementation-advice}@anchor{a} @chapter Implementation Advice @@ -14211,7 +14427,7 @@ case the text describes what GNAT does and why. @end menu @node RM 1 1 3 20 Error Detection,RM 1 1 3 31 Child Units,,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-1-1-3-20-error-detection}@anchor{235} +@anchor{gnat_rm/implementation_advice rm-1-1-3-20-error-detection}@anchor{237} @section RM 1.1.3(20): Error Detection @@ -14228,7 +14444,7 @@ or diagnosed at compile time. @geindex Child Units @node RM 1 1 3 31 Child Units,RM 1 1 5 12 Bounded Errors,RM 1 1 3 20 Error Detection,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-1-1-3-31-child-units}@anchor{236} +@anchor{gnat_rm/implementation_advice rm-1-1-3-31-child-units}@anchor{238} @section RM 1.1.3(31): Child Units @@ -14244,7 +14460,7 @@ Followed. @geindex Bounded errors @node RM 1 1 5 12 Bounded Errors,RM 2 8 16 Pragmas,RM 1 1 3 31 Child Units,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-1-1-5-12-bounded-errors}@anchor{237} +@anchor{gnat_rm/implementation_advice rm-1-1-5-12-bounded-errors}@anchor{239} @section RM 1.1.5(12): Bounded Errors @@ -14261,7 +14477,7 @@ runtime. @geindex Pragmas @node RM 2 8 16 Pragmas,RM 2 8 17-19 Pragmas,RM 1 1 5 12 Bounded Errors,Implementation Advice -@anchor{gnat_rm/implementation_advice id2}@anchor{238}@anchor{gnat_rm/implementation_advice rm-2-8-16-pragmas}@anchor{239} +@anchor{gnat_rm/implementation_advice id2}@anchor{23a}@anchor{gnat_rm/implementation_advice rm-2-8-16-pragmas}@anchor{23b} @section RM 2.8(16): Pragmas @@ -14374,7 +14590,7 @@ that this advice not be followed. For details see @ref{7,,Implementation Defined Pragmas}. @node RM 2 8 17-19 Pragmas,RM 3 5 2 5 Alternative Character Sets,RM 2 8 16 Pragmas,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-2-8-17-19-pragmas}@anchor{23a} +@anchor{gnat_rm/implementation_advice rm-2-8-17-19-pragmas}@anchor{23c} @section RM 2.8(17-19): Pragmas @@ -14395,14 +14611,14 @@ replacing @code{library_items}.” @end itemize @end quotation -See @ref{239,,RM 2.8(16); Pragmas}. +See @ref{23b,,RM 2.8(16); Pragmas}. @geindex Character Sets @geindex Alternative Character Sets @node RM 3 5 2 5 Alternative Character Sets,RM 3 5 4 28 Integer Types,RM 2 8 17-19 Pragmas,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-5-2-5-alternative-character-sets}@anchor{23b} +@anchor{gnat_rm/implementation_advice rm-3-5-2-5-alternative-character-sets}@anchor{23d} @section RM 3.5.2(5): Alternative Character Sets @@ -14430,7 +14646,7 @@ there is no such restriction. @geindex Integer types @node RM 3 5 4 28 Integer Types,RM 3 5 4 29 Integer Types,RM 3 5 2 5 Alternative Character Sets,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-5-4-28-integer-types}@anchor{23c} +@anchor{gnat_rm/implementation_advice rm-3-5-4-28-integer-types}@anchor{23e} @section RM 3.5.4(28): Integer Types @@ -14449,7 +14665,7 @@ are supported for convenient interface to C, and so that all hardware types of the machine are easily available. @node RM 3 5 4 29 Integer Types,RM 3 5 5 8 Enumeration Values,RM 3 5 4 28 Integer Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-5-4-29-integer-types}@anchor{23d} +@anchor{gnat_rm/implementation_advice rm-3-5-4-29-integer-types}@anchor{23f} @section RM 3.5.4(29): Integer Types @@ -14465,7 +14681,7 @@ Followed. @geindex Enumeration values @node RM 3 5 5 8 Enumeration Values,RM 3 5 7 17 Float Types,RM 3 5 4 29 Integer Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-5-5-8-enumeration-values}@anchor{23e} +@anchor{gnat_rm/implementation_advice rm-3-5-5-8-enumeration-values}@anchor{240} @section RM 3.5.5(8): Enumeration Values @@ -14485,7 +14701,7 @@ Followed. @geindex Float types @node RM 3 5 7 17 Float Types,RM 3 6 2 11 Multidimensional Arrays,RM 3 5 5 8 Enumeration Values,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-5-7-17-float-types}@anchor{23f} +@anchor{gnat_rm/implementation_advice rm-3-5-7-17-float-types}@anchor{241} @section RM 3.5.7(17): Float Types @@ -14515,7 +14731,7 @@ is a software rather than a hardware format. @geindex multidimensional @node RM 3 6 2 11 Multidimensional Arrays,RM 9 6 30-31 Duration’Small,RM 3 5 7 17 Float Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-3-6-2-11-multidimensional-arrays}@anchor{240} +@anchor{gnat_rm/implementation_advice rm-3-6-2-11-multidimensional-arrays}@anchor{242} @section RM 3.6.2(11): Multidimensional Arrays @@ -14533,7 +14749,7 @@ Followed. @geindex Duration'Small @node RM 9 6 30-31 Duration’Small,RM 10 2 1 12 Consistent Representation,RM 3 6 2 11 Multidimensional Arrays,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-9-6-30-31-duration-small}@anchor{241} +@anchor{gnat_rm/implementation_advice rm-9-6-30-31-duration-small}@anchor{243} @section RM 9.6(30-31): Duration’Small @@ -14554,7 +14770,7 @@ it need not be the same time base as used for @code{Calendar.Clock}.” Followed. @node RM 10 2 1 12 Consistent Representation,RM 11 4 1 19 Exception Information,RM 9 6 30-31 Duration’Small,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-10-2-1-12-consistent-representation}@anchor{242} +@anchor{gnat_rm/implementation_advice rm-10-2-1-12-consistent-representation}@anchor{244} @section RM 10.2.1(12): Consistent Representation @@ -14576,7 +14792,7 @@ advice without severely impacting efficiency of execution. @geindex Exception information @node RM 11 4 1 19 Exception Information,RM 11 5 28 Suppression of Checks,RM 10 2 1 12 Consistent Representation,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-11-4-1-19-exception-information}@anchor{243} +@anchor{gnat_rm/implementation_advice rm-11-4-1-19-exception-information}@anchor{245} @section RM 11.4.1(19): Exception Information @@ -14607,7 +14823,7 @@ Pragma @code{Discard_Names}. @geindex suppression of @node RM 11 5 28 Suppression of Checks,RM 13 1 21-24 Representation Clauses,RM 11 4 1 19 Exception Information,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-11-5-28-suppression-of-checks}@anchor{244} +@anchor{gnat_rm/implementation_advice rm-11-5-28-suppression-of-checks}@anchor{246} @section RM 11.5(28): Suppression of Checks @@ -14622,7 +14838,7 @@ Followed. @geindex Representation clauses @node RM 13 1 21-24 Representation Clauses,RM 13 2 6-8 Packed Types,RM 11 5 28 Suppression of Checks,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-1-21-24-representation-clauses}@anchor{245} +@anchor{gnat_rm/implementation_advice rm-13-1-21-24-representation-clauses}@anchor{247} @section RM 13.1 (21-24): Representation Clauses @@ -14674,7 +14890,7 @@ Followed. @geindex Packed types @node RM 13 2 6-8 Packed Types,RM 13 3 14-19 Address Clauses,RM 13 1 21-24 Representation Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-2-6-8-packed-types}@anchor{246} +@anchor{gnat_rm/implementation_advice rm-13-2-6-8-packed-types}@anchor{248} @section RM 13.2(6-8): Packed Types @@ -14705,7 +14921,7 @@ subcomponent of the packed type. @geindex Address clauses @node RM 13 3 14-19 Address Clauses,RM 13 3 29-35 Alignment Clauses,RM 13 2 6-8 Packed Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-3-14-19-address-clauses}@anchor{247} +@anchor{gnat_rm/implementation_advice rm-13-3-14-19-address-clauses}@anchor{249} @section RM 13.3(14-19): Address Clauses @@ -14758,7 +14974,7 @@ Followed. @geindex Alignment clauses @node RM 13 3 29-35 Alignment Clauses,RM 13 3 42-43 Size Clauses,RM 13 3 14-19 Address Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-3-29-35-alignment-clauses}@anchor{248} +@anchor{gnat_rm/implementation_advice rm-13-3-29-35-alignment-clauses}@anchor{24a} @section RM 13.3(29-35): Alignment Clauses @@ -14815,7 +15031,7 @@ Followed. @geindex Size clauses @node RM 13 3 42-43 Size Clauses,RM 13 3 50-56 Size Clauses,RM 13 3 29-35 Alignment Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-3-42-43-size-clauses}@anchor{249} +@anchor{gnat_rm/implementation_advice rm-13-3-42-43-size-clauses}@anchor{24b} @section RM 13.3(42-43): Size Clauses @@ -14833,7 +15049,7 @@ object’s @code{Alignment} (if the @code{Alignment} is nonzero).” Followed. @node RM 13 3 50-56 Size Clauses,RM 13 3 71-73 Component Size Clauses,RM 13 3 42-43 Size Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-3-50-56-size-clauses}@anchor{24a} +@anchor{gnat_rm/implementation_advice rm-13-3-50-56-size-clauses}@anchor{24c} @section RM 13.3(50-56): Size Clauses @@ -14884,7 +15100,7 @@ Followed. @geindex Component_Size clauses @node RM 13 3 71-73 Component Size Clauses,RM 13 4 9-10 Enumeration Representation Clauses,RM 13 3 50-56 Size Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-3-71-73-component-size-clauses}@anchor{24b} +@anchor{gnat_rm/implementation_advice rm-13-3-71-73-component-size-clauses}@anchor{24d} @section RM 13.3(71-73): Component Size Clauses @@ -14918,7 +15134,7 @@ Followed. @geindex enumeration @node RM 13 4 9-10 Enumeration Representation Clauses,RM 13 5 1 17-22 Record Representation Clauses,RM 13 3 71-73 Component Size Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-4-9-10-enumeration-representation-clauses}@anchor{24c} +@anchor{gnat_rm/implementation_advice rm-13-4-9-10-enumeration-representation-clauses}@anchor{24e} @section RM 13.4(9-10): Enumeration Representation Clauses @@ -14940,7 +15156,7 @@ Followed. @geindex records @node RM 13 5 1 17-22 Record Representation Clauses,RM 13 5 2 5 Storage Place Attributes,RM 13 4 9-10 Enumeration Representation Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-5-1-17-22-record-representation-clauses}@anchor{24d} +@anchor{gnat_rm/implementation_advice rm-13-5-1-17-22-record-representation-clauses}@anchor{24f} @section RM 13.5.1(17-22): Record Representation Clauses @@ -15000,7 +15216,7 @@ and all mentioned features are implemented. @geindex Storage place attributes @node RM 13 5 2 5 Storage Place Attributes,RM 13 5 3 7-8 Bit Ordering,RM 13 5 1 17-22 Record Representation Clauses,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-5-2-5-storage-place-attributes}@anchor{24e} +@anchor{gnat_rm/implementation_advice rm-13-5-2-5-storage-place-attributes}@anchor{250} @section RM 13.5.2(5): Storage Place Attributes @@ -15020,7 +15236,7 @@ Followed. There are no such components in GNAT. @geindex Bit ordering @node RM 13 5 3 7-8 Bit Ordering,RM 13 7 37 Address as Private,RM 13 5 2 5 Storage Place Attributes,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-5-3-7-8-bit-ordering}@anchor{24f} +@anchor{gnat_rm/implementation_advice rm-13-5-3-7-8-bit-ordering}@anchor{251} @section RM 13.5.3(7-8): Bit Ordering @@ -15038,7 +15254,7 @@ Followed. @geindex as private type @node RM 13 7 37 Address as Private,RM 13 7 1 16 Address Operations,RM 13 5 3 7-8 Bit Ordering,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-7-37-address-as-private}@anchor{250} +@anchor{gnat_rm/implementation_advice rm-13-7-37-address-as-private}@anchor{252} @section RM 13.7(37): Address as Private @@ -15056,7 +15272,7 @@ Followed. @geindex operations of @node RM 13 7 1 16 Address Operations,RM 13 9 14-17 Unchecked Conversion,RM 13 7 37 Address as Private,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-7-1-16-address-operations}@anchor{251} +@anchor{gnat_rm/implementation_advice rm-13-7-1-16-address-operations}@anchor{253} @section RM 13.7.1(16): Address Operations @@ -15074,7 +15290,7 @@ operation raises @code{Program_Error}, since all operations make sense. @geindex Unchecked conversion @node RM 13 9 14-17 Unchecked Conversion,RM 13 11 23-25 Implicit Heap Usage,RM 13 7 1 16 Address Operations,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-9-14-17-unchecked-conversion}@anchor{252} +@anchor{gnat_rm/implementation_advice rm-13-9-14-17-unchecked-conversion}@anchor{254} @section RM 13.9(14-17): Unchecked Conversion @@ -15118,7 +15334,7 @@ Followed. @geindex implicit @node RM 13 11 23-25 Implicit Heap Usage,RM 13 11 2 17 Unchecked Deallocation,RM 13 9 14-17 Unchecked Conversion,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-11-23-25-implicit-heap-usage}@anchor{253} +@anchor{gnat_rm/implementation_advice rm-13-11-23-25-implicit-heap-usage}@anchor{255} @section RM 13.11(23-25): Implicit Heap Usage @@ -15169,7 +15385,7 @@ Followed. @geindex Unchecked deallocation @node RM 13 11 2 17 Unchecked Deallocation,RM 13 13 2 1 6 Stream Oriented Attributes,RM 13 11 23-25 Implicit Heap Usage,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-11-2-17-unchecked-deallocation}@anchor{254} +@anchor{gnat_rm/implementation_advice rm-13-11-2-17-unchecked-deallocation}@anchor{256} @section RM 13.11.2(17): Unchecked Deallocation @@ -15184,7 +15400,7 @@ Followed. @geindex Stream oriented attributes @node RM 13 13 2 1 6 Stream Oriented Attributes,RM A 1 52 Names of Predefined Numeric Types,RM 13 11 2 17 Unchecked Deallocation,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-13-13-2-1-6-stream-oriented-attributes}@anchor{255} +@anchor{gnat_rm/implementation_advice rm-13-13-2-1-6-stream-oriented-attributes}@anchor{257} @section RM 13.13.2(1.6): Stream Oriented Attributes @@ -15215,7 +15431,7 @@ scalar types. This XDR alternative can be enabled via the binder switch -xdr. @geindex Stream oriented attributes @node RM A 1 52 Names of Predefined Numeric Types,RM A 3 2 49 Ada Characters Handling,RM 13 13 2 1 6 Stream Oriented Attributes,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-1-52-names-of-predefined-numeric-types}@anchor{256} +@anchor{gnat_rm/implementation_advice rm-a-1-52-names-of-predefined-numeric-types}@anchor{258} @section RM A.1(52): Names of Predefined Numeric Types @@ -15233,7 +15449,7 @@ Followed. @geindex Ada.Characters.Handling @node RM A 3 2 49 Ada Characters Handling,RM A 4 4 106 Bounded-Length String Handling,RM A 1 52 Names of Predefined Numeric Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-3-2-49-ada-characters-handling}@anchor{257} +@anchor{gnat_rm/implementation_advice rm-a-3-2-49-ada-characters-handling}@anchor{259} @section RM A.3.2(49): @code{Ada.Characters.Handling} @@ -15250,7 +15466,7 @@ Followed. GNAT provides no such localized definitions. @geindex Bounded-length strings @node RM A 4 4 106 Bounded-Length String Handling,RM A 5 2 46-47 Random Number Generation,RM A 3 2 49 Ada Characters Handling,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-4-4-106-bounded-length-string-handling}@anchor{258} +@anchor{gnat_rm/implementation_advice rm-a-4-4-106-bounded-length-string-handling}@anchor{25a} @section RM A.4.4(106): Bounded-Length String Handling @@ -15265,7 +15481,7 @@ Followed. No implicit pointers or dynamic allocation are used. @geindex Random number generation @node RM A 5 2 46-47 Random Number Generation,RM A 10 7 23 Get_Immediate,RM A 4 4 106 Bounded-Length String Handling,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-5-2-46-47-random-number-generation}@anchor{259} +@anchor{gnat_rm/implementation_advice rm-a-5-2-46-47-random-number-generation}@anchor{25b} @section RM A.5.2(46-47): Random Number Generation @@ -15294,7 +15510,7 @@ condition here to hold true. @geindex Get_Immediate @node RM A 10 7 23 Get_Immediate,RM A 18 Containers,RM A 5 2 46-47 Random Number Generation,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-10-7-23-get-immediate}@anchor{25a} +@anchor{gnat_rm/implementation_advice rm-a-10-7-23-get-immediate}@anchor{25c} @section RM A.10.7(23): @code{Get_Immediate} @@ -15318,7 +15534,7 @@ this functionality. @geindex Containers @node RM A 18 Containers,RM B 1 39-41 Pragma Export,RM A 10 7 23 Get_Immediate,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-a-18-containers}@anchor{25b} +@anchor{gnat_rm/implementation_advice rm-a-18-containers}@anchor{25d} @section RM A.18: @code{Containers} @@ -15339,7 +15555,7 @@ follow the implementation advice. @geindex Export @node RM B 1 39-41 Pragma Export,RM B 2 12-13 Package Interfaces,RM A 18 Containers,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-b-1-39-41-pragma-export}@anchor{25c} +@anchor{gnat_rm/implementation_advice rm-b-1-39-41-pragma-export}@anchor{25e} @section RM B.1(39-41): Pragma @code{Export} @@ -15387,7 +15603,7 @@ Followed. @geindex Interfaces @node RM B 2 12-13 Package Interfaces,RM B 3 63-71 Interfacing with C,RM B 1 39-41 Pragma Export,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-b-2-12-13-package-interfaces}@anchor{25d} +@anchor{gnat_rm/implementation_advice rm-b-2-12-13-package-interfaces}@anchor{25f} @section RM B.2(12-13): Package @code{Interfaces} @@ -15417,7 +15633,7 @@ Followed. GNAT provides all the packages described in this section. @geindex interfacing with @node RM B 3 63-71 Interfacing with C,RM B 4 95-98 Interfacing with COBOL,RM B 2 12-13 Package Interfaces,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-b-3-63-71-interfacing-with-c}@anchor{25e} +@anchor{gnat_rm/implementation_advice rm-b-3-63-71-interfacing-with-c}@anchor{260} @section RM B.3(63-71): Interfacing with C @@ -15505,7 +15721,7 @@ Followed. @geindex interfacing with @node RM B 4 95-98 Interfacing with COBOL,RM B 5 22-26 Interfacing with Fortran,RM B 3 63-71 Interfacing with C,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-b-4-95-98-interfacing-with-cobol}@anchor{25f} +@anchor{gnat_rm/implementation_advice rm-b-4-95-98-interfacing-with-cobol}@anchor{261} @section RM B.4(95-98): Interfacing with COBOL @@ -15546,7 +15762,7 @@ Followed. @geindex interfacing with @node RM B 5 22-26 Interfacing with Fortran,RM C 1 3-5 Access to Machine Operations,RM B 4 95-98 Interfacing with COBOL,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-b-5-22-26-interfacing-with-fortran}@anchor{260} +@anchor{gnat_rm/implementation_advice rm-b-5-22-26-interfacing-with-fortran}@anchor{262} @section RM B.5(22-26): Interfacing with Fortran @@ -15597,7 +15813,7 @@ Followed. @geindex Machine operations @node RM C 1 3-5 Access to Machine Operations,RM C 1 10-16 Access to Machine Operations,RM B 5 22-26 Interfacing with Fortran,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-1-3-5-access-to-machine-operations}@anchor{261} +@anchor{gnat_rm/implementation_advice rm-c-1-3-5-access-to-machine-operations}@anchor{263} @section RM C.1(3-5): Access to Machine Operations @@ -15632,7 +15848,7 @@ object that is specified as exported.” Followed. @node RM C 1 10-16 Access to Machine Operations,RM C 3 28 Interrupt Support,RM C 1 3-5 Access to Machine Operations,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-1-10-16-access-to-machine-operations}@anchor{262} +@anchor{gnat_rm/implementation_advice rm-c-1-10-16-access-to-machine-operations}@anchor{264} @section RM C.1(10-16): Access to Machine Operations @@ -15693,7 +15909,7 @@ Followed on any target supporting such operations. @geindex Interrupt support @node RM C 3 28 Interrupt Support,RM C 3 1 20-21 Protected Procedure Handlers,RM C 1 10-16 Access to Machine Operations,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-3-28-interrupt-support}@anchor{263} +@anchor{gnat_rm/implementation_advice rm-c-3-28-interrupt-support}@anchor{265} @section RM C.3(28): Interrupt Support @@ -15711,7 +15927,7 @@ of interrupt blocking. @geindex Protected procedure handlers @node RM C 3 1 20-21 Protected Procedure Handlers,RM C 3 2 25 Package Interrupts,RM C 3 28 Interrupt Support,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-3-1-20-21-protected-procedure-handlers}@anchor{264} +@anchor{gnat_rm/implementation_advice rm-c-3-1-20-21-protected-procedure-handlers}@anchor{266} @section RM C.3.1(20-21): Protected Procedure Handlers @@ -15737,7 +15953,7 @@ Followed. Compile time warnings are given when possible. @geindex Interrupts @node RM C 3 2 25 Package Interrupts,RM C 4 14 Pre-elaboration Requirements,RM C 3 1 20-21 Protected Procedure Handlers,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-3-2-25-package-interrupts}@anchor{265} +@anchor{gnat_rm/implementation_advice rm-c-3-2-25-package-interrupts}@anchor{267} @section RM C.3.2(25): Package @code{Interrupts} @@ -15755,7 +15971,7 @@ Followed. @geindex Pre-elaboration requirements @node RM C 4 14 Pre-elaboration Requirements,RM C 5 8 Pragma Discard_Names,RM C 3 2 25 Package Interrupts,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-4-14-pre-elaboration-requirements}@anchor{266} +@anchor{gnat_rm/implementation_advice rm-c-4-14-pre-elaboration-requirements}@anchor{268} @section RM C.4(14): Pre-elaboration Requirements @@ -15771,7 +15987,7 @@ Followed. Executable code is generated in some cases, e.g., loops to initialize large arrays. @node RM C 5 8 Pragma Discard_Names,RM C 7 2 30 The Package Task_Attributes,RM C 4 14 Pre-elaboration Requirements,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-5-8-pragma-discard-names}@anchor{267} +@anchor{gnat_rm/implementation_advice rm-c-5-8-pragma-discard-names}@anchor{269} @section RM C.5(8): Pragma @code{Discard_Names} @@ -15789,7 +16005,7 @@ Followed. @geindex Task_Attributes @node RM C 7 2 30 The Package Task_Attributes,RM D 3 17 Locking Policies,RM C 5 8 Pragma Discard_Names,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-c-7-2-30-the-package-task-attributes}@anchor{268} +@anchor{gnat_rm/implementation_advice rm-c-7-2-30-the-package-task-attributes}@anchor{26a} @section RM C.7.2(30): The Package Task_Attributes @@ -15810,7 +16026,7 @@ Not followed. This implementation is not targeted to such a domain. @geindex Locking Policies @node RM D 3 17 Locking Policies,RM D 4 16 Entry Queuing Policies,RM C 7 2 30 The Package Task_Attributes,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-d-3-17-locking-policies}@anchor{269} +@anchor{gnat_rm/implementation_advice rm-d-3-17-locking-policies}@anchor{26b} @section RM D.3(17): Locking Policies @@ -15827,7 +16043,7 @@ whose names (@code{Inheritance_Locking} and @geindex Entry queuing policies @node RM D 4 16 Entry Queuing Policies,RM D 6 9-10 Preemptive Abort,RM D 3 17 Locking Policies,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-d-4-16-entry-queuing-policies}@anchor{26a} +@anchor{gnat_rm/implementation_advice rm-d-4-16-entry-queuing-policies}@anchor{26c} @section RM D.4(16): Entry Queuing Policies @@ -15842,7 +16058,7 @@ Followed. No such implementation-defined queuing policies exist. @geindex Preemptive abort @node RM D 6 9-10 Preemptive Abort,RM D 7 21 Tasking Restrictions,RM D 4 16 Entry Queuing Policies,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-d-6-9-10-preemptive-abort}@anchor{26b} +@anchor{gnat_rm/implementation_advice rm-d-6-9-10-preemptive-abort}@anchor{26d} @section RM D.6(9-10): Preemptive Abort @@ -15868,7 +16084,7 @@ Followed. @geindex Tasking restrictions @node RM D 7 21 Tasking Restrictions,RM D 8 47-49 Monotonic Time,RM D 6 9-10 Preemptive Abort,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-d-7-21-tasking-restrictions}@anchor{26c} +@anchor{gnat_rm/implementation_advice rm-d-7-21-tasking-restrictions}@anchor{26e} @section RM D.7(21): Tasking Restrictions @@ -15887,7 +16103,7 @@ pragma @code{Profile (Restricted)} for more details. @geindex monotonic @node RM D 8 47-49 Monotonic Time,RM E 5 28-29 Partition Communication Subsystem,RM D 7 21 Tasking Restrictions,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-d-8-47-49-monotonic-time}@anchor{26d} +@anchor{gnat_rm/implementation_advice rm-d-8-47-49-monotonic-time}@anchor{26f} @section RM D.8(47-49): Monotonic Time @@ -15922,7 +16138,7 @@ Followed. @geindex PCS @node RM E 5 28-29 Partition Communication Subsystem,RM F 7 COBOL Support,RM D 8 47-49 Monotonic Time,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-e-5-28-29-partition-communication-subsystem}@anchor{26e} +@anchor{gnat_rm/implementation_advice rm-e-5-28-29-partition-communication-subsystem}@anchor{270} @section RM E.5(28-29): Partition Communication Subsystem @@ -15934,7 +16150,8 @@ should allow them to block until the corresponding subprogram body returns.” @end quotation -A separately supplied PCS that can be used with GNAT when combined with the PolyORB product. +A separately supplied PCS that can be used with GNAT when combined with the PolyORB product (NB! See the note in @ref{271,,PolyORB} regarding the lifetime +of this product). @quotation @@ -15946,7 +16163,7 @@ write the @code{Item} into the stream.” @geindex COBOL support @node RM F 7 COBOL Support,RM F 1 2 Decimal Radix Support,RM E 5 28-29 Partition Communication Subsystem,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-f-7-cobol-support}@anchor{26f} +@anchor{gnat_rm/implementation_advice rm-f-7-cobol-support}@anchor{272} @section RM F(7): COBOL Support @@ -15966,7 +16183,7 @@ Followed. @geindex Decimal radix support @node RM F 1 2 Decimal Radix Support,RM G Numerics,RM F 7 COBOL Support,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-f-1-2-decimal-radix-support}@anchor{270} +@anchor{gnat_rm/implementation_advice rm-f-1-2-decimal-radix-support}@anchor{273} @section RM F.1(2): Decimal Radix Support @@ -15982,7 +16199,7 @@ representations. @geindex Numerics @node RM G Numerics,RM G 1 1 56-58 Complex Types,RM F 1 2 Decimal Radix Support,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-g-numerics}@anchor{271} +@anchor{gnat_rm/implementation_advice rm-g-numerics}@anchor{274} @section RM G: Numerics @@ -16002,7 +16219,7 @@ Followed. @geindex Complex types @node RM G 1 1 56-58 Complex Types,RM G 1 2 49 Complex Elementary Functions,RM G Numerics,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-g-1-1-56-58-complex-types}@anchor{272} +@anchor{gnat_rm/implementation_advice rm-g-1-1-56-58-complex-types}@anchor{275} @section RM G.1.1(56-58): Complex Types @@ -16064,7 +16281,7 @@ Followed. @geindex Complex elementary functions @node RM G 1 2 49 Complex Elementary Functions,RM G 2 4 19 Accuracy Requirements,RM G 1 1 56-58 Complex Types,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-g-1-2-49-complex-elementary-functions}@anchor{273} +@anchor{gnat_rm/implementation_advice rm-g-1-2-49-complex-elementary-functions}@anchor{276} @section RM G.1.2(49): Complex Elementary Functions @@ -16086,7 +16303,7 @@ Followed. @geindex Accuracy requirements @node RM G 2 4 19 Accuracy Requirements,RM G 2 6 15 Complex Arithmetic Accuracy,RM G 1 2 49 Complex Elementary Functions,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-g-2-4-19-accuracy-requirements}@anchor{274} +@anchor{gnat_rm/implementation_advice rm-g-2-4-19-accuracy-requirements}@anchor{277} @section RM G.2.4(19): Accuracy Requirements @@ -16110,7 +16327,7 @@ Followed. @geindex complex arithmetic @node RM G 2 6 15 Complex Arithmetic Accuracy,RM H 6 15/2 Pragma Partition_Elaboration_Policy,RM G 2 4 19 Accuracy Requirements,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-g-2-6-15-complex-arithmetic-accuracy}@anchor{275} +@anchor{gnat_rm/implementation_advice rm-g-2-6-15-complex-arithmetic-accuracy}@anchor{278} @section RM G.2.6(15): Complex Arithmetic Accuracy @@ -16128,7 +16345,7 @@ Followed. @geindex Sequential elaboration policy @node RM H 6 15/2 Pragma Partition_Elaboration_Policy,,RM G 2 6 15 Complex Arithmetic Accuracy,Implementation Advice -@anchor{gnat_rm/implementation_advice rm-h-6-15-2-pragma-partition-elaboration-policy}@anchor{276} +@anchor{gnat_rm/implementation_advice rm-h-6-15-2-pragma-partition-elaboration-policy}@anchor{279} @section RM H.6(15/2): Pragma Partition_Elaboration_Policy @@ -16143,7 +16360,7 @@ immediately terminated.” Not followed. @node Implementation Defined Characteristics,Intrinsic Subprograms,Implementation Advice,Top -@anchor{gnat_rm/implementation_defined_characteristics doc}@anchor{277}@anchor{gnat_rm/implementation_defined_characteristics id1}@anchor{278}@anchor{gnat_rm/implementation_defined_characteristics implementation-defined-characteristics}@anchor{b} +@anchor{gnat_rm/implementation_defined_characteristics doc}@anchor{27a}@anchor{gnat_rm/implementation_defined_characteristics id1}@anchor{27b}@anchor{gnat_rm/implementation_defined_characteristics implementation-defined-characteristics}@anchor{b} @chapter Implementation Defined Characteristics @@ -16784,7 +17001,8 @@ may have been set by a call to @code{Ada.Command_Line.Set_Exit_Status}). “The mechanisms for building and running partitions. See 10.2(24).” @end itemize -GNAT itself supports programs with only a single partition. The PolyORB product (which also includes an implementation of the PCS) provides a completely flexible method for building and running programs consisting of multiple partitions. See the separate PolyORB user guide for details. +GNAT itself supports programs with only a single partition. The PolyORB product (which also includes an implementation of the PCS) provides a completely flexible method for building and running programs consisting of multiple partitions. `NB!' See the note in @ref{271,,PolyORB} regarding the lifetime +of this product. @itemize * @@ -16805,8 +17023,7 @@ implementation. See 10.2(28).” @end itemize Passive partitions are supported on targets where shared memory is -provided by the operating system. See the PolyORB user guide for -further details. +provided by the operating system. `NB!' See the note in @ref{271,,PolyORB} regarding the lifetime of this product. @itemize * @@ -16989,7 +17206,7 @@ See separate section on data representations. such aspects and the legality rules for such aspects. See 13.1.1(38).” @end itemize -See @ref{130,,Implementation Defined Aspects}. +See @ref{131,,Implementation Defined Aspects}. @itemize * @@ -17433,7 +17650,7 @@ When the @code{Pattern} parameter is not the null string, it is interpreted according to the syntax of regular expressions as defined in the @code{GNAT.Regexp} package. -See @ref{279,,GNAT.Regexp (g-regexp.ads)}. +See @ref{27c,,GNAT.Regexp (g-regexp.ads)}. @itemize * @@ -18192,7 +18409,7 @@ programs. See E(5).” @end itemize The PolyORB product provides means creating and executing -distributed programs. See the PolyORB user guide for further details. +distributed programs. `NB!' See the note in @ref{271,,PolyORB} regarding the lifetime of this product. @itemize * @@ -18203,6 +18420,8 @@ inaccessible. See E.1(7).” @end itemize See the PolyORB user guide for full details on such events. +`NB!' Consider the note in @ref{271,,PolyORB} regarding the lifetime +of this product. @itemize * @@ -18213,7 +18432,7 @@ shared resources between partitions in certain cases. See E.1(11).” @end itemize See the PolyORB user guide for full details on these aspects of -multi-partition execution. +multi-partition execution. `NB!' Consider the note in @ref{271,,PolyORB} regarding the lifetime of this product. @itemize * @@ -18224,7 +18443,7 @@ immediately aborted as a result of cancellation. See E.4(13).” @end itemize See the PolyORB user guide for details on the effect of abort in -a distributed application. +a distributed application. `NB!' Consider the note in @ref{271,,PolyORB} regarding the lifetime of this product. @itemize * @@ -18243,7 +18462,7 @@ System.RPC.Partition_ID’Last is Integer’Last. See source file @code{s-rpc.ad @end itemize See the PolyORB user guide for a full description of all -implementation defined interfaces. +implementation defined interfaces. `NB!' See the note in @ref{271,,PolyORB} regarding the lifetime of this product. @itemize * @@ -18531,7 +18750,7 @@ Information on those subjects is not yet available. Execution is erroneous in that case. @node Intrinsic Subprograms,Representation Clauses and Pragmas,Implementation Defined Characteristics,Top -@anchor{gnat_rm/intrinsic_subprograms doc}@anchor{27a}@anchor{gnat_rm/intrinsic_subprograms id1}@anchor{27b}@anchor{gnat_rm/intrinsic_subprograms intrinsic-subprograms}@anchor{c} +@anchor{gnat_rm/intrinsic_subprograms doc}@anchor{27d}@anchor{gnat_rm/intrinsic_subprograms id1}@anchor{27e}@anchor{gnat_rm/intrinsic_subprograms intrinsic-subprograms}@anchor{c} @chapter Intrinsic Subprograms @@ -18569,7 +18788,7 @@ Ada standard does not require Ada compilers to implement this feature. @end menu @node Intrinsic Operators,Compilation_ISO_Date,,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms id2}@anchor{27c}@anchor{gnat_rm/intrinsic_subprograms intrinsic-operators}@anchor{27d} +@anchor{gnat_rm/intrinsic_subprograms id2}@anchor{27f}@anchor{gnat_rm/intrinsic_subprograms intrinsic-operators}@anchor{280} @section Intrinsic Operators @@ -18600,7 +18819,7 @@ It is also possible to specify such operators for private types, if the full views are appropriate arithmetic types. @node Compilation_ISO_Date,Compilation_Date,Intrinsic Operators,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms compilation-iso-date}@anchor{27e}@anchor{gnat_rm/intrinsic_subprograms id3}@anchor{27f} +@anchor{gnat_rm/intrinsic_subprograms compilation-iso-date}@anchor{281}@anchor{gnat_rm/intrinsic_subprograms id3}@anchor{282} @section Compilation_ISO_Date @@ -18614,7 +18833,7 @@ application program should simply call the function the current compilation (in local time format YYYY-MM-DD). @node Compilation_Date,Compilation_Time,Compilation_ISO_Date,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms compilation-date}@anchor{280}@anchor{gnat_rm/intrinsic_subprograms id4}@anchor{281} +@anchor{gnat_rm/intrinsic_subprograms compilation-date}@anchor{283}@anchor{gnat_rm/intrinsic_subprograms id4}@anchor{284} @section Compilation_Date @@ -18624,7 +18843,7 @@ Same as Compilation_ISO_Date, except the string is in the form MMM DD YYYY. @node Compilation_Time,Enclosing_Entity,Compilation_Date,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms compilation-time}@anchor{282}@anchor{gnat_rm/intrinsic_subprograms id5}@anchor{283} +@anchor{gnat_rm/intrinsic_subprograms compilation-time}@anchor{285}@anchor{gnat_rm/intrinsic_subprograms id5}@anchor{286} @section Compilation_Time @@ -18638,7 +18857,7 @@ application program should simply call the function the current compilation (in local time format HH:MM:SS). @node Enclosing_Entity,Exception_Information,Compilation_Time,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms enclosing-entity}@anchor{284}@anchor{gnat_rm/intrinsic_subprograms id6}@anchor{285} +@anchor{gnat_rm/intrinsic_subprograms enclosing-entity}@anchor{287}@anchor{gnat_rm/intrinsic_subprograms id6}@anchor{288} @section Enclosing_Entity @@ -18652,7 +18871,7 @@ application program should simply call the function the current subprogram, package, task, entry, or protected subprogram. @node Exception_Information,Exception_Message,Enclosing_Entity,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms exception-information}@anchor{286}@anchor{gnat_rm/intrinsic_subprograms id7}@anchor{287} +@anchor{gnat_rm/intrinsic_subprograms exception-information}@anchor{289}@anchor{gnat_rm/intrinsic_subprograms id7}@anchor{28a} @section Exception_Information @@ -18666,7 +18885,7 @@ so an application program should simply call the function the exception information associated with the current exception. @node Exception_Message,Exception_Name,Exception_Information,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms exception-message}@anchor{288}@anchor{gnat_rm/intrinsic_subprograms id8}@anchor{289} +@anchor{gnat_rm/intrinsic_subprograms exception-message}@anchor{28b}@anchor{gnat_rm/intrinsic_subprograms id8}@anchor{28c} @section Exception_Message @@ -18680,7 +18899,7 @@ so an application program should simply call the function the message associated with the current exception. @node Exception_Name,File,Exception_Message,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms exception-name}@anchor{28a}@anchor{gnat_rm/intrinsic_subprograms id9}@anchor{28b} +@anchor{gnat_rm/intrinsic_subprograms exception-name}@anchor{28d}@anchor{gnat_rm/intrinsic_subprograms id9}@anchor{28e} @section Exception_Name @@ -18694,7 +18913,7 @@ so an application program should simply call the function the name of the current exception. @node File,Line,Exception_Name,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms file}@anchor{28c}@anchor{gnat_rm/intrinsic_subprograms id10}@anchor{28d} +@anchor{gnat_rm/intrinsic_subprograms file}@anchor{28f}@anchor{gnat_rm/intrinsic_subprograms id10}@anchor{290} @section File @@ -18708,7 +18927,7 @@ application program should simply call the function file. @node Line,Shifts and Rotates,File,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms id11}@anchor{28e}@anchor{gnat_rm/intrinsic_subprograms line}@anchor{28f} +@anchor{gnat_rm/intrinsic_subprograms id11}@anchor{291}@anchor{gnat_rm/intrinsic_subprograms line}@anchor{292} @section Line @@ -18722,7 +18941,7 @@ application program should simply call the function source line. @node Shifts and Rotates,Source_Location,Line,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms id12}@anchor{290}@anchor{gnat_rm/intrinsic_subprograms shifts-and-rotates}@anchor{291} +@anchor{gnat_rm/intrinsic_subprograms id12}@anchor{293}@anchor{gnat_rm/intrinsic_subprograms shifts-and-rotates}@anchor{294} @section Shifts and Rotates @@ -18765,7 +18984,7 @@ corresponding operator for modular type. In particular, shifting a negative number may change its sign bit to positive. @node Source_Location,,Shifts and Rotates,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms id13}@anchor{292}@anchor{gnat_rm/intrinsic_subprograms source-location}@anchor{293} +@anchor{gnat_rm/intrinsic_subprograms id13}@anchor{295}@anchor{gnat_rm/intrinsic_subprograms source-location}@anchor{296} @section Source_Location @@ -18779,7 +18998,7 @@ application program should simply call the function source file location. @node Representation Clauses and Pragmas,Standard Library Routines,Intrinsic Subprograms,Top -@anchor{gnat_rm/representation_clauses_and_pragmas doc}@anchor{294}@anchor{gnat_rm/representation_clauses_and_pragmas id1}@anchor{295}@anchor{gnat_rm/representation_clauses_and_pragmas representation-clauses-and-pragmas}@anchor{d} +@anchor{gnat_rm/representation_clauses_and_pragmas doc}@anchor{297}@anchor{gnat_rm/representation_clauses_and_pragmas id1}@anchor{298}@anchor{gnat_rm/representation_clauses_and_pragmas representation-clauses-and-pragmas}@anchor{d} @chapter Representation Clauses and Pragmas @@ -18825,7 +19044,7 @@ and this section describes the additional capabilities provided. @end menu @node Alignment Clauses,Size Clauses,,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas alignment-clauses}@anchor{296}@anchor{gnat_rm/representation_clauses_and_pragmas id2}@anchor{297} +@anchor{gnat_rm/representation_clauses_and_pragmas alignment-clauses}@anchor{299}@anchor{gnat_rm/representation_clauses_and_pragmas id2}@anchor{29a} @section Alignment Clauses @@ -18847,7 +19066,7 @@ For elementary types, the alignment is the minimum of the actual size of objects of the type divided by @code{Storage_Unit}, and the maximum alignment supported by the target. (This maximum alignment is given by the GNAT-specific attribute -@code{Standard'Maximum_Alignment}; see @ref{1a6,,Attribute Maximum_Alignment}.) +@code{Standard'Maximum_Alignment}; see @ref{1a8,,Attribute Maximum_Alignment}.) @geindex Maximum_Alignment attribute @@ -18956,7 +19175,7 @@ assumption is non-portable, and other compilers may choose different alignments for the subtype @code{RS}. @node Size Clauses,Storage_Size Clauses,Alignment Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id3}@anchor{298}@anchor{gnat_rm/representation_clauses_and_pragmas size-clauses}@anchor{299} +@anchor{gnat_rm/representation_clauses_and_pragmas id3}@anchor{29b}@anchor{gnat_rm/representation_clauses_and_pragmas size-clauses}@anchor{29c} @section Size Clauses @@ -19033,7 +19252,7 @@ if it is known that a Size value can be accommodated in an object of type Integer. @node Storage_Size Clauses,Size of Variant Record Objects,Size Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id4}@anchor{29a}@anchor{gnat_rm/representation_clauses_and_pragmas storage-size-clauses}@anchor{29b} +@anchor{gnat_rm/representation_clauses_and_pragmas id4}@anchor{29d}@anchor{gnat_rm/representation_clauses_and_pragmas storage-size-clauses}@anchor{29e} @section Storage_Size Clauses @@ -19106,7 +19325,7 @@ Of course in practice, there will not be any explicit allocators in the case of such an access declaration. @node Size of Variant Record Objects,Biased Representation,Storage_Size Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id5}@anchor{29c}@anchor{gnat_rm/representation_clauses_and_pragmas size-of-variant-record-objects}@anchor{29d} +@anchor{gnat_rm/representation_clauses_and_pragmas id5}@anchor{29f}@anchor{gnat_rm/representation_clauses_and_pragmas size-of-variant-record-objects}@anchor{2a0} @section Size of Variant Record Objects @@ -19216,7 +19435,7 @@ the maximum size, regardless of the current variant value, the variant value. @node Biased Representation,Value_Size and Object_Size Clauses,Size of Variant Record Objects,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas biased-representation}@anchor{29e}@anchor{gnat_rm/representation_clauses_and_pragmas id6}@anchor{29f} +@anchor{gnat_rm/representation_clauses_and_pragmas biased-representation}@anchor{2a1}@anchor{gnat_rm/representation_clauses_and_pragmas id6}@anchor{2a2} @section Biased Representation @@ -19254,7 +19473,7 @@ biased representation can be used for all discrete types except for enumeration types for which a representation clause is given. @node Value_Size and Object_Size Clauses,Component_Size Clauses,Biased Representation,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id7}@anchor{2a0}@anchor{gnat_rm/representation_clauses_and_pragmas value-size-and-object-size-clauses}@anchor{2a1} +@anchor{gnat_rm/representation_clauses_and_pragmas id7}@anchor{2a3}@anchor{gnat_rm/representation_clauses_and_pragmas value-size-and-object-size-clauses}@anchor{2a4} @section Value_Size and Object_Size Clauses @@ -19570,7 +19789,7 @@ definition clause forces biased representation. This warning can be turned off using @code{-gnatw.B}. @node Component_Size Clauses,Bit_Order Clauses,Value_Size and Object_Size Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas component-size-clauses}@anchor{2a2}@anchor{gnat_rm/representation_clauses_and_pragmas id8}@anchor{2a3} +@anchor{gnat_rm/representation_clauses_and_pragmas component-size-clauses}@anchor{2a5}@anchor{gnat_rm/representation_clauses_and_pragmas id8}@anchor{2a6} @section Component_Size Clauses @@ -19618,7 +19837,7 @@ and a pragma Pack for the same array type. if such duplicate clauses are given, the pragma Pack will be ignored. @node Bit_Order Clauses,Effect of Bit_Order on Byte Ordering,Component_Size Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas bit-order-clauses}@anchor{2a4}@anchor{gnat_rm/representation_clauses_and_pragmas id9}@anchor{2a5} +@anchor{gnat_rm/representation_clauses_and_pragmas bit-order-clauses}@anchor{2a7}@anchor{gnat_rm/representation_clauses_and_pragmas id9}@anchor{2a8} @section Bit_Order Clauses @@ -19724,7 +19943,7 @@ if desired. The following section contains additional details regarding the issue of byte ordering. @node Effect of Bit_Order on Byte Ordering,Pragma Pack for Arrays,Bit_Order Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas effect-of-bit-order-on-byte-ordering}@anchor{2a6}@anchor{gnat_rm/representation_clauses_and_pragmas id10}@anchor{2a7} +@anchor{gnat_rm/representation_clauses_and_pragmas effect-of-bit-order-on-byte-ordering}@anchor{2a9}@anchor{gnat_rm/representation_clauses_and_pragmas id10}@anchor{2aa} @section Effect of Bit_Order on Byte Ordering @@ -19981,7 +20200,7 @@ to set the boolean constant @code{Master_Byte_First} in an appropriate manner. @node Pragma Pack for Arrays,Pragma Pack for Records,Effect of Bit_Order on Byte Ordering,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id11}@anchor{2a8}@anchor{gnat_rm/representation_clauses_and_pragmas pragma-pack-for-arrays}@anchor{2a9} +@anchor{gnat_rm/representation_clauses_and_pragmas id11}@anchor{2ab}@anchor{gnat_rm/representation_clauses_and_pragmas pragma-pack-for-arrays}@anchor{2ac} @section Pragma Pack for Arrays @@ -20101,7 +20320,7 @@ Here 31-bit packing is achieved as required, and no warning is generated, since in this case the programmer intention is clear. @node Pragma Pack for Records,Record Representation Clauses,Pragma Pack for Arrays,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id12}@anchor{2aa}@anchor{gnat_rm/representation_clauses_and_pragmas pragma-pack-for-records}@anchor{2ab} +@anchor{gnat_rm/representation_clauses_and_pragmas id12}@anchor{2ad}@anchor{gnat_rm/representation_clauses_and_pragmas pragma-pack-for-records}@anchor{2ae} @section Pragma Pack for Records @@ -20185,7 +20404,7 @@ array that is longer than 64 bits, so it is itself non-packable on boundary, and takes an integral number of bytes, i.e., 72 bits. @node Record Representation Clauses,Handling of Records with Holes,Pragma Pack for Records,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id13}@anchor{2ac}@anchor{gnat_rm/representation_clauses_and_pragmas record-representation-clauses}@anchor{2ad} +@anchor{gnat_rm/representation_clauses_and_pragmas id13}@anchor{2af}@anchor{gnat_rm/representation_clauses_and_pragmas record-representation-clauses}@anchor{2b0} @section Record Representation Clauses @@ -20264,7 +20483,7 @@ end record; @end example @node Handling of Records with Holes,Enumeration Clauses,Record Representation Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas handling-of-records-with-holes}@anchor{2ae}@anchor{gnat_rm/representation_clauses_and_pragmas id14}@anchor{2af} +@anchor{gnat_rm/representation_clauses_and_pragmas handling-of-records-with-holes}@anchor{2b1}@anchor{gnat_rm/representation_clauses_and_pragmas id14}@anchor{2b2} @section Handling of Records with Holes @@ -20340,7 +20559,7 @@ for Hrec'Size use 64; @end example @node Enumeration Clauses,Address Clauses,Handling of Records with Holes,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas enumeration-clauses}@anchor{2b0}@anchor{gnat_rm/representation_clauses_and_pragmas id15}@anchor{2b1} +@anchor{gnat_rm/representation_clauses_and_pragmas enumeration-clauses}@anchor{2b3}@anchor{gnat_rm/representation_clauses_and_pragmas id15}@anchor{2b4} @section Enumeration Clauses @@ -20383,7 +20602,7 @@ the overhead of converting representation values to the corresponding positional values, (i.e., the value delivered by the @code{Pos} attribute). @node Address Clauses,Use of Address Clauses for Memory-Mapped I/O,Enumeration Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas address-clauses}@anchor{2b2}@anchor{gnat_rm/representation_clauses_and_pragmas id16}@anchor{2b3} +@anchor{gnat_rm/representation_clauses_and_pragmas address-clauses}@anchor{2b5}@anchor{gnat_rm/representation_clauses_and_pragmas id16}@anchor{2b6} @section Address Clauses @@ -20723,7 +20942,7 @@ then the program compiles without the warning and when run will generate the output @code{X was not clobbered}. @node Use of Address Clauses for Memory-Mapped I/O,Effect of Convention on Representation,Address Clauses,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas id17}@anchor{2b4}@anchor{gnat_rm/representation_clauses_and_pragmas use-of-address-clauses-for-memory-mapped-i-o}@anchor{2b5} +@anchor{gnat_rm/representation_clauses_and_pragmas id17}@anchor{2b7}@anchor{gnat_rm/representation_clauses_and_pragmas use-of-address-clauses-for-memory-mapped-i-o}@anchor{2b8} @section Use of Address Clauses for Memory-Mapped I/O @@ -20781,7 +21000,7 @@ provides the pragma @code{Volatile_Full_Access} which can be used in lieu of pragma @code{Atomic} and will give the additional guarantee. @node Effect of Convention on Representation,Conventions and Anonymous Access Types,Use of Address Clauses for Memory-Mapped I/O,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas effect-of-convention-on-representation}@anchor{2b6}@anchor{gnat_rm/representation_clauses_and_pragmas id18}@anchor{2b7} +@anchor{gnat_rm/representation_clauses_and_pragmas effect-of-convention-on-representation}@anchor{2b9}@anchor{gnat_rm/representation_clauses_and_pragmas id18}@anchor{2ba} @section Effect of Convention on Representation @@ -20859,7 +21078,7 @@ when one of these values is read, any nonzero value is treated as True. @end itemize @node Conventions and Anonymous Access Types,Determining the Representations chosen by GNAT,Effect of Convention on Representation,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas conventions-and-anonymous-access-types}@anchor{2b8}@anchor{gnat_rm/representation_clauses_and_pragmas id19}@anchor{2b9} +@anchor{gnat_rm/representation_clauses_and_pragmas conventions-and-anonymous-access-types}@anchor{2bb}@anchor{gnat_rm/representation_clauses_and_pragmas id19}@anchor{2bc} @section Conventions and Anonymous Access Types @@ -20935,7 +21154,7 @@ package ConvComp is @end example @node Determining the Representations chosen by GNAT,,Conventions and Anonymous Access Types,Representation Clauses and Pragmas -@anchor{gnat_rm/representation_clauses_and_pragmas determining-the-representations-chosen-by-gnat}@anchor{2ba}@anchor{gnat_rm/representation_clauses_and_pragmas id20}@anchor{2bb} +@anchor{gnat_rm/representation_clauses_and_pragmas determining-the-representations-chosen-by-gnat}@anchor{2bd}@anchor{gnat_rm/representation_clauses_and_pragmas id20}@anchor{2be} @section Determining the Representations chosen by GNAT @@ -21087,7 +21306,7 @@ generated by the compiler into the original source to fix and guarantee the actual representation to be used. @node Standard Library Routines,The Implementation of Standard I/O,Representation Clauses and Pragmas,Top -@anchor{gnat_rm/standard_library_routines doc}@anchor{2bc}@anchor{gnat_rm/standard_library_routines id1}@anchor{2bd}@anchor{gnat_rm/standard_library_routines standard-library-routines}@anchor{e} +@anchor{gnat_rm/standard_library_routines doc}@anchor{2bf}@anchor{gnat_rm/standard_library_routines id1}@anchor{2c0}@anchor{gnat_rm/standard_library_routines standard-library-routines}@anchor{e} @chapter Standard Library Routines @@ -21914,7 +22133,7 @@ For packages in Interfaces and System, all the RM defined packages are available in GNAT, see the Ada 2012 RM for full details. @node The Implementation of Standard I/O,The GNAT Library,Standard Library Routines,Top -@anchor{gnat_rm/the_implementation_of_standard_i_o doc}@anchor{2be}@anchor{gnat_rm/the_implementation_of_standard_i_o id1}@anchor{2bf}@anchor{gnat_rm/the_implementation_of_standard_i_o the-implementation-of-standard-i-o}@anchor{f} +@anchor{gnat_rm/the_implementation_of_standard_i_o doc}@anchor{2c1}@anchor{gnat_rm/the_implementation_of_standard_i_o id1}@anchor{2c2}@anchor{gnat_rm/the_implementation_of_standard_i_o the-implementation-of-standard-i-o}@anchor{f} @chapter The Implementation of Standard I/O @@ -21966,7 +22185,7 @@ these additional facilities are also described in this chapter. @end menu @node Standard I/O Packages,FORM Strings,,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id2}@anchor{2c0}@anchor{gnat_rm/the_implementation_of_standard_i_o standard-i-o-packages}@anchor{2c1} +@anchor{gnat_rm/the_implementation_of_standard_i_o id2}@anchor{2c3}@anchor{gnat_rm/the_implementation_of_standard_i_o standard-i-o-packages}@anchor{2c4} @section Standard I/O Packages @@ -22037,7 +22256,7 @@ flush the common I/O streams and in particular Standard_Output before elaborating the Ada code. @node FORM Strings,Direct_IO,Standard I/O Packages,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o form-strings}@anchor{2c2}@anchor{gnat_rm/the_implementation_of_standard_i_o id3}@anchor{2c3} +@anchor{gnat_rm/the_implementation_of_standard_i_o form-strings}@anchor{2c5}@anchor{gnat_rm/the_implementation_of_standard_i_o id3}@anchor{2c6} @section FORM Strings @@ -22063,7 +22282,7 @@ unrecognized keyword appears in a form string, it is silently ignored and not considered invalid. @node Direct_IO,Sequential_IO,FORM Strings,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o direct-io}@anchor{2c4}@anchor{gnat_rm/the_implementation_of_standard_i_o id4}@anchor{2c5} +@anchor{gnat_rm/the_implementation_of_standard_i_o direct-io}@anchor{2c7}@anchor{gnat_rm/the_implementation_of_standard_i_o id4}@anchor{2c8} @section Direct_IO @@ -22082,7 +22301,7 @@ There is no limit on the size of Direct_IO files, they are expanded as necessary to accommodate whatever records are written to the file. @node Sequential_IO,Text_IO,Direct_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id5}@anchor{2c6}@anchor{gnat_rm/the_implementation_of_standard_i_o sequential-io}@anchor{2c7} +@anchor{gnat_rm/the_implementation_of_standard_i_o id5}@anchor{2c9}@anchor{gnat_rm/the_implementation_of_standard_i_o sequential-io}@anchor{2ca} @section Sequential_IO @@ -22129,7 +22348,7 @@ using Stream_IO, and this is the preferred mechanism. In particular, the above program fragment rewritten to use Stream_IO will work correctly. @node Text_IO,Wide_Text_IO,Sequential_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id6}@anchor{2c8}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io}@anchor{2c9} +@anchor{gnat_rm/the_implementation_of_standard_i_o id6}@anchor{2cb}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io}@anchor{2cc} @section Text_IO @@ -22212,7 +22431,7 @@ the file. @end menu @node Stream Pointer Positioning,Reading and Writing Non-Regular Files,,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id7}@anchor{2ca}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning}@anchor{2cb} +@anchor{gnat_rm/the_implementation_of_standard_i_o id7}@anchor{2cd}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning}@anchor{2ce} @subsection Stream Pointer Positioning @@ -22248,7 +22467,7 @@ between two Ada files, then the difference may be observable in some situations. @node Reading and Writing Non-Regular Files,Get_Immediate,Stream Pointer Positioning,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id8}@anchor{2cc}@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files}@anchor{2cd} +@anchor{gnat_rm/the_implementation_of_standard_i_o id8}@anchor{2cf}@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files}@anchor{2d0} @subsection Reading and Writing Non-Regular Files @@ -22299,7 +22518,7 @@ to read data past that end of file indication, until another end of file indication is entered. @node Get_Immediate,Treating Text_IO Files as Streams,Reading and Writing Non-Regular Files,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o get-immediate}@anchor{2ce}@anchor{gnat_rm/the_implementation_of_standard_i_o id9}@anchor{2cf} +@anchor{gnat_rm/the_implementation_of_standard_i_o get-immediate}@anchor{2d1}@anchor{gnat_rm/the_implementation_of_standard_i_o id9}@anchor{2d2} @subsection Get_Immediate @@ -22317,7 +22536,7 @@ possible), it is undefined whether the FF character will be treated as a page mark. @node Treating Text_IO Files as Streams,Text_IO Extensions,Get_Immediate,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id10}@anchor{2d0}@anchor{gnat_rm/the_implementation_of_standard_i_o treating-text-io-files-as-streams}@anchor{2d1} +@anchor{gnat_rm/the_implementation_of_standard_i_o id10}@anchor{2d3}@anchor{gnat_rm/the_implementation_of_standard_i_o treating-text-io-files-as-streams}@anchor{2d4} @subsection Treating Text_IO Files as Streams @@ -22333,7 +22552,7 @@ skipped and the effect is similar to that described above for @code{Get_Immediate}. @node Text_IO Extensions,Text_IO Facilities for Unbounded Strings,Treating Text_IO Files as Streams,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id11}@anchor{2d2}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io-extensions}@anchor{2d3} +@anchor{gnat_rm/the_implementation_of_standard_i_o id11}@anchor{2d5}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io-extensions}@anchor{2d6} @subsection Text_IO Extensions @@ -22361,7 +22580,7 @@ the string is to be read. @end itemize @node Text_IO Facilities for Unbounded Strings,,Text_IO Extensions,Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id12}@anchor{2d4}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io-facilities-for-unbounded-strings}@anchor{2d5} +@anchor{gnat_rm/the_implementation_of_standard_i_o id12}@anchor{2d7}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io-facilities-for-unbounded-strings}@anchor{2d8} @subsection Text_IO Facilities for Unbounded Strings @@ -22409,7 +22628,7 @@ files @code{a-szuzti.ads} and @code{a-szuzti.adb} provides similar extended @code{Wide_Wide_Text_IO} functionality for unbounded wide wide strings. @node Wide_Text_IO,Wide_Wide_Text_IO,Text_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id13}@anchor{2d6}@anchor{gnat_rm/the_implementation_of_standard_i_o wide-text-io}@anchor{2d7} +@anchor{gnat_rm/the_implementation_of_standard_i_o id13}@anchor{2d9}@anchor{gnat_rm/the_implementation_of_standard_i_o wide-text-io}@anchor{2da} @section Wide_Text_IO @@ -22656,12 +22875,12 @@ input also causes Constraint_Error to be raised. @end menu @node Stream Pointer Positioning<2>,Reading and Writing Non-Regular Files<2>,,Wide_Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id14}@anchor{2d8}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning-1}@anchor{2d9} +@anchor{gnat_rm/the_implementation_of_standard_i_o id14}@anchor{2db}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning-1}@anchor{2dc} @subsection Stream Pointer Positioning @code{Ada.Wide_Text_IO} is similar to @code{Ada.Text_IO} in its handling -of stream pointer positioning (@ref{2c9,,Text_IO}). There is one additional +of stream pointer positioning (@ref{2cc,,Text_IO}). There is one additional case: If @code{Ada.Wide_Text_IO.Look_Ahead} reads a character outside the @@ -22680,7 +22899,7 @@ to a normal program using @code{Wide_Text_IO}. However, this discrepancy can be observed if the wide text file shares a stream with another file. @node Reading and Writing Non-Regular Files<2>,,Stream Pointer Positioning<2>,Wide_Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id15}@anchor{2da}@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files-1}@anchor{2db} +@anchor{gnat_rm/the_implementation_of_standard_i_o id15}@anchor{2dd}@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files-1}@anchor{2de} @subsection Reading and Writing Non-Regular Files @@ -22691,7 +22910,7 @@ treated as data characters), and @code{End_Of_Page} always returns it is possible to read beyond an end of file. @node Wide_Wide_Text_IO,Stream_IO,Wide_Text_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id16}@anchor{2dc}@anchor{gnat_rm/the_implementation_of_standard_i_o wide-wide-text-io}@anchor{2dd} +@anchor{gnat_rm/the_implementation_of_standard_i_o id16}@anchor{2df}@anchor{gnat_rm/the_implementation_of_standard_i_o wide-wide-text-io}@anchor{2e0} @section Wide_Wide_Text_IO @@ -22860,12 +23079,12 @@ input also causes Constraint_Error to be raised. @end menu @node Stream Pointer Positioning<3>,Reading and Writing Non-Regular Files<3>,,Wide_Wide_Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id17}@anchor{2de}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning-2}@anchor{2df} +@anchor{gnat_rm/the_implementation_of_standard_i_o id17}@anchor{2e1}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning-2}@anchor{2e2} @subsection Stream Pointer Positioning @code{Ada.Wide_Wide_Text_IO} is similar to @code{Ada.Text_IO} in its handling -of stream pointer positioning (@ref{2c9,,Text_IO}). There is one additional +of stream pointer positioning (@ref{2cc,,Text_IO}). There is one additional case: If @code{Ada.Wide_Wide_Text_IO.Look_Ahead} reads a character outside the @@ -22884,7 +23103,7 @@ to a normal program using @code{Wide_Wide_Text_IO}. However, this discrepancy can be observed if the wide text file shares a stream with another file. @node Reading and Writing Non-Regular Files<3>,,Stream Pointer Positioning<3>,Wide_Wide_Text_IO -@anchor{gnat_rm/the_implementation_of_standard_i_o id18}@anchor{2e0}@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files-2}@anchor{2e1} +@anchor{gnat_rm/the_implementation_of_standard_i_o id18}@anchor{2e3}@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files-2}@anchor{2e4} @subsection Reading and Writing Non-Regular Files @@ -22895,7 +23114,7 @@ treated as data characters), and @code{End_Of_Page} always returns it is possible to read beyond an end of file. @node Stream_IO,Text Translation,Wide_Wide_Text_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id19}@anchor{2e2}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-io}@anchor{2e3} +@anchor{gnat_rm/the_implementation_of_standard_i_o id19}@anchor{2e5}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-io}@anchor{2e6} @section Stream_IO @@ -22917,7 +23136,7 @@ manner described for stream attributes. @end itemize @node Text Translation,Shared Files,Stream_IO,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id20}@anchor{2e4}@anchor{gnat_rm/the_implementation_of_standard_i_o text-translation}@anchor{2e5} +@anchor{gnat_rm/the_implementation_of_standard_i_o id20}@anchor{2e7}@anchor{gnat_rm/the_implementation_of_standard_i_o text-translation}@anchor{2e8} @section Text Translation @@ -22951,7 +23170,7 @@ mode. (corresponds to_O_U16TEXT). @end itemize @node Shared Files,Filenames encoding,Text Translation,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id21}@anchor{2e6}@anchor{gnat_rm/the_implementation_of_standard_i_o shared-files}@anchor{2e7} +@anchor{gnat_rm/the_implementation_of_standard_i_o id21}@anchor{2e9}@anchor{gnat_rm/the_implementation_of_standard_i_o shared-files}@anchor{2ea} @section Shared Files @@ -23014,7 +23233,7 @@ heterogeneous input-output. Although this approach will work in GNAT if for this purpose (using the stream attributes). @node Filenames encoding,File content encoding,Shared Files,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o filenames-encoding}@anchor{2e8}@anchor{gnat_rm/the_implementation_of_standard_i_o id22}@anchor{2e9} +@anchor{gnat_rm/the_implementation_of_standard_i_o filenames-encoding}@anchor{2eb}@anchor{gnat_rm/the_implementation_of_standard_i_o id22}@anchor{2ec} @section Filenames encoding @@ -23054,7 +23273,7 @@ platform. On the other Operating Systems the run-time is supporting UTF-8 natively. @node File content encoding,Open Modes,Filenames encoding,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o file-content-encoding}@anchor{2ea}@anchor{gnat_rm/the_implementation_of_standard_i_o id23}@anchor{2eb} +@anchor{gnat_rm/the_implementation_of_standard_i_o file-content-encoding}@anchor{2ed}@anchor{gnat_rm/the_implementation_of_standard_i_o id23}@anchor{2ee} @section File content encoding @@ -23087,7 +23306,7 @@ Unicode 8-bit encoding This encoding is only supported on the Windows platform. @node Open Modes,Operations on C Streams,File content encoding,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id24}@anchor{2ec}@anchor{gnat_rm/the_implementation_of_standard_i_o open-modes}@anchor{2ed} +@anchor{gnat_rm/the_implementation_of_standard_i_o id24}@anchor{2ef}@anchor{gnat_rm/the_implementation_of_standard_i_o open-modes}@anchor{2f0} @section Open Modes @@ -23190,7 +23409,7 @@ subsequently requires switching from reading to writing or vice-versa, then the file is reopened in @code{r+} mode to permit the required operation. @node Operations on C Streams,Interfacing to C Streams,Open Modes,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id25}@anchor{2ee}@anchor{gnat_rm/the_implementation_of_standard_i_o operations-on-c-streams}@anchor{2ef} +@anchor{gnat_rm/the_implementation_of_standard_i_o id25}@anchor{2f1}@anchor{gnat_rm/the_implementation_of_standard_i_o operations-on-c-streams}@anchor{2f2} @section Operations on C Streams @@ -23350,7 +23569,7 @@ end Interfaces.C_Streams; @end example @node Interfacing to C Streams,,Operations on C Streams,The Implementation of Standard I/O -@anchor{gnat_rm/the_implementation_of_standard_i_o id26}@anchor{2f0}@anchor{gnat_rm/the_implementation_of_standard_i_o interfacing-to-c-streams}@anchor{2f1} +@anchor{gnat_rm/the_implementation_of_standard_i_o id26}@anchor{2f3}@anchor{gnat_rm/the_implementation_of_standard_i_o interfacing-to-c-streams}@anchor{2f4} @section Interfacing to C Streams @@ -23443,7 +23662,7 @@ imported from a C program, allowing an Ada file to operate on an existing C file. @node The GNAT Library,Interfacing to Other Languages,The Implementation of Standard I/O,Top -@anchor{gnat_rm/the_gnat_library doc}@anchor{2f2}@anchor{gnat_rm/the_gnat_library id1}@anchor{2f3}@anchor{gnat_rm/the_gnat_library the-gnat-library}@anchor{10} +@anchor{gnat_rm/the_gnat_library doc}@anchor{2f5}@anchor{gnat_rm/the_gnat_library id1}@anchor{2f6}@anchor{gnat_rm/the_gnat_library the-gnat-library}@anchor{10} @chapter The GNAT Library @@ -23521,6 +23740,7 @@ of GNAT, and will generate a warning message. * GNAT.Bubble_Sort_G (g-busorg.ads): GNAT Bubble_Sort_G g-busorg ads. * GNAT.Byte_Order_Mark (g-byorma.ads): GNAT Byte_Order_Mark g-byorma ads. * GNAT.Byte_Swapping (g-bytswa.ads): GNAT Byte_Swapping g-bytswa ads. +* GNAT.C_Time (g-c_time.ads): GNAT C_Time g-c_time ads. * GNAT.Calendar (g-calend.ads): GNAT Calendar g-calend ads. * GNAT.Calendar.Time_IO (g-catiio.ads): GNAT Calendar Time_IO g-catiio ads. * GNAT.CRC32 (g-crc32.ads): GNAT CRC32 g-crc32 ads. @@ -23628,7 +23848,7 @@ of GNAT, and will generate a warning message. @end menu @node Ada Characters Latin_9 a-chlat9 ads,Ada Characters Wide_Latin_1 a-cwila1 ads,,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-characters-latin-9-a-chlat9-ads}@anchor{2f4}@anchor{gnat_rm/the_gnat_library id2}@anchor{2f5} +@anchor{gnat_rm/the_gnat_library ada-characters-latin-9-a-chlat9-ads}@anchor{2f7}@anchor{gnat_rm/the_gnat_library id2}@anchor{2f8} @section @code{Ada.Characters.Latin_9} (@code{a-chlat9.ads}) @@ -23645,7 +23865,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Characters Wide_Latin_1 a-cwila1 ads,Ada Characters Wide_Latin_9 a-cwila9 ads,Ada Characters Latin_9 a-chlat9 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-characters-wide-latin-1-a-cwila1-ads}@anchor{2f6}@anchor{gnat_rm/the_gnat_library id3}@anchor{2f7} +@anchor{gnat_rm/the_gnat_library ada-characters-wide-latin-1-a-cwila1-ads}@anchor{2f9}@anchor{gnat_rm/the_gnat_library id3}@anchor{2fa} @section @code{Ada.Characters.Wide_Latin_1} (@code{a-cwila1.ads}) @@ -23662,7 +23882,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Characters Wide_Latin_9 a-cwila9 ads,Ada Characters Wide_Wide_Latin_1 a-chzla1 ads,Ada Characters Wide_Latin_1 a-cwila1 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-characters-wide-latin-9-a-cwila9-ads}@anchor{2f8}@anchor{gnat_rm/the_gnat_library id4}@anchor{2f9} +@anchor{gnat_rm/the_gnat_library ada-characters-wide-latin-9-a-cwila9-ads}@anchor{2fb}@anchor{gnat_rm/the_gnat_library id4}@anchor{2fc} @section @code{Ada.Characters.Wide_Latin_9} (@code{a-cwila9.ads}) @@ -23679,7 +23899,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Characters Wide_Wide_Latin_1 a-chzla1 ads,Ada Characters Wide_Wide_Latin_9 a-chzla9 ads,Ada Characters Wide_Latin_9 a-cwila9 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-characters-wide-wide-latin-1-a-chzla1-ads}@anchor{2fa}@anchor{gnat_rm/the_gnat_library id5}@anchor{2fb} +@anchor{gnat_rm/the_gnat_library ada-characters-wide-wide-latin-1-a-chzla1-ads}@anchor{2fd}@anchor{gnat_rm/the_gnat_library id5}@anchor{2fe} @section @code{Ada.Characters.Wide_Wide_Latin_1} (@code{a-chzla1.ads}) @@ -23696,7 +23916,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Characters Wide_Wide_Latin_9 a-chzla9 ads,Ada Containers Bounded_Holders a-coboho ads,Ada Characters Wide_Wide_Latin_1 a-chzla1 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-characters-wide-wide-latin-9-a-chzla9-ads}@anchor{2fc}@anchor{gnat_rm/the_gnat_library id6}@anchor{2fd} +@anchor{gnat_rm/the_gnat_library ada-characters-wide-wide-latin-9-a-chzla9-ads}@anchor{2ff}@anchor{gnat_rm/the_gnat_library id6}@anchor{300} @section @code{Ada.Characters.Wide_Wide_Latin_9} (@code{a-chzla9.ads}) @@ -23713,7 +23933,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Containers Bounded_Holders a-coboho ads,Ada Command_Line Environment a-colien ads,Ada Characters Wide_Wide_Latin_9 a-chzla9 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-containers-bounded-holders-a-coboho-ads}@anchor{2fe}@anchor{gnat_rm/the_gnat_library id7}@anchor{2ff} +@anchor{gnat_rm/the_gnat_library ada-containers-bounded-holders-a-coboho-ads}@anchor{301}@anchor{gnat_rm/the_gnat_library id7}@anchor{302} @section @code{Ada.Containers.Bounded_Holders} (@code{a-coboho.ads}) @@ -23725,7 +23945,7 @@ This child of @code{Ada.Containers} defines a modified version of Indefinite_Holders that avoids heap allocation. @node Ada Command_Line Environment a-colien ads,Ada Command_Line Remove a-colire ads,Ada Containers Bounded_Holders a-coboho ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-command-line-environment-a-colien-ads}@anchor{300}@anchor{gnat_rm/the_gnat_library id8}@anchor{301} +@anchor{gnat_rm/the_gnat_library ada-command-line-environment-a-colien-ads}@anchor{303}@anchor{gnat_rm/the_gnat_library id8}@anchor{304} @section @code{Ada.Command_Line.Environment} (@code{a-colien.ads}) @@ -23738,7 +23958,7 @@ provides a mechanism for obtaining environment values on systems where this concept makes sense. @node Ada Command_Line Remove a-colire ads,Ada Command_Line Response_File a-clrefi ads,Ada Command_Line Environment a-colien ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-command-line-remove-a-colire-ads}@anchor{302}@anchor{gnat_rm/the_gnat_library id9}@anchor{303} +@anchor{gnat_rm/the_gnat_library ada-command-line-remove-a-colire-ads}@anchor{305}@anchor{gnat_rm/the_gnat_library id9}@anchor{306} @section @code{Ada.Command_Line.Remove} (@code{a-colire.ads}) @@ -23756,7 +23976,7 @@ to further calls to the subprograms in @code{Ada.Command_Line}. These calls will not see the removed argument. @node Ada Command_Line Response_File a-clrefi ads,Ada Direct_IO C_Streams a-diocst ads,Ada Command_Line Remove a-colire ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-command-line-response-file-a-clrefi-ads}@anchor{304}@anchor{gnat_rm/the_gnat_library id10}@anchor{305} +@anchor{gnat_rm/the_gnat_library ada-command-line-response-file-a-clrefi-ads}@anchor{307}@anchor{gnat_rm/the_gnat_library id10}@anchor{308} @section @code{Ada.Command_Line.Response_File} (@code{a-clrefi.ads}) @@ -23776,7 +23996,7 @@ Using a response file allow passing a set of arguments to an executable longer than the maximum allowed by the system on the command line. @node Ada Direct_IO C_Streams a-diocst ads,Ada Exceptions Is_Null_Occurrence a-einuoc ads,Ada Command_Line Response_File a-clrefi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-direct-io-c-streams-a-diocst-ads}@anchor{306}@anchor{gnat_rm/the_gnat_library id11}@anchor{307} +@anchor{gnat_rm/the_gnat_library ada-direct-io-c-streams-a-diocst-ads}@anchor{309}@anchor{gnat_rm/the_gnat_library id11}@anchor{30a} @section @code{Ada.Direct_IO.C_Streams} (@code{a-diocst.ads}) @@ -23791,7 +24011,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Exceptions Is_Null_Occurrence a-einuoc ads,Ada Exceptions Last_Chance_Handler a-elchha ads,Ada Direct_IO C_Streams a-diocst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-exceptions-is-null-occurrence-a-einuoc-ads}@anchor{308}@anchor{gnat_rm/the_gnat_library id12}@anchor{309} +@anchor{gnat_rm/the_gnat_library ada-exceptions-is-null-occurrence-a-einuoc-ads}@anchor{30b}@anchor{gnat_rm/the_gnat_library id12}@anchor{30c} @section @code{Ada.Exceptions.Is_Null_Occurrence} (@code{a-einuoc.ads}) @@ -23805,7 +24025,7 @@ exception occurrence (@code{Null_Occurrence}) without raising an exception. @node Ada Exceptions Last_Chance_Handler a-elchha ads,Ada Exceptions Traceback a-exctra ads,Ada Exceptions Is_Null_Occurrence a-einuoc ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-exceptions-last-chance-handler-a-elchha-ads}@anchor{30a}@anchor{gnat_rm/the_gnat_library id13}@anchor{30b} +@anchor{gnat_rm/the_gnat_library ada-exceptions-last-chance-handler-a-elchha-ads}@anchor{30d}@anchor{gnat_rm/the_gnat_library id13}@anchor{30e} @section @code{Ada.Exceptions.Last_Chance_Handler} (@code{a-elchha.ads}) @@ -23819,7 +24039,7 @@ exceptions (hence the name last chance), and perform clean ups before terminating the program. Note that this subprogram never returns. @node Ada Exceptions Traceback a-exctra ads,Ada Sequential_IO C_Streams a-siocst ads,Ada Exceptions Last_Chance_Handler a-elchha ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-exceptions-traceback-a-exctra-ads}@anchor{30c}@anchor{gnat_rm/the_gnat_library id14}@anchor{30d} +@anchor{gnat_rm/the_gnat_library ada-exceptions-traceback-a-exctra-ads}@anchor{30f}@anchor{gnat_rm/the_gnat_library id14}@anchor{310} @section @code{Ada.Exceptions.Traceback} (@code{a-exctra.ads}) @@ -23832,7 +24052,7 @@ give a traceback array of addresses based on an exception occurrence. @node Ada Sequential_IO C_Streams a-siocst ads,Ada Streams Stream_IO C_Streams a-ssicst ads,Ada Exceptions Traceback a-exctra ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-sequential-io-c-streams-a-siocst-ads}@anchor{30e}@anchor{gnat_rm/the_gnat_library id15}@anchor{30f} +@anchor{gnat_rm/the_gnat_library ada-sequential-io-c-streams-a-siocst-ads}@anchor{311}@anchor{gnat_rm/the_gnat_library id15}@anchor{312} @section @code{Ada.Sequential_IO.C_Streams} (@code{a-siocst.ads}) @@ -23847,7 +24067,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Streams Stream_IO C_Streams a-ssicst ads,Ada Strings Unbounded Text_IO a-suteio ads,Ada Sequential_IO C_Streams a-siocst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-streams-stream-io-c-streams-a-ssicst-ads}@anchor{310}@anchor{gnat_rm/the_gnat_library id16}@anchor{311} +@anchor{gnat_rm/the_gnat_library ada-streams-stream-io-c-streams-a-ssicst-ads}@anchor{313}@anchor{gnat_rm/the_gnat_library id16}@anchor{314} @section @code{Ada.Streams.Stream_IO.C_Streams} (@code{a-ssicst.ads}) @@ -23862,7 +24082,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Strings Unbounded Text_IO a-suteio ads,Ada Strings Wide_Unbounded Wide_Text_IO a-swuwti ads,Ada Streams Stream_IO C_Streams a-ssicst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-strings-unbounded-text-io-a-suteio-ads}@anchor{312}@anchor{gnat_rm/the_gnat_library id17}@anchor{313} +@anchor{gnat_rm/the_gnat_library ada-strings-unbounded-text-io-a-suteio-ads}@anchor{315}@anchor{gnat_rm/the_gnat_library id17}@anchor{316} @section @code{Ada.Strings.Unbounded.Text_IO} (@code{a-suteio.ads}) @@ -23879,7 +24099,7 @@ strings, avoiding the necessity for an intermediate operation with ordinary strings. @node Ada Strings Wide_Unbounded Wide_Text_IO a-swuwti ads,Ada Strings Wide_Wide_Unbounded Wide_Wide_Text_IO a-szuzti ads,Ada Strings Unbounded Text_IO a-suteio ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-strings-wide-unbounded-wide-text-io-a-swuwti-ads}@anchor{314}@anchor{gnat_rm/the_gnat_library id18}@anchor{315} +@anchor{gnat_rm/the_gnat_library ada-strings-wide-unbounded-wide-text-io-a-swuwti-ads}@anchor{317}@anchor{gnat_rm/the_gnat_library id18}@anchor{318} @section @code{Ada.Strings.Wide_Unbounded.Wide_Text_IO} (@code{a-swuwti.ads}) @@ -23896,7 +24116,7 @@ wide strings, avoiding the necessity for an intermediate operation with ordinary wide strings. @node Ada Strings Wide_Wide_Unbounded Wide_Wide_Text_IO a-szuzti ads,Ada Task_Initialization a-tasini ads,Ada Strings Wide_Unbounded Wide_Text_IO a-swuwti ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-strings-wide-wide-unbounded-wide-wide-text-io-a-szuzti-ads}@anchor{316}@anchor{gnat_rm/the_gnat_library id19}@anchor{317} +@anchor{gnat_rm/the_gnat_library ada-strings-wide-wide-unbounded-wide-wide-text-io-a-szuzti-ads}@anchor{319}@anchor{gnat_rm/the_gnat_library id19}@anchor{31a} @section @code{Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO} (@code{a-szuzti.ads}) @@ -23913,7 +24133,7 @@ wide wide strings, avoiding the necessity for an intermediate operation with ordinary wide wide strings. @node Ada Task_Initialization a-tasini ads,Ada Text_IO C_Streams a-tiocst ads,Ada Strings Wide_Wide_Unbounded Wide_Wide_Text_IO a-szuzti ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-task-initialization-a-tasini-ads}@anchor{318}@anchor{gnat_rm/the_gnat_library id20}@anchor{319} +@anchor{gnat_rm/the_gnat_library ada-task-initialization-a-tasini-ads}@anchor{31b}@anchor{gnat_rm/the_gnat_library id20}@anchor{31c} @section @code{Ada.Task_Initialization} (@code{a-tasini.ads}) @@ -23925,7 +24145,7 @@ parameterless procedures. Note that such a handler is only invoked for those tasks activated after the handler is set. @node Ada Text_IO C_Streams a-tiocst ads,Ada Text_IO Reset_Standard_Files a-tirsfi ads,Ada Task_Initialization a-tasini ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-text-io-c-streams-a-tiocst-ads}@anchor{31a}@anchor{gnat_rm/the_gnat_library id21}@anchor{31b} +@anchor{gnat_rm/the_gnat_library ada-text-io-c-streams-a-tiocst-ads}@anchor{31d}@anchor{gnat_rm/the_gnat_library id21}@anchor{31e} @section @code{Ada.Text_IO.C_Streams} (@code{a-tiocst.ads}) @@ -23940,7 +24160,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Text_IO Reset_Standard_Files a-tirsfi ads,Ada Wide_Characters Unicode a-wichun ads,Ada Text_IO C_Streams a-tiocst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-text-io-reset-standard-files-a-tirsfi-ads}@anchor{31c}@anchor{gnat_rm/the_gnat_library id22}@anchor{31d} +@anchor{gnat_rm/the_gnat_library ada-text-io-reset-standard-files-a-tirsfi-ads}@anchor{31f}@anchor{gnat_rm/the_gnat_library id22}@anchor{320} @section @code{Ada.Text_IO.Reset_Standard_Files} (@code{a-tirsfi.ads}) @@ -23955,7 +24175,7 @@ execution (for example a standard input file may be redefined to be interactive). @node Ada Wide_Characters Unicode a-wichun ads,Ada Wide_Text_IO C_Streams a-wtcstr ads,Ada Text_IO Reset_Standard_Files a-tirsfi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-wide-characters-unicode-a-wichun-ads}@anchor{31e}@anchor{gnat_rm/the_gnat_library id23}@anchor{31f} +@anchor{gnat_rm/the_gnat_library ada-wide-characters-unicode-a-wichun-ads}@anchor{321}@anchor{gnat_rm/the_gnat_library id23}@anchor{322} @section @code{Ada.Wide_Characters.Unicode} (@code{a-wichun.ads}) @@ -23968,7 +24188,7 @@ This package provides subprograms that allow categorization of Wide_Character values according to Unicode categories. @node Ada Wide_Text_IO C_Streams a-wtcstr ads,Ada Wide_Text_IO Reset_Standard_Files a-wrstfi ads,Ada Wide_Characters Unicode a-wichun ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-wide-text-io-c-streams-a-wtcstr-ads}@anchor{320}@anchor{gnat_rm/the_gnat_library id24}@anchor{321} +@anchor{gnat_rm/the_gnat_library ada-wide-text-io-c-streams-a-wtcstr-ads}@anchor{323}@anchor{gnat_rm/the_gnat_library id24}@anchor{324} @section @code{Ada.Wide_Text_IO.C_Streams} (@code{a-wtcstr.ads}) @@ -23983,7 +24203,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Wide_Text_IO Reset_Standard_Files a-wrstfi ads,Ada Wide_Wide_Characters Unicode a-zchuni ads,Ada Wide_Text_IO C_Streams a-wtcstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-wide-text-io-reset-standard-files-a-wrstfi-ads}@anchor{322}@anchor{gnat_rm/the_gnat_library id25}@anchor{323} +@anchor{gnat_rm/the_gnat_library ada-wide-text-io-reset-standard-files-a-wrstfi-ads}@anchor{325}@anchor{gnat_rm/the_gnat_library id25}@anchor{326} @section @code{Ada.Wide_Text_IO.Reset_Standard_Files} (@code{a-wrstfi.ads}) @@ -23998,7 +24218,7 @@ execution (for example a standard input file may be redefined to be interactive). @node Ada Wide_Wide_Characters Unicode a-zchuni ads,Ada Wide_Wide_Text_IO C_Streams a-ztcstr ads,Ada Wide_Text_IO Reset_Standard_Files a-wrstfi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-wide-wide-characters-unicode-a-zchuni-ads}@anchor{324}@anchor{gnat_rm/the_gnat_library id26}@anchor{325} +@anchor{gnat_rm/the_gnat_library ada-wide-wide-characters-unicode-a-zchuni-ads}@anchor{327}@anchor{gnat_rm/the_gnat_library id26}@anchor{328} @section @code{Ada.Wide_Wide_Characters.Unicode} (@code{a-zchuni.ads}) @@ -24011,7 +24231,7 @@ This package provides subprograms that allow categorization of Wide_Wide_Character values according to Unicode categories. @node Ada Wide_Wide_Text_IO C_Streams a-ztcstr ads,Ada Wide_Wide_Text_IO Reset_Standard_Files a-zrstfi ads,Ada Wide_Wide_Characters Unicode a-zchuni ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-wide-wide-text-io-c-streams-a-ztcstr-ads}@anchor{326}@anchor{gnat_rm/the_gnat_library id27}@anchor{327} +@anchor{gnat_rm/the_gnat_library ada-wide-wide-text-io-c-streams-a-ztcstr-ads}@anchor{329}@anchor{gnat_rm/the_gnat_library id27}@anchor{32a} @section @code{Ada.Wide_Wide_Text_IO.C_Streams} (@code{a-ztcstr.ads}) @@ -24026,7 +24246,7 @@ extracted from a file opened on the Ada side, and an Ada file can be constructed from a stream opened on the C side. @node Ada Wide_Wide_Text_IO Reset_Standard_Files a-zrstfi ads,GNAT Altivec g-altive ads,Ada Wide_Wide_Text_IO C_Streams a-ztcstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-wide-wide-text-io-reset-standard-files-a-zrstfi-ads}@anchor{328}@anchor{gnat_rm/the_gnat_library id28}@anchor{329} +@anchor{gnat_rm/the_gnat_library ada-wide-wide-text-io-reset-standard-files-a-zrstfi-ads}@anchor{32b}@anchor{gnat_rm/the_gnat_library id28}@anchor{32c} @section @code{Ada.Wide_Wide_Text_IO.Reset_Standard_Files} (@code{a-zrstfi.ads}) @@ -24041,7 +24261,7 @@ change during execution (for example a standard input file may be redefined to be interactive). @node GNAT Altivec g-altive ads,GNAT Altivec Conversions g-altcon ads,Ada Wide_Wide_Text_IO Reset_Standard_Files a-zrstfi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-altivec-g-altive-ads}@anchor{32a}@anchor{gnat_rm/the_gnat_library id29}@anchor{32b} +@anchor{gnat_rm/the_gnat_library gnat-altivec-g-altive-ads}@anchor{32d}@anchor{gnat_rm/the_gnat_library id29}@anchor{32e} @section @code{GNAT.Altivec} (@code{g-altive.ads}) @@ -24054,7 +24274,7 @@ definitions of constants and types common to all the versions of the binding. @node GNAT Altivec Conversions g-altcon ads,GNAT Altivec Vector_Operations g-alveop ads,GNAT Altivec g-altive ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-altivec-conversions-g-altcon-ads}@anchor{32c}@anchor{gnat_rm/the_gnat_library id30}@anchor{32d} +@anchor{gnat_rm/the_gnat_library gnat-altivec-conversions-g-altcon-ads}@anchor{32f}@anchor{gnat_rm/the_gnat_library id30}@anchor{330} @section @code{GNAT.Altivec.Conversions} (@code{g-altcon.ads}) @@ -24065,7 +24285,7 @@ binding. This package provides the Vector/View conversion routines. @node GNAT Altivec Vector_Operations g-alveop ads,GNAT Altivec Vector_Types g-alvety ads,GNAT Altivec Conversions g-altcon ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-operations-g-alveop-ads}@anchor{32e}@anchor{gnat_rm/the_gnat_library id31}@anchor{32f} +@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-operations-g-alveop-ads}@anchor{331}@anchor{gnat_rm/the_gnat_library id31}@anchor{332} @section @code{GNAT.Altivec.Vector_Operations} (@code{g-alveop.ads}) @@ -24079,7 +24299,7 @@ library. The hard binding is provided as a separate package. This unit is common to both bindings. @node GNAT Altivec Vector_Types g-alvety ads,GNAT Altivec Vector_Views g-alvevi ads,GNAT Altivec Vector_Operations g-alveop ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-types-g-alvety-ads}@anchor{330}@anchor{gnat_rm/the_gnat_library id32}@anchor{331} +@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-types-g-alvety-ads}@anchor{333}@anchor{gnat_rm/the_gnat_library id32}@anchor{334} @section @code{GNAT.Altivec.Vector_Types} (@code{g-alvety.ads}) @@ -24091,7 +24311,7 @@ This package exposes the various vector types part of the Ada binding to AltiVec facilities. @node GNAT Altivec Vector_Views g-alvevi ads,GNAT Array_Split g-arrspl ads,GNAT Altivec Vector_Types g-alvety ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-views-g-alvevi-ads}@anchor{332}@anchor{gnat_rm/the_gnat_library id33}@anchor{333} +@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-views-g-alvevi-ads}@anchor{335}@anchor{gnat_rm/the_gnat_library id33}@anchor{336} @section @code{GNAT.Altivec.Vector_Views} (@code{g-alvevi.ads}) @@ -24106,7 +24326,7 @@ vector elements and provides a simple way to initialize vector objects. @node GNAT Array_Split g-arrspl ads,GNAT AWK g-awk ads,GNAT Altivec Vector_Views g-alvevi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-array-split-g-arrspl-ads}@anchor{334}@anchor{gnat_rm/the_gnat_library id34}@anchor{335} +@anchor{gnat_rm/the_gnat_library gnat-array-split-g-arrspl-ads}@anchor{337}@anchor{gnat_rm/the_gnat_library id34}@anchor{338} @section @code{GNAT.Array_Split} (@code{g-arrspl.ads}) @@ -24119,7 +24339,7 @@ an array wherever the separators appear, and provide direct access to the resulting slices. @node GNAT AWK g-awk ads,GNAT Binary_Search g-binsea ads,GNAT Array_Split g-arrspl ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-awk-g-awk-ads}@anchor{336}@anchor{gnat_rm/the_gnat_library id35}@anchor{337} +@anchor{gnat_rm/the_gnat_library gnat-awk-g-awk-ads}@anchor{339}@anchor{gnat_rm/the_gnat_library id35}@anchor{33a} @section @code{GNAT.AWK} (@code{g-awk.ads}) @@ -24134,7 +24354,7 @@ or more files containing formatted data. The file is viewed as a database where each record is a line and a field is a data element in this line. @node GNAT Binary_Search g-binsea ads,GNAT Bind_Environment g-binenv ads,GNAT AWK g-awk ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-binary-search-g-binsea-ads}@anchor{338}@anchor{gnat_rm/the_gnat_library id36}@anchor{339} +@anchor{gnat_rm/the_gnat_library gnat-binary-search-g-binsea-ads}@anchor{33b}@anchor{gnat_rm/the_gnat_library id36}@anchor{33c} @section @code{GNAT.Binary_Search} (@code{g-binsea.ads}) @@ -24146,7 +24366,7 @@ Allow binary search of a sorted array (or of an array-like container; the generic does not reference the array directly). @node GNAT Bind_Environment g-binenv ads,GNAT Branch_Prediction g-brapre ads,GNAT Binary_Search g-binsea ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-bind-environment-g-binenv-ads}@anchor{33a}@anchor{gnat_rm/the_gnat_library id37}@anchor{33b} +@anchor{gnat_rm/the_gnat_library gnat-bind-environment-g-binenv-ads}@anchor{33d}@anchor{gnat_rm/the_gnat_library id37}@anchor{33e} @section @code{GNAT.Bind_Environment} (@code{g-binenv.ads}) @@ -24159,7 +24379,7 @@ These associations can be specified using the @code{-V} binder command line switch. @node GNAT Branch_Prediction g-brapre ads,GNAT Bounded_Buffers g-boubuf ads,GNAT Bind_Environment g-binenv ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-branch-prediction-g-brapre-ads}@anchor{33c}@anchor{gnat_rm/the_gnat_library id38}@anchor{33d} +@anchor{gnat_rm/the_gnat_library gnat-branch-prediction-g-brapre-ads}@anchor{33f}@anchor{gnat_rm/the_gnat_library id38}@anchor{340} @section @code{GNAT.Branch_Prediction} (@code{g-brapre.ads}) @@ -24170,7 +24390,7 @@ line switch. Provides routines giving hints to the branch predictor of the code generator. @node GNAT Bounded_Buffers g-boubuf ads,GNAT Bounded_Mailboxes g-boumai ads,GNAT Branch_Prediction g-brapre ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-bounded-buffers-g-boubuf-ads}@anchor{33e}@anchor{gnat_rm/the_gnat_library id39}@anchor{33f} +@anchor{gnat_rm/the_gnat_library gnat-bounded-buffers-g-boubuf-ads}@anchor{341}@anchor{gnat_rm/the_gnat_library id39}@anchor{342} @section @code{GNAT.Bounded_Buffers} (@code{g-boubuf.ads}) @@ -24185,7 +24405,7 @@ useful directly or as parts of the implementations of other abstractions, such as mailboxes. @node GNAT Bounded_Mailboxes g-boumai ads,GNAT Bubble_Sort g-bubsor ads,GNAT Bounded_Buffers g-boubuf ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-bounded-mailboxes-g-boumai-ads}@anchor{340}@anchor{gnat_rm/the_gnat_library id40}@anchor{341} +@anchor{gnat_rm/the_gnat_library gnat-bounded-mailboxes-g-boumai-ads}@anchor{343}@anchor{gnat_rm/the_gnat_library id40}@anchor{344} @section @code{GNAT.Bounded_Mailboxes} (@code{g-boumai.ads}) @@ -24198,7 +24418,7 @@ such as mailboxes. Provides a thread-safe asynchronous intertask mailbox communication facility. @node GNAT Bubble_Sort g-bubsor ads,GNAT Bubble_Sort_A g-busora ads,GNAT Bounded_Mailboxes g-boumai ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-g-bubsor-ads}@anchor{342}@anchor{gnat_rm/the_gnat_library id41}@anchor{343} +@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-g-bubsor-ads}@anchor{345}@anchor{gnat_rm/the_gnat_library id41}@anchor{346} @section @code{GNAT.Bubble_Sort} (@code{g-bubsor.ads}) @@ -24213,7 +24433,7 @@ data items. Exchange and comparison procedures are provided by passing access-to-procedure values. @node GNAT Bubble_Sort_A g-busora ads,GNAT Bubble_Sort_G g-busorg ads,GNAT Bubble_Sort g-bubsor ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-a-g-busora-ads}@anchor{344}@anchor{gnat_rm/the_gnat_library id42}@anchor{345} +@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-a-g-busora-ads}@anchor{347}@anchor{gnat_rm/the_gnat_library id42}@anchor{348} @section @code{GNAT.Bubble_Sort_A} (@code{g-busora.ads}) @@ -24229,7 +24449,7 @@ access-to-procedure values. This is an older version, retained for compatibility. Usually @code{GNAT.Bubble_Sort} will be preferable. @node GNAT Bubble_Sort_G g-busorg ads,GNAT Byte_Order_Mark g-byorma ads,GNAT Bubble_Sort_A g-busora ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-g-g-busorg-ads}@anchor{346}@anchor{gnat_rm/the_gnat_library id43}@anchor{347} +@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-g-g-busorg-ads}@anchor{349}@anchor{gnat_rm/the_gnat_library id43}@anchor{34a} @section @code{GNAT.Bubble_Sort_G} (@code{g-busorg.ads}) @@ -24245,7 +24465,7 @@ if the procedures can be inlined, at the expense of duplicating code for multiple instantiations. @node GNAT Byte_Order_Mark g-byorma ads,GNAT Byte_Swapping g-bytswa ads,GNAT Bubble_Sort_G g-busorg ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-byte-order-mark-g-byorma-ads}@anchor{348}@anchor{gnat_rm/the_gnat_library id44}@anchor{349} +@anchor{gnat_rm/the_gnat_library gnat-byte-order-mark-g-byorma-ads}@anchor{34b}@anchor{gnat_rm/the_gnat_library id44}@anchor{34c} @section @code{GNAT.Byte_Order_Mark} (@code{g-byorma.ads}) @@ -24260,8 +24480,8 @@ see whether it is one of the standard byte order marks (BOM’s) which signal the encoding of the string. The routine includes detection of special XML sequences for various UCS input formats. -@node GNAT Byte_Swapping g-bytswa ads,GNAT Calendar g-calend ads,GNAT Byte_Order_Mark g-byorma ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-byte-swapping-g-bytswa-ads}@anchor{34a}@anchor{gnat_rm/the_gnat_library id45}@anchor{34b} +@node GNAT Byte_Swapping g-bytswa ads,GNAT C_Time g-c_time ads,GNAT Byte_Order_Mark g-byorma ads,The GNAT Library +@anchor{gnat_rm/the_gnat_library gnat-byte-swapping-g-bytswa-ads}@anchor{34d}@anchor{gnat_rm/the_gnat_library id45}@anchor{34e} @section @code{GNAT.Byte_Swapping} (@code{g-bytswa.ads}) @@ -24274,8 +24494,20 @@ sequences for various UCS input formats. General routines for swapping the bytes in 2-, 4-, and 8-byte quantities. Machine-specific implementations are available in some cases. -@node GNAT Calendar g-calend ads,GNAT Calendar Time_IO g-catiio ads,GNAT Byte_Swapping g-bytswa ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-calendar-g-calend-ads}@anchor{34c}@anchor{gnat_rm/the_gnat_library id46}@anchor{34d} +@node GNAT C_Time g-c_time ads,GNAT Calendar g-calend ads,GNAT Byte_Swapping g-bytswa ads,The GNAT Library +@anchor{gnat_rm/the_gnat_library gnat-c-time-g-c-time-ads}@anchor{34f}@anchor{gnat_rm/the_gnat_library id46}@anchor{350} +@section @code{GNAT.C_Time} (@code{g-c_time.ads}) + + +@geindex GNAT.C_Time (g-c_time.ads) + +@geindex Time + +Provides the time_t, timeval and timespec types corresponding to the C +types defined by the OS, as well as various conversion functions. + +@node GNAT Calendar g-calend ads,GNAT Calendar Time_IO g-catiio ads,GNAT C_Time g-c_time ads,The GNAT Library +@anchor{gnat_rm/the_gnat_library gnat-calendar-g-calend-ads}@anchor{351}@anchor{gnat_rm/the_gnat_library id47}@anchor{352} @section @code{GNAT.Calendar} (@code{g-calend.ads}) @@ -24285,11 +24517,9 @@ Machine-specific implementations are available in some cases. Extends the facilities provided by @code{Ada.Calendar} to include handling of days of the week, an extended @code{Split} and @code{Time_Of} capability. -Also provides conversion of @code{Ada.Calendar.Time} values to and from the -C @code{timeval} format. @node GNAT Calendar Time_IO g-catiio ads,GNAT CRC32 g-crc32 ads,GNAT Calendar g-calend ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-calendar-time-io-g-catiio-ads}@anchor{34e}@anchor{gnat_rm/the_gnat_library id47}@anchor{34f} +@anchor{gnat_rm/the_gnat_library gnat-calendar-time-io-g-catiio-ads}@anchor{353}@anchor{gnat_rm/the_gnat_library id48}@anchor{354} @section @code{GNAT.Calendar.Time_IO} (@code{g-catiio.ads}) @@ -24300,7 +24530,7 @@ C @code{timeval} format. @geindex GNAT.Calendar.Time_IO (g-catiio.ads) @node GNAT CRC32 g-crc32 ads,GNAT Case_Util g-casuti ads,GNAT Calendar Time_IO g-catiio ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-crc32-g-crc32-ads}@anchor{350}@anchor{gnat_rm/the_gnat_library id48}@anchor{351} +@anchor{gnat_rm/the_gnat_library gnat-crc32-g-crc32-ads}@anchor{355}@anchor{gnat_rm/the_gnat_library id49}@anchor{356} @section @code{GNAT.CRC32} (@code{g-crc32.ads}) @@ -24317,7 +24547,7 @@ of this algorithm see Aug. 1988. Sarwate, D.V. @node GNAT Case_Util g-casuti ads,GNAT CGI g-cgi ads,GNAT CRC32 g-crc32 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-case-util-g-casuti-ads}@anchor{352}@anchor{gnat_rm/the_gnat_library id49}@anchor{353} +@anchor{gnat_rm/the_gnat_library gnat-case-util-g-casuti-ads}@anchor{357}@anchor{gnat_rm/the_gnat_library id50}@anchor{358} @section @code{GNAT.Case_Util} (@code{g-casuti.ads}) @@ -24332,7 +24562,7 @@ without the overhead of the full casing tables in @code{Ada.Characters.Handling}. @node GNAT CGI g-cgi ads,GNAT CGI Cookie g-cgicoo ads,GNAT Case_Util g-casuti ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-cgi-g-cgi-ads}@anchor{354}@anchor{gnat_rm/the_gnat_library id50}@anchor{355} +@anchor{gnat_rm/the_gnat_library gnat-cgi-g-cgi-ads}@anchor{359}@anchor{gnat_rm/the_gnat_library id51}@anchor{35a} @section @code{GNAT.CGI} (@code{g-cgi.ads}) @@ -24347,7 +24577,7 @@ builds a table whose index is the key and provides some services to deal with this table. @node GNAT CGI Cookie g-cgicoo ads,GNAT CGI Debug g-cgideb ads,GNAT CGI g-cgi ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-cgi-cookie-g-cgicoo-ads}@anchor{356}@anchor{gnat_rm/the_gnat_library id51}@anchor{357} +@anchor{gnat_rm/the_gnat_library gnat-cgi-cookie-g-cgicoo-ads}@anchor{35b}@anchor{gnat_rm/the_gnat_library id52}@anchor{35c} @section @code{GNAT.CGI.Cookie} (@code{g-cgicoo.ads}) @@ -24362,7 +24592,7 @@ Common Gateway Interface (CGI). It exports services to deal with Web cookies (piece of information kept in the Web client software). @node GNAT CGI Debug g-cgideb ads,GNAT Command_Line g-comlin ads,GNAT CGI Cookie g-cgicoo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-cgi-debug-g-cgideb-ads}@anchor{358}@anchor{gnat_rm/the_gnat_library id52}@anchor{359} +@anchor{gnat_rm/the_gnat_library gnat-cgi-debug-g-cgideb-ads}@anchor{35d}@anchor{gnat_rm/the_gnat_library id53}@anchor{35e} @section @code{GNAT.CGI.Debug} (@code{g-cgideb.ads}) @@ -24374,7 +24604,7 @@ This is a package to help debugging CGI (Common Gateway Interface) programs written in Ada. @node GNAT Command_Line g-comlin ads,GNAT Compiler_Version g-comver ads,GNAT CGI Debug g-cgideb ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-command-line-g-comlin-ads}@anchor{35a}@anchor{gnat_rm/the_gnat_library id53}@anchor{35b} +@anchor{gnat_rm/the_gnat_library gnat-command-line-g-comlin-ads}@anchor{35f}@anchor{gnat_rm/the_gnat_library id54}@anchor{360} @section @code{GNAT.Command_Line} (@code{g-comlin.ads}) @@ -24387,7 +24617,7 @@ including the ability to scan for named switches with optional parameters and expand file names using wildcard notations. @node GNAT Compiler_Version g-comver ads,GNAT Ctrl_C g-ctrl_c ads,GNAT Command_Line g-comlin ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-compiler-version-g-comver-ads}@anchor{35c}@anchor{gnat_rm/the_gnat_library id54}@anchor{35d} +@anchor{gnat_rm/the_gnat_library gnat-compiler-version-g-comver-ads}@anchor{361}@anchor{gnat_rm/the_gnat_library id55}@anchor{362} @section @code{GNAT.Compiler_Version} (@code{g-comver.ads}) @@ -24405,7 +24635,7 @@ of the compiler if a consistent tool set is used to compile all units of a partition). @node GNAT Ctrl_C g-ctrl_c ads,GNAT Current_Exception g-curexc ads,GNAT Compiler_Version g-comver ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-ctrl-c-g-ctrl-c-ads}@anchor{35e}@anchor{gnat_rm/the_gnat_library id55}@anchor{35f} +@anchor{gnat_rm/the_gnat_library gnat-ctrl-c-g-ctrl-c-ads}@anchor{363}@anchor{gnat_rm/the_gnat_library id56}@anchor{364} @section @code{GNAT.Ctrl_C} (@code{g-ctrl_c.ads}) @@ -24416,7 +24646,7 @@ of a partition). Provides a simple interface to handle Ctrl-C keyboard events. @node GNAT Current_Exception g-curexc ads,GNAT Debug_Pools g-debpoo ads,GNAT Ctrl_C g-ctrl_c ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-current-exception-g-curexc-ads}@anchor{360}@anchor{gnat_rm/the_gnat_library id56}@anchor{361} +@anchor{gnat_rm/the_gnat_library gnat-current-exception-g-curexc-ads}@anchor{365}@anchor{gnat_rm/the_gnat_library id57}@anchor{366} @section @code{GNAT.Current_Exception} (@code{g-curexc.ads}) @@ -24433,7 +24663,7 @@ This is particularly useful in simulating typical facilities for obtaining information about exceptions provided by Ada 83 compilers. @node GNAT Debug_Pools g-debpoo ads,GNAT Debug_Utilities g-debuti ads,GNAT Current_Exception g-curexc ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-debug-pools-g-debpoo-ads}@anchor{362}@anchor{gnat_rm/the_gnat_library id57}@anchor{363} +@anchor{gnat_rm/the_gnat_library gnat-debug-pools-g-debpoo-ads}@anchor{367}@anchor{gnat_rm/the_gnat_library id58}@anchor{368} @section @code{GNAT.Debug_Pools} (@code{g-debpoo.ads}) @@ -24450,7 +24680,7 @@ problems. See @code{The GNAT Debug_Pool Facility} section in the @cite{GNAT User’s Guide}. @node GNAT Debug_Utilities g-debuti ads,GNAT Decode_String g-decstr ads,GNAT Debug_Pools g-debpoo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-debug-utilities-g-debuti-ads}@anchor{364}@anchor{gnat_rm/the_gnat_library id58}@anchor{365} +@anchor{gnat_rm/the_gnat_library gnat-debug-utilities-g-debuti-ads}@anchor{369}@anchor{gnat_rm/the_gnat_library id59}@anchor{36a} @section @code{GNAT.Debug_Utilities} (@code{g-debuti.ads}) @@ -24463,7 +24693,7 @@ to and from string images of address values. Supports both C and Ada formats for hexadecimal literals. @node GNAT Decode_String g-decstr ads,GNAT Decode_UTF8_String g-deutst ads,GNAT Debug_Utilities g-debuti ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-decode-string-g-decstr-ads}@anchor{366}@anchor{gnat_rm/the_gnat_library id59}@anchor{367} +@anchor{gnat_rm/the_gnat_library gnat-decode-string-g-decstr-ads}@anchor{36b}@anchor{gnat_rm/the_gnat_library id60}@anchor{36c} @section @code{GNAT.Decode_String} (@code{g-decstr.ads}) @@ -24487,7 +24717,7 @@ Useful in conjunction with Unicode character coding. Note there is a preinstantiation for UTF-8. See next entry. @node GNAT Decode_UTF8_String g-deutst ads,GNAT Directory_Operations g-dirope ads,GNAT Decode_String g-decstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-decode-utf8-string-g-deutst-ads}@anchor{368}@anchor{gnat_rm/the_gnat_library id60}@anchor{369} +@anchor{gnat_rm/the_gnat_library gnat-decode-utf8-string-g-deutst-ads}@anchor{36d}@anchor{gnat_rm/the_gnat_library id61}@anchor{36e} @section @code{GNAT.Decode_UTF8_String} (@code{g-deutst.ads}) @@ -24508,7 +24738,7 @@ preinstantiation for UTF-8. See next entry. A preinstantiation of GNAT.Decode_Strings for UTF-8 encoding. @node GNAT Directory_Operations g-dirope ads,GNAT Directory_Operations Iteration g-diopit ads,GNAT Decode_UTF8_String g-deutst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-directory-operations-g-dirope-ads}@anchor{36a}@anchor{gnat_rm/the_gnat_library id61}@anchor{36b} +@anchor{gnat_rm/the_gnat_library gnat-directory-operations-g-dirope-ads}@anchor{36f}@anchor{gnat_rm/the_gnat_library id62}@anchor{370} @section @code{GNAT.Directory_Operations} (@code{g-dirope.ads}) @@ -24521,7 +24751,7 @@ the current directory, making new directories, and scanning the files in a directory. @node GNAT Directory_Operations Iteration g-diopit ads,GNAT Dynamic_HTables g-dynhta ads,GNAT Directory_Operations g-dirope ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-directory-operations-iteration-g-diopit-ads}@anchor{36c}@anchor{gnat_rm/the_gnat_library id62}@anchor{36d} +@anchor{gnat_rm/the_gnat_library gnat-directory-operations-iteration-g-diopit-ads}@anchor{371}@anchor{gnat_rm/the_gnat_library id63}@anchor{372} @section @code{GNAT.Directory_Operations.Iteration} (@code{g-diopit.ads}) @@ -24533,7 +24763,7 @@ A child unit of GNAT.Directory_Operations providing additional operations for iterating through directories. @node GNAT Dynamic_HTables g-dynhta ads,GNAT Dynamic_Tables g-dyntab ads,GNAT Directory_Operations Iteration g-diopit ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-dynamic-htables-g-dynhta-ads}@anchor{36e}@anchor{gnat_rm/the_gnat_library id63}@anchor{36f} +@anchor{gnat_rm/the_gnat_library gnat-dynamic-htables-g-dynhta-ads}@anchor{373}@anchor{gnat_rm/the_gnat_library id64}@anchor{374} @section @code{GNAT.Dynamic_HTables} (@code{g-dynhta.ads}) @@ -24551,7 +24781,7 @@ dynamic instances of the hash table, while an instantiation of @code{GNAT.HTable} creates a single instance of the hash table. @node GNAT Dynamic_Tables g-dyntab ads,GNAT Encode_String g-encstr ads,GNAT Dynamic_HTables g-dynhta ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-dynamic-tables-g-dyntab-ads}@anchor{370}@anchor{gnat_rm/the_gnat_library id64}@anchor{371} +@anchor{gnat_rm/the_gnat_library gnat-dynamic-tables-g-dyntab-ads}@anchor{375}@anchor{gnat_rm/the_gnat_library id65}@anchor{376} @section @code{GNAT.Dynamic_Tables} (@code{g-dyntab.ads}) @@ -24571,7 +24801,7 @@ dynamic instances of the table, while an instantiation of @code{GNAT.Table} creates a single instance of the table type. @node GNAT Encode_String g-encstr ads,GNAT Encode_UTF8_String g-enutst ads,GNAT Dynamic_Tables g-dyntab ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-encode-string-g-encstr-ads}@anchor{372}@anchor{gnat_rm/the_gnat_library id65}@anchor{373} +@anchor{gnat_rm/the_gnat_library gnat-encode-string-g-encstr-ads}@anchor{377}@anchor{gnat_rm/the_gnat_library id66}@anchor{378} @section @code{GNAT.Encode_String} (@code{g-encstr.ads}) @@ -24593,7 +24823,7 @@ encoding method. Useful in conjunction with Unicode character coding. Note there is a preinstantiation for UTF-8. See next entry. @node GNAT Encode_UTF8_String g-enutst ads,GNAT Exception_Actions g-excact ads,GNAT Encode_String g-encstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-encode-utf8-string-g-enutst-ads}@anchor{374}@anchor{gnat_rm/the_gnat_library id66}@anchor{375} +@anchor{gnat_rm/the_gnat_library gnat-encode-utf8-string-g-enutst-ads}@anchor{379}@anchor{gnat_rm/the_gnat_library id67}@anchor{37a} @section @code{GNAT.Encode_UTF8_String} (@code{g-enutst.ads}) @@ -24614,7 +24844,7 @@ Note there is a preinstantiation for UTF-8. See next entry. A preinstantiation of GNAT.Encode_Strings for UTF-8 encoding. @node GNAT Exception_Actions g-excact ads,GNAT Exception_Traces g-exctra ads,GNAT Encode_UTF8_String g-enutst ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-exception-actions-g-excact-ads}@anchor{376}@anchor{gnat_rm/the_gnat_library id67}@anchor{377} +@anchor{gnat_rm/the_gnat_library gnat-exception-actions-g-excact-ads}@anchor{37b}@anchor{gnat_rm/the_gnat_library id68}@anchor{37c} @section @code{GNAT.Exception_Actions} (@code{g-excact.ads}) @@ -24627,7 +24857,7 @@ for specific exceptions, or when any exception is raised. This can be used for instance to force a core dump to ease debugging. @node GNAT Exception_Traces g-exctra ads,GNAT Exceptions g-except ads,GNAT Exception_Actions g-excact ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-exception-traces-g-exctra-ads}@anchor{378}@anchor{gnat_rm/the_gnat_library id68}@anchor{379} +@anchor{gnat_rm/the_gnat_library gnat-exception-traces-g-exctra-ads}@anchor{37d}@anchor{gnat_rm/the_gnat_library id69}@anchor{37e} @section @code{GNAT.Exception_Traces} (@code{g-exctra.ads}) @@ -24641,7 +24871,7 @@ Provides an interface allowing to control automatic output upon exception occurrences. @node GNAT Exceptions g-except ads,GNAT Expect g-expect ads,GNAT Exception_Traces g-exctra ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-exceptions-g-except-ads}@anchor{37a}@anchor{gnat_rm/the_gnat_library id69}@anchor{37b} +@anchor{gnat_rm/the_gnat_library gnat-exceptions-g-except-ads}@anchor{37f}@anchor{gnat_rm/the_gnat_library id70}@anchor{380} @section @code{GNAT.Exceptions} (@code{g-except.ads}) @@ -24662,7 +24892,7 @@ predefined exceptions, and for example allows raising @code{Constraint_Error} with a message from a pure subprogram. @node GNAT Expect g-expect ads,GNAT Expect TTY g-exptty ads,GNAT Exceptions g-except ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-expect-g-expect-ads}@anchor{37c}@anchor{gnat_rm/the_gnat_library id70}@anchor{37d} +@anchor{gnat_rm/the_gnat_library gnat-expect-g-expect-ads}@anchor{381}@anchor{gnat_rm/the_gnat_library id71}@anchor{382} @section @code{GNAT.Expect} (@code{g-expect.ads}) @@ -24678,7 +24908,7 @@ It is not implemented for cross ports, and in particular is not implemented for VxWorks or LynxOS. @node GNAT Expect TTY g-exptty ads,GNAT Float_Control g-flocon ads,GNAT Expect g-expect ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-expect-tty-g-exptty-ads}@anchor{37e}@anchor{gnat_rm/the_gnat_library id71}@anchor{37f} +@anchor{gnat_rm/the_gnat_library gnat-expect-tty-g-exptty-ads}@anchor{383}@anchor{gnat_rm/the_gnat_library id72}@anchor{384} @section @code{GNAT.Expect.TTY} (@code{g-exptty.ads}) @@ -24690,7 +24920,7 @@ ports. It is not implemented for cross ports, and in particular is not implemented for VxWorks or LynxOS. @node GNAT Float_Control g-flocon ads,GNAT Formatted_String g-forstr ads,GNAT Expect TTY g-exptty ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-float-control-g-flocon-ads}@anchor{380}@anchor{gnat_rm/the_gnat_library id72}@anchor{381} +@anchor{gnat_rm/the_gnat_library gnat-float-control-g-flocon-ads}@anchor{385}@anchor{gnat_rm/the_gnat_library id73}@anchor{386} @section @code{GNAT.Float_Control} (@code{g-flocon.ads}) @@ -24704,7 +24934,7 @@ library calls may cause this mode to be modified, and the Reset procedure in this package can be used to reestablish the required mode. @node GNAT Formatted_String g-forstr ads,GNAT Generic_Fast_Math_Functions g-gfmafu ads,GNAT Float_Control g-flocon ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-formatted-string-g-forstr-ads}@anchor{382}@anchor{gnat_rm/the_gnat_library id73}@anchor{383} +@anchor{gnat_rm/the_gnat_library gnat-formatted-string-g-forstr-ads}@anchor{387}@anchor{gnat_rm/the_gnat_library id74}@anchor{388} @section @code{GNAT.Formatted_String} (@code{g-forstr.ads}) @@ -24719,7 +24949,7 @@ derived from Integer, Float or enumerations as values for the formatted string. @node GNAT Generic_Fast_Math_Functions g-gfmafu ads,GNAT Heap_Sort g-heasor ads,GNAT Formatted_String g-forstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-generic-fast-math-functions-g-gfmafu-ads}@anchor{384}@anchor{gnat_rm/the_gnat_library id74}@anchor{385} +@anchor{gnat_rm/the_gnat_library gnat-generic-fast-math-functions-g-gfmafu-ads}@anchor{389}@anchor{gnat_rm/the_gnat_library id75}@anchor{38a} @section @code{GNAT.Generic_Fast_Math_Functions} (@code{g-gfmafu.ads}) @@ -24737,7 +24967,7 @@ have a vector implementation that can be automatically used by the compiler when auto-vectorization is enabled. @node GNAT Heap_Sort g-heasor ads,GNAT Heap_Sort_A g-hesora ads,GNAT Generic_Fast_Math_Functions g-gfmafu ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-heasor-ads}@anchor{386}@anchor{gnat_rm/the_gnat_library id75}@anchor{387} +@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-heasor-ads}@anchor{38b}@anchor{gnat_rm/the_gnat_library id76}@anchor{38c} @section @code{GNAT.Heap_Sort} (@code{g-heasor.ads}) @@ -24751,7 +24981,7 @@ access-to-procedure values. The algorithm used is a modified heap sort that performs approximately N*log(N) comparisons in the worst case. @node GNAT Heap_Sort_A g-hesora ads,GNAT Heap_Sort_G g-hesorg ads,GNAT Heap_Sort g-heasor ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-heap-sort-a-g-hesora-ads}@anchor{388}@anchor{gnat_rm/the_gnat_library id76}@anchor{389} +@anchor{gnat_rm/the_gnat_library gnat-heap-sort-a-g-hesora-ads}@anchor{38d}@anchor{gnat_rm/the_gnat_library id77}@anchor{38e} @section @code{GNAT.Heap_Sort_A} (@code{g-hesora.ads}) @@ -24767,7 +24997,7 @@ This differs from @code{GNAT.Heap_Sort} in having a less convenient interface, but may be slightly more efficient. @node GNAT Heap_Sort_G g-hesorg ads,GNAT HTable g-htable ads,GNAT Heap_Sort_A g-hesora ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-g-hesorg-ads}@anchor{38a}@anchor{gnat_rm/the_gnat_library id77}@anchor{38b} +@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-g-hesorg-ads}@anchor{38f}@anchor{gnat_rm/the_gnat_library id78}@anchor{390} @section @code{GNAT.Heap_Sort_G} (@code{g-hesorg.ads}) @@ -24781,7 +25011,7 @@ if the procedures can be inlined, at the expense of duplicating code for multiple instantiations. @node GNAT HTable g-htable ads,GNAT IO g-io ads,GNAT Heap_Sort_G g-hesorg ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-htable-g-htable-ads}@anchor{38c}@anchor{gnat_rm/the_gnat_library id78}@anchor{38d} +@anchor{gnat_rm/the_gnat_library gnat-htable-g-htable-ads}@anchor{391}@anchor{gnat_rm/the_gnat_library id79}@anchor{392} @section @code{GNAT.HTable} (@code{g-htable.ads}) @@ -24794,7 +25024,7 @@ data. Provides two approaches, one a simple static approach, and the other allowing arbitrary dynamic hash tables. @node GNAT IO g-io ads,GNAT IO_Aux g-io_aux ads,GNAT HTable g-htable ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-io-g-io-ads}@anchor{38e}@anchor{gnat_rm/the_gnat_library id79}@anchor{38f} +@anchor{gnat_rm/the_gnat_library gnat-io-g-io-ads}@anchor{393}@anchor{gnat_rm/the_gnat_library id80}@anchor{394} @section @code{GNAT.IO} (@code{g-io.ads}) @@ -24810,7 +25040,7 @@ Standard_Input, and writing characters, strings and integers to either Standard_Output or Standard_Error. @node GNAT IO_Aux g-io_aux ads,GNAT Lock_Files g-locfil ads,GNAT IO g-io ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-io-aux-g-io-aux-ads}@anchor{390}@anchor{gnat_rm/the_gnat_library id80}@anchor{391} +@anchor{gnat_rm/the_gnat_library gnat-io-aux-g-io-aux-ads}@anchor{395}@anchor{gnat_rm/the_gnat_library id81}@anchor{396} @section @code{GNAT.IO_Aux} (@code{g-io_aux.ads}) @@ -24824,7 +25054,7 @@ Provides some auxiliary functions for use with Text_IO, including a test for whether a file exists, and functions for reading a line of text. @node GNAT Lock_Files g-locfil ads,GNAT MBBS_Discrete_Random g-mbdira ads,GNAT IO_Aux g-io_aux ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-lock-files-g-locfil-ads}@anchor{392}@anchor{gnat_rm/the_gnat_library id81}@anchor{393} +@anchor{gnat_rm/the_gnat_library gnat-lock-files-g-locfil-ads}@anchor{397}@anchor{gnat_rm/the_gnat_library id82}@anchor{398} @section @code{GNAT.Lock_Files} (@code{g-locfil.ads}) @@ -24838,7 +25068,7 @@ Provides a general interface for using files as locks. Can be used for providing program level synchronization. @node GNAT MBBS_Discrete_Random g-mbdira ads,GNAT MBBS_Float_Random g-mbflra ads,GNAT Lock_Files g-locfil ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-mbbs-discrete-random-g-mbdira-ads}@anchor{394}@anchor{gnat_rm/the_gnat_library id82}@anchor{395} +@anchor{gnat_rm/the_gnat_library gnat-mbbs-discrete-random-g-mbdira-ads}@anchor{399}@anchor{gnat_rm/the_gnat_library id83}@anchor{39a} @section @code{GNAT.MBBS_Discrete_Random} (@code{g-mbdira.ads}) @@ -24850,7 +25080,7 @@ The original implementation of @code{Ada.Numerics.Discrete_Random}. Uses a modified version of the Blum-Blum-Shub generator. @node GNAT MBBS_Float_Random g-mbflra ads,GNAT MD5 g-md5 ads,GNAT MBBS_Discrete_Random g-mbdira ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-mbbs-float-random-g-mbflra-ads}@anchor{396}@anchor{gnat_rm/the_gnat_library id83}@anchor{397} +@anchor{gnat_rm/the_gnat_library gnat-mbbs-float-random-g-mbflra-ads}@anchor{39b}@anchor{gnat_rm/the_gnat_library id84}@anchor{39c} @section @code{GNAT.MBBS_Float_Random} (@code{g-mbflra.ads}) @@ -24862,7 +25092,7 @@ The original implementation of @code{Ada.Numerics.Float_Random}. Uses a modified version of the Blum-Blum-Shub generator. @node GNAT MD5 g-md5 ads,GNAT Memory_Dump g-memdum ads,GNAT MBBS_Float_Random g-mbflra ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-md5-g-md5-ads}@anchor{398}@anchor{gnat_rm/the_gnat_library id84}@anchor{399} +@anchor{gnat_rm/the_gnat_library gnat-md5-g-md5-ads}@anchor{39d}@anchor{gnat_rm/the_gnat_library id85}@anchor{39e} @section @code{GNAT.MD5} (@code{g-md5.ads}) @@ -24875,7 +25105,7 @@ the HMAC-MD5 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT Memory_Dump g-memdum ads,GNAT Most_Recent_Exception g-moreex ads,GNAT MD5 g-md5 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-memory-dump-g-memdum-ads}@anchor{39a}@anchor{gnat_rm/the_gnat_library id85}@anchor{39b} +@anchor{gnat_rm/the_gnat_library gnat-memory-dump-g-memdum-ads}@anchor{39f}@anchor{gnat_rm/the_gnat_library id86}@anchor{3a0} @section @code{GNAT.Memory_Dump} (@code{g-memdum.ads}) @@ -24888,7 +25118,7 @@ standard output or standard error files. Uses GNAT.IO for actual output. @node GNAT Most_Recent_Exception g-moreex ads,GNAT OS_Lib g-os_lib ads,GNAT Memory_Dump g-memdum ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-most-recent-exception-g-moreex-ads}@anchor{39c}@anchor{gnat_rm/the_gnat_library id86}@anchor{39d} +@anchor{gnat_rm/the_gnat_library gnat-most-recent-exception-g-moreex-ads}@anchor{3a1}@anchor{gnat_rm/the_gnat_library id87}@anchor{3a2} @section @code{GNAT.Most_Recent_Exception} (@code{g-moreex.ads}) @@ -24902,7 +25132,7 @@ various logging purposes, including duplicating functionality of some Ada 83 implementation dependent extensions. @node GNAT OS_Lib g-os_lib ads,GNAT Perfect_Hash_Generators g-pehage ads,GNAT Most_Recent_Exception g-moreex ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-os-lib-g-os-lib-ads}@anchor{39e}@anchor{gnat_rm/the_gnat_library id87}@anchor{39f} +@anchor{gnat_rm/the_gnat_library gnat-os-lib-g-os-lib-ads}@anchor{3a3}@anchor{gnat_rm/the_gnat_library id88}@anchor{3a4} @section @code{GNAT.OS_Lib} (@code{g-os_lib.ads}) @@ -24918,7 +25148,7 @@ including a portable spawn procedure, and access to environment variables and error return codes. @node GNAT Perfect_Hash_Generators g-pehage ads,GNAT Random_Numbers g-rannum ads,GNAT OS_Lib g-os_lib ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-perfect-hash-generators-g-pehage-ads}@anchor{3a0}@anchor{gnat_rm/the_gnat_library id88}@anchor{3a1} +@anchor{gnat_rm/the_gnat_library gnat-perfect-hash-generators-g-pehage-ads}@anchor{3a5}@anchor{gnat_rm/the_gnat_library id89}@anchor{3a6} @section @code{GNAT.Perfect_Hash_Generators} (@code{g-pehage.ads}) @@ -24936,7 +25166,7 @@ hashcode are in the same order. These hashing functions are very convenient for use with realtime applications. @node GNAT Random_Numbers g-rannum ads,GNAT Regexp g-regexp ads,GNAT Perfect_Hash_Generators g-pehage ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-random-numbers-g-rannum-ads}@anchor{3a2}@anchor{gnat_rm/the_gnat_library id89}@anchor{3a3} +@anchor{gnat_rm/the_gnat_library gnat-random-numbers-g-rannum-ads}@anchor{3a7}@anchor{gnat_rm/the_gnat_library id90}@anchor{3a8} @section @code{GNAT.Random_Numbers} (@code{g-rannum.ads}) @@ -24950,7 +25180,7 @@ however NOT suitable for situations requiring cryptographically secure randomness. @node GNAT Regexp g-regexp ads,GNAT Registry g-regist ads,GNAT Random_Numbers g-rannum ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-regexp-g-regexp-ads}@anchor{279}@anchor{gnat_rm/the_gnat_library id90}@anchor{3a4} +@anchor{gnat_rm/the_gnat_library gnat-regexp-g-regexp-ads}@anchor{27c}@anchor{gnat_rm/the_gnat_library id91}@anchor{3a9} @section @code{GNAT.Regexp} (@code{g-regexp.ads}) @@ -24966,7 +25196,7 @@ simplest of the three pattern matching packages provided, and is particularly suitable for ‘file globbing’ applications. @node GNAT Registry g-regist ads,GNAT Regpat g-regpat ads,GNAT Regexp g-regexp ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-registry-g-regist-ads}@anchor{3a5}@anchor{gnat_rm/the_gnat_library id91}@anchor{3a6} +@anchor{gnat_rm/the_gnat_library gnat-registry-g-regist-ads}@anchor{3aa}@anchor{gnat_rm/the_gnat_library id92}@anchor{3ab} @section @code{GNAT.Registry} (@code{g-regist.ads}) @@ -24980,7 +25210,7 @@ registry API, but at a lower level of abstraction, refer to the Win32.Winreg package provided with the Win32Ada binding @node GNAT Regpat g-regpat ads,GNAT Rewrite_Data g-rewdat ads,GNAT Registry g-regist ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-regpat-g-regpat-ads}@anchor{3a7}@anchor{gnat_rm/the_gnat_library id92}@anchor{3a8} +@anchor{gnat_rm/the_gnat_library gnat-regpat-g-regpat-ads}@anchor{3ac}@anchor{gnat_rm/the_gnat_library id93}@anchor{3ad} @section @code{GNAT.Regpat} (@code{g-regpat.ads}) @@ -24995,7 +25225,7 @@ from the original V7 style regular expression library written in C by Henry Spencer (and binary compatible with this C library). @node GNAT Rewrite_Data g-rewdat ads,GNAT Secondary_Stack_Info g-sestin ads,GNAT Regpat g-regpat ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-rewrite-data-g-rewdat-ads}@anchor{3a9}@anchor{gnat_rm/the_gnat_library id93}@anchor{3aa} +@anchor{gnat_rm/the_gnat_library gnat-rewrite-data-g-rewdat-ads}@anchor{3ae}@anchor{gnat_rm/the_gnat_library id94}@anchor{3af} @section @code{GNAT.Rewrite_Data} (@code{g-rewdat.ads}) @@ -25009,7 +25239,7 @@ full content to be processed is not loaded into memory all at once. This makes this interface usable for large files or socket streams. @node GNAT Secondary_Stack_Info g-sestin ads,GNAT Semaphores g-semaph ads,GNAT Rewrite_Data g-rewdat ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-secondary-stack-info-g-sestin-ads}@anchor{3ab}@anchor{gnat_rm/the_gnat_library id94}@anchor{3ac} +@anchor{gnat_rm/the_gnat_library gnat-secondary-stack-info-g-sestin-ads}@anchor{3b0}@anchor{gnat_rm/the_gnat_library id95}@anchor{3b1} @section @code{GNAT.Secondary_Stack_Info} (@code{g-sestin.ads}) @@ -25021,7 +25251,7 @@ Provides the capability to query the high water mark of the current task’s secondary stack. @node GNAT Semaphores g-semaph ads,GNAT Serial_Communications g-sercom ads,GNAT Secondary_Stack_Info g-sestin ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-semaphores-g-semaph-ads}@anchor{3ad}@anchor{gnat_rm/the_gnat_library id95}@anchor{3ae} +@anchor{gnat_rm/the_gnat_library gnat-semaphores-g-semaph-ads}@anchor{3b2}@anchor{gnat_rm/the_gnat_library id96}@anchor{3b3} @section @code{GNAT.Semaphores} (@code{g-semaph.ads}) @@ -25032,7 +25262,7 @@ secondary stack. Provides classic counting and binary semaphores using protected types. @node GNAT Serial_Communications g-sercom ads,GNAT SHA1 g-sha1 ads,GNAT Semaphores g-semaph ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-serial-communications-g-sercom-ads}@anchor{3af}@anchor{gnat_rm/the_gnat_library id96}@anchor{3b0} +@anchor{gnat_rm/the_gnat_library gnat-serial-communications-g-sercom-ads}@anchor{3b4}@anchor{gnat_rm/the_gnat_library id97}@anchor{3b5} @section @code{GNAT.Serial_Communications} (@code{g-sercom.ads}) @@ -25044,7 +25274,7 @@ Provides a simple interface to send and receive data over a serial port. This is only supported on GNU/Linux and Windows. @node GNAT SHA1 g-sha1 ads,GNAT SHA224 g-sha224 ads,GNAT Serial_Communications g-sercom ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha1-g-sha1-ads}@anchor{3b1}@anchor{gnat_rm/the_gnat_library id97}@anchor{3b2} +@anchor{gnat_rm/the_gnat_library gnat-sha1-g-sha1-ads}@anchor{3b6}@anchor{gnat_rm/the_gnat_library id98}@anchor{3b7} @section @code{GNAT.SHA1} (@code{g-sha1.ads}) @@ -25057,7 +25287,7 @@ and RFC 3174, and the HMAC-SHA1 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT SHA224 g-sha224 ads,GNAT SHA256 g-sha256 ads,GNAT SHA1 g-sha1 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha224-g-sha224-ads}@anchor{3b3}@anchor{gnat_rm/the_gnat_library id98}@anchor{3b4} +@anchor{gnat_rm/the_gnat_library gnat-sha224-g-sha224-ads}@anchor{3b8}@anchor{gnat_rm/the_gnat_library id99}@anchor{3b9} @section @code{GNAT.SHA224} (@code{g-sha224.ads}) @@ -25070,7 +25300,7 @@ and the HMAC-SHA224 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT SHA256 g-sha256 ads,GNAT SHA384 g-sha384 ads,GNAT SHA224 g-sha224 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha256-g-sha256-ads}@anchor{3b5}@anchor{gnat_rm/the_gnat_library id99}@anchor{3b6} +@anchor{gnat_rm/the_gnat_library gnat-sha256-g-sha256-ads}@anchor{3ba}@anchor{gnat_rm/the_gnat_library id100}@anchor{3bb} @section @code{GNAT.SHA256} (@code{g-sha256.ads}) @@ -25083,7 +25313,7 @@ and the HMAC-SHA256 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT SHA384 g-sha384 ads,GNAT SHA512 g-sha512 ads,GNAT SHA256 g-sha256 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha384-g-sha384-ads}@anchor{3b7}@anchor{gnat_rm/the_gnat_library id100}@anchor{3b8} +@anchor{gnat_rm/the_gnat_library gnat-sha384-g-sha384-ads}@anchor{3bc}@anchor{gnat_rm/the_gnat_library id101}@anchor{3bd} @section @code{GNAT.SHA384} (@code{g-sha384.ads}) @@ -25096,7 +25326,7 @@ and the HMAC-SHA384 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT SHA512 g-sha512 ads,GNAT Signals g-signal ads,GNAT SHA384 g-sha384 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sha512-g-sha512-ads}@anchor{3b9}@anchor{gnat_rm/the_gnat_library id101}@anchor{3ba} +@anchor{gnat_rm/the_gnat_library gnat-sha512-g-sha512-ads}@anchor{3be}@anchor{gnat_rm/the_gnat_library id102}@anchor{3bf} @section @code{GNAT.SHA512} (@code{g-sha512.ads}) @@ -25109,7 +25339,7 @@ and the HMAC-SHA512 message authentication function as described in RFC 2104 and FIPS PUB 198. @node GNAT Signals g-signal ads,GNAT Sockets g-socket ads,GNAT SHA512 g-sha512 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-signals-g-signal-ads}@anchor{3bb}@anchor{gnat_rm/the_gnat_library id102}@anchor{3bc} +@anchor{gnat_rm/the_gnat_library gnat-signals-g-signal-ads}@anchor{3c0}@anchor{gnat_rm/the_gnat_library id103}@anchor{3c1} @section @code{GNAT.Signals} (@code{g-signal.ads}) @@ -25121,7 +25351,7 @@ Provides the ability to manipulate the blocked status of signals on supported targets. @node GNAT Sockets g-socket ads,GNAT Source_Info g-souinf ads,GNAT Signals g-signal ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sockets-g-socket-ads}@anchor{3bd}@anchor{gnat_rm/the_gnat_library id103}@anchor{3be} +@anchor{gnat_rm/the_gnat_library gnat-sockets-g-socket-ads}@anchor{3c2}@anchor{gnat_rm/the_gnat_library id104}@anchor{3c3} @section @code{GNAT.Sockets} (@code{g-socket.ads}) @@ -25136,7 +25366,7 @@ on all native GNAT ports and on VxWorks cross ports. It is not implemented for the LynxOS cross port. @node GNAT Source_Info g-souinf ads,GNAT Spelling_Checker g-speche ads,GNAT Sockets g-socket ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-source-info-g-souinf-ads}@anchor{3bf}@anchor{gnat_rm/the_gnat_library id104}@anchor{3c0} +@anchor{gnat_rm/the_gnat_library gnat-source-info-g-souinf-ads}@anchor{3c4}@anchor{gnat_rm/the_gnat_library id105}@anchor{3c5} @section @code{GNAT.Source_Info} (@code{g-souinf.ads}) @@ -25150,7 +25380,7 @@ subprograms yielding the date and time of the current compilation (like the C macros @code{__DATE__} and @code{__TIME__}) @node GNAT Spelling_Checker g-speche ads,GNAT Spelling_Checker_Generic g-spchge ads,GNAT Source_Info g-souinf ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spelling-checker-g-speche-ads}@anchor{3c1}@anchor{gnat_rm/the_gnat_library id105}@anchor{3c2} +@anchor{gnat_rm/the_gnat_library gnat-spelling-checker-g-speche-ads}@anchor{3c6}@anchor{gnat_rm/the_gnat_library id106}@anchor{3c7} @section @code{GNAT.Spelling_Checker} (@code{g-speche.ads}) @@ -25162,7 +25392,7 @@ Provides a function for determining whether one string is a plausible near misspelling of another string. @node GNAT Spelling_Checker_Generic g-spchge ads,GNAT Spitbol Patterns g-spipat ads,GNAT Spelling_Checker g-speche ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spelling-checker-generic-g-spchge-ads}@anchor{3c3}@anchor{gnat_rm/the_gnat_library id106}@anchor{3c4} +@anchor{gnat_rm/the_gnat_library gnat-spelling-checker-generic-g-spchge-ads}@anchor{3c8}@anchor{gnat_rm/the_gnat_library id107}@anchor{3c9} @section @code{GNAT.Spelling_Checker_Generic} (@code{g-spchge.ads}) @@ -25175,7 +25405,7 @@ determining whether one string is a plausible near misspelling of another string. @node GNAT Spitbol Patterns g-spipat ads,GNAT Spitbol g-spitbo ads,GNAT Spelling_Checker_Generic g-spchge ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spitbol-patterns-g-spipat-ads}@anchor{3c5}@anchor{gnat_rm/the_gnat_library id107}@anchor{3c6} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-patterns-g-spipat-ads}@anchor{3ca}@anchor{gnat_rm/the_gnat_library id108}@anchor{3cb} @section @code{GNAT.Spitbol.Patterns} (@code{g-spipat.ads}) @@ -25191,7 +25421,7 @@ the SNOBOL4 dynamic pattern construction and matching capabilities, using the efficient algorithm developed by Robert Dewar for the SPITBOL system. @node GNAT Spitbol g-spitbo ads,GNAT Spitbol Table_Boolean g-sptabo ads,GNAT Spitbol Patterns g-spipat ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spitbol-g-spitbo-ads}@anchor{3c7}@anchor{gnat_rm/the_gnat_library id108}@anchor{3c8} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-g-spitbo-ads}@anchor{3cc}@anchor{gnat_rm/the_gnat_library id109}@anchor{3cd} @section @code{GNAT.Spitbol} (@code{g-spitbo.ads}) @@ -25206,7 +25436,7 @@ useful for constructing arbitrary mappings from strings in the style of the SNOBOL4 TABLE function. @node GNAT Spitbol Table_Boolean g-sptabo ads,GNAT Spitbol Table_Integer g-sptain ads,GNAT Spitbol g-spitbo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-boolean-g-sptabo-ads}@anchor{3c9}@anchor{gnat_rm/the_gnat_library id109}@anchor{3ca} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-boolean-g-sptabo-ads}@anchor{3ce}@anchor{gnat_rm/the_gnat_library id110}@anchor{3cf} @section @code{GNAT.Spitbol.Table_Boolean} (@code{g-sptabo.ads}) @@ -25221,7 +25451,7 @@ for type @code{Standard.Boolean}, giving an implementation of sets of string values. @node GNAT Spitbol Table_Integer g-sptain ads,GNAT Spitbol Table_VString g-sptavs ads,GNAT Spitbol Table_Boolean g-sptabo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-integer-g-sptain-ads}@anchor{3cb}@anchor{gnat_rm/the_gnat_library id110}@anchor{3cc} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-integer-g-sptain-ads}@anchor{3d0}@anchor{gnat_rm/the_gnat_library id111}@anchor{3d1} @section @code{GNAT.Spitbol.Table_Integer} (@code{g-sptain.ads}) @@ -25238,7 +25468,7 @@ for type @code{Standard.Integer}, giving an implementation of maps from string to integer values. @node GNAT Spitbol Table_VString g-sptavs ads,GNAT SSE g-sse ads,GNAT Spitbol Table_Integer g-sptain ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-vstring-g-sptavs-ads}@anchor{3cd}@anchor{gnat_rm/the_gnat_library id111}@anchor{3ce} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-vstring-g-sptavs-ads}@anchor{3d2}@anchor{gnat_rm/the_gnat_library id112}@anchor{3d3} @section @code{GNAT.Spitbol.Table_VString} (@code{g-sptavs.ads}) @@ -25255,7 +25485,7 @@ a variable length string type, giving an implementation of general maps from strings to strings. @node GNAT SSE g-sse ads,GNAT SSE Vector_Types g-ssvety ads,GNAT Spitbol Table_VString g-sptavs ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sse-g-sse-ads}@anchor{3cf}@anchor{gnat_rm/the_gnat_library id112}@anchor{3d0} +@anchor{gnat_rm/the_gnat_library gnat-sse-g-sse-ads}@anchor{3d4}@anchor{gnat_rm/the_gnat_library id113}@anchor{3d5} @section @code{GNAT.SSE} (@code{g-sse.ads}) @@ -25267,7 +25497,7 @@ targets. It exposes vector component types together with a general introduction to the binding contents and use. @node GNAT SSE Vector_Types g-ssvety ads,GNAT String_Hash g-strhas ads,GNAT SSE g-sse ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-sse-vector-types-g-ssvety-ads}@anchor{3d1}@anchor{gnat_rm/the_gnat_library id113}@anchor{3d2} +@anchor{gnat_rm/the_gnat_library gnat-sse-vector-types-g-ssvety-ads}@anchor{3d6}@anchor{gnat_rm/the_gnat_library id114}@anchor{3d7} @section @code{GNAT.SSE.Vector_Types} (@code{g-ssvety.ads}) @@ -25276,7 +25506,7 @@ introduction to the binding contents and use. SSE vector types for use with SSE related intrinsics. @node GNAT String_Hash g-strhas ads,GNAT Strings g-string ads,GNAT SSE Vector_Types g-ssvety ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-string-hash-g-strhas-ads}@anchor{3d3}@anchor{gnat_rm/the_gnat_library id114}@anchor{3d4} +@anchor{gnat_rm/the_gnat_library gnat-string-hash-g-strhas-ads}@anchor{3d8}@anchor{gnat_rm/the_gnat_library id115}@anchor{3d9} @section @code{GNAT.String_Hash} (@code{g-strhas.ads}) @@ -25288,7 +25518,7 @@ Provides a generic hash function working on arrays of scalars. Both the scalar type and the hash result type are parameters. @node GNAT Strings g-string ads,GNAT String_Split g-strspl ads,GNAT String_Hash g-strhas ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-strings-g-string-ads}@anchor{3d5}@anchor{gnat_rm/the_gnat_library id115}@anchor{3d6} +@anchor{gnat_rm/the_gnat_library gnat-strings-g-string-ads}@anchor{3da}@anchor{gnat_rm/the_gnat_library id116}@anchor{3db} @section @code{GNAT.Strings} (@code{g-string.ads}) @@ -25298,7 +25528,7 @@ Common String access types and related subprograms. Basically it defines a string access and an array of string access types. @node GNAT String_Split g-strspl ads,GNAT Table g-table ads,GNAT Strings g-string ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-string-split-g-strspl-ads}@anchor{3d7}@anchor{gnat_rm/the_gnat_library id116}@anchor{3d8} +@anchor{gnat_rm/the_gnat_library gnat-string-split-g-strspl-ads}@anchor{3dc}@anchor{gnat_rm/the_gnat_library id117}@anchor{3dd} @section @code{GNAT.String_Split} (@code{g-strspl.ads}) @@ -25312,7 +25542,7 @@ to the resulting slices. This package is instantiated from @code{GNAT.Array_Split}. @node GNAT Table g-table ads,GNAT Task_Lock g-tasloc ads,GNAT String_Split g-strspl ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-table-g-table-ads}@anchor{3d9}@anchor{gnat_rm/the_gnat_library id117}@anchor{3da} +@anchor{gnat_rm/the_gnat_library gnat-table-g-table-ads}@anchor{3de}@anchor{gnat_rm/the_gnat_library id118}@anchor{3df} @section @code{GNAT.Table} (@code{g-table.ads}) @@ -25332,7 +25562,7 @@ while an instantiation of @code{GNAT.Dynamic_Tables} creates a type that can be used to define dynamic instances of the table. @node GNAT Task_Lock g-tasloc ads,GNAT Time_Stamp g-timsta ads,GNAT Table g-table ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-task-lock-g-tasloc-ads}@anchor{3db}@anchor{gnat_rm/the_gnat_library id118}@anchor{3dc} +@anchor{gnat_rm/the_gnat_library gnat-task-lock-g-tasloc-ads}@anchor{3e0}@anchor{gnat_rm/the_gnat_library id119}@anchor{3e1} @section @code{GNAT.Task_Lock} (@code{g-tasloc.ads}) @@ -25349,7 +25579,7 @@ single global task lock. Appropriate for use in situations where contention between tasks is very rarely expected. @node GNAT Time_Stamp g-timsta ads,GNAT Threads g-thread ads,GNAT Task_Lock g-tasloc ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-time-stamp-g-timsta-ads}@anchor{3dd}@anchor{gnat_rm/the_gnat_library id119}@anchor{3de} +@anchor{gnat_rm/the_gnat_library gnat-time-stamp-g-timsta-ads}@anchor{3e2}@anchor{gnat_rm/the_gnat_library id120}@anchor{3e3} @section @code{GNAT.Time_Stamp} (@code{g-timsta.ads}) @@ -25364,7 +25594,7 @@ represents the current date and time in ISO 8601 format. This is a very simple routine with minimal code and there are no dependencies on any other unit. @node GNAT Threads g-thread ads,GNAT Traceback g-traceb ads,GNAT Time_Stamp g-timsta ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-threads-g-thread-ads}@anchor{3df}@anchor{gnat_rm/the_gnat_library id120}@anchor{3e0} +@anchor{gnat_rm/the_gnat_library gnat-threads-g-thread-ads}@anchor{3e4}@anchor{gnat_rm/the_gnat_library id121}@anchor{3e5} @section @code{GNAT.Threads} (@code{g-thread.ads}) @@ -25381,7 +25611,7 @@ further details if your program has threads that are created by a non-Ada environment which then accesses Ada code. @node GNAT Traceback g-traceb ads,GNAT Traceback Symbolic g-trasym ads,GNAT Threads g-thread ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-traceback-g-traceb-ads}@anchor{3e1}@anchor{gnat_rm/the_gnat_library id121}@anchor{3e2} +@anchor{gnat_rm/the_gnat_library gnat-traceback-g-traceb-ads}@anchor{3e6}@anchor{gnat_rm/the_gnat_library id122}@anchor{3e7} @section @code{GNAT.Traceback} (@code{g-traceb.ads}) @@ -25393,7 +25623,7 @@ Provides a facility for obtaining non-symbolic traceback information, useful in various debugging situations. @node GNAT Traceback Symbolic g-trasym ads,GNAT UTF_32 g-utf_32 ads,GNAT Traceback g-traceb ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-traceback-symbolic-g-trasym-ads}@anchor{3e3}@anchor{gnat_rm/the_gnat_library id122}@anchor{3e4} +@anchor{gnat_rm/the_gnat_library gnat-traceback-symbolic-g-trasym-ads}@anchor{3e8}@anchor{gnat_rm/the_gnat_library id123}@anchor{3e9} @section @code{GNAT.Traceback.Symbolic} (@code{g-trasym.ads}) @@ -25402,7 +25632,7 @@ in various debugging situations. @geindex Trace back facilities @node GNAT UTF_32 g-utf_32 ads,GNAT UTF_32_Spelling_Checker g-u3spch ads,GNAT Traceback Symbolic g-trasym ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-utf-32-g-utf-32-ads}@anchor{3e5}@anchor{gnat_rm/the_gnat_library id123}@anchor{3e6} +@anchor{gnat_rm/the_gnat_library gnat-utf-32-g-utf-32-ads}@anchor{3ea}@anchor{gnat_rm/the_gnat_library id124}@anchor{3eb} @section @code{GNAT.UTF_32} (@code{g-utf_32.ads}) @@ -25421,7 +25651,7 @@ lower case to upper case fold routine corresponding to the Ada 2005 rules for identifier equivalence. @node GNAT UTF_32_Spelling_Checker g-u3spch ads,GNAT Wide_Spelling_Checker g-wispch ads,GNAT UTF_32 g-utf_32 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-utf-32-spelling-checker-g-u3spch-ads}@anchor{3e7}@anchor{gnat_rm/the_gnat_library id124}@anchor{3e8} +@anchor{gnat_rm/the_gnat_library gnat-utf-32-spelling-checker-g-u3spch-ads}@anchor{3ec}@anchor{gnat_rm/the_gnat_library id125}@anchor{3ed} @section @code{GNAT.UTF_32_Spelling_Checker} (@code{g-u3spch.ads}) @@ -25434,7 +25664,7 @@ near misspelling of another wide wide string, where the strings are represented using the UTF_32_String type defined in System.Wch_Cnv. @node GNAT Wide_Spelling_Checker g-wispch ads,GNAT Wide_String_Split g-wistsp ads,GNAT UTF_32_Spelling_Checker g-u3spch ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-wide-spelling-checker-g-wispch-ads}@anchor{3e9}@anchor{gnat_rm/the_gnat_library id125}@anchor{3ea} +@anchor{gnat_rm/the_gnat_library gnat-wide-spelling-checker-g-wispch-ads}@anchor{3ee}@anchor{gnat_rm/the_gnat_library id126}@anchor{3ef} @section @code{GNAT.Wide_Spelling_Checker} (@code{g-wispch.ads}) @@ -25446,7 +25676,7 @@ Provides a function for determining whether one wide string is a plausible near misspelling of another wide string. @node GNAT Wide_String_Split g-wistsp ads,GNAT Wide_Wide_Spelling_Checker g-zspche ads,GNAT Wide_Spelling_Checker g-wispch ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-wide-string-split-g-wistsp-ads}@anchor{3eb}@anchor{gnat_rm/the_gnat_library id126}@anchor{3ec} +@anchor{gnat_rm/the_gnat_library gnat-wide-string-split-g-wistsp-ads}@anchor{3f0}@anchor{gnat_rm/the_gnat_library id127}@anchor{3f1} @section @code{GNAT.Wide_String_Split} (@code{g-wistsp.ads}) @@ -25460,7 +25690,7 @@ to the resulting slices. This package is instantiated from @code{GNAT.Array_Split}. @node GNAT Wide_Wide_Spelling_Checker g-zspche ads,GNAT Wide_Wide_String_Split g-zistsp ads,GNAT Wide_String_Split g-wistsp ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-wide-wide-spelling-checker-g-zspche-ads}@anchor{3ed}@anchor{gnat_rm/the_gnat_library id127}@anchor{3ee} +@anchor{gnat_rm/the_gnat_library gnat-wide-wide-spelling-checker-g-zspche-ads}@anchor{3f2}@anchor{gnat_rm/the_gnat_library id128}@anchor{3f3} @section @code{GNAT.Wide_Wide_Spelling_Checker} (@code{g-zspche.ads}) @@ -25472,7 +25702,7 @@ Provides a function for determining whether one wide wide string is a plausible near misspelling of another wide wide string. @node GNAT Wide_Wide_String_Split g-zistsp ads,Interfaces C Extensions i-cexten ads,GNAT Wide_Wide_Spelling_Checker g-zspche ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-wide-wide-string-split-g-zistsp-ads}@anchor{3ef}@anchor{gnat_rm/the_gnat_library id128}@anchor{3f0} +@anchor{gnat_rm/the_gnat_library gnat-wide-wide-string-split-g-zistsp-ads}@anchor{3f4}@anchor{gnat_rm/the_gnat_library id129}@anchor{3f5} @section @code{GNAT.Wide_Wide_String_Split} (@code{g-zistsp.ads}) @@ -25486,7 +25716,7 @@ to the resulting slices. This package is instantiated from @code{GNAT.Array_Split}. @node Interfaces C Extensions i-cexten ads,Interfaces C Streams i-cstrea ads,GNAT Wide_Wide_String_Split g-zistsp ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id129}@anchor{3f1}@anchor{gnat_rm/the_gnat_library interfaces-c-extensions-i-cexten-ads}@anchor{3f2} +@anchor{gnat_rm/the_gnat_library id130}@anchor{3f6}@anchor{gnat_rm/the_gnat_library interfaces-c-extensions-i-cexten-ads}@anchor{3f7} @section @code{Interfaces.C.Extensions} (@code{i-cexten.ads}) @@ -25497,7 +25727,7 @@ for use with either manually or automatically generated bindings to C libraries. @node Interfaces C Streams i-cstrea ads,Interfaces Packed_Decimal i-pacdec ads,Interfaces C Extensions i-cexten ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id130}@anchor{3f3}@anchor{gnat_rm/the_gnat_library interfaces-c-streams-i-cstrea-ads}@anchor{3f4} +@anchor{gnat_rm/the_gnat_library id131}@anchor{3f8}@anchor{gnat_rm/the_gnat_library interfaces-c-streams-i-cstrea-ads}@anchor{3f9} @section @code{Interfaces.C.Streams} (@code{i-cstrea.ads}) @@ -25510,7 +25740,7 @@ This package is a binding for the most commonly used operations on C streams. @node Interfaces Packed_Decimal i-pacdec ads,Interfaces VxWorks i-vxwork ads,Interfaces C Streams i-cstrea ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id131}@anchor{3f5}@anchor{gnat_rm/the_gnat_library interfaces-packed-decimal-i-pacdec-ads}@anchor{3f6} +@anchor{gnat_rm/the_gnat_library id132}@anchor{3fa}@anchor{gnat_rm/the_gnat_library interfaces-packed-decimal-i-pacdec-ads}@anchor{3fb} @section @code{Interfaces.Packed_Decimal} (@code{i-pacdec.ads}) @@ -25525,7 +25755,7 @@ from a packed decimal format compatible with that used on IBM mainframes. @node Interfaces VxWorks i-vxwork ads,Interfaces VxWorks IO i-vxwoio ads,Interfaces Packed_Decimal i-pacdec ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id132}@anchor{3f7}@anchor{gnat_rm/the_gnat_library interfaces-vxworks-i-vxwork-ads}@anchor{3f8} +@anchor{gnat_rm/the_gnat_library id133}@anchor{3fc}@anchor{gnat_rm/the_gnat_library interfaces-vxworks-i-vxwork-ads}@anchor{3fd} @section @code{Interfaces.VxWorks} (@code{i-vxwork.ads}) @@ -25539,7 +25769,7 @@ mainframes. This package provides a limited binding to the VxWorks API. @node Interfaces VxWorks IO i-vxwoio ads,System Address_Image s-addima ads,Interfaces VxWorks i-vxwork ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id133}@anchor{3f9}@anchor{gnat_rm/the_gnat_library interfaces-vxworks-io-i-vxwoio-ads}@anchor{3fa} +@anchor{gnat_rm/the_gnat_library id134}@anchor{3fe}@anchor{gnat_rm/the_gnat_library interfaces-vxworks-io-i-vxwoio-ads}@anchor{3ff} @section @code{Interfaces.VxWorks.IO} (@code{i-vxwoio.ads}) @@ -25562,7 +25792,7 @@ function codes. A particular use of this package is to enable the use of Get_Immediate under VxWorks. @node System Address_Image s-addima ads,System Assertions s-assert ads,Interfaces VxWorks IO i-vxwoio ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id134}@anchor{3fb}@anchor{gnat_rm/the_gnat_library system-address-image-s-addima-ads}@anchor{3fc} +@anchor{gnat_rm/the_gnat_library id135}@anchor{400}@anchor{gnat_rm/the_gnat_library system-address-image-s-addima-ads}@anchor{401} @section @code{System.Address_Image} (@code{s-addima.ads}) @@ -25578,7 +25808,7 @@ function that gives an (implementation dependent) string which identifies an address. @node System Assertions s-assert ads,System Atomic_Counters s-atocou ads,System Address_Image s-addima ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id135}@anchor{3fd}@anchor{gnat_rm/the_gnat_library system-assertions-s-assert-ads}@anchor{3fe} +@anchor{gnat_rm/the_gnat_library id136}@anchor{402}@anchor{gnat_rm/the_gnat_library system-assertions-s-assert-ads}@anchor{403} @section @code{System.Assertions} (@code{s-assert.ads}) @@ -25594,7 +25824,7 @@ by an run-time assertion failure, as well as the routine that is used internally to raise this assertion. @node System Atomic_Counters s-atocou ads,System Memory s-memory ads,System Assertions s-assert ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id136}@anchor{3ff}@anchor{gnat_rm/the_gnat_library system-atomic-counters-s-atocou-ads}@anchor{400} +@anchor{gnat_rm/the_gnat_library id137}@anchor{404}@anchor{gnat_rm/the_gnat_library system-atomic-counters-s-atocou-ads}@anchor{405} @section @code{System.Atomic_Counters} (@code{s-atocou.ads}) @@ -25608,7 +25838,7 @@ on most targets, including all Alpha, AARCH64, ARM, ia64, PowerPC, SPARC V9, x86, and x86_64 platforms. @node System Memory s-memory ads,System Multiprocessors s-multip ads,System Atomic_Counters s-atocou ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id137}@anchor{401}@anchor{gnat_rm/the_gnat_library system-memory-s-memory-ads}@anchor{402} +@anchor{gnat_rm/the_gnat_library id138}@anchor{406}@anchor{gnat_rm/the_gnat_library system-memory-s-memory-ads}@anchor{407} @section @code{System.Memory} (@code{s-memory.ads}) @@ -25626,7 +25856,7 @@ calls to this unit may be made for low level allocation uses (for example see the body of @code{GNAT.Tables}). @node System Multiprocessors s-multip ads,System Multiprocessors Dispatching_Domains s-mudido ads,System Memory s-memory ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id138}@anchor{403}@anchor{gnat_rm/the_gnat_library system-multiprocessors-s-multip-ads}@anchor{404} +@anchor{gnat_rm/the_gnat_library id139}@anchor{408}@anchor{gnat_rm/the_gnat_library system-multiprocessors-s-multip-ads}@anchor{409} @section @code{System.Multiprocessors} (@code{s-multip.ads}) @@ -25639,7 +25869,7 @@ in GNAT we also make it available in Ada 95 and Ada 2005 (where it is technically an implementation-defined addition). @node System Multiprocessors Dispatching_Domains s-mudido ads,System Partition_Interface s-parint ads,System Multiprocessors s-multip ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id139}@anchor{405}@anchor{gnat_rm/the_gnat_library system-multiprocessors-dispatching-domains-s-mudido-ads}@anchor{406} +@anchor{gnat_rm/the_gnat_library id140}@anchor{40a}@anchor{gnat_rm/the_gnat_library system-multiprocessors-dispatching-domains-s-mudido-ads}@anchor{40b} @section @code{System.Multiprocessors.Dispatching_Domains} (@code{s-mudido.ads}) @@ -25652,7 +25882,7 @@ in GNAT we also make it available in Ada 95 and Ada 2005 (where it is technically an implementation-defined addition). @node System Partition_Interface s-parint ads,System Pool_Global s-pooglo ads,System Multiprocessors Dispatching_Domains s-mudido ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id140}@anchor{407}@anchor{gnat_rm/the_gnat_library system-partition-interface-s-parint-ads}@anchor{408} +@anchor{gnat_rm/the_gnat_library id141}@anchor{40c}@anchor{gnat_rm/the_gnat_library system-partition-interface-s-parint-ads}@anchor{40d} @section @code{System.Partition_Interface} (@code{s-parint.ads}) @@ -25662,10 +25892,11 @@ technically an implementation-defined addition). This package provides facilities for partition interfacing. It is used primarily in a distribution context when using Annex E -with @code{PolyORB}. +with @code{PolyORB}. `NB!' See the note in @ref{271,,PolyORB} regarding +the lifetime of this product. @node System Pool_Global s-pooglo ads,System Pool_Local s-pooloc ads,System Partition_Interface s-parint ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id141}@anchor{409}@anchor{gnat_rm/the_gnat_library system-pool-global-s-pooglo-ads}@anchor{40a} +@anchor{gnat_rm/the_gnat_library id142}@anchor{40e}@anchor{gnat_rm/the_gnat_library system-pool-global-s-pooglo-ads}@anchor{40f} @section @code{System.Pool_Global} (@code{s-pooglo.ads}) @@ -25682,7 +25913,7 @@ declared. It uses malloc/free to allocate/free and does not attempt to do any automatic reclamation. @node System Pool_Local s-pooloc ads,System Restrictions s-restri ads,System Pool_Global s-pooglo ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id142}@anchor{40b}@anchor{gnat_rm/the_gnat_library system-pool-local-s-pooloc-ads}@anchor{40c} +@anchor{gnat_rm/the_gnat_library id143}@anchor{410}@anchor{gnat_rm/the_gnat_library system-pool-local-s-pooloc-ads}@anchor{411} @section @code{System.Pool_Local} (@code{s-pooloc.ads}) @@ -25699,7 +25930,7 @@ a list of allocated blocks, so that all storage allocated for the pool can be freed automatically when the pool is finalized. @node System Restrictions s-restri ads,System Rident s-rident ads,System Pool_Local s-pooloc ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id143}@anchor{40d}@anchor{gnat_rm/the_gnat_library system-restrictions-s-restri-ads}@anchor{40e} +@anchor{gnat_rm/the_gnat_library id144}@anchor{412}@anchor{gnat_rm/the_gnat_library system-restrictions-s-restri-ads}@anchor{413} @section @code{System.Restrictions} (@code{s-restri.ads}) @@ -25715,7 +25946,7 @@ compiler determined information on which restrictions are violated by one or more packages in the partition. @node System Rident s-rident ads,System Strings Stream_Ops s-ststop ads,System Restrictions s-restri ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id144}@anchor{40f}@anchor{gnat_rm/the_gnat_library system-rident-s-rident-ads}@anchor{410} +@anchor{gnat_rm/the_gnat_library id145}@anchor{414}@anchor{gnat_rm/the_gnat_library system-rident-s-rident-ads}@anchor{415} @section @code{System.Rident} (@code{s-rident.ads}) @@ -25731,7 +25962,7 @@ since the necessary instantiation is included in package System.Restrictions. @node System Strings Stream_Ops s-ststop ads,System Unsigned_Types s-unstyp ads,System Rident s-rident ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id145}@anchor{411}@anchor{gnat_rm/the_gnat_library system-strings-stream-ops-s-ststop-ads}@anchor{412} +@anchor{gnat_rm/the_gnat_library id146}@anchor{416}@anchor{gnat_rm/the_gnat_library system-strings-stream-ops-s-ststop-ads}@anchor{417} @section @code{System.Strings.Stream_Ops} (@code{s-ststop.ads}) @@ -25747,7 +25978,7 @@ stream attributes are applied to string types, but the subprograms in this package can be used directly by application programs. @node System Unsigned_Types s-unstyp ads,System Wch_Cnv s-wchcnv ads,System Strings Stream_Ops s-ststop ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id146}@anchor{413}@anchor{gnat_rm/the_gnat_library system-unsigned-types-s-unstyp-ads}@anchor{414} +@anchor{gnat_rm/the_gnat_library id147}@anchor{418}@anchor{gnat_rm/the_gnat_library system-unsigned-types-s-unstyp-ads}@anchor{419} @section @code{System.Unsigned_Types} (@code{s-unstyp.ads}) @@ -25760,7 +25991,7 @@ also contains some related definitions for other specialized types used by the compiler in connection with packed array types. @node System Wch_Cnv s-wchcnv ads,System Wch_Con s-wchcon ads,System Unsigned_Types s-unstyp ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id147}@anchor{415}@anchor{gnat_rm/the_gnat_library system-wch-cnv-s-wchcnv-ads}@anchor{416} +@anchor{gnat_rm/the_gnat_library id148}@anchor{41a}@anchor{gnat_rm/the_gnat_library system-wch-cnv-s-wchcnv-ads}@anchor{41b} @section @code{System.Wch_Cnv} (@code{s-wchcnv.ads}) @@ -25781,7 +26012,7 @@ encoding method. It uses definitions in package @code{System.Wch_Con}. @node System Wch_Con s-wchcon ads,,System Wch_Cnv s-wchcnv ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id148}@anchor{417}@anchor{gnat_rm/the_gnat_library system-wch-con-s-wchcon-ads}@anchor{418} +@anchor{gnat_rm/the_gnat_library id149}@anchor{41c}@anchor{gnat_rm/the_gnat_library system-wch-con-s-wchcon-ads}@anchor{41d} @section @code{System.Wch_Con} (@code{s-wchcon.ads}) @@ -25793,7 +26024,7 @@ in ordinary strings. These definitions are used by the package @code{System.Wch_Cnv}. @node Interfacing to Other Languages,Specialized Needs Annexes,The GNAT Library,Top -@anchor{gnat_rm/interfacing_to_other_languages doc}@anchor{419}@anchor{gnat_rm/interfacing_to_other_languages id1}@anchor{41a}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-other-languages}@anchor{11} +@anchor{gnat_rm/interfacing_to_other_languages doc}@anchor{41e}@anchor{gnat_rm/interfacing_to_other_languages id1}@anchor{41f}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-other-languages}@anchor{11} @chapter Interfacing to Other Languages @@ -25811,7 +26042,7 @@ provided. @end menu @node Interfacing to C,Interfacing to C++,,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id2}@anchor{41b}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-c}@anchor{41c} +@anchor{gnat_rm/interfacing_to_other_languages id2}@anchor{420}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-c}@anchor{421} @section Interfacing to C @@ -25951,7 +26182,7 @@ of the length corresponding to the @code{type'Size} value in Ada. @end itemize @node Interfacing to C++,Interfacing to COBOL,Interfacing to C,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id3}@anchor{49}@anchor{gnat_rm/interfacing_to_other_languages id4}@anchor{41d} +@anchor{gnat_rm/interfacing_to_other_languages id3}@anchor{4a}@anchor{gnat_rm/interfacing_to_other_languages id4}@anchor{422} @section Interfacing to C++ @@ -26168,7 +26399,7 @@ builds an opaque @code{Type_Info_Ptr} to reference a @code{std::type_info} object at a given @code{System.Address}. @node Interfacing to COBOL,Interfacing to Fortran,Interfacing to C++,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id5}@anchor{41e}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-cobol}@anchor{41f} +@anchor{gnat_rm/interfacing_to_other_languages id5}@anchor{423}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-cobol}@anchor{424} @section Interfacing to COBOL @@ -26176,7 +26407,7 @@ Interfacing to COBOL is achieved as described in section B.4 of the Ada Reference Manual. @node Interfacing to Fortran,Interfacing to non-GNAT Ada code,Interfacing to COBOL,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id6}@anchor{420}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-fortran}@anchor{421} +@anchor{gnat_rm/interfacing_to_other_languages id6}@anchor{425}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-fortran}@anchor{426} @section Interfacing to Fortran @@ -26186,7 +26417,7 @@ multi-dimensional array causes the array to be stored in column-major order as required for convenient interface to Fortran. @node Interfacing to non-GNAT Ada code,,Interfacing to Fortran,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id7}@anchor{422}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-non-gnat-ada-code}@anchor{423} +@anchor{gnat_rm/interfacing_to_other_languages id7}@anchor{427}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-non-gnat-ada-code}@anchor{428} @section Interfacing to non-GNAT Ada code @@ -26210,7 +26441,7 @@ values or simple record types without variants, or simple array types with fixed bounds. @node Specialized Needs Annexes,Implementation of Specific Ada Features,Interfacing to Other Languages,Top -@anchor{gnat_rm/specialized_needs_annexes doc}@anchor{424}@anchor{gnat_rm/specialized_needs_annexes id1}@anchor{425}@anchor{gnat_rm/specialized_needs_annexes specialized-needs-annexes}@anchor{12} +@anchor{gnat_rm/specialized_needs_annexes doc}@anchor{429}@anchor{gnat_rm/specialized_needs_annexes id1}@anchor{42a}@anchor{gnat_rm/specialized_needs_annexes specialized-needs-annexes}@anchor{12} @chapter Specialized Needs Annexes @@ -26231,7 +26462,7 @@ The Real-Time Systems Annex is fully implemented. Stub generation is fully implemented in the GNAT compiler. In addition, a complete compatible PCS is available as part of @code{PolyORB}, -a separate product. Note, that PolyORB is a deprecated product and will be eventually replaced with other technologies such as @code{RTI}. +a separate product. `NB!' See the note in @ref{271,,PolyORB} regarding the lifetime of this product. @item `Information Systems (Annex F)' @@ -26248,7 +26479,7 @@ in Ada 2005) is fully implemented. @end table @node Implementation of Specific Ada Features,Implementation of Ada 2022 Features,Specialized Needs Annexes,Top -@anchor{gnat_rm/implementation_of_specific_ada_features doc}@anchor{426}@anchor{gnat_rm/implementation_of_specific_ada_features id1}@anchor{427}@anchor{gnat_rm/implementation_of_specific_ada_features implementation-of-specific-ada-features}@anchor{13} +@anchor{gnat_rm/implementation_of_specific_ada_features doc}@anchor{42b}@anchor{gnat_rm/implementation_of_specific_ada_features id1}@anchor{42c}@anchor{gnat_rm/implementation_of_specific_ada_features implementation-of-specific-ada-features}@anchor{13} @chapter Implementation of Specific Ada Features @@ -26267,7 +26498,7 @@ facilities. @end menu @node Machine Code Insertions,GNAT Implementation of Tasking,,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features id2}@anchor{428}@anchor{gnat_rm/implementation_of_specific_ada_features machine-code-insertions}@anchor{181} +@anchor{gnat_rm/implementation_of_specific_ada_features id2}@anchor{42d}@anchor{gnat_rm/implementation_of_specific_ada_features machine-code-insertions}@anchor{183} @section Machine Code Insertions @@ -26435,7 +26666,7 @@ according to normal visibility rules. In particular if there is no qualification is required. @node GNAT Implementation of Tasking,GNAT Implementation of Shared Passive Packages,Machine Code Insertions,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-tasking}@anchor{429}@anchor{gnat_rm/implementation_of_specific_ada_features id3}@anchor{42a} +@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-tasking}@anchor{42e}@anchor{gnat_rm/implementation_of_specific_ada_features id3}@anchor{42f} @section GNAT Implementation of Tasking @@ -26451,7 +26682,7 @@ to compliance with the Real-Time Systems Annex. @end menu @node Mapping Ada Tasks onto the Underlying Kernel Threads,Ensuring Compliance with the Real-Time Annex,,GNAT Implementation of Tasking -@anchor{gnat_rm/implementation_of_specific_ada_features id4}@anchor{42b}@anchor{gnat_rm/implementation_of_specific_ada_features mapping-ada-tasks-onto-the-underlying-kernel-threads}@anchor{42c} +@anchor{gnat_rm/implementation_of_specific_ada_features id4}@anchor{430}@anchor{gnat_rm/implementation_of_specific_ada_features mapping-ada-tasks-onto-the-underlying-kernel-threads}@anchor{431} @subsection Mapping Ada Tasks onto the Underlying Kernel Threads @@ -26520,7 +26751,7 @@ support this functionality when the parent contains more than one task. @geindex Forking a new process @node Ensuring Compliance with the Real-Time Annex,Support for Locking Policies,Mapping Ada Tasks onto the Underlying Kernel Threads,GNAT Implementation of Tasking -@anchor{gnat_rm/implementation_of_specific_ada_features ensuring-compliance-with-the-real-time-annex}@anchor{42d}@anchor{gnat_rm/implementation_of_specific_ada_features id5}@anchor{42e} +@anchor{gnat_rm/implementation_of_specific_ada_features ensuring-compliance-with-the-real-time-annex}@anchor{432}@anchor{gnat_rm/implementation_of_specific_ada_features id5}@anchor{433} @subsection Ensuring Compliance with the Real-Time Annex @@ -26571,7 +26802,7 @@ placed at the end. @c Support_for_Locking_Policies @node Support for Locking Policies,,Ensuring Compliance with the Real-Time Annex,GNAT Implementation of Tasking -@anchor{gnat_rm/implementation_of_specific_ada_features support-for-locking-policies}@anchor{42f} +@anchor{gnat_rm/implementation_of_specific_ada_features support-for-locking-policies}@anchor{434} @subsection Support for Locking Policies @@ -26605,7 +26836,7 @@ then ceiling locking is used. Otherwise, the @code{Ceiling_Locking} policy is ignored. @node GNAT Implementation of Shared Passive Packages,Code Generation for Array Aggregates,GNAT Implementation of Tasking,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-shared-passive-packages}@anchor{430}@anchor{gnat_rm/implementation_of_specific_ada_features id6}@anchor{431} +@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-shared-passive-packages}@anchor{435}@anchor{gnat_rm/implementation_of_specific_ada_features id6}@anchor{436} @section GNAT Implementation of Shared Passive Packages @@ -26703,7 +26934,7 @@ This is used to provide the required locking semantics for proper protected object synchronization. @node Code Generation for Array Aggregates,The Size of Discriminated Records with Default Discriminants,GNAT Implementation of Shared Passive Packages,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features code-generation-for-array-aggregates}@anchor{432}@anchor{gnat_rm/implementation_of_specific_ada_features id7}@anchor{433} +@anchor{gnat_rm/implementation_of_specific_ada_features code-generation-for-array-aggregates}@anchor{437}@anchor{gnat_rm/implementation_of_specific_ada_features id7}@anchor{438} @section Code Generation for Array Aggregates @@ -26734,7 +26965,7 @@ component values and static subtypes also lead to simpler code. @end menu @node Static constant aggregates with static bounds,Constant aggregates with unconstrained nominal types,,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features id8}@anchor{434}@anchor{gnat_rm/implementation_of_specific_ada_features static-constant-aggregates-with-static-bounds}@anchor{435} +@anchor{gnat_rm/implementation_of_specific_ada_features id8}@anchor{439}@anchor{gnat_rm/implementation_of_specific_ada_features static-constant-aggregates-with-static-bounds}@anchor{43a} @subsection Static constant aggregates with static bounds @@ -26781,7 +27012,7 @@ Zero2: constant two_dim := (others => (others => 0)); @end example @node Constant aggregates with unconstrained nominal types,Aggregates with static bounds,Static constant aggregates with static bounds,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features constant-aggregates-with-unconstrained-nominal-types}@anchor{436}@anchor{gnat_rm/implementation_of_specific_ada_features id9}@anchor{437} +@anchor{gnat_rm/implementation_of_specific_ada_features constant-aggregates-with-unconstrained-nominal-types}@anchor{43b}@anchor{gnat_rm/implementation_of_specific_ada_features id9}@anchor{43c} @subsection Constant aggregates with unconstrained nominal types @@ -26796,7 +27027,7 @@ Cr_Unc : constant One_Unc := (12,24,36); @end example @node Aggregates with static bounds,Aggregates with nonstatic bounds,Constant aggregates with unconstrained nominal types,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-static-bounds}@anchor{438}@anchor{gnat_rm/implementation_of_specific_ada_features id10}@anchor{439} +@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-static-bounds}@anchor{43d}@anchor{gnat_rm/implementation_of_specific_ada_features id10}@anchor{43e} @subsection Aggregates with static bounds @@ -26824,7 +27055,7 @@ end loop; @end example @node Aggregates with nonstatic bounds,Aggregates in assignment statements,Aggregates with static bounds,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-nonstatic-bounds}@anchor{43a}@anchor{gnat_rm/implementation_of_specific_ada_features id11}@anchor{43b} +@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-nonstatic-bounds}@anchor{43f}@anchor{gnat_rm/implementation_of_specific_ada_features id11}@anchor{440} @subsection Aggregates with nonstatic bounds @@ -26835,7 +27066,7 @@ have to be applied to sub-arrays individually, if they do not have statically compatible subtypes. @node Aggregates in assignment statements,,Aggregates with nonstatic bounds,Code Generation for Array Aggregates -@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-in-assignment-statements}@anchor{43c}@anchor{gnat_rm/implementation_of_specific_ada_features id12}@anchor{43d} +@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-in-assignment-statements}@anchor{441}@anchor{gnat_rm/implementation_of_specific_ada_features id12}@anchor{442} @subsection Aggregates in assignment statements @@ -26877,7 +27108,7 @@ a temporary (created either by the front-end or the code generator) and then that temporary will be copied onto the target. @node The Size of Discriminated Records with Default Discriminants,Image Values For Nonscalar Types,Code Generation for Array Aggregates,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features id13}@anchor{43e}@anchor{gnat_rm/implementation_of_specific_ada_features the-size-of-discriminated-records-with-default-discriminants}@anchor{43f} +@anchor{gnat_rm/implementation_of_specific_ada_features id13}@anchor{443}@anchor{gnat_rm/implementation_of_specific_ada_features the-size-of-discriminated-records-with-default-discriminants}@anchor{444} @section The Size of Discriminated Records with Default Discriminants @@ -26957,7 +27188,7 @@ say) must be consistent, so it is imperative that the object, once created, remain invariant. @node Image Values For Nonscalar Types,Strict Conformance to the Ada Reference Manual,The Size of Discriminated Records with Default Discriminants,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features id14}@anchor{440}@anchor{gnat_rm/implementation_of_specific_ada_features image-values-for-nonscalar-types}@anchor{441} +@anchor{gnat_rm/implementation_of_specific_ada_features id14}@anchor{445}@anchor{gnat_rm/implementation_of_specific_ada_features image-values-for-nonscalar-types}@anchor{446} @section Image Values For Nonscalar Types @@ -26977,7 +27208,7 @@ control of image text is required for some type T, then T’Put_Image should be explicitly specified. @node Strict Conformance to the Ada Reference Manual,,Image Values For Nonscalar Types,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features id15}@anchor{442}@anchor{gnat_rm/implementation_of_specific_ada_features strict-conformance-to-the-ada-reference-manual}@anchor{443} +@anchor{gnat_rm/implementation_of_specific_ada_features id15}@anchor{447}@anchor{gnat_rm/implementation_of_specific_ada_features strict-conformance-to-the-ada-reference-manual}@anchor{448} @section Strict Conformance to the Ada Reference Manual @@ -27004,7 +27235,7 @@ behavior (although at the cost of a significant performance penalty), so infinite and NaN values are properly generated. @node Implementation of Ada 2022 Features,GNAT language extensions,Implementation of Specific Ada Features,Top -@anchor{gnat_rm/implementation_of_ada_2022_features doc}@anchor{444}@anchor{gnat_rm/implementation_of_ada_2022_features id1}@anchor{445}@anchor{gnat_rm/implementation_of_ada_2022_features implementation-of-ada-2022-features}@anchor{14} +@anchor{gnat_rm/implementation_of_ada_2022_features doc}@anchor{449}@anchor{gnat_rm/implementation_of_ada_2022_features id1}@anchor{44a}@anchor{gnat_rm/implementation_of_ada_2022_features implementation-of-ada-2022-features}@anchor{14} @chapter Implementation of Ada 2022 Features @@ -30423,7 +30654,7 @@ RM references: 3.02.04 (31/5) 4.06 (51.1/5) @end itemize @node GNAT language extensions,Security Hardening Features,Implementation of Ada 2022 Features,Top -@anchor{gnat_rm/gnat_language_extensions doc}@anchor{446}@anchor{gnat_rm/gnat_language_extensions gnat-language-extensions}@anchor{447}@anchor{gnat_rm/gnat_language_extensions id1}@anchor{448} +@anchor{gnat_rm/gnat_language_extensions doc}@anchor{44b}@anchor{gnat_rm/gnat_language_extensions gnat-language-extensions}@anchor{44c}@anchor{gnat_rm/gnat_language_extensions id1}@anchor{44d} @chapter GNAT language extensions @@ -30455,7 +30686,7 @@ These features might be removed or heavily modified at any time. @end menu @node How to activate the extended GNAT Ada superset,Curated Extensions,,GNAT language extensions -@anchor{gnat_rm/gnat_language_extensions how-to-activate-the-extended-gnat-ada-superset}@anchor{449} +@anchor{gnat_rm/gnat_language_extensions how-to-activate-the-extended-gnat-ada-superset}@anchor{44e} @section How to activate the extended GNAT Ada superset @@ -30465,7 +30696,7 @@ There are two ways to activate the extended GNAT Ada superset: @itemize * @item -The @ref{69,,Pragma Extensions_Allowed}. To activate +The @ref{6a,,Pragma Extensions_Allowed}. To activate the curated set of extensions, you should use @end itemize @@ -30496,7 +30727,7 @@ for use in playground experiments. @end cartouche @node Curated Extensions,Experimental Language Extensions,How to activate the extended GNAT Ada superset,GNAT language extensions -@anchor{gnat_rm/gnat_language_extensions curated-extensions}@anchor{44a}@anchor{gnat_rm/gnat_language_extensions curated-language-extensions}@anchor{6a} +@anchor{gnat_rm/gnat_language_extensions curated-extensions}@anchor{44f}@anchor{gnat_rm/gnat_language_extensions curated-language-extensions}@anchor{6b} @section Curated Extensions @@ -30513,11 +30744,12 @@ Features activated via @code{-gnatX} or * Constrained attribute for generic objects:: * Static aspect on intrinsic functions:: * First Controlling Parameter:: +* Generalized Finalization:: @end menu @node Local Declarations Without Block,Deep delta Aggregates,,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions local-declarations-without-block}@anchor{44b} +@anchor{gnat_rm/gnat_language_extensions local-declarations-without-block}@anchor{450} @subsection Local Declarations Without Block @@ -30610,7 +30842,7 @@ And as such the second `@w{`}A`@w{`} declaration is hiding the first one. @end cartouche @node Deep delta Aggregates,Fixed lower bounds for array types and subtypes,Local Declarations Without Block,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions deep-delta-aggregates}@anchor{44c} +@anchor{gnat_rm/gnat_language_extensions deep-delta-aggregates}@anchor{451} @subsection Deep delta Aggregates @@ -30632,7 +30864,7 @@ The syntax of delta aggregates in the extended version is the following: @end menu @node Syntax,Legality Rules,,Deep delta Aggregates -@anchor{gnat_rm/gnat_language_extensions syntax}@anchor{44d} +@anchor{gnat_rm/gnat_language_extensions syntax}@anchor{452} @subsubsection Syntax @@ -30678,7 +30910,7 @@ array_subcomponent_choice ::= @end example @node Legality Rules,Dynamic Semantics,Syntax,Deep delta Aggregates -@anchor{gnat_rm/gnat_language_extensions legality-rules}@anchor{44e} +@anchor{gnat_rm/gnat_language_extensions legality-rules}@anchor{453} @subsubsection Legality Rules @@ -30715,7 +30947,7 @@ the object denoted by the base_expression, prior to any update.] @end enumerate @node Dynamic Semantics,Examples,Legality Rules,Deep delta Aggregates -@anchor{gnat_rm/gnat_language_extensions dynamic-semantics}@anchor{44f} +@anchor{gnat_rm/gnat_language_extensions dynamic-semantics}@anchor{454} @subsubsection Dynamic Semantics @@ -30772,7 +31004,7 @@ and assigned to the corresponding subcomponent of the anonymous object. @end itemize @node Examples,,Dynamic Semantics,Deep delta Aggregates -@anchor{gnat_rm/gnat_language_extensions examples}@anchor{450} +@anchor{gnat_rm/gnat_language_extensions examples}@anchor{455} @subsubsection Examples @@ -30800,7 +31032,7 @@ end; @end example @node Fixed lower bounds for array types and subtypes,Prefixed-view notation for calls to primitive subprograms of untagged types,Deep delta Aggregates,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions fixed-lower-bounds-for-array-types-and-subtypes}@anchor{451} +@anchor{gnat_rm/gnat_language_extensions fixed-lower-bounds-for-array-types-and-subtypes}@anchor{456} @subsection Fixed lower bounds for array types and subtypes @@ -30851,7 +31083,7 @@ lower bound of unconstrained array formals when the formal’s subtype has index ranges with static fixed lower bounds. @node Prefixed-view notation for calls to primitive subprograms of untagged types,Expression defaults for generic formal functions,Fixed lower bounds for array types and subtypes,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions prefixed-view-notation-for-calls-to-primitive-subprograms-of-untagged-types}@anchor{452} +@anchor{gnat_rm/gnat_language_extensions prefixed-view-notation-for-calls-to-primitive-subprograms-of-untagged-types}@anchor{457} @subsection Prefixed-view notation for calls to primitive subprograms of untagged types @@ -30901,7 +31133,7 @@ pragma Assert (V.Nth_Element(1) = 42); @end example @node Expression defaults for generic formal functions,String interpolation,Prefixed-view notation for calls to primitive subprograms of untagged types,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions expression-defaults-for-generic-formal-functions}@anchor{453} +@anchor{gnat_rm/gnat_language_extensions expression-defaults-for-generic-formal-functions}@anchor{458} @subsection Expression defaults for generic formal functions @@ -30932,7 +31164,7 @@ If the default is used (i.e. there is no actual corresponding to Copy), then calls to Copy in the instance will simply return Item. @node String interpolation,Constrained attribute for generic objects,Expression defaults for generic formal functions,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions string-interpolation}@anchor{454} +@anchor{gnat_rm/gnat_language_extensions string-interpolation}@anchor{459} @subsection String interpolation @@ -31099,7 +31331,7 @@ a double quote is " and an open brace is @{ @end example @node Constrained attribute for generic objects,Static aspect on intrinsic functions,String interpolation,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions constrained-attribute-for-generic-objects}@anchor{455} +@anchor{gnat_rm/gnat_language_extensions constrained-attribute-for-generic-objects}@anchor{45a} @subsection Constrained attribute for generic objects @@ -31107,7 +31339,7 @@ The @code{Constrained} attribute is permitted for objects of generic types. The result indicates whether the corresponding actual is constrained. @node Static aspect on intrinsic functions,First Controlling Parameter,Constrained attribute for generic objects,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions static-aspect-on-intrinsic-functions}@anchor{456} +@anchor{gnat_rm/gnat_language_extensions static-aspect-on-intrinsic-functions}@anchor{45b} @subsection @code{Static} aspect on intrinsic functions @@ -31115,8 +31347,8 @@ The Ada 202x @code{Static} aspect can be specified on Intrinsic imported functio and the compiler will evaluate some of these intrinsics statically, in particular the @code{Shift_Left} and @code{Shift_Right} intrinsics. -@node First Controlling Parameter,,Static aspect on intrinsic functions,Curated Extensions -@anchor{gnat_rm/gnat_language_extensions first-controlling-parameter}@anchor{457} +@node First Controlling Parameter,Generalized Finalization,Static aspect on intrinsic functions,Curated Extensions +@anchor{gnat_rm/gnat_language_extensions first-controlling-parameter}@anchor{45c} @subsection First Controlling Parameter @@ -31215,8 +31447,170 @@ overriding a primitive or creating new one. The result of a function is never a controlling result. @end itemize +@node Generalized Finalization,,First Controlling Parameter,Curated Extensions +@anchor{gnat_rm/gnat_language_extensions generalized-finalization}@anchor{45d} +@subsection Generalized Finalization + + +The @code{Finalizable} aspect can be applied to any record type, tagged or not, +to specify that it provides the same level of control on the operations of +initialization, finalization, and assignment of objects as the controlled +types (see RM 7.6(2) for a high-level overview). The only restriction is +that the record type must be a root type, in other words not a derived type. + +The aspect additionally makes it possible to specify relaxed semantics for +the finalization operations by means of the @code{Relaxed_Finalization} setting. +Here is the archetypal example: + +@example +type T is record + ... +end record + with Finalizable => (Initialize => Initialize, + Adjust => Adjust, + Finalize => Finalize, + Relaxed_Finalization => True); + +procedure Adjust (Obj : in out T); +procedure Finalize (Obj : in out T); +procedure Initialize (Obj : in out T); +@end example + +The three procedures have the same profile, with a single @code{in out} parameter, +and also have the same dynamic semantics as for controlled types: + +@quotation + + +@itemize - + +@item +@code{Initialize} is called when an object of type @code{T} is declared without +initialization expression. + +@item +@code{Adjust} is called after an object of type @code{T} is assigned a new value. + +@item +@code{Finalize} is called when an object of type @code{T} goes out of scope (for +stack-allocated objects) or is deallocated (for heap-allocated objects). +It is also called when the value is replaced by an assignment. +@end itemize +@end quotation + +However, when @code{Relaxed_Finalization} is either @code{True} or not explicitly +specified, the following differences are implemented relative to the semantics +of controlled types: + + +@itemize * + +@item +The compiler has permission to perform no automatic finalization of +heap-allocated objects: @code{Finalize} is only called when such an object +is explicitly deallocated, or when the designated object is assigned a new +value. As a consequence, no runtime support is needed for performing +implicit deallocation. In particular, no per-object header data is needed +for heap-allocated objects. + +Heap-allocated objects allocated through a nested access type will therefore +`not' be deallocated either. The result is simply that memory will be leaked +in this case. + +@item +The @code{Adjust} and @code{Finalize} procedures are automatically considered as +having the @ref{45e,,No_Raise aspect} specified for them. In particular, the +compiler has permission to enforce none of the guarantees specified by the +RM 7.6.1 (14/1) and subsequent subclauses. +@end itemize + +Simple example of ref-counted type: + +@example +type T is record + Value : Integer; + Ref_Count : Natural := 0; +end record; + +procedure Inc_Ref (X : in out T); +procedure Dec_Ref (X : in out T); + +type T_Access is access all T; + +type T_Ref is record + Value : T_Access; +end record + with Finalizable => (Adjust => Adjust, + Finalize => Finalize); + +procedure Adjust (Ref : in out T_Ref) is +begin + Inc_Ref (Ref.Value); +end Adjust; + +procedure Finalize (Ref : in out T_Ref) is +begin + Def_Ref (Ref.Value); +end Finalize; +@end example + +Simple file handle that ensures resources are properly released: + +@example +package P is + type File (<>) is limited private; + + function Open (Path : String) return File; + + procedure Close (F : in out File); + +private + type File is limited record + Handle : ...; + end record + with Finalizable (Finalize => Close); +end P; +@end example + +@menu +* Finalizable tagged types:: +* Composite types:: +* Interoperability with controlled types:: + +@end menu + +@node Finalizable tagged types,Composite types,,Generalized Finalization +@anchor{gnat_rm/gnat_language_extensions finalizable-tagged-types}@anchor{45f} +@subsubsection Finalizable tagged types + + +The aspect is inherited by derived types and the primitives may be overridden +by the derivation. The compiler-generated calls to these operations are then +dispatching whenever it makes sense, i.e. when the object in question is of a +class-wide type and the class includes at least one finalizable tagged type. + +@node Composite types,Interoperability with controlled types,Finalizable tagged types,Generalized Finalization +@anchor{gnat_rm/gnat_language_extensions composite-types}@anchor{460} +@subsubsection Composite types + + +When a finalizable type is used as a component of a composite type, the latter +becomes finalizable as well. The three primitives are derived automatically +in order to call the primitives of their components. The dynamic semantics is +the same as for controlled components of composite types. + +@node Interoperability with controlled types,,Composite types,Generalized Finalization +@anchor{gnat_rm/gnat_language_extensions interoperability-with-controlled-types}@anchor{461} +@subsubsection Interoperability with controlled types + + +Finalizable types are fully interoperable with controlled types, in particular +it is possible for a finalizable type to have a controlled component and vice +versa, but the stricter dynamic semantics, in other words that of controlled +types, is applied in this case. + @node Experimental Language Extensions,,Curated Extensions,GNAT language extensions -@anchor{gnat_rm/gnat_language_extensions experimental-language-extensions}@anchor{6b}@anchor{gnat_rm/gnat_language_extensions id2}@anchor{458} +@anchor{gnat_rm/gnat_language_extensions experimental-language-extensions}@anchor{6c}@anchor{gnat_rm/gnat_language_extensions id2}@anchor{462} @section Experimental Language Extensions @@ -31231,18 +31625,18 @@ Features activated via @code{-gnatX0} or * Simpler Accessibility Model:: * Case pattern matching:: * Mutably Tagged Types with Size’Class Aspect:: -* Generalized Finalization:: * No_Raise aspect:: * Inference of Dependent Types in Generic Instantiations:: * External_Initialization Aspect:: * Finally construct:: * Continue statement:: * Destructors:: +* Structural Generic Instantiation:: @end menu @node Conditional when constructs,Implicit With,,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions conditional-when-constructs}@anchor{459} +@anchor{gnat_rm/gnat_language_extensions conditional-when-constructs}@anchor{463} @subsection Conditional when constructs @@ -31311,7 +31705,7 @@ end; @end example @node Implicit With,Storage Model,Conditional when constructs,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions implicit-with}@anchor{45a} +@anchor{gnat_rm/gnat_language_extensions implicit-with}@anchor{464} @subsection Implicit With @@ -31328,7 +31722,7 @@ end; @end example @node Storage Model,Attribute Super,Implicit With,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions storage-model}@anchor{45b} +@anchor{gnat_rm/gnat_language_extensions storage-model}@anchor{465} @subsection Storage Model @@ -31345,7 +31739,7 @@ memory models, in particular to support interactions with GPU. @end menu @node Aspect Storage_Model_Type,Aspect Designated_Storage_Model,,Storage Model -@anchor{gnat_rm/gnat_language_extensions aspect-storage-model-type}@anchor{45c} +@anchor{gnat_rm/gnat_language_extensions aspect-storage-model-type}@anchor{466} @subsubsection Aspect Storage_Model_Type @@ -31479,7 +31873,7 @@ end CUDA_Memory; @end example @node Aspect Designated_Storage_Model,Legacy Storage Pools,Aspect Storage_Model_Type,Storage Model -@anchor{gnat_rm/gnat_language_extensions aspect-designated-storage-model}@anchor{45d} +@anchor{gnat_rm/gnat_language_extensions aspect-designated-storage-model}@anchor{467} @subsubsection Aspect Designated_Storage_Model @@ -31557,7 +31951,7 @@ begin @end example @node Legacy Storage Pools,,Aspect Designated_Storage_Model,Storage Model -@anchor{gnat_rm/gnat_language_extensions legacy-storage-pools}@anchor{45e} +@anchor{gnat_rm/gnat_language_extensions legacy-storage-pools}@anchor{468} @subsubsection Legacy Storage Pools @@ -31608,7 +32002,7 @@ type Acc is access Integer_Array with Storage_Pool => My_Pool; can still be accepted as a shortcut for the new syntax. @node Attribute Super,Simpler Accessibility Model,Storage Model,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions attribute-super}@anchor{45f} +@anchor{gnat_rm/gnat_language_extensions attribute-super}@anchor{469} @subsection Attribute Super @@ -31643,7 +32037,7 @@ end; @end example @node Simpler Accessibility Model,Case pattern matching,Attribute Super,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions simpler-accessibility-model}@anchor{460} +@anchor{gnat_rm/gnat_language_extensions simpler-accessibility-model}@anchor{46a} @subsection Simpler Accessibility Model @@ -31674,7 +32068,7 @@ All of the refined rules are compatible with the [use of anonymous access types @end menu @node Stand-alone objects,Subprogram parameters,,Simpler Accessibility Model -@anchor{gnat_rm/gnat_language_extensions stand-alone-objects}@anchor{461} +@anchor{gnat_rm/gnat_language_extensions stand-alone-objects}@anchor{46b} @subsubsection Stand-alone objects @@ -31722,7 +32116,7 @@ of the RM 4.6 rule “The accessibility level of the operand type shall not be statically deeper than that of the target type …”. @node Subprogram parameters,Function results,Stand-alone objects,Simpler Accessibility Model -@anchor{gnat_rm/gnat_language_extensions subprogram-parameters}@anchor{462} +@anchor{gnat_rm/gnat_language_extensions subprogram-parameters}@anchor{46c} @subsubsection Subprogram parameters @@ -31815,7 +32209,7 @@ end; @end example @node Function results,,Subprogram parameters,Simpler Accessibility Model -@anchor{gnat_rm/gnat_language_extensions function-results}@anchor{463} +@anchor{gnat_rm/gnat_language_extensions function-results}@anchor{46d} @subsubsection Function results @@ -31943,7 +32337,7 @@ end; @end example @node Case pattern matching,Mutably Tagged Types with Size’Class Aspect,Simpler Accessibility Model,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions case-pattern-matching}@anchor{464} +@anchor{gnat_rm/gnat_language_extensions case-pattern-matching}@anchor{46e} @subsection Case pattern matching @@ -32072,8 +32466,8 @@ compile-time capacity limits in some annoyingly common scenarios; the message generated in such cases is usually “Capacity exceeded in compiling case statement with composite selector type”. -@node Mutably Tagged Types with Size’Class Aspect,Generalized Finalization,Case pattern matching,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions mutably-tagged-types-with-size-class-aspect}@anchor{465} +@node Mutably Tagged Types with Size’Class Aspect,No_Raise aspect,Case pattern matching,Experimental Language Extensions +@anchor{gnat_rm/gnat_language_extensions mutably-tagged-types-with-size-class-aspect}@anchor{46f} @subsection Mutably Tagged Types with Size’Class Aspect @@ -32243,170 +32637,8 @@ of the call is erroneous if the tag of the actual is changed while the formal parameter exists (that is, before leaving the corresponding callable construct). This is analogous to the RM 6.4.1(18) rule about discriminated parameters. -@node Generalized Finalization,No_Raise aspect,Mutably Tagged Types with Size’Class Aspect,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions generalized-finalization}@anchor{466} -@subsection Generalized Finalization - - -The @code{Finalizable} aspect can be applied to any record type, tagged or not, -to specify that it provides the same level of control on the operations of -initialization, finalization, and assignment of objects as the controlled -types (see RM 7.6(2) for a high-level overview). The only restriction is -that the record type must be a root type, in other words not a derived type. - -The aspect additionally makes it possible to specify relaxed semantics for -the finalization operations by means of the @code{Relaxed_Finalization} setting. -Here is the archetypal example: - -@example -type T is record - ... -end record - with Finalizable => (Initialize => Initialize, - Adjust => Adjust, - Finalize => Finalize, - Relaxed_Finalization => True); - -procedure Adjust (Obj : in out T); -procedure Finalize (Obj : in out T); -procedure Initialize (Obj : in out T); -@end example - -The three procedures have the same profile, with a single @code{in out} parameter, -and also have the same dynamic semantics as for controlled types: - -@quotation - - -@itemize - - -@item -@code{Initialize} is called when an object of type @code{T} is declared without -initialization expression. - -@item -@code{Adjust} is called after an object of type @code{T} is assigned a new value. - -@item -@code{Finalize} is called when an object of type @code{T} goes out of scope (for -stack-allocated objects) or is deallocated (for heap-allocated objects). -It is also called when the value is replaced by an assignment. -@end itemize -@end quotation - -However, when @code{Relaxed_Finalization} is either @code{True} or not explicitly -specified, the following differences are implemented relative to the semantics -of controlled types: - - -@itemize * - -@item -The compiler has permission to perform no automatic finalization of -heap-allocated objects: @code{Finalize} is only called when such an object -is explicitly deallocated, or when the designated object is assigned a new -value. As a consequence, no runtime support is needed for performing -implicit deallocation. In particular, no per-object header data is needed -for heap-allocated objects. - -Heap-allocated objects allocated through a nested access type will therefore -`not' be deallocated either. The result is simply that memory will be leaked -in this case. - -@item -The @code{Adjust} and @code{Finalize} procedures are automatically considered as -having the @ref{467,,No_Raise aspect} specified for them. In particular, the -compiler has permission to enforce none of the guarantees specified by the -RM 7.6.1 (14/1) and subsequent subclauses. -@end itemize - -Simple example of ref-counted type: - -@example -type T is record - Value : Integer; - Ref_Count : Natural := 0; -end record; - -procedure Inc_Ref (X : in out T); -procedure Dec_Ref (X : in out T); - -type T_Access is access all T; - -type T_Ref is record - Value : T_Access; -end record - with Finalizable => (Adjust => Adjust, - Finalize => Finalize); - -procedure Adjust (Ref : in out T_Ref) is -begin - Inc_Ref (Ref.Value); -end Adjust; - -procedure Finalize (Ref : in out T_Ref) is -begin - Def_Ref (Ref.Value); -end Finalize; -@end example - -Simple file handle that ensures resources are properly released: - -@example -package P is - type File (<>) is limited private; - - function Open (Path : String) return File; - - procedure Close (F : in out File); - -private - type File is limited record - Handle : ...; - end record - with Finalizable (Finalize => Close); -end P; -@end example - -@menu -* Finalizable tagged types:: -* Composite types:: -* Interoperability with controlled types:: - -@end menu - -@node Finalizable tagged types,Composite types,,Generalized Finalization -@anchor{gnat_rm/gnat_language_extensions finalizable-tagged-types}@anchor{468} -@subsubsection Finalizable tagged types - - -The aspect is inherited by derived types and the primitives may be overridden -by the derivation. The compiler-generated calls to these operations are then -dispatching whenever it makes sense, i.e. when the object in question is of a -class-wide type and the class includes at least one finalizable tagged type. - -@node Composite types,Interoperability with controlled types,Finalizable tagged types,Generalized Finalization -@anchor{gnat_rm/gnat_language_extensions composite-types}@anchor{469} -@subsubsection Composite types - - -When a finalizable type is used as a component of a composite type, the latter -becomes finalizable as well. The three primitives are derived automatically -in order to call the primitives of their components. The dynamic semantics is -the same as for controlled components of composite types. - -@node Interoperability with controlled types,,Composite types,Generalized Finalization -@anchor{gnat_rm/gnat_language_extensions interoperability-with-controlled-types}@anchor{46a} -@subsubsection Interoperability with controlled types - - -Finalizable types are fully interoperable with controlled types, in particular -it is possible for a finalizable type to have a controlled component and vice -versa, but the stricter dynamic semantics, in other words that of controlled -types, is applied in this case. - -@node No_Raise aspect,Inference of Dependent Types in Generic Instantiations,Generalized Finalization,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions id3}@anchor{46b}@anchor{gnat_rm/gnat_language_extensions no-raise-aspect}@anchor{467} +@node No_Raise aspect,Inference of Dependent Types in Generic Instantiations,Mutably Tagged Types with Size’Class Aspect,Experimental Language Extensions +@anchor{gnat_rm/gnat_language_extensions id3}@anchor{470}@anchor{gnat_rm/gnat_language_extensions no-raise-aspect}@anchor{45e} @subsection No_Raise aspect @@ -32416,7 +32648,7 @@ be raised during the execution of the subprogram, it is caught at the end of this execution and @code{Program_Error} is propagated to the caller. @node Inference of Dependent Types in Generic Instantiations,External_Initialization Aspect,No_Raise aspect,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions inference-of-dependent-types-in-generic-instantiations}@anchor{46c} +@anchor{gnat_rm/gnat_language_extensions inference-of-dependent-types-in-generic-instantiations}@anchor{471} @subsection Inference of Dependent Types in Generic Instantiations @@ -32493,7 +32725,7 @@ package Int_Array_Operations is new Array_Operations @end example @node External_Initialization Aspect,Finally construct,Inference of Dependent Types in Generic Instantiations,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions external-initialization-aspect}@anchor{46d} +@anchor{gnat_rm/gnat_language_extensions external-initialization-aspect}@anchor{472} @subsection External_Initialization Aspect @@ -32534,7 +32766,7 @@ The maximum size of loaded files is limited to 2@w{^31} bytes. @end cartouche @node Finally construct,Continue statement,External_Initialization Aspect,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions finally-construct}@anchor{46e} +@anchor{gnat_rm/gnat_language_extensions finally-construct}@anchor{473} @subsection Finally construct @@ -32551,7 +32783,7 @@ This feature is similar to the one with the same name in other languages such as @end menu @node Syntax<2>,Legality Rules<2>,,Finally construct -@anchor{gnat_rm/gnat_language_extensions id4}@anchor{46f} +@anchor{gnat_rm/gnat_language_extensions id4}@anchor{474} @subsubsection Syntax @@ -32566,7 +32798,7 @@ handled_sequence_of_statements ::= @end example @node Legality Rules<2>,Dynamic Semantics<2>,Syntax<2>,Finally construct -@anchor{gnat_rm/gnat_language_extensions id5}@anchor{470} +@anchor{gnat_rm/gnat_language_extensions id5}@anchor{475} @subsubsection Legality Rules @@ -32576,7 +32808,7 @@ to be transferred outside the finally part are forbidden. Goto & exit where the target is outside of the finally’s @code{sequence_of_statements} are forbidden @node Dynamic Semantics<2>,,Legality Rules<2>,Finally construct -@anchor{gnat_rm/gnat_language_extensions id6}@anchor{471} +@anchor{gnat_rm/gnat_language_extensions id6}@anchor{476} @subsubsection Dynamic Semantics @@ -32591,7 +32823,7 @@ execution, that is the finally block must be executed in full even if the contai aborted, or if the control is transferred out of the block. @node Continue statement,Destructors,Finally construct,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions continue-statement}@anchor{472} +@anchor{gnat_rm/gnat_language_extensions continue-statement}@anchor{477} @subsection Continue statement @@ -32608,8 +32840,8 @@ statement in the sequence of statements of the specified loop_statement. Note that @code{continue} is a keyword but it is not a reserved word. This is a configuration that does not exist in standard Ada. -@node Destructors,,Continue statement,Experimental Language Extensions -@anchor{gnat_rm/gnat_language_extensions destructors}@anchor{473} +@node Destructors,Structural Generic Instantiation,Continue statement,Experimental Language Extensions +@anchor{gnat_rm/gnat_language_extensions destructors}@anchor{478} @subsection Destructors @@ -32678,8 +32910,177 @@ mentioned legality rule, to prevent breaking the privacy of the type when imposing that rule on outside types that derive from the private view of the type. +@node Structural Generic Instantiation,,Destructors,Experimental Language Extensions +@anchor{gnat_rm/gnat_language_extensions structural-generic-instantiation}@anchor{479} +@subsection Structural Generic Instantiation + + +The compiler implements a second kind of generic instantiation, called +“structural”, alongside the traditional instantiation specified by the +language, which is defined as follows: the structural instantiation of +a generic unit on given actual parameters is the anonymous instantiation +of the generic unit on the actual parameters done in the outermost scope +where it would be legal to do an identical traditional instantiation. + +There is at most one structural instantiation of a generic unit on given +actual parameters done in a partition. + +Structural generic instances (the product of structural instantiation) +are implicitly created whenever a reference to them is made in a place +where a name is accepted by the language. + +@menu +* Syntax: Syntax<3>. +* Legality Rules: Legality Rules<3>. +* Static Semantics:: + +@end menu + +@node Syntax<3>,Legality Rules<3>,,Structural Generic Instantiation +@anchor{gnat_rm/gnat_language_extensions id7}@anchor{47a} +@subsubsection Syntax + + +@example +name ::= @{ set of productions specified in the RM @} + | structural_generic_instance_name + +structural_generic_instance_name ::= name generic_actual_part +@end example + +@node Legality Rules<3>,Static Semantics,Syntax<3>,Structural Generic Instantiation +@anchor{gnat_rm/gnat_language_extensions id8}@anchor{47b} +@subsubsection Legality Rules + + +The @code{name} in a @code{structural_generic_instance_name} shall denote a generic +unit that is preelaborated. Note that, unlike in a traditional instantiation, +there are no square brackets around the @code{generic_actual_part} in the second +production, which means that it is mandatory and, therefore, that the generic +unit shall have at least one generic formal parameter. + +The generic unit shall not take a generic formal object of mode @code{in out}. +If the generic unit takes a generic formal object of mode @code{in}, then the +corresponding generic actual parameter shall be a static expression. + +A @code{structural_generic_instance_name} shall not be present in a library +unit if the structural instance is also a library unit and has a semantic +dependence on the former. + +@node Static Semantics,,Legality Rules<3>,Structural Generic Instantiation +@anchor{gnat_rm/gnat_language_extensions static-semantics}@anchor{47c} +@subsubsection Static Semantics + + +A @code{structural_generic_instance_name} denotes the instance that is the +product of the structural instantiation of a generic unit on the specified +actual parameters. This instance is unique to a partition. + +Example: + +@example +with Ada.Containers.Vectors; + +procedure P is + V : Ada.Containers.Vectors(Positive,Integer).Vector; + +begin + V.Append (1); + V.Append (0); + Ada.Containers.Vectors(Positive,Integer).Generic_Sorting("<").Sort (V); +end; +@end example + +This procedure references two structural instantiations of two different generic +units: @code{Ada.Containers.Vectors(Positive,Integer)} is the structural instance +of the generic unit @code{Ada.Containers.Vectors} on @code{Positive} and @code{Integer} +and @code{Ada.Containers.Vectors(Positive,Integer).Generic_Sorting("<")} is the +structural instance of the nested generic unit +@code{Ada.Containers.Vectors(Positive,Integer).Generic_Sorting} on @code{"<"}. + +Note that the following example is illegal: + +@example +with Ada.Containers.Vectors; + +package Q is + type T is record + I : Integer; + end record; + + V : Ada.Containers.Vectors(Positive,T).Vector; +end Q; +@end example + +The reason is that @code{Ada.Containers.Vectors}, @code{Positive} and @code{Q.T} being +library-level entities, the structural instance @code{Ada.Containers.Vectors(Positive,T)} is a library unit with a dependence +on @code{Q} and, therefore, cannot be referenced from within @code{Q}. The simple +way out is to declare a traditional instantiation in this case: + +@example +with Ada.Containers.Vectors; + +package Q is + type T is record + I : Integer; + end record; + + package Vectors_Of_T is new Ada.Containers.Vectors(Positive,T); + + V : Vectors_Of_T.Vector; +end Q; +@end example + +But the following example is legal: + +@example +with Ada.Containers.Vectors; + +procedure P is + type T is record + I : Integer; + end record; + + V : Ada.Containers.Vectors(Positive,T).Vector; +end; +@end example + +because the structural instance @code{Ada.Containers.Vectors(Positive,T)} is +not a library unit. + +The first example can be rewritten in a less verbose manner: + +@example +with Ada.Containers.Vectors; use Ada.Containers.Vectors(Positive,Integer); + +procedure P is + V : Vector; + +begin + V.Append (1); + V.Append (0); + Generic_Sorting("<").Sort (V); +end; +@end example + +Another example, which additionally uses the inference of dependent types: + +@example +with Ada.Unchecked_Deallocation; + +procedure P is + + type Integer_Access is access all Integer; + + A : Integer_Access := new Integer'(1); + +begin + Ada.Unchecked_Deallocation(Name => Integer_Access) (A); +end; +@end example + @node Security Hardening Features,Obsolescent Features,GNAT language extensions,Top -@anchor{gnat_rm/security_hardening_features doc}@anchor{474}@anchor{gnat_rm/security_hardening_features id1}@anchor{475}@anchor{gnat_rm/security_hardening_features security-hardening-features}@anchor{15} +@anchor{gnat_rm/security_hardening_features doc}@anchor{47d}@anchor{gnat_rm/security_hardening_features id1}@anchor{47e}@anchor{gnat_rm/security_hardening_features security-hardening-features}@anchor{15} @chapter Security Hardening Features @@ -32689,6 +33090,8 @@ are provided by GNAT. The features in this chapter are currently experimental and subject to change. +These features are supported only by the GCC back end, not by LLVM. + @c Register Scrubbing: @menu @@ -32701,7 +33104,7 @@ change. @end menu @node Register Scrubbing,Stack Scrubbing,,Security Hardening Features -@anchor{gnat_rm/security_hardening_features register-scrubbing}@anchor{476} +@anchor{gnat_rm/security_hardening_features register-scrubbing}@anchor{47f} @section Register Scrubbing @@ -32737,7 +33140,7 @@ programming languages, see @cite{Using the GNU Compiler Collection (GCC)}. @c Stack Scrubbing: @node Stack Scrubbing,Hardened Conditionals,Register Scrubbing,Security Hardening Features -@anchor{gnat_rm/security_hardening_features stack-scrubbing}@anchor{477} +@anchor{gnat_rm/security_hardening_features stack-scrubbing}@anchor{480} @section Stack Scrubbing @@ -32881,7 +33284,7 @@ Bar_Callable_Ptr. @c Hardened Conditionals: @node Hardened Conditionals,Hardened Booleans,Stack Scrubbing,Security Hardening Features -@anchor{gnat_rm/security_hardening_features hardened-conditionals}@anchor{478} +@anchor{gnat_rm/security_hardening_features hardened-conditionals}@anchor{481} @section Hardened Conditionals @@ -32971,7 +33374,7 @@ be used with other programming languages supported by GCC. @c Hardened Booleans: @node Hardened Booleans,Control Flow Redundancy,Hardened Conditionals,Security Hardening Features -@anchor{gnat_rm/security_hardening_features hardened-booleans}@anchor{479} +@anchor{gnat_rm/security_hardening_features hardened-booleans}@anchor{482} @section Hardened Booleans @@ -33032,7 +33435,7 @@ and more details on that attribute, see @cite{Using the GNU Compiler Collection @c Control Flow Redundancy: @node Control Flow Redundancy,,Hardened Booleans,Security Hardening Features -@anchor{gnat_rm/security_hardening_features control-flow-redundancy}@anchor{47a} +@anchor{gnat_rm/security_hardening_features control-flow-redundancy}@anchor{483} @section Control Flow Redundancy @@ -33200,16 +33603,17 @@ see @cite{Using the GNU Compiler Collection (GCC)}. These options can be used with other programming languages supported by GCC. @node Obsolescent Features,Compatibility and Porting Guide,Security Hardening Features,Top -@anchor{gnat_rm/obsolescent_features doc}@anchor{47b}@anchor{gnat_rm/obsolescent_features id1}@anchor{47c}@anchor{gnat_rm/obsolescent_features obsolescent-features}@anchor{16} +@anchor{gnat_rm/obsolescent_features doc}@anchor{484}@anchor{gnat_rm/obsolescent_features id1}@anchor{485}@anchor{gnat_rm/obsolescent_features obsolescent-features}@anchor{16} @chapter Obsolescent Features This chapter describes features that are provided by GNAT, but are -considered obsolescent since there are preferred ways of achieving -the same effect. These features are provided solely for historical -compatibility purposes. +considered obsolescent since there are other, more appropriate, ways +of achieving the same effect. These features are provided solely for +historical compatibility purposes. @menu +* PolyORB:: * pragma No_Run_Time:: * pragma Ravenscar:: * pragma Restricted_Run_Time:: @@ -33218,8 +33622,18 @@ compatibility purposes. @end menu -@node pragma No_Run_Time,pragma Ravenscar,,Obsolescent Features -@anchor{gnat_rm/obsolescent_features id2}@anchor{47d}@anchor{gnat_rm/obsolescent_features pragma-no-run-time}@anchor{47e} +@node PolyORB,pragma No_Run_Time,,Obsolescent Features +@anchor{gnat_rm/obsolescent_features id2}@anchor{486}@anchor{gnat_rm/obsolescent_features polyorb}@anchor{271} +@section PolyORB + + +AWS is a deprecated product. It will be baselined with the GNAT Pro +release 28. After this release, there will be no new versions of this +product. Contact your sales representative or send a message to +@email{sales@@adacore.com} to get recommendations for replacements. + +@node pragma No_Run_Time,pragma Ravenscar,PolyORB,Obsolescent Features +@anchor{gnat_rm/obsolescent_features id3}@anchor{487}@anchor{gnat_rm/obsolescent_features pragma-no-run-time}@anchor{488} @section pragma No_Run_Time @@ -33232,7 +33646,7 @@ preferred usage is to use an appropriately configured run-time that includes just those features that are to be made accessible. @node pragma Ravenscar,pragma Restricted_Run_Time,pragma No_Run_Time,Obsolescent Features -@anchor{gnat_rm/obsolescent_features id3}@anchor{47f}@anchor{gnat_rm/obsolescent_features pragma-ravenscar}@anchor{480} +@anchor{gnat_rm/obsolescent_features id4}@anchor{489}@anchor{gnat_rm/obsolescent_features pragma-ravenscar}@anchor{48a} @section pragma Ravenscar @@ -33241,7 +33655,7 @@ The pragma @code{Ravenscar} has exactly the same effect as pragma is part of the new Ada 2005 standard. @node pragma Restricted_Run_Time,pragma Task_Info,pragma Ravenscar,Obsolescent Features -@anchor{gnat_rm/obsolescent_features id4}@anchor{481}@anchor{gnat_rm/obsolescent_features pragma-restricted-run-time}@anchor{482} +@anchor{gnat_rm/obsolescent_features id5}@anchor{48b}@anchor{gnat_rm/obsolescent_features pragma-restricted-run-time}@anchor{48c} @section pragma Restricted_Run_Time @@ -33251,7 +33665,7 @@ preferred since the Ada 2005 pragma @code{Profile} is intended for this kind of implementation dependent addition. @node pragma Task_Info,package System Task_Info s-tasinf ads,pragma Restricted_Run_Time,Obsolescent Features -@anchor{gnat_rm/obsolescent_features id5}@anchor{483}@anchor{gnat_rm/obsolescent_features pragma-task-info}@anchor{484} +@anchor{gnat_rm/obsolescent_features id6}@anchor{48d}@anchor{gnat_rm/obsolescent_features pragma-task-info}@anchor{48e} @section pragma Task_Info @@ -33277,7 +33691,7 @@ in the spec of package System.Task_Info in the runtime library. @node package System Task_Info s-tasinf ads,,pragma Task_Info,Obsolescent Features -@anchor{gnat_rm/obsolescent_features package-system-task-info}@anchor{485}@anchor{gnat_rm/obsolescent_features package-system-task-info-s-tasinf-ads}@anchor{486} +@anchor{gnat_rm/obsolescent_features package-system-task-info}@anchor{48f}@anchor{gnat_rm/obsolescent_features package-system-task-info-s-tasinf-ads}@anchor{490} @section package System.Task_Info (@code{s-tasinf.ads}) @@ -33287,7 +33701,7 @@ to support the @code{Task_Info} pragma. The predefined Ada package standard replacement for GNAT’s @code{Task_Info} functionality. @node Compatibility and Porting Guide,GNU Free Documentation License,Obsolescent Features,Top -@anchor{gnat_rm/compatibility_and_porting_guide doc}@anchor{487}@anchor{gnat_rm/compatibility_and_porting_guide compatibility-and-porting-guide}@anchor{17}@anchor{gnat_rm/compatibility_and_porting_guide id1}@anchor{488} +@anchor{gnat_rm/compatibility_and_porting_guide doc}@anchor{491}@anchor{gnat_rm/compatibility_and_porting_guide compatibility-and-porting-guide}@anchor{17}@anchor{gnat_rm/compatibility_and_porting_guide id1}@anchor{492} @chapter Compatibility and Porting Guide @@ -33309,7 +33723,7 @@ applications developed in other Ada environments. @end menu @node Writing Portable Fixed-Point Declarations,Compatibility with Ada 83,,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide id2}@anchor{489}@anchor{gnat_rm/compatibility_and_porting_guide writing-portable-fixed-point-declarations}@anchor{48a} +@anchor{gnat_rm/compatibility_and_porting_guide id2}@anchor{493}@anchor{gnat_rm/compatibility_and_porting_guide writing-portable-fixed-point-declarations}@anchor{494} @section Writing Portable Fixed-Point Declarations @@ -33431,7 +33845,7 @@ If you follow this scheme you will be guaranteed that your fixed-point types will be portable. @node Compatibility with Ada 83,Compatibility between Ada 95 and Ada 2005,Writing Portable Fixed-Point Declarations,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-ada-83}@anchor{48b}@anchor{gnat_rm/compatibility_and_porting_guide id3}@anchor{48c} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-ada-83}@anchor{495}@anchor{gnat_rm/compatibility_and_porting_guide id3}@anchor{496} @section Compatibility with Ada 83 @@ -33459,7 +33873,7 @@ following subsections treat the most likely issues to be encountered. @end menu @node Legal Ada 83 programs that are illegal in Ada 95,More deterministic semantics,,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide id4}@anchor{48d}@anchor{gnat_rm/compatibility_and_porting_guide legal-ada-83-programs-that-are-illegal-in-ada-95}@anchor{48e} +@anchor{gnat_rm/compatibility_and_porting_guide id4}@anchor{497}@anchor{gnat_rm/compatibility_and_porting_guide legal-ada-83-programs-that-are-illegal-in-ada-95}@anchor{498} @subsection Legal Ada 83 programs that are illegal in Ada 95 @@ -33559,7 +33973,7 @@ the fix is usually simply to add the @code{(<>)} to the generic declaration. @end itemize @node More deterministic semantics,Changed semantics,Legal Ada 83 programs that are illegal in Ada 95,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide id5}@anchor{48f}@anchor{gnat_rm/compatibility_and_porting_guide more-deterministic-semantics}@anchor{490} +@anchor{gnat_rm/compatibility_and_porting_guide id5}@anchor{499}@anchor{gnat_rm/compatibility_and_porting_guide more-deterministic-semantics}@anchor{49a} @subsection More deterministic semantics @@ -33587,7 +34001,7 @@ which open select branches are executed. @end itemize @node Changed semantics,Other language compatibility issues,More deterministic semantics,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide changed-semantics}@anchor{491}@anchor{gnat_rm/compatibility_and_porting_guide id6}@anchor{492} +@anchor{gnat_rm/compatibility_and_porting_guide changed-semantics}@anchor{49b}@anchor{gnat_rm/compatibility_and_porting_guide id6}@anchor{49c} @subsection Changed semantics @@ -33629,7 +34043,7 @@ covers only the restricted range. @end itemize @node Other language compatibility issues,,Changed semantics,Compatibility with Ada 83 -@anchor{gnat_rm/compatibility_and_porting_guide id7}@anchor{493}@anchor{gnat_rm/compatibility_and_porting_guide other-language-compatibility-issues}@anchor{494} +@anchor{gnat_rm/compatibility_and_porting_guide id7}@anchor{49d}@anchor{gnat_rm/compatibility_and_porting_guide other-language-compatibility-issues}@anchor{49e} @subsection Other language compatibility issues @@ -33662,7 +34076,7 @@ include @code{pragma Interface} and the floating point type attributes @end itemize @node Compatibility between Ada 95 and Ada 2005,Implementation-dependent characteristics,Compatibility with Ada 83,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-between-ada-95-and-ada-2005}@anchor{495}@anchor{gnat_rm/compatibility_and_porting_guide id8}@anchor{496} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-between-ada-95-and-ada-2005}@anchor{49f}@anchor{gnat_rm/compatibility_and_porting_guide id8}@anchor{4a0} @section Compatibility between Ada 95 and Ada 2005 @@ -33734,7 +34148,7 @@ can declare a function returning a value from an anonymous access type. @end itemize @node Implementation-dependent characteristics,Compatibility with Other Ada Systems,Compatibility between Ada 95 and Ada 2005,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide id9}@anchor{497}@anchor{gnat_rm/compatibility_and_porting_guide implementation-dependent-characteristics}@anchor{498} +@anchor{gnat_rm/compatibility_and_porting_guide id9}@anchor{4a1}@anchor{gnat_rm/compatibility_and_porting_guide implementation-dependent-characteristics}@anchor{4a2} @section Implementation-dependent characteristics @@ -33757,7 +34171,7 @@ transition from certain Ada 83 compilers. @end menu @node Implementation-defined pragmas,Implementation-defined attributes,,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide id10}@anchor{499}@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-pragmas}@anchor{49a} +@anchor{gnat_rm/compatibility_and_porting_guide id10}@anchor{4a3}@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-pragmas}@anchor{4a4} @subsection Implementation-defined pragmas @@ -33779,7 +34193,7 @@ avoiding compiler rejection of units that contain such pragmas; they are not relevant in a GNAT context and hence are not otherwise implemented. @node Implementation-defined attributes,Libraries,Implementation-defined pragmas,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide id11}@anchor{49b}@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-attributes}@anchor{49c} +@anchor{gnat_rm/compatibility_and_porting_guide id11}@anchor{4a5}@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-attributes}@anchor{4a6} @subsection Implementation-defined attributes @@ -33793,7 +34207,7 @@ Ada 83, GNAT supplies the attributes @code{Bit}, @code{Machine_Size} and @code{Type_Class}. @node Libraries,Elaboration order,Implementation-defined attributes,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide id12}@anchor{49d}@anchor{gnat_rm/compatibility_and_porting_guide libraries}@anchor{49e} +@anchor{gnat_rm/compatibility_and_porting_guide id12}@anchor{4a7}@anchor{gnat_rm/compatibility_and_porting_guide libraries}@anchor{4a8} @subsection Libraries @@ -33822,7 +34236,7 @@ be preferable to retrofit the application using modular types. @end itemize @node Elaboration order,Target-specific aspects,Libraries,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide elaboration-order}@anchor{49f}@anchor{gnat_rm/compatibility_and_porting_guide id13}@anchor{4a0} +@anchor{gnat_rm/compatibility_and_porting_guide elaboration-order}@anchor{4a9}@anchor{gnat_rm/compatibility_and_porting_guide id13}@anchor{4aa} @subsection Elaboration order @@ -33858,7 +34272,7 @@ pragmas either globally (as an effect of the `-gnatE' switch) or locally @end itemize @node Target-specific aspects,,Elaboration order,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide id14}@anchor{4a1}@anchor{gnat_rm/compatibility_and_porting_guide target-specific-aspects}@anchor{4a2} +@anchor{gnat_rm/compatibility_and_porting_guide id14}@anchor{4ab}@anchor{gnat_rm/compatibility_and_porting_guide target-specific-aspects}@anchor{4ac} @subsection Target-specific aspects @@ -33871,10 +34285,10 @@ on the robustness of the original design. Moreover, Ada 95 (and thus Ada 2005, Ada 2012, and Ada 2022) are sometimes incompatible with typical Ada 83 compiler practices regarding implicit packing, the meaning of the Size attribute, and the size of access values. -GNAT’s approach to these issues is described in @ref{4a3,,Representation Clauses}. +GNAT’s approach to these issues is described in @ref{4ad,,Representation Clauses}. @node Compatibility with Other Ada Systems,Representation Clauses,Implementation-dependent characteristics,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-other-ada-systems}@anchor{4a4}@anchor{gnat_rm/compatibility_and_porting_guide id15}@anchor{4a5} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-other-ada-systems}@anchor{4ae}@anchor{gnat_rm/compatibility_and_porting_guide id15}@anchor{4af} @section Compatibility with Other Ada Systems @@ -33917,7 +34331,7 @@ far beyond this minimal set, as described in the next section. @end itemize @node Representation Clauses,Compatibility with HP Ada 83,Compatibility with Other Ada Systems,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide id16}@anchor{4a6}@anchor{gnat_rm/compatibility_and_porting_guide representation-clauses}@anchor{4a3} +@anchor{gnat_rm/compatibility_and_porting_guide id16}@anchor{4b0}@anchor{gnat_rm/compatibility_and_porting_guide representation-clauses}@anchor{4ad} @section Representation Clauses @@ -34010,7 +34424,7 @@ with thin pointers. @end itemize @node Compatibility with HP Ada 83,,Representation Clauses,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-hp-ada-83}@anchor{4a7}@anchor{gnat_rm/compatibility_and_porting_guide id17}@anchor{4a8} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-hp-ada-83}@anchor{4b1}@anchor{gnat_rm/compatibility_and_porting_guide id17}@anchor{4b2} @section Compatibility with HP Ada 83 @@ -34040,7 +34454,7 @@ extension of package System. @end itemize @node GNU Free Documentation License,Index,Compatibility and Porting Guide,Top -@anchor{share/gnu_free_documentation_license doc}@anchor{4a9}@anchor{share/gnu_free_documentation_license gnu-fdl}@anchor{1}@anchor{share/gnu_free_documentation_license gnu-free-documentation-license}@anchor{4aa} +@anchor{share/gnu_free_documentation_license doc}@anchor{4b3}@anchor{share/gnu_free_documentation_license gnu-fdl}@anchor{1}@anchor{share/gnu_free_documentation_license gnu-free-documentation-license}@anchor{4b4} @chapter GNU Free Documentation License diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 7b3175e3d279..86b2cbc5d3f7 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -19,7 +19,7 @@ @copying @quotation -GNAT User's Guide for Native Platforms , Jun 27, 2025 +GNAT User's Guide for Native Platforms , Oct 06, 2025 AdaCore @@ -4628,6 +4628,23 @@ don’t specify a value, the symbol is defined to be @code{True}. You can use this switch instead of providing a definition file. @end table +@geindex -e (gnatprep) + + +@table @asis + +@item @code{-e} + +Causes both preprocessor lines and the lines deleted by +preprocessing to be replaced by empty comment lines marked +with @code{"--!"} (and no other text) in the output source file, +preserving line numbers in the output file. This option can +be useful as an alternative to @code{-b} and @code{-c} +when compilation style switches like @code{-gnatyu} or +@code{-gnatyM} are used (to avoid warnings about multiple +blank lines or lines too long). +@end table + @geindex -r (gnatprep) @@ -5023,7 +5040,7 @@ Finally, switches similar to those of @code{gnatprep} may optionally appear: Causes both preprocessor lines and the lines deleted by preprocessing to be replaced by blank lines, preserving the line number. This switch is always implied; however, if specified after @code{-c} -it cancels the effect of @code{-c}. +or @code{-e} it cancels the effect of those switches. @item @code{-c} @@ -5041,6 +5058,12 @@ literal string, an Ada identifier or any Ada reserved word. A symbol declared with this switch replaces a symbol with the same name defined in a definition file. +@item @code{-e} + +Causes both preprocessor lines and the lines deleted by +preprocessing to be replaced by empty comment lines marked +with ‘@cite{–!}’ (and no other text) in the output source file, + @item @code{-s} Causes a sorted list of symbol names and values to be @@ -5088,14 +5111,25 @@ symbol with the same name either in a definition file or specified with a switch @code{-D} in the preprocessor data file. This switch is similar to switch @code{-D} of @code{gnatprep}. +@end table + +@geindex -gnateG (gcc) -@item @code{-gnateG} + +@table @asis + +@item @code{-gnateG[bce]} When integrated preprocessing is performed on source file @code{filename.extension}, create or overwrite @code{filename.extension.prep} to contain the result of the preprocessing. For example if the source file is @code{foo.adb} then the output file is @code{foo.adb.prep}. +An optional character (b, c, or e) can be appended to indicate that filtered +lines are to be replaced by blank lines, comments, or empty comments (see +documentation above about @code{-b}, @code{-c}, and @code{-e}). +If one of those switches is given in a preprocessor data file, then it +will override any option included with @code{-gnateG}. @end table @node Mixed Language Programming,GNAT and Other Compilation Models,Conditional Compilation,The GNAT Compilation Model @@ -9155,9 +9189,13 @@ information. @table @asis -@item @code{-gnateG} +@item @code{-gnateG[bce]} -Save result of preprocessing in a text file. +Save result of preprocessing in a text file. An optional character (b, c, +or e) can be appended to indicate that filtered lines are to be replaced by +blank lines, comment lines that include the filtered line, or empty comment +lines (”–!”), respectively. The default is to replace filtered lines with +blank lines. @end table @geindex -gnateH (gcc) @@ -9561,13 +9599,13 @@ see @ref{32,,Character Set Control}. Ignore representation clauses. When this switch is used, representation clauses are treated as comments. This is useful when initially porting code where you want to ignore rep clause -problems, and also for compiling foreign code (particularly -for use with ASIS). The representation clauses that are ignored -are: enumeration_representation_clause, record_representation_clause, -and attribute_definition_clause for the following attributes: -Address, Alignment, Bit_Order, Component_Size, Machine_Radix, -Object_Size, Scalar_Storage_Order, Size, Small, Stream_Size, -and Value_Size. Pragma Default_Scalar_Storage_Order is also ignored. +problems, and also for compiling foreign code. The representation +clauses that are ignored are: enumeration_representation_clause, +record_representation_clause, and attribute_definition_clause for the +following attributes: Address, Alignment, Bit_Order, Component_Size, +Machine_Radix, Object_Size, Scalar_Storage_Order, Size, Small, +Stream_Size, and Value_Size. +Pragma Default_Scalar_Storage_Order is also ignored. Note that this option should be used only for compiling – the code is likely to malfunction at run time. @end table @@ -12143,7 +12181,7 @@ is the current list of constructs regarded as redundant: Assignment of an item to itself. @item -Type conversion that converts an expression to its own type. +Type conversion that converts an expression to its own subtype. @item Use of the attribute @code{Base} where @code{typ'Base} is the same @@ -17653,20 +17691,18 @@ version of GNAT. @item @code{gprbuild} can detect and use GNAT LLVM when it is installed. -@code{gprbuild} uses the first applicable compiler on the executable -search path, including GNAT LLVM. An easy way to build with GNAT -LLVM is to make it available on the operating system’s search path -before any other Ada compiler (such as the GCC version of GNAT). To -avoid accidentally using a different compiler than the one you want -to use, we recommend generating an explicit toolchain configuration -file with @code{gprconfig} and using it with @code{gprbuild}; see the -`GPRbuild and GPR Companion Tools User’s Guide' for details. You -can determine from the first line of the @code{.ali} file -which version of GNAT built that file because it contains either -@code{GNAT} or @code{GNAT-LLVM}. - -You can also explicitly select GNAT LLVM in your existing GPR project -file by adding @code{for Toolchain_Name("Ada") use "GNAT_LLVM";} +@code{gprbuild} uses the first applicable compiler on the executable search +path, including GNAT LLVM. An easy way to build with GNAT LLVM is to make +it available on the operating system’s search path before any other Ada +compiler (such as the GCC version of GNAT). To avoid accidentally using a +different compiler than the one you want to use, we recommend explicitly +selecting GNAT LLVM in your existing GPR project file by adding +@code{for Toolchain_Name ("Ada") use "GNAT_LLVM";}. You can also +generate an explicit toolchain configuration file with @code{gprconfig} and +use it with @code{gprbuild}; see the `GPRbuild and GPR Companion Tools +User’s Guide' for details. You can determine from the first line of the +@code{.ali} file which version of GNAT built that file because it +contains either @code{GNAT} or @code{GNAT-LLVM}. @end itemize @@ -30297,8 +30333,8 @@ to permit their use in free software. @printindex ge -@anchor{d2}@w{ } @anchor{gnat_ugn/gnat_utility_programs switches-related-to-project-files}@w{ } +@anchor{d2}@w{ } @c %**end of body @bye diff --git a/gcc/ada/gnatchop.adb b/gcc/ada/gnatchop.adb index 8f9887eb5775..bc045e1fb7ae 100644 --- a/gcc/ada/gnatchop.adb +++ b/gcc/ada/gnatchop.adb @@ -36,6 +36,7 @@ with GNAT.OS_Lib; use GNAT.OS_Lib; with GNAT.Heap_Sort_G; with GNAT.Table; +with Osint; with Switch; use Switch; with Types; @@ -44,12 +45,9 @@ procedure Gnatchop is Config_File_Name : constant String_Access := new String'("gnat.adc"); -- The name of the file holding the GNAT configuration pragmas - Gcc : String_Access := new String'("gcc"); + Gcc : String_Access := null; -- May be modified by switch --GCC= - Gcc_Set : Boolean := False; - -- True if a switch --GCC= is used - Gnat_Cmd : String_Access; -- Command to execute the GNAT compiler @@ -222,12 +220,6 @@ procedure Gnatchop is Integer'Image (Maximum_File_Name_Length); - function Locate_Executable - (Program_Name : String; - Look_For_Prefix : Boolean := True) return String_Access; - -- Locate executable for given program name. This takes into account - -- the target-prefix of the current command, if Look_For_Prefix is True. - subtype EOL_Length is Natural range 0 .. 2; -- Possible lengths of end of line sequence @@ -492,76 +484,6 @@ procedure Gnatchop is Unit.Table (Sorted_Units.Table (U + 1)).File_Name.all; end Is_Duplicated; - ----------------------- - -- Locate_Executable -- - ----------------------- - - function Locate_Executable - (Program_Name : String; - Look_For_Prefix : Boolean := True) return String_Access - is - Gnatchop_Str : constant String := "gnatchop"; - Current_Command : constant String := Normalize_Pathname (Command_Name); - End_Of_Prefix : Natural; - Start_Of_Prefix : Positive; - Start_Of_Suffix : Positive; - Result : String_Access; - - begin - Start_Of_Prefix := Current_Command'First; - Start_Of_Suffix := Current_Command'Last + 1; - End_Of_Prefix := Start_Of_Prefix - 1; - - if Look_For_Prefix then - - -- Find Start_Of_Prefix - - for J in reverse Current_Command'Range loop - if Current_Command (J) = '/' or else - Current_Command (J) = Directory_Separator or else - Current_Command (J) = ':' - then - Start_Of_Prefix := J + 1; - exit; - end if; - end loop; - - -- Find End_Of_Prefix - - for J in Start_Of_Prefix .. - Current_Command'Last - Gnatchop_Str'Length + 1 - loop - if Current_Command (J .. J + Gnatchop_Str'Length - 1) = - Gnatchop_Str - then - End_Of_Prefix := J - 1; - exit; - end if; - end loop; - end if; - - if End_Of_Prefix > Current_Command'First then - Start_Of_Suffix := End_Of_Prefix + Gnatchop_Str'Length + 1; - end if; - - declare - Command : constant String := - Current_Command (Start_Of_Prefix .. End_Of_Prefix) - & Program_Name - & Current_Command (Start_Of_Suffix .. - Current_Command'Last); - begin - Result := Locate_Exec_On_Path (Command); - - if Result = null then - Error_Msg - (Command & ": installation problem, executable not found"); - end if; - end; - - return Result; - end Locate_Executable; - --------------- -- Parse_EOL -- --------------- @@ -1088,8 +1010,8 @@ procedure Gnatchop is exit; when '-' => - Gcc := new String'(Parameter); - Gcc_Set := True; + Free (Gcc); + Gcc := new String'(Parameter); when 'c' => Compilation_Mode := True; @@ -1767,9 +1689,13 @@ begin -- Check presence of required executables - Gnat_Cmd := Locate_Executable (Gcc.all, not Gcc_Set); + if Gcc = null then + Gcc := Osint.Program_Name ("gcc", "gnatchop"); + end if; + Gnat_Cmd := Locate_Exec_On_Path (Gcc.all); if Gnat_Cmd = null then + Error_Msg (Gcc.all & ": installation problem, executable not found"); goto No_Files_Written; end if; diff --git a/gcc/ada/gnatlink.adb b/gcc/ada/gnatlink.adb index 527aa7f9fc81..406147b9eb7a 100644 --- a/gcc/ada/gnatlink.adb +++ b/gcc/ada/gnatlink.adb @@ -266,6 +266,9 @@ procedure Gnatlink is function Index (S, Pattern : String) return Natural; -- Return the last occurrence of Pattern in S, or 0 if none + function Is_Prefix (S, Prefix : String) return Boolean; + -- Return whether Prefix is a strict prefix of S + procedure Search_Library_Path (Next_Line : String; Nfirst : Integer; @@ -395,6 +398,16 @@ procedure Gnatlink is return 0; end Index; + --------------- + -- Is_Prefix -- + --------------- + + function Is_Prefix (S, Prefix : String) return Boolean is + begin + return Prefix'Length < S'Length + and then S (S'First .. S'First + Prefix'Length - 1) = Prefix; + end Is_Prefix; + ------------------ -- Process_Args -- ------------------ @@ -1292,13 +1305,8 @@ procedure Gnatlink is else for J in reverse 1 .. Linker_Options.Last loop if Linker_Options.Table (J) /= null - and then - Linker_Options.Table (J)'Length - > Run_Path_Opt'Length - and then - Linker_Options.Table (J) - (1 .. Run_Path_Opt'Length) = - Run_Path_Opt + and then Is_Prefix + (Linker_Options.Table (J).all, Run_Path_Opt) then -- We have found an already specified -- run_path_option: we will add to this switch, @@ -1887,31 +1895,12 @@ begin Shared_Libgcc_Seen : Boolean := False; Static_Libgcc_Seen : Boolean := False; - function Is_Prefix - (Complete_String : String; Prefix : String) return Boolean; - -- Returns whether Prefix is a prefix of Complete_String - - --------------- - -- Is_Prefix -- - --------------- - - function Is_Prefix - (Complete_String : String; Prefix : String) return Boolean - is - S : String renames Complete_String; - P : String renames Prefix; - begin - return P'Length <= S'Length - and then S (S'First .. S'First + P'Length - 1) = P; - end Is_Prefix; - begin J := Linker_Options.First; while J <= Linker_Options.Last loop if Linker_Options.Table (J).all = "-Xlinker" and then J < Linker_Options.Last - and then Linker_Options.Table (J + 1)'Length > 8 - and then Linker_Options.Table (J + 1) (1 .. 8) = "--stack=" + and then Is_Prefix (Linker_Options.Table (J + 1).all, "--stack=") then if Stack_Op then Linker_Options.Table (J .. Linker_Options.Last - 2) := @@ -1956,12 +1945,8 @@ begin -- Here we just check for a canonical form that matches the -- pragma Linker_Options set in the NT runtime. - if Is_Prefix - (Complete_String => Linker_Options.Table (J).all, - Prefix => "-Xlinker --stack=") - or else Is_Prefix - (Complete_String => Linker_Options.Table (J).all, - Prefix => "-Wl,--stack=") + if Is_Prefix (Linker_Options.Table (J).all, "-Xlinker --stack=") + or else Is_Prefix (Linker_Options.Table (J).all, "-Wl,--stack=") then if Stack_Op then Linker_Options.Table (J .. Linker_Options.Last - 1) := diff --git a/gcc/ada/gprep.adb b/gcc/ada/gprep.adb index 98e0072401e2..f40c38d8b145 100644 --- a/gcc/ada/gprep.adb +++ b/gcc/ada/gprep.adb @@ -735,7 +735,7 @@ package body GPrep is loop begin - Switch := GNAT.Command_Line.Getopt ("D: a b c C r s T u v"); + Switch := GNAT.Command_Line.Getopt ("D: a b c C e r s T u v"); case Switch is when ASCII.NUL => @@ -755,6 +755,9 @@ package body GPrep is when 'c' => Opt.Comment_Deleted_Lines := True; + when 'e' => + Opt.Empty_Comment_Deleted_Lines := True; + when 'C' => Opt.Replace_In_Comments := True; @@ -831,6 +834,7 @@ package body GPrep is Write_Line (" -c Keep preprocessor lines as comments"); Write_Line (" -C Do symbol replacements within comments"); Write_Line (" -D Associate symbol with value"); + Write_Line (" -e Replace preprocessor lines by empty comment lines"); Write_Line (" -r Generate Source_Reference pragma"); Write_Line (" -s Print a sorted list of symbol names and values"); Write_Line (" -T Use LF as line terminators"); diff --git a/gcc/ada/impunit.adb b/gcc/ada/impunit.adb index edb04a20f418..712d46c54abb 100644 --- a/gcc/ada/impunit.adb +++ b/gcc/ada/impunit.adb @@ -250,6 +250,7 @@ package body Impunit is ("g-busorg", F), -- GNAT.Bubble_Sort_G ("g-byorma", F), -- GNAT.Byte_Order_Mark ("g-bytswa", F), -- GNAT.Byte_Swapping + ("g-c_time", F), -- GNAT.C_Time ("g-calend", F), -- GNAT.Calendar ("g-catiio", F), -- GNAT.Calendar.Time_IO ("g-casuti", F), -- GNAT.Case_Util diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index 5e2f033b913d..9e60fa81de9e 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -151,7 +151,7 @@ package body Inline is function Node_Hash (Id : Node_Id) return Node_Header_Num; -- Simple hash function for Node_Ids - package To_Pending_Instantiations is new GNAT.Htable.Simple_HTable + package To_Pending_Instantiations is new GNAT.HTable.Simple_HTable (Header_Num => Node_Header_Num, Element => Int, No_Element => -1, @@ -1061,7 +1061,9 @@ package body Inline is E : constant Subprogram_Kind_Id := Inlined.Table (Index).Name; begin - if Is_Called (E) and then not Is_Ignored_Ghost_Entity (E) then + if Is_Called (E) + and then not Is_Ignored_Ghost_Entity_In_Codegen (E) + then Add_Inlined_Subprogram (E); end if; end; diff --git a/gcc/ada/layout.adb b/gcc/ada/layout.adb index 099ea49656d9..51facf6070da 100644 --- a/gcc/ada/layout.adb +++ b/gcc/ada/layout.adb @@ -248,13 +248,21 @@ package body Layout is end if; -- For access types, set size/alignment. This is system address size, - -- except for fat pointers (unconstrained array access types), where the - -- size is two times the address size, to accommodate the two pointers - -- that are required for a fat pointer (data and template). Note that - -- E_Access_Protected_Subprogram_Type is not an access type for this - -- purpose since it is not a pointer but is equivalent to a record. For - -- access subtypes, copy the size from the base type since Gigi - -- represents them the same way. + -- except for unconstrained array access types: + -- + -- - fat pointers where the size is two times the address size, to + -- accommodate the two pointers that are required for a fat pointer + -- (data and template). + -- + -- - extended access where the size is the size of an address (data + -- pointer) plus the size of the template. The template size can't be + -- computed yet (will be done in the code generator), leave it empty + -- for now. + -- + -- Note that E_Access_Protected_Subprogram_Type is not an access type + -- for this purpose since it is not a pointer but is equivalent to a + -- record. For access subtypes, copy the size from the base type since + -- the code generator represents them the same way. if Is_Access_Type (E) then Desig_Type := Underlying_Type (Designated_Type (E)); @@ -301,7 +309,9 @@ package body Layout is and then not Debug_Flag_6 then - Init_Size (E, 2 * System_Address_Size); + if not Is_Extended_Access_Type (E) then + Init_Size (E, 2 * System_Address_Size); + end if; -- Check for bad convention set @@ -326,7 +336,9 @@ package body Layout is N_Unconstrained_Array_Definition and then not Debug_Flag_6 then - Init_Size (E, 2 * System_Address_Size); + if not Is_Extended_Access_Type (E) then + Init_Size (E, 2 * System_Address_Size); + end if; -- If unnesting subprograms, subprogram access types contain the -- address of both the subprogram and an activation record. But if we diff --git a/gcc/ada/lib-xref.ads b/gcc/ada/lib-xref.ads index 6fc636794d38..b022b337c44e 100644 --- a/gcc/ada/lib-xref.ads +++ b/gcc/ada/lib-xref.ads @@ -445,6 +445,7 @@ package Lib.Xref is E_Anonymous_Access_Type => ' ', E_Array_Subtype => 'A', E_Array_Type => 'A', + E_Assertion_Level => 'z', E_Block => 'q', E_Class_Wide_Subtype => 'C', E_Class_Wide_Type => 'C', @@ -547,7 +548,7 @@ package Lib.Xref is -- w protected object protected type -- x abstract procedure exception -- y abstract function entry or entry family - -- z generic formal parameter (unused) + -- z generic formal parameter assertion level --------------------------------------------------- -- Handling of Imported and Exported Subprograms -- diff --git a/gcc/ada/lib.ads b/gcc/ada/lib.ads index 928f6f840c87..f5c6571ced32 100644 --- a/gcc/ada/lib.ads +++ b/gcc/ada/lib.ads @@ -901,7 +901,7 @@ private function Unit_Name_Hash (Id : Unit_Name_Type) return Unit_Name_Header_Num; -- Simple hash function for Unit_Name_Types - package Unit_Names is new GNAT.Htable.Simple_HTable + package Unit_Names is new GNAT.HTable.Simple_HTable (Header_Num => Unit_Name_Header_Num, Element => Unit_Number_Type, No_Element => No_Unit, diff --git a/gcc/ada/libgnarl/a-exetim__posix.adb b/gcc/ada/libgnarl/a-exetim__posix.adb index ee27ff29f156..a57689e0847d 100644 --- a/gcc/ada/libgnarl/a-exetim__posix.adb +++ b/gcc/ada/libgnarl/a-exetim__posix.adb @@ -34,8 +34,9 @@ with Ada.Task_Identification; use Ada.Task_Identification; with Ada.Unchecked_Conversion; -with System.Tasking; +with System.C_Time; with System.OS_Interface; use System.OS_Interface; +with System.Tasking; with System.Task_Primitives.Operations; use System.Task_Primitives.Operations; with Interfaces.C; use Interfaces.C; @@ -98,7 +99,7 @@ package body Ada.Execution_Time is (T : Ada.Task_Identification.Task_Id := Ada.Task_Identification.Current_Task) return CPU_Time is - TS : aliased timespec; + TS : aliased System.C_Time.timespec; Clock_Id : aliased Interfaces.C.int; Result : Interfaces.C.int; @@ -112,7 +113,7 @@ package body Ada.Execution_Time is function clock_gettime (clock_id : Interfaces.C.int; - tp : access timespec) + tp : access System.C_Time.timespec) return Interfaces.C.int; pragma Import (C, clock_gettime, "clock_gettime"); -- Function from the POSIX.1b Realtime Extensions library @@ -139,7 +140,7 @@ package body Ada.Execution_Time is (clock_id => Clock_Id, tp => TS'Unchecked_Access); pragma Assert (Result = 0); - return To_CPU_Time (To_Duration (TS)); + return To_CPU_Time (System.C_Time.To_Duration (TS)); end Clock; -------------------------- diff --git a/gcc/ada/libgnarl/a-intnam__bsd.ads b/gcc/ada/libgnarl/a-intnam__bsd.ads index 767f54e64cc2..a9fbf0eec9e9 100644 --- a/gcc/ada/libgnarl/a-intnam__bsd.ads +++ b/gcc/ada/libgnarl/a-intnam__bsd.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1991-2024, Free Software Foundation, Inc. -- +-- Copyright (C) 1991-2025, 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- -- diff --git a/gcc/ada/libgnarl/s-linux.ads b/gcc/ada/libgnarl/s-linux.ads index 62176f1bd968..f41a67bd8a3a 100644 --- a/gcc/ada/libgnarl/s-linux.ads +++ b/gcc/ada/libgnarl/s-linux.ads @@ -36,7 +36,6 @@ -- Preelaborate. This package is designed to be a bottom-level (leaf) package with Interfaces.C; -with System.Parameters; package System.Linux is pragma Preelaborate; @@ -45,24 +44,8 @@ package System.Linux is -- Time -- ---------- - subtype long is Interfaces.C.long; - subtype suseconds_t is Interfaces.C.long; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; subtype clockid_t is Interfaces.C.int; - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - - type timeval is record - tv_sec : time_t; - tv_usec : suseconds_t; - end record; - pragma Convention (C, timeval); - ----------- -- Errno -- ----------- diff --git a/gcc/ada/libgnarl/s-linux__alpha.ads b/gcc/ada/libgnarl/s-linux__alpha.ads index 855e6672e365..c05b90c04cb7 100644 --- a/gcc/ada/libgnarl/s-linux__alpha.ads +++ b/gcc/ada/libgnarl/s-linux__alpha.ads @@ -36,7 +36,6 @@ -- Preelaborate. This package is designed to be a bottom-level (leaf) package. with Interfaces.C; -with System.Parameters; package System.Linux is pragma Preelaborate; @@ -45,24 +44,8 @@ package System.Linux is -- Time -- ---------- - subtype long is Interfaces.C.long; - subtype suseconds_t is Interfaces.C.long; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; subtype clockid_t is Interfaces.C.int; - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - - type timeval is record - tv_sec : time_t; - tv_usec : suseconds_t; - end record; - pragma Convention (C, timeval); - ----------- -- Errno -- ----------- diff --git a/gcc/ada/libgnarl/s-linux__android-aarch64.ads b/gcc/ada/libgnarl/s-linux__android-aarch64.ads index 537c46b5d3cc..c7a69fa29c01 100644 --- a/gcc/ada/libgnarl/s-linux__android-aarch64.ads +++ b/gcc/ada/libgnarl/s-linux__android-aarch64.ads @@ -36,7 +36,6 @@ -- Preelaborate. This package is designed to be a bottom-level (leaf) package with Interfaces.C; -with System.Parameters; package System.Linux is pragma Preelaborate; @@ -45,24 +44,8 @@ package System.Linux is -- Time -- ---------- - subtype long is Interfaces.C.long; - subtype suseconds_t is Interfaces.C.long; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; subtype clockid_t is Interfaces.C.int; - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - - type timeval is record - tv_sec : time_t; - tv_usec : suseconds_t; - end record; - pragma Convention (C, timeval); - ----------- -- Errno -- ----------- diff --git a/gcc/ada/libgnarl/s-linux__android-arm.ads b/gcc/ada/libgnarl/s-linux__android-arm.ads index 07bca55f6c47..fdc14c387fb9 100644 --- a/gcc/ada/libgnarl/s-linux__android-arm.ads +++ b/gcc/ada/libgnarl/s-linux__android-arm.ads @@ -36,7 +36,6 @@ -- Preelaborate. This package is designed to be a bottom-level (leaf) package with Interfaces.C; -with System.Parameters; package System.Linux is pragma Preelaborate; @@ -45,24 +44,8 @@ package System.Linux is -- Time -- ---------- - subtype long is Interfaces.C.long; - subtype suseconds_t is Interfaces.C.long; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; subtype clockid_t is Interfaces.C.int; - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - - type timeval is record - tv_sec : time_t; - tv_usec : suseconds_t; - end record; - pragma Convention (C, timeval); - ----------- -- Errno -- ----------- diff --git a/gcc/ada/libgnarl/s-linux__hppa.ads b/gcc/ada/libgnarl/s-linux__hppa.ads index a3ce02bcb6e7..e249846cd302 100644 --- a/gcc/ada/libgnarl/s-linux__hppa.ads +++ b/gcc/ada/libgnarl/s-linux__hppa.ads @@ -36,7 +36,6 @@ -- Preelaborate. This package is designed to be a bottom-level (leaf) package. with Interfaces.C; -with System.Parameters; package System.Linux is pragma Preelaborate; @@ -45,24 +44,8 @@ package System.Linux is -- Time -- ---------- - subtype long is Interfaces.C.long; - subtype suseconds_t is Interfaces.C.long; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; subtype clockid_t is Interfaces.C.int; - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - - type timeval is record - tv_sec : time_t; - tv_usec : suseconds_t; - end record; - pragma Convention (C, timeval); - ----------- -- Errno -- ----------- diff --git a/gcc/ada/libgnarl/s-linux__loongarch.ads b/gcc/ada/libgnarl/s-linux__loongarch.ads index e0eaaa47e71d..20e3d909c0e0 100644 --- a/gcc/ada/libgnarl/s-linux__loongarch.ads +++ b/gcc/ada/libgnarl/s-linux__loongarch.ads @@ -35,7 +35,6 @@ -- Preelaborate. This package is designed to be a bottom-level (leaf) package with Interfaces.C; -with System.Parameters; package System.Linux is pragma Preelaborate; @@ -44,25 +43,8 @@ package System.Linux is -- Time -- ---------- - subtype int is Interfaces.C.int; - subtype long is Interfaces.C.long; - subtype suseconds_t is Interfaces.C.long; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; subtype clockid_t is Interfaces.C.int; - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - - type timeval is record - tv_sec : time_t; - tv_usec : suseconds_t; - end record; - pragma Convention (C, timeval); - ----------- -- Errno -- ----------- diff --git a/gcc/ada/libgnarl/s-linux__mips.ads b/gcc/ada/libgnarl/s-linux__mips.ads index 3ad7f45379eb..6a575c7a865e 100644 --- a/gcc/ada/libgnarl/s-linux__mips.ads +++ b/gcc/ada/libgnarl/s-linux__mips.ads @@ -35,7 +35,6 @@ -- Preelaborate. This package is designed to be a bottom-level (leaf) package with Interfaces.C; -with System.Parameters; package System.Linux is pragma Preelaborate; @@ -44,25 +43,8 @@ package System.Linux is -- Time -- ---------- - subtype int is Interfaces.C.int; - subtype long is Interfaces.C.long; - subtype suseconds_t is Interfaces.C.long; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; subtype clockid_t is Interfaces.C.int; - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - - type timeval is record - tv_sec : time_t; - tv_usec : suseconds_t; - end record; - pragma Convention (C, timeval); - ----------- -- Errno -- ----------- @@ -125,8 +107,8 @@ package System.Linux is -- struct_sigaction offsets - sa_handler_pos : constant := int'Size / 8; - sa_mask_pos : constant := int'Size / 8 + + sa_handler_pos : constant := Interfaces.C.int'Size / 8; + sa_mask_pos : constant := Interfaces.C.int'Size / 8 + Standard'Address_Size / 8; sa_flags_pos : constant := 0; diff --git a/gcc/ada/libgnarl/s-linux__riscv.ads b/gcc/ada/libgnarl/s-linux__riscv.ads index 867cb1fa8070..ad0a07b8c506 100644 --- a/gcc/ada/libgnarl/s-linux__riscv.ads +++ b/gcc/ada/libgnarl/s-linux__riscv.ads @@ -35,7 +35,6 @@ -- Preelaborate. This package is designed to be a bottom-level (leaf) package with Interfaces.C; -with System.Parameters; package System.Linux is pragma Preelaborate; @@ -44,25 +43,8 @@ package System.Linux is -- Time -- ---------- - subtype int is Interfaces.C.int; - subtype long is Interfaces.C.long; - subtype suseconds_t is Interfaces.C.long; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; subtype clockid_t is Interfaces.C.int; - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - - type timeval is record - tv_sec : time_t; - tv_usec : suseconds_t; - end record; - pragma Convention (C, timeval); - ----------- -- Errno -- ----------- @@ -125,8 +107,8 @@ package System.Linux is -- struct_sigaction offsets sa_handler_pos : constant := 0; - sa_mask_pos : constant := long'Size / 8; - sa_flags_pos : constant := long'Size / 8 + 128; + sa_mask_pos : constant := Interfaces.C.long'Size / 8; + sa_flags_pos : constant := Interfaces.C.long'Size / 8 + 128; SA_SIGINFO : constant := 16#04#; SA_ONSTACK : constant := 16#08000000#; diff --git a/gcc/ada/libgnarl/s-linux__sparc.ads b/gcc/ada/libgnarl/s-linux__sparc.ads index 5ff201cf832c..037834617d72 100644 --- a/gcc/ada/libgnarl/s-linux__sparc.ads +++ b/gcc/ada/libgnarl/s-linux__sparc.ads @@ -36,7 +36,6 @@ -- Preelaborate. This package is designed to be a bottom-level (leaf) package with Interfaces.C; -with System.Parameters; package System.Linux is pragma Preelaborate; @@ -45,24 +44,8 @@ package System.Linux is -- Time -- ---------- - subtype long is Interfaces.C.long; - subtype suseconds_t is Interfaces.C.long; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; subtype clockid_t is Interfaces.C.int; - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - - type timeval is record - tv_sec : time_t; - tv_usec : suseconds_t; - end record; - pragma Convention (C, timeval); - ----------- -- Errno -- ----------- diff --git a/gcc/ada/libgnarl/s-linux__x32.ads b/gcc/ada/libgnarl/s-linux__x32.ads deleted file mode 100644 index 6144b8b34ce1..000000000000 --- a/gcc/ada/libgnarl/s-linux__x32.ads +++ /dev/null @@ -1,133 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS -- --- -- --- S Y S T E M . L I N U X -- --- -- --- S p e c -- --- -- --- Copyright (C) 2013-2025, 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 -- --- . -- --- -- --- -- ------------------------------------------------------------------------------- - --- This is the x32 version of this package - --- This package encapsulates cpu specific differences between implementations --- of GNU/Linux, in order to share s-osinte-linux.ads. - --- PLEASE DO NOT add any with-clauses to this package or remove the pragma --- Preelaborate. This package is designed to be a bottom-level (leaf) package - -with Interfaces.C; - -with System.Parameters; - -package System.Linux is - pragma Preelaborate; - - ---------- - -- Time -- - ---------- - - subtype suseconds_t is Long_Long_Integer; - -- Note that suseconds_t is 64 bits. - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - subtype clockid_t is Interfaces.C.int; - - type timespec is record - tv_sec : time_t; - tv_nsec : Long_Long_Integer; - -- Note that tv_nsec is 64 bits. - end record; - pragma Convention (C, timespec); - - type timeval is record - tv_sec : time_t; - tv_usec : suseconds_t; - end record; - pragma Convention (C, timeval); - - ----------- - -- Errno -- - ----------- - - EAGAIN : constant := 11; - EINTR : constant := 4; - EINVAL : constant := 22; - ENOMEM : constant := 12; - EPERM : constant := 1; - ETIMEDOUT : constant := 110; - - ------------- - -- Signals -- - ------------- - - SIGHUP : constant := 1; -- hangup - SIGINT : constant := 2; -- interrupt (rubout) - SIGQUIT : constant := 3; -- quit (ASCD FS) - SIGILL : constant := 4; -- illegal instruction (not reset) - SIGTRAP : constant := 5; -- trace trap (not reset) - SIGIOT : constant := 6; -- IOT instruction - SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future - SIGFPE : constant := 8; -- floating point exception - SIGKILL : constant := 9; -- kill (cannot be caught or ignored) - SIGBUS : constant := 7; -- bus error - SIGUSR1 : constant := 10; -- user defined signal 1 - SIGSEGV : constant := 11; -- segmentation violation - SIGUSR2 : constant := 12; -- user defined signal 2 - SIGPIPE : constant := 13; -- write on a pipe with no one to read it - SIGALRM : constant := 14; -- alarm clock - SIGTERM : constant := 15; -- software termination signal from kill - SIGSTKFLT : constant := 16; -- coprocessor stack fault (Linux) - SIGCLD : constant := 17; -- alias for SIGCHLD - SIGCHLD : constant := 17; -- child status change - SIGSTOP : constant := 19; -- stop (cannot be caught or ignored) - SIGTSTP : constant := 20; -- user stop requested from tty - SIGCONT : constant := 18; -- stopped process has been continued - SIGTTIN : constant := 21; -- background tty read attempted - SIGTTOU : constant := 22; -- background tty write attempted - SIGURG : constant := 23; -- urgent condition on IO channel - SIGXCPU : constant := 24; -- CPU time limit exceeded - SIGXFSZ : constant := 25; -- filesize limit exceeded - SIGVTALRM : constant := 26; -- virtual timer expired - SIGPROF : constant := 27; -- profiling timer expired - SIGWINCH : constant := 28; -- window size change - SIGPOLL : constant := 29; -- pollable event occurred - SIGIO : constant := 29; -- I/O now possible (4.2 BSD) - SIGLOST : constant := 29; -- File lock lost - SIGPWR : constant := 30; -- power-fail restart - SIGSYS : constant := 31; -- bad system call - SIGUNUSED : constant := 31; -- unused signal (mapped to SIGSYS) - SIG32 : constant := 32; -- glibc internal signal - SIG33 : constant := 33; -- glibc internal signal - SIG34 : constant := 34; -- glibc internal signal - - -- struct_sigaction offsets - - sa_handler_pos : constant := 0; - sa_mask_pos : constant := Standard'Address_Size / 8; - sa_flags_pos : constant := 128 + sa_mask_pos; - - SA_SIGINFO : constant := 16#04#; - SA_ONSTACK : constant := 16#08000000#; - -end System.Linux; diff --git a/gcc/ada/libgnarl/s-osinte__aix.adb b/gcc/ada/libgnarl/s-osinte__aix.adb index da057d47cf5b..3a2df424d91b 100644 --- a/gcc/ada/libgnarl/s-osinte__aix.adb +++ b/gcc/ada/libgnarl/s-osinte__aix.adb @@ -35,15 +35,6 @@ package body System.OS_Interface is use Interfaces.C; - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (TS : timespec) return Duration is - begin - return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; - end To_Duration; - ------------------------ -- To_Target_Priority -- ------------------------ @@ -72,29 +63,6 @@ package body System.OS_Interface is end if; end To_Target_Priority; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F is negative due to a round-up, adjust for positive F value - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return timespec'(tv_sec => S, - tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - ----------------- -- sched_yield -- ----------------- diff --git a/gcc/ada/libgnarl/s-osinte__aix.ads b/gcc/ada/libgnarl/s-osinte__aix.ads index 1e115b80d6fb..eb417a2cc999 100644 --- a/gcc/ada/libgnarl/s-osinte__aix.ads +++ b/gcc/ada/libgnarl/s-osinte__aix.ads @@ -43,8 +43,8 @@ with Ada.Unchecked_Conversion; with Interfaces.C; with Interfaces.C.Extensions; +with System.C_Time; with System.OS_Locks; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -200,26 +200,18 @@ package System.OS_Interface is Time_Slice_Supported : constant Boolean := True; -- Indicates whether time slicing is supported - type timespec is private; - type clockid_t is new long_long; function clock_gettime (clock_id : clockid_t; - tp : access timespec) return int; + tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); function clock_getres (clock_id : clockid_t; - res : access timespec) return int; + res : access C_Time.timespec) return int; pragma Import (C, clock_getres, "clock_getres"); - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - type struct_timezone is record tz_minuteswest : int; tz_dsttime : int; @@ -420,7 +412,7 @@ package System.OS_Interface is function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); -------------------------- @@ -543,15 +535,6 @@ private type pid_t is new int; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - type pthread_attr_t is new System.Address; pragma Convention (C, pthread_attr_t); -- typedef struct __pt_attr *pthread_attr_t; diff --git a/gcc/ada/libgnarl/s-osinte__android.ads b/gcc/ada/libgnarl/s-osinte__android.ads index 4383860ed2b1..bf774fc491af 100644 --- a/gcc/ada/libgnarl/s-osinte__android.ads +++ b/gcc/ada/libgnarl/s-osinte__android.ads @@ -42,10 +42,10 @@ with Ada.Unchecked_Conversion; with Interfaces.C; +with System.C_Time; with System.Linux; with System.OS_Constants; with System.OS_Locks; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -213,25 +213,17 @@ package System.OS_Interface is Time_Slice_Supported : constant Boolean := True; -- Indicates whether time slicing is supported - type timespec is private; - type clockid_t is new int; function clock_gettime - (clock_id : clockid_t; tp : access timespec) return int; + (clock_id : clockid_t; tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); function clock_getres (clock_id : clockid_t; - res : access timespec) return int; + res : access C_Time.timespec) return int; pragma Import (C, clock_getres, "clock_getres"); - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - function sysconf (name : int) return long; pragma Import (C, sysconf); @@ -463,7 +455,7 @@ package System.OS_Interface is function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); -------------------------- @@ -630,15 +622,6 @@ private type pid_t is new int; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - type unsigned_long_long_t is mod 2 ** 64; -- Local type only used to get the alignment of this type below diff --git a/gcc/ada/libgnarl/s-osinte__cheribsd.ads b/gcc/ada/libgnarl/s-osinte__cheribsd.ads index d9dae354d41e..350fa1f15ad9 100644 --- a/gcc/ada/libgnarl/s-osinte__cheribsd.ads +++ b/gcc/ada/libgnarl/s-osinte__cheribsd.ads @@ -44,8 +44,8 @@ with Ada.Unchecked_Conversion; with Interfaces; with Interfaces.C; +with System.C_Time; with System.OS_Locks; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -232,30 +232,22 @@ package System.OS_Interface is Time_Slice_Supported : constant Boolean := True; -- Indicates whether time slicing is supported (i.e SCHED_RR is supported) - type timespec is private; - - function nanosleep (rqtp, rmtp : access timespec) return int; + function nanosleep (rqtp, rmtp : access C_Time.timespec) return int; pragma Import (C, nanosleep, "nanosleep"); type clockid_t is new int; function clock_getres (clock_id : clockid_t; - res : access timespec) return int; + res : access C_Time.timespec) return int; pragma Import (C, clock_getres, "clock_getres"); function clock_gettime (clock_id : clockid_t; - tp : access timespec) + tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - type struct_timezone is record tz_minuteswest : int; tz_dsttime : int; @@ -463,7 +455,7 @@ package System.OS_Interface is function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); -------------------------- @@ -664,15 +656,6 @@ private Self_PID : constant pid_t := 0; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - ts_sec : time_t; - ts_nsec : long; - end record; - pragma Convention (C, timespec); - type pthread_t is new System.Address; type pthread_attr_t is new System.Address; type pthread_mutexattr_t is new System.Address; diff --git a/gcc/ada/libgnarl/s-osinte__darwin.adb b/gcc/ada/libgnarl/s-osinte__darwin.adb index f512210d3437..955db064b773 100644 --- a/gcc/ada/libgnarl/s-osinte__darwin.adb +++ b/gcc/ada/libgnarl/s-osinte__darwin.adb @@ -31,19 +31,9 @@ -- This is a Darwin Threads version of this package -with Interfaces.C.Extensions; +with Interfaces.C; use Interfaces.C; package body System.OS_Interface is - use Interfaces.C; - - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (TS : timespec) return Duration is - begin - return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; - end To_Duration; ------------------------ -- To_Target_Priority -- @@ -56,37 +46,13 @@ package body System.OS_Interface is return Interfaces.C.int (Prio); end To_Target_Priority; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - -- value. - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return timespec'(tv_sec => S, - tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - ------------------- -- clock_gettime -- ------------------- function clock_gettime (clock_id : clockid_t; - tp : access timespec) return int + tp : access C_Time.timespec) return int is pragma Unreferenced (clock_id); @@ -94,33 +60,18 @@ package body System.OS_Interface is use Interfaces; - type timeval is array (1 .. 3) of C.long; - -- The timeval array is sized to contain long_long sec and long usec. - -- If long_long'Size = long'Size then it will be overly large but that - -- won't effect the implementation since it's not accessed directly. - - procedure timeval_to_duration - (T : not null access timeval; - sec : not null access C.Extensions.long_long; - usec : not null access C.long); - pragma Import (C, timeval_to_duration, "__gnat_timeval_to_duration"); - - Micro : constant := 10**6; - sec : aliased C.Extensions.long_long; - usec : aliased C.long; - TV : aliased timeval; + TV : aliased C_Time.timeval; Result : int; function gettimeofday - (Tv : access timeval; + (Tv : access C_Time.timeval; Tz : System.Address := System.Null_Address) return int; pragma Import (C, gettimeofday, "gettimeofday"); begin Result := gettimeofday (TV'Access, System.Null_Address); pragma Assert (Result = 0); - timeval_to_duration (TV'Access, sec'Access, usec'Access); - tp.all := To_Timespec (Duration (sec) + Duration (usec) / Micro); + tp.all := C_Time.To_Timespec (TV); return Result; end clock_gettime; @@ -130,13 +81,12 @@ package body System.OS_Interface is function clock_getres (clock_id : clockid_t; - res : access timespec) return int + res : access C_Time.timespec) return int is pragma Unreferenced (clock_id); -- Darwin Threads don't have clock_getres. - Nano : constant := 10**9; nsec : int := 0; Result : int := -1; @@ -145,7 +95,7 @@ package body System.OS_Interface is begin nsec := clock_get_res; - res.all := To_Timespec (Duration (0.0) + Duration (nsec) / Nano); + res.all := C_Time.Nanoseconds_To_Timespec (nsec); if nsec > 0 then Result := 0; diff --git a/gcc/ada/libgnarl/s-osinte__darwin.ads b/gcc/ada/libgnarl/s-osinte__darwin.ads index ea62f24cbc0d..1b2a40b3cbe8 100644 --- a/gcc/ada/libgnarl/s-osinte__darwin.ads +++ b/gcc/ada/libgnarl/s-osinte__darwin.ads @@ -40,9 +40,9 @@ with Interfaces.C; +with System.C_Time; with System.OS_Constants; with System.OS_Locks; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -184,23 +184,15 @@ package System.OS_Interface is Time_Slice_Supported : constant Boolean := True; -- Indicates whether time slicing is supported - type timespec is private; - type clockid_t is new int; function clock_gettime (clock_id : clockid_t; - tp : access timespec) return int; + tp : access C_Time.timespec) return int; function clock_getres (clock_id : clockid_t; - res : access timespec) return int; - - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); + res : access C_Time.timespec) return int; ------------------------- -- Priority Scheduling -- @@ -397,7 +389,7 @@ package System.OS_Interface is function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); -------------------------- @@ -517,15 +509,6 @@ private type pid_t is new int32_t; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - -- -- Darwin specific signal implementation -- diff --git a/gcc/ada/libgnarl/s-osinte__dragonfly.adb b/gcc/ada/libgnarl/s-osinte__dragonfly.adb index 73061d9eeb0c..adfbaeb27fc7 100644 --- a/gcc/ada/libgnarl/s-osinte__dragonfly.adb +++ b/gcc/ada/libgnarl/s-osinte__dragonfly.adb @@ -69,15 +69,6 @@ package body System.OS_Interface is null; end pthread_init; - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (TS : timespec) return Duration is - begin - return Duration (TS.ts_sec) + Duration (TS.ts_nsec) / 10#1#E9; - end To_Duration; - ------------------------ -- To_Target_Priority -- ------------------------ @@ -89,28 +80,4 @@ package body System.OS_Interface is return Interfaces.C.int (Prio); end To_Target_Priority; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - -- value. - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return timespec'(ts_sec => S, - ts_nsec => long (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - end System.OS_Interface; diff --git a/gcc/ada/libgnarl/s-osinte__dragonfly.ads b/gcc/ada/libgnarl/s-osinte__dragonfly.ads index 00dc11de2745..9e7b88e3c6e9 100644 --- a/gcc/ada/libgnarl/s-osinte__dragonfly.ads +++ b/gcc/ada/libgnarl/s-osinte__dragonfly.ads @@ -43,8 +43,8 @@ with Ada.Unchecked_Conversion; with Interfaces.C; +with System.C_Time; with System.OS_Locks; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -198,30 +198,22 @@ package System.OS_Interface is Time_Slice_Supported : constant Boolean := True; -- Indicates whether time slicing is supported (i.e SCHED_RR is supported) - type timespec is private; - - function nanosleep (rqtp, rmtp : access timespec) return int; + function nanosleep (rqtp, rmtp : access C_Time.timespec) return int; pragma Import (C, nanosleep, "nanosleep"); type clockid_t is new unsigned_long; function clock_getres (clock_id : clockid_t; - res : access timespec) return int; + res : access C_Time.timespec) return int; pragma Import (C, clock_getres, "clock_getres"); function clock_gettime (clock_id : clockid_t; - tp : access timespec) + tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - type struct_timezone is record tz_minuteswest : int; tz_dsttime : int; @@ -432,7 +424,7 @@ package System.OS_Interface is function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); Relative_Timed_Wait : constant Boolean := False; @@ -636,15 +628,6 @@ private type pid_t is new int; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - ts_sec : time_t; - ts_nsec : long; - end record; - pragma Convention (C, timespec); - type pthread_t is new System.Address; type pthread_attr_t is new System.Address; type pthread_mutexattr_t is new System.Address; diff --git a/gcc/ada/libgnarl/s-osinte__freebsd.adb b/gcc/ada/libgnarl/s-osinte__freebsd.adb index a3240bb38d18..4516935bbc8e 100644 --- a/gcc/ada/libgnarl/s-osinte__freebsd.adb +++ b/gcc/ada/libgnarl/s-osinte__freebsd.adb @@ -69,15 +69,6 @@ package body System.OS_Interface is null; end pthread_init; - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (TS : timespec) return Duration is - begin - return Duration (TS.ts_sec) + Duration (TS.ts_nsec) / 10#1#E9; - end To_Duration; - ------------------------ -- To_Target_Priority -- ------------------------ @@ -89,27 +80,4 @@ package body System.OS_Interface is return Interfaces.C.int (Prio); end To_Target_Priority; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return timespec'(ts_sec => S, - ts_nsec => long (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - end System.OS_Interface; diff --git a/gcc/ada/libgnarl/s-osinte__freebsd.ads b/gcc/ada/libgnarl/s-osinte__freebsd.ads index b10270a4cc49..027f81d060bf 100644 --- a/gcc/ada/libgnarl/s-osinte__freebsd.ads +++ b/gcc/ada/libgnarl/s-osinte__freebsd.ads @@ -43,8 +43,8 @@ with Ada.Unchecked_Conversion; with Interfaces.C; +with System.C_Time; with System.OS_Locks; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -198,30 +198,22 @@ package System.OS_Interface is Time_Slice_Supported : constant Boolean := True; -- Indicates whether time slicing is supported (i.e SCHED_RR is supported) - type timespec is private; - - function nanosleep (rqtp, rmtp : access timespec) return int; + function nanosleep (rqtp, rmtp : access C_Time.timespec) return int; pragma Import (C, nanosleep, "nanosleep"); type clockid_t is new int; function clock_getres (clock_id : clockid_t; - res : access timespec) return int; + res : access C_Time.timespec) return int; pragma Import (C, clock_getres, "clock_getres"); function clock_gettime (clock_id : clockid_t; - tp : access timespec) + tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - type struct_timezone is record tz_minuteswest : int; tz_dsttime : int; @@ -431,7 +423,7 @@ package System.OS_Interface is function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); -------------------------- @@ -633,15 +625,6 @@ private type pid_t is new int; Self_PID : constant pid_t := 0; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - ts_sec : time_t; - ts_nsec : long; - end record; - pragma Convention (C, timespec); - type pthread_t is new System.Address; type pthread_attr_t is new System.Address; type pthread_mutexattr_t is new System.Address; diff --git a/gcc/ada/libgnarl/s-osinte__gnu.adb b/gcc/ada/libgnarl/s-osinte__gnu.adb index 675cd0d93990..2c70f0dea157 100644 --- a/gcc/ada/libgnarl/s-osinte__gnu.adb +++ b/gcc/ada/libgnarl/s-osinte__gnu.adb @@ -93,15 +93,6 @@ package body System.OS_Interface is return 0; end pthread_setschedparam; - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (TS : timespec) return Duration is - begin - return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; - end To_Duration; - ------------------------ -- To_Target_Priority -- ------------------------ @@ -113,28 +104,4 @@ package body System.OS_Interface is return Interfaces.C.int (Prio); end To_Target_Priority; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - -- value. - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return timespec'(tv_sec => S, - tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - end System.OS_Interface; diff --git a/gcc/ada/libgnarl/s-osinte__gnu.ads b/gcc/ada/libgnarl/s-osinte__gnu.ads index 870059d09670..18410c60415e 100644 --- a/gcc/ada/libgnarl/s-osinte__gnu.ads +++ b/gcc/ada/libgnarl/s-osinte__gnu.ads @@ -42,8 +42,8 @@ with Ada.Unchecked_Conversion; with Interfaces.C; +with System.C_Time; with System.OS_Locks; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -210,9 +210,7 @@ package System.OS_Interface is Time_Slice_Supported : constant Boolean := True; -- Indicates whether time slicing is supported (i.e SCHED_RR is supported) - type timespec is private; - - function nanosleep (rqtp, rmtp : access timespec) return int; + function nanosleep (rqtp, rmtp : access C_Time.timespec) return int; pragma Import (C, nanosleep, "nanosleep"); type clockid_t is new int; @@ -221,21 +219,15 @@ package System.OS_Interface is -- From: /usr/include/time.h function clock_gettime (clock_id : clockid_t; - tp : access timespec) + tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); function clock_getres (clock_id : clockid_t; - res : access timespec) return int; + res : access C_Time.timespec) return int; pragma Import (C, clock_getres, "clock_getres"); - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - -- From: /usr/include/unistd.h function sysconf (name : int) return long; pragma Import (C, sysconf); @@ -487,7 +479,7 @@ package System.OS_Interface is function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); Relative_Timed_Wait : constant Boolean := False; @@ -656,15 +648,6 @@ private type pid_t is new int; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - -- From: /usr/include/pthread/pthreadtypes.h: -- typedef struct __pthread_attr pthread_attr_t; -- /usr/include/i386-gnu/bits/thread-attr.h: struct __pthread_attr... diff --git a/gcc/ada/libgnarl/s-osinte__hpux.ads b/gcc/ada/libgnarl/s-osinte__hpux.ads index 9d0f26d50f70..60fab698113b 100644 --- a/gcc/ada/libgnarl/s-osinte__hpux.ads +++ b/gcc/ada/libgnarl/s-osinte__hpux.ads @@ -42,8 +42,8 @@ with Ada.Unchecked_Conversion; with Interfaces.C; +with System.C_Time; with System.OS_Locks; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -181,26 +181,18 @@ package System.OS_Interface is Time_Slice_Supported : constant Boolean := True; -- Indicates whether time slicing is supported - type timespec is private; - type clockid_t is new int; function clock_gettime (clock_id : clockid_t; - tp : access timespec) return int; + tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); function clock_getres (clock_id : clockid_t; - res : access timespec) return int; + res : access C_Time.timespec) return int; pragma Import (C, clock_getres, "clock_getres"); - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - type struct_timezone is record tz_minuteswest : int; tz_dsttime : int; @@ -400,7 +392,7 @@ package System.OS_Interface is function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); -------------------------- @@ -517,15 +509,6 @@ private type pid_t is new int; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - type pthread_attr_t is new int; type pthread_condattr_t is new int; type pthread_mutexattr_t is new int; diff --git a/gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads b/gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads index 9924659cce5d..fc6d7a992f19 100644 --- a/gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads +++ b/gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads @@ -42,8 +42,8 @@ with Ada.Unchecked_Conversion; with Interfaces.C; +with System.C_Time; with System.OS_Locks; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -205,9 +205,7 @@ package System.OS_Interface is Time_Slice_Supported : constant Boolean := True; -- Indicates whether time slicing is supported (i.e SCHED_RR is supported) - type timespec is private; - - function nanosleep (rqtp, rmtp : access timespec) return int; + function nanosleep (rqtp, rmtp : access C_Time.timespec) return int; pragma Import (C, nanosleep, "nanosleep"); type clockid_t is new int; @@ -215,21 +213,15 @@ package System.OS_Interface is function clock_gettime (clock_id : clockid_t; - tp : access timespec) + tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); function clock_getres (clock_id : clockid_t; - res : access timespec) return int; + res : access C_Time.timespec) return int; pragma Import (C, clock_getres, "clock_getres"); - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - function sysconf (name : int) return long; pragma Import (C, sysconf); @@ -430,7 +422,7 @@ package System.OS_Interface is function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); -------------------------- @@ -602,15 +594,6 @@ private type pid_t is new int; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - type pthread_attr_t is record detachstate : int; schedpolicy : int; diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads b/gcc/ada/libgnarl/s-osinte__linux.ads index 7aeb15da523b..2c6b353a5e0f 100644 --- a/gcc/ada/libgnarl/s-osinte__linux.ads +++ b/gcc/ada/libgnarl/s-osinte__linux.ads @@ -42,6 +42,7 @@ with Ada.Unchecked_Conversion; with Interfaces.C; +with System.C_Time; with System.Linux; with System.OS_Constants; with System.OS_Locks; @@ -54,8 +55,6 @@ package System.OS_Interface is pragma Linker_Options ("-lpthread"); - use type System.Linux.time_t; - subtype int is Interfaces.C.int; subtype char is Interfaces.C.char; subtype short is Interfaces.C.short; @@ -229,26 +228,17 @@ package System.OS_Interface is -- Time -- ---------- - subtype time_t is System.Linux.time_t; - subtype timespec is System.Linux.timespec; - subtype timeval is System.Linux.timeval; subtype clockid_t is System.Linux.clockid_t; function clock_gettime - (clock_id : clockid_t; tp : access timespec) return int; + (clock_id : clockid_t; tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); function clock_getres (clock_id : clockid_t; - res : access timespec) return int; + res : access C_Time.timespec) return int; pragma Import (C, clock_getres, "clock_getres"); - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - function sysconf (name : int) return long; pragma Import (C, sysconf); @@ -457,7 +447,7 @@ package System.OS_Interface is function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); -------------------------- diff --git a/gcc/ada/libgnarl/s-osinte__lynxos178.adb b/gcc/ada/libgnarl/s-osinte__lynxos178.adb index 88758a954f8a..beeefb617fe9 100644 --- a/gcc/ada/libgnarl/s-osinte__lynxos178.adb +++ b/gcc/ada/libgnarl/s-osinte__lynxos178.adb @@ -85,15 +85,6 @@ package body System.OS_Interface is return int (sysconf (SC_PAGESIZE)); end Get_Page_Size; - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (TS : timespec) return Duration is - begin - return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; - end To_Duration; - ------------------------ -- To_Target_Priority -- ------------------------ @@ -105,29 +96,6 @@ package body System.OS_Interface is return Interfaces.C.int (Prio); end To_Target_Priority; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F is negative due to a round-up, adjust for positive F value - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return timespec'(tv_sec => S, - tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - ------------- -- sigwait -- ------------- diff --git a/gcc/ada/libgnarl/s-osinte__lynxos178e.ads b/gcc/ada/libgnarl/s-osinte__lynxos178e.ads index 8b31e204acb5..dcc36b251857 100644 --- a/gcc/ada/libgnarl/s-osinte__lynxos178e.ads +++ b/gcc/ada/libgnarl/s-osinte__lynxos178e.ads @@ -42,9 +42,9 @@ with Ada.Unchecked_Conversion; with Interfaces.C; +with System.C_Time; with System.Multiprocessors; with System.OS_Locks; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -193,26 +193,18 @@ package System.OS_Interface is Time_Slice_Supported : constant Boolean := True; -- Indicates whether time slicing is supported - type timespec is private; - type clockid_t is new int; function clock_gettime (clock_id : clockid_t; - tp : access timespec) return int; + tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); function clock_getres (clock_id : clockid_t; - res : access timespec) return int; + res : access C_Time.timespec) return int; pragma Import (C, clock_getres, "clock_getres"); - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - type struct_timezone is record tz_minuteswest : int; tz_dsttime : int; @@ -220,8 +212,6 @@ package System.OS_Interface is pragma Convention (C, struct_timezone); type struct_timezone_ptr is access all struct_timezone; - type struct_timeval is private; - ------------------------- -- Priority Scheduling -- ------------------------- @@ -415,7 +405,7 @@ package System.OS_Interface is function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); -------------------------- @@ -541,23 +531,6 @@ private type pid_t is new long; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type suseconds_t is new int; - - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - - type struct_timeval is record - tv_sec : time_t; - tv_usec : suseconds_t; - end record; - pragma Convention (C, struct_timeval); - type st_attr is record stksize : int; prio : int; diff --git a/gcc/ada/libgnarl/s-osinte__posix.adb b/gcc/ada/libgnarl/s-osinte__posix.adb index 1cb4f23aec6e..2d9baeb7f363 100644 --- a/gcc/ada/libgnarl/s-osinte__posix.adb +++ b/gcc/ada/libgnarl/s-osinte__posix.adb @@ -36,6 +36,7 @@ -- that are needed by children of System. with Interfaces.C; use Interfaces.C; + package body System.OS_Interface is -------------------- @@ -58,15 +59,6 @@ package body System.OS_Interface is null; end pthread_init; - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (TS : timespec) return Duration is - begin - return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; - end To_Duration; - ------------------------ -- To_Target_Priority -- ------------------------ @@ -78,28 +70,4 @@ package body System.OS_Interface is return Interfaces.C.int (Prio); end To_Target_Priority; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - -- value. - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return timespec'(tv_sec => S, - tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - end System.OS_Interface; diff --git a/gcc/ada/libgnarl/s-osinte__qnx.adb b/gcc/ada/libgnarl/s-osinte__qnx.adb index 720022548df1..bf95b0eab34f 100644 --- a/gcc/ada/libgnarl/s-osinte__qnx.adb +++ b/gcc/ada/libgnarl/s-osinte__qnx.adb @@ -36,6 +36,7 @@ -- that are needed by children of System. with Interfaces.C; use Interfaces.C; + package body System.OS_Interface is ----------------- @@ -70,15 +71,6 @@ package body System.OS_Interface is null; end pthread_init; - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (TS : timespec) return Duration is - begin - return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; - end To_Duration; - ------------------------ -- To_Target_Priority -- ------------------------ @@ -90,28 +82,4 @@ package body System.OS_Interface is return Interfaces.C.int (Prio); end To_Target_Priority; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - -- value. - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return timespec'(tv_sec => S, - tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - end System.OS_Interface; diff --git a/gcc/ada/libgnarl/s-osinte__qnx.ads b/gcc/ada/libgnarl/s-osinte__qnx.ads index ea940d86330d..ee13235d891b 100644 --- a/gcc/ada/libgnarl/s-osinte__qnx.ads +++ b/gcc/ada/libgnarl/s-osinte__qnx.ads @@ -41,9 +41,9 @@ with Ada.Unchecked_Conversion; with Interfaces.C; +with System.C_Time; with System.OS_Constants; with System.OS_Locks; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -213,25 +213,17 @@ package System.OS_Interface is Time_Slice_Supported : constant Boolean := True; -- Indicates whether time slicing is supported - type timespec is private; - type clockid_t is new int; function clock_gettime - (clock_id : clockid_t; tp : access timespec) return int; + (clock_id : clockid_t; tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); function clock_getres (clock_id : clockid_t; - res : access timespec) return int; + res : access C_Time.timespec) return int; pragma Import (C, clock_getres, "clock_getres"); - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - ------------------------- -- Priority Scheduling -- ------------------------- @@ -418,7 +410,7 @@ package System.OS_Interface is function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); -------------------------- @@ -572,15 +564,6 @@ private type pid_t is new int; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - type unsigned_long_long_t is mod 2 ** 64; -- Local type only used to get the alignment of this type below diff --git a/gcc/ada/libgnarl/s-osinte__rtems.adb b/gcc/ada/libgnarl/s-osinte__rtems.adb index c0f6c265b509..efd602e73f82 100644 --- a/gcc/ada/libgnarl/s-osinte__rtems.adb +++ b/gcc/ada/libgnarl/s-osinte__rtems.adb @@ -92,15 +92,6 @@ package body System.OS_Interface is return int with Import, External_Name => "rtems_semaphore_release", Convention => C; - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (TS : timespec) return Duration is - begin - return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; - end To_Duration; - ------------------------ -- To_Target_Priority -- ------------------------ @@ -112,27 +103,6 @@ package body System.OS_Interface is return Interfaces.C.int (Prio); end To_Target_Priority; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to round-up, adjust for positive F value - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - return timespec'(tv_sec => S, - tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - ----------------------------- -- Binary_Semaphore_Create -- ----------------------------- diff --git a/gcc/ada/libgnarl/s-osinte__rtems.ads b/gcc/ada/libgnarl/s-osinte__rtems.ads index 21b1be8a306a..184d48978364 100644 --- a/gcc/ada/libgnarl/s-osinte__rtems.ads +++ b/gcc/ada/libgnarl/s-osinte__rtems.ads @@ -52,9 +52,9 @@ with Interfaces.C; +with System.C_Time; with System.OS_Constants; with System.OS_Locks; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -181,8 +181,6 @@ package System.OS_Interface is Time_Slice_Supported : constant Boolean := True; -- Indicates whether time slicing is supported (i.e SCHED_RR is supported) - type timespec is private; - type clockid_t is new int; CLOCK_REALTIME : constant clockid_t; @@ -190,20 +188,14 @@ package System.OS_Interface is function clock_gettime (clock_id : clockid_t; - tp : access timespec) return int; + tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); function clock_getres (clock_id : clockid_t; - res : access timespec) return int; + res : access C_Time.timespec) return int; pragma Import (C, clock_getres, "clock_getres"); - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - ------------------------- -- Priority Scheduling -- ------------------------- @@ -428,7 +420,7 @@ package System.OS_Interface is function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); -------------------------- @@ -454,8 +446,8 @@ package System.OS_Interface is type struct_sched_param is record sched_priority : int; ss_low_priority : int; - ss_replenish_period : timespec; - ss_initial_budget : timespec; + ss_replenish_period : C_Time.timespec; + ss_initial_budget : C_Time.timespec; sched_ss_max_repl : int; end record; pragma Convention (C, struct_sched_param); @@ -591,15 +583,6 @@ private type pid_t is new int; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - CLOCK_REALTIME : constant clockid_t := System.OS_Constants.CLOCK_REALTIME; CLOCK_MONOTONIC : constant clockid_t := System.OS_Constants.CLOCK_MONOTONIC; diff --git a/gcc/ada/libgnarl/s-osinte__solaris.adb b/gcc/ada/libgnarl/s-osinte__solaris.adb index e5626fc4f0d8..78144efdbcdb 100644 --- a/gcc/ada/libgnarl/s-osinte__solaris.adb +++ b/gcc/ada/libgnarl/s-osinte__solaris.adb @@ -35,42 +35,8 @@ -- This package encapsulates all direct interfaces to OS services -- that are needed by children of System. -with Interfaces.C; use Interfaces.C; - package body System.OS_Interface is - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (TS : timespec) return Duration is - begin - return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; - end To_Duration; - - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return timespec'(tv_sec => S, - tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - ------------------ -- pthread_init -- ------------------ diff --git a/gcc/ada/libgnarl/s-osinte__solaris.ads b/gcc/ada/libgnarl/s-osinte__solaris.ads index d62dd37110eb..e9b59fe1ca92 100644 --- a/gcc/ada/libgnarl/s-osinte__solaris.ads +++ b/gcc/ada/libgnarl/s-osinte__solaris.ads @@ -42,8 +42,8 @@ with Ada.Unchecked_Conversion; with Interfaces.C; +with System.C_Time; with System.OS_Locks; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -241,24 +241,16 @@ package System.OS_Interface is -- Time -- ---------- - type timespec is private; - type clockid_t is new int; function clock_gettime - (clock_id : clockid_t; tp : access timespec) return int; + (clock_id : clockid_t; tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); function clock_getres - (clock_id : clockid_t; res : access timespec) return int; + (clock_id : clockid_t; res : access C_Time.timespec) return int; pragma Import (C, clock_getres, "clock_getres"); - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - function sysconf (name : int) return long; pragma Import (C, sysconf); @@ -347,7 +339,7 @@ package System.OS_Interface is function cond_timedwait (cond : access cond_t; mutex : access mutex_t; - abstime : access timespec) return int; + abstime : access C_Time.timespec) return int; pragma Import (C, cond_timedwait, "cond_timedwait"); function cond_signal (cond : access cond_t) return int; @@ -526,15 +518,6 @@ private type pid_t is new long; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - type array_type_9 is array (0 .. 3) of unsigned_char; type record_type_3 is record flag : array_type_9; diff --git a/gcc/ada/libgnarl/s-osinte__vxworks.adb b/gcc/ada/libgnarl/s-osinte__vxworks.adb index 5c227a1e54c8..0b2b5d442698 100644 --- a/gcc/ada/libgnarl/s-osinte__vxworks.adb +++ b/gcc/ada/libgnarl/s-osinte__vxworks.adb @@ -41,38 +41,6 @@ package body System.OS_Interface is Low_Priority : constant := 255; -- VxWorks native (default) lowest scheduling priority - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (TS : timespec) return Duration is - begin - return Duration (TS.ts_sec) + Duration (TS.ts_nsec) / 10#1#E9; - end To_Duration; - - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F is negative due to a round-up, adjust for positive F value - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return timespec'(ts_sec => S, - ts_nsec => long (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - ------------------------- -- To_VxWorks_Priority -- ------------------------- diff --git a/gcc/ada/libgnarl/s-osinte__vxworks.ads b/gcc/ada/libgnarl/s-osinte__vxworks.ads index a4095735bd6d..ecb63440a5db 100644 --- a/gcc/ada/libgnarl/s-osinte__vxworks.ads +++ b/gcc/ada/libgnarl/s-osinte__vxworks.ads @@ -40,10 +40,10 @@ with Interfaces.C; +with System.C_Time; with System.VxWorks; with System.VxWorks.Ext; with System.Multiprocessors; -with System.Parameters; package System.OS_Interface is pragma Preelaborate; @@ -244,37 +244,13 @@ package System.OS_Interface is -- Time -- ---------- - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - -- Time_t here used to be unsigned to match the VxWorks header declaration. - -- The header declaration has changed in newer releases and is now signed - -- for applications. - - type timespec is record - ts_sec : time_t; - ts_nsec : long; - end record; - pragma Convention (C, timespec); - type clockid_t is new int; - function To_Duration (TS : timespec) return Duration; - pragma Inline (To_Duration); - - function To_Timespec (D : Duration) return timespec; - pragma Inline (To_Timespec); - -- Convert a Duration value to a timespec value. Note that in VxWorks, - -- timespec is always non-negative (since time_t is defined above as - -- unsigned long). This means that there is a potential problem if a - -- negative argument is passed for D. However, in actual usage, the - -- value of the input argument D is always non-negative, so no problem - -- arises in practice. - function To_Clock_Ticks (D : Duration) return int; -- Convert a duration value (in seconds) into clock ticks function clock_gettime - (clock_id : clockid_t; tp : access timespec) return int; + (clock_id : clockid_t; tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); ---------------------- diff --git a/gcc/ada/libgnarl/s-osinte__x32.adb b/gcc/ada/libgnarl/s-osinte__x32.adb deleted file mode 100644 index 27313a4bcc07..000000000000 --- a/gcc/ada/libgnarl/s-osinte__x32.adb +++ /dev/null @@ -1,106 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- --- -- --- S Y S T E M . O S _ I N T E R F A C E -- --- -- --- B o d y -- --- -- --- Copyright (C) 1991-2017, Florida State University -- --- Copyright (C) 1995-2025, AdaCore -- --- -- --- 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 -- --- . -- --- -- --- GNARL was developed by the GNARL team at Florida State University. -- --- Extensive contributions were provided by Ada Core Technologies, Inc. -- --- -- ------------------------------------------------------------------------------- - --- This version is for Linux/x32 - --- This package encapsulates all direct interfaces to OS services --- that are needed by children of System. - -with Interfaces.C; use Interfaces.C; - -package body System.OS_Interface is - - -------------------- - -- Get_Stack_Base -- - -------------------- - - function Get_Stack_Base (thread : pthread_t) return Address is - pragma Warnings (Off, thread); - - begin - return Null_Address; - end Get_Stack_Base; - - ------------------ - -- pthread_init -- - ------------------ - - procedure pthread_init is - begin - null; - end pthread_init; - - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (TS : timespec) return Duration is - begin - return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; - end To_Duration; - - ------------------------ - -- To_Target_Priority -- - ------------------------ - - function To_Target_Priority - (Prio : System.Any_Priority) return Interfaces.C.int - is - begin - return Interfaces.C.int (Prio); - end To_Target_Priority; - - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - -- value. - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return timespec'(tv_sec => S, - tv_nsec => Long_Long_Integer (F * 10#1#E9)); - end To_Timespec; - -end System.OS_Interface; diff --git a/gcc/ada/libgnarl/s-qnx.ads b/gcc/ada/libgnarl/s-qnx.ads index 1197be15ef6c..f342ad673056 100644 --- a/gcc/ada/libgnarl/s-qnx.ads +++ b/gcc/ada/libgnarl/s-qnx.ads @@ -37,8 +37,6 @@ with Interfaces.C; -with System.Parameters; - package System.QNX is pragma Preelaborate; @@ -46,24 +44,8 @@ package System.QNX is -- Time -- ---------- - subtype long is Interfaces.C.long; - subtype suseconds_t is Interfaces.C.long; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; subtype clockid_t is Interfaces.C.int; - type timespec is record - tv_sec : time_t; - tv_nsec : long; - end record; - pragma Convention (C, timespec); - - type timeval is record - tv_sec : time_t; - tv_usec : suseconds_t; - end record; - pragma Convention (C, timeval); - ----------- -- Errno -- ----------- diff --git a/gcc/ada/libgnarl/s-stusta.adb b/gcc/ada/libgnarl/s-stusta.adb index c9848a060c20..d0e8c36a102f 100644 --- a/gcc/ada/libgnarl/s-stusta.adb +++ b/gcc/ada/libgnarl/s-stusta.adb @@ -51,14 +51,18 @@ package body System.Stack_Usage.Tasking is -- Compute the stack usage for a given task and saves it in the precise -- slot in System.Stack_Usage.Result_Array; - procedure Report_Impl (All_Tasks : Boolean; Do_Print : Boolean); + procedure Report_Impl + (All_Tasks : Boolean; + Do_Print : Boolean; + Result_Data : out Stack_Usage_Result_Array); -- Report the stack usage of either all tasks (All_Tasks = True) or of the -- current task (All_Task = False). If Print is True, then results are - -- printed on stderr + -- printed on stderr. Otherwise, we fill the referred structure with the + -- stack information for later processing. We do this copy to avoid reading + -- System.Stack_Usage.Result_Array without locking the runtime. procedure Convert - (TS : System.Stack_Usage.Task_Result; - Res : out Stack_Usage_Result); + (TS : System.Stack_Usage.Task_Result; Res : out Stack_Usage_Result); -- Convert an object of type System.Stack_Usage in a Stack_Usage_Result ------------- @@ -66,8 +70,7 @@ package body System.Stack_Usage.Tasking is ------------- procedure Convert - (TS : System.Stack_Usage.Task_Result; - Res : out Stack_Usage_Result) is + (TS : System.Stack_Usage.Task_Result; Res : out Stack_Usage_Result) is begin Res := TS; end Convert; @@ -77,9 +80,38 @@ package body System.Stack_Usage.Tasking is --------------------- procedure Report_For_Task (Id : System.Tasking.Task_Id) is + use type System.Tasking.Task_Id; begin - System.Stack_Usage.Compute_Result (Id.Common.Analyzer); - System.Stack_Usage.Report_Result (Id.Common.Analyzer); + -- Special treatment of the environment task that uses a Stack_Analyzer + -- object that is not part of its ATCB. + if Id = System.Task_Primitives.Operations.Environment_Task then + + -- Check whether we are tracking stack usage for the environment task + if Compute_Environment_Task then + Compute_Result (Environment_Task_Analyzer); + Report_Result (Environment_Task_Analyzer); + + else + Put_Line + ("Stack usage for environment task needs GNAT_STACK_LIMIT"); + end if; + + -- Regular task + + else + declare + Name_Length : constant Natural := + Natural'Min (Id.Common.Task_Image_Len, Task_Name_Length); + begin + -- Skip the task if it hasn't initialized the stack pattern yet + if Id.Common.Task_Image (1 .. Name_Length) = + Id.Common.Analyzer.Task_Name (1 .. Name_Length) + then + System.Stack_Usage.Compute_Result (Id.Common.Analyzer); + System.Stack_Usage.Report_Result (Id.Common.Analyzer); + end if; + end; + end if; end Report_For_Task; ----------------------- @@ -104,6 +136,9 @@ package body System.Stack_Usage.Tasking is -- Calculate the task usage for a given task + -- Skip if the task is terminated because the ATCB can be already + -- destroyed. + if not System.Tasking.Stages.Terminated (Id) then Report_For_Task (Id); end if; @@ -133,10 +168,13 @@ package body System.Stack_Usage.Tasking is -- Report_Impl -- ----------------- - procedure Report_Impl (All_Tasks : Boolean; Do_Print : Boolean) is + procedure Report_Impl + (All_Tasks : Boolean; + Do_Print : Boolean; + Result_Data : out Stack_Usage_Result_Array) is begin - -- Lock the runtime + -- Lock the runtime to compute and display stack usage System.Task_Primitives.Operations.Lock_RTS; @@ -148,9 +186,22 @@ package body System.Stack_Usage.Tasking is Compute_Current_Task; end if; - -- Output results + -- Output results, either printing it or in the out parameter + if Do_Print then System.Stack_Usage.Output_Results; + + else + -- Extract data from the snapshot in System.Stack_Usage.Result_Array + + pragma Assert + (System.Stack_Usage.Result_Array = null or else + (System.Stack_Usage.Result_Array'First = Result_Data'First and then + System.Stack_Usage.Result_Array'Last = Result_Data'Last)); + + for J in Result_Data'Range loop + Convert (System.Stack_Usage.Result_Array (J), Result_Data (J)); + end loop; end if; -- Unlock the runtime @@ -164,8 +215,9 @@ package body System.Stack_Usage.Tasking is ---------------------- procedure Report_All_Tasks is + Empty_Result_Array : Stack_Usage_Result_Array (1 .. 0); begin - Report_Impl (True, True); + Report_Impl (True, True, Empty_Result_Array); end Report_All_Tasks; ------------------------- @@ -185,13 +237,11 @@ package body System.Stack_Usage.Tasking is function Get_All_Tasks_Usage return Stack_Usage_Result_Array is Res : Stack_Usage_Result_Array - (1 .. System.Stack_Usage.Result_Array'Length); + (1 .. + (if System.Stack_Usage.Result_Array = null then 0 + else System.Stack_Usage.Result_Array'Length)); begin - Report_Impl (True, False); - - for J in Res'Range loop - Convert (System.Stack_Usage.Result_Array (J), Res (J)); - end loop; + Report_Impl (True, False, Res); return Res; end Get_All_Tasks_Usage; @@ -201,31 +251,70 @@ package body System.Stack_Usage.Tasking is ---------------------------- function Get_Current_Task_Usage return Stack_Usage_Result is - Res : Stack_Usage_Result; - Original : System.Stack_Usage.Task_Result; - Found : Boolean := False; - begin + use type System.Tasking.Task_Id; - Report_Impl (False, False); + Self_ID : constant System.Tasking.Task_Id := System.Tasking.Self; + Is_Env_Task : constant Boolean := + Self_ID = System.Task_Primitives.Operations.Environment_Task; - -- Look for the task info in System.Stack_Usage.Result_Array; - -- the search is based on task name + Res_Array : Stack_Usage_Result_Array + (1 .. + (if System.Stack_Usage.Result_Array = null then 0 + else System.Stack_Usage.Result_Array'Length)); + Res : Stack_Usage_Result; + Found : Boolean := False; - for T in System.Stack_Usage.Result_Array'Range loop - if System.Stack_Usage.Result_Array (T).Task_Name = - System.Tasking.Self.Common.Analyzer.Task_Name + begin + Report_Impl (False, False, Res_Array); + + -- Look for the task info in the copy of System.Stack_Usage.Result_Array + -- (the search is based on task name). + + for Stack_Usage of Res_Array loop + if Stack_Usage.Task_Name = Self_ID.Common.Analyzer.Task_Name or else + (Is_Env_Task and then + Stack_Usage.Task_Name (1 .. 16) = "ENVIRONMENT TASK") then - Original := System.Stack_Usage.Result_Array (T); + Res := Stack_Usage; Found := True; exit; end if; end loop; - -- Be sure a task has been found + if not Found then + -- Not found because the task is not part of those for which we store + -- the results. Hence we need to compute now. + + -- Environment task + if Is_Env_Task then + Res.Task_Name := + "ENVIRONMENT TASK" & (1 .. Task_Name_Length - 16 => ASCII.NUL); + + if Compute_Environment_Task then + Res.Stack_Size := Environment_Task_Analyzer.Stack_Size; + Res.Value := + Stack_Size + (To_Stack_Address + (Environment_Task_Analyzer.Topmost_Touched_Mark), + To_Stack_Address (Environment_Task_Analyzer.Stack_Base)); + else + Res.Stack_Size := 0; + Res.Value := 0; + end if; + + -- Other tasks - pragma Assert (Found); + else + Res.Task_Name := Self_ID.Common.Analyzer.Task_Name; + Res.Stack_Size := Self_ID.Common.Analyzer.Stack_Size; + Res.Value := + Stack_Size + (To_Stack_Address + (Self_ID.Common.Analyzer.Topmost_Touched_Mark), + To_Stack_Address (Self_ID.Common.Analyzer.Stack_Base)); + end if; + end if; - Convert (Original, Res); return Res; end Get_Current_Task_Usage; @@ -248,11 +337,14 @@ package body System.Stack_Usage.Tasking is declare T_Name : constant String := - Obj.Task_Name (Obj.Task_Name'First .. Pos); + Obj.Task_Name (Obj.Task_Name'First .. Pos); begin + -- Notify when we don't know stack usage Put_Line - ("| " & T_Name & " | " & Natural'Image (Obj.Stack_Size) & - Natural'Image (Obj.Value)); + ("| " & T_Name & "|" & + (if Obj.Stack_Size = 0 then " NA | NA" + else Natural'Image (Obj.Stack_Size) & " |" & + Natural'Image (Obj.Value))); end; end Print; diff --git a/gcc/ada/libgnarl/s-taprop__qnx.adb b/gcc/ada/libgnarl/s-taprop__qnx.adb index e7d245fec7de..b51f2b527082 100644 --- a/gcc/ada/libgnarl/s-taprop__qnx.adb +++ b/gcc/ada/libgnarl/s-taprop__qnx.adb @@ -766,6 +766,16 @@ package body System.Task_Primitives.Operations is function Thread_Body_Access is new Ada.Unchecked_Conversion (System.Address, Thread_Body); + function Disable_Signals return Interfaces.C.int with + Import, + Convention => C, + External_Name => "__gnat_disable_signals"; + + function Enable_Signals return Interfaces.C.int with + Import, + Convention => C, + External_Name => "__gnat_enable_signals"; + begin Adjusted_Stack_Size := Interfaces.C.size_t (Stack_Size + Alternate_Stack_Size); @@ -840,10 +850,11 @@ package body System.Task_Primitives.Operations is pragma Assert (Result = 0); - -- 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. + -- (QMS3263) lists PR 2894086. This defect causes a memory leak when + -- pthread_create is interrupted by a signal and later resumed. To avoid + -- avoid such a leak the document suggests to disable signals while + -- calling pthread_create. The signal mask of the calling thread is + -- restored after the call to pthread_create. -- The write to T.Common.LL.Thread is not racy with regard to the -- created thread because the created thread will not access it until @@ -851,6 +862,8 @@ package body System.Task_Primitives.Operations is -- Restricted.Stages is used). One can verify that by inspecting the -- Task_Wrapper procedures. + Result := Disable_Signals; + pragma Assert (Result = 0); Result := pthread_create (T.Common.LL.Thread'Access, Attributes'Access, @@ -860,6 +873,9 @@ package body System.Task_Primitives.Operations is Succeeded := Result = 0; + Result := Enable_Signals; + pragma Assert (Result = 0); + Result := pthread_attr_destroy (Attributes'Access); pragma Assert (Result = 0); end Create_Task; diff --git a/gcc/ada/libgnarl/s-taprop__solaris.adb b/gcc/ada/libgnarl/s-taprop__solaris.adb index 8edc58ea9d80..1b65100362c4 100644 --- a/gcc/ada/libgnarl/s-taprop__solaris.adb +++ b/gcc/ada/libgnarl/s-taprop__solaris.adb @@ -36,6 +36,7 @@ with Interfaces.C; +with System.C_Time; with System.Interrupt_Management; with System.Multiprocessors; with System.OS_Constants; @@ -762,12 +763,12 @@ package body System.Task_Primitives.Operations is --------------------- function Monotonic_Clock return Duration is - TS : aliased timespec; + TS : aliased C_Time.timespec; Result : Interfaces.C.int; begin Result := clock_gettime (OSC.CLOCK_RT_Ada, TS'Unchecked_Access); pragma Assert (Result = 0); - return To_Duration (TS); + return C_Time.To_Duration (TS); end Monotonic_Clock; ------------------- @@ -775,13 +776,13 @@ package body System.Task_Primitives.Operations is ------------------- function RT_Resolution return Duration is - TS : aliased timespec; + TS : aliased C_Time.timespec; Result : Interfaces.C.int; begin Result := clock_getres (OSC.CLOCK_REALTIME, TS'Unchecked_Access); pragma Assert (Result = 0); - return To_Duration (TS); + return C_Time.To_Duration (TS); end RT_Resolution; ----------- @@ -1175,7 +1176,7 @@ package body System.Task_Primitives.Operations is Base_Time : constant Duration := Monotonic_Clock; Check_Time : Duration := Base_Time; Abs_Time : Duration; - Request : aliased timespec; + Request : aliased C_Time.timespec; Result : Interfaces.C.int; begin @@ -1189,7 +1190,7 @@ package body System.Task_Primitives.Operations is else Duration'Min (Check_Time + Max_Sensible_Delay, Time)); if Abs_Time > Check_Time then - Request := To_Timespec (Abs_Time); + Request := C_Time.To_Timespec (Abs_Time); loop exit when Self_ID.Pending_ATC_Level < Self_ID.ATC_Nesting_Level; @@ -1230,7 +1231,7 @@ package body System.Task_Primitives.Operations is Base_Time : constant Duration := Monotonic_Clock; Check_Time : Duration := Base_Time; Abs_Time : Duration; - Request : aliased timespec; + Request : aliased C_Time.timespec; Result : Interfaces.C.int; Yielded : Boolean := False; @@ -1243,7 +1244,7 @@ package body System.Task_Primitives.Operations is else Duration'Min (Check_Time + Max_Sensible_Delay, Time)); if Abs_Time > Check_Time then - Request := To_Timespec (Abs_Time); + Request := C_Time.To_Timespec (Abs_Time); Self_ID.Common.State := Delay_Sleep; pragma Assert (Check_Sleep (Delay_Sleep)); diff --git a/gcc/ada/libgnarl/s-taprop__vxworks.adb b/gcc/ada/libgnarl/s-taprop__vxworks.adb index a0f1885a7e8d..a4dab5fa9d1e 100644 --- a/gcc/ada/libgnarl/s-taprop__vxworks.adb +++ b/gcc/ada/libgnarl/s-taprop__vxworks.adb @@ -38,6 +38,7 @@ with Ada.Unchecked_Conversion; with Interfaces.C; +with System.C_Time; with System.Float_Control; with System.Interrupt_Management; with System.Multiprocessors; @@ -681,12 +682,12 @@ package body System.Task_Primitives.Operations is --------------------- function Monotonic_Clock return Duration is - TS : aliased timespec; + TS : aliased C_Time.timespec; Result : int; begin Result := clock_gettime (OSC.CLOCK_RT_Ada, TS'Unchecked_Access); pragma Assert (Result = 0); - return To_Duration (TS); + return C_Time.To_Duration (TS); end Monotonic_Clock; ------------------- diff --git a/gcc/ada/libgnarl/s-tpopmo.adb b/gcc/ada/libgnarl/s-tpopmo.adb index 9ff1ecdc329f..547a5e44abcd 100644 --- a/gcc/ada/libgnarl/s-tpopmo.adb +++ b/gcc/ada/libgnarl/s-tpopmo.adb @@ -31,6 +31,8 @@ -- This is the Monotonic version of this package for Posix and Linux targets. +with System.C_Time; + separate (System.Task_Primitives.Operations) package body Monotonic is @@ -54,14 +56,14 @@ package body Monotonic is --------------------- function Monotonic_Clock return Duration is - TS : aliased timespec; + TS : aliased C_Time.timespec; Result : Interfaces.C.int; begin Result := clock_gettime (clock_id => OSC.CLOCK_RT_Ada, tp => TS'Unchecked_Access); pragma Assert (Result = 0); - return To_Duration (TS); + return C_Time.To_Duration (TS); end Monotonic_Clock; ------------------- @@ -69,14 +71,14 @@ package body Monotonic is ------------------- function RT_Resolution return Duration is - TS : aliased timespec; + TS : aliased C_Time.timespec; Result : Interfaces.C.int; begin Result := clock_getres (OSC.CLOCK_REALTIME, TS'Unchecked_Access); pragma Assert (Result = 0); - return To_Duration (TS); + return C_Time.To_Duration (TS); end RT_Resolution; ---------------------- @@ -150,7 +152,7 @@ package body Monotonic is Abs_Time : Duration; P_Abs_Time : Duration; - Request : aliased timespec; + Request : aliased C_Time.timespec; Result : Interfaces.C.int; Exit_Outer : Boolean := False; @@ -184,7 +186,7 @@ package body Monotonic is end if; pragma Warnings (On); - Request := To_Timespec (P_Abs_Time); + Request := C_Time.To_Timespec (P_Abs_Time); Inner : loop exit Outer @@ -236,7 +238,7 @@ package body Monotonic is Check_Time : Duration; Abs_Time : Duration; P_Abs_Time : Duration; - Request : aliased timespec; + Request : aliased C_Time.timespec; Result : Interfaces.C.int; Exit_Outer : Boolean := False; @@ -271,7 +273,7 @@ package body Monotonic is end if; pragma Warnings (On); - Request := To_Timespec (P_Abs_Time); + Request := C_Time.To_Timespec (P_Abs_Time); Inner : loop exit Outer diff --git a/gcc/ada/libgnat/a-cdlili.ads b/gcc/ada/libgnat/a-cdlili.ads index 93b63b31f7c8..323226cd5748 100644 --- a/gcc/ada/libgnat/a-cdlili.ads +++ b/gcc/ada/libgnat/a-cdlili.ads @@ -58,12 +58,12 @@ is Default_Iterator => Iterate, Iterator_Element => Element_Type, Aggregate => (Empty => Empty, - Add_Unnamed => Append); + Add_Unnamed => Append), + Preelaborable_Initialization; - pragma Preelaborable_Initialization (List); - - type Cursor is private; - pragma Preelaborable_Initialization (Cursor); + type Cursor is private + with + Preelaborable_Initialization; Empty_List : constant List; diff --git a/gcc/ada/libgnat/a-cidlli.ads b/gcc/ada/libgnat/a-cidlli.ads index de7167f3567d..87b582d707c1 100644 --- a/gcc/ada/libgnat/a-cidlli.ads +++ b/gcc/ada/libgnat/a-cidlli.ads @@ -57,12 +57,11 @@ is Default_Iterator => Iterate, Iterator_Element => Element_Type, Aggregate => (Empty => Empty, - Add_Unnamed => Append); + Add_Unnamed => Append), + Preelaborable_Initialization; - pragma Preelaborable_Initialization (List); - - type Cursor is private; - pragma Preelaborable_Initialization (Cursor); + type Cursor is private with + Preelaborable_Initialization; Empty_List : constant List; diff --git a/gcc/ada/libgnat/a-cihama.ads b/gcc/ada/libgnat/a-cihama.ads index fb6a65e4badd..8862bbbab9f2 100644 --- a/gcc/ada/libgnat/a-cihama.ads +++ b/gcc/ada/libgnat/a-cihama.ads @@ -59,12 +59,11 @@ is Default_Iterator => Iterate, Iterator_Element => Element_Type, Aggregate => (Empty => Empty, - Add_Named => Insert); + Add_Named => Insert), + Preelaborable_Initialization; - pragma Preelaborable_Initialization (Map); - - type Cursor is private; - pragma Preelaborable_Initialization (Cursor); + type Cursor is private with + Preelaborable_Initialization; Empty_Map : constant Map; -- Map objects declared without an initialization expression are diff --git a/gcc/ada/libgnat/a-cihase.ads b/gcc/ada/libgnat/a-cihase.ads index dbb42f1f8cf1..7efc9419bdc8 100644 --- a/gcc/ada/libgnat/a-cihase.ads +++ b/gcc/ada/libgnat/a-cihase.ads @@ -61,12 +61,11 @@ is Default_Iterator => Iterate, Iterator_Element => Element_Type, Aggregate => (Empty => Empty, - Add_Unnamed => Include); + Add_Unnamed => Include), + Preelaborable_Initialization; - pragma Preelaborable_Initialization (Set); - - type Cursor is private; - pragma Preelaborable_Initialization (Cursor); + type Cursor is private + with Preelaborable_Initialization; Empty_Set : constant Set; -- Set objects declared without an initialization expression are diff --git a/gcc/ada/libgnat/a-cimutr.ads b/gcc/ada/libgnat/a-cimutr.ads index b7e9b7cffb69..022ae5ed475c 100644 --- a/gcc/ada/libgnat/a-cimutr.ads +++ b/gcc/ada/libgnat/a-cimutr.ads @@ -54,12 +54,11 @@ is with Constant_Indexing => Constant_Reference, Variable_Indexing => Reference, Default_Iterator => Iterate, - Iterator_Element => Element_Type; + Iterator_Element => Element_Type, + Preelaborable_Initialization; - pragma Preelaborable_Initialization (Tree); - - type Cursor is private; - pragma Preelaborable_Initialization (Cursor); + type Cursor is private + with Preelaborable_Initialization; Empty_Tree : constant Tree; diff --git a/gcc/ada/libgnat/a-ciorma.ads b/gcc/ada/libgnat/a-ciorma.ads index 58e4f283435c..acf86b6c70b3 100644 --- a/gcc/ada/libgnat/a-ciorma.ads +++ b/gcc/ada/libgnat/a-ciorma.ads @@ -60,12 +60,11 @@ is Default_Iterator => Iterate, Iterator_Element => Element_Type, Aggregate => (Empty => Empty, - Add_Named => Insert); + Add_Named => Insert), + Preelaborable_Initialization; - pragma Preelaborable_Initialization (Map); - - type Cursor is private; - pragma Preelaborable_Initialization (Cursor); + type Cursor is private + with Preelaborable_Initialization; Empty_Map : constant Map; diff --git a/gcc/ada/libgnat/a-ciormu.ads b/gcc/ada/libgnat/a-ciormu.ads index ddc2722a6a2b..894a4934671d 100644 --- a/gcc/ada/libgnat/a-ciormu.ads +++ b/gcc/ada/libgnat/a-ciormu.ads @@ -58,12 +58,11 @@ is type Set is tagged private with Constant_Indexing => Constant_Reference, Default_Iterator => Iterate, - Iterator_Element => Element_Type; + Iterator_Element => Element_Type, + Preelaborable_Initialization; - pragma Preelaborable_Initialization (Set); - - type Cursor is private; - pragma Preelaborable_Initialization (Cursor); + type Cursor is private + with Preelaborable_Initialization; Empty_Set : constant Set; -- The default value for set objects declared without an explicit diff --git a/gcc/ada/libgnat/a-ciorse.ads b/gcc/ada/libgnat/a-ciorse.ads index c19e57e93d0c..fcc1aa12e4ff 100644 --- a/gcc/ada/libgnat/a-ciorse.ads +++ b/gcc/ada/libgnat/a-ciorse.ads @@ -59,12 +59,11 @@ is Default_Iterator => Iterate, Iterator_Element => Element_Type, Aggregate => (Empty => Empty, - Add_Unnamed => Include); + Add_Unnamed => Include), + Preelaborable_Initialization; - pragma Preelaborable_Initialization (Set); - - type Cursor is private; - pragma Preelaborable_Initialization (Cursor); + type Cursor is private with + Preelaborable_Initialization; Empty_Set : constant Set; function Empty return Set; diff --git a/gcc/ada/libgnat/a-cohama.ads b/gcc/ada/libgnat/a-cohama.ads index 2c2577c269ec..8f501e1c99f8 100644 --- a/gcc/ada/libgnat/a-cohama.ads +++ b/gcc/ada/libgnat/a-cohama.ads @@ -103,12 +103,12 @@ is Default_Iterator => Iterate, Iterator_Element => Element_Type, Aggregate => (Empty => Empty, - Add_Named => Insert); + Add_Named => Insert), + Preelaborable_Initialization; - pragma Preelaborable_Initialization (Map); - - type Cursor is private; - pragma Preelaborable_Initialization (Cursor); + type Cursor is private + with + Preelaborable_Initialization; function "=" (Left, Right : Cursor) return Boolean; -- The representation of cursors includes a component used to optimize diff --git a/gcc/ada/libgnat/a-cohase.ads b/gcc/ada/libgnat/a-cohase.ads index fb7c944f4ad4..6eb5b0c992a3 100644 --- a/gcc/ada/libgnat/a-cohase.ads +++ b/gcc/ada/libgnat/a-cohase.ads @@ -62,12 +62,12 @@ is Default_Iterator => Iterate, Iterator_Element => Element_Type, Aggregate => (Empty => Empty, - Add_Unnamed => Include); + Add_Unnamed => Include), + Preelaborable_Initialization; - pragma Preelaborable_Initialization (Set); - - type Cursor is private; - pragma Preelaborable_Initialization (Cursor); + type Cursor is private + with + Preelaborable_Initialization; function "=" (Left, Right : Cursor) return Boolean; -- The representation of cursors includes a component used to optimize diff --git a/gcc/ada/libgnat/a-coinho.ads b/gcc/ada/libgnat/a-coinho.ads index c9a6aa71226e..dcb5b0cddda3 100644 --- a/gcc/ada/libgnat/a-coinho.ads +++ b/gcc/ada/libgnat/a-coinho.ads @@ -42,8 +42,9 @@ package Ada.Containers.Indefinite_Holders is pragma Preelaborate (Indefinite_Holders); pragma Remote_Types (Indefinite_Holders); - type Holder is tagged private; - pragma Preelaborable_Initialization (Holder); + type Holder is tagged private + with + Preelaborable_Initialization; Empty_Holder : constant Holder; diff --git a/gcc/ada/libgnat/a-coinho__shared.ads b/gcc/ada/libgnat/a-coinho__shared.ads index 904ae01065f4..a8d0cff84ed4 100644 --- a/gcc/ada/libgnat/a-coinho__shared.ads +++ b/gcc/ada/libgnat/a-coinho__shared.ads @@ -47,8 +47,9 @@ package Ada.Containers.Indefinite_Holders is pragma Preelaborate (Indefinite_Holders); pragma Remote_Types (Indefinite_Holders); - type Holder is tagged private; - pragma Preelaborable_Initialization (Holder); + type Holder is tagged private + with + Preelaborable_Initialization; Empty_Holder : constant Holder; diff --git a/gcc/ada/libgnat/a-coinve.ads b/gcc/ada/libgnat/a-coinve.ads index 6d2df0cde679..65ff916c31cf 100644 --- a/gcc/ada/libgnat/a-coinve.ads +++ b/gcc/ada/libgnat/a-coinve.ads @@ -66,12 +66,12 @@ is Aggregate => (Empty => Empty, Add_Unnamed => Append, New_Indexed => New_Vector, - Assign_Indexed => Replace_Element); + Assign_Indexed => Replace_Element), + Preelaborable_Initialization; - pragma Preelaborable_Initialization (Vector); - - type Cursor is private; - pragma Preelaborable_Initialization (Cursor); + type Cursor is private + with + Preelaborable_Initialization; Empty_Vector : constant Vector; diff --git a/gcc/ada/libgnat/a-comutr.ads b/gcc/ada/libgnat/a-comutr.ads index adc2cad8e5e5..8291408a6130 100644 --- a/gcc/ada/libgnat/a-comutr.ads +++ b/gcc/ada/libgnat/a-comutr.ads @@ -54,11 +54,11 @@ is with Constant_Indexing => Constant_Reference, Variable_Indexing => Reference, Default_Iterator => Iterate, - Iterator_Element => Element_Type; - pragma Preelaborable_Initialization (Tree); + Iterator_Element => Element_Type, + Preelaborable_Initialization; - type Cursor is private; - pragma Preelaborable_Initialization (Cursor); + type Cursor is private + with Preelaborable_Initialization; Empty_Tree : constant Tree; diff --git a/gcc/ada/libgnat/a-convec.ads b/gcc/ada/libgnat/a-convec.ads index 5f443798b893..8fad465a1f34 100644 --- a/gcc/ada/libgnat/a-convec.ads +++ b/gcc/ada/libgnat/a-convec.ads @@ -97,15 +97,15 @@ is Aggregate => (Empty => Empty, Add_Unnamed => Append, New_Indexed => New_Vector, - Assign_Indexed => Replace_Element); - - pragma Preelaborable_Initialization (Vector); + Assign_Indexed => Replace_Element), + Preelaborable_Initialization; -- Vector type, to be instantiated by users of this package. If an object -- of type Vector is not otherwise initialized, it is initialized to -- Empty_Vector. - type Cursor is private; - pragma Preelaborable_Initialization (Cursor); + type Cursor is private + with + Preelaborable_Initialization; -- Cursor pointing into an instance of vector. If an object of type Cursor -- is not otherwise initialized, it is initialized to No_Element diff --git a/gcc/ada/libgnat/a-coorma.ads b/gcc/ada/libgnat/a-coorma.ads index 4ec4d1705fbb..644895c808e4 100644 --- a/gcc/ada/libgnat/a-coorma.ads +++ b/gcc/ada/libgnat/a-coorma.ads @@ -60,11 +60,12 @@ is Default_Iterator => Iterate, Iterator_Element => Element_Type, Aggregate => (Empty => Empty, - Add_Named => Insert); - pragma Preelaborable_Initialization (Map); + Add_Named => Insert), + Preelaborable_Initialization; - type Cursor is private; - pragma Preelaborable_Initialization (Cursor); + type Cursor is private + with + Preelaborable_Initialization; Empty_Map : constant Map; diff --git a/gcc/ada/libgnat/a-coormu.ads b/gcc/ada/libgnat/a-coormu.ads index 2dbaacbeee29..89e878dbfcff 100644 --- a/gcc/ada/libgnat/a-coormu.ads +++ b/gcc/ada/libgnat/a-coormu.ads @@ -57,12 +57,11 @@ is type Set is tagged private with Constant_Indexing => Constant_Reference, Default_Iterator => Iterate, - Iterator_Element => Element_Type; + Iterator_Element => Element_Type, + Preelaborable_Initialization; - pragma Preelaborable_Initialization (Set); - - type Cursor is private; - pragma Preelaborable_Initialization (Cursor); + type Cursor is private + with Preelaborable_Initialization; Empty_Set : constant Set; -- The default value for set objects declared without an explicit diff --git a/gcc/ada/libgnat/a-coorse.ads b/gcc/ada/libgnat/a-coorse.ads index aa76e7388f74..c8c8bf04d605 100644 --- a/gcc/ada/libgnat/a-coorse.ads +++ b/gcc/ada/libgnat/a-coorse.ads @@ -59,12 +59,11 @@ is Default_Iterator => Iterate, Iterator_Element => Element_Type, Aggregate => (Empty => Empty, - Add_Unnamed => Include); + Add_Unnamed => Include), + Preelaborable_Initialization; - pragma Preelaborable_Initialization (Set); - - type Cursor is private; - pragma Preelaborable_Initialization (Cursor); + type Cursor is private + with Preelaborable_Initialization; function Has_Element (Position : Cursor) return Boolean; diff --git a/gcc/ada/libgnat/a-crdlli.ads b/gcc/ada/libgnat/a-crdlli.ads index 858fecb08699..1f415f6f148d 100644 --- a/gcc/ada/libgnat/a-crdlli.ads +++ b/gcc/ada/libgnat/a-crdlli.ads @@ -46,11 +46,11 @@ generic package Ada.Containers.Restricted_Doubly_Linked_Lists is pragma Pure; - type List (Capacity : Count_Type) is tagged limited private; - pragma Preelaborable_Initialization (List); + type List (Capacity : Count_Type) is tagged limited private + with Preelaborable_Initialization; - type Cursor is private; - pragma Preelaborable_Initialization (Cursor); + type Cursor is private + with Preelaborable_Initialization; Empty_List : constant List; -- The default value for list objects declared without an explicit diff --git a/gcc/ada/libgnat/a-except.ads b/gcc/ada/libgnat/a-except.ads index b1f56d125782..603fb02cc5ed 100644 --- a/gcc/ada/libgnat/a-except.ads +++ b/gcc/ada/libgnat/a-except.ads @@ -45,13 +45,13 @@ package Ada.Exceptions is pragma Preelaborate; -- In accordance with Ada 2005 AI-362. - type Exception_Id is private; - pragma Preelaborable_Initialization (Exception_Id); + type Exception_Id is private + with Preelaborable_Initialization; Null_Id : constant Exception_Id; - type Exception_Occurrence is limited private; - pragma Preelaborable_Initialization (Exception_Occurrence); + type Exception_Occurrence is limited private + with Preelaborable_Initialization; type Exception_Occurrence_Access is access all Exception_Occurrence; diff --git a/gcc/ada/libgnat/a-finali.ads b/gcc/ada/libgnat/a-finali.ads index 6c7d0f4ab49a..5125af0a0d2e 100644 --- a/gcc/ada/libgnat/a-finali.ads +++ b/gcc/ada/libgnat/a-finali.ads @@ -40,15 +40,15 @@ pragma Warnings (On); package Ada.Finalization is pragma Pure; - type Controlled is abstract tagged private; - pragma Preelaborable_Initialization (Controlled); + type Controlled is abstract tagged private + with Preelaborable_Initialization; procedure Initialize (Object : in out Controlled) is null; procedure Adjust (Object : in out Controlled) is null; procedure Finalize (Object : in out Controlled) is null; - type Limited_Controlled is abstract tagged limited private; - pragma Preelaborable_Initialization (Limited_Controlled); + type Limited_Controlled is abstract tagged limited private + with Preelaborable_Initialization; procedure Initialize (Object : in out Limited_Controlled) is null; procedure Finalize (Object : in out Limited_Controlled) is null; diff --git a/gcc/ada/libgnat/a-ngcoty.ads b/gcc/ada/libgnat/a-ngcoty.ads index 9974037c7938..f5ff0aa90a69 100644 --- a/gcc/ada/libgnat/a-ngcoty.ads +++ b/gcc/ada/libgnat/a-ngcoty.ads @@ -45,8 +45,8 @@ package Ada.Numerics.Generic_Complex_Types is pragma Complex_Representation (Complex); - type Imaginary is private; - pragma Preelaborable_Initialization (Imaginary); + type Imaginary is private + with Preelaborable_Initialization; i : constant Imaginary; j : constant Imaginary; diff --git a/gcc/ada/libgnat/a-strbou.ads b/gcc/ada/libgnat/a-strbou.ads index c849dbea07ec..857a65fa9de5 100644 --- a/gcc/ada/libgnat/a-strbou.ads +++ b/gcc/ada/libgnat/a-strbou.ads @@ -75,8 +75,9 @@ is Max_Length : constant Positive := Max; - type Bounded_String is private; - pragma Preelaborable_Initialization (Bounded_String); + type Bounded_String is private + with + Preelaborable_Initialization; Null_Bounded_String : constant Bounded_String; -- Null_Bounded_String represents the null string. If an object of type diff --git a/gcc/ada/libgnat/a-stream.ads b/gcc/ada/libgnat/a-stream.ads index b9a7b99f437b..e32219931d22 100644 --- a/gcc/ada/libgnat/a-stream.ads +++ b/gcc/ada/libgnat/a-stream.ads @@ -36,8 +36,8 @@ package Ada.Streams is pragma Pure; - type Root_Stream_Type is abstract tagged limited private; - pragma Preelaborable_Initialization (Root_Stream_Type); + type Root_Stream_Type is abstract tagged limited private + with Preelaborable_Initialization; type Stream_Element is mod 2 ** Standard'Storage_Unit; diff --git a/gcc/ada/libgnat/a-strmap.ads b/gcc/ada/libgnat/a-strmap.ads index b963a63a82c1..0b5dff32e02c 100644 --- a/gcc/ada/libgnat/a-strmap.ads +++ b/gcc/ada/libgnat/a-strmap.ads @@ -59,8 +59,8 @@ is -- Character Set Declarations -- -------------------------------- - type Character_Set is private; - pragma Preelaborable_Initialization (Character_Set); + type Character_Set is private + with Preelaborable_Initialization; -- An object of type Character_Set represents a set of characters. Null_Set : constant Character_Set; @@ -256,8 +256,8 @@ is -- Character Mapping Declarations -- ------------------------------------ - type Character_Mapping is private; - pragma Preelaborable_Initialization (Character_Mapping); + type Character_Mapping is private + with Preelaborable_Initialization; -- An object of type Character_Mapping represents a Character-to-Character -- mapping. diff --git a/gcc/ada/libgnat/a-strunb.ads b/gcc/ada/libgnat/a-strunb.ads index 60d57954e5c9..3f13b7f61ef9 100644 --- a/gcc/ada/libgnat/a-strunb.ads +++ b/gcc/ada/libgnat/a-strunb.ads @@ -73,8 +73,8 @@ is subtype String_1 is String (1 .. <>) with Ghost; -- Type used in contracts type Unbounded_String is private with - Default_Initial_Condition => Length (Unbounded_String) = 0; - pragma Preelaborable_Initialization (Unbounded_String); + Default_Initial_Condition => Length (Unbounded_String) = 0, + Preelaborable_Initialization; Null_Unbounded_String : constant Unbounded_String; -- Represents the null String. If an object of type Unbounded_String is not diff --git a/gcc/ada/libgnat/a-strunb__shared.ads b/gcc/ada/libgnat/a-strunb__shared.ads index b731183df068..f4309083d5f1 100644 --- a/gcc/ada/libgnat/a-strunb__shared.ads +++ b/gcc/ada/libgnat/a-strunb__shared.ads @@ -103,8 +103,8 @@ is subtype String_1 is String (1 .. <>) with Ghost; -- Type used in contracts type Unbounded_String is private with - Default_Initial_Condition => Length (Unbounded_String) = 0; - pragma Preelaborable_Initialization (Unbounded_String); + Default_Initial_Condition => Length (Unbounded_String) = 0, + Preelaborable_Initialization; Null_Unbounded_String : constant Unbounded_String; diff --git a/gcc/ada/libgnat/a-ststio.ads b/gcc/ada/libgnat/a-ststio.ads index 8c43ecd6ec73..be66bea6f7a4 100644 --- a/gcc/ada/libgnat/a-ststio.ads +++ b/gcc/ada/libgnat/a-ststio.ads @@ -41,8 +41,9 @@ package Ada.Streams.Stream_IO is type Stream_Access is access all Root_Stream_Type'Class; - type File_Type is limited private with Default_Initial_Condition; - pragma Preelaborable_Initialization (File_Type); + type File_Type is limited private + with Default_Initial_Condition, + Preelaborable_Initialization; type File_Mode is (In_File, Out_File, Append_File); diff --git a/gcc/ada/libgnat/a-stwibo.ads b/gcc/ada/libgnat/a-stwibo.ads index 996dc33f0b38..c22722b3642b 100644 --- a/gcc/ada/libgnat/a-stwibo.ads +++ b/gcc/ada/libgnat/a-stwibo.ads @@ -47,8 +47,8 @@ package Ada.Strings.Wide_Bounded is Max_Length : constant Positive := Max; - type Bounded_Wide_String is private; - pragma Preelaborable_Initialization (Bounded_Wide_String); + type Bounded_Wide_String is private + with Preelaborable_Initialization; Null_Bounded_Wide_String : constant Bounded_Wide_String; diff --git a/gcc/ada/libgnat/a-stwima.ads b/gcc/ada/libgnat/a-stwima.ads index be5c7fb56846..1d4fc8acf594 100644 --- a/gcc/ada/libgnat/a-stwima.ads +++ b/gcc/ada/libgnat/a-stwima.ads @@ -42,8 +42,8 @@ package Ada.Strings.Wide_Maps is -- Wide Character Set Declarations -- ------------------------------------- - type Wide_Character_Set is private; - pragma Preelaborable_Initialization (Wide_Character_Set); + type Wide_Character_Set is private + with Preelaborable_Initialization; -- Representation for a set of Wide_Character values: Null_Set : constant Wide_Character_Set; @@ -120,8 +120,8 @@ package Ada.Strings.Wide_Maps is -- Wide Character Mapping Declarations -- ----------------------------------------- - type Wide_Character_Mapping is private; - pragma Preelaborable_Initialization (Wide_Character_Mapping); + type Wide_Character_Mapping is private + with Preelaborable_Initialization; -- Representation for a wide character to wide character mapping: function Value diff --git a/gcc/ada/libgnat/a-stwiun.ads b/gcc/ada/libgnat/a-stwiun.ads index a57739946e3c..285b5d35a3cd 100644 --- a/gcc/ada/libgnat/a-stwiun.ads +++ b/gcc/ada/libgnat/a-stwiun.ads @@ -39,8 +39,8 @@ with Ada.Finalization; package Ada.Strings.Wide_Unbounded is pragma Preelaborate; - type Unbounded_Wide_String is private; - pragma Preelaborable_Initialization (Unbounded_Wide_String); + type Unbounded_Wide_String is private + with Preelaborable_Initialization; Null_Unbounded_Wide_String : constant Unbounded_Wide_String; diff --git a/gcc/ada/libgnat/a-stwiun__shared.ads b/gcc/ada/libgnat/a-stwiun__shared.ads index 00cfbdb75cca..2f0927898262 100644 --- a/gcc/ada/libgnat/a-stwiun__shared.ads +++ b/gcc/ada/libgnat/a-stwiun__shared.ads @@ -48,8 +48,8 @@ private with System.Atomic_Counters; package Ada.Strings.Wide_Unbounded is pragma Preelaborate; - type Unbounded_Wide_String is private; - pragma Preelaborable_Initialization (Unbounded_Wide_String); + type Unbounded_Wide_String is private + with Preelaborable_Initialization; Null_Unbounded_Wide_String : constant Unbounded_Wide_String; diff --git a/gcc/ada/libgnat/a-stzbou.ads b/gcc/ada/libgnat/a-stzbou.ads index b0ca520d0c03..278875f68ff9 100644 --- a/gcc/ada/libgnat/a-stzbou.ads +++ b/gcc/ada/libgnat/a-stzbou.ads @@ -47,8 +47,8 @@ package Ada.Strings.Wide_Wide_Bounded is Max_Length : constant Positive := Max; - type Bounded_Wide_Wide_String is private; - pragma Preelaborable_Initialization (Bounded_Wide_Wide_String); + type Bounded_Wide_Wide_String is private + with Preelaborable_Initialization; Null_Bounded_Wide_Wide_String : constant Bounded_Wide_Wide_String; diff --git a/gcc/ada/libgnat/a-stzmap.ads b/gcc/ada/libgnat/a-stzmap.ads index 201ed713d825..c0ad1643122d 100644 --- a/gcc/ada/libgnat/a-stzmap.ads +++ b/gcc/ada/libgnat/a-stzmap.ads @@ -42,8 +42,8 @@ package Ada.Strings.Wide_Wide_Maps is -- Wide_Wide_Character Set Declarations -- ------------------------------------------ - type Wide_Wide_Character_Set is private; - pragma Preelaborable_Initialization (Wide_Wide_Character_Set); + type Wide_Wide_Character_Set is private + with Preelaborable_Initialization; -- Representation for a set of Wide_Wide_Character values: Null_Set : constant Wide_Wide_Character_Set; @@ -120,8 +120,8 @@ package Ada.Strings.Wide_Wide_Maps is -- Wide_Wide_Character Mapping Declarations -- ---------------------------------------------- - type Wide_Wide_Character_Mapping is private; - pragma Preelaborable_Initialization (Wide_Wide_Character_Mapping); + type Wide_Wide_Character_Mapping is private + with Preelaborable_Initialization; -- Representation for a wide character to wide character mapping: function Value diff --git a/gcc/ada/libgnat/a-stzunb.ads b/gcc/ada/libgnat/a-stzunb.ads index 8cecbcde1fba..34e41e15a961 100644 --- a/gcc/ada/libgnat/a-stzunb.ads +++ b/gcc/ada/libgnat/a-stzunb.ads @@ -39,8 +39,8 @@ with Ada.Finalization; package Ada.Strings.Wide_Wide_Unbounded is pragma Preelaborate; - type Unbounded_Wide_Wide_String is private; - pragma Preelaborable_Initialization (Unbounded_Wide_Wide_String); + type Unbounded_Wide_Wide_String is private + with Preelaborable_Initialization; Null_Unbounded_Wide_Wide_String : constant Unbounded_Wide_Wide_String; diff --git a/gcc/ada/libgnat/a-stzunb__shared.ads b/gcc/ada/libgnat/a-stzunb__shared.ads index 1d57510baf86..f56043b47a32 100644 --- a/gcc/ada/libgnat/a-stzunb__shared.ads +++ b/gcc/ada/libgnat/a-stzunb__shared.ads @@ -48,8 +48,8 @@ private with System.Atomic_Counters; package Ada.Strings.Wide_Wide_Unbounded is pragma Preelaborate; - type Unbounded_Wide_Wide_String is private; - pragma Preelaborable_Initialization (Unbounded_Wide_Wide_String); + type Unbounded_Wide_Wide_String is private + with Preelaborable_Initialization; Null_Unbounded_Wide_Wide_String : constant Unbounded_Wide_Wide_String; diff --git a/gcc/ada/libgnat/a-swunau.adb b/gcc/ada/libgnat/a-swunau.adb index acb9b6df4fe5..1ae8e19d0d6e 100644 --- a/gcc/ada/libgnat/a-swunau.adb +++ b/gcc/ada/libgnat/a-swunau.adb @@ -62,4 +62,17 @@ package body Ada.Strings.Wide_Unbounded.Aux is UP.Last := UP.Reference'Length; end Set_Wide_String; + procedure Set_Wide_String + (U : out Unbounded_Wide_String; + Length : Positive; + Set : not null access procedure (S : out Wide_String)) + is + Old : Wide_String_Access := U.Reference; + begin + U.Last := Length; + U.Reference := new Wide_String (1 .. Length); + Set (U.Reference.all); + Free (Old); + end Set_Wide_String; + end Ada.Strings.Wide_Unbounded.Aux; diff --git a/gcc/ada/libgnat/a-swunau.ads b/gcc/ada/libgnat/a-swunau.ads index ba4ccaa3af95..ea33db01a11e 100644 --- a/gcc/ada/libgnat/a-swunau.ads +++ b/gcc/ada/libgnat/a-swunau.ads @@ -73,4 +73,12 @@ package Ada.Strings.Wide_Unbounded.Aux is -- than string. The lower bound of the string value is required to be one, -- and this requirement is not checked. + procedure Set_Wide_String + (U : out Unbounded_Wide_String; + Length : Positive; + Set : not null access procedure (S : out Wide_String)); + pragma Inline (Set_Wide_String); + -- Create an unbounded string U with the given Length, using Set to fill + -- the contents of U. + end Ada.Strings.Wide_Unbounded.Aux; diff --git a/gcc/ada/libgnat/a-swunau__shared.adb b/gcc/ada/libgnat/a-swunau__shared.adb index fdaf8467e606..2d3366401f16 100644 --- a/gcc/ada/libgnat/a-swunau__shared.adb +++ b/gcc/ada/libgnat/a-swunau__shared.adb @@ -62,4 +62,30 @@ package body Ada.Strings.Wide_Unbounded.Aux is Free (X); end Set_Wide_String; + procedure Set_Wide_String + (U : out Unbounded_Wide_String; + Length : Positive; + Set : not null access procedure (S : out Wide_String)) + is + TR : constant Shared_Wide_String_Access := U.Reference; + DR : Shared_Wide_String_Access; + begin + -- Try to reuse existing shared string + + if Can_Be_Reused (TR, Length) then + Reference (TR); + DR := TR; + + -- Otherwise allocate new shared string + + else + DR := Allocate (Length); + U.Reference := DR; + end if; + + Set (DR.Data (1 .. Length)); + DR.Last := Length; + Unreference (TR); + end Set_Wide_String; + end Ada.Strings.Wide_Unbounded.Aux; diff --git a/gcc/ada/libgnat/a-szunau.adb b/gcc/ada/libgnat/a-szunau.adb index 5436e2f0d7ea..903b2c9e4df0 100644 --- a/gcc/ada/libgnat/a-szunau.adb +++ b/gcc/ada/libgnat/a-szunau.adb @@ -62,4 +62,17 @@ package body Ada.Strings.Wide_Wide_Unbounded.Aux is UP.Last := UP.Reference'Length; end Set_Wide_Wide_String; + procedure Set_Wide_Wide_String + (U : out Unbounded_Wide_Wide_String; + Length : Positive; + Set : not null access procedure (S : out Wide_Wide_String)) + is + Old : Wide_Wide_String_Access := U.Reference; + begin + U.Last := Length; + U.Reference := new Wide_Wide_String (1 .. Length); + Set (U.Reference.all); + Free (Old); + end Set_Wide_Wide_String; + end Ada.Strings.Wide_Wide_Unbounded.Aux; diff --git a/gcc/ada/libgnat/a-szunau.ads b/gcc/ada/libgnat/a-szunau.ads index 3f90d2802988..486ac137bfcd 100644 --- a/gcc/ada/libgnat/a-szunau.ads +++ b/gcc/ada/libgnat/a-szunau.ads @@ -75,4 +75,12 @@ package Ada.Strings.Wide_Wide_Unbounded.Aux is -- than string. The lower bound of the string value is required to be one, -- and this requirement is not checked. + procedure Set_Wide_Wide_String + (U : out Unbounded_Wide_Wide_String; + Length : Positive; + Set : not null access procedure (S : out Wide_Wide_String)); + pragma Inline (Set_Wide_Wide_String); + -- Create an unbounded string U with the given Length, using Set to fill + -- the contents of U. + end Ada.Strings.Wide_Wide_Unbounded.Aux; diff --git a/gcc/ada/libgnat/a-szunau__shared.adb b/gcc/ada/libgnat/a-szunau__shared.adb index dc9b2984883a..9fa937e74654 100644 --- a/gcc/ada/libgnat/a-szunau__shared.adb +++ b/gcc/ada/libgnat/a-szunau__shared.adb @@ -62,4 +62,30 @@ package body Ada.Strings.Wide_Wide_Unbounded.Aux is Free (X); end Set_Wide_Wide_String; + procedure Set_Wide_Wide_String + (U : out Unbounded_Wide_Wide_String; + Length : Positive; + Set : not null access procedure (S : out Wide_Wide_String)) + is + TR : constant Shared_Wide_Wide_String_Access := U.Reference; + DR : Shared_Wide_Wide_String_Access; + begin + -- Try to reuse existing shared string + + if Can_Be_Reused (TR, Length) then + Reference (TR); + DR := TR; + + -- Otherwise allocate new shared string + + else + DR := Allocate (Length); + U.Reference := DR; + end if; + + Set (DR.Data (1 .. Length)); + DR.Last := Length; + Unreference (TR); + end Set_Wide_Wide_String; + end Ada.Strings.Wide_Wide_Unbounded.Aux; diff --git a/gcc/ada/libgnat/a-tags.ads b/gcc/ada/libgnat/a-tags.ads index aec3a268c3bb..fecd2ba6077c 100644 --- a/gcc/ada/libgnat/a-tags.ads +++ b/gcc/ada/libgnat/a-tags.ads @@ -71,8 +71,8 @@ package Ada.Tags is pragma Preelaborate; -- In accordance with Ada 2005 AI-362 - type Tag is private; - pragma Preelaborable_Initialization (Tag); + type Tag is private + with Preelaborable_Initialization; No_Tag : constant Tag; diff --git a/gcc/ada/libgnat/g-c_time.ads b/gcc/ada/libgnat/g-c_time.ads new file mode 100644 index 000000000000..02461955b2f4 --- /dev/null +++ b/gcc/ada/libgnat/g-c_time.ads @@ -0,0 +1,38 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- +-- -- +-- G N A T . C _ T I M E -- +-- -- +-- S p e c -- +-- -- +-- Copyright (C) 2025, AdaCore -- +-- -- +-- 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 -- +-- . -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +-- This package provides the time_t, timeval and timespec types corresponding +-- to the C types defined by the OS, as well as various conversion functions. + +-- See file s-c_time.ads for full documentation of the interface + +with System.C_Time; +package GNAT.C_Time renames System.C_Time; diff --git a/gcc/ada/libgnat/g-calend.adb b/gcc/ada/libgnat/g-calend.adb index a2bc77c1cc7b..80b62b7547f5 100644 --- a/gcc/ada/libgnat/g-calend.adb +++ b/gcc/ada/libgnat/g-calend.adb @@ -29,11 +29,8 @@ -- -- ------------------------------------------------------------------------------ -with Interfaces.C.Extensions; - package body GNAT.Calendar is use Ada.Calendar; - use Interfaces; ----------------- -- Day_In_Year -- @@ -333,25 +330,8 @@ package body GNAT.Calendar is ----------------- function To_Duration (T : not null access timeval) return Duration is - - procedure timeval_to_duration - (T : not null access timeval; - sec : not null access C.Extensions.long_long; - usec : not null access C.long); - pragma Import (C, timeval_to_duration, "__gnat_timeval_to_duration"); - - Micro : constant := 10**6; - sec : aliased C.Extensions.long_long; - usec : aliased C.long; - - pragma Unsuppress (Overflow_Check); - begin - timeval_to_duration (T, sec'Access, usec'Access); - pragma Annotate (CodePeer, Modified, sec); - pragma Annotate (CodePeer, Modified, usec); - - return Duration (sec) + Duration (usec) / Micro; + return System.C_Time.To_Duration (T.all); end To_Duration; ---------------- @@ -359,45 +339,8 @@ package body GNAT.Calendar is ---------------- function To_Timeval (D : Duration) return timeval is - - procedure duration_to_timeval - (Sec : C.Extensions.long_long; - Usec : C.long; - T : not null access timeval); - pragma Import (C, duration_to_timeval, "__gnat_duration_to_timeval"); - - Micro : constant := 10**6; - Result : aliased timeval; - sec : C.Extensions.long_long; - usec : C.long; - - pragma Unsuppress (Overflow_Check); - begin - if D = 0.0 then - sec := 0; - usec := 0; - - elsif D < 0.0 then - sec := C.Extensions.long_long (D + 0.5); - if D = Duration (sec) then - usec := 0; - else - usec := C.long ((D - Duration (sec)) * Micro + 0.5); - end if; - - else - sec := C.Extensions.long_long (D - 0.5); - if D = Duration (sec) then - usec := 0; - else - usec := C.long ((D - Duration (sec)) * Micro - 0.5); - end if; - end if; - - duration_to_timeval (sec, usec, Result'Access); - - return Result; + return System.C_Time.To_Timeval (D); end To_Timeval; ------------------ diff --git a/gcc/ada/libgnat/g-calend.ads b/gcc/ada/libgnat/g-calend.ads index a3294993aa6d..c57b7df7a220 100644 --- a/gcc/ada/libgnat/g-calend.ads +++ b/gcc/ada/libgnat/g-calend.ads @@ -40,7 +40,8 @@ -- Day_Of_Week, Day_In_Year and Week_In_Year. with Ada.Calendar.Formatting; -with Interfaces.C; + +with System.C_Time; package GNAT.Calendar is @@ -126,7 +127,7 @@ package GNAT.Calendar is -- locale (equivalent to Clock). Due to this simplified behavior, the -- implementation does not require expensive system calls on targets such -- as Windows. - -- WARNING: Split_At_Locale is no longer aware of historic events and may + -- WARNING: Time_At_Locale is no longer aware of historic events and may -- produce inaccurate results over DST changes which occurred in the past. function Week_In_Year (Date : Ada.Calendar.Time) return Week_In_Year_Number; @@ -145,24 +146,18 @@ package GNAT.Calendar is -- Return the week number as defined in ISO 8601 along with the year in -- which the week occurs. - -- C timeval conversion - - -- C timeval represent a duration (used in Select for example). This - -- structure is composed of a number of seconds and a number of micro - -- seconds. The timeval structure is not exposed here because its - -- definition is target dependent. Interface to C programs is done via a - -- pointer to timeval structure. - - type timeval is private; + subtype timeval is System.C_Time.timeval; + pragma Obsolescent (timeval, "use type from GNAT.C_Time instead"); function To_Duration (T : not null access timeval) return Duration; + pragma Inline (To_Duration); + pragma Obsolescent (To_Duration, "use function from GNAT.C_Time instead"); + function To_Timeval (D : Duration) return timeval; + pragma Inline (To_Timeval); + pragma Obsolescent (To_Timeval, "use function from GNAT.C_Time instead"); private - -- This is a dummy declaration that should be the largest possible timeval - -- structure of all supported targets. - - type timeval is array (1 .. 3) of Interfaces.C.long; function Julian_Day (Year : Ada.Calendar.Year_Number; diff --git a/gcc/ada/libgnat/g-catiio.adb b/gcc/ada/libgnat/g-catiio.adb index 531070616a22..d229b3ba61b5 100644 --- a/gcc/ada/libgnat/g-catiio.adb +++ b/gcc/ada/libgnat/g-catiio.adb @@ -515,7 +515,7 @@ package body GNAT.Calendar.Time_IO is Result := Result & Image (Month_Name'Image (Month_Name'Val (Month - 1))); - -- Locale's date and time (Sat Nov 04 12:02:33 EST 1989) + -- Locale's date and time (Sat Nov 04 12:02:33 1989) when 'c' => case Padding is diff --git a/gcc/ada/libgnat/g-socket.adb b/gcc/ada/libgnat/g-socket.adb index 0fed79177544..37232ec031c0 100644 --- a/gcc/ada/libgnat/g-socket.adb +++ b/gcc/ada/libgnat/g-socket.adb @@ -47,6 +47,7 @@ with GNAT.Sockets.Poll; with System; use System; with System.Communication; use System.Communication; with System.CRTL; use System.CRTL; +with System.C_Time; with System.Task_Lock; package body GNAT.Sockets is @@ -179,13 +180,6 @@ package body GNAT.Sockets is function Value (S : System.Address) return String; -- Same as Interfaces.C.Strings.Value but taking a System.Address - function To_Timeval (Val : Timeval_Duration) return Timeval; - -- Separate Val in seconds and microseconds - - function To_Duration (Val : Timeval) return Timeval_Duration; - -- Reconstruct a Duration value from a Timeval record (seconds and - -- microseconds). - function Dedot (Value : String) return String is (if Value /= "" and then Value (Value'Last) = '.' then Value (Value'First .. Value'Last - 1) @@ -528,7 +522,7 @@ package body GNAT.Sockets is Res : C.int; Last : C.int; RSig : Socket_Type := No_Socket; - TVal : aliased Timeval; + TVal : aliased System.C_Time.timeval; TPtr : Timeval_Access; begin @@ -543,7 +537,7 @@ package body GNAT.Sockets is if Timeout = Forever then TPtr := null; else - TVal := To_Timeval (Timeout); + TVal := System.C_Time.To_Timeval (Timeout); TPtr := TVal'Unchecked_Access; end if; @@ -1423,7 +1417,7 @@ package body GNAT.Sockets is U4 : aliased C.unsigned; V1 : aliased C.unsigned_char; VS : aliased C.char_array (1 .. NS); -- for devices name - VT : aliased Timeval; + VT : aliased System.C_Time.timeval; Len : aliased C.int; Add : System.Address; Res : C.int; @@ -1596,8 +1590,10 @@ package body GNAT.Sockets is Opt.Timeout := Duration (U4) / 1000; end if; + elsif System.C_Time.In_Timeval_Duration (VT) then + Opt.Timeout := System.C_Time.To_Duration (VT); else - Opt.Timeout := To_Duration (VT); + Opt.Timeout := Forever; end if; when Bind_To_Device => @@ -1958,7 +1954,7 @@ package body GNAT.Sockets is procedure Listen_Socket (Socket : Socket_Type; - Length : Natural := 15) + Length : Natural := SOSC.BACKLOG_MAX) is Res : constant C.int := C_Listen (C.int (Socket), C.int (Length)); begin @@ -2633,7 +2629,7 @@ package body GNAT.Sockets is (1 .. (if Option.Name = Bind_To_Device then C.size_t (ASU.Length (Option.Device) + 1) else 0)); - VT : aliased Timeval; + VT : aliased System.C_Time.timeval; Len : C.int; Add : System.Address := Null_Address; Res : C.int; @@ -2767,7 +2763,7 @@ package body GNAT.Sockets is end if; else - VT := To_Timeval (Option.Timeout); + VT := System.C_Time.To_Timeval (Option.Timeout); Len := VT'Size / 8; Add := VT'Address; end if; @@ -2865,33 +2861,6 @@ package body GNAT.Sockets is return Integer (Socket); end To_C; - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (Val : Timeval) return Timeval_Duration is - Max_D : constant Long_Long_Integer := Long_Long_Integer (Forever - 0.5); - Tv_sec_64 : constant Boolean := SOSC.SIZEOF_tv_sec = 8; - -- Need to separate this condition into the constant declaration to - -- avoid GNAT warning about "always true" or "always false". - begin - if Tv_sec_64 then - -- Check for possible Duration overflow when Tv_Sec field is 64 bit - -- integer. - - if Val.Tv_Sec > time_t (Max_D) - or else - (Val.Tv_Sec = time_t (Max_D) - and then - Val.Tv_Usec > suseconds_t ((Forever - Duration (Max_D)) * 1E6)) - then - return Forever; - end if; - end if; - - return Duration (Val.Tv_Sec) + Duration (Val.Tv_Usec) * 1.0E-6; - end To_Duration; - ------------------- -- To_Host_Entry -- ------------------- @@ -3041,35 +3010,6 @@ package body GNAT.Sockets is return HN.Name (1 .. HN.Length); end To_String; - ---------------- - -- To_Timeval -- - ---------------- - - function To_Timeval (Val : Timeval_Duration) return Timeval is - S : time_t; - uS : suseconds_t; - - begin - -- If zero, set result as zero (otherwise it gets rounded down to -1) - - if Val = 0.0 then - S := 0; - uS := 0; - - -- Normal case where we do round down - - else - S := time_t (Val - 0.5); - if Val = Timeval_Duration (S) then - uS := 0; - else - uS := suseconds_t ((Val - Timeval_Duration (S)) * 1_000_000 - 0.5); - end if; - end if; - - return (S, uS); - end To_Timeval; - ----------- -- Value -- ----------- diff --git a/gcc/ada/libgnat/g-socket.ads b/gcc/ada/libgnat/g-socket.ads index 1fe8a74ef11e..7c6534cd71c9 100644 --- a/gcc/ada/libgnat/g-socket.ads +++ b/gcc/ada/libgnat/g-socket.ads @@ -1219,7 +1219,7 @@ package GNAT.Sockets is procedure Listen_Socket (Socket : Socket_Type; - Length : Natural := 15); + Length : Natural := SOSC.BACKLOG_MAX); -- To accept connections, a socket is first created with Create_Socket, -- a willingness to accept incoming connections and a queue Length for -- incoming connections are specified. Raise Socket_Error on error. diff --git a/gcc/ada/libgnat/g-socthi.adb b/gcc/ada/libgnat/g-socthi.adb index 5540dce04aef..c79b8db868be 100644 --- a/gcc/ada/libgnat/g-socthi.adb +++ b/gcc/ada/libgnat/g-socthi.adb @@ -40,6 +40,8 @@ with GNAT.Task_Lock; with Interfaces.C; use Interfaces.C; +with System.C_Time; + package body GNAT.Sockets.Thin is Non_Blocking_Sockets : aliased Fd_Set; @@ -215,7 +217,7 @@ package body GNAT.Sockets.Thin is declare -- unreachable if Thread_Blocking_IO is statically True pragma Warnings (On, "unreachable code"); WSet : aliased Fd_Set; - Now : aliased Timeval; + Now : aliased System.C_Time.timeval; begin Reset_Socket_Set (WSet'Access); diff --git a/gcc/ada/libgnat/g-socthi__vxworks.adb b/gcc/ada/libgnat/g-socthi__vxworks.adb index a3f05b384025..6ae74eb5f6bf 100644 --- a/gcc/ada/libgnat/g-socthi__vxworks.adb +++ b/gcc/ada/libgnat/g-socthi__vxworks.adb @@ -40,6 +40,8 @@ with GNAT.Task_Lock; with Interfaces.C; use Interfaces.C; +with System.C_Time; + package body GNAT.Sockets.Thin is Non_Blocking_Sockets : aliased Fd_Set; @@ -194,7 +196,7 @@ package body GNAT.Sockets.Thin is declare -- unreachable if Thread_Blocking_IO is statically True pragma Warnings (On, "unreachable code"); WSet : aliased Fd_Set; - Now : aliased Timeval; + Now : aliased System.C_Time.timeval; begin Reset_Socket_Set (WSet'Access); loop diff --git a/gcc/ada/libgnat/g-sothco.ads b/gcc/ada/libgnat/g-sothco.ads index cdf0a16ef086..ec9b5746f0c6 100644 --- a/gcc/ada/libgnat/g-sothco.ads +++ b/gcc/ada/libgnat/g-sothco.ads @@ -33,8 +33,10 @@ -- This package should not be directly with'ed by an applications program. with Ada.Unchecked_Conversion; + with Interfaces.C.Strings; -with System.Parameters; + +with System.C_Time; package GNAT.Sockets.Thin_Common is @@ -44,31 +46,23 @@ package GNAT.Sockets.Thin_Common is Success : constant C.int := 0; Failure : constant C.int := -1; - type time_t is - range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - for time_t'Size use System.Parameters.time_t_bits; - pragma Convention (C, time_t); - - type suseconds_t is - range -2 ** (8 * SOSC.SIZEOF_tv_usec - 1) - .. 2 ** (8 * SOSC.SIZEOF_tv_usec - 1) - 1; - for suseconds_t'Size use 8 * SOSC.SIZEOF_tv_usec; - pragma Convention (C, suseconds_t); - - type Timeval is record - Tv_Sec : time_t; - Tv_Usec : suseconds_t; - end record; - pragma Convention (C, Timeval); + subtype time_t is System.C_Time.time_t; + pragma Obsolescent (time_t, "use type from GNAT.C_Time instead"); + + subtype suseconds_t is System.C_Time.usec_t; + pragma Obsolescent (suseconds_t, "use type from GNAT.C_Time instead"); + + subtype timeval is System.C_Time.timeval; + pragma Obsolescent (timeval, "use type from GNAT.C_Time instead"); - type Timeval_Access is access all Timeval; + type Timeval_Access is access all System.C_Time.timeval; pragma Convention (C, Timeval_Access); type socklen_t is mod 2 ** (8 * SOSC.SIZEOF_socklen_t); for socklen_t'Size use (8 * SOSC.SIZEOF_socklen_t); - Immediat : constant Timeval := (0, 0); + Immediat : constant System.C_Time.timeval + := System.C_Time.Milliseconds_To_Timeval (0); ------------------------------------------- -- Mapping tables to low level constants -- diff --git a/gcc/ada/libgnat/g-spogwa.adb b/gcc/ada/libgnat/g-spogwa.adb index a4bbf962a9f3..3752b2bf4422 100644 --- a/gcc/ada/libgnat/g-spogwa.adb +++ b/gcc/ada/libgnat/g-spogwa.adb @@ -29,7 +29,7 @@ -- -- ------------------------------------------------------------------------------ -with GNAT.Sockets.Thin_Common; +with System.C_Time; procedure GNAT.Sockets.Poll.G_Wait (Fds : in out Set; Timeout : Interfaces.C.int; Result : out Integer) @@ -41,11 +41,11 @@ is readfds : access FD_Set_Type; writefds : access FD_Set_Type; exceptfds : access FD_Set_Type; - timeout : access Thin_Common.Timeval) return Integer + timeout : access System.C_Time.timeval) return Integer with Import => True, Convention => Stdcall, External_Name => "select"; - Timeout_V : aliased Thin_Common.Timeval; - Timeout_A : access Thin_Common.Timeval; + Timeout_V : aliased System.C_Time.timeval; + Timeout_A : access System.C_Time.timeval; Rfds : aliased FD_Set_Type; Rcount : Natural := 0; @@ -63,8 +63,7 @@ begin if Timeout >= 0 then Timeout_A := Timeout_V'Access; - Timeout_V.Tv_Sec := Thin_Common.time_t (Timeout / 1000); - Timeout_V.Tv_Usec := Thin_Common.suseconds_t (Timeout rem 1000 * 1000); + Timeout_V := System.C_Time.Milliseconds_To_Timeval (Timeout); end if; Reset_Socket_Set (Rfds); diff --git a/gcc/ada/libgnat/i-cstrin.ads b/gcc/ada/libgnat/i-cstrin.ads index 5939fe041a47..4396690eed94 100644 --- a/gcc/ada/libgnat/i-cstrin.ads +++ b/gcc/ada/libgnat/i-cstrin.ads @@ -62,8 +62,9 @@ is -- coming from who knows where, it seems a good idea to turn off any -- strict aliasing assumptions for this type. - type chars_ptr is private; - pragma Preelaborable_Initialization (chars_ptr); + type chars_ptr is private + with + Preelaborable_Initialization; type chars_ptr_array is array (size_t range <>) of aliased chars_ptr; diff --git a/gcc/ada/libgnat/s-aridou.adb b/gcc/ada/libgnat/s-aridou.adb index dd2f150252a9..aa9c54636493 100644 --- a/gcc/ada/libgnat/s-aridou.adb +++ b/gcc/ada/libgnat/s-aridou.adb @@ -128,6 +128,20 @@ is Raise_Error; end Add_With_Ovflo_Check; + -------------------------- + -- Add_With_Ovflo_Check -- + -------------------------- + + function Add_With_Ovflo_Check (X, Y : Double_Uns) return Double_Uns is + R : constant Double_Uns := X + Y; + begin + if R < X then + Raise_Error; + end if; + + return R; + end Add_With_Ovflo_Check; + ------------------- -- Double_Divide -- ------------------- @@ -336,6 +350,49 @@ is end if; end Multiply_With_Ovflo_Check; + ------------------------------- + -- Multiply_With_Ovflo_Check -- + ------------------------------- + + function Multiply_With_Ovflo_Check (X, Y : Double_Uns) return Double_Uns is + Xhi : constant Single_Uns := Hi (X); + Xlo : constant Single_Uns := Lo (X); + + Yhi : constant Single_Uns := Hi (Y); + Ylo : constant Single_Uns := Lo (Y); + + T1, T2 : Double_Uns; + + begin + if Xhi /= 0 then + if Yhi /= 0 then + Raise_Error; + else + T2 := Xhi * Ylo; + end if; + + elsif Yhi /= 0 then + T2 := Xlo * Yhi; + + else -- Yhi = Xhi = 0 + T2 := 0; + end if; + + -- Here we have T2 set to the contribution to the upper half of the + -- result from the upper halves of the input values. + + T1 := Xlo * Ylo; + T2 := T2 + Hi (T1); + + if Hi (T2) /= 0 then + Raise_Error; + end if; + + T2 := Lo (T2) & Lo (T1); + + return T2; + end Multiply_With_Ovflo_Check; + ----------------- -- Raise_Error -- ----------------- @@ -655,6 +712,20 @@ is Raise_Error; end Subtract_With_Ovflo_Check; + ------------------------------- + -- Subtract_With_Ovflo_Check -- + ------------------------------- + + function Subtract_With_Ovflo_Check (X, Y : Double_Uns) return Double_Uns is + R : constant Double_Uns := X - Y; + begin + if R > X then + Raise_Error; + end if; + + return R; + end Subtract_With_Ovflo_Check; + ---------------- -- To_Neg_Int -- ---------------- diff --git a/gcc/ada/libgnat/s-aridou.ads b/gcc/ada/libgnat/s-aridou.ads index f7240ded4d83..61b94a9a34c3 100644 --- a/gcc/ada/libgnat/s-aridou.ads +++ b/gcc/ada/libgnat/s-aridou.ads @@ -53,6 +53,10 @@ generic package System.Arith_Double with Pure, SPARK_Mode is + ---------------- + -- Double_Int -- + ---------------- + function Add_With_Ovflo_Check (X, Y : Double_Int) return Double_Int; -- Raises Constraint_Error if sum of operands overflows Double_Int, -- otherwise returns this sum of operands as Double_Int. @@ -145,4 +149,36 @@ is -- Double_Uns division is then performed, the result is rounded, its sign -- is corrected, and then returned. + ---------------- + -- Double_Uns -- + ---------------- + + function Add_With_Ovflo_Check (X, Y : Double_Uns) return Double_Uns; + -- Raises Constraint_Error if sum of operands overflows Double_Uns, + -- otherwise returns this sum of operands as Double_Uns. + -- + -- The sum of ``X`` and ``Y`` is first computed. If the result is + -- lower than the first operand, then an overflow occurred and the + -- exception *Constraint_Error* is raised; otherwise the result is + -- correct. + + function Subtract_With_Ovflo_Check (X, Y : Double_Uns) return Double_Uns; + -- Raises Constraint_Error if difference of operands overflows Double_Uns, + -- otherwise returns this difference of operands as Double_Int. + -- + -- The subtraction of ``X`` and ``Y`` is first computed. If the result + -- is greater than the first operand, then an overflow occurred and the + -- exception *Constraint_Error* is raised; otherwise the result is + -- correct. + + function Multiply_With_Ovflo_Check (X, Y : Double_Uns) return Double_Uns + with Convention => C; + -- Raises Constraint_Error if product of operands overflows Double_Uns, + -- otherwise returns this product of operands as Double_Uns. The code + -- generator may also generate direct calls to this routine. + -- + -- The multiplication is done using pencil and paper algorithm applied to + -- Single_Uns, then the correct Double_Uns value is returned. Overflow + -- check is performed by looking at higher digits. + end System.Arith_Double; diff --git a/gcc/ada/libgnat/s-arit128.adb b/gcc/ada/libgnat/s-arit128.adb index c4ef40dcaf04..66c54f9bae65 100644 --- a/gcc/ada/libgnat/s-arit128.adb +++ b/gcc/ada/libgnat/s-arit128.adb @@ -34,7 +34,6 @@ with System.Arith_Double; package body System.Arith_128 with SPARK_Mode is - subtype Uns128 is Interfaces.Unsigned_128; subtype Uns64 is Interfaces.Unsigned_64; use Interfaces; @@ -62,4 +61,13 @@ is Round : Boolean) renames Impl.Double_Divide; + function Uns_Add_With_Ovflo_Check128 (X, Y : Uns128) return Uns128 + renames Impl.Add_With_Ovflo_Check; + + function Uns_Subtract_With_Ovflo_Check128 (X, Y : Uns128) return Uns128 + renames Impl.Subtract_With_Ovflo_Check; + + function Uns_Multiply_With_Ovflo_Check128 (X, Y : Uns128) return Uns128 + renames Impl.Multiply_With_Ovflo_Check; + end System.Arith_128; diff --git a/gcc/ada/libgnat/s-arit128.ads b/gcc/ada/libgnat/s-arit128.ads index ea4ef6b3fa9f..de1be0cc45c0 100644 --- a/gcc/ada/libgnat/s-arit128.ads +++ b/gcc/ada/libgnat/s-arit128.ads @@ -41,6 +41,10 @@ with Interfaces; package System.Arith_128 with Pure, SPARK_Mode is + ------------ + -- Int128 -- + ------------ + subtype Int128 is Interfaces.Integer_128; function Add_With_Ovflo_Check128 (X, Y : Int128) return Int128; @@ -81,4 +85,39 @@ is -- then Q is the rounded quotient. The remainder R is not affected by the -- setting of the Round flag. + ------------ + -- Uns128 -- + ------------ + + subtype Uns128 is Interfaces.Unsigned_128; + + function Uns_Add_With_Ovflo_Check128 (X, Y : Uns128) return Uns128; + -- Raises Constraint_Error if sum of operands overflows 128 bits, + -- otherwise returns the 128-bit unsigned integer sum. + -- + -- The sum of ``X`` and ``Y`` is first computed. If the result is + -- lower than the first operand, then an overflow occurred and the + -- exception *Constraint_Error* is raised; otherwise the result is + -- correct. + + function Uns_Subtract_With_Ovflo_Check128 (X, Y : Uns128) return Uns128; + -- Raises Constraint_Error if difference of operands overflows 128 bits, + -- otherwise returns the 128-bit unsigned integer difference. + -- + -- The subtraction of ``X`` and ``Y`` is first computed. If the result + -- is greater than the first operand, then an overflow occurred and the + -- exception *Constraint_Error* is raised; otherwise the result is + -- correct. + + function Uns_Multiply_With_Ovflo_Check128 (X, Y : Uns128) return Uns128; + pragma Export (C, Uns_Multiply_With_Ovflo_Check128, "__gnat_uns_mulv128"); + -- Raises Constraint_Error if product of operands overflows 128 bits, + -- otherwise returns the 128-bit signed integer product. The code + -- generator may also generate direct calls to this routine. + -- + -- The multiplication is done using pencil and paper algorithm using base + -- 2**32. The multiplication is done on unsigned values, then the correct + -- unsigned value is returned. Overflow check is performed by looking at + -- higher digits. + end System.Arith_128; diff --git a/gcc/ada/libgnat/s-arit64.adb b/gcc/ada/libgnat/s-arit64.adb index 4e0336f4f166..fdf4331fa84c 100644 --- a/gcc/ada/libgnat/s-arit64.adb +++ b/gcc/ada/libgnat/s-arit64.adb @@ -34,7 +34,6 @@ with System.Arith_Double; package body System.Arith_64 with SPARK_Mode is - subtype Uns64 is Interfaces.Unsigned_64; subtype Uns32 is Interfaces.Unsigned_32; use Interfaces; @@ -62,4 +61,13 @@ is Round : Boolean) renames Impl.Double_Divide; + function Uns_Add_With_Ovflo_Check64 (X, Y : Uns64) return Uns64 + renames Impl.Add_With_Ovflo_Check; + + function Uns_Subtract_With_Ovflo_Check64 (X, Y : Uns64) return Uns64 + renames Impl.Subtract_With_Ovflo_Check; + + function Uns_Multiply_With_Ovflo_Check64 (X, Y : Uns64) return Uns64 + renames Impl.Multiply_With_Ovflo_Check; + end System.Arith_64; diff --git a/gcc/ada/libgnat/s-arit64.ads b/gcc/ada/libgnat/s-arit64.ads index 6e1278988bcf..671f04cb81d9 100644 --- a/gcc/ada/libgnat/s-arit64.ads +++ b/gcc/ada/libgnat/s-arit64.ads @@ -41,6 +41,10 @@ with Interfaces; package System.Arith_64 with Pure, SPARK_Mode is + ----------- + -- Int64 -- + ----------- + subtype Int64 is Interfaces.Integer_64; function Add_With_Ovflo_Check64 (X, Y : Int64) return Int64; @@ -147,4 +151,41 @@ is Round : Boolean) renames Double_Divide64; -- Renamed procedure to preserve compatibility with earlier versions + ----------- + -- Uns64 -- + ----------- + + subtype Uns64 is Interfaces.Unsigned_64; + + function Uns_Add_With_Ovflo_Check64 (X, Y : Uns64) return Uns64; + -- Raises Constraint_Error if sum of operands overflows 64 bits, + -- otherwise returns the 64 bits unsigned integer sum. + -- + -- The sum of ``X`` and ``Y`` is first computed. If the result is + -- lower than the first operand, then an overflow occurred and the + -- exception *Constraint_Error* is raised; otherwise the result is + -- correct. + + function Uns_Subtract_With_Ovflo_Check64 (X, Y : Uns64) return Uns64; + -- Raises Constraint_Error if difference of operands overflows 64 bits, + -- otherwise returns the 64-bit unsigned integer difference. + -- + -- The subtraction of ``X`` and ``Y`` is first computed using wrap-around + -- semantics. + -- + -- If the sign of the result is negative, then an overflow occurred and + -- the exception *Constraint_Error* is raised; otherwise the result is + -- correct. + + function Uns_Multiply_With_Ovflo_Check64 (X, Y : Uns64) return Uns64; + pragma Export (C, Uns_Multiply_With_Ovflo_Check64, "__gnat_uns_mulv64"); + -- Raises Constraint_Error if product of operands overflows 64 bits, + -- otherwise returns the 64-bit signed integer product. The code + -- generator may also generate direct calls to this routine. + -- + -- The multiplication is done using pencil and paper algorithm using base + -- 2**32. The multiplication is done on unsigned values, then the correct + -- unsigned value is returned. Overflow check is performed by looking at + -- higher digits. + end System.Arith_64; diff --git a/gcc/ada/libgnat/s-c_time.adb b/gcc/ada/libgnat/s-c_time.adb new file mode 100644 index 000000000000..70f8a9cac08f --- /dev/null +++ b/gcc/ada/libgnat/s-c_time.adb @@ -0,0 +1,203 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- +-- -- +-- S Y S T E M . C _ T I M E -- +-- -- +-- B o d y -- +-- -- +-- Copyright (C) 2025, 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 -- +-- . -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies, Inc. -- +-- -- +------------------------------------------------------------------------------ + +package body System.C_Time is + + -- Two Duration representations are described in targparm.ads: + -- Size Small Last = (2**(Size - 1) - 1) * Small + -- 32 0.02 42_949_672.94 + -- 64 0.000_000_001 9_223_372_036.854_775_807 + + Recip : constant := (if Duration'Size = 32 then 50 else 1_000_000_000); + -- The reciprocal of the Small used to write "* Small" as "/ Recip" + + Milli : constant := 1_000; + Micro : constant := 1_000_000; + Nano : constant := 1_000_000_000; + -- The standard divisors + + pragma Unsuppress (Overflow_Check); + -- Overflow may occur during the various conversions + + ------------------------- + -- In_Timeval_Duration -- + ------------------------- + + -- Immediate : constant Duration := 0.0; + + -- Forever : constant Duration := + -- Duration'Min (Duration'Last, 1.0 * OS_Constants.MAX_tv_sec); + + -- subtype Timeval_Duration is Duration range Immediate .. Forever; + + function In_Timeval_Duration (T : timeval) return Boolean is + Max_Dur : constant := 2**(Duration'Size - 1) - 1; + Max_Sec : constant := Max_Dur / Recip; + Max_Usec : constant := (Max_Dur mod Recip) * Micro / Recip; + + -- When Duration'Size = 64 and time_t'Size = 32, the compiler + -- complains that Max_Sec does not fit in time_t, hence cannot + -- be compared with T.tv_sec. + Safe_Max_Sec : constant := + (if Max_Sec > time_t'Last then time_t'Last else Max_Sec); + Safe_Max_Usec : constant := + (if Max_Sec > time_t'Last then usec_t'Last else Max_Usec); + + begin + pragma Warnings (Off, "condition is always"); + return T.tv_sec >= 0 + and then (T.tv_sec > 0 or else T.tv_usec >= 0) + and then T.tv_sec <= Safe_Max_Sec + and then (T.tv_sec < Safe_Max_Sec or else T.tv_usec <= Safe_Max_Usec) + and then T.tv_sec <= OS_Constants.MAX_tv_sec + and then (T.tv_sec < OS_Constants.MAX_tv_sec or else T.tv_usec = 0); + pragma Warnings (On, "condition is always"); + end In_Timeval_Duration; + + ----------------------------- + -- Milliseconds_To_Timeval -- + ----------------------------- + + function Milliseconds_To_Timeval (M : Interfaces.C.int) return timeval is + use Interfaces.C; + Q : constant int := M / Milli; + R : constant int := M rem Milli; + + begin + return (tv_sec => time_t (Q), tv_usec => usec_t (R) * (Micro / Milli)); + end Milliseconds_To_Timeval; + + ----------------------------- + -- Nanoseconds_To_Timespec -- + ----------------------------- + + function Nanoseconds_To_Timespec (N : Interfaces.C.int) return timespec is + use Interfaces.C; + Q : constant int := N / Nano; + R : constant int := N rem Nano; + + begin + return (tv_sec => time_t (Q), tv_nsec => nsec_t (R)); + end Nanoseconds_To_Timespec; + + ----------------- + -- To_Duration -- + ----------------- + + -- Duration (tv_usec) is OK even when Duration'Size = 32, see above + + function To_Duration (T : timeval) return Duration is + begin + return Duration (T.tv_sec) + Duration (T.tv_usec) / Micro; + end To_Duration; + + -- Duration (tv_nsec) overflows when Duration'Size = 32, see above. + -- Scale down nanoseconds by the value of the Small in nanoseconds. + + function To_Duration (T : timespec) return Duration is + S : constant := Nano / Recip; + + begin + return Duration (T.tv_sec) + Duration (T.tv_nsec / S) / (Nano / S); + end To_Duration; + + ----------------- + -- To_Timespec -- + ----------------- + + function To_Timespec (T : timeval) return timespec is + begin + return (tv_sec => T.tv_sec, tv_nsec => nsec_t (T.tv_usec) * Milli); + end To_Timespec; + + function To_Timespec (D : Duration) return timespec is + tv_sec : time_t; + tv_nsec : nsec_t; + + begin + if D = 0.0 then + tv_sec := 0; + tv_nsec := 0; + + elsif D < 0.0 then + tv_sec := time_t (D + 0.5); + if D = Duration (tv_sec) then + tv_nsec := 0; + else + tv_nsec := nsec_t ((D - Duration (tv_sec)) * Nano + 0.5); + end if; + + else + tv_sec := time_t (D - 0.5); + if D = Duration (tv_sec) then + tv_nsec := 0; + else + tv_nsec := nsec_t ((D - Duration (tv_sec)) * Nano - 0.5); + end if; + end if; + + return (tv_sec, tv_nsec); + end To_Timespec; + + ----------------- + -- To_Timeval -- + ----------------- + + function To_Timeval (D : Duration) return timeval is + tv_sec : time_t; + tv_usec : usec_t; + + begin + if D = 0.0 then + tv_sec := 0; + tv_usec := 0; + + elsif D < 0.0 then + tv_sec := time_t (D + 0.5); + if D = Duration (tv_sec) then + tv_usec := 0; + else + tv_usec := usec_t ((D - Duration (tv_sec)) * Micro + 0.5); + end if; + + else + tv_sec := time_t (D - 0.5); + if D = Duration (tv_sec) then + tv_usec := 0; + else + tv_usec := usec_t ((D - Duration (tv_sec)) * Micro - 0.5); + end if; + end if; + + return (tv_sec, tv_usec); + end To_Timeval; + +end System.C_Time; diff --git a/gcc/ada/libgnat/s-c_time.ads b/gcc/ada/libgnat/s-c_time.ads new file mode 100644 index 000000000000..626a02df5be0 --- /dev/null +++ b/gcc/ada/libgnat/s-c_time.ads @@ -0,0 +1,93 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- +-- -- +-- S Y S T E M . C _ T I M E -- +-- -- +-- S p e c -- +-- -- +-- Copyright (C) 2025, 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 -- +-- . -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies, Inc. -- +-- -- +------------------------------------------------------------------------------ + +-- This package provides the time_t, timeval and timespec types corresponding +-- to the C types defined by the OS, as well as various conversion functions. + +with Interfaces.C; + +with System.OS_Constants; + +package System.C_Time + with Pure +is + -- These two C structs represent durations with different accuracies and + -- maximal values. + + type time_t is range -2 ** (OS_Constants.SIZEOF_tv_sec * 8 - 1) .. + 2 ** (OS_Constants.SIZEOF_tv_sec * 8 - 1) - 1 + with Convention => C, Size => OS_Constants.SIZEOF_tv_sec * 8; + + type usec_t is range -2 ** (OS_Constants.SIZEOF_tv_usec * 8 - 1) .. + 2 ** (OS_Constants.SIZEOF_tv_usec * 8 - 1) - 1 + with Convention => C, Size => OS_Constants.SIZEOF_tv_usec * 8; + -- Larger than the suseconds_t C type on ARM 32 bits with GNU libc + -- when __TIME_BITS=64. + + type timeval is record + tv_sec : time_t; -- seconds + tv_usec : usec_t; -- microseconds + end record + with Convention => C; + + type nsec_t is range -2 ** (OS_Constants.SIZEOF_tv_nsec * 8 - 1) .. + 2 ** (OS_Constants.SIZEOF_tv_nsec * 8 - 1) - 1 + with Convention => C, Size => OS_Constants.SIZEOF_tv_nsec * 8; + -- Larger than the signed long int C type on x32. + + type timespec is record + tv_sec : time_t; -- seconds + tv_nsec : nsec_t; -- nanoseconds + end record + with Convention => C; + + -- All conversion functions truncate the result if it is inexact + + function To_Duration (T : timespec) return Duration with Inline; + function To_Duration (T : timeval) return Duration with Inline; + + function To_Timespec (D : Duration) return timespec with Inline; + function To_Timeval (D : Duration) return timeval with Inline; + + function In_Timeval_Duration (T : timeval) return Boolean with Inline; + -- g-socket.adb if not Windows target + + function Milliseconds_To_Timeval (M : Interfaces.C.int) return timeval + with Inline; + -- g-sothco.ads + -- g-spogwa.adb + + function Nanoseconds_To_Timespec (N : Interfaces.C.int) return timespec + with Inline; + function To_Timespec (T : timeval) return timespec with Inline; + -- s-osinte__darwin.adb + +end System.C_Time; diff --git a/gcc/ada/libgnat/s-crtl.adb b/gcc/ada/libgnat/s-crtl.adb new file mode 100644 index 000000000000..89818487fd80 --- /dev/null +++ b/gcc/ada/libgnat/s-crtl.adb @@ -0,0 +1,60 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- +-- -- +-- S Y S T E M . C R T L -- +-- -- +-- S p e c -- +-- -- +-- Copyright (C) 2003-2025, 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 -- +-- . -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +package body System.CRTL is + + ---------- + -- read -- + ---------- + + function read (fd : int; buffer : chars; count : size_t) return ssize_t + is + function read_raw + (fd : int; buffer : chars; count : size_t) return ssize_t; + pragma Import (C, read_raw, "read"); + begin + return read_raw (fd, buffer, count); + end read; + + ----------- + -- write -- + ----------- + + function write (fd : int; buffer : chars; count : size_t) return ssize_t + is + function write_raw + (fd : int; buffer : chars; count : size_t) return ssize_t; + pragma Import (C, write_raw, "write"); + begin + return write_raw (fd, buffer, count); + end write; + +end System.CRTL; diff --git a/gcc/ada/libgnat/s-crtl.ads b/gcc/ada/libgnat/s-crtl.ads index 42b31440683d..5ca7fc468495 100644 --- a/gcc/ada/libgnat/s-crtl.ads +++ b/gcc/ada/libgnat/s-crtl.ads @@ -50,6 +50,9 @@ package System.CRTL is subtype int is Integer; + type unsigned is mod 2 ** 32; + for unsigned'Size use 32; + type long is range -(2 ** (System.Parameters.long_bits - 1)) .. +(2 ** (System.Parameters.long_bits - 1)) - 1; @@ -231,9 +234,11 @@ package System.CRTL is pragma Import (C, close, "close"); function read (fd : int; buffer : chars; count : size_t) return ssize_t; - pragma Import (C, read, "read"); + pragma Inline (read); + -- Different return types on Windows and Posix, requires body function write (fd : int; buffer : chars; count : size_t) return ssize_t; - pragma Import (C, write, "write"); + pragma Inline (write); + -- Different return types on Windows and Posix, requires body end System.CRTL; diff --git a/gcc/ada/libgnarl/s-osinte__android.adb b/gcc/ada/libgnat/s-crtl__mingw.adb similarity index 59% rename from gcc/ada/libgnarl/s-osinte__android.adb rename to gcc/ada/libgnat/s-crtl__mingw.adb index 3e36d284c918..8f10cb8c13f4 100644 --- a/gcc/ada/libgnarl/s-osinte__android.adb +++ b/gcc/ada/libgnat/s-crtl__mingw.adb @@ -1,12 +1,12 @@ ------------------------------------------------------------------------------ -- -- --- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- +-- GNAT RUN-TIME COMPONENTS -- -- -- --- S Y S T E M . O S _ I N T E R F A C E -- +-- S Y S T E M . C R T L -- -- -- --- B o d y -- +-- S p e c -- -- -- --- Copyright (C) 1995-2025, AdaCore -- +-- Copyright (C) 2003-2025, 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- -- @@ -24,51 +24,39 @@ -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- . -- -- -- --- GNARL was developed by the GNARL team at Florida State University. -- --- Extensive contributions were provided by Ada Core Technologies, Inc. -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ --- This is an Android version of this package. +-- This is the Windows specific version of the System.CRTL --- This package encapsulates all direct interfaces to OS services --- that are needed by children of System. +package body System.CRTL is -with Interfaces.C; use Interfaces.C; + ---------- + -- read -- + ---------- -package body System.OS_Interface is - - ----------------- - -- To_Duration -- - ----------------- - - function To_Duration (TS : timespec) return Duration is + function read (fd : int; buffer : chars; count : size_t) return ssize_t + is + function read_raw + (fd : int; buffer : chars; count : unsigned) return int; + pragma Import (C, read_raw, "read"); begin - return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; - end To_Duration; - - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - + return ssize_t (read_raw (fd, buffer, unsigned (count))); + end read; + + ----------- + -- write -- + ----------- + + function write (fd : int; buffer : chars; count : size_t) return ssize_t + is + function write_raw + (fd : int; buffer : chars; count : unsigned) return int; + pragma Import (C, write_raw, "write"); begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - -- value. - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return timespec'(tv_sec => S, - tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; + return ssize_t (write_raw (fd, buffer, unsigned (count))); + end write; -end System.OS_Interface; +end System.CRTL; diff --git a/gcc/ada/libgnat/s-optide.adb b/gcc/ada/libgnat/s-optide.adb index 6abe6d3a0e69..e39c7cbe2d20 100644 --- a/gcc/ada/libgnat/s-optide.adb +++ b/gcc/ada/libgnat/s-optide.adb @@ -36,8 +36,13 @@ procedure Timed_Delay (Time : Duration; Mode : Integer) is - Request : aliased timespec; - Remaind : aliased timespec; + + function nanosleep (rqtp, rmtp : not null access C_Time.timespec) + return Integer; + pragma Import (C, nanosleep, "nanosleep"); + + Request : aliased C_Time.timespec; + Remaind : aliased C_Time.timespec; Rel_Time : Duration; Abs_Time : Duration; Base_Time : constant Duration := Clock; @@ -71,7 +76,7 @@ begin end if; pragma Warnings (On); - Request := To_Timespec (Time_Chunk); + Request := C_Time.To_Timespec (Time_Chunk); Result := nanosleep (Request'Access, Remaind'Access); Check_Time := Clock; diff --git a/gcc/ada/libgnat/s-os_lib.adb b/gcc/ada/libgnat/s-os_lib.adb index b07bdeadd092..d0a0ad34859d 100644 --- a/gcc/ada/libgnat/s-os_lib.adb +++ b/gcc/ada/libgnat/s-os_lib.adb @@ -2985,7 +2985,7 @@ package body System.OS_Lib is -- To_Ada -- ------------ - function To_Ada (Time : time_t) return OS_Time is + function To_Ada (Time : Long_Long_Integer) return OS_Time is begin return OS_Time (Time); end To_Ada; @@ -3023,9 +3023,9 @@ package body System.OS_Lib is -- To_C -- ---------- - function To_C (Time : OS_Time) return time_t is + function To_C (Time : OS_Time) return Long_Long_Integer is begin - return time_t (Time); + return Long_Long_Integer (Time); end To_C; ------------------ diff --git a/gcc/ada/libgnat/s-os_lib.ads b/gcc/ada/libgnat/s-os_lib.ads index 38cfc88c4eaa..734f4fd50a5d 100644 --- a/gcc/ada/libgnat/s-os_lib.ads +++ b/gcc/ada/libgnat/s-os_lib.ads @@ -115,6 +115,12 @@ package System.OS_Lib is -- these have Intrinsic convention, so for example it is not permissible -- to create accesses to any of these functions. + function To_Ada (Time : Long_Long_Integer) return OS_Time; + -- Convert Long_Long_Integer to OS_Time + + function To_C (Time : OS_Time) return Long_Long_Integer; + -- Convert OS_Time to Long_Long_Integer + subtype Year_Type is Integer range 1900 .. 2099; subtype Month_Type is Integer range 1 .. 12; subtype Day_Type is Integer range 1 .. 31; @@ -161,27 +167,6 @@ package System.OS_Lib is -- component parts to be interpreted in the local time zone, and returns -- an OS_Time. Returns Invalid_Time if the creation fails. - ------------------ - -- Time_t Stuff -- - ------------------ - - -- Note: Do not use time_t in the compiler and host-based tools; instead - -- use OS_Time. - - subtype time_t is Long_Long_Integer; - -- C time_t can be either long or long long, so we choose the Ada - -- equivalent of the latter because eventually that will be the - -- type used out of necessity. This may affect some user code on 32-bit - -- targets that have not yet migrated to the Posix 2008 standard, - -- particularly pre version 5 32-bit Linux. Do not change this - -- declaration without coordinating it with conversions in Ada.Calendar. - - function To_C (Time : OS_Time) return time_t; - -- Convert OS_Time to C time_t type - - function To_Ada (Time : time_t) return OS_Time; - -- Convert C time_t type to OS_Time - ---------------- -- File Stuff -- ---------------- @@ -1126,8 +1111,8 @@ private pragma Import (Intrinsic, ">"); pragma Import (Intrinsic, "<="); pragma Import (Intrinsic, ">="); - pragma Inline (To_C); pragma Inline (To_Ada); + pragma Inline (To_C); type Process_Id is new Integer; Invalid_Pid : constant Process_Id := -1; diff --git a/gcc/ada/libgnat/s-osprim__darwin.adb b/gcc/ada/libgnat/s-osprim__darwin.adb index 28bfcb8c6831..7b978a3b486d 100644 --- a/gcc/ada/libgnat/s-osprim__darwin.adb +++ b/gcc/ada/libgnat/s-osprim__darwin.adb @@ -29,9 +29,10 @@ -- -- ------------------------------------------------------------------------------ --- This version is for darwin +-- This version is for Darwin + +with System.C_Time; -with System.Parameters; package body System.OS_Primitives is -- ??? These definitions are duplicated from System.OS_Interface @@ -46,27 +47,13 @@ package body System.OS_Primitives is pragma Convention (C, struct_timezone); type struct_timezone_ptr is access all struct_timezone; - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type struct_timeval is record - tv_sec : time_t; - tv_usec : Integer; - end record; - pragma Convention (C, struct_timeval); - function gettimeofday - (tv : not null access struct_timeval; + (tv : not null access C_Time.timeval; tz : struct_timezone_ptr) return Integer; pragma Import (C, gettimeofday, "gettimeofday"); - type timespec is record - tv_sec : time_t; - tv_nsec : Long_Integer; - end record; - pragma Convention (C, timespec); - - function nanosleep (rqtp, rmtp : not null access timespec) return Integer; + function nanosleep (rqtp, rmtp : not null access C_Time.timespec) + return Integer; pragma Import (C, nanosleep, "nanosleep"); ----------- @@ -74,7 +61,7 @@ package body System.OS_Primitives is ----------- function Clock return Duration is - TV : aliased struct_timeval; + TV : aliased C_Time.timeval; Result : Integer; pragma Unreferenced (Result); @@ -89,36 +76,9 @@ package body System.OS_Primitives is -- value is never checked. Result := gettimeofday (TV'Access, null); - return Duration (TV.tv_sec) + Duration (TV.tv_usec) / 10#1#E6; + return C_Time.To_Duration (TV); end Clock; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec; - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - -- value. - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return - timespec'(tv_sec => S, - tv_nsec => Long_Integer (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - ----------------- -- Timed_Delay -- ----------------- @@ -127,8 +87,8 @@ package body System.OS_Primitives is (Time : Duration; Mode : Integer) is - Request : aliased timespec; - Remaind : aliased timespec; + Request : aliased C_Time.timespec; + Remaind : aliased C_Time.timespec; Rel_Time : Duration; Abs_Time : Duration; Base_Time : constant Duration := Clock; @@ -148,7 +108,7 @@ package body System.OS_Primitives is if Rel_Time > 0.0 then loop - Request := To_Timespec (Rel_Time); + Request := C_Time.To_Timespec (Rel_Time); Result := nanosleep (Request'Access, Remaind'Access); Check_Time := Clock; diff --git a/gcc/ada/libgnat/s-osprim__posix.adb b/gcc/ada/libgnat/s-osprim__posix.adb index 94d06c325bb2..45836ac806d3 100644 --- a/gcc/ada/libgnat/s-osprim__posix.adb +++ b/gcc/ada/libgnat/s-osprim__posix.adb @@ -30,26 +30,10 @@ ------------------------------------------------------------------------------ -- This version is for POSIX-like operating systems -with System.Parameters; -package body System.OS_Primitives is - - -- ??? These definitions are duplicated from System.OS_Interface - -- because we don't want to depend on any package. Consider removing - -- these declarations in System.OS_Interface and move these ones in - -- the spec. - - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; +with System.C_Time; - type timespec is record - tv_sec : time_t; - tv_nsec : Long_Integer; - end record; - pragma Convention (C, timespec); - - function nanosleep (rqtp, rmtp : not null access timespec) return Integer; - pragma Import (C, nanosleep, "nanosleep"); +package body System.OS_Primitives is ----------- -- Clock -- @@ -57,27 +41,12 @@ package body System.OS_Primitives is function Clock return Duration is - type timeval is array (1 .. 3) of Long_Integer; - -- The timeval array is sized to contain Long_Long_Integer sec and - -- Long_Integer usec. If Long_Long_Integer'Size = Long_Integer'Size then - -- it will be overly large but that will not effect the implementation - -- since it is not accessed directly. - - procedure timeval_to_duration - (T : not null access timeval; - sec : not null access Long_Long_Integer; - usec : not null access Long_Integer); - pragma Import (C, timeval_to_duration, "__gnat_timeval_to_duration"); - - Micro : constant := 10**6; - sec : aliased Long_Long_Integer; - usec : aliased Long_Integer; - TV : aliased timeval; + TV : aliased C_Time.timeval; Result : Integer; pragma Unreferenced (Result); function gettimeofday - (Tv : access timeval; + (Tv : access C_Time.timeval; Tz : System.Address := System.Null_Address) return Integer; pragma Import (C, gettimeofday, "gettimeofday"); @@ -91,37 +60,9 @@ package body System.OS_Primitives is -- value is never checked. Result := gettimeofday (TV'Access, System.Null_Address); - timeval_to_duration (TV'Access, sec'Access, usec'Access); - return Duration (sec) + Duration (usec) / Micro; + return C_Time.To_Duration (TV); end Clock; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec; - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - -- value. - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return - timespec'(tv_sec => S, - tv_nsec => Long_Integer (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - ----------------- -- Timed_Delay -- ----------------- diff --git a/gcc/ada/libgnat/s-osprim__posix2008.adb b/gcc/ada/libgnat/s-osprim__posix2008.adb index 78b21c6444d9..fceb37cdd011 100644 --- a/gcc/ada/libgnat/s-osprim__posix2008.adb +++ b/gcc/ada/libgnat/s-osprim__posix2008.adb @@ -32,34 +32,19 @@ -- This version is for POSIX.1-2008-like operating systems with System.CRTL; +with System.C_Time; with System.OS_Constants; -with System.Parameters; + package body System.OS_Primitives is subtype int is System.CRTL.int; - -- ??? These definitions are duplicated from System.OS_Interface because - -- we don't want to depend on any package. Consider removing these - -- declarations in System.OS_Interface and move these ones to the spec. - - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - tv_sec : time_t; - tv_nsec : Long_Integer; - end record; - pragma Convention (C, timespec); - - function nanosleep (rqtp, rmtp : not null access timespec) return Integer; - pragma Import (C, nanosleep, "nanosleep"); - ----------- -- Clock -- ----------- function Clock return Duration is - TS : aliased timespec; + TS : aliased C_Time.timespec; Result : int; type clockid_t is new int; @@ -68,42 +53,15 @@ package body System.OS_Primitives is function clock_gettime (clock_id : clockid_t; - tp : access timespec) return int; + tp : access C_Time.timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); begin Result := clock_gettime (CLOCK_REALTIME, TS'Unchecked_Access); pragma Assert (Result = 0); - return Duration (TS.tv_sec) + Duration (TS.tv_nsec) / 10#1#E9; + return C_Time.To_Duration (TS); end Clock; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec; - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - -- value. - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return - timespec'(tv_sec => S, - tv_nsec => Long_Integer (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - ----------------- -- Timed_Delay -- ----------------- diff --git a/gcc/ada/libgnat/s-osprim__rtems.adb b/gcc/ada/libgnat/s-osprim__rtems.adb index c8fbc8270ca8..99644b39424a 100644 --- a/gcc/ada/libgnat/s-osprim__rtems.adb +++ b/gcc/ada/libgnat/s-osprim__rtems.adb @@ -31,7 +31,8 @@ -- This version is for POSIX-like operating systems -with System.Parameters; +with System.C_Time; + package body System.OS_Primitives is -- ??? These definitions are duplicated from System.OS_Interface @@ -39,16 +40,8 @@ package body System.OS_Primitives is -- these declarations in System.OS_Interface and move these ones in -- the spec. - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - tv_sec : time_t; - tv_nsec : Long_Integer; - end record; - pragma Convention (C, timespec); - - function nanosleep (rqtp, rmtp : not null access timespec) return Integer; + function nanosleep (rqtp, rmtp : not null access C_Time.timespec) + return Integer; pragma Import (C, nanosleep, "nanosleep"); ----------- @@ -56,28 +49,12 @@ package body System.OS_Primitives is ----------- function Clock return Duration is - - type timeval is record - tv_sec : time_t; - tv_usec : Long_Integer; - end record; - pragma Convention (C, timeval); - - procedure timeval_to_duration - (T : not null access timeval; - sec : not null access Long_Long_Integer; - usec : not null access Long_Integer); - pragma Import (C, timeval_to_duration, "__gnat_timeval_to_duration"); - - Micro : constant := 10**6; - sec : aliased Long_Long_Integer; - usec : aliased Long_Integer; - TV : aliased timeval; + TV : aliased C_Time.timeval; Result : Integer; pragma Unreferenced (Result); function gettimeofday - (Tv : access timeval; + (Tv : access C_Time.timeval; Tz : System.Address := System.Null_Address) return Integer; pragma Import (C, gettimeofday, "gettimeofday"); @@ -91,37 +68,9 @@ package body System.OS_Primitives is -- value is never checked. Result := gettimeofday (TV'Access, System.Null_Address); - timeval_to_duration (TV'Access, sec'Access, usec'Access); - return Duration (sec) + Duration (usec) / Micro; + return C_Time.To_Duration (TV); end Clock; - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec; - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - -- value. - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return - timespec'(tv_sec => S, - tv_nsec => Long_Integer (Long_Long_Integer (F * 10#1#E9))); - end To_Timespec; - ----------------- -- Timed_Delay -- ----------------- @@ -130,8 +79,8 @@ package body System.OS_Primitives is (Time : Duration; Mode : Integer) is - Request : aliased timespec; - Remaind : aliased timespec; + Request : aliased C_Time.timespec; + Remaind : aliased C_Time.timespec; Rel_Time : Duration; Abs_Time : Duration; Base_Time : constant Duration := Clock; @@ -151,7 +100,7 @@ package body System.OS_Primitives is if Rel_Time > 0.0 then loop - Request := To_Timespec (Rel_Time); + Request := C_Time.To_Timespec (Rel_Time); Result := nanosleep (Request'Access, Remaind'Access); Check_Time := Clock; diff --git a/gcc/ada/libgnat/s-osprim__solaris.adb b/gcc/ada/libgnat/s-osprim__solaris.adb deleted file mode 100644 index a08feb5f666f..000000000000 --- a/gcc/ada/libgnat/s-osprim__solaris.adb +++ /dev/null @@ -1,126 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- --- -- --- S Y S T E M . O S _ P R I M I T I V E S -- --- -- --- B o d y -- --- -- --- Copyright (C) 1998-2025, 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 -- --- . -- --- -- --- GNARL was developed by the GNARL team at Florida State University. -- --- Extensive contributions were provided by Ada Core Technologies, Inc. -- --- -- ------------------------------------------------------------------------------- - --- This version uses gettimeofday and select --- This file is suitable for Solaris (32 and 64 bits). - -package body System.OS_Primitives is - - -- ??? These definitions are duplicated from System.OS_Interface - -- because we don't want to depend on any package. Consider removing - -- these declarations in System.OS_Interface and move these ones in - -- the spec. - - type struct_timeval is record - tv_sec : Long_Integer; - tv_usec : Long_Integer; - end record; - pragma Convention (C, struct_timeval); - - procedure gettimeofday - (tv : not null access struct_timeval; - tz : Address := Null_Address); - pragma Import (C, gettimeofday, "gettimeofday"); - - procedure C_select - (n : Integer := 0; - readfds, - writefds, - exceptfds : Address := Null_Address; - timeout : not null access struct_timeval); - pragma Import (C, C_select, "select"); - - ----------- - -- Clock -- - ----------- - - function Clock return Duration is - TV : aliased struct_timeval; - - begin - gettimeofday (TV'Access); - return Duration (TV.tv_sec) + Duration (TV.tv_usec) / 10#1#E6; - end Clock; - - ----------------- - -- Timed_Delay -- - ----------------- - - procedure Timed_Delay - (Time : Duration; - Mode : Integer) - is - Rel_Time : Duration; - Abs_Time : Duration; - Base_Time : constant Duration := Clock; - Check_Time : Duration := Base_Time; - timeval : aliased struct_timeval; - - begin - if Mode = Relative then - Rel_Time := Time; - Abs_Time := Time + Check_Time; - else - Rel_Time := Time - Check_Time; - Abs_Time := Time; - end if; - - if Rel_Time > 0.0 then - loop - timeval.tv_sec := Long_Integer (Rel_Time); - - if Duration (timeval.tv_sec) > Rel_Time then - timeval.tv_sec := timeval.tv_sec - 1; - end if; - - timeval.tv_usec := - Long_Integer ((Rel_Time - Duration (timeval.tv_sec)) * 10#1#E6); - - C_select (timeout => timeval'Unchecked_Access); - Check_Time := Clock; - - exit when Abs_Time <= Check_Time or else Check_Time < Base_Time; - - Rel_Time := Abs_Time - Check_Time; - end loop; - end if; - end Timed_Delay; - - ---------------- - -- Initialize -- - ---------------- - - procedure Initialize is - begin - null; - end Initialize; - -end System.OS_Primitives; diff --git a/gcc/ada/libgnat/s-osprim__unix.adb b/gcc/ada/libgnat/s-osprim__unix.adb index 5848df6f63fc..c48fbe1001f0 100644 --- a/gcc/ada/libgnat/s-osprim__unix.adb +++ b/gcc/ada/libgnat/s-osprim__unix.adb @@ -30,7 +30,9 @@ ------------------------------------------------------------------------------ -- This version uses gettimeofday and select --- This file is suitable for OpenNT, Dec Unix and SCO UnixWare. +-- This file is suitable for Dec Unix, SCO UnixWare and Sun Solaris. + +with System.C_Time; package body System.OS_Primitives is @@ -39,14 +41,8 @@ package body System.OS_Primitives is -- these declarations in System.OS_Interface and move these ones in -- the spec. - type struct_timeval is record - tv_sec : Integer; - tv_usec : Integer; - end record; - pragma Convention (C, struct_timeval); - procedure gettimeofday - (tv : not null access struct_timeval; + (tv : not null access C_Time.timeval; tz : Address := Null_Address); pragma Import (C, gettimeofday, "gettimeofday"); @@ -55,7 +51,7 @@ package body System.OS_Primitives is readfds, writefds, exceptfds : Address := Null_Address; - timeout : not null access struct_timeval); + timeout : not null access C_Time.timeval); pragma Import (C, C_select, "select"); ----------- @@ -63,11 +59,11 @@ package body System.OS_Primitives is ----------- function Clock return Duration is - TV : aliased struct_timeval; + TV : aliased C_Time.timeval; begin gettimeofday (TV'Access); - return Duration (TV.tv_sec) + Duration (TV.tv_usec) / 10#1#E6; + return C_Time.To_Duration (TV); end Clock; ----------------- @@ -82,7 +78,7 @@ package body System.OS_Primitives is Abs_Time : Duration; Base_Time : constant Duration := Clock; Check_Time : Duration := Base_Time; - timeval : aliased struct_timeval; + timeval : aliased C_Time.timeval; begin if Mode = Relative then @@ -95,14 +91,7 @@ package body System.OS_Primitives is if Rel_Time > 0.0 then loop - timeval.tv_sec := Integer (Rel_Time); - - if Duration (timeval.tv_sec) > Rel_Time then - timeval.tv_sec := timeval.tv_sec - 1; - end if; - - timeval.tv_usec := - Integer ((Rel_Time - Duration (timeval.tv_sec)) * 10#1#E6); + timeval := C_Time.To_Timeval (Rel_Time); C_select (timeout => timeval'Unchecked_Access); Check_Time := Clock; diff --git a/gcc/ada/libgnat/s-osprim__x32.adb b/gcc/ada/libgnat/s-osprim__x32.adb deleted file mode 100644 index e127107aa57d..000000000000 --- a/gcc/ada/libgnat/s-osprim__x32.adb +++ /dev/null @@ -1,170 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- --- -- --- S Y S T E M . O S _ P R I M I T I V E S -- --- -- --- B o d y -- --- -- --- Copyright (C) 2013-2025, 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 -- --- . -- --- -- --- GNARL was developed by the GNARL team at Florida State University. -- --- Extensive contributions were provided by Ada Core Technologies, Inc. -- --- -- ------------------------------------------------------------------------------- - --- This version is for Linux/x32 - -with System.Parameters; - -package body System.OS_Primitives is - - -- ??? These definitions are duplicated from System.OS_Interface - -- because we don't want to depend on any package. Consider removing - -- these declarations in System.OS_Interface and move these ones in - -- the spec. - - type time_t is range -2 ** (System.Parameters.time_t_bits - 1) - .. 2 ** (System.Parameters.time_t_bits - 1) - 1; - - type timespec is record - tv_sec : time_t; - tv_nsec : Long_Long_Integer; - end record; - pragma Convention (C, timespec); - - function nanosleep (rqtp, rmtp : not null access timespec) return Integer; - pragma Import (C, nanosleep, "nanosleep"); - - ----------- - -- Clock -- - ----------- - - function Clock return Duration is - type timeval is array (1 .. 2) of Long_Long_Integer; - - procedure timeval_to_duration - (T : not null access timeval; - sec : not null access Long_Integer; - usec : not null access Long_Integer); - pragma Import (C, timeval_to_duration, "__gnat_timeval_to_duration"); - - Micro : constant := 10**6; - sec : aliased Long_Integer; - usec : aliased Long_Integer; - TV : aliased timeval; - Result : Integer; - pragma Unreferenced (Result); - - function gettimeofday - (Tv : access timeval; - Tz : System.Address := System.Null_Address) return Integer; - pragma Import (C, gettimeofday, "gettimeofday"); - - begin - -- The return codes for gettimeofday are as follows (from man pages): - -- EPERM settimeofday is called by someone other than the superuser - -- EINVAL Timezone (or something else) is invalid - -- EFAULT One of tv or tz pointed outside accessible address space - - -- None of these codes signal a potential clock skew, hence the return - -- value is never checked. - - Result := gettimeofday (TV'Access, System.Null_Address); - timeval_to_duration (TV'Access, sec'Access, usec'Access); - return Duration (sec) + Duration (usec) / Micro; - end Clock; - - ----------------- - -- To_Timespec -- - ----------------- - - function To_Timespec (D : Duration) return timespec; - - function To_Timespec (D : Duration) return timespec is - S : time_t; - F : Duration; - - begin - S := time_t (Long_Long_Integer (D)); - F := D - Duration (S); - - -- If F has negative value due to a round-up, adjust for positive F - -- value. - - if F < 0.0 then - S := S - 1; - F := F + 1.0; - end if; - - return - timespec'(tv_sec => S, - tv_nsec => Long_Long_Integer (F * 10#1#E9)); - end To_Timespec; - - ----------------- - -- Timed_Delay -- - ----------------- - - procedure Timed_Delay - (Time : Duration; - Mode : Integer) - is - Request : aliased timespec; - Remaind : aliased timespec; - Rel_Time : Duration; - Abs_Time : Duration; - Base_Time : constant Duration := Clock; - Check_Time : Duration := Base_Time; - - Result : Integer; - pragma Unreferenced (Result); - - begin - if Mode = Relative then - Rel_Time := Time; - Abs_Time := Time + Check_Time; - else - Rel_Time := Time - Check_Time; - Abs_Time := Time; - end if; - - if Rel_Time > 0.0 then - loop - Request := To_Timespec (Rel_Time); - Result := nanosleep (Request'Access, Remaind'Access); - Check_Time := Clock; - - exit when Abs_Time <= Check_Time or else Check_Time < Base_Time; - - Rel_Time := Abs_Time - Check_Time; - end loop; - end if; - end Timed_Delay; - - ---------------- - -- Initialize -- - ---------------- - - procedure Initialize is - begin - null; - end Initialize; - -end System.OS_Primitives; diff --git a/gcc/ada/libgnat/s-parame.ads b/gcc/ada/libgnat/s-parame.ads index 98284a4d13ec..8587453c947e 100644 --- a/gcc/ada/libgnat/s-parame.ads +++ b/gcc/ada/libgnat/s-parame.ads @@ -97,13 +97,6 @@ package System.Parameters is -- 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 -- ---------------------------------------------- diff --git a/gcc/ada/libgnat/s-parame__hpux.ads b/gcc/ada/libgnat/s-parame__hpux.ads index a8a7b691802d..832f344a5927 100644 --- a/gcc/ada/libgnat/s-parame__hpux.ads +++ b/gcc/ada/libgnat/s-parame__hpux.ads @@ -96,13 +96,6 @@ package System.Parameters is -- 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 -- ---------------------------------------------- diff --git a/gcc/ada/libgnat/s-parame__posix2008.ads b/gcc/ada/libgnat/s-parame__posix2008.ads deleted file mode 100644 index 1cf09c6e39f1..000000000000 --- a/gcc/ada/libgnat/s-parame__posix2008.ads +++ /dev/null @@ -1,189 +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-2025, 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 -- --- . -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- --- -- ------------------------------------------------------------------------------- - --- This is the Posix 2008 version for 64 bit time_t. - --- 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 -Memory_Size / 2 .. Memory_Size / 2 - 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 := 8_192_000; - -- 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. - - 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 := True; - -- 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_Long_Integer'Size; - -- Number of bits in type time_t. Use for targets that are Posix 2008 - -- compliant (fixes the year 2038 time_t overflow). - - ---------------------------------------------- - -- 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 := 32; - -- Number of task attributes stored in the task control block - - ----------------------- - -- Task Image Length -- - ----------------------- - - Max_Task_Image_Length : constant := 256; - -- 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__vxworks.ads b/gcc/ada/libgnat/s-parame__vxworks.ads index dbaadb404b75..de9afdbb0b2b 100644 --- a/gcc/ada/libgnat/s-parame__vxworks.ads +++ b/gcc/ada/libgnat/s-parame__vxworks.ads @@ -98,21 +98,6 @@ package System.Parameters is -- 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 -- - ------------------------------------ - - -- IMPORTANT NOTE: - -- Select the appropriate time_t_bits for the VSB in use, then rebuild - -- the runtime using instructions in adainclude/libada.gpr. - - -- time_t_bits : constant := Long_Integer'Size; - -- Number of bits in type time_t for SR0650 and before and SR0660 with - -- non-default configuration. - - time_t_bits : constant := Long_Long_Integer'Size; - -- Number of bits in type time_t for SR0660 with default configuration. - ---------------------------------------------- -- Characteristics of types in Interfaces.C -- ---------------------------------------------- diff --git a/gcc/ada/libgnat/s-putima.adb b/gcc/ada/libgnat/s-putima.adb index 25dd7c139147..ea26e02c3a96 100644 --- a/gcc/ada/libgnat/s-putima.adb +++ b/gcc/ada/libgnat/s-putima.adb @@ -159,6 +159,16 @@ package body System.Put_Images is Fat_Instance (S, X, "access"); end Put_Image_Fat_Pointer; + procedure Ext_Acc_Instance is new + Put_Image_Pointer (Byte_String, Ext_Access_Pointer); + + procedure Put_Image_Extended_Access_Pointer + (S : in out Sink'Class; X : Ext_Access_Pointer) + is + begin + Ext_Acc_Instance (S, X, "extended access"); + end Put_Image_Extended_Access_Pointer; + procedure Put_Image_Access_Subp (S : in out Sink'Class; X : Thin_Pointer) is begin Thin_Instance (S, X, "access subprogram"); diff --git a/gcc/ada/libgnat/s-putima.ads b/gcc/ada/libgnat/s-putima.ads index c2d392abfdb9..accdcf12bf79 100644 --- a/gcc/ada/libgnat/s-putima.ads +++ b/gcc/ada/libgnat/s-putima.ads @@ -72,10 +72,20 @@ package System.Put_Images with Pure is type Byte_String is array (Positive range <>) of Byte with Alignment => 1; type Thin_Pointer is access all Byte with Storage_Size => 0; type Fat_Pointer is access all Byte_String with Storage_Size => 0; + type Ext_Access_Pointer is access all Byte_String with Storage_Size => 0; + procedure Put_Image_Thin_Pointer (S : in out Sink'Class; X : Thin_Pointer); + -- Print "(access)" followed by "null", or the address of the designated + -- object as an unsigned hexadecimal integer. + procedure Put_Image_Fat_Pointer (S : in out Sink'Class; X : Fat_Pointer); - -- Print "null", or the address of the designated object as an unsigned - -- hexadecimal integer. + -- Print "(access)" followed by "null", or the address of the designated + -- object as an unsigned hexadecimal integer. + + procedure Put_Image_Extended_Access_Pointer + (S : in out Sink'Class; X : Ext_Access_Pointer); + -- Print "(extended access)" followed by "null", or the address of the + -- designated object as an unsigned hexadecimal integer. procedure Put_Image_Access_Subp (S : in out Sink'Class; X : Thin_Pointer); -- For access-to-subprogram types diff --git a/gcc/ada/libgnat/s-stausa.adb b/gcc/ada/libgnat/s-stausa.adb index cbecc0bb20ed..d2d9e01ce05a 100644 --- a/gcc/ada/libgnat/s-stausa.adb +++ b/gcc/ada/libgnat/s-stausa.adb @@ -99,10 +99,10 @@ package body System.Stack_Usage is -- Now the implementation of the services offered by this unit, on top of -- the Stack_Slots abstraction above. - Index_Str : constant String := "Index"; - Task_Name_Str : constant String := "Task Name"; - Stack_Size_Str : constant String := "Stack Size"; - Actual_Size_Str : constant String := "Stack usage"; + Index_Str : constant String := "Index"; + Task_Name_Str : constant String := "Task Name"; + Stack_Size_Str : constant String := "Stack Size"; + Actual_Size_Str : constant String := "Stack usage"; procedure Output_Result (Result_Id : Natural; @@ -128,9 +128,7 @@ package body System.Stack_Usage is Result_Array := new Result_Array_Type (1 .. Buffer_Size); Result_Array.all := [others => - (Task_Name => [others => ASCII.NUL], - Value => 0, - Stack_Size => 0)]; + (Task_Name => [others => ASCII.NUL], Value => 0, Stack_Size => 0)]; -- Set the Is_Enabled flag to true, so that the task wrapper knows that -- it has to handle dynamic stack analysis @@ -151,11 +149,13 @@ package body System.Stack_Usage is begin My_Stack_Size := System.CRTL.atoi (Stack_Size_Chars) * 1024; + -- Approximate Stack_Base with the topmost stack address that is + -- known here. Initialize_Analyzer (Environment_Task_Analyzer, "ENVIRONMENT TASK", My_Stack_Size, - 0, + Stack_Size_Chars'Address, My_Stack_Size); Fill_Stack (Environment_Task_Analyzer); @@ -207,8 +207,8 @@ package body System.Stack_Usage is -- Reduce pattern size to prevent local frame overwrite Analyzer.Pattern_Size := - Integer (To_Stack_Address (Current_Stack_Level'Address) - Guard - - To_Stack_Address (Analyzer.Pattern_Limit)); + Integer (To_Stack_Address (Current_Stack_Level'Address) - Guard - + To_Stack_Address (Analyzer.Pattern_Limit)); end if; Analyzer.Pattern_Overlay_Address := Analyzer.Pattern_Limit; @@ -267,22 +267,21 @@ package body System.Stack_Usage is ------------------------- procedure Initialize_Analyzer - (Analyzer : in out Stack_Analyzer; - Task_Name : String; - Stack_Size : Natural; - Stack_Base : System.Address; - Pattern_Size : Natural; - Pattern : Interfaces.Unsigned_32 := 16#DEAD_BEEF#) - is + (Analyzer : in out Stack_Analyzer; + Task_Name : String; + Stack_Size : Natural; + Stack_Base : System.Address; + Pattern_Size : Natural; + Pattern : Interfaces.Unsigned_32 := 16#DEAD_BEEF#) is begin -- Initialize the analyzer fields - Analyzer.Stack_Base := Stack_Base; - Analyzer.Stack_Size := Stack_Size; - Analyzer.Pattern_Size := Pattern_Size; - Analyzer.Pattern := Pattern; - Analyzer.Result_Id := Next_Id; - Analyzer.Task_Name := [others => ' ']; + Analyzer.Stack_Base := Stack_Base; + Analyzer.Stack_Size := Stack_Size; + Analyzer.Pattern_Size := Pattern_Size; + Analyzer.Pattern := Pattern; + Analyzer.Result_Id := Next_Id; + Analyzer.Task_Name := [others => ' ']; -- Compute the task name, and truncate if bigger than Task_Name_Length @@ -290,10 +289,12 @@ package body System.Stack_Usage is Analyzer.Task_Name (1 .. Task_Name'Length) := Task_Name; else Analyzer.Task_Name := - Task_Name (Task_Name'First .. - Task_Name'First + Task_Name_Length - 1); + Task_Name + (Task_Name'First .. Task_Name'First + Task_Name_Length - 1); end if; + -- Next_Id does not need any explicit protection against race conditions + -- because Initialize_Analyzer is called holding the runtime lock. Next_Id := Next_Id + 1; end Initialize_Analyzer; @@ -302,9 +303,7 @@ package body System.Stack_Usage is ---------------- function Stack_Size - (SP_Low : Stack_Address; - SP_High : Stack_Address) return Natural - is + (SP_Low : Stack_Address; SP_High : Stack_Address) return Natural is begin if SP_Low > SP_High then return Natural (SP_Low - SP_High); @@ -379,16 +378,16 @@ package body System.Stack_Usage is Stack_Size_Str : constant String := Natural'Image (Result.Stack_Size); Actual_Use_Str : constant String := Natural'Image (Result.Value); - Result_Id_Blanks : constant - String (1 .. Index_Str'Length - Result_Id_Str'Length) := + Result_Id_Blanks : + constant String (1 .. Index_Str'Length - Result_Id_Str'Length) := (others => ' '); - Stack_Size_Blanks : constant - String (1 .. Max_Stack_Size_Len - Stack_Size_Str'Length) := + Stack_Size_Blanks : + constant String (1 .. Max_Stack_Size_Len - Stack_Size_Str'Length) := (others => ' '); - Actual_Use_Blanks : constant - String (1 .. Max_Actual_Use_Len - Actual_Use_Str'Length) := + Actual_Use_Blanks : + constant String (1 .. Max_Actual_Use_Len - Actual_Use_Str'Length) := (others => ' '); begin @@ -412,10 +411,9 @@ package body System.Stack_Usage is Max_Stack_Usage : Natural := 0; Max_Stack_Size_Len, Max_Actual_Use_Len : Natural := 0; - Task_Name_Blanks : constant - String - (1 .. Task_Name_Length - Task_Name_Str'Length) := - (others => ' '); + Task_Name_Blanks : + constant String (1 .. Task_Name_Length - Task_Name_Str'Length) := + (others => ' '); begin Set_Output (Standard_Error); @@ -431,6 +429,7 @@ package body System.Stack_Usage is -- in order to do correct column alignment. for J in Result_Array'Range loop + -- Slots at Next_Id or higher haven't been allocated to tasks exit when J >= Next_Id; if Result_Array (J).Value > Max_Stack_Usage then @@ -450,15 +449,15 @@ package body System.Stack_Usage is -- labels if needed. declare - Stack_Size_Blanks : constant - String (1 .. Max_Stack_Size_Len - - Stack_Size_Str'Length) := - [others => ' ']; + Stack_Size_Blanks : + constant String + (1 .. Max_Stack_Size_Len - Stack_Size_Str'Length) := + [others => ' ']; - Stack_Usage_Blanks : constant - String (1 .. Max_Actual_Use_Len - - Actual_Size_Str'Length) := - [others => ' ']; + Stack_Usage_Blanks : + constant String + (1 .. Max_Actual_Use_Len - Actual_Size_Str'Length) := + [others => ' ']; begin if Stack_Size_Str'Length > Max_Stack_Size_Len then @@ -480,6 +479,7 @@ package body System.Stack_Usage is -- Now display the individual results for J in Result_Array'Range loop + -- Slots at Next_Id or higher haven't been allocated to tasks exit when J >= Next_Id; Output_Result (J, Result_Array (J), Max_Stack_Size_Len, Max_Actual_Use_Len); @@ -489,8 +489,14 @@ package body System.Stack_Usage is else Put - (Index_Str & " | " & Task_Name_Str & Task_Name_Blanks & " | " - & Stack_Size_Str & " | " & Actual_Size_Str); + (Index_Str + & " | " + & Task_Name_Str + & Task_Name_Blanks + & " | " + & Stack_Size_Str + & " | " + & Actual_Size_Str); New_Line; end if; end Output_Results; @@ -500,9 +506,10 @@ package body System.Stack_Usage is ------------------- procedure Report_Result (Analyzer : Stack_Analyzer) is - Result : Task_Result := (Task_Name => Analyzer.Task_Name, - Stack_Size => Analyzer.Stack_Size, - Value => 0); + Result : Task_Result := + (Task_Name => Analyzer.Task_Name, + Stack_Size => Analyzer.Stack_Size, + Value => 0); begin if Analyzer.Pattern_Size = 0 then @@ -513,8 +520,9 @@ package body System.Stack_Usage is else Result.Value := - Stack_Size (To_Stack_Address (Analyzer.Topmost_Touched_Mark), - To_Stack_Address (Analyzer.Stack_Base)); + Stack_Size + (To_Stack_Address (Analyzer.Topmost_Touched_Mark), + To_Stack_Address (Analyzer.Stack_Base)); end if; if Analyzer.Result_Id in Result_Array'Range then @@ -528,9 +536,9 @@ package body System.Stack_Usage is declare Result_Str_Len : constant Natural := - Natural'Image (Result.Value)'Length; + Natural'Image (Result.Value)'Length; Size_Str_Len : constant Natural := - Natural'Image (Analyzer.Stack_Size)'Length; + Natural'Image (Analyzer.Stack_Size)'Length; Max_Stack_Size_Len : Natural; Max_Actual_Use_Len : Natural; diff --git a/gcc/ada/libgnat/s-stausa.ads b/gcc/ada/libgnat/s-stausa.ads index 36cebd7cde07..5fbda041b690 100644 --- a/gcc/ada/libgnat/s-stausa.ads +++ b/gcc/ada/libgnat/s-stausa.ads @@ -41,9 +41,8 @@ package System.Stack_Usage is subtype Stack_Address is SSE.Integer_Address; -- Address on the stack - function To_Stack_Address - (Value : System.Address) return Stack_Address - renames System.Storage_Elements.To_Integer; + function To_Stack_Address (Value : System.Address) return Stack_Address + renames System.Storage_Elements.To_Integer; Task_Name_Length : constant := 32; -- The maximum length of task name displayed. @@ -85,7 +84,7 @@ package System.Stack_Usage is -- Bottom_Of_Stack : aliased Integer; -- -- Bottom_Of_Stack'Address will be used as an approximation of - -- -- the bottom of stack. A good practise is to avoid allocating + -- -- the bottom of stack. A good practice is to avoid allocating -- -- other local variables on this stack, as it would degrade -- -- the quality of this approximation. @@ -227,12 +226,12 @@ package System.Stack_Usage is -- procedure Initialize_Analyzer - (Analyzer : in out Stack_Analyzer; - Task_Name : String; - Stack_Size : Natural; - Stack_Base : System.Address; - Pattern_Size : Natural; - Pattern : Interfaces.Unsigned_32 := 16#DEAD_BEEF#); + (Analyzer : in out Stack_Analyzer; + Task_Name : String; + Stack_Size : Natural; + Stack_Base : System.Address; + Pattern_Size : Natural; + Pattern : Interfaces.Unsigned_32 := 16#DEAD_BEEF#); -- Should be called before any use of a Stack_Analyzer, to initialize it. -- Max_Pattern_Size is the size of the pattern zone, might be smaller than -- the full stack size Stack_Size in order to take into account e.g. the @@ -244,22 +243,16 @@ package System.Stack_Usage is -- When this flag is true, then stack analysis is enabled procedure Compute_Result (Analyzer : in out Stack_Analyzer); - -- Read the pattern zone and deduce the stack usage. It should be called - -- from the same frame as Fill_Stack. If Analyzer.Probe is not null, an - -- array of Unsigned_32 with Analyzer.Probe elements is allocated on - -- Compute_Result's stack frame. Probe can be used to detect the error: - -- "instrumentation threshold at reading". See above. After the call + -- Read the pattern zone and deduce the stack usage. After the call -- to this procedure, the memory will look like: -- -- Stack growing -- -----------------------------------------------------------------------> - -- |<---------------------->|<-------------->|<--------->|<--------->| - -- | Stack frames | Array of | used | Memory | - -- | to Compute_Result | Analyzer.Probe | during | filled | - -- | | elements | the | with | - -- | | | execution | pattern | - -- | | | - -- |<----------------------------------------------------> | + -- |<---------------------->|<-------------------->|<--------------->| + -- | Stack frame | Used during the | Memory filled | + -- | to Compute_Result | execution | with pattern | + -- | | | | + -- |<--------------------------------------------->| | -- Stack used ^ -- Pattern_Limit @@ -277,8 +270,8 @@ package System.Stack_Usage is private - package Unsigned_32_Addr is - new System.Address_To_Access_Conversions (Interfaces.Unsigned_32); + package Unsigned_32_Addr is new + System.Address_To_Access_Conversions (Interfaces.Unsigned_32); subtype Pattern_Type is Interfaces.Unsigned_32; Bytes_Per_Pattern : constant := Pattern_Type'Object_Size / Storage_Unit; @@ -320,7 +313,7 @@ private Environment_Task_Analyzer : Stack_Analyzer; - Compute_Environment_Task : Boolean; + Compute_Environment_Task : Boolean; type Result_Array_Ptr is access all Result_Array_Type; @@ -332,8 +325,7 @@ private -- Id of the next stack analyzer function Stack_Size - (SP_Low : Stack_Address; - SP_High : Stack_Address) return Natural; + (SP_Low : Stack_Address; SP_High : Stack_Address) return Natural; pragma Inline (Stack_Size); -- Return the size of a portion of stack delimited by SP_High and SP_Low -- (), i.e. the difference between SP_High and SP_Low. The storage element diff --git a/gcc/ada/libgnat/s-stopoo.ads b/gcc/ada/libgnat/s-stopoo.ads index e5153dc00b1d..015bd3ed0bd4 100644 --- a/gcc/ada/libgnat/s-stopoo.ads +++ b/gcc/ada/libgnat/s-stopoo.ads @@ -40,8 +40,9 @@ package System.Storage_Pools with Pure is type Root_Storage_Pool is abstract - new Ada.Finalization.Limited_Controlled with private; - pragma Preelaborable_Initialization (Root_Storage_Pool); + new Ada.Finalization.Limited_Controlled with private + with + Preelaborable_Initialization; procedure Allocate (Pool : in out Root_Storage_Pool; diff --git a/gcc/ada/libgnat/s-stposu.ads b/gcc/ada/libgnat/s-stposu.ads index fda350126d84..97aba7658580 100644 --- a/gcc/ada/libgnat/s-stposu.ads +++ b/gcc/ada/libgnat/s-stposu.ads @@ -41,15 +41,17 @@ package System.Storage_Pools.Subpools is pragma Preelaborate; type Root_Storage_Pool_With_Subpools is abstract - new Root_Storage_Pool with private; - pragma Preelaborable_Initialization (Root_Storage_Pool_With_Subpools); + new Root_Storage_Pool with private + with + Preelaborable_Initialization; -- The base for all implementations of Storage_Pool_With_Subpools. This -- type is Limited_Controlled by derivation. To use subpools, an access -- type must be associated with an implementation descending from type -- Root_Storage_Pool_With_Subpools. - type Root_Subpool is abstract tagged limited private; - pragma Preelaborable_Initialization (Root_Subpool); + type Root_Subpool is abstract tagged limited private + with + Preelaborable_Initialization; -- The base for all implementations of Subpool. Objects of this type are -- managed by the pool_with_subpools. diff --git a/gcc/ada/libgnat/system-aix.ads b/gcc/ada/libgnat/system-aix.ads index 5129fbda8d8c..b8e9adb07fb7 100644 --- a/gcc/ada/libgnat/system-aix.ads +++ b/gcc/ada/libgnat/system-aix.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-darwin-arm.ads b/gcc/ada/libgnat/system-darwin-arm.ads index f4a14279a51e..a5e6a425758d 100644 --- a/gcc/ada/libgnat/system-darwin-arm.ads +++ b/gcc/ada/libgnat/system-darwin-arm.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-darwin-ppc.ads b/gcc/ada/libgnat/system-darwin-ppc.ads index 9c2393b8d3a8..f1421c4e86f2 100644 --- a/gcc/ada/libgnat/system-darwin-ppc.ads +++ b/gcc/ada/libgnat/system-darwin-ppc.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-darwin-x86.ads b/gcc/ada/libgnat/system-darwin-x86.ads index c6bcffc7b5a8..9c142760dba1 100644 --- a/gcc/ada/libgnat/system-darwin-x86.ads +++ b/gcc/ada/libgnat/system-darwin-x86.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-djgpp.ads b/gcc/ada/libgnat/system-djgpp.ads index 9241e0c96fa0..18ed31bbd420 100644 --- a/gcc/ada/libgnat/system-djgpp.ads +++ b/gcc/ada/libgnat/system-djgpp.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-dragonfly-x86_64.ads b/gcc/ada/libgnat/system-dragonfly-x86_64.ads index 0222746b2c63..5496518df87c 100644 --- a/gcc/ada/libgnat/system-dragonfly-x86_64.ads +++ b/gcc/ada/libgnat/system-dragonfly-x86_64.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-freebsd.ads b/gcc/ada/libgnat/system-freebsd.ads index 6b20133d4e9e..3d3ad8a22382 100644 --- a/gcc/ada/libgnat/system-freebsd.ads +++ b/gcc/ada/libgnat/system-freebsd.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-gnu.ads b/gcc/ada/libgnat/system-gnu.ads index 5049ab88856e..ff6afc64701d 100644 --- a/gcc/ada/libgnat/system-gnu.ads +++ b/gcc/ada/libgnat/system-gnu.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-hpux-ia64.ads b/gcc/ada/libgnat/system-hpux-ia64.ads index 0279aba44bec..f7dfa0ddbf62 100644 --- a/gcc/ada/libgnat/system-hpux-ia64.ads +++ b/gcc/ada/libgnat/system-hpux-ia64.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-hpux.ads b/gcc/ada/libgnat/system-hpux.ads index 02ba0dcf46ef..d33fa2faab85 100644 --- a/gcc/ada/libgnat/system-hpux.ads +++ b/gcc/ada/libgnat/system-hpux.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-linux-alpha.ads b/gcc/ada/libgnat/system-linux-alpha.ads index 8bd0567b27c7..3b5f1c741d7d 100644 --- a/gcc/ada/libgnat/system-linux-alpha.ads +++ b/gcc/ada/libgnat/system-linux-alpha.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-linux-arm.ads b/gcc/ada/libgnat/system-linux-arm.ads index 68d3bdebcb00..c8fadfbef8eb 100644 --- a/gcc/ada/libgnat/system-linux-arm.ads +++ b/gcc/ada/libgnat/system-linux-arm.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-linux-hppa.ads b/gcc/ada/libgnat/system-linux-hppa.ads index 49bf98544a42..edabc481f418 100644 --- a/gcc/ada/libgnat/system-linux-hppa.ads +++ b/gcc/ada/libgnat/system-linux-hppa.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-linux-ia64.ads b/gcc/ada/libgnat/system-linux-ia64.ads index 5fccde5d521a..eba85790784f 100644 --- a/gcc/ada/libgnat/system-linux-ia64.ads +++ b/gcc/ada/libgnat/system-linux-ia64.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-linux-loongarch.ads b/gcc/ada/libgnat/system-linux-loongarch.ads index 683b7a441558..32d58e90b5ef 100644 --- a/gcc/ada/libgnat/system-linux-loongarch.ads +++ b/gcc/ada/libgnat/system-linux-loongarch.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-linux-m68k.ads b/gcc/ada/libgnat/system-linux-m68k.ads index caa8359dea0f..82c1d0741e7a 100644 --- a/gcc/ada/libgnat/system-linux-m68k.ads +++ b/gcc/ada/libgnat/system-linux-m68k.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-linux-mips.ads b/gcc/ada/libgnat/system-linux-mips.ads index 729ffdd4f9f3..abb76e370296 100644 --- a/gcc/ada/libgnat/system-linux-mips.ads +++ b/gcc/ada/libgnat/system-linux-mips.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-linux-ppc.ads b/gcc/ada/libgnat/system-linux-ppc.ads index 5b0c2dcd39c3..9f3c57efb309 100644 --- a/gcc/ada/libgnat/system-linux-ppc.ads +++ b/gcc/ada/libgnat/system-linux-ppc.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-linux-riscv.ads b/gcc/ada/libgnat/system-linux-riscv.ads index b7aeb6bd7bef..0b917cfbed16 100644 --- a/gcc/ada/libgnat/system-linux-riscv.ads +++ b/gcc/ada/libgnat/system-linux-riscv.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-linux-s390.ads b/gcc/ada/libgnat/system-linux-s390.ads index 6d3cbc394dd5..bbba48f90c6b 100644 --- a/gcc/ada/libgnat/system-linux-s390.ads +++ b/gcc/ada/libgnat/system-linux-s390.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-linux-sh4.ads b/gcc/ada/libgnat/system-linux-sh4.ads index ccbbc7490b4c..85aade09dfa6 100644 --- a/gcc/ada/libgnat/system-linux-sh4.ads +++ b/gcc/ada/libgnat/system-linux-sh4.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-linux-sparc.ads b/gcc/ada/libgnat/system-linux-sparc.ads index 6f9f1a045064..159e0c891d01 100644 --- a/gcc/ada/libgnat/system-linux-sparc.ads +++ b/gcc/ada/libgnat/system-linux-sparc.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-linux-x86.ads b/gcc/ada/libgnat/system-linux-x86.ads index 325783ceccc5..75bcc0854c84 100644 --- a/gcc/ada/libgnat/system-linux-x86.ads +++ b/gcc/ada/libgnat/system-linux-x86.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-lynxos178-ppc.ads b/gcc/ada/libgnat/system-lynxos178-ppc.ads index ae1762173c8a..061a17f1f659 100644 --- a/gcc/ada/libgnat/system-lynxos178-ppc.ads +++ b/gcc/ada/libgnat/system-lynxos178-ppc.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-lynxos178-x86.ads b/gcc/ada/libgnat/system-lynxos178-x86.ads index 8549120f75e4..13a310a71aa8 100644 --- a/gcc/ada/libgnat/system-lynxos178-x86.ads +++ b/gcc/ada/libgnat/system-lynxos178-x86.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-mingw.ads b/gcc/ada/libgnat/system-mingw.ads index a0633b3f4d62..d0df352e4809 100644 --- a/gcc/ada/libgnat/system-mingw.ads +++ b/gcc/ada/libgnat/system-mingw.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-qnx-arm.ads b/gcc/ada/libgnat/system-qnx-arm.ads index a271612b88bb..2513a1d1340a 100644 --- a/gcc/ada/libgnat/system-qnx-arm.ads +++ b/gcc/ada/libgnat/system-qnx-arm.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-rtems.ads b/gcc/ada/libgnat/system-rtems.ads index 99e14febc5b0..48b7beb84f2f 100644 --- a/gcc/ada/libgnat/system-rtems.ads +++ b/gcc/ada/libgnat/system-rtems.ads @@ -68,8 +68,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := Standard'Storage_Unit; diff --git a/gcc/ada/libgnat/system-solaris-sparc.ads b/gcc/ada/libgnat/system-solaris-sparc.ads index 9599bc009fd3..0d8ae8750601 100644 --- a/gcc/ada/libgnat/system-solaris-sparc.ads +++ b/gcc/ada/libgnat/system-solaris-sparc.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-solaris-x86.ads b/gcc/ada/libgnat/system-solaris-x86.ads index 4b331c6f8164..c60939272b41 100644 --- a/gcc/ada/libgnat/system-solaris-x86.ads +++ b/gcc/ada/libgnat/system-solaris-x86.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-vxworks-ppc-kernel.ads b/gcc/ada/libgnat/system-vxworks-ppc-kernel.ads index f95db4a41f88..2f9c0b48af87 100644 --- a/gcc/ada/libgnat/system-vxworks-ppc-kernel.ads +++ b/gcc/ada/libgnat/system-vxworks-ppc-kernel.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-vxworks-ppc-rtp-smp.ads b/gcc/ada/libgnat/system-vxworks-ppc-rtp-smp.ads index 6890caeb9fea..e266b4b6fa9e 100644 --- a/gcc/ada/libgnat/system-vxworks-ppc-rtp-smp.ads +++ b/gcc/ada/libgnat/system-vxworks-ppc-rtp-smp.ads @@ -66,8 +66,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-vxworks-ppc-rtp.ads b/gcc/ada/libgnat/system-vxworks-ppc-rtp.ads index a4607df5b248..a205140bf11b 100644 --- a/gcc/ada/libgnat/system-vxworks-ppc-rtp.ads +++ b/gcc/ada/libgnat/system-vxworks-ppc-rtp.ads @@ -66,8 +66,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-vxworks7-aarch64-rtp-smp.ads b/gcc/ada/libgnat/system-vxworks7-aarch64-rtp-smp.ads index a2aabccf748c..7b01f8527ec9 100644 --- a/gcc/ada/libgnat/system-vxworks7-aarch64-rtp-smp.ads +++ b/gcc/ada/libgnat/system-vxworks7-aarch64-rtp-smp.ads @@ -66,8 +66,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; @@ -120,9 +120,6 @@ package System is private - pragma Linker_Options ("--specs=vxworks7-rtp-base-link.spec"); - -- Define the symbol wrs_rtp_base - type Address is mod Memory_Size; for Address'Size use Standard'Address_Size; diff --git a/gcc/ada/libgnat/system-vxworks7-aarch64.ads b/gcc/ada/libgnat/system-vxworks7-aarch64.ads index 7a94e40e02c7..12db85ff63a9 100644 --- a/gcc/ada/libgnat/system-vxworks7-aarch64.ads +++ b/gcc/ada/libgnat/system-vxworks7-aarch64.ads @@ -66,8 +66,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-vxworks7-arm-rtp-smp.ads b/gcc/ada/libgnat/system-vxworks7-arm-rtp-smp.ads index b7581c25d608..9b5c9b5712e2 100644 --- a/gcc/ada/libgnat/system-vxworks7-arm-rtp-smp.ads +++ b/gcc/ada/libgnat/system-vxworks7-arm-rtp-smp.ads @@ -66,8 +66,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-vxworks7-arm.ads b/gcc/ada/libgnat/system-vxworks7-arm.ads index 875f4be421b8..0b7b68c72f0b 100644 --- a/gcc/ada/libgnat/system-vxworks7-arm.ads +++ b/gcc/ada/libgnat/system-vxworks7-arm.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-vxworks7-ppc-kernel.ads b/gcc/ada/libgnat/system-vxworks7-ppc-kernel.ads index 356c1c568220..a89e71cc54e3 100644 --- a/gcc/ada/libgnat/system-vxworks7-ppc-kernel.ads +++ b/gcc/ada/libgnat/system-vxworks7-ppc-kernel.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-vxworks7-ppc-rtp-smp.ads b/gcc/ada/libgnat/system-vxworks7-ppc-rtp-smp.ads index 7a5cce0061ad..1958e1021f6e 100644 --- a/gcc/ada/libgnat/system-vxworks7-ppc-rtp-smp.ads +++ b/gcc/ada/libgnat/system-vxworks7-ppc-rtp-smp.ads @@ -66,8 +66,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; @@ -120,9 +120,6 @@ package System is private - pragma Linker_Options ("--specs=vxworks7-rtp-base-link.spec"); - -- Define the symbol wrs_rtp_base - type Address is mod Memory_Size; for Address'Size use Standard'Address_Size; diff --git a/gcc/ada/libgnat/system-vxworks7-ppc64-kernel.ads b/gcc/ada/libgnat/system-vxworks7-ppc64-kernel.ads index 6a12d2dac8ff..fb15358aedcc 100644 --- a/gcc/ada/libgnat/system-vxworks7-ppc64-kernel.ads +++ b/gcc/ada/libgnat/system-vxworks7-ppc64-kernel.ads @@ -66,8 +66,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-vxworks7-ppc64-rtp-smp.ads b/gcc/ada/libgnat/system-vxworks7-ppc64-rtp-smp.ads index 7670c1b79232..f8c69d6f8855 100644 --- a/gcc/ada/libgnat/system-vxworks7-ppc64-rtp-smp.ads +++ b/gcc/ada/libgnat/system-vxworks7-ppc64-rtp-smp.ads @@ -66,8 +66,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; @@ -120,9 +120,6 @@ package System is private - pragma Linker_Options ("--specs=vxworks7-ppc64-rtp-base-link.spec"); - -- Define the symbol wrs_rtp_base - type Address is mod Memory_Size; for Address'Size use Standard'Address_Size; diff --git a/gcc/ada/libgnat/system-vxworks7-x86-kernel.ads b/gcc/ada/libgnat/system-vxworks7-x86-kernel.ads index 9a11ed6b6a37..7a9baa920a2a 100644 --- a/gcc/ada/libgnat/system-vxworks7-x86-kernel.ads +++ b/gcc/ada/libgnat/system-vxworks7-x86-kernel.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-vxworks7-x86-rtp-smp.ads b/gcc/ada/libgnat/system-vxworks7-x86-rtp-smp.ads index 771c2aed4e2c..de3f68d3ebe9 100644 --- a/gcc/ada/libgnat/system-vxworks7-x86-rtp-smp.ads +++ b/gcc/ada/libgnat/system-vxworks7-x86-rtp-smp.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; @@ -118,9 +118,6 @@ package System is private - pragma Linker_Options ("--specs=vxworks7-x86-rtp-base-link.spec"); - -- Define the symbol wrs_rtp_base - type Address is mod Memory_Size; for Address'Size use Standard'Address_Size; diff --git a/gcc/ada/libgnat/system-vxworks7-x86_64-kernel.ads b/gcc/ada/libgnat/system-vxworks7-x86_64-kernel.ads index 6689f2dedf54..6567a26c8391 100644 --- a/gcc/ada/libgnat/system-vxworks7-x86_64-kernel.ads +++ b/gcc/ada/libgnat/system-vxworks7-x86_64-kernel.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; diff --git a/gcc/ada/libgnat/system-vxworks7-x86_64-rtp-smp.ads b/gcc/ada/libgnat/system-vxworks7-x86_64-rtp-smp.ads index a34aba4974a2..539e6bdf3017 100644 --- a/gcc/ada/libgnat/system-vxworks7-x86_64-rtp-smp.ads +++ b/gcc/ada/libgnat/system-vxworks7-x86_64-rtp-smp.ads @@ -64,8 +64,8 @@ package System is -- Storage-related Declarations - type Address is private; - pragma Preelaborable_Initialization (Address); + type Address is private + with Preelaborable_Initialization; Null_Address : constant Address; Storage_Unit : constant := 8; @@ -118,9 +118,6 @@ package System is private - pragma Linker_Options ("--specs=vxworks7-x86_64-rtp-base-link.spec"); - -- Define the symbol wrs_rtp_base - type Address is mod Memory_Size; for Address'Size use Standard'Address_Size; diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads index 73f9fe8e8f71..0fd5475e1279 100644 --- a/gcc/ada/opt.ads +++ b/gcc/ada/opt.ads @@ -338,7 +338,7 @@ package Opt is -- True if echoed commands to be written to stdout instead of stderr Comment_Deleted_Lines : Boolean := False; - -- GNATPREP + -- GNAT, GNATPREP -- True if source lines removed by the preprocessor should be commented -- in the output file. @@ -509,6 +509,11 @@ package Opt is -- GNATBIND -- Set to True to output chosen elaboration order + Empty_Comment_Deleted_Lines : Boolean := False; + -- GNAT, GNATPREP + -- True if source lines removed by the preprocessor are to be replaced + -- by empty comment lines ("--!" and no other text) in the output file. + Enable_128bit_Types : Boolean := False; -- GNAT -- Set to True to enable the support for 128-bit types in the compiler. @@ -755,6 +760,24 @@ package Opt is -- reflect the starting node of the outermost ignored Ghost region. If a -- nested ignored Ghost region is entered, the value must remain -- unchanged. + + Ghost_Mode_Assertion_Level : Entity_Id := Empty; + -- The Assertion_Level that is applied to the current ghost region. + -- It is either: + -- * Empty - when there is no ghost region + -- * Assertion_Level - if the ghost aspect/pragama had an + -- Assertion_Levle associated with it. + -- * Standard_Default_Level - if the ghost aspect/pragama did not have + -- an Assertion_Level associated to it. + + Current_Region : Node_Id := Empty; + -- Latest ghost region + + Is_Inside_Statement_Or_Pragma : Boolean := False; + -- A flag to tag whether we are currently in a region that originated + -- from a Statement or a pragma. Inside those regions the ghost policy + -- in effect for implicitly defined entities is not the policy for Ghost + -- but instead the policy for the region (SPARK RM 6.9 (3)). end record; Ghost_Config : Ghost_Config_Type; @@ -823,9 +846,9 @@ package Opt is Implicit_Packing : Boolean := False; -- GNAT - -- If set True, then a Size attribute clause on an array is allowed to - -- cause implicit packing instead of generating an error message. Set by - -- use of pragma Implicit_Packing. + -- If set True, then a Size attribute clause on an array or record is + -- allowed to cause implicit packing instead of generating an error + -- message. Set by use of pragma Implicit_Packing. Init_Or_Norm_Scalars : Boolean := False; -- GNAT, GNATBIND diff --git a/gcc/ada/par-ch10.adb b/gcc/ada/par-ch10.adb index 37121dd5028b..540339738130 100644 --- a/gcc/ada/par-ch10.adb +++ b/gcc/ada/par-ch10.adb @@ -925,7 +925,7 @@ package body Ch10 is -- then the compilation of the child unit itself is the -- place where such an "error" should be caught. - Set_Name (With_Node, P_Qualified_Simple_Name); + Set_Name (With_Node, P_Library_Unit_Name); if Name (With_Node) = Error then Remove (With_Node); end if; @@ -1038,7 +1038,7 @@ package body Ch10 is Scan; -- past SEPARATE; U_Left_Paren; - Set_Name (Subunit_Node, P_Qualified_Simple_Name); + Set_Name (Subunit_Node, P_Parent_Unit_Name); U_Right_Paren; Ignore (Tok_Semicolon); diff --git a/gcc/ada/par-ch12.adb b/gcc/ada/par-ch12.adb index 5fb6f8c98772..7bd449d0b72f 100644 --- a/gcc/ada/par-ch12.adb +++ b/gcc/ada/par-ch12.adb @@ -124,6 +124,8 @@ package body Ch12 is Check_Misspelling_Of (Tok_Renames); if Token = Tok_Renames then + Scan; -- past RENAMES + if Ren_Token = Tok_Package then Decl_Node := New_Node (N_Generic_Package_Renaming_Declaration, Gen_Sloc); @@ -137,10 +139,8 @@ package body Ch12 is (N_Generic_Function_Renaming_Declaration, Gen_Sloc); end if; - Scan; -- past RENAMES Set_Defining_Unit_Name (Decl_Node, Def_Unit); - Set_Name (Decl_Node, P_Name); - + Set_Name (Decl_Node, P_Generic_Unit_Name); P_Aspect_Specifications (Decl_Node, Semicolon => False); TF_Semicolon; return Decl_Node; @@ -944,7 +944,7 @@ package body Ch12 is Set_Interface_List (Def_Node, New_List); loop - Append (P_Qualified_Simple_Name, Interface_List (Def_Node)); + Append (P_Subtype_Name, Interface_List (Def_Node)); exit when Token /= Tok_And; Scan; -- past AND end loop; @@ -1285,7 +1285,7 @@ package body Ch12 is Set_Defining_Identifier (Def_Node, P_Defining_Identifier (C_Is)); T_Is; T_New; - Set_Name (Def_Node, P_Qualified_Simple_Name); + Set_Name (Def_Node, P_Generic_Unit_Name); if Token = Tok_Left_Paren then Save_Scan_State (Scan_State); -- at the left paren diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb index a685812de604..56c1b894c0df 100644 --- a/gcc/ada/par-ch3.adb +++ b/gcc/ada/par-ch3.adb @@ -1092,7 +1092,7 @@ package body Ch3 is return Error; else - Type_Node := P_Qualified_Simple_Name_Resync; + Type_Node := P_Subtype_Name_Resync; -- Check for a subtype mark attribute. The only valid possibilities -- are 'CLASS and 'BASE. Anything else is a definite error. We may @@ -1704,7 +1704,7 @@ package body Ch3 is No_List; Decl_Node := New_Node (N_Exception_Renaming_Declaration, Ident_Sloc); - Set_Name (Decl_Node, P_Qualified_Simple_Name_Resync); + Set_Name (Decl_Node, P_Exception_Name); No_Constraint; else Decl_Node := New_Node (N_Exception_Declaration, Prev_Token_Ptr); @@ -2054,7 +2054,7 @@ package body Ch3 is Set_Interface_List (Typedef_Node, New_List); loop - Append (P_Qualified_Simple_Name, Interface_List (Typedef_Node)); + Append (P_Subtype_Name, Interface_List (Typedef_Node)); exit when Token /= Tok_And; Scan; -- past AND end loop; @@ -4177,7 +4177,7 @@ package body Ch3 is Set_Abstract_Present (Typedef_Node); Set_Interface_Present (Typedef_Node); - Set_Subtype_Indication (Typedef_Node, P_Qualified_Simple_Name); + Set_Subtype_Indication (Typedef_Node, P_Subtype_Name); Set_Record_Extension_Part (Typedef_Node, New_Node (N_Record_Definition, Token_Ptr)); @@ -4188,8 +4188,7 @@ package body Ch3 is Scan; -- past AND loop - Append (P_Qualified_Simple_Name, - Interface_List (Typedef_Node)); + Append (P_Subtype_Name, Interface_List (Typedef_Node)); exit when Token /= Tok_And; Scan; -- past AND end loop; diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb index ebdc587f0e15..f8ae9970c88e 100644 --- a/gcc/ada/par-ch4.adb +++ b/gcc/ada/par-ch4.adb @@ -82,8 +82,6 @@ package body Ch4 is function P_Relation return Node_Id; function P_Term return Node_Id; function P_Declare_Expression return Node_Id; - function P_Reduction_Attribute_Reference (S : Node_Id) - return Node_Id; function P_Binary_Adding_Operator return Node_Kind; function P_Logical_Operator return Node_Kind; @@ -91,6 +89,9 @@ package body Ch4 is function P_Relational_Operator return Node_Kind; function P_Unary_Adding_Operator return Node_Kind; + function P_Simple_Name (Instance_OK : Boolean) return Node_Id; + function P_Simple_Name_Resync (Instance_OK : Boolean) return Node_Id; + procedure Bad_Range_Attribute (Loc : Source_Ptr); -- Called to place complaint about bad range attribute at the given -- source location. Terminates by raising Error_Resync. @@ -108,6 +109,10 @@ package body Ch4 is -- prefix. The current token is known to be an apostrophe and the -- following token is known to be RANGE. + function P_Reduction_Attribute_Reference (Pref : Node_Id) return Node_Id; + -- Scan a reduction attribute reference. The caller has scanned out the + -- prefix. The current token is known to be an identifier. + function P_Case_Expression return Node_Id; -- Scans out a case expression. Called with Token pointing to the CASE -- keyword, and returns pointing to the terminating right parent, @@ -152,9 +157,10 @@ package body Ch4 is -- NAME ::= -- DIRECT_NAME | EXPLICIT_DEREFERENCE -- | INDEXED_COMPONENT | SLICE - -- | SELECTED_COMPONENT | ATTRIBUTE + -- | SELECTED_COMPONENT | ATTRIBUTE_REFERENCE -- | TYPE_CONVERSION | FUNCTION_CALL -- | CHARACTER_LITERAL | TARGET_NAME + -- | STRUCTURAL_GENERIC_INSTANCE_NAME -- DIRECT_NAME ::= IDENTIFIER | OPERATOR_SYMBOL @@ -192,6 +198,8 @@ package body Ch4 is -- TARGET_NAME ::= @ (AI12-0125-3: abbreviation for LHS) + -- STRUCTURAL_GENERIC_INSTANCE_NAME ::= NAME GENERIC_ACTUAL_PART + -- Note: syntactically a procedure call looks just like a function call, -- so this routine is in practice used to scan out procedure calls as well. @@ -474,7 +482,11 @@ package body Ch4 is elsif Token = Tok_Identifier then Attr_Name := Token_Name; - if not Is_Attribute_Name (Attr_Name) then + -- Attribute Unsigned_Base_Range temporarily disabled + + if not Is_Attribute_Name (Attr_Name) + or else Attr_Name = Name_Unsigned_Base_Range + then if Apostrophe_Should_Be_Semicolon then Expr_Form := EF_Name; return Name_Node; @@ -683,6 +695,7 @@ package body Ch4 is -- If there is at least one occurrence of identifier => (but -- none of the other cases apply), then we have a call. + -- This case is handled by LP_State_Call. -- Test for Id => case @@ -902,8 +915,7 @@ package body Ch4 is -- have seen at least one named parameter already. Error_Msg_SC - ("positional parameter association " & - "not allowed after named one"); + ("positional parameter association not allowed after named one"); Error_Loc := Token_Ptr; @@ -929,79 +941,290 @@ package body Ch4 is end P_Name; + -- These functions parse a restricted form of Names which are either + -- designators or structural generic instance names, and are preceded, + -- or not, by a sequence of prefixes that are either direct names or + -- structural generic instance names. + + -- Error recovery: can raise Error_Resync + + function P_Exception_Name return Node_Id is + begin + return P_Simple_Name_Resync (Instance_OK => False); + end P_Exception_Name; + + function P_Label_Name return Node_Id is + begin + return P_Simple_Name_Resync (Instance_OK => False); + end P_Label_Name; + + function P_Loop_Name return Node_Id is + begin + return P_Simple_Name_Resync (Instance_OK => False); + end P_Loop_Name; + + function P_Subtype_Name_Resync return Node_Id is + begin + return P_Simple_Name_Resync (Instance_OK => False); + end P_Subtype_Name_Resync; + + -- Error recovery: cannot raise Error_Resync + + function P_Generic_Unit_Name return Node_Id is + begin + return P_Simple_Name (Instance_OK => False); + end P_Generic_Unit_Name; + + function P_Library_Unit_Name return Node_Id is + begin + return P_Simple_Name (Instance_OK => False); + end P_Library_Unit_Name; + + function P_Package_Name return Node_Id is + begin + return P_Simple_Name (Instance_OK => True); + end P_Package_Name; + + function P_Parent_Unit_Name return Node_Id is + begin + return P_Simple_Name (Instance_OK => False); + end P_Parent_Unit_Name; + + function P_Subtype_Name return Node_Id is + begin + return P_Simple_Name (Instance_OK => False); + end P_Subtype_Name; + -- This function parses a restricted form of Names which are either - -- designators, or designators preceded by a sequence of prefixes - -- that are direct names. + -- designators or structural generic instance names, and are preceded, + -- or not, by a sequence of prefixes that are either direct names or + -- structural generic instance names. + + -- If Instance_OK is False, the simple name cannot be a structural + -- generic instance name, preceded or not by prefixes (Instance_OK + -- has no effects on the accepted prefixes, if any). -- Error recovery: cannot raise Error_Resync - function P_Qualified_Simple_Name return Node_Id is + function P_Simple_Name (Instance_OK : Boolean) return Node_Id is begin - return P_Qualified_Simple_Name_Resync; + return P_Simple_Name_Resync (Instance_OK); exception when Error_Resync => return Error; - end P_Qualified_Simple_Name; + end P_Simple_Name; - -- This procedure differs from P_Qualified_Simple_Name only in that it - -- raises Error_Resync if any error is encountered. It only returns after - -- scanning a valid qualified simple name. + -- This procedure differs from P_Simple_Name only in that it raises + -- Error_Resync if any error is encountered. It only returns after + -- scanning a valid simple name. -- Error recovery: can raise Error_Resync - function P_Qualified_Simple_Name_Resync return Node_Id is - Designator_Node : Node_Id; - Prefix_Node : Node_Id; - Selector_Node : Node_Id; - Dot_Sloc : Source_Ptr := No_Location; + function P_Simple_Name_Resync (Instance_OK : Boolean) return Node_Id is + Arg_Node : Node_Id; + Ident_Node : Node_Id; + Name_Node : Node_Id; + Prefix_Node : Node_Id; + Scan_State_Id : Saved_Scan_State; + Scan_State_LP : Saved_Scan_State; + + Arg_List : List_Id := No_List; -- kill junk warning begin - -- Prefix_Node is set to the gathered prefix so far, Empty means that - -- no prefix has been scanned. This allows us to build up the result - -- in the required right recursive manner. + -- Case of not a designator - Prefix_Node := Empty; + if Token not in Token_Class_Desig then + Discard_Junk_Node (P_Identifier); -- to issue the error message + raise Error_Resync; + end if; - -- Loop through prefixes + Name_Node := Token_Node; - loop - Designator_Node := Token_Node; + Scan; -- past designator - if Token not in Token_Class_Desig then - Discard_Junk_Node (P_Identifier); -- to issue the error message - raise Error_Resync; + -- Loop scanning past name extensions. A label is used for control + -- transfer for this loop for ease of interfacing with the finite state + -- machine in the parenthesis scanning circuit, and also to allow for + -- passing in control to the appropriate point from the above code. - else - Scan; -- past designator - exit when Token /= Tok_Dot; - end if; + <> - -- Here at a dot, with token just before it in Designator_Node + case Token is + when Tok_Left_Paren => + Save_Scan_State (Scan_State_LP); -- at left paren + Scan; -- past left paren + Arg_List := New_List; + goto Scan_Name_Extension_Left_Paren; + + when Tok_Dot => + Scan; -- past dot + goto Scan_Name_Extension_Dot; + + when others => + return Name_Node; + end case; + + -- Case of name extended by dot (selection), dot is already skipped + -- and the scan state at the point of the dot is saved in Scan_State. + + <> + + if Token in Token_Class_Desig then + Prefix_Node := Name_Node; + Name_Node := New_Node (N_Selected_Component, Prev_Token_Ptr); + Set_Prefix (Name_Node, Prefix_Node); + Set_Selector_Name (Name_Node, Token_Node); + Scan; -- past selector + goto Scan_Name_Extension; + + -- Here if nothing legal after the dot + + else + Discard_Junk_Node (P_Identifier); -- to issue the error message + raise Error_Resync; + end if; + + -- Here for left parenthesis extending name (left paren skipped) + + <> + + -- We now have to scan through a list of items, terminated by a + -- right parenthesis. The scan is handled by a finite state + -- machine. The possibilities are: + + -- (expression, expression, ..) + + -- This is interpreted as an indexed component, i.e. as a + -- case of a name which can be extended in the normal manner. + -- This case is handled by LP_State_Expr. + + -- Note: if and case expressions (without an extra level of + -- parentheses) are permitted in this context). + + -- (..., identifier => expression , ...) + + -- If there is at least one occurrence of identifier => (but + -- none of the other cases apply), then we have a call. + -- This case is handled by LP_State_Call. + + -- Test for Id => case + + if Token in Tok_Identifier | Tok_Operator_Symbol | Tok_Others then + Save_Scan_State (Scan_State_Id); -- at Id + Scan; -- past Id + + -- Test for => (allow := as an error substitute) + + if Token in Tok_Arrow | Tok_Colon_Equal then + Restore_Scan_State (Scan_State_Id); -- to Id + goto LP_State_Call; - if No (Prefix_Node) then - Prefix_Node := Designator_Node; else - Selector_Node := New_Node (N_Selected_Component, Dot_Sloc); - Set_Prefix (Selector_Node, Prefix_Node); - Set_Selector_Name (Selector_Node, Designator_Node); - Prefix_Node := Selector_Node; + Restore_Scan_State (Scan_State_Id); -- to Id end if; + end if; - Dot_Sloc := Token_Ptr; - Scan; -- past dot - end loop; + -- Here we have an expression after all - -- Fall out of the loop having just scanned an identifier + <> + + if Token in Tok_Box | Tok_Right_Paren then + goto LP_State_Rewind; + end if; + + Append (P_Expression_Or_Range_Attribute_If_OK, Arg_List); + + if Token = Tok_Comma then + Scan; -- past comma + goto Scan_Name_Extension_Left_Paren; + + elsif Token = Tok_Right_Paren then + Scan; -- past right paren + + if not Instance_OK and then Token /= Tok_Dot then + goto LP_State_Rewind; + end if; + + Prefix_Node := Name_Node; + Name_Node := New_Node (N_Indexed_Component, Sloc (Prefix_Node)); + Set_Prefix (Name_Node, Prefix_Node); + Set_Expressions (Name_Node, Arg_List); + goto Scan_Name_Extension; - if No (Prefix_Node) then - return Designator_Node; else - Selector_Node := New_Node (N_Selected_Component, Dot_Sloc); - Set_Prefix (Selector_Node, Prefix_Node); - Set_Selector_Name (Selector_Node, Designator_Node); - return Selector_Node; + goto LP_State_Rewind; + end if; + + -- LP_State_Call corresponds to the situation in which at least one + -- instance of Id => Expression has been encountered, so we know that + -- we do not have a name, but rather a call. We enter it with the + -- scan pointer pointing to the next argument to scan, and Arg_List + -- containing the list of arguments scanned so far. + + <> + + -- Test for case of Id => Expression (named parameter) + + if Token in Tok_Identifier | Tok_Operator_Symbol | Tok_Others then + Save_Scan_State (Scan_State_Id); -- at Id + Ident_Node := Token_Node; + Scan; -- past Id + + -- Deal with => (allow := as incorrect substitute) + + if Token in Tok_Arrow | Tok_Colon_Equal then + Arg_Node := New_Node (N_Parameter_Association, Prev_Token_Ptr); + T_Arrow; + if Token in Tok_Box then + goto LP_State_Rewind; + end if; + Set_Selector_Name (Arg_Node, Ident_Node); + Set_Explicit_Actual_Parameter (Arg_Node, P_Expression); + Append (Arg_Node, Arg_List); + + -- If a comma follows, go back and scan next entry + + if Comma_Present then + goto LP_State_Call; + + -- Otherwise we have the end of a call + + else + T_Right_Paren; -- past right paren + + if not Instance_OK and then Token /= Tok_Dot then + goto LP_State_Rewind; + end if; + + Prefix_Node := Name_Node; + Name_Node := New_Node (N_Function_Call, Sloc (Prefix_Node)); + Set_Name (Name_Node, Prefix_Node); + Set_Parameter_Associations (Name_Node, Arg_List); + goto Scan_Name_Extension; + end if; + + -- Filter out tokens that may appear in constraints + + elsif Token in Tok_Vertical_Bar then + goto LP_State_Rewind; + + -- Not named parameter: Id started an expression after all + + else + Restore_Scan_State (Scan_State_Id); -- to Id + end if; end if; - end P_Qualified_Simple_Name_Resync; + + -- Here if entry did not start with Id => which means that it + -- is a positional parameter, which is not allowed, since we + -- have seen at least one named parameter already. + + goto LP_State_Expr; + + <> + Restore_Scan_State (Scan_State_LP); + return Name_Node; + end P_Simple_Name_Resync; ---------------------- -- 4.1 Direct_Name -- @@ -1117,7 +1340,7 @@ package body Ch4 is -- P_Reduction_Attribute_Reference -- ------------------------------------- - function P_Reduction_Attribute_Reference (S : Node_Id) + function P_Reduction_Attribute_Reference (Pref : Node_Id) return Node_Id is Attr_Node : Node_Id; @@ -1132,7 +1355,7 @@ package body Ch4 is Error_Msg ("Reduce attribute expected", Prev_Token_Ptr); end if; - Set_Prefix (Attr_Node, S); + Set_Prefix (Attr_Node, Pref); Set_Expressions (Attr_Node, New_List); T_Left_Paren; Append (P_Name, Expressions (Attr_Node)); @@ -3399,7 +3622,7 @@ package body Ch4 is and then Token = Tok_Identifier then Save_Scan_State (Scan_State); - Type_Node := P_Qualified_Simple_Name_Resync; + Type_Node := P_Subtype_Name_Resync; if Token = Tok_Apostrophe then Scan; if Token_Name = Name_Make then diff --git a/gcc/ada/par-ch5.adb b/gcc/ada/par-ch5.adb index cc0e6c167fc2..76a536b33d11 100644 --- a/gcc/ada/par-ch5.adb +++ b/gcc/ada/par-ch5.adb @@ -2042,7 +2042,7 @@ package body Ch5 is begin Goto_Node := New_Node (N_Goto_Statement, Token_Ptr); Scan; -- past GOTO (or TO) - Set_Name (Goto_Node, P_Qualified_Simple_Name_Resync); + Set_Name (Goto_Node, P_Label_Name); Append_Elmt (Goto_Node, Goto_List); if Token = Tok_When then @@ -2393,7 +2393,7 @@ package body Ch5 is Scan; -- past EXIT or CONTINUE if Token = Tok_Identifier then - Set_Name (N, P_Qualified_Simple_Name); + Set_Name (N, P_Loop_Name); elsif Style_Check and then Nkind (N) = N_Exit_Statement then -- This statement has no name, so check that -- the innermost loop is unnamed too. diff --git a/gcc/ada/par-ch6.adb b/gcc/ada/par-ch6.adb index 2465108f7abc..a6418a5dc9ea 100644 --- a/gcc/ada/par-ch6.adb +++ b/gcc/ada/par-ch6.adb @@ -366,8 +366,8 @@ package body Ch6 is Inst_Node := New_Node (N_Procedure_Instantiation, Fproc_Sloc); end if; - Set_Name (Inst_Node, P_Qualified_Simple_Name); Set_Defining_Unit_Name (Inst_Node, Name_Node); + Set_Name (Inst_Node, P_Generic_Unit_Name); Set_Generic_Associations (Inst_Node, P_Generic_Actual_Part_Opt); P_Aspect_Specifications (Inst_Node, Semicolon => True); Pop_Scope_Stack; -- Don't need scope stack entry in this case diff --git a/gcc/ada/par-ch7.adb b/gcc/ada/par-ch7.adb index da663685e4ee..ff55c87055f0 100644 --- a/gcc/ada/par-ch7.adb +++ b/gcc/ada/par-ch7.adb @@ -187,7 +187,7 @@ package body Ch7 is Package_Node := New_Node (N_Package_Renaming_Declaration, Package_Sloc); Set_Defining_Unit_Name (Package_Node, Name_Node); - Set_Name (Package_Node, P_Qualified_Simple_Name); + Set_Name (Package_Node, P_Package_Name); No_Constraint; P_Aspect_Specifications (Package_Node, Semicolon => False); @@ -224,7 +224,7 @@ package body Ch7 is Package_Node := New_Node (N_Package_Instantiation, Package_Sloc); Set_Defining_Unit_Name (Package_Node, Name_Node); - Set_Name (Package_Node, P_Qualified_Simple_Name); + Set_Name (Package_Node, P_Generic_Unit_Name); Set_Generic_Associations (Package_Node, P_Generic_Actual_Part_Opt); diff --git a/gcc/ada/par-ch8.adb b/gcc/ada/par-ch8.adb index 8be1ceb0e0ed..16f7f954c515 100644 --- a/gcc/ada/par-ch8.adb +++ b/gcc/ada/par-ch8.adb @@ -128,7 +128,7 @@ package body Ch8 is loop Use_Node := New_Node (N_Use_Package_Clause, Use_Sloc); - Set_Name (Use_Node, P_Qualified_Simple_Name); + Set_Name (Use_Node, P_Package_Name); -- Locally chain each name's use-package node diff --git a/gcc/ada/par-ch9.adb b/gcc/ada/par-ch9.adb index 5edce03a728b..3ba1e708a742 100644 --- a/gcc/ada/par-ch9.adb +++ b/gcc/ada/par-ch9.adb @@ -221,7 +221,7 @@ package body Ch9 is Set_Interface_List (Task_Node, New_List); loop - Append (P_Qualified_Simple_Name, Interface_List (Task_Node)); + Append (P_Subtype_Name, Interface_List (Task_Node)); exit when Token /= Tok_And; Scan; -- past AND end loop; @@ -557,8 +557,7 @@ package body Ch9 is Set_Interface_List (Protected_Node, New_List); loop - Append (P_Qualified_Simple_Name, - Interface_List (Protected_Node)); + Append (P_Subtype_Name, Interface_List (Protected_Node)); exit when Token /= Tok_And; Scan; -- past AND diff --git a/gcc/ada/par-load.adb b/gcc/ada/par-load.adb index 4a97f14ffb51..0206b56e174f 100644 --- a/gcc/ada/par-load.adb +++ b/gcc/ada/par-load.adb @@ -117,6 +117,29 @@ procedure Load is end Same_File_Name_Except_For_Case; + function Actual_Name_Collides_With_Predefined_Unit_Name + (Actual_File_Name : File_Name_Type) return Boolean; + -- Given an actual file name, determine if it is a child unit whose parent + -- unit is a single letter that is a, g, i, or s. Such a name could create + -- confusion with predefined units and thus is required to use a tilde + -- instead of the minus as the second character. + + ---------------------------------------------------- + -- Actual_Name_Collides_With_Predefined_Unit_Name -- + ---------------------------------------------------- + + function Actual_Name_Collides_With_Predefined_Unit_Name + (Actual_File_Name : File_Name_Type) return Boolean + is + N1 : Character; + begin + Get_Name_String (Actual_File_Name); + N1 := Name_Buffer (1); + return Name_Len > 1 + and then Name_Buffer (2) = '-' + and then (N1 = 'a' or else N1 = 'g' or else N1 = 'i' or else N1 = 's'); + end Actual_Name_Collides_With_Predefined_Unit_Name; + -- Start of processing for Load begin @@ -163,8 +186,18 @@ begin (File_Name, Unit_File_Name (Cur_Unum))) then Error_Msg_File_1 := File_Name; - Error_Msg - ("??file name does not match unit name, should be{", Sloc (Curunit)); + if Actual_Name_Collides_With_Predefined_Unit_Name + (Unit_File_Name (Cur_Unum)) + then + Error_Msg + ("??file name may conflict with predefined units, " + & "the expected file name for this unit is{", + Sloc (Curunit)); + else + Error_Msg + ("??file name does not match unit name, should be{", + Sloc (Curunit)); + end if; end if; -- For units other than the main unit, the expected unit name is set and diff --git a/gcc/ada/par-prag.adb b/gcc/ada/par-prag.adb index 4d0ffe625497..3723e644c244 100644 --- a/gcc/ada/par-prag.adb +++ b/gcc/ada/par-prag.adb @@ -305,7 +305,7 @@ begin -- it is a semantic error, not a syntactic one (we have already checked -- the syntax for the unrecognized pragma as required by (RM 2.8(11)). - if Prag_Id = Unknown_Pragma then + if Prag_Id = Pragma_Unknown then return Pragma_Node; end if; @@ -1394,6 +1394,7 @@ begin | Pragma_Annotate | Pragma_Assert | Pragma_Assert_And_Cut + | Pragma_Assertion_Level | Pragma_Assertion_Policy | Pragma_Assume | Pragma_Assume_No_Invalid_Values @@ -1607,6 +1608,7 @@ begin | Pragma_Unreferenced | Pragma_Unreferenced_Objects | Pragma_Unreserve_All_Interrupts + | Pragma_Unsigned_Base_Range | Pragma_Unsuppress | Pragma_Unused | Pragma_Use_VADS_Size @@ -1620,12 +1622,12 @@ begin null; -------------------- - -- Unknown_Pragma -- + -- Pragma_Unknown -- -------------------- -- Should be impossible, since we excluded this case earlier on - when Unknown_Pragma => + when Pragma_Unknown => raise Program_Error; end case; diff --git a/gcc/ada/par.adb b/gcc/ada/par.adb index 99bbed2cfb2c..8ced09dc0098 100644 --- a/gcc/ada/par.adb +++ b/gcc/ada/par.adb @@ -829,8 +829,15 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is function P_Expression return Node_Id; function P_Expression_Or_Range_Attribute return Node_Id; function P_Name return Node_Id; - function P_Qualified_Simple_Name return Node_Id; - function P_Qualified_Simple_Name_Resync return Node_Id; + function P_Exception_Name return Node_Id; + function P_Label_Name return Node_Id; + function P_Loop_Name return Node_Id; + function P_Generic_Unit_Name return Node_Id; + function P_Library_Unit_Name return Node_Id; + function P_Package_Name return Node_Id; + function P_Parent_Unit_Name return Node_Id; + function P_Subtype_Name return Node_Id; + function P_Subtype_Name_Resync return Node_Id; function P_Simple_Expression return Node_Id; function P_Simple_Expression_Or_Range_Attribute return Node_Id; diff --git a/gcc/ada/prep.adb b/gcc/ada/prep.adb index 951719e2cdf8..7e58421b56f3 100644 --- a/gcc/ada/prep.adb +++ b/gcc/ada/prep.adb @@ -1210,6 +1210,13 @@ package body Prep is Output (From, To); end if; + New_EOL.all; + + elsif Empty_Comment_Deleted_Lines then + Put_Char ('-'); + Put_Char ('-'); + Put_Char ('!'); + New_EOL.all; end if; diff --git a/gcc/ada/prepcomp.adb b/gcc/ada/prepcomp.adb index 35dd4cbf53ae..f5ef40a0ff95 100644 --- a/gcc/ada/prepcomp.adb +++ b/gcc/ada/prepcomp.adb @@ -54,29 +54,31 @@ package body Prepcomp is pragma Warnings (On); type Preproc_Data is record - Mapping : Symbol_Table.Instance; - File_Name : File_Name_Type := No_File; - Deffile : String_Id := No_String; - Undef_False : Boolean := False; - Always_Blank : Boolean := False; - Comments : Boolean := False; - No_Deletion : Boolean := False; - List_Symbols : Boolean := False; - Processed : Boolean := False; + Mapping : Symbol_Table.Instance; + File_Name : File_Name_Type := No_File; + Deffile : String_Id := No_String; + Undef_False : Boolean := False; + Always_Blank : Boolean := False; + Comments : Boolean := False; + Empty_Comments : Boolean := False; + No_Deletion : Boolean := False; + List_Symbols : Boolean := False; + Processed : Boolean := False; end record; -- Structure to keep the preprocessing data for a file name or for the -- default (when Name_Id = No_Name). No_Preproc_Data : constant Preproc_Data := - (Mapping => No_Mapping, - File_Name => No_File, - Deffile => No_String, - Undef_False => False, - Always_Blank => False, - Comments => False, - No_Deletion => False, - List_Symbols => False, - Processed => False); + (Mapping => No_Mapping, + File_Name => No_File, + Deffile => No_String, + Undef_False => False, + Always_Blank => False, + Comments => False, + Empty_Comments => False, + No_Deletion => False, + List_Symbols => False, + Processed => False); Default_Data : Preproc_Data := No_Preproc_Data; -- The preprocessing data to be used when no specific preprocessing data @@ -170,6 +172,17 @@ package body Prepcomp is No_Preprocessing := False; Current_Data.Processed := True; + if Opt.Blank_Deleted_Lines then + Current_Data.Always_Blank := True; + + elsif Opt.Comment_Deleted_Lines then + Current_Data.Comments := True; + + elsif Opt.Empty_Comment_Deleted_Lines then + Current_Data.Empty_Comments := True; + + end if; + -- Start with an empty, initialized mapping table; use Prep.Mapping, -- because Prep.Index_Of uses Prep.Mapping. @@ -379,6 +392,15 @@ package body Prepcomp is OK := True; end if; + when 'e' => + + -- Replace removed lines with empty comment lines ("--!") + + if Name_Len = 1 then + Current_Data.Empty_Comments := True; + OK := True; + end if; + when 's' => -- List symbols @@ -601,12 +623,22 @@ package body Prepcomp is -- Set the preprocessing flags according to the preprocessing data - if Current_Data.Comments and not Current_Data.Always_Blank then - Comment_Deleted_Lines := True; - Blank_Deleted_Lines := False; + if Current_Data.Comments then + Comment_Deleted_Lines := True; + Empty_Comment_Deleted_Lines := False; + Blank_Deleted_Lines := False; + + elsif Current_Data.Always_Blank then + Comment_Deleted_Lines := False; + Empty_Comment_Deleted_Lines := False; + Blank_Deleted_Lines := True; + + -- By default, emit empty comment lines in place of deleted lines + else - Comment_Deleted_Lines := False; - Blank_Deleted_Lines := True; + Comment_Deleted_Lines := False; + Empty_Comment_Deleted_Lines := True; + Blank_Deleted_Lines := False; end if; No_Deletion := Current_Data.No_Deletion; diff --git a/gcc/ada/repinfo.adb b/gcc/ada/repinfo.adb index bbf92a778007..41afbb7ecbf6 100644 --- a/gcc/ada/repinfo.adb +++ b/gcc/ada/repinfo.adb @@ -119,7 +119,7 @@ package body Repinfo is function Entity_Hash (Id : Entity_Id) return Entity_Header_Num; -- Simple hash function for Entity_Ids - package Relevant_Entities is new GNAT.Htable.Simple_HTable + package Relevant_Entities is new GNAT.HTable.Simple_HTable (Header_Num => Entity_Header_Num, Element => Boolean, No_Element => False, @@ -455,7 +455,7 @@ package body Repinfo is if Present (Ent) and then Nkind (Declaration_Node (Ent)) not in N_Renaming_Declaration - and then not Is_Ignored_Ghost_Entity (Ent) + and then not Sem_Util.Is_Ignored_Ghost_Entity_In_Codegen (Ent) then -- If entity is a subprogram and we are listing mechanisms, -- then we need to list mechanisms for this entity. We skip this diff --git a/gcc/ada/rtinit.c b/gcc/ada/rtinit.c index 6a135529870b..598550c4051c 100644 --- a/gcc/ada/rtinit.c +++ b/gcc/ada/rtinit.c @@ -419,6 +419,7 @@ __gnat_runtime_initialize (int install_handler) int last; int argc_expanded = 0; TCHAR result [MAX_PATH]; + int arglen; int quoted; __gnat_get_argw (GetCommandLineW (), &wargv, &wargc); @@ -436,7 +437,10 @@ __gnat_runtime_initialize (int install_handler) for (k=1; k 1 + && wargv[k][arglen - 1] == _T('\''); /* Check for wildcard expansion if the argument is not quoted. */ if (!quoted && __gnat_do_argv_expansion diff --git a/gcc/ada/rtsfind.adb b/gcc/ada/rtsfind.adb index f47aacc77487..e15e93f2fba4 100644 --- a/gcc/ada/rtsfind.adb +++ b/gcc/ada/rtsfind.adb @@ -1114,7 +1114,7 @@ package body Rtsfind is -- Provide a clean environment for the unit Ignore_SPARK_Mode_Pragmas_In_Instance := False; - Install_Ghost_Region (None, Empty); + Install_Ghost_Region (None, Empty, Empty); Install_SPARK_Mode (None, Empty); -- Otherwise we need to load the unit, First build unit name from the diff --git a/gcc/ada/rtsfind.ads b/gcc/ada/rtsfind.ads index 37ed22b1c87d..c82af1154fea 100644 --- a/gcc/ada/rtsfind.ads +++ b/gcc/ada/rtsfind.ads @@ -773,12 +773,20 @@ package Rtsfind is RE_Scaled_Divide64, -- System.Arith_64 RE_Subtract_With_Ovflo_Check64, -- System.Arith_64 + RE_Uns_Add_With_Ovflo_Check64, -- System.Arith_64 + RE_Uns_Multiply_With_Ovflo_Check64, -- System.Arith_64 + RE_Uns_Subtract_With_Ovflo_Check64, -- System.Arith_64 + RE_Add_With_Ovflo_Check128, -- System.Arith_128 RE_Double_Divide128, -- System.Arith_128 RE_Multiply_With_Ovflo_Check128, -- System.Arith_128 RE_Subtract_With_Ovflo_Check128, -- System.Arith_128 RE_Scaled_Divide128, -- System.Arith_128 + RE_Uns_Add_With_Ovflo_Check128, -- System.Arith_128 + RE_Uns_Multiply_With_Ovflo_Check128, -- System.Arith_128 + RE_Uns_Subtract_With_Ovflo_Check128, -- System.Arith_128 + RE_Assert_Failure, -- System.Assertions RE_Raise_Assert_Failure, -- System.Assertions @@ -1652,6 +1660,7 @@ package Rtsfind is RE_Put_Image_Long_Long_Long_Unsigned, -- System.Put_Images RE_Put_Image_Thin_Pointer, -- System.Put_Images RE_Put_Image_Fat_Pointer, -- System.Put_Images + RE_Put_Image_Extended_Access_Pointer, -- System.Put_Images RE_Put_Image_Access_Subp, -- System.Put_Images RE_Put_Image_Access_Prot_Subp, -- System.Put_Images RE_Put_Image_String, -- System.Put_Images @@ -2421,12 +2430,20 @@ package Rtsfind is RE_Scaled_Divide64 => System_Arith_64, RE_Subtract_With_Ovflo_Check64 => System_Arith_64, + RE_Uns_Add_With_Ovflo_Check64 => System_Arith_64, + RE_Uns_Multiply_With_Ovflo_Check64 => System_Arith_64, + RE_Uns_Subtract_With_Ovflo_Check64 => System_Arith_64, + RE_Add_With_Ovflo_Check128 => System_Arith_128, RE_Double_Divide128 => System_Arith_128, RE_Multiply_With_Ovflo_Check128 => System_Arith_128, RE_Subtract_With_Ovflo_Check128 => System_Arith_128, RE_Scaled_Divide128 => System_Arith_128, + RE_Uns_Add_With_Ovflo_Check128 => System_Arith_128, + RE_Uns_Multiply_With_Ovflo_Check128 => System_Arith_128, + RE_Uns_Subtract_With_Ovflo_Check128 => System_Arith_128, + RE_Assert_Failure => System_Assertions, RE_Raise_Assert_Failure => System_Assertions, @@ -3425,6 +3442,7 @@ package Rtsfind is RE_Put_Image_Long_Long_Long_Unsigned => System_Put_Images, RE_Put_Image_Thin_Pointer => System_Put_Images, RE_Put_Image_Fat_Pointer => System_Put_Images, + RE_Put_Image_Extended_Access_Pointer => System_Put_Images, RE_Put_Image_Access_Subp => System_Put_Images, RE_Put_Image_Access_Prot_Subp => System_Put_Images, RE_Put_Image_String => System_Put_Images, diff --git a/gcc/ada/s-oscons-tmplt.c b/gcc/ada/s-oscons-tmplt.c index 7a5e987cefc4..8391f1f8dd1c 100644 --- a/gcc/ada/s-oscons-tmplt.c +++ b/gcc/ada/s-oscons-tmplt.c @@ -1764,6 +1764,17 @@ CND(SIZEOF_tv_usec, "tv_usec") #endif CNS(MAX_tv_sec, "") } + +{ + struct timespec ts; +/* + -- Sizes (in bytes) of the components of struct timespec. + -- The tv_sec field is the same as in struct timeval. +*/ +#define SIZEOF_tv_nsec (sizeof (ts.tv_nsec)) +CND(SIZEOF_tv_nsec, "tv_nsec"); +} + /* -- Sizes of various data types @@ -1791,6 +1802,9 @@ struct sockaddr_un { #define SIZEOF_sockaddr_un (sizeof (struct sockaddr_un)) CND(SIZEOF_sockaddr_un, "struct sockaddr_un") +#define BACKLOG_MAX 15 +CND(BACKLOG_MAX, "number of outstanding connections in the socket's listen queue") + #define SIZEOF_fd_set (sizeof (fd_set)) CND(SIZEOF_fd_set, "fd_set") CND(FD_SETSIZE, "Max fd value") @@ -1868,6 +1882,7 @@ CND(IF_NAMESIZE, "Max size of interface name with 0 terminator"); #endif #elif defined(_WIN32) +#undef POLLPRI #define POLLPRI 0 /* If the POLLPRI flag is set on a socket for the Microsoft Winsock provider, * the WSAPoll function will fail. */ diff --git a/gcc/ada/s-pack.adb.tmpl b/gcc/ada/s-pack.adb.tmpl index e54f3befd4f1..b21d4129257c 100644 --- a/gcc/ada/s-pack.adb.tmpl +++ b/gcc/ada/s-pack.adb.tmpl @@ -37,7 +37,7 @@ package body System.Pack_@@ is -- The high-level idea of the implementation is to overlay a record -- containing components of the same size as that of the component - -- of the array, in order words @@ bits, and to access the indexed + -- of the array, in other words @@ bits, and to access the indexed -- component of the array through the appropriate selected component -- of the record. diff --git a/gcc/ada/sem.adb b/gcc/ada/sem.adb index 944ece119785..71e759e74c41 100644 --- a/gcc/ada/sem.adb +++ b/gcc/ada/sem.adb @@ -1460,7 +1460,7 @@ package body Sem is -- Set up a clean environment before analyzing - Install_Ghost_Region (None, Empty); + Install_Ghost_Region (None, Empty, Empty); Ignore_SPARK_Mode_Pragmas_In_Instance := False; Outer_Generic_Scope := Empty; @@ -1562,7 +1562,7 @@ package body Sem is -- Compile predefined units with GNAT_Mode set to True, to properly -- process the categorization stuff. However, do not set GNAT_Mode - -- to True for the renamings units (Text_IO, IO_Exceptions, Direct_IO, + -- to True for the renaming units (Text_IO, IO_Exceptions, Direct_IO, -- Sequential_IO) as this would prevent pragma Extend_System from being -- taken into account, for example when Text_IO is renaming DEC.Text_IO. diff --git a/gcc/ada/sem.ads b/gcc/ada/sem.ads index 611309775279..63cf1daad37d 100644 --- a/gcc/ada/sem.ads +++ b/gcc/ada/sem.ads @@ -307,6 +307,18 @@ package Sem is -- case. We could perhaps do a more accurate job and retain some of the -- warnings, but it is quite a tricky job. + Ghost_Context_Checks_Disabled : Boolean := False; + -- This flag controls whether ghost context related checks are enabled or + -- disabled. Typically they are enabled however they need to be disabled in + -- instances where the ghost region context has not been set. + -- + -- Typically this is done for pragmas where the ghostliness of the pragma + -- is determined by an entity specified as one of the arguments. In these + -- cases we need to analyze that argument before the pragma itself to + -- determine the ghostliness of the pragma. However at that point we have + -- not set the ghost region for the pragma in order to determine the ghost + -- context of the argument. + ----------------------------------- -- Handling of Check Suppression -- ----------------------------------- diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 58460b8e3bb8..baca06800abe 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -1139,7 +1139,8 @@ package body Sem_Aggr is if Is_Modular_Integer_Type (Index_Typ) then Error_Msg_N ("null array aggregate indexed by a modular type<<", N); - else + + elsif Is_Enumeration_Type (Index_Typ) then Error_Msg_N ("null array aggregate indexed by an enumeration type<<", N); end if; @@ -3331,6 +3332,24 @@ package body Sem_Aggr is -- Not needed if others, since missing impossible. if No (Others_N) then + -- We are dealing with a gap in the indicies. However + -- we should also check for an out of bounds error. If + -- there exists an out of bounds error then we should + -- not be suggesting that the user should add the + -- missing indices but rather remove the ones that are + -- out of bounds. + + Aggr_Low := Table (1).Lo; + Aggr_High := Table (Nb_Discrete_Choices).Hi; + + Check_Bounds + (Index_Typ_Low, Index_Typ_High, Aggr_Low, Aggr_High); + Check_Bounds + (Index_Base_Low, + Index_Base_High, + Aggr_Low, + Aggr_High); + for J in 2 .. Nb_Discrete_Choices loop Lo_Val := Expr_Value (Table (J).Lo); Hi_Val := Table (J - 1).Highest; @@ -3358,11 +3377,13 @@ package body Sem_Aggr is if Hi_Val + 1 = Lo_Val - 1 then Error_Msg_N ("missing index value " - & "in array aggregate!", Error_Node); + & "in array aggregate!", + Error_Node); else Error_Msg_N ("missing index values " - & "in array aggregate!", Error_Node); + & "in array aggregate!", + Error_Node); end if; Output_Bad_Choices @@ -5443,8 +5464,13 @@ package body Sem_Aggr is Hi := New_Copy_Tree (Lo); - Report_Null_Array_Constraint_Error (N, Index_Typ); - Set_Raises_Constraint_Error (N); + -- On multidimiensional arrays, avoid reporting the same error + -- several times. + + if not Raises_Constraint_Error (N) then + Report_Null_Array_Constraint_Error (N, Index_Typ); + Set_Raises_Constraint_Error (N); + end if; else -- The upper bound is the predecessor of the lower bound @@ -5458,6 +5484,15 @@ package body Sem_Aggr is Append (Make_Range (Loc, New_Copy_Tree (Lo), Hi), Constr); Analyze_And_Resolve (Last (Constr), Etype (Index)); + if Known_Bounds + and then + (Nkind (High_Bound (Last (Constr))) = N_Raise_Constraint_Error + or else + Nkind (Low_Bound (Last (Constr))) = N_Raise_Constraint_Error) + then + Set_Raises_Constraint_Error (N); + end if; + Next_Index (Index); end loop; diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 78b6318133a4..e9e245afb609 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -5179,10 +5179,8 @@ package body Sem_Attr is when Attribute_Make => declare Expr : Entity_Id; begin - -- Should this be assert? Parsing should fail if it hits 'Make - -- and all extensions aren't enabled ??? - if not All_Extensions_Allowed then + Error_Msg_GNAT_Extension ("Make attribute", Loc); return; end if; @@ -7190,6 +7188,27 @@ package body Sem_Attr is Analyze_Access_Attribute; + ------------------------- + -- Unsigned_Base_Range -- + ------------------------- + + -- GNAT core extension. The prefix of 'Unsigned_Base_Range must be a + -- signed integer type. The static result is a boolean that indicates + -- whether the base range is unsigned. + + when Attribute_Unsigned_Base_Range => + Check_E0; + Check_Integer_Type; + Check_Not_Incomplete_Type; + Set_Etype (N, Standard_Boolean); + Set_Is_Static_Expression (N, True); + + if not Core_Extensions_Allowed then + Error_Msg_GNAT_Extension + ("'Unsigned_'Base_'Range", Sloc (N), + Is_Core_Extension => True); + end if; + ------------ -- Update -- ------------ @@ -8174,13 +8193,6 @@ package body Sem_Attr is if Nkind (N) /= N_Attribute_Reference then return; - - -- No evaluation required under strict preanalysis because locating - -- static expressions is not needed; this also minimizes making tree - -- modifications during strict preanalysis. - - elsif In_Strict_Preanalysis then - return; end if; Aname := Attribute_Name (N); @@ -10481,10 +10493,10 @@ package body Sem_Attr is Fold_Uint (N, Expr_Value (Expression (S)), Static); -- If no size is specified, then we simply use the object - -- size in the VADS_Size case (e.g. Natural'Size is equal - -- to Integer'Size, not one less). + -- size (when known) in the VADS_Size case (for example, + -- Natural'Size is equal to Integer'Size, not one less). - else + elsif Known_Esize (P_TypeA) then Fold_Uint (N, Esize (P_TypeA), Static); end if; end; @@ -10685,6 +10697,26 @@ package body Sem_Attr is Set_Is_Static_Expression (N, True); end Unconstrained_Array; + ------------------------- + -- Unsigned_Base_Range -- + ------------------------- + + when Attribute_Unsigned_Base_Range => Unsigned_Base_Range : declare + begin + Rewrite (N, New_Occurrence_Of ( + Boolean_Literals ( + Is_Integer_Type (P_Type) + and then + Has_Unsigned_Base_Range_Aspect (P_Base_Type)), Loc)); + + -- Analyze and resolve as boolean, note that this attribute is + -- a static attribute in GNAT. + + Analyze_And_Resolve (N, Standard_Boolean); + Static := True; + Set_Is_Static_Expression (N, True); + end Unsigned_Base_Range; + -- Attribute Update is never static when Attribute_Update => @@ -12819,7 +12851,10 @@ package body Sem_Attr is end Proper_Op; begin - Resolve (Init_Value_Exp, Typ); + -- First try to resolve the reducer and then, if this succeeds, + -- resolve the initial value. This nicely deals with confused + -- programmers who swap the two items. + if Is_Overloaded (Reducer_Subp_Name) then Outer : for Retry in Boolean loop @@ -12841,14 +12876,18 @@ package body Sem_Attr is then Op := Reducer_Subp_Name; - elsif Proper_Op (Entity (Reducer_Subp_Name)) then + elsif Is_Entity_Name (Reducer_Subp_Name) + and then Proper_Op (Entity (Reducer_Subp_Name)) + then Op := Entity (Reducer_Subp_Name); Set_Etype (N, Typ); end if; if No (Op) then - Error_Msg_N ("No suitable reducer subprogram found", + Error_Msg_N ("no suitable reducer subprogram found", Reducer_Subp_Name); + else + Resolve (Init_Value_Exp, Typ); end if; end; diff --git a/gcc/ada/sem_attr.ads b/gcc/ada/sem_attr.ads index 1c54370316ef..4c8b60ca7f1c 100644 --- a/gcc/ada/sem_attr.ads +++ b/gcc/ada/sem_attr.ads @@ -539,6 +539,15 @@ package Sem_Attr is -- yields a value that can be called as long as the subprogram is in -- scope (normal Ada 95 accessibility rules restrict this usage). + ------------------------- + -- Unsigned_Base_Range -- + ------------------------- + + Attribute_Unsigned_Base_Range => True, + -- GNAT core extension. The prefix of 'Unsigned_Base_Range must be a + -- signed integer type. The static result is a boolean that indicates + -- whether the base range is unsigned. + --------------- -- VADS_Size -- --------------- diff --git a/gcc/ada/sem_aux.adb b/gcc/ada/sem_aux.adb index 0aa74e39050a..58a4beb221db 100644 --- a/gcc/ada/sem_aux.adb +++ b/gcc/ada/sem_aux.adb @@ -959,6 +959,7 @@ package body Sem_Aux is begin if Is_Type (Ent) + and then Present (Etype (Ent)) and then Base_Type (Ent) /= Root_Type (Ent) and then not Is_Class_Wide_Type (Ent) diff --git a/gcc/ada/sem_case.adb b/gcc/ada/sem_case.adb index c81b56337f6a..050e456d49c3 100644 --- a/gcc/ada/sem_case.adb +++ b/gcc/ada/sem_case.adb @@ -3890,6 +3890,7 @@ package body Sem_Case is return True; when N_Empty + | N_Allocator | N_Statement_Other_Than_Procedure_Call | N_Procedure_Call_Statement | N_Declaration diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb index f58513d115fb..cff0d71c17ce 100644 --- a/gcc/ada/sem_ch10.adb +++ b/gcc/ada/sem_ch10.adb @@ -176,7 +176,7 @@ package body Sem_Ch10 is -- use-package clauses to avoid circularities when installing context. procedure Install_Siblings (U_Name : Entity_Id; N : Node_Id); - -- In the compilation of a child unit, a child of any of the ancestor + -- In the compilation of a child unit, a child of any of the ancestor -- units is directly visible if it is visible, because the parent is in -- an enclosing scope. Iterate over context to find child units of U_Name -- or of some ancestor of it. @@ -1494,7 +1494,7 @@ package body Sem_Ch10 is -- No checked needed for ignored ghost units - or else Is_Ignored_Ghost_Entity (Spec_Id) + or else Is_Ignored_Ghost_Entity_In_Codegen (Spec_Id) ) then -- This is a case where we only need the entity for checking to @@ -3169,13 +3169,12 @@ package body Sem_Ch10 is elsif Unit_Kind = N_Package_Instantiation and then Nkind (U) = N_Package_Instantiation - and then Present (Instance_Spec (U)) then -- If the instance has not been rewritten as a package declaration, -- then it appeared already in a previous with clause. Retrieve -- the entity from the previous instance. - E_Name := Defining_Entity (Specification (Instance_Spec (U))); + E_Name := Defining_Entity_Of_Instance (U); elsif Unit_Kind in N_Subprogram_Instantiation then @@ -3186,9 +3185,7 @@ package body Sem_Ch10 is -- been rewritten as the declaration of the wrapper itself. if Nkind (U) in N_Subprogram_Instantiation then - E_Name := - Related_Instance - (Defining_Entity (Specification (Instance_Spec (U)))); + E_Name := Defining_Entity_Of_Instance (U); else E_Name := Related_Instance (Defining_Entity (U)); end if; @@ -4806,9 +4803,8 @@ package body Sem_Ch10 is ---------------------- procedure Install_Siblings (U_Name : Entity_Id; N : Node_Id) is - Item : Node_Id; - Id : Entity_Id; - Prev : Entity_Id; + Item : Node_Id; + Item_E : Entity_Id; begin -- Iterate over explicit with clauses, and check whether the scope of @@ -4839,42 +4835,46 @@ package body Sem_Ch10 is or else Private_Present (N) or else Nkind (Unit (N)) = N_Package_Body then - Id := Entity (Name (Item)); + Item_E := Entity (Name (Item)); - if Is_Child_Unit (Id) - and then Is_Ancestor_Package (Scope (Id), U_Name) + if Is_Child_Unit (Item_E) + and then Is_Ancestor_Package (Scope (Item_E), U_Name) then - Set_Is_Immediately_Visible (Id); + Set_Is_Immediately_Visible (Item_E); -- Check for the presence of another unit in the context that -- may be inadvertently hidden by the child. - Prev := Current_Entity (Id); + declare + Clause : Node_Id; + Clause_E : Entity_Id; - if Present (Prev) - and then Is_Immediately_Visible (Prev) - and then not Is_Child_Unit (Prev) - then - declare - Clause : Node_Id; + begin + Clause := First (Context_Items (N)); + while Present (Clause) loop + if Clause /= Item + and then Nkind (Clause) = N_With_Clause + and then not Limited_Present (Clause) + then + Clause_E := Entity (Name (Clause)); - begin - Clause := First (Context_Items (N)); - while Present (Clause) loop - if Nkind (Clause) = N_With_Clause - and then Entity (Name (Clause)) = Prev + if not Is_Ancestor_Package (Clause_E, U_Name) + and then Chars (Clause_E) = Chars (Item_E) + and then not Has_Prefix (Name (Clause)) + and then not In_Use (Clause_E) then Error_Msg_NE - ("child unit& hides compilation unit " & - "with the same name??", - Name (Item), Id); + ("child unit& hides compilation unit " + & "with the same name??", + Name (Item), + Item_E); exit; end if; + end if; - Next (Clause); - end loop; - end; - end if; + Next (Clause); + end loop; + end; -- The With_Clause may be on a grandchild or one of its further -- descendants, which makes a child immediately visible. Examine @@ -4882,12 +4882,12 @@ package body Sem_Ch10 is -- if current unit is A.C, and with_clause is on A.X.Y.Z, then X -- is immediately visible. - elsif Is_Child_Unit (Id) then + elsif Is_Child_Unit (Item_E) then declare Par : Entity_Id; begin - Par := Scope (Id); + Par := Scope (Item_E); while Is_Child_Unit (Par) loop if Is_Ancestor_Package (Scope (Par), U_Name) then Set_Is_Immediately_Visible (Par); @@ -4905,9 +4905,9 @@ package body Sem_Ch10 is -- is already a regular with_clause for it in the current unit. elsif Private_Present (Item) then - Id := Entity (Name (Item)); + Item_E := Entity (Name (Item)); - if Is_Child_Unit (Id) then + if Is_Child_Unit (Item_E) then declare Clause : Node_Id; @@ -4931,12 +4931,13 @@ package body Sem_Ch10 is and then Is_Entity_Name (Name (Clause)) and then not Private_Present (Clause) then - if Entity (Name (Clause)) = Id + if Entity (Name (Clause)) = Item_E or else (Nkind (Name (Clause)) = N_Expanded_Name and then Is_Entity_Name (Prefix (Name (Clause))) - and then Entity (Prefix (Name (Clause))) = Id) + and then Entity (Prefix (Name (Clause))) + = Item_E) then return True; end if; @@ -4949,7 +4950,7 @@ package body Sem_Ch10 is end In_Context; begin - Set_Is_Visible_Lib_Unit (Id, In_Context); + Set_Is_Visible_Lib_Unit (Item_E, In_Context); end; end if; end if; diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 1ba76dc74cee..24d276ba48ae 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -33,6 +33,7 @@ with Einfo.Utils; use Einfo.Utils; with Elists; use Elists; with Errout; use Errout; with Expander; use Expander; +with Exp_Dbug; use Exp_Dbug; with Fname; use Fname; with Fname.UF; use Fname.UF; with Freeze; use Freeze; @@ -1290,6 +1291,11 @@ package body Sem_Ch12 is -- onto Default_Actuals, and actuals that require freezing are -- appended onto Actuals_To_Freeze. + procedure Analyze_Structural_Associations + (N : Node_Id; + Match : Associations.Match_Rec); + -- Analyze associations for structural instantiation N + procedure Check_Fixed_Point_Warning (Match : Associations.Match_Rec; Renamings : List_Id); @@ -2067,9 +2073,15 @@ package body Sem_Ch12 is is begin for Index in Match.Assocs'Range loop - if Defining_Entity (Match.Assocs (Index).An_Formal) = F then - return Index; - end if; + declare + An_F : constant Node_Id := Match.Assocs (Index).An_Formal; + begin + if Nkind (An_F) not in N_Use_Package_Clause | N_Use_Type_Clause + and then Defining_Entity (An_F) = F + then + return Index; + end if; + end; end loop; raise Program_Error; -- it must be present @@ -2365,6 +2377,16 @@ package body Sem_Ch12 is Match : constant Match_Rec := Match_Assocs (N, Formals, F_Copy); begin + if Nkind (N) in N_Generic_Instantiation and then Is_Structural (N) then + Analyze_Structural_Associations (N, Match); + + -- Bail out if the instantiation has been turned into something else + + if Nkind (N) not in N_Generic_Instantiation then + return Result_Renamings; + end if; + end if; + for Index in Match.Assocs'Range loop declare Assoc : Assoc_Rec renames Match.Assocs (Index); @@ -2946,7 +2968,7 @@ package body Sem_Ch12 is end case; -- Check for correct use of Ghost entities in generic - -- instantiations (SPARK RM 6.9(10)). + -- instantiations (SPARK RM 6.9(13)). Check_Ghost_Context_In_Generic_Association (Actual => Match, @@ -4099,7 +4121,7 @@ package body Sem_Ch12 is end if; -- The default for a ghost generic formal procedure should be a ghost - -- procedure (SPARK RM 6.9(13)). + -- procedure (SPARK RM 6.9(16)). if Ekind (Nam) = E_Procedure then declare @@ -4848,6 +4870,13 @@ package body Sem_Ch12 is function Needs_Body_Instantiated (Gen_Unit : Entity_Id) return Boolean is begin + -- If the instantiation is in the auxiliary declarations of the main + -- unit, then the body is needed, even if the main unit is generic. + + if Parent (N) = Aux_Decls_Node (Cunit (Main_Unit)) then + return True; + end if; + -- No need to instantiate bodies in generic units if Is_Generic_Unit (Cunit_Entity (Main_Unit)) then @@ -4961,14 +4990,6 @@ package body Sem_Ch12 is Preanalyze_Actuals (N, Act_Decl_Id); - -- Turn off style checking in instances. If the check is enabled on the - -- generic unit, a warning in an instance would just be noise. If not - -- enabled on the generic, then a warning in an instance is just wrong. - -- This must be done after analyzing the actuals, which do come from - -- source and are subject to style checking. - - Style_Check := False; - Init_Env; Env_Installed := True; @@ -4987,6 +5008,14 @@ package body Sem_Ch12 is Check_Generic_Child_Unit (Gen_Id, Parent_Installed); end if; + -- Turn off style checking in instances. If the check is enabled on the + -- generic unit, a warning in an instance would just be noise. If not + -- enabled on the generic, then a warning in an instance is just wrong. + -- This must be done after analyzing the actuals and possibly installing + -- the parent, which come from source and are subject to style checking. + + Style_Check := False; + Gen_Unit := Entity (Gen_Id); -- A package instantiation is Ghost when it is subject to pragma Ghost @@ -5134,6 +5163,17 @@ package body Sem_Ch12 is Formals => Generic_Formal_Declarations (Act_Tree), F_Copy => Generic_Formal_Declarations (Gen_Decl)); + -- Bail out if the instantiation has been turned into something else + + if Nkind (N) /= N_Package_Instantiation then + if Parent_Installed then + Remove_Parent; + end if; + + Restore_Env; + goto Leave; + end if; + Vis_Prims_List := Check_Hidden_Primitives (Renamings); -- Set minimal decoration on the original entity @@ -5141,6 +5181,18 @@ package body Sem_Ch12 is Mutate_Ekind (Defining_Entity (N), E_Package); Set_Scope (Defining_Entity (N), Current_Scope); + -- From now on only Act_Decl_Id matters. If was copied from the + -- original entity earlier but, if the instance is structural, + -- the latter has been changed, so adjust it accordingly. + + if Chars (Defining_Entity (N)) /= Chars (Act_Decl_Id) then + pragma Assert (Is_Structural (N)); + Set_Incomplete_Actuals + (Defining_Entity (N), Incomplete_Actuals (Act_Decl_Id)); + Act_Decl_Id := New_Copy (Defining_Entity (N)); + Set_Is_Not_Self_Hidden (Act_Decl_Id); + end if; + Set_Instance_Env (Gen_Unit, Act_Decl_Id); Set_Is_Generic_Instance (Act_Decl_Id); Generate_Definition (Act_Decl_Id); @@ -6011,6 +6063,454 @@ package body Sem_Ch12 is Analyze_Subprogram_Instantiation (N, E_Procedure); end Analyze_Procedure_Instantiation; + ------------------------------------- + -- Analyze_Structural_Associations -- + ------------------------------------- + + procedure Analyze_Structural_Associations + (N : Node_Id; + Match : Associations.Match_Rec) + is + use Associations; + + Loc : constant Source_Ptr := Sloc (N); + -- The source location of the instantiation + + type Accessibility_Depth is record + Global : Uint; + Local : Uint; + end record; + -- The accessibility depth of an entity is the depth of the outermost + -- scope from which the entity can be accessed at run time. It's zero + -- for library-level entities since they can be accessed from Standard. + + -- However it can be accessed at run time only after being elaborated; + -- for a library-level entity, this means that it can be accessed from + -- Standard only after its enclosing library unit is elaborated, which + -- means that it can be accessed from all the other library units (that + -- have a dependence on this enclosing library unit) as if it was itself + -- declared in Standard, but not from this enclosing library unit. + + -- Global contains the accessibility depth as computed from outside the + -- library or program unit where the entity is declared. + + -- Local contains the accessibility depth as computed from the current + -- scope, which may be different from Global if the scope is within the + -- library or program unit where the entity is declared. + + procedure Append_Entity_Name (B : in out Bounded_String; E : Entity_Id); + -- Append E's name to B + + procedure Append_Expression (B : in out Bounded_String; N : Node_Id); + -- Append an encoding of N, a compile-time known expression, to B + + function Get_Actual_Subtype (N : Node_Id) return Entity_Id; + -- Return the actual subtype of the formal object declared by N, which + -- is an N_Formal_Object_Declaration. It's the declared subtype of the + -- formal object if it is not a generic type, otherwise it's the actual + -- corresponding to this generic type in the instantiation. + + function Get_Entity_Depth (E : Entity_Id) return Accessibility_Depth; + -- Return the accessibility depth of E + + procedure Structural_Instantiation_Error (N : Node_Id); + -- Output an error for the specified structural instantiation + + function Max (L, R : Accessibility_Depth) return Accessibility_Depth is + (Global => UI_Max (L.Global, R.Global), + Local => UI_Max (L.Local, R.Local)); + -- Return a pair made up of the maximum value of each component + + function OK_For_Structural_Instantiation (E : Entity_Id) return Boolean; + -- Return True if the generic unit E is OK for structural instantiation + -- and False if it is not, giving an error in the latter case. + + procedure Rewrite_As_Renaming (N : Node_Id; E : Entity_Id); + -- Rewrite N as a renaming of E + + ------------------------ + -- Append_Entity_Name -- + ------------------------ + + procedure Append_Entity_Name (B : in out Bounded_String; E : Entity_Id) + is + begin + if Operating_Mode = Generate_Code then + Get_External_Name (E); + Append (B, Global_Name_Buffer); + else + Append (B, 'E'); + Append (B, Nat (E)); + end if; + end Append_Entity_Name; + + ----------------------- + -- Append_Expression -- + ----------------------- + + procedure Append_Expression (B : in out Bounded_String; N : Node_Id) is + Typ : constant Entity_Id := Etype (N); + + begin + if Is_Integer_Type (Typ) then + Append (B, 'I'); + Append (B, UI_Image (Expr_Value (N))); + + elsif Is_Real_Type (Typ) then + declare + Val : constant Ureal := Expr_Value_R (N); + begin + Append (B, 'R'); + Append (B, UI_Image (Norm_Num (Val))); + Append (B, '_'); + Append (B, UI_Image (Norm_Den (Val))); + end; + + elsif Is_Enumeration_Type (Typ) then + Append (B, 'E'); + Append_Entity_Name (B, Expr_Value_E (N)); + + elsif Is_String_Type (Typ) then + Append (B, 'S'); + Append (B, Strval (Expr_Value_S (N))); + + else + raise Program_Error; + end if; + end Append_Expression; + + ------------------------ + -- Get_Actual_Subtype -- + ------------------------ + + function Get_Actual_Subtype (N : Node_Id) return Entity_Id is + Subt : constant Entity_Id := Entity (Subtype_Mark (N)); + + begin + if not Is_Generic_Type (Subt) then + return Subt; + end if; + + for Index in Match.Assocs'Range loop + declare + Assoc : Assoc_Rec renames Match.Assocs (Index); + + begin + if Assoc.Actual.Kind = Name_Exp + and then Nkind (Assoc.An_Formal) = N_Formal_Type_Declaration + and then Defining_Identifier (Assoc.An_Formal) = Subt + then + return Entity (Assoc.Actual.Name_Exp); + end if; + end; + end loop; + + return Empty; + end Get_Actual_Subtype; + + ---------------------- + -- Get_Entity_Depth -- + ---------------------- + + function Get_Entity_Depth (E : Entity_Id) return Accessibility_Depth is + Global : constant Uint := Scope_Depth (Enclosing_Dynamic_Scope (E)); + CS : constant Entity_Id := Current_Scope; + + S : Entity_Id := Scope (E); + + begin + -- Generic formal types are treated as local entities + + if Is_Generic_Type (E) then + return (Global => Scope_Depth (S), Local => Scope_Depth (S)); + end if; + + -- Compute the accessibility depth from the current scope + + while Scope_Depth (S) > Global + and then (not Scope_Within_Or_Same (CS, S) + or else + (Ekind (S) = E_Package + and then Is_Generic_Instance (S) + and then Alias (Related_Instance (S)) = CS)) + loop + S := Scope (S); + end loop; + + return (Global => Global, Local => Scope_Depth (S)); + end Get_Entity_Depth; + + ------------------------------------ + -- Structural_Instantiation_Error -- + ------------------------------------ + + procedure Structural_Instantiation_Error (N : Node_Id) is + begin + Error_Msg_N ("generic unit cannot be instantiated structurally", N); + end Structural_Instantiation_Error; + + ------------------------------------- + -- OK_For_Structural_Instantiation -- + ------------------------------------- + + function OK_For_Structural_Instantiation (E : Entity_Id) return Boolean + is + Formals : constant List_Id := + Generic_Formal_Declarations (Unit_Declaration_Node (E)); + Unit_Entity : constant Entity_Id := + Cunit_Entity (Get_Source_Unit (E)); + + Formal : Node_Id; + + begin + -- Check that the generic unit is preelaborated + + if Ekind (Unit_Entity) in E_Package | E_Generic_Package + and then not Is_Preelaborated (Unit_Entity) + and then not Is_Pure (Unit_Entity) + then + Structural_Instantiation_Error (N); + Error_Msg_NE + ("\generic unit& is not preelaborated", N, Unit_Entity); + return False; + end if; + + -- Check that there is no generic formal object of mode In Out + + Formal := First (Formals); + while Present (Formal) loop + if Nkind (Formal) = N_Formal_Object_Declaration + and then Out_Present (Formal) + then + Structural_Instantiation_Error (N); + Error_Msg_NE + ("\in out formal parameter& not allowed", N, + Defining_Identifier (Formal)); + return False; + end if; + + Next (Formal); + end loop; + + return True; + end OK_For_Structural_Instantiation; + + ------------------------- + -- Rewrite_As_Renaming -- + ------------------------- + + procedure Rewrite_As_Renaming (N : Node_Id; E : Entity_Id) is + begin + case Nkind (N) is + when N_Function_Instantiation => + Rewrite (N, + Make_Subprogram_Renaming_Declaration (Loc, + Specification => + Make_Function_Specification (Loc, + Defining_Unit_Name => Defining_Unit_Name (N), + Parameter_Specifications => + New_Copy_List + (Parameter_Specifications + (Subprogram_Specification (E))), + Result_Definition => + New_Occurrence_Of (Etype (E), Loc)), + Name => New_Occurrence_Of (E, Loc))); + + when N_Procedure_Instantiation => + Rewrite (N, + Make_Subprogram_Renaming_Declaration (Loc, + Specification => + Make_Procedure_Specification (Loc, + Defining_Unit_Name => Defining_Unit_Name (N), + Parameter_Specifications => + New_Copy_List + (Parameter_Specifications + (Subprogram_Specification (E)))), + Name => New_Occurrence_Of (E, Loc))); + + when N_Package_Instantiation => + Rewrite (N, + Make_Package_Renaming_Declaration (Loc, + Defining_Unit_Name => Defining_Unit_Name (N), + Name => New_Occurrence_Of (E, Loc))); + + when others => + raise Program_Error; + end case; + end Rewrite_As_Renaming; + + -- Local variables + + Buf : Bounded_String; + Depth : Accessibility_Depth; + Ent : Entity_Id; + Nam : Name_Id; + R : Node_Id; + Scop : Entity_Id; + + -- Start of processing for Analyze_Structural_Associations + + begin + if not OK_For_Structural_Instantiation (Match.Gen_Unit) then + return; + end if; + + -- Compute the name and the scope depth of the structural instance + + Append_Entity_Name (Buf, Match.Gen_Unit); + Append (Buf, "SI"); + Depth := Get_Entity_Depth (Match.Gen_Unit); + + for Index in Match.Assocs'Range loop + declare + Assoc : Assoc_Rec renames Match.Assocs (Index); + + begin + Append (Buf, '_'); + + case Assoc.Actual.Kind is + when Name_Exp + | Exp_Func_Default + => + if Nkind (Assoc.An_Formal) = N_Formal_Object_Declaration then + -- Resolve the expression to compute whether it is static + + Resolve + (Assoc.Actual.Name_Exp, + Get_Actual_Subtype (Assoc.An_Formal)); + + if Is_OK_Static_Expression (Assoc.Actual.Name_Exp) then + -- We need the value of the expression to encode it + + pragma Assert + (Compile_Time_Known_Value (Assoc.Actual.Name_Exp)); + + Append_Expression (Buf, Assoc.Actual.Name_Exp); + + else + Structural_Instantiation_Error (N); + Error_Msg_N + ("\expression is not static", Assoc.Actual.Name_Exp); + end if; + + elsif Nkind (Assoc.Actual.Name_Exp) = N_Operator_Symbol then + Append (Buf, Chars (Assoc.Actual.Name_Exp)); + + else pragma Assert (Is_Entity_Name (Assoc.Actual.Name_Exp)); + Ent := Entity (Assoc.Actual.Name_Exp); + + -- If this is a type that is a renaming of another one, + -- as is the case for actuals in instances, retain the + -- latter. Beware of Natural and Positive, see Cstand. + + if Is_Type (Ent) + and then Nkind (Parent (Ent)) = N_Subtype_Declaration + and then + Is_Entity_Name (Subtype_Indication (Parent (Ent))) + and then not Comes_From_Source (Parent (Ent)) + and then Scope (Ent) /= Standard_Standard + then + Ent := Entity (Subtype_Indication (Parent (Ent))); + end if; + + -- ??? Need to implement handling of explicit renaming + + Append_Entity_Name (Buf, Ent); + Depth := Max (Depth, Get_Entity_Depth (Ent)); + end if; + + when Box_Subp_Default => + Append (Buf, 'F'); + + when Null_Default => + Append (Buf, 'N'); + + when others => + Structural_Instantiation_Error (N); + end case; + end; + end loop; + + Nam := Name_Find (Buf); + Ent := Get_Name_Entity_Id (Nam); + + -- If the structural instance has already been created, then rewrite + -- this occurrence as a renaming of it. + + if Present (Ent) then + Rewrite_As_Renaming (N, Ent); + Analyze (N); + + -- Otherwise, create it in the outermost possible scope + + else + -- Depth.Global is the accessibility depth of the structural instance + -- which is defined to be the depth of the outermost scope where the + -- instantiation is possible. If the depth cannot be reached from the + -- current scope, then the structural instance cannot be accessed out + -- of it and we would need to create a local instance instead. + + if Depth.Local > Depth.Global then + Structural_Instantiation_Error (N); + Error_Msg_N ("\local entity used in the instantiation", N); + return; + end if; + + Scop := Current_Scope; + + -- If the current scope is too nested, analyze the instantiation + -- relocated in the outermost possible scope, which will invoke + -- us recursively with a matching scope depth this time. + + if Scope_Depth (Scop) > Depth.Global then + while Scope_Depth (Scop) > Depth.Global loop + Scop := Scope (Scop); + end loop; + + R := Relocate_Node (N); + + -- If the scope is Standard, the instantiation is done outside the + -- current compilation unit and, therefore, needs a clean context. + + if Scop = Standard_Standard then + declare + S_Expander_Active : constant Boolean := Expander_Active; + S_Full_Analysis : constant Boolean := Full_Analysis; + S_In_Spec_Expr : constant Boolean := In_Spec_Expression; + S_Inside_A_Generic : constant Boolean := Inside_A_Generic; + + begin + Expander_Active := (Operating_Mode = Opt.Generate_Code); + Full_Analysis := True; + In_Spec_Expression := False; + Inside_A_Generic := False; + + Add_Local_Declaration (R, N, Scop => Scop); + + Expander_Active := S_Expander_Active; + Full_Analysis := S_Full_Analysis; + In_Spec_Expression := S_In_Spec_Expr; + Inside_A_Generic := S_Inside_A_Generic; + end; + + else + Add_Local_Declaration (R, N, Scop => Scop); + end if; + + Ent := Defining_Entity_Of_Instance (R); + Rewrite_As_Renaming (N, Ent); + Analyze (N); + + -- Otherwise we are in the right scope and only need to set the + -- name of the instance. + + else + Ent := Make_Defining_Identifier (Loc, Chars => Nam); + Set_Defining_Unit_Name (N, Ent); + end if; + end if; + end Analyze_Structural_Associations; + ----------------------------------- -- Need_Subprogram_Instance_Body -- ----------------------------------- @@ -6056,9 +6556,12 @@ package body Sem_Ch12 is if (Is_In_Main_Unit (N) or else Is_Inlined_Or_Child_Of_Inlined (Subp)) - -- No need to instantiate bodies in generic units + -- No need to instantiate bodies in generic units, except when the + -- instantiation is in the auxiliary declarations of the main unit; + -- in this case the body is needed, even if the main unit is generic. - and then not Is_Generic_Unit (Cunit_Entity (Main_Unit)) + and then (not Is_Generic_Unit (Cunit_Entity (Main_Unit)) + or else Parent (N) = Aux_Decls_Node (Cunit (Main_Unit))) -- Must be generating code or analyzing code in GNATprove mode @@ -6482,6 +6985,17 @@ package body Sem_Ch12 is Formals => Generic_Formal_Declarations (Act_Tree), F_Copy => Generic_Formal_Declarations (Gen_Decl)); + -- Bail out if the instantiation has been turned into something else + + if Nkind (N) not in N_Subprogram_Instantiation then + if Parent_Installed then + Remove_Parent; + end if; + + Restore_Env; + goto Leave; + end if; + Vis_Prims_List := Check_Hidden_Primitives (Renamings); -- The subprogram itself cannot contain a nested instance, so the @@ -6828,6 +7342,69 @@ package body Sem_Ch12 is end if; end Get_Associated_Node; + ------------------------------------ + -- Build_Structural_Instantiation -- + ------------------------------------ + + function Build_Structural_Instantiation + (N : Node_Id; + Gen_Unit : Entity_Id; + Actuals : List_Id) return Entity_Id + is + Loc : constant Source_Ptr := Sloc (N); + Inst_Id : constant Entity_Id := Make_Temporary (Loc, 'P'); + + Inst : Node_Id; + + begin + case Ekind (Gen_Unit) is + when E_Generic_Function => + Inst := + Make_Function_Instantiation (Loc, + Defining_Unit_Name => Inst_Id, + Name => New_Occurrence_Of (Gen_Unit, Loc), + Generic_Associations => Actuals); + + when E_Generic_Package => + Inst := + Make_Package_Instantiation (Loc, + Defining_Unit_Name => Inst_Id, + Name => New_Occurrence_Of (Gen_Unit, Loc), + Generic_Associations => Actuals); + + when E_Generic_Procedure => + Inst := + Make_Procedure_Instantiation (Loc, + Defining_Unit_Name => Inst_Id, + Name => New_Occurrence_Of (Gen_Unit, Loc), + Generic_Associations => Actuals); + + when others => + raise Program_Error; + end case; + + Set_Is_Internal (Inst_Id); + Set_Is_Structural (Inst); + + -- The instantiation must be added to a declarative part for technical + -- reasons pertaining to freezing (see the Freeze_Package_Instance and + -- Freeze_Subprogram_Instance procedures). + + Add_Local_Declaration (Inst, N, Scop => Empty); + if Error_Posted (Inst) then + return Empty; + end if; + + -- If the structural instance had already been created, this occurrence + -- has been turned into a renaming of it. + + if Nkind (Inst) in N_Renaming_Declaration then + return Defining_Entity (Inst); + else + return Defining_Entity_Of_Instance (Inst); + end if; + end Build_Structural_Instantiation; + ----------------------------------- -- Build_Subprogram_Decl_Wrapper -- ----------------------------------- @@ -11704,7 +12281,7 @@ package body Sem_Ch12 is Formal_Pack := Defining_Unit_Name (Specification (Analyzed_Formal)); -- The actual for a ghost generic formal package should be a ghost - -- package (SPARK RM 6.9(14)). + -- package (SPARK RM 6.9(16)). Check_Ghost_Formal_Procedure_Or_Package (N => Actual, @@ -12023,7 +12600,7 @@ package body Sem_Ch12 is end if; -- The actual for a ghost generic formal procedure should be a ghost - -- procedure (SPARK RM 6.9(14)). + -- procedure (SPARK RM 6.9(16)). if Present (Act_E) and then Ekind (Act_E) = E_Procedure @@ -12530,7 +13107,7 @@ package body Sem_Ch12 is end if; -- The actual for a ghost generic formal IN OUT parameter should be a - -- ghost object (SPARK RM 6.9(14)). + -- ghost object (SPARK RM 6.9(16)). Check_Ghost_Formal_Variable (Actual => Actual, @@ -15912,6 +16489,64 @@ package body Sem_Ch12 is end loop; end Map_Formal_Package_Entities; + -------------------- + -- Mark_Link_Once -- + -------------------- + + procedure Mark_Link_Once (Decls : List_Id) is + procedure Mark_Link_Once (Ent : Entity_Id); + + -------------------- + -- Mark_Link_Once -- + -------------------- + + procedure Mark_Link_Once (Ent : Entity_Id) is + begin + if Is_Public (Ent) then + Set_Is_Link_Once (Ent); + end if; + + if Ekind (Ent) in E_Package | E_Package_Body + and then No (Renamed_Entity (Ent)) + then + declare + Pack_Ent : Entity_Id; + + begin + Pack_Ent := First_Entity (Ent); + while Present (Pack_Ent) loop + Mark_Link_Once (Pack_Ent); + + Next_Entity (Pack_Ent); + end loop; + end; + end if; + end Mark_Link_Once; + + Decl : Node_Id; + Spec : Node_Id; + + begin + Decl := First (Decls); + while Present (Decl) loop + if Nkind (Decl) in N_Generic_Instantiation + and then Is_Structural (Decl) + then + Spec := Instance_Spec (Decl); + + Mark_Link_Once (Defining_Entity (Specification (Spec))); + + if Nkind (Decl) = N_Package_Instantiation + and then Present (Corresponding_Body (Spec)) + then + Mark_Link_Once (Corresponding_Body (Spec)); + end if; + end if; + + Next (Decl); + end loop; + end Mark_Link_Once; + ----------------------- -- Move_Freeze_Nodes -- ----------------------- @@ -17004,6 +17639,8 @@ package body Sem_Ch12 is Set_Etype (N2, E); end if; + -- If the entity is global, save its type in the generic node + if Is_Global (E) then Set_Global_Type (N, N2); @@ -17024,12 +17661,24 @@ package body Sem_Ch12 is Set_Etype (N, Empty); end if; + -- If default actuals have been added to a generic instantiation + -- and they are global, save them in the generic node. + if Nkind (Parent (N)) in N_Generic_Instantiation and then N = Name (Parent (N)) then Save_Global_Defaults (Parent (N), Parent (N2)); end if; + if Nkind (Parent (N)) = N_Selected_Component + and then N = Selector_Name (Parent (N)) + and then Nkind (Parent (Parent (N))) in N_Generic_Instantiation + and then Parent (N) = Name (Parent (Parent (N))) + then + Save_Global_Defaults + (Parent (Parent (N)), Parent (Parent (N2))); + end if; + elsif Nkind (Parent (N)) = N_Selected_Component and then Nkind (Parent (N2)) = N_Expanded_Name then @@ -17853,12 +18502,13 @@ package body Sem_Ch12 is elsif Nkind (N) = N_Pragma then Save_References_In_Pragma (N); + -- Aspects + elsif Nkind (N) = N_Aspect_Specification then declare P : constant Node_Id := Parent (N); - Expr : Node_Id; - begin + begin if Permits_Aspect_Specifications (P) then -- The capture of global references within aspects @@ -17870,15 +18520,11 @@ package body Sem_Ch12 is if Requires_Delayed_Save (Original_Node (P)) then null; - -- Otherwise save all global references within the - -- aspects + -- Otherwise save all global references within the + -- expression of the aspect. - else - Expr := Expression (N); - - if Present (Expr) then - Save_Global_References (Expr); - end if; + elsif Present (Expression (N)) then + Save_Global_References (Expression (N)); end if; end if; end; @@ -17888,10 +18534,11 @@ package body Sem_Ch12 is elsif Nkind (N) = N_Implicit_Label_Declaration then null; + -- Other nodes + else Save_References_In_Descendants (N); end if; - end Save_References; --------------------- diff --git a/gcc/ada/sem_ch12.ads b/gcc/ada/sem_ch12.ads index 3e703a5906ca..83c3114667b8 100644 --- a/gcc/ada/sem_ch12.ads +++ b/gcc/ada/sem_ch12.ads @@ -44,6 +44,14 @@ package Sem_Ch12 is -- Must be invoked just at the end of the end of the processing of a -- generic spec or body. + function Build_Structural_Instantiation + (N : Node_Id; + Gen_Unit : Entity_Id; + Actuals : List_Id) return Entity_Id; + -- Build a structural instantiation of Gen_Unit on Actuals at N and return + -- its defining entity, after either having inserted it at the appropriate + -- place in the tree or turned it into a renaming of a previous instance. + procedure Check_Generic_Child_Unit (Gen_Id : Node_Id; Parent_Installed : in out Boolean); @@ -114,6 +122,9 @@ package Sem_Ch12 is -- Return true if E is a package created for an abbreviated instantiation -- to check conformance between formal package and corresponding actual. + procedure Mark_Link_Once (Decls : List_Id); + -- Mark all the structural instances present in Decls as Link Once + function Need_Subprogram_Instance_Body (N : Node_Id; Subp : Entity_Id) return Boolean; diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 31735e41a9c8..22fea0d02907 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -37,6 +37,7 @@ with Errid; use Errid; with Errout; use Errout; with Exp_Ch3; use Exp_Ch3; with Exp_Disp; use Exp_Disp; +with Exp_Strm; use Exp_Strm; with Exp_Tss; use Exp_Tss; with Exp_Util; use Exp_Util; with Expander; use Expander; @@ -1002,6 +1003,17 @@ package body Sem_Ch13 is -- aspect has the proper profile. If the name is overloaded, check that -- some interpretation is legal. + procedure Check_Nonoverridable_Aspect_Subprograms + (ASN : Node_Id; + E : Entity_Id; + Original : Entity_Id := Empty); + -- RM 13.1.1(18.4/6) requires checking that if any of the subprograms + -- denoted by a nonoverridable aspect ASN has a parameter or result of + -- either type E or access E, then all denoted subprograms are + -- primitive. If missing, Original is initialized with ASN and will not + -- change during the recursive exploration of aggregate aspects, it is + -- used to improve the error message. + procedure Make_Pragma_From_Boolean_Aspect (ASN : Node_Id); -- Given an aspect specification node ASN whose expression is an -- optional Boolean, this routines creates the corresponding pragma @@ -1205,6 +1217,200 @@ package body Sem_Ch13 is end if; end Check_Indexing_Functions; + --------------------------------------------- + -- Check_Nonoverridable_Aspect_Subprograms -- + --------------------------------------------- + + procedure Check_Nonoverridable_Aspect_Subprograms + (ASN : Node_Id; + E : Entity_Id; + Original : Node_Id := Empty) + is + Expr : constant Node_Id := Expression (ASN); + Kind : constant Node_Kind := Nkind (Expr); + + function Required_To_Be_Primitive (Subp : Entity_Id) return Boolean; + -- This function returns True if Subp, belonging to a nonoverridable + -- aspect of the entity E, is required to be a primitive operation. + -- Specifically, whenever either its return type or any of its + -- formals are of either type E or access E. + + function Required_To_Be_Primitive (Subp : Entity_Id) return Boolean is + Return_Typ : constant Entity_Id := Etype (Subp); + Last_Formal : constant Entity_Id := Last_Entity (Subp); + Cursor : Entity_Id := First_Entity (Subp); + begin + if Return_Typ = E + or else (Ekind (Return_Typ) in Access_Kind + and then Directly_Designated_Type (Return_Typ) = E) + then + return True; + + elsif Present (Cursor) then + loop + if Etype (Cursor) = E + or else (Ekind (Cursor) in Access_Kind + and then Directly_Designated_Type (Cursor) = E) + then + return True; + end if; + + exit when Cursor = Last_Formal; + + Cursor := Next_Entity (Cursor); + end loop; + end if; + + return False; + end Required_To_Be_Primitive; + + -- Local Variables + + Valid : Boolean := True; + Problem : Entity_Id := Empty; + + -- Start of processing for Check_Nonoverridable_Aspect_Subprograms + + begin + -- If the aspect specification was effectively inherited from the + -- parent type (so constructed anew by analysis), then no point + -- in validating. + + if not Comes_From_Source (ASN) then + return; + end if; + + -- If the expression is neither an aggregate nor a node denoting an + -- entity, then also no point in validating. + + if Kind not in N_Aggregate | N_Has_Entity then + return; + end if; + + -- Original should point to ASN if this is the first recursive call + + if No (Original) then + Check_Nonoverridable_Aspect_Subprograms + (ASN => ASN, + E => E, + Original => ASN); + return; + end if; + + if Kind = N_Aggregate then + declare + Aggregate_List : constant List_Id := + Component_Associations (Expr); + Current : Node_Id := First (Aggregate_List); + begin + -- Each component association must be checked separately + + while Present (Current) loop + + Check_Nonoverridable_Aspect_Subprograms + (ASN => Current, + E => E, + Original => Original); + + Next (Current); + end loop; + end; + + else + -- Some expressions may be unanalyzed, as some nonoverridable + -- aspects allow forward references. For instance, when the type E + -- is defined inside a package body. + + if No (Entity (Expr)) then + Analyze (Expr); + end if; + + declare + Subp : constant Entity_Id := Entity (Expr); + begin + + -- No point in validating a node that does not represent a + -- subprogram here. + + if not Is_Subprogram (Subp) then + return; + end if; + + if not Is_Overloaded (Expr) then + Valid := (if Required_To_Be_Primitive (Subp) + then Is_Primitive (Subp)); + + Problem := Subp; + + else + declare + Found : Boolean := False; + I : Interp_Index; + It : Interp; + begin + -- Check whether there is at least one interpretation + -- that is required to be primitive. We iterate over all + -- possible interpretations, as some may be removed. + + Get_First_Interp (Expr, I, It); + while Present (It.Nam) loop + + -- If the current interpretation is not declared + -- within the scope of E, then it should not be + -- considered, see RM 13.1.1(8/6). + + if not Within_Scope (It.Nam, Scope (E)) then + Remove_Interp (I); + + else + Found := Found + or else Required_To_Be_Primitive (It.Nam); + end if; + + Get_Next_Interp (I, It); + end loop; + + if Found then + + -- To satisfy the legality rule in RM 13.1.1(18.2/5), + -- if there's at least one interpretation that's + -- primitive, then all of them must be primitive; + -- otherwise we emit an error. + + Get_First_Interp (Expr, I, It); + pragma Warnings (Off, Valid); -- Valid not always True + while Valid and then Present (It.Nam) loop + + Valid := Valid and then Is_Primitive (It.Nam); + Problem := It.Nam; + + Get_Next_Interp (I, It); + end loop; + end if; + end; + end if; + end; + end if; + + if not Valid then + declare + Operation_Kind : constant String := + (if Comes_From_Source (Problem) + then "declared" + else "inherited"); + begin + Error_Msg_Name_1 := Chars (Identifier (Original)); + Error_Msg_Name_2 := Chars (E); + Error_Msg_Name_3 := Chars (Problem); + Error_Msg_Sloc := Sloc (Problem); + Error_Msg_N ("nonoverridable aspect % of type % requires % " + & Operation_Kind + & "# to be a primitive operation", + Original); + end; + end if; + end Check_Nonoverridable_Aspect_Subprograms; + ------------------------------------- -- Make_Pragma_From_Boolean_Aspect -- ------------------------------------- @@ -1548,6 +1754,14 @@ package body Sem_Ch13 is if Present (Ritem) then Analyze (Ritem); end if; + + -- All nonoverriding aspects need further legality checks + + if A_Id in Nonoverridable_Aspect_Id + and then Ada_Version >= Ada_2022 + then + Check_Nonoverridable_Aspect_Subprograms (ASN, E); + end if; end if; end if; @@ -1960,6 +2174,14 @@ package body Sem_Ch13 is -- expression is allowed. Includes checking that the expression -- does not raise Constraint_Error. + procedure Convert_Aspect_With_Assertion_Levels (Aspect : Node_Id); + -- If an Aspect is using an association with an Assertion_Level + -- analyze the aspect with the level and convert it into an aspect + -- without the Assertion_Level. In the case the aspect has + -- associations with Assertion_Levels then multiple aspects are + -- created and each one will point to the original aspect that + -- they were created from in the Original_Aspect field. + function Directly_Specified (Id : Entity_Id; A : Aspect_Id) return Boolean; -- Returns True if the given aspect is directly (as opposed to @@ -3114,6 +3336,73 @@ package body Sem_Ch13 is end case; end Check_Expr_Is_OK_Static_Expression; + ------------------------------------------ + -- Convert_Aspect_With_Assertion_Levels -- + ------------------------------------------ + + procedure Convert_Aspect_With_Assertion_Levels (Aspect : Node_Id) + is + Assoc : Node_Id; + Assocs : List_Id; + Choice : Node_Id; + Level : Entity_Id; + Sub_Expr : Node_Id; + New_Aspect : Node_Id; + begin + Assocs := Component_Associations (Expression (Aspect)); + Assoc := First (Assocs); + + if Present (Expressions (Expression (Aspect))) then + Error_Msg_N + ("wrong syntax for argument of %", Expression (Aspect)); + Error_Msg_N + ("\aspect with Assertion_Level can only contain " + & "contain Assertion_Level associations", + Expression (Aspect)); + end if; + + while Present (Assoc) loop + if List_Length (Choices (Assoc)) > 1 then + Error_Msg_Name_1 := Nam; + Error_Msg_N ("wrong syntax for argument of %", Assoc); + Error_Msg_N + ("\only one Assertion_Level can be associated " + & "with an expression", + Assoc); + end if; + + Choice := First (Choices (Assoc)); + + if Nkind (Choice) /= N_Identifier then + Error_Msg_N ("wrong syntax for argument of %", Assoc); + Error_Msg_N + ("\association must denote an Assertion_Level", Assoc); + end if; + + Level := Get_Assertion_Level (Chars (Choice)); + + Sub_Expr := Expression (Assoc); + New_Aspect := + Make_Aspect_Specification + (Sloc => Sloc (Assoc), + Identifier => New_Copy_Tree (Id), + Expression => Sub_Expr); + + Check_Applicable_Policy (New_Aspect, Level); + + Set_Aspect_Ghost_Assertion_Level (New_Aspect, Level); + + Insert_After (Aspect, New_Aspect); + + -- Store the Original_Aspect for the detection of + -- duplicates. + + Set_Original_Aspect (New_Aspect, Aspect); + + Next (Assoc); + end loop; + end Convert_Aspect_With_Assertion_Levels; + ------------------------ -- Directly_Specified -- ------------------------ @@ -3160,11 +3449,10 @@ package body Sem_Ch13 is -- Set additional semantic fields - if Is_Ignored (Aspect) then - Set_Is_Ignored (Aitem); - elsif Is_Checked (Aspect) then - Set_Is_Checked (Aitem); - end if; + Set_Is_Checked (Aitem, Is_Checked (Aspect)); + Set_Is_Ignored (Aitem, Is_Ignored (Aspect)); + Set_Pragma_Ghost_Assertion_Level + (Aitem, Aspect_Ghost_Assertion_Level (Aspect)); Set_Corresponding_Aspect (Aitem, Aspect); Set_From_Aspect_Specification (Aitem); @@ -3185,7 +3473,24 @@ package body Sem_Ch13 is -- as such for later reference in the tree. This also sets the -- Is_Ignored and Is_Checked flags appropriately. - Check_Applicable_Policy (Aspect); + if Is_Valid_Assertion_Kind (Nam) then + if Is_Checked (Aspect) or else Is_Ignored (Aspect) then + null; + + -- If the Aspect has at least one Assertion_Level argument + -- then split the original Aspect into multiple aspects each + -- with an associated Assertion_Level. + + elsif Has_Assertion_Level_Argument (Aspect) then + Convert_Aspect_With_Assertion_Levels (Aspect); + goto Continue; + else + Check_Applicable_Policy (Aspect); + Set_Aspect_Ghost_Assertion_Level + (Aspect, Standard_Level_Default); + end if; + + end if; if Is_Disabled (Aspect) then goto Continue; @@ -3249,8 +3554,11 @@ package body Sem_Ch13 is if No_Duplicates_Allowed (A_Id) then Anod := First (L); while Anod /= Aspect loop - if Comes_From_Source (Aspect) - and then Same_Aspect (A_Id, Get_Aspect_Id (Anod)) + + if (Comes_From_Source (Aspect) + or else (Original_Aspect (Aspect) /= Anod + and then not From_Same_Aspect (Aspect, Anod))) + and then Same_Aspect (A_Id, Get_Aspect_Id (Anod)) then Error_Msg_Name_1 := Nam; Error_Msg_Sloc := Sloc (Anod); @@ -3260,12 +3568,12 @@ package body Sem_Ch13 is if Class_Present (Anod) = Class_Present (Aspect) then if not Class_Present (Anod) then Error_Msg_NE - ("aspect% for & previously given#", - Id, E); + ("aspect% for & previously given#", Id, E); else Error_Msg_NE ("aspect `%''Class` for & previously given#", - Id, E); + Id, + E); end if; end if; end if; @@ -4157,11 +4465,16 @@ package body Sem_Ch13 is -- Error checking if not All_Extensions_Allowed then + Error_Msg_Name_1 := Nam; + Error_Msg_GNAT_Extension ("aspect %", Loc); goto Continue; end if; - if Ekind (E) /= E_Procedure then - Error_Msg_N ("Initialize must apply to a constructor", N); + if Ekind (E) /= E_Subprogram_Body + or else Nkind (Parent (E)) /= N_Procedure_Specification + then + Error_Msg_N + ("Initialize must apply to a constructor body", N); end if; if Present (Expressions (Expression (Aspect))) then @@ -4200,11 +4513,6 @@ package body Sem_Ch13 is Next_Entity (Type_Comp); end loop; - -- Push the scope and formals for analysis - - Push_Scope (E); - Install_Formals (Defining_Unit_Name (Specification (N))); - -- Analyze the components Aspect_Comp := @@ -4223,10 +4531,6 @@ package body Sem_Ch13 is Dummy_Aggr := New_Copy_Tree (Expression (Aspect)); Resolve_Aggregate (Dummy_Aggr, Typ); Expander_Active := True; - - -- Return the scope - - End_Scope; end Initialize; -- Initializes @@ -4724,6 +5028,12 @@ package body Sem_Ch13 is goto Continue; when Aspect_Constructor => + if not All_Extensions_Allowed then + Error_Msg_Name_1 := Nam; + Error_Msg_GNAT_Extension ("aspect %", Loc); + goto Continue; + end if; + Set_Constructor_Name (E, Expr); Set_Needs_Construction (E); @@ -4796,7 +5106,7 @@ package body Sem_Ch13 is if Class_Present (Aspect) and then A_Id in Aspect_Pre | Aspect_Post and then Is_Subprogram (E) - and then not Is_Ignored_Ghost_Entity (E) + and then not Is_Ignored_Ghost_Entity_In_Codegen (E) then if A_Id = Aspect_Pre then if Is_Ignored_In_Codegen (Aspect) then @@ -4988,6 +5298,80 @@ package body Sem_Ch13 is -- generated yet because the evaluation of the boolean needs -- to be delayed till the freeze point. + -- Super + + when Aspect_Super => Super : + declare + Analyze_Parameter_Expressions : constant Boolean := True; + -- ??? + -- We can analyze actual parameter expressions here (with + -- no context, like the operand of a type conversion), + -- or leave them unanalyzed for now and catch problems + -- when we analyze the generated constructor call + -- (where overload resolution may provide context that + -- resolves some ambiguities). + -- For now, we analyze them here to avoid depending + -- on legality checking performed during expansion. + -- To reverse this decision, set this flag to False. + + begin + -- Error checking + + if not All_Extensions_Allowed then + Error_Msg_Name_1 := Nam; + Error_Msg_GNAT_Extension ("aspect %", Loc); + goto Continue; + end if; + + if Ekind (E) /= E_Subprogram_Body + or else Nkind (Parent (E)) /= N_Procedure_Specification + then + Error_Msg_N ("Super must apply to a constructor body", N); + end if; + + -- handle missing parameter list (an error case) + + if No (Expr) then + Error_Msg_N ("constructor parameters required", N); + + -- Handle parameter list of length more than one + -- (such a list is parsed as an aggregate). + + elsif Nkind (Expr) = N_Aggregate then + if Present (Component_Associations (Expr)) + or else No (Expressions (Expr)) + then + Error_Msg_N + ("malformed constructor parameter list", N); + + elsif Analyze_Parameter_Expressions then + declare + Param_Expr : Node_Id := First (Expressions (Expr)); + begin + while Present (Param_Expr) loop + Analyze (Param_Expr); + Next (Param_Expr); + end loop; + + Set_Analyzed (Expr); + -- Someday Vast may complain that this so-called + -- aggregate has no Etype. For now, we mark it + -- as analyzed and hope that nobody trips over it. + end; + end if; + + -- handle parameter list of length one + + elsif Paren_Count (Expr) = 0 then + Error_Msg_N + ("parentheses missing for constructor parameter list ", + N); + + elsif Analyze_Parameter_Expressions then + Analyze (Expr); + end if; + end Super; + when Boolean_Aspects | Library_Unit_Aspects => @@ -5101,6 +5485,12 @@ package body Sem_Ch13 is Analyze_Aspect_Static; goto Continue; + -- GNAT Core Extension: Checks for this aspect are performed + -- when the corresponding pragma is analyzed. + + elsif A_Id = Aspect_Unsigned_Base_Range then + null; + -- Ada 2022 (AI12-0279) elsif A_Id = Aspect_Yield then @@ -5280,14 +5670,28 @@ package body Sem_Ch13 is goto Continue; end; - -- All other cases, generate attribute definition + -- Generate an attribute definition for access types - else + elsif Is_Access_Type (E) then Aitem := Make_Attribute_Definition_Clause (Loc, Name => Ent, Chars => Name_Storage_Size, Expression => Relocate_Node (Expr)); + + -- This is likely a misplaced aspect. Create a pragma to + -- emit the actual error. + + else + Aitem := + Make_Aitem_Pragma + (Pragma_Argument_Associations => + New_List + (Make_Pragma_Argument_Association + (Loc, Expression => Relocate_Node (Expr))), + Pragma_Name => Name_Storage_Size); + Insert_Pragma (Aitem); + goto Continue; end if; when Aspect_External_Initialization => @@ -5363,7 +5767,9 @@ package body Sem_Ch13 is Set_Declarations (N, New_List); end if; - Prepend (Aitem, Declarations (N)); + if Present (Aitem) then + Prepend (Aitem, Declarations (N)); + end if; elsif Nkind (N) = N_Generic_Package_Declaration then if No (Visible_Declarations (Specification (N))) then @@ -5434,7 +5840,9 @@ package body Sem_Ch13 is -- The pragma is added before source declarations - Prepend_To (Declarations (N), Aitem); + if Present (Aitem) then + Prepend_To (Declarations (N), Aitem); + end if; -- When delay is not required and the context is not a compilation -- unit, we simply insert the pragma/attribute definition clause @@ -7959,32 +8367,59 @@ package body Sem_Ch13 is if Duplicate_Clause then null; - + elsif No (Size) then + Error_Msg_N ("invalid argument for Stream_Size aspect", Nam); elsif Is_Elementary_Type (U_Ent) then - -- Size will be empty if we already detected an error - -- (e.g. Expr is of the wrong type); we might as well - -- give the useful hint below even in that case. - - if No (Size) or else - (Size /= System_Storage_Unit - and then Size /= System_Storage_Unit * 2 - and then Size /= System_Storage_Unit * 3 - and then Size /= System_Storage_Unit * 4 - and then Size /= System_Storage_Unit * 8) - then - Error_Msg_N - ("stream size for elementary type must be 8, 16, 24, " & - "32 or 64", N); + Set_Has_Stream_Size_Clause (U_Ent); - elsif Known_RM_Size (U_Ent) and then RM_Size (U_Ent) > Size then - Error_Msg_Uint_1 := RM_Size (U_Ent); - Error_Msg_N - ("stream size for elementary type must be 8, 16, 24, " & - "32 or 64 and at least ^", N); - end if; + declare + Minimum_Size : constant Uint := + (if Known_RM_Size (U_Ent) + then RM_Size (U_Ent) + else Uint_0); - Set_Has_Stream_Size_Clause (U_Ent); + Size_Or_Zero : constant Uint := + (if Size < Minimum_Size then Uint_0 else Size); + -- If the requested size is smaller than the RM size of the + -- type, we pass zero to Get_Primitives. That will always + -- give us the list of supported sizes we need to report an + -- error. + P : constant Primitive_Result := + Get_Primitives (U_Ent, Size_Or_Zero); + + Error_Text : Bounded_String; + + In_First_Iteration : Boolean := True; + Previous_Value : Nat := 0; + begin + case P.S is + when Possible_Sizes => + Error_Msg_N ("unsupported stream size", N); + + Append + (Error_Text, + "\supported stream sizes for this type: "); + for Sz of P.List loop + if Minimum_Size <= Sz and then Sz /= Previous_Value + then + if In_First_Iteration then + In_First_Iteration := False; + else + Append (Error_Text, ", "); + end if; + + Append (Error_Text, Sz); + + Previous_Value := Sz; + end if; + end loop; + Error_Msg_N (To_String (Error_Text), N); + + when others => + null; + end case; + end; else Error_Msg_N ("Stream_Size cannot be given for &", Nam); end if; @@ -11302,7 +11737,7 @@ package body Sem_Ch13 is -- Case of stream attributes and Put_Image, just have to compare -- entities. However, the expression is just a possibly-overloaded -- name, so we need to verify that one of these interpretations is - -- the one available at at the freeze point. + -- the one available at the freeze point. elsif A_Id in Aspect_Constructor | Aspect_Destructor @@ -11894,6 +12329,7 @@ package body Sem_Ch13 is | Aspect_Relaxed_Initialization | Aspect_SPARK_Mode | Aspect_Subprogram_Variant + | Aspect_Super | Aspect_Suppress | Aspect_Test_Case | Aspect_Unimplemented @@ -12513,8 +12949,8 @@ package body Sem_Ch13 is elsif No (Next_Formal (First_Formal (Subp))) then Error_Msg_Sloc := Sloc (Subp); Illegal_Indexing - ("at least two parameters required for indexing function " - & "defined #"); + ("at least two parameters required for indexing function " + & "defined #"); return; elsif not Subp_Is_Dispatching_Op_Of_Typ @@ -12525,7 +12961,7 @@ package body Sem_Ch13 is then Illegal_Indexing ("indexing aspect requires function with first formal " - & "applying to type& or its class-wide type"); + & "applying to type& or its class-wide type"); return; elsif Aspect = Aspect_Constant_Indexing @@ -12534,7 +12970,7 @@ package body Sem_Ch13 is then Illegal_Indexing ("Constant_Indexing must apply to function with " - & "access-to-constant formal"); + & "access-to-constant formal"); return; end if; @@ -12543,8 +12979,8 @@ package body Sem_Ch13 is if Aspect = Aspect_Variable_Indexing then if not Has_Implicit_Dereference (Ret_Type) then Illegal_Indexing - ("function for Variable_Indexing must return " - & "a reference type"); + ("function for Variable_Indexing must return " + & "a reference type"); return; elsif Is_Access_Constant diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 9f69e4f6cb8d..9ca77089d1a3 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -1476,9 +1476,15 @@ package body Sem_Ch3 is -- This reset is performed in most cases except where the access type -- has been created for the purposes of allocating or deallocating a -- build-in-place object. Such access types have explicitly set pools - -- and finalization collections. - - if No (Associated_Storage_Pool (T)) then + -- and finalization collections. It is also skipped when Etype (T) is + -- unknown, since attribute Associated_Storage_Pool is only available + -- in the root type of T, and in such case it cannot not be computed + -- (thus causing spurious errors). Etype (T) is unknown when errors + -- have been previously reported on T. + + if Present (Etype (T)) + and then No (Associated_Storage_Pool (T)) + then Set_Finalization_Collection (T, Empty); end if; @@ -1536,7 +1542,6 @@ package body Sem_Ch3 is Analyze_Component_Declaration (Decl); Set_Analyzed (Decl); - Mutate_Ekind (Tag, E_Component); Set_Is_Tag (Tag); Set_Is_Aliased (Tag); Set_Is_Independent (Tag); @@ -1577,7 +1582,6 @@ package body Sem_Ch3 is Analyze_Component_Declaration (Decl); Set_Analyzed (Decl); - Mutate_Ekind (Offset, E_Component); Set_Is_Aliased (Offset); Set_Is_Independent (Offset); Set_Related_Type (Offset, Iface); @@ -2898,12 +2902,14 @@ package body Sem_Ch3 is -- private type from a library unit, otherwise premature freezing of -- the private type will occur. - elsif not Analyzed (Next_Decl) and then Is_Body (Next_Decl) + elsif not Analyzed (Next_Decl) + and then Is_Body (Next_Decl) and then ((Nkind (Next_Decl) /= N_Subprogram_Body - or else not Was_Expression_Function (Next_Decl)) - or else (not Is_Ignored_Ghost_Entity (Current_Scope) - and then not Contains_Lib_Incomplete_Type - (Current_Scope))) + or else not Was_Expression_Function (Next_Decl)) + or else (not Is_Ignored_Ghost_Entity_In_Codegen + (Current_Scope) + and then not Contains_Lib_Incomplete_Type + (Current_Scope))) then -- When a controlled type is frozen, the expander generates stream -- and controlled-type support routines. If the freeze is caused @@ -3034,8 +3040,10 @@ package body Sem_Ch3 is or else In_Package_Body (Current_Scope)); procedure Check_Nonoverridable_Aspects; - -- Apply the rule in RM 13.1.1(18.4/4) on iterator aspects that cannot - -- be overridden, and can only be confirmed on derivation. + -- Apply rules for nonoverridable aspects on types with partial views + -- described in RM 13.1.1 (18.6/6). This procedure must only be called + -- in the partial view completion case, i.e. when T points to the + -- full view and Def_Id points to the partial view. procedure Check_Ops_From_Incomplete_Type; -- If there is a tagged incomplete partial view of the type, traverse @@ -3081,24 +3089,14 @@ package body Sem_Ch3 is -- Local variables - Prev_Aspects : constant List_Id := - Aspect_Specifications (Parent (Def_Id)); - Par_Type : Entity_Id; - Prev_Aspect : Node_Id; + Prev_Aspects : constant List_Id := + Aspect_Specifications (Parent (Def_Id)); + Prev_Aspect : Node_Id; + Par_Type : constant Entity_Id := Etype (T); -- Start of processing for Check_Nonoverridable_Aspects begin - -- Get parent type of derived type. Note that Prev is the entity in - -- the partial declaration, but its contents are now those of full - -- view, while Def_Id reflects the partial view. - - if Is_Private_Type (Def_Id) then - Par_Type := Etype (Full_View (Def_Id)); - else - Par_Type := Etype (Def_Id); - end if; - -- If there is an inherited Implicit_Dereference, verify that it is -- made explicit in the partial view. @@ -3191,9 +3189,29 @@ package body Sem_Ch3 is end if; end Check_Ops_From_Incomplete_Type; + -- Local variables + + Is_Unsigned_Base_Range_Type_Decl : Boolean := False; + -- Start of processing for Analyze_Full_Type_Declaration begin + if Present (Aspect_Specifications (Parent (Def))) then + declare + Asp : Node_Id; + begin + Asp := First (Aspect_Specifications (Parent (Def))); + while Present (Asp) loop + if Chars (Identifier (Asp)) = Name_Unsigned_Base_Range then + Is_Unsigned_Base_Range_Type_Decl := True; + exit; + end if; + + Next (Asp); + end loop; + end; + end if; + Prev := Find_Type_Name (N); -- The full view, if present, now points to the current type. If there @@ -3329,7 +3347,11 @@ package body Sem_Ch3 is Ordinary_Fixed_Point_Type_Declaration (T, Def); when N_Signed_Integer_Type_Definition => - Signed_Integer_Type_Declaration (T, Def); + if Is_Unsigned_Base_Range_Type_Decl then + Unsigned_Base_Range_Type_Declaration (T, Def); + else + Signed_Integer_Type_Declaration (T, Def); + end if; when N_Modular_Type_Definition => Modular_Type_Declaration (T, Def); @@ -3590,11 +3612,7 @@ package body Sem_Ch3 is Generate_Definition (Defining_Identifier (N)); -- Process an incomplete declaration. The identifier must not have been - -- declared already in the scope. However, an incomplete declaration may - -- appear in the private part of a package, for a private type that has - -- already been declared. - - -- In this case, the discriminants (if any) must match + -- declared already in the scope. T := Find_Type_Name (N); @@ -4612,7 +4630,10 @@ package body Sem_Ch3 is Set_Has_Delayed_Freeze (T); elsif not Preanalysis_Active then - Freeze_Before (N, T); + -- Do_Freeze_Profile matters in the case of an object + -- of an anonymous access-to-subprogram type. + + Freeze_Before (N, T, Do_Freeze_Profile => False); end if; end if; @@ -8235,6 +8256,8 @@ package body Sem_Ch3 is if Is_Integer_Type (Parent_Type) then Set_Has_Shift_Operator (Implicit_Base, Has_Shift_Operator (Parent_Type)); + Set_Has_Unsigned_Base_Range_Aspect + (Implicit_Base, Has_Unsigned_Base_Range_Aspect (Parent_Base)); end if; -- The type of the bounds is that of the parent type, and they @@ -10195,7 +10218,7 @@ package body Sem_Ch3 is end if; -- A type extension is automatically Ghost when one of its - -- progenitors is Ghost (SPARK RM 6.9(9)). This property is + -- progenitors is Ghost (SPARK RM 6.9(10)). This property is -- also inherited when the parent type is Ghost, but this is -- done in Build_Derived_Type as the mechanism also handles -- untagged derivations. @@ -10519,7 +10542,7 @@ package body Sem_Ch3 is end if; -- A derived type becomes Ghost when its parent type is also Ghost - -- (SPARK RM 6.9(9)). Note that the Ghost-related attributes are not + -- (SPARK RM 6.9(10)). Note that the Ghost-related attributes are not -- directly inherited because the Ghost policy in effect may differ. if Is_Ghost_Entity (Parent_Type) then @@ -15626,11 +15649,11 @@ package body Sem_Ch3 is -- Initialize new full declaration entity by copying the pertinent -- fields of the corresponding private declaration entity. - -- We temporarily set Ekind to a value appropriate for a type to - -- avoid assert failures in Einfo from checking for setting type - -- attributes on something that is not a type. Ekind (Priv) is an - -- appropriate choice, since it allowed the attributes to be set - -- in the first place. This Ekind value will be modified later. + -- We temporarily set Ekind to a value appropriate for a type to avoid + -- assert failures in Einfo from checking for setting type fields on + -- something that is not a type. Ekind (Priv) is an appropriate choice, + -- since it allowed the fields to be set in the first place. This Ekind + -- value will be modified later. Mutate_Ekind (Full, Ekind (Priv)); @@ -15640,7 +15663,7 @@ package body Sem_Ch3 is Set_Etype (Full, Any_Type); - -- Now start copying attributes + -- Now start copying fields Set_Has_Discriminants (Full, Has_Discriminants (Priv)); @@ -15695,12 +15718,15 @@ package body Sem_Ch3 is Access_Types_To_Process (Freeze_Node (Priv))); end if; - -- Swap the two entities. Now Private is the full type entity and Full - -- is the private one. They will be swapped back at the end of the - -- private part. This swapping ensures that the entity that is visible - -- in the private part is the full declaration. + -- Swap the two entities Exchange_Entities (Priv, Full); + + -- Now the slot Priv points to contains the full type entity and the + -- slot Full points to contains the private one. They will be swapped + -- back at the end of the private part. This swapping ensures that the + -- entity that is visible in the private part is the full declaration. + Set_Is_Not_Self_Hidden (Priv); Append_Entity (Full, Scope (Full)); end Copy_And_Swap; @@ -18729,7 +18755,11 @@ package body Sem_Ch3 is Enter_Name (Id); New_Id := Id; - -- Check invalid completion of private or incomplete type + -- Check invalid completion of private or incomplete type. The + -- completion of an incomplete view must be a non-incomplete type + -- declaration (RM 3.10.1 (3/3)) and the completion of a partial view + -- must be a full type declaration (RM 7.3 (4)). Before Ada 2012, a + -- full type declaration is needed in the two cases. elsif Nkind (N) not in N_Full_Type_Declaration | N_Task_Type_Declaration @@ -18740,8 +18770,6 @@ package body Sem_Ch3 is or else Nkind (N) not in N_Private_Type_Declaration | N_Private_Extension_Declaration) then - -- Completion must be a full type declarations (RM 7.3(4)) - Error_Msg_Sloc := Sloc (Prev); Error_Msg_NE ("invalid completion of }", Id, Prev); @@ -21557,7 +21585,7 @@ package body Sem_Ch3 is Set_Stored_Constraint (Current_Scope, No_Elist); -- Default expressions must be provided either for all or for none - -- of the discriminants of a discriminant part. (RM 3.7.1) + -- of the discriminants of a discriminant part (RM 3.7 (9.1/3)). if Default_Present and then Default_Not_Present then Error_Msg_N @@ -21948,8 +21976,7 @@ package body Sem_Ch3 is else -- For untagged types, verify that a type without discriminants is - -- not completed with an unconstrained type. A separate error message - -- is produced if the full type has defaulted discriminants. + -- not completed with an indefinite type. if Is_Definite_Subtype (Priv_T) and then not Is_Definite_Subtype (Full_T) @@ -21966,7 +21993,7 @@ package body Sem_Ch3 is end if; end if; - -- AI-419: verify that the use of "limited" is consistent + -- RM 7.3 (10.1/3): verify that the use of "limited" is consistent declare Orig_Decl : constant Node_Id := Original_Node (N); @@ -21982,7 +22009,9 @@ package body Sem_Ch3 is and then Limited_Present (Type_Definition (Orig_Decl)) then Error_Msg_N - ("full view of non-limited extension cannot be limited", N); + ("full view of implicitly limited extension must be " + & "implicitly limited", + N); -- Conversely, if the partial view carries the limited keyword, -- the full view must as well, even if it may be redundant. @@ -21991,7 +22020,8 @@ package body Sem_Ch3 is and then not Limited_Present (Type_Definition (Orig_Decl)) then Error_Msg_N - ("full view of limited extension must be explicitly limited", + ("full view of explicitly limited extension must be " + & "explicitly limited", N); end if; end if; @@ -23688,6 +23718,9 @@ package body Sem_Ch3 is -- Check bound to make sure it is integral and static. If not, post -- appropriate error message and set Errs flag + function Has_Pragma_Unsigned_Base_Range return Boolean; + -- Determine if type T has pragma Unsigned_Base_Range + --------------------- -- Can_Derive_From -- --------------------- @@ -23732,6 +23765,39 @@ package body Sem_Ch3 is end if; end Check_Bound; + ------------------------------------ + -- Has_Pragma_Unsigned_Base_Range -- + ------------------------------------ + + function Has_Pragma_Unsigned_Base_Range return Boolean is + Type_Decl : constant Node_Id := Parent (Def); + Nod : Node_Id := Next (Type_Decl); + Pragma_Arg : Node_Id; + + begin + while Present (Nod) loop + if Nkind (Nod) = N_Pragma + and then Chars (Pragma_Identifier (Nod)) + = Name_Unsigned_Base_Range + then + Pragma_Arg := First (Pragma_Argument_Associations (Nod)); + + -- Given that we are processing the full type declaration + -- of T, we cannot analyze yet the reference to the type + -- given in the pragma because it would be reported as + -- premature usage. Hence we rely on the name of the type. + + if Chars (Expression (Pragma_Arg)) = Chars (T) then + return True; + end if; + end if; + + Next (Nod); + end loop; + + return False; + end Has_Pragma_Unsigned_Base_Range; + -- Start of processing for Signed_Integer_Type_Declaration begin @@ -23791,6 +23857,22 @@ package body Sem_Ch3 is Check_Restriction (No_Long_Long_Integers, Def); Base_Typ := Base_Type (Standard_Long_Long_Long_Integer); + -- For performance reasons, we defer checking pragma unsigned base + -- range until we have this case with bounds out of range (since + -- there is no need to perform this check for all signed integer + -- type declarations). + + -- When the bounds of the integer type declaration are smaller, + -- and Unsigned_Base_Range is specified by means of a pragma, the + -- frontend handles the declaration as a regular signed integer + -- type declaration, and the base type is later adjusted (when the + -- pragma is processed); however, when the bounds are out of range + -- for the largest integer type we must handle it explicitly now. + + elsif Has_Pragma_Unsigned_Base_Range then + Unsigned_Base_Range_Type_Declaration (T, Def); + return; + else Base_Typ := Base_Type (Standard_Long_Long_Long_Integer); Error_Msg_N ("integer type definition bounds out of range", Def); @@ -23830,6 +23912,170 @@ package body Sem_Ch3 is Set_Is_Constrained (T); end Signed_Integer_Type_Declaration; + ------------------------------------------ + -- Unsigned_Base_Range_Type_Declaration -- + ------------------------------------------ + + procedure Unsigned_Base_Range_Type_Declaration + (T : Entity_Id; + Def : Node_Id) + is + Implicit_Base : Entity_Id; + Base_Typ : Entity_Id; + Lo_Val : Uint; + Hi_Val : Uint; + Errs : Boolean := False; + Lo : Node_Id; + Hi : Node_Id; + + function Can_Derive_From (E : Entity_Id) return Boolean; + -- Determine whether given bounds allow derivation from specified type + + procedure Check_Bound (Expr : Node_Id); + -- Check bound to make sure it is integral and static. If not, post + -- appropriate error message and set Errs flag + + --------------------- + -- Can_Derive_From -- + --------------------- + + -- Note we check both bounds against both end values, to deal with + -- strange types like ones with a range of 0 .. -12341234. + + function Can_Derive_From (E : Entity_Id) return Boolean is + Lo : constant Uint := Expr_Value (Type_Low_Bound (E)); + Hi : constant Uint := Expr_Value (Type_High_Bound (E)); + begin + return Lo <= Lo_Val and then Lo_Val <= Hi + and then + Lo <= Hi_Val and then Hi_Val <= Hi; + end Can_Derive_From; + + ----------------- + -- Check_Bound -- + ----------------- + + procedure Check_Bound (Expr : Node_Id) is + begin + -- If a range constraint is used as an integer type definition, each + -- bound of the range must be defined by a static expression of some + -- integer type, but the two bounds need not have the same integer + -- type (Negative bounds are allowed.) (RM 3.5.4) + + if not Is_Integer_Type (Etype (Expr)) then + Error_Msg_N + ("integer type definition bounds must be of integer type", Expr); + Errs := True; + + elsif not Is_OK_Static_Expression (Expr) then + Flag_Non_Static_Expr + ("non-static expression used for integer type bound!", Expr); + Errs := True; + + -- Otherwise the bounds are folded into literals + + elsif Is_Entity_Name (Expr) then + Fold_Uint (Expr, Expr_Value (Expr), True); + end if; + end Check_Bound; + + -- Start of processing for Unsigned_Base_Range_Type_Declaration + + begin + -- Create an anonymous base type + + Implicit_Base := + Create_Itype (E_Modular_Integer_Type, Parent (Def), T, 'B'); + + -- Analyze and check the bounds, they can be of any integer type + + Lo := Low_Bound (Def); + Hi := High_Bound (Def); + + -- Arbitrarily use Integer as the type if either bound had an error + + if Hi = Error or else Lo = Error then + Base_Typ := Any_Integer; + Set_Error_Posted (T, True); + Errs := True; + + -- Here both bounds are OK expressions + + else + Analyze_And_Resolve (Lo, Any_Integer); + Analyze_And_Resolve (Hi, Any_Integer); + + Check_Bound (Lo); + Check_Bound (Hi); + + if Errs then + Hi := Type_High_Bound (Standard_Long_Long_Long_Integer); + Lo := Type_Low_Bound (Standard_Long_Long_Long_Integer); + end if; + + -- Find type to derive from + + Lo_Val := Expr_Value (Lo); + Hi_Val := Expr_Value (Hi); + + if Can_Derive_From (Standard_Short_Short_Unsigned) then + Base_Typ := Base_Type (Standard_Short_Short_Unsigned); + + elsif Can_Derive_From (Standard_Short_Unsigned) then + Base_Typ := Base_Type (Standard_Short_Unsigned); + + elsif Can_Derive_From (Standard_Unsigned) then + Base_Typ := Base_Type (Standard_Unsigned); + + elsif Can_Derive_From (Standard_Long_Unsigned) then + Base_Typ := Base_Type (Standard_Long_Unsigned); + + elsif Can_Derive_From (Standard_Long_Long_Unsigned) then + Base_Typ := Base_Type (Standard_Long_Long_Unsigned); + + elsif Can_Derive_From (Standard_Long_Long_Long_Unsigned) then + Base_Typ := Base_Type (Standard_Long_Long_Long_Unsigned); + + else + Base_Typ := Base_Type (Standard_Long_Long_Long_Unsigned); + Error_Msg_N ("unsigned type base range bounds out of range", Def); + Hi := Type_High_Bound (Standard_Long_Long_Long_Unsigned); + Lo := Type_Low_Bound (Standard_Long_Long_Long_Unsigned); + end if; + end if; + + -- Set the type of the bounds to the implicit base: we cannot set it to + -- the new type, because this would be a forward reference for the code + -- generator and, if the original type is user-defined, this could even + -- lead to spurious semantic errors. Furthermore we do not set it to be + -- universal, because this could make it much larger than needed here. + + if not Errs then + Set_Etype (Lo, Implicit_Base); + Set_Etype (Hi, Implicit_Base); + end if; + + -- Complete both implicit base and declared first subtype entities. The + -- inheritance of the rep item chain ensures that SPARK-related pragmas + -- are not clobbered when the signed integer type acts as a full view of + -- a private type. + + Set_Etype (Implicit_Base, Base_Typ); + Set_Size_Info (Implicit_Base, Base_Typ); + Set_RM_Size (Implicit_Base, RM_Size (Base_Typ)); + Set_First_Rep_Item (Implicit_Base, First_Rep_Item (Base_Typ)); + Set_Scalar_Range (Implicit_Base, Scalar_Range (Base_Typ)); + Set_Modulus (Implicit_Base, Modulus (Base_Typ)); + + Mutate_Ekind (T, E_Signed_Integer_Subtype); + Set_Etype (T, Implicit_Base); + Set_Size_Info (T, Implicit_Base); + Inherit_Rep_Item_Chain (T, Implicit_Base); + Set_Scalar_Range (T, Def); + Set_RM_Size (T, UI_From_Int (Minimum_Size (T))); + Set_Is_Constrained (T); + end Unsigned_Base_Range_Type_Declaration; + ------------------------------------- -- Warn_On_Inherently_Limited_Type -- ------------------------------------- diff --git a/gcc/ada/sem_ch3.ads b/gcc/ada/sem_ch3.ads index a97393d3cfe8..0c2e66f293b3 100644 --- a/gcc/ada/sem_ch3.ads +++ b/gcc/ada/sem_ch3.ads @@ -165,12 +165,25 @@ package Sem_Ch3 is -- node or a plain N_Identifier), find the type of the subtype mark. function Find_Type_Name (N : Node_Id) return Entity_Id; - -- Enter the identifier in a type definition, or find the entity already - -- declared, in the case of the full declaration of an incomplete or - -- private type. If the previous declaration is tagged then the class-wide - -- entity is propagated to the identifier to prevent multiple incompatible - -- class-wide types that may be created for self-referential anonymous - -- access components. + -- N must be a type declaration. The declared view can be incomplete, + -- partial, or full. The behavior of this function depends on what + -- declaration, if there is one, N completes: + -- + -- - If N is not a completion, the function enters the entity of N in the + -- name table and returns that entity. + -- - If N completes an incomplete view, the function sets the entity of N + -- as the full view of the incomplete view and returns the incomplete + -- view. + -- - If N completes a partial view, the function "swaps" the partial view + -- and the full view (see Copy_And_Swap) and returns the Entity_Id that, + -- on exit, points to the full view. The value that + -- Defining_Identifier (N) had on entry points to the partial view on + -- exit. + -- + -- If the previous declaration is tagged then the class-wide entity is + -- propagated to the identifier to prevent multiple incompatible class-wide + -- types that may be created for self-referential anonymous access + -- components. function Get_Discriminant_Value (Discriminant : Entity_Id; @@ -337,4 +350,10 @@ package Sem_Ch3 is -- as referenced. Warnings on unused entities, if needed, go on the -- partial view. + procedure Unsigned_Base_Range_Type_Declaration + (T : Entity_Id; + Def : Node_Id); + -- Create a new unsigned integer entity, and apply the constraint to obtain + -- the required first named subtype of this type. + end Sem_Ch3; diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index 018c8a079324..5704bf142c84 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -54,6 +54,7 @@ with Sem_Cat; use Sem_Cat; with Sem_Ch3; use Sem_Ch3; with Sem_Ch6; use Sem_Ch6; with Sem_Ch8; use Sem_Ch8; +with Sem_Ch12; use Sem_Ch12; with Sem_Dim; use Sem_Dim; with Sem_Disp; use Sem_Disp; with Sem_Dist; use Sem_Dist; @@ -629,7 +630,8 @@ package body Sem_Ch4 is begin while Present (Discr) loop - Append (Discriminant_Default_Value (Discr), Constr); + Append_To (Constr, + New_Copy_Tree (Discriminant_Default_Value (Discr))); Next_Discriminant (Discr); end loop; @@ -1263,6 +1265,55 @@ package body Sem_Ch4 is No_Interpretation; end if; + -- Or this may be a reference to a structural instantiation + -- with named associations if GNAT extensions are allowed. + + elsif (Is_Generic_Subprogram (Nam_Ent) + or else Ekind (Nam_Ent) = E_Generic_Package) + and then All_Extensions_Allowed + and then not Is_Empty_List (Parameter_Associations (N)) + then + declare + Act : Node_Id; + Act_List : List_Id; + Assoc : Node_Id; + Inst_Id : Entity_Id; + + begin + Act_List := New_List; + Assoc := First (Parameter_Associations (N)); + while Present (Assoc) loop + if Nkind (Assoc) = N_Parameter_Association then + Act := + Make_Generic_Association (Sloc (Assoc), + Selector_Name => + Relocate_Node (Selector_Name (Assoc)), + Explicit_Generic_Actual_Parameter => + Relocate_Node + (Explicit_Actual_Parameter (Assoc))); + else + Act := + Make_Generic_Association (Sloc (Assoc), + Explicit_Generic_Actual_Parameter => + Relocate_Node (Assoc)); + end if; + + Append_To (Act_List, Act); + Next (Assoc); + end loop; + + Inst_Id := + Build_Structural_Instantiation (N, Nam_Ent, Act_List); + if Present (Inst_Id) then + Rewrite (N, New_Occurrence_Of (Inst_Id, Loc)); + else + Rewrite (N, + Make_Raise_Program_Error (Loc, + Reason => PE_Explicit_Raise)); + end if; + Analyze (N); + end; + else No_Interpretation; end if; @@ -2734,6 +2785,10 @@ package body Sem_Ch4 is -- If the prefix of an indexed component is overloaded, the proper -- interpretation is selected by the index types and the context. + procedure Process_Generic_Instantiation; + -- The prefix in indexed component form is a generic unit. This + -- routine processes it and builds the implicit instantiation. + --------------------------- -- Process_Function_Call -- --------------------------- @@ -3046,6 +3101,37 @@ package body Sem_Ch4 is end if; end Process_Overloaded_Indexed_Component; + ----------------------------------- + -- Process_Generic_Instantiation -- + ----------------------------------- + + procedure Process_Generic_Instantiation is + Act_List : List_Id; + Expr : Node_Id; + Inst_Id : Entity_Id; + + begin + Act_List := New_List; + Expr := First (Expressions (N)); + while Present (Expr) loop + Append_To (Act_List, + Make_Generic_Association (Sloc (Expr), + Explicit_Generic_Actual_Parameter => + Relocate_Node (Expr))); + Next (Expr); + end loop; + + Inst_Id := Build_Structural_Instantiation (N, U_N, Act_List); + if Present (Inst_Id) then + Rewrite (N, New_Occurrence_Of (Inst_Id, Sloc (N))); + else + Rewrite (N, + Make_Raise_Program_Error (Sloc (N), + Reason => PE_Explicit_Raise)); + end if; + Analyze (N); + end Process_Generic_Instantiation; + -- Start of processing for Analyze_Indexed_Component_Form begin @@ -3119,9 +3205,21 @@ package body Sem_Ch4 is -- A common beginner's (or C++ templates fan) error - Error_Msg_N ("generic subprogram cannot be called", N); - Set_Etype (N, Any_Type); - return; + if All_Extensions_Allowed + and then not Is_Empty_List (Expressions (N)) + then + Process_Generic_Instantiation; + else + Error_Msg_N ("generic subprogram cannot be called", N); + Set_Etype (N, Any_Type); + return; + end if; + + elsif Ekind (U_N) = E_Generic_Package + and then All_Extensions_Allowed + and then not Is_Empty_List (Expressions (N)) + then + Process_Generic_Instantiation; else Process_Indexed_Component_Or_Slice; @@ -5352,6 +5450,10 @@ package body Sem_Ch4 is else Prefix_Type := Etype (Pref); + if Prefix_Type = Standard_Void_Type then + pragma Assert (Serious_Errors_Detected > 0); + return; + end if; end if; if Is_Access_Type (Prefix_Type) then @@ -6526,53 +6628,50 @@ package body Sem_Ch4 is procedure Analyze_User_Defined_Binary_Op (N : Node_Id; - Op_Id : Entity_Id) is + Op_Id : Entity_Id) + is + F1 : constant Entity_Id := First_Formal (Op_Id); + F2 : constant Entity_Id := Next_Formal (F1); begin - declare - F1 : constant Entity_Id := First_Formal (Op_Id); - F2 : constant Entity_Id := Next_Formal (F1); - - begin - -- Verify that Op_Id is a visible binary function. Note that since - -- we know Op_Id is overloaded, potentially use visible means use - -- visible for sure (RM 9.4(11)). Be prepared for previous errors. - - if Ekind (Op_Id) = E_Function - and then Present (F2) - and then (Is_Immediately_Visible (Op_Id) - or else Is_Potentially_Use_Visible (Op_Id)) - and then (Has_Compatible_Type (Left_Opnd (N), Etype (F1)) - or else Etype (F1) = Any_Type) - and then (Has_Compatible_Type (Right_Opnd (N), Etype (F2)) - or else Etype (F2) = Any_Type) - then - Add_One_Interp (N, Op_Id, Base_Type (Etype (Op_Id))); + -- Verify that Op_Id is a visible binary function. Note that since + -- we know Op_Id is overloaded, potentially use visible means use + -- visible for sure (RM 9.4(11)). Be prepared for previous errors. + + if Ekind (Op_Id) = E_Function + and then Present (F2) + and then (Is_Immediately_Visible (Op_Id) + or else Is_Potentially_Use_Visible (Op_Id)) + and then (Has_Compatible_Type (Left_Opnd (N), Etype (F1)) + or else Etype (F1) = Any_Type) + and then (Has_Compatible_Type (Right_Opnd (N), Etype (F2)) + or else Etype (F2) = Any_Type) + then + Add_One_Interp (N, Op_Id, Base_Type (Etype (Op_Id))); - -- If the operands are overloaded, indicate that the current - -- type is a viable candidate. This is redundant in most cases, - -- but for equality and comparison operators where the context - -- does not impose a type on the operands, setting the proper - -- type is necessary to avoid subsequent ambiguities during - -- resolution, when both user-defined and predefined operators - -- may be candidates. + -- If the operands are overloaded, indicate that the current + -- type is a viable candidate. This is redundant in most cases, + -- but for equality and comparison operators where the context + -- does not impose a type on the operands, setting the proper + -- type is necessary to avoid subsequent ambiguities during + -- resolution, when both user-defined and predefined operators + -- may be candidates. - if Is_Overloaded (Left_Opnd (N)) then - Set_Etype (Left_Opnd (N), Etype (F1)); - end if; + if Is_Overloaded (Left_Opnd (N)) then + Set_Etype (Left_Opnd (N), Etype (F1)); + end if; - if Is_Overloaded (Right_Opnd (N)) then - Set_Etype (Right_Opnd (N), Etype (F2)); - end if; + if Is_Overloaded (Right_Opnd (N)) then + Set_Etype (Right_Opnd (N), Etype (F2)); + end if; - if Debug_Flag_E then - Write_Str ("user defined operator "); - Write_Name (Chars (Op_Id)); - Write_Str (" on node "); - Write_Int (Int (N)); - Write_Eol; - end if; + if Debug_Flag_E then + Write_Str ("user defined operator "); + Write_Name (Chars (Op_Id)); + Write_Str (" on node "); + Write_Int (Int (N)); + Write_Eol; end if; - end; + end if; end Analyze_User_Defined_Binary_Op; ----------------------------------- diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 9e4936bd6293..a767ee0b560f 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -1696,10 +1696,15 @@ package body Sem_Ch5 is -- interpretation of N. function Make_Call return N_Procedure_Call_Statement_Id is + Id : constant Node_Id := Make_Identifier (Loc, Name_Continue); + X : constant N_Procedure_Call_Statement_Id := + Make_Procedure_Call_Statement (Loc, Id); begin - return - Make_Procedure_Call_Statement - (Loc, Make_Identifier (Loc, Name_Continue)); + -- If we settle for the procedure call interpretation, we set + -- Comes_From_Source since the user did type out the call explicitly. + Set_Comes_From_Source (Id); + Set_Comes_From_Source (X); + return X; end Make_Call; function Make_Stmt return N_Continue_Statement_Id is @@ -2155,7 +2160,10 @@ package body Sem_Ch5 is Loc : constant Source_Ptr := Sloc (N); Subt : constant Node_Id := Subtype_Indication (N); + Assoc : Node_Id; Bas : Entity_Id := Empty; -- initialize to prevent warning + Iter_Asp : Node_Id; + Iter_Func : Node_Id; Typ : Entity_Id; procedure Check_Reverse_Iteration (Typ : Entity_Id); @@ -2865,12 +2873,9 @@ package body Sem_Ch5 is -- in the container package. We obtain it by name for a predefined -- container, or through the Iterable aspect for a formal one. - if Has_Aspect (Typ, Aspect_Iterable) then - Set_Etype (Def_Id, - Get_Cursor_Type - (Parent (Find_Value_Of_Aspect (Typ, Aspect_Iterable)), - Typ)); - + Iter_Asp := Find_Aspect (Typ, Aspect_Iterable); + if Present (Iter_Asp) then + Set_Etype (Def_Id, Get_Cursor_Type (Iter_Asp, Typ)); else Set_Etype (Def_Id, Get_Cursor_Type (Typ)); Check_Reverse_Iteration (Etype (Iter_Name)); @@ -2879,6 +2884,25 @@ package body Sem_Ch5 is end if; end if; + -- Validate the ghost context of he iterator function used for the + -- iterable aspect. + + Iter_Asp := Find_Aspect (Typ, Aspect_Iterable); + if Present (Iter_Asp) then + Assoc := First (Component_Associations (Expression (Iter_Asp))); + while Present (Assoc) loop + Iter_Func := Expression (Assoc); + if Nkind (Iter_Func) in N_Has_Entity + and then Present (Entity (Iter_Func)) + and then Is_Ghost_Entity (Entity (Iter_Func)) + then + Check_Ghost_Context (Entity (Iter_Func), Parent (N)); + end if; + + Next (Assoc); + end loop; + end if; + -- Preanalyze the filter. Expansion will take place when enclosing -- loop is expanded. diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index b7ddc4b7a6a6..5e84889e401d 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -436,11 +436,20 @@ package body Sem_Ch6 is Set_Parent (New_Body, Parent (N)); + -- Disable Ghost checks for this early analysis on the expression. + -- We have not analyzed the new body of the expression function + -- yet so the ghost region is not set up properly for the ghost + -- context checks yet. Avoid the checks for now as the expression + -- will be re-analyzed when the expression function is replaced + -- with the function body. + + Ghost_Context_Checks_Disabled := True; Freeze_Expr_Types (Def_Id => Def_Id, Typ => Typ, Expr => Expr, N => N); + Ghost_Context_Checks_Disabled := False; end if; -- For navigation purposes, indicate that the function is a body @@ -581,7 +590,8 @@ package body Sem_Ch6 is -- Ghost subprogram. if Inside_A_Generic then - Set_Has_Completion (Def_Id, not Is_Ignored_Ghost_Entity (Def_Id)); + Set_Has_Completion + (Def_Id, not Is_Ignored_Ghost_Entity_In_Codegen (Def_Id)); Push_Scope (Def_Id); Install_Formals (Def_Id); Preanalyze_And_Resolve_Spec_Expression (Expr, Typ); @@ -3864,7 +3874,7 @@ package body Sem_Ch6 is -- Separate spec is not present if No (Spec_Id) then - Create_Extra_Formals (Body_Id); + Create_Extra_Formals (Body_Id, Related_Nod => N); -- Separate spec is present; deal with freezing issues @@ -3883,7 +3893,7 @@ package body Sem_Ch6 is and then Is_Build_In_Place_Function (Spec_Id) and then not Has_BIP_Formals (Spec_Id) then - Create_Extra_Formals (Spec_Id); + Create_Extra_Formals (Spec_Id, Related_Nod => N); pragma Assert (not Expander_Active or else Extra_Formals_Known (Spec_Id)); Compute_Returns_By_Ref (Spec_Id); @@ -3907,7 +3917,7 @@ package body Sem_Ch6 is and then Serious_Errors_Detected = 0 and then (Expander_Active or else Operating_Mode = Check_Semantics - or else Is_Ignored_Ghost_Entity (Spec_Id)) + or else Is_Ignored_Ghost_Entity_In_Codegen (Spec_Id)) then -- The body generated for an expression function that is not a -- completion is a freeze point neither for the profile nor for @@ -3933,7 +3943,7 @@ package body Sem_Ch6 is and then Serious_Errors_Detected = 0 then Set_Has_Delayed_Freeze (Spec_Id); - Create_Extra_Formals (Spec_Id); + Create_Extra_Formals (Spec_Id, Related_Nod => N); Freeze_Before (N, Spec_Id); end if; end if; @@ -7752,6 +7762,7 @@ package body Sem_Ch6 is or else not Is_Dispatching_Operation (Subp) or else No (Find_Dispatching_Type (Subp)) or else not Is_Interface (Find_Dispatching_Type (Subp)) + or else Parent (Subp) not in N_Subprogram_Specification_Id then null; @@ -8549,7 +8560,10 @@ package body Sem_Ch6 is -- Create_Extra_Formals -- -------------------------- - procedure Create_Extra_Formals (E : Entity_Id) is + procedure Create_Extra_Formals + (E : Entity_Id; + Related_Nod : Node_Id := Empty) + is First_Extra : Entity_Id := Empty; Formal : Entity_Id; Last_Extra : Entity_Id := Empty; @@ -8823,7 +8837,8 @@ package body Sem_Ch6 is use Deferred_Extra_Formals_Support; Can_Be_Deferred : constant Boolean := - not Is_Unsupported_Extra_Formals_Entity (E); + not Is_Unsupported_Extra_Formals_Entity (E, + Related_Nod); Alias_Formal : Entity_Id := Empty; Alias_Subp : Entity_Id := Empty; Formal_Type : Entity_Id; @@ -8906,7 +8921,7 @@ package body Sem_Ch6 is pragma Assert (Is_Generic_Instance (E) = Is_Generic_Instance (Ultimate_Alias (E))); - Create_Extra_Formals (Ultimate_Alias (E)); + Create_Extra_Formals (Ultimate_Alias (E), Related_Nod); pragma Assert (not Expander_Active or else Extra_Formals_Known (Ultimate_Alias (E))); @@ -9079,7 +9094,7 @@ package body Sem_Ch6 is -- function Parent_Subprogram). if Ultimate_Alias (Parent_Subp) /= Ref_E then - Create_Extra_Formals (Parent_Subp); + Create_Extra_Formals (Parent_Subp, Related_Nod); end if; Parent_Formal := First_Formal (Parent_Subp); @@ -9114,7 +9129,7 @@ package body Sem_Ch6 is -- Ensure that the ultimate alias has all its extra formals elsif Present (Alias_Subp) then - Create_Extra_Formals (Alias_Subp); + Create_Extra_Formals (Alias_Subp, Related_Nod); Alias_Formal := First_Formal (Alias_Subp); end if; @@ -11772,16 +11787,18 @@ package body Sem_Ch6 is Is_Primitive := False; if not Comes_From_Source (S) then + if Present (Derived_Type) then - -- Add an inherited primitive for an untagged derived type to - -- Derived_Type's list of primitives. Tagged primitives are - -- dealt with in Check_Dispatching_Operation. Do this even when - -- Extensions_Allowed is False to issue better error messages. + -- Add an inherited primitive for an untagged derived type to + -- Derived_Type's list of primitives. Tagged primitives are + -- dealt with in Check_Dispatching_Operation. Do this even when + -- Extensions_Allowed is False to issue better error messages. - if Present (Derived_Type) - and then not Is_Tagged_Type (Derived_Type) - then - Append_Unique_Elmt (S, Primitive_Operations (Derived_Type)); + if not Is_Tagged_Type (Derived_Type) then + Append_Unique_Elmt (S, Primitive_Operations (Derived_Type)); + end if; + + Set_Is_Primitive (S); end if; -- If subprogram is at library level, it is not primitive operation @@ -11822,7 +11839,7 @@ package body Sem_Ch6 is Check_Private_Overriding (B_Typ); -- The Ghost policy in effect at the point of declaration -- or a tagged type and a primitive operation must match - -- (SPARK RM 6.9(18)). + -- (SPARK RM 6.9(21)). Check_Ghost_Primitive (S, B_Typ); end if; @@ -11863,7 +11880,7 @@ package body Sem_Ch6 is -- The Ghost policy in effect at the point of declaration -- of a tagged type and a primitive operation must match - -- (SPARK RM 6.9(18)). + -- (SPARK RM 6.9(21)). Check_Ghost_Primitive (S, B_Typ); end if; @@ -11896,7 +11913,7 @@ package body Sem_Ch6 is -- The Ghost policy in effect at the point of declaration of a -- tagged type and a primitive operation must match - -- (SPARK RM 6.9(18)). + -- (SPARK RM 6.9(21)). Check_Ghost_Primitive (S, B_Typ); end if; @@ -12367,7 +12384,7 @@ package body Sem_Ch6 is -- The Ghost policy in effect at the point of declaration of a -- parent subprogram and an overriding subprogram must match - -- (SPARK RM 6.9(19)). + -- (SPARK RM 6.9(21)). Check_Ghost_Overriding (S, Overridden_Subp); end if; @@ -12530,7 +12547,7 @@ package body Sem_Ch6 is -- The Ghost policy in effect at the point of declaration -- of a parent subprogram and an overriding subprogram - -- must match (SPARK RM 6.9(19)). + -- must match (SPARK RM 6.9(21)). Check_Ghost_Overriding (E, S); end if; @@ -12734,7 +12751,7 @@ package body Sem_Ch6 is -- The Ghost policy in effect at the point of declaration -- of a parent subprogram and an overriding subprogram - -- must match (SPARK RM 6.9(19)). + -- must match (SPARK RM 6.9(21)). Check_Ghost_Overriding (S, E); @@ -12900,7 +12917,7 @@ package body Sem_Ch6 is -- The Ghost policy in effect at the point of declaration of a parent -- subprogram and an overriding subprogram must match - -- (SPARK RM 6.9(19)). + -- (SPARK RM 6.9(21)). Check_Ghost_Overriding (S, Overridden_Subp); @@ -13111,8 +13128,8 @@ package body Sem_Ch6 is -- formals of the enclosing scope are available before -- adding the extra actuals of this call. - Create_Extra_Formals (Scop_Id); - Create_Extra_Formals (Call_Id); + Create_Extra_Formals (Scop_Id, Related_Nod => Call_Node); + Create_Extra_Formals (Call_Id, Related_Nod => Call_Node); pragma Assert (Extra_Formals_Known (Scop_Id)); pragma Assert (Extra_Formals_Known (Call_Id)); @@ -13285,8 +13302,11 @@ package body Sem_Ch6 is is Comp_Unit : constant Entity_Id := Cunit_Entity (Get_Source_Unit (Call_Node)); + begin - return not Underlying_Types_Available (Id) + return Expander_Active + and then not Extra_Formals_Known (Id) + and then not Underlying_Types_Available (Id) and then Is_Compilation_Unit (Comp_Unit) and then Ekind (Comp_Unit) in E_Package | E_Package_Body @@ -13305,12 +13325,18 @@ package body Sem_Ch6 is -- (AI05-0151-1/08). function Is_Unsupported_Extra_Formals_Entity - (Id : Entity_Id) return Boolean + (Id : Entity_Id; + Related_Nod : Node_Id := Empty) return Boolean is + Ref_Node : constant Node_Id := (if Present (Related_Nod) then + Related_Nod + else Id); Comp_Unit : constant Entity_Id := - Cunit_Entity (Get_Source_Unit (Id)); + Cunit_Entity (Get_Source_Unit (Ref_Node)); begin - return not Underlying_Types_Available (Id) + return Expander_Active + and then not Extra_Formals_Known (Id) + and then not Underlying_Types_Available (Id) and then Is_Compilation_Unit (Comp_Unit) and then Ekind (Comp_Unit) in E_Package_Body | E_Subprogram_Body; diff --git a/gcc/ada/sem_ch6.ads b/gcc/ada/sem_ch6.ads index 4ef5b654bb01..3c6de705097d 100644 --- a/gcc/ada/sem_ch6.ads +++ b/gcc/ada/sem_ch6.ads @@ -160,13 +160,23 @@ package Sem_Ch6 is -- True when this is a check against a formal access-to-subprogram type, -- indicating that mapping of types is needed. - procedure Create_Extra_Formals (E : Entity_Id); + procedure Create_Extra_Formals + (E : Entity_Id; + Related_Nod : Node_Id := Empty); -- For each parameter of a subprogram or entry that requires an additional -- formal (such as for access parameters and indefinite discriminated -- parameters), creates the appropriate formal and attach it to its -- associated parameter. Each extra formal will also be appended to -- the end of Subp's parameter list (with each subsequent extra formal -- being attached to the preceding extra formal). + -- + -- Related_Nod is the node motivating the frontend call to create the + -- extra formals; it is not passed when the node causing the call is E + -- (for example, as part of freezing E). Related_Nod provides the context + -- where the extra formals are created, and it is used to determine if + -- the creation of the extra formals can be deferred when the underlying + -- type of some formal (or its return type) is not available, and thus + -- improve the support for AI05-0151-1/08. function Extra_Formals_Match_OK (E : Entity_Id; @@ -432,12 +442,15 @@ package Sem_Ch6 is -- been registered to defer the addition of its extra formals. function Is_Unsupported_Extra_Formals_Entity - (Id : Entity_Id) return Boolean; + (Id : Entity_Id; + Related_Nod : Node_Id := Empty) return Boolean; -- Id is a subprogram, subprogram type, or entry. Return True if Id is -- unsupported for deferring the addition of its extra formals; that is, -- it is defined in a compilation unit that is a package body or a -- subprogram body, and the underlying type of some of its parameters - -- or result type is not available. + -- or result type is not available. Related_Nod is the node where this + -- check is performed (it is generally a subprogram call); if it is not + -- available then the location of entity Id is used as its related node. -- -- The context for this case is an unsupported case of AI05-0151-1/08 -- that allows incomplete tagged types as parameter and result types. diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb index d28bafb3378c..2002cc7621fd 100644 --- a/gcc/ada/sem_ch7.adb +++ b/gcc/ada/sem_ch7.adb @@ -206,7 +206,7 @@ package body Sem_Ch7 is function Node_Hash (Id : Entity_Id) return Entity_Header_Num; -- Simple hash function for Entity_Ids - package Subprogram_Table is new GNAT.Htable.Simple_HTable + package Subprogram_Table is new GNAT.HTable.Simple_HTable (Header_Num => Entity_Header_Num, Element => Boolean, No_Element => False, @@ -216,7 +216,7 @@ package body Sem_Ch7 is -- Hash table to record which subprograms are referenced. It is declared -- at library level to avoid elaborating it for every call to Analyze. - package Traversed_Table is new GNAT.Htable.Simple_HTable + package Traversed_Table is new GNAT.HTable.Simple_HTable (Header_Num => Entity_Header_Num, Element => Boolean, No_Element => False, @@ -2521,11 +2521,13 @@ package body Sem_Ch7 is and then Scope (Full_View (Id)) = Scope (Id) and then Ekind (Full_View (Id)) /= E_Incomplete_Type then + Full := Full_View (Id); + -- If there is a use-type clause on the private type, set the full -- view accordingly. - Set_In_Use (Full_View (Id), In_Use (Id)); - Full := Full_View (Id); + Set_In_Use (Full, In_Use (Id)); + Set_Current_Use_Clause (Full, Current_Use_Clause (Id)); if Is_Private_Base_Type (Full) and then Has_Private_Declaration (Full) @@ -2758,9 +2760,6 @@ package body Sem_Ch7 is Set_Is_Tagged_Type (Id, Tagged_Present (Def)); - Set_Discriminant_Constraint (Id, No_Elist); - Set_Stored_Constraint (Id, No_Elist); - if Present (Discriminant_Specifications (N)) then Push_Scope (Id); Process_Discriminants (N); @@ -2896,7 +2895,12 @@ package body Sem_Ch7 is -- When compiling a child unit this needs to be done recursively. function Type_In_Use (T : Entity_Id) return Boolean; - -- Check whether type or base type appear in an active use_type clause + -- Check whether type T is declared in P and appears in an active + -- use_type clause. + + function Type_Of_Primitive_In_Use_All (Id : Entity_Id) return Boolean; + -- Check whether the profile of primitive subprogram Id mentions a type + -- declared in P that appears in an active use-all-type clause. ------------------------------ -- Preserve_Full_Attributes -- @@ -3061,11 +3065,86 @@ package body Sem_Ch7 is ----------------- function Type_In_Use (T : Entity_Id) return Boolean is + BT : constant Entity_Id := Base_Type (T); begin - return Scope (Base_Type (T)) = P - and then (In_Use (T) or else In_Use (Base_Type (T))); + return Scope (BT) = P and then (In_Use (T) or else In_Use (BT)); end Type_In_Use; + ---------------------------------- + -- Type_Of_Primitive_In_Use_All -- + ---------------------------------- + + function Type_Of_Primitive_In_Use_All (Id : Entity_Id) return Boolean is + function Type_In_Use_All (T : Entity_Id) return Boolean; + -- Check whether type T is declared in P and appears in an active + -- use-all-type clause. + + --------------------- + -- Type_In_Use_All -- + --------------------- + + function Type_In_Use_All (T : Entity_Id) return Boolean is + begin + return Type_In_Use (T) + and then Nkind (Current_Use_Clause (T)) = N_Use_Type_Clause + and then All_Present (Current_Use_Clause (T)); + end Type_In_Use_All; + + -- Local variables + + F : Node_Id; + + -- Start of processing for Type_Of_Primitive_In_Use_All + + begin + -- The use-all-type clauses were introduced in Ada 2005 + + if Ada_Version <= Ada_95 then + return False; + end if; + + -- For enumeration literals, check type + + if Ekind (Id) = E_Enumeration_Literal then + return Type_In_Use_All (Etype (Id)); + end if; + + -- For functions, check return type + + if Ekind (Id) = E_Function then + declare + Typ : constant Entity_Id := + (if Ekind (Etype (Id)) = E_Anonymous_Access_Type + then Designated_Type (Etype (Id)) + else Etype (Id)); + begin + if Type_In_Use_All (Typ) then + return True; + end if; + end; + end if; + + -- For all subprograms, check formals + + F := First_Formal (Id); + while Present (F) loop + declare + Typ : constant Entity_Id := + (if Ekind (Etype (F)) = E_Anonymous_Access_Type + then Designated_Type (Etype (F)) + else Etype (F)); + begin + if Type_In_Use_All (Typ) then + return True; + end if; + end; + + Next_Formal (F); + end loop; + + return False; + end Type_Of_Primitive_In_Use_All; + -- Start of processing for Uninstall_Declarations begin @@ -3089,8 +3168,7 @@ package body Sem_Ch7 is -- the instantiation of the formals appears in the visible part, -- but the formals are private and remain so. - if Ekind (Id) = E_Function - and then Is_Operator_Symbol_Name (Chars (Id)) + if Nkind (Id) = N_Defining_Operator_Symbol and then not Is_Hidden (Id) and then not Error_Posted (Id) then @@ -3123,13 +3201,13 @@ package body Sem_Ch7 is elsif No (Etype (Id)) and then Serious_Errors_Detected /= 0 then null; - -- We need to avoid incorrectly marking enumeration literals as - -- non-visible when a visible use-all-type clause is in effect. + -- RM 8.4(8.1/3): Each primitive subprogram of T, including each + -- enumeration literal (if any), is potentially use-visible if T + -- is named in an active use-all-type clause. - elsif Type_In_Use (Etype (Id)) - and then Nkind (Current_Use_Clause (Etype (Id))) = - N_Use_Type_Clause - and then All_Present (Current_Use_Clause (Etype (Id))) + elsif (Ekind (Id) = E_Enumeration_Literal + or else (Is_Subprogram (Id) and then Is_Primitive (Id))) + and then Type_Of_Primitive_In_Use_All (Id) then null; diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index e6ef65860d63..86344b59c7ef 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -4340,7 +4340,12 @@ package body Sem_Ch8 is -- by inserting an extra with clause since redundant clauses don't -- really matter. - if All_Extensions_Allowed and then Is_In_Context_Clause (Clause) then + if All_Extensions_Allowed + and then Is_In_Context_Clause (Clause) + and then Nkind (Pack) in N_Expanded_Name + | N_Identifier + | N_Selected_Component + then declare Unum : Unit_Number_Type; With_Clause : constant Node_Id := @@ -4531,6 +4536,10 @@ package body Sem_Ch8 is Id := Subtype_Mark (N); Find_Type (Id); + if not Is_Entity_Name (Id) then + pragma Assert (Serious_Errors_Detected > 0); + return; + end if; E := Base_Type (Entity (Id)); -- There are many cases where a use_type_clause may be reanalyzed due to @@ -5031,10 +5040,37 @@ package body Sem_Ch8 is ----------------------------------- procedure Check_In_Previous_With_Clause (N, Nam : Node_Id) is - Pack : constant Entity_Id := Entity (Original_Node (Nam)); + + function Get_Name (N : Node_Id) return Node_Id; + -- Return the name of a package that may be present in a clause + + -------------- + -- Get_Name -- + -------------- + + function Get_Name (N : Node_Id) return Node_Id is + begin + case Nkind (N) is + when N_Indexed_Component => + return Prefix (N); + + when N_Function_Call => + return Name (N); + + when others => + return N; + end case; + end Get_Name; + + -- Local variables + + Pack : constant Entity_Id := Entity (Get_Name (Original_Node (Nam))); + Item : Node_Id; Par : Node_Id; + -- Start of processing for Check_In_Previous_With_Clause + begin Item := First (Context_Items (Parent (N))); while Present (Item) and then Item /= N loop @@ -5045,7 +5081,7 @@ package body Sem_Ch8 is and then Nkind (Name (Item)) /= N_Selected_Component and then Entity (Name (Item)) = Pack then - Par := Nam; + Par := Get_Name (Original_Node (Nam)); -- Find root library unit in with_clause @@ -5053,7 +5089,7 @@ package body Sem_Ch8 is Par := Prefix (Par); end loop; - if Is_Child_Unit (Entity (Original_Node (Par))) then + if Is_Child_Unit (Entity (Par)) then Error_Msg_NE ("& is not directly visible", Par, Entity (Par)); else return; @@ -5085,6 +5121,14 @@ package body Sem_Ch8 is if Nkind (Parent (N)) /= N_Compilation_Unit then return; + -- Structural instances can always be renamed + + elsif Is_Generic_Instance (Old_E) + and then Present (Get_Unit_Instantiation_Node (Old_E)) + and then Is_Structural (Get_Unit_Instantiation_Node (Old_E)) + then + return; + -- Check for library unit. Note that we used to check for the scope -- being Standard here, but that was wrong for Standard itself. @@ -5291,23 +5335,19 @@ package body Sem_Ch8 is Id : Entity_Id; Elmt : Elmt_Id; - function Is_Primitive_Operator_In_Use - (Op : Entity_Id; - F : Entity_Id) return Boolean; - -- Check whether Op is a primitive operator of a use-visible type + function Type_In_Use (T : Entity_Id; P : Entity_Id) return Boolean; + -- Check whether type T is declared in P and appears in an active + -- use_type clause. - ---------------------------------- - -- Is_Primitive_Operator_In_Use -- - ---------------------------------- + ----------------- + -- Type_In_Use -- + ----------------- - function Is_Primitive_Operator_In_Use - (Op : Entity_Id; - F : Entity_Id) return Boolean - is - T : constant Entity_Id := Base_Type (Etype (F)); + function Type_In_Use (T : Entity_Id; P : Entity_Id) return Boolean is + BT : constant Entity_Id := Base_Type (T); begin - return In_Use (T) and then Scope (T) = Scope (Op); - end Is_Primitive_Operator_In_Use; + return Scope (BT) = P and then (In_Use (T) or else In_Use (BT)); + end Type_In_Use; -- Start of processing for End_Use_Package @@ -5337,12 +5377,13 @@ package body Sem_Ch8 is if Nkind (Id) = N_Defining_Operator_Symbol and then - (Is_Primitive_Operator_In_Use (Id, First_Formal (Id)) + (Type_In_Use (Etype (Id), Pack) + or else Type_In_Use (Etype (First_Formal (Id)), Pack) or else (Present (Next_Formal (First_Formal (Id))) and then - Is_Primitive_Operator_In_Use - (Id, Next_Formal (First_Formal (Id))))) + Type_In_Use + (Etype (Next_Formal (First_Formal (Id))), Pack))) then null; else @@ -5467,10 +5508,7 @@ package body Sem_Ch8 is end if; end if; - if Is_Empty_Elmt_List (Used_Operations (N)) then - return; - - else + if Present (Used_Operations (N)) then Elmt := First_Elmt (Used_Operations (N)); while Present (Elmt) loop Set_Is_Potentially_Use_Visible (Node (Elmt), False); diff --git a/gcc/ada/sem_dim.adb b/gcc/ada/sem_dim.adb index 139ed661f901..822c1284d539 100644 --- a/gcc/ada/sem_dim.adb +++ b/gcc/ada/sem_dim.adb @@ -1273,7 +1273,9 @@ package body Sem_Dim is -- Get the expression from the component - if Nkind (Comp) = N_Component_Association then + if Nkind (Comp) in N_Component_Association + | N_Iterated_Component_Association + then Expr := Expression (Comp); else Expr := Comp; diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb index 77b1e120b800..0ce2b35305a1 100644 --- a/gcc/ada/sem_elab.adb +++ b/gcc/ada/sem_elab.adb @@ -11199,7 +11199,7 @@ package body Sem_Elab is (Id : Entity_Id) return Extended_Ghost_Mode is begin - return To_Ghost_Mode (Is_Ignored_Ghost_Entity (Id)); + return To_Ghost_Mode (Is_Ignored_Ghost_Entity_In_Codegen (Id)); end Ghost_Mode_Of_Entity; ------------------------ diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 4fd5b658a78d..6b38de037bf9 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -101,6 +101,121 @@ with System.Case_Util; package body Sem_Prag is + ---------------------------------- + -- Handling of Assertion Levels -- + ---------------------------------- + + -- Assertion levels are special entities declared using pragma + -- Assertion_Level. Assertion levels can be used in most Assertion_Kind + -- pragmas to associate a given level with a given list of existing + -- arguments. E.g. + -- + -- pragma Assert (Level1 => (Expr1, "Msg1"), + -- Level2 => (Expr2, "Msg2")); + -- + -- Assertion levels can also be used in pragma Assertion_Policy and + -- Check_Policy as a valid policy name. E.g. + -- + -- pragma Assertion_Policy (Level1 => Check); + + -------------------------------- + -- Declaring Assertion Levels -- + -------------------------------- + + -- Assertion levels are declared using configuration level pragma + -- Assertion_Level. We create a new E_Assertion_Level entity for each + -- pragma and add each unique level to the Assertion_Levels table. + -- + -- A pragma can be declared with dependencies. e.g. + -- + -- pragma Assertion_Level (L1); + -- pragma Assertion_Level (L2, Depends => L1); + -- pragma Assertion_Level (L3, Depends => L2); + -- + -- Levels that a level depends are called parent levels. Levels that depend + -- on a given level are called child levels. These dependencies are stored + -- in an E_Assertion_Level entity as attributes Parent_Levels and + -- Child_Levels. + -- + -- When a pragma with the same level name is declared, we check that the + -- assertion level is declared with the same dependencies as the existing + -- level. Otherwise an error is raised. + + package Assertion_Levels is new Table.Table ( + Table_Component_Type => Entity_Id, + Table_Index_Type => Nat, + Table_Low_Bound => 1, + Table_Initial => 30, + Table_Increment => 200, + Table_Name => "Assertion_Levels"); + + ------------------------------------------- + -- Applying Policies to Assertion Levels -- + ------------------------------------------- + + -- When a policy is applied to an assertion level, all assertions + -- associated with that level are subjected to the same policy. Depending + -- on the policy value, the same policy is applied to its dependencies. + -- + -- Consider the following assertion levels: + -- + -- pragma Assertion_Level (L1); + -- pragma Assertion_Level (L2, Depends => L1); + -- pragma Assertion_Level (L3, Depends => L2); + -- + -- When policy Check (or On) is applied to an assertion level, it is also + -- applied to all of its transitive parent levels. For example + -- + -- pragma Assertion_Policy (L3 => Check); + -- + -- applies policy Check to L2 and L1. + -- + -- When policy Ignore (or Off) is applied to an assertion level, it is also + -- applied to all of its transitive child levels. For example + -- + -- pragma Assertion_Policy (L1 => Ignore); + -- + -- applies the policy Ignore for L2 and L3. + -- + -- Note that assertion levels are not allowed to have the same name as any + -- other Assertion_Kind defined in the RM in order to avoid unintentional + -- name overloading. + + -------------------------------------------------- + -- Handling of Assertions with Assertion Levels -- + -------------------------------------------------- + + -- Each Assertion pragma (see Is_Valid_Assertion) supports a new syntax + -- where the existing arguments can be associated with an assertion level. + -- + -- Each association is converted into a new pragma with the same name but + -- without the level argument, and the old pragma is rewritten as N_Null. + -- An applicable policy for those pragmas is calculated by looking at the + -- first active Check_Policy that either matches the pragma name or the + -- name of the Assertion_Level. The following policy-based attributes are + -- set for the given pramga: + -- + -- * Is_Checked - Based on the policy + -- * Is_Ignored - Based on the policy + -- * Is_Disabled - Based on the policy + -- * Pragma_Ghost_Assertion_Level - level associated with the assertion. + -- * Original_Pragma - reference to the original pragma that had the + -- Assertion_Levels. + -- + -- For example, the following pragma: + -- + -- pragma Assert (L1 => (Expr1, "Msg1"), + -- L2 => (Expr2, "Msg2")); + -- + -- is rewritten as: + -- + -- null; -- The original pragma + -- pragma Assert (Expr1, "Msg1"); + -- pragma Assert (Expr2, "Msg2"); + -- + -- Each of the new pragmas is analyzed according to its existing semantic + -- rules. + ---------------------------------------------- -- Common Handling of Import-Export Pragmas -- ---------------------------------------------- @@ -212,6 +327,14 @@ package body Sem_Prag is -- Query whether a particular item appears in a mixed list of nodes and -- entities. It is assumed that all nodes in the list have entities. + procedure Apply_Check_Policy (N : Node_Id; Policy : Name_Id); + -- Set the Is_Checked, Is_Ignored, Is_Disabled attributes on node N + -- based on the Policy. e.g. + -- + -- * When Name_Ignore (or Name_Off) is used the node is marked as ignored. + -- * When Name_Check (or Name_On) is used the node is marked as checked. + -- * When Name_Disable is used the node is marked as disabled. + procedure Check_Postcondition_Use_In_Inlined_Subprogram (Prag : Node_Id; Spec_Id : Entity_Id); @@ -266,6 +389,11 @@ package body Sem_Prag is -- set, the routine reports duplicate pragmas. The routine returns Empty -- when reaching the start of the node chain. + function Get_Applicable_Policy + (Nam : Name_Id; Level : Entity_Id) return Name_Id; + -- Return the name of the Check_Policy applied to the name or the level + -- associated with the node. + function Get_Base_Subprogram (Def_Id : Entity_Id) return Entity_Id; -- If Def_Id refers to a renamed subprogram, then the base subprogram (the -- original one, following the renaming chain) is returned. Otherwise the @@ -281,6 +409,15 @@ package body Sem_Prag is -- Determine whether dependency clause Clause is surrounded by extra -- parentheses. If this is the case, issue an error message. + procedure Mark_Is_Checked (N : Node_Id); + -- Sets Is_Checked and unsets Is_Ignored + + procedure Mark_Is_Disabled (N : Node_Id); + -- Sets Is_Disabled and Is_Ignored and unsets Is_Checked + + procedure Mark_Is_Ignored (N : Node_Id); + -- Sets Is_Ignored and unsets Is_Checked + procedure Record_Possible_Body_Reference (State_Id : Entity_Id; Ref : Node_Id); @@ -4830,16 +4967,10 @@ package body Sem_Prag is (Arg : Node_Id; N1, N2 : Name_Id); procedure Check_Arg_Is_One_Of - (Arg : Node_Id; - N1, N2, N3 : Name_Id); - procedure Check_Arg_Is_One_Of - (Arg : Node_Id; - N1, N2, N3, N4 : Name_Id); - procedure Check_Arg_Is_One_Of - (Arg : Node_Id; - N1, N2, N3, N4, N5 : Name_Id); + (Arg : Node_Id; + Names : Name_List); -- Check the specified argument Arg to make sure that it is an - -- identifier whose name matches either N1 or N2 (or N3, N4, N5 if + -- identifier whose name matches either N1 or N2 (or a list of names is -- present). If not then give error and raise Pragma_Exit. procedure Check_Arg_Is_Queuing_Policy (Arg : Node_Id); @@ -4923,6 +5054,16 @@ package body Sem_Prag is -- Common checks for pragmas that appear within a main program -- (Priority, Main_Storage, Time_Slice, Relative_Deadline, CPU). + procedure Check_Inconsistent_Argument_Ghostliness + (Arg1 : Entity_Id; + Arg2 : Entity_Id; + Ghost_Error_Posted : in out Boolean); + -- Reports an error and sets Ghost_Error_Posted when: + -- * One argument is ghost and the other is not ghost + -- * One argument is checked ghost and the other is ignored ghost + -- + -- Checks are avoided when Ghost_Error_Posted is already set. + procedure Check_Interrupt_Or_Attach_Handler; -- Common processing for first argument of pragma Interrupt_Handler or -- pragma Attach_Handler. @@ -4995,6 +5136,11 @@ package body Sem_Prag is -- presence of at least one component. UU_Typ is the related Unchecked_ -- Union type. + function Create_Pragma_Without_Assertion_Level + (Expr : Node_Id) return Node_Id; + -- Creates a new pragma from an Assertion_Level association argument + -- with the same name as the orignal pragma. + procedure Ensure_Aggregate_Form (Arg : Node_Id); -- Subsidiary routine to the processing of pragmas Abstract_State, -- Contract_Cases, Depends, Exceptional_Cases, Global, Initializes, @@ -5450,6 +5596,19 @@ package body Sem_Prag is -- a class-wide precondition only if one of its ancestors has an -- explicit class-wide precondition. + function Assertion_Level_Pragma_Comes_From_Source + (N : Node_Id) return Boolean + is (Present (Original_Pragma (N)) + and then Present (Original_Node (Original_Pragma (N))) + and then Comes_From_Source (Original_Node (Original_Pragma (N)))); + -- Determine whether a pragma was originally from source and used an + -- assertion level. + -- + -- When the pragma was using an Assertion_Level it was replaced by + -- a new pragma where the Original_Pragma points to the original + -- pragma node which was removed from the tree and replaced by a + -- null node. + ----------------------------- -- Inherits_Class_Wide_Pre -- ----------------------------- @@ -5543,7 +5702,9 @@ package body Sem_Prag is -- rewriting the pragma identifier. This allows the retrieval of the -- original pragma name by routine Original_Aspect_Pragma_Name. - if Comes_From_Source (N) then + if Comes_From_Source (N) + or else Assertion_Level_Pragma_Comes_From_Source (N) + then if Pname in Name_Pre | Name_Pre_Class then Is_Pre_Post := True; Set_Class_Present (N, Pname = Name_Pre_Class); @@ -5687,9 +5848,12 @@ package body Sem_Prag is -- For Ada 2022, pre/postconditions can appear on formal subprograms elsif Nkind (Subp_Decl) = N_Formal_Concrete_Subprogram_Declaration - and then Ada_Version >= Ada_2022 then - null; + if Ada_Version < Ada_2022 then + Error_Msg_Ada_2022_Feature + ("pre/postcondition on formal subprogram", Loc); + raise Pragma_Exit; + end if; -- An access-to-subprogram type can have pre/postconditions, which -- are both analyzed when attached to the type and copied to the @@ -5882,9 +6046,10 @@ package body Sem_Prag is -- Flag set when an error concerning the illegal mix of Ghost and -- non-Ghost variables is emitted. - Ghost_Id : Entity_Id := Empty; - -- The entity of the first Ghost variable encountered while - -- processing the arguments of the pragma. + First_Arg_Id : Entity_Id := Empty; + -- The entity of the first variable encountered while processing the + -- arguments of the pragma. This is used as a reference for assessing + -- the ghostliness of other arguments. begin GNAT_Pragma; @@ -5922,41 +6087,22 @@ package body Sem_Prag is Set_Has_Pragma_Unused (Arg_Id); end if; - -- A pragma that applies to a Ghost entity becomes Ghost for - -- the purposes of legality checks and removal of ignored - -- Ghost code. - - Mark_Ghost_Pragma (N, Arg_Id); - - -- Capture the entity of the first Ghost variable being + -- Capture the entity of the first variable being -- processed for error detection purposes. - if Is_Ghost_Entity (Arg_Id) then - if No (Ghost_Id) then - Ghost_Id := Arg_Id; - end if; - - -- Otherwise the variable is non-Ghost. It is illegal to mix - -- references to Ghost and non-Ghost entities - -- (SPARK RM 6.9). - - elsif Present (Ghost_Id) - and then not Ghost_Error_Posted - then - Ghost_Error_Posted := True; - - Error_Msg_Name_1 := Pname; - Error_Msg_N - ("pragma % cannot mention ghost and non-ghost " - & "variables", N); + if No (First_Arg_Id) then + First_Arg_Id := Arg_Id; - Error_Msg_Sloc := Sloc (Ghost_Id); - Error_Msg_NE ("\& # declared as ghost", N, Ghost_Id); + -- A pragma that applies to a Ghost entity becomes Ghost + -- for the purposes of legality checks and removal of + -- ignored Ghost code. - Error_Msg_Sloc := Sloc (Arg_Id); - Error_Msg_NE ("\& # declared as non-ghost", N, Arg_Id); + Mark_Ghost_Pragma (N, Arg_Id); end if; + Check_Inconsistent_Argument_Ghostliness + (First_Arg_Id, Arg_Id, Ghost_Error_Posted); + -- Warn if already flagged as Unused or Unmodified elsif Has_Pragma_Unmodified (Arg_Id) then @@ -5998,9 +6144,10 @@ package body Sem_Prag is -- Flag set when an error concerning the illegal mix of Ghost and -- non-Ghost names is emitted. - Ghost_Id : Entity_Id := Empty; - -- The entity of the first Ghost name encountered while processing - -- the arguments of the pragma. + First_Arg_Id : Entity_Id := Empty; + -- The entity of the first variable encountered while processing the + -- arguments of the pragma. This is used as a reference for assessing + -- the ghostliness of other arguments. begin GNAT_Pragma; @@ -6063,6 +6210,19 @@ package body Sem_Prag is if Is_Entity_Name (Arg_Expr) then Arg_Id := Entity (Arg_Expr); + -- Capture the entity of the first variable being + -- processed for error detection purposes. + + if No (First_Arg_Id) then + First_Arg_Id := Arg_Id; + + -- A pragma that applies to a Ghost entity becomes Ghost + -- for the purposes of legality checks and removal of + -- ignored Ghost code. + + Mark_Ghost_Pragma (N, Arg_Id); + end if; + -- Warn if already flagged as Unused or Unreferenced and -- skip processing the argument. @@ -6102,36 +6262,8 @@ package body Sem_Prag is Mark_Ghost_Pragma (N, Arg_Id); - -- Capture the entity of the first Ghost name being - -- processed for error detection purposes. - - if Is_Ghost_Entity (Arg_Id) then - if No (Ghost_Id) then - Ghost_Id := Arg_Id; - end if; - - -- Otherwise the name is non-Ghost. It is illegal to mix - -- references to Ghost and non-Ghost entities - -- (SPARK RM 6.9). - - elsif Present (Ghost_Id) - and then not Ghost_Error_Posted - then - Ghost_Error_Posted := True; - - Error_Msg_Name_1 := Pname; - Error_Msg_N - ("pragma % cannot mention ghost and non-ghost " - & "names", N); - - Error_Msg_Sloc := Sloc (Ghost_Id); - Error_Msg_NE - ("\& # declared as ghost", N, Ghost_Id); - - Error_Msg_Sloc := Sloc (Arg_Id); - Error_Msg_NE - ("\& # declared as non-ghost", N, Arg_Id); - end if; + Check_Inconsistent_Argument_Ghostliness + (First_Arg_Id, Arg_Id, Ghost_Error_Posted); end if; end if; @@ -6288,7 +6420,14 @@ package body Sem_Prag is end if; end if; + -- We are going to check the entity that determines the ghost + -- region of that pragma. We need to disable the checks for ghost + -- context since the ghost region can only be set after analyzing + -- this entity. + + Ghost_Context_Checks_Disabled := True; Analyze (Argx); + Ghost_Context_Checks_Disabled := False; if Nkind (Argx) not in N_Direct_Name and then (Nkind (Argx) /= N_Attribute_Reference @@ -6445,45 +6584,18 @@ package body Sem_Prag is end Check_Arg_Is_One_Of; procedure Check_Arg_Is_One_Of - (Arg : Node_Id; - N1, N2, N3 : Name_Id) - is - Argx : constant Node_Id := Get_Pragma_Arg (Arg); - - begin - Check_Arg_Is_Identifier (Argx); - - if Chars (Argx) not in N1 | N2 | N3 then - Error_Pragma_Arg ("invalid argument for pragma%", Argx); - end if; - end Check_Arg_Is_One_Of; - - procedure Check_Arg_Is_One_Of - (Arg : Node_Id; - N1, N2, N3, N4 : Name_Id) + (Arg : Node_Id; + Names : Name_List) is Argx : constant Node_Id := Get_Pragma_Arg (Arg); - begin Check_Arg_Is_Identifier (Argx); - if Chars (Argx) not in N1 | N2 | N3 | N4 then - Error_Pragma_Arg ("invalid argument for pragma%", Argx); + if (for some Name of Names => Chars (Argx) = Name) then + return; end if; - end Check_Arg_Is_One_Of; - - procedure Check_Arg_Is_One_Of - (Arg : Node_Id; - N1, N2, N3, N4, N5 : Name_Id) - is - Argx : constant Node_Id := Get_Pragma_Arg (Arg); - begin - Check_Arg_Is_Identifier (Argx); - - if Chars (Argx) not in N1 | N2 | N3 | N4 | N5 then - Error_Pragma_Arg ("invalid argument for pragma%", Argx); - end if; + Error_Pragma_Arg ("invalid argument for pragma%", Argx); end Check_Arg_Is_One_Of; --------------------------------- @@ -6881,6 +6993,91 @@ package body Sem_Prag is end if; end Check_In_Main_Program; + --------------------------------------------- + -- Check_Inconsistent_Argument_Ghostliness -- + --------------------------------------------- + + procedure Check_Inconsistent_Argument_Ghostliness + (Arg1 : Entity_Id; + Arg2 : Entity_Id; + Ghost_Error_Posted : in out Boolean) + is + + procedure Report_Ghost_Argument_Mismatch + (Ghost_Arg : Entity_Id; Non_Ghost_Arg : Entity_Id); + -- Constructs an error message when both a ghost and a non-ghost + -- argument are used in the same pragma. + + procedure Report_Ghost_Policy_Mismatch + (Checked_Arg : Entity_Id; Ignored_Arg : Entity_Id); + -- Constructs an error message when both a checked ghost and an + -- ignored ghost argument are used in the same pragma. + + ------------------------------------ + -- Report_Ghost_Argument_Mismatch -- + ------------------------------------ + + procedure Report_Ghost_Argument_Mismatch + (Ghost_Arg : Entity_Id; Non_Ghost_Arg : Entity_Id) is + + begin + Error_Msg_Name_1 := Pname; + Error_Msg_N + ("pragma % cannot mention ghost and non-ghost " & "variables", + N); + + Error_Msg_Sloc := Sloc (Ghost_Arg); + Error_Msg_NE ("\& # declared as ghost", N, Ghost_Arg); + + Error_Msg_Sloc := Sloc (Non_Ghost_Arg); + Error_Msg_NE ("\& # declared as non-ghost", N, Non_Ghost_Arg); + end Report_Ghost_Argument_Mismatch; + + ---------------------------------- + -- Report_Ghost_Policy_Mismatch -- + ---------------------------------- + + procedure Report_Ghost_Policy_Mismatch + (Checked_Arg : Entity_Id; Ignored_Arg : Entity_Id) is + + begin + Error_Msg_Name_1 := Pname; + Error_Msg_N + ("pragma % cannot mention checked ghost and ignored ghost " + & "variables", + N); + + Error_Msg_Sloc := Sloc (Checked_Arg); + Error_Msg_NE + ("\& # declared with a checked policy", N, Checked_Arg); + + Error_Msg_Sloc := Sloc (Ignored_Arg); + Error_Msg_NE + ("\& # declared with an ignored policy", N, Ignored_Arg); + end Report_Ghost_Policy_Mismatch; + begin + if Ghost_Error_Posted then + null; + elsif Is_Ghost_Entity (Arg1) and then not Is_Ghost_Entity (Arg2) then + Report_Ghost_Argument_Mismatch (Arg1, Arg2); + Ghost_Error_Posted := True; + elsif not Is_Ghost_Entity (Arg1) and then Is_Ghost_Entity (Arg2) + then + Report_Ghost_Argument_Mismatch (Arg2, Arg1); + Ghost_Error_Posted := True; + elsif Is_Checked_Ghost_Entity (Arg1) + and then Is_Ignored_Ghost_Entity (Arg2) + then + Report_Ghost_Policy_Mismatch (Arg1, Arg2); + Ghost_Error_Posted := True; + elsif Is_Ignored_Ghost_Entity (Arg1) + and then Is_Checked_Ghost_Entity (Arg2) + then + Report_Ghost_Policy_Mismatch (Arg2, Arg1); + Ghost_Error_Posted := True; + end if; + end Check_Inconsistent_Argument_Ghostliness; + --------------------------------------- -- Check_Interrupt_Or_Attach_Handler -- --------------------------------------- @@ -6899,12 +7096,14 @@ package body Sem_Prag is Handler_Proc := Find_Unique_Parameterless_Procedure (Arg1_X, Arg1); Proc_Scope := Scope (Handler_Proc); - if Ekind (Proc_Scope) /= E_Protected_Type then + if Nkind (Parent (Subprogram_Spec (Handler_Proc))) /= + N_Protected_Definition + then Error_Pragma_Arg ("argument of pragma% must be protected procedure", Arg1); end if; - -- For pragma case (as opposed to access case), check placement. + -- For pragma case (as opposed to aspect case), check placement. -- We don't need to do that for aspects, because we have the -- check that they aspect applies an appropriate procedure. @@ -7602,6 +7801,114 @@ package body Sem_Prag is end loop; end Check_Variant; + ------------------------------------------- + -- Create_Pragma_Without_Assertion_Level -- + ------------------------------------------- + + function Create_Pragma_Without_Assertion_Level + (Expr : Node_Id) return Node_Id + is + function Aggregate_To_Associations (N : Node_Id) return List_Id; + -- Converts an Aggregate into a list of + -- Pragma_Argument_Associations. + + procedure Validate_Assertion_Level_Aggregate (N : Node_Id); + -- Handle invalid syntax scenarios for an Aggregate containing + -- Assertion_Levels. + + ------------------------------- + -- Aggregate_To_Associations -- + ------------------------------- + + function Aggregate_To_Associations (N : Node_Id) return List_Id is + Args : constant List_Id := New_List; + Comp_Assn : Node_Id; + Comp_Expr : Node_Id; + Comp_Expr_Repl : Node_Id; + Choice : Node_Id; + begin + pragma Assert (Nkind (N) = N_Aggregate); + Validate_Assertion_Level_Aggregate (N); + + Comp_Expr := First (Expressions (N)); + while Present (Comp_Expr) loop + -- Remove the expression from the list so that it can be + -- inserted into the new Pragma_Argument_Association. + + Comp_Expr_Repl := Comp_Expr; + Next (Comp_Expr); + Remove (Comp_Expr_Repl); + Append_To + (Args, + Make_Pragma_Argument_Association + (Sloc (Comp_Expr_Repl), + Expression => Comp_Expr_Repl)); + end loop; + + Comp_Assn := First (Component_Associations (N)); + while Present (Comp_Assn) loop + Choice := First (Choices (Comp_Assn)); + Append_To + (Args, + Make_Pragma_Argument_Association + (Sloc (Comp_Assn), + Chars => Chars (Choice), + Expression => Expression (Comp_Assn))); + Next (Comp_Assn); + end loop; + return Args; + end Aggregate_To_Associations; + + ---------------------------------------- + -- Validate_Assertion_Level_Aggregate -- + ---------------------------------------- + + procedure Validate_Assertion_Level_Aggregate (N : Node_Id) is + Comp_Assn : Node_Id; + Choice : Node_Id; + begin + Comp_Assn := First (Component_Associations (N)); + while Present (Comp_Assn) loop + if List_Length (Choices (Comp_Assn)) /= 1 then + Error_Pragma_Arg + ("only one Assertion_Level can be associated " + & "with an expression", + Comp_Assn); + end if; + + Choice := First (Choices (Comp_Assn)); + + if Nkind (Choice) /= N_Identifier then + Error_Pragma_Arg + ("\association must denote an Assertion_Level", Comp_Assn); + end if; + Next (Comp_Assn); + end loop; + end Validate_Assertion_Level_Aggregate; + + -- Local variables + + Args : List_Id; + + -- Start of proessing for Create_Pragma_Without_Assertion_Level + + begin + if Nkind (Expr) in N_Aggregate then + Validate_Assertion_Level_Aggregate (Expr); + Args := Aggregate_To_Associations (Expr); + else + Args := + New_List + (Make_Pragma_Argument_Association (Sloc (Expr), + Expression => Expr)); + end if; + + return + Make_Pragma (Sloc (N), + Chars => Pname, + Pragma_Argument_Associations => Args); + end Create_Pragma_Without_Assertion_Level; + --------------------------- -- Ensure_Aggregate_Form -- --------------------------- @@ -8531,6 +8838,8 @@ package body Sem_Prag is Check_Arg_Is_OK_Static_Expression (Arg2, Standard_String); Analyze_And_Resolve (Arg1x, Standard_Boolean); + Mark_Ghost_Pragma (N, Current_Scope); + if CodePeer_Mode then Rewrite (N, Make_Null_Statement (Loc)); return; @@ -8985,8 +9294,15 @@ package body Sem_Prag is Check_Optional_Identifier (Arg2, Name_Entity); Check_Arg_Is_Local_Name (Arg2); + -- We are going to check the entity that determines the ghost + -- region of that pragma. We need to disable the checks for ghost + -- context since the ghost region can only be set after analyzing + -- this entity. + + Ghost_Context_Checks_Disabled := True; Id := Get_Pragma_Arg (Arg2); Analyze (Id); + Ghost_Context_Checks_Disabled := False; if not Is_Entity_Name (Id) then Error_Pragma_Arg ("entity name required", Arg2); @@ -10438,9 +10754,10 @@ package body Sem_Prag is -- Flag set when an error concerning the illegal mix of Ghost and -- non-Ghost subprograms is emitted. - Ghost_Id : Entity_Id := Empty; - -- The entity of the first Ghost subprogram encountered while - -- processing the arguments of the pragma. + First_Arg_Id : Entity_Id := Empty; + -- The entity of the first variable encountered while processing the + -- arguments of the pragma. This is used as a reference for assessing + -- the ghostliness of other arguments. procedure Check_Inline_Always_Placement (Spec_Id : Entity_Id); -- Verify the placement of pragma Inline_Always with respect to the @@ -10928,36 +11245,21 @@ package body Sem_Prag is end if; end case; - -- A pragma that applies to a Ghost entity becomes Ghost for the - -- purposes of legality checks and removal of ignored Ghost code. - - Mark_Ghost_Pragma (N, Subp); - - -- Capture the entity of the first Ghost subprogram being + -- Capture the entity of the first variable being -- processed for error detection purposes. - if Is_Ghost_Entity (Subp) then - if No (Ghost_Id) then - Ghost_Id := Subp; - end if; - - -- Otherwise the subprogram is non-Ghost. It is illegal to mix - -- references to Ghost and non-Ghost entities (SPARK RM 6.9). + if No (First_Arg_Id) then + First_Arg_Id := Subp; - elsif Present (Ghost_Id) and then not Ghost_Error_Posted then - Ghost_Error_Posted := True; + -- A pragma that applies to a Ghost entity becomes Ghost + -- for the purposes of legality checks and removal of + -- ignored Ghost code. - Error_Msg_Name_1 := Pname; - Error_Msg_N - ("pragma % cannot mention ghost and non-ghost subprograms", - N); - - Error_Msg_Sloc := Sloc (Ghost_Id); - Error_Msg_NE ("\& # declared as ghost", N, Ghost_Id); - - Error_Msg_Sloc := Sloc (Subp); - Error_Msg_NE ("\& # declared as non-ghost", N, Subp); + Mark_Ghost_Pragma (N, Subp); end if; + + Check_Inconsistent_Argument_Ghostliness + (First_Arg_Id, Subp, Ghost_Error_Posted); end Set_Inline_Flags; -- Start of processing for Process_Inline @@ -11786,7 +12088,15 @@ package body Sem_Prag is Check_Optional_Identifier (Arg2, Name_On); E_Id := Get_Pragma_Arg (Arg2); + + -- We are going to check the entity that determines the ghost + -- region of that pragma. We need to disable the checks for ghost + -- context since the ghost region can only be set after analyzing + -- this entity. + + Ghost_Context_Checks_Disabled := True; Analyze (E_Id); + Ghost_Context_Checks_Disabled := False; if not Is_Entity_Name (E_Id) then Error_Pragma_Arg @@ -12336,6 +12646,13 @@ package body Sem_Prag is end Set_Ravenscar_Profile; + -- Local variables + + Assoc : Node_Id; + Last_Prag : Node_Id; + Level : Entity_Id; + Sub_Prag : Node_Id; + -- Start of processing for Analyze_Pragma begin @@ -12370,7 +12687,11 @@ package body Sem_Prag is -- Deal with unrecognized pragma - if not Is_Pragma_Name (Pname) then + -- Pragma Unsigned_Base_Range temporarily disabled + + if not Is_Pragma_Name (Pname) + or else Pname = Name_Unsigned_Base_Range + then declare Msg_Issued : Boolean := False; begin @@ -12429,8 +12750,7 @@ package body Sem_Prag is elsif Is_Rewrite_Substitution (N) and then Nkind (Original_Node (N)) = N_Pragma then - Set_Is_Ignored (N, Is_Ignored (Original_Node (N))); - Set_Is_Checked (N, Is_Checked (Original_Node (N))); + Set_Pragma_Ghost_Assertion_Level (N, Original_Node (N)); -- Skip querying the applicable policy at this point for dynamic -- predicate checks since they rely on the policy applicable in @@ -12446,22 +12766,67 @@ package body Sem_Prag is -- Otherwise query the applicable policy at this point - else - Check_Applicable_Policy (N); + elsif Is_Valid_Assertion_Kind (Pname) then + -- If the pragma is using Assertion_Level associations, analyze the + -- applicable policies for that pragma and then convert it into a + -- pragma without assertion levels. Analyze the new pragma with + -- policy-related attributes (Is_Checked/Is_Ignored/Is_Disabled) + -- already set. - -- If pragma is disabled, rewrite as NULL and skip analysis + if Has_Assertion_Level_Argument (N) then + Assoc := First (Pragma_Argument_Associations (N)); + Last_Prag := N; + while Present (Assoc) loop + Level := Get_Assertion_Level (Chars (Assoc)); + Sub_Prag := + Create_Pragma_Without_Assertion_Level (Expression (Assoc)); + + -- Set policy based attributes based on the pragma name and the + -- assertion level. + + Check_Applicable_Policy (Sub_Prag, Level); + + -- Store the Level on the pragma node for easier access + + Set_Pragma_Ghost_Assertion_Level (Sub_Prag, Level); + + -- Store the Original_Pragma for the detection of + -- duplicates. + + Set_Original_Pragma (Sub_Prag, N); + + -- Insert the created pragmas in the same order after the + -- original pragma and analyze them later. + + Insert_After (Last_Prag, Sub_Prag); + Last_Prag := Sub_Prag; + + Next (Assoc); + end loop; + + -- Remove the original pragma and continue processing all + -- of the new sub-pragmas. - if Is_Disabled (N) then Rewrite (N, Make_Null_Statement (Loc)); Analyze (N); raise Pragma_Exit; + + -- Otherwise apply the policy based attributes based on the pragma + -- name. + + else + Check_Applicable_Policy (N, Empty); + Set_Pragma_Ghost_Assertion_Level + (N, Standard_Level_Default); end if; end if; - -- Mark assertion pragmas as Ghost depending on their enclosing context + -- If the pragma is disabled, rewrite it as NULL and skip its analysis - if Assertion_Expression_Pragma (Prag_Id) then - Mark_Ghost_Pragma (N, Current_Scope); + if Is_Disabled (N) then + Rewrite (N, Make_Null_Statement (Loc)); + Analyze (N); + raise Pragma_Exit; end if; -- Preset arguments @@ -12929,7 +13294,7 @@ package body Sem_Prag is procedure Check_Ghost_Synchronous is begin -- A synchronized abstract state cannot be Ghost and vice - -- versa (SPARK RM 6.9(21)). + -- versa (SPARK RM 6.9(22)). if Ghost_Seen and Synchronous_Seen then SPARK_Msg_N ("synchronized state cannot be ghost", State); @@ -13090,6 +13455,12 @@ package body Sem_Prag is if Present (State_Id) then Set_Is_Ghost_Entity (State_Id); + + -- Amend the Assertion_Level coming from the + -- package. + + Set_Ghost_Assertion_Level + (State_Id, Standard_Level_Default); end if; -- Synchronous @@ -13170,7 +13541,26 @@ package body Sem_Prag is elsif Chars (Opt_Nam) = Name_Part_Of then Analyze_Part_Of_Option (Opt); + elsif Chars (Opt_Nam) = Name_Ghost then + Check_Duplicate_Option (Opt, Ghost_Seen); + Check_Ghost_Synchronous; + + if Present (State_Id) then + Set_Is_Ghost_Entity (State_Id); + + -- Amend the Assertion_Level coming from the + -- package. + if Nkind (Expression (Opt)) /= N_Identifier then + Error_Pragma_Arg + ("level name must be an identifier", N); + end if; + + Set_Ghost_Assertion_Level + (State_Id, + Get_Assertion_Level + (Chars (Expression (Opt)))); + end if; else SPARK_Msg_N ("invalid state option", Opt); end if; @@ -13837,6 +14227,9 @@ package body Sem_Prag is Expr : Node_Id; Nam_Arg : Node_Id; + Saved_Ghost_Config : constant Ghost_Config_Type := Ghost_Config; + -- Save the Ghost-related attributes to restore on exit + -------------------------- -- Inferred_String_Type -- -------------------------- @@ -13914,6 +14307,10 @@ package body Sem_Prag is end if; end if; + -- Set the ghost mode before analyzing all of the arguments + + Set_Ghost_Mode (N); + -- Continue the processing with last argument removed for now Check_Arg_Is_Identifier (Arg1); @@ -13959,6 +14356,8 @@ package body Sem_Prag is Next (Arg); end loop; end if; + + Restore_Ghost_Region (Saved_Ghost_Config); end Annotate; ------------------------------------------------- @@ -14022,8 +14421,13 @@ package body Sem_Prag is -- Local variables - Expr : Node_Id; - New_Args : List_Id; + Args : Args_List (1 .. 2); + Arg_Check : Node_Id renames Args (1); + Arg_Message : Node_Id renames Args (2); + Check_Prag : Node_Id; + New_Args : List_Id; + Names : constant Name_List (1 .. 2) := + (Name_Check, Name_Message); -- Start of processing for Assert @@ -14041,25 +14445,32 @@ package body Sem_Prag is Check_At_Least_N_Arguments (1); Check_At_Most_N_Arguments (2); - Check_Arg_Order ((Name_Check, Name_Message)); - Check_Optional_Identifier (Arg1, Name_Check); - Expr := Get_Pragma_Arg (Arg1); + Gather_Associations (Names, Args); + Check_Arg_Order (Names); + Mark_Ghost_Pragma (N, Current_Scope); -- Special processing for Loop_Invariant, Loop_Variant or for -- other cases where a Loop_Entry attribute is present. If the -- assertion pragma contains attribute Loop_Entry, ensure that -- the related pragma is within a loop. - if Prag_Id = Pragma_Loop_Invariant + if Prag_Id = Pragma_Loop_Invariant or else Prag_Id = Pragma_Loop_Variant - or else Contains_Loop_Entry (Expr) + or else Contains_Loop_Entry (Arg_Check) then Check_Loop_Pragma_Placement; -- Perform preanalysis to deal with embedded Loop_Entry -- attributes. + -- + -- But ignore the ghost context checks for now. The expression + -- will be reanalyzed with the correct ghost region once the + -- pragma has been converted to pragma check. - Preanalyze_And_Resolve_Assert_Expression (Expr, Any_Boolean); + Ghost_Context_Checks_Disabled := True; + Preanalyze_And_Resolve_Assert_Expression + (Arg_Check, Any_Boolean); + Ghost_Context_Checks_Disabled := False; end if; -- Implement Assert[_And_Cut]/Assume/Loop_Invariant by generating @@ -14079,30 +14490,186 @@ package body Sem_Prag is New_Args := New_List ( Make_Pragma_Argument_Association (Loc, Expression => Make_Identifier (Loc, Pname)), - Make_Pragma_Argument_Association (Sloc (Expr), - Expression => Expr)); + Make_Pragma_Argument_Association (Sloc (Arg_Check), + Expression => Arg_Check)); - if Arg_Count > 1 then - Check_Optional_Identifier (Arg2, Name_Message); + if Present (Arg_Message) then -- Provide semantic annotations for optional argument, for -- ASIS use, before rewriting. -- Is this still needed??? - Preanalyze_And_Resolve (Expression (Arg2), Standard_String); + Preanalyze_And_Resolve (Arg_Message, Standard_String); Append_To (New_Args, New_Copy_Tree (Arg2)); end if; -- Rewrite as Check pragma - Rewrite (N, - Make_Pragma (Loc, - Chars => Name_Check, - Pragma_Argument_Associations => New_Args)); + Check_Prag := + Make_Pragma + (Loc, + Chars => Name_Check, + Pragma_Argument_Associations => New_Args); + Copy_Assertion_Policy_Attributes (Check_Prag, N); + Rewrite (N, Check_Prag); Analyze (N); end Assert; + --------------------- + -- Assertion_Level -- + --------------------- + + -- pragma Assertion_Level (LEVEL_IDENTIFIER + -- [, depends => DEPENDENCY_DESCRIPTOR]); + -- + -- DEPENDENCY_DESCRIPTOR ::= LEVEL_IDENTIFIER | LEVEL_IDENTIFIER_LIST + -- + -- LEVEL_IDENTIFIER_LIST ::= '[' LEVEL_IDENTIFIER + -- {, LEVEL_IDENTIFIER} ']' + + when Pragma_Assertion_Level => Assertion_Level : declare + procedure Add_Dependencies + (Level : Entity_Id; Parent_Level : Entity_Id); + -- Adds the following dependencies: + -- * Adds Parent_Level to the Parent_Levels of Level + -- * Adds Level to the Child_Levels of Parent_Level + + procedure Check_Known_Level_Name + (Level : Entity_Id; Ref : Node_Id); + -- Raise an error if the level has not be declared before + + procedure Check_Valid_Level_Name (Nam : Name_Id); + -- Raise an error if the name matches a valid assertion kind. + -- + -- This is to avoid the ambigiouty in Assertion_Policy if either + -- the level or the assertion kind is affected by the policy. + + procedure Check_Valid_Level_Node (N : Node_Id); + -- Raise an error if the node is not a simple identifier + + ---------------------- + -- Add_Dependencies -- + ---------------------- + + procedure Add_Dependencies + (Level : Entity_Id; Parent_Level : Entity_Id) + is + Parent_Level_List : Elist_Id; + Child_Levels_List : Elist_Id; + begin + if No (Parent_Levels (Level)) then + Set_Parent_Levels (Level, New_Elmt_List); + end if; + Parent_Level_List := Parent_Levels (Level); + Append_Elmt (Parent_Level, Parent_Level_List); + + if No (Child_Levels (Parent_Level)) then + Set_Child_Levels (Parent_Level, New_Elmt_List); + end if; + Child_Levels_List := Child_Levels (Parent_Level); + Append_Elmt (Level, Child_Levels_List); + end Add_Dependencies; + + ---------------------------- + -- Check_Known_Level_Name -- + ---------------------------- + + procedure Check_Known_Level_Name + (Level : Entity_Id; Ref : Node_Id) is + begin + if No (Level) then + Error_Msg_Name_1 := Chars (Ref); + Error_Msg_N ("unknown assertion level &", Ref); + raise Pragma_Exit; + end if; + end Check_Known_Level_Name; + + ---------------------------- + -- Check_Valid_Level_Name -- + ---------------------------- + + procedure Check_Valid_Level_Name (Nam : Name_Id) is + begin + if Is_Valid_Assertion_Kind (Nam) then + Error_Pragma_Arg + ("level name cannot match an assertion kind", Arg1); + end if; + end Check_Valid_Level_Name; + + ---------------------------- + -- Check_Valid_Level_Node -- + ---------------------------- + + procedure Check_Valid_Level_Node (N : Node_Id) is + begin + if Nkind (N) /= N_Identifier then + Error_Pragma_Arg ("level name must be an identifier", N); + end if; + end Check_Valid_Level_Node; + + -- Local variables + + Dep : Node_Id; + Dep_Id : Entity_Id; + Dep_Arg : Node_Id; + Level_Arg : Node_Id; + Level_Id : Entity_Id; + Level_Nam : Name_Id; + + -- Start of processing for Pragma_Assertion_Level + + begin + GNAT_Pragma; + Check_Valid_Configuration_Pragma; + Check_At_Least_N_Arguments (1); + Check_At_Most_N_Arguments (2); + + Check_No_Identifier (Arg1); + + Level_Arg := Expression (Arg1); + Check_Valid_Level_Node (Level_Arg); + + Level_Nam := Chars (Level_Arg); + Check_Valid_Level_Name (Level_Nam); + + Level_Id := Make_Assertion_Level (Loc, Level_Nam); + + Set_Parent (Level_Id, Level_Arg); + Set_Entity (Level_Arg, Level_Id); + + if Arg_Count = 2 then + Check_Identifier (Arg2, Name_Depends); + + Dep_Arg := Expression (Arg2); + + if Nkind (Dep_Arg) = N_Identifier then + Dep_Id := Get_Assertion_Level (Chars (Dep_Arg)); + Check_Known_Level_Name (Dep_Id, Dep_Arg); + Add_Dependencies (Level_Id, Dep_Id); + elsif Nkind (Dep_Arg) = N_Aggregate then + Dep := First (Expressions (Dep_Arg)); + while Present (Dep) loop + Check_Valid_Level_Node (Dep); + Dep_Id := Get_Assertion_Level (Chars (Dep)); + Check_Known_Level_Name (Dep_Id, Dep); + Add_Dependencies (Level_Id, Dep_Id); + + Next (Dep); + end loop; + else + Error_Pragma_Arg + ("depends argument must be either " + & "an identifier or " + & "an aggregate of identifiers", Dep_Arg); + end if; + end if; + + -- Register the new Assertion_Level + + Insert_Assertion_Level (Level_Id); + end Assertion_Level; + ---------------------- -- Assertion_Policy -- ---------------------- @@ -14115,7 +14682,9 @@ package body Sem_Prag is -- ASSERTION_KIND => POLICY_IDENTIFIER -- {, ASSERTION_KIND => POLICY_IDENTIFIER}); - -- ASSERTION_KIND ::= RM_ASSERTION_KIND | ID_ASSERTION_KIND + -- ASSERTION_KIND ::= RM_ASSERTION_KIND | + -- ID_ASSERTION_KIND | + -- LEVEL_IDENTIFIER -- RM_ASSERTION_KIND ::= Assert | -- Static_Predicate | @@ -14194,8 +14763,13 @@ package body Sem_Prag is -- Local variables + Policy_Names : constant Name_List := + (Name_Check, Name_Disable, Name_Ignore, Name_Suppressible); + Arg : Node_Id; + Id : Node_Id; Kind : Name_Id; + Level : Entity_Id; LocP : Source_Ptr; Policy : Node_Id; @@ -14222,8 +14796,7 @@ package body Sem_Prag is and then (Nkind (Arg1) /= N_Pragma_Argument_Association or else Chars (Arg1) = No_Name) then - Check_Arg_Is_One_Of (Arg1, - Name_Check, Name_Disable, Name_Ignore, Name_Suppressible); + Check_Arg_Is_One_Of (Arg1, Policy_Names); Resolve_Suppressible (Arg1); @@ -14272,22 +14845,45 @@ package body Sem_Prag is -- Check Kind and Policy have allowed forms Kind := Chars (Arg); + Id := Make_Identifier (LocP, Kind); Policy := Get_Pragma_Arg (Arg); if not Is_Valid_Assertion_Kind (Kind) then - Error_Pragma_Arg - ("invalid assertion kind for pragma%", Arg); + Set_Entity (Id, Get_Assertion_Level (Kind)); + Level := Entity (Id); + if No (Level) + or else Ekind (Level) /= E_Assertion_Level + then + Error_Pragma_Arg + ("invalid assertion kind for pragma%", + Arg); + end if; + + -- An Assertion_Policy pragma specifying an + -- Assertion_Level policy shall not occur within a ghost + -- subprogram or package associated to an assertion level + -- which depends on this level (SPARK RM 6.9(19)). + + if Ghost_Config.Ghost_Mode > None + and then Is_Same_Or_Depends_On_Level + (Ghost_Config.Ghost_Mode_Assertion_Level, + Level) + then + Error_Msg_Name_2 := Chars (Level); + Error_Pragma + ("pragma % cannot appear within ghost subprogram or " + & "package that depends on %"); + end if; end if; - Check_Arg_Is_One_Of (Arg, - Name_Check, Name_Disable, Name_Ignore, Name_Suppressible); + Check_Arg_Is_One_Of (Arg, Policy_Names); Resolve_Suppressible (Arg); if Kind = Name_Ghost then -- The Ghost policy must be either Check or Ignore - -- (SPARK RM 6.9(6)). + -- (SPARK RM 6.9(8)). if Chars (Policy) not in Name_Check | Name_Ignore then Error_Pragma_Arg @@ -14297,7 +14893,7 @@ package body Sem_Prag is -- Pragma Assertion_Policy specifying a Ghost policy -- cannot occur within a Ghost subprogram or package - -- (SPARK RM 6.9(16)). + -- (SPARK RM 6.9(19)). if Ghost_Config.Ghost_Mode > None then Error_Pragma @@ -14321,7 +14917,7 @@ package body Sem_Prag is Chars => Name_Check_Policy, Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (LocP, - Expression => Make_Identifier (LocP, Kind)), + Expression => Id), Make_Pragma_Argument_Association (LocP, Expression => Policy)))); @@ -14545,6 +15141,7 @@ package body Sem_Prag is Check_Ada_83_Warning; Check_No_Identifiers; Check_Arg_Count (1); + Check_Arg_Is_Local_Name (Arg1); if Debug_Flag_U then @@ -14552,8 +15149,16 @@ package body Sem_Prag is end if; C_Ent := Cunit_Entity (Current_Sem_Unit); + + -- We are going to check the entity that determines the ghost + -- region of that pragma. We need to disable the checks for ghost + -- context since the ghost region can only be set after analyzing + -- this entity. + + Ghost_Context_Checks_Disabled := True; Analyze (Get_Pragma_Arg (Arg1)); Nm := Entity (Get_Pragma_Arg (Arg1)); + Ghost_Context_Checks_Disabled := False; -- A pragma that applies to a Ghost entity becomes Ghost for the -- purposes of legality checks and removal of ignored Ghost code. @@ -14864,12 +15469,10 @@ package body Sem_Prag is pragma Assert (Has_Dynamic_Predicate_Aspect (Typ)); if not Predicates_Ignored (Typ) then - Set_Is_Checked (N, True); - Set_Is_Ignored (N, False); + Mark_Is_Checked (N); else - Set_Is_Checked (N, False); - Set_Is_Ignored (N, True); + Mark_Is_Ignored (N); end if; end Handle_Dynamic_Predicate_Check; @@ -14879,11 +15482,16 @@ package body Sem_Prag is Saved_Ghost_Config : constant Ghost_Config_Type := Ghost_Config; -- Save the Ghost-related attributes to restore on exit + Names : constant Name_List (1 .. 3) := + (Name_Name, Name_Check, Name_Message); + + Args : Args_List (1 .. 3); + Arg_Name : Node_Id renames Args (1); + Arg_Check : Node_Id renames Args (2); + Arg_Message : Node_Id renames Args (3); + Cname : Name_Id; Eloc : Source_Ptr; - Expr : Node_Id; - Str : Node_Id; - pragma Warnings (Off, Str); -- Start of processing for Pragma_Check @@ -14892,22 +15500,19 @@ package body Sem_Prag is -- the mode now to ensure that any nodes generated during analysis -- and expansion are marked as Ghost. + Mark_Ghost_Pragma (N, Current_Scope); + Set_Ghost_Mode (N); GNAT_Pragma; Check_At_Least_N_Arguments (2); Check_At_Most_N_Arguments (3); - Check_Optional_Identifier (Arg1, Name_Name); - Check_Optional_Identifier (Arg2, Name_Check); - if Arg_Count = 3 then - Check_Optional_Identifier (Arg3, Name_Message); - Str := Get_Pragma_Arg (Arg3); - end if; + Gather_Associations (Names, Args); - Rewrite_Assertion_Kind (Get_Pragma_Arg (Arg1)); - Check_Arg_Is_Identifier (Arg1); - Cname := Chars (Get_Pragma_Arg (Arg1)); + Rewrite_Assertion_Kind (Arg_Name); + Check_Arg_Is_Identifier (Arg_Name); + Cname := Chars (Arg_Name); -- Check forbidden name Assertions or Statement_Assertions @@ -14915,12 +15520,12 @@ package body Sem_Prag is when Name_Assertions => Error_Pragma_Arg ("""Assertions"" is not allowed as a check kind for " - & "pragma%", Arg1); + & "pragma%", Arg_Name); when Name_Statement_Assertions => Error_Pragma_Arg ("""Statement_Assertions"" is not allowed as a check kind " - & "for pragma%", Arg1); + & "for pragma%", Arg_Name); when others => null; @@ -14938,8 +15543,7 @@ package body Sem_Prag is elsif Is_Rewrite_Substitution (N) and then Nkind (Original_Node (N)) = N_Pragma then - Set_Is_Ignored (N, Is_Ignored (Original_Node (N))); - Set_Is_Checked (N, Is_Checked (Original_Node (N))); + Copy_Assertion_Policy_Attributes (N, Original_Node (N)); -- Internally added dynamic predicate checks require checking the -- applicable policy at the point of the type declaration of their @@ -14954,34 +15558,18 @@ package body Sem_Prag is -- Otherwise query the applicable policy at this point else - case Check_Kind (Cname) is - when Name_Ignore => - Set_Is_Ignored (N, True); - Set_Is_Checked (N, False); - - when Name_Check => - Set_Is_Ignored (N, False); - Set_Is_Checked (N, True); - - -- For disable, rewrite pragma as null statement and skip - -- rest of the analysis of the pragma. + Apply_Check_Policy (N, Get_Applicable_Policy (Cname, Empty)); - when Name_Disable => - Rewrite (N, Make_Null_Statement (Loc)); - Analyze (N); - raise Pragma_Exit; + -- For disable, rewrite pragma as null statement and skip + -- rest of the analysis of the pragma. - -- No other possibilities - - when others => - raise Program_Error; - end case; + if Is_Disabled (N) then + Rewrite (N, Make_Null_Statement (Loc)); + Analyze (N); + raise Pragma_Exit; + end if; end if; - -- If check kind was not Disable, then continue pragma analysis - - Expr := Get_Pragma_Arg (Arg2); - -- Mark the pragma (or, if rewritten from an aspect, the original -- aspect) as enabled. Nothing to do for an internally generated -- check for a dynamic predicate. @@ -15005,8 +15593,8 @@ package body Sem_Prag is -- expression is only evaluated if the check fails and -- Assertion_Error is to be raised. - if Arg_Count = 3 then - Preanalyze_And_Resolve (Str, Standard_String); + if Present (Arg_Message) then + Preanalyze_And_Resolve (Arg_Message, Standard_String); end if; -- Now you might think we could just do the same with the Boolean @@ -15035,14 +15623,14 @@ package body Sem_Prag is -- warning when we delete the if statement. if Expander_Active and Is_Ignored_In_Codegen (N) then - Eloc := Sloc (Expr); + Eloc := Sloc (Arg_Check); Rewrite (N, Make_If_Statement (Eloc, Condition => Make_And_Then (Eloc, Left_Opnd => Make_Identifier (Eloc, Name_False), - Right_Opnd => Expr), + Right_Opnd => Arg_Check), Then_Statements => New_List ( Make_Null_Statement (Eloc)))); @@ -15083,7 +15671,7 @@ package body Sem_Prag is else In_Assertion_Expr := In_Assertion_Expr + 1; - Analyze_And_Resolve (Expr, Any_Boolean); + Analyze_And_Resolve (Arg_Check, Any_Boolean); In_Assertion_Expr := In_Assertion_Expr - 1; end if; @@ -15157,7 +15745,90 @@ package body Sem_Prag is -- new form syntax. when Pragma_Check_Policy => Check_Policy : declare - Kind : Node_Id; + procedure Get_All_Child_Levels + (Level : Entity_Id; + Deps : in out Elist_Id); + -- Add all of the transitive children of the given Level to the + -- Deps list. + + procedure Get_All_Parent_Levels + (Level : Entity_Id; + Deps : in out Elist_Id); + -- Add all of the transitive parents of the given Level to the + -- Deps list. + + -------------------------- + -- Get_All_Child_Levels -- + -------------------------- + + procedure Get_All_Child_Levels + (Level : Entity_Id; + Deps : in out Elist_Id) + is + It : Elmt_Id; + Child_Lvl : Entity_Id; + begin + if No (Child_Levels (Level)) then + return; + end if; + + It := First_Elmt (Child_Levels (Level)); + while Present (It) loop + Child_Lvl := Node (It); + if not Contains (Deps, Child_Lvl) then + Append_New_Elmt (Child_Lvl, Deps); + Get_All_Child_Levels (Child_Lvl, Deps); + end if; + + Next_Elmt (It); + end loop; + end Get_All_Child_Levels; + + --------------------------- + -- Get_All_Parent_Levels -- + --------------------------- + + procedure Get_All_Parent_Levels + (Level : Entity_Id; + Deps : in out Elist_Id) + is + It : Elmt_Id; + D : Entity_Id; + begin + if No (Parent_Levels (Level)) then + return; + end if; + + It := First_Elmt (Parent_Levels (Level)); + while Present (It) loop + D := Node (It); + + if not Contains (Deps, D) then + Append_New_Elmt (D, Deps); + Get_All_Parent_Levels (D, Deps); + end if; + + Next_Elmt (It); + end loop; + end Get_All_Parent_Levels; + + -- Local variables + + Policy_Names : constant Name_List := + (Name_On, Name_Off, Name_Check, Name_Disable, Name_Ignore); + + Affected_Levels : Elist_Id := New_Elmt_List; + Depends_On_Static : Boolean := False; + + Kind : Node_Id; + Level : Entity_Id; + L : Entity_Id; + L_It : Elmt_Id; + L_Id : Node_Id; + New_P : Node_Id; + Policy_Nam : Name_Id; + + -- Start of processing for Pragma Check_Policy begin GNAT_Pragma; @@ -15199,15 +15870,92 @@ package body Sem_Prag is -- Check policy Check_Optional_Identifier (Arg2, Name_Policy); - Check_Arg_Is_One_Of - (Arg2, - Name_On, Name_Off, Name_Check, Name_Disable, Name_Ignore); + Check_Arg_Is_One_Of (Arg2, Policy_Names); + + Policy_Nam := Chars (Get_Pragma_Arg (Arg2)); -- And chain pragma on the Check_Policy_List for search Set_Next_Pragma (N, Opt.Check_Policy_List); Opt.Check_Policy_List := N; + -- For Assertion_Levels create new policies for all of the + -- level dependencies. + + if Present (Entity (Kind)) + and then Ekind (Entity (Kind)) = E_Assertion_Level + then + Level := Entity (Kind); + + Depends_On_Static := + Depends_On_Level (Level, Standard_Level_Static); + + if Policy_Nam in Name_On | Name_Check then + if Level = Standard_Level_Static then + Error_Pragma_Arg + ("policy for `Static` cannot be changed to `Check`", + Arg1); + elsif Depends_On_Static then + Error_Pragma_Arg + ("Policy for a level that depends on `Static` " + & "cannot be changed to `Check`", + Arg1); + end if; + end if; + + if Policy_Nam in Name_Off | Name_Ignore + and then Level = Standard_Level_Runtime + then + Error_Pragma_Arg + ("policy for `Runtime` cannot be changed to `Ignore`", + Arg1); + end if; + + -- For Assertion_Levels create new policyies for all of the + -- level dependencies. + + if Policy_Nam in Name_On | Name_Check then + + -- Activating a level activates all levels that it + -- depends on (Parent_Levels). + + Get_All_Parent_Levels (Level, Affected_Levels); + elsif Policy_Nam in Name_Off | Name_Ignore then + + -- Deactivating a level deactivates all levels that + -- depend on it (Child_Levels) + + Get_All_Child_Levels (Level, Affected_Levels); + end if; + + L_It := First_Elmt (Affected_Levels); + while Present (L_It) loop + L := Node (L_It); + L_Id := Make_Identifier (Sloc (Arg1), Chars (L)); + Set_Entity (L_Id, L); + New_P := + Make_Pragma (Sloc (N), + Chars => Name_Check_Policy, + Pragma_Argument_Associations => New_List ( + Make_Pragma_Argument_Association (Sloc (Arg1), + Expression => L_Id), + Make_Pragma_Argument_Association (Sloc (Arg2), + Expression => + New_Copy_Tree (Get_Pragma_Arg (Arg2))))); + + -- We have collected the unique list of all transitive + -- Parent_Levels or Child_Levels. Avoid calculating + -- them again. + + Set_Analyzed (New_P); + + Set_Next_Pragma (New_P, Opt.Check_Policy_List); + Opt.Check_Policy_List := New_P; + + Next_Elmt (L_It); + end loop; + end if; + -- For the new syntax, what we do is to convert each argument to -- an old syntax equivalent. We do that because we want to chain -- old style Check_Policy pragmas for the search (we don't want @@ -15218,8 +15966,6 @@ package body Sem_Prag is Arg : Node_Id; Argx : Node_Id; LocP : Source_Ptr; - New_P : Node_Id; - begin Arg := Arg1; while Present (Arg) loop @@ -16362,6 +17108,21 @@ package body Sem_Prag is Check_No_Identifiers; Check_At_Most_N_Arguments (2); -- Accounts for implicit type arg + -- The value "null" cannot be associated with an assertion level + -- as it has no runtime semantics. + + if Present (Pragma_Ghost_Assertion_Level (N)) + and then Pragma_Ghost_Assertion_Level (N) + /= Standard_Level_Default + and then Present (Arg1) + and then Nkind (Get_Pragma_Arg (Arg1)) = N_Null + then + Error_Pragma_Arg + ("null argument cannot be used together " + & "with assertion levels", + Arg1); + end if; + Typ := Empty; Stmt := Prev (N); while Present (Stmt) loop @@ -16369,7 +17130,9 @@ package body Sem_Prag is -- Skip prior pragmas, but check for duplicates if Nkind (Stmt) = N_Pragma then - if Pragma_Name (Stmt) = Pname then + if Pragma_Name (Stmt) = Pname + and then not From_Same_Pragma (N, Stmt) + then Duplication_Error (Prag => N, Prev => Stmt); @@ -18020,7 +18783,8 @@ package body Sem_Prag is GNAT_Pragma; Check_Arg_Count (1); Check_No_Identifiers; - Check_Arg_Is_One_Of (Arg1, Name_On, Name_Off, Name_All_Extensions); + Check_Arg_Is_One_Of + (Arg1, (Name_On, Name_Off, Name_All_Extensions)); if Chars (Get_Pragma_Arg (Arg1)) = Name_On then Ada_Version := Ada_With_Core_Extensions; @@ -18225,7 +18989,7 @@ package body Sem_Prag is if Arg_Count = 2 then Check_Arg_Is_One_Of - (Arg2, Name_As_Is, Name_Uppercase, Name_Lowercase); + (Arg2, (Name_As_Is, Name_Uppercase, Name_Lowercase)); case Chars (Get_Pragma_Arg (Arg2)) is when Name_As_Is => @@ -18470,12 +19234,15 @@ package body Sem_Prag is -- Ghost -- ----------- - -- pragma Ghost [ (static_boolean_EXPRESSION) ]; + -- pragma Ghost [ (static_boolean_EXPRESSION + -- | Assertion_Level) ]; when Pragma_Ghost => Ghost : declare Context : Node_Id; Expr : Node_Id; Id : Entity_Id; + Is_Ghost : Boolean := True; + Level : Entity_Id; Orig_Stmt : Node_Id; Prev_Id : Entity_Id; Stmt : Node_Id; @@ -18500,7 +19267,7 @@ package body Sem_Prag is end if; -- Task unit declared without a definition cannot be subject to - -- pragma Ghost (SPARK RM 6.9(21)). + -- pragma Ghost (SPARK RM 6.9(22)). elsif Nkind (Stmt) in N_Single_Task_Declaration | N_Task_Type_Declaration @@ -18596,7 +19363,7 @@ package body Sem_Prag is end if; -- Protected and task types cannot be subject to pragma Ghost - -- (SPARK RM 6.9(21)). + -- (SPARK RM 6.9(22)). if Nkind (Context) in N_Protected_Body | N_Protected_Definition then @@ -18654,7 +19421,7 @@ package body Sem_Prag is -- The full declaration of a deferred constant cannot be -- subject to pragma Ghost unless the deferred declaration - -- is also Ghost (SPARK RM 6.9(9)). + -- is also Ghost (SPARK RM 6.9(11)). if Ekind (Prev_Id) = E_Constant then Error_Msg_Name_1 := Pname; @@ -18672,7 +19439,7 @@ package body Sem_Prag is -- The full declaration of a type cannot be subject to -- pragma Ghost unless the partial view is also Ghost - -- (SPARK RM 6.9(9)). + -- (SPARK RM 6.9(11)). else Error_Msg_NE (Fix_Error @@ -18683,7 +19450,7 @@ package body Sem_Prag is end if; -- A synchronized object cannot be subject to pragma Ghost - -- (SPARK RM 6.9(21)). + -- (SPARK RM 6.9(22)). elsif Ekind (Id) = E_Variable then if Is_Protected_Type (Etype (Id)) then @@ -18699,30 +19466,49 @@ package body Sem_Prag is if Present (Arg1) then Expr := Get_Pragma_Arg (Arg1); - Analyze_And_Resolve (Expr, Standard_Boolean); - - if Is_OK_Static_Expression (Expr) then - - -- "Ghostness" cannot be turned off once enabled within a - -- region (SPARK RM 6.9(6)). + if Nkind (Expr) /= N_Identifier + or else No (Get_Assertion_Level (Chars (Expr))) + then + Analyze_And_Resolve (Expr, Standard_Boolean); - if Is_False (Expr_Value (Expr)) - and then Ghost_Config.Ghost_Mode > None - then - Error_Pragma - ("pragma % with value False cannot appear in enabled " - & "ghost region"); + if not Is_OK_Static_Expression (Expr) then + Error_Pragma_Arg + ("expression of pragma % must be static", Expr); end if; - -- Otherwise the expression is not static + if Is_False (Expr_Value (Expr)) then + Is_Ghost := False; - else - Error_Pragma_Arg - ("expression of pragma % must be static", Expr); + -- "Ghostness" cannot be turned off once enabled within a + -- region (SPARK RM 6.9(8)). + + if Ghost_Config.Ghost_Mode > None then + Error_Pragma + ("pragma % with value False cannot appear in enabled" + & " ghost region"); + end if; + end if; end if; end if; - Set_Is_Ghost_Entity (Id); + Level := Assertion_Level_From_Arg (Arg1); + + -- Associate the assertion level before determing the kind of + -- ghost entity we should mark the entity as. + + Set_Ghost_Assertion_Level (Id, Level); + + -- Store it on the pragma node as well + + Set_Pragma_Ghost_Assertion_Level (N, Level); + + -- Mark it as a Ghost entity unless it was explicitly marked with + -- pragma Ghost (False). + + if Is_Ghost then + Set_Is_Implicit_Ghost (Id, False); + Set_Is_Ghost_Entity (Id); + end if; end Ghost; ------------ @@ -18943,17 +19729,17 @@ package body Sem_Prag is Proc_Id : Entity_Id; Typ : Entity_Id; + Impl_Names : constant Name_List := (Name_By_Any, + Name_By_Entry, + Name_By_Protected_Procedure, + Name_Optional); begin Ada_2012_Pragma; Check_Arg_Count (2); Check_No_Identifiers; Check_Arg_Is_Identifier (Arg1); Check_Arg_Is_Local_Name (Arg1); - Check_Arg_Is_One_Of (Arg2, - Name_By_Any, - Name_By_Entry, - Name_By_Protected_Procedure, - Name_Optional); + Check_Arg_Is_One_Of (Arg2, Impl_Names); -- Extract the name of the local procedure @@ -20875,6 +21661,11 @@ package body Sem_Prag is when Pragma_Loop_Optimize => Loop_Optimize : declare Hint : Node_Id; + Hint_Names : constant Name_List := (Name_Ivdep, + Name_No_Unroll, + Name_Unroll, + Name_No_Vector, + Name_Vector); begin GNAT_Pragma; Check_At_Least_N_Arguments (1); @@ -20882,11 +21673,7 @@ package body Sem_Prag is Hint := First (Pragma_Argument_Associations (N)); while Present (Hint) loop - Check_Arg_Is_One_Of (Hint, Name_Ivdep, - Name_No_Unroll, - Name_Unroll, - Name_No_Vector, - Name_Vector); + Check_Arg_Is_One_Of (Hint, Hint_Names); Next (Hint); end loop; @@ -20911,6 +21698,7 @@ package body Sem_Prag is GNAT_Pragma; Check_At_Least_N_Arguments (1); Check_Loop_Pragma_Placement; + Mark_Ghost_Pragma (N, Current_Scope); -- Process all increasing / decreasing expressions @@ -21079,8 +21867,17 @@ package body Sem_Prag is if Rep_Item_Too_Late (Def_Id, N) then return; - else - Set_Has_Gigi_Rep_Item (Def_Id); + end if; + + Set_Has_Gigi_Rep_Item (Def_Id); + + -- The pragma is processed directly by the back end when Def_Id is + -- translated. If the argument is not a string literal, it may be + -- declared after Def_Id and before the pragma, which requires the + -- processing of Def_Id to be delayed for the back end. + + if Nkind (Get_Pragma_Arg (Arg2)) /= N_String_Literal then + Set_Has_Delayed_Freeze (Def_Id); end if; end Machine_Attribute; @@ -21667,9 +22464,10 @@ package body Sem_Prag is -- Flag set when an error concerning the illegal mix of Ghost and -- non-Ghost subprograms is emitted. - Ghost_Id : Entity_Id := Empty; - -- The entity of the first Ghost procedure encountered while - -- processing the arguments of the pragma. + First_Arg_Id : Entity_Id := Empty; + -- The entity of the first variable encountered while processing + -- the arguments of the pragma. This is used as a reference for + -- assessing the ghostliness of other arguments. begin Ada_2005_Pragma; @@ -21681,7 +22479,15 @@ package body Sem_Prag is while Present (Arg) loop Check_Arg_Is_Local_Name (Arg); Id := Get_Pragma_Arg (Arg); + + -- We are going to check the entity that determines the ghost + -- region of that pragma. We need to disable the checks for + -- ghost context since the ghost region can only be set after + -- analyzing this entity. + + Ghost_Context_Checks_Disabled := True; Analyze (Id); + Ghost_Context_Checks_Disabled := False; if not Is_Entity_Name (Id) then Error_Pragma_Arg ("entity name required", Arg); @@ -21758,42 +22564,22 @@ package body Sem_Prag is Set_No_Return (E); end if; - -- A pragma that applies to a Ghost entity becomes - -- Ghost for the purposes of legality checks and - -- removal of ignored Ghost code. + -- Capture the entity of the first variable being + -- processed for error detection purposes. - Mark_Ghost_Pragma (N, E); + if No (First_Arg_Id) then + First_Arg_Id := E; - -- Capture the entity of the first Ghost procedure - -- being processed for error detection purposes. - - if Is_Ghost_Entity (E) then - if No (Ghost_Id) then - Ghost_Id := E; - end if; - - -- Otherwise the subprogram is non-Ghost. It is - -- illegal to mix references to Ghost and non-Ghost - -- entities (SPARK RM 6.9). - - elsif Present (Ghost_Id) - and then not Ghost_Error_Posted - then - Ghost_Error_Posted := True; - - Error_Msg_Name_1 := Pname; - Error_Msg_N - ("pragma % cannot mention ghost and non-ghost " - & "procedures", N); - - Error_Msg_Sloc := Sloc (Ghost_Id); - Error_Msg_NE - ("\& # declared as ghost", N, Ghost_Id); + -- A pragma that applies to a Ghost entity becomes + -- Ghost for the purposes of legality checks and + -- removal of ignored Ghost code. - Error_Msg_Sloc := Sloc (E); - Error_Msg_NE ("\& # declared as non-ghost", N, E); + Mark_Ghost_Pragma (N, E); end if; + Check_Inconsistent_Argument_Ghostliness + (First_Arg_Id, E, Ghost_Error_Posted); + -- Set flag on any alias as well if Is_Overloadable (E) @@ -22238,7 +23024,7 @@ package body Sem_Prag is when Pragma_Optimize => Check_No_Identifiers; Check_Arg_Count (1); - Check_Arg_Is_One_Of (Arg1, Name_Time, Name_Space, Name_Off); + Check_Arg_Is_One_Of (Arg1, (Name_Time, Name_Space, Name_Off)); ------------------------ -- Optimize_Alignment -- @@ -23158,12 +23944,18 @@ package body Sem_Prag is -- removal of ignored Ghost code. if From_Aspect_Specification (N) - and then Get_Aspect_Id - (Chars (Identifier (Corresponding_Aspect (N)))) - = Aspect_Ghost_Predicate + and then Get_Aspect_Id (Corresponding_Aspect (N)) + = Aspect_Ghost_Predicate then - Mark_Ghost_Pragma - (N, Name_To_Ghost_Mode (Policy_In_Effect (Name_Ghost))); + -- For Ghost_Predicate we have already analyzed the applicable + -- ghost policy already and set the policy using Is_Checked and + -- Is_Ignored. + + if Is_Ignored (N) then + Mark_Ghost_Pragma (N, Opt.Ignore); + else + Mark_Ghost_Pragma (N, Opt.Check); + end if; else Mark_Ghost_Pragma (N, Typ); end if; @@ -25675,7 +26467,7 @@ package body Sem_Prag is -- Check the legality of the mode (no argument = ON) if Arg_Count = 1 then - Check_Arg_Is_One_Of (Arg1, Name_Auto, Name_On, Name_Off); + Check_Arg_Is_One_Of (Arg1, (Name_Auto, Name_On, Name_Off)); Mode := Chars (Get_Pragma_Arg (Arg1)); else Mode := Name_On; @@ -27145,7 +27937,7 @@ package body Sem_Prag is GNAT_Pragma; Check_Arg_Count (1); Check_No_Identifiers; - Check_Arg_Is_One_Of (Arg1, Name_Error, Name_Warn, Name_Allow); + Check_Arg_Is_One_Of (Arg1, (Name_Error, Name_Warn, Name_Allow)); -- Suppress/Unsuppress can appear as a configuration pragma, or in -- a declarative part or a package spec. @@ -27261,9 +28053,10 @@ package body Sem_Prag is -- Flag set when an error concerning the illegal mix of Ghost and -- non-Ghost types is emitted. - Ghost_Id : Entity_Id := Empty; - -- The entity of the first Ghost type encountered while processing - -- the arguments of the pragma. + First_Arg_Id : Entity_Id := Empty; + -- The entity of the first variable encountered while processing + -- the arguments of the pragma. This is used as a reference for + -- assessing the ghostliness of other arguments. begin GNAT_Pragma; @@ -27278,43 +28071,25 @@ package body Sem_Prag is if Is_Entity_Name (Arg_Expr) then Arg_Id := Entity (Arg_Expr); - if Is_Type (Arg_Id) then - Set_Has_Pragma_Unreferenced_Objects (Arg_Id); + -- Capture the entity of the first Ghost type being + -- processed for error detection purposes. + + if No (First_Arg_Id) then + First_Arg_Id := Arg_Id; -- A pragma that applies to a Ghost entity becomes Ghost -- for the purposes of legality checks and removal of -- ignored Ghost code. Mark_Ghost_Pragma (N, Arg_Id); + end if; - -- Capture the entity of the first Ghost type being - -- processed for error detection purposes. - - if Is_Ghost_Entity (Arg_Id) then - if No (Ghost_Id) then - Ghost_Id := Arg_Id; - end if; - - -- Otherwise the type is non-Ghost. It is illegal to mix - -- references to Ghost and non-Ghost entities - -- (SPARK RM 6.9). - - elsif Present (Ghost_Id) - and then not Ghost_Error_Posted - then - Ghost_Error_Posted := True; - - Error_Msg_Name_1 := Pname; - Error_Msg_N - ("pragma % cannot mention ghost and non-ghost types", - N); + if Is_Type (Arg_Id) then + Set_Has_Pragma_Unreferenced_Objects (Arg_Id); - Error_Msg_Sloc := Sloc (Ghost_Id); - Error_Msg_NE ("\& # declared as ghost", N, Ghost_Id); + Check_Inconsistent_Argument_Ghostliness + (First_Arg_Id, Arg_Id, Ghost_Error_Posted); - Error_Msg_Sloc := Sloc (Arg_Id); - Error_Msg_NE ("\& # declared as non-ghost", N, Arg_Id); - end if; else Error_Pragma_Arg ("argument for pragma% must be type or subtype", Arg); @@ -27342,6 +28117,69 @@ package body Sem_Prag is Unreserve_All_Interrupts := True; end if; + -------------------------------- + -- Pragma_Unsigned_Base_Range -- + -------------------------------- + + when Pragma_Unsigned_Base_Range => Unsigned_Base_Range : declare + Arg : Node_Id; + E : Entity_Id := Empty; + Expr : Node_Id := Empty; + + begin + GNAT_Pragma; + Check_At_Least_N_Arguments (1); + Check_At_Most_N_Arguments (2); + + Arg := Get_Pragma_Arg (Arg1); + Check_Arg_Is_Identifier (Arg); + + Analyze (Arg); + E := Entity (Arg); + + if Present (Arg2) then + Check_Arg_Is_OK_Static_Expression (Arg2, Standard_Boolean); + Expr := Get_Pragma_Arg (Arg2); + Analyze_And_Resolve (Expr, Standard_Boolean); + end if; + + if not Core_Extensions_Allowed then + Error_Msg_GNAT_Extension + ("'Unsigned_'Base_'Range", Sloc (N), + Is_Core_Extension => True); + return; + + elsif not Is_Integer_Type (E) + or else Is_Modular_Integer_Type (E) + then + Error_Pragma_Arg + ("cannot apply pragma %", + "\& is not a signed integer type", + Arg1); + + elsif Is_Derived_Type (E) then + Error_Pragma_Arg + ("pragma % cannot apply to derived type", Arg1); + end if; + + Check_First_Subtype (Arg1); + + -- Create the new unsigned integer base type entity, and apply + -- the constraint to create the first subtype of E. + + Unsigned_Base_Range_Type_Declaration (E, + Def => Type_Definition (Parent (E))); + + Set_Direct_Primitive_Operations (Base_Type (E), New_Elmt_List); + Set_Direct_Primitive_Operations (E, + Direct_Primitive_Operations (Base_Type (E))); + Ensure_Freeze_Node (Base_Type (E)); + Set_First_Subtype_Link (Freeze_Node (Base_Type (E)), E); + Set_Has_Delayed_Freeze (E); + + Set_Has_Unsigned_Base_Range_Aspect (Base_Type (E)); + end Unsigned_Base_Range; + ---------------- -- Unsuppress -- ---------------- @@ -28177,13 +29015,13 @@ package body Sem_Prag is null; -------------------- - -- Unknown_Pragma -- + -- Pragma_Unknown -- -------------------- -- Should be impossible, since the case of an unknown pragma is -- separately processed before the case statement is entered. - when Unknown_Pragma => + when Pragma_Unknown => raise Program_Error; end case; @@ -30875,6 +31713,9 @@ package body Sem_Prag is -- A list that contains all refined states processed so far. The list is -- used to detect duplicate refinements. + Saved_Ghost_Config : constant Ghost_Config_Type := Ghost_Config; + -- Ghost configuration before starting to process this pragma + procedure Analyze_Refinement_Clause (Clause : Node_Id); -- Perform full analysis of a single refinement clause @@ -31634,6 +32475,10 @@ package body Sem_Prag is return; end if; + -- Get the Ghost context from the pragma before analyzing its parts + + Set_Ghost_Mode (N); + -- Save the scenario for examination by the ABE Processing phase Record_Elaboration_Scenario (N); @@ -31677,6 +32522,8 @@ package body Sem_Prag is Report_Unrefined_States (Available_States); Set_Is_Analyzed_Pragma (N); + + Restore_Ghost_Region (Saved_Ghost_Config); end Analyze_Refined_State_In_Decl_Part; --------------------------------------------- @@ -32002,6 +32849,30 @@ package body Sem_Prag is return False; end Appears_In; + ------------------------ + -- Apply_Check_Policy -- + ------------------------ + + procedure Apply_Check_Policy (N : Node_Id; Policy : Name_Id) is + begin + case Policy is + when Name_Ignore | Name_Off => + Mark_Is_Ignored (N); + + when Name_Check | Name_On => + Mark_Is_Checked (N); + + when Name_Disable => + Mark_Is_Disabled (N); + + -- That should be exhaustive, the null here is a defence + -- against a malformed tree from previous errors. + + when others => + null; + end case; + end Apply_Check_Policy; + ----------------------------------- -- Build_Pragma_Check_Equivalent -- ----------------------------------- @@ -32142,84 +33013,18 @@ package body Sem_Prag is -- Check_Applicable_Policy -- ----------------------------- - procedure Check_Applicable_Policy (N : Node_Id) is - PP : Node_Id; - Policy : Name_Id; - - Ename : constant Name_Id := Original_Aspect_Pragma_Name (N); + procedure Check_Applicable_Policy (N : Node_Id; Level : Entity_Id := Empty) + is + Nam : constant Name_Id := Original_Aspect_Pragma_Name (N); begin -- No effect if not valid assertion kind name - if not Is_Valid_Assertion_Kind (Ename) then + if not Is_Valid_Assertion_Kind (Nam) then return; end if; - -- Loop through entries in check policy list - - PP := Opt.Check_Policy_List; - while Present (PP) loop - declare - PPA : constant List_Id := Pragma_Argument_Associations (PP); - Pnm : constant Name_Id := Chars (Get_Pragma_Arg (First (PPA))); - - begin - if Ename = Pnm - or else Pnm = Name_Assertion - or else (Pnm = Name_Statement_Assertions - and then Ename in Name_Assert - | Name_Assert_And_Cut - | Name_Assume - | Name_Loop_Invariant - | Name_Loop_Variant) - then - Policy := Chars (Get_Pragma_Arg (Last (PPA))); - - case Policy is - when Name_Ignore - | Name_Off - => - Set_Is_Checked (N, False); - Set_Is_Ignored (N, True); - - when Name_Check - | Name_On - => - Set_Is_Checked (N, True); - Set_Is_Ignored (N, False); - - when Name_Disable => - Set_Is_Ignored (N, True); - Set_Is_Checked (N, False); - Set_Is_Disabled (N, True); - - -- That should be exhaustive, the null here is a defence - -- against a malformed tree from previous errors. - - when others => - null; - end case; - - return; - end if; - - PP := Next_Pragma (PP); - end; - end loop; - - -- If there are no specific entries that matched, then we let the - -- setting of assertions govern. Note that this provides the needed - -- compatibility with the RM for the cases of assertion, invariant, - -- precondition, predicate, and postcondition. Note also that - -- Assertions_Enabled is forced in CodePeer mode and GNATprove mode. - - if Assertions_Enabled then - Set_Is_Checked (N, True); - Set_Is_Ignored (N, False); - else - Set_Is_Checked (N, False); - Set_Is_Ignored (N, True); - end if; + Apply_Check_Policy (N, Get_Applicable_Policy (Nam, Level)); end Check_Applicable_Policy; ------------------------------- @@ -32267,69 +33072,6 @@ package body Sem_Prag is Item); end Check_External_Properties; - ---------------- - -- Check_Kind -- - ---------------- - - function Check_Kind (Nam : Name_Id) return Name_Id is - PP : Node_Id; - - begin - -- Loop through entries in check policy list - - PP := Opt.Check_Policy_List; - while Present (PP) loop - declare - PPA : constant List_Id := Pragma_Argument_Associations (PP); - Pnm : constant Name_Id := Chars (Get_Pragma_Arg (First (PPA))); - - begin - if Nam = Pnm - or else (Pnm = Name_Assertion - and then Is_Valid_Assertion_Kind (Nam)) - or else (Pnm = Name_Statement_Assertions - and then Nam in Name_Assert - | Name_Assert_And_Cut - | Name_Assume - | Name_Loop_Invariant - | Name_Loop_Variant) - then - case Chars (Get_Pragma_Arg (Last (PPA))) is - when Name_Check - | Name_On - => - return Name_Check; - - when Name_Ignore - | Name_Off - => - return Name_Ignore; - - when Name_Disable => - return Name_Disable; - - when others => - raise Program_Error; - end case; - - else - PP := Next_Pragma (PP); - end if; - end; - end loop; - - -- If there are no specific entries that matched, then we let the - -- setting of assertions govern. Note that this provides the needed - -- compatibility with the RM for the cases of assertion, invariant, - -- precondition, predicate, and postcondition. - - if Assertions_Enabled then - return Name_Check; - else - return Name_Ignore; - end if; - end Check_Kind; - --------------------------- -- Check_Missing_Part_Of -- --------------------------- @@ -33047,6 +33789,21 @@ package body Sem_Prag is end if; end Duplication_Error; + -------------------------- + -- Find_Assertion_Level -- + -------------------------- + + function Find_Assertion_Level (Nam : Name_Id) return Entity_Id is + begin + for J in Assertion_Levels.First .. Assertion_Levels.Last loop + if Chars (Assertion_Levels.Table (J)) = Nam then + return Assertion_Levels.Table (J); + end if; + end loop; + + return Empty; + end Find_Assertion_Level; + ------------------------------ -- Find_Encapsulating_State -- ------------------------------ @@ -33195,10 +33952,9 @@ package body Sem_Prag is if Nkind (Stmt) = N_Pragma then if Do_Checks and then Original_Aspect_Pragma_Name (Stmt) = Prag_Nam + and then not From_Same_Pragma (Prag, Stmt) then - Duplication_Error - (Prag => Prag, - Prev => Stmt); + Duplication_Error (Prag => Prag, Prev => Stmt); end if; -- Emit an error when a refinement pragma appears on an expression @@ -33361,10 +34117,11 @@ package body Sem_Prag is -- Skip prior pragmas, but check for duplicates if Nkind (Stmt) = N_Pragma then - if Do_Checks and then Pragma_Name (Stmt) = Prag_Nam then - Duplication_Error - (Prag => Prag, - Prev => Stmt); + if Do_Checks + and then Pragma_Name (Stmt) = Prag_Nam + and then not From_Same_Pragma (Prag, Stmt) + then + Duplication_Error (Prag => Prag, Prev => Stmt); end if; -- Skip internally generated code @@ -33430,6 +34187,80 @@ package body Sem_Prag is end if; end Find_Related_Package_Or_Body; + --------------------------- + -- Get_Applicable_Policy -- + --------------------------- + + function Get_Applicable_Policy + (Nam : Name_Id; Level : Entity_Id) return Name_Id + is + function Is_Statement_Assertion (Nam : Name_Id) return Boolean + is (Nam + in Name_Assert + | Name_Assert_And_Cut + | Name_Assume + | Name_Loop_Invariant + | Name_Loop_Variant); + + -- Local variables + + Assocs : List_Id; + P_Arg : Node_Id; + P_Nam : Name_Id; + Policy_Prag : Node_Id; + + -- Start of processing for Get_Applicable_Policy + + begin + -- Runtime level should always be checked irregardless of other + -- policies that are applied. + + if Level = Standard_Level_Runtime then + return Name_Check; + + -- Static level or levels that depend on Static should never be + -- checked irregardless of other policies that are applied. + + elsif Level = Standard_Level_Static + or else Depends_On_Level (Level, Standard_Level_Static) + then + return Name_Ignore; + end if; + + -- Loop through entries in check policy list + + Policy_Prag := Opt.Check_Policy_List; + while Present (Policy_Prag) loop + Assocs := Pragma_Argument_Associations (Policy_Prag); + P_Arg := Get_Pragma_Arg (First (Assocs)); + P_Nam := Chars (P_Arg); + + if P_Nam = Nam + or else P_Nam = Name_Assertion + or else (P_Nam = Name_Statement_Assertions + and then Is_Statement_Assertion (Nam)) + or else (Present (Level) and then P_Nam = Chars (Level)) + then + return Chars (Get_Pragma_Arg (Last (Assocs))); + end if; + + Policy_Prag := Next_Pragma (Policy_Prag); + end loop; + + -- If there are no specific entries that matched, then we let the + -- setting of assertions govern. Note that this provides the + -- needed compatibility with the RM for the cases of assertion, + -- invariant, precondition, predicate, and postcondition. Note + -- also that Assertions_Enabled is forced in CodePeer mode and + -- GNATprove mode. + + if Assertions_Enabled then + return Name_Check; + else + return Name_Ignore; + end if; + end Get_Applicable_Policy; + ------------------ -- Get_Argument -- ------------------ @@ -33462,6 +34293,19 @@ package body Sem_Prag is end if; end Get_Argument; + ------------------------- + -- Get_Assertion_Level -- + ------------------------- + + function Get_Assertion_Level (Nam : Name_Id) return Entity_Id is + begin + if Nam = No_Name then + return Empty; + end if; + + return Find_Assertion_Level (Nam); + end Get_Assertion_Level; + ------------------------- -- Get_Base_Subprogram -- ------------------------- @@ -33602,6 +34446,7 @@ package body Sem_Prag is begin Externals.Init; Compile_Time_Warnings_Errors.Init; + Assertion_Levels.Init; end Initialize; -------- @@ -33613,6 +34458,79 @@ package body Sem_Prag is Dummy := Dummy + 1; end ip; + ---------------------------- + -- Insert_Assertion_Level -- + ---------------------------- + + procedure Insert_Assertion_Level (Level : Entity_Id) is + Nam : constant Name_Id := Chars (Level); + + Dupl : constant Entity_Id := Find_Assertion_Level (Nam); + + function Same_Dependencies (Self, Other : Entity_Id) return Boolean; + -- Check that both levels have the same number of dependencies and the + -- names of the dependencies match. + + ----------------------- + -- Same_Dependencies -- + ----------------------- + + function Same_Dependencies (Self, Other : Entity_Id) return Boolean is + Other_El : Elmt_Id; + Other_Level : Entity_Id; + Self_El : Elmt_Id; + Self_Level : Entity_Id; + + begin + pragma Assert (Ekind (Self) = E_Assertion_Level); + pragma Assert (Ekind (Other) = E_Assertion_Level); + + if List_Length (Parent_Levels (Self)) + /= List_Length (Parent_Levels (Other)) + then + return False; + end if; + + if No (Parent_Levels (Self)) then + return True; + end if; + + -- Check that dependencies match. + -- Note that we are checking for positional and element matching. + -- The positional part could be relaxed. + + Self_El := First_Elmt (Parent_Levels (Self)); + Other_El := First_Elmt (Parent_Levels (Other)); + while Present (Self_El) loop + Self_Level := Node (Self_El); + Other_Level := Node (Other_El); + + if Chars (Self_Level) /= Chars (Other_Level) then + return False; + end if; + + Next_Elmt (Self_El); + Next_Elmt (Other_El); + end loop; + + return True; + end Same_Dependencies; + + -- Start of processing for Insert_Assertion_Level + + begin + if No (Dupl) then + Assertion_Levels.Append (Level); + else + if not Same_Dependencies (Level, Dupl) then + Error_Msg_N + ("conflicting Assertion_Level definition for &", Level); + Error_Msg_Sloc := Sloc (Dupl); + Error_Msg_NE ("\differs from existing definition #", Level, Dupl); + end if; + end if; + end Insert_Assertion_Level; + ----------------------------- -- Is_Config_Static_String -- ----------------------------- @@ -33753,6 +34671,7 @@ package body Sem_Prag is Pragma_Annotate => 93, Pragma_Assert => -1, Pragma_Assert_And_Cut => -1, + Pragma_Assertion_Level => 0, Pragma_Assertion_Policy => 0, Pragma_Assume => -1, Pragma_Assume_No_Invalid_Values => 0, @@ -33978,6 +34897,7 @@ package body Sem_Prag is Pragma_Unreferenced => 0, Pragma_Unreferenced_Objects => 0, Pragma_Unreserve_All_Interrupts => 0, + Pragma_Unsigned_Base_Range => 0, Pragma_Unsuppress => 0, Pragma_Unused => 0, Pragma_Use_VADS_Size => 0, @@ -33991,7 +34911,7 @@ package body Sem_Prag is Pragma_Warnings => 0, Pragma_Weak_External => 0, Pragma_Wide_Character_Encoding => 0, - Unknown_Pragma => 0); + Pragma_Unknown => 0); function Is_Non_Significant_Pragma_Reference (N : Node_Id) return Boolean is Id : Pragma_Id; @@ -34207,6 +35127,15 @@ package body Sem_Prag is end case; end Is_Valid_Assertion_Kind; + ------------------------------ + -- Is_Valid_Assertion_Level -- + ------------------------------ + + function Is_Valid_Assertion_Level (Nam : Name_Id) return Boolean is + begin + return Present (Get_Assertion_Level (Nam)); + end Is_Valid_Assertion_Level; + -------------------------------------- -- Process_Compilation_Unit_Pragmas -- -------------------------------------- @@ -34375,6 +35304,37 @@ package body Sem_Prag is end if; end Validate_Compile_Time_Warning_Or_Error; + --------------------- + -- Mark_Is_Checked -- + --------------------- + + procedure Mark_Is_Checked (N : Node_Id) is + begin + Set_Is_Checked (N, True); + Set_Is_Ignored (N, False); + end Mark_Is_Checked; + + ---------------------- + -- Mark_Is_Disabled -- + ---------------------- + + procedure Mark_Is_Disabled (N : Node_Id) is + begin + Set_Is_Ignored (N, True); + Set_Is_Checked (N, False); + Set_Is_Disabled (N, True); + end Mark_Is_Disabled; + + --------------------- + -- Mark_Is_Ignored -- + --------------------- + + procedure Mark_Is_Ignored (N : Node_Id) is + begin + Set_Is_Checked (N, False); + Set_Is_Ignored (N, True); + end Mark_Is_Ignored; + ------------------------------------ -- Record_Possible_Body_Reference -- ------------------------------------ diff --git a/gcc/ada/sem_prag.ads b/gcc/ada/sem_prag.ads index 9228a8774a5e..1262ede04db8 100644 --- a/gcc/ada/sem_prag.ads +++ b/gcc/ada/sem_prag.ads @@ -253,6 +253,73 @@ package Sem_Prag is (Pragma_Extensions_Visible => True, others => False); + -- List of pragmas where the ghost policy checks have been disabled. + -- + -- There is an analysis circularity issue here. These pragmas are marked as + -- Ghost based on the ghostness of the entity in their argument. We need to + -- analyze the argument to determine the ghostness of the pragma. However + -- if we are analyzing a ghost argument we need to validate its context and + -- for that we need to mark the ghostness of the pragma beforehand. + -- + -- We suppress the checks for these pragmas in order to break that loop. We + -- do not need to emit an error since if the argument was ghost that means + -- that the pragma was ghost as well. + + Suppressed_Ghost_Policy_Check_Pragma : + constant array (Pragma_Id) of Boolean := + (Pragma_All_Calls_Remote => True, + Pragma_Annotate => True, + Pragma_Asynchronous => True, + Pragma_Atomic_Components => True, + Pragma_Compile_Time_Error => True, + Pragma_Compile_Time_Warning => True, + Pragma_Convention => True, + Pragma_Default_Storage_Pool => True, + Pragma_Discard_Names => True, + Pragma_Elaborate_Body => True, + Pragma_Export => True, + Pragma_Extended_Access => True, + Pragma_External => True, + Pragma_Favor_Top_Level => True, + Pragma_Import => True, + Pragma_Independent_Components => True, + Pragma_Inline => True, + Pragma_Interface => True, + Pragma_No_Return => True, + Pragma_Obsolescent => True, + Pragma_Pack => True, + Pragma_Persistent_BSS => True, + Pragma_Preelaborable_Initialization => True, + Pragma_Preelaborate => True, + Pragma_Pure => True, + Pragma_Pure_Function => True, + Pragma_Remote_Access_Type => True, + Pragma_Remote_Call_Interface => True, + Pragma_Remote_Types => True, + Pragma_Shared_Passive => True, + Pragma_Simple_Storage_Pool_Type => True, + Pragma_Suppress => True, + Pragma_Suppress_Debug_Info => True, + Pragma_Suppress_Initialization => True, + Pragma_Thread_Local_Storage => True, + Pragma_Unchecked_Union => True, + Pragma_Universal_Aliasing => True, + Pragma_Unreferenced => True, + Pragma_Unreferenced_Objects => True, + Pragma_Unsuppress => True, + Pragma_Unused => True, + Pragma_Volatile_Components => True, + others => False); + + function Find_Assertion_Level (Nam : Name_Id) return Entity_Id; + -- Find an existing definition with the given name that has been inserted + -- into the Assertion_Levels table. + + procedure Insert_Assertion_Level (Level : Entity_Id); + -- Insert a new level into the Assertion_Levels table. If there is already + -- an entry with the same name check that it has the same dependencies as + -- the level you are trying to insert. Raises an error otherwise. + ----------------- -- Subprograms -- ----------------- @@ -377,7 +444,7 @@ package Sem_Prag is -- in fact of the same kind as the source pragma Prag. This is used -- in GNATprove_Mode to generate the inherited pre- and postconditions. - procedure Check_Applicable_Policy (N : Node_Id); + procedure Check_Applicable_Policy (N : Node_Id; Level : Entity_Id := Empty); -- N is either an N_Aspect or an N_Pragma node. There are two cases. If -- the name of the aspect or pragma is not one of those recognized as -- an assertion kind by an Assertion_Policy pragma, then the call has @@ -410,25 +477,6 @@ package Sem_Prag is -- is the related variable or state. Ensure legality of the combination and -- issue an error for an illegal combination. - function Check_Kind (Nam : Name_Id) return Name_Id; - -- This function is used in connection with pragmas Assert, Check, - -- and assertion aspects and pragmas, to determine if Check pragmas - -- (or corresponding assertion aspects or pragmas) are currently active - -- as determined by the presence of -gnata on the command line (which - -- sets the default), and the appearance of pragmas Check_Policy and - -- Assertion_Policy as configuration pragmas either in a configuration - -- pragma file, or at the start of the current unit, or locally given - -- Check_Policy and Assertion_Policy pragmas that are currently active. - -- - -- The value returned is one of the names Check, Ignore, Disable (On - -- returns Check, and Off returns Ignore). - -- - -- Note: for assertion kinds Pre'Class, Post'Class, Invariant'Class, - -- and Type_Invariant'Class, the name passed is Name_uPre, Name_uPost, - -- Name_uInvariant, or Name_uType_Invariant, which corresponds to _Pre, - -- _Post, _Invariant, or _Type_Invariant, which are special names used - -- in identifiers to represent these attribute references. - procedure Check_Missing_Part_Of (Item_Id : Entity_Id); -- Determine whether the placement within the state space of an abstract -- state, variable or package instantiation denoted by Item_Id requires the @@ -533,6 +581,9 @@ package Sem_Prag is -- Context denotes the entity of the function, package or procedure where -- Prag resides. + function Get_Assertion_Level (Nam : Name_Id) return Entity_Id; + -- Returns the entity of a known Assertion_Level name + function Get_SPARK_Mode_From_Annotation (N : Node_Id) return SPARK_Mode_Type; -- Given an aspect or pragma SPARK_Mode node, return corresponding mode id @@ -599,6 +650,10 @@ package Sem_Prag is -- Name_uInvariant, and Name_uType_Invariant (_Pre, _Post, _Invariant, -- and _Type_Invariant). + function Is_Valid_Assertion_Level (Nam : Name_Id) return Boolean; + -- Return True if Nam is one of the Assertion_Levels declared in the + -- current context. + procedure Process_Compilation_Unit_Pragmas (N : Node_Id); -- Called at the start of processing compilation unit N to deal with any -- special issues regarding pragmas. In particular, we have to deal with diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 29b776688023..4d467553373d 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -5273,7 +5273,7 @@ package body Sem_Res is end if; -- The actual parameter of a Ghost subprogram whose formal is of - -- mode IN OUT or OUT must be a Ghost variable (SPARK RM 6.9(12)). + -- mode IN OUT or OUT must be a Ghost variable (SPARK RM 6.9(15)). if Comes_From_Source (Nam) and then Is_Ghost_Entity (Nam) @@ -6954,7 +6954,7 @@ package body Sem_Res is -- checkable, the case of calling an immediately containing -- subprogram is easy to catch. - if not Is_Ignored_Ghost_Entity (Nam) then + if not Is_Ignored_Ghost_Entity_In_Codegen (Nam) then Check_Restriction (No_Recursion, N); end if; @@ -7092,7 +7092,7 @@ package body Sem_Res is and then Ekind (Nam) in E_Function | E_Subprogram_Type and then Requires_Transient_Scope (Etype (Nam)) and then not Is_Intrinsic_Subprogram (Nam) - and then not Is_Ignored_Ghost_Entity (Nam) + and then not Is_Ignored_Ghost_Entity_In_Codegen (Nam) and then not Is_Build_In_Place_Function (Nam) and then not Is_Inlinable_Expression_Function (Nam) and then not (Is_Inlined (Nam) diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index d19b3b956223..7f864d66ffaf 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -347,6 +347,133 @@ package body Sem_Util is Analyze (Decl); end Add_Global_Declaration; + --------------------------- + -- Add_Local_Declaration -- + --------------------------- + + procedure Add_Local_Declaration + (Decl : Node_Id; + N : Node_Id; + Scop : Entity_Id) + is + function Find_Associated_Scope (N : Node_Id) return Scope_Kind_Id; + -- Return the scope associated with the declarative part of N + + --------------------------- + -- Find_Associated_Scope -- + --------------------------- + + function Find_Associated_Scope (N : Node_Id) return Scope_Kind_Id is + begin + case Nkind (N) is + when N_Block_Statement => + return Entity (Identifier (N)); + + when N_Compilation_Unit + | N_Compilation_Unit_Aux + => + return Standard_Standard; + + when N_Package_Specification + | N_Protected_Definition + | N_Task_Definition + => + return Defining_Entity (Parent (N)); + + when N_Entry_Body + | N_Package_Body + | N_Protected_Body + | N_Task_Body + => + return Corresponding_Spec (N); + + when N_Subprogram_Body => + if Acts_As_Spec (N) then + return Defining_Entity (N); + else + return Corresponding_Spec (N); + end if; + + when others => + raise Program_Error; + end case; + end Find_Associated_Scope; + + -- Local variables + + Nod : Node_Id; + Par : Node_Id; + + -- Start of processing for Add_Local_Declaration + + begin + Nod := N; + Par := Parent (Nod); + + -- Look for the innermost enclosing construct with a declarative part + + while Nkind (Par) not in N_Block_Statement + | N_Compilation_Unit + | N_Compilation_Unit_Aux + | N_Entry_Body + | N_Package_Body + | N_Package_Specification + | N_Protected_Body + | N_Protected_Definition + | N_Subprogram_Body + | N_Task_Body + | N_Task_Definition + or else (Present (Scop) and Find_Associated_Scope (Par) /= Scop) + loop + Nod := Par; + Par := Parent (Nod); + end loop; + + -- Compilation units do not directly have a declarative part + + if Nkind (Par) = N_Compilation_Unit then + Par := Aux_Decls_Node (Par); + end if; + + -- Insert Decl before N or at the end of the declarative part + + case Nkind (Par) is + when N_Block_Statement + | N_Compilation_Unit_Aux + | N_Entry_Body + | N_Package_Body + | N_Protected_Body + | N_Subprogram_Body + | N_Task_Body + => + if Is_List_Member (Nod) + and then List_Containing (Nod) = Declarations (Par) + then + Insert_Before (Nod, Decl); + + else + if No (Declarations (Par)) then + Set_Declarations (Par, New_List); + end if; + + Append_To (Declarations (Par), Decl); + end if; + + when N_Package_Specification + | N_Protected_Definition + | N_Task_Definition + => + Insert_Before (Nod, Decl); + + when others => + raise Program_Error; + end case; + + Push_Scope (Find_Associated_Scope (Par)); + Analyze (Decl); + Pop_Scope; + end Add_Local_Declaration; + -------------------------------- -- Address_Integer_Convert_OK -- -------------------------------- @@ -2016,7 +2143,7 @@ package body Sem_Util is -- Elaboration entity is never a ghost object, regardless of the context -- in which this routine is called. - Install_Ghost_Region (None, N); + Install_Ghost_Region (None, N, Empty); -- Here we need the elaboration entity @@ -6202,6 +6329,18 @@ package body Sem_Util is end if; end Conditional_Delay; + -------------------------------------- + -- Copy_Assertion_Policy_Attributes -- + -------------------------------------- + + procedure Copy_Assertion_Policy_Attributes (New_Prag, Old_Prag : Node_Id) is + begin + Set_Is_Checked (New_Prag, Is_Checked (Old_Prag)); + Set_Is_Ignored (New_Prag, Is_Ignored (Old_Prag)); + Set_Pragma_Ghost_Assertion_Level + (New_Prag, Pragma_Ghost_Assertion_Level (Old_Prag)); + end Copy_Assertion_Policy_Attributes; + ------------------------- -- Copy_Component_List -- ------------------------- @@ -6316,6 +6455,7 @@ package body Sem_Util is Def_Id : Node_Id; Formal_Spec : Node_Id; Result : Node_Id; + Level : Entity_Id; begin -- The structure of the original tree must be replicated without any @@ -6334,6 +6474,7 @@ package body Sem_Util is -- Create a new entity for the defining unit name Def_Id := Defining_Unit_Name (Result); + Level := Ghost_Assertion_Level (Def_Id); case Nkind (Def_Id) is when N_Defining_Identifier => @@ -6344,6 +6485,10 @@ package body Sem_Util is when others => raise Program_Error; end case; + -- Copy the relevant Ghost Assertion_Level + + Set_Ghost_Assertion_Level (Def_Id, Level); + Set_Defining_Unit_Name (Result, Def_Id); -- Create new entities for the formal parameters @@ -6725,6 +6870,28 @@ package body Sem_Util is end if; end Defining_Entity; + --------------------------------- + -- Defining_Entity_Of_Instance -- + --------------------------------- + + function Defining_Entity_Of_Instance (N : Node_Id) return Entity_Id is + pragma Assert (Nkind (N) in N_Generic_Instantiation); + Spec : constant Node_Id := Instance_Spec (N); + + begin + -- Fall back to Defining_Entity in case of previous errors + + if No (Spec) then + return Defining_Entity (N); + end if; + + if Nkind (N) = N_Package_Instantiation then + return Defining_Entity (Specification (Spec)); + else + return Related_Instance (Defining_Entity (Specification (Spec))); + end if; + end Defining_Entity_Of_Instance; + ------------------------------ -- Defining_Entity_Or_Empty -- ------------------------------ @@ -7199,6 +7366,42 @@ package body Sem_Util is return Is_Variable (N) and then Paren_Count (N) = 0; end Denotes_Variable; + ---------------------- + -- Depends_On_Level -- + ---------------------- + + function Depends_On_Level + (Self : Entity_Id; Other : Entity_Id) return Boolean + is + Elm : Elmt_Id; + Dep : Entity_Id; + begin + if No (Self) then + return False; + elsif No (Other) then + return False; + end if; + + pragma Assert (Ekind (Self) = E_Assertion_Level); + pragma Assert (Ekind (Other) = E_Assertion_Level); + + if No (Parent_Levels (Self)) then + return False; + end if; + + Elm := First_Elmt (Parent_Levels (Self)); + while Present (Elm) loop + Dep := Node (Elm); + if Dep = Other or else Depends_On_Level (Dep, Other) then + return True; + end if; + + Next_Elmt (Elm); + end loop; + + return False; + end Depends_On_Level; + ----------------------------- -- Depends_On_Discriminant -- ----------------------------- @@ -9642,6 +9845,35 @@ package body Sem_Util is and then In_Open_Scopes (Scope (Pack)); end From_Nested_Package; + ---------------------- + -- From_Same_Aspect -- + ---------------------- + + function From_Same_Aspect (Self, Other : Node_Id) return Boolean is + begin + return + Present (Original_Aspect (Self)) + and then Present (Original_Aspect (Other)) + and then Original_Aspect (Self) = Original_Aspect (Other); + end From_Same_Aspect; + + ---------------------- + -- From_Same_Pragma -- + ---------------------- + + function From_Same_Pragma (Self, Other : Node_Id) return Boolean is + begin + return + (Present (Original_Pragma (Self)) + and then Present (Original_Pragma (Other)) + and then Original_Pragma (Self) = Original_Pragma (Other)) + or else (From_Aspect_Specification (Self) + and then From_Aspect_Specification (Other) + and then From_Same_Aspect + (Corresponding_Aspect (Self), + Corresponding_Aspect (Other))); + end From_Same_Pragma; + ----------------------- -- Gather_Components -- ----------------------- @@ -11088,6 +11320,10 @@ package body Sem_Util is if Is_Entity_Name (Subp) then Subp_Id := Entity (Subp); + if No (Subp_Id) then + return Empty; + end if; + if Ekind (Subp_Id) = E_Access_Subprogram_Type then Subp_Id := Directly_Designated_Type (Subp_Id); end if; @@ -11216,6 +11452,46 @@ package body Sem_Util is end if; end Get_Views; + ---------------------------------- + -- Has_Assertion_Level_Argument -- + ---------------------------------- + + function Has_Assertion_Level_Argument (N : Node_Id) return Boolean is + Assocs : List_Id; + Assoc : Node_Id; + Choice : Node_Id; + begin + if Nkind (N) = N_Aspect_Specification then + if Nkind (Expression (N)) /= N_Aggregate then + return False; + end if; + + Assocs := Component_Associations (Expression (N)); + + if No (Assocs) then + return False; + end if; + + Assoc := First (Assocs); + Choice := First (Choices (Assoc)); + + if Nkind (Choice) = N_Identifier then + return Present (Get_Assertion_Level (Chars (Choice))); + end if; + + return False; + else + pragma Assert (Nkind (N) = N_Pragma); + Assocs := Pragma_Argument_Associations (N); + Assoc := First (Assocs); + if Present (Assoc) and then Chars (Assoc) /= No_Name then + return Present (Get_Assertion_Level (Chars (Assoc))); + end if; + + return False; + end if; + end Has_Assertion_Level_Argument; + ------------------------------ -- Has_Compatible_Alignment -- ------------------------------ @@ -15864,14 +16140,14 @@ package body Sem_Util is (E1 : Entity_Id; E2 : Entity_Id) return Boolean is - Par : Entity_Id := E2; + Cursor : Entity_Id := E2; begin - while Present (Par) and then Par /= Standard_Standard loop - if Par = E1 then + while Present (Cursor) and then Cursor /= Standard_Standard loop + if Cursor = E1 then return True; end if; - Par := Scope (Par); + Cursor := Scope (Cursor); end loop; return False; @@ -19964,7 +20240,12 @@ package body Sem_Util is elsif Is_Tagged_Type (Typ) then return True; - -- Case of nondiscriminated record + -- Case of record type with no components + + elsif No (First_Component (Typ)) then + return False; + + -- Case of record type with components else declare @@ -23027,7 +23308,8 @@ package body Sem_Util is begin -- Ada 2005 or later, and formals present. The first formal must be -- of a type that supports prefix notation: a controlling argument, - -- a class-wide type, or an access to such. + -- a class-wide type, an access to such, or an untagged record type + -- (when compiling with Core_Extensions allowed). if Ada_Version >= Ada_2005 and then Present (First_Formal (E)) @@ -23035,7 +23317,9 @@ package body Sem_Util is and then (Is_Controlling_Formal (First_Formal (E)) or else Is_Class_Wide_Type (Etype (First_Formal (E))) - or else Is_Anonymous_Access_Type (Etype (First_Formal (E)))) + or else Is_Anonymous_Access_Type (Etype (First_Formal (E))) + or else (Core_Extensions_Allowed + and then Is_Record_Type (Etype (First_Formal (E))))) then Formal := Next_Formal (First_Formal (E)); while Present (Formal) loop @@ -26405,7 +26689,10 @@ package body Sem_Util is -- Policy_In_Effect -- ---------------------- - function Policy_In_Effect (Policy : Name_Id) return Name_Id is + function Policy_In_Effect + (Policy : Name_Id; + Level : Name_Id := No_Name) return Name_Id + is function Policy_In_List (List : Node_Id) return Name_Id; -- Determine the mode of a policy in a N_Pragma list @@ -26430,7 +26717,7 @@ package body Sem_Util is -- The current Check_Policy pragma matches the requested policy or -- appears in the single argument form (Assertion, policy_id). - if Chars (Arg1) in Name_Assertion | Policy then + if Chars (Arg1) in Name_Assertion | Policy | Level then return Chars (Arg2); end if; @@ -26444,6 +26731,8 @@ package body Sem_Util is Kind : Name_Id; + Level_Id : Entity_Id; + -- Start of processing for Policy_In_Effect begin @@ -26451,6 +26740,21 @@ package body Sem_Util is raise Program_Error; end if; + if Present (Level) then + Level_Id := Get_Assertion_Level (Level); + if No (Level_Id) then + raise Program_Error; + end if; + + if Level_Id = Standard_Level_Runtime then + return Name_Check; + elsif Level_Id = Standard_Level_Static + or else Depends_On_Level (Level_Id, Standard_Level_Static) + then + return Name_Ignore; + end if; + end if; + -- Inspect all policy pragmas that appear within scopes (if any) Kind := Policy_In_List (Check_Policy_List); @@ -26508,9 +26812,8 @@ package body Sem_Util is begin return Present (Predicate_Function (Typ)) - and then (GNATprove_Mode - or else (not Predicates_Ignored (Typ) - and then not Predicate_Checks_Suppressed (Empty))); + and then not Predicates_Ignored_In_Codegen (Typ) + and then not Predicate_Checks_Suppressed (Empty); end Predicate_Enabled; ---------------------------------- @@ -26576,6 +26879,18 @@ package body Sem_Util is return Empty; end Predicate_Failure_Expression; + ----------------------------------- + -- Predicates_Ignored_In_Codegen -- + ----------------------------------- + + function Predicates_Ignored_In_Codegen (N : Node_Id) return Boolean is + begin + return + Predicates_Ignored (N) + and then not CodePeer_Mode + and then not GNATprove_Mode; + end Predicates_Ignored_In_Codegen; + ---------------------------------- -- Predicate_Tests_On_Arguments -- ---------------------------------- @@ -28013,7 +28328,7 @@ package body Sem_Util is -- Nothing to do for an ignored Ghost entity because the entity will be -- eliminated from the tree. - elsif Is_Ignored_Ghost_Entity (T) then + elsif Is_Ignored_Ghost_Entity_In_Codegen (T) then return; -- Nothing to do if entity comes from a predefined file. Library files @@ -29300,11 +29615,7 @@ package body Sem_Util is begin Pref := N; - while Nkind (Pref) in N_Explicit_Dereference - | N_Indexed_Component - | N_Selected_Component - | N_Slice - loop + while Has_Prefix (Pref) loop Pref := Prefix (Pref); end loop; @@ -30837,7 +31148,7 @@ package body Sem_Util is ---------------------- package Interval_Sorting is - new Gnat.Heap_Sort_G (Move_Interval, Lt_Interval); + new GNAT.Heap_Sort_G (Move_Interval, Lt_Interval); ------------- -- Is_Null -- diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index 47fcc7d14eb0..ee9ecd2abb49 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -62,6 +62,15 @@ package Sem_Util is -- for the current unit. The declared entity is added to current scope, -- so the caller should push a new scope as required before the call. + procedure Add_Local_Declaration + (Decl : Node_Id; + N : Node_Id; + Scop : Entity_Id); + -- This procedure adds a declaration Decl to the innermost declarative + -- part that covers N, whose associated scope is Scop if Scop is present, + -- and before N if N is in this declarative part. The declared entity is + -- added to the scope associated with the declarative part. + function Add_Suffix (E : Entity_Id; Suffix : Character) return Name_Id; -- Returns the name of E adding Suffix @@ -560,6 +569,10 @@ package Sem_Util is -- of Old_Ent is set and Old_Ent has not yet been Frozen (i.e. Is_Frozen is -- False). + procedure Copy_Assertion_Policy_Attributes (New_Prag, Old_Prag : Node_Id); + -- Copy Is_Checked, Is_Ignored and Ghost_Assertion_Level attributes from + -- Old_Node. + function Copy_Component_List (R_Typ : Entity_Id; Loc : Source_Ptr) return List_Id; @@ -683,6 +696,11 @@ package Sem_Util is -- This is equivalent to Defining_Entity but it returns Empty for nodes -- without an entity instead of raising Program_Error. + function Defining_Entity_Of_Instance (N : Node_Id) return Entity_Id; + -- Given an N_Generic_Instantiation node, returns the defining entity of + -- the instance, that is to say the entity that is declared at N (which + -- is not the same as Defining_Entity (N), see Sem_Ch12). + function Denotes_Discriminant (N : Node_Id; Check_Concurrent : Boolean := False) return Boolean; @@ -707,6 +725,11 @@ package Sem_Util is function Denotes_Variable (N : Node_Id) return Boolean; -- Returns True if node N denotes a single variable without parentheses + function Depends_On_Level + (Self : Entity_Id; Other : Entity_Id) return Boolean; + -- Check if Assertion_Level Self depends on the Assertion_Level Other + -- either directly or transitively. + function Depends_On_Discriminant (N : Node_Id) return Boolean; -- Returns True if N denotes a discriminant or if N is a range, a subtype -- indication or a scalar subtype where one of the bounds is a @@ -1055,6 +1078,13 @@ package Sem_Util is -- to entities local to the nested package. In that case the package must -- be installed on the scope stack to prevent spurious visibility errors. + function From_Same_Aspect (Self, Other : Node_Id) return Boolean; + -- True if aspects Self and Other have the same Orginal_Aspect. + + function From_Same_Pragma (Self, Other : Node_Id) return Boolean; + -- True if pragmas Self and Other have the same Original Pragma or + -- they are from the same aspect. + procedure Gather_Components (Typ : Entity_Id; Comp_List : Node_Id; @@ -1343,6 +1373,10 @@ package Sem_Util is -- Result of Has_Compatible_Alignment test, description found below. Note -- that the values are arranged in increasing order of problematicness. + function Has_Assertion_Level_Argument (N : Node_Id) return Boolean; + -- Returns true if the first argument of a pragma or an aspect is using + -- an Assertion_Level association. + function Has_Compatible_Alignment (Obj : Entity_Id; Expr : Node_Id; @@ -1486,6 +1520,8 @@ package Sem_Util is -- for which the Extended_Access aspect has been specified, either -- explicitly or by inheritance. + -- WARNING: There is a matching C declaration of this subprogram in fe.h + function Is_Function_With_Side_Effects (Subp : Entity_Id) return Boolean; -- Return True if Subp is a function with side effects, ie. it has a -- (direct or inherited) pragma Side_Effects with static value True. @@ -1829,7 +1865,7 @@ package Sem_Util is function Is_Ancestor_Package (E1 : Entity_Id; E2 : Entity_Id) return Boolean; - -- True if package E1 is an ancestor of E2 other than E2 itself + -- True if package E1 is an ancestor of E2 function Is_Atomic_Object (N : Node_Id) return Boolean; -- Determine whether arbitrary node N denotes a reference to an atomic @@ -2082,14 +2118,42 @@ package Sem_Util is function Is_Ignored_Ghost_Entity_In_Codegen (N : Node_Id) return Boolean; -- True if N Is_Ignored_Ghost_Entity and GNATProve_mode and Codepeer_Mode -- are not active. + -- + -- See Is_Ignored_In_Codegen for instructions on when this function should + -- be used. function Is_Ignored_Ghost_Pragma_In_Codegen (N : Node_Id) return Boolean; -- True if N Is_Ignored_Ghost_Pragma and GNATProve_mode and Codepeer_Mode -- are not active. + -- + -- See Is_Ignored_In_Codegen for instructions on when this function should + -- be used. function Is_Ignored_In_Codegen (N : Node_Id) return Boolean; -- True if N Is_Ignored and GNATProve_mode and Codepeer_Mode are not -- active. + -- + -- Tools like GNATProve and Codepeer that use the frontend to get the + -- representation of the source code along with all of the code generated + -- for assertions. This includes even the ones that are ignored. The + -- frontend normally avoids the generation of such assertions and ghost + -- code if marked as ignored. However we should still enable the generation + -- when working in one of those tool modes. In most cases this means that + -- we should ignore the fact the given node is marked as ignored and behave + -- as if it was not. This involves checking attributes such as Is_Ignored + -- along with these tool modes. + -- + -- This function (and similar _In_Codegen functions) behaves as a wrapper + -- for such conditions. We should use this functions in scenarios where we + -- would normally stop the code generation for such ignored nodes. For + -- example in the expander where we normally transform non-ignored nodes. + -- Not doing so may lead to a partially expanded tree for those tools. + -- + -- On the other hand we should use these attributes directly when + -- propagating the Is_Ignored or other similar property related values + -- between nodes. Additionally we should be using the original attributes + -- when checking for the compatibility of the checked/ignored properties + -- between nodes. function Is_EVF_Expression (N : Node_Id) return Boolean; -- Determine whether node N denotes a reference to a formal parameter of @@ -2259,6 +2323,11 @@ package Sem_Util is -- legal. They will need to be checked again after subprogram call has -- been resolved. + function Is_Same_Or_Depends_On_Level + (Self : Entity_Id; Other : Entity_Id) return Boolean + is (Self = Other or else Depends_On_Level (Self, Other)); + -- Check if Assertion_Level Self is or depends on the Assertion_Level Other + function Is_Package_Contract_Annotation (Item : Node_Id) return Boolean; -- Determine whether aspect specification or pragma Item is one of the -- following package contract annotations: @@ -2913,7 +2982,10 @@ package Sem_Util is -- of the corresponding formal entity, otherwise returns Empty. Also -- handles the case of references to renamings of formals. - function Policy_In_Effect (Policy : Name_Id) return Name_Id; + function Policy_In_Effect + (Policy : Name_Id; + Level : Name_Id := No_Name) + return Name_Id; -- Given a policy, return the policy identifier associated with it. If no -- such policy is in effect, the value returned is No_Name. @@ -2931,6 +3003,13 @@ package Sem_Util is -- returns the result of recursing on the ancestor subtype. -- Otherwise, returns Empty. + function Predicates_Ignored_In_Codegen (N : Node_Id) return Boolean; + -- True if N Predicates_Ignored is set and GNATProve_mode and Codepeer_Mode + -- are not active. + -- + -- See Is_Ignored_In_Codegen for instructions on when this function should + -- be used. + function Predicate_Function_Needs_Membership_Parameter (Typ : Entity_Id) return Boolean is (Present (Predicate_Failure_Expression (Typ, Inherited_OK => True))); diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index 3d11d5c5aa67..2c15b80d12ef 100644 --- a/gcc/ada/sinfo.ads +++ b/gcc/ada/sinfo.ads @@ -798,6 +798,12 @@ package Sinfo is -- ancestor of the type of the aggregate in a generic context, if any, -- when the type is a derived tagged type. Otherwise Empty. + -- Aspect_Ghost_Assertion_Level + -- Assertion_Level that was originally used in the assertion level + -- associations of its arguments. These aspects are transformed to new + -- aspects with the associated arguments and the original assertion + -- level is stored in this attribute. + -- Aspect_On_Partial_View -- Present on an N_Aspect_Specification node. For an aspect that applies -- to a type entity, indicates whether the specification appears on the @@ -1470,7 +1476,7 @@ package Sinfo is -- Has_Target_Names -- Present in assignment statements. Indicates that the RHS contains - -- target names (see AI12-0125-3) and must be expanded accordingly. + -- target names ("@" -- see AI12-0125-3). -- Has_Wide_Character -- Present in string literals, set if any wide character (i.e. character @@ -1872,6 +1878,12 @@ package Sinfo is -- Indicates that an expression is a static expression according to the -- rules in RM-4.9. See Sem_Eval for details. + -- Is_Structural + -- Present in N_Generic_Instantiation nodes. Set if the instantiation is + -- structural, that is to say, is the unique anonymous instantiation of + -- the generic unit on the actual parameters done in the outermost scope + -- where it would be legal to declare an identical named instantiation. + -- Is_Subprogram_Descriptor -- Present in N_Object_Declaration, and set only for the object -- declaration generated for a subprogram descriptor in fast exception @@ -2122,6 +2134,12 @@ package Sinfo is -- indication carries a null-exclusion indicator, which is distinct from -- the null-exclusion indicator that may precede the access keyword. + -- Original_Pragma + -- When aspects with assertion level associations are transformed in to + -- individual aspects without the assertion level we store the original + -- aspect in this attribute. This is used to avoid duplicate detection on + -- these aspects. + -- Original_Discriminant -- Present in identifiers. Used in references to discriminants that -- appear in generic units. Because the names of the discriminants may be @@ -2138,6 +2156,12 @@ package Sinfo is -- interferes with the Entity field, making it impossible to preserve the -- original entity at the point of instantiation. + -- Original_Pragma + -- When pragmas with assertion level associations are transformed in to + -- individual pragmas without the assertion level we store the original + -- prama in this attribute. This is used to avoid duplicate detection on + -- these pragmas. + -- Others_Discrete_Choices -- When a case statement or variant is analyzed, the semantic checks -- determine the actual list of choices that correspond to an others @@ -2166,6 +2190,12 @@ package Sinfo is -- type, a subsequently generated error message indicates the position -- of its full declaration. + -- Pragma_Ghost_Assertion_Level + -- Assertion_Level that was originally used in the assertion level + -- associations of its arguments. These pragmas are transformed to new + -- pragmas with the associated arguments and the original assertion + -- level is stored in this attribute. + -- Present_Expr -- Present in an N_Variant node. This has a meaningful value only after -- Gigi has back annotated the tree with representation information. At @@ -2705,6 +2735,8 @@ package Sinfo is -- Is_Delayed_Aspect -- Is_Disabled -- Import_Interface_Present + -- Original_Pragma + -- Pragma_Ghost_Assertion_Level -- Uneval_Old_Warn -- Note: we should have a section on what pragmas are passed on to @@ -7093,6 +7125,7 @@ package Sinfo is -- Is_Elaboration_Warnings_OK_Node -- Is_Declaration_Level_Node -- Is_Known_Guaranteed_ABE + -- Is_Structural -- N_Procedure_Instantiation -- Sloc points to PROCEDURE @@ -7109,6 +7142,7 @@ package Sinfo is -- Must_Override set if overriding indicator present -- Must_Not_Override set if not_overriding indicator present -- Is_Known_Guaranteed_ABE + -- Is_Structural -- N_Function_Instantiation -- Sloc points to FUNCTION @@ -7125,6 +7159,7 @@ package Sinfo is -- Must_Override set if overriding indicator present -- Must_Not_Override set if not_overriding indicator present -- Is_Known_Guaranteed_ABE + -- Is_Structural -- Note: overriding indicator is an Ada 2005 feature @@ -7627,7 +7662,9 @@ package Sinfo is -- Is_Delayed_Aspect -- Is_Disabled -- Is_Boolean_Aspect + -- Aspect_Ghost_Assertion_Level -- Aspect_On_Partial_View + -- Original_Aspect -- Note: Aspect_Specification is an Ada 2012 feature diff --git a/gcc/ada/snames.adb-tmpl b/gcc/ada/snames.adb-tmpl index 264b81e78caa..fcfd3901e17b 100644 --- a/gcc/ada/snames.adb-tmpl +++ b/gcc/ada/snames.adb-tmpl @@ -281,10 +281,12 @@ package body Snames is return Pragma_Storage_Size; when Name_Storage_Unit => return Pragma_Storage_Unit; + when Name_Unsigned_Base_Range => + return Pragma_Unsigned_Base_Range; when First_Pragma_Name .. Last_Pragma_Name => return Pragma_Id'Val (N - First_Pragma_Name); when others => - return Unknown_Pragma; + return Pragma_Unknown; end case; end Get_Pragma_Id; @@ -508,7 +510,8 @@ package body Snames is or else N = Name_Priority or else N = Name_Secondary_Stack_Size or else N = Name_Storage_Size - or else N = Name_Storage_Unit; + or else N = Name_Storage_Unit + or else N = Name_Unsigned_Base_Range; end Is_Pragma_Name; --------------------------------- diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl index 272e10ba1d58..d6fe60ba89ac 100644 --- a/gcc/ada/snames.ads-tmpl +++ b/gcc/ada/snames.ads-tmpl @@ -424,6 +424,7 @@ package Snames is Name_Aggregate_Individually_Assign : constant Name_Id := N + $; -- GNAT Name_Allow_Integer_Address : constant Name_Id := N + $; -- GNAT Name_Annotate : constant Name_Id := N + $; -- GNAT + Name_Assertion_Level : constant Name_Id := N + $; -- GNAT Name_Assertion_Policy : constant Name_Id := N + $; -- Ada 05 Name_Assume_No_Invalid_Values : constant Name_Id := N + $; -- GNAT Name_C_Pass_By_Copy : constant Name_Id := N + $; -- GNAT @@ -573,7 +574,7 @@ package Snames is Name_Extensions_Visible : constant Name_Id := N + $; -- GNAT Name_External : constant Name_Id := N + $; -- GNAT Name_Finalize_Storage_Only : constant Name_Id := N + $; -- GNAT - Name_First_Controlling_Parameter : constant Name_Id := N + $; + Name_First_Controlling_Parameter : constant Name_Id := N + $; -- GNAT Name_Ghost : constant Name_Id := N + $; -- GNAT Name_Global : constant Name_Id := N + $; -- GNAT Name_Ident : constant Name_Id := N + $; -- GNAT @@ -721,6 +722,13 @@ package Snames is Name_Unreferenced : constant Name_Id := N + $; -- GNAT Name_Unreferenced_Objects : constant Name_Id := N + $; -- GNAT Name_Unreserve_All_Interrupts : constant Name_Id := N + $; -- GNAT + + -- Note: Unsigned_Base_Range is not in this list because its name matches + -- the name of the corresponding attribute. However, it is included in the + -- definition of the type Pragma_Id and the functions Get_Pragma_Id and + -- Is_Pragma_Name correctly recognize and process Unsigned_Base_Range. + -- Unsigned_Base_Range is a Core Extension pragma. + Name_Unused : constant Name_Id := N + $; -- GNAT Name_Volatile : constant Name_Id := N + $; Name_Volatile_Components : constant Name_Id := N + $; @@ -1056,6 +1064,7 @@ package Snames is Name_Unconstrained_Array : constant Name_Id := N + $; -- GNAT Name_Universal_Literal_String : constant Name_Id := N + $; -- GNAT Name_Unrestricted_Access : constant Name_Id := N + $; -- GNAT + Name_Unsigned_Base_Range : constant Name_Id := N + $; -- GNAT Name_Update : constant Name_Id := N + $; -- GNAT Name_VADS_Size : constant Name_Id := N + $; -- GNAT Name_Val : constant Name_Id := N + $; @@ -1409,6 +1418,10 @@ package Snames is Name_Reference_Control_Type : constant Name_Id := N + $; Name_Get_Element_Access : constant Name_Id := N + $; + -- Names used to implement Assertion_Levels + + Name_uDefault_Assertion_Level : constant Name_Id := N + $; + -- Names for Ada 202x Aggregate aspect. Name_Aggregate is already -- present for gprbuild. @@ -1595,6 +1608,7 @@ package Snames is Attribute_Unconstrained_Array, Attribute_Universal_Literal_String, Attribute_Unrestricted_Access, + Attribute_Unsigned_Base_Range, Attribute_Update, Attribute_VADS_Size, Attribute_Val, @@ -1773,6 +1787,7 @@ package Snames is Pragma_Aggregate_Individually_Assign, Pragma_Allow_Integer_Address, Pragma_Annotate, + Pragma_Assertion_Level, Pragma_Assertion_Policy, Pragma_Assume_No_Invalid_Values, Pragma_C_Pass_By_Copy, @@ -2027,10 +2042,11 @@ package Snames is Pragma_Secondary_Stack_Size, Pragma_Storage_Size, Pragma_Storage_Unit, + Pragma_Unsigned_Base_Range, -- The value to represent an unknown or unrecognized pragma - Unknown_Pragma); + Pragma_Unknown); ----------------------------------- -- Queuing Policy ID definitions -- @@ -2151,7 +2167,7 @@ package Snames is -- to call this function with a name that is not the name of a check. function Get_Pragma_Id (N : Name_Id) return Pragma_Id; - -- Returns Id of pragma corresponding to given name. Returns Unknown_Pragma + -- Returns Id of pragma corresponding to given name. Returns Pragma_Unknown -- if N is not a name of a known (Ada defined or GNAT-specific) pragma. -- Note that the function also works correctly for names of pragmas that -- are not included in the main list of pragma Names (e.g. Name_CPU returns diff --git a/gcc/ada/snames.h-tmpl b/gcc/ada/snames.h-tmpl index f01642ffbff8..a9370235438f 100644 --- a/gcc/ada/snames.h-tmpl +++ b/gcc/ada/snames.h-tmpl @@ -35,7 +35,7 @@ enum Name_Id : Int /* Define the numeric values for attributes. */ -enum Attribute_Id : unsigned char +enum Attribute_Id : Byte { Attr_ !! TEMPLATE INSERTION POINT }; @@ -46,7 +46,7 @@ enum Attribute_Id : unsigned char static inline Attribute_Id Get_Attribute_Id (int id) { - extern unsigned char snames__get_attribute_id (int); + extern Byte snames__get_attribute_id (int); return (Attribute_Id) snames__get_attribute_id (id); } @@ -64,7 +64,7 @@ extern Boolean Is_Pragma_Name (Name_Id); /* Define the numeric values for the pragmas. */ -enum Pragma_Id : Byte +enum Pragma_Id : Word { Pragma_ !! TEMPLATE_INSERTION_POINT }; @@ -75,7 +75,7 @@ enum Pragma_Id : Byte static inline Pragma_Id Get_Pragma_Id (int id) { - extern unsigned char snames__get_pragma_id (int); + extern Word snames__get_pragma_id (int); return (Pragma_Id) snames__get_pragma_id (id); } diff --git a/gcc/ada/sprint.adb b/gcc/ada/sprint.adb index 7a9749287af8..f5caa3d1b78d 100644 --- a/gcc/ada/sprint.adb +++ b/gcc/ada/sprint.adb @@ -2190,6 +2190,13 @@ package body Sprint is Indent_End; end if; + if Present (Finally_Statements (Node)) then + Write_Indent_Str ("finally"); + Indent_Begin; + Sprint_Node_List (Finally_Statements (Node)); + Indent_End; + end if; + Sprint_At_End_Proc (Node); when N_Identifier => diff --git a/gcc/ada/stand.ads b/gcc/ada/stand.ads index 9b511d584c86..770b7fa44c25 100644 --- a/gcc/ada/stand.ads +++ b/gcc/ada/stand.ads @@ -484,4 +484,16 @@ package Stand is Standard_Op_Shift_Right_Arithmetic : Entity_Id; -- These entities are used for shift operators generated by the expander + Standard_Level_Static : Entity_Id; + -- Assertion_Level that indicates that the associated entity is never + -- checked. + + Standard_Level_Runtime : Entity_Id; + -- Assertion_Level that indicates that the associated entity is always + -- checked. + + Standard_Level_Default : Entity_Id; + -- A special internally defined Assertion_Level that is applied to entities + -- that were not using Assertion_Levels syntactically. + end Stand; diff --git a/gcc/ada/styleg.adb b/gcc/ada/styleg.adb index 20945fbb65f7..46499fff7f1d 100644 --- a/gcc/ada/styleg.adb +++ b/gcc/ada/styleg.adb @@ -330,7 +330,7 @@ package body Styleg is -- Do we need to worry about UTF_32 line terminators here ??? S := Scan_Ptr + 3; - while Source (S) not in Line_Terminator loop + while Source (S) not in EOF | Line_Terminator loop S := S + 1; end loop; diff --git a/gcc/ada/switch-c.adb b/gcc/ada/switch-c.adb index efad12c9c408..3b4375700c01 100644 --- a/gcc/ada/switch-c.adb +++ b/gcc/ada/switch-c.adb @@ -636,6 +636,46 @@ package body Switch.C is Generate_Processed_File := True; Ptr := Ptr + 1; + if Ptr <= Max + and then Switch_Chars (Ptr) in 'b' | 'c' | 'e' + then + case Switch_Chars (Ptr) is + when 'b' => + Opt.Blank_Deleted_Lines := True; + Opt.Comment_Deleted_Lines := False; + Opt.Empty_Comment_Deleted_Lines := False; + + when 'c' => + Opt.Blank_Deleted_Lines := False; + Opt.Comment_Deleted_Lines := True; + Opt.Empty_Comment_Deleted_Lines := False; + + when 'e' => + Opt.Blank_Deleted_Lines := False; + Opt.Comment_Deleted_Lines := False; + Opt.Empty_Comment_Deleted_Lines := True; + + when others => + raise Program_Error; + end case; + + Ptr := Ptr + 1; + + -- Default to emitting blank lines for deleted lines + -- when generating a preprocessor output file. This is + -- despite the fact that when the file isn't being + -- generated, we emit empty comment lines for the + -- internally generated output (to avoid conflicts + -- with style switches -gnatyu and -gnatyM), but is + -- done for compatibility with the behavior of -gnateG + -- prior to adding support for empty comment lines. + + else + Opt.Blank_Deleted_Lines := True; + Opt.Comment_Deleted_Lines := False; + Opt.Empty_Comment_Deleted_Lines := False; + end if; + -- -gnateH (set reverse Bit_Order threshold to 64) when 'H' => diff --git a/gcc/ada/targparm.adb b/gcc/ada/targparm.adb index 9496d538b68a..d284e61a013f 100644 --- a/gcc/ada/targparm.adb +++ b/gcc/ada/targparm.adb @@ -307,7 +307,7 @@ package body Targparm is -- Test for type Address is private - elsif Looking_At_Skip (" type Address is private;") then + elsif Looking_At_Skip (" type Address is private") then Opt.Address_Is_Private := True; goto Line_Loop_Continue; diff --git a/gcc/ada/tbuild.adb b/gcc/ada/tbuild.adb index 52fdbfc2163f..2840707f2e93 100644 --- a/gcc/ada/tbuild.adb +++ b/gcc/ada/tbuild.adb @@ -151,6 +151,21 @@ package body Tbuild is null; end Discard_Node; + -------------------------- + -- Make_Assertion_Level -- + -------------------------- + + function Make_Assertion_Level + (Loc : Source_Ptr; Nam : Name_Id) return Entity_Id + is + Level : constant Entity_Id := Make_Defining_Identifier (Loc, Nam); + begin + Mutate_Ekind (Level, E_Assertion_Level); + Set_Etype (Level, Standard_Void_Type); + Set_Scope (Level, Standard_Standard); + return Level; + end Make_Assertion_Level; + ------------------------------------------- -- Make_Byte_Aligned_Attribute_Reference -- ------------------------------------------- diff --git a/gcc/ada/tbuild.ads b/gcc/ada/tbuild.ads index dc8b7f310c08..3a0adff97c7a 100644 --- a/gcc/ada/tbuild.ads +++ b/gcc/ada/tbuild.ads @@ -60,6 +60,10 @@ package Tbuild is -- effect (e.g. a call to the parser to parse a list of compilation -- units), but the List_Id value is not required. + function Make_Assertion_Level + (Loc : Source_Ptr; Nam : Name_Id) return Entity_Id; + -- Create a new Defining_Identifier node for an Assertion_Level + function Make_Byte_Aligned_Attribute_Reference (Sloc : Source_Ptr; Prefix : Node_Id; diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c index 89f887556c07..85a5c0dcbd95 100644 --- a/gcc/ada/terminals.c +++ b/gcc/ada/terminals.c @@ -724,13 +724,16 @@ __gnat_setup_child_communication if (bRet == FALSE) { cpid = -1; } - - dwRet = buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24); - if (dwRet != 0) { - cpid = -1; + else { + dwRet = buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24); + if (dwRet != 0) { + cpid = -1; + } + else { + cpid = buf[4] | (buf[5] << 8) | (buf[6] << 16) | (buf[7] << 24); + } } - cpid = buf[4] | (buf[5] << 8) | (buf[6] << 16) | (buf[7] << 24); process->pid = cpid; } diff --git a/gcc/ada/treepr.adb b/gcc/ada/treepr.adb index 857b9263f012..fbad71a3765a 100644 --- a/gcc/ada/treepr.adb +++ b/gcc/ada/treepr.adb @@ -1047,9 +1047,11 @@ package body Treepr is FD : Field_Descriptor; Format : UI_Format := Auto) is - NN : constant Node_Id := Node_To_Fetch_From (N, Field); + NN : constant Node_Id := Node_To_Fetch_From_If_Set (N, Field); + -- If NN is Empty, it means that we cannot compute the + -- Node_To_Fetch_From, so we simply skip this field. begin - if not Field_Is_Initial_Zero (N, Field) then + if Present (NN) and then not Field_Is_Initial_Zero (N, Field) then Print_Field (Prefix, Image (Field), NN, FD, Format); end if; end Print_Entity_Field; diff --git a/gcc/ada/types.h b/gcc/ada/types.h index d0a1a04f979f..98ef06089fce 100644 --- a/gcc/ada/types.h +++ b/gcc/ada/types.h @@ -57,6 +57,9 @@ typedef Int Pos; /* 8-bit unsigned integer */ typedef unsigned char Byte; +/* 16-bit unsigned integer */ +typedef unsigned short Word; + /* 8-Bit Character and String Types: */ /* 8-bit character type */ diff --git a/gcc/ada/usage.adb b/gcc/ada/usage.adb index 5b87bb54dcaa..bf8417a92c85 100644 --- a/gcc/ada/usage.adb +++ b/gcc/ada/usage.adb @@ -196,8 +196,8 @@ begin -- Line for -gnateG switch - Write_Switch_Char ("eG"); - Write_Line ("Generate preprocessed source"); + Write_Switch_Char ("eG[?]"); + Write_Line ("Generate preprocessed source (?=b/c/e)"); -- Line for -gnateH switch @@ -674,7 +674,7 @@ begin Write_Line (" D check declared identifiers in mixed case"); Write_Line (" e check end/exit labels present"); Write_Line (" f check no form feeds/vertical tabs in source"); - Write_Line (" g check standard GNAT style rules, same as ydISux"); + Write_Line (" g check GNAT style rules, same as ydISuxz"); Write_Line (" h check no horizontal tabs in source"); Write_Line (" i check if-then layout"); Write_Line (" I check mode in"); diff --git a/gcc/analyzer/ChangeLog b/gcc/analyzer/ChangeLog index aca818632712..3de38b232b76 100644 --- a/gcc/analyzer/ChangeLog +++ b/gcc/analyzer/ChangeLog @@ -1,3 +1,155 @@ +2025-10-16 David Malcolm + + * ana-state-to-diagnostic-state.cc: Reimplement throughout to use + json::property instances found within custom_sarif_properties + throughout, rather than types in diagnostics::state_graphs. + * ana-state-to-diagnostic-state.h: Likewise. + * checker-event.cc: Likewise. + * sm-malloc.cc: Likewise. + +2025-10-09 David Malcolm + + * access-diagram.cc: Update for renaming of fields of binding_key. + * ana-state-to-diagnostic-state.cc: Likewise. + * bounds-checking.cc: Likewise. Add store_manager param. + * call-summary.cc: Likewise. + * diagnostic-manager.cc: Drop includes of "basic-block.h" and + "gimple.h". + * engine.cc: Likewise. + * infinite-recursion.cc: Update for renaming of fields of + binding_key. + * kf.cc: Pass store_manager to mark_as_escaped. + * program-state.cc: Update for renaming of fields of binding_key. + * region-model-asm.cc: Pass store manager to + get_or_create_cluster. + * region-model-reachability.cc: Likewise. Update for renaming of + fields of binding_key. + * region-model.cc: Likewise. + (struct bad_pointer_finder): Drop. + (region_model::poison_any_pointers_to_descendents): Implement + iteration directly, rather than using store::for_each_binding. + Drop return value. + (selftest::test_struct): Set field in order y then x. Verify + that iteration yields bindings in order x then y. + * region-model.h + (region_model::poison_any_pointers_to_descendents): Drop return + value. + * region.cc: Pass store manager to get_or_create_cluster. + * store.cc (binding_map::const_iterator::operator==): New. + (binding_map::const_iterator::operator++): New. + (binding_map::const_iterator::operator*): New. + (binding_map::iterator::operator==): New. + (binding_map::iterator::operator++): New. + (binding_map::iterator::operator*): New. + (binding_map::binding_map): Reimplement. + (binding_map::operator=): Reimplement. + (binding_map::operator==): Reimplement. + (binding_map::hash): Reimplement. + (binding_map::get): Reimplement. + (binding_map::put): Reimplement. + (binding_map::overwrite): New. + (binding_map::remove): New. + (binding_map::begin): New. + (binding_map::end): New. + (binding_map::elements): New. + (binding_map::dump_to_pp): Reimplement. + (binding_map::to_json): Iterate over *this directly; drop sort. + (binding_map::add_to_tree_widget): Likewise. + (binding_map::cmp): Reimplement. + (binding_map::get_overlapping_bindings): Update for field + renamings. + (binding_cluster::binding_cluster): Add store_mgr param. + (binding_cluster::validate): Update for field renamings. + (binding_cluster::bind_compound_sval): Likewise. + (binding_cluster::purge_state_involving): Likewise. + (binding_cluster::maybe_get_compound_binding): Likewise. Add + store_mgr param. + (binding_cluster::can_merge_p): Likewise. Update for new + implementation. + (binding_cluster::make_unknown_relative_to): Likewise. + (binding_cluster::on_unknown_fncall): Likewise. + (binding_cluster::on_asm): Likewise. + (binding_cluster::get_representative_path_vars): Likewise. + (store::set_value): Likewise. + (store::on_maybe_live_values): Pass around store_manager. + (store::fill_region): Likewise. + (store::mark_region_as_unknown): Likewise. + (store::get_or_create_cluster): Likewise. + (store::can_merge_p): Likewise. + (store::mark_as_escaped): Likewise. + (store::canonicalize): Update for field renamings. + (store::loop_replay_fixup): Likewise. Pass around store_manager. + (store::replay_call_summary_cluster): Likewise. + (selftest::test_binding_map_ops): New. + (selftest::analyzer_store_cc_tests): Call it. + * store.h (class binding_map): Reimplement. + (binding_map::map_t): Drop. + (struct binding_map::symbolic_binding): New. + (binding_map::concrete_bindings_t): New. + (binding_map::symbolic_bindings_t): New. + (struct binding_map::bindings_pair): New. + (class binding_map::const_iterator): New. + (class binding_map::iterator): New. + (binding_map::get): Reimplement. + (binding_map::overwrite): New decl. + (binding_map::remove): Reimplement. + (binding_map::clear): Reimplement. + (binding_map::put): Reimplement. + (binding_map::empty_p): Reimplement. + (binding_map::begin): Reimplement. + (binding_map::end): Reimplement. + (binding_map::elements): Reimplement. + (binding_map::m_map): Drop field. + (binding_map::m_store_mgr): New field. + (binding_map::m_concrete): New field. + (binding_map::m_symbolic): New field. + (BindingVisitor): Drop. + (binding_cluster::map_t): Drop. + (binding_cluster::iterator_t): Reimplement. + (binding_cluster::const_iterator_t): New. + (binding_cluster::binding_cluster): Add store_mgr param. + (binding_cluster::for_each_value): Reimplement. + (binding_cluster::empty_p): Reimplement. + (binding_cluster::for_each_binding): Drop. + (binding_cluster::begin): Split into const/non-const overloads. + (binding_cluster::get_map): Add non-const overload. + (store::get_or_create_cluster): Add store_mgr param. + (store::mark_as_escaped): Likewise. + (store::for_each_binding): Drop. + (store::on_maybe_live_values): Add store_mgr param. + * svalue.cc (compound_svalue::compound_svalue): Reimplement. + (compound_svalue::accept): Likewise. + (compound_svalue::calc_complexity): Likewise. + (compound_svalue::maybe_fold_bits_within): Likewise. + * svalue.h (compound_svalue::const_iterator_t): New. + (compound_svalue::begin): Split into const/non-const overloads. + (compound_svalue::end): Likewise. + +2025-10-03 David Malcolm + + Revert: + 2025-10-03 David Malcolm + + * ana-state-to-diagnostic-state.cc: Reimplement throughout to use + json::property instances found within custom_sarif_properties + throughout, rather than types in diagnostics::state_graphs. + * ana-state-to-diagnostic-state.h: Likewise. + * checker-event.cc: Likewise. + * sm-malloc.cc: Likewise. + +2025-10-02 David Malcolm + + * ana-state-to-diagnostic-state.cc: Reimplement throughout to use + json::property instances found within custom_sarif_properties + throughout, rather than types in diagnostics::state_graphs. + * ana-state-to-diagnostic-state.h: Likewise. + * checker-event.cc: Likewise. + * sm-malloc.cc: Likewise. + +2025-09-15 Alexandre Oliva + + * kf.cc (register_known_functions): Add __get_errno_ptr. + 2025-08-29 David Malcolm * pending-diagnostic.cc: Include "diagnostics/logging.h". diff --git a/gcc/analyzer/access-diagram.cc b/gcc/analyzer/access-diagram.cc index 166be08f1c28..6e301b9132b8 100644 --- a/gcc/analyzer/access-diagram.cc +++ b/gcc/analyzer/access-diagram.cc @@ -1216,8 +1216,8 @@ class compound_svalue_spatial_item : public svalue_spatial_item auto_vec binding_keys; for (auto iter : map) { - const binding_key *key = iter.first; - const svalue *bound_sval = iter.second; + const binding_key *key = iter.m_key; + const svalue *bound_sval = iter.m_sval; if (const concrete_binding *concrete_key = key->dyn_cast_concrete_binding ()) { diff --git a/gcc/analyzer/ana-state-to-diagnostic-state.cc b/gcc/analyzer/ana-state-to-diagnostic-state.cc index 996538c37852..35740362b180 100644 --- a/gcc/analyzer/ana-state-to-diagnostic-state.cc +++ b/gcc/analyzer/ana-state-to-diagnostic-state.cc @@ -39,38 +39,55 @@ along with GCC; see the file COPYING3. If not see namespace ana { -using namespace ::diagnostics::state_graphs; +namespace node_properties = custom_sarif_properties::state_graphs::node; static void -set_wi_attr (state_node_ref state_node, - const char *attr_name, +set_wi_attr (diagnostics::digraphs::node &state_node, + const json::string_property &property, const wide_int_ref &w, signop sgn) { pretty_printer pp; pp_wide_int (&pp, w, sgn); - state_node.set_attr (attr_name, pp_formatted_text (&pp)); + state_node.set_property (property, pp_formatted_text (&pp)); } static void -set_type_attr (state_node_ref state_node, const_tree type) +set_type_attr (diagnostics::digraphs::node &state_node, + const_tree type) { gcc_assert (type); pretty_printer pp; pp_format_decoder (&pp) = default_tree_printer; pp_printf (&pp, "%T", type); - state_node.set_type (pp_formatted_text (&pp)); + state_node.set_property (node_properties::type, + pp_formatted_text (&pp)); } static void -set_bits_attr (state_node_ref state_node, +set_bits_attr (diagnostics::digraphs::node & state_node, bit_range bits) { pretty_printer pp; bits.dump_to_pp (&pp); - state_node.set_attr ("bits", pp_formatted_text (&pp)); + state_node.set_property (node_properties::bits, + pp_formatted_text (&pp)); } +static void +set_value_attrs (diagnostics::digraphs::node &state_node, + const svalue &sval) +{ + state_node.set_property (node_properties::value, + sval.to_json ()); + pretty_printer pp; + pp_format_decoder (&pp) = default_tree_printer; + sval.dump_to_pp (&pp, true); + state_node.set_property (node_properties::value_str, + pp_formatted_text (&pp)); +} + + // class analyzer_state_graph : public diagnostics::digraphs::digraph analyzer_state_graph::analyzer_state_graph (const program_state &state, @@ -86,7 +103,7 @@ analyzer_state_graph::analyzer_state_graph (const program_state &state, for (auto cluster_iter : *state.m_region_model->get_store ()) for (auto binding_iter : *cluster_iter.second) { - const svalue *svalue = binding_iter.second; + const svalue *svalue = binding_iter.m_sval; if (const region *reg = svalue->maybe_get_region ()) if (svalue->get_type () && !reg->get_type ()) { @@ -141,34 +158,34 @@ analyzer_state_graph::analyzer_state_graph (const program_state &state, /* Ensure we have a node for the dst region. This could lead to additional pending edges. */ - auto dst_node = get_or_create_state_node (item.m_dst_reg); - add_edge (nullptr, item.m_src_node.m_node, dst_node.m_node); + auto &dst_node = get_or_create_state_node (item.m_dst_reg); + add_edge (nullptr, item.m_src_node, dst_node); } } -state_node_ref +diagnostics::digraphs::node & analyzer_state_graph::get_or_create_state_node (const region ®) { auto existing = m_region_to_state_node_map.find (®); if (existing != m_region_to_state_node_map.end ()) return *existing->second; - auto ref = create_and_add_state_node (reg); - m_region_to_state_node_map[®] = &ref.m_node; - return ref; + auto &state_node = create_and_add_state_node (reg); + m_region_to_state_node_map[®] = &state_node; + return state_node; } -state_node_ref +diagnostics::digraphs::node & analyzer_state_graph::create_and_add_state_node (const region ®) { auto node = create_state_node (reg); - state_node_ref result = *node; + diagnostics::digraphs::node &result = *node; if (auto parent_reg = reg.get_parent_region ()) if (parent_reg->get_kind () != RK_ROOT) { - auto parent_state_node = get_or_create_state_node (*parent_reg); - parent_state_node.m_node.add_child (std::move (node)); + auto &parent_state_node = get_or_create_state_node (*parent_reg); + parent_state_node.add_child (std::move (node)); return result; } add_node (std::move (node)); @@ -264,19 +281,18 @@ analyzer_state_graph::make_node_id (const region ®) std::unique_ptr analyzer_state_graph:: -make_state_node (diagnostics::state_graphs::node_kind kind, +make_state_node (enum node_properties::kind_t kind, std::string id) { auto node = std::make_unique (*this, std::move (id)); - state_node_ref node_ref (*node); - node_ref.set_node_kind (kind); + node->set_property (node_properties::kind_prop, kind); return node; } std::unique_ptr analyzer_state_graph:: make_memspace_state_node (const region ®, - diagnostics::state_graphs::node_kind kind) + enum node_properties::kind_t kind) { return make_state_node (kind, make_node_id (reg)); } @@ -296,7 +312,7 @@ analyzer_state_graph::create_state_node (const region ®) const frame_region &frame_reg = static_cast (reg); - node = make_state_node (diagnostics::state_graphs::node_kind::stack_frame, + node = make_state_node (node_properties::kind_t::stack_frame, make_node_id (reg)); node->set_logical_loc (m_logical_loc_mgr.key_from_tree (frame_reg.get_fndecl ())); @@ -304,58 +320,59 @@ analyzer_state_graph::create_state_node (const region ®) pretty_printer pp; pp_format_decoder (&pp) = default_tree_printer; pp_printf (&pp, "%E", frame_reg.get_fndecl ()); - node->set_attr (STATE_NODE_PREFIX, "function", - pp_formatted_text (&pp)); + node->set_property (node_properties::function, + pp_formatted_text (&pp)); } } break; case RK_GLOBALS: node = make_memspace_state_node (reg, - diagnostics::state_graphs::node_kind::globals); + node_properties::kind_t::globals); break; case RK_CODE: node = make_memspace_state_node (reg, - diagnostics::state_graphs::node_kind::code); + node_properties::kind_t::code); break; case RK_FUNCTION: node = make_memspace_state_node (reg, - diagnostics::state_graphs::node_kind::function); + node_properties::kind_t::function); // TODO break; case RK_STACK: node = make_memspace_state_node (reg, - diagnostics::state_graphs::node_kind::stack); + node_properties::kind_t::stack); break; case RK_HEAP: node = make_memspace_state_node (reg, - diagnostics::state_graphs::node_kind::heap_); + node_properties::kind_t::heap_); break; case RK_THREAD_LOCAL: node = make_memspace_state_node (reg, - diagnostics::state_graphs::node_kind::thread_local_); + node_properties::kind_t::thread_local_); break; case RK_ROOT: gcc_unreachable (); break; case RK_SYMBOLIC: node = make_memspace_state_node (reg, - diagnostics::state_graphs::node_kind::other); + node_properties::kind_t::other); break; case RK_DECL: { - node = make_state_node (diagnostics::state_graphs::node_kind::variable, + node = make_state_node (node_properties::kind_t::variable, make_node_id (reg)); const decl_region &decl_reg = static_cast (reg); - state_node_ref node_ref (*node); + { pretty_printer pp; pp_format_decoder (&pp) = default_tree_printer; pp_printf (&pp, "%E", decl_reg.get_decl ()); - node_ref.set_name (pp_formatted_text (&pp)); + node->set_property (node_properties::name, + pp_formatted_text (&pp)); } set_type_attr (*node, TREE_TYPE (decl_reg.get_decl ())); } @@ -377,14 +394,15 @@ analyzer_state_graph::create_state_node (const region ®) case RK_ERRNO: case RK_PRIVATE: case RK_UNKNOWN: - node = make_state_node (diagnostics::state_graphs::node_kind::other, + node = make_state_node (node_properties::kind_t::other, make_node_id (reg)); break; case RK_HEAP_ALLOCATED: case RK_ALLOCA: - node = make_memspace_state_node (reg, - diagnostics::state_graphs::node_kind::dynalloc_buffer); + node + = make_memspace_state_node (reg, + node_properties::kind_t::dynalloc_buffer); set_attr_for_dynamic_extents (reg, *node); break; } @@ -417,17 +435,17 @@ create_state_nodes_for_binding_cluster (const binding_cluster &cluster, concrete_bindings_t conc_bindings; for (auto iter : cluster) { - const binding_key *key = iter.first; - const svalue *svalue = iter.second; + const binding_key *key = iter.m_key; + const svalue *svalue = iter.m_sval; if (auto conc_key = key->dyn_cast_concrete_binding ()) conc_bindings[conc_key->get_bit_range ()] = svalue; if (const region *reg = svalue->maybe_get_region ()) get_or_create_state_node (*reg); } - auto ref = get_or_create_state_node (*cluster.get_base_region ()); + auto &ref = get_or_create_state_node (*cluster.get_base_region ()); - ref.m_node.add_child (create_state_node_for_conc_bindings (conc_bindings)); + ref.add_child (create_state_node_for_conc_bindings (conc_bindings)); const region *typed_reg = cluster.get_base_region (); if (!typed_reg->get_type ()) @@ -455,23 +473,18 @@ create_state_nodes_for_binding_cluster (const binding_cluster &cluster, std::unique_ptr analyzer_state_graph::create_state_node_for_conc_bindings (const concrete_bindings_t &conc_bindings) { - auto node = make_state_node (diagnostics::state_graphs::node_kind::other, + auto node = make_state_node (node_properties::kind_t::other, make_node_id ("concrete-bindings")); for (auto iter : conc_bindings) { const bit_range bits = iter.first; const svalue *sval = iter.second; auto binding_state_node - = make_state_node (diagnostics::state_graphs::node_kind::other, + = make_state_node (node_properties::kind_t::other, make_node_id ("binding")); set_bits_attr (*binding_state_node, bits); - { - pretty_printer pp; - pp_format_decoder (&pp) = default_tree_printer; - sval->dump_to_pp (&pp, true); - binding_state_node->set_attr (STATE_NODE_PREFIX, "value", - pp_formatted_text (&pp)); - } + gcc_assert (sval); + set_value_attrs (*binding_state_node, *sval); node->add_child (std::move (binding_state_node)); } return node; @@ -496,27 +509,28 @@ analyzer_state_graph::get_bit_range_within_base_region (const region ®, void analyzer_state_graph:: -populate_state_node_for_typed_region (state_node_ref node, +populate_state_node_for_typed_region (diagnostics::digraphs::node &state_node, const region ®, const concrete_bindings_t &conc_bindings, bool create_all) { const_tree reg_type = reg.get_type (); gcc_assert (reg_type); - set_type_attr (node, reg_type); + set_type_attr (state_node, reg_type); bit_range bits (0, 0); if (get_bit_range_within_base_region (reg, bits)) { - set_bits_attr (node, bits); + set_bits_attr (state_node, bits); auto search = conc_bindings.find (bits); if (search != conc_bindings.end ()) { const svalue *bound_sval = search->second; - node.set_json_attr ("value", bound_sval->to_json ()); + gcc_assert (bound_sval); + set_value_attrs (state_node, *bound_sval); if (const region *dst_reg = bound_sval->maybe_get_region ()) - m_pending_edges.push_back ({node, *dst_reg}); + m_pending_edges.push_back ({state_node, *dst_reg}); } } @@ -555,9 +569,10 @@ populate_state_node_for_typed_region (state_node_ref node, { auto child_state_node = make_state_node - (diagnostics::state_graphs::node_kind::element, + (node_properties::kind_t::element, make_node_id (*child_reg)); - set_wi_attr (*child_state_node, "index", idx, UNSIGNED); + set_wi_attr (*child_state_node, + node_properties::index, idx, UNSIGNED); // Recurse: gcc_assert (element_type); @@ -565,7 +580,7 @@ populate_state_node_for_typed_region (state_node_ref node, *child_reg, conc_bindings, create_all); - node.m_node.add_child (std::move (child_state_node)); + state_node.add_child (std::move (child_state_node)); } } } @@ -587,11 +602,12 @@ populate_state_node_for_typed_region (state_node_ref node, { auto child_state_node = make_state_node - (diagnostics::state_graphs::node_kind::padding, + (node_properties::kind_t::padding, make_node_id (*child_reg)); - set_wi_attr (*child_state_node, "num_bits", + set_wi_attr (*child_state_node, + node_properties::num_bits, item.m_bit_range.m_size_in_bits, SIGNED); - node.m_node.add_child (std::move (child_state_node)); + state_node.add_child (std::move (child_state_node)); } } else @@ -600,27 +616,27 @@ populate_state_node_for_typed_region (state_node_ref node, = m_mgr.get_field_region (®, const_cast (item.m_field)); if (show_child_state_node_for_child_region_p (*child_reg, - conc_bindings, - create_all)) + conc_bindings, + create_all)) { auto child_state_node = make_state_node - (diagnostics::state_graphs::node_kind::field, + (node_properties::kind_t::field, make_node_id (*child_reg)); { pretty_printer pp; pp_format_decoder (&pp) = default_tree_printer; pp_printf (&pp, "%D", item.m_field); - child_state_node->set_attr (STATE_NODE_PREFIX, "name", - pp_formatted_text (&pp)); + child_state_node->set_property (node_properties::name, + pp_formatted_text (&pp)); } // Recurse: populate_state_node_for_typed_region (*child_state_node, - *child_reg, - conc_bindings, - create_all); - node.m_node.add_child (std::move (child_state_node)); + *child_reg, + conc_bindings, + create_all); + state_node.add_child (std::move (child_state_node)); } } } @@ -630,8 +646,9 @@ populate_state_node_for_typed_region (state_node_ref node, } void -analyzer_state_graph::set_attr_for_dynamic_extents (const region ®, - state_node_ref node_ref) +analyzer_state_graph:: +set_attr_for_dynamic_extents (const region ®, + diagnostics::digraphs::node &state_node) { const svalue *sval = m_state.m_region_model->get_dynamic_extents (®); if (sval) @@ -642,15 +659,16 @@ analyzer_state_graph::set_attr_for_dynamic_extents (const region ®, pp_wide_int (&pp, wi::to_wide (cst), UNSIGNED); else sval->dump_to_pp (&pp, true); - node_ref.set_attr ("dynamic-extents", pp_formatted_text (&pp)); + state_node.set_property (state_node_properties::dynamic_extents, + pp_formatted_text (&pp)); } } bool analyzer_state_graph:: show_child_state_node_for_child_region_p (const region ®, - const concrete_bindings_t &conc_bindings, - bool create_all) + const concrete_bindings_t &conc_bindings, + bool create_all) { if (create_all) return true; diff --git a/gcc/analyzer/ana-state-to-diagnostic-state.h b/gcc/analyzer/ana-state-to-diagnostic-state.h index 3a5ccc1b4306..272a4d762b65 100644 --- a/gcc/analyzer/ana-state-to-diagnostic-state.h +++ b/gcc/analyzer/ana-state-to-diagnostic-state.h @@ -23,34 +23,38 @@ along with GCC; see the file COPYING3. If not see #include "diagnostics/state-graphs.h" #include "tree-logical-location.h" +#include "custom-sarif-properties/state-graphs.h" namespace ana { +namespace state_node_properties = custom_sarif_properties::state_graphs::node; + class analyzer_state_graph : public diagnostics::digraphs::digraph { public: analyzer_state_graph (const program_state &state, const extrinsic_state &ext_state); - diagnostics::state_graphs::state_node_ref + diagnostics::digraphs::node & get_or_create_state_node (const region ®); private: + struct pending_edge { - diagnostics::state_graphs::state_node_ref m_src_node; + diagnostics::digraphs::node & m_src_node; const region &m_dst_reg; }; - - diagnostics::state_graphs::state_node_ref + + diagnostics::digraphs::node & create_and_add_state_node (const region ®); std::unique_ptr - make_state_node (diagnostics::state_graphs::node_kind kind, + make_state_node (enum state_node_properties::kind_t kind, std::string id); std::unique_ptr make_memspace_state_node (const region ®, - enum diagnostics::state_graphs::node_kind kind); + enum state_node_properties::kind_t kind); std::unique_ptr create_state_node (const region ®); @@ -71,14 +75,14 @@ class analyzer_state_graph : public diagnostics::digraphs::digraph bit_range &out); void - populate_state_node_for_typed_region (diagnostics::state_graphs::state_node_ref, + populate_state_node_for_typed_region (diagnostics::digraphs::node &, const region ®, const concrete_bindings_t &conc_bindings, bool create_all); void set_attr_for_dynamic_extents (const region ®, - diagnostics::state_graphs::state_node_ref); + diagnostics::digraphs::node &); bool show_child_state_node_for_child_region_p (const region ®, @@ -95,7 +99,8 @@ class analyzer_state_graph : public diagnostics::digraphs::digraph const program_state &m_state; const extrinsic_state &m_ext_state; region_model_manager &m_mgr; - std::map m_region_to_state_node_map; + std::map m_region_to_state_node_map; std::map m_types_for_untyped_regions; unsigned m_next_id; std::vector m_pending_edges; diff --git a/gcc/analyzer/bounds-checking.cc b/gcc/analyzer/bounds-checking.cc index 921ad16307e9..7c51ca27bc5b 100644 --- a/gcc/analyzer/bounds-checking.cc +++ b/gcc/analyzer/bounds-checking.cc @@ -1334,11 +1334,11 @@ strip_types (const svalue *sval, case SK_COMPOUND: { const compound_svalue *compound_sval = (const compound_svalue *)sval; - binding_map typeless_map; + binding_map typeless_map (*mgr.get_store_manager ()); for (auto iter : compound_sval->get_map ()) { - const binding_key *key = iter.first; - const svalue *bound_sval = iter.second; + const binding_key *key = iter.m_key; + const svalue *bound_sval = iter.m_sval; typeless_map.put (key, strip_types (bound_sval, mgr)); } return mgr.get_or_create_compound_svalue (NULL_TREE, typeless_map); diff --git a/gcc/analyzer/call-summary.cc b/gcc/analyzer/call-summary.cc index a094cbab87f0..14ff560b23a1 100644 --- a/gcc/analyzer/call-summary.cc +++ b/gcc/analyzer/call-summary.cc @@ -422,10 +422,10 @@ call_summary_replay::convert_svalue_from_summary_1 (const svalue *summary_sval) = as_a (summary_sval); region_model_manager *mgr = get_manager (); store_manager *store_mgr = mgr->get_store_manager (); - binding_map caller_map; + binding_map caller_map (*store_mgr); auto_vec summary_keys; for (auto kv : *compound_summary_sval) - summary_keys.safe_push (kv.first); + summary_keys.safe_push (kv.m_key); summary_keys.qsort (binding_key::cmp_ptrs); for (auto key : summary_keys) { @@ -447,8 +447,8 @@ call_summary_replay::convert_svalue_from_summary_1 (const svalue *summary_sval) for (auto inner_kv : *inner_compound_sval) { // These should already be mapped to the caller. - const binding_key *inner_key = inner_kv.first; - const svalue *inner_sval = inner_kv.second; + const binding_key *inner_key = inner_kv.m_key; + const svalue *inner_sval = inner_kv.m_sval; gcc_assert (inner_key->concrete_p ()); const concrete_binding *concrete_key = as_a (inner_key); diff --git a/gcc/analyzer/checker-event.cc b/gcc/analyzer/checker-event.cc index 4eac9450469f..790ebc714380 100644 --- a/gcc/analyzer/checker-event.cc +++ b/gcc/analyzer/checker-event.cc @@ -29,6 +29,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-logical-location.h" #include "diagnostics/sarif-sink.h" #include "diagnostics/state-graphs.h" +#include "custom-sarif-properties/state-graphs.h" #include "analyzer/analyzer-logging.h" #include "analyzer/sm.h" @@ -242,9 +243,11 @@ checker_event::maybe_make_diagnostic_state_graph (bool debug) const pretty_printer pp; text_art::theme *theme = global_dc->get_diagram_theme (); text_art::dump_to_pp (*state, theme, &pp); - result->set_attr (STATE_GRAPH_PREFIX, - "analyzer/program_state/", - pp_formatted_text (&pp)); + const json::string_property program_state_property + (custom_sarif_properties::state_graphs::graph::prefix, + "analyzer/program_state/"); + result->set_property (program_state_property, + pp_formatted_text (&pp)); } return result; diff --git a/gcc/analyzer/diagnostic-manager.cc b/gcc/analyzer/diagnostic-manager.cc index 88f72d17b03b..d3ed085b7129 100644 --- a/gcc/analyzer/diagnostic-manager.cc +++ b/gcc/analyzer/diagnostic-manager.cc @@ -21,8 +21,6 @@ along with GCC; see the file COPYING3. If not see #include "analyzer/common.h" #include "cfg.h" -#include "basic-block.h" -#include "gimple.h" #include "gimple-pretty-print.h" #include "gimple-iterator.h" #include "inlining-iterator.h" diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc index 745ef7e52c83..9d22950d79b1 100644 --- a/gcc/analyzer/engine.cc +++ b/gcc/analyzer/engine.cc @@ -23,9 +23,7 @@ along with GCC; see the file COPYING3. If not see #include #include "cfg.h" -#include "basic-block.h" #include "gcc-rich-location.h" -#include "gimple.h" #include "gimple-iterator.h" #include "gimple-pretty-print.h" #include "cgraph.h" diff --git a/gcc/analyzer/infinite-recursion.cc b/gcc/analyzer/infinite-recursion.cc index 960b4872ee60..cde3016b4449 100644 --- a/gcc/analyzer/infinite-recursion.cc +++ b/gcc/analyzer/infinite-recursion.cc @@ -401,7 +401,7 @@ contains_unknown_p (const svalue *sval) if (const compound_svalue *compound_sval = sval->dyn_cast_compound_svalue ()) for (auto iter : *compound_sval) - if (iter.second->get_kind () == SK_UNKNOWN) + if (iter.m_sval->get_kind () == SK_UNKNOWN) return true; return false; } diff --git a/gcc/analyzer/kf.cc b/gcc/analyzer/kf.cc index 2a7c35703153..b3c02e843090 100644 --- a/gcc/analyzer/kf.cc +++ b/gcc/analyzer/kf.cc @@ -857,7 +857,8 @@ class kf_putenv : public known_function const svalue *ptr_sval = cd.get_arg_svalue (0); const region *reg = model->deref_rvalue (ptr_sval, cd.get_arg_tree (0), ctxt); - model->get_store ()->mark_as_escaped (reg); + store_manager *store_mgr = model->get_manager ()->get_store_manager (); + model->get_store ()->mark_as_escaped (*store_mgr, reg); enum memory_space mem_space = reg->get_memory_space (); switch (mem_space) { @@ -2373,6 +2374,7 @@ register_known_functions (known_function_manager &kfm, kfm.add ("___errno", std::make_unique ()); kfm.add ("__error", std::make_unique ()); kfm.add ("__errno", std::make_unique ()); + kfm.add ("__get_errno_ptr", std::make_unique ()); } /* Language-specific support functions. */ diff --git a/gcc/analyzer/program-state.cc b/gcc/analyzer/program-state.cc index e16a50f78c78..ac91ea4e194d 100644 --- a/gcc/analyzer/program-state.cc +++ b/gcc/analyzer/program-state.cc @@ -564,7 +564,7 @@ sm_state_map::impl_set_state (const svalue *sval, = sval->dyn_cast_compound_svalue ()) for (auto iter : *compound_sval) { - const svalue *inner_sval = iter.second; + const svalue *inner_sval = iter.m_sval; if (inner_sval->can_have_associated_state_p ()) impl_set_state (inner_sval, state, origin, ext_state); } @@ -1531,7 +1531,7 @@ program_state::can_purge_base_region_p (const extrinsic_state &ext_state, for (auto iter : *cluster) { - const svalue *sval = iter.second; + const svalue *sval = iter.m_sval; if (!can_purge_p (ext_state, sval)) return false; } diff --git a/gcc/analyzer/region-model-asm.cc b/gcc/analyzer/region-model-asm.cc index fe704901a978..347a938445ff 100644 --- a/gcc/analyzer/region-model-asm.cc +++ b/gcc/analyzer/region-model-asm.cc @@ -260,7 +260,9 @@ region_model::on_asm_stmt (const gasm *stmt, region_model_context *ctxt) || !base_reg->tracked_p ()) continue; - binding_cluster *cluster = m_store.get_or_create_cluster (base_reg); + binding_cluster *cluster + = m_store.get_or_create_cluster (*m_mgr->get_store_manager (), + base_reg); cluster->on_asm (stmt, m_mgr->get_store_manager (), conjured_purge (this, ctxt)); } diff --git a/gcc/analyzer/region-model-reachability.cc b/gcc/analyzer/region-model-reachability.cc index 0fe324d001fb..ea3f967ed4f8 100644 --- a/gcc/analyzer/region-model-reachability.cc +++ b/gcc/analyzer/region-model-reachability.cc @@ -169,10 +169,10 @@ reachable_regions::handle_sval (const svalue *sval) if (const compound_svalue *compound_sval = sval->dyn_cast_compound_svalue ()) { - for (compound_svalue::iterator_t iter = compound_sval->begin (); + for (auto iter = compound_sval->begin (); iter != compound_sval->end (); ++iter) { - const svalue *iter_sval = (*iter).second; + const svalue *iter_sval = (*iter).m_sval; handle_sval (iter_sval); } } @@ -235,10 +235,10 @@ reachable_regions::handle_parm (const svalue *sval, tree param_type) if (const compound_svalue *compound_sval = sval->dyn_cast_compound_svalue ()) { - for (compound_svalue::iterator_t iter = compound_sval->begin (); + for (auto iter = compound_sval->begin (); iter != compound_sval->end (); ++iter) { - const svalue *iter_sval = (*iter).second; + const svalue *iter_sval = (*iter).m_sval; handle_sval (iter_sval); } } @@ -259,7 +259,8 @@ reachable_regions::mark_escaped_clusters (region_model_context *ctxt) iter != m_mutable_base_regs.end (); ++iter) { const region *base_reg = *iter; - m_store->mark_as_escaped (base_reg); + store_manager *store_mgr = m_model->get_manager ()->get_store_manager (); + m_store->mark_as_escaped (*store_mgr, base_reg); /* If we have a function that's escaped, potentially add it to the worklist. */ diff --git a/gcc/analyzer/region-model.cc b/gcc/analyzer/region-model.cc index 618d96b6b7c1..ceb5064007cb 100644 --- a/gcc/analyzer/region-model.cc +++ b/gcc/analyzer/region-model.cc @@ -4495,8 +4495,8 @@ class iterable_cluster return; for (auto iter : *cluster) { - const binding_key *key = iter.first; - const svalue *sval = iter.second; + const binding_key *key = iter.m_key; + const svalue *sval = iter.m_sval; if (const concrete_binding *concrete_key = key->dyn_cast_concrete_binding ()) @@ -4696,7 +4696,7 @@ region_model::scan_for_null_terminator_1 (const region *reg, logger->end_log_line (); } - binding_map result; + binding_map result (*store_mgr); while (1) { @@ -5118,7 +5118,8 @@ region_model::mark_region_as_unknown (const region *reg, svalue_set maybe_live_values; m_store.mark_region_as_unknown (m_mgr->get_store_manager(), reg, uncertainty, &maybe_live_values); - m_store.on_maybe_live_values (maybe_live_values); + m_store.on_maybe_live_values (*m_mgr->get_store_manager (), + maybe_live_values); } /* Determine what is known about the condition "LHS_SVAL OP RHS_SVAL" within @@ -6733,7 +6734,8 @@ region_model::on_top_level_param (tree param, const svalue *init_ptr_sval = m_mgr->get_or_create_initial_value (param_reg); const region *pointee_reg = m_mgr->get_symbolic_region (init_ptr_sval); - m_store.mark_as_escaped (pointee_reg); + store_manager *store_mgr = m_mgr->get_store_manager (); + m_store.mark_as_escaped (*store_mgr, pointee_reg); if (nonnull) { const svalue *null_ptr_sval @@ -7085,52 +7087,39 @@ region_model::unbind_region_and_descendents (const region *reg, } } -/* Implementation of BindingVisitor. - Update the bound svalues for regions below REG to use poisoned - values instead. */ - -struct bad_pointer_finder -{ - bad_pointer_finder (const region *reg, enum poison_kind pkind, - region_model_manager *mgr) - : m_reg (reg), m_pkind (pkind), m_mgr (mgr), m_count (0) - {} - - void on_binding (const binding_key *, const svalue *&sval) - { - if (const region_svalue *ptr_sval = sval->dyn_cast_region_svalue ()) - { - const region *ptr_dst = ptr_sval->get_pointee (); - /* Poison ptrs to descendents of REG, but not to REG itself, - otherwise double-free detection doesn't work (since sm-state - for "free" is stored on the original ptr svalue). */ - if (ptr_dst->descendent_of_p (m_reg) - && ptr_dst != m_reg) - { - sval = m_mgr->get_or_create_poisoned_svalue (m_pkind, - sval->get_type ()); - ++m_count; - } - } - } - - const region *m_reg; - enum poison_kind m_pkind; - region_model_manager *const m_mgr; - int m_count; -}; - /* Find any pointers to REG or its descendents; convert them to - poisoned values of kind PKIND. - Return the number of pointers that were poisoned. */ + poisoned values of kind PKIND. */ -int +void region_model::poison_any_pointers_to_descendents (const region *reg, - enum poison_kind pkind) + enum poison_kind pkind) { - bad_pointer_finder bv (reg, pkind, m_mgr); - m_store.for_each_binding (bv); - return bv.m_count; + for (const auto &cluster_iter : m_store) + { + binding_cluster *cluster = cluster_iter.second; + for (auto iter = cluster->begin (); + iter != cluster->end (); + ++iter) + { + auto bp = *iter; + const svalue *sval = bp.m_sval; + if (const region_svalue *ptr_sval = sval->dyn_cast_region_svalue ()) + { + const region *ptr_dst = ptr_sval->get_pointee (); + /* Poison ptrs to descendents of REG, but not to REG itself, + otherwise double-free detection doesn't work (since sm-state + for "free" is stored on the original ptr svalue). */ + if (ptr_dst->descendent_of_p (reg) + && ptr_dst != reg) + { + const svalue *new_sval + = m_mgr->get_or_create_poisoned_svalue (pkind, + sval->get_type ()); + cluster->get_map ().overwrite (iter, new_sval); + } + } + } + } } /* Attempt to merge THIS with OTHER_MODEL, writing the result @@ -7647,12 +7636,12 @@ class exposure_through_uninit_copy /* Find keys for uninit svals. */ for (auto iter : *compound_sval) { - const svalue *sval = iter.second; + const svalue *sval = iter.m_sval; if (const poisoned_svalue *psval = sval->dyn_cast_poisoned_svalue ()) if (psval->get_poison_kind () == poison_kind::uninit) { - const binding_key *key = iter.first; + const binding_key *key = iter.m_key; const concrete_binding *ckey = key->dyn_cast_concrete_binding (); gcc_assert (ckey); @@ -7699,12 +7688,12 @@ class exposure_through_uninit_copy auto_vec uninit_keys; for (auto iter : *compound_sval) { - const svalue *sval = iter.second; + const svalue *sval = iter.m_sval; if (const poisoned_svalue *psval = sval->dyn_cast_poisoned_svalue ()) if (psval->get_poison_kind () == poison_kind::uninit) { - const binding_key *key = iter.first; + const binding_key *key = iter.m_key; const concrete_binding *ckey = key->dyn_cast_concrete_binding (); gcc_assert (ckey); @@ -7914,7 +7903,7 @@ contains_uninit_p (const svalue *sval) for (auto iter : *compound_sval) { - const svalue *sval = iter.second; + const svalue *sval = iter.m_sval; if (const poisoned_svalue *psval = sval->dyn_cast_poisoned_svalue ()) if (psval->get_poison_kind () == poison_kind::uninit) @@ -8352,8 +8341,9 @@ test_struct () region_model_manager mgr; region_model model (&mgr); - model.set_value (c_x, int_17, nullptr); + /* Set fields in order y, then x. */ model.set_value (c_y, int_m3, nullptr); + model.set_value (c_x, int_17, nullptr); /* Verify get_offset for "c.x". */ { @@ -8370,6 +8360,27 @@ test_struct () ASSERT_EQ (offset.get_base_region (), model.get_lvalue (c, nullptr)); ASSERT_EQ (offset.get_bit_offset (), INT_TYPE_SIZE); } + + /* Check iteration order of binding_cluster (and thus of binding_map). */ + { + std::vector vec; + auto cluster + = model.get_store ()->get_cluster (model.get_lvalue (c, nullptr)); + for (auto iter : *cluster) + vec.push_back (iter); + ASSERT_EQ (vec.size (), 2); + /* we should get them back in ascending order in memory (x then y). */ + /* x */ + ASSERT_EQ (vec[0].m_key->dyn_cast_concrete_binding ()->get_bit_range (), + bit_range (0, INT_TYPE_SIZE)); + ASSERT_TRUE (tree_int_cst_equal(vec[0].m_sval->maybe_get_constant (), + int_17)); + /* y */ + ASSERT_EQ (vec[1].m_key->dyn_cast_concrete_binding ()->get_bit_range (), + bit_range (INT_TYPE_SIZE, INT_TYPE_SIZE)); + ASSERT_TRUE (tree_int_cst_equal(vec[1].m_sval->maybe_get_constant (), + int_m3)); + } } /* Verify usage of an array element. */ diff --git a/gcc/analyzer/region-model.h b/gcc/analyzer/region-model.h index 6271ea27cd8f..7f33a4572e72 100644 --- a/gcc/analyzer/region-model.h +++ b/gcc/analyzer/region-model.h @@ -715,8 +715,8 @@ class region_model region_model_context *ctxt, std::unique_ptr *out); - int poison_any_pointers_to_descendents (const region *reg, - enum poison_kind pkind); + void poison_any_pointers_to_descendents (const region *reg, + enum poison_kind pkind); void on_top_level_param (tree param, bool nonnull, diff --git a/gcc/analyzer/region.cc b/gcc/analyzer/region.cc index e27fc6e720b0..8f294b533983 100644 --- a/gcc/analyzer/region.cc +++ b/gcc/analyzer/region.cc @@ -591,7 +591,7 @@ region::calc_initial_value_at_main (region_model_manager *mgr) const else { /* Get the value for REG within base_reg_init. */ - binding_cluster c (base_reg); + binding_cluster c (*mgr->get_store_manager (), base_reg); c.bind (mgr->get_store_manager (), base_reg, base_reg_init); const svalue *sval = c.get_any_binding (mgr->get_store_manager (), this); @@ -1713,7 +1713,7 @@ decl_region::calc_svalue_for_constructor (tree ctor, /* Create a binding map, applying ctor to it, using this decl_region as the base region when building child regions for offset calculations. */ - binding_map map; + binding_map map (*mgr->get_store_manager ()); if (!map.apply_ctor_to_region (this, ctor, mgr)) return mgr->get_or_create_unknown_svalue (get_type ()); @@ -1772,7 +1772,7 @@ decl_region::get_svalue_for_initializer (region_model_manager *mgr) const if (!tracked_p ()) return nullptr; - binding_cluster c (this); + binding_cluster c (*mgr->get_store_manager (), this); c.zero_fill_region (mgr->get_store_manager (), this); return mgr->get_or_create_compound_svalue (TREE_TYPE (m_decl), c.get_map ()); diff --git a/gcc/analyzer/sm-malloc.cc b/gcc/analyzer/sm-malloc.cc index a6b14219068a..8ce771062ca6 100644 --- a/gcc/analyzer/sm-malloc.cc +++ b/gcc/analyzer/sm-malloc.cc @@ -2735,7 +2735,7 @@ malloc_state_machine::transition_ptr_sval_non_null (region_model *model, smap->set_state (model, new_ptr_sval, m_free.m_nonnull, nullptr, ext_state); } -static enum diagnostics::state_graphs::node_dynalloc_state +static enum custom_sarif_properties::state_graphs::node::dynalloc_state_t get_dynalloc_state_for_state (enum resource_state rs) { switch (rs) @@ -2746,17 +2746,17 @@ get_dynalloc_state_for_state (enum resource_state rs) case RS_NULL: case RS_NON_HEAP: case RS_STOP: - return diagnostics::state_graphs::node_dynalloc_state::unknown; + return state_node_properties::dynalloc_state_t::unknown; case RS_ASSUMED_NON_NULL: - return diagnostics::state_graphs::node_dynalloc_state::nonnull; + return state_node_properties::dynalloc_state_t::nonnull; case RS_UNCHECKED: - return diagnostics::state_graphs::node_dynalloc_state::unchecked; + return state_node_properties::dynalloc_state_t::unchecked; case RS_NONNULL: - return diagnostics::state_graphs::node_dynalloc_state::nonnull; + return state_node_properties::dynalloc_state_t::nonnull; case RS_FREED: - return diagnostics::state_graphs::node_dynalloc_state::freed; + return state_node_properties::dynalloc_state_t::freed; } } @@ -2768,24 +2768,23 @@ add_state_to_state_graph (analyzer_state_graph &out_state_graph, { if (const region *reg = sval.maybe_get_region ()) { - auto reg_node = out_state_graph.get_or_create_state_node (*reg); + auto ®_node = out_state_graph.get_or_create_state_node (*reg); auto alloc_state = as_a_allocation_state (state); gcc_assert (alloc_state); - reg_node.set_dynalloc_state - (get_dynalloc_state_for_state (alloc_state->m_rs)); + reg_node.set_property (state_node_properties::dynalloc_state_prop, + get_dynalloc_state_for_state (alloc_state->m_rs)); + if (alloc_state->m_deallocators) { pretty_printer pp; alloc_state->m_deallocators->dump_to_pp (&pp); - reg_node.m_node.set_attr (STATE_NODE_PREFIX, - "expected-deallocators", - pp_formatted_text (&pp)); + reg_node.set_property (state_node_properties::expected_deallocators, + pp_formatted_text (&pp)); } if (alloc_state->m_deallocator) - reg_node.m_node.set_attr (STATE_NODE_PREFIX, - "deallocator", - alloc_state->m_deallocator->m_name); + reg_node.set_property (state_node_properties::deallocator, + alloc_state->m_deallocator->m_name); } } diff --git a/gcc/analyzer/store.cc b/gcc/analyzer/store.cc index 942c9455e588..b354f9b6387b 100644 --- a/gcc/analyzer/store.cc +++ b/gcc/analyzer/store.cc @@ -618,29 +618,120 @@ simplify_for_binding (const svalue *sval) return sval; } +/* class binding_map::const_iterator. */ + +bool +binding_map::const_iterator::operator== (const binding_map::const_iterator &other) const +{ + if (m_concrete != other.m_concrete) + return false; + if (m_symbolic != other.m_symbolic) + return false; + return true; +} + +binding_map::const_iterator & +binding_map::const_iterator::operator++ () +{ + if (m_concrete != m_map.m_concrete.end ()) + ++m_concrete; + else + ++m_symbolic; + return *this; +} + +binding_map::binding_pair +binding_map::const_iterator::operator* () +{ + if (m_concrete != m_map.m_concrete.end ()) + { + const bit_range &bits = m_concrete->first; + const svalue *sval = m_concrete->second; + return binding_pair (m_map.m_store_mgr.get_concrete_binding (bits), sval); + } + else + { + gcc_assert (m_symbolic != m_map.m_symbolic.end ()); + const region *reg = m_symbolic->m_region; + const svalue *sval = m_symbolic->m_sval; + return binding_pair (m_map.m_store_mgr.get_symbolic_binding (reg), sval); + } +} + +/* class binding_map::iterator. */ + +bool +binding_map::iterator::operator== (const binding_map::iterator &other) const +{ + if (m_concrete != other.m_concrete) + return false; + if (m_symbolic != other.m_symbolic) + return false; + return true; +} + +binding_map::iterator & +binding_map::iterator::operator++ () +{ + if (m_concrete != m_map.m_concrete.end ()) + ++m_concrete; + else + ++m_symbolic; + return *this; +} + +binding_map::binding_pair +binding_map::iterator::operator* () +{ + if (m_concrete != m_map.m_concrete.end ()) + { + const bit_range &bits = m_concrete->first; + const svalue *&sval = m_concrete->second; + return binding_pair (m_map.m_store_mgr.get_concrete_binding (bits), sval); + } + else + { + gcc_assert (m_symbolic != m_map.m_symbolic.end ()); + const region *reg = m_symbolic->m_region; + const svalue *&sval = m_symbolic->m_sval; + return binding_pair (m_map.m_store_mgr.get_symbolic_binding (reg), sval); + } +} + /* class binding_map. */ +// Construct an empty binding_map. + +binding_map::binding_map (store_manager &store_mgr) +: m_store_mgr (store_mgr), + m_concrete (), + m_symbolic () +{ +} + /* binding_map's copy ctor. */ binding_map::binding_map (const binding_map &other) -: m_map (other.m_map) +: m_store_mgr (other.m_store_mgr), + m_concrete (other.m_concrete), + m_symbolic (other.m_symbolic) { } /* binding_map's assignment operator. */ binding_map& -binding_map::operator=(const binding_map &other) +binding_map::operator= (const binding_map &other) { + gcc_assert (&m_store_mgr == &other.m_store_mgr); + /* For now, assume we only ever copy to an empty cluster. */ - gcc_assert (m_map.elements () == 0); - for (map_t::iterator iter = other.m_map.begin (); iter != other.m_map.end (); - ++iter) - { - const binding_key *key = (*iter).first; - const svalue *sval = (*iter).second; - m_map.put (key, sval); - } + gcc_assert (m_concrete.size () == 0); + gcc_assert (m_symbolic.size () == 0); + + m_concrete = other.m_concrete; + m_symbolic = other.m_symbolic; + return *this; } @@ -649,21 +740,11 @@ binding_map::operator=(const binding_map &other) bool binding_map::operator== (const binding_map &other) const { - if (m_map.elements () != other.m_map.elements ()) + if (m_concrete != other.m_concrete) + return false; + if (m_symbolic != other.m_symbolic) return false; - for (map_t::iterator iter = m_map.begin (); iter != m_map.end (); ++iter) - { - const binding_key *key = (*iter).first; - const svalue *sval = (*iter).second; - const svalue **other_slot - = const_cast (other.m_map).get (key); - if (other_slot == nullptr) - return false; - if (sval != *other_slot) - return false; - } - gcc_checking_assert (hash () == other.hash ()); return true; } @@ -673,18 +754,140 @@ hashval_t binding_map::hash () const { hashval_t result = 0; - for (map_t::iterator iter = m_map.begin (); iter != m_map.end (); ++iter) + for (auto iter : *this) { /* Use a new hasher for each key to avoid depending on the ordering of keys when accumulating the result. */ inchash::hash hstate; - hstate.add_ptr ((*iter).first); - hstate.add_ptr ((*iter).second); + hstate.add_ptr (iter.m_key); + hstate.add_ptr (iter.m_sval); result ^= hstate.end (); } return result; } +const svalue * +binding_map::get (const binding_key *key) const +{ + if (key->symbolic_p ()) + { + const ana::symbolic_binding &sym_key + = *static_cast (key); + const region *reg = sym_key.get_region (); + + for (auto iter : m_symbolic) + { + if (iter.m_region == reg) + return iter.m_sval; + } + return nullptr; + } + else + { + const concrete_binding &conc_key + = *static_cast (key); + const bit_range &bits = conc_key.get_bit_range (); + + concrete_bindings_t::const_iterator iter (m_concrete.find (bits)); + if (iter != m_concrete.end ()) + return iter->second; + else + return nullptr; + } +} + +void +binding_map::put (const binding_key *key, const svalue *sval) +{ + if (key->symbolic_p ()) + { + const ana::symbolic_binding &sym_key + = *static_cast (key); + const region *reg = sym_key.get_region (); + + m_symbolic.clear (); + + m_symbolic.push_back ({reg, sval}); + } + else + { + const concrete_binding &conc_key + = *static_cast (key); + const bit_range &bits = conc_key.get_bit_range (); + + concrete_bindings_t::iterator iter (m_concrete.find (bits)); + if (iter != m_concrete.end ()) + (*iter).second = sval; + else + m_concrete.insert ({bits, sval}); + } +} + +void +binding_map::overwrite (iterator_t &pos, const svalue *v) +{ + gcc_assert (&pos.m_map == this); + if (pos.m_symbolic != m_symbolic.end ()) + (*(pos.m_symbolic)).m_sval = v; + else + { + gcc_assert (pos.m_concrete != m_concrete.end ()); + (*(pos.m_concrete)).second = v; + } +} + +void +binding_map::remove (const binding_key *key) +{ + if (key->symbolic_p ()) + m_symbolic.clear (); + else + { + const concrete_binding &conc_key + = *static_cast (key); + const bit_range &bits = conc_key.get_bit_range (); + m_concrete.erase (bits); + } +} + +binding_map::const_iterator_t +binding_map::begin () const +{ + return binding_map::const_iterator_t (*this, + m_concrete.begin (), + m_symbolic.begin ()); +} + +binding_map::const_iterator_t +binding_map::end () const +{ + return binding_map::const_iterator_t (*this, + m_concrete.end (), + m_symbolic.end ()); +} + +binding_map::iterator_t +binding_map::begin () +{ + return binding_map::iterator_t (*this, + m_concrete.begin (), + m_symbolic.begin ()); +} + +binding_map::iterator_t +binding_map::end () +{ + return binding_map::iterator_t (*this, + m_concrete.end (), + m_symbolic.end ()); +} + +size_t +binding_map::elements () const +{ + return m_concrete.size () + m_symbolic.size (); +} + /* Dump a representation of this binding_map to PP. SIMPLE controls how values and regions are to be printed. If MULTILINE, then split the dump over multiple lines and @@ -694,20 +897,11 @@ void binding_map::dump_to_pp (pretty_printer *pp, bool simple, bool multiline) const { - auto_vec binding_keys; - for (map_t::iterator iter = m_map.begin (); - iter != m_map.end (); ++iter) - { - const binding_key *key = (*iter).first; - binding_keys.safe_push (key); - } - binding_keys.qsort (binding_key::cmp_ptrs); - - const binding_key *key; - unsigned i; - FOR_EACH_VEC_ELT (binding_keys, i, key) + bool first = true; + for (auto iter : *this) { - const svalue *value = *const_cast (m_map).get (key); + const binding_key *key = iter.m_key; + const svalue *value = iter.m_sval; if (multiline) { pp_string (pp, " key: {"); @@ -724,7 +918,9 @@ binding_map::dump_to_pp (pretty_printer *pp, bool simple, } else { - if (i > 0) + if (first) + first = false; + else pp_string (pp, ", "); pp_string (pp, "binding key: {"); key->dump_to_pp (pp, simple); @@ -754,21 +950,10 @@ binding_map::to_json () const { auto map_obj = std::make_unique (); - auto_vec binding_keys; - for (map_t::iterator iter = m_map.begin (); - iter != m_map.end (); ++iter) - { - const binding_key *key = (*iter).first; - binding_keys.safe_push (key); - } - binding_keys.qsort (binding_key::cmp_ptrs); - - const binding_key *key; - unsigned i; - FOR_EACH_VEC_ELT (binding_keys, i, key) + for (auto iter : *this) { - const svalue *value = *const_cast (m_map).get (key); - label_text key_desc = key->get_desc (); + const svalue *value = iter.m_sval; + label_text key_desc = iter.m_key->get_desc (); map_obj->set (key_desc.get (), value->to_json ()); } @@ -805,20 +990,10 @@ void binding_map::add_to_tree_widget (text_art::tree_widget &parent_widget, const text_art::dump_widget_info &dwi) const { - auto_vec binding_keys; - for (map_t::iterator iter = m_map.begin (); - iter != m_map.end (); ++iter) - { - const binding_key *key = (*iter).first; - binding_keys.safe_push (key); - } - binding_keys.qsort (binding_key::cmp_ptrs); - - const binding_key *key; - unsigned i; - FOR_EACH_VEC_ELT (binding_keys, i, key) + for (auto iter : *this) { - const svalue *sval = *const_cast (m_map).get (key); + const binding_key *key = iter.m_key; + const svalue *sval = iter.m_sval; add_binding_to_tree_widget (parent_widget, dwi, key, sval); } @@ -834,15 +1009,13 @@ binding_map::cmp (const binding_map &map1, const binding_map &map2) return count_cmp; auto_vec keys1 (map1.elements ()); - for (map_t::iterator iter = map1.begin (); - iter != map1.end (); ++iter) - keys1.quick_push ((*iter).first); + for (auto iter : map1) + keys1.quick_push (iter.m_key); keys1.qsort (binding_key::cmp_ptrs); auto_vec keys2 (map2.elements ()); - for (map_t::iterator iter = map2.begin (); - iter != map2.end (); ++iter) - keys2.quick_push ((*iter).first); + for (auto iter : map2) + keys2.quick_push (iter.m_key); keys2.qsort (binding_key::cmp_ptrs); for (size_t i = 0; i < keys1.length (); i++) @@ -1096,7 +1269,7 @@ binding_map::get_overlapping_bindings (const binding_key *key, { for (auto iter : *this) { - const binding_key *iter_key = iter.first; + const binding_key *iter_key = iter.m_key; if (const concrete_binding *ckey = key->dyn_cast_concrete_binding ()) { @@ -1200,7 +1373,7 @@ binding_map::remove_overlapping_bindings (store_manager *mgr, auto_vec bindings; if (always_overlap) for (auto iter : *this) - bindings.safe_push (iter.first); /* Add all bindings. */ + bindings.safe_push (iter.m_key); /* Add all bindings. */ else /* Just add overlapping bindings. */ get_overlapping_bindings (drop_key, &bindings); @@ -1234,7 +1407,7 @@ binding_map::remove_overlapping_bindings (store_manager *mgr, maybe_live_values->add (old_sval); /* Begin by removing the old binding. */ - m_map.remove (iter_binding); + remove (iter_binding); /* Don't attempt to handle prefixes/suffixes for the "always_overlap" case; everything's being removed. */ @@ -1266,7 +1439,7 @@ binding_map::remove_overlapping_bindings (store_manager *mgr, = old_sval->extract_bit_range (NULL_TREE, rel_prefix, mgr->get_svalue_manager ()); - m_map.put (prefix_key, prefix_sval); + put (prefix_key, prefix_sval); } if (iter_bits.get_next_bit_offset () @@ -1285,7 +1458,7 @@ binding_map::remove_overlapping_bindings (store_manager *mgr, = old_sval->extract_bit_range (NULL_TREE, rel_suffix, mgr->get_svalue_manager ()); - m_map.put (suffix_key, suffix_sval); + put (suffix_key, suffix_sval); } } } @@ -1293,8 +1466,9 @@ binding_map::remove_overlapping_bindings (store_manager *mgr, /* class binding_cluster. */ -binding_cluster::binding_cluster (const region *base_region) -: m_base_region (base_region), m_map (), +binding_cluster::binding_cluster (store_manager &store_mgr, + const region *base_region) +: m_base_region (base_region), m_map (store_mgr), m_escaped (false), m_touched (false) { } @@ -1414,7 +1588,7 @@ binding_cluster::validate () const int num_concrete = 0; for (auto iter : m_map) { - if (iter.first->symbolic_p ()) + if (iter.m_key->symbolic_p ()) num_symbolic++; else num_concrete++; @@ -1537,11 +1711,10 @@ binding_cluster::bind_compound_sval (store_manager *mgr, return; } - for (map_t::iterator iter = compound_sval->begin (); - iter != compound_sval->end (); ++iter) + for (auto iter : *compound_sval) { - const binding_key *iter_key = (*iter).first; - const svalue *iter_sval = (*iter).second; + const binding_key *iter_key = iter.m_key; + const svalue *iter_sval = iter.m_sval; if (const concrete_binding *concrete_key = iter_key->dyn_cast_concrete_binding ()) @@ -1650,7 +1823,7 @@ binding_cluster::purge_state_involving (const svalue *sval, auto_vec > to_make_unknown; for (auto iter : m_map) { - const binding_key *iter_key = iter.first; + const binding_key *iter_key = iter.m_key; if (const symbolic_binding *symbolic_key = iter_key->dyn_cast_symbolic_binding ()) { @@ -1658,7 +1831,7 @@ binding_cluster::purge_state_involving (const svalue *sval, if (reg->involves_p (sval)) to_remove.safe_push (iter_key); } - const svalue *iter_sval = iter.second; + const svalue *iter_sval = iter.m_sval; if (iter_sval->involves_p (sval)) to_make_unknown.safe_push (std::make_pair(iter_key, iter_sval->get_type ())); @@ -1847,8 +2020,8 @@ binding_cluster::maybe_get_compound_binding (store_manager *mgr, perhaps we should have a spatial-organized data structure for concrete keys, though. */ - binding_map result_map; - binding_map default_map; + binding_map result_map (*mgr); + binding_map default_map (*mgr); /* Set up default values in default_map. */ const svalue *default_sval; @@ -1866,12 +2039,13 @@ binding_cluster::maybe_get_compound_binding (store_manager *mgr, return nullptr; const concrete_binding *default_key_relative_to_reg = mgr->get_concrete_binding (0, concrete_default_key->get_size_in_bits ()); + default_map.put (default_key_relative_to_reg, default_sval); - for (map_t::iterator iter = m_map.begin (); iter != m_map.end (); ++iter) + for (auto iter : m_map) { - const binding_key *key = (*iter).first; - const svalue *sval = (*iter).second; + const binding_key *key = iter.m_key; + const svalue *sval = iter.m_sval; if (const concrete_binding *concrete_key = key->dyn_cast_concrete_binding ()) @@ -1957,8 +2131,8 @@ binding_cluster::maybe_get_compound_binding (store_manager *mgr, /* Merge any bindings from default_map into result_map. */ for (auto iter : default_map) { - const binding_key *key = iter.first; - const svalue *sval = iter.second; + const binding_key *key = iter.m_key; + const svalue *sval = iter.m_sval; result_map.put (key, sval); } @@ -2051,16 +2225,14 @@ binding_cluster::can_merge_p (const binding_cluster *cluster_a, gcc_assert (cluster_b->m_base_region == out_cluster->m_base_region); hash_set keys; - for (map_t::iterator iter_a = cluster_a->m_map.begin (); - iter_a != cluster_a->m_map.end (); ++iter_a) + for (auto iter_a : cluster_a->m_map) { - const binding_key *key_a = (*iter_a).first; + const binding_key *key_a = iter_a.m_key; keys.add (key_a); } - for (map_t::iterator iter_b = cluster_b->m_map.begin (); - iter_b != cluster_b->m_map.end (); ++iter_b) + for (auto iter_b : cluster_b->m_map) { - const binding_key *key_b = (*iter_b).first; + const binding_key *key_b = iter_b.m_key; keys.add (key_b); } int num_symbolic_keys = 0; @@ -2122,7 +2294,7 @@ binding_cluster::can_merge_p (const binding_cluster *cluster_a, || (num_concrete_keys > 0 && num_symbolic_keys > 0)) { out_cluster->m_touched = true; - out_cluster->m_map.empty (); + out_cluster->m_map.clear (); } /* We don't handle other kinds of overlaps yet. */ @@ -2141,11 +2313,10 @@ binding_cluster::make_unknown_relative_to (const binding_cluster *other, store *out_store, store_manager *mgr) { - for (map_t::iterator iter = other->m_map.begin (); - iter != other->m_map.end (); ++iter) + for (auto iter : *other) { - const binding_key *iter_key = (*iter).first; - const svalue *iter_sval = (*iter).second; + const binding_key *iter_key = iter.m_key; + const svalue *iter_sval = iter.m_sval; const svalue *unknown_sval = mgr->get_svalue_manager ()->get_or_create_unknown_svalue (iter_sval->get_type ()); @@ -2165,7 +2336,8 @@ binding_cluster::make_unknown_relative_to (const binding_cluster *other, if (base_reg->tracked_p () && !base_reg->symbolic_for_unknown_ptr_p ()) { - binding_cluster *c = out_store->get_or_create_cluster (base_reg); + binding_cluster *c + = out_store->get_or_create_cluster (*mgr, base_reg); c->mark_as_escaped (); } } @@ -2193,7 +2365,7 @@ binding_cluster::on_unknown_fncall (const gcall &call, { if (m_escaped) { - m_map.empty (); + m_map.clear (); if (!m_base_region->empty_p ()) { @@ -2216,7 +2388,7 @@ binding_cluster::on_asm (const gasm *stmt, store_manager *mgr, const conjured_purge &p) { - m_map.empty (); + m_map.clear (); /* Bind it to a new "conjured" value using CALL. */ const svalue *sval @@ -2279,10 +2451,10 @@ binding_cluster::get_representative_path_vars (const region_model *model, { sval = simplify_for_binding (sval); - for (map_t::iterator iter = m_map.begin (); iter != m_map.end (); ++iter) + for (auto iter : m_map) { - const binding_key *key = (*iter).first; - const svalue *bound_sval = (*iter).second; + const binding_key *key = iter.m_key; + const svalue *bound_sval = iter.m_sval; if (bound_sval == sval) { if (const concrete_binding *ckey @@ -2804,14 +2976,14 @@ store::set_value (store_manager *mgr, const region *lhs_reg, { const region *ptr_dst = ptr_sval->get_pointee (); const region *ptr_base_reg = ptr_dst->get_base_region (); - mark_as_escaped (ptr_base_reg); + mark_as_escaped (*mgr, ptr_base_reg); } if (uncertainty) uncertainty->on_maybe_bound_sval (rhs_sval); } else if (lhs_base_reg->tracked_p ()) { - lhs_cluster = get_or_create_cluster (lhs_base_reg); + lhs_cluster = get_or_create_cluster (*mgr, lhs_base_reg); lhs_cluster->bind (mgr, lhs_reg, rhs_sval); } else @@ -2887,7 +3059,7 @@ store::set_value (store_manager *mgr, const region *lhs_reg, (e.g. marking regions as escaped). We do this after the iteration to avoid potentially changing m_cluster_map whilst iterating over it. */ - on_maybe_live_values (maybe_live_values); + on_maybe_live_values (*mgr, maybe_live_values); } /* Determine if BASE_REG_A could be an alias of BASE_REG_B. */ @@ -2983,14 +3155,15 @@ store::eval_alias_1 (const region *base_reg_a, /* Record all of the values in MAYBE_LIVE_VALUES as being possibly live. */ void -store::on_maybe_live_values (const svalue_set &maybe_live_values) +store::on_maybe_live_values (store_manager &mgr, + const svalue_set &maybe_live_values) { for (auto sval : maybe_live_values) { if (const region_svalue *ptr_sval = sval->dyn_cast_region_svalue ()) { const region *base_reg = ptr_sval->get_pointee ()->get_base_region (); - mark_as_escaped (base_reg); + mark_as_escaped (mgr, base_reg); } } } @@ -3044,7 +3217,7 @@ store::fill_region (store_manager *mgr, const region *reg, const svalue *sval) if (base_reg->symbolic_for_unknown_ptr_p () || !base_reg->tracked_p ()) return; - binding_cluster *cluster = get_or_create_cluster (base_reg); + binding_cluster *cluster = get_or_create_cluster (*mgr, base_reg); cluster->fill_region (mgr, reg, sval); } @@ -3069,7 +3242,7 @@ store::mark_region_as_unknown (store_manager *mgr, const region *reg, if (base_reg->symbolic_for_unknown_ptr_p () || !base_reg->tracked_p ()) return; - binding_cluster *cluster = get_or_create_cluster (base_reg); + binding_cluster *cluster = get_or_create_cluster (*mgr, base_reg); cluster->mark_region_as_unknown (mgr, reg, reg, uncertainty, maybe_live_values); } @@ -3127,7 +3300,8 @@ store::get_cluster (const region *base_reg) /* Get the cluster for BASE_REG, creating it if doesn't already exist. */ binding_cluster * -store::get_or_create_cluster (const region *base_reg) +store::get_or_create_cluster (store_manager &store_mgr, + const region *base_reg) { gcc_assert (base_reg); gcc_assert (base_reg->get_base_region () == base_reg); @@ -3141,7 +3315,7 @@ store::get_or_create_cluster (const region *base_reg) if (binding_cluster **slot = m_cluster_map.get (base_reg)) return *slot; - binding_cluster *cluster = new binding_cluster (base_reg); + binding_cluster *cluster = new binding_cluster (store_mgr, base_reg); m_cluster_map.put (base_reg, cluster); return cluster; @@ -3206,7 +3380,7 @@ store::can_merge_p (const store *store_a, const store *store_b, const binding_cluster *cluster_b = store_b->get_cluster (base_reg); /* At least one of cluster_a and cluster_b must be non-NULL. */ binding_cluster *out_cluster - = out_store->get_or_create_cluster (base_reg); + = out_store->get_or_create_cluster (*mgr, base_reg); if (!binding_cluster::can_merge_p (cluster_a, cluster_b, out_cluster, out_store, mgr, merger)) return false; @@ -3221,7 +3395,7 @@ store::can_merge_p (const store *store_a, const store *store_b, isn't reachable from args of those calls. */ void -store::mark_as_escaped (const region *base_reg) +store::mark_as_escaped (store_manager &mgr, const region *base_reg) { gcc_assert (base_reg); gcc_assert (base_reg->get_base_region () == base_reg); @@ -3230,7 +3404,7 @@ store::mark_as_escaped (const region *base_reg) || !base_reg->tracked_p ()) return; - binding_cluster *cluster = get_or_create_cluster (base_reg); + binding_cluster *cluster = get_or_create_cluster (mgr, base_reg); cluster->mark_as_escaped (); } @@ -3361,7 +3535,7 @@ store::canonicalize (store_manager *mgr) binding_cluster *cluster = (*iter).second; for (binding_cluster::iterator_t bind_iter = cluster->m_map.begin (); bind_iter != cluster->m_map.end (); ++bind_iter) - (*bind_iter).second->accept (&s); + (*bind_iter).m_sval->accept (&s); } /* Locate heap-allocated regions that have empty bindings that weren't @@ -3442,12 +3616,13 @@ store::loop_replay_fixup (const store *other_store, for (binding_cluster::iterator_t bind_iter = cluster->m_map.begin (); bind_iter != cluster->m_map.end (); ++bind_iter) { - const binding_key *key = (*bind_iter).first; - const svalue *sval = (*bind_iter).second; + const binding_key *key = (*bind_iter).m_key; + const svalue *sval = (*bind_iter).m_sval; if (sval->get_kind () == SK_WIDENING) { binding_cluster *this_cluster - = get_or_create_cluster (base_reg); + = get_or_create_cluster (*mgr->get_store_manager (), + base_reg); const svalue *unknown = mgr->get_or_create_unknown_svalue (sval->get_type ()); this_cluster->bind_key (key, unknown); @@ -3505,7 +3680,7 @@ store::replay_call_summary_cluster (call_summary_replay &r, && !caller_base_reg->symbolic_for_unknown_ptr_p ()) { binding_cluster *caller_cluster - = get_or_create_cluster (caller_base_reg); + = get_or_create_cluster (*mgr, caller_base_reg); if (summary_cluster->escaped_p ()) caller_cluster->mark_as_escaped (); if (summary_cluster->touched_p ()) @@ -3830,6 +4005,22 @@ test_binding_key_overlap () ASSERT_DISJOINT (cb_8_23, cb_24_31); } +static void +test_binding_map_ops () +{ + region_model_manager region_mgr; + store_manager store_mgr (®ion_mgr); + + /* Assignment of empty. */ + { + binding_map src (store_mgr); + binding_map dst (store_mgr); + dst = src; + + ASSERT_EQ (src, dst); + } +} + /* Run all of the selftests within this file. */ void @@ -3838,6 +4029,7 @@ analyzer_store_cc_tests () test_bit_range_intersects_p (); test_bit_range_from_mask (); test_binding_key_overlap (); + test_binding_map_ops (); } } // namespace selftest diff --git a/gcc/analyzer/store.h b/gcc/analyzer/store.h index 95d38e30924f..33a973151b7d 100644 --- a/gcc/analyzer/store.h +++ b/gcc/analyzer/store.h @@ -512,15 +512,99 @@ template <> struct default_hash_traits namespace ana { /* A mapping from binding_keys to svalues, for use by binding_cluster - and compound_svalue. */ + and compound_svalue. + We store a map from concrete keys to svalues, which is ordered by + the start offset. + We also store a vector of (symbolic key, svalue) pairs, but for now + this has maximum length of 1. */ class binding_map { public: - typedef hash_map map_t; - typedef map_t::iterator iterator_t; - - binding_map () : m_map () {} + struct symbolic_binding + { + bool operator== (const symbolic_binding &other) const + { + return (m_region == other.m_region + && m_sval == other.m_sval); + } + + const region *m_region; + const svalue *m_sval; + }; + using concrete_bindings_t = std::map; + using symbolic_bindings_t = std::vector; + + struct binding_pair + { + binding_pair (const binding_key *key, + const svalue *sval) + : m_key (key), + m_sval (sval) + { + } + + const binding_key *m_key; + const svalue *m_sval; + }; + + typedef class const_iterator + { + public: + const_iterator (const binding_map &map, + concrete_bindings_t::const_iterator concrete_iter, + symbolic_bindings_t::const_iterator symbolic_iter) + : m_map (map), + m_concrete (concrete_iter), + m_symbolic (symbolic_iter) + { + } + bool operator== (const const_iterator &other) const; + bool operator!= (const const_iterator &other) const + { + return !(*this == other); + } + const_iterator &operator++ (); + + binding_pair operator* (); + + private: + const binding_map &m_map; + concrete_bindings_t::const_iterator m_concrete; + symbolic_bindings_t::const_iterator m_symbolic; + } const_iterator_t; + + typedef class iterator + { + public: + friend class binding_map; + + iterator (const binding_map &map, + concrete_bindings_t::iterator concrete_iter, + symbolic_bindings_t::iterator symbolic_iter) + : m_map (map), + m_concrete (concrete_iter), + m_symbolic (symbolic_iter) + { + } + bool operator== (const iterator &other) const; + bool operator!= (const iterator &other) const + { + return !(*this == other); + } + iterator &operator++ (); + + binding_pair operator* (); + + const binding_key *get_key () const; + + private: + const binding_map &m_map; + concrete_bindings_t::iterator m_concrete; + symbolic_bindings_t::iterator m_symbolic; + } iterator_t; + + binding_map (store_manager &store_mgr); binding_map (const binding_map &other); binding_map& operator=(const binding_map &other); @@ -532,26 +616,27 @@ class binding_map hashval_t hash () const; - const svalue *get (const binding_key *key) const + const svalue *get (const binding_key *key) const; + void put (const binding_key *k, const svalue *v); + void overwrite (iterator_t &pos, const svalue *v); + + void remove (const binding_key *k); + void clear () { - const svalue **slot = const_cast (m_map).get (key); - if (slot) - return *slot; - else - return nullptr; + m_concrete.clear (); + m_symbolic.clear (); } - bool put (const binding_key *k, const svalue *v) + + bool empty_p () const { - gcc_assert (v); - return m_map.put (k, v); + return m_concrete.empty () && m_symbolic.empty (); } - void remove (const binding_key *k) { m_map.remove (k); } - void empty () { m_map.empty (); } - - iterator_t begin () const { return m_map.begin (); } - iterator_t end () const { return m_map.end (); } - size_t elements () const { return m_map.elements (); } + const_iterator_t begin () const; + const_iterator_t end () const; + iterator_t begin (); + iterator_t end (); + size_t elements () const; void dump_to_pp (pretty_printer *pp, bool simple, bool multiline) const; void dump (bool simple) const; @@ -583,16 +668,11 @@ class binding_map region_model_manager *mgr, tree index, tree val); - map_t m_map; + store_manager &m_store_mgr; + concrete_bindings_t m_concrete; + symbolic_bindings_t m_symbolic; }; -/* Concept: BindingVisitor, for use by binding_cluster::for_each_binding - and store::for_each_binding. - - Should implement: - void on_binding (const binding_key *key, const svalue *&sval); -*/ - /* All of the bindings within a store for regions that share the same base region. */ @@ -601,10 +681,10 @@ class binding_cluster public: friend class store; - typedef hash_map map_t; - typedef map_t::iterator iterator_t; + typedef binding_map::const_iterator const_iterator_t; + typedef binding_map::iterator iterator_t; - binding_cluster (const region *base_region); + binding_cluster (store_manager &store_mgr, const region *base_region); binding_cluster (const binding_cluster &other); binding_cluster& operator=(const binding_cluster &other); @@ -661,8 +741,8 @@ class binding_cluster void for_each_value (void (*cb) (const svalue *sval, T user_data), T user_data) const { - for (map_t::iterator iter = m_map.begin (); iter != m_map.end (); ++iter) - cb ((*iter).second, user_data); + for (auto iter : m_map) + cb (iter.m_sval, user_data); } static bool can_merge_p (const binding_cluster *cluster_a, @@ -685,7 +765,7 @@ class binding_cluster bool touched_p () const { return m_touched; } bool redundant_p () const; - bool empty_p () const { return m_map.elements () == 0; } + bool empty_p () const { return m_map.empty_p (); } void get_representative_path_vars (const region_model *model, svalue_set *visited, @@ -696,21 +776,14 @@ class binding_cluster const svalue *maybe_get_simple_value (store_manager *mgr) const; - template - void for_each_binding (BindingVisitor &v) const - { - for (map_t::iterator iter = m_map.begin (); iter != m_map.end (); ++iter) - { - const binding_key *key = (*iter).first; - const svalue *&sval = (*iter).second; - v.on_binding (key, sval); - } - } + const_iterator_t begin () const { return m_map.begin (); } + const_iterator_t end () const { return m_map.end (); } - iterator_t begin () const { return m_map.begin (); } - iterator_t end () const { return m_map.end (); } + iterator_t begin () { return m_map.begin (); } + iterator_t end () { return m_map.end (); } const binding_map &get_map () const { return m_map; } + binding_map &get_map () { return m_map; } private: const svalue *get_any_value (const binding_key *key) const; @@ -793,7 +866,8 @@ class store const binding_cluster *get_cluster (const region *base_reg) const; binding_cluster *get_cluster (const region *base_reg); - binding_cluster *get_or_create_cluster (const region *base_reg); + binding_cluster *get_or_create_cluster (store_manager &store_mgr, + const region *base_reg); void purge_cluster (const region *base_reg); template @@ -809,7 +883,7 @@ class store store *out_store, store_manager *mgr, model_merger *merger); - void mark_as_escaped (const region *base_reg); + void mark_as_escaped (store_manager &mgr, const region *base_reg); void on_unknown_fncall (const gcall &call, store_manager *mgr, const conjured_purge &p); bool escaped_p (const region *reg) const; @@ -826,14 +900,6 @@ class store tristate eval_alias (const region *base_reg_a, const region *base_reg_b) const; - template - void for_each_binding (BindingVisitor &v) - { - for (cluster_map_t::iterator iter = m_cluster_map.begin (); - iter != m_cluster_map.end (); ++iter) - (*iter).second->for_each_binding (v); - } - void canonicalize (store_manager *mgr); void loop_replay_fixup (const store *other_store, region_model_manager *mgr); @@ -843,7 +909,8 @@ class store void replay_call_summary_cluster (call_summary_replay &r, const store &summary, const region *base_reg); - void on_maybe_live_values (const svalue_set &maybe_live_values); + void on_maybe_live_values (store_manager &mgr, + const svalue_set &maybe_live_values); private: void remove_overlapping_bindings (store_manager *mgr, const region *reg, diff --git a/gcc/analyzer/svalue.cc b/gcc/analyzer/svalue.cc index fbbd1d2c1768..44482bfefbe2 100644 --- a/gcc/analyzer/svalue.cc +++ b/gcc/analyzer/svalue.cc @@ -2232,15 +2232,15 @@ compound_svalue::compound_svalue (symbol::id_t id, : svalue (calc_complexity (map), id, type), m_map (map) { #if CHECKING_P - for (iterator_t iter = begin (); iter != end (); ++iter) + for (auto iter : *this) { /* All keys within the underlying binding_map are required to be concrete, not symbolic. */ - const binding_key *key = (*iter).first; + const binding_key *key = iter.m_key; gcc_assert (key->concrete_p ()); /* We don't nest compound svalues. */ - const svalue *sval = (*iter).second; + const svalue *sval = iter.m_sval; gcc_assert (sval->get_kind () != SK_COMPOUND); } #endif @@ -2302,11 +2302,10 @@ add_dump_widget_children (text_art::tree_widget &w, void compound_svalue::accept (visitor *v) const { - for (binding_map::iterator_t iter = m_map.begin (); - iter != m_map.end (); ++iter) + for (auto iter : m_map) { - //(*iter).first.accept (v); - (*iter).second->accept (v); + //iter.first.accept (v); + iter.m_sval->accept (v); } v->visit_compound_svalue (this); } @@ -2319,10 +2318,9 @@ compound_svalue::calc_complexity (const binding_map &map) { unsigned num_child_nodes = 0; unsigned max_child_depth = 0; - for (binding_map::iterator_t iter = map.begin (); - iter != map.end (); ++iter) + for (auto iter : map) { - const complexity &sval_c = (*iter).second->get_complexity (); + const complexity &sval_c = iter.m_sval->get_complexity (); num_child_nodes += sval_c.m_num_nodes; max_child_depth = MAX (max_child_depth, sval_c.m_max_depth); } @@ -2337,10 +2335,10 @@ compound_svalue::maybe_fold_bits_within (tree type, const bit_range &bits, region_model_manager *mgr) const { - binding_map result_map; + binding_map result_map (*mgr->get_store_manager ()); for (auto iter : m_map) { - const binding_key *key = iter.first; + const binding_key *key = iter.m_key; if (const concrete_binding *conc_key = key->dyn_cast_concrete_binding ()) { @@ -2348,7 +2346,7 @@ compound_svalue::maybe_fold_bits_within (tree type, if (!conc_key->get_bit_range ().intersects_p (bits)) continue; - const svalue *sval = iter.second; + const svalue *sval = iter.m_sval; /* Get the position of conc_key relative to BITS. */ bit_range result_location (conc_key->get_start_bit_offset () - bits.get_start_bit_offset (), diff --git a/gcc/analyzer/svalue.h b/gcc/analyzer/svalue.h index 0ccb5ce4bd6a..df236d736064 100644 --- a/gcc/analyzer/svalue.h +++ b/gcc/analyzer/svalue.h @@ -1391,6 +1391,7 @@ namespace ana { class compound_svalue : public svalue { public: + typedef binding_map::const_iterator_t const_iterator_t; typedef binding_map::iterator_t iterator_t; /* A support class for uniquifying instances of compound_svalue. @@ -1445,8 +1446,10 @@ class compound_svalue : public svalue const binding_map &get_map () const { return m_map; } - iterator_t begin () const { return m_map.begin (); } - iterator_t end () const { return m_map.end (); } + const_iterator_t begin () const { return m_map.begin (); } + const_iterator_t end () const { return m_map.end (); } + iterator_t begin () { return m_map.begin (); } + iterator_t end () { return m_map.end (); } struct key_t make_key () const { diff --git a/gcc/attr-callback.cc b/gcc/attr-callback.cc new file mode 100644 index 000000000000..ee39ef61a20d --- /dev/null +++ b/gcc/attr-callback.cc @@ -0,0 +1,367 @@ +/* Callback attribute handling + Copyright (C) 2025 Free Software Foundation, Inc. + Contributed by Josef Melcr + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + GCC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + . */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "backend.h" +#include "tree.h" +#include "gimple.h" +#include "alloc-pool.h" +#include "cgraph.h" +#include "diagnostic.h" +#include "builtins.h" +#include "options.h" +#include "gimple-range.h" +#include "attribs.h" +#include "attr-callback.h" + +/* Returns a callback attribute with callback index FN_IDX, and ARG_COUNT + arguments specified by VA_ARGS. */ +tree +callback_build_attr (unsigned fn_idx, unsigned arg_count...) +{ + va_list args; + va_start (args, arg_count); + + tree cblist = NULL_TREE; + tree *pp = &cblist; + unsigned i; + for (i = 0; i < arg_count; i++) + { + int num = va_arg (args, int); + tree tnum = build_int_cst (integer_type_node, num); + *pp = build_tree_list (NULL, tnum); + pp = &TREE_CHAIN (*pp); + } + cblist + = tree_cons (NULL_TREE, build_int_cst (integer_type_node, fn_idx), cblist); + tree attr + = tree_cons (get_identifier (CALLBACK_ATTR_IDENT), cblist, NULL_TREE); + return attr; +} + +/* Returns TRUE if a function should be treated as if it had a callback + attribute despite the DECL not having it. STMT can be passed NULL + if the call statement is not available at the time, for example WPA, but it + should be called with the statement itself whenever possible. */ +bool +callback_is_special_cased (tree decl, gcall *stmt) +{ + if (fndecl_built_in_p (decl, BUILT_IN_GOMP_TASK)) + { + if (stmt) + return gimple_call_arg (stmt, 2) == null_pointer_node; + return true; + } + return false; +} + +/* Returns an attribute for a special cased function. */ +tree +callback_special_case_attr (tree decl) +{ + if (fndecl_built_in_p (decl, BUILT_IN_GOMP_TASK)) + return callback_build_attr (1, 1, 2); + gcc_unreachable (); +} + +/* Given an instance of callback attribute, return the 0-based + index of the called function in question. */ +int +callback_get_fn_index (tree cb_attr) +{ + tree args = TREE_VALUE (cb_attr); + int idx = TREE_INT_CST_LOW (TREE_VALUE (args)) - 1; + return idx; +} + +/* For a given callback pair, retrieves the callback attribute used + to create E from the callee of CARRYING. */ +tree +callback_fetch_attr_by_edge (cgraph_edge *e, cgraph_edge *carrying) +{ + gcc_checking_assert (e->call_stmt == carrying->call_stmt + && e->lto_stmt_uid == carrying->lto_stmt_uid); + + if (callback_is_special_cased (carrying->callee->decl, e->call_stmt)) + return callback_special_case_attr (carrying->callee->decl); + + tree cb_attr = lookup_attribute (CALLBACK_ATTR_IDENT, + DECL_ATTRIBUTES (carrying->callee->decl)); + gcc_checking_assert (cb_attr); + tree res = NULL_TREE; + for (; cb_attr; + cb_attr = lookup_attribute (CALLBACK_ATTR_IDENT, TREE_CHAIN (cb_attr))) + { + unsigned id = callback_get_fn_index (cb_attr); + if (id == e->callback_id) + { + res = cb_attr; + break; + } + } + gcc_checking_assert (res != NULL_TREE); + return res; +} + +/* Given an instance of callback attribute, return the 0-base indices + of arguments passed to the callback. For a callback function taking + n parameters, returns a vector of n indices of their values in the parameter + list of it's caller. Indices with unknown positions contain -1. */ +auto_vec +callback_get_arg_mapping (cgraph_edge *e, cgraph_edge *carrying) +{ + tree attr = callback_fetch_attr_by_edge (e, carrying); + gcc_checking_assert (attr); + tree args = TREE_VALUE (attr); + auto_vec res; + tree it; + + /* Skip over the first argument, which denotes + which argument is the called function. */ + for (it = TREE_CHAIN (args); it != NULL_TREE; it = TREE_CHAIN (it)) + { + int idx = TREE_INT_CST_LOW (TREE_VALUE (it)); + /* Subtract 1 to account for 1-based indexing. If the value is unknown, + use constant -1 instead. */ + idx = idx == CB_UNKNOWN_POS ? -1 : idx - 1; + res.safe_push (idx); + } + + return res; +} + +/* For a callback pair, returns the 0-based index of the address of + E's callee in the argument list of CARRYING's callee decl. */ +int +callback_fetch_fn_position (cgraph_edge *e, cgraph_edge *carrying) +{ + tree attr = callback_fetch_attr_by_edge (e, carrying); + return callback_get_fn_index (attr); +} + +/* Returns the element at index idx in the list or NULL_TREE if + the list isn't long enough. NULL_TREE is used as the endpoint. */ +static tree +get_nth_list_elem (tree list, unsigned idx) +{ + tree res = NULL_TREE; + unsigned i = 0; + tree it; + for (it = list; it != NULL_TREE; it = TREE_CHAIN (it), i++) + { + if (i == idx) + { + res = TREE_VALUE (it); + break; + } + } + return res; +} + +/* Handle a "callback" attribute; arguments as in + struct attribute_spec.handler. */ +tree +handle_callback_attribute (tree *node, tree name, tree args, + int ARG_UNUSED (flags), bool *no_add_attrs) +{ + tree decl = *node; + if (TREE_CODE (decl) != FUNCTION_DECL) + { + error_at (DECL_SOURCE_LOCATION (decl), + "%qE attribute can only be used on functions", name); + *no_add_attrs = true; + } + + tree cb_fn_idx_node = TREE_VALUE (args); + if (TREE_CODE (cb_fn_idx_node) != INTEGER_CST) + { + error_at (DECL_SOURCE_LOCATION (decl), + "argument specifying callback function position is not an " + "integer constant"); + *no_add_attrs = true; + return NULL_TREE; + } + /* We have to use the function type for validation, as + DECL_ARGUMENTS returns NULL at this point. */ + int callback_fn_idx = TREE_INT_CST_LOW (cb_fn_idx_node); + tree decl_type_args = TYPE_ARG_TYPES (TREE_TYPE (decl)); + tree it; + int decl_nargs = list_length (decl_type_args); + for (it = decl_type_args; it != NULL_TREE; it = TREE_CHAIN (it)) + if (it == void_list_node) + { + --decl_nargs; + break; + } + if (callback_fn_idx == CB_UNKNOWN_POS) + { + error_at (DECL_SOURCE_LOCATION (decl), + "callback function position cannot be marked as unknown"); + *no_add_attrs = true; + return NULL_TREE; + } + --callback_fn_idx; + if (callback_fn_idx >= decl_nargs) + { + error_at (DECL_SOURCE_LOCATION (decl), + "callback function position out of range"); + *no_add_attrs = true; + return NULL_TREE; + } + + /* Search for the type of the callback function + in parameters of the original function. */ + tree cfn = get_nth_list_elem (decl_type_args, callback_fn_idx); + if (cfn == NULL_TREE) + { + error_at (DECL_SOURCE_LOCATION (decl), + "could not retrieve callback function from arguments"); + *no_add_attrs = true; + return NULL_TREE; + } + tree cfn_pointee_type = TREE_TYPE (cfn); + if (TREE_CODE (cfn) != POINTER_TYPE + || TREE_CODE (cfn_pointee_type) != FUNCTION_TYPE) + { + error_at (DECL_SOURCE_LOCATION (decl), + "argument no. %d is not an address of a function", + callback_fn_idx + 1); + *no_add_attrs = true; + return NULL_TREE; + } + + tree type_args = TYPE_ARG_TYPES (cfn_pointee_type); + /* Compare the length of the list of argument indices + and the real number of parameters the callback takes. */ + unsigned cfn_nargs = list_length (TREE_CHAIN (args)); + unsigned type_nargs = list_length (type_args); + for (it = type_args; it != NULL_TREE; it = TREE_CHAIN (it)) + if (it == void_list_node) + { + --type_nargs; + break; + } + if (cfn_nargs != type_nargs) + { + error_at (DECL_SOURCE_LOCATION (decl), + "argument number mismatch, %d expected, got %d", type_nargs, + cfn_nargs); + *no_add_attrs = true; + return NULL_TREE; + } + + unsigned curr = 0; + tree cfn_it; + /* Validate type compatibility of the arguments passed + from caller function to callback. "it" is used to step + through the parameters of the caller, "cfn_it" is + stepping through the parameters of the callback. */ + for (it = type_args, cfn_it = TREE_CHAIN (args); curr < type_nargs; + it = TREE_CHAIN (it), cfn_it = TREE_CHAIN (cfn_it), curr++) + { + if (TREE_CODE (TREE_VALUE (cfn_it)) != INTEGER_CST) + { + error_at (DECL_SOURCE_LOCATION (decl), + "argument no. %d is not an integer constant", curr + 1); + *no_add_attrs = true; + continue; + } + + int arg_idx = TREE_INT_CST_LOW (TREE_VALUE (cfn_it)); + + /* No need to check for type compatibility, + if we don't know what we are passing. */ + if (arg_idx == CB_UNKNOWN_POS) + continue; + + arg_idx -= 1; + /* Report an error if the position is out of bounds, + but we can still check the rest of the arguments. */ + if (arg_idx >= decl_nargs) + { + error_at (DECL_SOURCE_LOCATION (decl), + "callback argument index %d is out of range", arg_idx + 1); + *no_add_attrs = true; + continue; + } + + tree arg_type = get_nth_list_elem (decl_type_args, arg_idx); + tree expected_type = TREE_VALUE (it); + /* Check the type of the value we are about to pass ("arg_type") + for compatibility with the actual type the callback function + expects ("expected_type"). */ + if (!types_compatible_p (expected_type, arg_type)) + { + error_at (DECL_SOURCE_LOCATION (decl), + "argument type at index %d is not compatible with callback " + "argument type at index %d", + arg_idx + 1, curr + 1); + *no_add_attrs = true; + continue; + } + } + + /* Check that the decl does not already have a callback attribute describing + the same argument. */ + it = lookup_attribute (CALLBACK_ATTR_IDENT, DECL_ATTRIBUTES (decl)); + for (; it; it = lookup_attribute (CALLBACK_ATTR_IDENT, TREE_CHAIN (it))) + if (callback_get_fn_index (it) == callback_fn_idx) + { + error_at (DECL_SOURCE_LOCATION (decl), + "function declaration has multiple callback attributes " + "describing argument no. %d", + callback_fn_idx + 1); + *no_add_attrs = true; + break; + } + + return NULL_TREE; +} + +/* Returns TRUE if E is considered useful in the callgraph, FALSE otherwise. If + this predicate returns FALSE, then E wasn't used to optimize its callee and + can be safely removed from the callgraph. */ +bool +callback_edge_useful_p (cgraph_edge *e) +{ + gcc_checking_assert (e->callback); + /* If the edge is not pointing towards a clone, it is no longer useful as its + entire purpose is to produce clones of callbacks. */ + if (!e->callee->clone_of) + return false; + return true; +} + +/* Returns the number of arguments the callback function described by ATTR + takes. */ + +size_t +callback_num_args (tree attr) +{ + tree args = TREE_VALUE (attr); + size_t res = 0; + tree it; + + for (it = TREE_CHAIN (args); it != NULL_TREE; it = TREE_CHAIN (it), ++res) + ; + return res; +} diff --git a/gcc/attr-callback.h b/gcc/attr-callback.h new file mode 100644 index 000000000000..b0b08438afbe --- /dev/null +++ b/gcc/attr-callback.h @@ -0,0 +1,78 @@ +/* Callback attribute handling + Copyright (C) 2025 Free Software Foundation, Inc. + Contributed by Josef Melcr + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + GCC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + . */ + +#ifndef ATTR_CALLBACK_H +#define ATTR_CALLBACK_H + +enum callback_position +{ + /* Value used when an argument of a callback function + is unknown or when multiple values may be used. */ + CB_UNKNOWN_POS = 0 +}; + +#define CALLBACK_ATTR_IDENT " callback" + +/* Returns a callback attribute with callback index FN_IDX, and ARG_COUNT + arguments specified by VA_ARGS. */ +tree callback_build_attr (unsigned fn_idx, unsigned arg_count...); + +/* Returns TRUE if a function should be treated as if it had a callback + attribute despite the DECL not having it. STMT can be passed NULL + if the call statement is not available at the time, for example WPA, but it + should be called with the statement itself whenever possible. */ +bool callback_is_special_cased (tree decl, gcall *stmt); + +/* Returns an attribute for a special cased function. */ +tree callback_special_case_attr (tree decl); + +/* Given an instance of callback attribute, return the 0-based + index of the called function in question. */ +int callback_get_fn_index (tree cb_attr); + +/* For a given callback pair, retrieves the callback attribute used + to create E from the callee of CARRYING. */ +tree callback_fetch_attr_by_edge (cgraph_edge *e, cgraph_edge *carrying); + +/* Given an instance of callback attribute, return the 0-base indices + of arguments passed to the callback. For a callback function taking + n parameters, returns a vector of n indices of their values in the parameter + list of it's caller. Indices with unknown positions contain -1. */ +auto_vec callback_get_arg_mapping (cgraph_edge *e, cgraph_edge *carrying); + +/* For a callback pair, returns the 0-based index of the address of + E's callee in the argument list of CARRYING's callee decl. */ +int callback_fetch_fn_position (cgraph_edge *e, cgraph_edge *carrying); + +/* Handle a "callback" attribute; arguments as in + struct attribute_spec.handler. */ +tree handle_callback_attribute (tree *node, tree name, tree args, int flags, + bool *no_add_attrs); + +/* Returns TRUE if E is considered useful in the callgraph, FALSE otherwise. If + this predicate returns FALSE, then E wasn't used to optimize its callee and + can be safely removed from the callgraph. */ +bool callback_edge_useful_p (cgraph_edge *e); + +/* Returns the number of arguments the callback function described by ATTR + takes. */ +size_t callback_num_args (tree attr); + +#endif /* ATTR_CALLBACK_H */ diff --git a/gcc/attribs.cc b/gcc/attribs.cc index 3fce9d625256..7d7f8f36a7fc 100644 --- a/gcc/attribs.cc +++ b/gcc/attribs.cc @@ -39,6 +39,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-pretty-print.h" #include "intl.h" #include "gcc-urlifier.h" +#include "cgraph.h" /* Table of the tables of attributes (common, language, format, machine) searched. */ @@ -1085,7 +1086,27 @@ make_attribute (string_slice name, string_slice arg_name, tree chain) return attr; } -/* Common functions used for target clone support. */ +/* Default implementation of TARGET_OPTION_FUNCTIONS_B_RESOLVABLE_FROM_A. + Used to check very basically if DECL_B is callable from DECL_A. + For now this checks if the version strings are the same. */ + +bool +functions_b_resolvable_from_a (tree decl_a, tree decl_b, + tree base ATTRIBUTE_UNUSED) +{ + const char *attr_name = TARGET_HAS_FMV_TARGET_ATTRIBUTE + ? "target" + : "target_version"; + + tree attr_a = lookup_attribute (attr_name, DECL_ATTRIBUTES (decl_a)); + tree attr_b = lookup_attribute (attr_name, DECL_ATTRIBUTES (decl_b)); + + gcc_assert (attr_b); + if (!attr_a) + return false; + + return attribute_value_equal (attr_a, attr_b); +} /* Comparator function to be used in qsort routine to sort attribute specification strings to "target". */ @@ -1176,71 +1197,6 @@ sorted_attr_string (tree arglist) return ret_str; } - -/* This function returns true if FN1 and FN2 are versions of the same function, - that is, the target strings of the function decls are different. This assumes - that FN1 and FN2 have the same signature. */ - -bool -common_function_versions (tree fn1, tree fn2) -{ - tree attr1, attr2; - char *target1, *target2; - bool result; - - if (TREE_CODE (fn1) != FUNCTION_DECL - || TREE_CODE (fn2) != FUNCTION_DECL) - return false; - - attr1 = lookup_attribute ("target", DECL_ATTRIBUTES (fn1)); - attr2 = lookup_attribute ("target", DECL_ATTRIBUTES (fn2)); - - /* At least one function decl should have the target attribute specified. */ - if (attr1 == NULL_TREE && attr2 == NULL_TREE) - return false; - - /* Diagnose missing target attribute if one of the decls is already - multi-versioned. */ - if (attr1 == NULL_TREE || attr2 == NULL_TREE) - { - if (DECL_FUNCTION_VERSIONED (fn1) || DECL_FUNCTION_VERSIONED (fn2)) - { - if (attr2 != NULL_TREE) - { - std::swap (fn1, fn2); - attr1 = attr2; - } - auto_diagnostic_group d; - error_at (DECL_SOURCE_LOCATION (fn2), - "missing % attribute for multi-versioned %qD", - fn2); - inform (DECL_SOURCE_LOCATION (fn1), - "previous declaration of %qD", fn1); - /* Prevent diagnosing of the same error multiple times. */ - DECL_ATTRIBUTES (fn2) - = tree_cons (get_identifier ("target"), - copy_node (TREE_VALUE (attr1)), - DECL_ATTRIBUTES (fn2)); - } - return false; - } - - target1 = sorted_attr_string (TREE_VALUE (attr1)); - target2 = sorted_attr_string (TREE_VALUE (attr2)); - - /* The sorted target strings must be different for fn1 and fn2 - to be versions. */ - if (strcmp (target1, target2) == 0) - result = false; - else - result = true; - - XDELETEVEC (target1); - XDELETEVEC (target2); - - return result; -} - /* Make a dispatcher declaration for the multi-versioned function DECL. Calls to DECL function will be replaced with calls to the dispatcher by the front-end. Return the decl created. */ @@ -1248,18 +1204,12 @@ common_function_versions (tree fn1, tree fn2) tree make_dispatcher_decl (const tree decl) { - tree func_decl; - char *func_name; - tree fn_type, func_type; + tree fn_type = TREE_TYPE (decl); + tree func_type = build_function_type (TREE_TYPE (fn_type), + TYPE_ARG_TYPES (fn_type)); + tree func_decl = build_fn_decl (IDENTIFIER_POINTER (DECL_NAME (decl)), + func_type); - func_name = xstrdup (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl))); - - fn_type = TREE_TYPE (decl); - func_type = build_function_type (TREE_TYPE (fn_type), - TYPE_ARG_TYPES (fn_type)); - - func_decl = build_fn_decl (func_name, func_type); - XDELETEVEC (func_name); TREE_USED (func_decl) = 1; DECL_CONTEXT (func_decl) = NULL_TREE; DECL_INITIAL (func_decl) = error_mark_node; @@ -1269,6 +1219,34 @@ make_dispatcher_decl (const tree decl) DECL_EXTERNAL (func_decl) = 1; /* This will be of type IFUNCs have to be externally visible. */ TREE_PUBLIC (func_decl) = 1; + TREE_NOTHROW (func_decl) = TREE_NOTHROW (decl); + + /* Set the decl name to avoid graph_node re-mangling it. */ + SET_DECL_ASSEMBLER_NAME (func_decl, DECL_ASSEMBLER_NAME (decl)); + + cgraph_node *node = cgraph_node::get (decl); + gcc_assert (node); + cgraph_function_version_info *node_v = node->function_version (); + gcc_assert (node_v); + + /* Set flags on the cgraph_node for the new decl. */ + cgraph_node *func_node = cgraph_node::get_create (func_decl); + func_node->dispatcher_function = true; + func_node->definition = true; + + cgraph_function_version_info *func_v + = func_node->insert_new_function_version (); + func_v->next = node_v; + func_v->assembler_name = node_v->assembler_name; + + /* If the default node is from a target_clone, mark the dispatcher as from + target_clone. */ + func_node->is_target_clone = node->is_target_clone; + + /* Get the assembler name by mangling with the base assembler name. */ + tree id = targetm.mangle_decl_assembler_name + (func_decl, func_v->assembler_name); + symtab->change_decl_assembler_name (func_decl, id); return func_decl; } @@ -1277,7 +1255,8 @@ make_dispatcher_decl (const tree decl) With the target attribute semantics, returns true if the function is marked as default with the target version. With the target_version attribute semantics, returns true if the function - is either not annotated, or annotated as default. */ + is either not annotated, annotated as default, or is a target_clone + containing the default declaration. */ bool is_function_default_version (const tree decl) @@ -1294,6 +1273,13 @@ is_function_default_version (const tree decl) } else { + if (lookup_attribute ("target_clones", DECL_ATTRIBUTES (decl))) + { + int num_defaults = 0; + get_clone_versions (decl, &num_defaults); + return num_defaults > 0; + } + attr = lookup_attribute ("target_version", DECL_ATTRIBUTES (decl)); if (!attr) return true; diff --git a/gcc/attribs.h b/gcc/attribs.h index b8b6838599cc..b6f3d5a0f9bb 100644 --- a/gcc/attribs.h +++ b/gcc/attribs.h @@ -54,9 +54,9 @@ extern struct scoped_attributes * register_scoped_attributes (const scoped_attribute_specs &, bool = false); extern char *sorted_attr_string (tree); -extern bool common_function_versions (tree, tree); extern tree make_dispatcher_decl (const tree); extern bool is_function_default_version (const tree); +extern bool functions_b_resolvable_from_a (tree, tree, tree); extern void handle_ignored_attributes_option (vec *); /* Return a type like TTYPE except that its TYPE_ATTRIBUTES diff --git a/gcc/auto-profile.cc b/gcc/auto-profile.cc index ce607a68d2ee..cf7a21913361 100644 --- a/gcc/auto-profile.cc +++ b/gcc/auto-profile.cc @@ -100,7 +100,7 @@ along with GCC; see the file COPYING3. If not see significantly form one inline instance to another and from the offline version. - This is controlled by -fauto-profile-inlinig and is independent + This is controlled by -fauto-profile-inlining and is independent of -fearly-inlining. Phase 4: In AFDO pass. @@ -128,7 +128,7 @@ along with GCC; see the file COPYING3. If not see considered cols. */ gcov_type afdo_hot_bb_threshod = -1; -/* Return ture if COUNT is possiby hot. */ +/* Return true if COUNT is possibly hot. */ bool maybe_hot_afdo_count_p (profile_count count) { @@ -136,6 +136,24 @@ maybe_hot_afdo_count_p (profile_count count) return count.ipa ().to_gcov_type () >= afdo_hot_bb_threshod; } +/* Return true if location of STMT may be expressed by debug info. */ + +static bool +stmt_loc_used_by_debug_info (gimple *stmt) +{ + /* Only inline_entry and gimple_bind's locations + are not output into debug output. */ + if (is_gimple_debug (stmt)) + return gimple_debug_begin_stmt_p (stmt); + if (gimple_code (stmt) == GIMPLE_LABEL + || gimple_code (stmt) == GIMPLE_NOP + || gimple_code (stmt) == GIMPLE_PREDICT) + return false; + if (gimple_clobber_p (stmt)) + return false; + return true; +} + namespace autofdo { @@ -354,7 +372,7 @@ class function_instance removed_icall_target_ = true; } - /* Reutrn true if function is removed from indir target list. */ + /* Return true if function is removed from indir target list. */ bool removed_icall_target () { @@ -488,7 +506,7 @@ class function_instance to it. */ bool realized_; - /* Ture if function is in worklist for merging/offlining. */ + /* True if function is in worklist for merging/offlining. */ bool in_worklist_; /* Pointer to outer function instance or NULL if this @@ -1072,7 +1090,7 @@ function_instance::merge (function_instance *other, } /* Make inline function FN offline. - If tolevel function of same name already exists, then merge profiles. + If toplevel function of same name already exists, then merge profiles. Otherwise turn FN toplevel. Return true if new toplevel function was introduced. If new toplevel functions are created and NEW_FUNCTIONS != NULL, @@ -1353,10 +1371,13 @@ function_instance::match (cgraph_node *node, gphi *phi = gpi.phi (); inline_stack stack; + /* We do not assign discriminators to PHI nodes. + In case we every start using them, we wil need to + update tree-cfg.cc::assign_discriminators. */ + gcc_assert (gimple_location (phi) == UNKNOWN_LOCATION); get_inline_stack_in_node (gimple_location (phi), &stack, node); count_info *info = lookup_count (gimple_location (phi), stack, node); - if (info) - counts.add (info); + gcc_assert (!info); dump_stmt (phi, info, NULL, stack); counts.add (info); for (edge e : bb->succs) @@ -1620,7 +1641,7 @@ function_instance::match (cgraph_node *node, unsigned int start_location = get_combined_location (DECL_STRUCT_FUNCTION (node->decl)->function_start_locus, node->decl); /* When outputting code to builtins location we use line number 0. - craeate_gcov is stupid and hapilly computes offsets across files. + create_gcov is stupid and happily computes offsets across files. Silently ignore it. */ unsigned int zero_location = ((unsigned)(1-DECL_SOURCE_LINE (node->decl))) << 16; @@ -2072,11 +2093,11 @@ autofdo_source_profile::offline_external_functions () seen.add (iter.first); } - /* Now process all tolevel (offline) function instances. + /* Now process all toplevel (offline) function instances. If instance has no definition in this translation unit, first offline all inlined functions which are defined here - (so we do not lose porfile due to cross-module inlining + (so we do not lose profile due to cross-module inlining done by link-time optimizers). If instance has a definition, look into all inlined functions @@ -2417,6 +2438,7 @@ bool autofdo_source_profile::get_count_info (gimple *stmt, count_info *info, cgraph_node *node) const { + gcc_checking_assert (stmt_loc_used_by_debug_info (stmt)); return get_count_info (gimple_location (stmt), info, node); } @@ -2627,7 +2649,7 @@ autofdo_source_profile::read () bigger than sum_max eventually. */ if (afdo_profile_info->sum_max) afdo_count_scale - = MAX (((gcov_type)1 << (profile_count::n_bits / 2)) + = MAX (((gcov_type)1 << (profile_count::n_bits - 10)) / afdo_profile_info->sum_max, 1); afdo_profile_info->cutoff *= afdo_count_scale; afdo_hot_bb_threshod @@ -2675,7 +2697,7 @@ autofdo_source_profile::get_function_instance_by_inline_stack ( if (s == NULL) { /* afdo inliner extends the stack by last entry with unknown - location while chekcing if function was inlined during train run. + location while checking if function was inlined during train run. We do not want to print diagnostics about every function which is not inlined. */ if (s && dump_enabled_p () && stack[i].location != UNKNOWN_LOCATION) @@ -2950,6 +2972,48 @@ update_count_by_afdo_count (profile_count *count, profile_count c) *count = c; } +/* Try to determine unscaled count of edge E. + Return -1 if nothing is known. */ + +static gcov_type +afdo_unscaled_edge_count (edge e) +{ + gcov_type max_count = -1; + basic_block bb_succ = e->dest; + count_info info; + if (afdo_source_profile->get_count_info (e->goto_locus, &info)) + { + if (info.count > max_count) + max_count = info.count; + if (dump_file && info.count) + { + fprintf (dump_file, + " goto location of edge %i->%i with count %" PRIu64"\n", + e->src->index, e->dest->index, (int64_t)info.count); + } + } + for (gphi_iterator gpi = gsi_start_phis (bb_succ); + !gsi_end_p (gpi); gsi_next (&gpi)) + { + gphi *phi = gpi.phi (); + location_t phi_loc + = gimple_phi_arg_location_from_edge (phi, e); + if (afdo_source_profile->get_count_info (phi_loc, &info)) + { + if (info.count > max_count) + max_count = info.count; + if (dump_file && info.count) + { + fprintf (dump_file, + " phi op of edge %i->%i with count %" PRIu64": ", + e->src->index, e->dest->index, (int64_t)info.count); + print_gimple_stmt (dump_file, phi, 0, TDF_SLIM); + } + } + } + return max_count; +} + /* For a given BB, set its execution count. Attach value profile if a stmt is not in PROMOTED, because we only want to promote an indirect call once. Return TRUE if BB is annotated. */ @@ -2958,8 +3022,7 @@ static bool afdo_set_bb_count (basic_block bb, hash_set &zero_bbs) { gimple_stmt_iterator gsi; - gcov_type max_count = 0; - bool has_annotated = false; + gcov_type max_count = -1; if (dump_file) fprintf (dump_file, " Looking up AFDO count of bb %i\n", bb->index); @@ -2967,7 +3030,7 @@ afdo_set_bb_count (basic_block bb, hash_set &zero_bbs) { count_info info; gimple *stmt = gsi_stmt (gsi); - if (gimple_clobber_p (stmt)) + if (!stmt_loc_used_by_debug_info (stmt)) continue; if (afdo_source_profile->get_count_info (stmt, &info)) { @@ -2979,7 +3042,6 @@ afdo_set_bb_count (basic_block bb, hash_set &zero_bbs) (int64_t)info.count); print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM); } - has_annotated = true; gcall *call = dyn_cast (gsi_stmt (gsi)); /* TODO; if inlined early and indirect call was not optimized out, we will end up speculating again. Early inliner should remove @@ -2990,44 +3052,11 @@ afdo_set_bb_count (basic_block bb, hash_set &zero_bbs) } } - if (!has_annotated) - { - /* For an empty BB with all debug stmt which assigne a value with - constant, check successors PHIs corresponding to the block and - use those counts. */ - edge tmp_e; - edge_iterator tmp_ei; - FOR_EACH_EDGE (tmp_e, tmp_ei, bb->succs) - { - basic_block bb_succ = tmp_e->dest; - for (gphi_iterator gpi = gsi_start_phis (bb_succ); - !gsi_end_p (gpi); - gsi_next (&gpi)) - { - gphi *phi = gpi.phi (); - location_t phi_loc - = gimple_phi_arg_location_from_edge (phi, tmp_e); - count_info info; - if (afdo_source_profile->get_count_info (phi_loc, &info) - && info.count != 0) - { - if (info.count > max_count) - max_count = info.count; - if (dump_file && info.count) - { - fprintf (dump_file, - " phi op in BB %i with count %" PRIu64": ", - bb_succ->index, (int64_t)info.count); - print_gimple_stmt (dump_file, phi, 0, TDF_SLIM); - } - has_annotated = true; - } - } - } + if (max_count == -1 && single_succ_p (bb)) + max_count = afdo_unscaled_edge_count (single_succ_edge (bb)); - if (!has_annotated) - return false; - } + if (max_count == -1) + return false; if (max_count) { @@ -3181,6 +3210,8 @@ afdo_propagate_edge (bool is_succ, bb_set *annotated_bb) changed = true; } else if (is_bb_annotated (bb, *annotated_bb) + /* We do not want to consider 0 (afdo) > 0 (precise) */ + && total_known_count.nonzero_p () && bb->count < total_known_count) { if (dump_file) @@ -3417,7 +3448,7 @@ cmp (const void *a, const void *b) return 0; } -/* To scalle a connected component of graph we collect desired scales of +/* To scale a connected component of graph we collect desired scales of basic blocks on the boundary and then compute a robust average. */ struct scale @@ -3483,6 +3514,110 @@ scale_bbs (const vec &bbs, sreal scale) } } +/* Determine scaling factor by taking robust average of SCALES + and taking into account limits. + MAX_COUNT is maximal guessed count to be scaled while MAC_COUNT_IN_FN + is maximal count in function determined by auto-fdo. */ + +sreal +determine_scale (vec *scales, profile_count max_count, + profile_count max_count_in_fn) +{ + scales->qsort (cmp); + + uint64_t overall_weight = 0; + for (scale &e : *scales) + overall_weight += e.weight; + + uint64_t cummulated = 0, weight_sum = 0; + sreal scale_sum = 0; + for (scale &e : *scales) + { + uint64_t prev = cummulated; + cummulated += e.weight; + if (cummulated >= overall_weight / 4 + && prev <= 3 * overall_weight / 4) + { + scale_sum += e.scale * e.weight; + weight_sum += e.weight; + if (dump_file) + fprintf (dump_file, " accounting scale %.16f, weight %" PRId64 "\n", + e.scale.to_double (), e.weight); + } + else if (dump_file) + fprintf (dump_file, " ignoring scale %.16f, weight %" PRId64 "\n", + e.scale.to_double (), e.weight); + } + sreal scale = scale_sum / (sreal)weight_sum; + + /* Avoid scaled regions to have very large counts. + Otherwise they may dominate ipa-profile's histogram computing cutoff + of hot basic blocks. */ + if (max_count * scale > max_count_in_fn.guessed_local ().apply_scale (128, 1)) + { + if (dump_file) + { + fprintf (dump_file, "Scaling by %.16f produces max count ", + scale.to_double ()); + (max_count * scale).dump (dump_file); + fprintf (dump_file, " that exceeds max count in fn "); + max_count_in_fn.dump (dump_file); + fprintf (dump_file, "; capping\n"); + } + scale = max_count_in_fn.guessed_local ().to_sreal_scale (max_count); + } + return scale; +} + +/* Scale profile of the whole function to approximately match auto-profile. */ + +bool +scale_bb_profile () +{ + const function_instance *s + = afdo_source_profile->get_function_instance_by_decl + (current_function_decl); + + /* In the first pass only store non-zero counts. */ + gcov_type head_count = s->head_count () * autofdo::afdo_count_scale; + hash_set zero_bbs; + auto_vec bbs (n_basic_blocks_for_fn (cfun)); + auto_vec scales; + basic_block bb; + profile_count max_count = profile_count::zero (); + profile_count max_count_in_fn = profile_count::zero (); + bbs.quick_push (ENTRY_BLOCK_PTR_FOR_FN (cfun)); + bbs.quick_push (EXIT_BLOCK_PTR_FOR_FN (cfun)); + if (head_count > 0) + { + profile_count entry_count = ENTRY_BLOCK_PTR_FOR_FN (cfun)->count; + max_count = entry_count; + update_count_by_afdo_count (&entry_count, head_count); + max_count_in_fn = entry_count; + add_scale (&scales, entry_count, ENTRY_BLOCK_PTR_FOR_FN (cfun)->count); + } + FOR_EACH_BB_FN (bb, cfun) + { + profile_count cnt = bb->count; + bbs.safe_push (bb); + max_count = profile_count::max_prefer_initialized (max_count, cnt); + if (afdo_set_bb_count (bb, zero_bbs)) + { + std::swap (cnt, bb->count); + max_count_in_fn + = profile_count::max_prefer_initialized (max_count_in_fn, cnt); + add_scale (&scales, cnt, bb->count); + } + } + if (scales.length ()) + { + sreal scale = determine_scale (&scales, max_count, max_count_in_fn); + scale_bbs (bbs, scale); + return true; + } + return false; +} + /* In case given basic block was fully optimized out, AutoFDO will have no data about it. In this case try to preserve static profile. Identify connected components (in undirected form of CFG) which has @@ -3512,7 +3647,8 @@ afdo_adjust_guessed_profile (bb_set *annotated_bb) if (is_bb_annotated (seed_bb, *annotated_bb)) { component[seed_bb->index] = 1; - max_count_in_fn = max_count_in_fn.max (seed_bb->count); + max_count_in_fn + = profile_count::max_prefer_initialized (max_count_in_fn, seed_bb->count); } else component[seed_bb->index] = 0; @@ -3535,7 +3671,7 @@ afdo_adjust_guessed_profile (bb_set *annotated_bb) basic_block b = stack.pop (); bbs.quick_push (b); - max_count = max_count.max (b->count); + max_count = profile_count::max_prefer_initialized (max_count, b->count); for (edge e: b->preds) if (!component[e->src->index]) @@ -3692,47 +3828,7 @@ afdo_adjust_guessed_profile (bb_set *annotated_bb) continue; } gcc_checking_assert (scales.length ()); - scales.qsort (cmp); - - uint64_t overall_weight = 0; - for (scale &e : scales) - overall_weight += e.weight; - - uint64_t cummulated = 0, weight_sum = 0; - sreal scale_sum = 0; - for (scale &e : scales) - { - uint64_t prev = cummulated; - cummulated += e.weight; - if (cummulated >= overall_weight / 4 - && prev <= 3 * overall_weight / 4) - { - scale_sum += e.scale * e.weight; - weight_sum += e.weight; - if (dump_file) - fprintf (dump_file, " accounting scale %.16f, weight %" PRId64 "\n", - e.scale.to_double (), e.weight); - } - else if (dump_file) - fprintf (dump_file, " ignoring scale %.16f, weight %" PRId64 "\n", - e.scale.to_double (), e.weight); - } - sreal scale = scale_sum / (sreal)weight_sum; - - /* Avoid scaled regions to have very large counts. - Otherwise they may dominate ipa-profile's histogram computing cutoff - of hot basic blocks. */ - if (max_count * scale > max_count_in_fn.guessed_local ()) - { - if (dump_file) - { - fprintf (dump_file, "Scaling by %.16f produces max count ", - scale.to_double ()); - (max_count * scale).dump (dump_file); - fprintf (dump_file, " that exceeds max count in fn; capping\n"); - } - scale = max_count_in_fn.guessed_local ().to_sreal_scale (max_count); - } + sreal scale = determine_scale (&scales, max_count, max_count_in_fn); scale_bbs (bbs, scale); } } @@ -3754,6 +3850,30 @@ afdo_calculate_branch_prob (bb_set *annotated_bb) { gcc_assert (e->aux == NULL); e->aux = new edge_info (); + gcov_type c = afdo_unscaled_edge_count (e); + if (c == 0 && e->count () == profile_count::zero ()) + { + AFDO_EINFO (e)->set_count (profile_count::zero ()); + if (dump_file) + fprintf (dump_file, + " Annotating edge %i->%i with count 0;" + " static profile aggress", + e->src->index, e->dest->index); + } + else if (c > 0) + { + AFDO_EINFO (e)->set_count + (profile_count::from_gcov_type + (c * autofdo::afdo_count_scale).afdo ()); + if (dump_file) + { + fprintf (dump_file, + " Annotating edge %i->%i with count ", + e->src->index, e->dest->index); + AFDO_EINFO (e)->get_count ().dump (dump_file); + fprintf (dump_file, "\n"); + } + } } } @@ -3784,24 +3904,41 @@ afdo_calculate_branch_prob (bb_set *annotated_bb) } if (!all_known || !total_count.nonzero_p ()) continue; + if (dump_file) + { + fprintf (dump_file, "Total count of bb %i is ", bb->index); + total_count.dump (dump_file); + fprintf (dump_file, "\n"); + } FOR_EACH_EDGE (e, ei, bb->succs) if (AFDO_EINFO (e)->is_annotated ()) { + profile_count cnt = AFDO_EINFO (e)->get_count (); /* If probability is 1, preserve reliable static prediction (This is, for example the case of single fallthru edge or single fallthru plus unlikely EH edge.) */ - if (AFDO_EINFO (e)->get_count () == total_count + if (cnt == total_count && e->probability == profile_probability::always ()) ; - else if (AFDO_EINFO (e)->get_count ().nonzero_p ()) + else if (cnt.nonzero_p ()) e->probability - = AFDO_EINFO (e)->get_count ().probability_in (total_count); + = cnt.probability_in (total_count); /* If probability is zero, preserve reliable static prediction. */ else if (e->probability.nonzero_p () || e->probability.quality () == GUESSED) e->probability = profile_probability::never ().afdo (); + if (dump_file) + { + fprintf (dump_file, " probability of edge %i->%i" + " with count ", + e->src->index, e->dest->index); + cnt.dump (dump_file); + fprintf (dump_file, " set to "); + e->probability.dump (dump_file); + fprintf (dump_file, "\n"); + } } } afdo_adjust_guessed_profile (annotated_bb); @@ -3858,21 +3995,30 @@ afdo_annotate_cfg (void) s->dump (dump_file); fprintf (dump_file, "\n"); } - - /* In the first pass only store non-zero counts. */ - gcov_type head_count = s->head_count () * autofdo::afdo_count_scale; - bool profile_found = head_count > 0; + bool profile_found = false; hash_set zero_bbs; - FOR_EACH_BB_FN (bb, cfun) + gcov_type head_count = s->head_count () * autofdo::afdo_count_scale; + + if (!param_auto_profile_bbs) { - if (afdo_set_bb_count (bb, zero_bbs)) + if (scale_bb_profile ()) + return; + } + else + { + /* In the first pass only store non-zero counts. */ + profile_found = head_count > 0; + FOR_EACH_BB_FN (bb, cfun) { - if (bb->count.quality () == AFDO) + if (afdo_set_bb_count (bb, zero_bbs)) { - gcc_assert (bb->count.nonzero_p ()); - profile_found = true; + if (bb->count.quality () == AFDO) + { + gcc_assert (bb->count.nonzero_p ()); + profile_found = true; + } + set_bb_annotated (bb, &annotated_bb); } - set_bb_annotated (bb, &annotated_bb); } } /* Exit without clobbering static profile if there was no @@ -4133,8 +4279,10 @@ afdo_vpt_for_early_inline (cgraph_node *node) for (gimple_stmt_iterator gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) { - autofdo::count_info info; gimple *stmt = gsi_stmt (gsi); + if (!stmt_loc_used_by_debug_info (stmt)) + continue; + autofdo::count_info info; if (autofdo::afdo_source_profile->get_count_info (stmt, &info, node)) bb_count = MAX (bb_count, info.count); } diff --git a/gcc/auto-profile.h b/gcc/auto-profile.h index 639e263ef7a9..3cce5f2152ca 100644 --- a/gcc/auto-profile.h +++ b/gcc/auto-profile.h @@ -39,7 +39,7 @@ extern void remove_afdo_speculative_target (cgraph_edge *); considered cols. */ extern gcov_type afdo_hot_bb_threshold; -/* Return ture if COUNT is possiby hot. */ +/* Return true if COUNT is possibly hot. */ extern bool maybe_hot_afdo_count_p (profile_count count); #endif /* AUTO_PROFILE_H */ diff --git a/gcc/basic-block.h b/gcc/basic-block.h index 049631de49b9..410a03c6a5af 100644 --- a/gcc/basic-block.h +++ b/gcc/basic-block.h @@ -293,11 +293,6 @@ enum cfg_bb_flags /* Return expected execution frequency of the edge E. */ #define EDGE_FREQUENCY(e) e->count ().to_frequency (cfun) -/* Compute a scale factor (or probability) suitable for scaling of - gcov_type values via apply_probability() and apply_scale(). */ -#define GCOV_COMPUTE_SCALE(num,den) \ - ((den) ? RDIV ((num) * REG_BR_PROB_BASE, (den)) : REG_BR_PROB_BASE) - /* Return nonzero if edge is critical. */ #define EDGE_CRITICAL_P(e) (EDGE_COUNT ((e)->src->succs) >= 2 \ && EDGE_COUNT ((e)->dest->preds) >= 2) diff --git a/gcc/bb-reorder.cc b/gcc/bb-reorder.cc index 641b4928ffba..e4efdee0b16e 100644 --- a/gcc/bb-reorder.cc +++ b/gcc/bb-reorder.cc @@ -2389,8 +2389,10 @@ edge_order (const void *ve1, const void *ve2) /* Since profile_count::operator< does not establish a strict weak order in presence of uninitialized counts, use 'max': this makes them appear as if having execution frequency less than any initialized count. */ - profile_count m = c1.max (c2); - return (m == c2) - (m == c1); + gcov_type gc1 = c1.initialized_p () ? c1.to_gcov_type () : 0; + gcov_type gc2 = c2.initialized_p () ? c2.to_gcov_type () : 0; + gcov_type m = MAX (gc1, gc2); + return (m == gc1) - (m == gc2); } /* Reorder basic blocks using the "simple" algorithm. This tries to diff --git a/gcc/btfout.cc b/gcc/btfout.cc index ff7ea42a9614..5a210cd51e6c 100644 --- a/gcc/btfout.cc +++ b/gcc/btfout.cc @@ -141,6 +141,8 @@ get_btf_kind (uint32_t ctf_kind) case CTF_K_VOLATILE: return BTF_KIND_VOLATILE; case CTF_K_CONST: return BTF_KIND_CONST; case CTF_K_RESTRICT: return BTF_KIND_RESTRICT; + case CTF_K_DECL_TAG: return BTF_KIND_DECL_TAG; + case CTF_K_TYPE_TAG: return BTF_KIND_TYPE_TAG; default:; } return BTF_KIND_UNKN; @@ -217,6 +219,7 @@ btf_calc_num_vbytes (ctf_dtdef_ref dtd) case BTF_KIND_CONST: case BTF_KIND_RESTRICT: case BTF_KIND_FUNC: + case BTF_KIND_TYPE_TAG: /* These kinds have no vlen data. */ break; @@ -256,6 +259,10 @@ btf_calc_num_vbytes (ctf_dtdef_ref dtd) vlen_bytes += vlen * sizeof (struct btf_var_secinfo); break; + case BTF_KIND_DECL_TAG: + vlen_bytes += sizeof (struct btf_decl_tag); + break; + default: break; } @@ -452,6 +459,20 @@ btf_asm_type (ctf_dtdef_ref dtd) and should write 0. */ dw2_asm_output_data (4, 0, "(unused)"); return; + case BTF_KIND_DECL_TAG: + { + if (dtd->ref_type) + break; + else if (dtd->dtd_u.dtu_tag.ref_var) + { + /* ref_type is NULL for decl tag attached to a variable. */ + ctf_dvdef_ref dvd = dtd->dtd_u.dtu_tag.ref_var; + dw2_asm_output_data (4, dvd->dvd_id, + "btt_type: (BTF_KIND_VAR '%s')", + dvd->dvd_name); + return; + } + } default: break; } @@ -801,6 +822,12 @@ output_asm_btf_vlen_bytes (ctf_container_ref ctfc, ctf_dtdef_ref dtd) at this point. */ gcc_unreachable (); + case BTF_KIND_DECL_TAG: + dw2_asm_output_data (4, dtd->dtd_u.dtu_tag.component_idx, + "component_idx=%d", + dtd->dtd_u.dtu_tag.component_idx); + break; + default: /* All other BTF type kinds have no variable length data. */ break; @@ -851,6 +878,20 @@ output_btf_func_types (void) btf_asm_func_type (ref); } +static void +output_btf_tags (ctf_container_ref ctfc) +{ + /* If pruning, tags which are not pruned have already been added to + the used list and output by output_btf_types. */ + if (debug_prune_btf) + return; + + ctf_dtdef_ref dtd; + unsigned i; + FOR_EACH_VEC_ELT (*ctfc->ctfc_tags, i, dtd) + output_asm_btf_type (ctfc, dtd); +} + /* Output all BTF_KIND_DATASEC records. */ static void @@ -869,6 +910,7 @@ btf_output (ctf_container_ref ctfc) output_btf_types (ctfc); output_btf_vars (ctfc); output_btf_func_types (); + output_btf_tags (ctfc); output_btf_datasec_types (); output_btf_strs (ctfc); } @@ -985,7 +1027,8 @@ static vec fixups; is created and emitted. This vector stores them. */ static GTY (()) vec *forwards; -/* Recursively add type DTD and any types it references to the used set. +/* Implementation of btf_add_used_type. + Recursively add type DTD and any types it references to the used set. Return a type that should be used for references to DTD - usually DTD itself, but may be NULL if DTD corresponds to a type which will not be emitted. CHECK_PTR is true if one of the predecessors in recursive calls is a struct @@ -996,8 +1039,8 @@ static GTY (()) vec *forwards; CREATE_FIXUPS is false. */ static ctf_dtdef_ref -btf_add_used_type (ctf_container_ref ctfc, ctf_dtdef_ref dtd, - bool check_ptr, bool seen_ptr, bool create_fixups) +btf_add_used_type_1 (ctf_container_ref ctfc, ctf_dtdef_ref dtd, + bool check_ptr, bool seen_ptr, bool create_fixups) { if (dtd == NULL) return NULL; @@ -1029,8 +1072,9 @@ btf_add_used_type (ctf_container_ref ctfc, ctf_dtdef_ref dtd, fixups.unordered_remove (i); /* Add the concrete base type. */ - dtd->ref_type = btf_add_used_type (ctfc, dtd->ref_type, check_ptr, - seen_ptr, create_fixups); + dtd->ref_type = btf_add_used_type_1 (ctfc, dtd->ref_type, + check_ptr, seen_ptr, + create_fixups); return dtd; } default: @@ -1044,8 +1088,8 @@ btf_add_used_type (ctf_container_ref ctfc, ctf_dtdef_ref dtd, the reference to the bitfield. The slice type won't be emitted, but we need the information in it when writing out the bitfield encoding. */ - btf_add_used_type (ctfc, dtd->dtd_u.dtu_slice.cts_type, - check_ptr, seen_ptr, create_fixups); + btf_add_used_type_1 (ctfc, dtd->dtd_u.dtu_slice.cts_type, + check_ptr, seen_ptr, create_fixups); return dtd; } @@ -1069,7 +1113,11 @@ btf_add_used_type (ctf_container_ref ctfc, ctf_dtdef_ref dtd, case BTF_KIND_INT: case BTF_KIND_FLOAT: case BTF_KIND_FWD: - /* Leaf kinds which do not refer to any other types. */ + case BTF_KIND_DECL_TAG: + /* Leaf kinds which do not refer to any other types. + BTF_KIND_DECL_TAG is a special case: we treat it as though it does not + refer to any other types, since we only want the DECL_TAG to be added + if the type to which it refers has already been added. */ break; case BTF_KIND_FUNC: @@ -1082,6 +1130,7 @@ btf_add_used_type (ctf_container_ref ctfc, ctf_dtdef_ref dtd, case BTF_KIND_CONST: case BTF_KIND_VOLATILE: case BTF_KIND_RESTRICT: + case BTF_KIND_TYPE_TAG: { /* These type kinds refer to exactly one other type. */ if (check_ptr && !seen_ptr) @@ -1106,18 +1155,18 @@ btf_add_used_type (ctf_container_ref ctfc, ctf_dtdef_ref dtd, } /* Add the type to which this type refers. */ - dtd->ref_type = btf_add_used_type (ctfc, dtd->ref_type, check_ptr, - seen_ptr, create_fixups); + dtd->ref_type = btf_add_used_type_1 (ctfc, dtd->ref_type, check_ptr, + seen_ptr, create_fixups); break; } case BTF_KIND_ARRAY: { /* Add element and index types. */ ctf_arinfo_t *arr = &(dtd->dtd_u.dtu_arr); - arr->ctr_contents = btf_add_used_type (ctfc, arr->ctr_contents, false, - false, create_fixups); - arr->ctr_index = btf_add_used_type (ctfc, arr->ctr_index, false, false, - create_fixups); + arr->ctr_contents = btf_add_used_type_1 (ctfc, arr->ctr_contents, + false, false, create_fixups); + arr->ctr_index = btf_add_used_type_1 (ctfc, arr->ctr_index, false, + false, create_fixups); break; } case BTF_KIND_STRUCT: @@ -1133,8 +1182,8 @@ btf_add_used_type (ctf_container_ref ctfc, ctf_dtdef_ref dtd, /* Add member type for struct/union members. For enums, only the enumerator names are needed. */ if (kind == BTF_KIND_STRUCT || kind == BTF_KIND_UNION) - dmd->dmd_type = btf_add_used_type (ctfc, dmd->dmd_type, true, - false, create_fixups); + dmd->dmd_type = btf_add_used_type_1 (ctfc, dmd->dmd_type, true, + false, create_fixups); ctf_add_string (ctfc, dmd->dmd_name, &(dmd->dmd_name_offset), CTF_STRTAB); } @@ -1143,16 +1192,17 @@ btf_add_used_type (ctf_container_ref ctfc, ctf_dtdef_ref dtd, case BTF_KIND_FUNC_PROTO: { /* Add return type. */ - dtd->ref_type = btf_add_used_type (ctfc, dtd->ref_type, false, false, - create_fixups); + dtd->ref_type = btf_add_used_type_1 (ctfc, dtd->ref_type, false, false, + create_fixups); /* Add arg types. */ ctf_func_arg_t * farg; for (farg = dtd->dtd_u.dtu_argv; farg != NULL; farg = (ctf_func_arg_t *) ctf_farg_list_next (farg)) { - farg->farg_type = btf_add_used_type (ctfc, farg->farg_type, false, - false, create_fixups); + farg->farg_type = btf_add_used_type_1 (ctfc, farg->farg_type, + false, false, + create_fixups); /* Note: argument names are stored in the auxilliary string table, since CTF does not include arg names. That table has not been cleared, so no need to re-add argument names here. */ @@ -1166,6 +1216,16 @@ btf_add_used_type (ctf_container_ref ctfc, ctf_dtdef_ref dtd, return dtd; } +/* Recursively add type DTD and any types it references to the used set. + Return a type that should be used for references to DTD - usually DTD itself, + but may be NULL if DTD corresponds to a type which will not be emitted. */ + +static ctf_dtdef_ref +btf_add_used_type (ctf_container_ref ctfc, ctf_dtdef_ref dtd) +{ + return btf_add_used_type_1 (ctfc, dtd, false, false, true); +} + /* Initial entry point of BTF generation, called at early_finish () after CTF information has possibly been output. Translate all CTF information to BTF, and do any processing that must be done early, such as creating @@ -1402,7 +1462,7 @@ btf_add_vars (ctf_container_ref ctfc) ctf_dmdef_t *dmd; for (dmd = dtd->dtd_u.dtu_members; dmd != NULL; dmd = (ctf_dmdef_t *) ctf_dmd_list_next (dmd)) - btf_add_used_type (ctfc, dmd->dmd_type, false, false, true); + btf_add_used_type (ctfc, dmd->dmd_type); } } } @@ -1488,6 +1548,39 @@ btf_assign_var_ids (ctf_container_ref ctfc) } } +/* Assign BTF IDs for type and decl tags and account for their size. */ + +static void +btf_assign_tag_ids (ctf_container_ref ctfc) +{ + size_t num_tags = vec_safe_length (ctfc->ctfc_tags); + if (num_tags == 0) + return; + + unsigned int i; + ctf_dtdef_ref dtd; + FOR_EACH_VEC_ELT (*ctfc->ctfc_tags, i, dtd) + { + /* Assign BTF id. */ + ctf_id_t id = ctfc->ctfc_nextid++; + gcc_assert (id <= BTF_MAX_TYPE); + dtd->dtd_type = id; + + /* Tags on functions will have a ref_type pointing to the + FUNC_PROTO, we want them to point the FUNC record instead. */ + ctf_dtdef_ref *pdtd = NULL; + if (dtd->ref_type && (pdtd = func_map->get (dtd->ref_type)) != NULL) + dtd->ref_type = *pdtd; + + /* Strings for tags are stored in the auxiliary strtab, which is + concatenated after the regular strtab. ctti_name only accounts + for offset in the auxiliary strtab until this point. */ + dtd->dtd_data.ctti_name += ctfc_get_strtab_len (ctfc, CTF_STRTAB); + ctfc->ctfc_num_types++; + ctfc->ctfc_num_vlen_bytes += btf_calc_num_vbytes (dtd); + } +} + /* Assign BTF IDs for datasec records and account for their size. */ static void @@ -1522,7 +1615,7 @@ btf_mark_type_used (tree t) if (!dtd) return; - btf_add_used_type (ctfc, dtd, false, false, true); + btf_add_used_type (ctfc, dtd); } /* Callback used for assembling the only-used-types list. Note that this is @@ -1549,7 +1642,7 @@ btf_collect_pruned_types (ctf_container_ref ctfc) size_t i; FOR_EACH_VEC_ELT (*funcs, i, dtd) { - btf_add_used_type (ctfc, dtd->ref_type, false, false, true); + btf_add_used_type (ctfc, dtd->ref_type); ctf_add_string (ctfc, dtd->dtd_name, &(dtd->dtd_data.ctti_name), CTF_STRTAB); } @@ -1558,10 +1651,33 @@ btf_collect_pruned_types (ctf_container_ref ctfc) for (i = 0; i < ctfc->ctfc_vars_list_count; i++) { ctf_dvdef_ref dvd = ctfc->ctfc_vars_list[i]; - btf_add_used_type (ctfc, dvd->dvd_type, false, false, true); + btf_add_used_type (ctfc, dvd->dvd_type); ctf_add_string (ctfc, dvd->dvd_name, &(dvd->dvd_name_offset), CTF_STRTAB); } + /* Used type tags will be added by recursive btf_add_used_type calls above. + For decl tags, scan the list and only add those decl tags whose referent + types are marked as used. We may have pruned a struct type with members + annotated by a decl tag. */ + FOR_EACH_VEC_ELT (*ctfc->ctfc_tags, i, dtd) + { + /* Only add decl tags whose referent types have not been pruned. + Variables are never pruned, so decl tags on variables are always + used. */ + if (btf_dtd_kind (dtd) == BTF_KIND_DECL_TAG + && ((dtd->ref_type && btf_used_types->contains (dtd->ref_type)) + || (dtd->dtd_u.dtu_tag.ref_var))) + btf_add_used_type (ctfc, dtd); + + /* Tags on functions or function args will have a ref_type pointing to the + FUNC_PROTO, we want them to point the FUNC record instead. */ + ctf_dtdef_ref *pdtd = NULL; + if (dtd->ref_type + && btf_used_types->contains (dtd->ref_type) + && (pdtd = func_map->get (dtd->ref_type)) != NULL) + dtd->ref_type = *pdtd; + } + /* Process fixups. If the base type was never added, create a forward for it and adjust the reference to point to that. If it was added, then nothing needs to change. */ @@ -1634,6 +1750,13 @@ btf_finish (void) btf_assign_var_ids (tu_ctfc); btf_assign_func_ids (tu_ctfc); + + /* Both decl and type tags may be pruned if the types/decls to which they + refer are pruned. This is handled in btf_collect_pruned_types, and + through that process they have also been assigned ids already. */ + if (!debug_prune_btf) + btf_assign_tag_ids (tu_ctfc); + btf_assign_datasec_ids (tu_ctfc); /* Finally, write out the complete .BTF section. */ diff --git a/gcc/builtin-attrs.def b/gcc/builtin-attrs.def index 2b82fc2326e0..dedb841364d3 100644 --- a/gcc/builtin-attrs.def +++ b/gcc/builtin-attrs.def @@ -130,6 +130,7 @@ DEF_ATTR_IDENT (ATTR_TM_TMPURE, "transaction_pure") DEF_ATTR_IDENT (ATTR_RETURNS_TWICE, "returns_twice") DEF_ATTR_IDENT (ATTR_RETURNS_NONNULL, "returns_nonnull") DEF_ATTR_IDENT (ATTR_WARN_UNUSED_RESULT, "warn_unused_result") +DEF_ATTR_IDENT (ATTR_CALLBACK, " callback") DEF_ATTR_TREE_LIST (ATTR_NOVOPS_LIST, ATTR_NOVOPS, ATTR_NULL, ATTR_NULL) @@ -430,6 +431,16 @@ DEF_FORMAT_ATTRIBUTE_NOTHROW(STRFMON,3,3_4) #undef DEF_FORMAT_ATTRIBUTE_NOTHROW #undef DEF_FORMAT_ATTRIBUTE_BOTH +/* Construct callback attributes for GOMP builtins. */ +#define DEF_CALLBACK_ATTRIBUTE(TYPE, CA, VALUES) \ + DEF_ATTR_TREE_LIST (ATTR_CALLBACK_##TYPE##_##CA##_##VALUES, ATTR_CALLBACK,\ + ATTR_##CA, ATTR_LIST_##VALUES) + +DEF_CALLBACK_ATTRIBUTE(GOMP, 1, 2) +DEF_ATTR_TREE_LIST(ATTR_CALLBACK_GOMP_LIST, ATTR_CALLBACK, + ATTR_CALLBACK_GOMP_1_2, ATTR_NOTHROW_LIST) +#undef DEF_CALLBACK_ATTRIBUTE + /* Transactional memory variants of the above. */ DEF_ATTR_TREE_LIST (ATTR_TM_NOTHROW_LIST, diff --git a/gcc/builtins.cc b/gcc/builtins.cc index de3e389c5d4b..fb294ce58cd4 100644 --- a/gcc/builtins.cc +++ b/gcc/builtins.cc @@ -156,7 +156,6 @@ static rtx expand_builtin_stack_address (); static tree stabilize_va_list_loc (location_t, tree, int); static rtx expand_builtin_expect (tree, rtx); static rtx expand_builtin_expect_with_probability (tree, rtx); -static tree fold_builtin_constant_p (tree); static tree fold_builtin_classify_type (tree); static tree fold_builtin_strlen (location_t, tree, tree, tree); static tree fold_builtin_inf (location_t, tree, int); @@ -8428,6 +8427,10 @@ expand_builtin (tree exp, rtx target, rtx subtarget, machine_mode mode, expand_builtin_unreachable (); return const0_rtx; + case BUILT_IN_OBSERVABLE_CHKPT: + /* Generate no code. */ + return const0_rtx; + CASE_FLT_FN (BUILT_IN_SIGNBIT): case BUILT_IN_SIGNBITD32: case BUILT_IN_SIGNBITD64: @@ -9150,7 +9153,7 @@ builtin_mathfn_code (const_tree t) /* Fold a call to __builtin_constant_p, if we know its argument ARG will evaluate to a constant. */ -static tree +tree fold_builtin_constant_p (tree arg) { /* We return 1 for a numeric type that's known to be a constant diff --git a/gcc/builtins.def b/gcc/builtins.def index 3dc2333c6f29..7cd5353bcb16 100644 --- a/gcc/builtins.def +++ b/gcc/builtins.def @@ -1142,6 +1142,7 @@ DEF_C2Y_BUILTIN (BUILT_IN_ULABS, "ulabs", BT_FN_ULONG_LONG, ATTR_CONST_NO DEF_C2Y_BUILTIN (BUILT_IN_ULLABS, "ullabs", BT_FN_ULONGLONG_LONGLONG, ATTR_CONST_NOTHROW_LEAF_LIST) DEF_GCC_BUILTIN (BUILT_IN_UNREACHABLE_TRAP, "unreachable trap", BT_FN_VOID, ATTR_CONST_NORETURN_NOTHROW_LEAF_COLD_LIST) DEF_GCC_BUILTIN (BUILT_IN_UNREACHABLE, "unreachable", BT_FN_VOID, ATTR_CONST_NORETURN_NOTHROW_LEAF_COLD_LIST) +DEF_GCC_BUILTIN (BUILT_IN_OBSERVABLE_CHKPT, "observable_checkpoint", BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST) DEF_GCC_BUILTIN (BUILT_IN_UNWIND_INIT, "unwind_init", BT_FN_VOID, ATTR_NULL) DEF_GCC_BUILTIN (BUILT_IN_UPDATE_SETJMP_BUF, "update_setjmp_buf", BT_FN_VOID_PTR, ATTR_NULL) DEF_GCC_BUILTIN (BUILT_IN_VA_COPY, "va_copy", BT_FN_VOID_VALIST_REF_VALIST_ARG, ATTR_NOTHROW_LEAF_LIST) diff --git a/gcc/builtins.h b/gcc/builtins.h index 5a553a9c8365..4f23afad9eed 100644 --- a/gcc/builtins.h +++ b/gcc/builtins.h @@ -139,6 +139,7 @@ extern rtx expand_builtin_crc_table_based (internal_fn, scalar_mode, extern rtx expand_builtin (tree, rtx, rtx, machine_mode, int); extern enum built_in_function builtin_mathfn_code (const_tree); extern tree fold_builtin_expect (location_t, tree, tree, tree, tree); +extern tree fold_builtin_constant_p (tree); extern bool avoid_folding_inline_builtin (tree); extern tree fold_call_expr (location_t, tree, bool); extern tree fold_builtin_call_array (location_t, tree, tree, int, tree *); diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 582a282c2ee3..1c8a2b8e25e4 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,129 @@ +2025-10-22 Jakub Jelinek + + PR c++/122302 + * c-common.cc (braced_list_to_string): Call copy_node on RAW_DATA_CST + before changing RAW_DATA_POINTER and RAW_DATA_LENGTH on it. + +2025-10-21 Tobias Burnus + + * c-omp.cc (c_omp_directives): Uncomment 'declare mapper', + add comment to 'begin metadirective', add 6.x unimplemented + directives as comment-out entries. + +2025-10-17 Josef Melcr + + * c-attribs.cc: Define callback attr. + +2025-10-14 Jakub Jelinek + + * c.opt (Wflex-array-member-not-at-end, Wignored-qualifiers, + Wopenacc-parallelism, Wstrict-flex-arrays, Wsync-nand, + fstrict-flex-arrays, fstrict-flex-arrays=): Enable also for ObjC and + ObjC++ next to C and C++. + (Wmisleading-indentation, Wopenmp-simd): Likewise. Also change + LangEnabledBy from just C C++ to C ObjC C++ ObjC++. + (Wplacement-new, Wplacement-new=, fcontract-assumption-mode=, + fcontract-build-level=, fcontract-strict-declarations=, + fcontract-mode=, fcontract-continuation-mode=, fcontract-role=, + fcontract-semantic=, fcoroutines, flang-info-include-translate, + flang-info-include-translate-not, flang-info-include-translate=, + flang-info-module-cmi, flang-info-module-cmi=): Enable also + for ObjC++ next to C++. + +2025-10-13 Iain Sandoe + + * c.opt: Enable Wignored-attributes for Objective-C and + Objective-C++. + +2025-10-09 David Faust + + * c-attribs.cc (c_common_attribute_table): Add btf_decl_tag and + btf_type_tag attributes. + (handle_btf_decl_tag_attribute): New handler for btf_decl_tag. + (hanlde_btf_type_tag_attribute): New handler for btf_type_tag. + (btf_tag_args_ok): Helper for new attribute handlers. + +2025-10-09 Jakub Jelinek + + * c-common.h (D_CXX26): Define. + * c-common.cc (c_common_resword): Add D_CXX26 to + __builtin_c23_va_start flags, mention D_CXX26 in comment. + +2025-10-09 Jakub Jelinek + + PR c/122188 + * c-gimplify.cc (c_gimplify_expr): Also gimplify the second operand + before the COND_EXPR and use in COND_EXPR result of gimplification. + +2025-10-09 David Malcolm + + * c-opts.cc: Define INCLUDE_VECTOR. + +2025-10-08 Jakub Jelinek + + PR c/122188 + * c-gimplify.cc (c_gimplify_expr): Gimplify CALL_EXPR_ARG (*expr_p, 0) + instead of calling save_expr on it. + +2025-10-04 Jakub Jelinek + + PR c++/114457 + * c-opts.cc (c_common_post_options): For C++26 set + flag_auto_var_init to AUTO_INIT_CXX26 if not specified explicitly. + For C++ disable warn_trivial_auto_var_init. + +2025-10-04 Nathaniel Shead + + PR c++/117658 + * c.opt: New flag '-Wexternal-tu-local'. + * c.opt.urls: Regenerate. + +2025-10-02 Alfie Richards + + * c-attribs.cc (attr_target_clones_exclusions): Add simd and omp + exclusions. + (attr_target_version_exclusions): New definition with simd and omp + exclusions. + (attr_omp_declare_simd_exclusions): New definition with target_version + and clones exclusions. + (attr_simd_exclusions): Ditto. + (c_common_gnu_attributes): Add new target_version, simd, and omp + declare simd variables. + +2025-10-01 Alejandro Colomar + + * c.opt.urls: Regenerate + +2025-09-26 Alejandro Colomar + + * c.opt: Add -Wmultiple-parameter-fwd-decl-lists + +2025-09-23 Alfie Richards + + * c-attribs.cc: Add support for target_version and target_clone mixing. + +2025-09-23 Alfie Richards + + * c-pretty-print.cc (pp_c_function_target_version): New function. + (pp_c_function_target_clones): New function. + (pp_c_maybe_whitespace): Move to c-pretty-print.h. + * c-pretty-print.h (pp_c_function_target_version): New function. + (pp_c_function_target_clones): New function. + (pp_c_maybe_whitespace): Moved here from c-pretty-print.cc. + +2025-09-23 Alfie Richards + + * c-attribs.cc (handle_target_clones_attribute): Update to use new hook. + +2025-09-08 Eric Botcazou + + PR ada/121544 + * c-ada-spec.cc (dump_ada_node) : Dump the name of + anonymous tagged pointed-to types specially. + (dump_nested_type) : Recurse on anonymous pointed-to + types declared in the same file. + Set TREE_VISITED on the underlying DECL of the field type, if any. + 2025-08-27 Jakub Jelinek PR target/121520 diff --git a/gcc/c-family/c-ada-spec.cc b/gcc/c-family/c-ada-spec.cc index c7ae032230a8..42d75b49c94e 100644 --- a/gcc/c-family/c-ada-spec.cc +++ b/gcc/c-family/c-ada-spec.cc @@ -2442,8 +2442,14 @@ dump_ada_node (pretty_printer *pp, tree node, tree type, int spc, break; } - dump_ada_node (pp, ref_type, ref_type, spc, is_access, - true); + /* Dump anonymous tagged types specially. */ + if (TYPE_NAME (ref_type) + || (!RECORD_OR_UNION_TYPE_P (ref_type) + && TREE_CODE (ref_type) != ENUMERAL_TYPE)) + dump_ada_node (pp, ref_type, ref_type, spc, is_access, + true); + else + dump_anonymous_type_name (pp, ref_type); } } } @@ -2699,7 +2705,16 @@ dump_nested_type (pretty_printer *pp, tree field, tree t, int spc) { case POINTER_TYPE: tmp = TREE_TYPE (field_type); - dump_forward_type (pp, tmp, t, spc); + decl = get_underlying_decl (tmp); + if (TYPE_NAME (tmp) || !decl || DECL_NAME (decl)) + dump_forward_type (pp, tmp, t, spc); + else if (DECL_SOURCE_FILE (decl) == DECL_SOURCE_FILE (t) + && !TREE_VISITED (decl)) + { + /* Generate full declaration. */ + dump_nested_type (pp, decl, t, spc); + TREE_VISITED (decl) = 1; + } break; case ARRAY_TYPE: @@ -2773,6 +2788,11 @@ dump_nested_type (pretty_printer *pp, tree field, tree t, int spc) default: break; } + + /* Make sure not to output the nested type twice in C++. */ + decl = get_underlying_decl (field_type); + if (decl) + TREE_VISITED (decl) = 1; } /* Hash table of overloaded names that we cannot support. It is needed even diff --git a/gcc/c-family/c-attribs.cc b/gcc/c-family/c-attribs.cc index 1e3a94ed9493..8ca767abbeba 100644 --- a/gcc/c-family/c-attribs.cc +++ b/gcc/c-family/c-attribs.cc @@ -49,6 +49,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-pretty-print.h" #include "gcc-rich-location.h" #include "gcc-urlifier.h" +#include "attr-callback.h" static tree handle_packed_attribute (tree *, tree, tree, int, bool *); static tree handle_nocommon_attribute (tree *, tree, tree, int, bool *); @@ -189,6 +190,9 @@ static tree handle_fd_arg_attribute (tree *, tree, tree, int, bool *); static tree handle_flag_enum_attribute (tree *, tree, tree, int, bool *); static tree handle_null_terminated_string_arg_attribute (tree *, tree, tree, int, bool *); +static tree handle_btf_decl_tag_attribute (tree *, tree, tree, int, bool *); +static tree handle_btf_type_tag_attribute (tree *, tree, tree, int, bool *); + /* Helper to define attribute exclusions. */ #define ATTR_EXCL(name, function, type, variable) \ { name, function, type, variable } @@ -249,12 +253,28 @@ static const struct attribute_spec::exclusions attr_target_clones_exclusions[] = ATTR_EXCL ("always_inline", true, true, true), ATTR_EXCL ("target", TARGET_HAS_FMV_TARGET_ATTRIBUTE, TARGET_HAS_FMV_TARGET_ATTRIBUTE, TARGET_HAS_FMV_TARGET_ATTRIBUTE), - ATTR_EXCL ("target_version", true, true, true), + ATTR_EXCL ("omp declare simd", true, true, true), + ATTR_EXCL ("simd", true, true, true), ATTR_EXCL (NULL, false, false, false), }; static const struct attribute_spec::exclusions attr_target_version_exclusions[] = { + ATTR_EXCL ("omp declare simd", true, true, true), + ATTR_EXCL ("simd", true, true, true), + ATTR_EXCL (NULL, false, false, false), +}; + +static const struct attribute_spec::exclusions attr_omp_declare_simd_exclusions[] = +{ + ATTR_EXCL ("target_version", true, true, true), + ATTR_EXCL ("target_clones", true, true, true), + ATTR_EXCL (NULL, false, false, false), +}; + +static const struct attribute_spec::exclusions attr_simd_exclusions[] = +{ + ATTR_EXCL ("target_version", true, true, true), ATTR_EXCL ("target_clones", true, true, true), ATTR_EXCL (NULL, false, false, false), }; @@ -465,6 +485,8 @@ const struct attribute_spec c_common_gnu_attributes[] = handle_tm_attribute, NULL }, { "transaction_may_cancel_outer", 0, 0, false, true, false, false, handle_tm_attribute, NULL }, + { CALLBACK_ATTR_IDENT, 1, -1, true, false, false, false, + handle_callback_attribute, NULL }, /* ??? These two attributes didn't make the transition from the Intel language document to the multi-vendor language document. */ { "transaction_pure", 0, 0, false, true, false, false, @@ -543,7 +565,7 @@ const struct attribute_spec c_common_gnu_attributes[] = attr_target_exclusions }, { "target_version", 1, 1, true, false, false, false, handle_target_version_attribute, - attr_target_version_exclusions }, + attr_target_version_exclusions}, { "target_clones", 1, -1, true, false, false, false, handle_target_clones_attribute, attr_target_clones_exclusions }, @@ -570,7 +592,8 @@ const struct attribute_spec c_common_gnu_attributes[] = { "returns_nonnull", 0, 0, false, true, true, false, handle_returns_nonnull_attribute, NULL }, { "omp declare simd", 0, -1, true, false, false, false, - handle_omp_declare_simd_attribute, NULL }, + handle_omp_declare_simd_attribute, + attr_omp_declare_simd_exclusions }, { "omp declare variant base", 0, -1, true, false, false, false, handle_omp_declare_variant_attribute, NULL }, { "omp declare variant variant", 0, -1, true, false, false, false, @@ -579,7 +602,7 @@ const struct attribute_spec c_common_gnu_attributes[] = false, false, handle_omp_declare_variant_attribute, NULL }, { "simd", 0, 1, true, false, false, false, - handle_simd_attribute, NULL }, + handle_simd_attribute, attr_simd_exclusions }, { "omp declare target", 0, -1, true, false, false, false, handle_omp_declare_target_attribute, NULL }, { "omp declare target link", 0, 0, true, false, false, false, @@ -640,7 +663,11 @@ const struct attribute_spec c_common_gnu_attributes[] = { "flag_enum", 0, 0, false, true, false, false, handle_flag_enum_attribute, NULL }, { "null_terminated_string_arg", 1, 1, false, true, true, false, - handle_null_terminated_string_arg_attribute, NULL} + handle_null_terminated_string_arg_attribute, NULL}, + { "btf_type_tag", 1, 1, false, true, false, false, + handle_btf_type_tag_attribute, NULL}, + { "btf_decl_tag", 1, 1, true, false, false, false, + handle_btf_decl_tag_attribute, NULL} }; const struct scoped_attribute_specs c_common_gnu_attribute_table = @@ -5155,6 +5182,107 @@ handle_null_terminated_string_arg_attribute (tree *node, tree name, tree args, return NULL_TREE; } +/* Common argument checking for btf_type_tag and btf_decl_tag. + Return true if the ARGS are valid, otherwise emit an error and + return false. */ + +static bool +btf_tag_args_ok (tree name, tree args) +{ + if (!args) /* Correct number of args (1) is checked for us. */ + return false; + else if (TREE_CODE (TREE_VALUE (args)) != STRING_CST) + { + error ("%qE attribute requires a string argument", name); + return false; + } + + /* Only narrow character strings are accepted. */ + tree argtype = TREE_TYPE (TREE_TYPE (TREE_VALUE (args))); + if (!(argtype == char_type_node + || argtype == char8_type_node + || argtype == signed_char_type_node + || argtype == unsigned_char_type_node)) + { + error ("unsupported wide string type argument in %qE attribute", name); + return false; + } + + return true; +} + +/* Handle the "btf_decl_tag" attribute. */ + +static tree +handle_btf_decl_tag_attribute (tree * ARG_UNUSED (node), tree name, tree args, + int ARG_UNUSED (flags), bool *no_add_attrs) +{ + if (!btf_tag_args_ok (name, args)) + *no_add_attrs = true; + + return NULL_TREE; +} + +/* Handle the "btf_type_tag" attribute. */ + +static tree +handle_btf_type_tag_attribute (tree *node, tree name, tree args, + int flags, bool *no_add_attrs) +{ + if (!btf_tag_args_ok (name, args)) + { + *no_add_attrs = true; + return NULL_TREE; + } + + if (TREE_CODE (*node) == FUNCTION_TYPE || TREE_CODE (*node) == METHOD_TYPE) + { + warning (OPT_Wattributes, + "%qE attribute does not apply to functions", name); + *no_add_attrs = true; + return NULL_TREE; + } + + /* Ensure a variant type is always created to hold the type_tag, + unless ATTR_FLAG_IN_PLACE is set. Same logic as in + common_handle_aligned_attribute. */ + tree decl = NULL_TREE; + tree *type = NULL; + bool is_type = false; + + if (DECL_P (*node)) + { + decl = *node; + type = &TREE_TYPE (decl); + is_type = TREE_CODE (*node) == TYPE_DECL; + } + else if (TYPE_P (*node)) + type = node, is_type = true; + + if (is_type) + { + if ((flags & (int) ATTR_FLAG_TYPE_IN_PLACE)) + /* OK, modify the type in place. */; + + /* If we have a TYPE_DECL, then copy the type, so that we + don't accidentally modify a builtin type. See pushdecl. */ + else if (decl && TREE_TYPE (decl) != error_mark_node + && DECL_ORIGINAL_TYPE (decl) == NULL_TREE) + { + tree tt = TREE_TYPE (decl); + *type = build_variant_type_copy (*type); + DECL_ORIGINAL_TYPE (decl) = tt; + TYPE_NAME (*type) = decl; + TREE_USED (*type) = TREE_USED (decl); + TREE_TYPE (decl) = *type; + } + else + *type = build_variant_type_copy (*type); + } + + return NULL_TREE; +} + /* Handle the "nonstring" variable attribute. */ static tree @@ -6282,12 +6410,25 @@ handle_target_clones_attribute (tree *node, tree name, tree ARG_UNUSED (args), } } - auto_vec versions = get_clone_attr_versions (args, NULL); - - if (versions.length () == 1) + int num_defaults = 0; + auto_vec versions = get_clone_attr_versions + (args, + &num_defaults, + false); + + for (auto v : versions) + targetm.check_target_clone_version + (v, &DECL_SOURCE_LOCATION (*node)); + + /* Lone target_clones version is always ignored for target attr semantics. + Only ignore under target_version semantics if it is a default + version. */ + if (versions.length () == 1 + && (TARGET_HAS_FMV_TARGET_ATTRIBUTE || num_defaults == 1)) { - warning (OPT_Wattributes, - "single % attribute is ignored"); + if (TARGET_HAS_FMV_TARGET_ATTRIBUTE) + warning (OPT_Wattributes, + "single % attribute is ignored"); *no_add_attrs = true; } else diff --git a/gcc/c-family/c-common.cc b/gcc/c-family/c-common.cc index e7dd4602ac11..f2eed0337065 100644 --- a/gcc/c-family/c-common.cc +++ b/gcc/c-family/c-common.cc @@ -376,9 +376,10 @@ static bool nonnull_check_p (tree, unsigned HOST_WIDE_INT); C --std=c17: D_C23 | D_CXXONLY | D_OBJC C --std=c23: D_CXXONLY | D_OBJC ObjC is like C except that D_OBJC and D_CXX_OBJC are not set - C++ --std=c++98: D_CONLY | D_CXX11 | D_CXX20 | D_OBJC - C++ --std=c++11: D_CONLY | D_CXX20 | D_OBJC - C++ --std=c++20: D_CONLY | D_OBJC + C++ --std=c++98: D_CONLY | D_CXX11 | D_CXX20 | D_CXX26 | D_OBJC + C++ --std=c++11: D_CONLY | D_CXX20 | D_CXX26 | D_OBJC + C++ --std=c++20: D_CONLY | D_CXX26 | D_OBJC + C++ --std=c++26: D_CONLY | D_OBJC ObjC++ is like C++ except that D_OBJC is not set If -fno-asm is used, D_ASM is added to the mask. If @@ -462,7 +463,7 @@ const struct c_common_resword c_common_reswords[] = { "__builtin_tgmath", RID_BUILTIN_TGMATH, D_CONLY }, { "__builtin_offsetof", RID_OFFSETOF, 0 }, { "__builtin_types_compatible_p", RID_TYPES_COMPATIBLE_P, D_CONLY }, - { "__builtin_c23_va_start", RID_C23_VA_START, D_C23 }, + { "__builtin_c23_va_start", RID_C23_VA_START, D_C23 | D_CXX26 }, { "__builtin_va_arg", RID_VA_ARG, 0 }, { "__complex", RID_COMPLEX, 0 }, { "__complex__", RID_COMPLEX, 0 }, @@ -10295,6 +10296,7 @@ braced_list_to_string (tree type, tree ctor, bool member) j = i - start; else j -= start; + value = copy_node (value); RAW_DATA_POINTER (value) -= start; RAW_DATA_LENGTH (value) += start + end; i += end; diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h index b6021d241731..bedbd4a94b0e 100644 --- a/gcc/c-family/c-common.h +++ b/gcc/c-family/c-common.h @@ -448,6 +448,7 @@ extern machine_mode c_default_pointer_mode; #define D_CXX20 0x8000 /* In C++, C++20 only. */ #define D_CXX_COROUTINES 0x10000 /* In C++, only with coroutines. */ #define D_CXX_MODULES 0x20000 /* In C++, only with modules. */ +#define D_CXX26 0x40000 /* In C++, C++26 only. */ #define D_CXX_CONCEPTS_FLAGS D_CXXONLY | D_CXX_CONCEPTS #define D_CXX_CHAR8_T_FLAGS D_CXXONLY | D_CXX_CHAR8_T diff --git a/gcc/c-family/c-gimplify.cc b/gcc/c-family/c-gimplify.cc index 131eca8297f8..2249c101cf56 100644 --- a/gcc/c-family/c-gimplify.cc +++ b/gcc/c-family/c-gimplify.cc @@ -1036,7 +1036,14 @@ c_gimplify_expr (tree *expr_p, gimple_seq *pre_p ATTRIBUTE_UNUSED, && call_expr_nargs (*expr_p) == 2 && TREE_CODE (CALL_EXPR_ARG (*expr_p, 1)) != INTEGER_CST) { - tree a = save_expr (CALL_EXPR_ARG (*expr_p, 0)); + tree a = CALL_EXPR_ARG (*expr_p, 0); + if (gimplify_expr (&a, pre_p, post_p, is_gimple_val, fb_rvalue) + == GS_ERROR) + return GS_ERROR; + tree b = CALL_EXPR_ARG (*expr_p, 1); + if (gimplify_expr (&b, pre_p, post_p, is_gimple_val, fb_rvalue) + == GS_ERROR) + return GS_ERROR; tree c = build_call_expr_loc (EXPR_LOCATION (*expr_p), fndecl, 1, a); *expr_p = build3_loc (EXPR_LOCATION (*expr_p), COND_EXPR, @@ -1044,7 +1051,7 @@ c_gimplify_expr (tree *expr_p, gimple_seq *pre_p ATTRIBUTE_UNUSED, build2_loc (EXPR_LOCATION (*expr_p), NE_EXPR, boolean_type_node, a, build_zero_cst (TREE_TYPE (a))), - c, CALL_EXPR_ARG (*expr_p, 1)); + c, b); return GS_OK; } break; diff --git a/gcc/c-family/c-omp.cc b/gcc/c-family/c-omp.cc index fe272888c51e..3c2ee9ff1ae6 100644 --- a/gcc/c-family/c-omp.cc +++ b/gcc/c-family/c-omp.cc @@ -4604,6 +4604,9 @@ const struct c_omp_directive c_omp_directives[] = { C_OMP_DIR_DECLARATIVE, false }, /* { "begin", "declare", "variant", PRAGMA_OMP_BEGIN, C_OMP_DIR_DECLARATIVE, false }, */ + /* 'begin metadirective' is not yet implemented; however, + it is only applicable if an end-directive exists, but + metadirectives are of limited use for declarative directives. */ /* { "begin", "metadirective", nullptr, PRAGMA_OMP_BEGIN, C_OMP_DIR_META, false }, */ { "cancel", nullptr, nullptr, PRAGMA_OMP_CANCEL, @@ -4612,8 +4615,10 @@ const struct c_omp_directive c_omp_directives[] = { C_OMP_DIR_STANDALONE, false }, { "critical", nullptr, nullptr, PRAGMA_OMP_CRITICAL, C_OMP_DIR_CONSTRUCT, false }, - /* { "declare", "mapper", nullptr, PRAGMA_OMP_DECLARE, - C_OMP_DIR_DECLARATIVE, false }, */ + /* { "declare", "induction", nullptr, PRAGMA_OMP_DECLARE, + C_OMP_DIR_DECLARATIVE, true }, */ + { "declare", "mapper", nullptr, PRAGMA_OMP_DECLARE, + C_OMP_DIR_DECLARATIVE, false }, { "declare", "reduction", nullptr, PRAGMA_OMP_DECLARE, C_OMP_DIR_DECLARATIVE, true }, { "declare", "simd", nullptr, PRAGMA_OMP_DECLARE, @@ -4639,12 +4644,18 @@ const struct c_omp_directive c_omp_directives[] = { /* error with at(execution) is C_OMP_DIR_STANDALONE. */ { "error", nullptr, nullptr, PRAGMA_OMP_ERROR, C_OMP_DIR_UTILITY, false }, + /* { "flatten", nullptr, nullptr, PRAGMA_OMP_FLATTEN, + C_OMP_DIR_CONSTRUCT, true }, */ { "flush", nullptr, nullptr, PRAGMA_OMP_FLUSH, C_OMP_DIR_STANDALONE, false }, { "for", nullptr, nullptr, PRAGMA_OMP_FOR, C_OMP_DIR_CONSTRUCT, true }, + /* { "fuse", nullptr, nullptr, PRAGMA_OMP_FUSE, + C_OMP_DIR_CONSTRUCT, true }, */ /* { "groupprivate", nullptr, nullptr, PRAGMA_OMP_GROUPPRIVATE, C_OMP_DIR_DECLARATIVE, false }, */ + /* { "interchange", nullptr, nullptr, PRAGMA_OMP_INTERCHANGE, + C_OMP_DIR_CONSTRUCT, true }, */ { "interop", nullptr, nullptr, PRAGMA_OMP_INTEROP, C_OMP_DIR_STANDALONE, false }, { "loop", nullptr, nullptr, PRAGMA_OMP_LOOP, @@ -4676,6 +4687,10 @@ const struct c_omp_directive c_omp_directives[] = { C_OMP_DIR_CONSTRUCT, true }, { "single", nullptr, nullptr, PRAGMA_OMP_SINGLE, C_OMP_DIR_CONSTRUCT, false }, + /* { "split", nullptr, nullptr, PRAGMA_OMP_SPLIT, + C_OMP_DIR_CONSTRUCT, true }, */ + /* { "stripe", nullptr, nullptr, PRAGMA_OMP_STRIPE, + C_OMP_DIR_CONSTRUCT, true }, */ { "target", "data", nullptr, PRAGMA_OMP_TARGET, C_OMP_DIR_CONSTRUCT, false }, { "target", "enter", "data", PRAGMA_OMP_TARGET, @@ -4688,6 +4703,10 @@ const struct c_omp_directive c_omp_directives[] = { C_OMP_DIR_CONSTRUCT, true }, { "task", nullptr, nullptr, PRAGMA_OMP_TASK, C_OMP_DIR_CONSTRUCT, false }, + /* { "task", "iteration", nullptr, PRAGMA_OMP_TASK_ITERATION, + C_OMP_DIR_STANDALONE, false }, */ + /* { "taskgraph", nullptr, nullptr, PRAGMA_OMP_TASKGRAPH, + C_OMP_DIR_CONSTRUCT, false }, */ { "taskgroup", nullptr, nullptr, PRAGMA_OMP_TASKGROUP, C_OMP_DIR_CONSTRUCT, false }, { "taskloop", nullptr, nullptr, PRAGMA_OMP_TASKLOOP, diff --git a/gcc/c-family/c-opts.cc b/gcc/c-family/c-opts.cc index 0ec30e852158..b7dc8ceae820 100644 --- a/gcc/c-family/c-opts.cc +++ b/gcc/c-family/c-opts.cc @@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see . */ +#define INCLUDE_VECTOR #include "config.h" #include "system.h" #include "coretypes.h" @@ -229,7 +230,6 @@ c_common_init_options_struct (struct gcc_options *opts) /* By default, C99-like requirements for complex multiply and divide. */ opts->x_flag_complex_method = 2; - opts->x_flag_default_complex_method = opts->x_flag_complex_method; } /* Common initialization before calling option handlers. */ @@ -913,6 +913,16 @@ c_common_post_options (const char **pfilename) else flag_permitted_flt_eval_methods = PERMITTED_FLT_EVAL_METHODS_C11; + if (cxx_dialect >= cxx26) + SET_OPTION_IF_UNSET (&global_options, &global_options_set, + flag_auto_var_init, AUTO_INIT_CXX26); + + /* The -Wtrivial-auto-var-init warning is useless for C++, where we always + add .DEFERRED_INIT calls when some (vacuous) initializers are bypassed + through jumps from switch condition to case/default label. */ + if (c_dialect_cxx ()) + warn_trivial_auto_var_init = 0; + /* C23 Annex F does not permit certain built-in functions to raise "inexact". */ if (flag_isoc23) diff --git a/gcc/c-family/c-pretty-print.cc b/gcc/c-family/c-pretty-print.cc index fad6b5eb9b04..5adb13b9784d 100644 --- a/gcc/c-family/c-pretty-print.cc +++ b/gcc/c-family/c-pretty-print.cc @@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see #include "function.h" #include "basic-block.h" #include "gimple.h" +#include "tm.h" /* The pretty-printer code is primarily designed to closely follow (GNU) C and C++ grammars. That is to be contrasted with spaghetti @@ -45,12 +46,6 @@ along with GCC; see the file COPYING3. If not see takes expression or declaration contexts into account. */ -#define pp_c_maybe_whitespace(PP) \ - do { \ - if ((PP)->get_padding () == pp_before) \ - pp_c_whitespace (PP); \ - } while (0) - /* literal */ static void pp_c_char (c_pretty_printer *, int); @@ -3054,6 +3049,76 @@ pp_c_tree_decl_identifier (c_pretty_printer *pp, tree t) pp_c_identifier (pp, name); } +/* Prints "[version: VERSION]" for a versioned function decl. + This will only print for targets with target_version semantics. */ +void +pp_c_function_target_version (c_pretty_printer *pp, tree t) +{ + if (TARGET_HAS_FMV_TARGET_ATTRIBUTE) + return; + + string_slice version = get_target_version (t); + if (!version.is_valid ()) + return; + + pp_c_whitespace (pp); + + pp_c_left_bracket (pp); + pp_c_left_bracket (pp); + pp_string (pp, "target_version"); + pp_c_left_paren (pp); + pp_doublequote (pp); + pp_string_n (pp, version.begin (), version.size ()); + pp_doublequote (pp); + pp_c_right_paren (pp); + pp_c_right_bracket (pp); + pp_c_right_bracket (pp); + + pp->set_padding (pp_before); +} + +/* Prints "[clones: VERSION, +]" for a versioned function decl. + This only works for targets with target_version semantics. */ +void +pp_c_function_target_clones (c_pretty_printer *pp, tree t) +{ + /* Only print for target_version semantics. + This is because for target FMV semantics a target_clone always defines + the entire FMV set. target_version semantics can mix target_clone and + target_version decls in the definition of a FMV set and so the + target_clone becomes a part of the identity of the declaration. */ + if (TARGET_HAS_FMV_TARGET_ATTRIBUTE) + return; + + auto_vec versions = get_clone_versions (t, NULL, false); + if (versions.is_empty ()) + return; + + pp_c_whitespace (pp); + + string_slice final_version = versions.pop (); + pp_c_left_bracket (pp); + pp_c_left_bracket (pp); + pp_string (pp, "target_clones"); + pp_c_left_paren (pp); + for (string_slice version : versions) + { + pp_doublequote (pp); + pp_string_n (pp, version.begin (), version.size ()); + pp_doublequote (pp); + pp_string (pp, ","); + pp_c_whitespace (pp); + } + pp_doublequote (pp); + pp_string_n (pp, final_version.begin (), final_version.size ()); + pp_doublequote (pp); + pp_c_right_paren (pp); + pp_c_right_bracket (pp); + pp_c_right_bracket (pp); + + pp->set_padding (pp_before); +} + #if CHECKING_P namespace selftest { diff --git a/gcc/c-family/c-pretty-print.h b/gcc/c-family/c-pretty-print.h index c8fb67899915..5e00b952c814 100644 --- a/gcc/c-family/c-pretty-print.h +++ b/gcc/c-family/c-pretty-print.h @@ -102,6 +102,12 @@ class c_pretty_printer : public pretty_printer #define pp_ptr_operator(PP, D) (PP)->ptr_operator (PP, D) #define pp_parameter_list(PP, T) (PP)->parameter_list (PP, T) +#define pp_c_maybe_whitespace(PP) \ + do { \ + if ((PP)->get_padding () == pp_before) \ + pp_c_whitespace (PP); \ + } while (0) + void pp_c_whitespace (c_pretty_printer *); void pp_c_left_paren (c_pretty_printer *); void pp_c_right_paren (c_pretty_printer *); @@ -138,6 +144,8 @@ void pp_c_ws_string (c_pretty_printer *, const char *); void pp_c_identifier (c_pretty_printer *, const char *); void pp_c_string_literal (c_pretty_printer *, tree); void pp_c_integer_constant (c_pretty_printer *, tree); +void pp_c_function_target_version (c_pretty_printer *, tree); +void pp_c_function_target_clones (c_pretty_printer *, tree); void print_c_tree (FILE *file, tree t, dump_flags_t); diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index 3f5e2f0874d9..b7ce67a5bbe5 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -761,6 +761,10 @@ Wexpansion-to-defined C ObjC C++ ObjC++ CPP(warn_expansion_to_defined) CppReason(CPP_W_EXPANSION_TO_DEFINED) Var(cpp_warn_expansion_to_defined) Init(0) Warning EnabledBy(Wextra || Wpedantic) Warn if \"defined\" is used outside #if. +Wexternal-tu-local +C++ ObjC++ Var(warn_tu_local) Warning Init(1) +Warn about naming a TU-local entity declared in another translation unit. + Wextra C ObjC C++ ObjC++ Warning ; in common.opt @@ -770,7 +774,7 @@ C++ ObjC++ Var(warn_extra_semi) Init(-1) Warning Warn about semicolon after in-class function definition. Wflex-array-member-not-at-end -C C++ Var(warn_flex_array_member_not_at_end) Warning +C ObjC C++ ObjC++ Var(warn_flex_array_member_not_at_end) Warning Warn when a structure containing a C99 flexible array member as the last field is not at the end of another structure. @@ -862,11 +866,11 @@ C ObjC C++ ObjC++ Var(warn_if_not_aligned) Init(1) Warning Warn when the field in a struct is not aligned. Wignored-qualifiers -C C++ Var(warn_ignored_qualifiers) Warning EnabledBy(Wextra) +C ObjC C++ ObjC++ Var(warn_ignored_qualifiers) Warning EnabledBy(Wextra) Warn whenever type qualifiers are ignored. Wignored-attributes -C C++ Var(warn_ignored_attributes) Init(1) Warning +C ObjC C++ ObjC++ Var(warn_ignored_attributes) Init(1) Warning Warn whenever attributes are ignored. Wimplicit @@ -1009,7 +1013,7 @@ C ObjC C++ ObjC++ Var(warn_memset_transposed_args) Warning LangEnabledBy(C ObjC Warn about suspicious calls to memset where the third argument is constant literal zero and the second is not. Wmisleading-indentation -C C++ Common Var(warn_misleading_indentation) Warning LangEnabledBy(C C++,Wall) +C ObjC C++ ObjC++ Common Var(warn_misleading_indentation) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall) Warn when the indentation of the code does not reflect the block structure. Wmismatched-dealloc @@ -1086,6 +1090,10 @@ Wmultiple-inheritance C++ ObjC++ Var(warn_multiple_inheritance) Warning Warn on direct multiple inheritance. +Wmultiple-parameter-fwd-decl-lists +C ObjC Var(warn_multiple_parameter_fwd_decl_lists) Warning EnabledBy(Wextra) +Warn for multiple lists of forward declarations of function parameters. + Wmultistatement-macros C ObjC C++ ObjC++ Var(warn_multistatement_macros) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall) Warn about unsafe macros expanding to multiple statements used as a body of a clause such as if, else, while, switch, or for. @@ -1179,7 +1187,7 @@ C ObjC Var(warn_old_style_definition) Init(-1) Warning Warn if an old-style parameter definition is used. Wopenacc-parallelism -C C++ Var(warn_openacc_parallelism) Warning +C ObjC C++ ObjC++ Var(warn_openacc_parallelism) Warning Warn about potentially suboptimal choices related to OpenACC parallelism. Wopenmp @@ -1187,7 +1195,7 @@ C ObjC C++ ObjC++ Warning Var(warn_openmp) Init(1) Warn about suspicious OpenMP code. Wopenmp-simd -C C++ Var(warn_openmp_simd) Warning LangEnabledBy(C C++,Wall) +C ObjC C++ ObjC++ Var(warn_openmp_simd) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall) Warn if a simd directive is overridden by the vectorizer cost model. Woverlength-strings @@ -1235,11 +1243,11 @@ C++ ObjC++ Var(warn_pessimizing_move) Warning LangEnabledBy(C++ ObjC++, Wall) Warn about calling std::move on a local object in a return statement preventing copy elision. Wplacement-new -C++ Warning Alias(Wplacement-new=, 1, 0) +C++ ObjC++ Warning Alias(Wplacement-new=, 1, 0) Warn for placement new expressions with undefined behavior. Wplacement-new= -C++ Joined RejectNegative UInteger Var(warn_placement_new) Init(-1) Warning IntegerRange(0, 2) +C++ ObjC++ Joined RejectNegative UInteger Var(warn_placement_new) Init(-1) Warning IntegerRange(0, 2) Warn for placement new expressions with undefined behavior. Wpmf-conversions @@ -1409,7 +1417,7 @@ C ObjC C++ ObjC++ LangEnabledBy(C ObjC C++ ObjC++,Wall, 3, 0) IntegerRange(0, 3) ; Wstrict-flex-arrays -C C++ Var(warn_strict_flex_arrays) Warning +C ObjC C++ ObjC++ Var(warn_strict_flex_arrays) Warning Warn about improper usages of flexible array members according to the level of -fstrict-flex-arrays. @@ -1487,7 +1495,7 @@ C ObjC C++ ObjC++ Var(warn_switch_outside_range) Warning Init(1) Warn about switch values that are outside of the switch's type range. Wsync-nand -C C++ Var(warn_sync_nand) Init(1) Warning +C ObjC C++ ObjC++ Var(warn_sync_nand) Init(1) Warning Warn when __sync_fetch_and_nand and __sync_nand_and_fetch built-in functions are used. Wsynth @@ -1892,35 +1900,35 @@ EnumValue Enum(on_off) String(on) Value(1) fcontract-assumption-mode= -C++ Joined RejectNegative +C++ ObjC++ Joined RejectNegative -fcontract-assumption-mode=[on|off] Enable or disable treating axiom level contracts as assumptions (default on). fcontract-build-level= -C++ Joined RejectNegative +C++ ObjC++ Joined RejectNegative -fcontract-build-level=[off|default|audit] Specify max contract level to generate runtime checks for. fcontract-strict-declarations= -C++ Var(flag_contract_strict_declarations) Enum(on_off) Joined Init(0) RejectNegative +C++ ObjC++ Var(flag_contract_strict_declarations) Enum(on_off) Joined Init(0) RejectNegative -fcontract-strict-declarations=[on|off] Enable or disable warnings on generalized redeclaration of functions with contracts (default off). fcontract-mode= -C++ Var(flag_contract_mode) Enum(on_off) Joined Init(1) RejectNegative +C++ ObjC++ Var(flag_contract_mode) Enum(on_off) Joined Init(1) RejectNegative -fcontract-mode=[on|off] Enable or disable all contract facilities (default on). fcontract-continuation-mode= -C++ Joined RejectNegative +C++ ObjC++ Joined RejectNegative -fcontract-continuation-mode=[on|off] Enable or disable contract continuation mode (default off). fcontract-role= -C++ Joined RejectNegative +C++ ObjC++ Joined RejectNegative -fcontract-role=: Specify the semantics for all levels in a role (default, review), or a custom contract role with given semantics (ex: opt:assume,assume,assume). fcontract-semantic= -C++ Joined RejectNegative +C++ ObjC++ Joined RejectNegative -fcontract-semantic=: Specify the concrete semantics for level. fcoroutines -C++ LTO Var(flag_coroutines) +C++ ObjC++ LTO Var(flag_coroutines) Enable C++ coroutines (experimental). fdebug-cpp @@ -2122,23 +2130,23 @@ C ObjC Var(warn_compare_distinct_pointer_types) Warning Init(1) Warn if pointers of distinct types are compared without a cast. flang-info-include-translate -C++ Var(note_include_translate_yes) +C++ ObjC++ Var(note_include_translate_yes) Note #include directives translated to import declarations. flang-info-include-translate-not -C++ Var(note_include_translate_no) +C++ ObjC++ Var(note_include_translate_no) Note #include directives not translated to import declarations, and not known to be textual. flang-info-include-translate= -C++ Joined RejectNegative MissingArgError(missing header name) +C++ ObjC++ Joined RejectNegative MissingArgError(missing header name) Note a #include translation of a specific header. flang-info-module-cmi -C++ Var(note_module_cmi_yes) +C++ ObjC++ Var(note_module_cmi_yes) Note Compiled Module Interface pathnames. flang-info-module-cmi= -C++ Joined RejectNegative MissingArgError(missing module name) +C++ ObjC++ Joined RejectNegative MissingArgError(missing module name) Note Compiled Module Interface pathname of a specific module or header-unit. fmax-include-depth= @@ -2349,10 +2357,10 @@ C++ ObjC++ Var(flag_sized_deallocation) Init(-1) Enable C++14 sized deallocation support. fstrict-flex-arrays -C C++ Common Alias(fstrict-flex-arrays=,3,0) +C ObjC C++ ObjC++ Common Alias(fstrict-flex-arrays=,3,0) fstrict-flex-arrays= -C C++ Common Joined RejectNegative UInteger Var(flag_strict_flex_arrays) Init(0) IntegerRange(0,3) +C ObjC C++ ObjC++ Common Joined RejectNegative UInteger Var(flag_strict_flex_arrays) Init(0) IntegerRange(0,3) -fstrict-flex-arrays= Control when to treat the trailing array of a structure as a flexible array member for the purposes of accessing the elements of such an array. The default is treating all trailing arrays of structures as flexible array members. fsquangle diff --git a/gcc/c-family/c.opt.urls b/gcc/c-family/c.opt.urls index e09d51d8afb9..399f9f8a659e 100644 --- a/gcc/c-family/c.opt.urls +++ b/gcc/c-family/c.opt.urls @@ -376,6 +376,9 @@ UrlSuffix(gcc/C_002b_002b-Dialect-Options.html#index-Wexceptions) Wexpansion-to-defined UrlSuffix(gcc/Warning-Options.html#index-Wexpansion-to-defined) +Wexternal-tu-local +UrlSuffix(gcc/C_002b_002b-Dialect-Options.html#index-Wexternal-tu-local) + Wextra UrlSuffix(gcc/Warning-Options.html#index-Wextra) LangUrlSuffix_D(gdc/Warnings.html#index-Wextra) LangUrlSuffix_Fortran(gfortran/Error-and-Warning-Options.html#index-Wextra) @@ -595,6 +598,9 @@ UrlSuffix(gcc/Warning-Options.html#index-Wmultichar) Wmultiple-inheritance UrlSuffix(gcc/C_002b_002b-Dialect-Options.html#index-Wmultiple-inheritance) +Wmultiple-parameter-fwd-decl-lists +UrlSuffix(gcc/Warning-Options.html#index-Wmultiple-parameter-fwd-decl-lists) + Wmultistatement-macros UrlSuffix(gcc/Warning-Options.html#index-Wmultistatement-macros) diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index d719cb8598ec..89a1bbe6d419 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,183 @@ +2025-10-24 Joseph Myers + + * c-parser.cc (c_parser_next_tokens_start_typename) + (c_parser_next_tokens_start_declaration): Add argument for token + to start from + (c_parser_next_tokens_start_declaration): Check for whether static + assertion followed by semicolon. + (c_parser_check_balanced_raw_token_sequence): Declare earlier. + (c_parser_compound_statement_nostart, c_parser_for_statement): Use + c_parser_next_tokens_start_declaration not + c_token_starts_declaration on second token. + (c_parser_unary_expression): Handle static assertions. + * c-parser.h (c_parser_next_tokens_start_declaration): Add + argument. + +2025-10-21 Martin Uecker + + * c-decl.cc (build_array_declarator): Remove error. + (grokgenassoc): New function. + (grokdeclarator): Add error. + * c-parser.cc (c_parser_generic_selection): Use grokgenassoc. + * c-tree.h (grokgenassoc): Add prototype. + +2025-10-21 Paul-Antoine Arras + + PR c/120180 + PR fortran/122306 + * c-parser.cc (c_parser_pragma): Accept a subset of non-executable + OpenMP directives in intervening code. + (c_parser_omp_error): Reject 'error at(execution)' in intervening code. + (c_parser_omp_metadirective): Return early if only one selector matches + and it resolves to 'omp nothing'. + +2025-10-21 Tobias Burnus + + * c-parser.cc (c_parser_omp_assumption_clauses): Switch to + 'unknown' not 'invalid' directive name for end directives. + +2025-10-08 Joseph Myers + + * c-typeck.cc (in_generic, save_maybe_used, restore_maybe_used): + New. + (mark_decl_used, record_maybe_used_decl, pop_maybe_used): Use + in_generic. + (struct maybe_used_decl): Move to c-tree.h. + * c-tree.h (struct maybe_used_decl): Move from c-typeck.cc. + (in_generic, save_maybe_used, restore_maybe_used): Declare. + * c-parser.cc (c_parser_generic_selection): Increment and + decrement in_generic. Use pop_maybe_used, save_maybe_used and + restore_maybe_used. + +2025-10-08 Martin Uecker + + * c-parser.cc (c_parser_generic_selection): Change + error_at to pedwarn_c23. + +2025-10-08 Alfie Richards + + PR target/122180 + * c-decl.cc (pushdecl): Add TARGET_HAS_FMV_TARGET_ATTRIBUTE check. + +2025-10-07 Joseph Myers + + PR c/26581 + * c-decl.cc (c_finish_incomplete_decl): Give error for tentative + definition of incomplete array for C2y with internal linkage. + (finish_decl): Do not set DO_DEFAULT based on -pedantic. Use + pedwarn_c23 for missing array sizes for internal linkage. + +2025-10-02 Alfie Richards + + * c-decl.cc (maybe_mark_function_versioned): Add diagnostic. + * c-parser.cc (c_finish_omp_declare_simd): Add diagnostic. + +2025-10-02 Alfie Richards + + * c-decl.cc (maybe_mark_function_versioned): New function. + (merge_decls): Preserve DECL_FUNCTION_VERSIONED in merging. + (duplicate_decls): Add check and diagnostic for unmergable version decls. + (pushdecl): Add FMV target_version logic. + (lookup_name): Don't resolve non-default versions. + (start_decl): Mark and mangle versioned functions. + (start_function): Mark and mangle versioned functions. + (c_parse_final_cleanups): Add call to process_same_body_aliases. + +2025-10-01 Jan Hubicka + + * Make-lang.in: Add c_FDAS + (create_fdas_for_cc1): Be sure that build fails if create_gcov fails. + +2025-09-30 Martin Uecker + + PR target/121933 + * c-typeck.cc (mark_decl_used): Set DECL_NONLOCAL + only for VAR_DECL, FUNC_DECL, PARM_DECL. + +2025-09-26 Alejandro Colomar + + * c-decl.cc (c_scope): Rename {warned > had}_forward_parm_decls. + (mark_forward_parm_decls): Add + -Wmultiple-parameter-fwd-decl-lists. + +2025-09-26 Joseph Myers + + PR c/88642 + * c-typeck.cc (constructor_braced_scalar): New variable. + (struct constructor_stack): Add braced_scalar field. + (really_start_incremental_init): Handle constructor_braced_scalar + and braced_scalar field. + (push_init_level): Handle constructor_braced_scalar and + braced_scalar field. Give permerror rather than warning for + nested braces around scalar initializer. + (pop_init_level): Handle constructor_braced_scalar and + braced_scalar field. + +2025-09-24 Joseph Myers + + * c-typeck.cc (really_atomic_lvalue): For a COMPOUND_LITERAL_EXPR, + check C_DECL_REGISTER on the COMPOUND_LITERAL_EXPR_DECL. + +2025-09-23 Alfie Richards + + * c-objc-common.cc (c_tree_printer): Add printing of target_clone and + target_version in decl diagnostics. + +2025-09-20 Joseph Myers + + * c-typeck.cc (really_atomic_lvalue): Return false for incomplete + types. + (convert_lvalue_to_rvalue): Call require_complete_type for + qualified void for C2y. + +2025-09-17 Richard Biener + + * gimple-parser.cc (c_parser_parse_gimple_body): Initialize + SSA operands for each stmt. + (c_parser_gimple_compound_statement): Append stmts without + updating SSA operands. + +2025-09-16 Andrew Pinski + + PR c/121421 + * c-parser.cc (c_parser_declaration_or_fndef): Error out for gimple + and rtl functions as nested functions. + +2025-09-13 Joseph Myers + + * c-typeck.cc (c_mark_addressable): New parameter + override_register. + (build_array_ref): Update calls to c_mark_addressable. Give error + in C2Y mode for negative array indices when array expression is an + array not a pointer. Use pedwarn_c23 for subscripting register + array; diagnose that also for register compound literal. + * c-tree.h (c_mark_addressable): Update prototype. + +2025-09-10 Martin Uecker + + * c-tree.h: Add new macro C_DECL_NONLOCAL_CONTEXT and prototype + for mark_decl_used. + * c-typeck.cc (mark_decl_used): New function. + (function_to_pointer_conversion): Mark exempt functions. + (record_maybe_used_decl): Add `address' parameter. + (build_external_ref): Change to mark_decl_used. + (pop_maybe_used): Call mark_decl_used. + (c_mark_addressable): Ditto. + (c_finish_goto_label): Ditto. + (c_finish_return): Add warning. + * c-decl.cc (declspecs_add_type): Ditto. + (grokdeclarator): Don't set C_DECL_REGISTER on function + declarators. + +2025-09-08 H.J. Lu + + PR c/107419 + * c-decl.cc (c_decl_attributes): Update TLS model with the + default TLS access model if the default TLS access model is + stronger. + (grokdeclarator): Set a tentative TLS model which will be + updated by c_decl_attributes later. + 2025-09-05 Jakub Jelinek * c-decl.cc (pushtag): Remove ()s around string literal diff --git a/gcc/c/Make-lang.in b/gcc/c/Make-lang.in index 2517b64439fe..f09fc99467b9 100644 --- a/gcc/c/Make-lang.in +++ b/gcc/c/Make-lang.in @@ -58,6 +58,7 @@ C_AND_OBJC_OBJS = attribs.o c/c-errors.o c/c-decl.o c/c-typeck.o \ # Language-specific object files for C. C_OBJS = c/c-lang.o c-family/stub-objc.o $(C_AND_OBJC_OBJS) c_OBJS = $(C_OBJS) cc1-checksum.o c/gccspec.o +c_FDAS = cc1.fda # Use strict warnings for this front end. c-warn = $(STRICT_WARN) @@ -101,7 +102,7 @@ create_fdas_for_cc1: ../stage1-gcc/cc1$(exeext) ../prev-gcc/$(PERF_DATA) echo $$perf_path; \ if [ -f $$perf_path ]; then \ profile_name=cc1_$$component_in_prev.fda; \ - $(CREATE_GCOV) -binary ../stage1-gcc/cc1$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \ + $(CREATE_GCOV) -binary ../stage1-gcc/cc1$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2 || exit 1; \ fi; \ done; @@ -111,7 +112,7 @@ create_fdas_for_cc1: ../stage1-gcc/cc1$(exeext) ../prev-gcc/$(PERF_DATA) echo $$perf_path; \ if [ -f $$perf_path ]; then \ profile_name=cc1_$$component_in_prev_target.fda; \ - $(CREATE_GCOV) -binary ../prev-gcc/cc1$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2; \ + $(CREATE_GCOV) -binary ../prev-gcc/cc1$(exeext) -gcov $$profile_name -profile $$perf_path -gcov_version 2 || exit 1; \ fi; \ done; diff --git a/gcc/c/c-decl.cc b/gcc/c/c-decl.cc index 589abf4e4e28..061892ac95b8 100644 --- a/gcc/c/c-decl.cc +++ b/gcc/c/c-decl.cc @@ -71,7 +71,8 @@ enum decl_context FUNCDEF, /* Function definition */ PARM, /* Declaration of parm before function body */ FIELD, /* Declaration inside struct or union */ - TYPENAME}; /* Typename (inside cast or sizeof) */ + TYPENAME, /* Typename (inside cast or sizeof) */ + GENERIC_ASSOC }; /* Typename in generic association */ /* States indicating how grokdeclarator() should handle declspecs marked with __attribute__((deprecated)) or __attribute__((unavailable)). @@ -504,10 +505,8 @@ struct GTY((chain_next ("%h.outer"))) c_scope { if these appears in a function definition. */ BOOL_BITFIELD had_vla_unspec : 1; - /* True if we already complained about forward parameter decls - in this scope. This prevents double warnings on - foo (int a; int b; ...) */ - BOOL_BITFIELD warned_forward_parm_decls : 1; + /* True if we parsed a list of forward parameter decls in this scope. */ + BOOL_BITFIELD had_forward_parm_decls : 1; /* True if this is the outermost block scope of a function body. This scope contains the parameters, the local variables declared @@ -910,8 +909,12 @@ c_finish_incomplete_decl (tree decl) && !DECL_EXTERNAL (decl) && TYPE_DOMAIN (type) == NULL_TREE) { - warning_at (DECL_SOURCE_LOCATION (decl), - 0, "array %q+D assumed to have one element", decl); + if (flag_isoc2y && !TREE_PUBLIC (decl)) + error_at (DECL_SOURCE_LOCATION (decl), + "array size missing in %q+D", decl); + else + warning_at (DECL_SOURCE_LOCATION (decl), + 0, "array %q+D assumed to have one element", decl); complete_array_type (&TREE_TYPE (decl), NULL_TREE, true); @@ -2088,6 +2091,35 @@ previous_tag (tree type) return NULL_TREE; } +/* Subroutine to mark functions as versioned when using the attribute + 'target_version'. */ + +static void +maybe_mark_function_versioned (tree decl) +{ + if (!DECL_FUNCTION_VERSIONED (decl)) + { + /* Check if the name of the function has been overridden. */ + if (DECL_ASSEMBLER_NAME_SET_P (decl) + && IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl))[0] == '*') + error_at (DECL_SOURCE_LOCATION (decl), + "cannot use function multiversioning on a renamed function"); + + /* We need to insert function version now to make sure the correct + pre-mangled assembler name is recorded. */ + cgraph_node *node = cgraph_node::get_create (decl); + + if (!node->function_version ()) + node->insert_new_function_version (); + + DECL_FUNCTION_VERSIONED (decl) = 1; + + tree mangled_name + = targetm.mangle_decl_assembler_name (decl, DECL_NAME (decl)); + SET_DECL_ASSEMBLER_NAME (decl, mangled_name); + } +} + /* Subroutine of duplicate_decls. Compare NEWDECL to OLDDECL. Returns true if the caller should proceed to merge the two, false if OLDDECL should simply be discarded. As a side effect, issues @@ -2507,6 +2539,10 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, "but not here"); } } + /* Check if these are unmergable overlapping FMV declarations. */ + if (!TARGET_HAS_FMV_TARGET_ATTRIBUTE + && diagnose_versioned_decls (olddecl, newdecl)) + return false; } else if (VAR_P (newdecl)) { @@ -2973,6 +3009,12 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype) if (TREE_CODE (newdecl) == FUNCTION_DECL) { + if (DECL_FUNCTION_VERSIONED (olddecl) + || DECL_FUNCTION_VERSIONED (newdecl)) + { + maybe_mark_function_versioned (olddecl); + maybe_mark_function_versioned (newdecl); + } /* If we're redefining a function previously defined as extern inline, make sure we emit debug info for the inline before we throw it away, in case it was inlined into a function that @@ -3372,6 +3414,56 @@ pushdecl (tree x) TREE_TYPE (b_use->decl) = b_use->u.type; } } + + /* Check if x is part of a FMV set with b_use. + FMV is only supported in c for targets with target_version + attributes. */ + if (!TARGET_HAS_FMV_TARGET_ATTRIBUTE + && b_use && TREE_CODE (b_use->decl) == FUNCTION_DECL + && TREE_CODE (x) == FUNCTION_DECL && DECL_FILE_SCOPE_P (b_use->decl) + && DECL_FILE_SCOPE_P (x) + && disjoint_version_decls (x, b_use->decl) + && comptypes (vistype, type) != 0) + { + maybe_mark_function_versioned (b_use->decl); + maybe_mark_function_versioned (b->decl); + maybe_mark_function_versioned (x); + + cgraph_node *b_node = cgraph_node::get_create (b_use->decl); + cgraph_function_version_info *b_v = b_node->function_version (); + if (!b_v) + b_v = b_node->insert_new_function_version (); + + /* Check if this new node conflicts with any previous functions + in the set. */ + cgraph_function_version_info *version = b_v; + for (; version; version = version->next) + if (!disjoint_version_decls (version->this_node->decl, x)) + { + /* The decls define overlapping version, so attempt to merge + or diagnose the conflict. */ + if (duplicate_decls (x, version->this_node->decl)) + return version->this_node->decl; + else + return error_mark_node; + } + + /* This is a new version to be added to FMV structure. */ + cgraph_node::add_function_version (b_v, x); + + /* Get the first node from the structure. */ + cgraph_function_version_info *default_v = b_v; + while (default_v->prev) + default_v = default_v->prev; + /* Always use the default node for the bindings. */ + b_use->decl = default_v->this_node->decl; + b->decl = default_v->this_node->decl; + + /* Node is not a duplicate, so no need to do the rest of the + checks. */ + return x; + } + if (duplicate_decls (x, b_use->decl)) { if (b_use != b) @@ -4496,6 +4588,12 @@ tree lookup_name (tree name) { struct c_binding *b = I_SYMBOL_BINDING (name); + /* Do not resolve non-default function versions. */ + if (b + && TREE_CODE (b->decl) == FUNCTION_DECL + && DECL_FUNCTION_VERSIONED (b->decl) + && !is_function_default_version (b->decl)) + return NULL_TREE; if (b && !b->invisible) { maybe_record_typedef_use (b->decl); @@ -5358,20 +5456,12 @@ build_array_declarator (location_t loc, pedwarn_c90 (loc, OPT_Wpedantic, "ISO C90 does not support % or type " "qualifiers in parameter array declarators"); - if (vla_unspec_p) - pedwarn_c90 (loc, OPT_Wpedantic, - "ISO C90 does not support %<[*]%> array declarators"); if (vla_unspec_p) { - if (!current_scope->parm_flag) - { - /* C99 6.7.5.2p4 */ - error_at (loc, "%<[*]%> not allowed in other than " - "function prototype scope"); - declarator->u.array.vla_unspec_p = false; - return NULL; - } - current_scope->had_vla_unspec = true; + pedwarn_c90 (loc, OPT_Wpedantic, + "ISO C90 does not support %<[*]%> array declarators"); + if (current_scope->parm_flag) + current_scope->had_vla_unspec = true; } return declarator; } @@ -5477,6 +5567,29 @@ groktypename (struct c_type_name *type_name, tree *expr, return type; } + +/* Decode a "typename", such as "int **", returning a ..._TYPE node, + as for groktypename but setting the context to GENERIC_ASSOC. */ + +tree +grokgenassoc (struct c_type_name *type_name) +{ + tree type; + tree attrs = type_name->specs->attrs; + + type_name->specs->attrs = NULL_TREE; + + type = grokdeclarator (type_name->declarator, type_name->specs, GENERIC_ASSOC, + false, NULL, &attrs, NULL, NULL, DEPRECATED_NORMAL); + + /* Apply attributes. */ + attrs = c_warn_type_attributes (type, attrs); + decl_attributes (&type, attrs, 0); + + return type; +} + + /* Looks up the most recent pushed declaration corresponding to DECL. */ static tree @@ -5582,7 +5695,16 @@ c_decl_attributes (tree *node, tree attributes, int flags) tree last_decl = lookup_last_decl (*node); if (last_decl == error_mark_node) last_decl = NULL_TREE; - return decl_attributes (node, attributes, flags, last_decl); + tree attr = decl_attributes (node, attributes, flags, last_decl); + if (VAR_P (*node) && DECL_THREAD_LOCAL_P (*node)) + { + // tls_model attribute can set a stronger TLS access model. + tls_model model = DECL_TLS_MODEL (*node); + tls_model default_model = decl_default_tls_model (*node); + if (default_model > model) + set_decl_tls_model (*node, default_model); + } + return attr; } @@ -5769,6 +5891,17 @@ start_decl (struct c_declarator *declarator, struct c_declspecs *declspecs, && VAR_OR_FUNCTION_DECL_P (decl)) objc_check_global_decl (decl); + /* To enable versions to be created across TU's we mark and mangle all + non-default versioned functions. */ + if (TREE_CODE (decl) == FUNCTION_DECL + && !TARGET_HAS_FMV_TARGET_ATTRIBUTE + && get_target_version (decl).is_valid ()) + { + maybe_mark_function_versioned (decl); + if (current_scope != file_scope) + error ("versioned declarations are only allowed at file scope"); + } + /* Add this decl to the current scope. TEM may equal DECL or it may be a previous decl of the same name. */ if (do_push) @@ -5874,11 +6007,7 @@ finish_decl (tree decl, location_t init_loc, tree init, && !(TREE_PUBLIC (decl) && current_scope != file_scope)) { bool do_default - = (TREE_STATIC (decl) - /* Even if pedantic, an external linkage array - may have incomplete type at first. */ - ? pedantic && !TREE_PUBLIC (decl) - : !DECL_EXTERNAL (decl)); + = !TREE_STATIC (decl) && !DECL_EXTERNAL (decl); int failure = complete_array_type (&TREE_TYPE (decl), DECL_INITIAL (decl), do_default); @@ -5895,6 +6024,9 @@ finish_decl (tree decl, location_t init_loc, tree init, case 2: if (do_default) error ("array size missing in %q+D", decl); + else if (!TREE_PUBLIC (decl)) + pedwarn_c23 (DECL_SOURCE_LOCATION (decl), OPT_Wpedantic, + "array size missing in %q+D", decl); break; case 3: @@ -6260,12 +6392,14 @@ mark_forward_parm_decls (void) { struct c_binding *b; - if (pedantic && !current_scope->warned_forward_parm_decls) - { - pedwarn (input_location, OPT_Wpedantic, - "ISO C forbids forward parameter declarations"); - current_scope->warned_forward_parm_decls = true; - } + if (current_scope->had_forward_parm_decls) + warning_at (input_location, OPT_Wmultiple_parameter_fwd_decl_lists, + "more than one list of forward declarations of parameters"); + if (pedantic && !current_scope->had_forward_parm_decls) + pedwarn (input_location, OPT_Wpedantic, + "ISO C forbids forward parameter declarations"); + + current_scope->had_forward_parm_decls = true; for (b = current_scope->bindings; b; b = b->prev) if (TREE_CODE (b->decl) == PARM_DECL) @@ -6654,6 +6788,7 @@ build_arg_spec_attribute (tree type, bool static_p, tree attrs) or before a function body). Make a PARM_DECL, or return void_type_node. TYPENAME if for a typename (in a cast or sizeof). Don't make a DECL node; just return the ..._TYPE node. + GENERIC_ASSOC for typenames in a generic association. FIELD for a struct or union field; make a FIELD_DECL. INITIALIZED is true if the decl has an initializer. WIDTH is non-NULL for bit-fields, and is a pointer to an INTEGER_CST node @@ -6790,6 +6925,7 @@ grokdeclarator (const struct c_declarator *declarator, { gcc_assert (decl_context == PARM || decl_context == TYPENAME + || decl_context == GENERIC_ASSOC || (decl_context == FIELD && declarator->kind == cdk_id)); gcc_assert (!initialized); @@ -7363,14 +7499,6 @@ grokdeclarator (const struct c_declarator *declarator, itype = build_index_type (NULL_TREE); } - if (array_parm_vla_unspec_p) - { - /* C99 6.7.5.2p4 */ - if (decl_context == TYPENAME) - warning (0, "%<[*]%> not in a declaration"); - size_varies = true; - } - /* Complain about arrays of incomplete types. */ if (!COMPLETE_TYPE_P (type)) { @@ -7409,6 +7537,22 @@ grokdeclarator (const struct c_declarator *declarator, type = c_build_array_type (type, itype); } + if (array_parm_vla_unspec_p) + { + /* C99 6.7.5.2p4 */ + if (decl_context == TYPENAME) + warning (0, "%<[*]%> not in a declaration"); + else if (decl_context != GENERIC_ASSOC + && decl_context != PARM + && decl_context != FIELD) + { + error ("%<[*]%> not allowed in other than function prototype scope " + "or generic association"); + type = error_mark_node; + } + size_varies = true; + } + if (type != error_mark_node) { /* The GCC extension for zero-length arrays differs from @@ -7780,7 +7924,7 @@ grokdeclarator (const struct c_declarator *declarator, /* If this is a type name (such as, in a cast or sizeof), compute the type and return it now. */ - if (decl_context == TYPENAME) + if (decl_context == TYPENAME || decl_context == GENERIC_ASSOC) { /* Note that the grammar rejects storage classes in typenames and fields. */ @@ -8181,8 +8325,11 @@ grokdeclarator (const struct c_declarator *declarator, TREE_PUBLIC (decl) = extern_ref; } + // NB: Set a tentative TLS model to avoid tls_model attribute + // warnings due to lack of thread storage duration. It will + // be updated by c_decl_attributes later. if (threadp) - set_decl_tls_model (decl, decl_default_tls_model (decl)); + set_decl_tls_model (decl, TLS_MODEL_REAL); } if ((storage_class == csc_extern @@ -8219,7 +8366,8 @@ grokdeclarator (const struct c_declarator *declarator, /* Record `register' declaration for warnings on & and in case doing stupid register allocation. */ - if (storage_class == csc_register) + if (storage_class == csc_register + && TREE_CODE (type) != FUNCTION_TYPE) { C_DECL_REGISTER (decl) = 1; DECL_REGISTER (decl) = 1; @@ -10741,6 +10889,17 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator, warn_parm_array_mismatch (origloc, old_decl, parms); } + /* To enable versions to be created across TU's we mark and mangle all + non-default versioned functions. */ + if (TREE_CODE (decl1) == FUNCTION_DECL + && !TARGET_HAS_FMV_TARGET_ATTRIBUTE + && get_target_version (decl1).is_valid ()) + { + maybe_mark_function_versioned (decl1); + if (current_scope != file_scope) + error ("versioned definitions are only allowed at file scope"); + } + /* Record the decl so that the function name is defined. If we already have a decl for this name, and it is a FUNCTION_DECL, use the old decl. */ @@ -12815,6 +12974,7 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs, error_at (loc, "two or more data types in declaration specifiers"); else if (TREE_CODE (type) == TYPE_DECL) { + mark_decl_used (type, false); specs->type = TREE_TYPE (type); if (TREE_TYPE (type) != error_mark_node) { @@ -13571,6 +13731,10 @@ c_parse_final_cleanups (void) c_write_global_declarations_1 (BLOCK_VARS (DECL_INITIAL (t))); c_write_global_declarations_1 (BLOCK_VARS (ext_block)); + /* Call this to set cpp_implicit_aliases_done on all nodes. This is + important for function multiversioning aliases to get resolved. */ + symtab->process_same_body_aliases (); + if (!in_lto_p) free_attr_access_data (); diff --git a/gcc/c/c-objc-common.cc b/gcc/c/c-objc-common.cc index 5c50983544d7..109a8cb33ee8 100644 --- a/gcc/c/c-objc-common.cc +++ b/gcc/c/c-objc-common.cc @@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see #include "c-tree.h" #include "intl.h" #include "c-family/c-pretty-print.h" +#include "tree-core.h" #include "tree-pretty-print.h" #include "tree-pretty-print-markup.h" #include "gimple-pretty-print.h" @@ -359,6 +360,11 @@ c_tree_printer (pretty_printer *pp, text_info *text, const char *spec, if (DECL_NAME (t)) { pp_identifier (cpp, lang_hooks.decl_printable_name (t, 2)); + if (TREE_CODE (t) == FUNCTION_DECL) + { + pp_c_function_target_version (cpp, t); + pp_c_function_target_clones (cpp, t); + } return true; } break; diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc index f1aaab12e6e8..0cf3f92a72cb 100644 --- a/gcc/c/c-parser.cc +++ b/gcc/c/c-parser.cc @@ -675,14 +675,15 @@ c_token_starts_typename (c_token *token) } } -/* Return true if the next token from PARSER can start a type name, - false otherwise. LA specifies how to do lookahead in order to +/* Return true if the next token from PARSER, starting from token N, can start + a type name, false otherwise. LA specifies how to do lookahead in order to detect unknown type names. If unsure, pick CLA_PREFER_ID. */ static inline bool -c_parser_next_tokens_start_typename (c_parser *parser, enum c_lookahead_kind la) +c_parser_next_tokens_start_typename (c_parser *parser, enum c_lookahead_kind la, + unsigned int n = 1) { - c_token *token = c_parser_peek_token (parser); + c_token *token = c_parser_peek_nth_token (parser, n); if (c_token_starts_typename (token)) return true; @@ -695,8 +696,8 @@ c_parser_next_tokens_start_typename (c_parser *parser, enum c_lookahead_kind la) && !parser->objc_could_be_foreach_context && (la == cla_prefer_type - || c_parser_peek_2nd_token (parser)->type == CPP_NAME - || c_parser_peek_2nd_token (parser)->type == CPP_MULT) + || c_parser_peek_nth_token (parser, n + 1)->type == CPP_NAME + || c_parser_peek_nth_token (parser, n + 1)->type == CPP_MULT) /* Only unknown identifiers. */ && !lookup_name (token->value)) @@ -892,30 +893,47 @@ c_parser_next_token_starts_declspecs (c_parser *parser) return c_token_starts_declspecs (token); } -/* Return true if the next tokens from PARSER can start declaration - specifiers (not including standard attributes) or a static - assertion, false otherwise. */ +static bool c_parser_check_balanced_raw_token_sequence (c_parser *, + unsigned int *); + +/* Return true if the next tokens from PARSER (starting with token N, 1-based) + can start declaration specifiers (not including standard attributes) or a + static assertion, false otherwise. */ bool -c_parser_next_tokens_start_declaration (c_parser *parser) +c_parser_next_tokens_start_declaration (c_parser *parser, unsigned int n) { - c_token *token = c_parser_peek_token (parser); + c_token *token = c_parser_peek_nth_token (parser, n); /* Same as above. */ if (c_dialect_objc () && token->type == CPP_NAME && token->id_kind == C_ID_CLASSNAME - && c_parser_peek_2nd_token (parser)->type == CPP_DOT) + && c_parser_peek_nth_token (parser, n + 1)->type == CPP_DOT) return false; /* Labels do not start declarations. */ if (token->type == CPP_NAME - && c_parser_peek_2nd_token (parser)->type == CPP_COLON) + && c_parser_peek_nth_token (parser, n + 1)->type == CPP_COLON) return false; + /* A static assertion is only a declaration if followed by a semicolon; + otherwise, it may be an expression in C2Y. */ + if (token->keyword == RID_STATIC_ASSERT + && c_parser_peek_nth_token (parser, n + 1)->type == CPP_OPEN_PAREN) + { + n += 2; + if (!c_parser_check_balanced_raw_token_sequence (parser, &n) + || c_parser_peek_nth_token_raw (parser, n)->type != CPP_CLOSE_PAREN) + /* Invalid static assertion syntax; treat as a declaration and report a + syntax error there. */ + return true; + return c_parser_peek_nth_token_raw (parser, n + 1)->type == CPP_SEMICOLON; + } + if (c_token_starts_declaration (token)) return true; - if (c_parser_next_tokens_start_typename (parser, cla_nonabstract_decl)) + if (c_parser_next_tokens_start_typename (parser, cla_nonabstract_decl, n)) return true; return false; @@ -3222,7 +3240,7 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, else fnbody = c_parser_compound_statement (parser, &endloc); tree fndecl = current_function_decl; - if (nested) + if (nested && specs->declspec_il == cdil_none) { tree decl = current_function_decl; /* Mark nested functions as needing static-chain initially. @@ -3235,6 +3253,15 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, c_pop_function_context (); add_stmt (build_stmt (DECL_SOURCE_LOCATION (decl), DECL_EXPR, decl)); } + else if (nested) + { + if (specs->declspec_il == cdil_rtl) + error ("%<__RTL%> function cannot be a nested function"); + else + error ("%<__GIMPLE%> function cannot be a nested function"); + finish_function (endloc); + c_pop_function_context (); + } else { if (fnbody) @@ -5846,9 +5873,6 @@ c_parser_balanced_token_sequence (c_parser *parser) } } -static bool c_parser_check_balanced_raw_token_sequence (c_parser *, - unsigned int *); - /* Parse arguments of omp::directive or omp::decl attribute. directive-name ,[opt] clause-list[opt] @@ -7715,7 +7739,7 @@ c_parser_compound_statement_nostart (c_parser *parser) == RID_EXTENSION)) c_parser_consume_token (parser); if (!have_std_attrs - && (c_token_starts_declaration (c_parser_peek_2nd_token (parser)) + && (c_parser_next_tokens_start_declaration (parser, 2) || c_parser_nth_token_starts_std_attributes (parser, 2))) { int ext; @@ -9123,7 +9147,7 @@ c_parser_for_statement (c_parser *parser, bool ivdep, unsigned short unroll, && (c_parser_peek_2nd_token (parser)->keyword == RID_EXTENSION)) c_parser_consume_token (parser); - if (c_token_starts_declaration (c_parser_peek_2nd_token (parser)) + if (c_parser_next_tokens_start_declaration (parser, 2) || c_parser_nth_token_starts_std_attributes (parser, 2)) { int ext; @@ -10504,8 +10528,9 @@ c_parser_cast_expression (c_parser *parser, struct c_expr *after) _Countof ( type-name ) sizeof unary-expression sizeof ( type-name ) + static-assert-declaration-no-semi - (_Countof is new in C2y.) + (_Countof and the use of static assertions in expressions are new in C2y.) unary-operator: one of & * + - ~ ! @@ -10670,6 +10695,15 @@ c_parser_unary_expression (c_parser *parser) case RID_TRANSACTION_RELAXED: return c_parser_transaction_expression (parser, c_parser_peek_token (parser)->keyword); + case RID_STATIC_ASSERT: + c_parser_static_assert_declaration_no_semi (parser); + pedwarn_c23 (op_loc, OPT_Wpedantic, + "ISO C does not support static assertions in " + "expressions before C2Y"); + ret.value = void_node; + set_c_expr_source_range (&ret, op_loc, op_loc); + ret.m_decimal = 0; + return ret; default: return c_parser_postfix_expression (parser); } @@ -11174,9 +11208,12 @@ c_parser_generic_selection (c_parser *parser) else { c_inhibit_evaluation_warnings++; + in_generic++; selector = c_parser_expr_no_commas (parser, NULL); selector = default_function_array_conversion (selector_loc, selector); c_inhibit_evaluation_warnings--; + in_generic--; + pop_maybe_used (!flag_isoc23); if (selector.value == error_mark_node) { @@ -11205,6 +11242,7 @@ c_parser_generic_selection (c_parser *parser) } auto_vec associations; + struct maybe_used_decl *maybe_used_default = NULL; while (1) { struct c_generic_association assoc, *iter; @@ -11227,7 +11265,7 @@ c_parser_generic_selection (c_parser *parser) c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); return error_expr; } - assoc.type = groktypename (type_name, NULL, NULL); + assoc.type = grokgenassoc (type_name); if (assoc.type == error_mark_node) { c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); @@ -11244,9 +11282,9 @@ c_parser_generic_selection (c_parser *parser) "incomplete type before C2Y"); if (c_type_variably_modified_p (assoc.type)) - error_at (assoc.type_location, - "%<_Generic%> association has " - "variable length type"); + pedwarn_c23 (assoc.type_location, OPT_Wpedantic, + "ISO C does not support %<_Generic%> association with " + "variably-modified type before C2Y"); } if (!c_parser_require (parser, CPP_COLON, "expected %<:%>")) @@ -11260,11 +11298,19 @@ c_parser_generic_selection (c_parser *parser) if (!match) c_inhibit_evaluation_warnings++; + in_generic++; assoc.expression = c_parser_expr_no_commas (parser, NULL); if (!match) c_inhibit_evaluation_warnings--; + in_generic--; + if (!match) + pop_maybe_used (!flag_isoc23); + else if (assoc.type == NULL_TREE) + maybe_used_default = save_maybe_used (); + else + pop_maybe_used (true); if (assoc.expression.value == error_mark_node) { @@ -11325,6 +11371,20 @@ c_parser_generic_selection (c_parser *parser) c_parser_consume_token (parser); } + if (match_found >= 0 && matched_assoc.type == NULL_TREE) + { + /* Declarations referenced in the default association are used. */ + restore_maybe_used (maybe_used_default); + pop_maybe_used (true); + } + else if (maybe_used_default) + { + /* Declarations referenced in the default association are not used, but + are treated as used before C23. */ + restore_maybe_used (maybe_used_default); + pop_maybe_used (!flag_isoc23); + } + unsigned int ix; struct c_generic_association *iter; FOR_EACH_VEC_ELT (associations, ix, iter) @@ -15752,11 +15812,15 @@ c_parser_pragma (c_parser *parser, enum pragma_context context, bool *if_p, gcc_assert (id != PRAGMA_NONE); if (parser->omp_for_parse_state && parser->omp_for_parse_state->in_intervening_code - && id >= PRAGMA_OMP__START_ - && id <= PRAGMA_OMP__LAST_) - { - error_at (input_location, - "intervening code must not contain OpenMP directives"); + && id >= PRAGMA_OMP__START_ && id <= PRAGMA_OMP__LAST_ + /* Allow a safe subset of non-executable directives. See classification in + array c_omp_directives. */ + && id != PRAGMA_OMP_METADIRECTIVE && id != PRAGMA_OMP_NOTHING + && id != PRAGMA_OMP_ASSUME && id != PRAGMA_OMP_ERROR) + { + error_at ( + input_location, + "intervening code must not contain executable OpenMP directives"); parser->omp_for_parse_state->fail = true; c_parser_skip_until_found (parser, CPP_PRAGMA_EOL, NULL); return false; @@ -27767,6 +27831,13 @@ c_finish_omp_declare_simd (c_parser *parser, tree fndecl, tree parms, clauses[0].type = CPP_EOF; return; } + if (DECL_FUNCTION_VERSIONED (fndecl)) + { + error_at (DECL_SOURCE_LOCATION (fndecl), + "%<#pragma omp declare %s%> cannot be used with function " + "multi-versioning", kind); + return; + } if (parms == NULL_TREE) parms = DECL_ARGUMENTS (fndecl); @@ -29292,6 +29363,14 @@ c_parser_omp_error (c_parser *parser, enum pragma_context context) "may only be used in compound statements"); return true; } + if (parser->omp_for_parse_state + && parser->omp_for_parse_state->in_intervening_code) + { + error_at (loc, "%<#pragma omp error%> with % clause " + "may not be used in intervening code"); + parser->omp_for_parse_state->fail = true; + return true; + } tree fndecl = builtin_decl_explicit (severity_fatal ? BUILT_IN_GOMP_ERROR : BUILT_IN_GOMP_WARNING); @@ -29438,6 +29517,7 @@ c_parser_omp_assumption_clauses (c_parser *parser, bool is_assume) directive[1], directive[2]); if (dir + && dir->id != PRAGMA_OMP_END && (dir->kind == C_OMP_DIR_DECLARATIVE || dir->kind == C_OMP_DIR_INFORMATIONAL || dir->kind == C_OMP_DIR_META)) @@ -29821,6 +29901,17 @@ c_parser_omp_metadirective (c_parser *parser, bool *if_p) } c_parser_skip_to_pragma_eol (parser); + /* If only one selector matches and it evaluates to 'omp nothing', no need to + proceed. */ + if (ctxs.length () == 1) + { + tree ctx = ctxs[0]; + if (ctx == NULL_TREE + || (omp_context_selector_matches (ctx, NULL_TREE, false) == 1 + && directive_tokens[0].pragma_kind == PRAGMA_OMP_NOTHING)) + return; + } + if (!default_seen) { /* Add a default clause that evaluates to 'omp nothing'. */ @@ -29901,7 +29992,7 @@ c_parser_omp_metadirective (c_parser *parser, bool *if_p) if (standalone_body == NULL_TREE) { standalone_body = push_stmt_list (); - c_parser_statement (parser, if_p); + c_parser_statement (parser, if_p); // TODO skip this standalone_body = pop_stmt_list (standalone_body); } else diff --git a/gcc/c/c-parser.h b/gcc/c/c-parser.h index a84779bcbf83..46713d715ac7 100644 --- a/gcc/c/c-parser.h +++ b/gcc/c/c-parser.h @@ -156,7 +156,8 @@ extern void c_parser_skip_until_found (c_parser *parser, enum cpp_ttype type, const char *msgid, location_t = UNKNOWN_LOCATION); extern bool c_parser_next_token_starts_declspecs (c_parser *parser); -bool c_parser_next_tokens_start_declaration (c_parser *parser); +bool c_parser_next_tokens_start_declaration (c_parser *parser, + unsigned int n = 1); bool c_token_starts_typename (c_token *token); /* Abstraction to avoid defining c_parser here which messes up gengtype diff --git a/gcc/c/c-tree.h b/gcc/c/c-tree.h index afec03e25ebc..f367cda35d7c 100644 --- a/gcc/c/c-tree.h +++ b/gcc/c/c-tree.h @@ -80,6 +80,11 @@ along with GCC; see the file COPYING3. If not see /* For a PARM_DECL, nonzero if it was declared as an array. */ #define C_ARRAY_PARAMETER(NODE) DECL_LANG_FLAG_0 (NODE) +/* For FUNCTION_DECLs, evaluates true if the decl is a nested + function that requires a non-local context. */ +#define C_FUNC_NONLOCAL_CONTEXT(EXP) \ + DECL_LANG_FLAG_4 (FUNCTION_DECL_CHECK (EXP)) + /* For FUNCTION_DECLs, evaluates true if the decl is built-in but has been declared. */ #define C_DECL_DECLARED_BUILTIN(EXP) \ @@ -111,7 +116,8 @@ along with GCC; see the file COPYING3. If not see /* Record whether a decl was declared register. This is strictly a front-end flag, whereas DECL_REGISTER is used for code generation; they may differ for structures with volatile fields. */ -#define C_DECL_REGISTER(EXP) DECL_LANG_FLAG_4 (EXP) +#define C_DECL_REGISTER(EXP) \ + DECL_LANG_FLAG_4 (TREE_NOT_CHECK (EXP, FUNCTION_DECL)) /* Record whether a decl was used in an expression anywhere except an unevaluated operand of sizeof / typeof / alignof. This is only @@ -618,6 +624,19 @@ enum c_inline_static_type { csi_modifiable }; +/* Record details of decls possibly used inside sizeof or typeof. */ +struct maybe_used_decl +{ + /* The decl. */ + tree decl; + /* The level seen at (in_sizeof + in_typeof + in_countof + in_generic). */ + int level; + /* Seen in address-of. */ + bool address; + /* The next one at this level or above, or NULL. */ + struct maybe_used_decl *next; +}; + /* in c-parser.cc */ struct c_tree_token_vec; @@ -694,6 +713,7 @@ extern struct c_arg_info *get_parm_info (bool, tree); extern tree grokfield (location_t, struct c_declarator *, struct c_declspecs *, tree, tree *, tree *); extern tree groktypename (struct c_type_name *, tree *, bool *); +extern tree grokgenassoc (struct c_type_name *); extern tree grokparm (const struct c_parm *, tree *); extern tree implicitly_declare (location_t, tree); extern void keep_next_level (void); @@ -768,6 +788,7 @@ extern int in_alignof; extern int in_sizeof; extern int in_countof; extern int in_typeof; +extern int in_generic; extern bool c_in_omp_for; extern bool c_omp_array_section_p; @@ -807,7 +828,7 @@ extern bool comptypes_same_p (tree, tree); extern bool comptypes_equiv_p (tree, tree); extern int comptypes_check_different_types (tree, tree, bool *); extern int comptypes_check_enum_int (tree, tree, bool *); -extern bool c_mark_addressable (tree, bool = false); +extern bool c_mark_addressable (tree, bool = false, bool = false); extern void c_incomplete_type_error (location_t, const_tree, const_tree); extern tree c_type_promotes_to (tree); extern struct c_expr default_function_array_conversion (location_t, @@ -827,6 +848,9 @@ extern tree build_array_ref (location_t, tree, tree); extern tree build_omp_array_section (location_t, tree, tree, tree); extern tree build_external_ref (location_t, tree, bool, tree *); extern void pop_maybe_used (bool); +extern struct maybe_used_decl *save_maybe_used (); +extern void restore_maybe_used (struct maybe_used_decl *); +extern void mark_decl_used (tree, bool); extern struct c_expr c_expr_sizeof_expr (location_t, struct c_expr); extern struct c_expr c_expr_sizeof_type (location_t, struct c_type_name *); extern struct c_expr c_expr_countof_expr (location_t, struct c_expr); diff --git a/gcc/c/c-typeck.cc b/gcc/c/c-typeck.cc index 191ec7b4b822..371583bd64ed 100644 --- a/gcc/c/c-typeck.cc +++ b/gcc/c/c-typeck.cc @@ -78,6 +78,9 @@ int in_countof; /* The level of nesting inside "typeof". */ int in_typeof; +/* The level of nesting inside "_Generic". */ +int in_generic; + /* True when parsing OpenMP loop expressions. */ bool c_in_omp_for; @@ -133,7 +136,7 @@ static void set_nonincremental_init_from_string (tree, struct obstack *); static tree find_init_member (tree, struct obstack *); static void readonly_warning (tree, enum lvalue_use); static int lvalue_or_else (location_t, const_tree, enum lvalue_use); -static void record_maybe_used_decl (tree); +static void record_maybe_used_decl (tree, bool address); static bool comptypes_internal (const_tree, const_tree, struct comptypes_data *data); static bool comptypes_check_for_composite (tree t1, tree t2); @@ -2328,7 +2331,15 @@ function_to_pointer_conversion (location_t loc, tree exp) copy_warning (exp, orig_exp); - return build_unary_op (loc, ADDR_EXPR, exp, false); + tree exp2 = build_unary_op (loc, ADDR_EXPR, exp, false); + + /* If the function is defined and known to not to require a non-local + context, make sure no trampoline is generated. */ + if (TREE_CODE (exp) == FUNCTION_DECL + && DECL_INITIAL (exp) && !C_FUNC_NONLOCAL_CONTEXT (exp)) + TREE_NO_TRAMPOLINE (exp2) = 1; + + return exp2; } /* Mark EXP as read, not just set, for set but not used -Wunused @@ -2504,6 +2515,8 @@ really_atomic_lvalue (tree expr) return false; if (!TYPE_ATOMIC (TREE_TYPE (expr))) return false; + if (!COMPLETE_TYPE_P (TREE_TYPE (expr))) + return false; if (!lvalue_p (expr)) return false; @@ -2521,6 +2534,8 @@ really_atomic_lvalue (tree expr) return false; expr = TREE_OPERAND (expr, 0); } + if (TREE_CODE (expr) == COMPOUND_LITERAL_EXPR) + expr = COMPOUND_LITERAL_EXPR_DECL (expr); if (DECL_P (expr) && C_DECL_REGISTER (expr)) return false; return true; @@ -2599,7 +2614,9 @@ convert_lvalue_to_rvalue (location_t loc, struct c_expr exp, if (convert_p) exp = default_function_array_conversion (loc, exp); - if (!VOID_TYPE_P (TREE_TYPE (exp.value))) + if (!VOID_TYPE_P (TREE_TYPE (exp.value)) + || (flag_isoc2y + && TYPE_QUALS (TREE_TYPE (exp.value)) != TYPE_UNQUALIFIED)) exp.value = require_complete_type (loc, exp.value); if (for_init || !RECORD_OR_UNION_TYPE_P (TREE_TYPE (exp.value))) { @@ -3519,7 +3536,7 @@ build_array_ref (location_t loc, tree array, tree index) || (COMPLETE_TYPE_P (TREE_TYPE (TREE_TYPE (array))) && TREE_CODE (TYPE_SIZE (TREE_TYPE (TREE_TYPE (array)))) != INTEGER_CST)) { - if (!c_mark_addressable (array, true)) + if (!c_mark_addressable (array, true, true)) return error_mark_node; } /* An array that is indexed by a constant value which is not within @@ -3530,19 +3547,28 @@ build_array_ref (location_t loc, tree array, tree index) && TYPE_DOMAIN (TREE_TYPE (array)) && !int_fits_type_p (index, TYPE_DOMAIN (TREE_TYPE (array)))) { - if (!c_mark_addressable (array)) + if (!c_mark_addressable (array, false, true)) return error_mark_node; + /* ISO C2Y disallows a negative integer constant expression index + when array subscripting has an operand of array type. */ + if (flag_isoc2y + && !TREE_OVERFLOW (index) + && tree_int_cst_sgn (index) < 0) + error_at (loc, "array subscript is negative"); } - if ((pedantic || warn_c90_c99_compat) + if ((pedantic || warn_c90_c99_compat || warn_c23_c2y_compat) && ! was_vector) { tree foo = array; while (TREE_CODE (foo) == COMPONENT_REF) foo = TREE_OPERAND (foo, 0); - if (VAR_P (foo) && C_DECL_REGISTER (foo)) - pedwarn (loc, OPT_Wpedantic, - "ISO C forbids subscripting % array"); + if ((VAR_P (foo) && C_DECL_REGISTER (foo)) + || (TREE_CODE (foo) == COMPOUND_LITERAL_EXPR + && C_DECL_REGISTER (COMPOUND_LITERAL_EXPR_DECL (foo)))) + pedwarn_c23 (loc, OPT_Wpedantic, + "ISO C forbids subscripting % array " + "before C2Y"); else if (!lvalue_p (foo)) pedwarn_c90 (loc, OPT_Wpedantic, "ISO C90 forbids subscripting non-lvalue " @@ -3641,6 +3667,92 @@ build_omp_array_section (location_t loc, tree array, tree index, tree length) return build3_loc (loc, OMP_ARRAY_SECTION, sectype, array, index, length); } + +/* Record that REF is used. This is relevant for undeclared static + function and declarations referenced from a non-local context. + ADDRESS indicates whether the address is taken. */ + +void +mark_decl_used (tree ref, bool address) +{ + if (!ref || !DECL_P (ref) || in_alignof) + return; + + /* Non-file-scope and non-local reference in nested function. */ + bool nonloc_p = current_function_decl && DECL_CONTEXT (ref) + && DECL_CONTEXT (current_function_decl) + && DECL_CONTEXT (ref) != current_function_decl; + + /* An undeclared static function. */ + bool static_p = TREE_CODE (ref) == FUNCTION_DECL + && DECL_INITIAL (ref) == NULL_TREE + && DECL_EXTERNAL (ref) + && !TREE_PUBLIC (ref); + + if (!static_p && !nonloc_p) + return; + + /* If we may be in an unevaluated context, delay the decision. */ + if (in_sizeof || in_typeof || in_countof || in_generic) + return record_maybe_used_decl (ref, address); + + if (static_p) + C_DECL_USED (ref) = 1; + + if (nonloc_p && (VAR_OR_FUNCTION_DECL_P (ref) + || TREE_CODE (ref) == PARM_DECL)) + DECL_NONLOCAL (ref) = 1; + + /* Nothing to do anymore. */ + if (!nonloc_p || C_FUNC_NONLOCAL_CONTEXT (current_function_decl)) + return; + + /* Filter out the cases where referencing a non-local variable does not + require a non-local context passed via the static chain. */ + if (!C_TYPE_VARIABLY_MODIFIED (TREE_TYPE (ref))) + switch (TREE_CODE (ref)) + { + case FUNCTION_DECL: + /* Use of another local function that requires no context is ok. */ + if (!C_FUNC_NONLOCAL_CONTEXT (ref) && DECL_INITIAL (ref)) + return; + break; + case VAR_DECL: + /* Static variables and constexpr are ok, but for the later only + when the address is not taken. */ + if (TREE_STATIC (ref) || (C_DECL_DECLARED_CONSTEXPR (ref) && !address)) + return; + break; + case TYPE_DECL: + /* A typedef is ok when not for a variably-modified type. */ + return; + case CONST_DECL: + /* An enumeration constant is ok. */ + return; + case PARM_DECL: + break; + case LABEL_DECL: + break; + default: + gcc_unreachable (); + } + + /* Mark all parent functions up to the nesting level of the variable as + as needing the non-local context. */ + for (tree cont = current_function_decl; cont; cont = DECL_CONTEXT (cont)) + { + if (cont == DECL_CONTEXT (ref)) + break; + + /* There should not be any other type of context used for function + except TRANSLATION_UNIT_DECL which we should be able to reach. */ + gcc_checking_assert (TREE_CODE (cont) == FUNCTION_DECL); + + if (TREE_CODE (cont) == FUNCTION_DECL) + C_FUNC_NONLOCAL_CONTEXT (cont) = 1; + } +} + /* Build an external reference to identifier ID. FUN indicates whether this will be used for a function call. LOC is the source @@ -3698,15 +3810,7 @@ build_external_ref (location_t loc, tree id, bool fun, tree *type) TREE_USED (ref) = 1; } - if (TREE_CODE (ref) == FUNCTION_DECL && !in_alignof) - { - if (!in_sizeof && !in_typeof && !in_countof) - C_DECL_USED (ref) = 1; - else if (DECL_INITIAL (ref) == NULL_TREE - && DECL_EXTERNAL (ref) - && !TREE_PUBLIC (ref)) - record_maybe_used_decl (ref); - } + mark_decl_used (ref, false); if (TREE_CODE (ref) == CONST_DECL) { @@ -3725,16 +3829,6 @@ build_external_ref (location_t loc, tree id, bool fun, tree *type) ref = DECL_INITIAL (ref); TREE_CONSTANT (ref) = 1; } - else if (current_function_decl != NULL_TREE - && !DECL_FILE_SCOPE_P (current_function_decl) - && (VAR_OR_FUNCTION_DECL_P (ref) - || TREE_CODE (ref) == PARM_DECL)) - { - tree context = decl_function_context (ref); - - if (context != NULL_TREE && context != current_function_decl) - DECL_NONLOCAL (ref) = 1; - } /* C99 6.7.4p3: An inline definition of a function with external linkage ... shall not contain a reference to an identifier with internal linkage. */ @@ -3751,50 +3845,42 @@ build_external_ref (location_t loc, tree id, bool fun, tree *type) return ref; } -/* Record details of decls possibly used inside sizeof or typeof. */ -struct maybe_used_decl -{ - /* The decl. */ - tree decl; - /* The level seen at (in_sizeof + in_typeof + in_countof). */ - int level; - /* The next one at this level or above, or NULL. */ - struct maybe_used_decl *next; -}; - static struct maybe_used_decl *maybe_used_decls; -/* Record that DECL, an undefined static function reference seen - inside sizeof or typeof, might be used if the operand of sizeof is - a VLA type or the operand of typeof is a variably modified - type. */ +/* Record that DECL, a reference seen inside sizeof or typeof or _Countof or + _Generic, might be used if the operand of sizeof is a VLA type or the + operand of typeof is a variably modified type or the operand of _Countof has + a variable number of elements or the operand of _Generic is the one selected + as the result. */ static void -record_maybe_used_decl (tree decl) +record_maybe_used_decl (tree decl, bool address) { struct maybe_used_decl *t = XOBNEW (&parser_obstack, struct maybe_used_decl); t->decl = decl; - t->level = in_sizeof + in_typeof + in_countof; + t->level = in_sizeof + in_typeof + in_countof + in_generic; + t->address = address; t->next = maybe_used_decls; maybe_used_decls = t; } -/* Pop the stack of decls possibly used inside sizeof or typeof. If - USED is false, just discard them. If it is true, mark them used - (if no longer inside sizeof or typeof) or move them to the next - level up (if still inside sizeof or typeof). */ +/* Pop the stack of decls possibly used inside sizeof or typeof or _Countof or + _Generic. If USED is false, just discard them. If it is true, mark them + used (if no longer inside sizeof or typeof or _Countof or _Generic) or move + them to the next level up (if still inside sizeof or typeof or _Countof or + _Generic). */ void pop_maybe_used (bool used) { struct maybe_used_decl *p = maybe_used_decls; - int cur_level = in_sizeof + in_typeof + in_countof; + int cur_level = in_sizeof + in_typeof + in_countof + in_generic; while (p && p->level > cur_level) { if (used) { if (cur_level == 0) - C_DECL_USED (p->decl) = 1; + mark_decl_used (p->decl, p->address); else p->level = cur_level; } @@ -3804,6 +3890,35 @@ pop_maybe_used (bool used) maybe_used_decls = p; } +/* Pop the stack of decls possibly used inside sizeof or typeof or _Countof or + _Generic, without acting on them, and return the pointer to the previous top + of the stack. This for use at the end of a default generic association when + it is not yet known whether the expression is used. If it later turns out + the expression is used (or treated as used before C23), restore_maybe_used + should be called on the return value followed by pop_maybe_used (true); + otherwise, the return value can be discarded. */ + +struct maybe_used_decl * +save_maybe_used () +{ + struct maybe_used_decl *p = maybe_used_decls, *orig = p; + int cur_level = in_sizeof + in_typeof + in_countof + in_generic; + while (p && p->level > cur_level) + p = p->next; + maybe_used_decls = p; + return orig; +} + +/* Restore the stack of decls possibly used inside sizeof or typeof or _Countof + or _Generic returned by save_maybe_used. It is required that the stack is + at exactly the point where it was left by save_maybe_used. */ + +void +restore_maybe_used (struct maybe_used_decl *stack) +{ + maybe_used_decls = stack; +} + /* Return the result of sizeof applied to EXPR. */ struct c_expr @@ -6180,10 +6295,11 @@ lvalue_or_else (location_t loc, const_tree ref, enum lvalue_use use) is for ARRAY_REF construction - in that case we don't want to look through VIEW_CONVERT_EXPR from VECTOR_TYPE to ARRAY_TYPE, it is fine to use ARRAY_REFs for vector subscripts on vector - register variables. */ + register variables. If OVERRIDE_REGISTER, clear DECL_REGISTER rather + than producing an error for taking the address of a register. */ bool -c_mark_addressable (tree exp, bool array_ref_p) +c_mark_addressable (tree exp, bool array_ref_p, bool override_register) { tree x = exp; @@ -6216,8 +6332,13 @@ c_mark_addressable (tree exp, bool array_ref_p) case COMPOUND_LITERAL_EXPR: if (C_DECL_REGISTER (COMPOUND_LITERAL_EXPR_DECL (x))) { - error ("address of register compound literal requested"); - return false; + if (override_register) + DECL_REGISTER (COMPOUND_LITERAL_EXPR_DECL (x)) = 0; + else + { + error ("address of register compound literal requested"); + return false; + } } TREE_ADDRESSABLE (x) = 1; TREE_ADDRESSABLE (COMPOUND_LITERAL_EXPR_DECL (x)) = 1; @@ -6246,6 +6367,13 @@ c_mark_addressable (tree exp, bool array_ref_p) { if (TREE_PUBLIC (x) || is_global_var (x)) error ("address of global register variable %qD requested", x); + else if (override_register && !DECL_HARD_REGISTER (x)) + { + DECL_REGISTER (x) = 0; + TREE_ADDRESSABLE (x) = 1; + mark_decl_used (x, true); + return true; + } else error ("address of register variable %qD requested", x); return false; @@ -6254,6 +6382,7 @@ c_mark_addressable (tree exp, bool array_ref_p) /* FALLTHRU */ case FUNCTION_DECL: TREE_ADDRESSABLE (x) = 1; + mark_decl_used (x, true); /* FALLTHRU */ default: return true; @@ -10026,6 +10155,10 @@ static int constructor_zeroinit; /* 1 if this constructor should have padding bits zeroed (C23 {}. */ static bool constructor_zero_padding_bits; +/* 1 if this constructor is a braced scalar initializer (further nested levels + of braces are an error). */ +static bool constructor_braced_scalar; + /* Structure for managing pending initializer elements, organized as an AVL tree. */ @@ -10097,6 +10230,7 @@ struct constructor_stack char incremental; char designated; bool zero_padding_bits; + bool braced_scalar; int designator_depth; }; @@ -10273,6 +10407,7 @@ really_start_incremental_init (tree type) p->incremental = constructor_incremental; p->designated = constructor_designated; p->zero_padding_bits = constructor_zero_padding_bits; + p->braced_scalar = constructor_braced_scalar; p->designator_depth = designator_depth; p->next = 0; constructor_stack = p; @@ -10288,6 +10423,7 @@ really_start_incremental_init (tree type) constructor_designated = 0; constructor_zero_padding_bits = false; constructor_zeroinit = 1; + constructor_braced_scalar = false; designator_depth = 0; designator_erroneous = 0; @@ -10347,6 +10483,7 @@ really_start_incremental_init (tree type) /* Handle the case of int x = {5}; */ constructor_fields = constructor_type; constructor_unfilled_fields = constructor_type; + constructor_braced_scalar = true; } } @@ -10423,6 +10560,7 @@ push_init_level (location_t loc, int implicit, p->incremental = constructor_incremental; p->designated = constructor_designated; p->zero_padding_bits = constructor_zero_padding_bits; + p->braced_scalar = constructor_braced_scalar; p->designator_depth = designator_depth; p->next = constructor_stack; p->range_stack = 0; @@ -10440,6 +10578,7 @@ push_init_level (location_t loc, int implicit, /* If the upper initializer has padding bits zeroed, that includes all nested initializers as well. */ constructor_zero_padding_bits = p->zero_padding_bits; + constructor_braced_scalar = false; constructor_pending_elts = 0; if (!implicit) { @@ -10558,7 +10697,15 @@ push_init_level (location_t loc, int implicit, else { if (constructor_type != error_mark_node) - warning_init (input_location, 0, "braces around scalar initializer"); + { + if (p->braced_scalar) + permerror_init (input_location, 0, + "braces around scalar initializer"); + else + warning_init (input_location, 0, + "braces around scalar initializer"); + constructor_braced_scalar = true; + } constructor_fields = constructor_type; constructor_unfilled_fields = constructor_type; } @@ -10780,6 +10927,7 @@ pop_init_level (location_t loc, int implicit, constructor_incremental = p->incremental; constructor_designated = p->designated; constructor_zero_padding_bits = p->zero_padding_bits; + constructor_braced_scalar = p->braced_scalar; designator_depth = p->designator_depth; constructor_pending_elts = p->pending_elts; constructor_depth = p->depth; @@ -13015,6 +13163,7 @@ c_finish_goto_label (location_t loc, tree label) if (!decl) return NULL_TREE; TREE_USED (decl) = 1; + mark_decl_used (decl, false); { add_stmt (build_predict_expr (PRED_GOTO, NOT_TAKEN)); tree t = build1 (GOTO_EXPR, void_type_node, decl); @@ -13190,14 +13339,20 @@ c_finish_return (location_t loc, tree retval, tree origtype, bool musttail_p) if (DECL_P (inner) && !DECL_EXTERNAL (inner) - && !TREE_STATIC (inner) && DECL_CONTEXT (inner) == current_function_decl && POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (current_function_decl)))) { if (TREE_CODE (inner) == LABEL_DECL) warning_at (loc, OPT_Wreturn_local_addr, "function returns address of label"); - else + else if (TREE_CODE (inner) == FUNCTION_DECL + && (C_FUNC_NONLOCAL_CONTEXT (inner) + || !DECL_INITIAL (inner))) + warning_at (loc, OPT_Wreturn_local_addr, + "function returns address of nested function " + "referencing local context"); + else if (TREE_CODE (inner) != FUNCTION_DECL + && !TREE_STATIC (inner)) { warning_at (loc, OPT_Wreturn_local_addr, "function returns address of local variable"); diff --git a/gcc/c/gimple-parser.cc b/gcc/c/gimple-parser.cc index 5fd1db874530..d4c5001623e8 100644 --- a/gcc/c/gimple-parser.cc +++ b/gcc/c/gimple-parser.cc @@ -356,28 +356,33 @@ c_parser_parse_gimple_body (c_parser *cparser, char *gimple_pass, update stmts. */ if (cdil == cdil_gimple_ssa) { - /* Create PHI nodes, they are parsed into __PHI internal calls. */ + /* Create PHI nodes, they are parsed into __PHI internal calls + and update SSA operands. */ FOR_EACH_BB_FN (bb, cfun) - for (gimple_stmt_iterator gsi = gsi_start_bb (bb); - !gsi_end_p (gsi);) - { - gimple *stmt = gsi_stmt (gsi); - if (!gimple_call_internal_p (stmt, IFN_PHI)) - break; + { + gimple_stmt_iterator gsi; + for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi);) + { + gimple *stmt = gsi_stmt (gsi); + if (!gimple_call_internal_p (stmt, IFN_PHI)) + break; - gphi *phi = create_phi_node (gimple_call_lhs (stmt), bb); - for (unsigned i = 0; i < gimple_call_num_args (stmt); i += 2) - { - int srcidx = TREE_INT_CST_LOW (gimple_call_arg (stmt, i)); - edge e = find_edge (BASIC_BLOCK_FOR_FN (cfun, srcidx), bb); - if (!e) - c_parser_error (parser, "edge not found"); - else - add_phi_arg (phi, gimple_call_arg (stmt, i + 1), e, - UNKNOWN_LOCATION); - } - gsi_remove (&gsi, true); - } + gphi *phi = create_phi_node (gimple_call_lhs (stmt), bb); + for (unsigned i = 0; i < gimple_call_num_args (stmt); i += 2) + { + int srcidx = TREE_INT_CST_LOW (gimple_call_arg (stmt, i)); + edge e = find_edge (BASIC_BLOCK_FOR_FN (cfun, srcidx), bb); + if (!e) + c_parser_error (parser, "edge not found"); + else + add_phi_arg (phi, gimple_call_arg (stmt, i + 1), e, + UNKNOWN_LOCATION); + } + gsi_remove (&gsi, true); + } + for (; !gsi_end_p (gsi); gsi_next (&gsi)) + update_stmt (gsi_stmt (gsi)); + } /* Fill SSA name gaps, putting them on the freelist and diagnose SSA names without definition. */ for (unsigned i = 1; i < num_ssa_names; ++i) @@ -639,7 +644,8 @@ c_parser_gimple_compound_statement (gimple_parser &parser, gimple_seq *seq) { gimple_stmt_iterator gsi = gsi_start_bb (parser.current_bb); - gsi_insert_seq_after (&gsi, *seq, GSI_CONTINUE_LINKING); + gsi_insert_seq_after_without_update (&gsi, *seq, + GSI_CONTINUE_LINKING); } *seq = NULL; } @@ -735,7 +741,8 @@ c_parser_gimple_compound_statement (gimple_parser &parser, gimple_seq *seq) else { gimple_stmt_iterator gsi = gsi_start_bb (parser.current_bb); - gsi_insert_seq_after (&gsi, *seq, GSI_CONTINUE_LINKING); + gsi_insert_seq_after_without_update (&gsi, *seq, + GSI_CONTINUE_LINKING); } *seq = NULL; } diff --git a/gcc/cfgexpand.cc b/gcc/cfgexpand.cc index 8950294abb60..5c3ba50862e9 100644 --- a/gcc/cfgexpand.cc +++ b/gcc/cfgexpand.cc @@ -90,7 +90,7 @@ along with GCC; see the file COPYING3. If not see struct ssaexpand SA; /* This variable holds the currently expanded gimple statement for purposes - of comminucating the profile info to the builtin expanders. */ + of communicating the profile info to the builtin expanders. */ gimple *currently_expanding_gimple_stmt; static rtx expand_debug_expr (tree); @@ -834,8 +834,8 @@ add_scope_conflicts_2 (vars_ssa_cache &cache, tree name, { gcc_assert (TREE_CODE (name) == SSA_NAME); - /* Querry the cache for the mapping of addresses that are referendd by - ssa name NAME. Querrying it will fill in it. */ + /* Query the cache for the mapping of addresses that are referenced by + ssa name NAME. Querying it will fill in it. */ bitmap_iterator bi; unsigned i; const_bitmap bmap = cache (name); diff --git a/gcc/cfghooks.cc b/gcc/cfghooks.cc index 5f7fc2723745..01169e22fbb9 100644 --- a/gcc/cfghooks.cc +++ b/gcc/cfghooks.cc @@ -817,6 +817,15 @@ merge_blocks (basic_block a, basic_block b) if (!cfg_hooks->merge_blocks) internal_error ("%s does not support merge_blocks", cfg_hooks->name); + /* Pick the more reliable count. If both qualities agrees, pick the larger + one since turning mistakely hot code to cold is more harmful. */ + if (!a->count.initialized_p ()) + a->count = b->count; + else if (a->count.quality () < b->count.quality ()) + a->count = b->count; + else if (a->count.quality () == b->count.quality ()) + a->count = profile_count::max_prefer_initialized (a->count, b->count); + cfg_hooks->merge_blocks (a, b); if (current_loops != NULL) diff --git a/gcc/cfgloopmanip.cc b/gcc/cfgloopmanip.cc index 2c28437b34d9..dda2fb661d8c 100644 --- a/gcc/cfgloopmanip.cc +++ b/gcc/cfgloopmanip.cc @@ -32,6 +32,8 @@ along with GCC; see the file COPYING3. If not see #include "tree-ssa-loop-manip.h" #include "dumpfile.h" #include "sreal.h" +#include "tree-cfg.h" +#include "tree-pass.h" static void copy_loops_to (class loop **, int, class loop *); @@ -1615,7 +1617,15 @@ create_preheader (class loop *loop, int flags) just a single successor and a normal edge. */ if ((flags & CP_SIMPLE_PREHEADERS) && ((single_entry->flags & EDGE_COMPLEX) - || !single_succ_p (single_entry->src))) + || !single_succ_p (single_entry->src) + /* We document LOOPS_HAVE_PREHEADERS as to forming a + natural place to move code outside of the loop, so it + should not end with a control instruction. */ + /* ??? This, and below JUMP_P check needs to be a new + CFG hook. */ + || (cfun->curr_properties & PROP_gimple + && !gsi_end_p (gsi_last_bb (single_entry->src)) + && stmt_ends_bb_p (*gsi_last_bb (single_entry->src))))) need_forwarder_block = true; /* If we want fallthru preheaders, also create forwarder block when preheader ends with a jump or has predecessors from loop. */ diff --git a/gcc/cgraph.cc b/gcc/cgraph.cc index 32071a84bacc..d1b2e2a162c0 100644 --- a/gcc/cgraph.cc +++ b/gcc/cgraph.cc @@ -69,6 +69,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-nested.h" #include "symtab-thunks.h" #include "symtab-clones.h" +#include "attr-callback.h" /* FIXME: Only for PROP_loops, but cgraph shouldn't have to know about this. */ #include "tree-pass.h" @@ -322,6 +323,7 @@ cgraph_node::insert_new_function_version (void) version_info_node = NULL; version_info_node = ggc_cleared_alloc (); version_info_node->this_node = this; + version_info_node->assembler_name = DECL_ASSEMBLER_NAME (this->decl); if (cgraph_fnver_htab == NULL) cgraph_fnver_htab = hash_table::create_ggc (2); @@ -332,8 +334,8 @@ cgraph_node::insert_new_function_version (void) } /* Remove the cgraph_function_version_info node given by DECL_V. */ -static void -delete_function_version (cgraph_function_version_info *decl_v) +void +cgraph_node::delete_function_version (cgraph_function_version_info *decl_v) { if (decl_v == NULL) return; @@ -870,11 +872,22 @@ cgraph_add_edge_to_call_site_hash (cgraph_edge *e) one indirect); always hash the direct one. */ if (e->speculative && e->indirect_unknown_callee) return; + /* We always want to hash the carrying edge of a callback, not the edges + pointing to the callbacks themselves, as their call statement doesn't + exist. */ + if (e->callback) + return; cgraph_edge **slot = e->caller->call_site_hash->find_slot_with_hash (e->call_stmt, cgraph_edge_hasher::hash (e->call_stmt), INSERT); if (*slot) { - gcc_assert (((cgraph_edge *)*slot)->speculative); + cgraph_edge *edge = (cgraph_edge *) *slot; + gcc_assert (edge->speculative || edge->has_callback); + if (edge->has_callback) + /* If the slot is already occupied, then the hashed edge is the + callback-carrying edge, which is desired behavior, so we can safely + return. */ + gcc_checking_assert (edge == e); if (e->callee && (!e->prev_callee || !e->prev_callee->speculative || e->prev_callee->call_stmt != e->call_stmt)) @@ -918,6 +931,13 @@ cgraph_node::get_edge (gimple *call_stmt) n++; } + /* We want to work with the callback-carrying edge whenever possible. When it + comes to callback edges, a call statement might have multiple callback + edges attached to it. These can be easily obtained from the carrying edge + instead. */ + if (e && e->callback) + e = e->get_callback_carrying_edge (); + if (n > 100) { call_site_hash = hash_table::create_ggc (120); @@ -930,15 +950,16 @@ cgraph_node::get_edge (gimple *call_stmt) return e; } - -/* Change field call_stmt of edge E to NEW_STMT. If UPDATE_SPECULATIVE and E +/* Change field call_stmt of edge E to NEW_STMT. If UPDATE_DERIVED_EDGES and E is any component of speculative edge, then update all components. - Speculations can be resolved in the process and EDGE can be removed and - deallocated. Return the edge that now represents the call. */ + speculations can be resolved in the process and edge can be removed and + deallocated. if update_derived_edges and e is a part of a callback pair, + update all associated edges and return their carrying edge. return the edge + that now represents the call. */ cgraph_edge * cgraph_edge::set_call_stmt (cgraph_edge *e, gcall *new_stmt, - bool update_speculative) + bool update_derived_edges) { tree decl; @@ -954,7 +975,7 @@ cgraph_edge::set_call_stmt (cgraph_edge *e, gcall *new_stmt, /* Speculative edges has three component, update all of them when asked to. */ - if (update_speculative && e->speculative + if (update_derived_edges && e->speculative /* If we are about to resolve the speculation by calling make_direct below, do not bother going over all the speculative edges now. */ && !new_direct_callee) @@ -990,6 +1011,27 @@ cgraph_edge::set_call_stmt (cgraph_edge *e, gcall *new_stmt, if (new_direct_callee) e = make_direct (e, new_direct_callee); + /* When updating a callback or a callback-carrying edge, update every edge + involved. */ + if (update_derived_edges && (e->callback || e->has_callback)) + { + cgraph_edge *current, *next, *carrying; + carrying = e->has_callback ? e : e->get_callback_carrying_edge (); + + current = e->first_callback_edge (); + if (current) + { + for (cgraph_edge *d = current; d; d = next) + { + next = d->next_callback_edge (); + cgraph_edge *d2 = set_call_stmt (d, new_stmt, false); + gcc_assert (d2 == d); + } + } + carrying = set_call_stmt (carrying, new_stmt, false); + return carrying; + } + /* Only direct speculative edges go to call_site_hash. */ if (e->caller->call_site_hash && (!e->speculative || !e->indirect_unknown_callee) @@ -1035,7 +1077,7 @@ symbol_table::create_edge (cgraph_node *caller, cgraph_node *callee, construction of call stmt hashtable. */ cgraph_edge *e; gcc_checking_assert (!(e = caller->get_edge (call_stmt)) - || e->speculative); + || e->speculative || e->has_callback || e->callback); gcc_assert (is_gimple_call (call_stmt)); } @@ -1062,6 +1104,9 @@ symbol_table::create_edge (cgraph_node *caller, cgraph_node *callee, edge->indirect_info = NULL; edge->indirect_inlining_edge = 0; edge->speculative = false; + edge->has_callback = false; + edge->callback = false; + edge->callback_id = 0; edge->indirect_unknown_callee = indir_unknown_callee; if (call_stmt && caller->call_site_hash) cgraph_add_edge_to_call_site_hash (edge); @@ -1285,6 +1330,119 @@ cgraph_edge::make_speculative (cgraph_node *n2, profile_count direct_count, return e2; } +/* Create a callback edge calling N2. Callback edges + never get turned into actual calls, they are just used + as clues and allow for optimizing functions which do not + have any callsites during compile time, e.g. functions + passed to standard library functions. + + The edge will be attached to the same call statement as + the callback-carrying edge, which is the instance this method + is called on. + + callback_id is used to pair the returned edge with the attribute that + originated it. + + Return the resulting callback edge. */ + +cgraph_edge * +cgraph_edge::make_callback (cgraph_node *n2, unsigned int callback_id) +{ + cgraph_node *n = caller; + cgraph_edge *e2; + + has_callback = true; + e2 = n->create_edge (n2, call_stmt, count); + if (dump_file) + fprintf ( + dump_file, + "Created callback edge %s -> %s belonging to carrying edge %s -> %s\n", + e2->caller->dump_name (), e2->callee->dump_name (), caller->dump_name (), + callee->dump_name ()); + e2->inline_failed = CIF_CALLBACK_EDGE; + e2->callback = true; + e2->callback_id = callback_id; + if (TREE_NOTHROW (n2->decl)) + e2->can_throw_external = false; + else + e2->can_throw_external = can_throw_external; + e2->lto_stmt_uid = lto_stmt_uid; + n2->mark_address_taken (); + return e2; +} + +/* Returns the callback_carrying edge of a callback edge on which + it is called on or NULL when no such edge can be found. + + An edge is taken to be the callback-carrying if it has it's has_callback + flag set and the edges share their call statements. */ + +cgraph_edge * +cgraph_edge::get_callback_carrying_edge () +{ + gcc_checking_assert (callback); + cgraph_edge *e; + for (e = caller->callees; e; e = e->next_callee) + { + if (e->has_callback && e->call_stmt == call_stmt + && e->lto_stmt_uid == lto_stmt_uid) + break; + } + return e; +} + +/* Returns the first callback edge in the list of callees of the caller node. + Note that the edges might be in arbitrary order. Must be called on a + callback or callback-carrying edge. */ + +cgraph_edge * +cgraph_edge::first_callback_edge () +{ + gcc_checking_assert (has_callback || callback); + cgraph_edge *e = NULL; + for (e = caller->callees; e; e = e->next_callee) + { + if (e->callback && e->call_stmt == call_stmt + && e->lto_stmt_uid == lto_stmt_uid) + break; + } + return e; +} + +/* Given a callback edge, returns the next callback edge belonging to the same + carrying edge. Must be called on a callback edge, not the callback-carrying + edge. */ + +cgraph_edge * +cgraph_edge::next_callback_edge () +{ + gcc_checking_assert (callback); + cgraph_edge *e = NULL; + for (e = next_callee; e; e = e->next_callee) + { + if (e->callback && e->call_stmt == call_stmt + && e->lto_stmt_uid == lto_stmt_uid) + break; + } + return e; +} + +/* When called on a callback-carrying edge, removes all of its attached callback + edges and sets has_callback to FALSE. */ + +void +cgraph_edge::purge_callback_edges () +{ + gcc_checking_assert (has_callback); + cgraph_edge *e, *next; + for (e = first_callback_edge (); e; e = next) + { + next = e->next_callback_edge (); + cgraph_edge::remove (e); + } + has_callback = false; +} + /* Speculative call consists of an indirect edge and one or more direct edge+ref pairs. @@ -1466,13 +1624,11 @@ cgraph_edge::make_direct (cgraph_edge *edge, cgraph_node *callee) /* Compare ref not direct->callee. Direct edge is possibly inlined or redirected. */ if (!direct->speculative_call_target_ref () - ->referred->semantically_equivalent_p (callee)) + ->referred->semantically_equivalent_p (callee) + || found) edge = direct->resolve_speculation (direct, NULL); else - { - gcc_checking_assert (!found); - found = direct; - } + found = direct; } /* On successful speculation just remove the indirect edge and @@ -1522,12 +1678,27 @@ void cgraph_edge::redirect_callee (cgraph_node *n) { bool loc = callee->comdat_local_p (); + cgraph_node *old_callee = callee; + /* Remove from callers list of the current callee. */ remove_callee (); /* Insert to callers list of the new callee. */ set_callee (n); + if (callback) + { + /* When redirecting a callback callee, redirect its ref as well. */ + ipa_ref *old_ref = caller->find_reference (old_callee, call_stmt, + lto_stmt_uid, IPA_REF_ADDR); + gcc_checking_assert(old_ref); + old_ref->remove_reference (); + ipa_ref *new_ref = caller->create_reference (n, IPA_REF_ADDR, call_stmt); + new_ref->lto_stmt_uid = lto_stmt_uid; + if (!old_callee->referred_to_p ()) + old_callee->address_taken = 0; + } + if (!inline_failed) return; if (!loc && n->comdat_local_p ()) @@ -1644,6 +1815,27 @@ cgraph_edge::redirect_call_stmt_to_callee (cgraph_edge *e, || decl == e->callee->decl) return e->call_stmt; + /* When redirecting a callback edge, all we need to do is replace + the original address with the address of the function we are + redirecting to. */ + if (e->callback) + { + cgraph_edge *carrying = e->get_callback_carrying_edge (); + if (!callback_is_special_cased (carrying->callee->decl, e->call_stmt) + && !lookup_attribute (CALLBACK_ATTR_IDENT, + DECL_ATTRIBUTES (carrying->callee->decl))) + /* Callback attribute is removed if the dispatching function changes + signature, as the indices wouldn't be correct anymore. These edges + will get cleaned up later, ignore their redirection for now. */ + return e->call_stmt; + int fn_idx = callback_fetch_fn_position (e, carrying); + tree previous_arg = gimple_call_arg (e->call_stmt, fn_idx); + location_t loc = EXPR_LOCATION (previous_arg); + tree new_addr = build_fold_addr_expr_loc (loc, e->callee->decl); + gimple_call_set_arg (e->call_stmt, fn_idx, new_addr); + return e->call_stmt; + } + if (decl && ipa_saved_clone_sources) { tree *p = ipa_saved_clone_sources->get (e->callee); @@ -1753,7 +1945,9 @@ cgraph_edge::redirect_call_stmt_to_callee (cgraph_edge *e, maybe_remove_unused_call_args (DECL_STRUCT_FUNCTION (e->caller->decl), new_stmt); - e->caller->set_call_stmt_including_clones (e->call_stmt, new_stmt, false); + /* Update callback edges if setting the carrying edge's statement, or else + their pairing would fall apart. */ + e->caller->set_call_stmt_including_clones (e->call_stmt, new_stmt, e->has_callback); if (symtab->dump_file) { @@ -1945,6 +2139,17 @@ cgraph_node::remove_callers (void) for (e = callers; e; e = f) { f = e->next_caller; + /* When removing a callback-carrying edge, remove all its attached edges + as well. */ + if (e->has_callback) + { + cgraph_edge *cbe, *next_cbe = NULL; + for (cbe = e->first_callback_edge (); cbe; cbe = next_cbe) + { + next_cbe = cbe->next_callback_edge (); + cgraph_edge::remove (cbe); + } + } symtab->call_edge_removal_hooks (e); e->remove_caller (); symtab->free_edge (e); @@ -2254,6 +2459,10 @@ cgraph_edge::dump_edge_flags (FILE *f) { if (speculative) fprintf (f, "(speculative) "); + if (callback) + fprintf (f, "(callback) "); + if (has_callback) + fprintf (f, "(has_callback) "); if (!inline_failed) fprintf (f, "(inlined) "); if (call_stmt_cannot_inline_p) @@ -3159,9 +3368,17 @@ cgraph_edge::maybe_hot_p (sreal scale) /* If reliable IPA count is available, just use it. */ profile_count c = count.ipa (); - if (c.reliable_p ()) + if (c.reliable_p () + || (c.quality () == AFDO && c.nonzero_p ())) return maybe_hot_count_p (NULL, c * scale); + /* In auto-FDO, count 0 may lead to hot code in case the + call is simply not called often enough to receive some samples. */ + if ((c.quality () == AFDO + || count.quality () == GUESSED_GLOBAL0_ADJUSTED) + && callee && callee->count.quality () == AFDO) + return maybe_hot_count_p (NULL, c.force_nonzero () * scale); + /* See if we can determine hotness using caller frequency. */ if (caller->frequency == NODE_FREQUENCY_UNLIKELY_EXECUTED || (callee @@ -3859,6 +4076,8 @@ cgraph_node::verify_node (void) if (gimple_has_body_p (e->caller->decl) && !e->caller->inlined_to && !e->speculative + && !e->callback + && !e->has_callback /* Optimized out calls are redirected to __builtin_unreachable. */ && (e->count.nonzero_p () || ! e->callee->decl @@ -4064,7 +4283,12 @@ cgraph_node::verify_node (void) } if (!e->indirect_unknown_callee) { - if (e->verify_corresponds_to_fndecl (decl)) + /* Callback edges violate this assertion + because their call statement doesn't exist, + their associated statement belongs to the + callback-dispatching function. */ + if (!e->callback + && e->verify_corresponds_to_fndecl (decl)) { error ("edge points to wrong declaration:"); debug_tree (e->callee->decl); @@ -4106,7 +4330,58 @@ cgraph_node::verify_node (void) for (e = callees; e; e = e->next_callee) { - if (!e->aux && !e->speculative) + if (!e->callback && e->callback_id) + { + error ("non-callback edge has callback_id set"); + error_found = true; + } + + if (e->callback && e->has_callback) + { + error ("edge has both callback and has_callback set"); + error_found = true; + } + + if (e->callback) + { + if (!e->get_callback_carrying_edge ()) + { + error ("callback edge %s->%s has no callback-carrying", + identifier_to_locale (e->caller->name ()), + identifier_to_locale (e->callee->name ())); + error_found = true; + } + } + + if (e->has_callback + && !callback_is_special_cased (e->callee->decl, e->call_stmt)) + { + int ncallbacks = 0; + int nfound_edges = 0; + for (tree cb = lookup_attribute (CALLBACK_ATTR_IDENT, DECL_ATTRIBUTES ( + e->callee->decl)); + cb; cb = lookup_attribute (CALLBACK_ATTR_IDENT, TREE_CHAIN (cb)), + ncallbacks++) + ; + for (cgraph_edge *cbe = callees; cbe; cbe = cbe->next_callee) + { + if (cbe->callback && cbe->call_stmt == e->call_stmt + && cbe->lto_stmt_uid == e->lto_stmt_uid) + { + nfound_edges++; + } + } + if (ncallbacks < nfound_edges) + { + error ("callback edge %s->%s callback edge count mismatch, " + "expected at most %d, found %d", + identifier_to_locale (e->caller->name ()), + identifier_to_locale (e->callee->name ()), ncallbacks, + nfound_edges); + } + } + + if (!e->aux && !e->speculative && !e->callback && !e->has_callback) { error ("edge %s->%s has no corresponding call_stmt", identifier_to_locale (e->caller->name ()), @@ -4422,6 +4697,25 @@ cgraph_edge::sreal_frequency () : caller->count); } +/* Expected frequency of executions within the function. + If edge is speculative, sum all its indirect targets. */ + +sreal +cgraph_edge::combined_sreal_frequency () +{ + if (!speculative) + return sreal_frequency (); + cgraph_edge *e = this; + if (e->callee) + e = e->speculative_call_indirect_edge (); + sreal sum = e->sreal_frequency (); + for (e = e->first_speculative_call_target (); + e; + e = e->next_speculative_call_target ()) + sum += e->sreal_frequency (); + return sum; +} + /* During LTO stream in this can be used to check whether call can possibly be internal to the current translation unit. */ diff --git a/gcc/cgraph.h b/gcc/cgraph.h index deca564a8e37..069e007ab71c 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -856,6 +856,9 @@ struct GTY((for_user)) cgraph_function_version_info { dispatcher. The dispatcher decl is an alias to the resolver function decl. */ tree dispatcher_resolver; + + /* The assmbly name of the function set before version mangling. */ + tree assembler_name; }; #define DEFCIFCODE(code, type, string) CIF_ ## code, @@ -904,7 +907,9 @@ struct GTY((tag ("SYMTAB_FUNCTION"))) cgraph_node : public symtab_node used_as_abstract_origin (false), lowered (false), process (false), frequency (NODE_FREQUENCY_NORMAL), only_called_at_startup (false), only_called_at_exit (false), - tm_clone (false), dispatcher_function (false), calls_comdat_local (false), + tm_clone (false), dispatcher_function (false), + dispatcher_resolver_function (false), is_target_clone (false), + calls_comdat_local (false), icf_merged (false), nonfreeing_fn (false), merged_comdat (false), merged_extern_inline (false), parallelized_function (false), split_part (false), indirect_call_target (false), local (false), @@ -1347,6 +1352,8 @@ struct GTY((tag ("SYMTAB_FUNCTION"))) cgraph_node : public symtab_node DECL is a duplicate declaration. */ static void delete_function_version_by_decl (tree decl); + static void delete_function_version (cgraph_function_version_info *); + /* Add the function FNDECL to the call graph. Unlike finalize_function, this function is intended to be used by middle end and allows insertion of new function at arbitrary point @@ -1482,6 +1489,12 @@ struct GTY((tag ("SYMTAB_FUNCTION"))) cgraph_node : public symtab_node unsigned tm_clone : 1; /* True if this decl is a dispatcher for function versions. */ unsigned dispatcher_function : 1; + /* True if this decl is a resolver for function versions. */ + unsigned dispatcher_resolver_function : 1; + /* True this is part of a multiversioned set and this version comes from a + target_clone attribute. Or if this is a dispatched symbol or resolver + and the default version comes from a target_clones. */ + unsigned is_target_clone : 1; /* True if this decl calls a COMDAT-local function. This is set up in compute_fn_summary and inline_call. */ unsigned calls_comdat_local : 1; @@ -1725,12 +1738,14 @@ class GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_caller"), /* Remove EDGE from the cgraph. */ static void remove (cgraph_edge *edge); - /* Change field call_stmt of edge E to NEW_STMT. If UPDATE_SPECULATIVE and E - is any component of speculative edge, then update all components. + /* Change field call_stmt of edge E to NEW_STMT. If UPDATE_DERIVED_EDGES and + E is any component of speculative edge, then update all components. Speculations can be resolved in the process and EDGE can be removed and - deallocated. Return the edge that now represents the call. */ + deallocated. Return the edge that now represents the call. If + UPDATE_DERIVED_EDGES and E is a part of a callback edge, update all + associated edges and return the callback-carrying edge. */ static cgraph_edge *set_call_stmt (cgraph_edge *e, gcall *new_stmt, - bool update_speculative = true); + bool update_derived_edges = true); /* Redirect callee of the edge to N. The function does not update underlying call expression. */ @@ -1756,6 +1771,32 @@ class GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_caller"), cgraph_edge *make_speculative (cgraph_node *n2, profile_count direct_count, unsigned int speculative_id = 0); + /* Create a callback edge, representing an indirect call to n2 + passed to a function by argument. Sets has_callback flag of the original + edge. Both edges are attached to the same call statement. Returns created + callback edge. */ + cgraph_edge *make_callback (cgraph_node *n2, unsigned int callback_hash); + + /* Returns the callback-carrying edge of a callback edge or NULL, if such edge + cannot be found. An edge is considered callback-carrying, if it has it's + has_callback flag set and shares it's call statement with the edge + this method is caled on. */ + cgraph_edge *get_callback_carrying_edge (); + + /* Returns the first callback edge in the list of callees of the caller node. + Note that the edges might be in arbitrary order. Must be called on a + callback or callback-carrying edge. */ + cgraph_edge *first_callback_edge (); + + /* Given a callback edge, returns the next callback edge belonging to the same + callback-carrying edge. Must be called on a callback edge, not the + callback-carrying edge. */ + cgraph_edge *next_callback_edge (); + + /* When called on a callback-carrying edge, removes all of its attached + callback edges and sets has_callback to FALSE. */ + void purge_callback_edges (); + /* Speculative call consists of an indirect edge and one or more direct edge+ref pairs. Speculative will expand to the following sequence: @@ -1977,6 +2018,23 @@ class GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_caller"), Optimizers may later redirect direct call to clone, so 1) and 3) do not need to necessarily agree with destination. */ unsigned int speculative : 1; + /* Edges with CALLBACK flag represent indirect calls to functions passed + to their callers by argument. This is useful in cases, where the body + of these caller functions is not known, e. g. qsort in glibc or + GOMP_parallel in libgomp. These edges are never made into real calls, + but are used instead to optimize these callback functions and later replace + their addresses with their optimized versions. Edges with this flag set + share their call statement with their callback-carrying edge. */ + unsigned int callback : 1; + /* Edges with this flag set have one or more callback edges attached. They + share their call statements with this edge. This flag represents the fact + that the callee of this edge takes a function and it's parameters by + argument and calls it at a later time. */ + unsigned int has_callback : 1; + /* Used to pair callback edges and the attributes that originated them + together. Currently the index of the callback argument, retrieved + from the attribute. */ + unsigned int callback_id : 16; /* Set to true when caller is a constructor or destructor of polymorphic type. */ unsigned in_polymorphic_cdtor : 1; @@ -1991,6 +2049,10 @@ class GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_caller"), /* Expected frequency of executions within the function. */ sreal sreal_frequency (); + + /* Expected frequency of executions within the function. + If edge is speculative, sum all its indirect targets. */ + sreal combined_sreal_frequency (); private: /* Unique id of the edge. */ int m_uid; @@ -2644,6 +2706,8 @@ tree clone_function_name (const char *name, const char *suffix, tree clone_function_name (tree decl, const char *suffix, unsigned long number); tree clone_function_name (tree decl, const char *suffix); +tree clone_identifier (tree decl, const char *suffix, + bool filter_suffix = false); void tree_function_versioning (tree, tree, vec *, ipa_param_adjustments *, @@ -3105,6 +3169,13 @@ symbol_table::next_function_with_gimple_body (cgraph_node *node) for ((node) = symtab->first_function (); (node); \ (node) = symtab->next_function ((node))) +/* Walk all functions but precompute so a node can be deleted if needed. */ +#define FOR_EACH_FUNCTION_REMOVABLE(node) \ + cgraph_node *next; \ + for ((node) = symtab->first_function (), \ + next = (node) ? symtab->next_function ((node)) : NULL; (node); \ + (node) = next, next = (node) ? symtab->next_function ((node)) : NULL) + /* Return true when callgraph node is a function with Gimple body defined in current unit. Functions can also be define externally or they can be thunks with no Gimple representation. diff --git a/gcc/cgraphclones.cc b/gcc/cgraphclones.cc index c160e8b6985b..49f0e58fa1ef 100644 --- a/gcc/cgraphclones.cc +++ b/gcc/cgraphclones.cc @@ -144,6 +144,9 @@ cgraph_edge::clone (cgraph_node *n, gcall *call_stmt, unsigned stmt_uid, new_edge->can_throw_external = can_throw_external; new_edge->call_stmt_cannot_inline_p = call_stmt_cannot_inline_p; new_edge->speculative = speculative; + new_edge->callback = callback; + new_edge->has_callback = has_callback; + new_edge->callback_id = callback_id; new_edge->in_polymorphic_cdtor = in_polymorphic_cdtor; /* Update IPA profile. Local profiles need no updating in original. */ @@ -570,6 +573,32 @@ clone_function_name (tree decl, const char *suffix) /* For consistency this needs to behave the same way as ASM_FORMAT_PRIVATE_NAME does, but without the final number suffix. */ + return clone_identifier (identifier, suffix); +} + +/* Return true if symbol is valid in assembler name. */ + +static bool +is_valid_asm_symbol (char c) +{ + if ('a' <= c && c <= 'z') + return true; + if ('A' <= c && c <= 'Z') + return true; + if ('0' <= c && c <= '9') + return true; + if (c == '_') + return true; + return false; +} + +/* Return a new clone of ID ending with the string SUFFIX. + If FILTER_SUFFIX is true, any illegal asm characters in the SUFFIX are + replaced with _. */ + +tree +clone_identifier (tree id, const char *suffix, bool filter_suffix) +{ char *separator = XALLOCAVEC (char, 2); separator[0] = symbol_table::symbol_suffix_separator (); separator[1] = 0; @@ -578,14 +607,32 @@ clone_function_name (tree decl, const char *suffix) #else const char *prefix = ""; #endif - char *result = ACONCAT ((prefix, - IDENTIFIER_POINTER (identifier), - separator, - suffix, - (char*)0)); - return get_identifier (result); -} + if (!suffix) + suffix = ""; + if (!filter_suffix) + { + char *result = ACONCAT ( + (prefix, IDENTIFIER_POINTER (id), separator, suffix, (char *) 0)); + return get_identifier (result); + } + else + { + /* Replace any illegal chars with _. */ + int suffix_len = strlen (suffix); + char *converted_suffix = XALLOCAVEC (char, suffix_len + 1); + for (int i = 0; i < suffix_len; i++) + if (!is_valid_asm_symbol (suffix[i])) + converted_suffix[i] = '_'; + else + converted_suffix[i] = suffix[i]; + converted_suffix[suffix_len] = '\0'; + + char *result = ACONCAT ((prefix, IDENTIFIER_POINTER (id), separator, + converted_suffix, (char *) 0)); + return get_identifier (result); + } +} /* Create callgraph node clone with new declaration. The actual body will be copied later at compilation stage. The name of the new clone will be @@ -990,6 +1037,7 @@ cgraph_node::create_version_clone (tree new_decl, version. */ e->redirect_callee (new_version); } + new_version->calls_comdat_local = new_version->check_calls_comdat_local_p (); dump_callgraph_transformation (this, new_version, suffix); diff --git a/gcc/cgraphunit.cc b/gcc/cgraphunit.cc index 9f4af63b7dc0..a81f685654f8 100644 --- a/gcc/cgraphunit.cc +++ b/gcc/cgraphunit.cc @@ -1264,6 +1264,15 @@ analyze_functions (bool first_time) if (!cnode->analyzed) cnode->analyze (); + /* A reference to a default node in a function set implies a + reference to all versions in the set. */ + cgraph_function_version_info *node_v = cnode->function_version (); + if (node_v && is_function_default_version (node->decl)) + for (cgraph_function_version_info *fvi = node_v->next; + fvi; + fvi = fvi->next) + enqueue_node (fvi->this_node); + for (edge = cnode->callees; edge; edge = edge->next_callee) if (edge->callee->definition && (!DECL_EXTERNAL (edge->callee->decl) diff --git a/gcc/cif-code.def b/gcc/cif-code.def index 8735eafebc5f..a54116f48bc9 100644 --- a/gcc/cif-code.def +++ b/gcc/cif-code.def @@ -142,3 +142,8 @@ DEFCIFCODE(EXTERN_LIVE_ONLY_STATIC, CIF_FINAL_ERROR, /* We proved that the call is unreachable. */ DEFCIFCODE(UNREACHABLE, CIF_FINAL_ERROR, N_("unreachable")) + +/* Callback edges cannot be inlined, as the corresponding call + statement does not exist. */ +DEFCIFCODE(CALLBACK_EDGE, CIF_FINAL_ERROR, + N_("callback edges cannot be inlined")) diff --git a/gcc/cobol/ChangeLog b/gcc/cobol/ChangeLog index 0fc2fc9e9bd4..d2cc68accf7a 100644 --- a/gcc/cobol/ChangeLog +++ b/gcc/cobol/ChangeLog @@ -1,3 +1,224 @@ +2025-10-26 Eric Botcazou + + * Make-lang.in ($(srcdir)/cobol/token_names.h): Silence recipe. + +2025-10-23 Robert Dubner + + * genapi.cc (parser_alphabet): Alphabet encoding. + (parser_alphabet_use): Likewise. + (parser_xml_parse): Use correct debugging macro; encoding. + (parser_xml_on_exception): Likewise. + (parser_xml_not_exception): Likewise. + (parser_xml_end): Likewise. + (initialize_the_data): Encoding. + (parser_label_label): Debugging macros. + (parser_label_goto): Likewise. + (parser_file_add): Encoding. + (parser_intrinsic_call_1): Special handling for __gg__char. + (parser_intrinsic_call_2): Formatting. + * parse.y: Response from FUNCTION ORD is flagged "unsigned". + * symbols.cc (cbl_alphabet_t::reencode): Establish + low_char & high_char. + * symbols.h (struct cbl_alphabet_t): Likewise. + +2025-10-23 Robert Dubner + James K. Lowden + + * Make-lang.in: Incorporate new token_names.h file. + * cdf.y: Modify tokens. + * gcobol.1: Document XML PARSE statement + * genapi.cc (parser_enter_program): Verify that every goto has a + matching label. + (parser_end_program): Likewise. + (parser_alphabet): Refine handling codeset encodings. + (parser_alphabet_use): Likewise. + (label_fetch): Moved from later in the source code. + (parser_xml_parse): New routine for XML PARSE. + (parser_xml_on_exception): Likewise. + (parser_xml_not_exception): Likewise. + (parser_xml_end): Likewise. + (parser_label_label): Verify goto/label matching. + (parser_label_goto): Likewise. + (parser_entry): Minor change to SHOW_PARSE report. + * genapi.h (parser_alphabet): Set parameter to const. + (parser_xml_parse): Declare new function. + (parser_xml_on_exception): Likewise. + (parser_xml_not_exception): Likewise. + (parser_xml_end): Likewise. + (parser_label_addr): Likewise. + * parse.y: label_pair_t structure; locale processing; new token + processing for alphabets and XML PARSE. + * parse_ante.h (name_of): Return field->name when initial is NULL. + (new_tempnumeric): Make signable_e optional. + (ast_save_locale): New function. + (data_division_ready): Warning for "no alphabet". + * scan.l: Repair interpretation of BINARY, COMP, COMP-4, and + COMP-5. + * scan_ante.h (struct bint_t): Likewise. + * scan_post.h (current_tokens_t::tokenset_t::tokenset_t): + Include token_names.h. + * symbols.cc (symbols_alphabet_set): Revert to prior alphabet + determination. + (symbol_table_init): New XML special registers. + (new_temporary): Make signable_e controllable, not fixed. + * symbols.h (__gg__encoding_iconv_valid): New declaration. + (enum cbl_label_type_t): New LblXml label type. + (struct cbl_xml_parse_t): + (struct cbl_label_t): Implement XML PARSE. + (new_temporary): Incorporate boolean for signable_e. + (symbol_elem_of): Change label field type handling. + (cbl_section_of): Likewise. + (cbl_field_of): Likewise. + (cbl_label_of): Likewise. + (cbl_special_name_of): Likewise. + (cbl_alphabet_of): Likewise. + (cbl_file_of): Likewise. + * token_names.h: New file. + * util.cc (gcc_location_set_impl): Improve location_t calculations + when entering and leaving COPYBOOKs. + +2025-10-19 Robert Dubner + + * genapi.cc (move_tree): Formatting. + (parser_enter_file): Incorporate global __gg__entry_label. + (enter_program_common): Remove calls to alphabet overrides. + (parser_alphabet): Change cbl_alphabet_e handling. + (parser_alphabet_use): Likewise. + (initialize_the_data): Likewise. + (establish_using): Process passed parameters in a subroutine. + (parser_division): Remove in-line parameter processing; + call establish_using() instead. Check for __gg__entry_label. + (parser_file_add): Temporary workaround for charset encoding. + (parser_file_open): Likewise. + (create_and_call): Push/pop program state around call to external. + (parser_entry): Implement new ENTRY statement feature. + (mh_source_is_literalN): Formatting. + * genapi.h (parser_entry): New ENTRY statement. + * gengen.cc (gg_create_goto_pair): Formatting. + (gg_goto_label_decl): Remove. + * gengen.h (gg_goto_label_decl): Remove. + * genutil.cc (internal_codeset_is_ebcdic): Remove. + * genutil.h (internal_codeset_is_ebcdic): Remove. + * symbols.cc (symbols_alphabet_set): Restrict alphabet scan to + program. + * symbols.h (is_elementary): Use defined constants instead of + explicit 'A'and 'N' + +2025-10-10 Robert Dubner + + * cdf.y: In support of the described changes. + * gcobol.1: Likewise. + * genapi.cc (level_88_helper): Likewise. + (get_level_88_domain): Likewise. + (get_class_condition_string): Likewise. + (initialize_variable_internal): Likewise. + (gg_default_qualification): Likewise. + (cobol_compare): Likewise. + (move_tree): Likewise. + (move_tree_to_field): Likewise. + (psa_FldBlob): Likewise. + (parser_accept_date_yymmdd): Likewise. + (parser_accept_date_yyyymmdd): Likewise. + (parser_accept_date_yyddd): Likewise. + (parser_accept_date_yyyyddd): Likewise. + (parser_accept_date_dow): Likewise. + (parser_accept_date_hhmmssff): Likewise. + (parser_alphabet): Likewise. + (parser_alphabet_use): Likewise. + (parser_display_internal): Likewise. + (parser_display): Likewise. + (is_valuable): Likewise. + (parser_division): Likewise. + (parser_relop_long): Likewise. + (parser_setop): Likewise. + (parser_set_conditional88): Likewise. + (parser_file_add): Likewise. + (parser_file_open): Likewise. + (create_and_call): Likewise. + (parser_call): Likewise. + (mh_identical): Likewise. + (mh_source_is_literalN): Likewise. + (picky_memcpy): Likewise. + (mh_numeric_display): Likewise. + (mh_source_is_group): Likewise. + (mh_source_is_literalA): Likewise. + (move_helper): Likewise. + (initial_from_initial): Likewise. + (actually_create_the_static_field): Likewise. + (psa_FldLiteralA): Likewise. + (parser_symbol_add): Likewise. + * genmath.cc (arithmetic_operation): Likewise. + * genutil.cc (get_binary_value): Likewise. + (get_literal_string): Likewise. + * genutil.h (EBCDIC_MINUS): Likewise. + (EBCDIC_PLUS): Likewise. + (EBCDIC_ZERO): Likewise. + (EBCDIC_NINE): Likewise. + * parse.y: Likewise. + * parse_ante.h (name_of): Likewise. + (class prog_descr_t): Likewise. + (current_encoding): Likewise. + (needs_picture): Likewise. + (is_callable): Likewise. + (field_attr_str): Likewise. + (value_encoding_check): Likewise. + (field_alloc): Likewise. + (file_add): Likewise. + * scan.l: Likewise. + * structs.cc (create_cblc_field_t): Likewise. + * symbols.cc (elementize): Likewise. + (cbl_field_attr_str): Likewise. + (is_variable_length): Likewise. + (field_str): Likewise. + (extend_66_capacity): Likewise. + (assert): Likewise. + (symbols_update): Likewise. + (symbol_field_parent_set): Likewise. + (add_token): Likewise. + (symbol_table_init): Likewise. + (symbol_field_add): Likewise. + (symbol_field_forward_add): Likewise. + (symbol_field_same_as): Likewise. + (cbl_alphabet_t::reencode): Likewise. + (new_temporary_impl): Likewise. + (parser_symbol_add2): Likewise. + (new_literal_add): Likewise. + (temporaries_t::literal): Likewise. + (new_literal): Likewise. + (standard_internal): Likewise. + (new_temporary): Likewise. + (cbl_field_t::holds_ascii): Likewise. + (cbl_field_t::is_ascii): Likewise. + (cbl_field_t::internalize): Likewise. + (symbol_label_add): Likewise. + (symbol_label_section_exists): Likewise. + (cbl_occurs_t::subscript_ok): Likewise. + (cbl_file_t::deforward): Likewise. + (has_value): Likewise. + * symbols.h (is_numeric): Likewise. + (__gg__encoding_iconv_name): Likewise. + (current_encoding): Likewise. + (struct cbl_field_t): Likewise. + (new_literal): Likewise. + (class temporaries_t): Likewise. + (struct function_descr_t): Likewise. + (hex_decode): Likewise. + (struct cbl_alphabet_t): Likewise. + (struct cbl_file_t): Likewise. + * symfind.cc (field_structure): Likewise. + (erase_symbol_map_fwds): Likewise. + (symbol_find): Likewise. + * token_names.h: Likewise. + * util.cc (cbl_field_type_str): Likewise. + (is_elementary): Likewise. + (symbol_field_type_update): Likewise. + (cbl_field_t::report_invalid_initial_value): Likewise. + (valid_move): Likewise. + (valid_picture): Likewise. + (type_capacity): Likewise. + (gcc_location_set_impl): Likewise. + (cbl_unimplementedw): Likewise. + 2025-09-05 Robert Dubner * genapi.cc (trace1_init): Prepend two internal variables with diff --git a/gcc/cobol/Make-lang.in b/gcc/cobol/Make-lang.in index 0e2a773d4dfb..ed6b588fe729 100644 --- a/gcc/cobol/Make-lang.in +++ b/gcc/cobol/Make-lang.in @@ -225,6 +225,7 @@ cobol/scan.o: cobol/scan.cc \ $(srcdir)/cobol/scan_post.h \ $(srcdir)/cobol/symbols.h \ $(srcdir)/cobol/util.h \ + $(srcdir)/cobol/token_names.h \ $(srcdir)/hwint.h \ $(srcdir)/system.h \ $(srcdir)/../include/ansidecl.h \ @@ -241,6 +242,15 @@ cobol/scan.o: cobol/scan.cc \ cobol/cdf.cc \ cobol/parse.cc +# Update token names if the generator script is installed +# (by a developer) and there's been a change. +$(srcdir)/cobol/token_names.h: cobol/parse.cc + @if [ -f $@.gen ]; then \ + $@.gen $(subst .cc,.h,$^) \ + | diff -u $@ - \ + | patch -t --set-time $@ ; \ + fi + # # The src targets are executed if # ‘--enable-generated-files-in-srcdir’ was specified as a configure diff --git a/gcc/cobol/cdf.y b/gcc/cobol/cdf.y index 53fea5d894ce..f72ed77c9641 100644 --- a/gcc/cobol/cdf.y +++ b/gcc/cobol/cdf.y @@ -198,7 +198,7 @@ apply_cdf_turn( const exception_turn_t& turn ) { %type namelit name_any name_one %type name subscript subscripts inof %token BOOL -%token FEATURE 365 NUMBER 303 EXCEPTION_NAME 280 "EXCEPTION NAME" +%token FEATURE 366 NUMBER 303 EXCEPTION_NAME 280 "EXCEPTION NAME" %type cdf_expr %type cdf_relexpr cdf_reloper cdf_and cdf_bool_expr @@ -210,55 +210,55 @@ apply_cdf_turn( const exception_turn_t& turn ) { %type cdf_stackable -%token BY 486 -%token COPY 362 -%token CDF_DISPLAY 384 ">>DISPLAY" -%token IN 605 +%token BY 487 +%token COPY 363 +%token CDF_DISPLAY 385 ">>DISPLAY" +%token IN 606 %token NAME 286 %token NUMSTR 305 "numeric literal" -%token OF 686 -%token PSEUDOTEXT 721 -%token REPLACING 743 +%token OF 687 +%token PSEUDOTEXT 723 +%token REPLACING 745 %token LITERAL 298 -%token SUPPRESS 376 - -%token LSUB 367 "(" -%token SUBSCRIPT 375 RSUB 372 ")" - -%token CDF_DEFINE 383 ">>DEFINE" -%token CDF_IF 385 ">>IF" -%token CDF_ELSE 386 ">>ELSE" -%token CDF_END_IF 387 ">>END-IF" -%token CDF_EVALUATE 388 ">>EVALUATE" -%token CDF_WHEN 389 ">>WHEN" -%token CDF_END_EVALUATE 390 ">>END-EVALUATE" - -%token ALL 450 -%token CALL_CONVENTION 391 ">>CALL-CONVENTION" -%token COBOL_WORDS 380 ">>COBOL-WORDS" -%token CDF_PUSH 394 ">>PUSH" -%token CDF_POP 395 ">>POP" -%token SOURCE_FORMAT 396 ">>SOURCE FORMAT" - -%token AS 468 CONSTANT 361 DEFINED 363 +%token SUPPRESS 377 + +%token LSUB 368 "(" +%token SUBSCRIPT 376 RSUB 373 ")" + +%token CDF_DEFINE 384 ">>DEFINE" +%token CDF_IF 386 ">>IF" +%token CDF_ELSE 387 ">>ELSE" +%token CDF_END_IF 388 ">>END-IF" +%token CDF_EVALUATE 389 ">>EVALUATE" +%token CDF_WHEN 390 ">>WHEN" +%token CDF_END_EVALUATE 391 ">>END-EVALUATE" + +%token ALL 451 +%token CALL_CONVENTION 392 ">>CALL-CONVENTION" +%token COBOL_WORDS 381 ">>COBOL-WORDS" +%token CDF_PUSH 395 ">>PUSH" +%token CDF_POP 396 ">>POP" +%token SOURCE_FORMAT 397 ">>SOURCE FORMAT" + +%token AS 469 CONSTANT 362 DEFINED 364 %type DEFINED -%token OTHER 698 PARAMETER_kw 368 "PARAMETER" -%token OFF 687 OVERRIDE 369 -%token THRU 939 -%token TRUE_kw 813 "True" +%token OTHER 699 PARAMETER_kw 369 "PARAMETER" +%token OFF 688 OVERRIDE 370 +%token THRU 949 +%token TRUE_kw 814 "True" -%token CALL_COBOL 392 "CALL" -%token CALL_VERBATIM 393 "CALL (as C)" +%token CALL_COBOL 393 "CALL" +%token CALL_VERBATIM 394 "CALL (as C)" -%token TURN 815 CHECKING 496 LOCATION 649 ON 689 WITH 841 +%token TURN 816 CHECKING 497 LOCATION 650 ON 690 WITH 843 -%left OR 940 -%left AND 941 -%right NOT 942 -%left '<' '>' '=' NE 943 LE 944 GE 945 +%left OR 950 +%left AND 951 +%right NOT 952 +%left '<' '>' '=' NE 953 LE 954 GE 955 %left '-' '+' %left '*' '/' -%right NEG 947 +%right NEG 957 %define api.prefix {ydf} %define api.token.prefix{YDF_} diff --git a/gcc/cobol/gcobol.1 b/gcc/cobol/gcobol.1 index ebb833c793bd..0de86dff623f 100644 --- a/gcc/cobol/gcobol.1 +++ b/gcc/cobol/gcobol.1 @@ -778,6 +778,30 @@ resolution of .Ar filename is deferred until runtime, when the name must appear in the program's environment. +.Ss XML PARSE +.Nm +emulates the IBM +.Sy "XML PARSE" +statement. The following values for +.Sy XML-EVENT +are defined: +.Bl -tag -compact +.It Sy COMMENT +Text of a comment between "" +.It Sy CONTENT-CHARACTERS +Some or all of the character content of the element between start and end tags. +.It Sy END-OF-ELEMENT +End-element tag, with name if present in the input. +.It Sy PROCESSING-INSTRUCTION-DATA +Processing instruction (after the target name), excluding "?>". +.It Sy PROCESSING-INSTRUCTION-TARGET +The processing instruction target name appears in +.Sy XML-TEXT +or +.Sy XML-NTEXT . +.It Sy START-OF-ELEMENT +Name of the start element tag or empty element tag. +.El . .Sh ISO \*[lang] Implementation Status .Ss USAGE Data Types @@ -1417,6 +1441,15 @@ it may contain several directory names separated by a colon .Ev COBPATH is searched first, followed by .Ev LD_LIBRARY_PATH . +Note that +.Ev COBPATH does not change where the runtime linker looks for +.Pa libgcobol.so +itself. +How the runtime linker searches for +.Pa libgcobol.so +when the executable loads is controlled by +.Xr ld.so 8 , +not libgcobol. .Pp Each directory is searched for files whose name ends in .Ql ".so" . @@ -1471,6 +1504,18 @@ error. This feature is meant to help diagnose mysterious copybook errors. .El . +.Ss Variables for Developers +.Bl -tag -compact +.It Ev GCOBOL_SHOW +produces a trace of the internal calls made by the parser to prepare +the GENERIC tree. +.It Ev GCOBOL_TRACE +used at compile time, produces an executable that traces the +execution, mapping it back the same code-creation functions as +.Ev GCOBOL_SHOW , +as well as the values of data items and branch conditions. +.El +. .Sh FILES Executables produced by .Nm diff --git a/gcc/cobol/genapi.cc b/gcc/cobol/genapi.cc index 11242c19285d..9d30dde96ebc 100644 --- a/gcc/cobol/genapi.cc +++ b/gcc/cobol/genapi.cc @@ -366,7 +366,8 @@ static char * level_88_helper(size_t parent_capacity, const cbl_domain_elem_t &elem, - size_t &returned_size) + size_t &returned_size, + cbl_encoding_t encoding) { // We return a MALLOCed return value, which the caller must free. char *retval = static_cast(xmalloc(parent_capacity + 64)); @@ -419,11 +420,20 @@ level_88_helper(size_t parent_capacity, memcpy(first_name, elem.name(), first_name_length); first_name[first_name_length] = '\0'; - // Convert it to EBCDIC, when necessary; leave it alone when not necessary. - for(size_t i=0; imapped_character(first_name[i]); } + ///////////////// end of conversion if( parent_capacity == 0 ) { @@ -505,7 +515,10 @@ get_level_88_domain(size_t parent_capacity, cbl_field_t *var, size_t &returned_s char *stream; // Do the first element of the domain - stream = level_88_helper(parent_capacity, domain->first, stream_len); + stream = level_88_helper( parent_capacity, + domain->first, + stream_len, + var->codeset.encoding); if( output_index + stream_len > retval_capacity ) { retval_capacity *= 2; @@ -518,7 +531,10 @@ get_level_88_domain(size_t parent_capacity, cbl_field_t *var, size_t &returned_s free(stream); // Do the second element of the domain - stream = level_88_helper(parent_capacity, domain->last, stream_len); + stream = level_88_helper( parent_capacity, + domain->last, + stream_len, + var->codeset.encoding); if( output_index + stream_len > retval_capacity ) { retval_capacity *= 2; @@ -591,15 +607,9 @@ get_class_condition_string(cbl_field_t *var) uint8_t value1; uint8_t value2; - char achFirstName[256]; - char achLastName[256]; - size_t first_name_length = domain->first.size() ? domain->first.size() : strlen(domain->first.name()); - size_t last_name_length = domain->last.size() - ? domain->last.size() - : strlen(domain->last.name()); if( domain->first.is_numeric ) { @@ -629,21 +639,11 @@ get_class_condition_string(cbl_field_t *var) { // Since the first.name is a single character, we can do this as // a single-character pair. - uint8_t ch1; uint8_t ch2; - char *p2; - size_t one; - p2 = achFirstName; - one = 8; - raw_to_internal(&p2, &one, domain->last.name(), last_name_length); - ch2 = achFirstName[0]; - - p2 = achLastName; - one = 8; - raw_to_internal(&p2, &one, domain->first.name(), first_name_length); - ch1 = achLastName[0]; + ch2 = domain->last.name()[0]; + ch1 = domain->first.name()[0]; if( ch1 < ch2 ) { @@ -670,15 +670,12 @@ get_class_condition_string(cbl_field_t *var) // We are working with a string larger than 1 character. The COBOL // spec says there can't be a THROUGH, so we ignore the last.name: - char *p2; - size_t one; - p2 = achFirstName; - one = 8; - raw_to_internal(&p2, &one, domain->last.name(), last_name_length); - + // size_t first_name_length = domain->first.size() + // ? domain->first.size() + // : strlen(domain->first.name()); for(size_t i=0; ifirst.name()[i]); } } domain += 1; @@ -1232,11 +1229,6 @@ initialize_variable_internal( cbl_refer_t refer, return; } - if( parsed_var->type == FldBlob ) - { - return; - } - Analyze(); SHOW_PARSE { @@ -1663,12 +1655,6 @@ gg_attribute_bit_set(struct cbl_field_t *var, cbl_field_attr_t bits) } #pragma GCC diagnostic pop -static void -gg_default_qualification(struct cbl_field_t * /*var*/) - { -// gg_attribute_bit_clear(var, refmod_e); - } - static void depending_on_value(tree depending_on, cbl_field_t *current_sizer) @@ -2259,21 +2245,27 @@ cobol_compare( tree return_int, case FldLiteralA: { // Comparing a FldLiteralN to an alphanumeric - // It is the case that data.initial is in the original form seen - // in the source code, which means that even in EBCDIC mode the - // characters are in the "ASCII" state. - static size_t buffer_size = 0; - static char *buffer = NULL; - raw_to_internal(&buffer, - &buffer_size, - lefty->field->data.initial, - strlen(lefty->field->data.initial)); + // CONVERSION ALERT. lefty->field->data.initial is an ASCII + // string. We want to convert it to the same encoding as the + // right side. + + cbl_encoding_t enc_left = DEFAULT_CHARMAP_SOURCE; + cbl_encoding_t enc_right = + static_cast(righty->field->codeset.encoding); + + size_t outlength; + char *converted = __gg__iconverter(enc_left, + enc_right, + lefty->field->data.initial, + strlen(lefty->field->data.initial)+1, + &outlength ); gg_assign( return_int, gg_call_expr( INT, "__gg__literaln_alpha_compare", - gg_string_literal(buffer), + build_string_literal(strlen(lefty->field->data.initial)+1, + converted), gg_get_address_of(righty->field->var_decl_node), refer_offset(*righty), refer_size_source( *righty), @@ -2364,9 +2356,12 @@ cobol_compare( tree return_int, static void move_tree( cbl_field_t *dest, tree offset, - tree psz_source, - tree length_bump=integer_zero_node) // psz_source is a null-terminated string + tree psz_source, // psz_source is a null-terminated string + tree length_bump=integer_zero_node) { + // This routine assumes that the psz_source is in the same codeset as the + // dest. + Analyze(); SHOW_PARSE { @@ -2411,15 +2406,20 @@ move_tree( cbl_field_t *dest, { case FldGroup: case FldAlphanumeric: + { // Space out the alphanumeric destination: + charmap_t *charmap = __gg__get_charmap(dest->codeset.encoding); + gg_memset( location, - build_int_cst_type(INT, internal_space), + build_int_cst_type(INT, + charmap->mapped_character(ascii_space)), length ); // Copy the alphanumeric result over. gg_memcpy( location, psz_source, min_length ); break; + } case FldNumericDisplay: case FldNumericEdited: @@ -2433,8 +2433,9 @@ move_tree( cbl_field_t *dest, gg_assign(value, gg_call_expr( INT128, - "__gg__dirty_to_binary_internal", + "__gg__dirty_to_binary", psz_source, + build_int_cst_type(INT, dest->codeset.encoding), source_length, gg_get_address_of(rdigits), NULL_TREE)); @@ -2455,8 +2456,9 @@ move_tree( cbl_field_t *dest, case FldAlphaEdited: { gg_call(VOID, - "__gg__string_to_alpha_edited_ascii", + "__gg__string_to_alpha_edited", location, + build_int_cst_type(INT, DEFAULT_CHARMAP_SOURCE), psz_source, min_length, member(dest->var_decl_node, "picture"), @@ -2493,6 +2495,7 @@ move_tree( cbl_field_t *dest, static void move_tree_to_field(cbl_field_t *field, tree psz) { + // psz has to be in the same encoding as field move_tree(field, integer_zero_node, psz); } @@ -3771,6 +3774,7 @@ parser_enter_file(const char *filename) SET_VAR_DECL(var_decl_treeplet_4s , SIZE_T_P , "__gg__treeplet_4s" ); SET_VAR_DECL(var_decl_nop , INT , "__gg__nop" ); SET_VAR_DECL(var_decl_main_called , INT , "__gg__main_called" ); + SET_VAR_DECL(var_decl_entry_label , VOID_P , "__gg__entry_label" ); } } @@ -3862,25 +3866,6 @@ enter_program_common(const char *funcname, const char *funcname_) current_function->current_section = NULL; current_function->current_paragraph = NULL; - // Text conversion must be initialized before the code generated by - // parser_symbol_add runs. - - // The text_conversion_override exists both in the library and in the compiler - - __gg__set_internal_codeset(internal_codeset_is_ebcdic()); - gg_call(VOID, - "__gg__set_internal_codeset", - internal_codeset_is_ebcdic() - ? integer_one_node : integer_zero_node, - NULL_TREE); - - __gg__text_conversion_override(td_default_e, cs_default_e); - gg_call(VOID, - "__gg__text_conversion_override", - build_int_cst_type(INT, td_default_e), - build_int_cst_type(INT, cs_default_e), - NULL_TREE); - gg_call(VOID, "__gg__codeset_figurative_constants", NULL_TREE); @@ -4003,6 +3988,37 @@ parser_enter_program( const char *funcname_, free(funcname); } +static class label_verify_t { + std::set lain, dangling; + static inline size_t index_of( const cbl_label_t *label ) { + return symbol_index(symbol_elem_of(label)); + } +public: + void go_to( const cbl_label_t *label ) { + auto p = lain.find(index_of(label)); + if( p == lain.end() ) { + dangling.insert(index_of(label)); + } + } + bool lay( const cbl_label_t *label ) { + auto ok = lain.insert(index_of(label)); + if( ok.second ) { + dangling.erase(index_of(label)); + } + return true; + } + bool vet() const { // be always agreeable, for now. + return dangling.empty(); + } + void dump() const { + fprintf(stderr, "%u nonexistent labels called\n", unsigned(dangling.size()) ); + for( auto sym : dangling ) { + const cbl_label_t *label = cbl_label_of(symbol_at(sym)); + fprintf(stderr, "\t %s\n", label->name); + } + } +} label_verify; + void parser_end_program(const char *prog_name ) { @@ -4029,6 +4045,13 @@ parser_end_program(const char *prog_name ) TRACE1_END } + if( ! label_verify.vet() ) + { + label_verify.dump(); + gcc_unreachable(); + } + + if( gg_trans_unit.function_stack.size() ) { // The body has been created by various parser calls. It's time @@ -4341,55 +4364,6 @@ psa_FldLiteralN(struct cbl_field_t *field ) // wi::to_wide( DECL_INITIAL(new_var_decl) ) } -static void -psa_FldBlob(struct cbl_field_t *var ) - { - Analyze(); - SHOW_PARSE - { - SHOW_PARSE_HEADER - SHOW_PARSE_FIELD(" ", var) - SHOW_PARSE_END - } - - CHECK_FIELD(var); - - // We are constructing a completely static constant structure. We know the - // capacity. We'll create it from the data.initial. The var_decl_node will - // be a pointer to the data - - char base_name[257]; - char id_string[32] = ""; - - static size_t our_index = 0; - - sprintf(id_string, "." HOST_SIZE_T_PRINT_DEC, (fmt_size_t)++our_index); - strcpy(base_name, var->name); - strcat(base_name, id_string); - - // Build the constructor for the array of bytes - - tree array_type = build_array_type_nelts(UCHAR, var->data.capacity); - tree array_constructor = make_node(CONSTRUCTOR); - TREE_TYPE(array_constructor) = array_type; - TREE_STATIC(array_constructor) = 1; - TREE_CONSTANT(array_constructor) = 1; - - for(size_t i=0; idata.capacity; i++) - { - CONSTRUCTOR_APPEND_ELT( CONSTRUCTOR_ELTS(array_constructor), - build_int_cst_type(INT, i), - build_int_cst_type(UCHAR, var->data.initial[i])); - } - - // The array constructor is ready to be used - tree var_decl_node = gg_define_variable( array_type, - base_name, - vs_static); - DECL_INITIAL(var_decl_node) = array_constructor; - var->var_decl_node = gg_get_address_of(var_decl_node); - } - void parser_accept(const struct cbl_refer_t &tgt, special_name_t special_e, @@ -4923,8 +4897,8 @@ parser_accept_date_yymmdd( struct cbl_field_t *target ) tree pointer = gg_define_char_star(); gg_assign(pointer, gg_call_expr(CHAR_P, "__gg__get_date_yymmdd", + gg_get_address_of(target->var_decl_node), NULL_TREE)); - gg_default_qualification(target); move_tree_to_field( target, pointer); @@ -4953,8 +4927,8 @@ parser_accept_date_yyyymmdd( struct cbl_field_t *target ) tree pointer = gg_define_char_star(); gg_assign(pointer, gg_call_expr(CHAR_P, "__gg__get_date_yyyymmdd", + gg_get_address_of(target->var_decl_node), NULL_TREE)); - gg_default_qualification(target); move_tree_to_field( target, pointer); @@ -4983,8 +4957,8 @@ parser_accept_date_yyddd( struct cbl_field_t *target ) tree pointer = gg_define_char_star(); gg_assign(pointer, gg_call_expr(CHAR_P, "__gg__get_date_yyddd", + gg_get_address_of(target->var_decl_node), NULL_TREE)); - gg_default_qualification(target); move_tree_to_field( target, pointer); @@ -5013,8 +4987,8 @@ parser_accept_date_yyyyddd( struct cbl_field_t *target ) tree pointer = gg_define_char_star(); gg_assign(pointer, gg_call_expr(CHAR_P, "__gg__get_yyyyddd", + gg_get_address_of(target->var_decl_node), NULL_TREE)); - gg_default_qualification(target); move_tree_to_field( target, pointer); @@ -5043,8 +5017,8 @@ parser_accept_date_dow( struct cbl_field_t *target ) tree pointer = gg_define_char_star(); gg_assign(pointer, gg_call_expr(CHAR_P, "__gg__get_date_dow", + gg_get_address_of(target->var_decl_node), NULL_TREE)); - gg_default_qualification(target); move_tree_to_field( target, pointer); @@ -5073,8 +5047,8 @@ parser_accept_date_hhmmssff( struct cbl_field_t *target ) tree pointer = gg_define_char_star(); gg_assign(pointer, gg_call_expr(CHAR_P, "__gg__get_date_hhmmssff", + gg_get_address_of(target->var_decl_node), NULL_TREE)); - gg_default_qualification(target); move_tree_to_field( target, pointer); @@ -5097,43 +5071,62 @@ parser_accept_date_hhmmssff( struct cbl_field_t *target ) * * The parameter is always a reference to an element in the symbol table. */ + void -parser_alphabet( cbl_alphabet_t& alphabet ) +parser_alphabet( const cbl_alphabet_t& alphabet ) { Analyze(); SHOW_PARSE { SHOW_PARSE_HEADER - fprintf(stderr, "%s\n", alphabet.name); + char *psz = xasprintf(" %s ", alphabet.name); + SHOW_PARSE_TEXT(psz); + free(psz); switch(alphabet.encoding) { + case iconv_CP1252_e: + psz = xasprintf("CP1252"); + break; case ASCII_e: - fprintf(stderr, "ASCII\n"); + psz = xasprintf("ASCII"); break; case iso646_e: - fprintf(stderr, "ISO646\n"); + psz = xasprintf("ISO646"); break; case EBCDIC_e: - fprintf(stderr, "EBCDIC\n"); + psz = xasprintf("EBCDIC"); + break; + case UTF8_e: + psz = xasprintf("UTF8"); break; case custom_encoding_e: - fprintf(stderr, "%s\n", alphabet.name); + psz = xasprintf("%s", alphabet.name); break; + default: + { const char * p = __gg__encoding_iconv_name( alphabet.encoding ); + psz = xasprintf("%s", p? p : "[unknown]"); + } } + SHOW_PARSE_TEXT(" "); + SHOW_PARSE_TEXT(psz); + free(psz); SHOW_PARSE_END } - size_t alphabet_index = symbol_index(symbol_elem_of(&alphabet)); - switch(alphabet.encoding) { + case iconv_CP1252_e: case ASCII_e: case iso646_e: case EBCDIC_e: + case UTF8_e: break; case custom_encoding_e: { +#pragma message "Use program-id to disambiguate" + size_t alphabet_index = symbol_index(symbol_elem_of(&alphabet)); + unsigned char ach[256]; tree table_type = build_array_type_nelts(UCHAR, 256); @@ -5141,27 +5134,35 @@ parser_alphabet( cbl_alphabet_t& alphabet ) for( int i=0; i<256; i++ ) { // character i has the ordinal alphabet[i] - unsigned char ch = ascii_to_internal(i); + unsigned char ch = i; ach[ch] = (alphabet.alphabet[i]); gg_assign( gg_array_value(table256, ch), build_int_cst_type(UCHAR, (alphabet.alphabet[i])) ); } + + unsigned int low_char = alphabet.low_char; + unsigned int high_char = alphabet.high_char; __gg__alphabet_create(alphabet.encoding, alphabet_index, ach, - alphabet.low_index, - alphabet.high_index); + low_char, + high_char); gg_call(VOID, "__gg__alphabet_create", build_int_cst_type(INT, alphabet.encoding), build_int_cst_type(SIZE_T, alphabet_index), gg_get_address_of(table256), - build_int_cst_type(INT, alphabet.low_index), - build_int_cst_type(INT, alphabet.high_index), + build_int_cst_type(INT, low_char), + build_int_cst_type(INT, high_char), NULL_TREE ); break; } + default: + fprintf(stderr, "%s: Program ID %s:\n", + cobol_filename(), + cbl_label_of(symbol_at(current_program_index()))->name); + gcc_unreachable(); } } @@ -5172,21 +5173,34 @@ parser_alphabet_use( cbl_alphabet_t& alphabet ) SHOW_PARSE { SHOW_PARSE_HEADER + char *psz = xasprintf(" %s ", alphabet.name); + SHOW_PARSE_TEXT(psz); + free(psz); switch(alphabet.encoding) { + case iconv_CP1252_e: + psz = xasprintf("CP1252"); + break; case ASCII_e: - fprintf(stderr, "ASCII\n"); + psz = xasprintf("ASCII"); break; case iso646_e: - fprintf(stderr, "ISO646\n"); + psz = xasprintf("ISO646"); break; case EBCDIC_e: - fprintf(stderr, "EBCDIC\n"); + psz = xasprintf("EBCDIC"); + break; + case UTF8_e: + psz = xasprintf("UTF8"); break; case custom_encoding_e: - fprintf(stderr, "%s\n", alphabet.name); + psz = xasprintf("%s", alphabet.name); break; + default: + gcc_unreachable(); } + SHOW_PARSE_TEXT(psz); + free(psz); SHOW_PARSE_END } @@ -5194,13 +5208,19 @@ parser_alphabet_use( cbl_alphabet_t& alphabet ) switch(alphabet.encoding) { + default: + gcc_unreachable(); + case iconv_CP1252_e: case ASCII_e: case iso646_e: case EBCDIC_e: + case UTF8_e: __gg__low_value_character = DEGENERATE_LOW_VALUE; __gg__high_value_character = DEGENERATE_HIGH_VALUE; gg_call(VOID, "__gg__alphabet_use", + build_int_cst_type(INT, current_encoding(display_encoding_e)), + build_int_cst_type(INT, current_encoding(national_encoding_e)), build_int_cst_type(INT, alphabet.encoding), null_pointer_node, NULL_TREE); @@ -5216,6 +5236,8 @@ parser_alphabet_use( cbl_alphabet_t& alphabet ) gg_call(VOID, "__gg__alphabet_use", + build_int_cst_type(INT, current_encoding(display_encoding_e)), + build_int_cst_type(INT, current_encoding(national_encoding_e)), build_int_cst_type(INT, alphabet.encoding), build_int_cst_type(SIZE_T, alphabet_index), NULL_TREE); @@ -5279,6 +5301,7 @@ parser_display_internal(tree file_descriptor, gg_call(VOID, "__gg__display_string", file_descriptor, + build_int_cst_type(INT, refer.field->codeset.encoding), build_string_literal(refer.field->data.capacity, refer.field->data.initial), build_int_cst_type(SIZE_T, refer.field->data.capacity), @@ -5582,7 +5605,8 @@ parser_display( const struct cbl_special_name_t *upon, } else { - gg_assign(file_descriptor,integer_one_node); // stdout is file descriptor 1. + // stdout is file descriptor 1. + gg_assign(file_descriptor, integer_one_node); } for(size_t i=0; istructs.goto_trees ) + { + label->structs.goto_trees + = static_cast + (xmalloc(sizeof(struct cbl_label_addresses_t))); + gcc_assert(label->structs.goto_trees); + + gg_create_goto_pair(&label->structs.goto_trees->go_to, + &label->structs.goto_trees->label); + } + return label->structs.goto_trees; + } + +void +parser_xml_parse( cbl_label_t *instance, + cbl_refer_t input, + cbl_field_t *encoding, + cbl_field_t *validating, + bool returns_national, + cbl_label_t *from_proc, + cbl_label_t *to_proc ) + { + SHOW_PARSE + { + SHOW_PARSE_HEADER + SHOW_PARSE_LABEL_OK("", instance) + SHOW_PARSE_REF(" ", input) + SHOW_PARSE_END + } + + TRACE1 + { + TRACE1_HEADER + TRACE1_END + } + + // We know that this routine comes first in the sequence, so we can + // create the goto/label pairs here: + + instance->structs.xml_parse = static_cast + (xmalloc(sizeof(struct cbl_xml_parse_t))); + gcc_assert(instance->structs.xml_parse); + + gg_create_goto_pair(&instance->structs.xml_parse->over.go_to, + &instance->structs.xml_parse->over.label); + gg_create_goto_pair(&instance->structs.xml_parse->exception.go_to, + &instance->structs.xml_parse->exception.label); + gg_create_goto_pair(&instance->structs.xml_parse->no_exception.go_to, + &instance->structs.xml_parse->no_exception.label); + + // We need to create a COBOL ENTRY point into this function. That entry + // point will be used by __gg__xml_parse to perform from_proc through to_proc + // as part of processing the libxml2 callbacks. + + char ach[64]; + static int instance_counter = 1; + sprintf(ach, + "_%s_xml_callback_%d", + current_function->our_name, + instance_counter++); + + cbl_field_t for_entry = {}; + for_entry.type = FldAlphanumeric; + for_entry.data.capacity = strlen(ach); + for_entry.data.initial = ach; + for_entry.codeset.encoding = iconv_CP1252_e; + + // build an island for the callback: + tree island_goto; + tree island_label; + gg_create_goto_pair(&island_goto, + &island_label); + + gg_append_statement(island_goto); + // This creates the separate _xml_callback function + parser_entry(&for_entry, 0, nullptr); + // When invoked, the callback performs the processing procedures + parser_perform(from_proc, to_proc); + // And then returns back to the caller + gg_return(0); + gg_append_statement(island_label); + + // With the callback in place, we are ready to call the library: + tree pcallback = gg_get_function_address(VOID, ach); + + tree erc = gg_define_int(); + gg_assign(erc, gg_call_expr(INT, + "__gg__xml_parse", + gg_get_address_of(input.field->var_decl_node), + refer_offset(input), + refer_size_source(input), + encoding ? + gg_get_address_of(encoding->var_decl_node) + : null_pointer_node, + validating ? + gg_get_address_of(validating->var_decl_node) + : null_pointer_node, + build_int_cst_type(INT, returns_national), + pcallback, + NULL_TREE)); + IF( erc, ne_op, integer_zero_node ) + { + //gg_printf("__gg__xml_parse() failed with erc %d\n", erc, NULL_TREE); + gg_append_statement(instance->structs.xml_parse->exception.go_to); + } + ELSE + { + //gg_printf("__gg__xml_parse() apparently succeeded\n", NULL_TREE); + gg_append_statement(instance->structs.xml_parse->no_exception.go_to); + } + ENDIF + } + +void +parser_xml_on_exception( cbl_label_t *instance ) + { + SHOW_PARSE + { + SHOW_PARSE_HEADER + SHOW_PARSE_LABEL_OK(" ", instance) + SHOW_PARSE_END + } + gg_append_statement(instance->structs.xml_parse->over.go_to); + gg_append_statement(instance->structs.xml_parse->exception.label); + } + +void +parser_xml_not_exception( cbl_label_t *instance ) +{ + SHOW_PARSE + { + SHOW_PARSE_HEADER + SHOW_PARSE_LABEL_OK(" ", instance) + SHOW_PARSE_END + } + gg_append_statement(instance->structs.xml_parse->over.go_to); + gg_append_statement(instance->structs.xml_parse->no_exception.label); + } + +void parser_xml_end( cbl_label_t *instance ) + { + SHOW_PARSE + { + SHOW_PARSE_HEADER + SHOW_PARSE_LABEL_OK(" ", instance) + SHOW_PARSE_END + } + gg_append_statement(instance->structs.xml_parse->over.label); + } + void parser_arith_error(cbl_label_t *arithmetic_label) { @@ -6962,6 +7141,8 @@ initialize_the_data() // This is one-time initialization of the libgcobol program state stack gg_call(VOID, "__gg__init_program_state", + build_int_cst_type(INT, current_encoding(display_encoding_e)), + build_int_cst_type(INT, current_encoding(national_encoding_e)), NULL_TREE); __gg__currency_signs = __gg__ct_currency_signs; @@ -7013,65 +7194,339 @@ initialize_the_data() } } +static void -parser_division(cbl_division_t division, - cbl_field_t *returning, - size_t nusing, +establish_using(size_t nusing, cbl_ffi_arg_t args[] ) { - // This is called when the parser enters a COBOL program DIVISION. See - // parser_divide for the arithmetic operation. - - if( mode_syntax_only() ) return; - - // Do this before the SHOW_PARSE; it makes a little more sense when reviewing - // the SHOW_PARSE output. - if( division == identification_div_e ) + if( nusing ) { - initialized_data = false; - if( gg_trans_unit.function_stack.size() >= 1 ) + for(size_t i=0; iname); - SHOW_PARSE - { - SHOW_PARSE_HEADER - SHOW_PARSE_TEXT(" ") - switch(division) + size_t nbytes = 0; + tree par_type = tree_type_from_field_type(args[i].refer.field, nbytes); + if( par_type == FLOAT ) + { + par_type = SSIZE_T; + } + if( par_type == DOUBLE ) + { + par_type = SSIZE_T; + } + if( par_type == FLOAT128 ) + { + par_type = INT128; + } + chain_parameter_to_function(current_function->function_decl, par_type, ach); + free(ach); + } + + // During the call, we saved the parameter_count and an array of variable + // lengths. We need to look at those values if, and only if, one or more + // of our USING arguments has an OPTIONAL flag or if one of our targets is + // marked as VARYING. + bool check_for_parameter_count = false; + for(size_t i=0; iattr & any_length_e ) + { + check_for_parameter_count = true; break; + } } - SHOW_PARSE_END - } + if( check_for_parameter_count ) + { + IF( var_decl_call_parameter_signature, + eq_op, + gg_cast(CHAR_P, current_function->function_address) ) + { + // We know to use var_decl_call_parameter_count, so unflag this + // pointer to avoid problems in the ridiculous possibility of + // COBOL-A calls C_B calls COBOL_A + gg_assign(var_decl_call_parameter_signature, + gg_cast(CHAR_P, null_pointer_node)); + } + ELSE + { + // We were apparently called by a C routine, not a COBOL routine, so + // make sure we don't get shortchanged by a count left behind from an + // earlier COBOL call. + gg_assign(var_decl_call_parameter_count, + build_int_cst_type(INT, A_ZILLION)); + } + ENDIF + } + else + { + // None of our parameters require a count, so make sure we don't get + // bamboozled by a count left behind from an earlier COBOL call. + gg_assign(var_decl_call_parameter_count, + build_int_cst_type(INT, A_ZILLION)); + } - if( division == data_div_e ) - { - Analyze(); - initialize_the_data(); - } - if( division == environment_div_e ) + // There are 'nusing' elements in the PROCEDURE DIVISION USING list. + + tree parameter = NULL_TREE; + tree rt_i = gg_define_int(); + for(size_t i=0; ivar_decl_node, "data"), + ne_op, + gg_cast(UCHAR_P, null_pointer_node) ) + { + gg_call(VOID, + "__gg__push_local_variable", + gg_get_address_of(args[i].refer.field->var_decl_node), + NULL_TREE); + } + ELSE + ENDIF + + tree base = gg_define_variable(UCHAR_P); + gg_assign(rt_i, build_int_cst_type(INT, i)); + //gg_printf("The rt_i counter is %d\n", rt_i, NULL_TREE); + IF( rt_i, lt_op , var_decl_call_parameter_count ) + { + if( i == 0 ) + { + // This is the first parameter. + parameter = DECL_ARGUMENTS(current_function->function_decl); + } + else + { + // These are subsequent parameters + parameter = TREE_CHAIN(parameter); + } + gg_assign(base, gg_cast(UCHAR_P, parameter)); + + if( args[i].refer.field->attr & any_length_e ) + { + // gg_printf("side channel: Length of \"%s\" is %ld\n", + // member(args[i].refer.field->var_decl_node, "name"), + // gg_array_value(var_decl_call_parameter_lengths, rt_i), + // NULL_TREE); + + // Get the length from the global lengths[] side channel. Don't + // forget to use the length mask on the table value. + gg_assign(member(args[i].refer.field->var_decl_node, "capacity"), + gg_array_value(var_decl_call_parameter_lengths, rt_i)); + } + } + ELSE + { + gg_assign(base, gg_cast(UCHAR_P, null_pointer_node)); + } + ENDIF + + // Arriving here means that we are processing an instruction like + // this: + // PROCEDURE DIVISION USING using[0] using[1] ... using using[nusing-1] + + // When __gg__call_parameter_count is equal to A_ZILLION, then this is + // an OTHER-TO-COBOL call and the var_decl_call_parameter_lengths array + // is not valid + + cbl_ffi_crv_t crv = args[i].crv; + cbl_field_t *new_var = args[i].refer.field; + + if( crv == by_value_e ) + { + switch(new_var->type) + { + case FldGroup: + case FldAlphanumeric: + case FldAlphaEdited: + case FldNumericEdited: + crv = by_reference_e; + break; + default: + break; + } + } + + if( crv == by_value_e ) + { + // 'parameter' is the 64-bit or 128-bit value that was placed on the stack + + size_t nbytes; + tree_type_from_field_type(new_var, nbytes); + tree parm = gg_define_variable(INT128); + + if( nbytes <= 8 ) + { + // Our input is a 64-bit number + if( new_var->attr & signable_e ) + { + IF( gg_bitwise_and( gg_cast(SIZE_T, base), + build_int_cst_type(SIZE_T, 0x8000000000000000ULL)), + ne_op, + gg_cast(SIZE_T, integer_zero_node) ) + { + // Our input is a negative number + gg_assign(parm, gg_cast(INT128, integer_minus_one_node)); + } + ELSE + { + // Our input is a positive number + gg_assign(parm, gg_cast(INT128, integer_zero_node)); + } + ENDIF + } + else + { + // This is a 64-bit positive number: + gg_assign(parm, gg_cast(INT128, integer_zero_node)); + } + } + // At this point, parm has been set to 0 or -1 + + gg_memcpy(gg_get_address_of(parm), + gg_get_address_of(base), + build_int_cst_type(SIZE_T, nbytes)); + + tree array_type = build_array_type_nelts(UCHAR, new_var->data.capacity); + tree data_decl_node = gg_define_variable( array_type, + NULL, + vs_static); + gg_assign( member(new_var->var_decl_node, "data"), + gg_get_address_of(data_decl_node) ); + + // And then move it into place + gg_call(VOID, + "__gg__assign_value_from_stack", + gg_get_address_of(new_var->var_decl_node), + parm, + NULL_TREE); + // We now have to handle an oddball situation. It's possible we are + // dealing with + // + // linkage section. + // 01 var1 + // 01 var2 redefines var1 + // + // If so, we have to give var2::data_pointer the same value as + // var1::data_pointer + // + size_t our_index = symbol_index(symbol_elem_of(new_var)); + size_t next_index = our_index + 1; + // Look ahead in the symbol table for the next LEVEL01/77 + for(;;) + { + symbol_elem_t *e = symbol_at(next_index); + if( e->type != SymField ) + { + break; + } + cbl_field_t *next_var = cbl_field_of(e); + if( !next_var ) + { + break; + } + if( next_var->level == LEVEL01 || next_var->level == LEVEL77 ) + { + if( next_var->parent == our_index ) + { + gg_assign(member(next_var->var_decl_node, "data"), + member(new_var->var_decl_node, "data")); + } + break; + } + next_index += 1; + } + } + else + { + // 'parameter' is a reference, so it it becomes the data member of + // the cblc_field_t COBOL variable. + gg_assign(member(args[i].field()->var_decl_node, "data"), base); + + // We need to apply base + offset to the LINKAGE variable + // and all of its children + propogate_linkage_offsets( args[i].field(), base ); + } + } + } + } + +void +parser_division(cbl_division_t division, + cbl_field_t *returning, + size_t nusing, + cbl_ffi_arg_t args[] ) + { + // This is called when the parser enters a COBOL program DIVISION. See + // parser_divide for the arithmetic operation. + + if( mode_syntax_only() ) return; + + // Do this before the SHOW_PARSE; it makes a little more sense when reviewing + // the SHOW_PARSE output. + if( division == identification_div_e ) + { + initialized_data = false; + if( gg_trans_unit.function_stack.size() >= 1 ) + { + // This is a nested program. So, we need to tie off the current + // section: + leave_paragraph_internal(); + leave_section_internal(); + } + } + + if( division == environment_div_e ) + { + initialized_data = false; + } + + SHOW_PARSE + { + SHOW_PARSE_HEADER + SHOW_PARSE_TEXT(" ") + switch(division) + { + case identification_div_e: + SHOW_PARSE_TEXT("IDENTIFICATION") + break; + case environment_div_e: + SHOW_PARSE_TEXT("ENVIRONMENT") + break; + case data_div_e: + SHOW_PARSE_TEXT("DATA") + break; + case procedure_div_e: + SHOW_PARSE_TEXT("PROCEDURE") + break; + } + + SHOW_PARSE_END + } + + if( division == data_div_e ) + { + Analyze(); + initialize_the_data(); + } + if( division == environment_div_e ) { Analyze(); initialize_the_data(); @@ -7144,7 +7599,7 @@ parser_division(cbl_division_t division, // UPSI 10000110 means that bits 0, 5, and 6 are on, which means that // SW-0, SW-5, and SW-6 are on. gg_call(VOID, - "__gg__set_initial_switch_value", + "__gg__onetime_initialization", NULL_TREE); // And then flag one-time initialization as having been done. @@ -7211,273 +7666,6 @@ parser_division(cbl_division_t division, // length. We establish those lengths based on the types of the target // for each USING. - for(size_t i=0; iname); - - size_t nbytes = 0; - tree par_type = tree_type_from_field_type(args[i].refer.field, nbytes); - if( par_type == FLOAT ) - { - par_type = SSIZE_T; - } - if( par_type == DOUBLE ) - { - par_type = SSIZE_T; - } - if( par_type == FLOAT128 ) - { - par_type = INT128; - } - chain_parameter_to_function(current_function->function_decl, par_type, ach); - } - - if( nusing ) - { - // During the call, we saved the parameter_count and an array of variable - // lengths. We need to look at those values if, and only if, one or more - // of our USING arguments has an OPTIONAL flag or if one of our targets is - // marked as VARYING. - bool check_for_parameter_count = false; - for(size_t i=0; iattr & any_length_e ) - { - check_for_parameter_count = true; - break; - } - } - - if( check_for_parameter_count ) - { - IF( var_decl_call_parameter_signature, - eq_op, - gg_cast(CHAR_P, current_function->function_address) ) - { - // We know to use var_decl_call_parameter_count, so unflag this - // pointer to avoid problems in the ridiculous possibility of - // COBOL-A calls C_B calls COBOL_A - gg_assign(var_decl_call_parameter_signature, - gg_cast(CHAR_P, null_pointer_node)); - } - ELSE - { - // We were apparently called by a C routine, not a COBOL routine, so - // make sure we don't get shortchanged by a count left behind from an - // earlier COBOL call. - gg_assign(var_decl_call_parameter_count, - build_int_cst_type(INT, A_ZILLION)); - } - ENDIF - } - else - { - // None of our parameters require a count, so make sure we don't get - // bamboozled by a count left behind from an earlier COBOL call. - gg_assign(var_decl_call_parameter_count, - build_int_cst_type(INT, A_ZILLION)); - } - - // There are 'nusing' elements in the PROCEDURE DIVISION USING list. - - tree parameter = NULL_TREE; - tree rt_i = gg_define_int(); - for(size_t i=0; ivar_decl_node, "data"), - ne_op, - gg_cast(UCHAR_P, null_pointer_node) ) - { - gg_call(VOID, - "__gg__push_local_variable", - gg_get_address_of(args[i].refer.field->var_decl_node), - NULL_TREE); - } - ELSE - ENDIF - - tree base = gg_define_variable(UCHAR_P); - gg_assign(rt_i, build_int_cst_type(INT, i)); - //gg_printf("The rt_i counter is %d\n", rt_i, NULL_TREE); - IF( rt_i, lt_op , var_decl_call_parameter_count ) - { - if( i == 0 ) - { - // This is the first parameter. - parameter = DECL_ARGUMENTS(current_function->function_decl); - } - else - { - // These are subsequent parameters - parameter = TREE_CHAIN(parameter); - } - gg_assign(base, gg_cast(UCHAR_P, parameter)); - - if( args[i].refer.field->attr & any_length_e ) - { - // gg_printf("side channel: Length of \"%s\" is %ld\n", - // member(args[i].refer.field->var_decl_node, "name"), - // gg_array_value(var_decl_call_parameter_lengths, rt_i), - // NULL_TREE); - - // Get the length from the global lengths[] side channel. Don't - // forget to use the length mask on the table value. - gg_assign(member(args[i].refer.field->var_decl_node, "capacity"), - gg_array_value(var_decl_call_parameter_lengths, rt_i)); - } - } - ELSE - { - gg_assign(base, gg_cast(UCHAR_P, null_pointer_node)); - } - ENDIF - - // Arriving here means that we are processing an instruction like - // this: - // PROCEDURE DIVISION USING using[0] using[1] ... using using[nusing-1] - - // When __gg__call_parameter_count is equal to A_ZILLION, then this is - // an OTHER-TO-COBOL call and the var_decl_call_parameter_lengths array - // is not valid - - cbl_ffi_crv_t crv = args[i].crv; - cbl_field_t *new_var = args[i].refer.field; - - if( crv == by_value_e ) - { - switch(new_var->type) - { - case FldGroup: - case FldAlphanumeric: - case FldAlphaEdited: - case FldNumericEdited: - crv = by_reference_e; - break; - default: - break; - } - } - - if( crv == by_value_e ) - { - // 'parameter' is the 64-bit or 128-bit value that was placed on the stack - - size_t nbytes; - tree_type_from_field_type(new_var, nbytes); - tree parm = gg_define_variable(INT128); - - if( nbytes <= 8 ) - { - // Our input is a 64-bit number - if( new_var->attr & signable_e ) - { - IF( gg_bitwise_and( gg_cast(SIZE_T, base), - build_int_cst_type(SIZE_T, 0x8000000000000000ULL)), - ne_op, - gg_cast(SIZE_T, integer_zero_node) ) - { - // Our input is a negative number - gg_assign(parm, gg_cast(INT128, integer_minus_one_node)); - } - ELSE - { - // Our input is a positive number - gg_assign(parm, gg_cast(INT128, integer_zero_node)); - } - ENDIF - } - else - { - // This is a 64-bit positive number: - gg_assign(parm, gg_cast(INT128, integer_zero_node)); - } - } - // At this point, parm has been set to 0 or -1 - - gg_memcpy(gg_get_address_of(parm), - gg_get_address_of(base), - build_int_cst_type(SIZE_T, nbytes)); - - tree array_type = build_array_type_nelts(UCHAR, new_var->data.capacity); - tree data_decl_node = gg_define_variable( array_type, - NULL, - vs_static); - gg_assign( member(new_var->var_decl_node, "data"), - gg_get_address_of(data_decl_node) ); - - // And then move it into place - gg_call(VOID, - "__gg__assign_value_from_stack", - gg_get_address_of(new_var->var_decl_node), - parm, - NULL_TREE); - // We now have to handle an oddball situation. It's possible we are - // dealing with - // - // linkage section. - // 01 var1 - // 01 var2 redefines var1 - // - // If so, we have to give var2::data_pointer the same value as - // var1::data_pointer - // - size_t our_index = symbol_index(symbol_elem_of(new_var)); - size_t next_index = our_index + 1; - // Look ahead in the symbol table for the next LEVEL01/77 - for(;;) - { - symbol_elem_t *e = symbol_at(next_index); - if( e->type != SymField ) - { - break; - } - cbl_field_t *next_var = cbl_field_of(e); - if( !next_var ) - { - break; - } - if( next_var->level == LEVEL01 || next_var->level == LEVEL77 ) - { - if( next_var->parent == our_index ) - { - gg_assign(member(next_var->var_decl_node, "data"), - member(new_var->var_decl_node, "data")); - } - break; - } - next_index += 1; - } - } - else - { - // 'parameter' is a reference, so it it becomes the data member of - // the cblc_field_t COBOL variable. - gg_assign(member(args[i].field()->var_decl_node, "data"), base); - - // We need to apply base + offset to the LINKAGE variable - // and all of its children - propogate_linkage_offsets( args[i].field(), base ); - } - } - } - gg_call(VOID, "__gg__pseudo_return_bookmark", NULL_TREE); @@ -7528,6 +7716,25 @@ parser_division(cbl_division_t division, // logic for backing up one line, which is needed to correctly step through // COBOL code with GDB-COBOL. So, we clear it here. current_location_minus_one_clear(); + + // It is at this point that we check to see if the call to this function + // is a re-entry because of an ENTRY statement: + + IF( var_decl_entry_label, ne_op, null_pointer_node ) + { + // This is an ENTRY re-entry. The processing of USING variables was + // done in parser_entry, so now we jump to the label + static tree loc = gg_define_variable(VOID_P, vs_static); + gg_assign(loc, var_decl_entry_label); + gg_assign(var_decl_entry_label, gg_cast(VOID_P, null_pointer_node)); + gg_goto(loc); + } + ELSE + { + } + ENDIF + + establish_using(nusing, args); } } @@ -7817,7 +8024,6 @@ parser_relop_long(cbl_field_t *tgt, NULL, bref.field, refer_offset(bref) ); - static tree comp_res = gg_define_variable(LONG, "..prl_comp_res", vs_file_static); gg_assign(comp_res, gg_subtract(tree_a, tree_b)); @@ -7965,23 +8171,6 @@ parser_see_stop_run(struct cbl_refer_t exit_status, gg_exit(returned_value); } -static -cbl_label_addresses_t * -label_fetch(struct cbl_label_t *label) - { - if( !label->structs.goto_trees ) - { - label->structs.goto_trees - = static_cast - (xmalloc(sizeof(struct cbl_label_addresses_t))); - gcc_assert(label->structs.goto_trees); - - gg_create_goto_pair(&label->structs.goto_trees->go_to, - &label->structs.goto_trees->label); - } - return label->structs.goto_trees; - } - void parser_label_label(struct cbl_label_t *label) { @@ -8012,6 +8201,18 @@ parser_label_label(struct cbl_label_t *label) } CHECK_LABEL(label); + +#if 1 + // At the present time, label_verify.lay is returning true, so I edited + // out the if( !... ) to quiet cppcheck + label_verify.lay(label); +#else + if( ! label_verify.lay(label) ) + { + yywarn("%s: label %qs already exists", __func__, label->name); + gcc_unreachable(); + } +#endif if(strcmp(label->name, "_end_declaratives") == 0 ) { @@ -8051,6 +8252,10 @@ parser_label_goto(struct cbl_label_t *label) } CHECK_LABEL(label); + + label_verify.go_to(label); + + label_verify.go_to(label); if( strcmp(label->name, "_end_declaratives") == 0 ) { @@ -8111,6 +8316,8 @@ parser_setop( struct cbl_field_t *tgt, member(candidate, "data"), member(candidate, "capacity"), member(domain, "initial"), + build_int_cst_type(INT, + domain->codeset.encoding), NULL_TREE), ne_op, integer_zero_node)); @@ -9472,12 +9679,24 @@ parser_set_conditional88( const cbl_refer_t& refer, bool which_way ) if( !figconst ) { // We are dealing with an ordinary string. - static size_t buffer_size = 0; - static char *buffer = NULL; - size_t length = src->first.size(); - raw_to_internal(&buffer, &buffer_size, src->first.name(), length); + + // When Jim gets around to converting the domain to the target encoding, + // this code will have to be removed +#if 1 + char *fname = xstrdup(src->first.name()); + charmap_t *charmap = __gg__get_charmap(tgt->codeset.encoding); + for(size_t i=0; imapped_character(fname[i]); + } move_tree_to_field( parent, - gg_string_literal(buffer)); + build_string_literal(strlen(fname)+1, fname)); + free(fname); +#else + move_tree_to_field( parent, + build_string_literal(src->first.size()+1, + src->first.name())); +#endif } else { @@ -9671,6 +9890,7 @@ parser_file_add(struct cbl_file_t *file) __func__); } +#pragma message "Use program-id to disambiguate" size_t symbol_table_index = symbol_index(symbol_elem_of(file)); gg_call(VOID, @@ -9694,6 +9914,11 @@ parser_file_add(struct cbl_file_t *file) build_int_cst_type(INT, (int)file->optional), build_int_cst_type(SIZE_T, varies.min), build_int_cst_type(SIZE_T, varies.max), +/* Right now, file->codeset.encoding is not being set properly. Remove this + comment and fix the following code when that's repaired. */ +// build_int_cst_type(INT, (int)file->codeset.encoding), + build_int_cst_type(INT, current_encoding(display_encoding_e)), + build_int_cst_type(INT, (int)file->codeset.alphabet), NULL_TREE); file->var_decl_node = new_var_decl; } @@ -9782,6 +10007,14 @@ parser_file_open( struct cbl_file_t *file, int mode_char ) { // The name is coming from a presumably FldAlphaNumeric variable psz = get_string_from(field_of_name); + gg_call( CHAR_P, + "__gg__convert_encoding", + psz, + build_int_cst_type(INT, + field_of_name->codeset.encoding), + build_int_cst_type(INT, + DEFAULT_CHARMAP_SOURCE), + NULL_TREE); quoted_name = true; } @@ -11114,6 +11347,16 @@ parser_intrinsic_call_1( cbl_field_t *tgt, } } } + else if( strcmp(function_name, "__gg__char") == 0 ) + { + gg_call(VOID, + function_name, + gg_get_address_of(tgt->var_decl_node), + gg_get_address_of(ref1.field->var_decl_node), + refer_offset(ref1), + refer_size_source(ref1), + NULL_TREE); + } else { TRACE1 @@ -11168,13 +11411,15 @@ parser_intrinsic_call_2( cbl_field_t *tgt, TRACE1_REFER("parameter 2: ", ref2, "") } store_location_stuff(function_name); + gg_call(VOID, function_name, gg_get_address_of(tgt->var_decl_node), gg_get_address_of(ref1.field->var_decl_node), refer_offset(ref1), refer_size_source(ref1), - ref2.field ? gg_get_address_of(ref2.field->var_decl_node) : null_pointer_node, + ref2.field ? gg_get_address_of(ref2.field->var_decl_node) + : null_pointer_node, refer_offset(ref2), refer_size_source(ref2), NULL_TREE); @@ -13191,8 +13436,10 @@ create_and_call(size_t narg, { // Somebody was discourteous enough to return a NULL pointer // We'll jam in spaces: + charmap_t *charmap = __gg__get_charmap(returned.field->codeset.encoding); + int dest_space = charmap->mapped_character(ascii_space); gg_memset( returned_location, - char_nodes[(unsigned char)internal_space], + char_nodes[(unsigned char)dest_space], returned_length ); } ELSE @@ -13273,7 +13520,9 @@ create_and_call(size_t narg, { // Because no explicit returning value is expected, we just call it. We // expect COBOL routines to set RETURN-CODE when they think it necessary. + push_program_state(); gg_append_statement(call_expr); + pop_program_state(); } for( size_t i=0; iprogram); } -// Define ENTRY point with alternative LINKAGE +static tree entry_goto; +static tree entry_label; +static tree entry_addr; + void -parser_entry( cbl_field_t */*name*/, size_t /*narg*/, cbl_ffi_arg_t */*args*/ ) +parser_entry( const cbl_field_t *name, size_t nusing, cbl_ffi_arg_t *args ) { + // We are implementing the ENTRY statement, which creates an alternative + // entry point into the current program-id. There is no actual way to do + // that literally. So, we are going to create a separate routine that sets + // things up and then calls the current routine with the information it needs + // to transfer processing to the ENTRY point. + + SHOW_PARSE + { + SHOW_PARSE_HEADER + SHOW_PARSE_TEXT(" ") + SHOW_PARSE_TEXT(name->data.initial) + SHOW_PARSE_END + } + + // Get the name of the program that contains the ENTRY statement. + char *name_of_parent = xstrdup(current_function->our_name); + + // Get the name of the ENTRY point. + // cppcheck-suppress nullPointerRedundantCheck + char *psz = cobol_name_mangler(name->data.initial); + + // Create a goto/label pair. The label will be set up here; the goto will + // be used when we re-enter the containing function: + + gg_create_goto_pair(&entry_goto, + &entry_label, + &entry_addr); + + // Start creating the ENTRY function. + tree function_decl = gg_define_function( VOID, + psz, + psz, + NULL_TREE); + free(psz); + + // Modify the default settings for this entry point + TREE_ADDRESSABLE(function_decl) = 0; + TREE_USED(function_decl) = 0; + TREE_NOTHROW(function_decl) = 0; + TREE_STATIC(function_decl) = 1; + DECL_EXTERNAL (function_decl) = 0; + TREE_PUBLIC (function_decl) = 1; + DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT(function_decl) = 1; + + // When the ENTRY function point is called, we process its "using" + // parameters: + establish_using(nusing, args); + + // Put the entry_label into the global variable that will be picked up + // when the containing program-id is re-entered: + gg_assign(var_decl_entry_label, entry_addr); + + // Get the function address of the containing function. + tree gfa = gg_get_function_address(VOID, name_of_parent); + free(name_of_parent); + + // Call the containing function + gg_append_statement(gg_call_expr_list(VOID, + gfa, + 0, + NULL)); + // We are done with the ENTRY function: + gg_finalize_function(); + + // Lay down the address of the label that matches var_decl_entry_label; + // the containing program-id will jump to this point. + gg_append_statement(entry_label); } void @@ -14268,6 +14588,7 @@ mh_identical(const cbl_refer_t &destref, && destref.field->data.rdigits == sourceref.field->data.rdigits && (destref.field->attr & (signable_e|separate_e|leading_e)) == (sourceref.field->attr & (signable_e|separate_e|leading_e)) + && destref.field->codeset.encoding == sourceref.field->codeset.encoding && !destref.field->occurs.depending_on && !sourceref.field->occurs.depending_on && !destref.refmod.from @@ -14321,19 +14642,24 @@ mh_source_is_literalN(cbl_refer_t &destref, SHOW_PARSE_TEXT("mh_source_is_literalN: __gg__psz_to_alpha_move") } - static char *buffer = NULL; - static size_t buffer_size = 0; - raw_to_internal(&buffer, - &buffer_size, - sourceref.field->data.initial, - strlen(sourceref.field->data.initial)); + // We know that the encoding of the literal::initial is in ASCII + + // We need the data sent to __gg__psz_to_alpha_move to be in the + // encoding of the destination + + size_t charsout; + const char *converted = __gg__iconverter(DEFAULT_CHARMAP_SOURCE, + destref.field->codeset.encoding, + sourceref.field->data.initial, + strlen(sourceref.field->data.initial), + &charsout); gg_call(VOID, "__gg__psz_to_alpha_move", gg_get_address_of(destref.field->var_decl_node), refer_offset(destref), refer_size_dest(destref), - gg_string_literal(buffer), - build_int_cst_type(SIZE_T, strlen(sourceref.field->data.initial)), + gg_string_literal(converted), + build_int_cst_type(SIZE_T, charsout), NULL_TREE); moved = true; break; @@ -14510,14 +14836,32 @@ mh_source_is_literalN(cbl_refer_t &destref, SHOW_PARSE_INDENT SHOW_PARSE_TEXT(" FldAlphaEdited") } + + // __gg__string_to_alpha_edited expects the source string to be in + // the same encoding as the target: + size_t len = strlen(sourceref.field->data.initial); + char *src = + static_cast(xmalloc(len+1)); + memcpy( src, + sourceref.field->data.initial, + strlen(sourceref.field->data.initial)); + size_t charsout; + const char *converted = __gg__iconverter( + sourceref.field->codeset.encoding, + destref.field->codeset.encoding, + src, + len, + &charsout); gg_call(VOID, - "__gg__string_to_alpha_edited_ascii", + "__gg__string_to_alpha_edited", gg_add( member(destref.field->var_decl_node, "data"), refer_offset(destref) ), - gg_string_literal(sourceref.field->data.initial), - build_int_cst_type(INT, strlen(sourceref.field->data.initial)), + build_int_cst_type(INT, destref.field->codeset.encoding), + gg_string_literal(converted), + build_int_cst_type(INT, len), gg_string_literal(destref.field->data.picture), NULL_TREE); + free(src); moved = true; break; } @@ -14829,8 +15173,11 @@ picky_memset(tree &dest_p, unsigned char value, size_t length) } static void -picky_memcpy(tree &dest_p, const tree &source_p, size_t length) +picky_memcpy(tree &dest_p, const tree &source_p, size_t length, tree zero) { + // This is the routine that copies digits for NumericDisplay. In addition + // to just moving digits from source to destination, it has to handle + // clearing up embedded sign information. if( length ) { tree dest_ep = gg_define_variable(TREE_TYPE(dest_p)); @@ -14839,7 +15186,10 @@ picky_memcpy(tree &dest_p, const tree &source_p, size_t length) build_int_cst_type(SIZE_T, length))); WHILE( dest_p, lt_op, dest_ep ) { - gg_assign(gg_indirect(dest_p), gg_indirect(source_p)); + gg_assign(gg_indirect(dest_p), + gg_bitwise_or(zero, + gg_bitwise_and(gg_indirect(source_p), + build_int_cst_type(UCHAR, 0x0F)))); gg_increment(dest_p); gg_increment(source_p); } @@ -14869,10 +15219,10 @@ mh_numeric_display( const cbl_refer_t &destref, // Fasten your seat belts. - // This routine is complicated by the fact that although I had several + // This routine is complicated by the fact that although I had several // false starts of putting this into libgcobol, I keep coming back to the // fact that assignment of zoned values is common. And, so, there are all - // kinds of things that are known at compile time that would turn into + // kinds of things that are known at compile time that would turn into // execution-time decisions if I moved them to the library. So, complex // or not, I am doing all this code here at compile time because it will // minimize the code at execution time. @@ -14885,11 +15235,19 @@ mh_numeric_display( const cbl_refer_t &destref, // nybble is 0xC0 for positive values, and 0xD0 for negative; all other // digits are 0x70. + charmap_t *charmap_source = + __gg__get_charmap(sourceref.field->codeset.encoding); + charmap_t *charmap_dest = + __gg__get_charmap( destref.field->codeset.encoding); + static tree source_sign_loc = gg_define_variable(UCHAR_P, "..mhnd_sign_loc", vs_file_static); - static tree source_sign_byte = gg_define_variable(UCHAR, - "..mhnd_sign_byte", + static tree dest_sign_loc = gg_define_variable(UCHAR_P, + "..mhnd_dest_sign_loc", + vs_file_static); + static tree source_sign = gg_define_variable(INT, + "..mhnd_sign", vs_file_static); // The destination data pointer static tree dest_p = gg_define_variable( UCHAR_P, @@ -14904,10 +15262,6 @@ mh_numeric_display( const cbl_refer_t &destref, "..mhnd_source_e", vs_file_static); - gg_assign(dest_p, qualified_data_location(destref)); - gg_assign(source_p, gg_add(member(sourceref.field, "data"), - tsource.offset)); - bool source_is_signable = sourceref.field->attr & signable_e; bool source_is_leading = sourceref.field->attr & leading_e; bool source_is_separate = sourceref.field->attr & separate_e; @@ -14916,108 +15270,157 @@ mh_numeric_display( const cbl_refer_t &destref, bool dest_is_leading = destref.field->attr & leading_e; bool dest_is_separate = destref.field->attr & separate_e; - if( source_is_signable ) - { - // The source is signable, so we are going to calculate the location of - // the source sign information. + int switch_source = (source_is_signable ? 4 : 0 ) + + (source_is_leading ? 2 : 0 ) + + (source_is_separate ? 1 : 0 ) ; - gg_assign(source_sign_loc, - gg_add(member(sourceref.field->var_decl_node, "data"), - tsource.offset)); + int switch_dest = (dest_is_signable ? 4 : 0 ) + + (dest_is_leading ? 2 : 0 ) + + (dest_is_separate ? 1 : 0 ) ; - if( (source_is_leading) ) - { - // The source sign location is in the leading position. - if( source_is_separate ) - { - // We have LEADING SEPARATE, so the first actual digit is at - // source_p+1. - gg_increment(source_p); - } - } - else - { - // The sign location is trailing. Whether separate or not, the - // location is the final byte of the data: + // Calculate the start of the source data: + gg_assign(source_p, gg_add(member(sourceref.field, "data"), + tsource.offset)); + + // Calculate the start of the destination data + gg_assign(dest_p, qualified_data_location(destref)); + + // Figure out exactly where the sign is, if any, and where the input + // digits are. + + switch( switch_source ) + { + case 0: + case 1: + case 2: + case 3: + // not signable + gg_assign(source_sign, integer_zero_node); + break; + case 4: + // signable, not leading, not separate + // Calculate location of the sign byte; it's the last byte of the data gg_assign(source_sign_loc, - gg_add(source_sign_loc, + gg_add(source_p, build_int_cst_type(SIZE_T, sourceref.field->data.capacity-1))); - } - // Pick up the byte that contains the sign data, whether internal or - // external: - gg_assign(source_sign_byte, gg_indirect(source_sign_loc)); + break; + case 5: + // signable, not leading, separate + // Calculate location of the sign byte; it's the last byte of the data + gg_assign(source_sign_loc, + gg_add(source_p, + build_int_cst_type(SIZE_T, + sourceref.field->data.capacity-1))); + break; + case 6: + // signable, leading, not separate + // Calculate location of the sign byte; it's the first byte of the data + gg_assign(source_sign_loc, source_p); + break; + case 7: + // signable, leading, separate + // Calculate location of the sign byte; it's the first byte of the data + gg_assign(source_sign_loc, source_p); + gg_increment(source_p); + break; + } + // At this point, the source sign is at source_sign_loc, and the digits + // start at source_p - if( !source_is_separate ) + // Let's learn what the source sign is + if( source_is_signable && source_is_separate ) + { + IF( gg_indirect(source_sign_loc), + eq_op, + build_int_cst_type(UCHAR, + charmap_source->mapped_character(ascii_minus)) ) + { + // Flag the source as negative + gg_assign(source_sign, integer_one_node); + } + ELSE { - // The source is signable and internal. We will modify the zone of - // the source sign byte to force it to be plain vanilla positive. - - // When the move is done, we will replace that byte with the original - // value. - gg_assign(gg_indirect(source_sign_loc), - gg_bitwise_or(build_int_cst_type(UCHAR, ZONED_ZERO), - gg_bitwise_and( source_sign_byte, - build_int_cst_type( UCHAR, 0x0F)))); + // Flag the source as positive + gg_assign(source_sign, integer_zero_node); } + ENDIF } - - // Let the shenanigans begin. - - // We are now ready to output the very first byte. - - // The first thing to do is see if we need to output a leading sign - // character - if( dest_is_signable - && dest_is_leading - && dest_is_separate ) + if( source_is_signable && !source_is_separate ) { - // The output is signed, separate, and leading, so the first character - // needs to be either '+' or '-' - if( source_is_separate ) + // We need to look for an indication that we are internally signed. We + // can tell that by checking to see if the digit is between '0' and '9' + IF( gg_indirect(source_sign_loc), + lt_op, + build_int_cst_type(UCHAR, + charmap_source->mapped_character(ascii_0)) ) { - // The source and dest are both signable/separate. - // Oooh. Shiny. We already have the sign character from the source, - // so we assign that to the destination. - gg_assign(gg_indirect(dest_p), source_sign_byte); + // The sign byte is less than '0', so we are negative + gg_assign(source_sign, integer_one_node); } - else + ELSE { - // The source is internal. - if( source_is_signable ) + IF( gg_indirect(source_sign_loc), + gt_op, + build_int_cst_type(UCHAR, + charmap_source->mapped_character(ascii_9)) ) { - IF( gg_bitwise_and( source_sign_byte, - build_int_cst_type( UCHAR, - NUMERIC_DISPLAY_SIGN_BIT)), - ne_op, - build_int_cst_type( UCHAR, 0) ) - { - // The source was negative - gg_assign(gg_indirect(dest_p), - build_int_cst_type( UCHAR, SEPARATE_MINUS)); - - } - ELSE - { - // The source was positive - gg_assign(gg_indirect(dest_p), - build_int_cst_type( UCHAR, SEPARATE_PLUS)); - } - ENDIF + // The sign byte is greater than '9', so we are negative + gg_assign(source_sign, integer_one_node); } - else + ELSE { - // The source is not signable, so the signed becomes positive no - // matter what the sign of the source. - gg_assign(gg_indirect(dest_p), - build_int_cst_type( UCHAR, SEPARATE_PLUS)); + // The sign byte is betwixt '0' and '9', so we are positive + gg_assign(source_sign, integer_zero_node); } + ENDIF } - gg_increment(dest_p); + ENDIF } - // We have the leading '+' or '-', assuming one is needed. We can - // now start outputting the digits to the left of the decimal place + // We now know the source's sign, and where its digits are. + + // The first order of business is to move the digits into place. To do + // that, we need to know where things go in the destination: + + switch( switch_dest ) + { + case 0: + case 1: + case 2: + case 3: + // not signable + break; + case 4: + // signable, not leading, not separate + // Calculate location of the sign byte; it's the last byte of the data + gg_assign(dest_sign_loc, + gg_add(dest_p, + build_int_cst_type(SIZE_T, + destref.field->data.capacity-1))); + break; + case 5: + // signable, not leading, separate + // Calculate location of the sign byte; it's the last byte of the data + gg_assign(dest_sign_loc, + gg_add(dest_p, + build_int_cst_type(SIZE_T, + destref.field->data.capacity-1))); + break; + case 6: + // signable, leading, not separate + // Calculate location of the sign byte; it's the first byte of the data + gg_assign(dest_sign_loc, dest_p); + break; + case 7: + // signable, leading, separate + // Calculate location of the sign byte; it's the first byte of the data + gg_assign(dest_sign_loc, dest_p); + gg_increment(dest_p); + break; + } + + // We can now start copying the digits to the left of the decimal place int dest_ldigits = (int)destref.field->data.digits - destref.field->data.rdigits; @@ -15031,9 +15434,9 @@ mh_numeric_display( const cbl_refer_t &destref, // The destination has more ldigits than the source, and needs some // leading zeroes: picky_memset( dest_p, - ZONED_ZERO , + charmap_dest->mapped_character(ascii_0) , dest_ldigits - source_ldigits); - // With the leading zeros set, copy over the ldigits: + // With the leading zeros set, set the number of ldigits to copy: digit_count = source_ldigits; } else if( dest_ldigits == source_ldigits ) @@ -15041,7 +15444,7 @@ mh_numeric_display( const cbl_refer_t &destref, // This is the Goldilocks zone. Everything is *just* right. digit_count = dest_ldigits; } - else + else // dest_ldigits < source_ldigits { // The destination is smaller than the source. We have to throw away the // the high-order digits of the source. If any of them are non-zero, then @@ -15057,7 +15460,7 @@ mh_numeric_display( const cbl_refer_t &destref, IF( gg_indirect(source_p), ne_op, build_int_cst_type( UCHAR, - ZONED_ZERO) ) + charmap_source->mapped_character(ascii_0)) ) { set_exception_code(ec_size_truncation_e); gg_assign(size_error, integer_one_node); @@ -15073,9 +15476,8 @@ mh_numeric_display( const cbl_refer_t &destref, // remaining digits digit_count = dest_ldigits; } - - // The ldigits are in place. We now go the very similar exercise for the - // rdigits: + // We now have digit_count, which will cover the ldigits. Augment it by + // the number of rdigits: int dest_rdigits = destref.field->data.rdigits; int source_rdigits = sourceref.field->data.rdigits; @@ -15103,136 +15505,79 @@ mh_numeric_display( const cbl_refer_t &destref, // over only the necessary rdigits, discarding the ones to the right. digit_count += dest_rdigits; } - picky_memcpy(dest_p, source_p, digit_count); + picky_memcpy(dest_p, + source_p, + digit_count, + build_int_cst_type(UCHAR, + charmap_dest->mapped_character(ascii_0))); picky_memset( dest_p, - ZONED_ZERO , + charmap_dest->mapped_character(ascii_0), trailing_zeros); - // With the digits in place, we need to sort out what to do if the target - // is signable: - if( dest_is_signable ) + // With the digits in place, the only thing left is to establish the sign + + switch( switch_dest ) { - if( dest_is_separate - && !dest_is_leading ) - { - // The target is separate/trailing, so we need to tack a '+' - // or '-' character - if( source_is_separate ) - { - // The source was separate, so we already have what we need in the - // source_sign_byte: - gg_assign(gg_indirect(dest_p), source_sign_byte); - gg_increment(dest_p); - } - else + case 0: + case 1: + case 2: + case 3: + // not signable, so there is nothing to do. + break; + case 4: + case 6: + // signable, not leading, not separate + if( charmap_dest->is_like_ebcdic() ) { - // The source is either internal, or unsigned - if( source_is_signable ) + IF( source_sign, ne_op, integer_zero_node ) { - // The source is signable/internal, so we need to extract the - // sign bit from source_sign_byte - IF( gg_bitwise_and( source_sign_byte, - build_int_cst_type( UCHAR, - NUMERIC_DISPLAY_SIGN_BIT)), - ne_op, - build_int_cst_type( UCHAR, 0) ) - { - // The source was negative - gg_assign(gg_indirect(dest_p), - build_int_cst_type( UCHAR, SEPARATE_MINUS)); - - } - ELSE - { - // The source was positive - gg_assign(gg_indirect(dest_p), - build_int_cst_type( UCHAR, SEPARATE_PLUS)); - } - ENDIF + // It's negative ebcdic, so we have to turn the bit off. + gg_assign(gg_indirect(dest_sign_loc), + gg_bitwise_and(gg_indirect(dest_sign_loc), + build_int_cst_type(UCHAR, + ~NUMERIC_DISPLAY_SIGN_BIT_EBCDIC))); } - else + ELSE { - // The source is unsigned, so dest is positive - gg_assign(gg_indirect(dest_p), - build_int_cst_type( UCHAR, - SEPARATE_PLUS)); } - } - gg_increment(dest_p); - } - else if( !dest_is_separate ) - { - // The destination is signed/internal - if( dest_is_leading ) - { - // The sign bit goes into the first byte: - gg_assign(dest_p, qualified_data_location(destref)); + ENDIF } else { - // The sign bit goes into the last byte: - gg_decrement(dest_p); - } - // dest_p now points to the internal sign location - if( internal_codeset_is_ebcdic() ) - { - // For EBCDIC, the zone is going to end up being 0xC0 or 0xD0 - gg_assign(gg_indirect(dest_p), - gg_bitwise_and(gg_indirect(dest_p), - build_int_cst_type(UCHAR, - ZONE_SIGNED_EBCDIC+0x0F))); - } - - if( source_is_signable ) - { - if( source_is_separate ) + IF( source_sign, ne_op, integer_zero_node ) { - // The source is separate, so source_sign_byte is '+' or '-' - IF( source_sign_byte, - eq_op, - build_int_cst_type(UCHAR, SEPARATE_MINUS) ) - { - // The source is negative, so turn on the internal "is minus" bit - gg_assign(gg_indirect(dest_p), - gg_bitwise_or(gg_indirect(dest_p), - build_int_cst_type( - UCHAR, - NUMERIC_DISPLAY_SIGN_BIT))); - } - ELSE - ENDIF - } - else - { - // The source is signable/internal, so the sign bit is in - // source_sign_byte. Whatever it is, it has to go into dest_p: - IF( gg_bitwise_and( source_sign_byte, - build_int_cst_type( - UCHAR, - NUMERIC_DISPLAY_SIGN_BIT)), - ne_op, - build_int_cst_type(UCHAR, 0) ) - { - // The source was negative, so make the dest negative - gg_assign(gg_indirect(dest_p), - gg_bitwise_or(gg_indirect(dest_p), - build_int_cst_type( - UCHAR, - NUMERIC_DISPLAY_SIGN_BIT))); - } - ELSE - ENDIF + // It's negative ascii, so we have to turn the bit on. + gg_assign(gg_indirect(dest_sign_loc), + gg_bitwise_or(gg_indirect(dest_sign_loc), + build_int_cst_type(UCHAR, + NUMERIC_DISPLAY_SIGN_BIT_ASCII))); } + ELSE + { + } + ENDIF } - } - } + break; + case 5: + case 7: + // signable, not leading, separate + // signable, leading, separate + // Calculate location of the sign byte; it's the last byte of the data - if( source_is_signable - && !source_is_separate) - { - // The source is signable internal, so we need to restore the original - // sign byte in the original source data: - gg_assign(gg_indirect(source_sign_loc), source_sign_byte); + IF( source_sign, eq_op, integer_zero_node ) + { + gg_assign(gg_indirect(dest_sign_loc), + build_int_cst_type(UCHAR, + charmap_dest->mapped_character(ascii_plus))); + } + ELSE + { + gg_assign(gg_indirect(dest_sign_loc), + build_int_cst_type(UCHAR, + charmap_dest->mapped_character(ascii_minus))); + } + ENDIF + break; } moved = true; } @@ -15337,7 +15682,9 @@ mh_source_is_group( const cbl_refer_t &destref, ELSE { // There are too-few source bytes: - gg_memset(tdest, build_int_cst_type(INT, internal_space), dbytes); + charmap_t *charmap = __gg__get_charmap(destref.field->codeset.encoding); + int dest_space = charmap->mapped_character(ascii_space); + gg_memset(tdest, build_int_cst_type(INT, dest_space), dbytes); gg_memcpy(tdest, tsource, sbytes); } ENDIF @@ -15346,6 +15693,141 @@ mh_source_is_group( const cbl_refer_t &destref, return retval; } +static bool +mh_source_is_literalA(const cbl_refer_t &destref, + const cbl_refer_t &sourceref, + cbl_round_t rounded, + tree size_error) + { + bool moved = false; + if( sourceref.field->type == FldLiteralA ) + { + // We are moving a literal somewhere. Because a program-id can take + // variables of ANY LENGTH, we don't know the length of the target + // variable. We do, however, know its encoding. So, we are going to + // construct a string with the same number of characters as the source, but + // in the target variable's encoding. + + // We will then call a library routine that will be in charge of trimming + // and space filling. + + cbl_encoding_t encoding_dest = destref.field->codeset.encoding; + charmap_t *charmap_dest = __gg__get_charmap(encoding_dest); + + if( destref.refmod.from + || destref.refmod.len ) + { + // Let the move routine know to treat the destination as alphanumeric + gg_attribute_bit_set(destref.field, refmod_e); + } + + static char *buffer = NULL; + static size_t buffer_size = 0; + size_t source_length = sourceref.field->data.capacity; + + if( buffer_size < source_length ) + { + buffer_size = source_length; + buffer = static_cast(xrealloc(buffer, source_length)); + } + gcc_assert(buffer); + + cbl_figconst_t figconst = cbl_figconst_of( sourceref.field->data.initial); + if( figconst ) + { + // We are going to fill 'buffer' with a solid run of the figurative + // constant in the destination codeset. + char const_char = 0x7F; // Head off a compiler warning about + // // uninitialized variables + switch(figconst) + { + case normal_value_e : + // This is not possible, it says here in the fine print. + abort(); + break; + case low_value_e : + const_char = charmap_dest->low_value_character(); + break; + case zero_value_e : + const_char = charmap_dest->mapped_character(ascii_zero); + break; + case space_value_e : + const_char = charmap_dest->mapped_character(ascii_space); + break; + case quote_value_e : + const_char = charmap_dest->quote_character(); + break; + case high_value_e : + const_char = charmap_dest->high_value_character(); + break; + case null_value_e: + const_char = 0x00; + break; + } + memset(buffer, const_char, source_length); + } + else + { + // We are going to convert the source string to the destination codeset, + // and then copy it to 'buffer', trimming if necessary, and space-filling + // to the right if necessary: + cbl_encoding_t encoding_src = sourceref.field->codeset.encoding; + + size_t outlength; + const char *source_string = __gg__iconverter( encoding_src, + encoding_dest, + sourceref.field->data.initial, + source_length, + &outlength ); + // Copy over the converted string + memcpy( buffer, + source_string, + outlength ); + } + + // If the source is flagged ALL, or if we are setting the destination to + // a figurative constant, pass along the ALL bit: + int rounded_parameter = rounded + | ((sourceref.all || figconst ) ? REFER_ALL_BIT : 0); + + if( size_error ) + { + gg_assign(size_error, + gg_call_expr( INT, + "__gg__move_literala", + gg_get_address_of(destref.field->var_decl_node), + refer_offset(destref), + refer_size_dest(destref), + build_int_cst_type(INT, rounded_parameter), + build_string_literal(source_length, + buffer), + build_int_cst_type( SIZE_T, source_length), + NULL_TREE)); + } + else + { + gg_call ( INT, + "__gg__move_literala", + gg_get_address_of(destref.field->var_decl_node), + refer_offset(destref), + refer_size_dest(destref), + build_int_cst_type(INT, rounded_parameter), + build_string_literal(source_length, + buffer), + build_int_cst_type( SIZE_T, source_length), + NULL_TREE); + } + if( destref.refmod.from + || destref.refmod.len ) + { + // Return that value to its original form + gg_attribute_bit_clear(destref.field, refmod_e); + } + moved = true; + } + return moved; + } + static void move_helper(tree size_error, // This is an INT cbl_refer_t destref, @@ -15451,112 +15933,10 @@ move_helper(tree size_error, // This is an INT if( !moved && sourceref.field->type == FldLiteralA) { - SHOW_PARSE1 - { - SHOW_PARSE_INDENT - SHOW_PARSE_TEXT("__gg__move_literala") - } - - cbl_figconst_t figconst = cbl_figconst_of( sourceref.field->data.initial); - - if( destref.refmod.from - || destref.refmod.len ) - { - // Let the move routine know to treat the destination as alphanumeric - gg_attribute_bit_set(destref.field, refmod_e); - } - - static char *buffer = NULL; - static size_t buffer_size = 0; - size_t source_length = sourceref.field->data.capacity; - - if( buffer_size < source_length ) - { - buffer_size = source_length; - buffer = static_cast(xrealloc(buffer, buffer_size)); - } - gcc_assert(buffer); - - if( figconst ) - { - char const_char = 0x7F; // Head off a compiler warning about - // // uninitialized variables - switch(figconst) - { - case normal_value_e : - // This is not possible, it says here in the fine print. - abort(); - break; - case low_value_e : - const_char = ascii_to_internal(__gg__low_value_character); - break; - case zero_value_e : - const_char = internal_zero; - break; - case space_value_e : - const_char = internal_space; - break; - case quote_value_e : - const_char = ascii_to_internal(__gg__quote_character); - break; - case high_value_e : - const_char = ascii_to_internal(__gg__high_value_character); - break; - case null_value_e: - const_char = 0x00; - break; - } - memset(buffer, const_char, source_length); - } - else - { - memset( buffer, ascii_space, source_length); - memcpy( buffer, - sourceref.field->data.initial, - std::min(source_length, (size_t)sourceref.field->data.capacity) ); - for( size_t i=0; ivar_decl_node), - refer_offset(destref), - refer_size_dest(destref), - build_int_cst_type(INT, rounded_parameter), - build_string_literal(source_length, - buffer), - build_int_cst_type( SIZE_T, source_length), - NULL_TREE)); - } - else - { - gg_call ( INT, - "__gg__move_literala", - gg_get_address_of(destref.field->var_decl_node), - refer_offset(destref), - refer_size_dest(destref), - build_int_cst_type(INT, rounded_parameter), - build_string_literal(source_length, - buffer), - build_int_cst_type( SIZE_T, source_length), - NULL_TREE); - } - if( destref.refmod.from - || destref.refmod.len ) - { - // Return that value to its original form - gg_attribute_bit_clear(destref.field, refmod_e); - } - moved = true; + moved = mh_source_is_literalA(destref, + sourceref, + rounded, + size_error); } if( !moved ) @@ -15837,43 +16217,11 @@ initial_from_initial(cbl_field_t *field) int rdigits; // Let's handle the possibility of a figurative constant - cbl_figconst_t figconst = cbl_figconst_of( field->data.initial); - //cbl_figconst_t figconst = (cbl_figconst_t)(field->attr & FIGCONST_MASK); + cbl_figconst_t figconst = cbl_figconst_of(field->data.initial); if( figconst ) { - int const_char = 0xFF; // Head off a compiler warning about uninitialized - // // variables - switch(figconst) - { - case normal_value_e : - // This really should never happen because normal_value_e is zero - abort(); - break; - case low_value_e : - const_char = ascii_to_internal(__gg__low_value_character); - break; - case zero_value_e : - const_char = internal_zero; - break; - case space_value_e : - const_char = internal_space; - break; - case quote_value_e : - const_char = ascii_to_internal(__gg__quote_character); - break; - case high_value_e : - if( __gg__high_value_character == DEGENERATE_HIGH_VALUE ) - { - const_char = __gg__high_value_character; - } - else - { - const_char = ascii_to_internal(__gg__high_value_character); - } - break; - case null_value_e: - break; - } + charmap_t *charmap = __gg__get_charmap(field->codeset.encoding); + int const_char = charmap->figconst_character(figconst); bool set_return = figconst != zero_value_e; if( !set_return ) { @@ -15962,6 +16310,8 @@ initial_from_initial(cbl_field_t *field) case FldNumericDisplay: { + charmap_t *charmap = __gg__get_charmap(field->codeset.encoding); + retval = static_cast(xmalloc(field->data.capacity)); gcc_assert(retval); char *pretval = retval; @@ -15988,17 +16338,17 @@ initial_from_initial(cbl_field_t *field) // This zoned decimal value is signable, separate, and leading. if( negative ) { - *pretval++ = internal_minus; + *pretval++ = charmap->mapped_character(ascii_minus); } else { - *pretval++ = internal_plus; + *pretval++ = charmap->mapped_character(ascii_plus); } } for(size_t i=0; idata.digits; i++) { - // Start by assuming its an value that can't be signed - *pretval++ = internal_zero + ((*digits++) & 0x0F); + // Start by assuming it's an value that can't be signed + *pretval++ = charmap->mapped_character(ascii_0) + ((*digits++) & 0x0F); } if( (field->attr & signable_e) && (field->attr & separate_e) @@ -16007,11 +16357,11 @@ initial_from_initial(cbl_field_t *field) // The value is signable, separate, and trailing if( negative ) { - *pretval++ = internal_minus; + *pretval++ = charmap->mapped_character(ascii_minus); } else { - *pretval++ = internal_plus; + *pretval++ = charmap->mapped_character(ascii_plus); } } if( (field->attr & signable_e) @@ -16019,18 +16369,10 @@ initial_from_initial(cbl_field_t *field) { // This value is signable, and not separate. So, the sign information // goes into the first or last byte: - char *sign_location = field->attr & leading_e ? + char *sign_location = field->attr & leading_e ? retval : retval + field->data.digits - 1 ; - if( internal_codeset_is_ebcdic() ) - { - // Change the zone from 0xFO to 0xC0 - *sign_location &= (ZONE_SIGNED_EBCDIC + 0x0F); - } - if( negative ) - { - // Turn on the sign bit: - *sign_location |= NUMERIC_DISPLAY_SIGN_BIT; - } + *sign_location = charmap->set_digit_negative(*sign_location, + negative); } break; } @@ -16113,10 +16455,8 @@ initial_from_initial(cbl_field_t *field) } else { - size_t buffer_size = 0; size_t length = field->data.capacity; - memset(retval, internal_space, length); - raw_to_internal(&retval, &buffer_size, field->data.initial, length); + memcpy(retval, field->data.initial, length); if( strlen(field->data.initial) < length ) { // If this is true, then the initial string must've been Z'xyz' @@ -16130,6 +16470,7 @@ initial_from_initial(cbl_field_t *field) case FldNumericEdited: { + charmap_t *charmap = __gg__get_charmap(field->codeset.encoding); retval = static_cast(xmalloc(field->data.capacity+1)); gcc_assert(retval); if( field->data.initial && field->attr & quoted_e ) @@ -16140,12 +16481,12 @@ initial_from_initial(cbl_field_t *field) strlen(field->data.initial)); for(size_t i=0; idata.initial[i]); + retval[i] = field->data.initial[i]; } if( length < (size_t)field->data.capacity ) { memset( retval+length, - internal_space, + charmap->mapped_character(ascii_space), (size_t)field->data.capacity - length); } } @@ -16169,7 +16510,9 @@ initial_from_initial(cbl_field_t *field) if( (field->attr & blank_zero_e) && real_iszero (&value) ) { - memset(retval, internal_space, field->data.capacity); + memset( retval, + charmap->mapped_character(ascii_space), + field->data.capacity); } else { @@ -16213,6 +16556,10 @@ initial_from_initial(cbl_field_t *field) case FldLiteralN: { +//// retval = static_cast(xmalloc(field->data.capacity+1)); +//// gcc_assert(retval); +//// memcpy(retval, field->data.initial, field->data.capacity); +//// retval[field->data.capacity] = '\0'; break; } @@ -16368,13 +16715,24 @@ actually_create_the_static_field( cbl_field_t *new_var, build_int_cst_type(SCHAR, new_var->data.rdigits) ); next_field = TREE_CHAIN(next_field); + // INT, "encoding", + CONSTRUCTOR_APPEND_ELT(CONSTRUCTOR_ELTS(constr), + next_field, + build_int_cst_type(INT, new_var->codeset.encoding)); + next_field = TREE_CHAIN(next_field); + + // INT, "alphabet", + CONSTRUCTOR_APPEND_ELT(CONSTRUCTOR_ELTS(constr), + next_field, + build_int_cst_type(INT, new_var->codeset.alphabet)); + next_field = TREE_CHAIN(next_field); + DECL_INITIAL(new_var_decl) = constr; } static void psa_global(cbl_field_t *new_var) { - if( strcmp(new_var->name, "_VERY_TRUE") == 0 ) { new_var->var_decl_node = boolean_true_node; @@ -16579,11 +16937,10 @@ psa_FldLiteralA(struct cbl_field_t *field ) // We are constructing a completely static constant structure. We know the // capacity. We'll create it from the data.initial. The cblc_field_t:data - // will be an ASCII/EBCDIC copy of the .initial data. The .initial will be - // left as ASCII. The var_decl_node will be an ordinary cblc_field_t, which - // means that at this point in time, a FldLiteralA can be used anywhere a - // FldGroup or FldAlphanumeric can be used. We are counting on the parser - // not allowing a FldLiteralA to be a left-hand-side variable. + // will be a copy of the .initial data. The var_decl_node will be an ordinary + // cblc_field_t, which means that at this point in time, a FldLiteralA can be + // used anywhere a FldGroup or FldAlphanumeric can be used. We are counting + // on the parser not allowing a FldLiteralA to be a left-hand-side variable. // First make room static size_t buffer_size = 1024; @@ -16598,17 +16955,7 @@ psa_FldLiteralA(struct cbl_field_t *field ) cbl_figconst_t figconst = cbl_figconst_of( field->data.initial ); gcc_assert(figconst == normal_value_e); - if( internal_codeset_is_ebcdic() ) - { - for( size_t i=0; idata.capacity; i++ ) - { - buffer[i] = ascii_to_internal(field->data.initial[i]); - } - } - else - { - memcpy(buffer, field->data.initial, field->data.capacity); - } + memcpy(buffer, field->data.initial, field->data.capacity); buffer[field->data.capacity] = '\0'; // We have the original nul-terminated text at data.initial. We have a @@ -16673,12 +17020,6 @@ psa_FldLiteralA(struct cbl_field_t *field ) TREE_STATIC(field->var_decl_node) = 1; DECL_PRESERVE_P (field->var_decl_node) = 1; } -// TRACE1 -// { -// TRACE1_INDENT -// TRACE1_TEXT("Finished") -// TRACE1_END -// } } #endif @@ -16859,12 +17200,6 @@ parser_symbol_add(struct cbl_field_t *new_var ) goto done; } - if( new_var->type == FldBlob ) - { - psa_FldBlob(new_var); - goto done; - } - if( new_var->type == FldLiteralA ) { new_var->data.picture = ""; @@ -16873,13 +17208,7 @@ parser_symbol_add(struct cbl_field_t *new_var ) } size_t length_of_initial_string = 0; - const char *new_initial = NULL; - - // gg_printf("parser_symbol_add %s\n", build_string_literal( strlen(new_var->name)+1, new_var->name), NULL_TREE); - - // If we are dealing with an alphanumeric, and it is not hex_encoded, we - // want to convert to single-byte-encoding (if it happens to be UTF-8) and - // to EBCDIC, if EBCDIC is in force: + char *new_initial = NULL; // Make sure we have a new variable to work with. if( !new_var ) @@ -17321,7 +17650,9 @@ parser_symbol_add(struct cbl_field_t *new_var ) } else { - new_initial = new_var->data.initial; + new_initial = static_cast(xmalloc(length_of_initial_string)); + gcc_assert(new_initial); + memcpy(new_initial, new_var->data.initial, length_of_initial_string); } actual_allocate: @@ -17331,6 +17662,7 @@ parser_symbol_add(struct cbl_field_t *new_var ) new_initial, immediate_parent, new_var_decl); + free(new_initial); if( level_88_string ) { diff --git a/gcc/cobol/genapi.h b/gcc/cobol/genapi.h index b86be8e97909..6582d2e8898d 100644 --- a/gcc/cobol/genapi.h +++ b/gcc/cobol/genapi.h @@ -81,7 +81,7 @@ void parser_accept_date_dow( cbl_field_t *tgt ); void parser_accept_date_hhmmssff( cbl_field_t *tgt ); void -parser_alphabet( cbl_alphabet_t& alphabet ); +parser_alphabet( const cbl_alphabet_t& alphabet ); void parser_alphabet_use( cbl_alphabet_t& alphabet ); @@ -90,6 +90,18 @@ parser_allocate( cbl_refer_t size_or_based, cbl_refer_t returning, bool initiali void parser_free( size_t n, cbl_refer_t refers[] ); +void parser_xml_parse( cbl_label_t *stmt, + cbl_refer_t input, + cbl_field_t *encoding, + cbl_field_t *validating, + bool returns_national, + cbl_label_t *from_proc, + cbl_label_t *to_proc ); + +void parser_xml_on_exception( cbl_label_t *name ); +void parser_xml_not_exception( cbl_label_t *name ); +void parser_xml_end( cbl_label_t *name ); + void parser_add( size_t nC, cbl_num_result_t *C, size_t nA, cbl_refer_t *A, @@ -322,6 +334,9 @@ parser_label_label( struct cbl_label_t *label ); void parser_label_goto( struct cbl_label_t *label ); +callback_t * +parser_label_addr( struct cbl_label_t *label ); + void parser_goto( cbl_refer_t value, size_t narg, cbl_label_t * const labels[] ); @@ -558,8 +573,9 @@ void parser_call( cbl_refer_t name, void parser_entry_activate( size_t iprog, const cbl_label_t *declarative ); -void parser_entry( cbl_field_t *name, - size_t narg = 0, cbl_ffi_arg_t args[] = NULL); +void parser_entry( const cbl_field_t *name, + size_t narg = 0, + cbl_ffi_arg_t args[] = NULL); bool is_ascending_key(const cbl_refer_t& key); diff --git a/gcc/cobol/gengen.cc b/gcc/cobol/gengen.cc index 3ad33442119c..f3642f2d736f 100644 --- a/gcc/cobol/gengen.cc +++ b/gcc/cobol/gengen.cc @@ -1830,7 +1830,10 @@ gg_build_logical_expression(tree operand_a, } void -gg_create_goto_pair(tree *goto_expr, tree *label_expr, tree *label_addr, const char *name) +gg_create_goto_pair(tree *goto_expr, + tree *label_expr, + tree *label_addr, + const char *name) { // We are going to create a pair of expressions for our // caller. They are a matched set of goto/label expressions, @@ -1886,16 +1889,6 @@ gg_create_goto_pair(tree *goto_expr, *label_addr = gg_get_address_of(*label_decl); } -void -gg_goto_label_decl(tree label_decl) - { - tree goto_expr = build1_loc( gg_token_location(), - GOTO_EXPR, - void_type_node, - label_decl); - gg_append_statement(goto_expr); - } - void gg_create_goto_pair(tree *goto_expr, tree *label_expr) { diff --git a/gcc/cobol/gengen.h b/gcc/cobol/gengen.h index 96e69dd3ac70..e785ac7819af 100644 --- a/gcc/cobol/gengen.h +++ b/gcc/cobol/gengen.h @@ -495,7 +495,6 @@ void gg_create_goto_pair( tree *goto_expr, tree *label_expr, tree *label_addr, tree *label_decl); -void gg_goto_label_decl(tree label_decl); // Used for implementing SECTIONS and PARAGRAPHS. When you have a // void *pointer = &&label, gg_goto is the same as diff --git a/gcc/cobol/genmath.cc b/gcc/cobol/genmath.cc index 27d5c1ee65fc..320e6bf43664 100644 --- a/gcc/cobol/genmath.cc +++ b/gcc/cobol/genmath.cc @@ -178,6 +178,7 @@ arithmetic_operation(size_t nC, cbl_num_result_t *C, temp_field.data.rdigits = remainder->field->data.rdigits ; temp_field.data.initial = remainder->field->data.initial ; temp_field.data.picture = remainder->field->data.picture ; + temp_field.codeset = remainder->field->codeset ; parser_symbol_add(&temp_field); temp_remainder.field = &temp_field; diff --git a/gcc/cobol/genutil.cc b/gcc/cobol/genutil.cc index 4b296e46e877..56b6b83728b5 100644 --- a/gcc/cobol/genutil.cc +++ b/gcc/cobol/genutil.cc @@ -50,8 +50,6 @@ #include "../../libgcobol/exceptl.h" #include "exceptg.h" -bool internal_codeset_is_ebcdic() { return gcobol_feature_internal_ebcdic(); } - bool exception_location_active = true; bool skip_exception_processing = true; @@ -107,8 +105,13 @@ tree var_decl_treeplet_4s; // SIZE_T_P , "__gg__treeplet_4s" // wasn't successful figuring out how to create an actual NOP assembly language // instruction, I instead gg_assign(var_decl_nop, integer_zero_node) tree var_decl_nop; // int __gg__nop; + +// Indicates which routine main() called tree var_decl_main_called; // int __gg__main_called; +// Indicates the target label for an ENTRY statement +tree var_decl_entry_label; // void* __gg__entry_label + #if 0 #define REFER(a) #else @@ -890,7 +893,8 @@ get_binary_value( tree value, signp, pointer, build_int_cst_type(INT, field->data.digits), - NULL_TREE)); + build_int_cst_type(INT, field->codeset.encoding), + NULL_TREE)); // Assign the value we got from the string to our "return" value: gg_assign(value, gg_cast(TREE_TYPE(value), val128)); } @@ -1739,11 +1743,13 @@ get_literal_string(cbl_field_t *field) size_t buffer_length = field->data.capacity+1; char *buffer = static_cast(xcalloc(1, buffer_length)); - for(size_t i=0; idata.capacity; i++) - { - buffer[i] = ascii_to_internal(field->data.initial[i]); - } - + size_t charsout; + const char *converted = __gg__iconverter(DEFAULT_CHARMAP_SOURCE, + field->codeset.encoding, + field->data.initial, + field->data.capacity, + &charsout); + memcpy(buffer, converted, field->data.capacity+1); return buffer; } diff --git a/gcc/cobol/genutil.h b/gcc/cobol/genutil.h index f12124ecc5b9..251b1c11631b 100644 --- a/gcc/cobol/genutil.h +++ b/gcc/cobol/genutil.h @@ -30,13 +30,6 @@ #ifndef _GENUTIL_H_ #define _GENUTIL_H_ -#define EBCDIC_MINUS (0x60) -#define EBCDIC_PLUS (0x4E) -#define EBCDIC_ZERO (0xF0) -#define EBCDIC_NINE (0xF9) - -bool internal_codeset_is_ebcdic(); - extern bool exception_location_active; extern bool skip_exception_processing; @@ -84,9 +77,9 @@ extern tree var_decl_treeplet_3s; // SIZE_T_P , "__gg__treeplet_3 extern tree var_decl_treeplet_4f; // cblc_field_pp_type_node , "__gg__treeplet_4f" extern tree var_decl_treeplet_4o; // SIZE_T_P , "__gg__treeplet_4o" extern tree var_decl_treeplet_4s; // SIZE_T_P , "__gg__treeplet_4s" - extern tree var_decl_nop; // int __gg__nop extern tree var_decl_main_called; // int __gg__main_called +extern tree var_decl_entry_label; // void* __gg__entry_label int get_scaled_rdigits(cbl_field_t *field); int get_scaled_digits(cbl_field_t *field); diff --git a/gcc/cobol/parse.y b/gcc/cobol/parse.y index 039cb957de0c..9187a59a3cfc 100644 --- a/gcc/cobol/parse.y +++ b/gcc/cobol/parse.y @@ -51,18 +51,56 @@ accept_envar_e, }; + struct collating_an_t { + const char *alpha, *national; + }; + + struct label_pair_t { + cbl_label_t *from, *to; + }; + +class locale_tgt_t { + char user_system_default; + std::vector categories; + public: + locale_tgt_t() : user_system_default('\0') {} + locale_tgt_t( int category ) + : user_system_default('\0') + , categories(1, category) + {} + locale_tgt_t operator=( int ch ) { + assert(categories.empty()); + switch(ch) { + case 'S': case 'U': + user_system_default = ch; + return *this; + } + gcc_unreachable(); + } + locale_tgt_t push_back( int token ) { + categories.push_back(token); + return *this; + } + + bool is_default() const { return 0 < user_system_default; } + char default_of() const { + assert(categories.empty()); + return user_system_default; + } + const std::vector& lc_categories() const { return categories; } +}; + class literal_t { size_t isym; public: + cbl_encoding_t encoding; char prefix[3]; size_t len; char *data; bool empty() const { return data == NULL; } size_t isymbol() const { return isym; } - const char * symbol_name() const { - return isym? cbl_field_of(symbol_at(isym))->name : ""; - } + const char * symbol_name() const; literal_t& set( size_t len, char *data, const char prefix[] ) { @@ -71,17 +109,8 @@ return *this; } - literal_t& - set( const cbl_field_t * field ) { - assert(field->has_attr(constant_e)); - assert(is_literal(field)); - - set_prefix( "", 0 ); - set_data( field->data.capacity, - const_cast(field->data.initial), - field_index(field) ); - return *this; - } + literal_t& set( const cbl_field_t * field ); + literal_t& set_data( size_t len, char *data, size_t isym = 0 ) { this->isym = isym; @@ -94,13 +123,8 @@ } return *this; } - literal_t& - set_prefix( const char *input, size_t len ) { - assert(len < sizeof(prefix)); - std::fill(prefix, prefix + sizeof(prefix), '\0'); - std::transform(input, input + len, prefix, toupper); - return *this; - } + literal_t& set_prefix( const char *input, size_t len ); + bool compatible_prefix( const literal_t& that ) const { if( prefix[0] != that.prefix[0] ) { @@ -300,6 +324,7 @@ #include "genapi.h" #include "../../libgcobol/exceptl.h" #include "exceptg.h" +#include "../../libgcobol/charmaps.h" #include "parse_ante.h" %} @@ -364,6 +389,7 @@ %token MIGHT_BE "IS or IS NOT" FUNCTION_UDF "UDF name" FUNCTION_UDF_0 "UDF" + DEFAULT %token DATE_FMT "date format" TIME_FMT "time format" @@ -426,7 +452,7 @@ CF CH CHANGED CHAR CHAR_NATIONAL "CHAR-NATIONAL" CHARACTER CHARACTERS CHECKING CLASS - COBOL CODE CODESET COLLATING + COBOL CODE CODESET "CODE-SET" COLLATING COLUMN COMBINED_DATETIME "COMBINED-DATETIME" COMMA COMMAND_LINE "COMMAND-LINE" COMMAND_LINE_COUNT "COMMAND-LINE-COUNT" @@ -445,13 +471,13 @@ DAY_OF_WEEK "DAY-OF-WEEK" DAY_TO_YYYYDDD "DAY-TO-YYYYDDD" DBCS DE DEBUGGING DECIMAL_POINT - DECLARATIVES DEFAULT DELIMITED DELIMITER DEPENDING + DECLARATIVES DELIMITED DELIMITER DEPENDING DESCENDING DETAIL DIRECT DIRECT_ACCESS "DIRECT-ACCESS" DOWN DUPLICATES DYNAMIC - E EBCDIC EC EGCS ENTRY ENVIRONMENT EQUAL EVERY + E EBCDIC EC EGCS ENCODING ENTRY ENVIRONMENT EQUAL EVERY EXAMINE EXHIBIT EXP EXP10 EXTEND EXTERNAL EXCEPTION_FILE "EXCEPTION-FILE" @@ -494,7 +520,7 @@ INTEGER_OF_DAY "INTEGER-OF-DAY" INTEGER_OF_FORMATTED_DATE "INTEGER-OF-FORMATTED-DATE" INTEGER_PART "INTEGER-PART" - INTO INTRINSIC INVOKE IO IO_CONTROL "IO-CONTROL" + INTO INTRINSIC INVOKE IO "I-O" IO_CONTROL "I-O-CONTROL" IS ISNT "IS NOT" KANJI KEY @@ -539,7 +565,7 @@ PAGE_COUNTER "PAGE-COUNTER" PF PH PI PIC PICTURE PLUS PRESENT_VALUE PRINT_SWITCH - PROCEDURE PROCEDURES PROCEED PROCESS + PROCEDURE PROCEDURES PROCEED PROCESS PROCESSING PROGRAM_ID "PROGRAM-ID" PROGRAM_kw "Program" PROPERTY PROTOTYPE PSEUDOTEXT @@ -570,7 +596,7 @@ STATUS STRONG SUBSTITUTE SUM SYMBOL SYMBOLIC SYNCHRONIZED - TALLY TALLYING TAN TERMINATE TEST + TALLYING TAN TERMINATE TEST TEST_DATE_YYYYMMDD "TEST-DATE-YYYYMMDD" TEST_DAY_YYYYDDD "TEST-DAY-YYYYDDD" TEST_FORMATTED_DATETIME "TEST-FORMATTED-DATETIME" @@ -587,10 +613,9 @@ UP UPON UPOS UPPER_CASE USAGE USING USUBSTR USUPPLEMENTARY UTILITY UUID4 UVALID UWIDTH - VALUE VARIANCE VARYING VOLATILE + VALIDATING VALUE VARIANCE VARYING VOLATILE WHEN_COMPILED WITH WORKING_STORAGE - XML XMLGENERATE XMLPARSE YEAR_TO_YYYY YYYYDDD YYYYMMDD /* unused Context Words */ @@ -634,6 +659,8 @@ UNDERLINE UNSIGNED_kw UTF_16 "UTF-16" UTF_8 "UTF-8" + XMLGENERATE "XML GENERATE" + XMLPARSE "XML PARSE" ADDRESS END_ACCEPT "END-ACCEPT" @@ -655,6 +682,7 @@ END_SUBTRACT "END-SUBTRACT" END_UNSTRING "END-UNSTRING" END_WRITE "END-WRITE" + END_XML "END-XML" END_IF "END-IF" /* end tokens without semantic value */ @@ -665,7 +693,7 @@ %type sentence statements statement %type star_cbl_opt close_how -%type test_before usage_clause1 might_be +%type test_before usage_clause1 might_be alphanational %type all optional sign_leading on_off initialized strong is_signed %type count data_clauses data_clause %type nine nines nps relop spaces_etc reserved_value signed @@ -673,7 +701,9 @@ %type true_false posneg eval_posneg %type open_io alphabet_etc %type device_name -%type numed collating_sequence context_word ctx_name locale_spec +%type numed context_word ctx_name locale_spec +%type collating_sequences collating_ans +%type collating_an %type namestr alphabet_lit program_as repo_as %type perform_cond kind_of_name %type alloc_ret @@ -782,6 +812,7 @@ %type on_overflow on_overflows %type arith_err arith_errs %type accept_except accept_excepts call_except call_excepts + %type compute_body %type ffi_name set_operand set_tgt scalar_arg unstring_src @@ -805,6 +836,12 @@ %type mistake globally first_last %type io_mode +%type xmlprocs +%type xmlexcept xmlexcepts +%type xmlencoding xmlvalidating +%type xmlreturning +%type