diff options
author | Martin Liska <mliska@suse.cz> | 2021-06-21 09:32:59 +0200 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2021-06-21 09:32:59 +0200 |
commit | 86e9a5c431d1af7ca07356a7763d806ab6368bad (patch) | |
tree | 2df2be4b85977bdf74d29c3f8b73f8de6fe4d544 | |
parent | d79a408d0e2693048ac20d7ac469115fc906f2da (diff) | |
parent | e24379c789800188281514235d4a37ff98ad7826 (diff) | |
download | gcc-86e9a5c431d1af7ca07356a7763d806ab6368bad.zip gcc-86e9a5c431d1af7ca07356a7763d806ab6368bad.tar.gz gcc-86e9a5c431d1af7ca07356a7763d806ab6368bad.tar.bz2 |
Merge branch 'master' into devel/sphinx
249 files changed, 10040 insertions, 3652 deletions
@@ -1,3 +1,12 @@ +2021-06-18 Antoni Boucher <bouanto@zoho.com> + + * MAINTAINERS (Write After Approval): Add myself. + +2021-06-17 Aldy Hernandez <aldyh@redhat.com> + + * MAINTAINERS (Various Maintainers): Add Andrew and myself + as *vrp and ranger maintainers. + 2021-06-05 Jeff Law <jeffreyalaw@gmail.com> * MAINTAINERS: Adjust my entry in the DCO section so that it does diff --git a/MAINTAINERS b/MAINTAINERS index e044778..4ac4fc5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -74,6 +74,7 @@ hppa port John David Anglin <dave.anglin@bell.net> i386 port Jan Hubicka <hubicka@ucw.cz> i386 port Uros Bizjak <ubizjak@gmail.com> i386 vector ISA extns Kirill Yukhin <kirill.yukhin@gmail.com> +i386 vector ISA extns Hongtao Liu <hongtao.liu@intel.com> iq2000 port Nick Clifton <nickc@redhat.com> lm32 port Sebastien Bourdeauducq <sebastien@milkymist.org> m32r port Nick Clifton <nickc@redhat.com> @@ -337,6 +338,7 @@ Lynn Boger <laboger@linux.vnet.ibm.com> Ian Bolton <ian.bolton@arm.com> Andrea Bona <andrea.bona@st.com> Neil Booth <neil@daikokuya.co.uk> +Antoni Boucher <bouanto@zoho.com> Robert Bowdidge <bowdidge@apple.com> Joel Brobecker <brobecker@gnat.com> Dave Brolley <brolley@redhat.com> diff --git a/contrib/ChangeLog b/contrib/ChangeLog index d8df6be..6d5a2e4 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,8 @@ +2021-06-17 Jason Merrill <jason@redhat.com> + + * mklog.py: Add an initial component: [PRnnnnn] line when + we have a PR. + 2021-06-13 Tobias Burnus <tobias@codesourcery.com> * gcc-changelog/git_commit.py (pr_regex): Add ?P<pr> for group('pr'). diff --git a/contrib/mklog.py b/contrib/mklog.py index 5c93c70..1f59055 100755 --- a/contrib/mklog.py +++ b/contrib/mklog.py @@ -39,6 +39,7 @@ import requests from unidiff import PatchSet pr_regex = re.compile(r'(\/(\/|\*)|[Cc*!])\s+(?P<pr>PR [a-z+-]+\/[0-9]+)') +prnum_regex = re.compile(r'PR (?P<comp>[a-z+-]+)/(?P<num>[0-9]+)') dr_regex = re.compile(r'(\/(\/|\*)|[Cc*!])\s+(?P<dr>DR [0-9]+)') dg_regex = re.compile(r'{\s+dg-(error|warning)') identifier_regex = re.compile(r'^([a-zA-Z0-9_#].*)') @@ -67,6 +68,8 @@ PATCH must be generated using diff(1)'s -up or -cp options script_folder = os.path.realpath(__file__) root = os.path.dirname(os.path.dirname(script_folder)) +firstpr = '' + def find_changelog(path): folder = os.path.split(path)[0] @@ -134,6 +137,7 @@ def generate_changelog(data, no_functions=False, fill_pr_titles=False): prs = [] out = '' diff = PatchSet(data) + global firstpr for file in diff: # skip files that can't be parsed @@ -166,6 +170,9 @@ def generate_changelog(data, no_functions=False, fill_pr_titles=False): # Found dg-warning/dg-error line break + if prs: + firstpr = prs[0] + if fill_pr_titles: out += get_pr_titles(prs) @@ -308,8 +315,14 @@ if __name__ == '__main__': start = list(takewhile(lambda l: not l.startswith('#'), lines)) end = lines[len(start):] with open(args.changelog, 'w') as f: + if not start or not start[0]: + # initial commit subject line 'component: [PRnnnnn]' + m = prnum_regex.match(firstpr) + if m: + title = f'{m.group("comp")}: [PR{m.group("num")}]' + start.insert(0, title) if start: - # appent empty line + # append empty line if start[-1] != '': start.append('') else: diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 61a714d..4597e59 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,268 @@ +2021-06-18 Jeff Law <jeffreyalaw@gmail.com> + + * config/h8300/h8300.c (h8300_select_cc_mode): Handle SYMBOL_REF. + * config/h8300/logical.md (<code><mode>3 logcial expander): Generate + more efficient code when the source can be trivially simplified. + +2021-06-18 Andrew MacLeod <amacleod@redhat.com> + + * gimple-range-cache.cc (ranger_cache::range_of_def): Calculate + a range if global is not available. + (ranger_cache::entry_range): Fallback to range_of_def. + * gimple-range-cache.h (range_of_def): Adjust prototype. + +2021-06-18 Andrew MacLeod <amacleod@redhat.com> + + PR tree-optimization/101014 + * gimple-range-cache.cc (ranger_cache::ranger_cache): Remove poor + value list. + (ranger_cache::~ranger_cache): Ditto. + (ranger_cache::enable_new_values): Delete. + (ranger_cache::push_poor_value): Delete. + (ranger_cache::range_of_def): Remove poor value processing. + (ranger_cache::entry_range): Ditto. + (ranger_cache::fill_block_cache): Ditto. + * gimple-range-cache.h (class ranger_cache): Remove poor value members. + * gimple-range.cc (gimple_ranger::range_of_expr): Remove call. + * gimple-range.h (class gimple_ranger): Adjust. + +2021-06-18 Srinath Parvathaneni <srinath.parvathaneni@arm.com> + + PR target/100856 + * common/config/arm/arm-common.c (arm_canon_arch_option_1): New function + derived from arm_canon_arch. + (arm_canon_arch_option): Call it. + (arm_canon_arch_multilib_option): New function. + * config/arm/arm-cpus.in (IGNORE_FOR_MULTILIB): New fgroup. + * config/arm/arm.h (arm_canon_arch_multilib_option): New prototype. + (CANON_ARCH_MULTILIB_SPEC_FUNCTION): New macro. + (MULTILIB_ARCH_CANONICAL_SPECS): New macro. + (DRIVER_SELF_SPECS): Add MULTILIB_ARCH_CANONICAL_SPECS. + * config/arm/arm.opt (mlibarch): New option. + * config/arm/t-rmprofile (MULTILIB_MATCHES): For armv8*-m, replace use + of march on RHS with mlibarch. + +2021-06-18 Marcel Vollweiler <marcel@codesourcery.com> + + * config.in: Regenerate. + * config/gcn/gcn.c (print_operand_address): Fix for global_load assembler + functions. + * configure: Regenerate. + * configure.ac: Fix for global_load assembler functions. + +2021-06-18 Richard Biener <rguenther@suse.de> + + PR tree-optimization/101112 + * tree-vect-slp.c (vect_slp_linearize_chain): Fix condition + to lookup a pattern stmt def. + +2021-06-18 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/101062 + * stor-layout.c (finish_bitfield_layout): Don't add bitfield + representatives in QUAL_UNION_TYPE. + +2021-06-18 Andrew Pinski <apinski@marvell.com> + + * tree-ssa-phiopt.c (replace_phi_edge_with_variable): + Add counting of how many times it is done. + (factor_out_conditional_conversion): Likewise. + (match_simplify_replacement): Likewise. + (value_replacement): Likewise. + (spaceship_replacement): Likewise. + (cond_store_replacement): Likewise. + (cond_if_else_store_replacement_1): Likewise. + (hoist_adjacent_loads): Likewise. + +2021-06-18 Andrew Pinski <apinski@marvell.com> + + * tree-cfg.c (verify_gimple_assign_unary): Reject point and offset + types on NEGATE_EXPR, ABS_EXPR, BIT_NOT_EXPR, PAREN_EXPR and CNONJ_EXPR. + (verify_gimple_assign_binary): Reject point and offset types on + MULT_EXPR, MULT_HIGHPART_EXPR, TRUNC_DIV_EXPR, CEIL_DIV_EXPR, + FLOOR_DIV_EXPR, ROUND_DIV_EXPR, TRUNC_MOD_EXPR, CEIL_MOD_EXPR, + FLOOR_MOD_EXPR, ROUND_MOD_EXPR, RDIV_EXPR, and EXACT_DIV_EXPR. + +2021-06-18 Michael Meissner <meissner@linux.ibm.com> + + * config/rs6000/rs6000.c (rs6000_emit_minmax): Add support for ISA + 3.1 IEEE 128-bit floating point xsmaxcqp/xsmincqp instructions. + * config/rs6000/rs6000.md (s<minmax><mode>3, IEEE128 iterator): + New insns. + +2021-06-17 Aaron Sawdey <acsawdey@linux.ibm.com> + + * config/rs6000/genfusion.pl (gen_logical_addsubf): Add + earlyclobber to alts 0/1. + (gen_addadd): Add earlyclobber to alts 0/1. + * config/rs6000/fusion.md: Regenerate file. + +2021-06-17 Trevor Saunders <tbsaunde@tbsaunde.org> + + * cfgloopanal.c (get_loop_hot_path): Make path an auto_vec. + +2021-06-17 Andrew MacLeod <amacleod@redhat.com> + + * gimple-range-cache.cc: Comment cleanups. + * gimple-range-gori.cc: Comment cleanups. + * gimple-range.cc: Comment/spacing cleanups + * value-range.h: Comment cleanups. + +2021-06-17 H.J. Lu <hjl.tools@gmail.com> + + PR target/100704 + * calls.c (expand_call): Replace PUSH_ARGS with + targetm.calls.push_argument (0). + (emit_library_call_value_1): Likewise. + * defaults.h (PUSH_ARGS): Removed. + (PUSH_ARGS_REVERSED): Replace PUSH_ARGS with + targetm.calls.push_argument (0). + * expr.c (block_move_libcall_safe_for_call_parm): Likewise. + (emit_push_insn): Pass the number bytes to push to + targetm.calls.push_argument and pass 0 if ARGS_ADDR is 0. + * hooks.c (hook_bool_uint_true): New. + * hooks.h (hook_bool_uint_true): Likewise. + * rtlanal.c (nonzero_bits1): Replace PUSH_ARGS with + targetm.calls.push_argument (0). + * target.def (push_argument): Add a targetm.calls hook. + * targhooks.c (default_push_argument): New. + * targhooks.h (default_push_argument): Likewise. + * config/bpf/bpf.h (PUSH_ARGS): Removed. + * config/cr16/cr16.c (TARGET_PUSH_ARGUMENT): New. + * config/cr16/cr16.h (PUSH_ARGS): Removed. + * config/i386/i386.c (ix86_push_argument): New. + (TARGET_PUSH_ARGUMENT): Likewise. + * config/i386/i386.h (PUSH_ARGS): Removed. + * config/m32c/m32c.c (TARGET_PUSH_ARGUMENT): New. + * config/m32c/m32c.h (PUSH_ARGS): Removed. + * config/nios2/nios2.h (PUSH_ARGS): Likewise. + * config/pru/pru.h (PUSH_ARGS): Likewise. + * doc/tm.texi.in: Remove PUSH_ARGS documentation. Add + TARGET_PUSH_ARGUMENT hook. + * doc/tm.texi: Regenerated. + +2021-06-17 Uroš Bizjak <ubizjak@gmail.com> + + PR target/97194 + * config/i386/i386-expand.c (expand_vector_set_var): + Handle V2FS mode remapping. Pass TARGET_MMX_WITH_SSE to + ix86_expand_vector_init_duplicate. + (ix86_expand_vector_init_duplicate): Emit insv_1 for + QImode for !TARGET_PARTIAL_REG_STALL. + * config/i386/predicates.md (vec_setm_mmx_operand): New predicate. + * config/i386/mmx.md (vec_setv2sf): Use vec_setm_mmx_operand + as operand 2 predicate. Call ix86_expand_vector_set_var + for non-constant index operand. + (vec_setv2si): Ditto. + (vec_setv4hi): Ditto. + (vec_setv8qi): ditto. + +2021-06-17 Aldy Hernandez <aldyh@redhat.com> + + PR tree-optimization/100790 + * gimple-range.cc (range_of_builtin_call): Cleanup clz and ctz + code. + +2021-06-17 Martin Liska <mliska@suse.cz> + + * doc/invoke.texi: Use consistently -O1 instead of -O. + +2021-06-17 Martin Liska <mliska@suse.cz> + + * gcov-io.h: Update documentation entry about string format. + +2021-06-17 Marius Hillenbrand <mhillen@linux.ibm.com> + + PR target/100871 + * config/s390/vecintrin.h (vec_doublee): Fix to use + __builtin_s390_vflls. + (vec_floate): Fix to use __builtin_s390_vflrd. + +2021-06-17 Trevor Saunders <tbsaunde@tbsaunde.org> + + * dominance.c (get_dominated_to_depth): Return auto_vec<basic_block>. + * dominance.h (get_dominated_to_depth): Likewise. + (get_all_dominated_blocks): Likewise. + * cfgcleanup.c (delete_unreachable_blocks): Adjust. + * gcse.c (hoist_code): Likewise. + * tree-cfg.c (remove_edge_and_dominated_blocks): Likewise. + * tree-parloops.c (oacc_entry_exit_ok): Likewise. + * tree-ssa-dce.c (eliminate_unnecessary_stmts): Likewise. + * tree-ssa-phiprop.c (pass_phiprop::execute): Likewise. + +2021-06-17 Trevor Saunders <tbsaunde@tbsaunde.org> + + * dominance.c (get_dominated_by_region): Return auto_vec<basic_block>. + * dominance.h (get_dominated_by_region): Likewise. + * tree-cfg.c (gimple_duplicate_sese_region): Adjust. + (gimple_duplicate_sese_tail): Likewise. + (move_sese_region_to_fn): Likewise. + +2021-06-17 Trevor Saunders <tbsaunde@tbsaunde.org> + + * dominance.c (get_dominated_by): Return auto_vec<basic_block>. + * dominance.h (get_dominated_by): Likewise. + * auto-profile.c (afdo_find_equiv_class): Adjust. + * cfgloopmanip.c (duplicate_loop_to_header_edge): Likewise. + * loop-unroll.c (unroll_loop_runtime_iterations): Likewise. + * tree-cfg.c (test_linear_chain): Likewise. + (test_diamond): Likewise. + +2021-06-17 Trevor Saunders <tbsaunde@tbsaunde.org> + + * cfgloop.h (get_loop_hot_path): Return auto_vec<basic_block>. + * cfgloopanal.c (get_loop_hot_path): Likewise. + * tree-ssa-loop-ivcanon.c (tree_estimate_loop_size): Likewise. + +2021-06-17 Trevor Saunders <tbsaunde@tbsaunde.org> + + * cgraph.c (cgraph_node::collect_callers): Return + auto_vec<cgraph_edge *>. + * cgraph.h (cgraph_node::collect_callers): Likewise. + * ipa-cp.c (create_specialized_node): Adjust. + (decide_about_value): Likewise. + (decide_whether_version_node): Likewise. + * ipa-sra.c (process_isra_node_results): Likewise. + +2021-06-17 Trevor Saunders <tbsaunde@tbsaunde.org> + + * vec.h (vl_ptr>::using_auto_storage): Handle null m_vec. + (auto_vec<T, 0>::auto_vec): Define move constructor, and delete copy + constructor. + (auto_vec<T, 0>::operator=): Define move assignment and delete copy + assignment. + +2021-06-17 Aldy Hernandez <aldyh@redhat.com> + + * gimple-range.cc (debug_seed_ranger): New. + (dump_ranger): New. + (debug_ranger): New. + +2021-06-17 Richard Biener <rguenther@suse.de> + + PR tree-optimization/54400 + * tree-vectorizer.h (enum slp_instance_kind): Add + slp_inst_kind_bb_reduc. + (reduction_fn_for_scalar_code): Declare. + * tree-vect-data-refs.c (vect_slp_analyze_instance_dependence): + Check SLP_INSTANCE_KIND instead of looking at the + representative. + (vect_slp_analyze_instance_alignment): Likewise. + * tree-vect-loop.c (reduction_fn_for_scalar_code): Export. + * tree-vect-slp.c (vect_slp_linearize_chain): Split out + chain linearization from vect_build_slp_tree_2 and generalize + for the use of BB reduction vectorization. + (vect_build_slp_tree_2): Adjust accordingly. + (vect_optimize_slp): Elide permutes at the root of BB reduction + instances. + (vectorizable_bb_reduc_epilogue): New function. + (vect_slp_prune_covered_roots): Likewise. + (vect_slp_analyze_operations): Use them. + (vect_slp_check_for_constructors): Recognize associatable + chains for BB reduction vectorization. + (vectorize_slp_instance_root_stmt): Generate code for the + BB reduction epilogue. + 2021-06-17 Andrew MacLeod <amacleod@redhat.com> * gimple-range-gori.cc (gori_compute::has_edge_range_p): Check with diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index f84fbff..8abc411 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20210617 +20210621 diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index f102600..baf0dbd 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,635 @@ +2021-06-18 Gary Dismukes <dismukes@adacore.com> + + * sem_ch3.adb (Constrain_Array): Add error checking for + fixed-lower-bound and constrained index ranges applied + inappropriately on subtypes of unconstrained and + fixed-lower-bound array types. + (Constrain_Index): Correct and refine comment related to + fixed-lower-bound index ranges. + +2021-06-18 Bob Duff <duff@adacore.com> + + * gen_il-gen.adb: Improve comments. + * snames.ads-tmpl (Convention_Id): Remove "-- Plenty of space + for expansion", because that's irrelevant now that we are no + longer laying out node fields by hand. + +2021-06-18 Piotr Trojanek <trojanek@adacore.com> + + * sem_util.adb (Denotes_Same_Object): Handle character literals + just like integer literals. + +2021-06-18 Piotr Trojanek <trojanek@adacore.com> + + * sem_util.adb (Denotes_Same_Object): Explicitly test for node + kinds being the same; deal with renamings one-by-one; adjust + numbers in references to the Ada RM. + +2021-06-18 Bob Duff <duff@adacore.com> + + * sprint.adb (Write_Source_Line): Check for EOF in + Line_Terminator loop. Note that when a source file is read in, + an EOF character is added to the end. + +2021-06-18 Piotr Trojanek <trojanek@adacore.com> + + * sem_aux.adb (Package_Specification): Add assertions to confirm + the kind of the of parameter and returned node. + * sem_ch12.adb (Remove_Parent): Reorder conditions; this change + appears to be semantically neutral, but is enough to avoid the + problematic call to Package_Specification. + * sem_util.adb (Is_Incomplete_Or_Private_Type): Replace loop + with a call to Package_Specification. + +2021-06-18 Bob Duff <duff@adacore.com> + + * sem_attr.adb (Eval_Attribute): For Enum_Lit'Size, use + Enum_Type'Object_Size. + +2021-06-18 Olivier Hainque <hainque@adacore.com> + + * sigtramp-vxworks-target.inc (__aarch64__): Sync + REGNO_PC_OFFSET with the back-end DWARF_ALT_FRAME_RETURN_COLUMN. + In CFI_COMMON_REGS, leave r18 alone, VxWorks private. + +2021-06-18 Javier Miranda <miranda@adacore.com> + + * contracts.adb (Process_Spec_Postconditions): Add missing + support for aliased subprograms and handle wrappers of + class-wide pre/post conditions. + (Process_Inherited_Preconditions): Add missing support for + aliased subprograms and handle wrappers of class-wide pre/post + conditions. + * einfo.ads (Class_Wide_Clone): Fix typo. + (Is_Class_Wide_Clone): Removed since it is not referenced. + (Is_Wrapper): Documenting new flag. + (LSP_Subprogram): Documenting new attribute. + * exp_ch3.adb (Make_Controlling_Function_Wrappers): Decorate + wrapper as Is_Wrapper and adjust call to + Override_Dispatching_Operation. + * freeze.adb (Build_Inherited_Condition_Pragmas): Fix typo in + documentation. + (Check_Inherited_Conditions): Handle LSP wrappers; ensure + correct decoration of LSP wrappers. + * gen_il-fields.ads (Is_Class_Wide_Clone): Removed. + (Is_Wrapper): Added. + (LSP_Subprogram): Added. + * gen_il-gen-gen_entities.adb (Is_Class_Wide_Clone): Removed. + (Is_Wrapper): Added. + (LSP_Subprogram): Added. + * gen_il-internals.adb (Image): Adding uppercase image of + LSP_Subprogram. + * sem_ch6.adb (New_Overloaded_Entity): Fix decoration of LSP + wrappers. + * sem_disp.ads (Override_Dispatching_Operation): Remove + parameter Is_Wrapper; no longer needed. + * sem_disp.adb (Check_Dispatching_Operation): Adjust assertion. + (Override_Dispatching_Operation): Remove parameter Is_Wrapper; + no longer needed. + * treepr.adb (Image): Adding uppercase image of LSP_Subprogram. + +2021-06-18 Arnaud Charlet <charlet@adacore.com> + + * exp_ch4.adb (Expand_N_Quantified_Expression): Ensure the type + of the name of a "for of" loop is frozen. + * exp_disp.adb (Check_Premature_Freezing): Complete condition to + take into account a private type completed by another private + type now that the freezing rule are better implemented. + * freeze.adb (Freeze_Entity.Freeze_Profile): Do not perform an + early freeze on types if not in the proper scope. Special case + expression functions that requires access to the dispatch table. + (Should_Freeze_Type): New. + * sem_ch13.adb (Resolve_Aspect_Expressions): Prevent assert + failure in case of an invalid tree (previous errors detected). + * sem_res.adb (Resolve): Remove kludge related to entities + causing incorrect premature freezing. + * sem_util.adb (Ensure_Minimum_Decoration): Add protection + against non base types. + +2021-06-18 Gary Dismukes <dismukes@adacore.com> + + * sem_ch3.adb (Constrain_Index): Set the High_Bound of a + fixed-lower-bound subtype's range to T (the subtype of the FLB + index being constrained) rather than Base_Type (T). + +2021-06-18 Bob Duff <duff@adacore.com> + + * ada_get_targ.adb, aspects.ads, checks.adb, cstand.adb, + einfo.ads, exp_attr.adb, freeze.adb, get_targ.adb, + libgnat/a-textio.ads, libgnat/g-memdum.ads, + libgnat/s-scaval__128.adb, libgnat/s-scaval.adb, make.adb, + osint.ads, par-prag.adb, sem_ch13.adb, sem_prag.adb, + sem_prag.ads, set_targ.adb, set_targ.ads, snames.ads-tmpl, + targparm.ads, types.ads: Remove AAMP-specific code. + * switch.ads: Minor reformatting. + * gen_il-fields.ads, gen_il-gen.adb, + gen_il-gen-gen_entities.adb, gen_il-types.ads, einfo-utils.adb, + einfo-utils.ads: Package Types now contains "type Float_Rep_Kind + is (IEEE_Binary);", which used to also have an enumeral AAMP. + Gen_IL can't handle fields of this type, which would be zero + sized. Therefore, we move the Float_Rep field into Einfo.Utils + as a synthesized attribute. (We do not delete the field + altogether, in case we want new floating-point representations + in the future.) + * doc/gnat_rm/implementation_defined_pragmas.rst, + doc/gnat_rm/implementation_defined_aspects.rst, + doc/gnat_ugn/building_executable_programs_with_gnat.rst, + doc/gnat_ugn/the_gnat_compilation_model.rst: Remove + AAMP-specific documentation. + * gnat_rm.texi, gnat_ugn.texi: Regenerate. + +2021-06-18 Gary Dismukes <dismukes@adacore.com> + + * exp_util.adb (Expand_Sliding_Conversion): Move test of + Is_Fixed_Lower_Bound_Subtype to an assertion. Exclude string + literals from sliding expansion. + +2021-06-18 Piotr Trojanek <trojanek@adacore.com> + + * sem_warn.adb (Warn_On_Overlapping_Actuals): Cleanup conditions + related to Ada_Version. + +2021-06-18 Piotr Trojanek <trojanek@adacore.com> + + * sem_util.adb (Address_Value): Simplify. + +2021-06-18 Bob Duff <duff@adacore.com> + + * sem_attr.adb (Check_Array_Or_Scalar_Type): Use Expr_Value + instead of Intval, because the latter only exists in literals. + Remove Set_Etype on E1; setting the type is done elsewhere. + +2021-06-18 Piotr Trojanek <trojanek@adacore.com> + + * sem_warn.adb (Warn_On_Overlapping_Actuals): Examine types of + both formal parameters; refactor a complex detection of + by-reference types. + +2021-06-18 Arnaud Charlet <charlet@adacore.com> + + * gnatcmd.adb: Fix handling of check and test commands. + +2021-06-18 Gary Dismukes <dismukes@adacore.com> + + * doc/gnat_rm/implementation_defined_pragmas.rst: Add + documentation for the array fixed-lower-bound feature. + * gnat_rm.texi: Regenerate. + +2021-06-18 Bob Duff <duff@adacore.com> + + * debug.adb: Document switch. + * exp_aggr.adb: If -gnatd_g was given, then do not bump the + limit to 500_000. + +2021-06-18 Bob Duff <duff@adacore.com> + + * sem_util.ads, sem_util.adb (Has_Access_Values): Remove + Include_Internal parameter that was added in previous change. + * sem_warn.adb (Warnings_Off_E1): Back out E_Out_Parameter ==> + Formal_Kind change made previously. Check Is_Private_Type to + avoid warnings on private types. Misc cleanup. + * sem_attr.adb (Attribute_Has_Access_Values): Remove + Include_Internal parameter. + +2021-06-18 Piotr Trojanek <trojanek@adacore.com> + + * sem_warn.adb (Warn_On_Overlapping_Actuals): Remove dead branch + for overlapping actuals in prefix notation. + +2021-06-18 Eric Botcazou <ebotcazou@adacore.com> + + * sem_prag.adb (Process_Import_Or_Interface): Do not + artificially record a possible modification for a constant. + +2021-06-18 Arnaud Charlet <charlet@adacore.com> + + * exp_ch6.adb (Expand_Call_Helper): Code cleanups. + +2021-06-18 Arnaud Charlet <charlet@adacore.com> + + * exp_aggr.adb, exp_dist.adb, exp_unst.adb, sa_messages.ads, + sem_ch13.adb, sem_ch3.adb, sem_ch5.adb, sem_eval.adb, + sem_util.adb, sem_util.ads, sinfo.ads: Update comments. + +2021-06-18 Ghjuvan Lacambre <lacambre@adacore.com> + + * back_end.adb (Scan_Back_End_Switches): Set Opt.JSON_Output to + True if -fdiagnostics-format=json option is found. + * back_end.ads (Scan_Compiler_Arguments): Mention + Opt.JSON_Output. + * errout.adb (Output_JSON_Message): New procedure. + (Output_Messages): If Opt.JSON_Output is True, print messages + with new Output_JSON_Message procedure. + * opt.ads: Declare JSON_Output variable. + * doc/gnat_ugn/building_executable_programs_with_gnat.rst: + Mention new -fdiagnostics-format option. + * gnat_ugn.texi: Regenerate. + +2021-06-18 Arnaud Charlet <charlet@adacore.com> + + * sem_ch6.adb (Null_Exclusions_Match): Relax null exclusion + mismatch check when Relaxed_RM_Semantics is set. + +2021-06-18 Arnaud Charlet <charlet@adacore.com> + + * fe.h, opt.adb, opt.ads, par-prag.adb, sem_prag.adb, + switch-c.adb (Extensions_Allowed): Replace by a function. + (Ada_Version_Type): Add new value Ada_With_Extensions, to + replace setting of Extensions_Allowed. Update setting of + Extensions_Allowed. + +2021-06-18 Arnaud Charlet <charlet@adacore.com> + + * bindgen.adb (Gen_Output_File_Ada): Generate a new constant + GNAT_Version_Address. + * libgnat/g-comver.adb (GNAT_Version_Address): New; + (GNAT_Version): Use GNAT_Version_Address to disable LTO warning. + +2021-06-18 Javier Miranda <miranda@adacore.com> + + * einfo.ads (Is_Ada_2022_Only): Adding documentation. + * gen_il-fields.ads (Is_Ada_2022_Only): New flag. + * gen_il-gen-gen_entities.adb (Is_Ada_2022_Only): New flag. + * itypes.adb (Create_Null_Excluding_Itype): Inherit + Is_Ada_2022_Only. + * sem_ch3.adb (Check_Abstract_Overriding): Skip reporting error + on Ada 2022 only subprograms that require overriding if we are + not in Ada 2022 mode. + (Derive_Subprogram): Inherit Is_Ada_2022_Only. + * sem_ch6.adb (Check_Overriding_Indicator): Inherit + Is_Ada_2022_Only. + (New_Overloaded_Entity): Inherit Is_Ada_2022_Only. + * sem_ch7.adb (Declare_Inherited_Private_Subprograms): Inherit + Is_Ada_2022_Only. + (Preserve_Full_Attributes): Inherit Is_Ada_2022_Only. + * sem_disp.adb (Find_Hidden_Overridden_Primitive): Inherit + Is_Ada_2022_Only. + (Override_Dispatching_Operation): Inherit Is_Ada_2022_Only. + * sem_prag.adb (Analyze_Pragma): Allow form with argument for + Ada 2022. + * sem_type.adb: (Disambiguate): Deal with Is_Ada_2022_Only + * lib-xref.adb (Generate_Reference): Error on static and + dispatching calls to Ada 2022 subprograms that require + overriding if we are not in Ada 2022 mode; warn on other + references to Ada 2022 entities when not in Ada 2022 mode. + * sem_ch13.adb (Inherit_Aspects_At_Freeze_Point): Inherit + Ada_2020_Only. + * libgnat/a-cdlili.ads (Empty): Adding pragma Ada_2022. + * libgnat/a-cidlli.ads (Empty): Adding pragma Ada_2022. + * libgnat/a-ciorma.ads (Empty): Adding pragma Ada_2022. + * libgnat/a-cobove.ads (Empty): Adding pragma Ada_2022. + * libgnat/a-coorma.ads (Empty): Adding pragma Ada_2022. + (New_Vector): Adding pragma Ada_2022. + (Insert_Vector): Adding pragma Ada_2022. + (Prepend_Vector): Adding pragma Ada_2022. + (Append_Vector): Adding pragma Ada_2022. + +2021-06-17 Arnaud Charlet <charlet@adacore.com> + + * sem_ch3.adb (Check_Ops_From_Incomplete_Type): Protect against + no Primitive_Operations. + +2021-06-17 Vadim Godunko <godunko@adacore.com> + + * libgnat/a-strunb__shared.ads (Allocate): Additional parameter + to provide additional amount of space to be allocated. + * libgnat/a-strunb__shared.adb (Aligned_Max_Length): Limit + length to Natural'Last when requested length is larger than it. + (Allocate): Merge two slightly different implementations into + one. + +2021-06-17 Gary Dismukes <dismukes@adacore.com> + + * checks.adb (Discrete_Range_Cond): For an index subtype that + has a fixed lower bound, require that the range's lower bound + match that of the subtype. + (Selected_Range_Checks): Warn about the case where a static + lower bound does not equal an index subtype's fixed lower bound. + * einfo.ads (Is_Fixed_Lower_Bound_Array_Subtype, + Is_Fixed_Lower_Bound_Index_Subtype): Document new entity flag. + * exp_ch4.adb (Expand_N_Type_Conversion): If the operand is of + an unconstrained array subtype with fixed lower bound, then + Expand_Sliding_Conversion is applied to the operand. + * exp_ch6.adb (Expand_Simple_Function_Return): If the result + subtype is an unconstrained array subtype with fixed lower + bound, then Expand_Sliding_Conversion is applied to the return + object. + * exp_util.ads (Expand_Sliding_Conversion): New procedure for + applying a sliding subtype conversion to an array object of a + fixed-lower-bound subtype when needed. + * exp_util.adb: Add with_clause for Freeze. + (Expand_Sliding_Conversion): New procedure for applying a + sliding subtype conversion to an array object of a + fixed-lower-bound subtype when needed. It traverses the indexes + of the unconstrained array type/subtype to create a target + constrained subtype and rewrites the array object to be a + conversion to that subtype, when there's at least one index + whose lower bound does not statically match the fixed-lower + bound of the target subtype. + * gen_il-fields.ads (type Opt_Field_Enum): Add literals + Is_Fixed_Lower_Bound_Array_Subtype and + Is_Fixed_Lower_Bound_Index_Subtype for new flags on type + entities. + * gen_il-gen-gen_entities.adb: Add calls to + Create_Semantic_Field for the new fixed-lower-bound flags on + type entities. + * par-ch3.adb (P_Array_Type_Definition): Add handling for + parsing of fixed-lower-bound index ranges in unconstrained array + types. Report an error if such an index is encountered and GNAT + language extensions are not enabled. + (P_Index_Subtype_Def_With_Fixed_Lower_Bound): Support procedure + for parsing unconstrained index ranges. + (P_Index_Or_Discriminant_Constraint): Add handling for parsing + of index constraints that specify ranges with fixed lower + bounds. Report an error if such an index is encountered and GNAT + language extensions are not enabled. + * sem_ch3.adb (Analyze_Object_Declaration): If the object's + nominal subtype is an array subtype with fixed lower bound, then + Expand_Sliding_Conversion is applied to the object. + (Array_Type_Declaration): Mark the array type and the subtypes + of any indexes that specify a fixed lower bound as being + fixed-lower-bound subtypes, and set the High_bound of the range + of such an index to the upper bound of the named subtype. + (Constrain_Array): For an array subtype with one or more index + ranges specifying a fixed lower bound, set Is_Constrained to + False and set the array subtype's + Is_Fixed_Lower_Bound_Array_Subtype flag to True. + (Constrain_Index): Mark the subtypes of an index that specifies + a fixed lower bound as being a fixed-lower-bound index subtype, + and set the High_bound of the range of such an index to the + upper bound of the base type of the array type's corresponding + index. + * sem_res.adb (Resolve_Actuals): If a formal is of an + unconstrained array subtype with fixed lower bound, then + Expand_Sliding_Conversion is applied to the actual. + * sem_util.adb (Build_Actual_Subtype): If the actual subtype + corresponds to an unconstrained array subtype having any indexes + with fixed lower bounds, then set the lower bounds of any such + indexes of the actual subtype to the appropriate fixed lower + bound of the formal subtype (rather than taking it from the + formal itself). + * sprint.adb (Sprint_Node_Actual, case N_Range): If a range's + Etype has a fixed lower bound, then print "<>" rather than the + High_Bound of the range. + +2021-06-17 Bob Duff <duff@adacore.com> + + * sem_util.adb, sem_util.ads (Has_Access_Values): New formal + Include_Internal to indicate whether internal types should be + included. + * sem_warn.adb (Check_References): Change E_Out_Parameter to + Formal_Kind, to match the comment about Spec_Entity. Pass + Include_Internal => False to Has_Access_Values, so that we warn + on types with access values that happen to be in internal types, + such as Unbounded_String. + * sem_attr.adb (Attribute_Has_Access_Values): Pass + Include_Internal => True to Has_Access_Values, to preserve + existing behavior. + * libgnat/g-rewdat.adb (Do_Output): Change B from 'in out' to + 'in', to avoid warning enabled by the change to sem_warn.adb. + * libgnat/s-objrea.adb (Check_Read_Offset): Change S from 'in + out' to 'in', to avoid warning enabled by the change to + sem_warn.adb. + +2021-06-17 Steve Baird <baird@adacore.com> + + * exp_ch5.adb + (Expand_N_Case_Statement.Expand_General_Case_Statement): New + subprogram. + (Expand_N_Case_Statement): If extensions are allowed and the + case selector is not of a discrete type, then call + Expand_General_Case_Statement to generate expansion instead of + flagging the non-discrete selector as an error. + * sem_case.ads (Is_Case_Choice_Pattern): New Boolean-valued + function for testing whether a given expression occurs as part + of a case choice pattern. + * sem_case.adb (Composite_Case_Ops): New package providing + support routines for the new form of case statements. This + includes a nested package, Composite_Case_Ops.Value_Sets, which + encapsulates the "representative values" implementation of + composite value sets. + (Check_Choices.Check_Case_Pattern_Choices): New procedure for + semantic checking of non-discrete case choices. This includes + the checks pertaining to coverage and overlapping. + (Check_Choices.Check_Composite_Case_Selector): New procedure for + semantic checking of non-discrete case selectors. + (Check_Choices): If extensions are allowed then a non-discrete + selector type no longer implies that an error must have been + flagged earlier. Instead of simply returning, call + Check_Composite_Case_Selector and Check_Case_Pattern_Choices. + (Is_Case_Choice_Pattern): Body of new function declared in + sem_case.ads . + * sem_ch5.adb (Analyze_Case_Statement): If extensions are + allowed, then we can't use RM 5.4's "The selecting_expression is + expected to be of any discrete type" name resolution rule. + Handle the case where the type of the selecting expression is + not discrete, as well as the new ambiguous-name-resolution error + cases made possible by this change. + * sem_res.adb (Resolve_Entity_Name): It is ok to treat the name + of a type or subtype as an expression if it is part of a case + choice pattern, as in "(Field1 => Positive, Field2 => <>)". + * exp_aggr.adb (Expand_Record_Aggregate): Do not expand case + choice aggregates. + * gen_il-fields.ads: Define two new node attributes, + Binding_Chars and Multidefined_Bindings. + * gen_il-gen-gen_nodes.adb: The new Multidefined_Bindings + attribute is Boolean-valued and may be set on + N_Case_Statement_Alternative nodes. The new Binding_Chars + attribute is Name_Id-valued and may be set on + N_Component_Association nodes. + * par-ch4.adb (P_Record_Or_Array_Component_Association): When + parsing a component association, check for both new syntax forms + used to specify a bound value in a case-choice aggregate. In + the case of a box value, an identifier may occur within the box, + as in "Foo => <Abc>" instead of "Foo => <>". In the more general + case, an expression (or a box) may be followed by "is + <identifier>", as in + "Foo => Bar is Abc" instead of just "Foo => Bar". + * sem_aggr.adb (Resolve_Record_Aggregate): Do not transform box + component values in a case-choice aggregate. + * sinfo.ads: Provide comments for the new attributes added in + gen_il-fields.ads. + * doc/gnat_rm/implementation_defined_pragmas.rst: Describe this + new feature in documentation for pragma Extensions_Allowed. + * gnat_rm.texi: Regenerate. + +2021-06-17 Arnaud Charlet <charlet@adacore.com> + + * exp_ch4.adb (Expand_N_Expression_With_Actions.Process_Action): + Do not abandon processing on a nested N_Expression_With_Actions + or N_Loop_Statement, otherwise we may miss some transient + declarations. + +2021-06-17 Arnaud Charlet <charlet@adacore.com> + + * exp_util.adb (Find_Hook_Context): Do not stop on an aggregate + node. + +2021-06-17 Piotr Trojanek <trojanek@adacore.com> + + * sem_util.adb (Is_Valid_Renaming): Check not only indexed + components, but slices too. + +2021-06-17 Piotr Trojanek <trojanek@adacore.com> + + * sem_ch3.adb (Analyze_Private_Extension_Declaration): Check + No_Wide_Characters restriction after rejecting illegal parent + types. + (Derived_Type_Declaration): Likewise. + (Find_Type_Of_Subtype_Indic): Remove check for + No_Wide_Characters restriction, which was done too early. + +2021-06-17 Piotr Trojanek <trojanek@adacore.com> + + * sem_util.adb (Is_Valid_Renaming): Body moved from its nested + routine. + +2021-06-17 Gary Dismukes <dismukes@adacore.com> + + * sem_ch12.adb (Instantiate_Type): If the actual type for an + incomplete formal type is also incomplete, but has a Full_View, + use the Full_View of the actual type rather than the incomplete + view. + +2021-06-17 Piotr Trojanek <trojanek@adacore.com> + + * doc/gnat_ugn/building_executable_programs_with_gnat.rst + (-gnatw.I): Remove double period at the end of sentence. + * gnat_ugn.texi: Regenerate. + +2021-06-17 Piotr Trojanek <trojanek@adacore.com> + + * sem_util.adb (Denotes_Same_Object): Call Get_Index_Bounds with + the range of a slice object, not its type. + +2021-06-17 Piotr Trojanek <trojanek@adacore.com> + + * sem_warn.adb (Warn_On_Overlapping_Actuals): Fix style; + refactor repeated calls to Nkind; remove early RETURN. + +2021-06-17 Piotr Trojanek <trojanek@adacore.com> + + * sem_warn.adb (Warn_On_Overlapping_Actuals): Ignore formal of + generic types, but keep examining other parameters. + +2021-06-17 Piotr Trojanek <trojanek@adacore.com> + + * sem_warn.adb (Warn_On_Overlapping_Actuals): Remove dead code. + +2021-06-17 Piotr Trojanek <trojanek@adacore.com> + + * sem_warn.adb (Warn_On_Overlapping_Actuals): Remove repeated + code. + +2021-06-17 Piotr Trojanek <trojanek@adacore.com> + + * checks.adb (Overlap_Check): Replace Set_Casing with + Adjust_Name_Case and adapt surrounding code as needed. + +2021-06-17 Arnaud Charlet <charlet@adacore.com> + + * libgnat/s-putaim.ads, libgnat/s-putaim.adb: Move... + * libgnarl/s-putaim.ads, libgnarl/s-putaim.adb: ... here. + +2021-06-17 Arnaud Charlet <charlet@adacore.com> + + * uintp.ads, uintp.adb (UI_To_Unsigned_64): New. + +2021-06-17 Piotr Trojanek <trojanek@adacore.com> + + * sem_prag.adb (Get_Overflow_Mode): Reword error message. + * switch-c.adb (Get_Overflow_Mode): Likewise. + +2021-06-17 Richard Kenner <kenner@adacore.com> + + * exp_util.adb (Expand_Static_Predicates_In_Choices): Handle + Others_Discrete_Choices in N_Others_Choice. + +2021-06-17 Arnaud Charlet <charlet@adacore.com> + + * atree.adb: Remove redundant comment with spec. + * sem_warn.adb: Fix typo in comment. + +2021-06-17 Arnaud Charlet <charlet@adacore.com> + + * atree.adb: Do not suppress checks. + +2021-06-17 Justin Squirek <squirek@adacore.com> + + * exp_ch3.adb (Check_Missing_Others): Add comment. + (Build_Initialization_Call): Remove inaccurate accessibility + comment. + * sem_ch12.adb (Analyze_Generic_Subprogram_Declaration): Remove + test for Ada2012. + (Analyze_Package_Instantiation): Remove speculative comment. + (Inline_Instance_Body): Add comments for loops. + (Build_Subprogram_Renaming): Remove comment about fix being + partial and "ugly." + (Instantiate_Subprogram_Body): Remove comment referencing DEC + related internal issue. + (Subtypes_Match): Add comment and simplify anonymous access + test. + (Is_Global): Add test for when E is an expanded name, and + calculate the scope accordingly. + * sem_ch6.adb (Analyze_Function_Return): Update comment + regarding accessibility, and add check for + Warn_On_Ada_2012_Compatibility. + (Mask_Type_Refs): Add comments. + (Analyze_Subprogram_Declaration): Remove mysterious suppression + of elaboration checks. + * sem_ch7.adb (Preserve_Full_Attributes): Preserve Is_Atomic + value. + * sem_ch8.adb (Most_Descendant_Use_Clause): Remove comment. + (Note_Redundant_Use): Fix calls to Find_First_Use to be + Find_Most_Prev. + (Get_Object_Name): Modify error message to be more descriptive. + (Known_But_Visible): Remove mysterious special case for + GNAT_Mode. + (Find_First_Use): Removed. + (Find_Most_Prev): Renamed from Find_First_Use. + * sem_prag.adb (Check_Static_Constraint): Add comments to + routine. + +2021-06-17 Bob Duff <duff@adacore.com> + + * treepr.adb (Print_Node): Display the Entity or Associated_Node + fields if appropriate. + * sinfo-utils.ads (F_Associated_Node, F_Entity): Remove. These + are no longer needed. + +2021-06-17 Piotr Trojanek <trojanek@adacore.com> + + * checks.adb (Apply_Parameter_Aliasing_Checks): Replace calls to + Is_Object_Reference with calls to Is_Name_Reference; remove + asymmetric condition that only detected an aggregate as the + first actual (aggregate objects were just a special case of an + object reference that was not a name). + +2021-06-17 Bob Duff <duff@adacore.com> + + * gen_il-gen.adb, gen_il-internals.ads: Generate field + enumeration literals with "F_" prefix. Update all generated + references accordingly. + * atree.adb, einfo-utils.adb, sem_ch3.adb, sem_ch5.adb, + sem_ch6.adb, sem_ch8.adb, sinfo-cn.adb, sinfo-utils.adb, + sinfo-utils.ads, treepr.adb: Add "F_" prefix to all uses of the + field enumeration literals. + +2021-06-17 Arnaud Charlet <charlet@adacore.com> + + * libgnat/i-c.ads, libgnat/i-cexten.ads, + libgnat/i-cexten__128.ads: bool renamed C_bool. + +2021-06-17 Piotr Trojanek <trojanek@adacore.com> + + * sem_ch4.adb (Analyze_Allocator): Reject allocators in + restricted contexts. + +2021-06-17 Arnaud Charlet <charlet@adacore.com> + + * gcc-interface/Make-lang.in: Use libgnat.so if libgnat.a cannot + be found. + 2021-06-16 Piotr Trojanek <trojanek@adacore.com> * sem_util.adb (Is_Volatile_Function): Follow the exact wording diff --git a/gcc/ada/ada_get_targ.adb b/gcc/ada/ada_get_targ.adb index fff0b9d..6098478 100644 --- a/gcc/ada/ada_get_targ.adb +++ b/gcc/ada/ada_get_targ.adb @@ -214,7 +214,7 @@ package body Get_Targ is function Get_Max_Unaligned_Field return Pos is begin - return 64; -- Can be different on some targets (e.g., AAMP) + return 64; -- Can be different on some targets end Get_Max_Unaligned_Field; ----------------------------- diff --git a/gcc/ada/aspects.ads b/gcc/ada/aspects.ads index c5373e7..2cbb2da 100644 --- a/gcc/ada/aspects.ads +++ b/gcc/ada/aspects.ads @@ -173,7 +173,6 @@ package Aspects is Aspect_Remote_Call_Interface, Aspect_Remote_Types, Aspect_Shared_Passive, - Aspect_Universal_Data, -- GNAT -- Remaining aspects have a static boolean value that turns the aspect -- on or off. They all correspond to pragmas, but are only converted to @@ -292,7 +291,6 @@ package Aspects is Aspect_Thread_Local_Storage => True, Aspect_Test_Case => True, Aspect_Universal_Aliasing => True, - Aspect_Universal_Data => True, Aspect_Unmodified => True, Aspect_Unreferenced => True, Aspect_Unreferenced_Objects => True, @@ -330,7 +328,7 @@ package Aspects is -- the occurrence of the aspect. subtype Library_Unit_Aspects is - Aspect_Id range Aspect_All_Calls_Remote .. Aspect_Universal_Data; + Aspect_Id range Aspect_All_Calls_Remote .. Aspect_Shared_Passive; -- The following subtype defines aspects accepting an optional static -- boolean parameter indicating if the aspect should be active or @@ -734,7 +732,6 @@ package Aspects is Aspect_Unchecked_Union => Name_Unchecked_Union, Aspect_Unimplemented => Name_Unimplemented, Aspect_Universal_Aliasing => Name_Universal_Aliasing, - Aspect_Universal_Data => Name_Universal_Data, Aspect_Unmodified => Name_Unmodified, Aspect_Unreferenced => Name_Unreferenced, Aspect_Unreferenced_Objects => Name_Unreferenced_Objects, @@ -935,7 +932,6 @@ package Aspects is Aspect_Type_Invariant => Always_Delay, Aspect_Unchecked_Union => Always_Delay, Aspect_Universal_Aliasing => Always_Delay, - Aspect_Universal_Data => Always_Delay, Aspect_Unmodified => Always_Delay, Aspect_Unreferenced => Always_Delay, Aspect_Unreferenced_Objects => Always_Delay, diff --git a/gcc/ada/atree.adb b/gcc/ada/atree.adb index 8df2d7f..be03c97 100644 --- a/gcc/ada/atree.adb +++ b/gcc/ada/atree.adb @@ -23,16 +23,11 @@ -- -- ------------------------------------------------------------------------------ --- WARNING: There is a C version of this package. Any changes to this source --- file must be properly reflected in the file atree.h which is a C header --- file containing equivalent definitions for use by gigi. - --- Checks and assertions in this package are too slow, and are mostly needed --- when working on this package itself, or on gen_il, so we disable them. +-- Assertions in this package are too slow, and are mostly needed when working +-- on this package itself, or on gen_il, so we disable them. -- To debug low-level bugs in this area, comment out the following pragmas, -- and run with -gnatd_v. -pragma Suppress (All_Checks); pragma Assertion_Policy (Ignore); with Aspects; use Aspects; @@ -900,12 +895,12 @@ package body Atree is end Check_Vanishing_Fields; Nkind_Offset : constant Field_Offset := - Node_Field_Descriptors (Nkind).Offset; + Node_Field_Descriptors (F_Nkind).Offset; procedure Set_Node_Kind_Type is new Set_8_Bit_Field (Node_Kind) with Inline; procedure Init_Nkind (N : Node_Id; Val : Node_Kind) is - pragma Assert (Field_Is_Initial_Zero (N, Nkind)); + pragma Assert (Field_Is_Initial_Zero (N, F_Nkind)); begin Set_Node_Kind_Type (N, Nkind_Offset, Val); end Init_Nkind; @@ -953,7 +948,7 @@ package body Atree is end Mutate_Nkind; Ekind_Offset : constant Field_Offset := - Entity_Field_Descriptors (Ekind).Offset; + Entity_Field_Descriptors (F_Ekind).Offset; procedure Set_Entity_Kind_Type is new Set_8_Bit_Field (Entity_Kind) with Inline; @@ -1323,11 +1318,11 @@ package body Atree is -- we can't just call Set_Chars, because Empty is of the wrong -- type, and is outside the range of Name_Id. - Reinit_Field_To_Zero (New_Id, Chars); - Reinit_Field_To_Zero (New_Id, Has_Private_View); - Reinit_Field_To_Zero (New_Id, Is_Elaboration_Checks_OK_Node); - Reinit_Field_To_Zero (New_Id, Is_Elaboration_Warnings_OK_Node); - Reinit_Field_To_Zero (New_Id, Is_SPARK_Mode_On_Node); + Reinit_Field_To_Zero (New_Id, F_Chars); + Reinit_Field_To_Zero (New_Id, F_Has_Private_View); + Reinit_Field_To_Zero (New_Id, F_Is_Elaboration_Checks_OK_Node); + Reinit_Field_To_Zero (New_Id, F_Is_Elaboration_Warnings_OK_Node); + Reinit_Field_To_Zero (New_Id, F_Is_SPARK_Mode_On_Node); -- Change the node type diff --git a/gcc/ada/back_end.adb b/gcc/ada/back_end.adb index a170ed5..42d837d 100644 --- a/gcc/ada/back_end.adb +++ b/gcc/ada/back_end.adb @@ -281,6 +281,14 @@ package body Back_End is elsif Switch_Chars (First .. Last) = "fpreserve-control-flow" then Opt.Suppress_Control_Flow_Optimizations := True; + -- Back end switch -fdiagnostics-format=json tells the frontend to + -- output its error and warning messages in the same format GCC + -- uses when passed -fdiagnostics-format=json. + + elsif Switch_Chars (First .. Last) = "fdiagnostics-format=json" + then + Opt.JSON_Output := True; + -- Back end switch -fdump-scos, which exists primarily for C, is -- also accepted for Ada as a synonym of -gnateS. diff --git a/gcc/ada/back_end.ads b/gcc/ada/back_end.ads index 8f86825..32a0ea3 100644 --- a/gcc/ada/back_end.ads +++ b/gcc/ada/back_end.ads @@ -70,6 +70,7 @@ package Back_End is -- Opt.Suppress_Control_Float_Optimizations -- Opt.Generate_SCO -- Opt.Generate_SCO_Instance_Table + -- Opt.JSON_Output -- Opt.Stack_Checking_Enabled -- Opt.No_Stdinc -- Opt.No_Stdlib diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb index 303bcde..0014f6a 100644 --- a/gcc/ada/bindgen.adb +++ b/gcc/ada/bindgen.adb @@ -2388,7 +2388,11 @@ package body Bindgen is Gnat_Version_String & """ & ASCII.NUL;"); WBI (" pragma Export (C, GNAT_Version, ""__gnat_version"");"); - + WBI (""); + WBI (" GNAT_Version_Address : constant System.Address := " & + "GNAT_Version'Address;"); + WBI (" pragma Export (C, GNAT_Version_Address, " & + """__gnat_version_address"");"); WBI (""); Set_String (" Ada_Main_Program_Name : constant String := """); Get_Name_String (Units.Table (First_Unit_Entry).Uname); diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 877a982..bdaae59 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -24,7 +24,6 @@ ------------------------------------------------------------------------------ with Atree; use Atree; -with Casing; use Casing; with Debug; use Debug; with Einfo; use Einfo; with Einfo.Entities; use Einfo.Entities; @@ -2417,9 +2416,8 @@ package body Checks is Formal_2 : Entity_Id; Check : in out Node_Id) is - Cond : Node_Id; - ID_Casing : constant Casing_Type := - Identifier_Casing (Source_Index (Current_Sem_Unit)); + Cond : Node_Id; + Formal_Name : Bounded_String; begin -- Generate: @@ -2451,15 +2449,17 @@ package body Checks is Store_String_Chars ("aliased parameters, actuals for """); - Get_Name_String (Chars (Formal_1)); - Set_Casing (ID_Casing); - Store_String_Chars (Name_Buffer (1 .. Name_Len)); + Append (Formal_Name, Chars (Formal_1)); + Adjust_Name_Case (Formal_Name, Sloc (Formal_1)); + Store_String_Chars (To_String (Formal_Name)); Store_String_Chars (""" and """); - Get_Name_String (Chars (Formal_2)); - Set_Casing (ID_Casing); - Store_String_Chars (Name_Buffer (1 .. Name_Len)); + Formal_Name.Length := 0; + + Append (Formal_Name, Chars (Formal_2)); + Adjust_Name_Case (Formal_Name, Sloc (Formal_2)); + Store_String_Chars (To_String (Formal_Name)); Store_String_Chars (""" overlap"); @@ -2507,29 +2507,16 @@ package body Checks is while Present (Actual_1) and then Present (Formal_1) loop Orig_Act_1 := Original_Actual (Actual_1); - -- Ensure that the actual is an object that is not passed by value. - -- Elementary types are always passed by value, therefore actuals of - -- such types cannot lead to aliasing. An aggregate is an object in - -- Ada 2012, but an actual that is an aggregate cannot overlap with - -- another actual. - - if Nkind (Orig_Act_1) = N_Aggregate - or else (Nkind (Orig_Act_1) = N_Qualified_Expression - and then Nkind (Expression (Orig_Act_1)) = N_Aggregate) - then - null; - - elsif Is_Object_Reference (Orig_Act_1) then + if Is_Name_Reference (Orig_Act_1) then Actual_2 := Next_Actual (Actual_1); Formal_2 := Next_Formal (Formal_1); while Present (Actual_2) and then Present (Formal_2) loop Orig_Act_2 := Original_Actual (Actual_2); - -- The other actual we are testing against must also denote - -- a non pass-by-value object. Generate the check only when - -- the mode of the two formals may lead to aliasing. + -- Generate the check only when the mode of the two formals may + -- lead to aliasing. - if Is_Object_Reference (Orig_Act_2) + if Is_Name_Reference (Orig_Act_2) and then May_Cause_Aliasing (Formal_1, Formal_2) then @@ -5628,6 +5615,10 @@ package body Checks is -- If type is not defined, we can't determine its range + pragma Warnings (Off, "condition can only be True if invalid"); + -- Otherwise the compiler warns on the check of Float_Rep below, because + -- there is only one value (see types.ads). + if No (Typ) -- We don't deal with anything except IEEE floating-point types @@ -5641,6 +5632,7 @@ package body Checks is or else Error_Posted (N) or else Error_Posted (Typ) then + pragma Warnings (On, "condition can only be True if invalid"); OK := False; return; end if; @@ -10519,16 +10511,36 @@ package body Checks is LB := New_Occurrence_Of (Discriminal (Entity (LB)), Loc); end if; - Left_Opnd := - Make_Op_Lt (Loc, - Left_Opnd => - Convert_To - (Base_Type (Typ), Duplicate_Subexpr_No_Checks (LB)), + -- If the index type has a fixed lower bound, then we require an + -- exact match of the range's lower bound against that fixed lower + -- bound. - Right_Opnd => - Convert_To - (Base_Type (Typ), - Get_E_First_Or_Last (Loc, Typ, 0, Name_First))); + if Is_Fixed_Lower_Bound_Index_Subtype (Typ) then + Left_Opnd := + Make_Op_Ne (Loc, + Left_Opnd => + Convert_To + (Base_Type (Typ), Duplicate_Subexpr_No_Checks (LB)), + + Right_Opnd => + Convert_To + (Base_Type (Typ), + Get_E_First_Or_Last (Loc, Typ, 0, Name_First))); + + -- Otherwise we do the expected less-than comparison + + else + Left_Opnd := + Make_Op_Lt (Loc, + Left_Opnd => + Convert_To + (Base_Type (Typ), Duplicate_Subexpr_No_Checks (LB)), + + Right_Opnd => + Convert_To + (Base_Type (Typ), + Get_E_First_Or_Last (Loc, Typ, 0, Name_First))); + end if; if Nkind (HB) = N_Identifier and then Ekind (Entity (HB)) = E_Discriminant @@ -10834,6 +10846,22 @@ package body Checks is end if; end if; + -- Flag the case of a fixed-lower-bound index where the static + -- bounds are not equal. + + if not Check_Added + and then Is_Fixed_Lower_Bound_Index_Subtype (T_Typ) + and then Expr_Value (LB) /= Expr_Value (T_LB) + then + Add_Check + (Compile_Time_Constraint_Error + ((if Present (Warn_Node) + then Warn_Node else Low_Bound (Expr)), + "static value does not equal lower bound of}??", + T_Typ)); + Check_Added := True; + end if; + if Known_HB then if Known_T_HB then Out_Of_Range_H := T_HB < HB; @@ -10985,7 +11013,6 @@ package body Checks is if Is_Array_Type (T_Typ) and then Is_Array_Type (S_Typ) then if Is_Constrained (T_Typ) then - Expr_Actual := Get_Referenced_Object (Expr); Exptyp := Get_Actual_Subtype (Expr_Actual); diff --git a/gcc/ada/contracts.adb b/gcc/ada/contracts.adb index f31d265..d096cbb 100644 --- a/gcc/ada/contracts.adb +++ b/gcc/ada/contracts.adb @@ -2610,7 +2610,21 @@ package body Contracts is for Index in Subps'Range loop Subp_Id := Subps (Index); - Items := Contract (Subp_Id); + + if Present (Alias (Subp_Id)) then + Subp_Id := Ultimate_Alias (Subp_Id); + end if; + + -- Wrappers of class-wide pre/post conditions reference the + -- parent primitive that has the inherited contract. + + if Is_Wrapper (Subp_Id) + and then Present (LSP_Subprogram (Subp_Id)) + then + Subp_Id := LSP_Subprogram (Subp_Id); + end if; + + Items := Contract (Subp_Id); if Present (Items) then Prag := Pre_Post_Conditions (Items); @@ -2892,7 +2906,21 @@ package body Contracts is for Index in Subps'Range loop Subp_Id := Subps (Index); - Items := Contract (Subp_Id); + + if Present (Alias (Subp_Id)) then + Subp_Id := Ultimate_Alias (Subp_Id); + end if; + + -- Wrappers of class-wide pre/post conditions reference the + -- parent primitive that has the inherited contract. + + if Is_Wrapper (Subp_Id) + and then Present (LSP_Subprogram (Subp_Id)) + then + Subp_Id := LSP_Subprogram (Subp_Id); + end if; + + Items := Contract (Subp_Id); if Present (Items) then Prag := Pre_Post_Conditions (Items); diff --git a/gcc/ada/cstand.adb b/gcc/ada/cstand.adb index f54d82e..44cb69c 100644 --- a/gcc/ada/cstand.adb +++ b/gcc/ada/cstand.adb @@ -916,9 +916,9 @@ package body CStand is Set_Alignment (Standard_String, Uint_1); Pack_String_Type (Standard_String); - -- On targets where a storage unit is larger than a byte (such as AAMP), - -- pragma Pack has a real effect on the representation of type String, - -- and the type must be marked as having a nonstandard representation. + -- On targets where a storage unit is larger than a byte, pragma Pack + -- has a real effect on the representation of type String, and the type + -- must be marked as having a nonstandard representation. if System_Storage_Unit > Uint_8 then Set_Has_Non_Standard_Rep (Standard_String); diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb index e2c7228..0694f23 100644 --- a/gcc/ada/debug.adb +++ b/gcc/ada/debug.adb @@ -145,7 +145,7 @@ package body Debug is -- d_d -- d_e Ignore entry calls and requeue statements for elaboration -- d_f Issue info messages related to GNATprove usage - -- d_g + -- d_g Disable large static aggregates -- d_h Disable the use of (perfect) hash functions for enumeration Value -- d_i Ignore activations and calls to instances for elaboration -- d_j Read JSON files and populate Repinfo tables (opposite of -gnatRjs) @@ -965,6 +965,10 @@ package body Debug is -- beginners find them confusing. Set automatically by GNATprove when -- switch --info is used. + -- d_g Disable large static aggregates. The maximum size for a static + -- aggregate will be fairly modest, which is useful if the compiler + -- is using too much memory and time at compile time. + -- d_h The compiler does not make use of (perfect) hash functions in the -- implementation of the Value attribute for enumeration types. diff --git a/gcc/ada/doc/gnat_rm/implementation_defined_aspects.rst b/gcc/ada/doc/gnat_rm/implementation_defined_aspects.rst index fb92e47..b09a4bb 100644 --- a/gcc/ada/doc/gnat_rm/implementation_defined_aspects.rst +++ b/gcc/ada/doc/gnat_rm/implementation_defined_aspects.rst @@ -561,12 +561,6 @@ Aspect Universal_Aliasing This boolean aspect is equivalent to :ref:`pragma Universal_Aliasing<Pragma-Universal_Aliasing>`. -Aspect Universal_Data -===================== -.. index:: Universal_Data - -This aspect is equivalent to :ref:`pragma Universal_Data<Pragma-Universal_Data>`. - Aspect Unmodified ================= .. index:: Unmodified diff --git a/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst b/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst index 74b9718..6668dff 100644 --- a/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst +++ b/gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst @@ -2062,27 +2062,6 @@ string or a static string expressions that evaluates to the null string. In this case, no external name is generated. This form still allows the specification of parameter mechanisms. -Pragma Export_Value -=================== - -Syntax: - - -:: - - pragma Export_Value ( - [Value =>] static_integer_EXPRESSION, - [Link_Name =>] static_string_EXPRESSION); - - -This pragma serves to export a static integer value for external use. -The first argument specifies the value to be exported. The Link_Name -argument specifies the symbolic name to be associated with the integer -value. This pragma is useful for defining a named static value in Ada -that can be referenced in assembly language units to be linked with -the application. This pragma is currently supported only for the -AAMP target and is ignored for other targets. - Pragma Export_Valued_Procedure ============================== @@ -2210,7 +2189,7 @@ extension mode (the use of Off as a parameter cancels the effect of the *-gnatX* command switch). In extension mode, the latest version of the Ada language is -implemented (currently Ada 202x), and in addition a small number +implemented (currently Ada 2022), and in addition a number of GNAT specific extensions are recognized as follows: * Constrained attribute for generic objects @@ -2235,6 +2214,136 @@ of GNAT specific extensions are recognized as follows: This new aggregate syntax for arrays and containers is provided under -gnatX to experiment and confirm this new language syntax. +* Casing on composite values (aka pattern matching) + + The selector for a case statement may be of a composite type, subject to + some restrictions (described below). Aggregate syntax is used for choices + of such a case statement; however, in cases where a "normal" aggregate would + require a discrete value, a discrete subtype may be used instead; box + notation can also be used to match all values (but currently only + for discrete subcomponents). + + Consider this example: + + .. code-block:: ada + + type Rec is record + F1, F2 : Integer; + end record; + + procedure Caser_1 (X : Rec) is + begin + case X is + when (F1 => Positive, F2 => Positive) => + Do_This; + when (F1 => Natural, F2 => <>) | (F1 => <>, F2 => Natural) => + Do_That; + when others => + Do_The_Other_Thing; + end case; + end Caser_1; + + If Caser_1 is called and both components of X are positive, then + Do_This will be called; otherwise, if either component is nonnegative + then Do_That will be called; otherwise, Do_The_Other_Thing will be called. + + If the set of values that match the choice(s) of an earlier alternative + overlaps the corresponding set of a later alternative, then the first + set shall be a proper subset of the second (and the later alternative + will not be executed if the earlier alternative "matches"). All possible + values of the composite type shall be covered. The composite type of the + selector shall be a nonlimited untagged undiscriminated record type, all + of whose subcomponent subtypes are either static discrete subtypes or + record types that meet the same restrictions. Support for arrays is + planned, but not yet implemented. + + In addition, pattern bindings are supported. This is a mechanism + for binding a name to a component of a matching value for use within + an alternative of a case statement. For a component association + that occurs within a case choice, the expression may be followed by + "is <identifier>". In the special case of a "box" component association, + the identifier may instead be provided within the box. Either of these + indicates that the given identifer denotes (a constant view of) the matching + subcomponent of the case selector. + + Consider this example (which uses type Rec from the previous example): + + .. code-block:: ada + + procedure Caser_2 (X : Rec) is + begin + case X is + when (F1 => Positive is Abc, F2 => Positive) => + Do_This (Abc) + when (F1 => Natural is N1, F2 => <N2>) | + (F1 => <N2>, F2 => Natural is N1) => + Do_That (Param_1 => N1, Param_2 => N2); + when others => + Do_The_Other_Thing; + end case; + end Caser_2; + + This example is the same as the previous one with respect to + determining whether Do_This, Do_That, or Do_The_Other_Thing will + be called. But for this version, Do_This takes a parameter and Do_That + takes two parameters. If Do_This is called, the actual parameter in the + call will be X.F1. + + If Do_That is called, the situation is more complex because there are two + choices for that alternative. If Do_That is called because the first choice + matched (i.e., because X.F1 is nonnegative and either X.F1 or X.F2 is zero + or negative), then the actual parameters of the call will be (in order) + X.F1 and X.F2. If Do_That is called because the second choice matched (and + the first one did not), then the actual parameters will be reversed. + + Within the choice list for single alternative, each choice must + define the same set of bindings and the component subtypes for + for a given identifer must all statically match. Currently, the case + of a binding for a nondiscrete component is not implemented. + +* Fixed lower bounds for array types and subtypes + + Unconstrained array types and subtypes can be specified with a lower bound + that is fixed to a certain value, by writing an index range that uses the + syntax "<lower-bound-expression> .. <>". This guarantees that all objects + of the type or subtype will have the specified lower bound. + + For example, a matrix type with fixed lower bounds of zero for each + dimension can be declared by the following: + + .. code-block:: ada + + type Matrix is + array (Natural range 0 .. <>, Natural range 0 .. <>) of Integer; + + Objects of type Matrix declared with an index constraint must have index + ranges starting at zero: + + .. code-block:: ada + + M1 : Matrix (0 .. 9, 0 .. 19); + M2 : Matrix (2 .. 11, 3 .. 22); -- Warning about bounds; will raise CE + + Similarly, a subtype of String can be declared that specifies the lower + bound of objects of that subtype to be 1: + + .. code-block:: ada + + subtype String_1 is String (1 .. <>); + + If a string slice is passed to a formal of subtype String_1 in a call to + a subprogram S, the slice's bounds will "slide" so that the lower bound + is 1. Within S, the lower bound of the formal is known to be 1, so, unlike + a normal unconstrained String formal, there is no need to worry about + accounting for other possible lower-bound values. Sliding of bounds also + occurs in other contexts, such as for object declarations with an + unconstrained subtype with fixed lower bound, as well as in subtype + conversions. + + Use of this feature increases safety by simplifying code, and can also + improve the efficiency of indexing operations, since the compiler statically + knows the lower bound of unconstrained array formals when the formal's + subtype has index ranges with static fixed lower bounds. .. _Pragma-Extensions_Visible: @@ -3114,13 +3223,7 @@ Syntax: This program unit pragma is supported for parameterless protected procedures -as described in Annex C of the Ada Reference Manual. On the AAMP target -the pragma can also be specified for nonprotected parameterless procedures -that are declared at the library level (which includes procedures -declared at the top level of a library package). In the case of AAMP, -when this pragma is applied to a nonprotected procedure, the instruction -``IERET`` is generated for returns from the procedure, enabling -maskable interrupts, in place of the normal return instruction. +as described in Annex C of the Ada Reference Manual. Pragma Interrupt_State ====================== @@ -6914,32 +7017,6 @@ For a detailed description of the strict aliasing optimization, and the situations in which it must be suppressed, see the section on ``Optimization and Strict Aliasing`` in the :title:`GNAT User's Guide`. -.. _Pragma-Universal_Data: - -Pragma Universal_Data -===================== - -Syntax: - - -:: - - pragma Universal_Data [(library_unit_Name)]; - - -This pragma is supported only for the AAMP target and is ignored for -other targets. The pragma specifies that all library-level objects -(Counter 0 data) associated with the library unit are to be accessed -and updated using universal addressing (24-bit addresses for AAMP5) -rather than the default of 16-bit Data Environment (DENV) addressing. -Use of this pragma will generally result in less efficient code for -references to global data associated with the library unit, but -allows such data to be located anywhere in memory. This pragma is -a library unit pragma, but can also be used as a configuration pragma -(including use in the :file:`gnat.adc` file). The functionality -of this pragma is also available by applying the -univ switch on the -compilations of units where universal addressing of the data is desired. - .. _Pragma-Unmodified: Pragma Unmodified 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 63b3f17..07c38df 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 @@ -1233,6 +1233,13 @@ Alphabetical List of All Switches marker is specified, the callgraph is decorated with information about dynamically allocated objects. +.. index:: -fdiagnostics-format (gcc) + +:switch:`-fdiagnostics-format=json` + Makes GNAT emit warning and error messages as JSON. Inhibits printing of + text warning and errors messages except if :switch:`-gnatv` or + :switch:`-gnatl` are present. + .. index:: -fdump-scos (gcc) @@ -1741,8 +1748,7 @@ Alphabetical List of All Switches in bits.` ``Max_Unaligned_Field`` is the maximum size for unaligned bit field, which is - 64 for the majority of GCC targets (but can be different on some targets like - AAMP). + 64 for the majority of GCC targets (but can be different on some targets). ``Strict_Alignment`` is the equivalent of GCC macro ``STRICT_ALIGNMENT`` documented as follows: `Define this macro to be the value 1 if instructions @@ -1781,8 +1787,9 @@ Alphabetical List of All Switches where ``name`` is the string name of the type (which can have single spaces embedded in the name (e.g. long double), ``digs`` is the number of digits for the floating-point type, ``float_rep`` is - the float representation (I/V/A for IEEE-754-Binary, Vax_Native, - AAMP), ``size`` is the size in bits, ``alignment`` is the + the float representation (I for IEEE-754-Binary, which is + the only one supported at this time), + ``size`` is the size in bits, ``alignment`` is the alignment in bits. The name is followed by at least two blanks, fields are separated by at least one blank, and a LF character immediately follows the alignment field. @@ -2003,8 +2010,7 @@ Alphabetical List of All Switches by the front end and will be visible in the :switch:`-gnatG` output. - When using a gcc-based back end (in practice this means using any version - of GNAT other than the JGNAT, .NET or GNAAMP versions), then the use of + When using a gcc-based back end, then the use of :switch:`-gnatN` is deprecated, and the use of :switch:`-gnatn` is preferred. Historically front end inlining was more extensive than the gcc back end inlining, but that is no longer the case. @@ -3253,7 +3259,7 @@ of the pragma in the :title:`GNAT_Reference_manual`). :switch:`-gnatw.I` *Disable warnings on overlapping actuals.* - This switch disables warnings on overlapping actuals in a call.. + This switch disables warnings on overlapping actuals in a call. .. index:: -gnatwj (gcc) @@ -5687,8 +5693,7 @@ Subprogram Inlining Control This switch activates front-end inlining which also generates additional dependencies. - When using a gcc-based back end (in practice this means using any version - of GNAT other than the JGNAT, .NET or GNAAMP versions), then the use of + When using a gcc-based back end, then the use of :switch:`-gnatN` is deprecated, and the use of :switch:`-gnatn` is preferred. Historically front end inlining was more extensive than the gcc back end inlining, but that is no longer the case. 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 46d589a..39b9ca1 100644 --- a/gcc/ada/doc/gnat_ugn/the_gnat_compilation_model.rst +++ b/gcc/ada/doc/gnat_ugn/the_gnat_compilation_model.rst @@ -1672,8 +1672,7 @@ additional source files as follows: not require that the code generation be optimized. Like :switch:`-gnatn`, the use of this switch generates additional dependencies. - When using a gcc-based back end (in practice this means using any version - of GNAT other than for the JVM, .NET or GNAAMP platforms), then the use of + When using a gcc-based back end, then the use of :switch:`-gnatN` is deprecated, and the use of :switch:`-gnatn` is preferred. Historically front end inlining was more extensive than the gcc back end inlining, but that is no longer the case. diff --git a/gcc/ada/einfo-utils.adb b/gcc/ada/einfo-utils.adb index d713777..0641862 100644 --- a/gcc/ada/einfo-utils.adb +++ b/gcc/ada/einfo-utils.adb @@ -913,6 +913,22 @@ package body Einfo.Utils is end if; end First_Formal_With_Extras; + --------------- + -- Float_Rep -- + --------------- + + function Float_Rep (N : Entity_Id) return Float_Rep_Kind is + pragma Unreferenced (N); + pragma Assert (Float_Rep_Kind'First = Float_Rep_Kind'Last); + + -- There is only one value, so we don't need to store it, see types.ads. + + Val : constant Float_Rep_Kind := IEEE_Binary; + + begin + return Val; + end Float_Rep; + ------------------------------------- -- Get_Attribute_Definition_Clause -- ------------------------------------- @@ -1835,9 +1851,6 @@ package body Einfo.Utils is when 16 .. 33 => return 2**14; when others => return No_Uint; end case; - - when AAMP => - return Uint_2 ** Uint_7 - Uint_1; end case; end Machine_Emax_Value; @@ -1849,7 +1862,6 @@ package body Einfo.Utils is begin case Float_Rep (Id) is when IEEE_Binary => return Uint_3 - Machine_Emax_Value (Id); - when AAMP => return -Machine_Emax_Value (Id); end case; end Machine_Emin_Value; @@ -1870,13 +1882,6 @@ package body Einfo.Utils is when 19 .. 33 => return UI_From_Int (113); when others => return No_Uint; end case; - - when AAMP => - case Digs is - when 1 .. 6 => return Uint_24; - when 7 .. 9 => return UI_From_Int (40); - when others => return No_Uint; - end case; end case; end Machine_Mantissa_Value; @@ -1887,9 +1892,7 @@ package body Einfo.Utils is function Machine_Radix_Value (Id : E) return U is begin case Float_Rep (Id) is - when AAMP - | IEEE_Binary - => + when IEEE_Binary => return Uint_2; end case; end Machine_Radix_Value; @@ -2676,7 +2679,7 @@ package body Einfo.Utils is function Scope_Depth_Set (Id : E) return B is begin return not Is_Record_Type (Id) - and then not Field_Is_Initial_Zero (Id, Scope_Depth_Value); + and then not Field_Is_Initial_Zero (Id, F_Scope_Depth_Value); -- We can't call Scope_Depth_Value here, because Empty is not a valid -- value of type Uint. end Scope_Depth_Set; @@ -2767,6 +2770,18 @@ package body Einfo.Utils is Set_DIC_Procedure (Id, V); end Set_Partial_DIC_Procedure; + ------------------- + -- Set_Float_Rep -- + ------------------- + + procedure Set_Float_Rep + (Ignore_N : Entity_Id; Ignore_Val : Float_Rep_Kind) is + begin + pragma Assert (Float_Rep_Kind'First = Float_Rep_Kind'Last); + -- There is only one value, so we don't need to store it (see + -- types.ads). + end Set_Float_Rep; + ----------------------------- -- Set_Invariant_Procedure -- ----------------------------- diff --git a/gcc/ada/einfo-utils.ads b/gcc/ada/einfo-utils.ads index f305235..f65dbfa 100644 --- a/gcc/ada/einfo-utils.ads +++ b/gcc/ada/einfo-utils.ads @@ -196,6 +196,16 @@ package Einfo.Utils is function First_Component_Or_Discriminant (Id : E) return E; function First_Formal (Id : E) return E; function First_Formal_With_Extras (Id : E) return E; + + function Float_Rep + (N : Entity_Id) return F with Inline, Pre => + N in E_Void_Id + | Float_Kind_Id; + procedure Set_Float_Rep + (Ignore_N : Entity_Id; Ignore_Val : F) with Inline, Pre => + Ignore_N in E_Void_Id + | Float_Kind_Id; + function Has_Attach_Handler (Id : E) return B; function Has_DIC (Id : E) return B; function Has_Entries (Id : E) return B; diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index fe9bf72..93ccffb 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -612,7 +612,7 @@ package Einfo is -- Class_Wide_Clone -- Defined on subprogram entities. Set if the subprogram has a class-wide --- ore- or postcondition, and the expression contains calls to other +-- pre- or postcondition, and the expression contains calls to other -- primitive funtions of the type. Used to implement properly the -- semantics of inherited operations whose class-wide condition may -- be different from that of the ancestor (See AI012-0195). @@ -2317,6 +2317,13 @@ package Einfo is -- the entity is part of a unit compiled with the normal no-argument form -- of pragma Ada_12 or Ada_2012. +-- Is_Ada_2022_Only +-- Defined in all entities, true if a valid pragma Ada_2022 applies to +-- the entity which specifically names the entity, indicating that the +-- entity is Ada 2022 only. Note that this flag is not set if the entity +-- is part of a unit compiled with the normal no-argument form of pragma +-- Ada_2022. + -- Is_Aliased -- Defined in all entities. Set for objects and types whose declarations -- carry the keyword aliased, and on record components that have the @@ -2378,12 +2385,6 @@ package Einfo is -- Defined in all entities. Set only for defining entities of program -- units that are child units (but False for subunits). --- Is_Class_Wide_Clone --- Defined on subprogram entities. Set for subprograms built in order --- to implement properly the inheritance of class-wide pre- or post- --- conditions when the condition contains calls to other primitives --- of the ancestor type. Used to implement AI12-0195. - -- Is_Class_Wide_Equivalent_Type -- Defined in record types and subtypes. Set to True, if the type acts -- as a class-wide equivalent type, i.e. the Equivalent_Type field of @@ -2589,6 +2590,16 @@ package Einfo is -- an anonymous base type (e.g. for integer type declarations or -- constrained array declarations). +-- Is_Fixed_Lower_Bound_Array_Subtype +-- Defined in type entities. True for unconstrained array types and +-- subtypes where at least one index has a range specified with a fixed +-- lower bound (range syntax is "<expression> .. <>"). + +-- Is_Fixed_Lower_Bound_Index_Subtype +-- Defined in type entities. True for an index of an unconstrained array +-- type or subtype whose range is specified with a fixed lower bound +-- (range syntax is "<expression> .. <>"). + -- Is_Fixed_Point_Type (synthesized) -- Applies to all entities, true for decimal and ordinary fixed -- point types and subtypes. @@ -2782,8 +2793,8 @@ package Einfo is -- Is_Interrupt_Handler -- Defined in procedures. Set if a pragma Interrupt_Handler applies --- to the procedure. The procedure must be parameterless, and on all --- targets except AAMP it must be a protected procedure. +-- to the procedure. The procedure must be a parameterless protected +-- procedure. -- Is_Intrinsic_Subprogram -- Defined in functions and procedures. It is set if a valid pragma @@ -3391,6 +3402,11 @@ package Einfo is -- Defined in package entities. Indicates that the package has been -- created as a wrapper for a subprogram instantiation. +-- Is_Wrapper +-- Defined in subprogram entities. Indicates that it has been created as +-- a wrapper to handle inherited class-wide pre/post conditions that call +-- overridden primitives or as a wrapper of a controlling function. + -- Itype_Printed -- Defined in all type and subtype entities. Set in Itypes if the Itype -- has been printed by Sprint. This is used to avoid printing an Itype @@ -4698,6 +4714,12 @@ package Einfo is -- Defined in functions and procedures which have been classified as -- Is_Primitive_Wrapper. Set to the entity being wrapper. +-- LSP_Subprogram +-- Defined in subprogram entities. Set on wrappers created to handle +-- inherited class-wide pre/post conditions that call overridden +-- primitives. It references the parent primitive that has the +-- class-wide pre/post conditions. + --------------------------- -- Renaming and Aliasing -- --------------------------- @@ -4861,6 +4883,7 @@ package Einfo is -- In_Private_Part -- Is_Ada_2005_Only -- Is_Ada_2012_Only + -- Is_Ada_2022_Only -- Is_Bit_Packed_Array (base type only) -- Is_Aliased -- Is_Character_Type @@ -5469,6 +5492,7 @@ package Einfo is -- Protection_Object (for concurrent kind) -- Subps_Index (non-generic case only) -- Interface_Alias + -- LSP_Subprogram (non-generic case only) -- Overridden_Operation -- Wrapped_Entity (non-generic case only) -- Extra_Formals @@ -5528,6 +5552,7 @@ package Einfo is -- Is_Private_Primitive (non-generic case only) -- Is_Pure -- Is_Visible_Lib_Unit + -- Is_Wrapper -- Needs_No_Actuals -- Requires_Overriding (non-generic case only) -- Return_Present @@ -5669,6 +5694,7 @@ package Einfo is -- Linker_Section_Pragma -- Contract -- Import_Pragma + -- LSP_Subprogram -- SPARK_Pragma -- Default_Expressions_Processed -- Has_Nested_Subprogram @@ -5679,6 +5705,7 @@ package Einfo is -- Is_Machine_Code_Subprogram -- Is_Primitive -- Is_Pure + -- Is_Wrapper -- SPARK_Pragma_Inherited -- Interface_Name $$$ -- Renamed_Entity $$$ @@ -5823,6 +5850,7 @@ package Einfo is -- Protection_Object (for concurrent kind) -- Subps_Index (non-generic case only) -- Interface_Alias + -- LSP_Subprogram (non-generic case only) -- Overridden_Operation (never for init proc) -- Wrapped_Entity (non-generic case only) -- Extra_Formals @@ -5881,6 +5909,7 @@ package Einfo is -- Is_Private_Descendant -- Is_Private_Primitive (non-generic case only) -- Is_Pure + -- Is_Wrapper -- Is_Valued_Procedure -- Is_Visible_Lib_Unit -- Needs_No_Actuals diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb index 42a1099..16f7aa3 100644 --- a/gcc/ada/errout.adb +++ b/gcc/ada/errout.adb @@ -130,6 +130,11 @@ package body Errout is -- or if it refers to an Etype that has an error posted on it, or if -- it references an Entity that has an error posted on it. + procedure Output_JSON_Message (Error_Id : Error_Msg_Id); + -- Output error message Error_Id and any subsequent continuation message + -- using a JSON format similar to the one GCC uses when passed + -- -fdiagnostics-format=json. + procedure Output_Source_Line (L : Physical_Line_Number; Sfile : Source_File_Index; @@ -2055,6 +2060,133 @@ package body Errout is end if; end OK_Node; + ------------------------- + -- Output_JSON_Message -- + ------------------------- + + procedure Output_JSON_Message (Error_Id : Error_Msg_Id) is + + procedure Write_JSON_Escaped_String (Str : String_Ptr); + -- Write each character of Str, taking care of preceding each quote and + -- backslash with a backslash. Note that this escaping differs from what + -- GCC does. + -- + -- Indeed, the JSON specification mandates encoding wide characters + -- either as their direct UTF-8 representation or as their escaped + -- UTF-16 surrogate pairs representation. GCC seems to prefer escaping - + -- we choose to use the UTF-8 representation instead. + + procedure Write_JSON_Location (Sptr : Source_Ptr); + -- Write Sptr as a JSON location, an object containing a file attribute, + -- a line number and a column number. + + procedure Write_JSON_Span (Span : Source_Span); + -- Write Span as a JSON span, an object containing a "caret" attribute + -- whose value is the JSON location of Span.Ptr. If Span.First and + -- Span.Last are different from Span.Ptr, they will be printed as JSON + -- locations under the names "start" and "finish". + + ------------------------------- + -- Write_JSON_Escaped_String -- + ------------------------------- + + procedure Write_JSON_Escaped_String (Str : String_Ptr) is + begin + for C of Str.all loop + if C = '"' or else C = '\' then + Write_Char ('\'); + end if; + + Write_Char (C); + end loop; + end Write_JSON_Escaped_String; + + ------------------------- + -- Write_JSON_Location -- + ------------------------- + + procedure Write_JSON_Location (Sptr : Source_Ptr) is + begin + Write_Str ("{""file"":"""); + Write_Name (Full_Ref_Name (Get_Source_File_Index (Sptr))); + Write_Str (""",""line"":"); + Write_Int (Pos (Get_Physical_Line_Number (Sptr))); + Write_Str (", ""column"":"); + Write_Int (Nat (Get_Column_Number (Sptr))); + Write_Str ("}"); + end Write_JSON_Location; + + --------------------- + -- Write_JSON_Span -- + --------------------- + + procedure Write_JSON_Span (Span : Source_Span) is + begin + Write_Str ("{""caret"":"); + Write_JSON_Location (Span.Ptr); + + if Span.Ptr /= Span.First then + Write_Str (",""start"":"); + Write_JSON_Location (Span.First); + end if; + + if Span.Ptr /= Span.Last then + Write_Str (",""finish"":"); + Write_JSON_Location (Span.Last); + end if; + + Write_Str ("}"); + end Write_JSON_Span; + + -- Local Variables + + E : Error_Msg_Id := Error_Id; + + -- Start of processing for Output_JSON_Message + + begin + + -- Print message kind + + Write_Str ("{""kind"":"); + + if Errors.Table (E).Warn and then not Errors.Table (E).Warn_Err then + Write_Str ("""warning"""); + elsif Errors.Table (E).Info or else Errors.Table (E).Check then + Write_Str ("""note"""); + else + Write_Str ("""error"""); + end if; + + -- Print message location + + Write_Str (",""locations"":["); + Write_JSON_Span (Errors.Table (E).Sptr); + + if Errors.Table (E).Optr /= Errors.Table (E).Sptr.Ptr then + Write_Str (",{""caret"":"); + Write_JSON_Location (Errors.Table (E).Optr); + Write_Str ("}"); + end if; + + -- Print message content + + Write_Str ("],""message"":"""); + Write_JSON_Escaped_String (Errors.Table (E).Text); + + -- Print message continuations if present + + E := E + 1; + + while E <= Last_Error_Msg and then Errors.Table (E).Msg_Cont loop + Write_Str (", "); + Write_JSON_Escaped_String (Errors.Table (E).Text); + E := E + 1; + end loop; + + Write_Str ("""}"); + end Output_JSON_Message; + --------------------- -- Output_Messages -- --------------------- @@ -2615,9 +2747,46 @@ package body Errout is Current_Error_Source_File := No_Source_File; end if; + if Opt.JSON_Output then + Set_Standard_Error; + + E := First_Error_Msg; + + -- Find first printable message + + while E /= No_Error_Msg and then Errors.Table (E).Deleted loop + E := Errors.Table (E).Next; + end loop; + + Write_Char ('['); + + if E /= No_Error_Msg then + + Output_JSON_Message (E); + + E := Errors.Table (E).Next; + + -- Skip deleted messages. + -- Also skip continuation messages, as they have already been + -- printed along the message they're attached to. + + while E /= No_Error_Msg + and then not Errors.Table (E).Deleted + and then not Errors.Table (E).Msg_Cont + loop + Write_Char (','); + Output_JSON_Message (E); + E := Errors.Table (E).Next; + end loop; + end if; + + Write_Char (']'); + + Set_Standard_Output; + -- Brief Error mode - if Brief_Output or (not Full_List and not Verbose_Mode) then + elsif Brief_Output or (not Full_List and not Verbose_Mode) then Set_Standard_Error; E := First_Error_Msg; @@ -2899,7 +3068,9 @@ package body Errout is Write_Error_Summary; end if; - Write_Max_Errors; + if not Opt.JSON_Output then + Write_Max_Errors; + end if; -- Even though Warning_Info_Messages are a subclass of warnings, they -- must not be treated as errors when -gnatwe is in effect. diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index 345baaf..2e772ed 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -54,6 +54,7 @@ with Ttypes; use Ttypes; with Sem; use Sem; with Sem_Aggr; use Sem_Aggr; with Sem_Aux; use Sem_Aux; +with Sem_Case; use Sem_Case; with Sem_Ch3; use Sem_Ch3; with Sem_Ch8; use Sem_Ch8; with Sem_Ch13; use Sem_Ch13; @@ -683,9 +684,11 @@ package body Exp_Aggr is begin -- We bump the maximum size unless the aggregate has a single component -- association, which will be more efficient if implemented with a loop. + -- The -gnatd_g switch disables this bumping. - if No (Expressions (N)) - and then No (Next (First (Component_Associations (N)))) + if (No (Expressions (N)) + and then No (Next (First (Component_Associations (N))))) + or else Debug_Flag_Underscore_G then Max_Aggr_Size := Max_Aggregate_Size (N); else @@ -7166,7 +7169,7 @@ package body Exp_Aggr is return Build_Siz_Exp (First (Discrete_Choices (Comp))); elsif Nkind (Comp) = N_Iterated_Element_Association then - return -1; -- TBD, build expression for size of the domain + return -1; -- ??? build expression for size of the domain else return -1; @@ -8515,6 +8518,11 @@ package body Exp_Aggr is elsif Is_Static_Dispatch_Table_Aggregate (N) then return; + + -- Case pattern aggregates need to remain as aggregates + + elsif Is_Case_Choice_Pattern (N) then + return; end if; -- If the pragma Aggregate_Individually_Assign is set, always convert to diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb index 41ea467..a103060 100644 --- a/gcc/ada/exp_attr.adb +++ b/gcc/ada/exp_attr.adb @@ -7092,9 +7092,9 @@ package body Exp_Attr is -- Start of processing for Float_Valid begin - -- The C and AAMP back-ends handle Valid for fpt types + -- The C back end handles Valid for floating-point types - if Modify_Tree_For_C or else Float_Rep (PBtyp) = AAMP then + if Modify_Tree_For_C then Analyze_And_Resolve (Pref, Ptyp); Set_Etype (N, Standard_Boolean); Set_Analyzed (N); diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 90529f1..6a8b330 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -1502,7 +1502,8 @@ package body Exp_Ch3 is Typ : constant Entity_Id := Etype (Discr); procedure Check_Missing_Others (V : Node_Id); - -- ??? + -- Check that a given variant and its nested variants have an others + -- choice, and generate a constraint error raise when it does not. -------------------------- -- Check_Missing_Others -- @@ -1871,10 +1872,6 @@ package body Exp_Ch3 is -- Pass the extra accessibility level parameter associated with the -- level of the object being initialized when required. - -- When no entity is present for Id_Ref it may not have been fully - -- analyzed, so allow the default value of standard standard to be - -- passed ??? - if Is_Entity_Name (Id_Ref) and then Present (Init_Proc_Level_Formal (Proc)) then @@ -9706,10 +9703,10 @@ package body Exp_Ch3 is -- to override interface primitives. Mutate_Ekind (Defining_Unit_Name (Func_Spec), E_Function); + Set_Is_Wrapper (Defining_Unit_Name (Func_Spec)); Override_Dispatching_Operation - (Tag_Typ, Subp, New_Op => Defining_Unit_Name (Func_Spec), - Is_Wrapper => True); + (Tag_Typ, Subp, New_Op => Defining_Unit_Name (Func_Spec)); end if; <<Next_Prim>> diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 5b3a116..9c585e7 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -5780,15 +5780,14 @@ package body Exp_Ch4 is -- Avoid processing temporary function results multiple times when -- dealing with nested expression_with_actions. + -- Similarly, do not process temporary function results in loops. + -- This is done by Expand_N_Loop_Statement and Build_Finalizer. + -- Note that we used to wrongly return Abandon instead of Skip here: + -- this is wrong since it means that we were ignoring lots of + -- relevant subsequent statements. - elsif Nkind (Act) = N_Expression_With_Actions then - return Abandon; - - -- Do not process temporary function results in loops. This is done - -- by Expand_N_Loop_Statement and Build_Finalizer. - - elsif Nkind (Act) = N_Loop_Statement then - return Abandon; + elsif Nkind (Act) in N_Expression_With_Actions | N_Loop_Statement then + return Skip; end if; return OK; @@ -10852,10 +10851,11 @@ package body Exp_Ch4 is Var : Entity_Id; begin - -- Ensure that the bound variable is properly frozen. We must do - -- this before expansion because the expression is about to be - -- converted into a loop, and resulting freeze nodes may end up - -- in the wrong place in the tree. + -- Ensure that the bound variable as well as the type of Name of the + -- Iter_Spec if present are properly frozen. We must do this before + -- expansion because the expression is about to be converted into a + -- loop, and resulting freeze nodes may end up in the wrong place in the + -- tree. if Present (Iter_Spec) then Var := Defining_Identifier (Iter_Spec); @@ -10870,6 +10870,10 @@ package body Exp_Ch4 is P := Parent (P); end loop; + if Present (Iter_Spec) then + Freeze_Before (P, Etype (Name (Iter_Spec))); + end if; + Freeze_Before (P, Etype (Var)); end; @@ -12586,6 +12590,13 @@ package body Exp_Ch4 is if Is_Constrained (Target_Type) then Apply_Length_Check (Operand, Target_Type); else + -- If the object has an unconstrained array subtype with fixed + -- lower bound, then sliding to that bound may be needed. + + if Is_Fixed_Lower_Bound_Array_Subtype (Target_Type) then + Expand_Sliding_Conversion (Operand, Target_Type); + end if; + Apply_Range_Check (Operand, Target_Type); end if; diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb index c886607..cd9ab29 100644 --- a/gcc/ada/exp_ch5.adb +++ b/gcc/ada/exp_ch5.adb @@ -31,6 +31,7 @@ with Einfo; use Einfo; with Einfo.Entities; use Einfo.Entities; with Einfo.Utils; use Einfo.Utils; with Elists; use Elists; +with Errout; use Errout; with Exp_Aggr; use Exp_Aggr; with Exp_Ch6; use Exp_Ch6; with Exp_Ch7; use Exp_Ch7; @@ -39,6 +40,7 @@ with Exp_Dbug; use Exp_Dbug; with Exp_Pakd; use Exp_Pakd; with Exp_Tss; use Exp_Tss; with Exp_Util; use Exp_Util; +with Expander; use Expander; with Inline; use Inline; with Namet; use Namet; with Nlists; use Nlists; @@ -3031,7 +3033,415 @@ package body Exp_Ch5 is Choice : Node_Id; Chlist : List_Id; + function Expand_General_Case_Statement return Node_Id; + -- Expand a case statement whose selecting expression is not discrete + + ----------------------------------- + -- Expand_General_Case_Statement -- + ----------------------------------- + + function Expand_General_Case_Statement return Node_Id is + -- expand into a block statement + + Selector : constant Entity_Id := + Make_Temporary (Loc, 'J'); + + function Selector_Subtype_Mark return Node_Id is + (New_Occurrence_Of (Etype (Expr), Loc)); + + Renamed_Name : constant Node_Id := + (if Is_Name_Reference (Expr) + then Expr + else Make_Qualified_Expression (Loc, + Subtype_Mark => Selector_Subtype_Mark, + Expression => Expr)); + + Selector_Decl : constant Node_Id := + Make_Object_Renaming_Declaration (Loc, + Defining_Identifier => Selector, + Subtype_Mark => Selector_Subtype_Mark, + Name => Renamed_Name); + + First_Alt : constant Node_Id := First (Alternatives (N)); + + function Choice_Index_Decl_If_Needed return Node_Id; + -- If we are going to need a choice index object (that is, if + -- Multidefined_Bindings is true for at least one of the case + -- alternatives), then create and return that object's declaration. + -- Otherwise, return Empty; no need for a decl in that case because + -- it would never be referenced. + + --------------------------------- + -- Choice_Index_Decl_If_Needed -- + --------------------------------- + + function Choice_Index_Decl_If_Needed return Node_Id is + Alt : Node_Id := First_Alt; + begin + while Present (Alt) loop + if Multidefined_Bindings (Alt) then + return Make_Object_Declaration + (Sloc => Loc, + Defining_Identifier => + Make_Temporary (Loc, 'K'), + Object_Definition => + New_Occurrence_Of (Standard_Positive, Loc)); + end if; + + Next (Alt); + end loop; + return Empty; -- decl not needed + end Choice_Index_Decl_If_Needed; + + Choice_Index_Decl : constant Node_Id := Choice_Index_Decl_If_Needed; + + function Pattern_Match + (Pattern : Node_Id; + Object : Node_Id; + Choice_Index : Natural; + Alt : Node_Id; + Suppress_Choice_Index_Update : Boolean := False) return Node_Id; + -- Returns a Boolean-valued expression indicating a pattern match + -- for a given pattern and object. If Choice_Index is nonzero, + -- then Choice_Index is assigned to Choice_Index_Decl (unless + -- Suppress_Choice_Index_Update is specified, which should only + -- be the case for a recursive call where the caller has already + -- taken care of the update). Pattern occurs as a choice (or as a + -- subexpression of a choice) of the case statement alternative Alt. + + function Top_Level_Pattern_Match_Condition + (Alt : Node_Id) return Node_Id; + -- Returns a Boolean-valued expression indicating a pattern match + -- for the given alternative's list of choices. + + ------------------- + -- Pattern_Match -- + ------------------- + + function Pattern_Match + (Pattern : Node_Id; + Object : Node_Id; + Choice_Index : Natural; + Alt : Node_Id; + Suppress_Choice_Index_Update : Boolean := False) return Node_Id + is + function Update_Choice_Index return Node_Id is ( + Make_Assignment_Statement (Loc, + Name => + New_Occurrence_Of + (Defining_Identifier (Choice_Index_Decl), Loc), + Expression => Make_Integer_Literal (Loc, Pos (Choice_Index)))); + + function PM + (Pattern : Node_Id; + Object : Node_Id; + Choice_Index : Natural := Pattern_Match.Choice_Index; + Alt : Node_Id := Pattern_Match.Alt; + Suppress_Choice_Index_Update : Boolean := + Pattern_Match.Suppress_Choice_Index_Update) return Node_Id + renames Pattern_Match; + -- convenient rename for recursive calls + + begin + if Choice_Index /= 0 and not Suppress_Choice_Index_Update then + pragma Assert (Present (Choice_Index_Decl)); + + -- Add Choice_Index update as a side effect of evaluating + -- this condition and try again, this time suppressing + -- Choice_Index update. + + return Make_Expression_With_Actions (Loc, + Actions => New_List (Update_Choice_Index), + Expression => + PM (Pattern, Object, + Suppress_Choice_Index_Update => True)); + end if; + + if Nkind (Pattern) in N_Has_Etype + and then Is_Discrete_Type (Etype (Pattern)) + and then Compile_Time_Known_Value (Pattern) + then + return Make_Op_Eq (Loc, + Object, + Make_Integer_Literal (Loc, Expr_Value (Pattern))); + end if; + + case Nkind (Pattern) is + when N_Aggregate => + return Result : Node_Id := + New_Occurrence_Of (Standard_True, Loc) + do + if Is_Array_Type (Etype (Pattern)) then + -- Calling Error_Msg_N during expansion is usually a + -- mistake but is ok for an "unimplemented" message. + Error_Msg_N + ("array-valued case choices unimplemented", + Pattern); + return; + end if; + + -- positional notation should have been normalized + pragma Assert (No (Expressions (Pattern))); + + declare + Component_Assoc : Node_Id + := First (Component_Associations (Pattern)); + Choice : Node_Id; + + function Subobject return Node_Id is + (Make_Selected_Component (Loc, + Prefix => New_Copy_Tree (Object), + Selector_Name => New_Occurrence_Of + (Entity (Choice), Loc))); + begin + while Present (Component_Assoc) loop + Choice := First (Choices (Component_Assoc)); + while Present (Choice) loop + pragma Assert + (Is_Entity_Name (Choice) + and then Ekind (Entity (Choice)) + in E_Discriminant | E_Component); + + if Box_Present (Component_Assoc) then + -- Box matches anything + + pragma Assert + (No (Expression (Component_Assoc))); + else + Result := Make_And_Then (Loc, + Left_Opnd => Result, + Right_Opnd => + PM (Pattern => + Expression + (Component_Assoc), + Object => Subobject)); + end if; + + -- If this component association defines + -- (in the case where the pattern matches) + -- the value of a binding object, then + -- prepend to the statement list for this + -- alternative an assignment to the binding + -- object. This assignment will be conditional + -- if there is more than one choice. + + if Binding_Chars (Component_Assoc) /= No_Name + then + declare + Decl_Chars : constant Name_Id := + Binding_Chars (Component_Assoc); + + Block_Stmt : constant Node_Id := + First (Statements (Alt)); + pragma Assert + (Nkind (Block_Stmt) = N_Block_Statement); + pragma Assert (No (Next (Block_Stmt))); + Decl : Node_Id + := First (Declarations (Block_Stmt)); + Def_Id : Node_Id := Empty; + + Assignment_Stmt : Node_Id; + Condition : Node_Id; + Prepended_Stmt : Node_Id; + begin + -- find the variable to be modified + while No (Def_Id) or else + Chars (Def_Id) /= Decl_Chars + loop + Def_Id := Defining_Identifier (Decl); + Next (Decl); + end loop; + + Assignment_Stmt := + Make_Assignment_Statement (Loc, + Name => New_Occurrence_Of + (Def_Id, Loc), + Expression => Subobject); + + -- conditional if multiple choices + + if Present (Choice_Index_Decl) then + Condition := + Make_Op_Eq (Loc, + New_Occurrence_Of + (Defining_Identifier + (Choice_Index_Decl), Loc), + Make_Integer_Literal + (Loc, Int (Choice_Index))); + + Prepended_Stmt := + Make_If_Statement (Loc, + Condition => Condition, + Then_Statements => + New_List (Assignment_Stmt)); + else + -- assignment is unconditional + Prepended_Stmt := Assignment_Stmt; + end if; + + declare + HSS : constant Node_Id := + Handled_Statement_Sequence + (Block_Stmt); + begin + Prepend (Prepended_Stmt, + Statements (HSS)); + + Set_Analyzed (Block_Stmt, False); + Set_Analyzed (HSS, False); + end; + end; + end if; + + Next (Choice); + end loop; + + Next (Component_Assoc); + end loop; + end; + end return; + + when N_Qualified_Expression => + -- Make a copy for one of the two uses of Object; the choice + -- of where to use the original and where to use the copy + -- is arbitrary. + + return Make_And_Then (Loc, + Left_Opnd => Make_In (Loc, + Left_Opnd => New_Copy_Tree (Object), + Right_Opnd => New_Copy_Tree (Subtype_Mark (Pattern))), + Right_Opnd => + PM (Pattern => Expression (Pattern), + Object => Object)); + + when N_Identifier | N_Expanded_Name => + if Is_Type (Entity (Pattern)) then + return Make_In (Loc, + Left_Opnd => Object, + Right_Opnd => New_Occurrence_Of + (Entity (Pattern), Loc)); + end if; + + when N_Others_Choice => + return New_Occurrence_Of (Standard_True, Loc); + + when N_Type_Conversion => + -- aggregate expansion sometimes introduces conversions + if not Comes_From_Source (Pattern) + and then Base_Type (Etype (Pattern)) + = Base_Type (Etype (Expression (Pattern))) + then + return PM (Expression (Pattern), Object); + end if; + + when others => + null; + end case; + + -- Avoid cascading errors + pragma Assert (Serious_Errors_Detected > 0); + return New_Occurrence_Of (Standard_True, Loc); + end Pattern_Match; + + --------------------------------------- + -- Top_Level_Pattern_Match_Condition -- + --------------------------------------- + + function Top_Level_Pattern_Match_Condition + (Alt : Node_Id) return Node_Id + is + Top_Level_Object : constant Node_Id := + New_Occurrence_Of (Selector, Loc); + + Choices : constant List_Id := Discrete_Choices (Alt); + + First_Choice : constant Node_Id := First (Choices); + Subsequent : Node_Id := Next (First_Choice); + + Choice_Index : Natural := 0; + begin + if Multidefined_Bindings (Alt) then + Choice_Index := 1; + end if; + + return Result : Node_Id := + Pattern_Match (Pattern => First_Choice, + Object => Top_Level_Object, + Choice_Index => Choice_Index, + Alt => Alt) + do + while Present (Subsequent) loop + if Choice_Index /= 0 then + Choice_Index := Choice_Index + 1; + end if; + + Result := Make_Or_Else (Loc, + Left_Opnd => Result, + Right_Opnd => Pattern_Match + (Pattern => Subsequent, + Object => Top_Level_Object, + Choice_Index => Choice_Index, + Alt => Alt)); + Subsequent := Next (Subsequent); + end loop; + end return; + end Top_Level_Pattern_Match_Condition; + + function Elsif_Parts return List_Id; + -- Process subsequent alternatives + + ----------------- + -- Elsif_Parts -- + ----------------- + + function Elsif_Parts return List_Id is + Alt : Node_Id := First_Alt; + Result : constant List_Id := New_List; + begin + loop + Alt := Next (Alt); + exit when No (Alt); + + Append (Make_Elsif_Part (Loc, + Condition => Top_Level_Pattern_Match_Condition (Alt), + Then_Statements => Statements (Alt)), + Result); + end loop; + return Result; + end Elsif_Parts; + + If_Stmt : constant Node_Id := + Make_If_Statement (Loc, + Condition => Top_Level_Pattern_Match_Condition (First_Alt), + Then_Statements => Statements (First_Alt), + Elsif_Parts => Elsif_Parts); + -- Do we want an implicit "else raise Program_Error" here??? + -- Perhaps only if Exception-related restrictions are not in effect. + + Declarations : constant List_Id := New_List (Selector_Decl); + + begin + if Present (Choice_Index_Decl) then + Append_To (Declarations, Choice_Index_Decl); + end if; + + return Make_Block_Statement (Loc, + Declarations => Declarations, + Handled_Statement_Sequence => + Make_Handled_Sequence_Of_Statements (Loc, + Statements => New_List (If_Stmt))); + end Expand_General_Case_Statement; + + -- Start of processing for Expand_N_Case_Statement + begin + if Extensions_Allowed and then not Is_Discrete_Type (Etype (Expr)) then + Rewrite (N, Expand_General_Case_Statement); + Analyze (N); + Expand (N); + return; + end if; + -- Check for the situation where we know at compile time which branch -- will be taken. @@ -3557,7 +3967,7 @@ package body Exp_Ch5 is --------------------------- -- First we deal with the case of C and Fortran convention boolean values, - -- with zero/non-zero semantics. + -- with zero/nonzero semantics. -- Second, we deal with the obvious rewriting for the cases where the -- condition of the IF is known at compile time to be True or False. diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index b5d77bd..14c5d18 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -4248,6 +4248,16 @@ package body Exp_Ch6 is if Nkind (Call_Node) in N_Subprogram_Call and then Present (Controlling_Argument (Call_Node)) then + if Tagged_Type_Expansion then + Expand_Dispatching_Call (Call_Node); + + -- Expand_Dispatching_Call takes care of all the needed processing + + return; + end if; + + -- VM targets + declare Call_Typ : constant Entity_Id := Etype (Call_Node); Typ : constant Entity_Id := Find_Dispatching_Type (Subp); @@ -4257,69 +4267,56 @@ package body Exp_Ch6 is Prev_Call : Node_Id; begin + Apply_Tag_Checks (Call_Node); + if not Is_Limited_Type (Typ) then Eq_Prim_Op := Find_Prim_Op (Typ, Name_Op_Eq); end if; - if Tagged_Type_Expansion then - Expand_Dispatching_Call (Call_Node); - - -- The following return is worrisome. Is it really OK to skip - -- all remaining processing in this procedure ??? - - return; - - -- VM targets - - else - Apply_Tag_Checks (Call_Node); - - -- If this is a dispatching "=", we must first compare the - -- tags so we generate: x.tag = y.tag and then x = y + -- If this is a dispatching "=", we must first compare the + -- tags so we generate: x.tag = y.tag and then x = y - if Subp = Eq_Prim_Op then - - -- Mark the node as analyzed to avoid reanalyzing this - -- dispatching call (which would cause a never-ending loop) - - Prev_Call := Relocate_Node (Call_Node); - Set_Analyzed (Prev_Call); + if Subp = Eq_Prim_Op then - Param := First_Actual (Call_Node); - New_Call := - Make_And_Then (Loc, - Left_Opnd => - Make_Op_Eq (Loc, - Left_Opnd => - Make_Selected_Component (Loc, - Prefix => New_Value (Param), - Selector_Name => - New_Occurrence_Of - (First_Tag_Component (Typ), Loc)), + -- Mark the node as analyzed to avoid reanalyzing this + -- dispatching call (which would cause a never-ending loop) + + Prev_Call := Relocate_Node (Call_Node); + Set_Analyzed (Prev_Call); + + Param := First_Actual (Call_Node); + New_Call := + Make_And_Then (Loc, + Left_Opnd => + Make_Op_Eq (Loc, + Left_Opnd => + Make_Selected_Component (Loc, + Prefix => New_Value (Param), + Selector_Name => + New_Occurrence_Of + (First_Tag_Component (Typ), Loc)), + + Right_Opnd => + Make_Selected_Component (Loc, + Prefix => + Unchecked_Convert_To (Typ, + New_Value (Next_Actual (Param))), + Selector_Name => + New_Occurrence_Of + (First_Tag_Component (Typ), Loc))), + Right_Opnd => Prev_Call); - Right_Opnd => - Make_Selected_Component (Loc, - Prefix => - Unchecked_Convert_To (Typ, - New_Value (Next_Actual (Param))), - Selector_Name => - New_Occurrence_Of - (First_Tag_Component (Typ), Loc))), - Right_Opnd => Prev_Call); - - Rewrite (Call_Node, New_Call); - - Analyze_And_Resolve - (Call_Node, Call_Typ, Suppress => All_Checks); - end if; + Rewrite (Call_Node, New_Call); + Analyze_And_Resolve + (Call_Node, Call_Typ, Suppress => All_Checks); + end if; - -- Expansion of a dispatching call results in an indirect call, - -- which in turn causes current values to be killed (see - -- Resolve_Call), so on VM targets we do the call here to - -- ensure consistent warnings between VM and non-VM targets. + -- Expansion of a dispatching call results in an indirect call, + -- which in turn causes current values to be killed (see + -- Resolve_Call), so on VM targets we do the call here to + -- ensure consistent warnings between VM and non-VM targets. - Kill_Current_Values; - end if; + Kill_Current_Values; -- If this is a dispatching "=" then we must update the reference -- to the call node because we generated: @@ -7534,6 +7531,13 @@ package body Exp_Ch6 is Suppress => All_Checks); end if; + -- If the result is of an unconstrained array subtype with fixed lower + -- bound, then sliding to that bound may be needed. + + if Is_Fixed_Lower_Bound_Array_Subtype (R_Type) then + Expand_Sliding_Conversion (Exp, R_Type); + end if; + -- If we are returning a nonscalar object that is possibly unaligned, -- then copy the value into a temporary first. This copy may need to -- expand to a loop of component operations. diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb index eb6b352..a2ea7c6 100644 --- a/gcc/ada/exp_disp.adb +++ b/gcc/ada/exp_disp.adb @@ -4052,6 +4052,7 @@ package body Exp_Disp is if Present (N) and then Is_Private_Type (Typ) and then No (Full_View (Typ)) + and then not Has_Private_Declaration (Typ) and then not Is_Generic_Type (Typ) and then not Is_Tagged_Type (Typ) and then not Is_Frozen (Typ) @@ -4070,6 +4071,7 @@ package body Exp_Disp is if not Is_Tagged_Type (Typ) and then Present (Comp) and then not Is_Frozen (Comp) + and then not Has_Private_Declaration (Comp) and then not Is_Actual_For_Formal_Incomplete_Type (Comp) then Error_Msg_Sloc := Sloc (Subp); diff --git a/gcc/ada/exp_dist.adb b/gcc/ada/exp_dist.adb index cf908b1..7fb2132 100644 --- a/gcc/ada/exp_dist.adb +++ b/gcc/ada/exp_dist.adb @@ -10906,8 +10906,8 @@ package body Exp_Dist is raise Program_Error; end if; - -- TBD: fixed point types??? - -- TBverified numeric types with a biased representation??? + -- What about fixed point types and numeric types with a biased + -- representation??? end Find_Numeric_Representation; diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb index 8204fdc..c071a9c 100644 --- a/gcc/ada/exp_unst.adb +++ b/gcc/ada/exp_unst.adb @@ -1566,7 +1566,7 @@ package body Exp_Unst is -- A subprogram instantiation does not have an explicit -- body. If unused, we could remove the corresponding - -- wrapper package and its body (TBD). + -- wrapper package and its body. if Present (STJ.Bod) then Spec := Corresponding_Spec (STJ.Bod); diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index 860525d..ed1a016 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -37,6 +37,7 @@ with Exp_Aggr; use Exp_Aggr; with Exp_Ch6; use Exp_Ch6; with Exp_Ch7; use Exp_Ch7; with Exp_Ch11; use Exp_Ch11; +with Freeze; use Freeze; with Ghost; use Ghost; with Inline; use Inline; with Itypes; use Itypes; @@ -5315,6 +5316,190 @@ package body Exp_Util is end if; end Evolve_Or_Else; + ------------------------------- + -- Expand_Sliding_Conversion -- + ------------------------------- + + procedure Expand_Sliding_Conversion (N : Node_Id; Arr_Typ : Entity_Id) is + + pragma Assert (Is_Array_Type (Arr_Typ) + and then not Is_Constrained (Arr_Typ) + and then Is_Fixed_Lower_Bound_Array_Subtype (Arr_Typ)); + + Constraints : List_Id; + Index : Node_Id := First_Index (Arr_Typ); + Loc : constant Source_Ptr := Sloc (N); + Subt_Decl : Node_Id; + Subt : Entity_Id; + Subt_Low : Node_Id; + Subt_High : Node_Id; + + Act_Subt : Entity_Id; + Act_Index : Node_Id; + Act_Low : Node_Id; + Act_High : Node_Id; + Adjust_Incr : Node_Id; + Dimension : Int := 0; + All_FLBs_Match : Boolean := True; + + begin + -- Sliding should never be needed for string literals, because they have + -- their bounds set according to the applicable index constraint. + + if Nkind (N) /= N_String_Literal then + Constraints := New_List; + + Act_Subt := Get_Actual_Subtype (N); + Act_Index := First_Index (Act_Subt); + + -- Loop over the indexes of the fixed-lower-bound array type or + -- subtype to build up an index constraint for constructing the + -- subtype that will be the target of a conversion of the array + -- object that may need a sliding conversion. + + while Present (Index) loop + pragma Assert (Present (Act_Index)); + + Dimension := Dimension + 1; + + Get_Index_Bounds (Act_Index, Act_Low, Act_High); + + -- If Index defines a normal unconstrained range (range <>), + -- then we will simply use the bounds of the actual subtype's + -- corresponding index range. + + if not Is_Fixed_Lower_Bound_Index_Subtype (Etype (Index)) then + Subt_Low := Act_Low; + Subt_High := Act_High; + + -- Otherwise, a range will be created with a low bound given by + -- the fixed lower bound of the array subtype's index, and with + -- high bound given by (Actual'Length + fixed lower bound - 1). + + else + if Nkind (Index) = N_Subtype_Indication then + Subt_Low := + New_Copy_Tree + (Low_Bound (Range_Expression (Constraint (Index)))); + else + pragma Assert (Nkind (Index) = N_Range); + + Subt_Low := New_Copy_Tree (Low_Bound (Index)); + end if; + + -- If either we have a nonstatic lower bound, or the target and + -- source subtypes are statically known to have unequal lower + -- bounds, then we will need to make a subtype conversion to + -- slide the bounds. However, if all of the indexes' lower + -- bounds are static and known to be equal (the common case), + -- then no conversion will be needed, and we'll end up not + -- creating the subtype or the conversion (though we still + -- build up the index constraint, which will simply be unused). + + if not (Compile_Time_Known_Value (Subt_Low) + and then Compile_Time_Known_Value (Act_Low)) + or else Expr_Value (Subt_Low) /= Expr_Value (Act_Low) + then + All_FLBs_Match := False; + end if; + + -- Apply 'Pos to lower bound, which may be of an enumeration + -- type, before subtracting. + + Adjust_Incr := + Make_Op_Subtract (Loc, + Make_Attribute_Reference (Loc, + Prefix => + New_Occurrence_Of (Etype (Act_Index), Loc), + Attribute_Name => + Name_Pos, + Expressions => + New_List (New_Copy_Tree (Subt_Low))), + Make_Integer_Literal (Loc, 1)); + + -- Apply 'Val to the result of adding the increment to the + -- length, to handle indexes of enumeration types. + + Subt_High := + Make_Attribute_Reference (Loc, + Prefix => + New_Occurrence_Of (Etype (Act_Index), Loc), + Attribute_Name => + Name_Val, + Expressions => + New_List (Make_Op_Add (Loc, + Make_Attribute_Reference (Loc, + Prefix => + New_Occurrence_Of (Act_Subt, Loc), + Attribute_Name => + Name_Length, + Expressions => + New_List + (Make_Integer_Literal + (Loc, Dimension))), + Adjust_Incr))); + end if; + + Append (Make_Range (Loc, Subt_Low, Subt_High), Constraints); + + Next (Index); + Next (Act_Index); + end loop; + + -- If for each index with a fixed lower bound (FLB), the lower bound + -- of the corresponding index of the actual subtype is statically + -- known be equal to the FLB, then a sliding conversion isn't needed + -- at all, so just return without building a subtype or conversion. + + if All_FLBs_Match then + return; + end if; + + -- A sliding conversion is needed, so create the target subtype using + -- the index constraint created above, and rewrite the expression + -- as a conversion to that subtype. + + Subt := Make_Temporary (Loc, 'S', Related_Node => N); + Set_Is_Internal (Subt); + + Subt_Decl := + Make_Subtype_Declaration (Loc, + Defining_Identifier => Subt, + Subtype_Indication => + Make_Subtype_Indication (Loc, + Subtype_Mark => + New_Occurrence_Of (Arr_Typ, Loc), + Constraint => + Make_Index_Or_Discriminant_Constraint (Loc, + Constraints => Constraints))); + + Mark_Rewrite_Insertion (Subt_Decl); + + -- The actual subtype is an Itype, so we analyze the declaration, + -- but do not attach it to the tree. + + Set_Parent (Subt_Decl, N); + Set_Is_Itype (Subt); + Analyze (Subt_Decl, Suppress => All_Checks); + Set_Associated_Node_For_Itype (Subt, N); + Set_Has_Delayed_Freeze (Subt, False); + + -- We need to freeze the actual subtype immediately. This is needed + -- because otherwise this Itype will not get frozen at all, and it is + -- always safe to freeze on creation because any associated types + -- must be frozen at this point. + + Freeze_Itype (Subt, N); + + Rewrite (N, + Make_Type_Conversion (Loc, + Subtype_Mark => + New_Occurrence_Of (Subt, Loc), + Expression => Relocate_Node (N))); + Analyze (N); + end if; + end Expand_Sliding_Conversion; + ----------------------------------------- -- Expand_Static_Predicates_In_Choices -- ----------------------------------------- @@ -5322,7 +5507,7 @@ package body Exp_Util is procedure Expand_Static_Predicates_In_Choices (N : Node_Id) is pragma Assert (Nkind (N) in N_Case_Statement_Alternative | N_Variant); - Choices : constant List_Id := Discrete_Choices (N); + Choices : List_Id := Discrete_Choices (N); Choice : Node_Id; Next_C : Node_Id; @@ -5330,6 +5515,13 @@ package body Exp_Util is C : Node_Id; begin + -- If this is an "others" alternative, we need to process any static + -- predicates in its Others_Discrete_Choices. + + if Nkind (First (Choices)) = N_Others_Choice then + Choices := Others_Discrete_Choices (First (Choices)); + end if; + Choice := First (Choices); while Present (Choice) loop Next_C := Next (Choice); @@ -6213,6 +6405,9 @@ package body Exp_Util is | N_Discriminant_Association | N_Parameter_Association | N_Pragma_Argument_Association + | N_Aggregate + | N_Delta_Aggregate + | N_Extension_Aggregate and then Nkind (Parent (Par)) not in N_Function_Call | N_Procedure_Call_Statement | N_Entry_Call_Statement diff --git a/gcc/ada/exp_util.ads b/gcc/ada/exp_util.ads index 85e5a55..2b3147d 100644 --- a/gcc/ada/exp_util.ads +++ b/gcc/ada/exp_util.ads @@ -560,6 +560,12 @@ package Exp_Util is -- indicating that no checks were required). The Sloc field of the -- constructed N_Or_Else node is copied from Cond1. + procedure Expand_Sliding_Conversion (N : Node_Id; Arr_Typ : Entity_Id); + -- When sliding is needed for an array object N in the context of an + -- unconstrained array type Arr_Typ with fixed lower bound (FLB), create + -- a subtype with appropriate index constraint (FLB .. N'Length + FLB - 1) + -- and apply a conversion from N to that subtype. + procedure Expand_Static_Predicates_In_Choices (N : Node_Id); -- N is either a case alternative or a variant. The Discrete_Choices field -- of N points to a list of choices. If any of these choices is the name diff --git a/gcc/ada/fe.h b/gcc/ada/fe.h index 6317737..dc2b416 100644 --- a/gcc/ada/fe.h +++ b/gcc/ada/fe.h @@ -203,7 +203,7 @@ extern Boolean In_Extended_Main_Code_Unit (Entity_Id); #define Suppress_Checks opt__suppress_checks typedef enum { - Ada_83, Ada_95, Ada_2005, Ada_2012, Ada_2022 + Ada_83, Ada_95, Ada_2005, Ada_2012, Ada_2022, Ada_With_Extensions } Ada_Version_Type; typedef enum { diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index fd82169..3ea4a99 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -186,6 +186,72 @@ package body Freeze is -- the designated type. Otherwise freezing the access type does not freeze -- the designated type. + function Should_Freeze_Type (Typ : Entity_Id; E : Entity_Id) return Boolean; + -- If Typ is in the current scope or in an instantiation, then return True. + -- ???Expression functions (represented by E) shouldn't freeze types in + -- general, but our current expansion and freezing model requires an early + -- freezing when the dispatch table is needed or when building an aggregate + -- with a subtype of Typ, so return True also in this case. + -- Note that expression function completions do freeze and are + -- handled in Sem_Ch6.Analyze_Expression_Function. + + ------------------------ + -- Should_Freeze_Type -- + ------------------------ + + function Should_Freeze_Type + (Typ : Entity_Id; E : Entity_Id) return Boolean + is + function Is_Dispatching_Call_Or_Aggregate + (N : Node_Id) return Traverse_Result; + -- Return Abandon if N is a dispatching call to a subprogram + -- declared in the same scope as Typ or an aggregate whose type + -- is Typ. + + -------------------------------------- + -- Is_Dispatching_Call_Or_Aggregate -- + -------------------------------------- + + function Is_Dispatching_Call_Or_Aggregate + (N : Node_Id) return Traverse_Result is + begin + if Nkind (N) = N_Function_Call + and then Present (Controlling_Argument (N)) + and then Scope (Entity (Original_Node (Name (N)))) + = Scope (Typ) + then + return Abandon; + elsif Nkind (N) = N_Aggregate + and then Base_Type (Etype (N)) = Base_Type (Typ) + then + return Abandon; + else + return OK; + end if; + end Is_Dispatching_Call_Or_Aggregate; + + ------------------------- + -- Need_Dispatch_Table -- + ------------------------- + + function Need_Dispatch_Table is new + Traverse_Func (Is_Dispatching_Call_Or_Aggregate); + -- Return Abandon if the input expression requires access to + -- Typ's dispatch table. + + Decl : constant Node_Id := + (if No (E) then E else Original_Node (Unit_Declaration_Node (E))); + + -- Start of processing for Should_Freeze_Type + + begin + return Within_Scope (Typ, Current_Scope) + or else In_Instance + or else (Present (Decl) + and then Nkind (Decl) = N_Expression_Function + and then Need_Dispatch_Table (Expression (Decl)) = Abandon); + end Should_Freeze_Type; + procedure Process_Default_Expressions (E : Entity_Id; After : in out Node_Id); @@ -1408,7 +1474,7 @@ package body Freeze is -- pragmas force the creation of a wrapper for the inherited operation. -- If the ancestor is being overridden, the pragmas are constructed only -- to verify their legality, in case they contain calls to other - -- primitives that may haven been overridden. + -- primitives that may have been overridden. --------------------------------------- -- Build_Inherited_Condition_Pragmas -- @@ -1492,6 +1558,15 @@ package body Freeze is then Par_Prim := Overridden_Operation (Prim); + -- When the primitive is an LSP wrapper we climb to the parent + -- primitive that has the inherited contract. + + if Is_Wrapper (Par_Prim) + and then Present (LSP_Subprogram (Par_Prim)) + then + Par_Prim := LSP_Subprogram (Par_Prim); + end if; + -- Analyze the contract items of the overridden operation, before -- they are rewritten as pragmas. @@ -1530,6 +1605,15 @@ package body Freeze is if not Comes_From_Source (Prim) and then Present (Alias (Prim)) then Par_Prim := Alias (Prim); + -- When the primitive is an LSP wrapper we climb to the parent + -- primitive that has the inherited contract. + + if Is_Wrapper (Par_Prim) + and then Present (LSP_Subprogram (Par_Prim)) + then + Par_Prim := LSP_Subprogram (Par_Prim); + end if; + -- Analyze the contract items of the parent operation, and -- determine whether a wrapper is needed. This is determined -- when the condition is rewritten in sem_prag, using the @@ -1563,14 +1647,22 @@ package body Freeze is -- statement with a call. declare + Alias_Id : constant Entity_Id := Ultimate_Alias (Prim); Loc : constant Source_Ptr := Sloc (R); Par_R : constant Node_Id := Parent (R); New_Body : Node_Id; New_Decl : Node_Id; + New_Id : Entity_Id; New_Spec : Node_Id; begin + -- The wrapper must be analyzed in the scope of its wrapped + -- primitive (to ensure its correct decoration). + + Push_Scope (Scope (Prim)); + New_Spec := Build_Overriding_Spec (Par_Prim, R); + New_Id := Defining_Entity (New_Spec); New_Decl := Make_Subprogram_Declaration (Loc, Specification => New_Spec); @@ -1592,9 +1684,26 @@ package body Freeze is Build_Class_Wide_Clone_Call (Loc, Decls, Par_Prim, New_Spec); + -- Adding minimum decoration + + Mutate_Ekind (New_Id, Ekind (Par_Prim)); + Set_LSP_Subprogram (New_Id, Par_Prim); + Set_Is_Wrapper (New_Id); + Insert_List_After_And_Analyze (Par_R, New_List (New_Decl, New_Body)); + + -- Ensure correct decoration + + pragma Assert (Present (Alias (Prim))); + pragma Assert (Present (Overridden_Operation (New_Id))); + pragma Assert (Overridden_Operation (New_Id) = Alias_Id); end if; + + pragma Assert (Is_Dispatching_Operation (Prim)); + pragma Assert (Is_Dispatching_Operation (New_Id)); + + Pop_Scope; end; end if; @@ -4006,7 +4115,9 @@ package body Freeze is Set_Etype (Formal, F_Type); end if; - if not From_Limited_With (F_Type) then + if not From_Limited_With (F_Type) + and then Should_Freeze_Type (F_Type, E) + then Freeze_And_Append (F_Type, N, Result); end if; @@ -4183,7 +4294,9 @@ package body Freeze is Set_Etype (E, R_Type); end if; - Freeze_And_Append (R_Type, N, Result); + if Should_Freeze_Type (R_Type, E) then + Freeze_And_Append (R_Type, N, Result); + end if; -- Check suspicious return type for C function @@ -4317,8 +4430,7 @@ package body Freeze is and then Convention (E) /= Convention_Intrinsic - -- Assume that ASM interface knows what it is doing. This deals - -- with e.g. unsigned.ads in the AAMP back end. + -- Assume that ASM interface knows what it is doing and then Convention (E) /= Convention_Assembler then @@ -5952,11 +6064,12 @@ package body Freeze is -- Here for other than a subprogram or type else - -- If entity has a type, and it is not a generic unit, then freeze - -- it first (RM 13.14(10)). + -- If entity has a type declared in the current scope, and it is + -- not a generic unit, then freeze it first. if Present (Etype (E)) and then Ekind (E) /= E_Generic_Function + and then Within_Scope (Etype (E), Current_Scope) then Freeze_And_Append (Etype (E), N, Result); @@ -7784,7 +7897,7 @@ package body Freeze is -- tree. This is an unusual case, but there are some legitimate -- situations in which this occurs, notably when the expressions -- in the range of a type declaration are resolved. We simply - -- ignore the freeze request in this case. Is this right ??? + -- ignore the freeze request in this case. if No (Parent_P) then return; @@ -8044,7 +8157,7 @@ package body Freeze is end case; -- We fall through the case if we did not yet find the proper - -- place in the free for inserting the freeze node, so climb. + -- place in the tree for inserting the freeze node, so climb. P := Parent_P; end loop; diff --git a/gcc/ada/gen_il-fields.ads b/gcc/ada/gen_il-fields.ads index 9c3bf34..220db60 100644 --- a/gcc/ada/gen_il-fields.ads +++ b/gcc/ada/gen_il-fields.ads @@ -87,6 +87,7 @@ package Gen_IL.Fields is Aux_Decls_Node, Backwards_OK, Bad_Is_Detected, + Binding_Chars, Body_Required, Body_To_Inline, Box_Present, @@ -306,6 +307,7 @@ package Gen_IL.Fields is Low_Bound, Mod_Clause, More_Ids, + Multidefined_Bindings, Must_Be_Byte_Aligned, Must_Not_Freeze, Must_Not_Override, @@ -545,7 +547,6 @@ package Gen_IL.Fields is First_Literal, First_Private_Entity, First_Rep_Item, - Float_Rep, Freeze_Node, From_Limited_With, Full_View, @@ -667,6 +668,7 @@ package Gen_IL.Fields is Is_Actual_Subtype, Is_Ada_2005_Only, Is_Ada_2012_Only, + Is_Ada_2022_Only, Is_Aliased, Is_Asynchronous, Is_Atomic, @@ -675,7 +677,6 @@ package Gen_IL.Fields is Is_Character_Type, Is_Checked_Ghost_Entity, Is_Child_Unit, - Is_Class_Wide_Clone, Is_Class_Wide_Equivalent_Type, Is_Compilation_Unit, Is_Completely_Hidden, @@ -703,6 +704,8 @@ package Gen_IL.Fields is Is_Exported, Is_Finalized_Transient, Is_First_Subtype, + Is_Fixed_Lower_Bound_Array_Subtype, + Is_Fixed_Lower_Bound_Index_Subtype, Is_Formal_Subprogram, Is_Frozen, Is_Generic_Actual_Subprogram, @@ -785,6 +788,7 @@ package Gen_IL.Fields is Is_Volatile_Type, Is_Volatile_Object, Is_Volatile_Full_Access, + Is_Wrapper, Itype_Printed, Kill_Elaboration_Checks, Kill_Range_Checks, @@ -798,6 +802,7 @@ package Gen_IL.Fields is Lit_Indexes, Lit_Strings, Low_Bound_Tested, + LSP_Subprogram, Machine_Radix_10, Master_Id, Materialize_Entity, diff --git a/gcc/ada/gen_il-gen-gen_entities.adb b/gcc/ada/gen_il-gen-gen_entities.adb index 85eb2d7..dda309b 100644 --- a/gcc/ada/gen_il-gen-gen_entities.adb +++ b/gcc/ada/gen_il-gen-gen_entities.adb @@ -119,13 +119,13 @@ begin -- Gen_IL.Gen.Gen_Entities Sm (In_Use, Flag), Sm (Is_Ada_2005_Only, Flag), Sm (Is_Ada_2012_Only, Flag), + Sm (Is_Ada_2022_Only, Flag), Sm (Is_Aliased, Flag), Sm (Is_Atomic, Flag), Sm (Is_Bit_Packed_Array, Flag, Impl_Base_Type_Only), Sm (Is_Character_Type, Flag), Sm (Is_Checked_Ghost_Entity, Flag), Sm (Is_Child_Unit, Flag), - Sm (Is_Class_Wide_Clone, Flag), Sm (Is_Class_Wide_Equivalent_Type, Flag), Sm (Is_Compilation_Unit, Flag), Sm (Is_Concurrent_Record_Type, Flag), @@ -203,6 +203,7 @@ begin -- Gen_IL.Gen.Gen_Entities Sm (Is_Volatile_Type, Flag), Sm (Is_Volatile_Object, Flag), Sm (Is_Volatile_Full_Access, Flag), + Sm (Is_Wrapper, Flag), Sm (Kill_Elaboration_Checks, Flag), Sm (Kill_Range_Checks, Flag), Sm (Low_Bound_Tested, Flag), @@ -279,7 +280,6 @@ begin -- Gen_IL.Gen.Gen_Entities Sm (RM_Size, Uint), Sm (Extra_Formal, Node_Id), Sm (First_Entity, Node_Id), - Sm (Float_Rep, Float_Rep_Kind, Base_Type_Only), Sm (Generic_Homonym, Node_Id), Sm (Generic_Renamings, Elist_Id), Sm (Handler_Records, List_Id), @@ -532,6 +532,8 @@ begin -- Gen_IL.Gen.Gen_Entities Sm (Is_Abstract_Type, Flag), Sm (Is_Actual_Subtype, Flag), Sm (Is_Asynchronous, Flag), + Sm (Is_Fixed_Lower_Bound_Array_Subtype, Flag), + Sm (Is_Fixed_Lower_Bound_Index_Subtype, Flag), Sm (Is_Generic_Actual_Type, Flag), Sm (Is_Non_Static_Subtype, Flag), Sm (Is_Private_Composite, Flag), @@ -656,8 +658,7 @@ begin -- Gen_IL.Gen.Gen_Entities -- first named subtype). Ab (Float_Kind, Real_Kind, - (Sm (Digits_Value, Uint), - Sm (Float_Rep, Float_Rep_Kind, Base_Type_Only))); + (Sm (Digits_Value, Uint))); Cc (E_Floating_Point_Type, Float_Kind); -- Floating point type, used for the anonymous base type of the @@ -1087,6 +1088,7 @@ begin -- Gen_IL.Gen.Gen_Entities Sm (Is_Predicate_Function_M, Flag), Sm (Is_Primitive_Wrapper, Flag), Sm (Is_Private_Primitive, Flag), + Sm (LSP_Subprogram, Node_Id), Sm (Mechanism, Mechanism_Type), Sm (Next_Inlined_Subprogram, Node_Id), Sm (Original_Protected_Subprogram, Node_Id), @@ -1106,7 +1108,8 @@ begin -- Gen_IL.Gen.Gen_Entities -- defined concatenation operator created whenever an array is declared. -- We do not make normal derived operators explicit in the tree, but the -- concatenation operators are made explicit. - (Sm (Extra_Accessibility_Of_Result, Node_Id))); + (Sm (Extra_Accessibility_Of_Result, Node_Id), + Sm (LSP_Subprogram, Node_Id))); Cc (E_Procedure, Subprogram_Kind, -- A procedure, created by a procedure declaration or a procedure @@ -1136,6 +1139,7 @@ begin -- Gen_IL.Gen.Gen_Entities Sm (Is_Primitive_Wrapper, Flag), Sm (Is_Private_Primitive, Flag), Sm (Is_Valued_Procedure, Flag), + Sm (LSP_Subprogram, Node_Id), Sm (Next_Inlined_Subprogram, Node_Id), Sm (Original_Protected_Subprogram, Node_Id), Sm (Postconditions_Proc, Node_Id), diff --git a/gcc/ada/gen_il-gen-gen_nodes.adb b/gcc/ada/gen_il-gen-gen_nodes.adb index 2405fd75..13bdd71 100644 --- a/gcc/ada/gen_il-gen-gen_nodes.adb +++ b/gcc/ada/gen_il-gen-gen_nodes.adb @@ -1213,7 +1213,8 @@ begin -- Gen_IL.Gen.Gen_Nodes Cc (N_Case_Statement_Alternative, Node_Kind, (Sy (Discrete_Choices, List_Id), Sy (Statements, List_Id, Default_Empty_List), - Sm (Has_SP_Choice, Flag))); + Sm (Has_SP_Choice, Flag), + Sm (Multidefined_Bindings, Flag))); Cc (N_Compilation_Unit, Node_Kind, (Sy (Context_Items, List_Id), @@ -1241,6 +1242,7 @@ begin -- Gen_IL.Gen.Gen_Nodes Sy (Expression, Node_Id, Default_Empty), Sy (Box_Present, Flag), Sy (Inherited_Discriminant, Flag), + Sy (Binding_Chars, Name_Id, Default_No_Name), Sm (Loop_Actions, List_Id), Sm (Was_Default_Init_Box_Association, Flag))); diff --git a/gcc/ada/gen_il-gen.adb b/gcc/ada/gen_il-gen.adb index cffbf2a..7ef285e 100644 --- a/gcc/ada/gen_il-gen.adb +++ b/gcc/ada/gen_il-gen.adb @@ -831,26 +831,30 @@ package body Gen_IL.Gen is function Field_Size (T : Type_Enum) return Bit_Offset is (case T is - when Flag | Float_Rep_Kind => 1, + when Flag => 1, when Small_Paren_Count_Type | Component_Alignment_Kind => 2, when Node_Kind_Type | Entity_Kind_Type | Convention_Id => 8, - when Mechanism_Type - | List_Id - | Elist_Id - | Name_Id - | String_Id - | Uint - | Ureal - | Source_Ptr - | Union_Id - | Node_Id - | Node_Or_Entity_Type => 32, + when Mechanism_Type + | List_Id + | Elist_Id + | Name_Id + | String_Id + | Uint + | Ureal + | Source_Ptr + | Union_Id + | Node_Id + | Node_Or_Entity_Type => 32, when Between_Special_And_Abstract_Node_Types => -- can't happen Bit_Offset'Last); + -- Size in bits of a a field of type T. It must be a power of 2, and + -- must match the size of the type in GNAT, which sometimes requires + -- a Size clause in GNAT. + -- -- Note that this is not the same as Type_Bit_Size of the field's -- type. For one thing, Type_Bit_Size only covers concrete node and -- entity types, which does not include most of the above. For @@ -1012,11 +1016,20 @@ package body Gen_IL.Gen is end loop; -- Sort All_Fields based on how many concrete types have the field. + -- This is for efficiency; we want to choose the offsets of the most + -- common fields first, so they get low numbers. Sorting.Sort (All_Fields); -- Go through all the fields, and choose the lowest offset that is - -- free in all types that have the field. + -- free in all types that have the field. This is basically a + -- graph-coloring algorithm on the interference graph. The + -- interference graph is an undirected graph with the fields being + -- nodes (not nodes in the compiler!) in the graph, and an edge + -- between a pair of fields if they appear in the same node in the + -- compiler. The "colors" are fields offsets, except that a + -- complication compared to standard graph coloring is that fields + -- are different sizes. for F of All_Fields loop Field_Table (F).Offset := Choose_Offset (F); @@ -2019,7 +2032,7 @@ package body Gen_IL.Gen is Put (S, ",\n"); end if; - Put (S, "\1", Image (F)); + Put (S, "\1", F_Image (F)); end if; end loop; end Put_Field_Array; @@ -2081,7 +2094,7 @@ package body Gen_IL.Gen is Put (S, ",\n"); end if; - Put (S, "\1", Image (F)); + Put (S, "\1", F_Image (F)); end loop; Outdent (S, 1); @@ -2161,7 +2174,7 @@ package body Gen_IL.Gen is Put (S, ",\n"); end if; - Put (S, "\1 => (\2_Field, \3)", Image (F), + Put (S, "\1 => (\2_Field, \3)", F_Image (F), Image (Field_Table (F).Field_Type), Image (Field_Table (F).Offset)); end loop; @@ -2283,6 +2296,8 @@ package body Gen_IL.Gen is Put (B, "end Set_\1_Id_With_Parent;\n", Kind); end Put_Setter_With_Parent; + -- Start of processing for Put_Nodes + begin Put (S, "with Seinfo; use Seinfo;\n"); Put (S, "pragma Warnings (Off);\n"); diff --git a/gcc/ada/gen_il-internals.adb b/gcc/ada/gen_il-internals.adb index ca6c217..d676d91 100644 --- a/gcc/ada/gen_il-internals.adb +++ b/gcc/ada/gen_il-internals.adb @@ -317,6 +317,8 @@ package body Gen_IL.Internals is return "Is_SPARK_Mode_On_Node"; when Local_Raise_Not_OK => return "Local_Raise_Not_OK"; + when LSP_Subprogram => + return "LSP_Subprogram"; when OK_To_Rename => return "OK_To_Rename"; when Referenced_As_LHS => diff --git a/gcc/ada/gen_il-internals.ads b/gcc/ada/gen_il-internals.ads index 93acdb4..27022a0 100644 --- a/gcc/ada/gen_il-internals.ads +++ b/gcc/ada/gen_il-internals.ads @@ -189,6 +189,13 @@ package Gen_IL.Internals is function Image (F : Opt_Field_Enum) return String; + function F_Image (F : Opt_Field_Enum) return String is + ("F_" & Image (F)); + -- Prepends "F_" to Image (F). This is used for the enumeration literals in + -- the generated Sinfo.Nodes.Node_Field and Einfo.Entities.Entity_Field + -- types. If we used Image (F), these enumeration literals would overload + -- the getter functions, which confuses gdb. + procedure Nil (T : Node_Or_Entity_Type); -- Null procedure diff --git a/gcc/ada/gen_il-types.ads b/gcc/ada/gen_il-types.ads index 6d0af21..96231e9 100644 --- a/gcc/ada/gen_il-types.ads +++ b/gcc/ada/gen_il-types.ads @@ -65,7 +65,6 @@ package Gen_IL.Types is Convention_Id, Component_Alignment_Kind, - Float_Rep_Kind, Mechanism_Type, Between_Special_And_Abstract_Node_Types, diff --git a/gcc/ada/get_targ.adb b/gcc/ada/get_targ.adb index d65c44f..cd2aed2 100644 --- a/gcc/ada/get_targ.adb +++ b/gcc/ada/get_targ.adb @@ -284,7 +284,7 @@ package body Get_Targ is function Get_Max_Unaligned_Field return Pos is begin - return 64; -- Can be different on some targets (e.g., AAMP) + return 64; -- Can be different on some targets end Get_Max_Unaligned_Field; ----------------------------- diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index 7051aa6..5c22995 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -154,7 +154,6 @@ Implementation Defined Pragmas * Pragma Export_Function:: * Pragma Export_Object:: * Pragma Export_Procedure:: -* Pragma Export_Value:: * Pragma Export_Valued_Procedure:: * Pragma Extend_System:: * Pragma Extensions_Allowed:: @@ -282,7 +281,6 @@ Implementation Defined Pragmas * Pragma Unevaluated_Use_Of_Old:: * Pragma Unimplemented_Unit:: * Pragma Universal_Aliasing:: -* Pragma Universal_Data:: * Pragma Unmodified:: * Pragma Unreferenced:: * Pragma Unreferenced_Objects:: @@ -355,7 +353,6 @@ Implementation Defined Aspects * Aspect Test_Case:: * Aspect Thread_Local_Storage:: * Aspect Universal_Aliasing:: -* Aspect Universal_Data:: * Aspect Unmodified:: * Aspect Unreferenced:: * Aspect Unreferenced_Objects:: @@ -1235,7 +1232,6 @@ consideration, the use of these pragmas should be minimized. * Pragma Export_Function:: * Pragma Export_Object:: * Pragma Export_Procedure:: -* Pragma Export_Value:: * Pragma Export_Valued_Procedure:: * Pragma Extend_System:: * Pragma Extensions_Allowed:: @@ -1363,7 +1359,6 @@ consideration, the use of these pragmas should be minimized. * Pragma Unevaluated_Use_Of_Old:: * Pragma Unimplemented_Unit:: * Pragma Universal_Aliasing:: -* Pragma Universal_Data:: * Pragma Unmodified:: * Pragma Unreferenced:: * Pragma Unreferenced_Objects:: @@ -3429,7 +3424,7 @@ separate Export pragma (and you probably should from the point of view of portability), but it is not required. @code{Size} is syntax checked, but otherwise ignored by GNAT. -@node Pragma Export_Procedure,Pragma Export_Value,Pragma Export_Object,Implementation Defined Pragmas +@node Pragma Export_Procedure,Pragma Export_Valued_Procedure,Pragma Export_Object,Implementation Defined Pragmas @anchor{gnat_rm/implementation_defined_pragmas pragma-export-procedure}@anchor{61} @section Pragma Export_Procedure @@ -3482,29 +3477,8 @@ string or a static string expressions that evaluates to the null string. In this case, no external name is generated. This form still allows the specification of parameter mechanisms. -@node Pragma Export_Value,Pragma Export_Valued_Procedure,Pragma Export_Procedure,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-export-value}@anchor{62} -@section Pragma Export_Value - - -Syntax: - -@example -pragma Export_Value ( - [Value =>] static_integer_EXPRESSION, - [Link_Name =>] static_string_EXPRESSION); -@end example - -This pragma serves to export a static integer value for external use. -The first argument specifies the value to be exported. The Link_Name -argument specifies the symbolic name to be associated with the integer -value. This pragma is useful for defining a named static value in Ada -that can be referenced in assembly language units to be linked with -the application. This pragma is currently supported only for the -AAMP target and is ignored for other targets. - -@node Pragma Export_Valued_Procedure,Pragma Extend_System,Pragma Export_Value,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-export-valued-procedure}@anchor{63} +@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{62} @section Pragma Export_Valued_Procedure @@ -3562,7 +3536,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{64} +@anchor{gnat_rm/implementation_defined_pragmas pragma-extend-system}@anchor{63} @section Pragma Extend_System @@ -3613,7 +3587,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 pragma-extensions-allowed}@anchor{65} +@anchor{gnat_rm/implementation_defined_pragmas pragma-extensions-allowed}@anchor{64} @section Pragma Extensions_Allowed @@ -3632,7 +3606,7 @@ extension mode (the use of Off as a parameter cancels the effect of the @emph{-gnatX} command switch). In extension mode, the latest version of the Ada language is -implemented (currently Ada 202x), and in addition a small number +implemented (currently Ada 2022), and in addition a number of GNAT specific extensions are recognized as follows: @@ -3663,10 +3637,146 @@ now under -gnatX to confirm and potentially refine its usage and syntax. This new aggregate syntax for arrays and containers is provided under -gnatX to experiment and confirm this new language syntax. + +@item +Casing on composite values (aka pattern matching) + +The selector for a case statement may be of a composite type, subject to +some restrictions (described below). Aggregate syntax is used for choices +of such a case statement; however, in cases where a "normal" aggregate would +require a discrete value, a discrete subtype may be used instead; box +notation can also be used to match all values (but currently only +for discrete subcomponents). + +Consider this example: + +@example +type Rec is record + F1, F2 : Integer; +end record; + +procedure Caser_1 (X : Rec) is +begin + case X is + when (F1 => Positive, F2 => Positive) => + Do_This; + when (F1 => Natural, F2 => <>) | (F1 => <>, F2 => Natural) => + Do_That; + when others => + Do_The_Other_Thing; + end case; +end Caser_1; +@end example + +If Caser_1 is called and both components of X are positive, then +Do_This will be called; otherwise, if either component is nonnegative +then Do_That will be called; otherwise, Do_The_Other_Thing will be called. + +If the set of values that match the choice(s) of an earlier alternative +overlaps the corresponding set of a later alternative, then the first +set shall be a proper subset of the second (and the later alternative +will not be executed if the earlier alternative "matches"). All possible +values of the composite type shall be covered. The composite type of the +selector shall be a nonlimited untagged undiscriminated record type, all +of whose subcomponent subtypes are either static discrete subtypes or +record types that meet the same restrictions. Support for arrays is +planned, but not yet implemented. + +In addition, pattern bindings are supported. This is a mechanism +for binding a name to a component of a matching value for use within +an alternative of a case statement. For a component association +that occurs within a case choice, the expression may be followed by +"is <identifier>". In the special case of a "box" component association, +the identifier may instead be provided within the box. Either of these +indicates that the given identifer denotes (a constant view of) the matching +subcomponent of the case selector. + +Consider this example (which uses type Rec from the previous example): + +@example +procedure Caser_2 (X : Rec) is +begin + case X is + when (F1 => Positive is Abc, F2 => Positive) => + Do_This (Abc) + when (F1 => Natural is N1, F2 => <N2>) | + (F1 => <N2>, F2 => Natural is N1) => + Do_That (Param_1 => N1, Param_2 => N2); + when others => + Do_The_Other_Thing; + end case; +end Caser_2; +@end example + +This example is the same as the previous one with respect to +determining whether Do_This, Do_That, or Do_The_Other_Thing will +be called. But for this version, Do_This takes a parameter and Do_That +takes two parameters. If Do_This is called, the actual parameter in the +call will be X.F1. + +If Do_That is called, the situation is more complex because there are two +choices for that alternative. If Do_That is called because the first choice +matched (i.e., because X.F1 is nonnegative and either X.F1 or X.F2 is zero +or negative), then the actual parameters of the call will be (in order) +X.F1 and X.F2. If Do_That is called because the second choice matched (and +the first one did not), then the actual parameters will be reversed. + +Within the choice list for single alternative, each choice must +define the same set of bindings and the component subtypes for +for a given identifer must all statically match. Currently, the case +of a binding for a nondiscrete component is not implemented. + +@item +Fixed lower bounds for array types and subtypes + +Unconstrained array types and subtypes can be specified with a lower bound +that is fixed to a certain value, by writing an index range that uses the +syntax "<lower-bound-expression> .. <>". This guarantees that all objects +of the type or subtype will have the specified lower bound. + +For example, a matrix type with fixed lower bounds of zero for each +dimension can be declared by the following: + +@example +type Matrix is + array (Natural range 0 .. <>, Natural range 0 .. <>) of Integer; +@end example + +Objects of type Matrix declared with an index constraint must have index +ranges starting at zero: + +@example +M1 : Matrix (0 .. 9, 0 .. 19); +M2 : Matrix (2 .. 11, 3 .. 22); -- Warning about bounds; will raise CE +@end example + +Similarly, a subtype of String can be declared that specifies the lower +bound of objects of that subtype to be 1: + +@quotation + +@example +subtype String_1 is String (1 .. <>); +@end example +@end quotation + +If a string slice is passed to a formal of subtype String_1 in a call to +a subprogram S, the slice's bounds will "slide" so that the lower bound +is 1. Within S, the lower bound of the formal is known to be 1, so, unlike +a normal unconstrained String formal, there is no need to worry about +accounting for other possible lower-bound values. Sliding of bounds also +occurs in other contexts, such as for object declarations with an +unconstrained subtype with fixed lower bound, as well as in subtype +conversions. + +Use of this feature increases safety by simplifying code, and can also +improve the efficiency of indexing operations, since the compiler statically +knows the lower bound of unconstrained array formals when the formal's +subtype has index ranges with static fixed lower bounds. @end itemize @node Pragma Extensions_Visible,Pragma External,Pragma Extensions_Allowed,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id12}@anchor{66}@anchor{gnat_rm/implementation_defined_pragmas pragma-extensions-visible}@anchor{67} +@anchor{gnat_rm/implementation_defined_pragmas id12}@anchor{65}@anchor{gnat_rm/implementation_defined_pragmas pragma-extensions-visible}@anchor{66} @section Pragma Extensions_Visible @@ -3680,7 +3790,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{68} +@anchor{gnat_rm/implementation_defined_pragmas pragma-external}@anchor{67} @section Pragma External @@ -3701,7 +3811,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{69} +@anchor{gnat_rm/implementation_defined_pragmas pragma-external-name-casing}@anchor{68} @section Pragma External_Name_Casing @@ -3790,7 +3900,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{6a} +@anchor{gnat_rm/implementation_defined_pragmas pragma-fast-math}@anchor{69} @section Pragma Fast_Math @@ -3819,7 +3929,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 id13}@anchor{6b}@anchor{gnat_rm/implementation_defined_pragmas pragma-favor-top-level}@anchor{6c} +@anchor{gnat_rm/implementation_defined_pragmas id13}@anchor{6a}@anchor{gnat_rm/implementation_defined_pragmas pragma-favor-top-level}@anchor{6b} @section Pragma Favor_Top_Level @@ -3838,7 +3948,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{6d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-finalize-storage-only}@anchor{6c} @section Pragma Finalize_Storage_Only @@ -3858,7 +3968,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{6e} +@anchor{gnat_rm/implementation_defined_pragmas pragma-float-representation}@anchor{6d} @section Pragma Float_Representation @@ -3893,7 +4003,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 pragma-ghost}@anchor{6f}@anchor{gnat_rm/implementation_defined_pragmas id14}@anchor{70} +@anchor{gnat_rm/implementation_defined_pragmas pragma-ghost}@anchor{6e}@anchor{gnat_rm/implementation_defined_pragmas id14}@anchor{6f} @section Pragma Ghost @@ -3907,7 +4017,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 pragma-global}@anchor{71}@anchor{gnat_rm/implementation_defined_pragmas id15}@anchor{72} +@anchor{gnat_rm/implementation_defined_pragmas pragma-global}@anchor{70}@anchor{gnat_rm/implementation_defined_pragmas id15}@anchor{71} @section Pragma Global @@ -3932,7 +4042,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{73} +@anchor{gnat_rm/implementation_defined_pragmas pragma-ident}@anchor{72} @section Pragma Ident @@ -3946,7 +4056,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{74} +@anchor{gnat_rm/implementation_defined_pragmas pragma-ignore-pragma}@anchor{73} @section Pragma Ignore_Pragma @@ -3966,7 +4076,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{75} +@anchor{gnat_rm/implementation_defined_pragmas pragma-implementation-defined}@anchor{74} @section Pragma Implementation_Defined @@ -3993,7 +4103,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{76} +@anchor{gnat_rm/implementation_defined_pragmas pragma-implemented}@anchor{75} @section Pragma Implemented @@ -4039,7 +4149,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{77} +@anchor{gnat_rm/implementation_defined_pragmas pragma-implicit-packing}@anchor{76} @section Pragma Implicit_Packing @@ -4093,7 +4203,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{78} +@anchor{gnat_rm/implementation_defined_pragmas pragma-import-function}@anchor{77} @section Pragma Import_Function @@ -4158,7 +4268,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{79} +@anchor{gnat_rm/implementation_defined_pragmas pragma-import-object}@anchor{78} @section Pragma Import_Object @@ -4184,7 +4294,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{7a} +@anchor{gnat_rm/implementation_defined_pragmas pragma-import-procedure}@anchor{79} @section Pragma Import_Procedure @@ -4224,7 +4334,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{7b} +@anchor{gnat_rm/implementation_defined_pragmas pragma-import-valued-procedure}@anchor{7a} @section Pragma Import_Valued_Procedure @@ -4277,7 +4387,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{7c} +@anchor{gnat_rm/implementation_defined_pragmas pragma-independent}@anchor{7b} @section Pragma Independent @@ -4299,7 +4409,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{7d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-independent-components}@anchor{7c} @section Pragma Independent_Components @@ -4320,7 +4430,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 id16}@anchor{7e}@anchor{gnat_rm/implementation_defined_pragmas pragma-initial-condition}@anchor{7f} +@anchor{gnat_rm/implementation_defined_pragmas id16}@anchor{7d}@anchor{gnat_rm/implementation_defined_pragmas pragma-initial-condition}@anchor{7e} @section Pragma Initial_Condition @@ -4334,7 +4444,7 @@ For the semantics of this pragma, see the entry for aspect @code{Initial_Conditi in the SPARK 2014 Reference Manual, section 7.1.6. @node Pragma Initialize_Scalars,Pragma Initializes,Pragma Initial_Condition,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-initialize-scalars}@anchor{80} +@anchor{gnat_rm/implementation_defined_pragmas pragma-initialize-scalars}@anchor{7f} @section Pragma Initialize_Scalars @@ -4443,7 +4553,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 pragma-initializes}@anchor{81}@anchor{gnat_rm/implementation_defined_pragmas id17}@anchor{82} +@anchor{gnat_rm/implementation_defined_pragmas pragma-initializes}@anchor{80}@anchor{gnat_rm/implementation_defined_pragmas id17}@anchor{81} @section Pragma Initializes @@ -4470,7 +4580,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 id18}@anchor{83}@anchor{gnat_rm/implementation_defined_pragmas pragma-inline-always}@anchor{84} +@anchor{gnat_rm/implementation_defined_pragmas id18}@anchor{82}@anchor{gnat_rm/implementation_defined_pragmas pragma-inline-always}@anchor{83} @section Pragma Inline_Always @@ -4489,7 +4599,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{85} +@anchor{gnat_rm/implementation_defined_pragmas pragma-inline-generic}@anchor{84} @section Pragma Inline_Generic @@ -4507,7 +4617,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{86} +@anchor{gnat_rm/implementation_defined_pragmas pragma-interface}@anchor{85} @section Pragma Interface @@ -4534,7 +4644,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{87} +@anchor{gnat_rm/implementation_defined_pragmas pragma-interface-name}@anchor{86} @section Pragma Interface_Name @@ -4553,7 +4663,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{88} +@anchor{gnat_rm/implementation_defined_pragmas pragma-interrupt-handler}@anchor{87} @section Pragma Interrupt_Handler @@ -4564,16 +4674,10 @@ pragma Interrupt_Handler (procedure_LOCAL_NAME); @end example This program unit pragma is supported for parameterless protected procedures -as described in Annex C of the Ada Reference Manual. On the AAMP target -the pragma can also be specified for nonprotected parameterless procedures -that are declared at the library level (which includes procedures -declared at the top level of a library package). In the case of AAMP, -when this pragma is applied to a nonprotected procedure, the instruction -@code{IERET} is generated for returns from the procedure, enabling -maskable interrupts, in place of the normal return instruction. +as described in Annex C of the Ada Reference Manual. @node Pragma Interrupt_State,Pragma Invariant,Pragma Interrupt_Handler,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-interrupt-state}@anchor{89} +@anchor{gnat_rm/implementation_defined_pragmas pragma-interrupt-state}@anchor{88} @section Pragma Interrupt_State @@ -4659,7 +4763,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 Invariant,Pragma Keep_Names,Pragma Interrupt_State,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id19}@anchor{8a}@anchor{gnat_rm/implementation_defined_pragmas pragma-invariant}@anchor{8b} +@anchor{gnat_rm/implementation_defined_pragmas id19}@anchor{89}@anchor{gnat_rm/implementation_defined_pragmas pragma-invariant}@anchor{8a} @section Pragma Invariant @@ -4698,7 +4802,7 @@ For further details on the use of this pragma, see the Ada 2012 documentation of the Type_Invariant aspect. @node Pragma Keep_Names,Pragma License,Pragma Invariant,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-keep-names}@anchor{8c} +@anchor{gnat_rm/implementation_defined_pragmas pragma-keep-names}@anchor{8b} @section Pragma Keep_Names @@ -4718,7 +4822,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{8d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-license}@anchor{8c} @section Pragma License @@ -4813,7 +4917,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{8e} +@anchor{gnat_rm/implementation_defined_pragmas pragma-link-with}@anchor{8d} @section Pragma Link_With @@ -4837,7 +4941,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{8f} +@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-alias}@anchor{8e} @section Pragma Linker_Alias @@ -4878,7 +4982,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{90} +@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-constructor}@anchor{8f} @section Pragma Linker_Constructor @@ -4908,7 +5012,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{91} +@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-destructor}@anchor{90} @section Pragma Linker_Destructor @@ -4931,7 +5035,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 id20}@anchor{92}@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-section}@anchor{93} +@anchor{gnat_rm/implementation_defined_pragmas id20}@anchor{91}@anchor{gnat_rm/implementation_defined_pragmas pragma-linker-section}@anchor{92} @section Pragma Linker_Section @@ -5005,7 +5109,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 id21}@anchor{94}@anchor{gnat_rm/implementation_defined_pragmas pragma-lock-free}@anchor{95} +@anchor{gnat_rm/implementation_defined_pragmas id21}@anchor{93}@anchor{gnat_rm/implementation_defined_pragmas pragma-lock-free}@anchor{94} @section Pragma Lock_Free @@ -5057,7 +5161,7 @@ Function calls and attribute references must be static @end itemize @node Pragma Loop_Invariant,Pragma Loop_Optimize,Pragma Lock_Free,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-loop-invariant}@anchor{96} +@anchor{gnat_rm/implementation_defined_pragmas pragma-loop-invariant}@anchor{95} @section Pragma Loop_Invariant @@ -5090,7 +5194,7 @@ attribute can only be used within the expression of a @code{Loop_Invariant} pragma. For full details, see documentation of attribute @code{Loop_Entry}. @node Pragma Loop_Optimize,Pragma Loop_Variant,Pragma Loop_Invariant,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-loop-optimize}@anchor{97} +@anchor{gnat_rm/implementation_defined_pragmas pragma-loop-optimize}@anchor{96} @section Pragma Loop_Optimize @@ -5152,7 +5256,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{98} +@anchor{gnat_rm/implementation_defined_pragmas pragma-loop-variant}@anchor{97} @section Pragma Loop_Variant @@ -5199,7 +5303,7 @@ 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. @node Pragma Machine_Attribute,Pragma Main,Pragma Loop_Variant,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-machine-attribute}@anchor{99} +@anchor{gnat_rm/implementation_defined_pragmas pragma-machine-attribute}@anchor{98} @section Pragma Machine_Attribute @@ -5225,7 +5329,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{9a} +@anchor{gnat_rm/implementation_defined_pragmas pragma-main}@anchor{99} @section Pragma Main @@ -5245,7 +5349,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{9b} +@anchor{gnat_rm/implementation_defined_pragmas pragma-main-storage}@anchor{9a} @section Pragma Main_Storage @@ -5264,7 +5368,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 id22}@anchor{9c}@anchor{gnat_rm/implementation_defined_pragmas pragma-max-queue-length}@anchor{9d} +@anchor{gnat_rm/implementation_defined_pragmas id22}@anchor{9b}@anchor{gnat_rm/implementation_defined_pragmas pragma-max-queue-length}@anchor{9c} @section Pragma Max_Queue_Length @@ -5282,7 +5386,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{9e} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-body}@anchor{9d} @section Pragma No_Body @@ -5305,7 +5409,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 pragma-no-caching}@anchor{9f}@anchor{gnat_rm/implementation_defined_pragmas id23}@anchor{a0} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-caching}@anchor{9e}@anchor{gnat_rm/implementation_defined_pragmas id23}@anchor{9f} @section Pragma No_Caching @@ -5319,7 +5423,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{a1} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-component-reordering}@anchor{a0} @section Pragma No_Component_Reordering @@ -5338,7 +5442,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 id24}@anchor{a2}@anchor{gnat_rm/implementation_defined_pragmas pragma-no-elaboration-code-all}@anchor{a3} +@anchor{gnat_rm/implementation_defined_pragmas id24}@anchor{a1}@anchor{gnat_rm/implementation_defined_pragmas pragma-no-elaboration-code-all}@anchor{a2} @section Pragma No_Elaboration_Code_All @@ -5357,7 +5461,7 @@ current unit, it must also have the 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{a4} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-heap-finalization}@anchor{a3} @section Pragma No_Heap_Finalization @@ -5389,7 +5493,7 @@ lose its @code{No_Heap_Finalization} pragma when the corresponding instance does appear at the library level. @node Pragma No_Inline,Pragma No_Return,Pragma No_Heap_Finalization,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id25}@anchor{a5}@anchor{gnat_rm/implementation_defined_pragmas pragma-no-inline}@anchor{a6} +@anchor{gnat_rm/implementation_defined_pragmas id25}@anchor{a4}@anchor{gnat_rm/implementation_defined_pragmas pragma-no-inline}@anchor{a5} @section Pragma No_Inline @@ -5407,7 +5511,7 @@ in particular it is not subject to the use of option @emph{-gnatn} or pragma @code{Inline_Always} for the same @code{NAME}. @node Pragma No_Return,Pragma No_Strict_Aliasing,Pragma No_Inline,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-no-return}@anchor{a7} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-return}@anchor{a6} @section Pragma No_Return @@ -5434,7 +5538,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{a8} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-strict-aliasing}@anchor{a7} @section Pragma No_Strict_Aliasing @@ -5456,7 +5560,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 pragma-no-tagged-streams}@anchor{a9}@anchor{gnat_rm/implementation_defined_pragmas id26}@anchor{aa} +@anchor{gnat_rm/implementation_defined_pragmas pragma-no-tagged-streams}@anchor{a8}@anchor{gnat_rm/implementation_defined_pragmas id26}@anchor{a9} @section Pragma No_Tagged_Streams @@ -5495,7 +5599,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{ab} +@anchor{gnat_rm/implementation_defined_pragmas pragma-normalize-scalars}@anchor{aa} @section Pragma Normalize_Scalars @@ -5577,7 +5681,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 pragma-obsolescent}@anchor{ac}@anchor{gnat_rm/implementation_defined_pragmas id27}@anchor{ad} +@anchor{gnat_rm/implementation_defined_pragmas pragma-obsolescent}@anchor{ab}@anchor{gnat_rm/implementation_defined_pragmas id27}@anchor{ac} @section Pragma Obsolescent @@ -5673,7 +5777,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{ae} +@anchor{gnat_rm/implementation_defined_pragmas pragma-optimize-alignment}@anchor{ad} @section Pragma Optimize_Alignment @@ -5759,7 +5863,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{af} +@anchor{gnat_rm/implementation_defined_pragmas pragma-ordered}@anchor{ae} @section Pragma Ordered @@ -5851,7 +5955,7 @@ For additional information please refer to the description of the @emph{-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{b0} +@anchor{gnat_rm/implementation_defined_pragmas pragma-overflow-mode}@anchor{af} @section Pragma Overflow_Mode @@ -5890,7 +5994,7 @@ The pragma @code{Unsuppress (Overflow_Check)} unsuppresses (enables) overflow checking, but does not affect the overflow mode. @node Pragma Overriding_Renamings,Pragma Partition_Elaboration_Policy,Pragma Overflow_Mode,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-overriding-renamings}@anchor{b1} +@anchor{gnat_rm/implementation_defined_pragmas pragma-overriding-renamings}@anchor{b0} @section Pragma Overriding_Renamings @@ -5925,7 +6029,7 @@ RM 8.3 (15) stipulates that an overridden operation is not visible within the declaration of the overriding operation. @node Pragma Partition_Elaboration_Policy,Pragma Part_Of,Pragma Overriding_Renamings,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-partition-elaboration-policy}@anchor{b2} +@anchor{gnat_rm/implementation_defined_pragmas pragma-partition-elaboration-policy}@anchor{b1} @section Pragma Partition_Elaboration_Policy @@ -5942,7 +6046,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Part_Of,Pragma Passive,Pragma Partition_Elaboration_Policy,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id28}@anchor{b3}@anchor{gnat_rm/implementation_defined_pragmas pragma-part-of}@anchor{b4} +@anchor{gnat_rm/implementation_defined_pragmas id28}@anchor{b2}@anchor{gnat_rm/implementation_defined_pragmas pragma-part-of}@anchor{b3} @section Pragma Part_Of @@ -5958,7 +6062,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 Passive,Pragma Persistent_BSS,Pragma Part_Of,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-passive}@anchor{b5} +@anchor{gnat_rm/implementation_defined_pragmas pragma-passive}@anchor{b4} @section Pragma Passive @@ -5982,7 +6086,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 id29}@anchor{b6}@anchor{gnat_rm/implementation_defined_pragmas pragma-persistent-bss}@anchor{b7} +@anchor{gnat_rm/implementation_defined_pragmas id29}@anchor{b5}@anchor{gnat_rm/implementation_defined_pragmas pragma-persistent-bss}@anchor{b6} @section Pragma Persistent_BSS @@ -6013,7 +6117,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{b8} +@anchor{gnat_rm/implementation_defined_pragmas pragma-post}@anchor{b7} @section Pragma Post @@ -6038,7 +6142,7 @@ appear at the start of the declarations in a subprogram body (preceded only by other pragmas). @node Pragma Postcondition,Pragma Post_Class,Pragma Post,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-postcondition}@anchor{b9} +@anchor{gnat_rm/implementation_defined_pragmas pragma-postcondition}@anchor{b8} @section Pragma Postcondition @@ -6203,7 +6307,7 @@ Ada 2012, and has been retained in its original form for compatibility purposes. @node Pragma Post_Class,Pragma Rename_Pragma,Pragma Postcondition,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-post-class}@anchor{ba} +@anchor{gnat_rm/implementation_defined_pragmas pragma-post-class}@anchor{b9} @section Pragma Post_Class @@ -6238,7 +6342,7 @@ policy that controls this pragma is @code{Post'Class}, not @code{Post_Class}. @node Pragma Rename_Pragma,Pragma Pre,Pragma Post_Class,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-rename-pragma}@anchor{bb} +@anchor{gnat_rm/implementation_defined_pragmas pragma-rename-pragma}@anchor{ba} @section Pragma Rename_Pragma @@ -6277,7 +6381,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 Pre,Pragma Precondition,Pragma Rename_Pragma,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-pre}@anchor{bc} +@anchor{gnat_rm/implementation_defined_pragmas pragma-pre}@anchor{bb} @section Pragma Pre @@ -6302,7 +6406,7 @@ appear at the start of the declarations in a subprogram body (preceded only by other pragmas). @node Pragma Precondition,Pragma Predicate,Pragma Pre,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-precondition}@anchor{bd} +@anchor{gnat_rm/implementation_defined_pragmas pragma-precondition}@anchor{bc} @section Pragma Precondition @@ -6361,7 +6465,7 @@ Ada 2012, and has been retained in its original form for compatibility purposes. @node Pragma Predicate,Pragma Predicate_Failure,Pragma Precondition,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-predicate}@anchor{be}@anchor{gnat_rm/implementation_defined_pragmas id30}@anchor{bf} +@anchor{gnat_rm/implementation_defined_pragmas pragma-predicate}@anchor{bd}@anchor{gnat_rm/implementation_defined_pragmas id30}@anchor{be} @section Pragma Predicate @@ -6415,7 +6519,7 @@ defined for subtype B). When following this approach, the use of predicates should be avoided. @node Pragma Predicate_Failure,Pragma Preelaborable_Initialization,Pragma Predicate,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-predicate-failure}@anchor{c0} +@anchor{gnat_rm/implementation_defined_pragmas pragma-predicate-failure}@anchor{bf} @section Pragma Predicate_Failure @@ -6432,7 +6536,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{c1} +@anchor{gnat_rm/implementation_defined_pragmas pragma-preelaborable-initialization}@anchor{c0} @section Pragma Preelaborable_Initialization @@ -6447,7 +6551,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{c2} +@anchor{gnat_rm/implementation_defined_pragmas pragma-prefix-exception-messages}@anchor{c1} @section Pragma Prefix_Exception_Messages @@ -6478,7 +6582,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{c3} +@anchor{gnat_rm/implementation_defined_pragmas pragma-pre-class}@anchor{c2} @section Pragma Pre_Class @@ -6513,7 +6617,7 @@ policy that controls this pragma is @code{Pre'Class}, not @code{Pre_Class}. @node Pragma Priority_Specific_Dispatching,Pragma Profile,Pragma Pre_Class,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-priority-specific-dispatching}@anchor{c4} +@anchor{gnat_rm/implementation_defined_pragmas pragma-priority-specific-dispatching}@anchor{c3} @section Pragma Priority_Specific_Dispatching @@ -6537,7 +6641,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{c5} +@anchor{gnat_rm/implementation_defined_pragmas pragma-profile}@anchor{c4} @section Pragma Profile @@ -6816,7 +6920,7 @@ conforming Ada constructs. The profile enables the following three pragmas: @end itemize @node Pragma Profile_Warnings,Pragma Propagate_Exceptions,Pragma Profile,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-profile-warnings}@anchor{c6} +@anchor{gnat_rm/implementation_defined_pragmas pragma-profile-warnings}@anchor{c5} @section Pragma Profile_Warnings @@ -6834,7 +6938,7 @@ violations of the profile generate warning messages instead of error messages. @node Pragma Propagate_Exceptions,Pragma Provide_Shift_Operators,Pragma Profile_Warnings,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-propagate-exceptions}@anchor{c7} +@anchor{gnat_rm/implementation_defined_pragmas pragma-propagate-exceptions}@anchor{c6} @section Pragma Propagate_Exceptions @@ -6853,7 +6957,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{c8} +@anchor{gnat_rm/implementation_defined_pragmas pragma-provide-shift-operators}@anchor{c7} @section Pragma Provide_Shift_Operators @@ -6873,7 +6977,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{c9} +@anchor{gnat_rm/implementation_defined_pragmas pragma-psect-object}@anchor{c8} @section Pragma Psect_Object @@ -6893,7 +6997,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 pragma-pure-function}@anchor{ca}@anchor{gnat_rm/implementation_defined_pragmas id31}@anchor{cb} +@anchor{gnat_rm/implementation_defined_pragmas pragma-pure-function}@anchor{c9}@anchor{gnat_rm/implementation_defined_pragmas id31}@anchor{ca} @section Pragma Pure_Function @@ -6955,7 +7059,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{cc} +@anchor{gnat_rm/implementation_defined_pragmas pragma-rational}@anchor{cb} @section Pragma Rational @@ -6973,7 +7077,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{cd} +@anchor{gnat_rm/implementation_defined_pragmas pragma-ravenscar}@anchor{cc} @section Pragma Ravenscar @@ -6993,7 +7097,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 pragma-refined-depends}@anchor{ce}@anchor{gnat_rm/implementation_defined_pragmas id32}@anchor{cf} +@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-depends}@anchor{cd}@anchor{gnat_rm/implementation_defined_pragmas id32}@anchor{ce} @section Pragma Refined_Depends @@ -7026,7 +7130,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 pragma-refined-global}@anchor{d0}@anchor{gnat_rm/implementation_defined_pragmas id33}@anchor{d1} +@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-global}@anchor{cf}@anchor{gnat_rm/implementation_defined_pragmas id33}@anchor{d0} @section Pragma Refined_Global @@ -7051,7 +7155,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 pragma-refined-post}@anchor{d2}@anchor{gnat_rm/implementation_defined_pragmas id34}@anchor{d3} +@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-post}@anchor{d1}@anchor{gnat_rm/implementation_defined_pragmas id34}@anchor{d2} @section Pragma Refined_Post @@ -7065,7 +7169,7 @@ For the semantics of this pragma, see the entry for aspect @code{Refined_Post} i the SPARK 2014 Reference Manual, section 7.2.7. @node Pragma Refined_State,Pragma Relative_Deadline,Pragma Refined_Post,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-state}@anchor{d4}@anchor{gnat_rm/implementation_defined_pragmas id35}@anchor{d5} +@anchor{gnat_rm/implementation_defined_pragmas pragma-refined-state}@anchor{d3}@anchor{gnat_rm/implementation_defined_pragmas id35}@anchor{d4} @section Pragma Refined_State @@ -7091,7 +7195,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{d6} +@anchor{gnat_rm/implementation_defined_pragmas pragma-relative-deadline}@anchor{d5} @section Pragma Relative_Deadline @@ -7106,7 +7210,7 @@ versions of Ada as an implementation-defined pragma. See Ada 2012 Reference Manual for details. @node Pragma Remote_Access_Type,Pragma Restricted_Run_Time,Pragma Relative_Deadline,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id36}@anchor{d7}@anchor{gnat_rm/implementation_defined_pragmas pragma-remote-access-type}@anchor{d8} +@anchor{gnat_rm/implementation_defined_pragmas id36}@anchor{d6}@anchor{gnat_rm/implementation_defined_pragmas pragma-remote-access-type}@anchor{d7} @section Pragma Remote_Access_Type @@ -7132,7 +7236,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 Restricted_Run_Time,Pragma Restriction_Warnings,Pragma Remote_Access_Type,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-restricted-run-time}@anchor{d9} +@anchor{gnat_rm/implementation_defined_pragmas pragma-restricted-run-time}@anchor{d8} @section Pragma Restricted_Run_Time @@ -7153,7 +7257,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{da} +@anchor{gnat_rm/implementation_defined_pragmas pragma-restriction-warnings}@anchor{d9} @section Pragma Restriction_Warnings @@ -7191,7 +7295,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{db} +@anchor{gnat_rm/implementation_defined_pragmas pragma-reviewable}@anchor{da} @section Pragma Reviewable @@ -7295,7 +7399,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 id37}@anchor{dc}@anchor{gnat_rm/implementation_defined_pragmas pragma-secondary-stack-size}@anchor{dd} +@anchor{gnat_rm/implementation_defined_pragmas id37}@anchor{db}@anchor{gnat_rm/implementation_defined_pragmas pragma-secondary-stack-size}@anchor{dc} @section Pragma Secondary_Stack_Size @@ -7331,7 +7435,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{de} +@anchor{gnat_rm/implementation_defined_pragmas pragma-share-generic}@anchor{dd} @section Pragma Share_Generic @@ -7349,7 +7453,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 id38}@anchor{df}@anchor{gnat_rm/implementation_defined_pragmas pragma-shared}@anchor{e0} +@anchor{gnat_rm/implementation_defined_pragmas id38}@anchor{de}@anchor{gnat_rm/implementation_defined_pragmas pragma-shared}@anchor{df} @section Pragma Shared @@ -7357,7 +7461,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{e1} +@anchor{gnat_rm/implementation_defined_pragmas pragma-short-circuit-and-or}@anchor{e0} @section Pragma Short_Circuit_And_Or @@ -7376,7 +7480,7 @@ within the file being compiled, it applies only to the file being compiled. There is no requirement that all units in a partition use this option. @node Pragma Short_Descriptors,Pragma Simple_Storage_Pool_Type,Pragma Short_Circuit_And_Or,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-short-descriptors}@anchor{e2} +@anchor{gnat_rm/implementation_defined_pragmas pragma-short-descriptors}@anchor{e1} @section Pragma Short_Descriptors @@ -7390,7 +7494,7 @@ This pragma is provided for compatibility with other Ada implementations. It is recognized but ignored by all current versions of GNAT. @node Pragma Simple_Storage_Pool_Type,Pragma Source_File_Name,Pragma Short_Descriptors,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-simple-storage-pool-type}@anchor{e3}@anchor{gnat_rm/implementation_defined_pragmas id39}@anchor{e4} +@anchor{gnat_rm/implementation_defined_pragmas pragma-simple-storage-pool-type}@anchor{e2}@anchor{gnat_rm/implementation_defined_pragmas id39}@anchor{e3} @section Pragma Simple_Storage_Pool_Type @@ -7444,7 +7548,7 @@ storage-management discipline). An object of a simple storage pool type can be associated with an access type by specifying the attribute -@ref{e5,,Simple_Storage_Pool}. For example: +@ref{e4,,Simple_Storage_Pool}. For example: @example My_Pool : My_Simple_Storage_Pool_Type; @@ -7454,11 +7558,11 @@ type Acc is access My_Data_Type; for Acc'Simple_Storage_Pool use My_Pool; @end example -See attribute @ref{e5,,Simple_Storage_Pool} +See attribute @ref{e4,,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 pragma-source-file-name}@anchor{e6}@anchor{gnat_rm/implementation_defined_pragmas id40}@anchor{e7} +@anchor{gnat_rm/implementation_defined_pragmas pragma-source-file-name}@anchor{e5}@anchor{gnat_rm/implementation_defined_pragmas id40}@anchor{e6} @section Pragma Source_File_Name @@ -7550,20 +7654,20 @@ aware of these pragmas, and so other tools that use the projet 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{e8,,Pragma Source_File_Name_Project}. +Source_File_Name cannot appear after a @ref{e7,,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 pragma-source-file-name-project}@anchor{e8}@anchor{gnat_rm/implementation_defined_pragmas id41}@anchor{e9} +@anchor{gnat_rm/implementation_defined_pragmas pragma-source-file-name-project}@anchor{e7}@anchor{gnat_rm/implementation_defined_pragmas id41}@anchor{e8} @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{e6,,Pragma Source_File_Name}, and +It cannot appear after a @ref{e5,,Pragma Source_File_Name}, and most importantly, once pragma Source_File_Name_Project appears, no further Source_File_Name pragmas are allowed. @@ -7575,7 +7679,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{ea} +@anchor{gnat_rm/implementation_defined_pragmas pragma-source-reference}@anchor{e9} @section Pragma Source_Reference @@ -7599,7 +7703,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 pragma-spark-mode}@anchor{eb}@anchor{gnat_rm/implementation_defined_pragmas id42}@anchor{ec} +@anchor{gnat_rm/implementation_defined_pragmas pragma-spark-mode}@anchor{ea}@anchor{gnat_rm/implementation_defined_pragmas id42}@anchor{eb} @section Pragma SPARK_Mode @@ -7681,7 +7785,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{ed} +@anchor{gnat_rm/implementation_defined_pragmas pragma-static-elaboration-desired}@anchor{ec} @section Pragma Static_Elaboration_Desired @@ -7705,7 +7809,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{ee} +@anchor{gnat_rm/implementation_defined_pragmas pragma-stream-convert}@anchor{ed} @section Pragma Stream_Convert @@ -7782,7 +7886,7 @@ the pragma is silently ignored, and the default implementation of the stream attributes is used instead. @node Pragma Style_Checks,Pragma Subtitle,Pragma Stream_Convert,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-style-checks}@anchor{ef} +@anchor{gnat_rm/implementation_defined_pragmas pragma-style-checks}@anchor{ee} @section Pragma Style_Checks @@ -7855,7 +7959,7 @@ Rf2 : Integer := ARG; -- OK, no error @end example @node Pragma Subtitle,Pragma Suppress,Pragma Style_Checks,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-subtitle}@anchor{f0} +@anchor{gnat_rm/implementation_defined_pragmas pragma-subtitle}@anchor{ef} @section Pragma Subtitle @@ -7869,7 +7973,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{f1} +@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress}@anchor{f0} @section Pragma Suppress @@ -7942,7 +8046,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{f2} +@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-all}@anchor{f1} @section Pragma Suppress_All @@ -7961,7 +8065,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 pragma-suppress-debug-info}@anchor{f3}@anchor{gnat_rm/implementation_defined_pragmas id43}@anchor{f4} +@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-debug-info}@anchor{f2}@anchor{gnat_rm/implementation_defined_pragmas id43}@anchor{f3} @section Pragma Suppress_Debug_Info @@ -7976,7 +8080,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{f5} +@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-exception-locations}@anchor{f4} @section Pragma Suppress_Exception_Locations @@ -7999,7 +8103,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 id44}@anchor{f6}@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-initialization}@anchor{f7} +@anchor{gnat_rm/implementation_defined_pragmas id44}@anchor{f5}@anchor{gnat_rm/implementation_defined_pragmas pragma-suppress-initialization}@anchor{f6} @section Pragma Suppress_Initialization @@ -8044,7 +8148,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{f8} +@anchor{gnat_rm/implementation_defined_pragmas pragma-task-name}@anchor{f7} @section Pragma Task_Name @@ -8100,7 +8204,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{f9} +@anchor{gnat_rm/implementation_defined_pragmas pragma-task-storage}@anchor{f8} @section Pragma Task_Storage @@ -8120,7 +8224,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 pragma-test-case}@anchor{fa}@anchor{gnat_rm/implementation_defined_pragmas id45}@anchor{fb} +@anchor{gnat_rm/implementation_defined_pragmas pragma-test-case}@anchor{f9}@anchor{gnat_rm/implementation_defined_pragmas id45}@anchor{fa} @section Pragma Test_Case @@ -8176,7 +8280,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 pragma-thread-local-storage}@anchor{fc}@anchor{gnat_rm/implementation_defined_pragmas id46}@anchor{fd} +@anchor{gnat_rm/implementation_defined_pragmas pragma-thread-local-storage}@anchor{fb}@anchor{gnat_rm/implementation_defined_pragmas id46}@anchor{fc} @section Pragma Thread_Local_Storage @@ -8214,7 +8318,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{fe} +@anchor{gnat_rm/implementation_defined_pragmas pragma-time-slice}@anchor{fd} @section Pragma Time_Slice @@ -8230,7 +8334,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{ff} +@anchor{gnat_rm/implementation_defined_pragmas pragma-title}@anchor{fe} @section Pragma Title @@ -8255,7 +8359,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{100} +@anchor{gnat_rm/implementation_defined_pragmas pragma-type-invariant}@anchor{ff} @section Pragma Type_Invariant @@ -8276,7 +8380,7 @@ controlled by the assertion identifier @code{Type_Invariant} rather than @code{Invariant}. @node Pragma Type_Invariant_Class,Pragma Unchecked_Union,Pragma Type_Invariant,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id47}@anchor{101}@anchor{gnat_rm/implementation_defined_pragmas pragma-type-invariant-class}@anchor{102} +@anchor{gnat_rm/implementation_defined_pragmas id47}@anchor{100}@anchor{gnat_rm/implementation_defined_pragmas pragma-type-invariant-class}@anchor{101} @section Pragma Type_Invariant_Class @@ -8303,7 +8407,7 @@ policy that controls this pragma is @code{Type_Invariant'Class}, not @code{Type_Invariant_Class}. @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{103} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unchecked-union}@anchor{102} @section Pragma Unchecked_Union @@ -8323,7 +8427,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 Unimplemented_Unit,Pragma Unchecked_Union,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unevaluated-use-of-old}@anchor{104} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unevaluated-use-of-old}@anchor{103} @section Pragma Unevaluated_Use_Of_Old @@ -8378,7 +8482,7 @@ uses up to the end of the corresponding statement sequence or sequence of package declarations. @node Pragma Unimplemented_Unit,Pragma Universal_Aliasing,Pragma Unevaluated_Use_Of_Old,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unimplemented-unit}@anchor{105} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unimplemented-unit}@anchor{104} @section Pragma Unimplemented_Unit @@ -8397,8 +8501,8 @@ a clean manner. 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 Universal_Data,Pragma Unimplemented_Unit,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-universal-aliasing}@anchor{106}@anchor{gnat_rm/implementation_defined_pragmas id48}@anchor{107} +@node Pragma Universal_Aliasing,Pragma Unmodified,Pragma Unimplemented_Unit,Implementation Defined Pragmas +@anchor{gnat_rm/implementation_defined_pragmas pragma-universal-aliasing}@anchor{105}@anchor{gnat_rm/implementation_defined_pragmas id48}@anchor{106} @section Pragma Universal_Aliasing @@ -8416,32 +8520,8 @@ For a detailed description of the strict aliasing optimization, and the situations in which it must be suppressed, see the section on @code{Optimization and Strict Aliasing} in the @cite{GNAT User's Guide}. -@node Pragma Universal_Data,Pragma Unmodified,Pragma Universal_Aliasing,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-universal-data}@anchor{108}@anchor{gnat_rm/implementation_defined_pragmas id49}@anchor{109} -@section Pragma Universal_Data - - -Syntax: - -@example -pragma Universal_Data [(library_unit_Name)]; -@end example - -This pragma is supported only for the AAMP target and is ignored for -other targets. The pragma specifies that all library-level objects -(Counter 0 data) associated with the library unit are to be accessed -and updated using universal addressing (24-bit addresses for AAMP5) -rather than the default of 16-bit Data Environment (DENV) addressing. -Use of this pragma will generally result in less efficient code for -references to global data associated with the library unit, but -allows such data to be located anywhere in memory. This pragma is -a library unit pragma, but can also be used as a configuration pragma -(including use in the @code{gnat.adc} file). The functionality -of this pragma is also available by applying the -univ switch on the -compilations of units where universal addressing of the data is desired. - -@node Pragma Unmodified,Pragma Unreferenced,Pragma Universal_Data,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas id50}@anchor{10a}@anchor{gnat_rm/implementation_defined_pragmas pragma-unmodified}@anchor{10b} +@node Pragma Unmodified,Pragma Unreferenced,Pragma Universal_Aliasing,Implementation Defined Pragmas +@anchor{gnat_rm/implementation_defined_pragmas pragma-unmodified}@anchor{107}@anchor{gnat_rm/implementation_defined_pragmas id49}@anchor{108} @section Pragma Unmodified @@ -8475,7 +8555,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 pragma-unreferenced}@anchor{10c}@anchor{gnat_rm/implementation_defined_pragmas id51}@anchor{10d} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unreferenced}@anchor{109}@anchor{gnat_rm/implementation_defined_pragmas id50}@anchor{10a} @section Pragma Unreferenced @@ -8519,7 +8599,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{ac,,Pragma Obsolescent}. +for this purpose, see @ref{ab,,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 @@ -8535,7 +8615,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 pragma-unreferenced-objects}@anchor{10e}@anchor{gnat_rm/implementation_defined_pragmas id52}@anchor{10f} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unreferenced-objects}@anchor{10b}@anchor{gnat_rm/implementation_defined_pragmas id51}@anchor{10c} @section Pragma Unreferenced_Objects @@ -8560,7 +8640,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{110} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unreserve-all-interrupts}@anchor{10d} @section Pragma Unreserve_All_Interrupts @@ -8596,7 +8676,7 @@ handled, see pragma @code{Interrupt_State}, which subsumes the functionality of the @code{Unreserve_All_Interrupts} pragma. @node Pragma Unsuppress,Pragma Use_VADS_Size,Pragma Unreserve_All_Interrupts,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unsuppress}@anchor{111} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unsuppress}@anchor{10e} @section Pragma Unsuppress @@ -8632,7 +8712,7 @@ number of implementation-defined check names. See the description of pragma @code{Suppress} for full details. @node Pragma Use_VADS_Size,Pragma Unused,Pragma Unsuppress,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-use-vads-size}@anchor{112} +@anchor{gnat_rm/implementation_defined_pragmas pragma-use-vads-size}@anchor{10f} @section Pragma Use_VADS_Size @@ -8656,7 +8736,7 @@ as implemented in the VADS compiler. See description of the VADS_Size attribute for further details. @node Pragma Unused,Pragma Validity_Checks,Pragma Use_VADS_Size,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-unused}@anchor{113}@anchor{gnat_rm/implementation_defined_pragmas id53}@anchor{114} +@anchor{gnat_rm/implementation_defined_pragmas pragma-unused}@anchor{110}@anchor{gnat_rm/implementation_defined_pragmas id52}@anchor{111} @section Pragma Unused @@ -8690,7 +8770,7 @@ Thus it is never necessary to use @code{pragma Unmodified} for such variables, though it is harmless to do so. @node Pragma Validity_Checks,Pragma Volatile,Pragma Unused,Implementation Defined Pragmas -@anchor{gnat_rm/implementation_defined_pragmas pragma-validity-checks}@anchor{115} +@anchor{gnat_rm/implementation_defined_pragmas pragma-validity-checks}@anchor{112} @section Pragma Validity_Checks @@ -8746,7 +8826,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 id54}@anchor{116}@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile}@anchor{117} +@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile}@anchor{113}@anchor{gnat_rm/implementation_defined_pragmas id53}@anchor{114} @section Pragma Volatile @@ -8764,7 +8844,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 id55}@anchor{118}@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile-full-access}@anchor{119} +@anchor{gnat_rm/implementation_defined_pragmas id54}@anchor{115}@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile-full-access}@anchor{116} @section Pragma Volatile_Full_Access @@ -8790,7 +8870,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 id56}@anchor{11a}@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile-function}@anchor{11b} +@anchor{gnat_rm/implementation_defined_pragmas id55}@anchor{117}@anchor{gnat_rm/implementation_defined_pragmas pragma-volatile-function}@anchor{118} @section Pragma Volatile_Function @@ -8804,7 +8884,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{11c} +@anchor{gnat_rm/implementation_defined_pragmas pragma-warning-as-error}@anchor{119} @section Pragma Warning_As_Error @@ -8844,7 +8924,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{11d,,Pragma Warnings}. +warnings provided by the back end and mentioned in @ref{11a,,Pragma Warnings}. By using a single full @emph{-Wxxx} switch in the pragma, such warnings can also be treated as errors. @@ -8894,7 +8974,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 id57}@anchor{11e}@anchor{gnat_rm/implementation_defined_pragmas pragma-warnings}@anchor{11d} +@anchor{gnat_rm/implementation_defined_pragmas id56}@anchor{11b}@anchor{gnat_rm/implementation_defined_pragmas pragma-warnings}@anchor{11a} @section Pragma Warnings @@ -9050,7 +9130,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{11f} +@anchor{gnat_rm/implementation_defined_pragmas pragma-weak-external}@anchor{11c} @section Pragma Weak_External @@ -9101,7 +9181,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{120} +@anchor{gnat_rm/implementation_defined_pragmas pragma-wide-character-encoding}@anchor{11d} @section Pragma Wide_Character_Encoding @@ -9132,7 +9212,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 implementation-defined-aspects}@anchor{121}@anchor{gnat_rm/implementation_defined_aspects doc}@anchor{122}@anchor{gnat_rm/implementation_defined_aspects id1}@anchor{123} +@anchor{gnat_rm/implementation_defined_aspects implementation-defined-aspects}@anchor{11e}@anchor{gnat_rm/implementation_defined_aspects doc}@anchor{11f}@anchor{gnat_rm/implementation_defined_aspects id1}@anchor{120} @chapter Implementation Defined Aspects @@ -9241,7 +9321,6 @@ or attribute definition clause. * Aspect Test_Case:: * Aspect Thread_Local_Storage:: * Aspect Universal_Aliasing:: -* Aspect Universal_Data:: * Aspect Unmodified:: * Aspect Unreferenced:: * Aspect Unreferenced_Objects:: @@ -9253,7 +9332,7 @@ or attribute definition clause. @end menu @node Aspect Abstract_State,Aspect Annotate,,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-abstract-state}@anchor{124} +@anchor{gnat_rm/implementation_defined_aspects aspect-abstract-state}@anchor{121} @section Aspect Abstract_State @@ -9262,7 +9341,7 @@ or attribute definition clause. This aspect is equivalent to @ref{1c,,pragma Abstract_State}. @node Aspect Annotate,Aspect Async_Readers,Aspect Abstract_State,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-annotate}@anchor{125} +@anchor{gnat_rm/implementation_defined_aspects aspect-annotate}@anchor{122} @section Aspect Annotate @@ -9289,7 +9368,7 @@ 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{126} +@anchor{gnat_rm/implementation_defined_aspects aspect-async-readers}@anchor{123} @section Aspect Async_Readers @@ -9298,7 +9377,7 @@ Equivalent to @code{pragma Annotate (ID, ID @{, ARG@}, Entity => Name);} This boolean aspect is equivalent to @ref{2d,,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{127} +@anchor{gnat_rm/implementation_defined_aspects aspect-async-writers}@anchor{124} @section Aspect Async_Writers @@ -9307,7 +9386,7 @@ This boolean aspect is equivalent to @ref{2d,,pragma Async_Readers}. This boolean aspect is equivalent to @ref{30,,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{128} +@anchor{gnat_rm/implementation_defined_aspects aspect-constant-after-elaboration}@anchor{125} @section Aspect Constant_After_Elaboration @@ -9316,7 +9395,7 @@ This boolean aspect is equivalent to @ref{30,,pragma Async_Writers}. This aspect is equivalent to @ref{42,,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{129} +@anchor{gnat_rm/implementation_defined_aspects aspect-contract-cases}@anchor{126} @section Aspect Contract_Cases @@ -9327,7 +9406,7 @@ 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{12a} +@anchor{gnat_rm/implementation_defined_aspects aspect-depends}@anchor{127} @section Aspect Depends @@ -9336,7 +9415,7 @@ aggregate. This aspect is equivalent to @ref{53,,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{12b} +@anchor{gnat_rm/implementation_defined_aspects aspect-default-initial-condition}@anchor{128} @section Aspect Default_Initial_Condition @@ -9345,7 +9424,7 @@ This aspect is equivalent to @ref{53,,pragma Depends}. This aspect is equivalent to @ref{4e,,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{12c} +@anchor{gnat_rm/implementation_defined_aspects aspect-dimension}@anchor{129} @section Aspect Dimension @@ -9381,7 +9460,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{12d} +@anchor{gnat_rm/implementation_defined_aspects aspect-dimension-system}@anchor{12a} @section Aspect Dimension_System @@ -9441,7 +9520,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{12e} +@anchor{gnat_rm/implementation_defined_aspects aspect-disable-controlled}@anchor{12b} @section Aspect Disable_Controlled @@ -9454,7 +9533,7 @@ 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{12f} +@anchor{gnat_rm/implementation_defined_aspects aspect-effective-reads}@anchor{12c} @section Aspect Effective_Reads @@ -9463,7 +9542,7 @@ whether some run-time check is enabled or suppressed. This aspect is equivalent to @ref{59,,pragma Effective_Reads}. @node Aspect Effective_Writes,Aspect Extensions_Visible,Aspect Effective_Reads,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-effective-writes}@anchor{130} +@anchor{gnat_rm/implementation_defined_aspects aspect-effective-writes}@anchor{12d} @section Aspect Effective_Writes @@ -9472,92 +9551,92 @@ This aspect is equivalent to @ref{59,,pragma Effective_Reads}. This aspect is equivalent to @ref{5b,,pragma Effective_Writes}. @node Aspect Extensions_Visible,Aspect Favor_Top_Level,Aspect Effective_Writes,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-extensions-visible}@anchor{131} +@anchor{gnat_rm/implementation_defined_aspects aspect-extensions-visible}@anchor{12e} @section Aspect Extensions_Visible @geindex Extensions_Visible -This aspect is equivalent to @ref{67,,pragma Extensions_Visible}. +This aspect is equivalent to @ref{66,,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{132} +@anchor{gnat_rm/implementation_defined_aspects aspect-favor-top-level}@anchor{12f} @section Aspect Favor_Top_Level @geindex Favor_Top_Level -This boolean aspect is equivalent to @ref{6c,,pragma Favor_Top_Level}. +This boolean aspect is equivalent to @ref{6b,,pragma Favor_Top_Level}. @node Aspect Ghost,Aspect Global,Aspect Favor_Top_Level,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-ghost}@anchor{133} +@anchor{gnat_rm/implementation_defined_aspects aspect-ghost}@anchor{130} @section Aspect Ghost @geindex Ghost -This aspect is equivalent to @ref{6f,,pragma Ghost}. +This aspect is equivalent to @ref{6e,,pragma Ghost}. @node Aspect Global,Aspect Initial_Condition,Aspect Ghost,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-global}@anchor{134} +@anchor{gnat_rm/implementation_defined_aspects aspect-global}@anchor{131} @section Aspect Global @geindex Global -This aspect is equivalent to @ref{71,,pragma Global}. +This aspect is equivalent to @ref{70,,pragma Global}. @node Aspect Initial_Condition,Aspect Initializes,Aspect Global,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-initial-condition}@anchor{135} +@anchor{gnat_rm/implementation_defined_aspects aspect-initial-condition}@anchor{132} @section Aspect Initial_Condition @geindex Initial_Condition -This aspect is equivalent to @ref{7f,,pragma Initial_Condition}. +This aspect is equivalent to @ref{7e,,pragma Initial_Condition}. @node Aspect Initializes,Aspect Inline_Always,Aspect Initial_Condition,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-initializes}@anchor{136} +@anchor{gnat_rm/implementation_defined_aspects aspect-initializes}@anchor{133} @section Aspect Initializes @geindex Initializes -This aspect is equivalent to @ref{81,,pragma Initializes}. +This aspect is equivalent to @ref{80,,pragma Initializes}. @node Aspect Inline_Always,Aspect Invariant,Aspect Initializes,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-inline-always}@anchor{137} +@anchor{gnat_rm/implementation_defined_aspects aspect-inline-always}@anchor{134} @section Aspect Inline_Always @geindex Inline_Always -This boolean aspect is equivalent to @ref{84,,pragma Inline_Always}. +This boolean aspect is equivalent to @ref{83,,pragma Inline_Always}. @node Aspect Invariant,Aspect Invariant'Class,Aspect Inline_Always,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-invariant}@anchor{138} +@anchor{gnat_rm/implementation_defined_aspects aspect-invariant}@anchor{135} @section Aspect Invariant @geindex Invariant -This aspect is equivalent to @ref{8b,,pragma Invariant}. It is a +This aspect is equivalent to @ref{8a,,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{139} +@anchor{gnat_rm/implementation_defined_aspects aspect-invariant-class}@anchor{136} @section Aspect Invariant'Class @geindex Invariant'Class -This aspect is equivalent to @ref{102,,pragma Type_Invariant_Class}. It is a +This aspect is equivalent to @ref{101,,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{13a} +@anchor{gnat_rm/implementation_defined_aspects aspect-iterable}@anchor{137} @section Aspect Iterable @@ -9637,73 +9716,73 @@ 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 Lock_Free,Aspect Iterable,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-linker-section}@anchor{13b} +@anchor{gnat_rm/implementation_defined_aspects aspect-linker-section}@anchor{138} @section Aspect Linker_Section @geindex Linker_Section -This aspect is equivalent to @ref{93,,pragma Linker_Section}. +This aspect is equivalent to @ref{92,,pragma Linker_Section}. @node Aspect Lock_Free,Aspect Max_Queue_Length,Aspect Linker_Section,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-lock-free}@anchor{13c} +@anchor{gnat_rm/implementation_defined_aspects aspect-lock-free}@anchor{139} @section Aspect Lock_Free @geindex Lock_Free -This boolean aspect is equivalent to @ref{95,,pragma Lock_Free}. +This boolean aspect is equivalent to @ref{94,,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{13d} +@anchor{gnat_rm/implementation_defined_aspects aspect-max-queue-length}@anchor{13a} @section Aspect Max_Queue_Length @geindex Max_Queue_Length -This aspect is equivalent to @ref{9d,,pragma Max_Queue_Length}. +This aspect is equivalent to @ref{9c,,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{13e} +@anchor{gnat_rm/implementation_defined_aspects aspect-no-caching}@anchor{13b} @section Aspect No_Caching @geindex No_Caching -This boolean aspect is equivalent to @ref{9f,,pragma No_Caching}. +This boolean aspect is equivalent to @ref{9e,,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{13f} +@anchor{gnat_rm/implementation_defined_aspects aspect-no-elaboration-code-all}@anchor{13c} @section Aspect No_Elaboration_Code_All @geindex No_Elaboration_Code_All -This aspect is equivalent to @ref{a3,,pragma No_Elaboration_Code_All} +This aspect is equivalent to @ref{a2,,pragma No_Elaboration_Code_All} for a program unit. @node Aspect No_Inline,Aspect No_Tagged_Streams,Aspect No_Elaboration_Code_All,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-no-inline}@anchor{140} +@anchor{gnat_rm/implementation_defined_aspects aspect-no-inline}@anchor{13d} @section Aspect No_Inline @geindex No_Inline -This boolean aspect is equivalent to @ref{a6,,pragma No_Inline}. +This boolean aspect is equivalent to @ref{a5,,pragma No_Inline}. @node Aspect No_Tagged_Streams,Aspect No_Task_Parts,Aspect No_Inline,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-no-tagged-streams}@anchor{141} +@anchor{gnat_rm/implementation_defined_aspects aspect-no-tagged-streams}@anchor{13e} @section Aspect No_Tagged_Streams @geindex No_Tagged_Streams -This aspect is equivalent to @ref{a9,,pragma No_Tagged_Streams} with an +This aspect is equivalent to @ref{a8,,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{142} +@anchor{gnat_rm/implementation_defined_aspects aspect-no-task-parts}@anchor{13f} @section Aspect No_Task_Parts @@ -9719,51 +9798,51 @@ 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{143} +@anchor{gnat_rm/implementation_defined_aspects aspect-object-size}@anchor{140} @section Aspect Object_Size @geindex Object_Size -This aspect is equivalent to @ref{144,,attribute Object_Size}. +This aspect is equivalent to @ref{141,,attribute Object_Size}. @node Aspect Obsolescent,Aspect Part_Of,Aspect Object_Size,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-obsolescent}@anchor{145} +@anchor{gnat_rm/implementation_defined_aspects aspect-obsolescent}@anchor{142} @section Aspect Obsolescent @geindex Obsolsecent -This aspect is equivalent to @ref{ac,,pragma Obsolescent}. Note that the +This aspect is equivalent to @ref{ab,,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{146} +@anchor{gnat_rm/implementation_defined_aspects aspect-part-of}@anchor{143} @section Aspect Part_Of @geindex Part_Of -This aspect is equivalent to @ref{b4,,pragma Part_Of}. +This aspect is equivalent to @ref{b3,,pragma Part_Of}. @node Aspect Persistent_BSS,Aspect Predicate,Aspect Part_Of,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-persistent-bss}@anchor{147} +@anchor{gnat_rm/implementation_defined_aspects aspect-persistent-bss}@anchor{144} @section Aspect Persistent_BSS @geindex Persistent_BSS -This boolean aspect is equivalent to @ref{b7,,pragma Persistent_BSS}. +This boolean aspect is equivalent to @ref{b6,,pragma Persistent_BSS}. @node Aspect Predicate,Aspect Pure_Function,Aspect Persistent_BSS,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-predicate}@anchor{148} +@anchor{gnat_rm/implementation_defined_aspects aspect-predicate}@anchor{145} @section Aspect Predicate @geindex Predicate -This aspect is equivalent to @ref{be,,pragma Predicate}. It is thus +This aspect is equivalent to @ref{bd,,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 @@ -9771,52 +9850,52 @@ expression. It is also separately controllable using pragma @code{Assertion_Policy}. @node Aspect Pure_Function,Aspect Refined_Depends,Aspect Predicate,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-pure-function}@anchor{149} +@anchor{gnat_rm/implementation_defined_aspects aspect-pure-function}@anchor{146} @section Aspect Pure_Function @geindex Pure_Function -This boolean aspect is equivalent to @ref{ca,,pragma Pure_Function}. +This boolean aspect is equivalent to @ref{c9,,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{14a} +@anchor{gnat_rm/implementation_defined_aspects aspect-refined-depends}@anchor{147} @section Aspect Refined_Depends @geindex Refined_Depends -This aspect is equivalent to @ref{ce,,pragma Refined_Depends}. +This aspect is equivalent to @ref{cd,,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{14b} +@anchor{gnat_rm/implementation_defined_aspects aspect-refined-global}@anchor{148} @section Aspect Refined_Global @geindex Refined_Global -This aspect is equivalent to @ref{d0,,pragma Refined_Global}. +This aspect is equivalent to @ref{cf,,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{14c} +@anchor{gnat_rm/implementation_defined_aspects aspect-refined-post}@anchor{149} @section Aspect Refined_Post @geindex Refined_Post -This aspect is equivalent to @ref{d2,,pragma Refined_Post}. +This aspect is equivalent to @ref{d1,,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{14d} +@anchor{gnat_rm/implementation_defined_aspects aspect-refined-state}@anchor{14a} @section Aspect Refined_State @geindex Refined_State -This aspect is equivalent to @ref{d4,,pragma Refined_State}. +This aspect is equivalent to @ref{d3,,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{14e} +@anchor{gnat_rm/implementation_defined_aspects aspect-relaxed-initialization}@anchor{14b} @section Aspect Relaxed_Initialization @@ -9826,196 +9905,187 @@ For the syntax and semantics of this aspect, see the SPARK 2014 Reference Manual, section 6.10. @node Aspect Remote_Access_Type,Aspect Secondary_Stack_Size,Aspect Relaxed_Initialization,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-remote-access-type}@anchor{14f} +@anchor{gnat_rm/implementation_defined_aspects aspect-remote-access-type}@anchor{14c} @section Aspect Remote_Access_Type @geindex Remote_Access_Type -This aspect is equivalent to @ref{d8,,pragma Remote_Access_Type}. +This aspect is equivalent to @ref{d7,,pragma Remote_Access_Type}. @node Aspect Secondary_Stack_Size,Aspect Scalar_Storage_Order,Aspect Remote_Access_Type,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-secondary-stack-size}@anchor{150} +@anchor{gnat_rm/implementation_defined_aspects aspect-secondary-stack-size}@anchor{14d} @section Aspect Secondary_Stack_Size @geindex Secondary_Stack_Size -This aspect is equivalent to @ref{dd,,pragma Secondary_Stack_Size}. +This aspect is equivalent to @ref{dc,,pragma Secondary_Stack_Size}. @node Aspect Scalar_Storage_Order,Aspect Shared,Aspect Secondary_Stack_Size,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-scalar-storage-order}@anchor{151} +@anchor{gnat_rm/implementation_defined_aspects aspect-scalar-storage-order}@anchor{14e} @section Aspect Scalar_Storage_Order @geindex Scalar_Storage_Order -This aspect is equivalent to a @ref{152,,attribute Scalar_Storage_Order}. +This aspect is equivalent to a @ref{14f,,attribute Scalar_Storage_Order}. @node Aspect Shared,Aspect Simple_Storage_Pool,Aspect Scalar_Storage_Order,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-shared}@anchor{153} +@anchor{gnat_rm/implementation_defined_aspects aspect-shared}@anchor{150} @section Aspect Shared @geindex Shared -This boolean aspect is equivalent to @ref{e0,,pragma Shared} +This boolean aspect is equivalent to @ref{df,,pragma Shared} and is thus a synonym for aspect @code{Atomic}. @node Aspect Simple_Storage_Pool,Aspect Simple_Storage_Pool_Type,Aspect Shared,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-simple-storage-pool}@anchor{154} +@anchor{gnat_rm/implementation_defined_aspects aspect-simple-storage-pool}@anchor{151} @section Aspect Simple_Storage_Pool @geindex Simple_Storage_Pool -This aspect is equivalent to @ref{e5,,attribute Simple_Storage_Pool}. +This aspect is equivalent to @ref{e4,,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{155} +@anchor{gnat_rm/implementation_defined_aspects aspect-simple-storage-pool-type}@anchor{152} @section Aspect Simple_Storage_Pool_Type @geindex Simple_Storage_Pool_Type -This boolean aspect is equivalent to @ref{e3,,pragma Simple_Storage_Pool_Type}. +This boolean aspect is equivalent to @ref{e2,,pragma Simple_Storage_Pool_Type}. @node Aspect SPARK_Mode,Aspect Suppress_Debug_Info,Aspect Simple_Storage_Pool_Type,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-spark-mode}@anchor{156} +@anchor{gnat_rm/implementation_defined_aspects aspect-spark-mode}@anchor{153} @section Aspect SPARK_Mode @geindex SPARK_Mode -This aspect is equivalent to @ref{eb,,pragma SPARK_Mode} and +This aspect is equivalent to @ref{ea,,pragma SPARK_Mode} and may be specified for either or both of the specification and body of a subprogram or package. @node Aspect Suppress_Debug_Info,Aspect Suppress_Initialization,Aspect SPARK_Mode,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-suppress-debug-info}@anchor{157} +@anchor{gnat_rm/implementation_defined_aspects aspect-suppress-debug-info}@anchor{154} @section Aspect Suppress_Debug_Info @geindex Suppress_Debug_Info -This boolean aspect is equivalent to @ref{f3,,pragma Suppress_Debug_Info}. +This boolean aspect is equivalent to @ref{f2,,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{158} +@anchor{gnat_rm/implementation_defined_aspects aspect-suppress-initialization}@anchor{155} @section Aspect Suppress_Initialization @geindex Suppress_Initialization -This boolean aspect is equivalent to @ref{f7,,pragma Suppress_Initialization}. +This boolean aspect is equivalent to @ref{f6,,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{159} +@anchor{gnat_rm/implementation_defined_aspects aspect-test-case}@anchor{156} @section Aspect Test_Case @geindex Test_Case -This aspect is equivalent to @ref{fa,,pragma Test_Case}. +This aspect is equivalent to @ref{f9,,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{15a} +@anchor{gnat_rm/implementation_defined_aspects aspect-thread-local-storage}@anchor{157} @section Aspect Thread_Local_Storage @geindex Thread_Local_Storage -This boolean aspect is equivalent to @ref{fc,,pragma Thread_Local_Storage}. +This boolean aspect is equivalent to @ref{fb,,pragma Thread_Local_Storage}. -@node Aspect Universal_Aliasing,Aspect Universal_Data,Aspect Thread_Local_Storage,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-universal-aliasing}@anchor{15b} +@node Aspect Universal_Aliasing,Aspect Unmodified,Aspect Thread_Local_Storage,Implementation Defined Aspects +@anchor{gnat_rm/implementation_defined_aspects aspect-universal-aliasing}@anchor{158} @section Aspect Universal_Aliasing @geindex Universal_Aliasing -This boolean aspect is equivalent to @ref{106,,pragma Universal_Aliasing}. - -@node Aspect Universal_Data,Aspect Unmodified,Aspect Universal_Aliasing,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-universal-data}@anchor{15c} -@section Aspect Universal_Data - - -@geindex Universal_Data - -This aspect is equivalent to @ref{108,,pragma Universal_Data}. +This boolean aspect is equivalent to @ref{105,,pragma Universal_Aliasing}. -@node Aspect Unmodified,Aspect Unreferenced,Aspect Universal_Data,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-unmodified}@anchor{15d} +@node Aspect Unmodified,Aspect Unreferenced,Aspect Universal_Aliasing,Implementation Defined Aspects +@anchor{gnat_rm/implementation_defined_aspects aspect-unmodified}@anchor{159} @section Aspect Unmodified @geindex Unmodified -This boolean aspect is equivalent to @ref{10b,,pragma Unmodified}. +This boolean aspect is equivalent to @ref{107,,pragma Unmodified}. @node Aspect Unreferenced,Aspect Unreferenced_Objects,Aspect Unmodified,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-unreferenced}@anchor{15e} +@anchor{gnat_rm/implementation_defined_aspects aspect-unreferenced}@anchor{15a} @section Aspect Unreferenced @geindex Unreferenced -This boolean aspect is equivalent to @ref{10c,,pragma Unreferenced}. +This boolean aspect is equivalent to @ref{109,,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 Value_Size,Aspect Unreferenced,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-unreferenced-objects}@anchor{15f} +@anchor{gnat_rm/implementation_defined_aspects aspect-unreferenced-objects}@anchor{15b} @section Aspect Unreferenced_Objects @geindex Unreferenced_Objects -This boolean aspect is equivalent to @ref{10e,,pragma Unreferenced_Objects}. +This boolean aspect is equivalent to @ref{10b,,pragma Unreferenced_Objects}. @node Aspect Value_Size,Aspect Volatile_Full_Access,Aspect Unreferenced_Objects,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-value-size}@anchor{160} +@anchor{gnat_rm/implementation_defined_aspects aspect-value-size}@anchor{15c} @section Aspect Value_Size @geindex Value_Size -This aspect is equivalent to @ref{161,,attribute Value_Size}. +This aspect is equivalent to @ref{15d,,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{162} +@anchor{gnat_rm/implementation_defined_aspects aspect-volatile-full-access}@anchor{15e} @section Aspect Volatile_Full_Access @geindex Volatile_Full_Access -This boolean aspect is equivalent to @ref{119,,pragma Volatile_Full_Access}. +This boolean aspect is equivalent to @ref{116,,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{163} +@anchor{gnat_rm/implementation_defined_aspects aspect-volatile-function}@anchor{15f} @section Aspect Volatile_Function @geindex Volatile_Function -This boolean aspect is equivalent to @ref{11b,,pragma Volatile_Function}. +This boolean aspect is equivalent to @ref{118,,pragma Volatile_Function}. @node Aspect Warnings,,Aspect Volatile_Function,Implementation Defined Aspects -@anchor{gnat_rm/implementation_defined_aspects aspect-warnings}@anchor{164} +@anchor{gnat_rm/implementation_defined_aspects aspect-warnings}@anchor{160} @section Aspect Warnings @geindex Warnings -This aspect is equivalent to the two argument form of @ref{11d,,pragma Warnings}, +This aspect is equivalent to the two argument form of @ref{11a,,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{165}@anchor{gnat_rm/implementation_defined_attributes implementation-defined-attributes}@anchor{8}@anchor{gnat_rm/implementation_defined_attributes id1}@anchor{166} +@anchor{gnat_rm/implementation_defined_attributes doc}@anchor{161}@anchor{gnat_rm/implementation_defined_attributes implementation-defined-attributes}@anchor{8}@anchor{gnat_rm/implementation_defined_attributes id1}@anchor{162} @chapter Implementation Defined Attributes @@ -10121,7 +10191,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{167} +@anchor{gnat_rm/implementation_defined_attributes attribute-abort-signal}@anchor{163} @section Attribute Abort_Signal @@ -10135,7 +10205,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{168} +@anchor{gnat_rm/implementation_defined_attributes attribute-address-size}@anchor{164} @section Attribute Address_Size @@ -10151,7 +10221,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{169} +@anchor{gnat_rm/implementation_defined_attributes attribute-asm-input}@anchor{165} @section Attribute Asm_Input @@ -10165,10 +10235,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{16a,,Machine Code Insertions} +@ref{166,,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{16b} +@anchor{gnat_rm/implementation_defined_attributes attribute-asm-output}@anchor{167} @section Attribute Asm_Output @@ -10184,10 +10254,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{16a,,Machine Code Insertions} +@ref{166,,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{16c} +@anchor{gnat_rm/implementation_defined_attributes attribute-atomic-always-lock-free}@anchor{168} @section Attribute Atomic_Always_Lock_Free @@ -10199,7 +10269,7 @@ and False otherwise. The result indicate 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{16d} +@anchor{gnat_rm/implementation_defined_attributes attribute-bit}@anchor{169} @section Attribute Bit @@ -10230,7 +10300,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{16e} +@anchor{gnat_rm/implementation_defined_attributes attribute-bit-position}@anchor{16a} @section Attribute Bit_Position @@ -10245,7 +10315,7 @@ type @emph{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{16f} +@anchor{gnat_rm/implementation_defined_attributes attribute-code-address}@anchor{16b} @section Attribute Code_Address @@ -10288,7 +10358,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{170} +@anchor{gnat_rm/implementation_defined_attributes attribute-compiler-version}@anchor{16c} @section Attribute Compiler_Version @@ -10299,7 +10369,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{171} +@anchor{gnat_rm/implementation_defined_attributes attribute-constrained}@anchor{16d} @section Attribute Constrained @@ -10314,7 +10384,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{172} +@anchor{gnat_rm/implementation_defined_attributes attribute-default-bit-order}@anchor{16e} @section Attribute Default_Bit_Order @@ -10331,7 +10401,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{173} +@anchor{gnat_rm/implementation_defined_attributes attribute-default-scalar-storage-order}@anchor{16f} @section Attribute Default_Scalar_Storage_Order @@ -10348,7 +10418,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{174} +@anchor{gnat_rm/implementation_defined_attributes attribute-deref}@anchor{170} @section Attribute Deref @@ -10361,7 +10431,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{175} +@anchor{gnat_rm/implementation_defined_attributes attribute-descriptor-size}@anchor{171} @section Attribute Descriptor_Size @@ -10390,7 +10460,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{176} +@anchor{gnat_rm/implementation_defined_attributes attribute-elaborated}@anchor{172} @section Attribute Elaborated @@ -10405,7 +10475,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{177} +@anchor{gnat_rm/implementation_defined_attributes attribute-elab-body}@anchor{173} @section Attribute Elab_Body @@ -10421,7 +10491,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{178} +@anchor{gnat_rm/implementation_defined_attributes attribute-elab-spec}@anchor{174} @section Attribute Elab_Spec @@ -10437,7 +10507,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{179} +@anchor{gnat_rm/implementation_defined_attributes attribute-elab-subp-body}@anchor{175} @section Attribute Elab_Subp_Body @@ -10451,7 +10521,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{17a} +@anchor{gnat_rm/implementation_defined_attributes attribute-emax}@anchor{176} @section Attribute Emax @@ -10464,7 +10534,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{17b} +@anchor{gnat_rm/implementation_defined_attributes attribute-enabled}@anchor{177} @section Attribute Enabled @@ -10488,7 +10558,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{17c} +@anchor{gnat_rm/implementation_defined_attributes attribute-enum-rep}@anchor{178} @section Attribute Enum_Rep @@ -10528,7 +10598,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{17d} +@anchor{gnat_rm/implementation_defined_attributes attribute-enum-val}@anchor{179} @section Attribute Enum_Val @@ -10554,7 +10624,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{17e} +@anchor{gnat_rm/implementation_defined_attributes attribute-epsilon}@anchor{17a} @section Attribute Epsilon @@ -10567,7 +10637,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{17f} +@anchor{gnat_rm/implementation_defined_attributes attribute-fast-math}@anchor{17b} @section Attribute Fast_Math @@ -10578,7 +10648,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{180} +@anchor{gnat_rm/implementation_defined_attributes attribute-finalization-size}@anchor{17c} @section Attribute Finalization_Size @@ -10596,7 +10666,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{181} +@anchor{gnat_rm/implementation_defined_attributes attribute-fixed-value}@anchor{17d} @section Attribute Fixed_Value @@ -10623,7 +10693,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{182} +@anchor{gnat_rm/implementation_defined_attributes attribute-from-any}@anchor{17e} @section Attribute From_Any @@ -10633,7 +10703,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{183} +@anchor{gnat_rm/implementation_defined_attributes attribute-has-access-values}@anchor{17f} @section Attribute Has_Access_Values @@ -10651,7 +10721,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{184} +@anchor{gnat_rm/implementation_defined_attributes attribute-has-discriminants}@anchor{180} @section Attribute Has_Discriminants @@ -10667,7 +10737,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{185} +@anchor{gnat_rm/implementation_defined_attributes attribute-has-tagged-values}@anchor{181} @section Attribute Has_Tagged_Values @@ -10684,7 +10754,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{186} +@anchor{gnat_rm/implementation_defined_attributes attribute-img}@anchor{182} @section Attribute Img @@ -10714,7 +10784,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{187} +@anchor{gnat_rm/implementation_defined_attributes attribute-initialized}@anchor{183} @section Attribute Initialized @@ -10724,7 +10794,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{188} +@anchor{gnat_rm/implementation_defined_attributes attribute-integer-value}@anchor{184} @section Attribute Integer_Value @@ -10752,7 +10822,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 Iterable,Attribute Integer_Value,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-invalid-value}@anchor{189} +@anchor{gnat_rm/implementation_defined_attributes attribute-invalid-value}@anchor{185} @section Attribute Invalid_Value @@ -10766,7 +10836,7 @@ including the ability to modify the value with the binder -Sxx flag and relevant environment variables at run time. @node Attribute Iterable,Attribute Large,Attribute Invalid_Value,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-iterable}@anchor{18a} +@anchor{gnat_rm/implementation_defined_attributes attribute-iterable}@anchor{186} @section Attribute Iterable @@ -10775,7 +10845,7 @@ relevant environment variables at run time. Equivalent to Aspect Iterable. @node Attribute Large,Attribute Library_Level,Attribute Iterable,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-large}@anchor{18b} +@anchor{gnat_rm/implementation_defined_attributes attribute-large}@anchor{187} @section Attribute Large @@ -10788,7 +10858,7 @@ the Ada 83 reference manual for an exact description of the semantics of this attribute. @node Attribute Library_Level,Attribute Lock_Free,Attribute Large,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-library-level}@anchor{18c} +@anchor{gnat_rm/implementation_defined_attributes attribute-library-level}@anchor{188} @section Attribute Library_Level @@ -10814,7 +10884,7 @@ end Gen; @end example @node Attribute Lock_Free,Attribute Loop_Entry,Attribute Library_Level,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-lock-free}@anchor{18d} +@anchor{gnat_rm/implementation_defined_attributes attribute-lock-free}@anchor{189} @section Attribute Lock_Free @@ -10824,7 +10894,7 @@ end Gen; pragma @code{Lock_Free} applies to P. @node Attribute Loop_Entry,Attribute Machine_Size,Attribute Lock_Free,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-loop-entry}@anchor{18e} +@anchor{gnat_rm/implementation_defined_attributes attribute-loop-entry}@anchor{18a} @section Attribute Loop_Entry @@ -10854,7 +10924,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{18f} +@anchor{gnat_rm/implementation_defined_attributes attribute-machine-size}@anchor{18b} @section Attribute Machine_Size @@ -10864,7 +10934,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{190} +@anchor{gnat_rm/implementation_defined_attributes attribute-mantissa}@anchor{18c} @section Attribute Mantissa @@ -10877,7 +10947,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{191}@anchor{gnat_rm/implementation_defined_attributes id2}@anchor{192} +@anchor{gnat_rm/implementation_defined_attributes attribute-maximum-alignment}@anchor{18d}@anchor{gnat_rm/implementation_defined_attributes id2}@anchor{18e} @section Attribute Maximum_Alignment @@ -10893,7 +10963,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{193} +@anchor{gnat_rm/implementation_defined_attributes attribute-max-integer-size}@anchor{18f} @section Attribute Max_Integer_Size @@ -10904,7 +10974,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{194} +@anchor{gnat_rm/implementation_defined_attributes attribute-mechanism-code}@anchor{190} @section Attribute Mechanism_Code @@ -10935,7 +11005,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{195} +@anchor{gnat_rm/implementation_defined_attributes attribute-null-parameter}@anchor{191} @section Attribute Null_Parameter @@ -10960,7 +11030,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{144}@anchor{gnat_rm/implementation_defined_attributes id3}@anchor{196} +@anchor{gnat_rm/implementation_defined_attributes attribute-object-size}@anchor{141}@anchor{gnat_rm/implementation_defined_attributes id3}@anchor{192} @section Attribute Object_Size @@ -11030,7 +11100,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{197} +@anchor{gnat_rm/implementation_defined_attributes attribute-old}@anchor{193} @section Attribute Old @@ -11045,7 +11115,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{198} +@anchor{gnat_rm/implementation_defined_attributes attribute-passed-by-reference}@anchor{194} @section Attribute Passed_By_Reference @@ -11061,7 +11131,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{199} +@anchor{gnat_rm/implementation_defined_attributes attribute-pool-address}@anchor{195} @section Attribute Pool_Address @@ -11083,7 +11153,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{19a} +@anchor{gnat_rm/implementation_defined_attributes attribute-range-length}@anchor{196} @section Attribute Range_Length @@ -11096,7 +11166,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{19b} +@anchor{gnat_rm/implementation_defined_attributes attribute-restriction-set}@anchor{197} @section Attribute Restriction_Set @@ -11166,7 +11236,7 @@ Restrictions pragma, they are not analyzed semantically, so they do not have a type. @node Attribute Result,Attribute Safe_Emax,Attribute Restriction_Set,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-result}@anchor{19c} +@anchor{gnat_rm/implementation_defined_attributes attribute-result}@anchor{198} @section Attribute Result @@ -11179,7 +11249,7 @@ For a further discussion of the use of this attribute and examples of its use, see the description of pragma Postcondition. @node Attribute Safe_Emax,Attribute Safe_Large,Attribute Result,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-safe-emax}@anchor{19d} +@anchor{gnat_rm/implementation_defined_attributes attribute-safe-emax}@anchor{199} @section Attribute Safe_Emax @@ -11192,7 +11262,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{19e} +@anchor{gnat_rm/implementation_defined_attributes attribute-safe-large}@anchor{19a} @section Attribute Safe_Large @@ -11205,7 +11275,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{19f} +@anchor{gnat_rm/implementation_defined_attributes attribute-safe-small}@anchor{19b} @section Attribute Safe_Small @@ -11218,7 +11288,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 id4}@anchor{1a0}@anchor{gnat_rm/implementation_defined_attributes attribute-scalar-storage-order}@anchor{152} +@anchor{gnat_rm/implementation_defined_attributes id4}@anchor{19c}@anchor{gnat_rm/implementation_defined_attributes attribute-scalar-storage-order}@anchor{14f} @section Attribute Scalar_Storage_Order @@ -11341,7 +11411,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{e5}@anchor{gnat_rm/implementation_defined_attributes id5}@anchor{1a1} +@anchor{gnat_rm/implementation_defined_attributes attribute-simple-storage-pool}@anchor{e4}@anchor{gnat_rm/implementation_defined_attributes id5}@anchor{19d} @section Attribute Simple_Storage_Pool @@ -11404,7 +11474,7 @@ as defined in section 13.11.2 of the Ada Reference Manual, except that the term @emph{simple storage pool} is substituted for @emph{storage pool}. @node Attribute Small,Attribute Small_Denominator,Attribute Simple_Storage_Pool,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-small}@anchor{1a2} +@anchor{gnat_rm/implementation_defined_attributes attribute-small}@anchor{19e} @section Attribute Small @@ -11420,7 +11490,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{1a3} +@anchor{gnat_rm/implementation_defined_attributes attribute-small-denominator}@anchor{19f} @section Attribute Small_Denominator @@ -11433,7 +11503,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{1a4} +@anchor{gnat_rm/implementation_defined_attributes attribute-small-numerator}@anchor{1a0} @section Attribute Small_Numerator @@ -11446,7 +11516,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{1a5} +@anchor{gnat_rm/implementation_defined_attributes attribute-storage-unit}@anchor{1a1} @section Attribute Storage_Unit @@ -11456,7 +11526,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{1a6} +@anchor{gnat_rm/implementation_defined_attributes attribute-stub-type}@anchor{1a2} @section Attribute Stub_Type @@ -11480,7 +11550,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{1a7} +@anchor{gnat_rm/implementation_defined_attributes attribute-system-allocator-alignment}@anchor{1a3} @section Attribute System_Allocator_Alignment @@ -11497,7 +11567,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{1a8} +@anchor{gnat_rm/implementation_defined_attributes attribute-target-name}@anchor{1a4} @section Attribute Target_Name @@ -11510,7 +11580,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{1a9} +@anchor{gnat_rm/implementation_defined_attributes attribute-to-address}@anchor{1a5} @section Attribute To_Address @@ -11533,7 +11603,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{1aa} +@anchor{gnat_rm/implementation_defined_attributes attribute-to-any}@anchor{1a6} @section Attribute To_Any @@ -11543,7 +11613,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{1ab} +@anchor{gnat_rm/implementation_defined_attributes attribute-type-class}@anchor{1a7} @section Attribute Type_Class @@ -11573,7 +11643,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{1ac} +@anchor{gnat_rm/implementation_defined_attributes attribute-type-key}@anchor{1a8} @section Attribute Type_Key @@ -11585,7 +11655,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{1ad} +@anchor{gnat_rm/implementation_defined_attributes attribute-typecode}@anchor{1a9} @section Attribute TypeCode @@ -11595,7 +11665,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{1ae} +@anchor{gnat_rm/implementation_defined_attributes attribute-unconstrained-array}@anchor{1aa} @section Attribute Unconstrained_Array @@ -11609,7 +11679,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{1af} +@anchor{gnat_rm/implementation_defined_attributes attribute-universal-literal-string}@anchor{1ab} @section Attribute Universal_Literal_String @@ -11637,7 +11707,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{1b0} +@anchor{gnat_rm/implementation_defined_attributes attribute-unrestricted-access}@anchor{1ac} @section Attribute Unrestricted_Access @@ -11824,7 +11894,7 @@ In general this is a risky approach. It may appear to "work" but such uses of of GNAT to another, so are best avoided if possible. @node Attribute Update,Attribute Valid_Scalars,Attribute Unrestricted_Access,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-update}@anchor{1b1} +@anchor{gnat_rm/implementation_defined_attributes attribute-update}@anchor{1ad} @section Attribute Update @@ -11905,7 +11975,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_Scalars,Attribute VADS_Size,Attribute Update,Implementation Defined Attributes -@anchor{gnat_rm/implementation_defined_attributes attribute-valid-scalars}@anchor{1b2} +@anchor{gnat_rm/implementation_defined_attributes attribute-valid-scalars}@anchor{1ae} @section Attribute Valid_Scalars @@ -11939,7 +12009,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{1b3} +@anchor{gnat_rm/implementation_defined_attributes attribute-vads-size}@anchor{1af} @section Attribute VADS_Size @@ -11959,7 +12029,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 id6}@anchor{1b4}@anchor{gnat_rm/implementation_defined_attributes attribute-value-size}@anchor{161} +@anchor{gnat_rm/implementation_defined_attributes id6}@anchor{1b0}@anchor{gnat_rm/implementation_defined_attributes attribute-value-size}@anchor{15d} @section Attribute Value_Size @@ -11973,7 +12043,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{1b5} +@anchor{gnat_rm/implementation_defined_attributes attribute-wchar-t-size}@anchor{1b1} @section Attribute Wchar_T_Size @@ -11985,7 +12055,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{1b6} +@anchor{gnat_rm/implementation_defined_attributes attribute-word-size}@anchor{1b2} @section Attribute Word_Size @@ -11996,7 +12066,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 standard-and-implementation-defined-restrictions}@anchor{9}@anchor{gnat_rm/standard_and_implementation_defined_restrictions doc}@anchor{1b7}@anchor{gnat_rm/standard_and_implementation_defined_restrictions id1}@anchor{1b8} +@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{1b3}@anchor{gnat_rm/standard_and_implementation_defined_restrictions id1}@anchor{1b4} @chapter Standard and Implementation Defined Restrictions @@ -12025,7 +12095,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 partition-wide-restrictions}@anchor{1b9}@anchor{gnat_rm/standard_and_implementation_defined_restrictions id2}@anchor{1ba} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions partition-wide-restrictions}@anchor{1b5}@anchor{gnat_rm/standard_and_implementation_defined_restrictions id2}@anchor{1b6} @section Partition-Wide Restrictions @@ -12114,7 +12184,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{1bb} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions immediate-reclamation}@anchor{1b7} @subsection Immediate_Reclamation @@ -12126,7 +12196,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{1bc} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-asynchronous-select-nesting}@anchor{1b8} @subsection Max_Asynchronous_Select_Nesting @@ -12138,7 +12208,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{1bd} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-entry-queue-length}@anchor{1b9} @subsection Max_Entry_Queue_Length @@ -12159,7 +12229,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{1be} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-protected-entries}@anchor{1ba} @subsection Max_Protected_Entries @@ -12170,7 +12240,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{1bf} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-select-alternatives}@anchor{1bb} @subsection Max_Select_Alternatives @@ -12179,7 +12249,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{1c0} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-storage-at-blocking}@anchor{1bc} @subsection Max_Storage_At_Blocking @@ -12190,7 +12260,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{1c1} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-task-entries}@anchor{1bd} @subsection Max_Task_Entries @@ -12203,7 +12273,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{1c2} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions max-tasks}@anchor{1be} @subsection Max_Tasks @@ -12216,7 +12286,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{1c3} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-abort-statements}@anchor{1bf} @subsection No_Abort_Statements @@ -12226,7 +12296,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{1c4} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-access-parameter-allocators}@anchor{1c0} @subsection No_Access_Parameter_Allocators @@ -12237,7 +12307,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{1c5} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-access-subprograms}@anchor{1c1} @subsection No_Access_Subprograms @@ -12247,7 +12317,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{1c6} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-allocators}@anchor{1c2} @subsection No_Allocators @@ -12257,7 +12327,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{1c7} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-anonymous-allocators}@anchor{1c3} @subsection No_Anonymous_Allocators @@ -12267,7 +12337,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{1c8} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-asynchronous-control}@anchor{1c4} @subsection No_Asynchronous_Control @@ -12277,7 +12347,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{1c9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-calendar}@anchor{1c5} @subsection No_Calendar @@ -12287,7 +12357,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{1ca} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-coextensions}@anchor{1c6} @subsection No_Coextensions @@ -12297,7 +12367,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{1cb} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-default-initialization}@anchor{1c7} @subsection No_Default_Initialization @@ -12314,7 +12384,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{1cc} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-delay}@anchor{1c8} @subsection No_Delay @@ -12324,7 +12394,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{1cd} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dependence}@anchor{1c9} @subsection No_Dependence @@ -12334,7 +12404,7 @@ delay statements and no semantic dependences on package Calendar. dependences on a library unit. @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{1ce} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-direct-boolean-operators}@anchor{1ca} @subsection No_Direct_Boolean_Operators @@ -12347,7 +12417,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{1cf} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dispatch}@anchor{1cb} @subsection No_Dispatch @@ -12357,7 +12427,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{1d0} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dispatching-calls}@anchor{1cc} @subsection No_Dispatching_Calls @@ -12418,7 +12488,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{1d1} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-attachment}@anchor{1cd} @subsection No_Dynamic_Attachment @@ -12437,7 +12507,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{1d2} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-priorities}@anchor{1ce} @subsection No_Dynamic_Priorities @@ -12446,7 +12516,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{1d3} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-entry-calls-in-elaboration-code}@anchor{1cf} @subsection No_Entry_Calls_In_Elaboration_Code @@ -12458,7 +12528,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{1d4} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-enumeration-maps}@anchor{1d0} @subsection No_Enumeration_Maps @@ -12469,7 +12539,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{1d5} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-handlers}@anchor{1d1} @subsection No_Exception_Handlers @@ -12494,7 +12564,7 @@ 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{1d6} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-propagation}@anchor{1d2} @subsection No_Exception_Propagation @@ -12511,7 +12581,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{1d7} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exception-registration}@anchor{1d3} @subsection No_Exception_Registration @@ -12525,7 +12595,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{1d8} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-exceptions}@anchor{1d4} @subsection No_Exceptions @@ -12536,7 +12606,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{1d9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-finalization}@anchor{1d5} @subsection No_Finalization @@ -12577,7 +12647,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{1da} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-fixed-point}@anchor{1d6} @subsection No_Fixed_Point @@ -12587,7 +12657,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{1db} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-floating-point}@anchor{1d7} @subsection No_Floating_Point @@ -12597,7 +12667,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{1dc} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-conditionals}@anchor{1d8} @subsection No_Implicit_Conditionals @@ -12613,7 +12683,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{1dd} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-dynamic-code}@anchor{1d9} @subsection No_Implicit_Dynamic_Code @@ -12643,7 +12713,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{1de} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-heap-allocations}@anchor{1da} @subsection No_Implicit_Heap_Allocations @@ -12652,7 +12722,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{1df} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-protected-object-allocations}@anchor{1db} @subsection No_Implicit_Protected_Object_Allocations @@ -12662,7 +12732,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{1e0} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-task-allocations}@anchor{1dc} @subsection No_Implicit_Task_Allocations @@ -12671,7 +12741,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{1e1} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-initialize-scalars}@anchor{1dd} @subsection No_Initialize_Scalars @@ -12683,7 +12753,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{1e2} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-io}@anchor{1de} @subsection No_IO @@ -12694,7 +12764,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{1e3} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-allocators}@anchor{1df} @subsection No_Local_Allocators @@ -12705,7 +12775,7 @@ occurrences of an allocator in subprograms, generic subprograms, tasks, and entry bodies. @node No_Local_Protected_Objects,No_Local_Timing_Events,No_Local_Allocators,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-protected-objects}@anchor{1e4} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-protected-objects}@anchor{1e0} @subsection No_Local_Protected_Objects @@ -12715,7 +12785,7 @@ and entry bodies. only declared at the library level. @node No_Local_Timing_Events,No_Long_Long_Integers,No_Local_Protected_Objects,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-timing-events}@anchor{1e5} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-local-timing-events}@anchor{1e1} @subsection No_Local_Timing_Events @@ -12725,7 +12795,7 @@ only 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{1e6} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-long-long-integers}@anchor{1e2} @subsection No_Long_Long_Integers @@ -12737,7 +12807,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{1e7} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-multiple-elaboration}@anchor{1e3} @subsection No_Multiple_Elaboration @@ -12753,7 +12823,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{1e8} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-nested-finalization}@anchor{1e4} @subsection No_Nested_Finalization @@ -12762,7 +12832,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{1e9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-protected-type-allocators}@anchor{1e5} @subsection No_Protected_Type_Allocators @@ -12772,7 +12842,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{1ea} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-protected-types}@anchor{1e6} @subsection No_Protected_Types @@ -12782,7 +12852,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{1eb} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-recursion}@anchor{1e7} @subsection No_Recursion @@ -12792,7 +12862,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{1ec} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-reentrancy}@anchor{1e8} @subsection No_Reentrancy @@ -12802,7 +12872,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{1ed} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-relative-delay}@anchor{1e9} @subsection No_Relative_Delay @@ -12813,7 +12883,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{1ee} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-requeue-statements}@anchor{1ea} @subsection No_Requeue_Statements @@ -12831,7 +12901,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{1ef} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-secondary-stack}@anchor{1eb} @subsection No_Secondary_Stack @@ -12844,7 +12914,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{1f0} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-select-statements}@anchor{1ec} @subsection No_Select_Statements @@ -12854,7 +12924,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{1f1} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-specific-termination-handlers}@anchor{1ed} @subsection No_Specific_Termination_Handlers @@ -12864,7 +12934,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{1f2} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-specification-of-aspect}@anchor{1ee} @subsection No_Specification_of_Aspect @@ -12875,7 +12945,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{1f3} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-standard-allocators-after-elaboration}@anchor{1ef} @subsection No_Standard_Allocators_After_Elaboration @@ -12887,7 +12957,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{1f4} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-standard-storage-pools}@anchor{1f0} @subsection No_Standard_Storage_Pools @@ -12899,7 +12969,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{1f5} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-stream-optimizations}@anchor{1f1} @subsection No_Stream_Optimizations @@ -12912,7 +12982,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_Task_Allocators,No_Stream_Optimizations,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-streams}@anchor{1f6} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-streams}@anchor{1f2} @subsection No_Streams @@ -12933,7 +13003,7 @@ unit declaring a tagged type should be compiled with the restriction, though this is not required. @node No_Task_Allocators,No_Task_At_Interrupt_Priority,No_Streams,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-allocators}@anchor{1f7} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-allocators}@anchor{1f3} @subsection No_Task_Allocators @@ -12943,7 +13013,7 @@ though this is not required. 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{1f8} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-at-interrupt-priority}@anchor{1f4} @subsection No_Task_At_Interrupt_Priority @@ -12955,7 +13025,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{1f9} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-attributes-package}@anchor{1f5} @subsection No_Task_Attributes_Package @@ -12972,7 +13042,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{1fa} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-hierarchy}@anchor{1f6} @subsection No_Task_Hierarchy @@ -12982,7 +13052,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{1fb} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-task-termination}@anchor{1f7} @subsection No_Task_Termination @@ -12991,7 +13061,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{1fc} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-tasking}@anchor{1f8} @subsection No_Tasking @@ -13004,7 +13074,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{1fd} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-terminate-alternatives}@anchor{1f9} @subsection No_Terminate_Alternatives @@ -13013,7 +13083,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{1fe} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-access}@anchor{1fa} @subsection No_Unchecked_Access @@ -13023,7 +13093,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{1ff} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-conversion}@anchor{1fb} @subsection No_Unchecked_Conversion @@ -13033,7 +13103,7 @@ occurrences of the Unchecked_Access attribute. dependences on the predefined generic function Unchecked_Conversion. @node No_Unchecked_Deallocation,No_Use_Of_Entity,No_Unchecked_Conversion,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-deallocation}@anchor{200} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-unchecked-deallocation}@anchor{1fc} @subsection No_Unchecked_Deallocation @@ -13043,7 +13113,7 @@ dependences on the predefined generic function Unchecked_Conversion. dependences on the predefined generic procedure Unchecked_Deallocation. @node No_Use_Of_Entity,Pure_Barriers,No_Unchecked_Deallocation,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-use-of-entity}@anchor{201} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-use-of-entity}@anchor{1fd} @subsection No_Use_Of_Entity @@ -13063,7 +13133,7 @@ No_Use_Of_Entity => Ada.Text_IO.Put_Line @end example @node Pure_Barriers,Simple_Barriers,No_Use_Of_Entity,Partition-Wide Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions pure-barriers}@anchor{202} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions pure-barriers}@anchor{1fe} @subsection Pure_Barriers @@ -13114,7 +13184,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{203} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions simple-barriers}@anchor{1ff} @subsection Simple_Barriers @@ -13133,7 +13203,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{204} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-priorities}@anchor{200} @subsection Static_Priorities @@ -13144,7 +13214,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{205} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-storage-size}@anchor{201} @subsection Static_Storage_Size @@ -13154,7 +13224,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 program-unit-level-restrictions}@anchor{206}@anchor{gnat_rm/standard_and_implementation_defined_restrictions id3}@anchor{207} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions program-unit-level-restrictions}@anchor{202}@anchor{gnat_rm/standard_and_implementation_defined_restrictions id3}@anchor{203} @section Program Unit Level Restrictions @@ -13184,7 +13254,7 @@ other compilation units in the partition. @end menu @node No_Elaboration_Code,No_Dynamic_Sized_Objects,,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-elaboration-code}@anchor{208} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-elaboration-code}@anchor{204} @subsection No_Elaboration_Code @@ -13240,7 +13310,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_Sized_Objects,No_Entry_Queue,No_Elaboration_Code,Program Unit Level Restrictions -@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-sized-objects}@anchor{209} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-dynamic-sized-objects}@anchor{205} @subsection No_Dynamic_Sized_Objects @@ -13258,7 +13328,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{20a} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-entry-queue}@anchor{206} @subsection No_Entry_Queue @@ -13271,7 +13341,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{20b} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-aspect-specifications}@anchor{207} @subsection No_Implementation_Aspect_Specifications @@ -13282,7 +13352,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{20c} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-attributes}@anchor{208} @subsection No_Implementation_Attributes @@ -13294,7 +13364,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{20d} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-identifiers}@anchor{209} @subsection No_Implementation_Identifiers @@ -13305,7 +13375,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{20e} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-pragmas}@anchor{20a} @subsection No_Implementation_Pragmas @@ -13316,7 +13386,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{20f} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-restrictions}@anchor{20b} @subsection No_Implementation_Restrictions @@ -13328,7 +13398,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{210} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implementation-units}@anchor{20c} @subsection No_Implementation_Units @@ -13339,7 +13409,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{211} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-aliasing}@anchor{20d} @subsection No_Implicit_Aliasing @@ -13354,7 +13424,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{212} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-implicit-loops}@anchor{20e} @subsection No_Implicit_Loops @@ -13371,7 +13441,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{213} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-obsolescent-features}@anchor{20f} @subsection No_Obsolescent_Features @@ -13381,7 +13451,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{214} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions no-wide-characters}@anchor{210} @subsection No_Wide_Characters @@ -13395,7 +13465,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{215} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions static-dispatch-tables}@anchor{211} @subsection Static_Dispatch_Tables @@ -13405,7 +13475,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{216} +@anchor{gnat_rm/standard_and_implementation_defined_restrictions spark-05}@anchor{212} @subsection SPARK_05 @@ -13428,7 +13498,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{217}@anchor{gnat_rm/implementation_advice implementation-advice}@anchor{a}@anchor{gnat_rm/implementation_advice id1}@anchor{218} +@anchor{gnat_rm/implementation_advice doc}@anchor{213}@anchor{gnat_rm/implementation_advice implementation-advice}@anchor{a}@anchor{gnat_rm/implementation_advice id1}@anchor{214} @chapter Implementation Advice @@ -13526,7 +13596,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{219} +@anchor{gnat_rm/implementation_advice rm-1-1-3-20-error-detection}@anchor{215} @section RM 1.1.3(20): Error Detection @@ -13543,7 +13613,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{21a} +@anchor{gnat_rm/implementation_advice rm-1-1-3-31-child-units}@anchor{216} @section RM 1.1.3(31): Child Units @@ -13559,7 +13629,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{21b} +@anchor{gnat_rm/implementation_advice rm-1-1-5-12-bounded-errors}@anchor{217} @section RM 1.1.5(12): Bounded Errors @@ -13576,7 +13646,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{21c}@anchor{gnat_rm/implementation_advice rm-2-8-16-pragmas}@anchor{21d} +@anchor{gnat_rm/implementation_advice id2}@anchor{218}@anchor{gnat_rm/implementation_advice rm-2-8-16-pragmas}@anchor{219} @section RM 2.8(16): Pragmas @@ -13689,7 +13759,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{21e} +@anchor{gnat_rm/implementation_advice rm-2-8-17-19-pragmas}@anchor{21a} @section RM 2.8(17-19): Pragmas @@ -13710,14 +13780,14 @@ replacing @code{library_items}." @end itemize @end quotation -See @ref{21d,,RM 2.8(16); Pragmas}. +See @ref{219,,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{21f} +@anchor{gnat_rm/implementation_advice rm-3-5-2-5-alternative-character-sets}@anchor{21b} @section RM 3.5.2(5): Alternative Character Sets @@ -13745,7 +13815,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{220} +@anchor{gnat_rm/implementation_advice rm-3-5-4-28-integer-types}@anchor{21c} @section RM 3.5.4(28): Integer Types @@ -13764,7 +13834,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{221} +@anchor{gnat_rm/implementation_advice rm-3-5-4-29-integer-types}@anchor{21d} @section RM 3.5.4(29): Integer Types @@ -13780,7 +13850,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{222} +@anchor{gnat_rm/implementation_advice rm-3-5-5-8-enumeration-values}@anchor{21e} @section RM 3.5.5(8): Enumeration Values @@ -13800,7 +13870,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{223} +@anchor{gnat_rm/implementation_advice rm-3-5-7-17-float-types}@anchor{21f} @section RM 3.5.7(17): Float Types @@ -13830,7 +13900,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{224} +@anchor{gnat_rm/implementation_advice rm-3-6-2-11-multidimensional-arrays}@anchor{220} @section RM 3.6.2(11): Multidimensional Arrays @@ -13848,7 +13918,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{225} +@anchor{gnat_rm/implementation_advice rm-9-6-30-31-duration-small}@anchor{221} @section RM 9.6(30-31): Duration'Small @@ -13869,7 +13939,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{226} +@anchor{gnat_rm/implementation_advice rm-10-2-1-12-consistent-representation}@anchor{222} @section RM 10.2.1(12): Consistent Representation @@ -13891,7 +13961,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{227} +@anchor{gnat_rm/implementation_advice rm-11-4-1-19-exception-information}@anchor{223} @section RM 11.4.1(19): Exception Information @@ -13922,7 +13992,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{228} +@anchor{gnat_rm/implementation_advice rm-11-5-28-suppression-of-checks}@anchor{224} @section RM 11.5(28): Suppression of Checks @@ -13937,7 +14007,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{229} +@anchor{gnat_rm/implementation_advice rm-13-1-21-24-representation-clauses}@anchor{225} @section RM 13.1 (21-24): Representation Clauses @@ -13986,7 +14056,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{22a} +@anchor{gnat_rm/implementation_advice rm-13-2-6-8-packed-types}@anchor{226} @section RM 13.2(6-8): Packed Types @@ -14025,7 +14095,7 @@ Followed. @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{22b} +@anchor{gnat_rm/implementation_advice rm-13-3-14-19-address-clauses}@anchor{227} @section RM 13.3(14-19): Address Clauses @@ -14078,7 +14148,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{22c} +@anchor{gnat_rm/implementation_advice rm-13-3-29-35-alignment-clauses}@anchor{228} @section RM 13.3(29-35): Alignment Clauses @@ -14135,7 +14205,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{22d} +@anchor{gnat_rm/implementation_advice rm-13-3-42-43-size-clauses}@anchor{229} @section RM 13.3(42-43): Size Clauses @@ -14153,7 +14223,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{22e} +@anchor{gnat_rm/implementation_advice rm-13-3-50-56-size-clauses}@anchor{22a} @section RM 13.3(50-56): Size Clauses @@ -14204,7 +14274,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{22f} +@anchor{gnat_rm/implementation_advice rm-13-3-71-73-component-size-clauses}@anchor{22b} @section RM 13.3(71-73): Component Size Clauses @@ -14238,7 +14308,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{230} +@anchor{gnat_rm/implementation_advice rm-13-4-9-10-enumeration-representation-clauses}@anchor{22c} @section RM 13.4(9-10): Enumeration Representation Clauses @@ -14260,7 +14330,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{231} +@anchor{gnat_rm/implementation_advice rm-13-5-1-17-22-record-representation-clauses}@anchor{22d} @section RM 13.5.1(17-22): Record Representation Clauses @@ -14320,7 +14390,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{232} +@anchor{gnat_rm/implementation_advice rm-13-5-2-5-storage-place-attributes}@anchor{22e} @section RM 13.5.2(5): Storage Place Attributes @@ -14340,7 +14410,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{233} +@anchor{gnat_rm/implementation_advice rm-13-5-3-7-8-bit-ordering}@anchor{22f} @section RM 13.5.3(7-8): Bit Ordering @@ -14360,7 +14430,7 @@ Thus non-default bit ordering is not supported. @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{234} +@anchor{gnat_rm/implementation_advice rm-13-7-37-address-as-private}@anchor{230} @section RM 13.7(37): Address as Private @@ -14378,7 +14448,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{235} +@anchor{gnat_rm/implementation_advice rm-13-7-1-16-address-operations}@anchor{231} @section RM 13.7.1(16): Address Operations @@ -14396,7 +14466,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{236} +@anchor{gnat_rm/implementation_advice rm-13-9-14-17-unchecked-conversion}@anchor{232} @section RM 13.9(14-17): Unchecked Conversion @@ -14440,7 +14510,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{237} +@anchor{gnat_rm/implementation_advice rm-13-11-23-25-implicit-heap-usage}@anchor{233} @section RM 13.11(23-25): Implicit Heap Usage @@ -14491,7 +14561,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{238} +@anchor{gnat_rm/implementation_advice rm-13-11-2-17-unchecked-deallocation}@anchor{234} @section RM 13.11.2(17): Unchecked Deallocation @@ -14506,7 +14576,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{239} +@anchor{gnat_rm/implementation_advice rm-13-13-2-1-6-stream-oriented-attributes}@anchor{235} @section RM 13.13.2(1.6): Stream Oriented Attributes @@ -14537,7 +14607,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{23a} +@anchor{gnat_rm/implementation_advice rm-a-1-52-names-of-predefined-numeric-types}@anchor{236} @section RM A.1(52): Names of Predefined Numeric Types @@ -14555,7 +14625,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{23b} +@anchor{gnat_rm/implementation_advice rm-a-3-2-49-ada-characters-handling}@anchor{237} @section RM A.3.2(49): @code{Ada.Characters.Handling} @@ -14572,7 +14642,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{23c} +@anchor{gnat_rm/implementation_advice rm-a-4-4-106-bounded-length-string-handling}@anchor{238} @section RM A.4.4(106): Bounded-Length String Handling @@ -14587,7 +14657,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{23d} +@anchor{gnat_rm/implementation_advice rm-a-5-2-46-47-random-number-generation}@anchor{239} @section RM A.5.2(46-47): Random Number Generation @@ -14616,7 +14686,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{23e} +@anchor{gnat_rm/implementation_advice rm-a-10-7-23-get-immediate}@anchor{23a} @section RM A.10.7(23): @code{Get_Immediate} @@ -14640,7 +14710,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{23f} +@anchor{gnat_rm/implementation_advice rm-a-18-containers}@anchor{23b} @section RM A.18: @code{Containers} @@ -14661,7 +14731,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{240} +@anchor{gnat_rm/implementation_advice rm-b-1-39-41-pragma-export}@anchor{23c} @section RM B.1(39-41): Pragma @code{Export} @@ -14709,7 +14779,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{241} +@anchor{gnat_rm/implementation_advice rm-b-2-12-13-package-interfaces}@anchor{23d} @section RM B.2(12-13): Package @code{Interfaces} @@ -14739,7 +14809,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{242} +@anchor{gnat_rm/implementation_advice rm-b-3-63-71-interfacing-with-c}@anchor{23e} @section RM B.3(63-71): Interfacing with C @@ -14827,7 +14897,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{243} +@anchor{gnat_rm/implementation_advice rm-b-4-95-98-interfacing-with-cobol}@anchor{23f} @section RM B.4(95-98): Interfacing with COBOL @@ -14868,7 +14938,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{244} +@anchor{gnat_rm/implementation_advice rm-b-5-22-26-interfacing-with-fortran}@anchor{240} @section RM B.5(22-26): Interfacing with Fortran @@ -14919,7 +14989,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{245} +@anchor{gnat_rm/implementation_advice rm-c-1-3-5-access-to-machine-operations}@anchor{241} @section RM C.1(3-5): Access to Machine Operations @@ -14954,7 +15024,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{246} +@anchor{gnat_rm/implementation_advice rm-c-1-10-16-access-to-machine-operations}@anchor{242} @section RM C.1(10-16): Access to Machine Operations @@ -15015,7 +15085,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{247} +@anchor{gnat_rm/implementation_advice rm-c-3-28-interrupt-support}@anchor{243} @section RM C.3(28): Interrupt Support @@ -15033,7 +15103,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{248} +@anchor{gnat_rm/implementation_advice rm-c-3-1-20-21-protected-procedure-handlers}@anchor{244} @section RM C.3.1(20-21): Protected Procedure Handlers @@ -15059,7 +15129,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{249} +@anchor{gnat_rm/implementation_advice rm-c-3-2-25-package-interrupts}@anchor{245} @section RM C.3.2(25): Package @code{Interrupts} @@ -15077,7 +15147,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{24a} +@anchor{gnat_rm/implementation_advice rm-c-4-14-pre-elaboration-requirements}@anchor{246} @section RM C.4(14): Pre-elaboration Requirements @@ -15093,7 +15163,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{24b} +@anchor{gnat_rm/implementation_advice rm-c-5-8-pragma-discard-names}@anchor{247} @section RM C.5(8): Pragma @code{Discard_Names} @@ -15111,7 +15181,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{24c} +@anchor{gnat_rm/implementation_advice rm-c-7-2-30-the-package-task-attributes}@anchor{248} @section RM C.7.2(30): The Package Task_Attributes @@ -15132,7 +15202,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{24d} +@anchor{gnat_rm/implementation_advice rm-d-3-17-locking-policies}@anchor{249} @section RM D.3(17): Locking Policies @@ -15149,7 +15219,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{24e} +@anchor{gnat_rm/implementation_advice rm-d-4-16-entry-queuing-policies}@anchor{24a} @section RM D.4(16): Entry Queuing Policies @@ -15164,7 +15234,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{24f} +@anchor{gnat_rm/implementation_advice rm-d-6-9-10-preemptive-abort}@anchor{24b} @section RM D.6(9-10): Preemptive Abort @@ -15190,7 +15260,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{250} +@anchor{gnat_rm/implementation_advice rm-d-7-21-tasking-restrictions}@anchor{24c} @section RM D.7(21): Tasking Restrictions @@ -15209,7 +15279,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{251} +@anchor{gnat_rm/implementation_advice rm-d-8-47-49-monotonic-time}@anchor{24d} @section RM D.8(47-49): Monotonic Time @@ -15244,7 +15314,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{252} +@anchor{gnat_rm/implementation_advice rm-e-5-28-29-partition-communication-subsystem}@anchor{24e} @section RM E.5(28-29): Partition Communication Subsystem @@ -15272,7 +15342,7 @@ GNAT. @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{253} +@anchor{gnat_rm/implementation_advice rm-f-7-cobol-support}@anchor{24f} @section RM F(7): COBOL Support @@ -15292,7 +15362,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{254} +@anchor{gnat_rm/implementation_advice rm-f-1-2-decimal-radix-support}@anchor{250} @section RM F.1(2): Decimal Radix Support @@ -15308,7 +15378,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{255} +@anchor{gnat_rm/implementation_advice rm-g-numerics}@anchor{251} @section RM G: Numerics @@ -15328,7 +15398,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{256} +@anchor{gnat_rm/implementation_advice rm-g-1-1-56-58-complex-types}@anchor{252} @section RM G.1.1(56-58): Complex Types @@ -15390,7 +15460,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{257} +@anchor{gnat_rm/implementation_advice rm-g-1-2-49-complex-elementary-functions}@anchor{253} @section RM G.1.2(49): Complex Elementary Functions @@ -15412,7 +15482,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{258} +@anchor{gnat_rm/implementation_advice rm-g-2-4-19-accuracy-requirements}@anchor{254} @section RM G.2.4(19): Accuracy Requirements @@ -15436,7 +15506,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{259} +@anchor{gnat_rm/implementation_advice rm-g-2-6-15-complex-arithmetic-accuracy}@anchor{255} @section RM G.2.6(15): Complex Arithmetic Accuracy @@ -15454,7 +15524,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{25a} +@anchor{gnat_rm/implementation_advice rm-h-6-15-2-pragma-partition-elaboration-policy}@anchor{256} @section RM H.6(15/2): Pragma Partition_Elaboration_Policy @@ -15469,7 +15539,7 @@ immediately terminated." Not followed. @node Implementation Defined Characteristics,Intrinsic Subprograms,Implementation Advice,Top -@anchor{gnat_rm/implementation_defined_characteristics implementation-defined-characteristics}@anchor{b}@anchor{gnat_rm/implementation_defined_characteristics doc}@anchor{25b}@anchor{gnat_rm/implementation_defined_characteristics id1}@anchor{25c} +@anchor{gnat_rm/implementation_defined_characteristics implementation-defined-characteristics}@anchor{b}@anchor{gnat_rm/implementation_defined_characteristics doc}@anchor{257}@anchor{gnat_rm/implementation_defined_characteristics id1}@anchor{258} @chapter Implementation Defined Characteristics @@ -16697,7 +16767,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{25d,,GNAT.Regexp (g-regexp.ads)}. +See @ref{259,,GNAT.Regexp (g-regexp.ads)}. @itemize * @@ -17745,7 +17815,7 @@ H.4(27)." There are no restrictions on pragma @code{Restrictions}. @node Intrinsic Subprograms,Representation Clauses and Pragmas,Implementation Defined Characteristics,Top -@anchor{gnat_rm/intrinsic_subprograms doc}@anchor{25e}@anchor{gnat_rm/intrinsic_subprograms intrinsic-subprograms}@anchor{c}@anchor{gnat_rm/intrinsic_subprograms id1}@anchor{25f} +@anchor{gnat_rm/intrinsic_subprograms doc}@anchor{25a}@anchor{gnat_rm/intrinsic_subprograms intrinsic-subprograms}@anchor{c}@anchor{gnat_rm/intrinsic_subprograms id1}@anchor{25b} @chapter Intrinsic Subprograms @@ -17783,7 +17853,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{260}@anchor{gnat_rm/intrinsic_subprograms intrinsic-operators}@anchor{261} +@anchor{gnat_rm/intrinsic_subprograms id2}@anchor{25c}@anchor{gnat_rm/intrinsic_subprograms intrinsic-operators}@anchor{25d} @section Intrinsic Operators @@ -17814,7 +17884,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 id3}@anchor{262}@anchor{gnat_rm/intrinsic_subprograms compilation-iso-date}@anchor{263} +@anchor{gnat_rm/intrinsic_subprograms id3}@anchor{25e}@anchor{gnat_rm/intrinsic_subprograms compilation-iso-date}@anchor{25f} @section Compilation_ISO_Date @@ -17828,7 +17898,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{264}@anchor{gnat_rm/intrinsic_subprograms id4}@anchor{265} +@anchor{gnat_rm/intrinsic_subprograms compilation-date}@anchor{260}@anchor{gnat_rm/intrinsic_subprograms id4}@anchor{261} @section Compilation_Date @@ -17838,7 +17908,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{266}@anchor{gnat_rm/intrinsic_subprograms id5}@anchor{267} +@anchor{gnat_rm/intrinsic_subprograms compilation-time}@anchor{262}@anchor{gnat_rm/intrinsic_subprograms id5}@anchor{263} @section Compilation_Time @@ -17852,7 +17922,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 id6}@anchor{268}@anchor{gnat_rm/intrinsic_subprograms enclosing-entity}@anchor{269} +@anchor{gnat_rm/intrinsic_subprograms id6}@anchor{264}@anchor{gnat_rm/intrinsic_subprograms enclosing-entity}@anchor{265} @section Enclosing_Entity @@ -17866,7 +17936,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 id7}@anchor{26a}@anchor{gnat_rm/intrinsic_subprograms exception-information}@anchor{26b} +@anchor{gnat_rm/intrinsic_subprograms id7}@anchor{266}@anchor{gnat_rm/intrinsic_subprograms exception-information}@anchor{267} @section Exception_Information @@ -17880,7 +17950,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{26c}@anchor{gnat_rm/intrinsic_subprograms id8}@anchor{26d} +@anchor{gnat_rm/intrinsic_subprograms exception-message}@anchor{268}@anchor{gnat_rm/intrinsic_subprograms id8}@anchor{269} @section Exception_Message @@ -17894,7 +17964,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{26e}@anchor{gnat_rm/intrinsic_subprograms id9}@anchor{26f} +@anchor{gnat_rm/intrinsic_subprograms exception-name}@anchor{26a}@anchor{gnat_rm/intrinsic_subprograms id9}@anchor{26b} @section Exception_Name @@ -17908,7 +17978,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 id10}@anchor{270}@anchor{gnat_rm/intrinsic_subprograms file}@anchor{271} +@anchor{gnat_rm/intrinsic_subprograms id10}@anchor{26c}@anchor{gnat_rm/intrinsic_subprograms file}@anchor{26d} @section File @@ -17922,7 +17992,7 @@ application program should simply call the function file. @node Line,Shifts and Rotates,File,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms id11}@anchor{272}@anchor{gnat_rm/intrinsic_subprograms line}@anchor{273} +@anchor{gnat_rm/intrinsic_subprograms id11}@anchor{26e}@anchor{gnat_rm/intrinsic_subprograms line}@anchor{26f} @section Line @@ -17936,7 +18006,7 @@ application program should simply call the function source line. @node Shifts and Rotates,Source_Location,Line,Intrinsic Subprograms -@anchor{gnat_rm/intrinsic_subprograms shifts-and-rotates}@anchor{274}@anchor{gnat_rm/intrinsic_subprograms id12}@anchor{275} +@anchor{gnat_rm/intrinsic_subprograms shifts-and-rotates}@anchor{270}@anchor{gnat_rm/intrinsic_subprograms id12}@anchor{271} @section Shifts and Rotates @@ -17979,7 +18049,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 source-location}@anchor{276}@anchor{gnat_rm/intrinsic_subprograms id13}@anchor{277} +@anchor{gnat_rm/intrinsic_subprograms source-location}@anchor{272}@anchor{gnat_rm/intrinsic_subprograms id13}@anchor{273} @section Source_Location @@ -17993,7 +18063,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 representation-clauses-and-pragmas}@anchor{d}@anchor{gnat_rm/representation_clauses_and_pragmas doc}@anchor{278}@anchor{gnat_rm/representation_clauses_and_pragmas id1}@anchor{279} +@anchor{gnat_rm/representation_clauses_and_pragmas representation-clauses-and-pragmas}@anchor{d}@anchor{gnat_rm/representation_clauses_and_pragmas doc}@anchor{274}@anchor{gnat_rm/representation_clauses_and_pragmas id1}@anchor{275} @chapter Representation Clauses and Pragmas @@ -18039,7 +18109,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 id2}@anchor{27a}@anchor{gnat_rm/representation_clauses_and_pragmas alignment-clauses}@anchor{27b} +@anchor{gnat_rm/representation_clauses_and_pragmas id2}@anchor{276}@anchor{gnat_rm/representation_clauses_and_pragmas alignment-clauses}@anchor{277} @section Alignment Clauses @@ -18061,7 +18131,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{191,,Attribute Maximum_Alignment}.) +@code{Standard'Maximum_Alignment}; see @ref{18d,,Attribute Maximum_Alignment}.) @geindex Maximum_Alignment attribute @@ -18170,7 +18240,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{27c}@anchor{gnat_rm/representation_clauses_and_pragmas size-clauses}@anchor{27d} +@anchor{gnat_rm/representation_clauses_and_pragmas id3}@anchor{278}@anchor{gnat_rm/representation_clauses_and_pragmas size-clauses}@anchor{279} @section Size Clauses @@ -18247,7 +18317,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 storage-size-clauses}@anchor{27e}@anchor{gnat_rm/representation_clauses_and_pragmas id4}@anchor{27f} +@anchor{gnat_rm/representation_clauses_and_pragmas storage-size-clauses}@anchor{27a}@anchor{gnat_rm/representation_clauses_and_pragmas id4}@anchor{27b} @section Storage_Size Clauses @@ -18320,7 +18390,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{280}@anchor{gnat_rm/representation_clauses_and_pragmas size-of-variant-record-objects}@anchor{281} +@anchor{gnat_rm/representation_clauses_and_pragmas id5}@anchor{27c}@anchor{gnat_rm/representation_clauses_and_pragmas size-of-variant-record-objects}@anchor{27d} @section Size of Variant Record Objects @@ -18430,7 +18500,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 id6}@anchor{282}@anchor{gnat_rm/representation_clauses_and_pragmas biased-representation}@anchor{283} +@anchor{gnat_rm/representation_clauses_and_pragmas id6}@anchor{27e}@anchor{gnat_rm/representation_clauses_and_pragmas biased-representation}@anchor{27f} @section Biased Representation @@ -18468,7 +18538,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{284}@anchor{gnat_rm/representation_clauses_and_pragmas value-size-and-object-size-clauses}@anchor{285} +@anchor{gnat_rm/representation_clauses_and_pragmas id7}@anchor{280}@anchor{gnat_rm/representation_clauses_and_pragmas value-size-and-object-size-clauses}@anchor{281} @section Value_Size and Object_Size Clauses @@ -18784,7 +18854,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 id8}@anchor{286}@anchor{gnat_rm/representation_clauses_and_pragmas component-size-clauses}@anchor{287} +@anchor{gnat_rm/representation_clauses_and_pragmas id8}@anchor{282}@anchor{gnat_rm/representation_clauses_and_pragmas component-size-clauses}@anchor{283} @section Component_Size Clauses @@ -18832,7 +18902,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{288}@anchor{gnat_rm/representation_clauses_and_pragmas id9}@anchor{289} +@anchor{gnat_rm/representation_clauses_and_pragmas bit-order-clauses}@anchor{284}@anchor{gnat_rm/representation_clauses_and_pragmas id9}@anchor{285} @section Bit_Order Clauses @@ -18938,7 +19008,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 id10}@anchor{28a}@anchor{gnat_rm/representation_clauses_and_pragmas effect-of-bit-order-on-byte-ordering}@anchor{28b} +@anchor{gnat_rm/representation_clauses_and_pragmas id10}@anchor{286}@anchor{gnat_rm/representation_clauses_and_pragmas effect-of-bit-order-on-byte-ordering}@anchor{287} @section Effect of Bit_Order on Byte Ordering @@ -19195,7 +19265,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 pragma-pack-for-arrays}@anchor{28c}@anchor{gnat_rm/representation_clauses_and_pragmas id11}@anchor{28d} +@anchor{gnat_rm/representation_clauses_and_pragmas pragma-pack-for-arrays}@anchor{288}@anchor{gnat_rm/representation_clauses_and_pragmas id11}@anchor{289} @section Pragma Pack for Arrays @@ -19315,7 +19385,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 pragma-pack-for-records}@anchor{28e}@anchor{gnat_rm/representation_clauses_and_pragmas id12}@anchor{28f} +@anchor{gnat_rm/representation_clauses_and_pragmas pragma-pack-for-records}@anchor{28a}@anchor{gnat_rm/representation_clauses_and_pragmas id12}@anchor{28b} @section Pragma Pack for Records @@ -19399,7 +19469,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{290}@anchor{gnat_rm/representation_clauses_and_pragmas record-representation-clauses}@anchor{291} +@anchor{gnat_rm/representation_clauses_and_pragmas id13}@anchor{28c}@anchor{gnat_rm/representation_clauses_and_pragmas record-representation-clauses}@anchor{28d} @section Record Representation Clauses @@ -19478,7 +19548,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{292}@anchor{gnat_rm/representation_clauses_and_pragmas id14}@anchor{293} +@anchor{gnat_rm/representation_clauses_and_pragmas handling-of-records-with-holes}@anchor{28e}@anchor{gnat_rm/representation_clauses_and_pragmas id14}@anchor{28f} @section Handling of Records with Holes @@ -19554,7 +19624,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{294}@anchor{gnat_rm/representation_clauses_and_pragmas id15}@anchor{295} +@anchor{gnat_rm/representation_clauses_and_pragmas enumeration-clauses}@anchor{290}@anchor{gnat_rm/representation_clauses_and_pragmas id15}@anchor{291} @section Enumeration Clauses @@ -19597,7 +19667,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 id16}@anchor{296}@anchor{gnat_rm/representation_clauses_and_pragmas address-clauses}@anchor{297} +@anchor{gnat_rm/representation_clauses_and_pragmas id16}@anchor{292}@anchor{gnat_rm/representation_clauses_and_pragmas address-clauses}@anchor{293} @section Address Clauses @@ -19926,7 +19996,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{298}@anchor{gnat_rm/representation_clauses_and_pragmas use-of-address-clauses-for-memory-mapped-i-o}@anchor{299} +@anchor{gnat_rm/representation_clauses_and_pragmas id17}@anchor{294}@anchor{gnat_rm/representation_clauses_and_pragmas use-of-address-clauses-for-memory-mapped-i-o}@anchor{295} @section Use of Address Clauses for Memory-Mapped I/O @@ -19984,7 +20054,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 id18}@anchor{29a}@anchor{gnat_rm/representation_clauses_and_pragmas effect-of-convention-on-representation}@anchor{29b} +@anchor{gnat_rm/representation_clauses_and_pragmas id18}@anchor{296}@anchor{gnat_rm/representation_clauses_and_pragmas effect-of-convention-on-representation}@anchor{297} @section Effect of Convention on Representation @@ -20062,7 +20132,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{29c}@anchor{gnat_rm/representation_clauses_and_pragmas id19}@anchor{29d} +@anchor{gnat_rm/representation_clauses_and_pragmas conventions-and-anonymous-access-types}@anchor{298}@anchor{gnat_rm/representation_clauses_and_pragmas id19}@anchor{299} @section Conventions and Anonymous Access Types @@ -20138,7 +20208,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 id20}@anchor{29e}@anchor{gnat_rm/representation_clauses_and_pragmas determining-the-representations-chosen-by-gnat}@anchor{29f} +@anchor{gnat_rm/representation_clauses_and_pragmas id20}@anchor{29a}@anchor{gnat_rm/representation_clauses_and_pragmas determining-the-representations-chosen-by-gnat}@anchor{29b} @section Determining the Representations chosen by GNAT @@ -20290,7 +20360,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 standard-library-routines}@anchor{e}@anchor{gnat_rm/standard_library_routines doc}@anchor{2a0}@anchor{gnat_rm/standard_library_routines id1}@anchor{2a1} +@anchor{gnat_rm/standard_library_routines standard-library-routines}@anchor{e}@anchor{gnat_rm/standard_library_routines doc}@anchor{29c}@anchor{gnat_rm/standard_library_routines id1}@anchor{29d} @chapter Standard Library Routines @@ -21114,7 +21184,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 the-implementation-of-standard-i-o}@anchor{f}@anchor{gnat_rm/the_implementation_of_standard_i_o doc}@anchor{2a2}@anchor{gnat_rm/the_implementation_of_standard_i_o id1}@anchor{2a3} +@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{29e}@anchor{gnat_rm/the_implementation_of_standard_i_o id1}@anchor{29f} @chapter The Implementation of Standard I/O @@ -21166,7 +21236,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 standard-i-o-packages}@anchor{2a4}@anchor{gnat_rm/the_implementation_of_standard_i_o id2}@anchor{2a5} +@anchor{gnat_rm/the_implementation_of_standard_i_o standard-i-o-packages}@anchor{2a0}@anchor{gnat_rm/the_implementation_of_standard_i_o id2}@anchor{2a1} @section Standard I/O Packages @@ -21237,7 +21307,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{2a6}@anchor{gnat_rm/the_implementation_of_standard_i_o id3}@anchor{2a7} +@anchor{gnat_rm/the_implementation_of_standard_i_o form-strings}@anchor{2a2}@anchor{gnat_rm/the_implementation_of_standard_i_o id3}@anchor{2a3} @section FORM Strings @@ -21263,7 +21333,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{2a8}@anchor{gnat_rm/the_implementation_of_standard_i_o id4}@anchor{2a9} +@anchor{gnat_rm/the_implementation_of_standard_i_o direct-io}@anchor{2a4}@anchor{gnat_rm/the_implementation_of_standard_i_o id4}@anchor{2a5} @section Direct_IO @@ -21283,7 +21353,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 sequential-io}@anchor{2aa}@anchor{gnat_rm/the_implementation_of_standard_i_o id5}@anchor{2ab} +@anchor{gnat_rm/the_implementation_of_standard_i_o sequential-io}@anchor{2a6}@anchor{gnat_rm/the_implementation_of_standard_i_o id5}@anchor{2a7} @section Sequential_IO @@ -21330,7 +21400,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{2ac}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io}@anchor{2ad} +@anchor{gnat_rm/the_implementation_of_standard_i_o id6}@anchor{2a8}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io}@anchor{2a9} @section Text_IO @@ -21413,7 +21483,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{2ae}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning}@anchor{2af} +@anchor{gnat_rm/the_implementation_of_standard_i_o id7}@anchor{2aa}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning}@anchor{2ab} @subsection Stream Pointer Positioning @@ -21449,7 +21519,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 reading-and-writing-non-regular-files}@anchor{2b0}@anchor{gnat_rm/the_implementation_of_standard_i_o id8}@anchor{2b1} +@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files}@anchor{2ac}@anchor{gnat_rm/the_implementation_of_standard_i_o id8}@anchor{2ad} @subsection Reading and Writing Non-Regular Files @@ -21500,7 +21570,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{2b2}@anchor{gnat_rm/the_implementation_of_standard_i_o id9}@anchor{2b3} +@anchor{gnat_rm/the_implementation_of_standard_i_o get-immediate}@anchor{2ae}@anchor{gnat_rm/the_implementation_of_standard_i_o id9}@anchor{2af} @subsection Get_Immediate @@ -21518,7 +21588,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{2b4}@anchor{gnat_rm/the_implementation_of_standard_i_o treating-text-io-files-as-streams}@anchor{2b5} +@anchor{gnat_rm/the_implementation_of_standard_i_o id10}@anchor{2b0}@anchor{gnat_rm/the_implementation_of_standard_i_o treating-text-io-files-as-streams}@anchor{2b1} @subsection Treating Text_IO Files as Streams @@ -21534,7 +21604,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{2b6}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io-extensions}@anchor{2b7} +@anchor{gnat_rm/the_implementation_of_standard_i_o id11}@anchor{2b2}@anchor{gnat_rm/the_implementation_of_standard_i_o text-io-extensions}@anchor{2b3} @subsection Text_IO Extensions @@ -21562,7 +21632,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 text-io-facilities-for-unbounded-strings}@anchor{2b8}@anchor{gnat_rm/the_implementation_of_standard_i_o id12}@anchor{2b9} +@anchor{gnat_rm/the_implementation_of_standard_i_o text-io-facilities-for-unbounded-strings}@anchor{2b4}@anchor{gnat_rm/the_implementation_of_standard_i_o id12}@anchor{2b5} @subsection Text_IO Facilities for Unbounded Strings @@ -21610,7 +21680,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 wide-text-io}@anchor{2ba}@anchor{gnat_rm/the_implementation_of_standard_i_o id13}@anchor{2bb} +@anchor{gnat_rm/the_implementation_of_standard_i_o wide-text-io}@anchor{2b6}@anchor{gnat_rm/the_implementation_of_standard_i_o id13}@anchor{2b7} @section Wide_Text_IO @@ -21857,12 +21927,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 stream-pointer-positioning-1}@anchor{2bc}@anchor{gnat_rm/the_implementation_of_standard_i_o id14}@anchor{2bd} +@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning-1}@anchor{2b8}@anchor{gnat_rm/the_implementation_of_standard_i_o id14}@anchor{2b9} @subsection Stream Pointer Positioning @code{Ada.Wide_Text_IO} is similar to @code{Ada.Text_IO} in its handling -of stream pointer positioning (@ref{2ad,,Text_IO}). There is one additional +of stream pointer positioning (@ref{2a9,,Text_IO}). There is one additional case: If @code{Ada.Wide_Text_IO.Look_Ahead} reads a character outside the @@ -21881,7 +21951,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 reading-and-writing-non-regular-files-1}@anchor{2be}@anchor{gnat_rm/the_implementation_of_standard_i_o id15}@anchor{2bf} +@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files-1}@anchor{2ba}@anchor{gnat_rm/the_implementation_of_standard_i_o id15}@anchor{2bb} @subsection Reading and Writing Non-Regular Files @@ -21892,7 +21962,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{2c0}@anchor{gnat_rm/the_implementation_of_standard_i_o wide-wide-text-io}@anchor{2c1} +@anchor{gnat_rm/the_implementation_of_standard_i_o id16}@anchor{2bc}@anchor{gnat_rm/the_implementation_of_standard_i_o wide-wide-text-io}@anchor{2bd} @section Wide_Wide_Text_IO @@ -22061,12 +22131,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 stream-pointer-positioning-2}@anchor{2c2}@anchor{gnat_rm/the_implementation_of_standard_i_o id17}@anchor{2c3} +@anchor{gnat_rm/the_implementation_of_standard_i_o stream-pointer-positioning-2}@anchor{2be}@anchor{gnat_rm/the_implementation_of_standard_i_o id17}@anchor{2bf} @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{2ad,,Text_IO}). There is one additional +of stream pointer positioning (@ref{2a9,,Text_IO}). There is one additional case: If @code{Ada.Wide_Wide_Text_IO.Look_Ahead} reads a character outside the @@ -22085,7 +22155,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{2c4}@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files-2}@anchor{2c5} +@anchor{gnat_rm/the_implementation_of_standard_i_o id18}@anchor{2c0}@anchor{gnat_rm/the_implementation_of_standard_i_o reading-and-writing-non-regular-files-2}@anchor{2c1} @subsection Reading and Writing Non-Regular Files @@ -22096,7 +22166,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{2c6}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-io}@anchor{2c7} +@anchor{gnat_rm/the_implementation_of_standard_i_o id19}@anchor{2c2}@anchor{gnat_rm/the_implementation_of_standard_i_o stream-io}@anchor{2c3} @section Stream_IO @@ -22118,7 +22188,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{2c8}@anchor{gnat_rm/the_implementation_of_standard_i_o text-translation}@anchor{2c9} +@anchor{gnat_rm/the_implementation_of_standard_i_o id20}@anchor{2c4}@anchor{gnat_rm/the_implementation_of_standard_i_o text-translation}@anchor{2c5} @section Text Translation @@ -22152,7 +22222,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{2ca}@anchor{gnat_rm/the_implementation_of_standard_i_o shared-files}@anchor{2cb} +@anchor{gnat_rm/the_implementation_of_standard_i_o id21}@anchor{2c6}@anchor{gnat_rm/the_implementation_of_standard_i_o shared-files}@anchor{2c7} @section Shared Files @@ -22215,7 +22285,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{2cc}@anchor{gnat_rm/the_implementation_of_standard_i_o id22}@anchor{2cd} +@anchor{gnat_rm/the_implementation_of_standard_i_o filenames-encoding}@anchor{2c8}@anchor{gnat_rm/the_implementation_of_standard_i_o id22}@anchor{2c9} @section Filenames encoding @@ -22255,7 +22325,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{2ce}@anchor{gnat_rm/the_implementation_of_standard_i_o id23}@anchor{2cf} +@anchor{gnat_rm/the_implementation_of_standard_i_o file-content-encoding}@anchor{2ca}@anchor{gnat_rm/the_implementation_of_standard_i_o id23}@anchor{2cb} @section File content encoding @@ -22288,7 +22358,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 open-modes}@anchor{2d0}@anchor{gnat_rm/the_implementation_of_standard_i_o id24}@anchor{2d1} +@anchor{gnat_rm/the_implementation_of_standard_i_o open-modes}@anchor{2cc}@anchor{gnat_rm/the_implementation_of_standard_i_o id24}@anchor{2cd} @section Open Modes @@ -22391,7 +22461,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 operations-on-c-streams}@anchor{2d2}@anchor{gnat_rm/the_implementation_of_standard_i_o id25}@anchor{2d3} +@anchor{gnat_rm/the_implementation_of_standard_i_o operations-on-c-streams}@anchor{2ce}@anchor{gnat_rm/the_implementation_of_standard_i_o id25}@anchor{2cf} @section Operations on C Streams @@ -22551,7 +22621,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 interfacing-to-c-streams}@anchor{2d4}@anchor{gnat_rm/the_implementation_of_standard_i_o id26}@anchor{2d5} +@anchor{gnat_rm/the_implementation_of_standard_i_o interfacing-to-c-streams}@anchor{2d0}@anchor{gnat_rm/the_implementation_of_standard_i_o id26}@anchor{2d1} @section Interfacing to C Streams @@ -22644,7 +22714,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 the-gnat-library}@anchor{10}@anchor{gnat_rm/the_gnat_library doc}@anchor{2d6}@anchor{gnat_rm/the_gnat_library id1}@anchor{2d7} +@anchor{gnat_rm/the_gnat_library the-gnat-library}@anchor{10}@anchor{gnat_rm/the_gnat_library doc}@anchor{2d2}@anchor{gnat_rm/the_gnat_library id1}@anchor{2d3} @chapter The GNAT Library @@ -22838,7 +22908,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 id2}@anchor{2d8}@anchor{gnat_rm/the_gnat_library ada-characters-latin-9-a-chlat9-ads}@anchor{2d9} +@anchor{gnat_rm/the_gnat_library id2}@anchor{2d4}@anchor{gnat_rm/the_gnat_library ada-characters-latin-9-a-chlat9-ads}@anchor{2d5} @section @code{Ada.Characters.Latin_9} (@code{a-chlat9.ads}) @@ -22855,7 +22925,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-cwila1 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{2da}@anchor{gnat_rm/the_gnat_library id3}@anchor{2db} +@anchor{gnat_rm/the_gnat_library ada-characters-wide-latin-1-a-cwila1-ads}@anchor{2d6}@anchor{gnat_rm/the_gnat_library id3}@anchor{2d7} @section @code{Ada.Characters.Wide_Latin_1} (@code{a-cwila1.ads}) @@ -22872,7 +22942,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Characters Wide_Latin_9 a-cwila1 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 id4}@anchor{2dc}@anchor{gnat_rm/the_gnat_library ada-characters-wide-latin-9-a-cwila1-ads}@anchor{2dd} +@anchor{gnat_rm/the_gnat_library id4}@anchor{2d8}@anchor{gnat_rm/the_gnat_library ada-characters-wide-latin-9-a-cwila1-ads}@anchor{2d9} @section @code{Ada.Characters.Wide_Latin_9} (@code{a-cwila1.ads}) @@ -22889,7 +22959,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-cwila1 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-characters-wide-wide-latin-1-a-chzla1-ads}@anchor{2de}@anchor{gnat_rm/the_gnat_library id5}@anchor{2df} +@anchor{gnat_rm/the_gnat_library ada-characters-wide-wide-latin-1-a-chzla1-ads}@anchor{2da}@anchor{gnat_rm/the_gnat_library id5}@anchor{2db} @section @code{Ada.Characters.Wide_Wide_Latin_1} (@code{a-chzla1.ads}) @@ -22906,7 +22976,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 Formal_Doubly_Linked_Lists a-cfdlli 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{2e0}@anchor{gnat_rm/the_gnat_library id6}@anchor{2e1} +@anchor{gnat_rm/the_gnat_library ada-characters-wide-wide-latin-9-a-chzla9-ads}@anchor{2dc}@anchor{gnat_rm/the_gnat_library id6}@anchor{2dd} @section @code{Ada.Characters.Wide_Wide_Latin_9} (@code{a-chzla9.ads}) @@ -22923,7 +22993,7 @@ is specifically authorized by the Ada Reference Manual (RM A.3.3(27)). @node Ada Containers Formal_Doubly_Linked_Lists a-cfdlli ads,Ada Containers Formal_Hashed_Maps a-cfhama ads,Ada Characters Wide_Wide_Latin_9 a-chzla9 ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id7}@anchor{2e2}@anchor{gnat_rm/the_gnat_library ada-containers-formal-doubly-linked-lists-a-cfdlli-ads}@anchor{2e3} +@anchor{gnat_rm/the_gnat_library id7}@anchor{2de}@anchor{gnat_rm/the_gnat_library ada-containers-formal-doubly-linked-lists-a-cfdlli-ads}@anchor{2df} @section @code{Ada.Containers.Formal_Doubly_Linked_Lists} (@code{a-cfdlli.ads}) @@ -22942,7 +23012,7 @@ efficient version than the one defined in the standard. In particular it does not have the complex overhead required to detect cursor tampering. @node Ada Containers Formal_Hashed_Maps a-cfhama ads,Ada Containers Formal_Hashed_Sets a-cfhase ads,Ada Containers Formal_Doubly_Linked_Lists a-cfdlli ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id8}@anchor{2e4}@anchor{gnat_rm/the_gnat_library ada-containers-formal-hashed-maps-a-cfhama-ads}@anchor{2e5} +@anchor{gnat_rm/the_gnat_library id8}@anchor{2e0}@anchor{gnat_rm/the_gnat_library ada-containers-formal-hashed-maps-a-cfhama-ads}@anchor{2e1} @section @code{Ada.Containers.Formal_Hashed_Maps} (@code{a-cfhama.ads}) @@ -22961,7 +23031,7 @@ efficient version than the one defined in the standard. In particular it does not have the complex overhead required to detect cursor tampering. @node Ada Containers Formal_Hashed_Sets a-cfhase ads,Ada Containers Formal_Ordered_Maps a-cforma ads,Ada Containers Formal_Hashed_Maps a-cfhama ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id9}@anchor{2e6}@anchor{gnat_rm/the_gnat_library ada-containers-formal-hashed-sets-a-cfhase-ads}@anchor{2e7} +@anchor{gnat_rm/the_gnat_library id9}@anchor{2e2}@anchor{gnat_rm/the_gnat_library ada-containers-formal-hashed-sets-a-cfhase-ads}@anchor{2e3} @section @code{Ada.Containers.Formal_Hashed_Sets} (@code{a-cfhase.ads}) @@ -22980,7 +23050,7 @@ efficient version than the one defined in the standard. In particular it does not have the complex overhead required to detect cursor tampering. @node Ada Containers Formal_Ordered_Maps a-cforma ads,Ada Containers Formal_Ordered_Sets a-cforse ads,Ada Containers Formal_Hashed_Sets a-cfhase ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id10}@anchor{2e8}@anchor{gnat_rm/the_gnat_library ada-containers-formal-ordered-maps-a-cforma-ads}@anchor{2e9} +@anchor{gnat_rm/the_gnat_library id10}@anchor{2e4}@anchor{gnat_rm/the_gnat_library ada-containers-formal-ordered-maps-a-cforma-ads}@anchor{2e5} @section @code{Ada.Containers.Formal_Ordered_Maps} (@code{a-cforma.ads}) @@ -22999,7 +23069,7 @@ efficient version than the one defined in the standard. In particular it does not have the complex overhead required to detect cursor tampering. @node Ada Containers Formal_Ordered_Sets a-cforse ads,Ada Containers Formal_Vectors a-cofove ads,Ada Containers Formal_Ordered_Maps a-cforma ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-containers-formal-ordered-sets-a-cforse-ads}@anchor{2ea}@anchor{gnat_rm/the_gnat_library id11}@anchor{2eb} +@anchor{gnat_rm/the_gnat_library ada-containers-formal-ordered-sets-a-cforse-ads}@anchor{2e6}@anchor{gnat_rm/the_gnat_library id11}@anchor{2e7} @section @code{Ada.Containers.Formal_Ordered_Sets} (@code{a-cforse.ads}) @@ -23018,7 +23088,7 @@ efficient version than the one defined in the standard. In particular it does not have the complex overhead required to detect cursor tampering. @node Ada Containers Formal_Vectors a-cofove ads,Ada Containers Formal_Indefinite_Vectors a-cfinve ads,Ada Containers Formal_Ordered_Sets a-cforse ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id12}@anchor{2ec}@anchor{gnat_rm/the_gnat_library ada-containers-formal-vectors-a-cofove-ads}@anchor{2ed} +@anchor{gnat_rm/the_gnat_library id12}@anchor{2e8}@anchor{gnat_rm/the_gnat_library ada-containers-formal-vectors-a-cofove-ads}@anchor{2e9} @section @code{Ada.Containers.Formal_Vectors} (@code{a-cofove.ads}) @@ -23037,7 +23107,7 @@ efficient version than the one defined in the standard. In particular it does not have the complex overhead required to detect cursor tampering. @node Ada Containers Formal_Indefinite_Vectors a-cfinve ads,Ada Containers Functional_Vectors a-cofuve ads,Ada Containers Formal_Vectors a-cofove ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id13}@anchor{2ee}@anchor{gnat_rm/the_gnat_library ada-containers-formal-indefinite-vectors-a-cfinve-ads}@anchor{2ef} +@anchor{gnat_rm/the_gnat_library id13}@anchor{2ea}@anchor{gnat_rm/the_gnat_library ada-containers-formal-indefinite-vectors-a-cfinve-ads}@anchor{2eb} @section @code{Ada.Containers.Formal_Indefinite_Vectors} (@code{a-cfinve.ads}) @@ -23056,7 +23126,7 @@ efficient version than the one defined in the standard. In particular it does not have the complex overhead required to detect cursor tampering. @node Ada Containers Functional_Vectors a-cofuve ads,Ada Containers Functional_Sets a-cofuse ads,Ada Containers Formal_Indefinite_Vectors a-cfinve ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id14}@anchor{2f0}@anchor{gnat_rm/the_gnat_library ada-containers-functional-vectors-a-cofuve-ads}@anchor{2f1} +@anchor{gnat_rm/the_gnat_library id14}@anchor{2ec}@anchor{gnat_rm/the_gnat_library ada-containers-functional-vectors-a-cofuve-ads}@anchor{2ed} @section @code{Ada.Containers.Functional_Vectors} (@code{a-cofuve.ads}) @@ -23078,7 +23148,7 @@ and annotations, so that they can be removed from the final executable. The specification of this unit is compatible with SPARK 2014. @node Ada Containers Functional_Sets a-cofuse ads,Ada Containers Functional_Maps a-cofuma ads,Ada Containers Functional_Vectors a-cofuve ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-containers-functional-sets-a-cofuse-ads}@anchor{2f2}@anchor{gnat_rm/the_gnat_library id15}@anchor{2f3} +@anchor{gnat_rm/the_gnat_library ada-containers-functional-sets-a-cofuse-ads}@anchor{2ee}@anchor{gnat_rm/the_gnat_library id15}@anchor{2ef} @section @code{Ada.Containers.Functional_Sets} (@code{a-cofuse.ads}) @@ -23100,7 +23170,7 @@ and annotations, so that they can be removed from the final executable. The specification of this unit is compatible with SPARK 2014. @node Ada Containers Functional_Maps a-cofuma ads,Ada Containers Bounded_Holders a-coboho ads,Ada Containers Functional_Sets a-cofuse ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id16}@anchor{2f4}@anchor{gnat_rm/the_gnat_library ada-containers-functional-maps-a-cofuma-ads}@anchor{2f5} +@anchor{gnat_rm/the_gnat_library id16}@anchor{2f0}@anchor{gnat_rm/the_gnat_library ada-containers-functional-maps-a-cofuma-ads}@anchor{2f1} @section @code{Ada.Containers.Functional_Maps} (@code{a-cofuma.ads}) @@ -23122,7 +23192,7 @@ and annotations, so that they can be removed from the final executable. The specification of this unit is compatible with SPARK 2014. @node Ada Containers Bounded_Holders a-coboho ads,Ada Command_Line Environment a-colien ads,Ada Containers Functional_Maps a-cofuma ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library ada-containers-bounded-holders-a-coboho-ads}@anchor{2f6}@anchor{gnat_rm/the_gnat_library id17}@anchor{2f7} +@anchor{gnat_rm/the_gnat_library ada-containers-bounded-holders-a-coboho-ads}@anchor{2f2}@anchor{gnat_rm/the_gnat_library id17}@anchor{2f3} @section @code{Ada.Containers.Bounded_Holders} (@code{a-coboho.ads}) @@ -23134,7 +23204,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{2f8}@anchor{gnat_rm/the_gnat_library id18}@anchor{2f9} +@anchor{gnat_rm/the_gnat_library ada-command-line-environment-a-colien-ads}@anchor{2f4}@anchor{gnat_rm/the_gnat_library id18}@anchor{2f5} @section @code{Ada.Command_Line.Environment} (@code{a-colien.ads}) @@ -23147,7 +23217,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 id19}@anchor{2fa}@anchor{gnat_rm/the_gnat_library ada-command-line-remove-a-colire-ads}@anchor{2fb} +@anchor{gnat_rm/the_gnat_library id19}@anchor{2f6}@anchor{gnat_rm/the_gnat_library ada-command-line-remove-a-colire-ads}@anchor{2f7} @section @code{Ada.Command_Line.Remove} (@code{a-colire.ads}) @@ -23165,7 +23235,7 @@ to further calls on the subprograms in @code{Ada.Command_Line} 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 id20}@anchor{2fc}@anchor{gnat_rm/the_gnat_library ada-command-line-response-file-a-clrefi-ads}@anchor{2fd} +@anchor{gnat_rm/the_gnat_library id20}@anchor{2f8}@anchor{gnat_rm/the_gnat_library ada-command-line-response-file-a-clrefi-ads}@anchor{2f9} @section @code{Ada.Command_Line.Response_File} (@code{a-clrefi.ads}) @@ -23185,7 +23255,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 id21}@anchor{2fe}@anchor{gnat_rm/the_gnat_library ada-direct-io-c-streams-a-diocst-ads}@anchor{2ff} +@anchor{gnat_rm/the_gnat_library id21}@anchor{2fa}@anchor{gnat_rm/the_gnat_library ada-direct-io-c-streams-a-diocst-ads}@anchor{2fb} @section @code{Ada.Direct_IO.C_Streams} (@code{a-diocst.ads}) @@ -23200,7 +23270,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 id22}@anchor{300}@anchor{gnat_rm/the_gnat_library ada-exceptions-is-null-occurrence-a-einuoc-ads}@anchor{301} +@anchor{gnat_rm/the_gnat_library id22}@anchor{2fc}@anchor{gnat_rm/the_gnat_library ada-exceptions-is-null-occurrence-a-einuoc-ads}@anchor{2fd} @section @code{Ada.Exceptions.Is_Null_Occurrence} (@code{a-einuoc.ads}) @@ -23214,7 +23284,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 id23}@anchor{302}@anchor{gnat_rm/the_gnat_library ada-exceptions-last-chance-handler-a-elchha-ads}@anchor{303} +@anchor{gnat_rm/the_gnat_library id23}@anchor{2fe}@anchor{gnat_rm/the_gnat_library ada-exceptions-last-chance-handler-a-elchha-ads}@anchor{2ff} @section @code{Ada.Exceptions.Last_Chance_Handler} (@code{a-elchha.ads}) @@ -23228,7 +23298,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{304}@anchor{gnat_rm/the_gnat_library id24}@anchor{305} +@anchor{gnat_rm/the_gnat_library ada-exceptions-traceback-a-exctra-ads}@anchor{300}@anchor{gnat_rm/the_gnat_library id24}@anchor{301} @section @code{Ada.Exceptions.Traceback} (@code{a-exctra.ads}) @@ -23241,7 +23311,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{306}@anchor{gnat_rm/the_gnat_library id25}@anchor{307} +@anchor{gnat_rm/the_gnat_library ada-sequential-io-c-streams-a-siocst-ads}@anchor{302}@anchor{gnat_rm/the_gnat_library id25}@anchor{303} @section @code{Ada.Sequential_IO.C_Streams} (@code{a-siocst.ads}) @@ -23256,7 +23326,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 id26}@anchor{308}@anchor{gnat_rm/the_gnat_library ada-streams-stream-io-c-streams-a-ssicst-ads}@anchor{309} +@anchor{gnat_rm/the_gnat_library id26}@anchor{304}@anchor{gnat_rm/the_gnat_library ada-streams-stream-io-c-streams-a-ssicst-ads}@anchor{305} @section @code{Ada.Streams.Stream_IO.C_Streams} (@code{a-ssicst.ads}) @@ -23271,7 +23341,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{30a}@anchor{gnat_rm/the_gnat_library id27}@anchor{30b} +@anchor{gnat_rm/the_gnat_library ada-strings-unbounded-text-io-a-suteio-ads}@anchor{306}@anchor{gnat_rm/the_gnat_library id27}@anchor{307} @section @code{Ada.Strings.Unbounded.Text_IO} (@code{a-suteio.ads}) @@ -23288,7 +23358,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 id28}@anchor{30c}@anchor{gnat_rm/the_gnat_library ada-strings-wide-unbounded-wide-text-io-a-swuwti-ads}@anchor{30d} +@anchor{gnat_rm/the_gnat_library id28}@anchor{308}@anchor{gnat_rm/the_gnat_library ada-strings-wide-unbounded-wide-text-io-a-swuwti-ads}@anchor{309} @section @code{Ada.Strings.Wide_Unbounded.Wide_Text_IO} (@code{a-swuwti.ads}) @@ -23305,7 +23375,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 id29}@anchor{30e}@anchor{gnat_rm/the_gnat_library ada-strings-wide-wide-unbounded-wide-wide-text-io-a-szuzti-ads}@anchor{30f} +@anchor{gnat_rm/the_gnat_library id29}@anchor{30a}@anchor{gnat_rm/the_gnat_library ada-strings-wide-wide-unbounded-wide-wide-text-io-a-szuzti-ads}@anchor{30b} @section @code{Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO} (@code{a-szuzti.ads}) @@ -23322,7 +23392,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{310}@anchor{gnat_rm/the_gnat_library id30}@anchor{311} +@anchor{gnat_rm/the_gnat_library ada-task-initialization-a-tasini-ads}@anchor{30c}@anchor{gnat_rm/the_gnat_library id30}@anchor{30d} @section @code{Ada.Task_Initialization} (@code{a-tasini.ads}) @@ -23334,7 +23404,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{312}@anchor{gnat_rm/the_gnat_library id31}@anchor{313} +@anchor{gnat_rm/the_gnat_library ada-text-io-c-streams-a-tiocst-ads}@anchor{30e}@anchor{gnat_rm/the_gnat_library id31}@anchor{30f} @section @code{Ada.Text_IO.C_Streams} (@code{a-tiocst.ads}) @@ -23349,7 +23419,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{314}@anchor{gnat_rm/the_gnat_library id32}@anchor{315} +@anchor{gnat_rm/the_gnat_library ada-text-io-reset-standard-files-a-tirsfi-ads}@anchor{310}@anchor{gnat_rm/the_gnat_library id32}@anchor{311} @section @code{Ada.Text_IO.Reset_Standard_Files} (@code{a-tirsfi.ads}) @@ -23364,7 +23434,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 id33}@anchor{316}@anchor{gnat_rm/the_gnat_library ada-wide-characters-unicode-a-wichun-ads}@anchor{317} +@anchor{gnat_rm/the_gnat_library id33}@anchor{312}@anchor{gnat_rm/the_gnat_library ada-wide-characters-unicode-a-wichun-ads}@anchor{313} @section @code{Ada.Wide_Characters.Unicode} (@code{a-wichun.ads}) @@ -23377,7 +23447,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 id34}@anchor{318}@anchor{gnat_rm/the_gnat_library ada-wide-text-io-c-streams-a-wtcstr-ads}@anchor{319} +@anchor{gnat_rm/the_gnat_library id34}@anchor{314}@anchor{gnat_rm/the_gnat_library ada-wide-text-io-c-streams-a-wtcstr-ads}@anchor{315} @section @code{Ada.Wide_Text_IO.C_Streams} (@code{a-wtcstr.ads}) @@ -23392,7 +23462,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{31a}@anchor{gnat_rm/the_gnat_library id35}@anchor{31b} +@anchor{gnat_rm/the_gnat_library ada-wide-text-io-reset-standard-files-a-wrstfi-ads}@anchor{316}@anchor{gnat_rm/the_gnat_library id35}@anchor{317} @section @code{Ada.Wide_Text_IO.Reset_Standard_Files} (@code{a-wrstfi.ads}) @@ -23407,7 +23477,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 id36}@anchor{31c}@anchor{gnat_rm/the_gnat_library ada-wide-wide-characters-unicode-a-zchuni-ads}@anchor{31d} +@anchor{gnat_rm/the_gnat_library id36}@anchor{318}@anchor{gnat_rm/the_gnat_library ada-wide-wide-characters-unicode-a-zchuni-ads}@anchor{319} @section @code{Ada.Wide_Wide_Characters.Unicode} (@code{a-zchuni.ads}) @@ -23420,7 +23490,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 id37}@anchor{31e}@anchor{gnat_rm/the_gnat_library ada-wide-wide-text-io-c-streams-a-ztcstr-ads}@anchor{31f} +@anchor{gnat_rm/the_gnat_library id37}@anchor{31a}@anchor{gnat_rm/the_gnat_library ada-wide-wide-text-io-c-streams-a-ztcstr-ads}@anchor{31b} @section @code{Ada.Wide_Wide_Text_IO.C_Streams} (@code{a-ztcstr.ads}) @@ -23435,7 +23505,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{320}@anchor{gnat_rm/the_gnat_library id38}@anchor{321} +@anchor{gnat_rm/the_gnat_library ada-wide-wide-text-io-reset-standard-files-a-zrstfi-ads}@anchor{31c}@anchor{gnat_rm/the_gnat_library id38}@anchor{31d} @section @code{Ada.Wide_Wide_Text_IO.Reset_Standard_Files} (@code{a-zrstfi.ads}) @@ -23450,7 +23520,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{322}@anchor{gnat_rm/the_gnat_library id39}@anchor{323} +@anchor{gnat_rm/the_gnat_library gnat-altivec-g-altive-ads}@anchor{31e}@anchor{gnat_rm/the_gnat_library id39}@anchor{31f} @section @code{GNAT.Altivec} (@code{g-altive.ads}) @@ -23463,7 +23533,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{324}@anchor{gnat_rm/the_gnat_library id40}@anchor{325} +@anchor{gnat_rm/the_gnat_library gnat-altivec-conversions-g-altcon-ads}@anchor{320}@anchor{gnat_rm/the_gnat_library id40}@anchor{321} @section @code{GNAT.Altivec.Conversions} (@code{g-altcon.ads}) @@ -23474,7 +23544,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 id41}@anchor{326}@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-operations-g-alveop-ads}@anchor{327} +@anchor{gnat_rm/the_gnat_library id41}@anchor{322}@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-operations-g-alveop-ads}@anchor{323} @section @code{GNAT.Altivec.Vector_Operations} (@code{g-alveop.ads}) @@ -23488,7 +23558,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{328}@anchor{gnat_rm/the_gnat_library id42}@anchor{329} +@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-types-g-alvety-ads}@anchor{324}@anchor{gnat_rm/the_gnat_library id42}@anchor{325} @section @code{GNAT.Altivec.Vector_Types} (@code{g-alvety.ads}) @@ -23500,7 +23570,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{32a}@anchor{gnat_rm/the_gnat_library id43}@anchor{32b} +@anchor{gnat_rm/the_gnat_library gnat-altivec-vector-views-g-alvevi-ads}@anchor{326}@anchor{gnat_rm/the_gnat_library id43}@anchor{327} @section @code{GNAT.Altivec.Vector_Views} (@code{g-alvevi.ads}) @@ -23515,7 +23585,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{32c}@anchor{gnat_rm/the_gnat_library id44}@anchor{32d} +@anchor{gnat_rm/the_gnat_library gnat-array-split-g-arrspl-ads}@anchor{328}@anchor{gnat_rm/the_gnat_library id44}@anchor{329} @section @code{GNAT.Array_Split} (@code{g-arrspl.ads}) @@ -23528,7 +23598,7 @@ an array wherever the separators appear, and provide direct access to the resulting slices. @node GNAT AWK g-awk ads,GNAT Bind_Environment g-binenv ads,GNAT Array_Split g-arrspl ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id45}@anchor{32e}@anchor{gnat_rm/the_gnat_library gnat-awk-g-awk-ads}@anchor{32f} +@anchor{gnat_rm/the_gnat_library id45}@anchor{32a}@anchor{gnat_rm/the_gnat_library gnat-awk-g-awk-ads}@anchor{32b} @section @code{GNAT.AWK} (@code{g-awk.ads}) @@ -23543,7 +23613,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 Bind_Environment g-binenv ads,GNAT Branch_Prediction g-brapre ads,GNAT AWK g-awk ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id46}@anchor{330}@anchor{gnat_rm/the_gnat_library gnat-bind-environment-g-binenv-ads}@anchor{331} +@anchor{gnat_rm/the_gnat_library id46}@anchor{32c}@anchor{gnat_rm/the_gnat_library gnat-bind-environment-g-binenv-ads}@anchor{32d} @section @code{GNAT.Bind_Environment} (@code{g-binenv.ads}) @@ -23556,7 +23626,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 id47}@anchor{332}@anchor{gnat_rm/the_gnat_library gnat-branch-prediction-g-brapre-ads}@anchor{333} +@anchor{gnat_rm/the_gnat_library id47}@anchor{32e}@anchor{gnat_rm/the_gnat_library gnat-branch-prediction-g-brapre-ads}@anchor{32f} @section @code{GNAT.Branch_Prediction} (@code{g-brapre.ads}) @@ -23567,7 +23637,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{334}@anchor{gnat_rm/the_gnat_library id48}@anchor{335} +@anchor{gnat_rm/the_gnat_library gnat-bounded-buffers-g-boubuf-ads}@anchor{330}@anchor{gnat_rm/the_gnat_library id48}@anchor{331} @section @code{GNAT.Bounded_Buffers} (@code{g-boubuf.ads}) @@ -23582,7 +23652,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{336}@anchor{gnat_rm/the_gnat_library id49}@anchor{337} +@anchor{gnat_rm/the_gnat_library gnat-bounded-mailboxes-g-boumai-ads}@anchor{332}@anchor{gnat_rm/the_gnat_library id49}@anchor{333} @section @code{GNAT.Bounded_Mailboxes} (@code{g-boumai.ads}) @@ -23595,7 +23665,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{338}@anchor{gnat_rm/the_gnat_library id50}@anchor{339} +@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-g-bubsor-ads}@anchor{334}@anchor{gnat_rm/the_gnat_library id50}@anchor{335} @section @code{GNAT.Bubble_Sort} (@code{g-bubsor.ads}) @@ -23610,7 +23680,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 id51}@anchor{33a}@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-a-g-busora-ads}@anchor{33b} +@anchor{gnat_rm/the_gnat_library id51}@anchor{336}@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-a-g-busora-ads}@anchor{337} @section @code{GNAT.Bubble_Sort_A} (@code{g-busora.ads}) @@ -23626,7 +23696,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{33c}@anchor{gnat_rm/the_gnat_library id52}@anchor{33d} +@anchor{gnat_rm/the_gnat_library gnat-bubble-sort-g-g-busorg-ads}@anchor{338}@anchor{gnat_rm/the_gnat_library id52}@anchor{339} @section @code{GNAT.Bubble_Sort_G} (@code{g-busorg.ads}) @@ -23642,7 +23712,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{33e}@anchor{gnat_rm/the_gnat_library id53}@anchor{33f} +@anchor{gnat_rm/the_gnat_library gnat-byte-order-mark-g-byorma-ads}@anchor{33a}@anchor{gnat_rm/the_gnat_library id53}@anchor{33b} @section @code{GNAT.Byte_Order_Mark} (@code{g-byorma.ads}) @@ -23658,7 +23728,7 @@ 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{340}@anchor{gnat_rm/the_gnat_library id54}@anchor{341} +@anchor{gnat_rm/the_gnat_library gnat-byte-swapping-g-bytswa-ads}@anchor{33c}@anchor{gnat_rm/the_gnat_library id54}@anchor{33d} @section @code{GNAT.Byte_Swapping} (@code{g-bytswa.ads}) @@ -23672,7 +23742,7 @@ 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 id55}@anchor{342}@anchor{gnat_rm/the_gnat_library gnat-calendar-g-calend-ads}@anchor{343} +@anchor{gnat_rm/the_gnat_library id55}@anchor{33e}@anchor{gnat_rm/the_gnat_library gnat-calendar-g-calend-ads}@anchor{33f} @section @code{GNAT.Calendar} (@code{g-calend.ads}) @@ -23686,7 +23756,7 @@ 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 id56}@anchor{344}@anchor{gnat_rm/the_gnat_library gnat-calendar-time-io-g-catiio-ads}@anchor{345} +@anchor{gnat_rm/the_gnat_library id56}@anchor{340}@anchor{gnat_rm/the_gnat_library gnat-calendar-time-io-g-catiio-ads}@anchor{341} @section @code{GNAT.Calendar.Time_IO} (@code{g-catiio.ads}) @@ -23697,7 +23767,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 id57}@anchor{346}@anchor{gnat_rm/the_gnat_library gnat-crc32-g-crc32-ads}@anchor{347} +@anchor{gnat_rm/the_gnat_library id57}@anchor{342}@anchor{gnat_rm/the_gnat_library gnat-crc32-g-crc32-ads}@anchor{343} @section @code{GNAT.CRC32} (@code{g-crc32.ads}) @@ -23714,7 +23784,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 id58}@anchor{348}@anchor{gnat_rm/the_gnat_library gnat-case-util-g-casuti-ads}@anchor{349} +@anchor{gnat_rm/the_gnat_library id58}@anchor{344}@anchor{gnat_rm/the_gnat_library gnat-case-util-g-casuti-ads}@anchor{345} @section @code{GNAT.Case_Util} (@code{g-casuti.ads}) @@ -23729,7 +23799,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 id59}@anchor{34a}@anchor{gnat_rm/the_gnat_library gnat-cgi-g-cgi-ads}@anchor{34b} +@anchor{gnat_rm/the_gnat_library id59}@anchor{346}@anchor{gnat_rm/the_gnat_library gnat-cgi-g-cgi-ads}@anchor{347} @section @code{GNAT.CGI} (@code{g-cgi.ads}) @@ -23744,7 +23814,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{34c}@anchor{gnat_rm/the_gnat_library id60}@anchor{34d} +@anchor{gnat_rm/the_gnat_library gnat-cgi-cookie-g-cgicoo-ads}@anchor{348}@anchor{gnat_rm/the_gnat_library id60}@anchor{349} @section @code{GNAT.CGI.Cookie} (@code{g-cgicoo.ads}) @@ -23759,7 +23829,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{34e}@anchor{gnat_rm/the_gnat_library id61}@anchor{34f} +@anchor{gnat_rm/the_gnat_library gnat-cgi-debug-g-cgideb-ads}@anchor{34a}@anchor{gnat_rm/the_gnat_library id61}@anchor{34b} @section @code{GNAT.CGI.Debug} (@code{g-cgideb.ads}) @@ -23771,7 +23841,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 id62}@anchor{350}@anchor{gnat_rm/the_gnat_library gnat-command-line-g-comlin-ads}@anchor{351} +@anchor{gnat_rm/the_gnat_library id62}@anchor{34c}@anchor{gnat_rm/the_gnat_library gnat-command-line-g-comlin-ads}@anchor{34d} @section @code{GNAT.Command_Line} (@code{g-comlin.ads}) @@ -23784,7 +23854,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{352}@anchor{gnat_rm/the_gnat_library id63}@anchor{353} +@anchor{gnat_rm/the_gnat_library gnat-compiler-version-g-comver-ads}@anchor{34e}@anchor{gnat_rm/the_gnat_library id63}@anchor{34f} @section @code{GNAT.Compiler_Version} (@code{g-comver.ads}) @@ -23802,7 +23872,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 id64}@anchor{354}@anchor{gnat_rm/the_gnat_library gnat-ctrl-c-g-ctrl-c-ads}@anchor{355} +@anchor{gnat_rm/the_gnat_library id64}@anchor{350}@anchor{gnat_rm/the_gnat_library gnat-ctrl-c-g-ctrl-c-ads}@anchor{351} @section @code{GNAT.Ctrl_C} (@code{g-ctrl_c.ads}) @@ -23813,7 +23883,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 id65}@anchor{356}@anchor{gnat_rm/the_gnat_library gnat-current-exception-g-curexc-ads}@anchor{357} +@anchor{gnat_rm/the_gnat_library id65}@anchor{352}@anchor{gnat_rm/the_gnat_library gnat-current-exception-g-curexc-ads}@anchor{353} @section @code{GNAT.Current_Exception} (@code{g-curexc.ads}) @@ -23830,7 +23900,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{358}@anchor{gnat_rm/the_gnat_library id66}@anchor{359} +@anchor{gnat_rm/the_gnat_library gnat-debug-pools-g-debpoo-ads}@anchor{354}@anchor{gnat_rm/the_gnat_library id66}@anchor{355} @section @code{GNAT.Debug_Pools} (@code{g-debpoo.ads}) @@ -23847,7 +23917,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{35a}@anchor{gnat_rm/the_gnat_library id67}@anchor{35b} +@anchor{gnat_rm/the_gnat_library gnat-debug-utilities-g-debuti-ads}@anchor{356}@anchor{gnat_rm/the_gnat_library id67}@anchor{357} @section @code{GNAT.Debug_Utilities} (@code{g-debuti.ads}) @@ -23860,7 +23930,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{35c}@anchor{gnat_rm/the_gnat_library id68}@anchor{35d} +@anchor{gnat_rm/the_gnat_library gnat-decode-string-g-decstr-ads}@anchor{358}@anchor{gnat_rm/the_gnat_library id68}@anchor{359} @section @code{GNAT.Decode_String} (@code{g-decstr.ads}) @@ -23884,7 +23954,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{35e}@anchor{gnat_rm/the_gnat_library id69}@anchor{35f} +@anchor{gnat_rm/the_gnat_library gnat-decode-utf8-string-g-deutst-ads}@anchor{35a}@anchor{gnat_rm/the_gnat_library id69}@anchor{35b} @section @code{GNAT.Decode_UTF8_String} (@code{g-deutst.ads}) @@ -23905,7 +23975,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 id70}@anchor{360}@anchor{gnat_rm/the_gnat_library gnat-directory-operations-g-dirope-ads}@anchor{361} +@anchor{gnat_rm/the_gnat_library id70}@anchor{35c}@anchor{gnat_rm/the_gnat_library gnat-directory-operations-g-dirope-ads}@anchor{35d} @section @code{GNAT.Directory_Operations} (@code{g-dirope.ads}) @@ -23918,7 +23988,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 id71}@anchor{362}@anchor{gnat_rm/the_gnat_library gnat-directory-operations-iteration-g-diopit-ads}@anchor{363} +@anchor{gnat_rm/the_gnat_library id71}@anchor{35e}@anchor{gnat_rm/the_gnat_library gnat-directory-operations-iteration-g-diopit-ads}@anchor{35f} @section @code{GNAT.Directory_Operations.Iteration} (@code{g-diopit.ads}) @@ -23930,7 +24000,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 id72}@anchor{364}@anchor{gnat_rm/the_gnat_library gnat-dynamic-htables-g-dynhta-ads}@anchor{365} +@anchor{gnat_rm/the_gnat_library id72}@anchor{360}@anchor{gnat_rm/the_gnat_library gnat-dynamic-htables-g-dynhta-ads}@anchor{361} @section @code{GNAT.Dynamic_HTables} (@code{g-dynhta.ads}) @@ -23948,7 +24018,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{366}@anchor{gnat_rm/the_gnat_library id73}@anchor{367} +@anchor{gnat_rm/the_gnat_library gnat-dynamic-tables-g-dyntab-ads}@anchor{362}@anchor{gnat_rm/the_gnat_library id73}@anchor{363} @section @code{GNAT.Dynamic_Tables} (@code{g-dyntab.ads}) @@ -23968,7 +24038,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 id74}@anchor{368}@anchor{gnat_rm/the_gnat_library gnat-encode-string-g-encstr-ads}@anchor{369} +@anchor{gnat_rm/the_gnat_library id74}@anchor{364}@anchor{gnat_rm/the_gnat_library gnat-encode-string-g-encstr-ads}@anchor{365} @section @code{GNAT.Encode_String} (@code{g-encstr.ads}) @@ -23990,7 +24060,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{36a}@anchor{gnat_rm/the_gnat_library id75}@anchor{36b} +@anchor{gnat_rm/the_gnat_library gnat-encode-utf8-string-g-enutst-ads}@anchor{366}@anchor{gnat_rm/the_gnat_library id75}@anchor{367} @section @code{GNAT.Encode_UTF8_String} (@code{g-enutst.ads}) @@ -24011,7 +24081,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{36c}@anchor{gnat_rm/the_gnat_library id76}@anchor{36d} +@anchor{gnat_rm/the_gnat_library gnat-exception-actions-g-excact-ads}@anchor{368}@anchor{gnat_rm/the_gnat_library id76}@anchor{369} @section @code{GNAT.Exception_Actions} (@code{g-excact.ads}) @@ -24024,7 +24094,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{36e}@anchor{gnat_rm/the_gnat_library id77}@anchor{36f} +@anchor{gnat_rm/the_gnat_library gnat-exception-traces-g-exctra-ads}@anchor{36a}@anchor{gnat_rm/the_gnat_library id77}@anchor{36b} @section @code{GNAT.Exception_Traces} (@code{g-exctra.ads}) @@ -24038,7 +24108,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 id78}@anchor{370}@anchor{gnat_rm/the_gnat_library gnat-exceptions-g-except-ads}@anchor{371} +@anchor{gnat_rm/the_gnat_library id78}@anchor{36c}@anchor{gnat_rm/the_gnat_library gnat-exceptions-g-except-ads}@anchor{36d} @section @code{GNAT.Exceptions} (@code{g-except.ads}) @@ -24059,7 +24129,7 @@ predefined exceptions, and for example allow 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 id79}@anchor{372}@anchor{gnat_rm/the_gnat_library gnat-expect-g-expect-ads}@anchor{373} +@anchor{gnat_rm/the_gnat_library id79}@anchor{36e}@anchor{gnat_rm/the_gnat_library gnat-expect-g-expect-ads}@anchor{36f} @section @code{GNAT.Expect} (@code{g-expect.ads}) @@ -24075,7 +24145,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 id80}@anchor{374}@anchor{gnat_rm/the_gnat_library gnat-expect-tty-g-exptty-ads}@anchor{375} +@anchor{gnat_rm/the_gnat_library id80}@anchor{370}@anchor{gnat_rm/the_gnat_library gnat-expect-tty-g-exptty-ads}@anchor{371} @section @code{GNAT.Expect.TTY} (@code{g-exptty.ads}) @@ -24087,7 +24157,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 id81}@anchor{376}@anchor{gnat_rm/the_gnat_library gnat-float-control-g-flocon-ads}@anchor{377} +@anchor{gnat_rm/the_gnat_library id81}@anchor{372}@anchor{gnat_rm/the_gnat_library gnat-float-control-g-flocon-ads}@anchor{373} @section @code{GNAT.Float_Control} (@code{g-flocon.ads}) @@ -24101,7 +24171,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 Heap_Sort g-heasor ads,GNAT Float_Control g-flocon ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id82}@anchor{378}@anchor{gnat_rm/the_gnat_library gnat-formatted-string-g-forstr-ads}@anchor{379} +@anchor{gnat_rm/the_gnat_library id82}@anchor{374}@anchor{gnat_rm/the_gnat_library gnat-formatted-string-g-forstr-ads}@anchor{375} @section @code{GNAT.Formatted_String} (@code{g-forstr.ads}) @@ -24116,7 +24186,7 @@ derived from Integer, Float or enumerations as values for the formatted string. @node GNAT Heap_Sort g-heasor ads,GNAT Heap_Sort_A g-hesora ads,GNAT Formatted_String g-forstr ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id83}@anchor{37a}@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-heasor-ads}@anchor{37b} +@anchor{gnat_rm/the_gnat_library id83}@anchor{376}@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-heasor-ads}@anchor{377} @section @code{GNAT.Heap_Sort} (@code{g-heasor.ads}) @@ -24130,7 +24200,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{37c}@anchor{gnat_rm/the_gnat_library id84}@anchor{37d} +@anchor{gnat_rm/the_gnat_library gnat-heap-sort-a-g-hesora-ads}@anchor{378}@anchor{gnat_rm/the_gnat_library id84}@anchor{379} @section @code{GNAT.Heap_Sort_A} (@code{g-hesora.ads}) @@ -24146,7 +24216,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 id85}@anchor{37e}@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-g-hesorg-ads}@anchor{37f} +@anchor{gnat_rm/the_gnat_library id85}@anchor{37a}@anchor{gnat_rm/the_gnat_library gnat-heap-sort-g-g-hesorg-ads}@anchor{37b} @section @code{GNAT.Heap_Sort_G} (@code{g-hesorg.ads}) @@ -24160,7 +24230,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 id86}@anchor{380}@anchor{gnat_rm/the_gnat_library gnat-htable-g-htable-ads}@anchor{381} +@anchor{gnat_rm/the_gnat_library id86}@anchor{37c}@anchor{gnat_rm/the_gnat_library gnat-htable-g-htable-ads}@anchor{37d} @section @code{GNAT.HTable} (@code{g-htable.ads}) @@ -24173,7 +24243,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 id87}@anchor{382}@anchor{gnat_rm/the_gnat_library gnat-io-g-io-ads}@anchor{383} +@anchor{gnat_rm/the_gnat_library id87}@anchor{37e}@anchor{gnat_rm/the_gnat_library gnat-io-g-io-ads}@anchor{37f} @section @code{GNAT.IO} (@code{g-io.ads}) @@ -24189,7 +24259,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 id88}@anchor{384}@anchor{gnat_rm/the_gnat_library gnat-io-aux-g-io-aux-ads}@anchor{385} +@anchor{gnat_rm/the_gnat_library id88}@anchor{380}@anchor{gnat_rm/the_gnat_library gnat-io-aux-g-io-aux-ads}@anchor{381} @section @code{GNAT.IO_Aux} (@code{g-io_aux.ads}) @@ -24203,7 +24273,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 id89}@anchor{386}@anchor{gnat_rm/the_gnat_library gnat-lock-files-g-locfil-ads}@anchor{387} +@anchor{gnat_rm/the_gnat_library id89}@anchor{382}@anchor{gnat_rm/the_gnat_library gnat-lock-files-g-locfil-ads}@anchor{383} @section @code{GNAT.Lock_Files} (@code{g-locfil.ads}) @@ -24217,7 +24287,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 id90}@anchor{388}@anchor{gnat_rm/the_gnat_library gnat-mbbs-discrete-random-g-mbdira-ads}@anchor{389} +@anchor{gnat_rm/the_gnat_library id90}@anchor{384}@anchor{gnat_rm/the_gnat_library gnat-mbbs-discrete-random-g-mbdira-ads}@anchor{385} @section @code{GNAT.MBBS_Discrete_Random} (@code{g-mbdira.ads}) @@ -24229,7 +24299,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 id91}@anchor{38a}@anchor{gnat_rm/the_gnat_library gnat-mbbs-float-random-g-mbflra-ads}@anchor{38b} +@anchor{gnat_rm/the_gnat_library id91}@anchor{386}@anchor{gnat_rm/the_gnat_library gnat-mbbs-float-random-g-mbflra-ads}@anchor{387} @section @code{GNAT.MBBS_Float_Random} (@code{g-mbflra.ads}) @@ -24241,7 +24311,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 id92}@anchor{38c}@anchor{gnat_rm/the_gnat_library gnat-md5-g-md5-ads}@anchor{38d} +@anchor{gnat_rm/the_gnat_library id92}@anchor{388}@anchor{gnat_rm/the_gnat_library gnat-md5-g-md5-ads}@anchor{389} @section @code{GNAT.MD5} (@code{g-md5.ads}) @@ -24254,7 +24324,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 id93}@anchor{38e}@anchor{gnat_rm/the_gnat_library gnat-memory-dump-g-memdum-ads}@anchor{38f} +@anchor{gnat_rm/the_gnat_library id93}@anchor{38a}@anchor{gnat_rm/the_gnat_library gnat-memory-dump-g-memdum-ads}@anchor{38b} @section @code{GNAT.Memory_Dump} (@code{g-memdum.ads}) @@ -24267,7 +24337,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{390}@anchor{gnat_rm/the_gnat_library id94}@anchor{391} +@anchor{gnat_rm/the_gnat_library gnat-most-recent-exception-g-moreex-ads}@anchor{38c}@anchor{gnat_rm/the_gnat_library id94}@anchor{38d} @section @code{GNAT.Most_Recent_Exception} (@code{g-moreex.ads}) @@ -24281,7 +24351,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{392}@anchor{gnat_rm/the_gnat_library id95}@anchor{393} +@anchor{gnat_rm/the_gnat_library gnat-os-lib-g-os-lib-ads}@anchor{38e}@anchor{gnat_rm/the_gnat_library id95}@anchor{38f} @section @code{GNAT.OS_Lib} (@code{g-os_lib.ads}) @@ -24297,7 +24367,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{394}@anchor{gnat_rm/the_gnat_library id96}@anchor{395} +@anchor{gnat_rm/the_gnat_library gnat-perfect-hash-generators-g-pehage-ads}@anchor{390}@anchor{gnat_rm/the_gnat_library id96}@anchor{391} @section @code{GNAT.Perfect_Hash_Generators} (@code{g-pehage.ads}) @@ -24315,7 +24385,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{396}@anchor{gnat_rm/the_gnat_library id97}@anchor{397} +@anchor{gnat_rm/the_gnat_library gnat-random-numbers-g-rannum-ads}@anchor{392}@anchor{gnat_rm/the_gnat_library id97}@anchor{393} @section @code{GNAT.Random_Numbers} (@code{g-rannum.ads}) @@ -24327,7 +24397,7 @@ Provides random number capabilities which extend those available in the standard Ada library and are more convenient to use. @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 id98}@anchor{398}@anchor{gnat_rm/the_gnat_library gnat-regexp-g-regexp-ads}@anchor{25d} +@anchor{gnat_rm/the_gnat_library id98}@anchor{394}@anchor{gnat_rm/the_gnat_library gnat-regexp-g-regexp-ads}@anchor{259} @section @code{GNAT.Regexp} (@code{g-regexp.ads}) @@ -24343,7 +24413,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 id99}@anchor{399}@anchor{gnat_rm/the_gnat_library gnat-registry-g-regist-ads}@anchor{39a} +@anchor{gnat_rm/the_gnat_library id99}@anchor{395}@anchor{gnat_rm/the_gnat_library gnat-registry-g-regist-ads}@anchor{396} @section @code{GNAT.Registry} (@code{g-regist.ads}) @@ -24357,7 +24427,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 id100}@anchor{39b}@anchor{gnat_rm/the_gnat_library gnat-regpat-g-regpat-ads}@anchor{39c} +@anchor{gnat_rm/the_gnat_library id100}@anchor{397}@anchor{gnat_rm/the_gnat_library gnat-regpat-g-regpat-ads}@anchor{398} @section @code{GNAT.Regpat} (@code{g-regpat.ads}) @@ -24372,7 +24442,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 id101}@anchor{39d}@anchor{gnat_rm/the_gnat_library gnat-rewrite-data-g-rewdat-ads}@anchor{39e} +@anchor{gnat_rm/the_gnat_library id101}@anchor{399}@anchor{gnat_rm/the_gnat_library gnat-rewrite-data-g-rewdat-ads}@anchor{39a} @section @code{GNAT.Rewrite_Data} (@code{g-rewdat.ads}) @@ -24386,7 +24456,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{39f}@anchor{gnat_rm/the_gnat_library id102}@anchor{3a0} +@anchor{gnat_rm/the_gnat_library gnat-secondary-stack-info-g-sestin-ads}@anchor{39b}@anchor{gnat_rm/the_gnat_library id102}@anchor{39c} @section @code{GNAT.Secondary_Stack_Info} (@code{g-sestin.ads}) @@ -24398,7 +24468,7 @@ Provide 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 id103}@anchor{3a1}@anchor{gnat_rm/the_gnat_library gnat-semaphores-g-semaph-ads}@anchor{3a2} +@anchor{gnat_rm/the_gnat_library id103}@anchor{39d}@anchor{gnat_rm/the_gnat_library gnat-semaphores-g-semaph-ads}@anchor{39e} @section @code{GNAT.Semaphores} (@code{g-semaph.ads}) @@ -24409,7 +24479,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{3a3}@anchor{gnat_rm/the_gnat_library id104}@anchor{3a4} +@anchor{gnat_rm/the_gnat_library gnat-serial-communications-g-sercom-ads}@anchor{39f}@anchor{gnat_rm/the_gnat_library id104}@anchor{3a0} @section @code{GNAT.Serial_Communications} (@code{g-sercom.ads}) @@ -24421,7 +24491,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{3a5}@anchor{gnat_rm/the_gnat_library id105}@anchor{3a6} +@anchor{gnat_rm/the_gnat_library gnat-sha1-g-sha1-ads}@anchor{3a1}@anchor{gnat_rm/the_gnat_library id105}@anchor{3a2} @section @code{GNAT.SHA1} (@code{g-sha1.ads}) @@ -24434,7 +24504,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{3a7}@anchor{gnat_rm/the_gnat_library id106}@anchor{3a8} +@anchor{gnat_rm/the_gnat_library gnat-sha224-g-sha224-ads}@anchor{3a3}@anchor{gnat_rm/the_gnat_library id106}@anchor{3a4} @section @code{GNAT.SHA224} (@code{g-sha224.ads}) @@ -24447,7 +24517,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{3a9}@anchor{gnat_rm/the_gnat_library id107}@anchor{3aa} +@anchor{gnat_rm/the_gnat_library gnat-sha256-g-sha256-ads}@anchor{3a5}@anchor{gnat_rm/the_gnat_library id107}@anchor{3a6} @section @code{GNAT.SHA256} (@code{g-sha256.ads}) @@ -24460,7 +24530,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 id108}@anchor{3ab}@anchor{gnat_rm/the_gnat_library gnat-sha384-g-sha384-ads}@anchor{3ac} +@anchor{gnat_rm/the_gnat_library id108}@anchor{3a7}@anchor{gnat_rm/the_gnat_library gnat-sha384-g-sha384-ads}@anchor{3a8} @section @code{GNAT.SHA384} (@code{g-sha384.ads}) @@ -24473,7 +24543,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 id109}@anchor{3ad}@anchor{gnat_rm/the_gnat_library gnat-sha512-g-sha512-ads}@anchor{3ae} +@anchor{gnat_rm/the_gnat_library id109}@anchor{3a9}@anchor{gnat_rm/the_gnat_library gnat-sha512-g-sha512-ads}@anchor{3aa} @section @code{GNAT.SHA512} (@code{g-sha512.ads}) @@ -24486,7 +24556,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{3af}@anchor{gnat_rm/the_gnat_library id110}@anchor{3b0} +@anchor{gnat_rm/the_gnat_library gnat-signals-g-signal-ads}@anchor{3ab}@anchor{gnat_rm/the_gnat_library id110}@anchor{3ac} @section @code{GNAT.Signals} (@code{g-signal.ads}) @@ -24498,7 +24568,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{3b1}@anchor{gnat_rm/the_gnat_library id111}@anchor{3b2} +@anchor{gnat_rm/the_gnat_library gnat-sockets-g-socket-ads}@anchor{3ad}@anchor{gnat_rm/the_gnat_library id111}@anchor{3ae} @section @code{GNAT.Sockets} (@code{g-socket.ads}) @@ -24513,7 +24583,7 @@ on all native GNAT ports and on VxWorks cross prots. 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{3b3}@anchor{gnat_rm/the_gnat_library id112}@anchor{3b4} +@anchor{gnat_rm/the_gnat_library gnat-source-info-g-souinf-ads}@anchor{3af}@anchor{gnat_rm/the_gnat_library id112}@anchor{3b0} @section @code{GNAT.Source_Info} (@code{g-souinf.ads}) @@ -24527,7 +24597,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{3b5}@anchor{gnat_rm/the_gnat_library id113}@anchor{3b6} +@anchor{gnat_rm/the_gnat_library gnat-spelling-checker-g-speche-ads}@anchor{3b1}@anchor{gnat_rm/the_gnat_library id113}@anchor{3b2} @section @code{GNAT.Spelling_Checker} (@code{g-speche.ads}) @@ -24539,7 +24609,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{3b7}@anchor{gnat_rm/the_gnat_library id114}@anchor{3b8} +@anchor{gnat_rm/the_gnat_library gnat-spelling-checker-generic-g-spchge-ads}@anchor{3b3}@anchor{gnat_rm/the_gnat_library id114}@anchor{3b4} @section @code{GNAT.Spelling_Checker_Generic} (@code{g-spchge.ads}) @@ -24552,7 +24622,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{3b9}@anchor{gnat_rm/the_gnat_library id115}@anchor{3ba} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-patterns-g-spipat-ads}@anchor{3b5}@anchor{gnat_rm/the_gnat_library id115}@anchor{3b6} @section @code{GNAT.Spitbol.Patterns} (@code{g-spipat.ads}) @@ -24568,7 +24638,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 id116}@anchor{3bb}@anchor{gnat_rm/the_gnat_library gnat-spitbol-g-spitbo-ads}@anchor{3bc} +@anchor{gnat_rm/the_gnat_library id116}@anchor{3b7}@anchor{gnat_rm/the_gnat_library gnat-spitbol-g-spitbo-ads}@anchor{3b8} @section @code{GNAT.Spitbol} (@code{g-spitbo.ads}) @@ -24583,7 +24653,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{3bd}@anchor{gnat_rm/the_gnat_library id117}@anchor{3be} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-boolean-g-sptabo-ads}@anchor{3b9}@anchor{gnat_rm/the_gnat_library id117}@anchor{3ba} @section @code{GNAT.Spitbol.Table_Boolean} (@code{g-sptabo.ads}) @@ -24598,7 +24668,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{3bf}@anchor{gnat_rm/the_gnat_library id118}@anchor{3c0} +@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-integer-g-sptain-ads}@anchor{3bb}@anchor{gnat_rm/the_gnat_library id118}@anchor{3bc} @section @code{GNAT.Spitbol.Table_Integer} (@code{g-sptain.ads}) @@ -24615,7 +24685,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 id119}@anchor{3c1}@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-vstring-g-sptavs-ads}@anchor{3c2} +@anchor{gnat_rm/the_gnat_library id119}@anchor{3bd}@anchor{gnat_rm/the_gnat_library gnat-spitbol-table-vstring-g-sptavs-ads}@anchor{3be} @section @code{GNAT.Spitbol.Table_VString} (@code{g-sptavs.ads}) @@ -24632,7 +24702,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 id120}@anchor{3c3}@anchor{gnat_rm/the_gnat_library gnat-sse-g-sse-ads}@anchor{3c4} +@anchor{gnat_rm/the_gnat_library id120}@anchor{3bf}@anchor{gnat_rm/the_gnat_library gnat-sse-g-sse-ads}@anchor{3c0} @section @code{GNAT.SSE} (@code{g-sse.ads}) @@ -24644,7 +24714,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{3c5}@anchor{gnat_rm/the_gnat_library id121}@anchor{3c6} +@anchor{gnat_rm/the_gnat_library gnat-sse-vector-types-g-ssvety-ads}@anchor{3c1}@anchor{gnat_rm/the_gnat_library id121}@anchor{3c2} @section @code{GNAT.SSE.Vector_Types} (@code{g-ssvety.ads}) @@ -24653,7 +24723,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{3c7}@anchor{gnat_rm/the_gnat_library id122}@anchor{3c8} +@anchor{gnat_rm/the_gnat_library gnat-string-hash-g-strhas-ads}@anchor{3c3}@anchor{gnat_rm/the_gnat_library id122}@anchor{3c4} @section @code{GNAT.String_Hash} (@code{g-strhas.ads}) @@ -24665,7 +24735,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 id123}@anchor{3c9}@anchor{gnat_rm/the_gnat_library gnat-strings-g-string-ads}@anchor{3ca} +@anchor{gnat_rm/the_gnat_library id123}@anchor{3c5}@anchor{gnat_rm/the_gnat_library gnat-strings-g-string-ads}@anchor{3c6} @section @code{GNAT.Strings} (@code{g-string.ads}) @@ -24675,7 +24745,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{3cb}@anchor{gnat_rm/the_gnat_library id124}@anchor{3cc} +@anchor{gnat_rm/the_gnat_library gnat-string-split-g-strspl-ads}@anchor{3c7}@anchor{gnat_rm/the_gnat_library id124}@anchor{3c8} @section @code{GNAT.String_Split} (@code{g-strspl.ads}) @@ -24689,7 +24759,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 id125}@anchor{3cd}@anchor{gnat_rm/the_gnat_library gnat-table-g-table-ads}@anchor{3ce} +@anchor{gnat_rm/the_gnat_library id125}@anchor{3c9}@anchor{gnat_rm/the_gnat_library gnat-table-g-table-ads}@anchor{3ca} @section @code{GNAT.Table} (@code{g-table.ads}) @@ -24709,7 +24779,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 id126}@anchor{3cf}@anchor{gnat_rm/the_gnat_library gnat-task-lock-g-tasloc-ads}@anchor{3d0} +@anchor{gnat_rm/the_gnat_library id126}@anchor{3cb}@anchor{gnat_rm/the_gnat_library gnat-task-lock-g-tasloc-ads}@anchor{3cc} @section @code{GNAT.Task_Lock} (@code{g-tasloc.ads}) @@ -24726,7 +24796,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 id127}@anchor{3d1}@anchor{gnat_rm/the_gnat_library gnat-time-stamp-g-timsta-ads}@anchor{3d2} +@anchor{gnat_rm/the_gnat_library id127}@anchor{3cd}@anchor{gnat_rm/the_gnat_library gnat-time-stamp-g-timsta-ads}@anchor{3ce} @section @code{GNAT.Time_Stamp} (@code{g-timsta.ads}) @@ -24741,7 +24811,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{3d3}@anchor{gnat_rm/the_gnat_library id128}@anchor{3d4} +@anchor{gnat_rm/the_gnat_library gnat-threads-g-thread-ads}@anchor{3cf}@anchor{gnat_rm/the_gnat_library id128}@anchor{3d0} @section @code{GNAT.Threads} (@code{g-thread.ads}) @@ -24758,7 +24828,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 id129}@anchor{3d5}@anchor{gnat_rm/the_gnat_library gnat-traceback-g-traceb-ads}@anchor{3d6} +@anchor{gnat_rm/the_gnat_library id129}@anchor{3d1}@anchor{gnat_rm/the_gnat_library gnat-traceback-g-traceb-ads}@anchor{3d2} @section @code{GNAT.Traceback} (@code{g-traceb.ads}) @@ -24770,7 +24840,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-table ads,GNAT Traceback g-traceb ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id130}@anchor{3d7}@anchor{gnat_rm/the_gnat_library gnat-traceback-symbolic-g-trasym-ads}@anchor{3d8} +@anchor{gnat_rm/the_gnat_library id130}@anchor{3d3}@anchor{gnat_rm/the_gnat_library gnat-traceback-symbolic-g-trasym-ads}@anchor{3d4} @section @code{GNAT.Traceback.Symbolic} (@code{g-trasym.ads}) @@ -24779,7 +24849,7 @@ in various debugging situations. @geindex Trace back facilities @node GNAT UTF_32 g-table ads,GNAT Wide_Spelling_Checker g-u3spch ads,GNAT Traceback Symbolic g-trasym ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library id131}@anchor{3d9}@anchor{gnat_rm/the_gnat_library gnat-utf-32-g-table-ads}@anchor{3da} +@anchor{gnat_rm/the_gnat_library id131}@anchor{3d5}@anchor{gnat_rm/the_gnat_library gnat-utf-32-g-table-ads}@anchor{3d6} @section @code{GNAT.UTF_32} (@code{g-table.ads}) @@ -24798,7 +24868,7 @@ lower case to upper case fold routine corresponding to the Ada 2005 rules for identifier equivalence. @node GNAT Wide_Spelling_Checker g-u3spch ads,GNAT Wide_Spelling_Checker g-wispch ads,GNAT UTF_32 g-table ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-wide-spelling-checker-g-u3spch-ads}@anchor{3db}@anchor{gnat_rm/the_gnat_library id132}@anchor{3dc} +@anchor{gnat_rm/the_gnat_library gnat-wide-spelling-checker-g-u3spch-ads}@anchor{3d7}@anchor{gnat_rm/the_gnat_library id132}@anchor{3d8} @section @code{GNAT.Wide_Spelling_Checker} (@code{g-u3spch.ads}) @@ -24811,7 +24881,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 Wide_Spelling_Checker g-u3spch ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library gnat-wide-spelling-checker-g-wispch-ads}@anchor{3dd}@anchor{gnat_rm/the_gnat_library id133}@anchor{3de} +@anchor{gnat_rm/the_gnat_library gnat-wide-spelling-checker-g-wispch-ads}@anchor{3d9}@anchor{gnat_rm/the_gnat_library id133}@anchor{3da} @section @code{GNAT.Wide_Spelling_Checker} (@code{g-wispch.ads}) @@ -24823,7 +24893,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 id134}@anchor{3df}@anchor{gnat_rm/the_gnat_library gnat-wide-string-split-g-wistsp-ads}@anchor{3e0} +@anchor{gnat_rm/the_gnat_library id134}@anchor{3db}@anchor{gnat_rm/the_gnat_library gnat-wide-string-split-g-wistsp-ads}@anchor{3dc} @section @code{GNAT.Wide_String_Split} (@code{g-wistsp.ads}) @@ -24837,7 +24907,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{3e1}@anchor{gnat_rm/the_gnat_library id135}@anchor{3e2} +@anchor{gnat_rm/the_gnat_library gnat-wide-wide-spelling-checker-g-zspche-ads}@anchor{3dd}@anchor{gnat_rm/the_gnat_library id135}@anchor{3de} @section @code{GNAT.Wide_Wide_Spelling_Checker} (@code{g-zspche.ads}) @@ -24849,7 +24919,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{3e3}@anchor{gnat_rm/the_gnat_library id136}@anchor{3e4} +@anchor{gnat_rm/the_gnat_library gnat-wide-wide-string-split-g-zistsp-ads}@anchor{3df}@anchor{gnat_rm/the_gnat_library id136}@anchor{3e0} @section @code{GNAT.Wide_Wide_String_Split} (@code{g-zistsp.ads}) @@ -24863,7 +24933,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 interfaces-c-extensions-i-cexten-ads}@anchor{3e5}@anchor{gnat_rm/the_gnat_library id137}@anchor{3e6} +@anchor{gnat_rm/the_gnat_library interfaces-c-extensions-i-cexten-ads}@anchor{3e1}@anchor{gnat_rm/the_gnat_library id137}@anchor{3e2} @section @code{Interfaces.C.Extensions} (@code{i-cexten.ads}) @@ -24874,7 +24944,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 id138}@anchor{3e7}@anchor{gnat_rm/the_gnat_library interfaces-c-streams-i-cstrea-ads}@anchor{3e8} +@anchor{gnat_rm/the_gnat_library id138}@anchor{3e3}@anchor{gnat_rm/the_gnat_library interfaces-c-streams-i-cstrea-ads}@anchor{3e4} @section @code{Interfaces.C.Streams} (@code{i-cstrea.ads}) @@ -24887,7 +24957,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 interfaces-packed-decimal-i-pacdec-ads}@anchor{3e9}@anchor{gnat_rm/the_gnat_library id139}@anchor{3ea} +@anchor{gnat_rm/the_gnat_library interfaces-packed-decimal-i-pacdec-ads}@anchor{3e5}@anchor{gnat_rm/the_gnat_library id139}@anchor{3e6} @section @code{Interfaces.Packed_Decimal} (@code{i-pacdec.ads}) @@ -24902,7 +24972,7 @@ from a packed decimal format compatible with that used on IBM mainframes. @node Interfaces VxWorks i-vxwork ads,Interfaces VxWorks Int_Connection i-vxinco ads,Interfaces Packed_Decimal i-pacdec ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library interfaces-vxworks-i-vxwork-ads}@anchor{3eb}@anchor{gnat_rm/the_gnat_library id140}@anchor{3ec} +@anchor{gnat_rm/the_gnat_library interfaces-vxworks-i-vxwork-ads}@anchor{3e7}@anchor{gnat_rm/the_gnat_library id140}@anchor{3e8} @section @code{Interfaces.VxWorks} (@code{i-vxwork.ads}) @@ -24918,7 +24988,7 @@ In particular, it interfaces with the VxWorks hardware interrupt facilities. @node Interfaces VxWorks Int_Connection i-vxinco ads,Interfaces VxWorks IO i-vxwoio ads,Interfaces VxWorks i-vxwork ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library interfaces-vxworks-int-connection-i-vxinco-ads}@anchor{3ed}@anchor{gnat_rm/the_gnat_library id141}@anchor{3ee} +@anchor{gnat_rm/the_gnat_library interfaces-vxworks-int-connection-i-vxinco-ads}@anchor{3e9}@anchor{gnat_rm/the_gnat_library id141}@anchor{3ea} @section @code{Interfaces.VxWorks.Int_Connection} (@code{i-vxinco.ads}) @@ -24934,7 +25004,7 @@ intConnect() with a custom routine for installing interrupt handlers. @node Interfaces VxWorks IO i-vxwoio ads,System Address_Image s-addima ads,Interfaces VxWorks Int_Connection i-vxinco ads,The GNAT Library -@anchor{gnat_rm/the_gnat_library interfaces-vxworks-io-i-vxwoio-ads}@anchor{3ef}@anchor{gnat_rm/the_gnat_library id142}@anchor{3f0} +@anchor{gnat_rm/the_gnat_library interfaces-vxworks-io-i-vxwoio-ads}@anchor{3eb}@anchor{gnat_rm/the_gnat_library id142}@anchor{3ec} @section @code{Interfaces.VxWorks.IO} (@code{i-vxwoio.ads}) @@ -24957,7 +25027,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 system-address-image-s-addima-ads}@anchor{3f1}@anchor{gnat_rm/the_gnat_library id143}@anchor{3f2} +@anchor{gnat_rm/the_gnat_library system-address-image-s-addima-ads}@anchor{3ed}@anchor{gnat_rm/the_gnat_library id143}@anchor{3ee} @section @code{System.Address_Image} (@code{s-addima.ads}) @@ -24973,7 +25043,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 id144}@anchor{3f3}@anchor{gnat_rm/the_gnat_library system-assertions-s-assert-ads}@anchor{3f4} +@anchor{gnat_rm/the_gnat_library id144}@anchor{3ef}@anchor{gnat_rm/the_gnat_library system-assertions-s-assert-ads}@anchor{3f0} @section @code{System.Assertions} (@code{s-assert.ads}) @@ -24989,7 +25059,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 id145}@anchor{3f5}@anchor{gnat_rm/the_gnat_library system-atomic-counters-s-atocou-ads}@anchor{3f6} +@anchor{gnat_rm/the_gnat_library id145}@anchor{3f1}@anchor{gnat_rm/the_gnat_library system-atomic-counters-s-atocou-ads}@anchor{3f2} @section @code{System.Atomic_Counters} (@code{s-atocou.ads}) @@ -25003,7 +25073,7 @@ on most targets, including all Alpha, 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 system-memory-s-memory-ads}@anchor{3f7}@anchor{gnat_rm/the_gnat_library id146}@anchor{3f8} +@anchor{gnat_rm/the_gnat_library system-memory-s-memory-ads}@anchor{3f3}@anchor{gnat_rm/the_gnat_library id146}@anchor{3f4} @section @code{System.Memory} (@code{s-memory.ads}) @@ -25021,7 +25091,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 id147}@anchor{3f9}@anchor{gnat_rm/the_gnat_library system-multiprocessors-s-multip-ads}@anchor{3fa} +@anchor{gnat_rm/the_gnat_library id147}@anchor{3f5}@anchor{gnat_rm/the_gnat_library system-multiprocessors-s-multip-ads}@anchor{3f6} @section @code{System.Multiprocessors} (@code{s-multip.ads}) @@ -25034,7 +25104,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 system-multiprocessors-dispatching-domains-s-mudido-ads}@anchor{3fb}@anchor{gnat_rm/the_gnat_library id148}@anchor{3fc} +@anchor{gnat_rm/the_gnat_library system-multiprocessors-dispatching-domains-s-mudido-ads}@anchor{3f7}@anchor{gnat_rm/the_gnat_library id148}@anchor{3f8} @section @code{System.Multiprocessors.Dispatching_Domains} (@code{s-mudido.ads}) @@ -25047,7 +25117,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 id149}@anchor{3fd}@anchor{gnat_rm/the_gnat_library system-partition-interface-s-parint-ads}@anchor{3fe} +@anchor{gnat_rm/the_gnat_library id149}@anchor{3f9}@anchor{gnat_rm/the_gnat_library system-partition-interface-s-parint-ads}@anchor{3fa} @section @code{System.Partition_Interface} (@code{s-parint.ads}) @@ -25060,7 +25130,7 @@ is used primarily in a distribution context when using Annex E with @code{GLADE}. @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 id150}@anchor{3ff}@anchor{gnat_rm/the_gnat_library system-pool-global-s-pooglo-ads}@anchor{400} +@anchor{gnat_rm/the_gnat_library id150}@anchor{3fb}@anchor{gnat_rm/the_gnat_library system-pool-global-s-pooglo-ads}@anchor{3fc} @section @code{System.Pool_Global} (@code{s-pooglo.ads}) @@ -25077,7 +25147,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 system-pool-local-s-pooloc-ads}@anchor{401}@anchor{gnat_rm/the_gnat_library id151}@anchor{402} +@anchor{gnat_rm/the_gnat_library system-pool-local-s-pooloc-ads}@anchor{3fd}@anchor{gnat_rm/the_gnat_library id151}@anchor{3fe} @section @code{System.Pool_Local} (@code{s-pooloc.ads}) @@ -25094,7 +25164,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 id152}@anchor{403}@anchor{gnat_rm/the_gnat_library system-restrictions-s-restri-ads}@anchor{404} +@anchor{gnat_rm/the_gnat_library id152}@anchor{3ff}@anchor{gnat_rm/the_gnat_library system-restrictions-s-restri-ads}@anchor{400} @section @code{System.Restrictions} (@code{s-restri.ads}) @@ -25110,7 +25180,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 system-rident-s-rident-ads}@anchor{405}@anchor{gnat_rm/the_gnat_library id153}@anchor{406} +@anchor{gnat_rm/the_gnat_library system-rident-s-rident-ads}@anchor{401}@anchor{gnat_rm/the_gnat_library id153}@anchor{402} @section @code{System.Rident} (@code{s-rident.ads}) @@ -25126,7 +25196,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 id154}@anchor{407}@anchor{gnat_rm/the_gnat_library system-strings-stream-ops-s-ststop-ads}@anchor{408} +@anchor{gnat_rm/the_gnat_library id154}@anchor{403}@anchor{gnat_rm/the_gnat_library system-strings-stream-ops-s-ststop-ads}@anchor{404} @section @code{System.Strings.Stream_Ops} (@code{s-ststop.ads}) @@ -25142,7 +25212,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 system-unsigned-types-s-unstyp-ads}@anchor{409}@anchor{gnat_rm/the_gnat_library id155}@anchor{40a} +@anchor{gnat_rm/the_gnat_library system-unsigned-types-s-unstyp-ads}@anchor{405}@anchor{gnat_rm/the_gnat_library id155}@anchor{406} @section @code{System.Unsigned_Types} (@code{s-unstyp.ads}) @@ -25155,7 +25225,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 system-wch-cnv-s-wchcnv-ads}@anchor{40b}@anchor{gnat_rm/the_gnat_library id156}@anchor{40c} +@anchor{gnat_rm/the_gnat_library system-wch-cnv-s-wchcnv-ads}@anchor{407}@anchor{gnat_rm/the_gnat_library id156}@anchor{408} @section @code{System.Wch_Cnv} (@code{s-wchcnv.ads}) @@ -25176,7 +25246,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 id157}@anchor{40d}@anchor{gnat_rm/the_gnat_library system-wch-con-s-wchcon-ads}@anchor{40e} +@anchor{gnat_rm/the_gnat_library id157}@anchor{409}@anchor{gnat_rm/the_gnat_library system-wch-con-s-wchcon-ads}@anchor{40a} @section @code{System.Wch_Con} (@code{s-wchcon.ads}) @@ -25188,7 +25258,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 interfacing-to-other-languages}@anchor{11}@anchor{gnat_rm/interfacing_to_other_languages doc}@anchor{40f}@anchor{gnat_rm/interfacing_to_other_languages id1}@anchor{410} +@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-other-languages}@anchor{11}@anchor{gnat_rm/interfacing_to_other_languages doc}@anchor{40b}@anchor{gnat_rm/interfacing_to_other_languages id1}@anchor{40c} @chapter Interfacing to Other Languages @@ -25206,7 +25276,7 @@ provided. @end menu @node Interfacing to C,Interfacing to C++,,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-c}@anchor{411}@anchor{gnat_rm/interfacing_to_other_languages id2}@anchor{412} +@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-c}@anchor{40d}@anchor{gnat_rm/interfacing_to_other_languages id2}@anchor{40e} @section Interfacing to C @@ -25346,7 +25416,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 id4}@anchor{413}@anchor{gnat_rm/interfacing_to_other_languages id3}@anchor{47} +@anchor{gnat_rm/interfacing_to_other_languages id4}@anchor{40f}@anchor{gnat_rm/interfacing_to_other_languages id3}@anchor{47} @section Interfacing to C++ @@ -25403,7 +25473,7 @@ The @code{External_Name} is the name of the C++ RTTI symbol. You can then cover a specific C++ exception in an exception handler. @node Interfacing to COBOL,Interfacing to Fortran,Interfacing to C++,Interfacing to Other Languages -@anchor{gnat_rm/interfacing_to_other_languages id5}@anchor{414}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-cobol}@anchor{415} +@anchor{gnat_rm/interfacing_to_other_languages id5}@anchor{410}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-cobol}@anchor{411} @section Interfacing to COBOL @@ -25411,7 +25481,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{416}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-fortran}@anchor{417} +@anchor{gnat_rm/interfacing_to_other_languages id6}@anchor{412}@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-fortran}@anchor{413} @section Interfacing to Fortran @@ -25421,7 +25491,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 interfacing-to-non-gnat-ada-code}@anchor{418}@anchor{gnat_rm/interfacing_to_other_languages id7}@anchor{419} +@anchor{gnat_rm/interfacing_to_other_languages interfacing-to-non-gnat-ada-code}@anchor{414}@anchor{gnat_rm/interfacing_to_other_languages id7}@anchor{415} @section Interfacing to non-GNAT Ada code @@ -25445,7 +25515,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 specialized-needs-annexes}@anchor{12}@anchor{gnat_rm/specialized_needs_annexes doc}@anchor{41a}@anchor{gnat_rm/specialized_needs_annexes id1}@anchor{41b} +@anchor{gnat_rm/specialized_needs_annexes specialized-needs-annexes}@anchor{12}@anchor{gnat_rm/specialized_needs_annexes doc}@anchor{416}@anchor{gnat_rm/specialized_needs_annexes id1}@anchor{417} @chapter Specialized Needs Annexes @@ -25486,7 +25556,7 @@ in Ada 2005) is fully implemented. @end table @node Implementation of Specific Ada Features,Implementation of Ada 2012 Features,Specialized Needs Annexes,Top -@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{41c}@anchor{gnat_rm/implementation_of_specific_ada_features id1}@anchor{41d} +@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{418}@anchor{gnat_rm/implementation_of_specific_ada_features id1}@anchor{419} @chapter Implementation of Specific Ada Features @@ -25504,7 +25574,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 machine-code-insertions}@anchor{16a}@anchor{gnat_rm/implementation_of_specific_ada_features id2}@anchor{41e} +@anchor{gnat_rm/implementation_of_specific_ada_features machine-code-insertions}@anchor{166}@anchor{gnat_rm/implementation_of_specific_ada_features id2}@anchor{41a} @section Machine Code Insertions @@ -25672,7 +25742,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 id3}@anchor{41f}@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-tasking}@anchor{420} +@anchor{gnat_rm/implementation_of_specific_ada_features id3}@anchor{41b}@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-tasking}@anchor{41c} @section GNAT Implementation of Tasking @@ -25688,7 +25758,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 mapping-ada-tasks-onto-the-underlying-kernel-threads}@anchor{421}@anchor{gnat_rm/implementation_of_specific_ada_features id4}@anchor{422} +@anchor{gnat_rm/implementation_of_specific_ada_features mapping-ada-tasks-onto-the-underlying-kernel-threads}@anchor{41d}@anchor{gnat_rm/implementation_of_specific_ada_features id4}@anchor{41e} @subsection Mapping Ada Tasks onto the Underlying Kernel Threads @@ -25757,7 +25827,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 id5}@anchor{423}@anchor{gnat_rm/implementation_of_specific_ada_features ensuring-compliance-with-the-real-time-annex}@anchor{424} +@anchor{gnat_rm/implementation_of_specific_ada_features id5}@anchor{41f}@anchor{gnat_rm/implementation_of_specific_ada_features ensuring-compliance-with-the-real-time-annex}@anchor{420} @subsection Ensuring Compliance with the Real-Time Annex @@ -25808,7 +25878,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{425} +@anchor{gnat_rm/implementation_of_specific_ada_features support-for-locking-policies}@anchor{421} @subsection Support for Locking Policies @@ -25842,7 +25912,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 id6}@anchor{426}@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-shared-passive-packages}@anchor{427} +@anchor{gnat_rm/implementation_of_specific_ada_features id6}@anchor{422}@anchor{gnat_rm/implementation_of_specific_ada_features gnat-implementation-of-shared-passive-packages}@anchor{423} @section GNAT Implementation of Shared Passive Packages @@ -25940,7 +26010,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{428}@anchor{gnat_rm/implementation_of_specific_ada_features id7}@anchor{429} +@anchor{gnat_rm/implementation_of_specific_ada_features code-generation-for-array-aggregates}@anchor{424}@anchor{gnat_rm/implementation_of_specific_ada_features id7}@anchor{425} @section Code Generation for Array Aggregates @@ -25971,7 +26041,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 static-constant-aggregates-with-static-bounds}@anchor{42a}@anchor{gnat_rm/implementation_of_specific_ada_features id8}@anchor{42b} +@anchor{gnat_rm/implementation_of_specific_ada_features static-constant-aggregates-with-static-bounds}@anchor{426}@anchor{gnat_rm/implementation_of_specific_ada_features id8}@anchor{427} @subsection Static constant aggregates with static bounds @@ -26018,7 +26088,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{42c}@anchor{gnat_rm/implementation_of_specific_ada_features id9}@anchor{42d} +@anchor{gnat_rm/implementation_of_specific_ada_features constant-aggregates-with-unconstrained-nominal-types}@anchor{428}@anchor{gnat_rm/implementation_of_specific_ada_features id9}@anchor{429} @subsection Constant aggregates with unconstrained nominal types @@ -26033,7 +26103,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 id10}@anchor{42e}@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-static-bounds}@anchor{42f} +@anchor{gnat_rm/implementation_of_specific_ada_features id10}@anchor{42a}@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-static-bounds}@anchor{42b} @subsection Aggregates with static bounds @@ -26061,7 +26131,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 id11}@anchor{430}@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-nonstatic-bounds}@anchor{431} +@anchor{gnat_rm/implementation_of_specific_ada_features id11}@anchor{42c}@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-with-nonstatic-bounds}@anchor{42d} @subsection Aggregates with nonstatic bounds @@ -26072,7 +26142,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 id12}@anchor{432}@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-in-assignment-statements}@anchor{433} +@anchor{gnat_rm/implementation_of_specific_ada_features id12}@anchor{42e}@anchor{gnat_rm/implementation_of_specific_ada_features aggregates-in-assignment-statements}@anchor{42f} @subsection Aggregates in assignment statements @@ -26114,7 +26184,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,Strict Conformance to the Ada Reference Manual,Code Generation for Array Aggregates,Implementation of Specific Ada Features -@anchor{gnat_rm/implementation_of_specific_ada_features id13}@anchor{434}@anchor{gnat_rm/implementation_of_specific_ada_features the-size-of-discriminated-records-with-default-discriminants}@anchor{435} +@anchor{gnat_rm/implementation_of_specific_ada_features id13}@anchor{430}@anchor{gnat_rm/implementation_of_specific_ada_features the-size-of-discriminated-records-with-default-discriminants}@anchor{431} @section The Size of Discriminated Records with Default Discriminants @@ -26194,7 +26264,7 @@ say) must be consistent, so it is imperative that the object, once created, remain invariant. @node 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 strict-conformance-to-the-ada-reference-manual}@anchor{436}@anchor{gnat_rm/implementation_of_specific_ada_features id14}@anchor{437} +@anchor{gnat_rm/implementation_of_specific_ada_features strict-conformance-to-the-ada-reference-manual}@anchor{432}@anchor{gnat_rm/implementation_of_specific_ada_features id14}@anchor{433} @section Strict Conformance to the Ada Reference Manual @@ -26221,7 +26291,7 @@ behavior (although at the cost of a significant performance penalty), so infinite and NaN values are properly generated. @node Implementation of Ada 2012 Features,Obsolescent Features,Implementation of Specific Ada Features,Top -@anchor{gnat_rm/implementation_of_ada_2012_features doc}@anchor{438}@anchor{gnat_rm/implementation_of_ada_2012_features implementation-of-ada-2012-features}@anchor{14}@anchor{gnat_rm/implementation_of_ada_2012_features id1}@anchor{439} +@anchor{gnat_rm/implementation_of_ada_2012_features doc}@anchor{434}@anchor{gnat_rm/implementation_of_ada_2012_features implementation-of-ada-2012-features}@anchor{14}@anchor{gnat_rm/implementation_of_ada_2012_features id1}@anchor{435} @chapter Implementation of Ada 2012 Features @@ -28387,7 +28457,7 @@ RM References: H.04 (8/1) @end itemize @node Obsolescent Features,Compatibility and Porting Guide,Implementation of Ada 2012 Features,Top -@anchor{gnat_rm/obsolescent_features id1}@anchor{43a}@anchor{gnat_rm/obsolescent_features doc}@anchor{43b}@anchor{gnat_rm/obsolescent_features obsolescent-features}@anchor{15} +@anchor{gnat_rm/obsolescent_features id1}@anchor{436}@anchor{gnat_rm/obsolescent_features doc}@anchor{437}@anchor{gnat_rm/obsolescent_features obsolescent-features}@anchor{15} @chapter Obsolescent Features @@ -28406,7 +28476,7 @@ compatibility purposes. @end menu @node pragma No_Run_Time,pragma Ravenscar,,Obsolescent Features -@anchor{gnat_rm/obsolescent_features id2}@anchor{43c}@anchor{gnat_rm/obsolescent_features pragma-no-run-time}@anchor{43d} +@anchor{gnat_rm/obsolescent_features id2}@anchor{438}@anchor{gnat_rm/obsolescent_features pragma-no-run-time}@anchor{439} @section pragma No_Run_Time @@ -28419,7 +28489,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{43e}@anchor{gnat_rm/obsolescent_features pragma-ravenscar}@anchor{43f} +@anchor{gnat_rm/obsolescent_features id3}@anchor{43a}@anchor{gnat_rm/obsolescent_features pragma-ravenscar}@anchor{43b} @section pragma Ravenscar @@ -28428,7 +28498,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 pragma-restricted-run-time}@anchor{440}@anchor{gnat_rm/obsolescent_features id4}@anchor{441} +@anchor{gnat_rm/obsolescent_features pragma-restricted-run-time}@anchor{43c}@anchor{gnat_rm/obsolescent_features id4}@anchor{43d} @section pragma Restricted_Run_Time @@ -28438,7 +28508,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 pragma-task-info}@anchor{442}@anchor{gnat_rm/obsolescent_features id5}@anchor{443} +@anchor{gnat_rm/obsolescent_features pragma-task-info}@anchor{43e}@anchor{gnat_rm/obsolescent_features id5}@anchor{43f} @section pragma Task_Info @@ -28464,7 +28534,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{444}@anchor{gnat_rm/obsolescent_features package-system-task-info-s-tasinf-ads}@anchor{445} +@anchor{gnat_rm/obsolescent_features package-system-task-info}@anchor{440}@anchor{gnat_rm/obsolescent_features package-system-task-info-s-tasinf-ads}@anchor{441} @section package System.Task_Info (@code{s-tasinf.ads}) @@ -28474,7 +28544,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 compatibility-and-porting-guide}@anchor{16}@anchor{gnat_rm/compatibility_and_porting_guide doc}@anchor{446}@anchor{gnat_rm/compatibility_and_porting_guide id1}@anchor{447} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-and-porting-guide}@anchor{16}@anchor{gnat_rm/compatibility_and_porting_guide doc}@anchor{442}@anchor{gnat_rm/compatibility_and_porting_guide id1}@anchor{443} @chapter Compatibility and Porting Guide @@ -28496,7 +28566,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{448}@anchor{gnat_rm/compatibility_and_porting_guide writing-portable-fixed-point-declarations}@anchor{449} +@anchor{gnat_rm/compatibility_and_porting_guide id2}@anchor{444}@anchor{gnat_rm/compatibility_and_porting_guide writing-portable-fixed-point-declarations}@anchor{445} @section Writing Portable Fixed-Point Declarations @@ -28618,7 +28688,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{44a}@anchor{gnat_rm/compatibility_and_porting_guide id3}@anchor{44b} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-ada-83}@anchor{446}@anchor{gnat_rm/compatibility_and_porting_guide id3}@anchor{447} @section Compatibility with Ada 83 @@ -28646,7 +28716,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{44c}@anchor{gnat_rm/compatibility_and_porting_guide legal-ada-83-programs-that-are-illegal-in-ada-95}@anchor{44d} +@anchor{gnat_rm/compatibility_and_porting_guide id4}@anchor{448}@anchor{gnat_rm/compatibility_and_porting_guide legal-ada-83-programs-that-are-illegal-in-ada-95}@anchor{449} @subsection Legal Ada 83 programs that are illegal in Ada 95 @@ -28746,7 +28816,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 more-deterministic-semantics}@anchor{44e}@anchor{gnat_rm/compatibility_and_porting_guide id5}@anchor{44f} +@anchor{gnat_rm/compatibility_and_porting_guide more-deterministic-semantics}@anchor{44a}@anchor{gnat_rm/compatibility_and_porting_guide id5}@anchor{44b} @subsection More deterministic semantics @@ -28774,7 +28844,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 id6}@anchor{450}@anchor{gnat_rm/compatibility_and_porting_guide changed-semantics}@anchor{451} +@anchor{gnat_rm/compatibility_and_porting_guide id6}@anchor{44c}@anchor{gnat_rm/compatibility_and_porting_guide changed-semantics}@anchor{44d} @subsection Changed semantics @@ -28816,7 +28886,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 other-language-compatibility-issues}@anchor{452}@anchor{gnat_rm/compatibility_and_porting_guide id7}@anchor{453} +@anchor{gnat_rm/compatibility_and_porting_guide other-language-compatibility-issues}@anchor{44e}@anchor{gnat_rm/compatibility_and_porting_guide id7}@anchor{44f} @subsection Other language compatibility issues @@ -28849,7 +28919,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{454}@anchor{gnat_rm/compatibility_and_porting_guide id8}@anchor{455} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-between-ada-95-and-ada-2005}@anchor{450}@anchor{gnat_rm/compatibility_and_porting_guide id8}@anchor{451} @section Compatibility between Ada 95 and Ada 2005 @@ -28921,7 +28991,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 implementation-dependent-characteristics}@anchor{456}@anchor{gnat_rm/compatibility_and_porting_guide id9}@anchor{457} +@anchor{gnat_rm/compatibility_and_porting_guide implementation-dependent-characteristics}@anchor{452}@anchor{gnat_rm/compatibility_and_porting_guide id9}@anchor{453} @section Implementation-dependent characteristics @@ -28944,7 +29014,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 implementation-defined-pragmas}@anchor{458}@anchor{gnat_rm/compatibility_and_porting_guide id10}@anchor{459} +@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-pragmas}@anchor{454}@anchor{gnat_rm/compatibility_and_porting_guide id10}@anchor{455} @subsection Implementation-defined pragmas @@ -28966,7 +29036,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{45a}@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-attributes}@anchor{45b} +@anchor{gnat_rm/compatibility_and_porting_guide id11}@anchor{456}@anchor{gnat_rm/compatibility_and_porting_guide implementation-defined-attributes}@anchor{457} @subsection Implementation-defined attributes @@ -28980,7 +29050,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 libraries}@anchor{45c}@anchor{gnat_rm/compatibility_and_porting_guide id12}@anchor{45d} +@anchor{gnat_rm/compatibility_and_porting_guide libraries}@anchor{458}@anchor{gnat_rm/compatibility_and_porting_guide id12}@anchor{459} @subsection Libraries @@ -29009,7 +29079,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{45e}@anchor{gnat_rm/compatibility_and_porting_guide id13}@anchor{45f} +@anchor{gnat_rm/compatibility_and_porting_guide elaboration-order}@anchor{45a}@anchor{gnat_rm/compatibility_and_porting_guide id13}@anchor{45b} @subsection Elaboration order @@ -29045,7 +29115,7 @@ pragmas either globally (as an effect of the @emph{-gnatE} switch) or locally @end itemize @node Target-specific aspects,,Elaboration order,Implementation-dependent characteristics -@anchor{gnat_rm/compatibility_and_porting_guide target-specific-aspects}@anchor{460}@anchor{gnat_rm/compatibility_and_porting_guide id14}@anchor{461} +@anchor{gnat_rm/compatibility_and_porting_guide target-specific-aspects}@anchor{45c}@anchor{gnat_rm/compatibility_and_porting_guide id14}@anchor{45d} @subsection Target-specific aspects @@ -29058,10 +29128,10 @@ on the robustness of the original design. Moreover, Ada 95 (and thus Ada 2005 and Ada 2012) 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{462,,Representation Clauses}. +GNAT's approach to these issues is described in @ref{45e,,Representation Clauses}. @node Compatibility with Other Ada Systems,Representation Clauses,Implementation-dependent characteristics,Compatibility and Porting Guide -@anchor{gnat_rm/compatibility_and_porting_guide id15}@anchor{463}@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-other-ada-systems}@anchor{464} +@anchor{gnat_rm/compatibility_and_porting_guide id15}@anchor{45f}@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-other-ada-systems}@anchor{460} @section Compatibility with Other Ada Systems @@ -29104,7 +29174,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 representation-clauses}@anchor{462}@anchor{gnat_rm/compatibility_and_porting_guide id16}@anchor{465} +@anchor{gnat_rm/compatibility_and_porting_guide representation-clauses}@anchor{45e}@anchor{gnat_rm/compatibility_and_porting_guide id16}@anchor{461} @section Representation Clauses @@ -29197,7 +29267,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{466}@anchor{gnat_rm/compatibility_and_porting_guide id17}@anchor{467} +@anchor{gnat_rm/compatibility_and_porting_guide compatibility-with-hp-ada-83}@anchor{462}@anchor{gnat_rm/compatibility_and_porting_guide id17}@anchor{463} @section Compatibility with HP Ada 83 @@ -29227,7 +29297,7 @@ extension of package System. @end itemize @node GNU Free Documentation License,Index,Compatibility and Porting Guide,Top -@anchor{share/gnu_free_documentation_license gnu-fdl}@anchor{1}@anchor{share/gnu_free_documentation_license doc}@anchor{468}@anchor{share/gnu_free_documentation_license gnu-free-documentation-license}@anchor{469} +@anchor{share/gnu_free_documentation_license gnu-fdl}@anchor{1}@anchor{share/gnu_free_documentation_license doc}@anchor{464}@anchor{share/gnu_free_documentation_license gnu-free-documentation-license}@anchor{465} @chapter GNU Free Documentation License diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 78814c3..ef68b82 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -3107,8 +3107,7 @@ that is performed by the front end of the compiler. This inlining does not require that the code generation be optimized. Like @code{-gnatn}, the use of this switch generates additional dependencies. -When using a gcc-based back end (in practice this means using any version -of GNAT other than for the JVM, .NET or GNAAMP platforms), then the use of +When using a gcc-based back end, then the use of @code{-gnatN} is deprecated, and the use of @code{-gnatn} is preferred. Historically front end inlining was more extensive than the gcc back end inlining, but that is no longer the case. @@ -8581,6 +8580,18 @@ marker is specified, the callgraph is decorated with information about dynamically allocated objects. @end table +@geindex -fdiagnostics-format (gcc) + + +@table @asis + +@item @code{-fdiagnostics-format=json} + +Makes GNAT emit warning and error messages as JSON. Inhibits printing of +text warning and errors messages except if @code{-gnatv} or +@code{-gnatl} are present. +@end table + @geindex -fdump-scos (gcc) @@ -9275,8 +9286,7 @@ be specified in GNAT. It is computed for GCC backends as @code{BIGGEST_ALIGNMENT follows: @cite{Biggest alignment that any data type can require on this machine@comma{} in bits.} @code{Max_Unaligned_Field} is the maximum size for unaligned bit field, which is -64 for the majority of GCC targets (but can be different on some targets like -AAMP). +64 for the majority of GCC targets (but can be different on some targets). @code{Strict_Alignment} is the equivalent of GCC macro @code{STRICT_ALIGNMENT} documented as follows: @cite{Define this macro to be the value 1 if instructions will fail to work if given data not on the nominal alignment. If instructions will merely go slower in that case@comma{} define this macro as 0.} @@ -9309,8 +9319,9 @@ name digs float_rep size alignment where @code{name} is the string name of the type (which can have single spaces embedded in the name (e.g. long double), @code{digs} is the number of digits for the floating-point type, @code{float_rep} is -the float representation (I/V/A for IEEE-754-Binary, Vax_Native, -AAMP), @code{size} is the size in bits, @code{alignment} is the +the float representation (I for IEEE-754-Binary, which is +the only one supported at this time), +@code{size} is the size in bits, @code{alignment} is the alignment in bits. The name is followed by at least two blanks, fields are separated by at least one blank, and a LF character immediately follows the alignment field. @@ -9634,8 +9645,7 @@ pragma @code{Inline} is specified. This inlining is performed by the front end and will be visible in the @code{-gnatG} output. -When using a gcc-based back end (in practice this means using any version -of GNAT other than the JGNAT, .NET or GNAAMP versions), then the use of +When using a gcc-based back end, then the use of @code{-gnatN} is deprecated, and the use of @code{-gnatn} is preferred. Historically front end inlining was more extensive than the gcc back end inlining, but that is no longer the case. @@ -11387,7 +11397,7 @@ types of the actuals are not by-copy types. This warning is off by default. @emph{Disable warnings on overlapping actuals.} -This switch disables warnings on overlapping actuals in a call.. +This switch disables warnings on overlapping actuals in a call. @end table @geindex -gnatwj (gcc) @@ -14691,8 +14701,7 @@ see @ref{100,,Inlining of Subprograms}. This switch activates front-end inlining which also generates additional dependencies. -When using a gcc-based back end (in practice this means using any version -of GNAT other than the JGNAT, .NET or GNAAMP versions), then the use of +When using a gcc-based back end, then the use of @code{-gnatN} is deprecated, and the use of @code{-gnatn} is preferred. Historically front end inlining was more extensive than the gcc back end inlining, but that is no longer the case. diff --git a/gcc/ada/gnatcmd.adb b/gcc/ada/gnatcmd.adb index daa2482..94da878 100644 --- a/gcc/ada/gnatcmd.adb +++ b/gcc/ada/gnatcmd.adb @@ -472,6 +472,15 @@ begin Program := new String'(Command_List (The_Command).Unixcmd.all); + elsif The_Command in Check | Test then + Program := new String'(Command_List (The_Command).Unixcmd.all); + Find_Program_Name; + + if Name_Len > 5 then + First_Switches.Append + (new String' + ("--target=" & Name_Buffer (1 .. Name_Len - 5))); + end if; else Program := Program_Name (Command_List (The_Command).Unixcmd.all, "gnat"); @@ -481,13 +490,7 @@ begin -- instead of gnatmake/gnatclean. -- Ditto for gnatname -> gprname and gnatls -> gprls. - if The_Command = Make - or else The_Command = Compile - or else The_Command = Bind - or else The_Command = Link - or else The_Command = Clean - or else The_Command = Name - or else The_Command = List + if The_Command in Make | Compile | Bind | Link | Clean | Name | List then declare Switch : String_Access; @@ -588,23 +591,23 @@ begin end if; -- For FIND and XREF, look for switch -P. If it is specified, then - -- report an error indicating that the command is no longer supporting - -- project files. + -- report an error indicating that the command does not support project + -- files. - if The_Command = Find or else The_Command = Xref then + if The_Command in Find | Xref then declare Argv : String_Access; begin for Arg_Num in 1 .. Last_Switches.Last loop Argv := Last_Switches.Table (Arg_Num); - if Argv'Length >= 2 and then - Argv (Argv'First .. Argv'First + 1) = "-P" + if Argv'Length >= 2 + and then Argv (Argv'First .. Argv'First + 1) = "-P" then if The_Command = Find then - Fail ("'gnat find -P' is no longer supported;"); + Fail ("'gnat find -P' is not supported;"); else - Fail ("'gnat xref -P' is no longer supported;"); + Fail ("'gnat xref -P' is not supported;"); end if; end if; end loop; diff --git a/gcc/ada/itypes.adb b/gcc/ada/itypes.adb index 3282d11..f51b44a 100644 --- a/gcc/ada/itypes.adb +++ b/gcc/ada/itypes.adb @@ -111,6 +111,7 @@ package body Itypes is Set_Is_Atomic (I_Typ, Is_Atomic (T)); Set_Is_Ada_2005_Only (I_Typ, Is_Ada_2005_Only (T)); Set_Is_Ada_2012_Only (I_Typ, Is_Ada_2012_Only (T)); + Set_Is_Ada_2022_Only (I_Typ, Is_Ada_2022_Only (T)); Set_Can_Never_Be_Null (I_Typ); return I_Typ; diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb index a426745..17de886 100644 --- a/gcc/ada/lib-xref.adb +++ b/gcc/ada/lib-xref.adb @@ -703,6 +703,37 @@ package body Lib.Xref is Error_Msg_NE ("& is only defined in Ada 2012?y?", N, E); end if; + -- Warn if reference to Ada 2022 entity not in Ada 2022 mode. We only + -- detect real explicit references (modifications and references). + + if Comes_From_Source (N) + and then Is_Ada_2022_Only (E) + and then not Is_Subprogram (E) + and then Ada_Version < Ada_2022 + and then Warn_On_Ada_2022_Compatibility + and then (Typ = 'm' or else Typ = 'r') + then + Error_Msg_NE ("& is only defined in Ada 2022?y?", N, E); + + -- Error on static and dispatching calls to Ada 2022 subprograms that + -- require overriding if we are not in Ada 2022 mode (since overriding + -- was skipped); warn if the subprogram does not require overriding. + + elsif Comes_From_Source (N) + and then Is_Ada_2022_Only (E) + and then Ada_Version < Ada_2022 + and then Is_Subprogram (E) + and then (Typ = 'r' or else Typ = 's' or else Typ = 'R') + then + if Requires_Overriding (E) then + Error_Msg_NE + ("& is only defined in Ada 2022 and requires overriding", N, E); + + elsif Warn_On_Ada_2022_Compatibility then + Error_Msg_NE ("& is only defined in Ada 2022?y?", N, E); + end if; + end if; + -- Do not generate references if we are within a postcondition sub- -- program, because the reference does not comes from source, and the -- preanalysis of the aspect has already created an entry for the ALI diff --git a/gcc/ada/libgnat/s-putaim.adb b/gcc/ada/libgnarl/s-putaim.adb index ae785e2..ae785e2 100644 --- a/gcc/ada/libgnat/s-putaim.adb +++ b/gcc/ada/libgnarl/s-putaim.adb diff --git a/gcc/ada/libgnat/s-putaim.ads b/gcc/ada/libgnarl/s-putaim.ads index 5ad69db..5ad69db 100644 --- a/gcc/ada/libgnat/s-putaim.ads +++ b/gcc/ada/libgnarl/s-putaim.ads diff --git a/gcc/ada/libgnat/a-cdlili.ads b/gcc/ada/libgnat/a-cdlili.ads index aed02bc..8d2d345 100644 --- a/gcc/ada/libgnat/a-cdlili.ads +++ b/gcc/ada/libgnat/a-cdlili.ads @@ -66,7 +66,9 @@ is pragma Preelaborable_Initialization (Cursor); Empty_List : constant List; + function Empty return List; + pragma Ada_2022 (Empty); No_Element : constant Cursor; diff --git a/gcc/ada/libgnat/a-cidlli.ads b/gcc/ada/libgnat/a-cidlli.ads index ee92e71..d5c4e45 100644 --- a/gcc/ada/libgnat/a-cidlli.ads +++ b/gcc/ada/libgnat/a-cidlli.ads @@ -65,7 +65,9 @@ is pragma Preelaborable_Initialization (Cursor); Empty_List : constant List; + function Empty return List; + pragma Ada_2022 (Empty); No_Element : constant Cursor; diff --git a/gcc/ada/libgnat/a-ciorma.ads b/gcc/ada/libgnat/a-ciorma.ads index 734fdb2..68e9b93 100644 --- a/gcc/ada/libgnat/a-ciorma.ads +++ b/gcc/ada/libgnat/a-ciorma.ads @@ -70,6 +70,7 @@ is Empty_Map : constant Map; function Empty return Map; + pragma Ada_2022 (Empty); No_Element : constant Cursor; function Has_Element (Position : Cursor) return Boolean; diff --git a/gcc/ada/libgnat/a-cobove.ads b/gcc/ada/libgnat/a-cobove.ads index e808d85..eb8072d 100644 --- a/gcc/ada/libgnat/a-cobove.ads +++ b/gcc/ada/libgnat/a-cobove.ads @@ -80,12 +80,14 @@ package Ada.Containers.Bounded_Vectors is Ada.Iterator_Interfaces (Cursor, Has_Element); function Empty (Capacity : Count_Type := 10) return Vector; + pragma Ada_2022 (Empty); overriding function "=" (Left, Right : Vector) return Boolean; function New_Vector (First, Last : Index_Type) return Vector with Pre => First = Index_Type'First; -- Ada 2022 aggregate operation. + pragma Ada_2022 (New_Vector); function To_Vector (Length : Count_Type) return Vector; @@ -194,6 +196,7 @@ package Ada.Containers.Bounded_Vectors is (Container : in out Vector; Before : Extended_Index; New_Item : Vector); + pragma Ada_2022 (Insert_Vector); procedure Insert (Container : in out Vector; @@ -205,6 +208,7 @@ package Ada.Containers.Bounded_Vectors is (Container : in out Vector; Before : Cursor; New_Item : Vector); + pragma Ada_2022 (Insert_Vector); procedure Insert (Container : in out Vector; @@ -217,6 +221,7 @@ package Ada.Containers.Bounded_Vectors is Before : Cursor; New_Item : Vector; Position : out Cursor); + pragma Ada_2022 (Insert_Vector); procedure Insert (Container : in out Vector; @@ -258,6 +263,7 @@ package Ada.Containers.Bounded_Vectors is procedure Prepend_Vector (Container : in out Vector; New_Item : Vector); + pragma Ada_2022 (Prepend_Vector); procedure Prepend (Container : in out Vector; @@ -272,6 +278,7 @@ package Ada.Containers.Bounded_Vectors is procedure Append_Vector (Container : in out Vector; New_Item : Vector); + pragma Ada_2022 (Append_Vector); procedure Append (Container : in out Vector; diff --git a/gcc/ada/libgnat/a-coorma.ads b/gcc/ada/libgnat/a-coorma.ads index 735b0b1..5740621 100644 --- a/gcc/ada/libgnat/a-coorma.ads +++ b/gcc/ada/libgnat/a-coorma.ads @@ -67,7 +67,9 @@ is pragma Preelaborable_Initialization (Cursor); Empty_Map : constant Map; + function Empty return Map; + pragma Ada_2022 (Empty); No_Element : constant Cursor; diff --git a/gcc/ada/libgnat/a-strunb__shared.adb b/gcc/ada/libgnat/a-strunb__shared.adb index 00327de..d2907f6 100644 --- a/gcc/ada/libgnat/a-strunb__shared.adb +++ b/gcc/ada/libgnat/a-strunb__shared.adb @@ -50,11 +50,13 @@ package body Ada.Strings.Unbounded is -- align the returned memory on the maximum alignment as malloc does not -- know the target alignment. - function Aligned_Max_Length (Max_Length : Natural) return Natural; + function Aligned_Max_Length + (Required_Length : Natural; + Reserved_Length : Natural) return Natural; -- Returns recommended length of the shared string which is greater or - -- equal to specified length. Calculation take in sense alignment of the - -- allocated memory segments to use memory effectively by Append/Insert/etc - -- operations. + -- equal to specified required length and desired reserved length. + -- Calculation takes into account alignment of the allocated memory + -- segments to use memory effectively by Append/Insert/etc operations. function Sum (Left : Natural; Right : Integer) return Natural with Inline; -- Returns summary of Left and Right, raise Constraint_Error on overflow @@ -63,11 +65,6 @@ package body Ada.Strings.Unbounded is -- Returns multiplication of Left and Right, raise Constraint_Error on -- overflow - function Allocate - (Length, Growth : Natural) return not null Shared_String_Access; - -- Allocates new Shared_String with at least specified Length plus optional - -- Growth. - --------- -- "&" -- --------- @@ -490,17 +487,24 @@ package body Ada.Strings.Unbounded is -- Aligned_Max_Length -- ------------------------ - function Aligned_Max_Length (Max_Length : Natural) return Natural is + function Aligned_Max_Length + (Required_Length : Natural; + Reserved_Length : Natural) return Natural + is Static_Size : constant Natural := Empty_Shared_String'Size / Standard'Storage_Unit; -- Total size of all Shared_String static components begin - if Max_Length > Natural'Last - Static_Size then + if Required_Length > Natural'Last - Static_Size - Reserved_Length then + -- Total requested length is larger than maximum possible length. + -- Use of Static_Size needed to avoid overflows in expression to + -- compute aligned length. return Natural'Last; + else return - ((Static_Size + Max_Length - 1) / Min_Mul_Alloc + 2) * Min_Mul_Alloc - - Static_Size; + ((Static_Size + Required_Length + Reserved_Length - 1) + / Min_Mul_Alloc + 2) * Min_Mul_Alloc - Static_Size; end if; end Aligned_Max_Length; @@ -509,35 +513,21 @@ package body Ada.Strings.Unbounded is -------------- function Allocate - (Max_Length : Natural) return not null Shared_String_Access + (Required_Length : Natural; + Reserved_Length : Natural := 0) return not null Shared_String_Access is begin -- Empty string requested, return shared empty string - if Max_Length = 0 then + if Required_Length = 0 then return Empty_Shared_String'Access; -- Otherwise, allocate requested space (and probably some more room) else - return new Shared_String (Aligned_Max_Length (Max_Length)); - end if; - end Allocate; - - -------------- - -- Allocate -- - -------------- - - function Allocate - (Length, Growth : Natural) return not null Shared_String_Access is - begin - if Natural'Last - Growth < Length then - -- Then Length + Growth would be more than Natural'Last - - return new Shared_String (Integer'Last); - - else - return Allocate (Length + Growth); + return + new Shared_String + (Aligned_Max_Length (Required_Length, Reserved_Length)); end if; end Allocate; @@ -657,7 +647,7 @@ package body Ada.Strings.Unbounded is System.Atomic_Counters.Is_One (Item.Counter) and then Item.Max_Length >= Length and then Item.Max_Length <= - Aligned_Max_Length (Length + Length / Growth_Factor); + Aligned_Max_Length (Length, Length / Growth_Factor); end Can_Be_Reused; ----------- diff --git a/gcc/ada/libgnat/a-strunb__shared.ads b/gcc/ada/libgnat/a-strunb__shared.ads index ee446a6..094bf7e 100644 --- a/gcc/ada/libgnat/a-strunb__shared.ads +++ b/gcc/ada/libgnat/a-strunb__shared.ads @@ -725,10 +725,12 @@ private -- store string with specified length effectively. function Allocate - (Max_Length : Natural) return not null Shared_String_Access; - -- Allocates new Shared_String with at least specified maximum length. - -- Actual maximum length of the allocated Shared_String can be slightly - -- greater. Returns reference to Empty_Shared_String when requested length + (Required_Length : Natural; + Reserved_Length : Natural := 0) return not null Shared_String_Access; + -- Allocates new Shared_String. Actual maximum length of allocated object + -- is at least the specified required length. Additional storage is + -- allocated to allow to store up to the specified reserved length when + -- possible. Returns reference to Empty_Shared_String when requested length -- is zero. Empty_Shared_String : aliased Shared_String (0); diff --git a/gcc/ada/libgnat/a-textio.ads b/gcc/ada/libgnat/a-textio.ads index f6c0a8a..a06a35c 100644 --- a/gcc/ada/libgnat/a-textio.ads +++ b/gcc/ada/libgnat/a-textio.ads @@ -715,7 +715,7 @@ private -- Returns the system-specific character indicating the end of a text file. -- This is exported for use by child packages such as Enumeration_Aux to -- eliminate their needing to depend directly on Interfaces.C_Streams, - -- which is not available in certain target environments (such as AAMP). + -- which might not be available in certain target environments. procedure Initialize_Standard_Files; -- Initializes the file control blocks for the standard files. Called from diff --git a/gcc/ada/libgnat/g-comver.adb b/gcc/ada/libgnat/g-comver.adb index e2aef3e..575caac 100644 --- a/gcc/ada/libgnat/g-comver.adb +++ b/gcc/ada/libgnat/g-comver.adb @@ -33,6 +33,8 @@ -- GNAT compiler used to compile the program. It relies on the generated -- constant in the binder generated package that records this information. +with System; + package body GNAT.Compiler_Version is Ver_Len_Max : constant := 256; @@ -43,8 +45,15 @@ package body GNAT.Compiler_Version is -- This is logically a reference to Gnatvsn.Ver_Prefix but we cannot -- import this directly since run-time units cannot WITH compiler units. + GNAT_Version_Address : constant System.Address; + pragma Import (C, GNAT_Version_Address, "__gnat_version_address"); + GNAT_Version : constant String (1 .. Ver_Len_Max + Ver_Prefix'Length); - pragma Import (C, GNAT_Version, "__gnat_version"); + pragma Import (Ada, GNAT_Version); + for GNAT_Version'Address use GNAT_Version_Address; + -- Use a level of indirection via __gnat_version_address to avoid LTO + -- type mismtch warnings between two string objects of potentially + -- different size. ------------- -- Version -- diff --git a/gcc/ada/libgnat/g-memdum.ads b/gcc/ada/libgnat/g-memdum.ads index 61b599b..be74588 100644 --- a/gcc/ada/libgnat/g-memdum.ads +++ b/gcc/ada/libgnat/g-memdum.ads @@ -46,9 +46,9 @@ package GNAT.Memory_Dump is -- Dumps indicated number (Count) of bytes, starting at the address given -- by Addr. The coding of this routine in its current form assumes the case -- of a byte addressable machine (and is therefore inapplicable to machines - -- like the AAMP, where the storage unit is not 8 bits). The output is one - -- or more lines in the following format, which is for the case of 32-bit - -- addresses (64-bit addresses are handled appropriately): + -- where the storage unit is not 8 bits). The output is one or more lines + -- in the following format, which is for the case of 32-bit addresses + -- (64-bit addresses are handled appropriately): -- -- 0234_3368: 66 67 68 . . . 73 74 75 "fghijklmnopqstuv" -- diff --git a/gcc/ada/libgnat/g-rewdat.adb b/gcc/ada/libgnat/g-rewdat.adb index c257afa..3b4a0d0 100644 --- a/gcc/ada/libgnat/g-rewdat.adb +++ b/gcc/ada/libgnat/g-rewdat.adb @@ -37,7 +37,7 @@ package body GNAT.Rewrite_Data is subtype SEO is Stream_Element_Offset; procedure Do_Output - (B : in out Buffer; + (B : Buffer; Data : Stream_Element_Array; Output : not null access procedure (Data : Stream_Element_Array)); -- Do the actual output. This ensures that we properly send the data @@ -81,7 +81,7 @@ package body GNAT.Rewrite_Data is --------------- procedure Do_Output - (B : in out Buffer; + (B : Buffer; Data : Stream_Element_Array; Output : not null access procedure (Data : Stream_Element_Array)) is diff --git a/gcc/ada/libgnat/i-c.ads b/gcc/ada/libgnat/i-c.ads index 5c36245..428ea49 100644 --- a/gcc/ada/libgnat/i-c.ads +++ b/gcc/ada/libgnat/i-c.ads @@ -63,8 +63,8 @@ package Interfaces.C is -- Boolean type - type bool is new Boolean; - pragma Convention (C, bool); + type C_bool is new Boolean; + pragma Convention (C, C_bool); -- Floating-Point diff --git a/gcc/ada/libgnat/i-cexten.ads b/gcc/ada/libgnat/i-cexten.ads index 42eb578..70d2621 100644 --- a/gcc/ada/libgnat/i-cexten.ads +++ b/gcc/ada/libgnat/i-cexten.ads @@ -56,7 +56,7 @@ package Interfaces.C.Extensions is -- C bool - subtype bool is Interfaces.C.bool; + subtype bool is Interfaces.C.C_bool; -- 64-bit integer types diff --git a/gcc/ada/libgnat/i-cexten__128.ads b/gcc/ada/libgnat/i-cexten__128.ads index 70727b7..c07c5ab 100644 --- a/gcc/ada/libgnat/i-cexten__128.ads +++ b/gcc/ada/libgnat/i-cexten__128.ads @@ -56,7 +56,7 @@ package Interfaces.C.Extensions is -- C bool - subtype bool is Interfaces.C.bool; + subtype bool is Interfaces.C.C_bool; -- 64-bit integer types diff --git a/gcc/ada/libgnat/s-objrea.adb b/gcc/ada/libgnat/s-objrea.adb index 50be05a..b5ca32f 100644 --- a/gcc/ada/libgnat/s-objrea.adb +++ b/gcc/ada/libgnat/s-objrea.adb @@ -47,7 +47,7 @@ package body System.Object_Reader is function Trim_Trailing_Nuls (Str : String) return String; -- Return a copy of a string with any trailing NUL characters truncated - procedure Check_Read_Offset (S : in out Mapped_Stream; Size : uint32); + procedure Check_Read_Offset (S : Mapped_Stream; Size : uint32); -- Check that the SIZE bytes at the current offset are still in the stream ------------------------------------- @@ -1931,7 +1931,7 @@ package body System.Object_Reader is return To_String_Ptr_Len (Read (S)); end Read; - procedure Check_Read_Offset (S : in out Mapped_Stream; Size : uint32) is + procedure Check_Read_Offset (S : Mapped_Stream; Size : uint32) is begin if S.Off + Offset (Size) > Offset (Last (S.Region)) then raise IO_Error with "could not read from object file"; diff --git a/gcc/ada/libgnat/s-scaval.adb b/gcc/ada/libgnat/s-scaval.adb index 71578ee..81394af 100644 --- a/gcc/ada/libgnat/s-scaval.adb +++ b/gcc/ada/libgnat/s-scaval.adb @@ -60,26 +60,17 @@ package body System.Scalar_Values is EFloat : constant Boolean := Long_Long_Float'Size > Long_Float'Size; -- Set True if we are on an x86 with 96-bit floats for extended - AFloat : constant Boolean := - Long_Float'Size = 48 and then Long_Long_Float'Size = 48; - -- Set True if we are on an AAMP with 48-bit extended floating point - - type ByteLF is array (0 .. 7 - 2 * Boolean'Pos (AFloat)) of Byte1; + type ByteLF is array (0 .. 7) of Byte1; for ByteLF'Component_Size use 8; - -- Type used to hold Long_Float values on all targets and to initialize - -- 48-bit Long_Float values used on AAMP. On AAMP, this type is 6 bytes. - -- On other targets the type is 8 bytes, and type Byte8 is used for - -- values that are then converted to ByteLF. + -- Type used to hold Long_Float values on all targets. On most targets + -- the type is 8 bytes, and type Byte8 is used for values that are then + -- converted to ByteLF. - pragma Warnings (Off); -- why ??? function To_ByteLF is new Ada.Unchecked_Conversion (Byte8, ByteLF); - pragma Warnings (On); - type ByteLLF is - array (0 .. 7 + 4 * Boolean'Pos (EFloat) - 2 * Boolean'Pos (AFloat)) - of Byte1; + type ByteLLF is array (0 .. 7 + 4 * Boolean'Pos (EFloat)) of Byte1; for ByteLLF'Component_Size use 8; @@ -186,16 +177,9 @@ package body System.Scalar_Values is IS_Iz4 := 16#0000_0000#; IS_Iz8 := 16#0000_0000_0000_0000#; - if AFloat then - IV_Isf := 16#FFFF_FF00#; - IV_Ifl := 16#FFFF_FF00#; - IV_Ilf := (0, 16#FF#, 16#FF#, 16#FF#, 16#FF#, 16#FF#); - - else - IV_Isf := IS_Iu4; - IV_Ifl := IS_Iu4; - IV_Ilf := To_ByteLF (IS_Iu8); - end if; + IV_Isf := IS_Iu4; + IV_Ifl := IS_Iu4; + IV_Ilf := To_ByteLF (IS_Iu8); if EFloat then IV_Ill := (0, 0, 0, 0, 0, 0, 0, 16#C0#, 16#FF#, 16#FF#, 0, 0); @@ -219,16 +203,9 @@ package body System.Scalar_Values is IS_Iz4 := 16#0000_0000#; IS_Iz8 := 16#0000_0000_0000_0000#; - if AFloat then - IV_Isf := 16#0000_0001#; - IV_Ifl := 16#0000_0001#; - IV_Ilf := (1, 0, 0, 0, 0, 0); - - else - IV_Isf := 16#FF80_0000#; - IV_Ifl := 16#FF80_0000#; - IV_Ilf := To_ByteLF (16#FFF0_0000_0000_0000#); - end if; + IV_Isf := 16#FF80_0000#; + IV_Ifl := 16#FF80_0000#; + IV_Ilf := To_ByteLF (16#FFF0_0000_0000_0000#); if EFloat then IV_Ill := (0, 0, 0, 0, 0, 0, 0, 16#80#, 16#FF#, 16#FF#, 0, 0); @@ -252,16 +229,9 @@ package body System.Scalar_Values is IS_Iz4 := 16#FFFF_FFFF#; IS_Iz8 := 16#FFFF_FFFF_FFFF_FFFF#; - if AFloat then - IV_Isf := 16#7FFF_FFFF#; - IV_Ifl := 16#7FFF_FFFF#; - IV_Ilf := (16#FF#, 16#FF#, 16#FF#, 16#FF#, 16#FF#, 16#7F#); - - else - IV_Isf := 16#7F80_0000#; - IV_Ifl := 16#7F80_0000#; - IV_Ilf := To_ByteLF (16#7FF0_0000_0000_0000#); - end if; + IV_Isf := 16#7F80_0000#; + IV_Ifl := 16#7F80_0000#; + IV_Ilf := To_ByteLF (16#7FF0_0000_0000_0000#); if EFloat then IV_Ill := (0, 0, 0, 0, 0, 0, 0, 16#80#, 16#FF#, 16#7F#, 0, 0); @@ -301,11 +271,7 @@ package body System.Scalar_Values is IV_Isf := IS_Is4; IV_Ifl := IS_Is4; - if AFloat then - IV_Ill := (B, B, B, B, B, B); - else - IV_Ilf := To_ByteLF (IS_Is8); - end if; + IV_Ilf := To_ByteLF (IS_Is8); if EFloat then IV_Ill := (B, B, B, B, B, B, B, B, B, B, B, B); @@ -317,7 +283,7 @@ package body System.Scalar_Values is if not EFloat then declare - pragma Warnings (Off); -- why??? + pragma Warnings (Off); -- because sizes don't match function To_ByteLLF is new Ada.Unchecked_Conversion (ByteLF, ByteLLF); pragma Warnings (On); diff --git a/gcc/ada/libgnat/s-scaval__128.adb b/gcc/ada/libgnat/s-scaval__128.adb index bb36b84..7bb5696 100644 --- a/gcc/ada/libgnat/s-scaval__128.adb +++ b/gcc/ada/libgnat/s-scaval__128.adb @@ -60,26 +60,12 @@ package body System.Scalar_Values is EFloat : constant Boolean := Long_Long_Float'Size > Long_Float'Size; -- Set True if we are on an x86 with 96-bit floats for extended - AFloat : constant Boolean := - Long_Float'Size = 48 and then Long_Long_Float'Size = 48; - -- Set True if we are on an AAMP with 48-bit extended floating point - - type ByteLF is array (0 .. 7 - 2 * Boolean'Pos (AFloat)) of Byte1; + type ByteLF is array (0 .. 7) of Byte1; for ByteLF'Component_Size use 8; - - -- Type used to hold Long_Float values on all targets and to initialize - -- 48-bit Long_Float values used on AAMP. On AAMP, this type is 6 bytes. - -- On other targets the type is 8 bytes, and type Byte8 is used for - -- values that are then converted to ByteLF. - - pragma Warnings (Off); -- why ??? function To_ByteLF is new Ada.Unchecked_Conversion (Byte8, ByteLF); - pragma Warnings (On); - type ByteLLF is - array (0 .. 7 + 4 * Boolean'Pos (EFloat) - 2 * Boolean'Pos (AFloat)) - of Byte1; + type ByteLLF is array (0 .. 7 + 4 * Boolean'Pos (EFloat)) of Byte1; for ByteLLF'Component_Size use 8; @@ -189,16 +175,9 @@ package body System.Scalar_Values is IS_Iz8 := 16#0000_0000_0000_0000#; IS_Iz16 := 16#0000_0000_0000_0000_0000_0000_0000_0000#; - if AFloat then - IV_Isf := 16#FFFF_FF00#; - IV_Ifl := 16#FFFF_FF00#; - IV_Ilf := (0, 16#FF#, 16#FF#, 16#FF#, 16#FF#, 16#FF#); - - else - IV_Isf := IS_Iu4; - IV_Ifl := IS_Iu4; - IV_Ilf := To_ByteLF (IS_Iu8); - end if; + IV_Isf := IS_Iu4; + IV_Ifl := IS_Iu4; + IV_Ilf := To_ByteLF (IS_Iu8); if EFloat then IV_Ill := (0, 0, 0, 0, 0, 0, 0, 16#C0#, 16#FF#, 16#FF#, 0, 0); @@ -225,16 +204,9 @@ package body System.Scalar_Values is IS_Iz8 := 16#0000_0000_0000_0000#; IS_Iz16 := 16#0000_0000_0000_0000_0000_0000_0000_0000#; - if AFloat then - IV_Isf := 16#0000_0001#; - IV_Ifl := 16#0000_0001#; - IV_Ilf := (1, 0, 0, 0, 0, 0); - - else - IV_Isf := 16#FF80_0000#; - IV_Ifl := 16#FF80_0000#; - IV_Ilf := To_ByteLF (16#FFF0_0000_0000_0000#); - end if; + IV_Isf := 16#FF80_0000#; + IV_Ifl := 16#FF80_0000#; + IV_Ilf := To_ByteLF (16#FFF0_0000_0000_0000#); if EFloat then IV_Ill := (0, 0, 0, 0, 0, 0, 0, 16#80#, 16#FF#, 16#FF#, 0, 0); @@ -261,16 +233,9 @@ package body System.Scalar_Values is IS_Iz8 := 16#FFFF_FFFF_FFFF_FFFF#; IS_Iz16 := 16#FFFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF#; - if AFloat then - IV_Isf := 16#7FFF_FFFF#; - IV_Ifl := 16#7FFF_FFFF#; - IV_Ilf := (16#FF#, 16#FF#, 16#FF#, 16#FF#, 16#FF#, 16#7F#); - - else - IV_Isf := 16#7F80_0000#; - IV_Ifl := 16#7F80_0000#; - IV_Ilf := To_ByteLF (16#7FF0_0000_0000_0000#); - end if; + IV_Isf := 16#7F80_0000#; + IV_Ifl := 16#7F80_0000#; + IV_Ilf := To_ByteLF (16#7FF0_0000_0000_0000#); if EFloat then IV_Ill := (0, 0, 0, 0, 0, 0, 0, 16#80#, 16#FF#, 16#7F#, 0, 0); @@ -313,11 +278,7 @@ package body System.Scalar_Values is IV_Isf := IS_Is4; IV_Ifl := IS_Is4; - if AFloat then - IV_Ill := (B, B, B, B, B, B); - else - IV_Ilf := To_ByteLF (IS_Is8); - end if; + IV_Ilf := To_ByteLF (IS_Is8); if EFloat then IV_Ill := (B, B, B, B, B, B, B, B, B, B, B, B); @@ -329,7 +290,7 @@ package body System.Scalar_Values is if not EFloat then declare - pragma Warnings (Off); -- why??? + pragma Warnings (Off); -- because sizes don't match function To_ByteLLF is new Ada.Unchecked_Conversion (ByteLF, ByteLLF); pragma Warnings (On); diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb index adff94a..f7f166c 100644 --- a/gcc/ada/make.adb +++ b/gcc/ada/make.adb @@ -4594,18 +4594,6 @@ package body Make is Add_Switch ("-aO" & Argv (4 .. Argv'Last), Binder); - -- -aamp_target=... - - elsif Argv'Length >= 13 and then Argv (2 .. 13) = "aamp_target=" then - Add_Switch (Argv, Compiler); - - -- Set the aamp_target environment variable so that the binder and - -- linker will use the proper target library. This is consistent - -- with how things work when -aamp_target is passed on the command - -- line to gnaampmake. - - Setenv ("aamp_target", Argv (14 .. Argv'Last)); - -- -Adir (to gnatbind this is like a -aO switch, to gcc like a -I) elsif Argv (2) = 'A' then diff --git a/gcc/ada/opt.adb b/gcc/ada/opt.adb index a2d6eda..cd909495 100644 --- a/gcc/ada/opt.adb +++ b/gcc/ada/opt.adb @@ -84,7 +84,6 @@ package body Opt is Default_SSO_Config := Default_SSO; Dynamic_Elaboration_Checks_Config := Dynamic_Elaboration_Checks; Exception_Locations_Suppressed_Config := Exception_Locations_Suppressed; - Extensions_Allowed_Config := Extensions_Allowed; External_Name_Exp_Casing_Config := External_Name_Exp_Casing; External_Name_Imp_Casing_Config := External_Name_Imp_Casing; Fast_Math_Config := Fast_Math; @@ -123,7 +122,6 @@ package body Opt is Default_SSO := Save.Default_SSO; Dynamic_Elaboration_Checks := Save.Dynamic_Elaboration_Checks; Exception_Locations_Suppressed := Save.Exception_Locations_Suppressed; - Extensions_Allowed := Save.Extensions_Allowed; External_Name_Exp_Casing := Save.External_Name_Exp_Casing; External_Name_Imp_Casing := Save.External_Name_Imp_Casing; Fast_Math := Save.Fast_Math; @@ -165,7 +163,6 @@ package body Opt is Default_SSO => Default_SSO, Dynamic_Elaboration_Checks => Dynamic_Elaboration_Checks, Exception_Locations_Suppressed => Exception_Locations_Suppressed, - Extensions_Allowed => Extensions_Allowed, External_Name_Exp_Casing => External_Name_Exp_Casing, External_Name_Imp_Casing => External_Name_Imp_Casing, Fast_Math => Fast_Math, @@ -204,7 +201,6 @@ package body Opt is Ada_Version_Pragma := Empty; Default_SSO := ' '; Dynamic_Elaboration_Checks := False; - Extensions_Allowed := True; External_Name_Exp_Casing := As_Is; External_Name_Imp_Casing := Lowercase; No_Component_Reordering := False; @@ -263,7 +259,6 @@ package body Opt is Check_Policy_List := Check_Policy_List_Config; Default_SSO := Default_SSO_Config; Dynamic_Elaboration_Checks := Dynamic_Elaboration_Checks_Config; - Extensions_Allowed := Extensions_Allowed_Config; External_Name_Exp_Casing := External_Name_Exp_Casing_Config; External_Name_Imp_Casing := External_Name_Imp_Casing_Config; Fast_Math := Fast_Math_Config; diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads index 429bd42..827bbef 100644 --- a/gcc/ada/opt.ads +++ b/gcc/ada/opt.ads @@ -68,17 +68,20 @@ package Opt is -- the default values. Latest_Ada_Only : Boolean := False; - -- If True, the only value valid for Ada_Version is Ada_Version_Type'Last, - -- trying to specify other values will be ignored (in case of pragma + -- If True, the only value valid for Ada_Version is Ada_2012 or later. + -- Trying to specify other values will be ignored (in case of pragma -- Ada_xxx) or generate an error (in case of -gnat83/95/xx switches). - type Ada_Version_Type is (Ada_83, Ada_95, Ada_2005, Ada_2012, Ada_2022); + type Ada_Version_Type is + (Ada_83, Ada_95, Ada_2005, Ada_2012, Ada_2022, Ada_With_Extensions); pragma Ordered (Ada_Version_Type); pragma Convention (C, Ada_Version_Type); -- Versions of Ada for Ada_Version below. Note that these are ordered, -- so that tests like Ada_Version >= Ada_95 are legitimate and useful. -- Think twice before using "="; Ada_Version >= Ada_2012 is more likely -- what you want, because it will apply to future versions of the language. + -- Note that Ada_With_Extensions should always be last since it should + -- always be a superset of the latest Ada version. -- WARNING: There is a matching C declaration of this type in fe.h @@ -108,7 +111,7 @@ package Opt is -- remains set to Ada_Version_Default). This is used in the rare cases -- (notably pragma Obsolescent) where we want the explicit version set. - Ada_Version_Runtime : Ada_Version_Type := Ada_2022; + Ada_Version_Runtime : Ada_Version_Type := Ada_With_Extensions; -- GNAT -- Ada version used to compile the runtime. Used to set Ada_Version (but -- not Ada_Version_Explicit) when compiling predefined or internal units. @@ -623,10 +626,10 @@ package Opt is -- Set to True to convert nonbinary modular additions into code -- that relies on the front-end expansion of operator Mod. - Extensions_Allowed : Boolean := False; - -- GNAT - -- Set to True by switch -gnatX if GNAT specific language extensions - -- are allowed. See GNAT RM for details. + function Extensions_Allowed return Boolean is + (Ada_Version = Ada_With_Extensions); + -- True if GNAT specific language extensions are allowed. See GNAT RM for + -- details. type External_Casing_Type is ( As_Is, -- External names cased as they appear in the Ada source @@ -912,6 +915,11 @@ package Opt is -- directory if these files already exist or in the source directory -- if not. + JSON_Output : Boolean := False; + -- GNAT + -- Output error and warning messages in JSON format. Set to true when the + -- backend option "-fdiagnostics-format=json" is found on the command line. + Keep_Going : Boolean := False; -- GNATMAKE, GPRBUILD -- When True signals to ignore compilation errors and keep processing @@ -2040,14 +2048,6 @@ package Opt is -- GNAT -- Set True by use of the configuration pragma Suppress_Exception_Messages - Extensions_Allowed_Config : Boolean; - -- GNAT - -- This is the flag that indicates whether extensions are allowed. It can - -- be set True either by use of the -gnatX switch, or by use of the - -- configuration pragma Extensions_Allowed (On). It is always set to True - -- for internal GNAT units, since extensions are always permitted in such - -- units. - External_Name_Exp_Casing_Config : External_Casing_Type; -- GNAT -- This is the value of the configuration switch that controls casing of @@ -2331,7 +2331,6 @@ private Default_SSO : Character; Dynamic_Elaboration_Checks : Boolean; Exception_Locations_Suppressed : Boolean; - Extensions_Allowed : Boolean; External_Name_Exp_Casing : External_Casing_Type; External_Name_Imp_Casing : External_Casing_Type; Fast_Math : Boolean; diff --git a/gcc/ada/osint.ads b/gcc/ada/osint.ads index 006cb38..f481812 100644 --- a/gcc/ada/osint.ads +++ b/gcc/ada/osint.ads @@ -140,14 +140,12 @@ package Osint is -- path) in Name_Buffer, with the length in Name_Len. function Program_Name (Nam : String; Prog : String) return String_Access; - -- In the native compilation case, Create a string containing Nam. In the + -- In the native compilation case, creates a string containing Nam. In the -- cross compilation case, looks at the prefix of the current program being - -- run and prepend it to Nam. For instance if the program being run is + -- run and prepends it to Nam. For instance if the program being run is -- <target>-gnatmake and Nam is "gcc", the returned value will be a pointer - -- to "<target>-gcc". In the specific case where AAMP_On_Target is set, the - -- name "gcc" is mapped to "gnaamp", and names of the form "gnat*" are - -- mapped to "gnaamp*". This function clobbers Name_Buffer and Name_Len. - -- Also look at any suffix, e.g. gnatmake-4.1 -> "gcc-4.1". Prog is the + -- to "<target>-gcc". This function clobbers Name_Buffer and Name_Len. + -- Also looks at any suffix, e.g. gnatmake-4.1 -> "gcc-4.1". Prog is the -- default name of the current program being executed, e.g. "gnatmake", -- "gnatlink". diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb index 2a79599..52e52dc 100644 --- a/gcc/ada/par-ch3.adb +++ b/gcc/ada/par-ch3.adb @@ -2693,6 +2693,73 @@ package body Ch3 is Scan_State : Saved_Scan_State; Aliased_Present : Boolean := False; + procedure P_Index_Subtype_Def_With_Fixed_Lower_Bound + (Subtype_Mark : Node_Id); + -- Parse an unconstrained index range with a fixed lower bound: + -- subtype_mark range <expression> .. <> + -- This procedure creates a subtype_indication node for the index. + + -------------------------------------------- + -- P_Index_Range_With_Fixed_Lower_Bound -- + -------------------------------------------- + + procedure P_Index_Subtype_Def_With_Fixed_Lower_Bound + (Subtype_Mark : Node_Id) + is + Low_Expr_Node : constant Node_Id := P_Expression; + High_Expr_Node : Node_Id; + Indic_Node : Node_Id; + Constr_Node : Node_Id; + Range_Node : Node_Id; + + begin + T_Dot_Dot; -- Error if no .. + + -- A box is required at this point, and we'll set the upper bound to + -- the same expression as the lower bound (see further below), to + -- avoid problems with trying to analyze an Empty node. Analysis can + -- still tell that this is a fixed-lower-bound range because the + -- index is represented by a subtype_indication in an unconstrained + -- array type definition. + + if Token = Tok_Box then + Scan; + High_Expr_Node := Low_Expr_Node; + + -- Error if no <> was found, and try to parse an expression since + -- it's likely one was given in place of the <>. + + else + Error_Msg_AP -- CODEFIX + ("missing ""'<'>"""); + + High_Expr_Node := P_Expression; + end if; + + Constr_Node := New_Node (N_Range_Constraint, Token_Ptr); + Range_Node := New_Node (N_Range, Token_Ptr); + Set_Range_Expression (Constr_Node, Range_Node); + + Check_Simple_Expression (Low_Expr_Node); + + Set_Low_Bound (Range_Node, Low_Expr_Node); + Set_High_Bound (Range_Node, High_Expr_Node); + + Indic_Node := + New_Node (N_Subtype_Indication, Sloc (Subtype_Mark)); + Set_Subtype_Mark (Indic_Node, Check_Subtype_Mark (Subtype_Mark)); + Set_Constraint (Indic_Node, Constr_Node); + + Append (Indic_Node, Subs_List); + end P_Index_Subtype_Def_With_Fixed_Lower_Bound; + + -- Local variables + + Is_Constrained_Array_Def : Boolean := True; + Subtype_Mark_Node : Node_Id; + + -- Start of processing for P_Array_Type_Definition + begin Array_Loc := Token_Ptr; Scan; -- past ARRAY @@ -2724,17 +2791,125 @@ package body Ch3 is Def_Node := New_Node (N_Unconstrained_Array_Definition, Array_Loc); Restore_Scan_State (Scan_State); -- to first subtype mark + Is_Constrained_Array_Def := False; + + -- Now parse a sequence of indexes where each is either of form: + -- <subtype_mark> range <> + -- or + -- <subtype_mark> range <expr> .. <> + -- + -- The latter syntax indicates an index with a fixed lower bound, + -- and only applies when extensions are enabled (-gnatX). + loop - Append (P_Subtype_Mark_Resync, Subs_List); + Subtype_Mark_Node := P_Subtype_Mark_Resync; + T_Range; - T_Box; + + -- Normal "subtype_mark range <>" form, so simply append + -- the subtype reference. + + if Token = Tok_Box then + Append (Subtype_Mark_Node, Subs_List); + Scan; + + -- Fixed-lower-bound form ("subtype_mark range <expr> .. <>") + + else + P_Index_Subtype_Def_With_Fixed_Lower_Bound (Subtype_Mark_Node); + + if not Extensions_Allowed then + Error_Msg_N + ("fixed-lower-bound array is an extension feature; " + & "use -gnatX", + Token_Node); + end if; + end if; + exit when Token = Tok_Right_Paren or else Token = Tok_Of; T_Comma; end loop; Set_Subtype_Marks (Def_Node, Subs_List); - else + -- If we don't have "range <>", then "range" will be followed by an + -- expression, for either a normal range or a fixed-lower-bound range + -- ("<exp> .. <>"), and we have to know which, in order to determine + -- whether to parse the indexes for an unconstrained or constrained + -- array definition. So we look ahead to see if "<>" follows the "..". + -- If not, then this must be a discrete_subtype_indication for a + -- constrained_array_definition, which will be processed further below. + + elsif Prev_Token = Tok_Range + and then Token /= Tok_Right_Paren and then Token /= Tok_Comma + then + -- If we have an expression followed by "..", then scan farther + -- and check for "<>" to see if we have a fixed-lower-bound range. + + if P_Expression_Or_Range_Attribute /= Error + and then Expr_Form /= EF_Range_Attr + and then Token = Tok_Dot_Dot + then + Scan; + + -- If there's a "<>", then we know we have a fixed-lower-bound + -- index, so we can proceed with parsing an unconstrained array + -- definition. + + if Token = Tok_Box then + Is_Constrained_Array_Def := False; + + Def_Node := + New_Node (N_Unconstrained_Array_Definition, Array_Loc); + + Restore_Scan_State (Scan_State); -- to first subtype mark + + -- Now parse a sequence of indexes where each is either of + -- form: + -- <subtype_mark> range <> + -- or + -- <subtype_mark> range <expr> .. <> + -- + -- The latter indicates an index with a fixed lower bound, + -- and only applies when extensions are enabled (-gnatX). + + loop + Subtype_Mark_Node := P_Subtype_Mark_Resync; + + T_Range; + + -- Normal "subtype_mark range <>" form, so simply append + -- the subtype reference. + + if Token = Tok_Box then + Append (Subtype_Mark_Node, Subs_List); + Scan; + + -- This must be an index of form: + -- <subtype_mark> range <expr> .. <>" + + else + P_Index_Subtype_Def_With_Fixed_Lower_Bound + (Subtype_Mark_Node); + + if not Extensions_Allowed then + Error_Msg_N + ("fixed-lower-bound array is an extension feature; " + & "use -gnatX", + Token_Node); + end if; + end if; + + exit when Token = Tok_Right_Paren or else Token = Tok_Of; + T_Comma; + end loop; + + Set_Subtype_Marks (Def_Node, Subs_List); + end if; + end if; + end if; + + if Is_Constrained_Array_Def then Def_Node := New_Node (N_Constrained_Array_Definition, Array_Loc); Restore_Scan_State (Scan_State); -- to first discrete range @@ -3217,8 +3392,30 @@ package body Ch3 is Constr_Node := New_Node (N_Range, Token_Ptr); Set_Low_Bound (Constr_Node, Expr_Node); Scan; -- past .. - Expr_Node := P_Expression; - Check_Simple_Expression (Expr_Node); + + -- If the upper bound is given by "<>", this is an index for + -- a fixed-lower-bound subtype, so set the expression to Empty + -- for now (it will be set to the ranges maximum upper bound + -- later during analysis), and scan to the next token. + + if Token = Tok_Box then + if not Extensions_Allowed then + Error_Msg_N + ("fixed-lower-bound array is an extension feature; " + & "use -gnatX", + Expr_Node); + end if; + + Expr_Node := Empty; + Scan; + + -- Otherwise parse the range's upper bound expression + + else + Expr_Node := P_Expression; + Check_Simple_Expression (Expr_Node); + end if; + Set_High_Bound (Constr_Node, Expr_Node); Append (Constr_Node, Constr_List); goto Loop_Continue; diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb index ba128ec..20f8dd1 100644 --- a/gcc/ada/par-ch4.adb +++ b/gcc/ada/par-ch4.adb @@ -1734,8 +1734,9 @@ package body Ch4 is -- aggregates (AI-287) function P_Record_Or_Array_Component_Association return Node_Id is - Assoc_Node : Node_Id; - + Assoc_Node : Node_Id; + Box_Present : Boolean := False; + Box_With_Identifier_Present : Boolean := False; begin -- A loop indicates an iterated_component_association @@ -1744,6 +1745,8 @@ package body Ch4 is end if; Assoc_Node := New_Node (N_Component_Association, Token_Ptr); + Set_Binding_Chars (Assoc_Node, No_Name); + Set_Choices (Assoc_Node, P_Discrete_Choice_List); Set_Sloc (Assoc_Node, Token_Ptr); TF_Arrow; @@ -1755,12 +1758,78 @@ package body Ch4 is Error_Msg_Ada_2005_Extension ("component association with '<'>"); + Box_Present := True; Set_Box_Present (Assoc_Node); - Scan; -- Past box - else + Scan; -- past box + elsif Token = Tok_Less then + declare + Scan_State : Saved_Scan_State; + Id : Node_Id; + begin + Save_Scan_State (Scan_State); + Scan; -- past "<" + if Token = Tok_Identifier then + Id := P_Defining_Identifier; + if Token = Tok_Greater then + if Extensions_Allowed then + Set_Box_Present (Assoc_Node); + Set_Binding_Chars (Assoc_Node, Chars (Id)); + Box_Present := True; + Box_With_Identifier_Present := True; + Scan; -- past ">" + else + Error_Msg + ("Identifier within box only supported under -gnatX", + Token_Ptr); + Box_Present := True; + -- Avoid cascading errors by ignoring the identifier + end if; + end if; + end if; + if not Box_Present then + -- it wasn't an "is <identifier>", so restore. + Restore_Scan_State (Scan_State); + end if; + end; + end if; + + if not Box_Present then Set_Expression (Assoc_Node, P_Expression); end if; + -- Check for "is <identifier>" for aggregate that is part of + -- a pattern for a general case statement. + + if Token = Tok_Is then + declare + Scan_State : Saved_Scan_State; + Id : Node_Id; + begin + Save_Scan_State (Scan_State); + Scan; -- past "is" + if Token = Tok_Identifier then + Id := P_Defining_Identifier; + + if not Extensions_Allowed then + Error_Msg + ("IS following component association" + & " only supported under -gnatX", + Token_Ptr); + elsif Box_With_Identifier_Present then + Error_Msg + ("Both identifier-in-box and trailing identifier" + & " specified for one component association", + Token_Ptr); + else + Set_Binding_Chars (Assoc_Node, Chars (Id)); + end if; + else + -- It wasn't an "is <identifier>", so restore. + Restore_Scan_State (Scan_State); + end if; + end; + end if; + return Assoc_Node; end P_Record_Or_Array_Component_Association; diff --git a/gcc/ada/par-prag.adb b/gcc/ada/par-prag.adb index 33182cc..d701c2c 100644 --- a/gcc/ada/par-prag.adb +++ b/gcc/ada/par-prag.adb @@ -443,10 +443,8 @@ begin Check_Arg_Is_On_Or_Off (Arg1); if Chars (Expression (Arg1)) = Name_On then - Extensions_Allowed := True; - Ada_Version := Ada_Version_Type'Last; + Ada_Version := Ada_With_Extensions; else - Extensions_Allowed := False; Ada_Version := Ada_Version_Explicit; end if; @@ -1381,7 +1379,6 @@ begin | Pragma_Export_Function | Pragma_Export_Object | Pragma_Export_Procedure - | Pragma_Export_Value | Pragma_Export_Valued_Procedure | Pragma_Extend_System | Pragma_Extensions_Visible @@ -1525,7 +1522,6 @@ begin | Pragma_Unevaluated_Use_Of_Old | Pragma_Unimplemented_Unit | Pragma_Universal_Aliasing - | Pragma_Universal_Data | Pragma_Unmodified | Pragma_Unreferenced | Pragma_Unreferenced_Objects diff --git a/gcc/ada/sa_messages.ads b/gcc/ada/sa_messages.ads index 4963c6d..4f4ed8a 100644 --- a/gcc/ada/sa_messages.ads +++ b/gcc/ada/sa_messages.ads @@ -96,7 +96,7 @@ package SA_Messages is -- Contract_Cases, Default_Initial_Condition, Initial_Condition, -- Loop_Invariant, Loop_Variant, Refined_Post, and Subprogram_Variant. -- - -- TBD: it might be nice to distinguish these different kinds of assertions + -- It might be nice to distinguish these different kinds of assertions -- as is done in SPARK's VC_Kind enumeration type, but any distinction -- which isn't already present in CP's BE_Message_Subkind enumeration type -- would require more work on the CP side. diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index ae0c2be..d189ab7 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -48,6 +48,7 @@ with Restrict; use Restrict; with Rident; use Rident; with Sem; use Sem; with Sem_Aux; use Sem_Aux; +with Sem_Case; use Sem_Case; with Sem_Cat; use Sem_Cat; with Sem_Ch3; use Sem_Ch3; with Sem_Ch5; use Sem_Ch5; @@ -5190,7 +5191,18 @@ package body Sem_Aggr is -- replace the reference to the current instance by the target -- object of the aggregate. - if Present (Parent (Component)) + if Is_Case_Choice_Pattern (N) then + + -- Do not transform box component values in a case-choice + -- aggregate. + + Add_Association + (Component => Component, + Expr => Empty, + Assoc_List => New_Assoc_List, + Is_Box_Present => True); + + elsif Present (Parent (Component)) and then Nkind (Parent (Component)) = N_Component_Declaration and then Present (Expression (Parent (Component))) then diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 63b0f09..46c3d65 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -1603,7 +1603,6 @@ package body Sem_Attr is -- Local variables - Dims : Int; Index : Entity_Id; -- Start of processing for Check_Array_Or_Scalar_Type @@ -1667,14 +1666,16 @@ package body Sem_Attr is Set_Etype (N, Base_Type (Etype (Index))); else - Dims := UI_To_Int (Intval (E1)); - - for J in 1 .. Dims - 1 loop - Next_Index (Index); - end loop; + declare + Udims : constant Uint := Expr_Value (E1); + Dims : constant Int := UI_To_Int (Udims); + begin + for J in 1 .. Dims - 1 loop + Next_Index (Index); + end loop; + end; Set_Etype (N, Base_Type (Etype (Index))); - Set_Etype (E1, Standard_Integer); end if; end if; end Check_Array_Or_Scalar_Type; @@ -7982,14 +7983,27 @@ package body Sem_Attr is end if; end; - -- For Size, give size of object if available, otherwise we - -- cannot fold Size. - elsif Id = Attribute_Size then + -- For Enum_Lit'Size, use Enum_Type'Object_Size. Taking the 'Size + -- of a literal is kind of a strange thing to do, so we don't want + -- to pass this oddity on to the back end. Note that Etype of an + -- enumeration literal is always a (base) type, never a + -- constrained subtype, so the Esize is always known. + if Is_Entity_Name (P) - and then Known_Static_Esize (Entity (P)) + and then Ekind (Entity (P)) = E_Enumeration_Literal + then + pragma Assert (Known_Static_Esize (Etype (P))); + Compile_Time_Known_Attribute (N, Esize (Etype (P))); + + -- Otherwise, if Size is available, use that + + elsif Is_Entity_Name (P) and then Known_Static_Esize (Entity (P)) then Compile_Time_Known_Attribute (N, Esize (Entity (P))); + + -- Otherwise, we cannot fold + else Check_Expressions; end if; diff --git a/gcc/ada/sem_aux.adb b/gcc/ada/sem_aux.adb index 9f3ca2f..ea3b59c 100644 --- a/gcc/ada/sem_aux.adb +++ b/gcc/ada/sem_aux.adb @@ -1421,12 +1421,16 @@ package body Sem_Aux is N : Node_Id; begin + pragma Assert (Is_Package_Or_Generic_Package (E)); + N := Parent (E); if Nkind (N) = N_Defining_Program_Unit_Name then N := Parent (N); end if; + pragma Assert (Nkind (N) = N_Package_Specification); + return N; end Package_Specification; diff --git a/gcc/ada/sem_case.adb b/gcc/ada/sem_case.adb index b8602aa..36db9a7 100644 --- a/gcc/ada/sem_case.adb +++ b/gcc/ada/sem_case.adb @@ -43,12 +43,14 @@ with Stand; use Stand; with Sinfo; use Sinfo; with Sinfo.Nodes; use Sinfo.Nodes; with Sinfo.Utils; use Sinfo.Utils; +with Table; with Tbuild; use Tbuild; with Uintp; use Uintp; with Ada.Unchecked_Deallocation; with GNAT.Heap_Sort_G; +with GNAT.Sets; package body Sem_Case is @@ -95,6 +97,114 @@ package body Sem_Case is -- Given a Pos value of enumeration type Ctype, returns the name -- ID of an appropriate string to be used in error message output. + package Composite_Case_Ops is + + function Scalar_Part_Count (Subtyp : Entity_Id) return Nat; + -- Given the composite type Subtyp of a case selector, returns the + -- number of scalar parts in an object of this type. This is the + -- dimensionality of the associated Cartesian product space. + + function Choice_Count (Alternatives : List_Id) return Nat; + -- The sum of the number of choices for each alternative in the given + -- list. + + generic + Case_Statement : Node_Id; + package Choice_Analysis is + + type Alternative_Id is + new Int range 1 .. List_Length (Alternatives (Case_Statement)); + type Choice_Id is + new Int range 1 .. Choice_Count (Alternatives (Case_Statement)); + type Part_Id is new Int range + 1 .. Scalar_Part_Count (Etype (Expression (Case_Statement))); + + type Discrete_Range_Info is + record + Low, High : Uint; + end record; + + type Composite_Range_Info is array (Part_Id) of Discrete_Range_Info; + + type Choice_Range_Info (Is_Others : Boolean := False) is + record + case Is_Others is + when False => + Ranges : Composite_Range_Info; + when True => + null; + end case; + end record; + + type Choices_Range_Info is array (Choice_Id) of Choice_Range_Info; + + package Value_Sets is + + type Value_Set is private; + -- A set of points in the Cartesian product space defined + -- by the composite type of the case selector. + -- Implemented as an access type. + + type Set_Comparison is + (Disjoint, Equal, Contains, Contained_By, Overlaps); + + function Compare (S1, S2 : Value_Set) return Set_Comparison; + -- If either argument (or both) is empty, result is Disjoint. + -- Otherwise, result is Equal if the two sets are equal. + + Empty : constant Value_Set; + + function Matching_Values + (Info : Composite_Range_Info) return Value_Set; + -- The Cartesian product of the given array of ranges + -- (excluding any values outside the Cartesian product of the + -- component ranges). + + procedure Union (Target : in out Value_Set; Source : Value_Set); + -- Add elements of Source into Target + + procedure Remove (Target : in out Value_Set; Source : Value_Set); + -- Remove elements of Source from Target + + function Complement_Is_Empty (Set : Value_Set) return Boolean; + -- Return True iff the set is "maximal", in the sense that it + -- includes every value in the Cartesian product of the + -- component ranges. + + procedure Free_Value_Sets; + -- Reclaim storage associated with implementation of this package. + + private + type Value_Set is new Natural; + -- An index for a table that will be declared in the package body. + + Empty : constant Value_Set := 0; + + end Value_Sets; + + type Single_Choice_Info (Is_Others : Boolean := False) is + record + Alternative : Alternative_Id; + case Is_Others is + when False => + Matches : Value_Sets.Value_Set; + when True => + null; + end case; + end record; + + type Choices_Info is array (Choice_Id) of Single_Choice_Info; + + function Analysis return Choices_Info; + -- Parse the case choices in order to determine the set of + -- matching values associated with each choice. + + type Bound_Values is array (Positive range <>) of Node_Id; + + end Choice_Analysis; + + end Composite_Case_Ops; + procedure Expand_Others_Choice (Case_Table : Choice_Table_Type; Others_Choice : Node_Id; @@ -980,6 +1090,1179 @@ package body Sem_Case is return Name_Find; end Choice_Image; + package body Composite_Case_Ops is + + function Static_Array_Length (Subtyp : Entity_Id) return Nat; + -- Given a one-dimensional constrained array subtype with + -- statically known bounds, return its length. + + ------------------------- + -- Static_Array_Length -- + ------------------------- + + function Static_Array_Length (Subtyp : Entity_Id) return Nat is + pragma Assert (Is_Constrained (Subtyp)); + pragma Assert (Number_Dimensions (Subtyp) = 1); + Index : constant Node_Id := First_Index (Subtyp); + pragma Assert (Is_OK_Static_Range (Index)); + Lo : constant Uint := Expr_Value (Low_Bound (Index)); + Hi : constant Uint := Expr_Value (High_Bound (Index)); + Len : constant Uint := UI_Max (0, (Hi - Lo) + 1); + begin + return UI_To_Int (Len); + end Static_Array_Length; + + ----------------------- + -- Scalar_Part_Count -- + ----------------------- + + function Scalar_Part_Count (Subtyp : Entity_Id) return Nat is + begin + if Is_Scalar_Type (Subtyp) then + return 1; + elsif Is_Array_Type (Subtyp) then + return Static_Array_Length (Subtyp) + * Scalar_Part_Count (Component_Type (Subtyp)); + elsif Is_Record_Type (Subtyp) then + pragma Assert (not Has_Discriminants (Subtyp)); + declare + Result : Nat := 0; + Comp : Entity_Id := First_Component (Subtyp); + begin + while Present (Comp) loop + Result := Result + Scalar_Part_Count (Etype (Comp)); + Next_Component (Comp); + end loop; + return Result; + end; + else + pragma Assert (False); + raise Program_Error; + end if; + end Scalar_Part_Count; + + ------------------ + -- Choice_Count -- + ------------------ + + function Choice_Count (Alternatives : List_Id) return Nat is + Result : Nat := 0; + Alt : Node_Id := First (Alternatives); + begin + while Present (Alt) loop + Result := Result + List_Length (Discrete_Choices (Alt)); + Next (Alt); + end loop; + return Result; + end Choice_Count; + + package body Choice_Analysis is + + function Component_Bounds_Info return Composite_Range_Info; + -- Returns the (statically known) bounds for each component. + -- The selector expression value (or any other value of the type + -- of the selector expression) can be thought of as a point in the + -- Cartesian product of these sets. + + function Parse_Choice (Choice : Node_Id; + Alt : Node_Id) return Choice_Range_Info; + -- Extract Choice_Range_Info from a Choice node + + --------------------------- + -- Component_Bounds_Info -- + --------------------------- + + function Component_Bounds_Info return Composite_Range_Info is + Result : Composite_Range_Info; + Next : Part_Id := 1; + Done : Boolean := False; + + procedure Update_Result (Info : Discrete_Range_Info); + -- Initialize first remaining uninitialized element of Result. + -- Also set Next and Done. + + ------------------- + -- Update_Result -- + ------------------- + + procedure Update_Result (Info : Discrete_Range_Info) is + begin + Result (Next) := Info; + if Next /= Part_Id'Last then + Next := Next + 1; + else + pragma Assert (not Done); + Done := True; + end if; + end Update_Result; + + procedure Traverse_Discrete_Parts (Subtyp : Entity_Id); + -- Traverse the given subtype, looking for discrete parts. + -- For an array subtype of length N, the element subtype + -- is traversed N times. For a record subtype, traverse + -- each component's subtype (once). When a discrete part is + -- found, call Update_Result. + + ----------------------------- + -- Traverse_Discrete_Parts -- + ----------------------------- + + procedure Traverse_Discrete_Parts (Subtyp : Entity_Id) is + begin + if Is_Discrete_Type (Subtyp) then + Update_Result + ((Low => Expr_Value (Type_Low_Bound (Subtyp)), + High => Expr_Value (Type_High_Bound (Subtyp)))); + elsif Is_Array_Type (Subtyp) then + for I in 1 .. Static_Array_Length (Subtyp) loop + Traverse_Discrete_Parts (Component_Type (Subtyp)); + end loop; + elsif Is_Record_Type (Subtyp) then + pragma Assert (not Has_Discriminants (Subtyp)); + declare + Comp : Entity_Id := First_Component (Subtyp); + begin + while Present (Comp) loop + Traverse_Discrete_Parts (Etype (Comp)); + Next_Component (Comp); + end loop; + end; + else + Error_Msg_N + ("case selector type having a non-discrete non-record" + & " non-array subcomponent type not implemented", + Expression (Case_Statement)); + end if; + end Traverse_Discrete_Parts; + begin + Traverse_Discrete_Parts (Etype (Expression (Case_Statement))); + pragma Assert (Done or else Serious_Errors_Detected > 0); + return Result; + end Component_Bounds_Info; + + Component_Bounds : constant Composite_Range_Info + := Component_Bounds_Info; + + package Case_Bindings is + + procedure Note_Binding + (Comp_Assoc : Node_Id; + Choice : Node_Id; + Alt : Node_Id); + -- Note_Binding is called once for each component association + -- that defines a binding (using either "A => B is X" or + -- "A => <X>" syntax); + + procedure Check_Bindings; + -- After all calls to Note_Binding, check that bindings are + -- ok (e.g., check consistency among different choices of + -- one alternative). + + end Case_Bindings; + + procedure Refresh_Binding_Info (Aggr : Node_Id); + -- The parser records binding-related info in the tree. + -- The choice nodes that we see here might not be (will never be?) + -- the original nodes that were produced by the parser. The info + -- recorded by the parser is missing in that case, so this + -- procedure recovers it. + -- + -- There are bugs here. In some cases involving nested aggregates, + -- the path back to the parser-created nodes is lost. In particular, + -- we may fail to detect an illegal case like + -- when (F1 | F2 => (Aa => Natural, Bb => Natural is X)) => + -- This should be rejected because it is binding X to both the + -- F1.Bb and to the F2.Bb subcomponents of the case selector. + -- It would be nice if the not-specific-to-pattern-matching + -- aggregate-processing code could remain unaware of the existence + -- of this binding-related info but perhaps that isn't possible. + + -------------------------- + -- Refresh_Binding_Info -- + -------------------------- + + procedure Refresh_Binding_Info (Aggr : Node_Id) is + Orig_Aggr : constant Node_Id := Original_Node (Aggr); + Orig_Comp : Node_Id := First (Component_Associations (Orig_Aggr)); + begin + if Aggr = Orig_Aggr then + return; + end if; + + while Present (Orig_Comp) loop + if Nkind (Orig_Comp) = N_Component_Association + and then Binding_Chars (Orig_Comp) /= No_Name + then + if List_Length (Choices (Orig_Comp)) /= 1 then + -- Conceivably this could be checked during parsing, + -- but checking is easier here. + + Error_Msg_N + ("binding shared by multiple components", Orig_Comp); + return; + end if; + + declare + Orig_Name : constant Name_Id := + Chars (First (Choices (Orig_Comp))); + Comp : Node_Id := First (Component_Associations (Aggr)); + Matching_Comp : Node_Id := Empty; + begin + while Present (Comp) loop + if Chars (First (Choices (Comp))) = Orig_Name then + pragma Assert (not Present (Matching_Comp)); + Matching_Comp := Comp; + end if; + + Next (Comp); + end loop; + + pragma Assert (Present (Matching_Comp)); + + Set_Binding_Chars + (Matching_Comp, + Binding_Chars (Orig_Comp)); + end; + end if; + + Next (Orig_Comp); + end loop; + end Refresh_Binding_Info; + + ------------------ + -- Parse_Choice -- + ------------------ + + function Parse_Choice (Choice : Node_Id; + Alt : Node_Id) return Choice_Range_Info + is + Result : Choice_Range_Info (Is_Others => False); + Ranges : Composite_Range_Info renames Result.Ranges; + Next_Part : Part_Id := 1; + Done : Boolean := False; + + procedure Update_Result (Discrete_Range : Discrete_Range_Info); + -- Initialize first remaining uninitialized element of Ranges. + -- Also set Next_Part and Done. + + ------------------- + -- Update_Result -- + ------------------- + + procedure Update_Result (Discrete_Range : Discrete_Range_Info) is + begin + pragma Assert (not Done); + Ranges (Next_Part) := Discrete_Range; + if Next_Part = Part_Id'Last then + Done := True; + else + Next_Part := Next_Part + 1; + end if; + end Update_Result; + + procedure Traverse_Choice (Expr : Node_Id); + -- Traverse a legal choice expression, looking for + -- values/ranges of discrete parts. Call Update_Result + -- for each. + + --------------------- + -- Traverse_Choice -- + --------------------- + + procedure Traverse_Choice (Expr : Node_Id) is + begin + if Nkind (Expr) = N_Qualified_Expression then + Traverse_Choice (Expression (Expr)); + + elsif Nkind (Expr) = N_Type_Conversion + and then not Comes_From_Source (Expr) + then + if Expr /= Original_Node (Expr) then + Traverse_Choice (Original_Node (Expr)); + else + Traverse_Choice (Expression (Expr)); + end if; + + elsif Nkind (Expr) = N_Aggregate then + if Is_Record_Type (Etype (Expr)) then + Refresh_Binding_Info (Aggr => Expr); + + declare + Comp : Node_Id := + First (Component_Associations (Expr)); + -- Ok to assume that components are in order here? + begin + while Present (Comp) loop + pragma Assert (List_Length (Choices (Comp)) = 1); + if Box_Present (Comp) then + declare + Comp_Type : constant Entity_Id := + Etype (First (Choices (Comp))); + begin + if Is_Discrete_Type (Comp_Type) then + declare + Low : constant Node_Id := + Type_Low_Bound (Comp_Type); + High : constant Node_Id := + Type_High_Bound (Comp_Type); + begin + Update_Result + ((Low => Expr_Value (Low), + High => Expr_Value (High))); + end; + else + -- Need to recursively traverse type + -- here, calling Update_Result for + -- each discrete subcomponent. + + Error_Msg_N + ("box values for nondiscrete pattern " + & "subcomponents unimplemented", Comp); + end if; + end; + else + Traverse_Choice (Expression (Comp)); + end if; + + if Binding_Chars (Comp) /= No_Name + then + Case_Bindings.Note_Binding + (Comp_Assoc => Comp, + Choice => Choice, + Alt => Alt); + end if; + + Next (Comp); + end loop; + end; + elsif Is_Array_Type (Etype (Expr)) then + if Is_Non_Empty_List (Component_Associations (Expr)) then + Error_Msg_N + ("non-positional array aggregate as/within case " + & "choice not implemented", Expr); + end if; + + declare + Subexpr : Node_Id := First (Expressions (Expr)); + begin + while Present (Subexpr) loop + Traverse_Choice (Subexpr); + Next (Subexpr); + end loop; + end; + else + raise Program_Error; + end if; + elsif Is_Discrete_Type (Etype (Expr)) then + if Nkind (Expr) in N_Has_Entity and then + Is_Type (Entity (Expr)) + then + declare + Low : constant Node_Id := + Type_Low_Bound (Entity (Expr)); + High : constant Node_Id := + Type_High_Bound (Entity (Expr)); + begin + Update_Result ((Low => Expr_Value (Low), + High => Expr_Value (High))); + end; + else + pragma Assert (Compile_Time_Known_Value (Expr)); + Update_Result ((Low | High => Expr_Value (Expr))); + end if; + else + Error_Msg_N + ("non-aggregate case choice subexpression which is not" + & " of a discrete type not implemented", Expr); + end if; + end Traverse_Choice; + + begin + if Nkind (Choice) = N_Others_Choice then + return (Is_Others => True); + end if; + Traverse_Choice (Choice); + + -- Avoid returning uninitialized garbage in error case + if not Done then + pragma Assert (Serious_Errors_Detected > 0); + Result.Ranges := (others => (Low => Uint_1, High => Uint_0)); + end if; + + return Result; + end Parse_Choice; + + package body Case_Bindings is + + type Binding is record + Comp_Assoc : Node_Id; + Choice : Node_Id; + Alt : Node_Id; + end record; + + type Binding_Index is new Natural; + + package Case_Bindings_Table is new Table.Table + (Table_Component_Type => Binding, + Table_Index_Type => Binding_Index, + Table_Low_Bound => 1, + Table_Initial => 16, + Table_Increment => 64, + Table_Name => "Composite_Case_Ops.Case_Bindings"); + + ------------------ + -- Note_Binding -- + ------------------ + + procedure Note_Binding + (Comp_Assoc : Node_Id; + Choice : Node_Id; + Alt : Node_Id) + is + begin + Case_Bindings_Table.Append + ((Comp_Assoc => Comp_Assoc, + Choice => Choice, + Alt => Alt)); + end Note_Binding; + + -------------------- + -- Check_Bindings -- + -------------------- + + procedure Check_Bindings + is + use Case_Bindings_Table; + begin + if Last = 0 then + -- no bindings to check + return; + end if; + + declare + Tab : Table_Type + renames Case_Bindings_Table.Table (1 .. Last); + + function Same_Id (Idx1, Idx2 : Binding_Index) + return Boolean is ( + Binding_Chars (Tab (Idx1).Comp_Assoc) = + Binding_Chars (Tab (Idx2).Comp_Assoc)); + + function Binding_Subtype (Idx : Binding_Index) + return Entity_Id is + (Etype (Nlists.First (Choices (Tab (Idx).Comp_Assoc)))); + begin + -- Verify that elements with given choice or alt value + -- are contiguous, and that elements with equal + -- choice values have same alt value. + + for Idx1 in 2 .. Tab'Last loop + if Tab (Idx1 - 1).Choice /= Tab (Idx1).Choice then + pragma Assert + (for all Idx2 in Idx1 + 1 .. Tab'Last => + Tab (Idx2).Choice /= Tab (Idx1 - 1).Choice); + else + pragma Assert (Tab (Idx1 - 1).Alt = Tab (Idx1).Alt); + end if; + if Tab (Idx1 - 1).Alt /= Tab (Idx1).Alt then + pragma Assert + (for all Idx2 in Idx1 + 1 .. Tab'Last => + Tab (Idx2).Alt /= Tab (Idx1 - 1).Alt); + end if; + end loop; + + -- Check for user errors: + -- 1) Two choices for a given alternative shall define the + -- same set of names. Can't have + -- when (<X>, 0) | (0, <Y>) => + -- 2) A choice shall not define a name twice. Can't have + -- when (A => <X>, B => <X>, C => 0) => + -- 3) Two definitions of a name within one alternative + -- shall have statically matching component subtypes. + -- Can't have + -- type R is record Int : Integer; + -- Nat : Natural; end record; + -- case R'(...) is + -- when (<X>, 1) | (1, <X>) => + -- 4) A given binding shall match only one value. + -- Can't have + -- (Fld1 | Fld2 => (Fld => <X>)) + -- For now, this is enforced *very* conservatively + -- with respect to arrays - a binding cannot match + -- any part of an array. This is temporary. + + for Idx1 in Tab'Range loop + if Idx1 = 1 + or else Tab (Idx1 - 1).Alt /= Tab (Idx1).Alt + then + -- Process one alternative + declare + Alt_Start : constant Binding_Index := Idx1; + Alt : constant Node_Id := Tab (Alt_Start).Alt; + + First_Choice : constant Node_Id := + Nlists.First (Discrete_Choices (Alt)); + First_Choice_Bindings : Natural := 0; + begin + -- Check for duplicates within one choice, + -- and for choices with no bindings. + + if First_Choice /= Tab (Alt_Start).Choice then + Error_Msg_N ("binding(s) missing for choice", + First_Choice); + return; + end if; + + declare + Current_Choice : Node_Id := First_Choice; + Choice_Start : Binding_Index := Alt_Start; + begin + for Idx2 in Alt_Start .. Tab'Last loop + exit when Tab (Idx2).Alt /= Alt; + if Tab (Idx2).Choice = Current_Choice then + for Idx3 in Choice_Start .. Idx2 - 1 loop + if Same_Id (Idx2, Idx3) + then + Error_Msg_N + ("duplicate binding in choice", + Current_Choice); + return; + end if; + end loop; + else + Next (Current_Choice); + pragma Assert (Present (Current_Choice)); + Choice_Start := Idx2; + + if Tab (Idx2).Choice /= Current_Choice + then + Error_Msg_N + ("binding(s) missing for choice", + Current_Choice); + return; + end if; + end if; + end loop; + + -- If we made it through all the bindings + -- for this alternative but didn't make it + -- to the last choice, then bindings are + -- missing for all remaining choices. + -- We only complain about the first one. + + if Present (Next (Current_Choice)) then + Error_Msg_N + ("binding(s) missing for choice", + Next (Current_Choice)); + return; + end if; + end; + + -- Count bindings for first choice of alternative + + for FC_Idx in Alt_Start .. Tab'Last loop + exit when Tab (FC_Idx).Choice /= First_Choice; + First_Choice_Bindings := + First_Choice_Bindings + 1; + end loop; + + declare + Current_Choice : Node_Id := First_Choice; + Current_Choice_Bindings : Natural := 0; + begin + for Idx2 in Alt_Start .. Tab'Last loop + exit when Tab (Idx2).Alt /= Alt; + + -- If starting a new choice + + if Tab (Idx2).Choice /= Current_Choice then + + -- Check count for choice just finished + + if Current_Choice_Bindings + /= First_Choice_Bindings + then + Error_Msg_N + ("subsequent choice has different" + & " number of bindings than first" + & " choice", Current_Choice); + end if; + + Current_Choice := Tab (Idx2).Choice; + Current_Choice_Bindings := 1; + + -- Remember that Alt has both one or more + -- bindings and two or more choices; we'll + -- need to know this during expansion. + + Set_Multidefined_Bindings (Alt, True); + else + Current_Choice_Bindings := + Current_Choice_Bindings + 1; + end if; + + -- Check that first choice has binding with + -- matching name; check subtype consistency. + + declare + Found : Boolean := False; + begin + for FC_Idx in + Alt_Start .. + Alt_Start + Binding_Index + (First_Choice_Bindings - 1) + loop + if Same_Id (Idx2, FC_Idx) then + if not Subtypes_Statically_Match + (Binding_Subtype (Idx2), + Binding_Subtype (FC_Idx)) + then + Error_Msg_N + ("subtype of binding in " + & "subsequent choice does not " + & "match that in first choice", + Tab (Idx2).Comp_Assoc); + end if; + Found := True; + exit; + end if; + end loop; + + if not Found then + Error_Msg_N + ("binding defined in subsequent " + & "choice not defined in first " + & "choice", Current_Choice); + end if; + end; + + -- Check for illegal repeated binding + -- via an enclosing aggregate, as in + -- (F1 | F2 => (F3 => Natural is X, + -- F4 => Natural)) + -- where the inner aggregate would be ok. + + declare + Rover : Node_Id := Tab (Idx2).Comp_Assoc; + begin + while Rover /= Tab (Idx2).Choice loop + Rover := + (if Is_List_Member (Rover) then + Parent (List_Containing (Rover)) + else Parent (Rover)); + pragma Assert (Present (Rover)); + if Nkind (Rover) + = N_Component_Association + and then List_Length (Choices (Rover)) + > 1 + then + Error_Msg_N + ("binding shared by multiple " + & "enclosing components", + Tab (Idx2).Comp_Assoc); + end if; + end loop; + end; + end loop; + end; + + -- Construct the (unanalyzed) declarations for + -- the current alternative. Then analyze them. + + if First_Choice_Bindings > 0 then + declare + Loc : constant Source_Ptr := Sloc (Alt); + Declarations : constant List_Id := New_List; + Decl : Node_Id; + begin + for FC_Idx in + Alt_Start .. + Alt_Start + + Binding_Index (First_Choice_Bindings - 1) + loop + Decl := Make_Object_Declaration + (Sloc => Loc, + Defining_Identifier => + Make_Defining_Identifier + (Loc, + Binding_Chars + (Tab (FC_Idx).Comp_Assoc)), + Object_Definition => + New_Occurrence_Of + (Binding_Subtype (FC_Idx), Loc)); + + Append_To (Declarations, Decl); + end loop; + + declare + Old_Statements : constant List_Id := + Statements (Alt); + New_Statements : constant List_Id := + New_List; + + Block_Statement : constant Node_Id := + Make_Block_Statement (Sloc => Loc, + Declarations => Declarations, + Handled_Statement_Sequence => + Make_Handled_Sequence_Of_Statements + (Loc, Old_Statements), + Has_Created_Identifier => True); + begin + Append_To + (New_Statements, Block_Statement); + + Set_Statements (Alt, New_Statements); + end; + end; + end if; + end; + end if; + end loop; + end; + end Check_Bindings; + end Case_Bindings; + + function Choice_Bounds_Info return Choices_Range_Info; + -- Returns mapping from any given Choice_Id value to that choice's + -- component-to-range map. + + ------------------------ + -- Choice_Bounds_Info -- + ------------------------ + + function Choice_Bounds_Info return Choices_Range_Info is + Result : Choices_Range_Info; + Alt : Node_Id := First (Alternatives (Case_Statement)); + C_Id : Choice_Id := 1; + begin + while Present (Alt) loop + declare + Choice : Node_Id := First (Discrete_Choices (Alt)); + begin + while Present (Choice) loop + Result (C_Id) := Parse_Choice (Choice, Alt => Alt); + + Next (Choice); + if C_Id /= Choice_Id'Last then + C_Id := C_Id + 1; + end if; + end loop; + end; + Next (Alt); + end loop; + + pragma Assert (C_Id = Choice_Id'Last); + + -- No more calls to Note_Binding, so time for checks. + Case_Bindings.Check_Bindings; + + return Result; + end Choice_Bounds_Info; + + Choices_Bounds : constant Choices_Range_Info := Choice_Bounds_Info; + + package body Value_Sets is + use GNAT; + + function Hash (Key : Uint) return Bucket_Range_Type is + (Bucket_Range_Type + (UI_To_Int (Key mod (Uint_2 ** Uint_31)))); + + package Uint_Sets is new GNAT.Sets.Membership_Sets + (Uint, "=", Hash); + + type Representative_Values_Array is + array (Part_Id) of Uint_Sets.Membership_Set; + + function Representative_Values_Init + return Representative_Values_Array; + -- Select the representative values for each Part_Id value. + -- This function is called exactly once, immediately after it + -- is declared. + + -------------------------------- + -- Representative_Values_Init -- + -------------------------------- + + function Representative_Values_Init + return Representative_Values_Array + is + -- For each range of each choice (as well as the range for the + -- component subtype, which is handled in the first loop), + -- insert the low bound of the range and the successor of + -- the high bound into the corresponding R_V element. + -- + -- The idea we are trying to capture here is somewhat tricky. + -- Given an arbitrary point P1 in the Cartesian product + -- of the Component_Bounds sets, we want to be able + -- to map that to a point P2 in the (smaller) Cartesian product + -- of the Representative_Values sets that has the property + -- that for every choice of the case statement, P1 matches + -- the choice if and only if P2 also matches. Given that, + -- we can implement the overlapping/containment/etc. rules + -- safely by just looking at (using brute force enumeration) + -- the (smaller) Cartesian product of the R_V sets. + -- We are never going to actually perform this point-to-point + -- mapping - just the fact that it exists is enough to ensure + -- we can safely look at just the R_V sets. + -- + -- The desired mapping can be implemented by mapping a point + -- P1 to a point P2 by reducing each of P1's coordinates down + -- to the largest element of the corresponding R_V set that is + -- less than or equal to the original coordinate value (such + -- an element Y will always exist because the R_V set for a + -- given component always includes the low bound of the + -- component subtype). It then suffices to show that every + -- choice in the case statement yields the same Boolean result + -- for P1 as for P2. + -- + -- Suppose the contrary. Then there is some particular + -- coordinate position X (i.e., a Part_Id value) and some + -- choice C where exactly one of P1(X) and P2(X) belongs to + -- the (contiguous) range associated with C(X); call that + -- range L .. H. We know that P2(X) <= P1(X) because the + -- mapping never increases coordinate values. Consider three + -- cases: P1(X) lies within the L .. H range, or it is greater + -- than H, or it is lower than L. + -- The third case is impossible because reducing a value that + -- is less than L can only produce another such value, + -- violating the "exactly one" assumption. The second + -- case is impossible because L belongs to the corresponding + -- R_V set, so P2(X) >= L and both values belong to the + -- range, again violating the "exactly one" assumption. + -- Finally, the third case is impossible because H+1 belongs + -- to the corresponding R_V set, so P2(X) > H, so neither + -- value belongs to the range, again violating the "exactly + -- one" assumption. So our initial supposition was wrong. QED. + + use Uint_Sets; + + Result : constant Representative_Values_Array + := (others => Uint_Sets.Create (Initial_Size => 32)); + + procedure Insert_Representative (Value : Uint; P : Part_Id); + -- Insert the given Value into the representative values set + -- for the given component if it belongs to the component's + -- subtype. Otherwise, do nothing. + + --------------------------- + -- Insert_Representative -- + --------------------------- + + procedure Insert_Representative (Value : Uint; P : Part_Id) is + begin + if Value >= Component_Bounds (P).Low and + Value <= Component_Bounds (P).High + then + Insert (Result (P), Value); + end if; + end Insert_Representative; + + begin + for P in Part_Id loop + Insert_Representative (Component_Bounds (P).Low, P); + end loop; + for C of Choices_Bounds loop + if not C.Is_Others then + for P in Part_Id loop + if C.Ranges (P).Low <= C.Ranges (P).High then + Insert_Representative (C.Ranges (P).Low, P); + Insert_Representative (C.Ranges (P).High + 1, P); + end if; + end loop; + end if; + end loop; + return Result; + end Representative_Values_Init; + + Representative_Values : constant Representative_Values_Array + := Representative_Values_Init; + -- We want to avoid looking at every point in the Cartesian + -- product of all component values. Instead we select, for each + -- component, a set of representative values and then look only + -- at the Cartesian product of those sets. A single value can + -- safely represent a larger enclosing interval if every choice + -- for that component either completely includes or completely + -- excludes the interval. The elements of this array will be + -- populated by a call to Initialize_Representative_Values and + -- will remain constant after that. + + type Value_Index_Base is new Natural; + + function Value_Index_Count return Value_Index_Base; + -- Returns the product of the sizes of the Representative_Values + -- sets (i.e., the size of the Cartesian product of the sets). + -- May return zero if one of the sets is empty. + -- This function is called exactly once, immediately after it + -- is declared. + + ----------------------- + -- Value_Index_Count -- + ----------------------- + + function Value_Index_Count return Value_Index_Base is + Result : Value_Index_Base := 1; + begin + for Set of Representative_Values loop + Result := Result * Value_Index_Base (Uint_Sets.Size (Set)); + end loop; + return Result; + end Value_Index_Count; + + Max_Value_Index : constant Value_Index_Base := Value_Index_Count; + + subtype Value_Index is Value_Index_Base range 1 .. Max_Value_Index; + type Value_Index_Set is array (Value_Index) of Boolean; + + package Value_Index_Set_Table is new Table.Table + (Table_Component_Type => Value_Index_Set, + Table_Index_Type => Value_Set, + Table_Low_Bound => 1, + Table_Initial => 16, + Table_Increment => 100, + Table_Name => "Composite_Case_Ops.Value_Sets"); + -- A nonzero Value_Set value is an index into this table. + + function Indexed (Index : Value_Set) return Value_Index_Set + is (Value_Index_Set_Table.Table.all (Index)); + + function Allocate_Table_Element (Initial_Value : Value_Index_Set) + return Value_Set; + -- Allocate and initialize a new table element; return its index. + + ---------------------------- + -- Allocate_Table_Element -- + ---------------------------- + + function Allocate_Table_Element (Initial_Value : Value_Index_Set) + return Value_Set + is + use Value_Index_Set_Table; + begin + Append (Initial_Value); + return Last; + end Allocate_Table_Element; + + procedure Assign_Table_Element (Index : Value_Set; + Value : Value_Index_Set); + -- Assign specified value to specified table element. + + -------------------------- + -- Assign_Table_Element -- + -------------------------- + + procedure Assign_Table_Element (Index : Value_Set; + Value : Value_Index_Set) + is + begin + Value_Index_Set_Table.Table.all (Index) := Value; + end Assign_Table_Element; + + ------------- + -- Compare -- + ------------- + + function Compare (S1, S2 : Value_Set) return Set_Comparison is + begin + if S1 = Empty or S2 = Empty then + return Disjoint; + elsif Indexed (S1) = Indexed (S2) then + return Equal; + else + declare + Intersection : constant Value_Index_Set + := Indexed (S1) and Indexed (S2); + begin + if (for all Flag of Intersection => not Flag) then + return Disjoint; + elsif Intersection = Indexed (S1) then + return Contained_By; + elsif Intersection = Indexed (S2) then + return Contains; + else + return Overlaps; + end if; + end; + end if; + end Compare; + + ------------------------- + -- Complement_Is_Empty -- + ------------------------- + + function Complement_Is_Empty (Set : Value_Set) return Boolean + is (Set /= Empty + and then (for all Flag of Indexed (Set) => Flag)); + + --------------------- + -- Free_Value_Sets -- + --------------------- + procedure Free_Value_Sets is + begin + Value_Index_Set_Table.Free; + end Free_Value_Sets; + + ----------- + -- Union -- + ----------- + + procedure Union (Target : in out Value_Set; Source : Value_Set) is + begin + if Source /= Empty then + if Target = Empty then + Target := Allocate_Table_Element (Indexed (Source)); + else + Assign_Table_Element + (Target, Indexed (Target) or Indexed (Source)); + end if; + end if; + end Union; + + ------------ + -- Remove -- + ------------ + + procedure Remove (Target : in out Value_Set; Source : Value_Set) is + begin + if Source /= Empty and Target /= Empty then + Assign_Table_Element + (Target, Indexed (Target) and not Indexed (Source)); + if (for all V of Indexed (Target) => not V) then + Target := Empty; + end if; + end if; + end Remove; + + --------------------- + -- Matching_Values -- + --------------------- + + function Matching_Values + (Info : Composite_Range_Info) return Value_Set + is + Matches : Value_Index_Set; + Next_Index : Value_Index := 1; + Done : Boolean := False; + Point : array (Part_Id) of Uint; + + procedure Test_Point_For_Match; + -- Point identifies a point in the Cartesian product of the + -- representative value sets. Record whether that Point + -- belongs to the product-of-ranges specified by Info. + + -------------------------- + -- Test_Point_For_Match -- + -------------------------- + + procedure Test_Point_For_Match is + function In_Range (Val : Uint; Rang : Discrete_Range_Info) + return Boolean is + ((Rang.Low <= Val) and then (Val <= Rang.High)); + begin + pragma Assert (not Done); + Matches (Next_Index) := + (for all P in Part_Id => In_Range (Point (P), Info (P))); + if Next_Index = Matches'Last then + Done := True; + else + Next_Index := Next_Index + 1; + end if; + end Test_Point_For_Match; + + procedure Test_Points (P : Part_Id); + -- Iterate over the Cartesian product of the representative + -- value sets, calling Test_Point_For_Match for each point. + + ----------------- + -- Test_Points -- + ----------------- + + procedure Test_Points (P : Part_Id) is + use Uint_Sets; + Iter : Iterator := Iterate (Representative_Values (P)); + begin + -- We could traverse here in sorted order, as opposed to + -- whatever order the set iterator gives us. + -- No need for that as long as every iteration over + -- a given representative values set yields the same order. + -- Not sorting is more efficient, but it makes it harder to + -- interpret a Value_Index_Set bit vector when debugging. + + while Has_Next (Iter) loop + Next (Iter, Point (P)); + + -- If we have finished building up a Point value, then + -- test it for matching. Otherwise, recurse to continue + -- building up a point value. + + if P = Part_Id'Last then + Test_Point_For_Match; + else + Test_Points (P + 1); + end if; + end loop; + end Test_Points; + + begin + Test_Points (1); + if (for all Flag of Matches => not Flag) then + return Empty; + end if; + return Allocate_Table_Element (Matches); + end Matching_Values; + + end Value_Sets; + + -------------- + -- Analysis -- + -------------- + + function Analysis return Choices_Info is + Result : Choices_Info; + Alt : Node_Id := First (Alternatives (Case_Statement)); + A_Id : Alternative_Id := 1; + C_Id : Choice_Id := 1; + begin + while Present (Alt) loop + declare + Choice : Node_Id := First (Discrete_Choices (Alt)); + begin + while Present (Choice) loop + if Nkind (Choice) = N_Others_Choice then + pragma Assert (Choices_Bounds (C_Id).Is_Others); + Result (C_Id) := + (Alternative => A_Id, + Is_Others => True); + else + Result (C_Id) := + (Alternative => A_Id, + Is_Others => False, + Matches => Value_Sets.Matching_Values + (Choices_Bounds (C_Id).Ranges)); + end if; + Next (Choice); + if C_Id /= Choice_Id'Last then + C_Id := C_Id + 1; + end if; + end loop; + end; + + Next (Alt); + if A_Id /= Alternative_Id'Last then + A_Id := A_Id + 1; + end if; + end loop; + + pragma Assert (A_Id = Alternative_Id'Last); + pragma Assert (C_Id = Choice_Id'Last); + + return Result; + end Analysis; + + end Choice_Analysis; + + end Composite_Case_Ops; + -------------------------- -- Expand_Others_Choice -- -------------------------- @@ -1379,6 +2662,15 @@ package body Sem_Case is -- later entry into the choices table so that they can be sorted -- later on. + procedure Check_Case_Pattern_Choices; + -- Check choices validity for the Ada extension case where the + -- selecting expression is not of a discrete type and so the + -- choices are patterns. + + procedure Check_Composite_Case_Selector; + -- Check that the (non-discrete) type of the expression being + -- cased on is suitable. + procedure Handle_Static_Predicate (Typ : Entity_Id; Lo : Node_Id; @@ -1500,6 +2792,195 @@ package body Sem_Case is Num_Choices := Num_Choices + 1; end Check; + -------------------------------- + -- Check_Case_Pattern_Choices -- + -------------------------------- + + procedure Check_Case_Pattern_Choices is + -- ??? Need to Free/Finalize value sets allocated here. + + package Ops is new Composite_Case_Ops.Choice_Analysis + (Case_Statement => N); + use Ops; + use Ops.Value_Sets; + + Empty : Value_Set renames Value_Sets.Empty; + -- Cope with hiding due to multiple use clauses + + Info : constant Choices_Info := Analysis; + Others_Seen : Boolean := False; + + begin + declare + Matches : array (Alternative_Id) of Value_Sets.Value_Set := + (others => Empty); + + Flag_Overlapping_Within_One_Alternative : constant Boolean := + False; + -- We may want to flag overlapping (perhaps with only a + -- warning) if the pattern binds an identifier, as in + -- when (Positive, <X>) | (Integer, <X>) => + + Covered : Value_Set := Empty; + -- The union of all alternatives seen so far + + begin + for Choice of Info loop + if Choice.Is_Others then + Others_Seen := True; + else + if Flag_Overlapping_Within_One_Alternative + and then (Compare (Matches (Choice.Alternative), + Choice.Matches) /= Disjoint) + then + Error_Msg_N + ("bad overlapping within one alternative", N); + end if; + + Union (Target => Matches (Choice.Alternative), + Source => Choice.Matches); + end if; + end loop; + + for A1 in Alternative_Id loop + for A2 in Alternative_Id + range A1 + 1 .. Alternative_Id'Last + loop + case Compare (Matches (A1), Matches (A2)) is + when Disjoint | Contained_By => + null; -- OK + when Overlaps => + declare + Uncovered_1, Uncovered_2 : Value_Set := Empty; + begin + Union (Uncovered_1, Matches (A1)); + Remove (Uncovered_1, Covered); + Union (Uncovered_2, Matches (A2)); + Remove (Uncovered_2, Covered); + + -- Recheck for overlap after removing choices + -- covered by earlier alternatives. + + case Compare (Uncovered_1, Uncovered_2) is + when Disjoint | Contained_By => + null; + when Contains | Overlaps | Equal => + Error_Msg_N + ("bad alternative overlapping", N); + end case; + end; + + when Equal => + Error_Msg_N ("alternatives match same values", N); + when Contains => + Error_Msg_N ("alternatives in wrong order", N); + end case; + end loop; + + Union (Target => Covered, Source => Matches (A1)); + end loop; + + if (not Others_Seen) and then not Complement_Is_Empty (Covered) + then + Error_Msg_N ("not all values are covered", N); + end if; + end; + + Ops.Value_Sets.Free_Value_Sets; + end Check_Case_Pattern_Choices; + + ----------------------------------- + -- Check_Composite_Case_Selector -- + ----------------------------------- + + procedure Check_Composite_Case_Selector is + -- Some of these restrictions will be relaxed eventually, but best + -- to initially err in the direction of being too restrictive. + + procedure Check_Component_Subtype (Subtyp : Entity_Id); + -- Recursively traverse subcomponent types to perform checks. + + ----------------------------- + -- Check_Component_Subtype -- + ----------------------------- + + procedure Check_Component_Subtype (Subtyp : Entity_Id) is + begin + if Has_Predicates (Subtyp) then + Error_Msg_N + ("subtype of case selector (or subcomponent thereof)" & + "has predicate", N); + elsif Is_Discrete_Type (Subtyp) then + if not Is_Static_Subtype (Subtyp) then + Error_Msg_N + ("discrete subtype of selector subcomponent is not " & + "a static subtype", N); + elsif Is_Enumeration_Type (Subtyp) + and then Has_Enumeration_Rep_Clause (Subtyp) + then + Error_Msg_N + ("enumeration type of selector subcomponent has " & + "an enumeration representation clause", N); + end if; + elsif Is_Array_Type (Subtyp) then + pragma Assert (Is_Constrained (Subtyp)); + + if Number_Dimensions (Subtyp) /= 1 then + Error_Msg_N + ("dimensionality of array type of case selector (or " & + "subcomponent thereof) is greater than 1", N); + elsif not Is_OK_Static_Range (First_Index (Subtyp)) then + Error_Msg_N + ("array subtype of case selector (or " & + "subcomponent thereof) has nonstatic constraint", N); + end if; + Check_Component_Subtype (Component_Type (Subtyp)); + elsif Is_Record_Type (Subtyp) then + if Has_Discriminants (Subtyp) then + Error_Msg_N + ("type of case selector (or subcomponent thereof)" & + "is discriminated", N); + else + declare + Comp : Entity_Id := First_Component (Subtyp); + begin + while Present (Comp) loop + Check_Component_Subtype (Etype (Comp)); + Next_Component (Comp); + end loop; + end; + end if; + else + Error_Msg_N + ("type of case selector (or subcomponent thereof) is " & + "not a discrete type, a record type, or an array type", + N); + end if; + end Check_Component_Subtype; + + begin + if not Is_Composite_Type (Subtyp) then + Error_Msg_N + ("case selector type neither discrete nor composite", N); + + elsif Is_Limited_Type (Subtyp) then + Error_Msg_N ("case selector type is limited", N); + + elsif Is_Class_Wide_Type (Subtyp) then + Error_Msg_N ("case selector type is class-wide", N); + + elsif Needs_Finalization (Subtyp) then + Error_Msg_N ("case selector type requires finalization", N); + + elsif Is_Array_Type (Subtyp) and not Is_Constrained (Subtyp) then + Error_Msg_N + ("case selector subtype is unconstrained array subtype", N); + + else + Check_Component_Subtype (Subtyp); + end if; + end Check_Composite_Case_Selector; + ----------------------------- -- Handle_Static_Predicate -- ----------------------------- @@ -1562,6 +3043,14 @@ package body Sem_Case is -- a complete mess. if not Is_Discrete_Type (Subtyp) or else Subtyp = Any_Type then + + -- Hold on, maybe it isn't a complete mess after all. + + if Extensions_Allowed and then Subtyp /= Any_Type then + Check_Composite_Case_Selector; + Check_Case_Pattern_Choices; + end if; + return; end if; @@ -1809,4 +3298,37 @@ package body Sem_Case is end Generic_Check_Choices; + ---------------------------- + -- Is_Case_Choice_Pattern -- + ---------------------------- + + function Is_Case_Choice_Pattern (Expr : Node_Id) return Boolean is + E : Node_Id := Expr; + begin + if not Extensions_Allowed then + return False; + end if; + + loop + case Nkind (E) is + when N_Case_Statement_Alternative + | N_Case_Expression_Alternative + => + -- We could return False if selecting expression is discrete, + -- but this doesn't seem to be worth the bother. + return True; + + when N_Empty + | N_Statement_Other_Than_Procedure_Call + | N_Procedure_Call_Statement + | N_Declaration + => + return False; + + when others => + E := Parent (E); + end case; + end loop; + end Is_Case_Choice_Pattern; + end Sem_Case; diff --git a/gcc/ada/sem_case.ads b/gcc/ada/sem_case.ads index 7bde09d..3943cf2 100644 --- a/gcc/ada/sem_case.ads +++ b/gcc/ada/sem_case.ads @@ -147,4 +147,10 @@ package Sem_Case is -- the parent node (N_Variant, N_Case_Expression/Statement_Alternative). end Generic_Check_Choices; + + function Is_Case_Choice_Pattern (Expr : Node_Id) return Boolean; + -- GNAT language extensions allow casing on a non-discrete value, with + -- patterns as case choices. Return True iff Expr is such a pattern, or + -- a subexpression thereof. + end Sem_Case; diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index f76d370..efdc449 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -3903,12 +3903,7 @@ package body Sem_Ch12 is -- Check restriction imposed by AI05-073: a generic function -- cannot return an abstract type or an access to such. - -- This is a binding interpretation should it apply to earlier - -- versions of Ada as well as Ada 2012??? - - if Is_Abstract_Type (Designated_Type (Result_Type)) - and then Ada_Version >= Ada_2012 - then + if Is_Abstract_Type (Designated_Type (Result_Type)) then Error_Msg_N ("generic function cannot have an access result " & "that designates an abstract type", Spec); @@ -4539,10 +4534,7 @@ package body Sem_Ch12 is -- If the current scope is itself an instance within a child -- unit, there will be duplications in the scope stack, and the -- unstacking mechanism in Inline_Instance_Body will fail. - -- This loses some rare cases of optimization, and might be - -- improved some day, if we can find a proper abstraction for - -- "the complete compilation context" that can be saved and - -- restored. ??? + -- This loses some rare cases of optimization. if Is_Generic_Instance (Current_Scope) then declare @@ -4987,17 +4979,20 @@ package body Sem_Ch12 is if Gen_Comp /= Cunit_Entity (Current_Sem_Unit) then - -- Add some comments for the following two loops ??? + -- Loop through enclosing scopes until we reach a generic instance, + -- package body, or subprogram. S := Current_Scope; while Present (S) and then S /= Standard_Standard loop + + -- Save use clauses from enclosing scopes into Use_Clauses + loop Num_Scopes := Num_Scopes + 1; Use_Clauses (Num_Scopes) := (Scope_Stack.Table - (Scope_Stack.Last - Num_Scopes + 1). - First_Use_Clause); + (Scope_Stack.Last - Num_Scopes + 1).First_Use_Clause); End_Use_Clauses (Use_Clauses (Num_Scopes)); exit when Scope_Stack.Last - Num_Scopes + 1 = Scope_Stack.First @@ -5554,7 +5549,6 @@ package body Sem_Ch12 is -- If there is a formal subprogram with the same name as the unit -- itself, do not add this renaming declaration, to prevent -- ambiguities when there is a call with that name in the body. - -- This is a partial and ugly fix for one ACATS test. ??? Renaming_Decl := First (Renaming_List); while Present (Renaming_Decl) loop @@ -9764,6 +9758,7 @@ package body Sem_Ch12 is -- point of the current enclosing instance. Pending a better usage of -- Slocs to indicate instantiation places, we determine the place of -- origin of a node by finding the maximum sloc of any ancestor node. + -- Why is this not equivalent to Top_Level_Location ??? ------------------- @@ -12576,9 +12571,7 @@ package body Sem_Ch12 is -- errors, this may be an instance whose scope is a premature instance. -- In that case we must insure that the (legal) program does raise -- program error if executed. We generate a subprogram body for this - -- purpose. See DEC ac30vso. - - -- Should not reference proprietary DEC tests in comments ??? + -- purpose. elsif Serious_Errors_Detected = 0 and then Nkind (Parent (Inst_Node)) /= N_Compilation_Unit @@ -12705,7 +12698,7 @@ package body Sem_Ch12 is function Subtypes_Match (Gen_T, Act_T : Entity_Id) return Boolean; -- Check that base types are the same and that the subtypes match - -- statically. Used in several of the above. + -- statically. Used in several of the validation subprograms. -------------------------------------------- -- Check_Shared_Variable_Control_Aspects -- @@ -12840,7 +12833,9 @@ package body Sem_Ch12 is T : constant Entity_Id := Get_Instance_Of (Gen_T); begin - -- Some detailed comments would be useful here ??? + -- Check that the base types, root types (when dealing with class + -- wide types), or designated types (when dealing with anonymous + -- access types) of Gen_T and Act_T are statically matching subtypes. return ((Base_Type (T) = Act_T or else Base_Type (T) = Base_Type (Act_T)) @@ -12852,9 +12847,7 @@ package body Sem_Ch12 is (Get_Instance_Of (Root_Type (Gen_T)), Root_Type (Act_T))) - or else - (Ekind (Gen_T) in E_Anonymous_Access_Subprogram_Type - | E_Anonymous_Access_Type + or else (Is_Anonymous_Access_Type (Gen_T) and then Ekind (Act_T) = Ekind (Gen_T) and then Subtypes_Statically_Match (Designated_Type (Gen_T), Designated_Type (Act_T))); @@ -14029,9 +14022,12 @@ package body Sem_Ch12 is and then Ekind (Root_Type (Act_T)) = E_Incomplete_Type) then -- If the formal is an incomplete type, the actual can be - -- incomplete as well. + -- incomplete as well, but if an actual incomplete type has + -- a full view, then we'll retrieve that. - if Ekind (A_Gen_T) = E_Incomplete_Type then + if Ekind (A_Gen_T) = E_Incomplete_Type + and then not Present (Full_View (Act_T)) + then null; elsif Is_Class_Wide_Type (Act_T) @@ -14039,6 +14035,7 @@ package body Sem_Ch12 is then Error_Msg_N ("premature use of incomplete type", Actual); Abandon_Instantiation (Actual); + else Act_T := Full_View (Act_T); Set_Entity (Actual, Act_T); @@ -15225,14 +15222,15 @@ package body Sem_Ch12 is -- subunit of a generic contains an instance of a child unit of -- its generic parent unit. - elsif S = Current_Scope and then Is_Generic_Instance (S) then + elsif S = Current_Scope and then Is_Generic_Instance (S) + and then (In_Package_Body (S) or else In_Private_Part (S)) + then declare Par : constant Entity_Id := Generic_Parent (Package_Specification (S)); begin if Present (Par) and then P = Scope (Par) - and then (In_Package_Body (S) or else In_Private_Part (S)) then Set_In_Private_Part (P); Install_Private_Declarations (P); @@ -15626,7 +15624,8 @@ package body Sem_Ch12 is elsif Nkind (E) not in N_Entity then return False; - elsif Is_Child_Unit (E) + elsif Nkind (E) /= N_Expanded_Name + and then Is_Child_Unit (E) and then (Is_Instance_Node (Parent (N2)) or else (Nkind (Parent (N2)) = N_Expanded_Name and then N2 = Selector_Name (Parent (N2)) @@ -15636,7 +15635,19 @@ package body Sem_Ch12 is return True; else - Se := Scope (E); + -- E may be an expanded name - typically an operator - in which + -- case we must find its enclosing scope since expanded names + -- don't have corresponding scopes. + + if Nkind (E) = N_Expanded_Name then + Se := Find_Enclosing_Scope (E); + + -- Otherwise, E is an entity and will have Scope set + + else + Se := Scope (E); + end if; + while Se /= Gen_Scope loop if Se = Standard_Standard then return True; diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 3c3e351..062aa50 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -2623,7 +2623,7 @@ package body Sem_Ch13 is end if; end loop; - -- ??? TBD: Must check that "for result type R, if the + -- ??? Must check that "for result type R, if the -- function is a boundary entity for type R (see 7.3.2), -- no type invariant applies to type R; if R has a -- component type C, a similar rule applies to C." @@ -13399,6 +13399,16 @@ package body Sem_Ch13 is Set_Is_Ada_2012_Only (Typ); end if; + -- Ada_2022 + + if not Has_Rep_Item (Typ, Name_Ada_2022, False) + and then Has_Rep_Item (Typ, Name_Ada_2022) + and then Is_Pragma_Or_Corr_Pragma_Present_In_Rep_Item + (Get_Rep_Item (Typ, Name_Ada_2022)) + then + Set_Is_Ada_2022_Only (Typ); + end if; + -- Atomic/Shared if not Has_Rep_Item (Typ, Name_Atomic, Name_Shared, False) @@ -13581,7 +13591,8 @@ package body Sem_Ch13 is Address_Clause_Checks.Init; Unchecked_Conversions.Init; - -- ??? Might be needed in the future for some non GCC back-ends + -- The following might be needed in the future for some non-GCC back + -- ends: -- if AAMP_On_Target then -- Independence_Checks.Init; -- end if; @@ -15058,7 +15069,7 @@ package body Sem_Ch13 is -- For now we only deal with aspects that do not generate -- subprograms, or that may mention current instances of - -- types. These will require special handling (???TBD). + -- types. These will require special handling???. when Aspect_Invariant | Aspect_Predicate @@ -15095,7 +15106,11 @@ package body Sem_Ch13 is begin Assoc := First (Component_Associations (Expr)); while Present (Assoc) loop - Find_Direct_Name (Expression (Assoc)); + if Nkind (Expression (Assoc)) in N_Has_Entity + then + Find_Direct_Name (Expression (Assoc)); + end if; + Next (Assoc); end loop; end; diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index c6687b5..4982fcd 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -2827,7 +2827,7 @@ package body Sem_Ch3 is -- to the first encountered body. -- ??? A cleaner approach may be possible and/or this solution - -- could be extended to general-purpose late primitives, TBD. + -- could be extended to general-purpose late primitives. if Present (Ctrl_Typ) then @@ -3055,7 +3055,7 @@ package body Sem_Ch3 is end if; end if; - -- TBD : other nonoverridable aspects. + -- What about other nonoverridable aspects??? end Check_Nonoverridable_Aspects; ------------------------------------ @@ -3072,6 +3072,7 @@ package body Sem_Ch3 is and then Ekind (Prev) = E_Incomplete_Type and then Is_Tagged_Type (Prev) and then Is_Tagged_Type (T) + and then Present (Primitive_Operations (Prev)) then Elmt := First_Elmt (Primitive_Operations (Prev)); while Present (Elmt) loop @@ -4620,6 +4621,13 @@ package body Sem_Ch3 is Related_Id := Empty; end if; + -- If the object has an unconstrained array subtype with fixed + -- lower bound, then sliding to that bound may be needed. + + if Is_Fixed_Lower_Bound_Array_Subtype (T) then + Expand_Sliding_Conversion (E, T); + end if; + Expand_Subtype_From_Expr (N => N, Unc_Type => T, @@ -4760,7 +4768,7 @@ package body Sem_Ch3 is -- Now establish the proper kind and type of the object if Ekind (Id) = E_Void then - Reinit_Field_To_Zero (Id, Next_Inlined_Subprogram); + Reinit_Field_To_Zero (Id, F_Next_Inlined_Subprogram); end if; if Constant_Present (N) then @@ -5121,6 +5129,8 @@ package body Sem_Ch3 is goto Leave; end if; + Check_Wide_Character_Restriction (Parent_Type, Indic); + -- Perhaps the parent type should be changed to the class-wide type's -- specific type in this case to prevent cascading errors ??? @@ -6022,6 +6032,7 @@ package body Sem_Ch3 is Nb_Index : Pos; Priv : Entity_Id; Related_Id : Entity_Id; + Has_FLB_Index : Boolean := False; begin if Nkind (Def) = N_Constrained_Array_Definition then @@ -6111,6 +6122,39 @@ package body Sem_Ch3 is Make_Index (Index, P, Related_Id, Nb_Index); + -- In the case where we have an unconstrained array with an index + -- given by a subtype_indication, this is necessarily a "fixed lower + -- bound" index. We change the upper bound of that index to the upper + -- bound of the index's subtype (denoted by the subtype_mark), since + -- that upper bound was originally set by the parser to be the same + -- as the lower bound. In truth, that upper bound corresponds to + -- a box ("<>"), and could be set to Empty, but it's convenient to + -- set it to the upper bound to avoid needing to add special tests + -- in various places for an Empty upper bound, and in any case that + -- accurately characterizes the index's range of values. + + if Nkind (Def) = N_Unconstrained_Array_Definition + and then Nkind (Index) = N_Subtype_Indication + then + declare + Index_Subtype_High_Bound : constant Entity_Id := + Type_High_Bound (Entity (Subtype_Mark (Index))); + begin + Set_High_Bound (Range_Expression (Constraint (Index)), + Index_Subtype_High_Bound); + + -- Record that the array type has one or more indexes with + -- a fixed lower bound. + + Has_FLB_Index := True; + + -- Mark the index as belonging to an array type with a fixed + -- lower bound. + + Set_Is_Fixed_Lower_Bound_Index_Subtype (Etype (Index)); + end; + end if; + -- Check error of subtype with predicate for index type Bad_Predicated_Subtype_Use @@ -6181,7 +6225,7 @@ package body Sem_Ch3 is if Nkind (Def) = N_Constrained_Array_Definition then if Ekind (T) in Incomplete_Or_Private_Kind then - Reinit_Field_To_Zero (T, Stored_Constraint); + Reinit_Field_To_Zero (T, F_Stored_Constraint); else pragma Assert (Ekind (T) = E_Void); end if; @@ -6228,7 +6272,7 @@ package body Sem_Ch3 is else pragma Assert (Nkind (Def) = N_Unconstrained_Array_Definition); if Ekind (T) in Incomplete_Or_Private_Kind then - Reinit_Field_To_Zero (T, Stored_Constraint); + Reinit_Field_To_Zero (T, F_Stored_Constraint); else pragma Assert (Ekind (T) = E_Void); end if; @@ -6239,6 +6283,8 @@ package body Sem_Ch3 is Set_Scope (T, Current_Scope); Set_Component_Size (T, Uint_0); Set_Is_Constrained (T, False); + Set_Is_Fixed_Lower_Bound_Array_Subtype + (T, Has_FLB_Index); Set_First_Index (T, First (Subtype_Marks (Def))); Set_Has_Delayed_Freeze (T, True); Propagate_Concurrent_Flags (T, Element_Type); @@ -9747,7 +9793,7 @@ package body Sem_Ch3 is if Ekind (Derived_Type) in Incomplete_Or_Private_Kind and then Ekind (Parent_Base) in Modular_Integer_Kind | Array_Kind then - Reinit_Field_To_Zero (Derived_Type, Stored_Constraint); + Reinit_Field_To_Zero (Derived_Type, F_Stored_Constraint); end if; Set_Scope (Derived_Type, Current_Scope); @@ -10921,6 +10967,15 @@ package body Sem_Ch3 is then null; + -- Skip reporting the error on Ada 2022 only subprograms + -- that require overriding if we are not in Ada 2022 mode. + + elsif Ada_Version < Ada_2022 + and then Requires_Overriding (Subp) + and then Is_Ada_2022_Only (Ultimate_Alias (Subp)) + then + null; + else Error_Msg_NE ("type must be declared abstract or & overridden", @@ -12532,7 +12587,7 @@ package body Sem_Ch3 is Set_Associated_Node_For_Itype (Full, Related_Nod); if Ekind (Full) in Incomplete_Or_Private_Kind then - Reinit_Field_To_Zero (Full, Private_Dependents); + Reinit_Field_To_Zero (Full, F_Private_Dependents); end if; -- Set common attributes for all subtypes: kind, convention, etc. @@ -13268,6 +13323,7 @@ package body Sem_Ch3 is Index : Node_Id; S, T : Entity_Id; Constraint_OK : Boolean := True; + Is_FLB_Array_Subtype : Boolean := False; begin T := Entity (Subtype_Mark (SI)); @@ -13311,6 +13367,48 @@ package body Sem_Ch3 is for J in 1 .. Number_Of_Constraints loop Constrain_Index (Index, S, Related_Nod, Related_Id, Suffix, J); + + -- If the subtype of the index has been set to indicate that + -- it has a fixed lower bound, then record that the subtype's + -- entity will need to be marked as being a fixed-lower-bound + -- array subtype. + + if S = First (Constraints (C)) then + Is_FLB_Array_Subtype := + Is_Fixed_Lower_Bound_Index_Subtype (Etype (S)); + + -- If the parent subtype (or should this be Etype of that?) + -- is an FLB array subtype, we flag an error, because we + -- don't currently allow subtypes of such subtypes to + -- specify a fixed lower bound for any of their indexes, + -- even if the index of the parent subtype is a "range <>" + -- index. + + if Is_FLB_Array_Subtype + and then Is_Fixed_Lower_Bound_Array_Subtype (T) + then + Error_Msg_NE + ("index with fixed lower bound not allowed for subtype " + & "of fixed-lower-bound }", S, T); + + Is_FLB_Array_Subtype := False; + end if; + + elsif Is_FLB_Array_Subtype + and then not Is_Fixed_Lower_Bound_Index_Subtype (Etype (S)) + then + Error_Msg_NE + ("constrained index not allowed for fixed-lower-bound " + & "subtype of}", S, T); + + elsif not Is_FLB_Array_Subtype + and then Is_Fixed_Lower_Bound_Index_Subtype (Etype (S)) + then + Error_Msg_NE + ("index with fixed lower bound not allowed for " + & "constrained subtype of}", S, T); + end if; + Next (Index); Next (S); end loop; @@ -13337,7 +13435,9 @@ package body Sem_Ch3 is Set_First_Index (Def_Id, First_Index (T)); end if; - Set_Is_Constrained (Def_Id, True); + Set_Is_Constrained (Def_Id, not Is_FLB_Array_Subtype); + Set_Is_Fixed_Lower_Bound_Array_Subtype + (Def_Id, Is_FLB_Array_Subtype); Set_Is_Aliased (Def_Id, Is_Aliased (T)); Set_Is_Independent (Def_Id, Is_Independent (T)); Set_Depends_On_Private (Def_Id, Has_Private_Component (Def_Id)); @@ -14199,6 +14299,7 @@ package body Sem_Ch3 is Def_Id : Entity_Id; R : Node_Id := Empty; T : constant Entity_Id := Etype (Index); + Is_FLB_Index : Boolean := False; begin Def_Id := @@ -14212,6 +14313,20 @@ package body Sem_Ch3 is then -- A Range attribute will be transformed into N_Range by Resolve + -- If a range has an Empty upper bound, then remember that for later + -- setting of the index subtype's Is_Fixed_Lower_Bound_Index_Subtype + -- flag, and also set the upper bound of the range to the index + -- subtype's upper bound rather than leaving it Empty. In truth, + -- that upper bound corresponds to a box ("<>"), but it's convenient + -- to set it to the upper bound to avoid needing to add special tests + -- in various places for an Empty upper bound, and in any case it + -- accurately characterizes the index's range of values. + + if Nkind (S) = N_Range and then not Present (High_Bound (S)) then + Is_FLB_Index := True; + Set_High_Bound (S, Type_High_Bound (T)); + end if; + R := S; Process_Range_Expr_In_Decl (R, T); @@ -14312,7 +14427,22 @@ package body Sem_Ch3 is Set_RM_Size (Def_Id, RM_Size (T)); Set_First_Rep_Item (Def_Id, First_Rep_Item (T)); - Set_Scalar_Range (Def_Id, R); + -- If this is a range for a fixed-lower-bound subtype, then set the + -- index itype's low bound to the FLB and the index itype's upper bound + -- to the high bound of the parent array type's index subtype. Also, + -- mark the itype as an FLB index subtype. + + if Nkind (S) = N_Range and then Is_FLB_Index then + Set_Scalar_Range + (Def_Id, + Make_Range (Sloc (S), + Low_Bound => Low_Bound (S), + High_Bound => Type_High_Bound (T))); + Set_Is_Fixed_Lower_Bound_Index_Subtype (Def_Id); + + else + Set_Scalar_Range (Def_Id, R); + end if; Set_Etype (S, Def_Id); Set_Discrete_RM_Size (Def_Id); @@ -15972,6 +16102,8 @@ package body Sem_Ch3 is then Set_Has_Yield_Aspect (New_Subp, Has_Yield_Aspect (Alias (New_Subp))); end if; + + Set_Is_Ada_2022_Only (New_Subp, Is_Ada_2022_Only (Parent_Subp)); end Derive_Subprogram; ------------------------ @@ -17120,6 +17252,8 @@ package body Sem_Ch3 is Error_Msg_N ("null exclusion can only apply to an access type", N); end if; + Check_Wide_Character_Restriction (Parent_Type, Indic); + -- Avoid deriving parent primitives of underlying record views Build_Derived_Type (N, Parent_Type, T, Is_Completion, @@ -17979,10 +18113,6 @@ package body Sem_Ch3 is Typ := Entity (S); end if; - -- Check No_Wide_Characters restriction - - Check_Wide_Character_Restriction (Typ, S); - return Typ; end Find_Type_Of_Subtype_Indic; @@ -19225,19 +19355,19 @@ package body Sem_Ch3 is -- cannot have any invariants. if Ekind (CW_Type) in Incomplete_Or_Private_Kind then - Reinit_Field_To_Zero (CW_Type, Private_Dependents); + Reinit_Field_To_Zero (CW_Type, F_Private_Dependents); elsif Ekind (CW_Type) in Concurrent_Kind then - Reinit_Field_To_Zero (CW_Type, First_Private_Entity); - Reinit_Field_To_Zero (CW_Type, Scope_Depth_Value); + Reinit_Field_To_Zero (CW_Type, F_First_Private_Entity); + Reinit_Field_To_Zero (CW_Type, F_Scope_Depth_Value); if Ekind (CW_Type) in Task_Kind then - Reinit_Field_To_Zero (CW_Type, Is_Elaboration_Checks_OK_Id); - Reinit_Field_To_Zero (CW_Type, Is_Elaboration_Warnings_OK_Id); + Reinit_Field_To_Zero (CW_Type, F_Is_Elaboration_Checks_OK_Id); + Reinit_Field_To_Zero (CW_Type, F_Is_Elaboration_Warnings_OK_Id); end if; if Ekind (CW_Type) in E_Task_Type | E_Protected_Type then - Reinit_Field_To_Zero (CW_Type, SPARK_Aux_Pragma_Inherited); + Reinit_Field_To_Zero (CW_Type, F_SPARK_Aux_Pragma_Inherited); end if; end if; @@ -19624,7 +19754,7 @@ package body Sem_Ch3 is Analyze_And_Resolve (Mod_Expr, Any_Integer); if Ekind (T) in Incomplete_Or_Private_Kind then - Reinit_Field_To_Zero (T, Stored_Constraint); + Reinit_Field_To_Zero (T, F_Stored_Constraint); end if; Set_Etype (T, T); @@ -20428,7 +20558,7 @@ package body Sem_Ch3 is Id := Defining_Identifier (Discr); if Ekind (Id) = E_In_Parameter then - Reinit_Field_To_Zero (Id, Discriminal_Link); + Reinit_Field_To_Zero (Id, F_Discriminal_Link); end if; Mutate_Ekind (Id, E_Discriminant); @@ -21316,7 +21446,7 @@ package body Sem_Ch3 is Set_Subtype_Indication (Parent (Priv_Dep), New_Occurrence_Of (Full_T, Sloc (Priv_Dep))); Reinit_Field_To_Zero - (Priv_Dep, Private_Dependents, + (Priv_Dep, F_Private_Dependents, Old_Ekind => E_Incomplete_Subtype); Mutate_Ekind (Priv_Dep, Subtype_Kind (Ekind (Full_T))); Set_Etype (Priv_Dep, Full_T); diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index d849834..ede257b 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -889,6 +889,16 @@ package body Sem_Ch4 is Check_Restriction (No_Local_Allocators, N); end if; + if SPARK_Mode = On + and then Comes_From_Source (N) + and then not Is_OK_Volatile_Context (Context => Parent (N), + Obj_Ref => N, + Check_Actuals => False) + then + Error_Msg_N + ("allocator cannot appear in this context (SPARK RM 7.1.3(10))", N); + end if; + if Serious_Errors_Detected > Sav_Errs then Set_Error_Posted (N); Set_Etype (N, Any_Type); diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 453b50e..58cf6c2 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -1320,7 +1320,7 @@ package body Sem_Ch5 is else if Ekind (Ent) = E_Label then - Reinit_Field_To_Zero (Ent, Enclosing_Scope); + Reinit_Field_To_Zero (Ent, F_Enclosing_Scope); end if; Mutate_Ekind (Ent, E_Block); @@ -1412,6 +1412,9 @@ package body Sem_Ch5 is -- the case statement, and as a result it is not a good idea to output -- warning messages about unreachable code. + Is_General_Case_Statement : Boolean := False; + -- Set True (later) if type of case expression is not discrete + procedure Non_Static_Choice_Error (Choice : Node_Id); -- Error routine invoked by the generic instantiation below when the -- case statement has a non static choice. @@ -1453,6 +1456,12 @@ package body Sem_Ch5 is Ent : Entity_Id; begin + if Is_General_Case_Statement then + return; + -- Processing deferred in this case; decls associated with + -- pattern match bindings don't exist yet. + end if; + Unblocked_Exit_Count := Unblocked_Exit_Count + 1; Statements_Analyzed := True; @@ -1527,6 +1536,34 @@ package body Sem_Ch5 is Resolve (Exp); Exp_Type := Full_View (Etype (Exp)); + -- For Ada, overloading might be ok because subsequently filtering + -- out non-discretes may resolve the ambiguity. + -- But GNAT extensions allow casing on non-discretes. + + elsif Extensions_Allowed and then Is_Overloaded (Exp) then + + -- It would be nice if we could generate all the right error + -- messages by calling "Resolve (Exp, Any_Type);" in the + -- same way that they are generated a few lines below by the + -- call "Analyze_And_Resolve (Exp, Any_Discrete);". + -- Unfortunately, Any_Type and Any_Discrete are not treated + -- consistently (specifically, by Sem_Type.Covers), so that + -- doesn't work. + + Error_Msg_N + ("selecting expression of general case statement is ambiguous", + Exp); + return; + + -- Check for a GNAT-extension "general" case statement (i.e., one where + -- the type of the selecting expression is not discrete). + + elsif Extensions_Allowed + and then not Is_Discrete_Type (Etype (Exp)) + then + Resolve (Exp, Etype (Exp)); + Exp_Type := Etype (Exp); + Is_General_Case_Statement := True; else Analyze_And_Resolve (Exp, Any_Discrete); Exp_Type := Etype (Exp); @@ -1579,6 +1616,21 @@ package body Sem_Ch5 is Analyze_Choices (Alternatives (N), Exp_Type); Check_Choices (N, Alternatives (N), Exp_Type, Others_Present); + if Is_General_Case_Statement then + -- Work normally done in Process_Statements was deferred; do that + -- deferred work now that Check_Choices has had a chance to create + -- any needed pattern-match-binding declarations. + declare + Alt : Node_Id := First (Alternatives (N)); + begin + while Present (Alt) loop + Unblocked_Exit_Count := Unblocked_Exit_Count + 1; + Analyze_Statements (Statements (Alt)); + Next (Alt); + end loop; + end; + end if; + if Exp_Type = Universal_Integer and then not Others_Present then Error_Msg_N ("case on universal integer requires OTHERS choice", Exp); end if; @@ -3760,7 +3812,7 @@ package body Sem_Ch5 is -- parser for generic units. if Ekind (Ent) = E_Label then - Reinit_Field_To_Zero (Ent, Enclosing_Scope); + Reinit_Field_To_Zero (Ent, F_Enclosing_Scope); Mutate_Ekind (Ent, E_Loop); if Nkind (Parent (Ent)) = N_Implicit_Label_Declaration then diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index d707b0e..05e74ef 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -1535,14 +1535,12 @@ package body Sem_Ch6 is -- Check RM 6.5 (5.9/3) if Has_Aliased then - if Ada_Version < Ada_2012 then - - -- Shouldn't this test Warn_On_Ada_2012_Compatibility ??? - -- Can it really happen (extended return???) - + if Ada_Version < Ada_2012 + and then Warn_On_Ada_2012_Compatibility + then Error_Msg_N ("ALIASED only allowed for limited return objects " - & "in Ada 2012??", N); + & "in Ada 2012?y?", N); elsif not Is_Limited_View (R_Type) then Error_Msg_N @@ -1674,9 +1672,9 @@ package body Sem_Ch6 is Related_Nod => N); end if; - -- ??? A real run-time accessibility check is needed in cases - -- involving dereferences of access parameters. For now we just - -- check the static cases. + -- Perform static accessibility checks for cases involving + -- dereferences of access parameters. Runtime accessibility checks + -- get generated elsewhere. if (Ada_Version < Ada_2005 or else Debug_Flag_Dot_L) and then Is_Limited_View (Etype (Scope_Id)) @@ -1848,7 +1846,7 @@ package body Sem_Ch6 is -- Visible generic entity is callable within its own body Mutate_Ekind (Gen_Id, Ekind (Body_Id)); - Reinit_Field_To_Zero (Body_Id, Has_Out_Or_In_Out_Parameter, + Reinit_Field_To_Zero (Body_Id, F_Has_Out_Or_In_Out_Parameter, Old_Ekind => (E_Function | E_Procedure | E_Generic_Function | E_Generic_Procedure => True, @@ -1929,7 +1927,7 @@ package body Sem_Ch6 is -- Outside of its body, unit is generic again - Reinit_Field_To_Zero (Gen_Id, Has_Nested_Subprogram, + Reinit_Field_To_Zero (Gen_Id, F_Has_Nested_Subprogram, Old_Ekind => (E_Function | E_Procedure => True, others => False)); Mutate_Ekind (Gen_Id, Kind); Generate_Reference (Gen_Id, Body_Id, 'b', Set_Ref => False); @@ -3827,7 +3825,8 @@ package body Sem_Ch6 is Result : Elist_Id := No_Elist; function Mask_Type_Refs (Node : Node_Id) return Traverse_Result; - -- Mask all types referenced in the subtree rooted at Node + -- Mask all types referenced in the subtree rooted at Node as + -- formally frozen. -------------------- -- Mask_Type_Refs -- @@ -3835,7 +3834,8 @@ package body Sem_Ch6 is function Mask_Type_Refs (Node : Node_Id) return Traverse_Result is procedure Mask_Type (Typ : Entity_Id); - -- ??? what does this do? + -- Mask a given type as formally frozen when outside the current + -- scope, or else freeze the type. --------------- -- Mask_Type -- @@ -4610,16 +4610,16 @@ package body Sem_Ch6 is Reference_Body_Formals (Spec_Id, Body_Id); end if; - Reinit_Field_To_Zero (Body_Id, Has_Out_Or_In_Out_Parameter); - Reinit_Field_To_Zero (Body_Id, Needs_No_Actuals, + Reinit_Field_To_Zero (Body_Id, F_Has_Out_Or_In_Out_Parameter); + Reinit_Field_To_Zero (Body_Id, F_Needs_No_Actuals, Old_Ekind => (E_Function | E_Procedure => True, others => False)); - Reinit_Field_To_Zero (Body_Id, Is_Predicate_Function, + Reinit_Field_To_Zero (Body_Id, F_Is_Predicate_Function, Old_Ekind => (E_Function | E_Procedure => True, others => False)); - Reinit_Field_To_Zero (Body_Id, Protected_Subprogram, + Reinit_Field_To_Zero (Body_Id, F_Protected_Subprogram, Old_Ekind => (E_Function | E_Procedure => True, others => False)); if Ekind (Body_Id) = E_Procedure then - Reinit_Field_To_Zero (Body_Id, Receiving_Entry); + Reinit_Field_To_Zero (Body_Id, F_Receiving_Entry); end if; Mutate_Ekind (Body_Id, E_Subprogram_Body); @@ -5665,17 +5665,6 @@ package body Sem_Ch6 is end; end if; - -- What is the following code for, it used to be - - -- ??? Set_Suppress_Elaboration_Checks - -- ??? (Designator, Elaboration_Checks_Suppressed (Designator)); - - -- The following seems equivalent, but a bit dubious - - if Elaboration_Checks_Suppressed (Designator) then - Set_Kill_Elaboration_Checks (Designator); - end if; - -- For a compilation unit, set body required. This flag will only be -- reset if a valid Import or Interface pragma is processed later on. @@ -6276,7 +6265,9 @@ package body Sem_Ch6 is -- Null exclusion must match - if not Null_Exclusions_Match (Old_Formal, New_Formal) then + if not Relaxed_RM_Semantics + and then not Null_Exclusions_Match (Old_Formal, New_Formal) + then Conformance_Error ("\null exclusion for& does not match", New_Formal); @@ -7282,10 +7273,14 @@ package body Sem_Ch6 is then Set_Overridden_Operation (Subp, Alias (Overridden_Subp)); Inherit_Subprogram_Contract (Subp, Alias (Overridden_Subp)); + Set_Is_Ada_2022_Only (Subp, + Is_Ada_2022_Only (Alias (Overridden_Subp))); else Set_Overridden_Operation (Subp, Overridden_Subp); Inherit_Subprogram_Contract (Subp, Overridden_Subp); + Set_Is_Ada_2022_Only (Subp, + Is_Ada_2022_Only (Overridden_Subp)); end if; end if; end if; @@ -11899,10 +11894,13 @@ package body Sem_Ch6 is if Present (Alias (S)) then Set_Overridden_Operation (E, Alias (S)); Inherit_Subprogram_Contract (E, Alias (S)); + Set_Is_Ada_2022_Only (E, + Is_Ada_2022_Only (Alias (S))); else Set_Overridden_Operation (E, S); Inherit_Subprogram_Contract (E, S); + Set_Is_Ada_2022_Only (E, Is_Ada_2022_Only (S)); end if; -- When a dispatching operation overrides an inherited @@ -12069,6 +12067,8 @@ package body Sem_Ch6 is then Set_Overridden_Operation (S, Alias (E)); Inherit_Subprogram_Contract (S, Alias (E)); + Set_Is_Ada_2022_Only (S, + Is_Ada_2022_Only (Alias (E))); -- Normal case of setting entity as overridden @@ -12080,8 +12080,22 @@ package body Sem_Ch6 is -- must check whether the target is an init_proc. elsif not Is_Init_Proc (S) then - Set_Overridden_Operation (S, E); - Inherit_Subprogram_Contract (S, E); + + -- LSP wrappers must override the ultimate alias of their + -- wrapped dispatching primitive E; required to traverse + -- the chain of ancestor primitives (c.f. Map_Primitives) + -- They don't inherit contracts. + + if Is_Wrapper (S) + and then Present (LSP_Subprogram (S)) + then + Set_Overridden_Operation (S, Ultimate_Alias (E)); + else + Set_Overridden_Operation (S, E); + Inherit_Subprogram_Contract (S, E); + end if; + + Set_Is_Ada_2022_Only (S, Is_Ada_2022_Only (E)); end if; Check_Overriding_Indicator (S, E, Is_Primitive => True); @@ -12108,8 +12122,22 @@ package body Sem_Ch6 is Is_Predefined_Dispatching_Operation (Alias (E))) then if Present (Alias (E)) then - Set_Overridden_Operation (S, Alias (E)); - Inherit_Subprogram_Contract (S, Alias (E)); + + -- LSP wrappers must override the ultimate alias of + -- their wrapped dispatching primitive E; required to + -- traverse the chain of ancestor primitives (see + -- Map_Primitives). They don't inherit contracts. + + if Is_Wrapper (S) + and then Present (LSP_Subprogram (S)) + then + Set_Overridden_Operation (S, Ultimate_Alias (E)); + else + Set_Overridden_Operation (S, Alias (E)); + Inherit_Subprogram_Contract (S, Alias (E)); + end if; + + Set_Is_Ada_2022_Only (S, Is_Ada_2022_Only (Alias (E))); end if; end if; diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb index ff8308c..69ad184 100644 --- a/gcc/ada/sem_ch7.adb +++ b/gcc/ada/sem_ch7.adb @@ -2061,6 +2061,8 @@ package body Sem_Ch7 is Replace_Elmt (Op_Elmt, New_Op); Remove_Elmt (Op_List, Op_Elmt_2); Set_Overridden_Operation (New_Op, Parent_Subp); + Set_Is_Ada_2022_Only (New_Op, + Is_Ada_2022_Only (Parent_Subp)); -- We don't need to inherit its dispatching slot. -- Set_All_DT_Position has previously ensured that @@ -2722,8 +2724,10 @@ package body Sem_Ch7 is (Priv, Size_Known_At_Compile_Time (Full)); Set_Is_Volatile (Priv, Is_Volatile (Full)); Set_Treat_As_Volatile (Priv, Treat_As_Volatile (Full)); + Set_Is_Atomic (Priv, Is_Atomic (Full)); Set_Is_Ada_2005_Only (Priv, Is_Ada_2005_Only (Full)); Set_Is_Ada_2012_Only (Priv, Is_Ada_2012_Only (Full)); + Set_Is_Ada_2022_Only (Priv, Is_Ada_2022_Only (Full)); Set_Has_Pragma_Unmodified (Priv, Has_Pragma_Unmodified (Full)); Set_Has_Pragma_Unreferenced (Priv, Has_Pragma_Unreferenced (Full)); Set_Has_Pragma_Unreferenced_Objects @@ -2733,7 +2737,6 @@ package body Sem_Ch7 is if Is_Unchecked_Union (Full) then Set_Is_Unchecked_Union (Base_Type (Priv)); end if; - -- Why is atomic not copied here ??? if Referenced (Full) then Set_Referenced (Priv); diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index 26fc45f..1c68eed 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -481,11 +481,10 @@ package body Sem_Ch8 is -- legality of selector given the scope denoted by prefix, and change node -- N into a expanded name with a properly set Entity field. - function Find_Most_Prev (Use_Clause : Node_Id) return Node_Id; + function Find_First_Use (Use_Clause : Node_Id) return Node_Id; -- Find the most previous use clause (that is, the first one to appear in -- the source) by traversing the previous clause chain that exists in both -- N_Use_Package_Clause nodes and N_Use_Type_Clause nodes. - -- ??? a better subprogram name is in order function Find_Renamed_Entity (N : Node_Id; @@ -529,7 +528,6 @@ package body Sem_Ch8 is Clause2 : Entity_Id) return Entity_Id; -- Determine which use clause parameter is the most descendant in terms of -- scope. - -- ??? a better subprogram name is in order procedure Premature_Usage (N : Node_Id); -- Diagnose usage of an entity before it is visible @@ -1168,7 +1166,9 @@ package body Sem_Ch8 is and then Is_Anonymous_Access_Type (Etype (Expression (Nam))) and then not Is_Anonymous_Access_Type (T) then - Wrong_Type (Expression (Nam), T); -- Should we give better error??? + Error_Msg_NE + ("cannot rename anonymous access object " + & "as a named access type", Expression (Nam), T); end if; -- Check that a class-wide object is not being renamed as an object @@ -3278,8 +3278,8 @@ package body Sem_Ch8 is -- constructed later at the freeze point, so indicate that the -- completion has not been seen yet. - Reinit_Field_To_Zero (New_S, Has_Out_Or_In_Out_Parameter); - Reinit_Field_To_Zero (New_S, Needs_No_Actuals, + Reinit_Field_To_Zero (New_S, F_Has_Out_Or_In_Out_Parameter); + Reinit_Field_To_Zero (New_S, F_Needs_No_Actuals, Old_Ekind => (E_Function | E_Procedure => True, others => False)); Mutate_Ekind (New_S, E_Subprogram_Body); New_S := Rename_Spec; @@ -5314,16 +5314,6 @@ package body Sem_Ch8 is elsif not Comes_From_Source (E) then return False; - - -- In gnat internal mode, we consider all entities known. The - -- historical reason behind this discrepancy is not known??? But the - -- only effect is to modify the error message given, so it is not - -- critical. Since it only affects the exact wording of error - -- messages in illegal programs, we do not mention this as an - -- effect of -gnatg, since it is not a language modification. - - elsif GNAT_Mode then - return True; end if; -- Here we have an entity that is not from package Standard, and @@ -6835,7 +6825,7 @@ package body Sem_Ch8 is case Nkind (N) is when N_Selected_Component => - Reinit_Field_To_Zero (N, Is_Prefixed_Call); + Reinit_Field_To_Zero (N, F_Is_Prefixed_Call); Change_Selected_Component_To_Expanded_Name (N); when N_Expanded_Name => @@ -6989,10 +6979,10 @@ package body Sem_Ch8 is end Find_Expanded_Name; -------------------- - -- Find_Most_Prev -- + -- Find_First_Use -- -------------------- - function Find_Most_Prev (Use_Clause : Node_Id) return Node_Id is + function Find_First_Use (Use_Clause : Node_Id) return Node_Id is Curr : Node_Id; begin @@ -7004,7 +6994,7 @@ package body Sem_Ch8 is end loop; return Curr; - end Find_Most_Prev; + end Find_First_Use; ------------------------- -- Find_Renamed_Entity -- @@ -9804,16 +9794,16 @@ package body Sem_Ch8 is if Present (Redundant) and then Parent (Redundant) /= Prev_Use then -- Make sure we are looking at most-descendant use_package_clause - -- by traversing the chain with Find_Most_Prev and then verifying + -- by traversing the chain with Find_First_Use and then verifying -- there is no scope manipulation via Most_Descendant_Use_Clause. if Nkind (Prev_Use) = N_Use_Package_Clause and then (Nkind (Parent (Prev_Use)) /= N_Compilation_Unit or else Most_Descendant_Use_Clause - (Prev_Use, Find_Most_Prev (Prev_Use)) /= Prev_Use) + (Prev_Use, Find_First_Use (Prev_Use)) /= Prev_Use) then - Prev_Use := Find_Most_Prev (Prev_Use); + Prev_Use := Find_First_Use (Prev_Use); end if; Error_Msg_Sloc := Sloc (Prev_Use); @@ -10367,7 +10357,7 @@ package body Sem_Ch8 is if Present (Current_Use_Clause (T)) then Use_Clause_Known : declare Clause1 : constant Node_Id := - Find_Most_Prev (Current_Use_Clause (T)); + Find_First_Use (Current_Use_Clause (T)); Clause2 : constant Node_Id := Parent (Id); Ent1 : Entity_Id; Ent2 : Entity_Id; @@ -10507,10 +10497,10 @@ package body Sem_Ch8 is -- a spurious warning - so verify there is a previous use clause. if Current_Use_Clause (Scope (T)) /= - Find_Most_Prev (Current_Use_Clause (Scope (T))) + Find_First_Use (Current_Use_Clause (Scope (T))) then Error_Msg_Sloc := - Sloc (Find_Most_Prev (Current_Use_Clause (Scope (T)))); + Sloc (Find_First_Use (Current_Use_Clause (Scope (T)))); Error_Msg_NE -- CODEFIX ("& is already use-visible through package use clause #??", Id, T); diff --git a/gcc/ada/sem_disp.adb b/gcc/ada/sem_disp.adb index 20e3e93..15b700fa 100644 --- a/gcc/ada/sem_disp.adb +++ b/gcc/ada/sem_disp.adb @@ -1239,7 +1239,9 @@ package body Sem_Disp is or else Get_TSS_Name (Subp) = TSS_Stream_Read or else Get_TSS_Name (Subp) = TSS_Stream_Write - or else Present (Contract (Overridden_Operation (Subp))) + or else + (Is_Wrapper (Subp) + and then Present (LSP_Subprogram (Subp))) or else GNATprove_Mode); @@ -2199,6 +2201,8 @@ package body Sem_Disp is while Present (Elmt) loop if Node (Elmt) = Orig_Prim then Set_Overridden_Operation (S, Prim); + Set_Is_Ada_2022_Only (S, + Is_Ada_2022_Only (Prim)); Set_Alias (Prim, Orig_Prim); return Prim; end if; @@ -2644,8 +2648,7 @@ package body Sem_Disp is procedure Override_Dispatching_Operation (Tagged_Type : Entity_Id; Prev_Op : Entity_Id; - New_Op : Entity_Id; - Is_Wrapper : Boolean := False) + New_Op : Entity_Id) is Elmt : Elmt_Id; Prim : Node_Id; @@ -2722,7 +2725,7 @@ package body Sem_Disp is -- wrappers of controlling functions since (at this stage) -- they are not yet decorated. - if not Is_Wrapper then + if not Is_Wrapper (New_Op) then Check_Subtype_Conformant (New_Op, Prim); Set_Is_Abstract_Subprogram (Prim, @@ -2761,6 +2764,7 @@ package body Sem_Disp is Set_Alias (Prev_Op, New_Op); Set_DTC_Entity (Prev_Op, Empty); Set_Has_Controlling_Result (New_Op, Has_Controlling_Result (Prev_Op)); + Set_Is_Ada_2022_Only (New_Op, Is_Ada_2022_Only (Prev_Op)); end if; end Override_Dispatching_Operation; diff --git a/gcc/ada/sem_disp.ads b/gcc/ada/sem_disp.ads index c9aa366..7b42cf5 100644 --- a/gcc/ada/sem_disp.ads +++ b/gcc/ada/sem_disp.ads @@ -167,13 +167,10 @@ package Sem_Disp is procedure Override_Dispatching_Operation (Tagged_Type : Entity_Id; Prev_Op : Entity_Id; - New_Op : Entity_Id; - Is_Wrapper : Boolean := False); + New_Op : Entity_Id); -- Replace an implicit dispatching operation of the type Tagged_Type -- with an explicit one. Prev_Op is an inherited primitive operation which - -- is overridden by the explicit declaration of New_Op. Is_Wrapper is - -- True when New_Op is an internally generated wrapper of a controlling - -- function. The caller checks that Tagged_Type is indeed a tagged type. + -- is overridden by the explicit declaration of New_Op. procedure Propagate_Tag (Control : Node_Id; Actual : Node_Id); -- If a function call given by Actual is tag-indeterminate, its controlling diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb index 307045a2..7a70fd8 100644 --- a/gcc/ada/sem_eval.adb +++ b/gcc/ada/sem_eval.adb @@ -6223,7 +6223,7 @@ package body Sem_Eval is end; else - -- TBD: Implement Interval_Lists for real types + -- ??? Need to implement Interval_Lists for real types return False; end if; diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index d52ad5c..ea0a5bb 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -4083,9 +4083,9 @@ package body Sem_Prag is procedure Check_Static_Constraint (Constr : Node_Id); -- Constr is a constraint from an N_Subtype_Indication node from a - -- component constraint in an Unchecked_Union type. This routine checks - -- that the constraint is static as required by the restrictions for - -- Unchecked_Union. + -- component constraint in an Unchecked_Union type, a range, or a + -- discriminant association. This routine checks that the constraint + -- is static as required by the restrictions for Unchecked_Union. procedure Check_Valid_Configuration_Pragma; -- Legality checks for placement of a configuration pragma @@ -6458,11 +6458,6 @@ package body Sem_Prag is -- Check_Static_Constraint -- ----------------------------- - -- Note: for convenience in writing this procedure, in addition to - -- the officially (i.e. by spec) allowed argument which is always a - -- constraint, it also allows ranges and discriminant associations. - -- Above is not clear ??? - procedure Check_Static_Constraint (Constr : Node_Id) is procedure Require_Static (E : Node_Id); @@ -6893,7 +6888,7 @@ package body Sem_Prag is Proc : Entity_Id := Empty; begin - -- The body of this procedure needs some comments ??? + -- Perform sanity checks on Name if not Is_Entity_Name (Name) then Error_Pragma_Arg @@ -6909,6 +6904,9 @@ package body Sem_Prag is ("argument of pragma% must be parameterless procedure", Arg); end if; + -- Otherwise, search through interpretations looking for one which + -- has no parameters. + else declare Found : Boolean := False; @@ -6923,10 +6921,17 @@ package body Sem_Prag is if Ekind (Proc) = E_Procedure and then No (First_Formal (Proc)) then + -- We found an interpretation, note it and continue + -- looking looking to verify it is unique. + if not Found then Found := True; Set_Entity (Name, Proc); Set_Is_Overloaded (Name, False); + + -- Two procedures with the same name, log an error + -- since the name is ambiguous. + else Error_Pragma_Arg ("ambiguous handler name for pragma%", Arg); @@ -6937,9 +6942,13 @@ package body Sem_Prag is end loop; if not Found then + -- Issue an error if we haven't found a suitable match for + -- Name. + Error_Pragma_Arg ("argument of pragma% must be parameterless procedure", Arg); + else Proc := Entity (Name); end if; @@ -9127,7 +9136,10 @@ package body Sem_Prag is Def_Id := Entity (Def_Id); Kill_Size_Check_Code (Def_Id); - Note_Possible_Modification (Get_Pragma_Arg (Arg1), Sure => False); + if Ekind (Def_Id) /= E_Constant then + Note_Possible_Modification + (Get_Pragma_Arg (Arg1), Sure => False); + end if; else Process_Convention (C, Def_Id); @@ -9137,7 +9149,10 @@ package body Sem_Prag is Mark_Ghost_Pragma (N, Def_Id); Kill_Size_Check_Code (Def_Id); - Note_Possible_Modification (Get_Pragma_Arg (Arg2), Sure => False); + if Ekind (Def_Id) /= E_Constant then + Note_Possible_Modification + (Get_Pragma_Arg (Arg2), Sure => False); + end if; end if; -- Various error checks @@ -10869,8 +10884,8 @@ package body Sem_Prag is procedure Record_Independence_Check (N : Node_Id; E : Entity_Id) is pragma Unreferenced (N, E); begin - -- For GCC back ends the validation is done a priori - -- ??? This code is dead, might be useful in the future + -- For GCC back ends the validation is done a priori. This code is + -- dead, but might be useful in the future. -- if not AAMP_On_Target then -- return; @@ -12533,22 +12548,61 @@ package body Sem_Prag is -------------- -- pragma Ada_2022; + -- pragma Ada_2022 (LOCAL_NAME): -- Note: this pragma also has some specific processing in Par.Prag -- because we want to set the Ada 2022 version mode during parsing. + -- The one argument form is used for managing the transition from Ada + -- 2012 to Ada 2022 in the run-time library. If an entity is marked + -- as Ada_2022 only, then referencing the entity in any pre-Ada_2022 + -- mode will generate a warning;for calls to Ada_2022 only primitives + -- that require overriding an error will be reported. In addition, in + -- any pre-Ada_2022 mode, a preference rule is established which does + -- not choose such an entity unless it is unambiguously specified. + -- This avoids extra subprograms marked this way from generating + -- ambiguities in otherwise legal pre-Ada 2022 programs. The one + -- argument form is intended for exclusive use in the GNAT run-time + -- library. + when Pragma_Ada_2022 => + declare + E_Id : Node_Id; + + begin GNAT_Pragma; - Check_Arg_Count (0); + if Arg_Count = 1 then + Check_Arg_Is_Local_Name (Arg1); + E_Id := Get_Pragma_Arg (Arg1); - Check_Valid_Configuration_Pragma; + if Etype (E_Id) = Any_Type then + return; + end if; + + Set_Is_Ada_2022_Only (Entity (E_Id)); + Record_Rep_Item (Entity (E_Id), N); + + else + Check_Arg_Count (0); + + -- For Ada_2022 we unconditionally enforce the documented + -- configuration pragma placement, since we do not want to + -- tolerate mixed modes in a unit involving Ada 2022. That + -- would cause real difficulties for those cases where there + -- are incompatibilities between Ada 2012 and Ada 2022. We + -- could allow mixing of Ada 2012 and Ada 2022 but it's not + -- worth it. - -- Now set appropriate Ada mode + Check_Valid_Configuration_Pragma; + + -- Now set appropriate Ada mode - Ada_Version := Ada_2022; - Ada_Version_Explicit := Ada_2022; - Ada_Version_Pragma := N; + Ada_Version := Ada_2022; + Ada_Version_Explicit := Ada_2022; + Ada_Version_Pragma := N; + end if; + end; ------------------------------------- -- Aggregate_Individually_Assign -- @@ -16280,25 +16334,6 @@ package body Sem_Prag is Arg_Mechanism => Mechanism); end Export_Procedure; - ------------------ - -- Export_Value -- - ------------------ - - -- pragma Export_Value ( - -- [Value =>] static_integer_EXPRESSION, - -- [Link_Name =>] static_string_EXPRESSION); - - when Pragma_Export_Value => - GNAT_Pragma; - Check_Arg_Order ((Name_Value, Name_Link_Name)); - Check_Arg_Count (2); - - Check_Optional_Identifier (Arg1, Name_Value); - Check_Arg_Is_OK_Static_Expression (Arg1, Any_Integer); - - Check_Optional_Identifier (Arg2, Name_Link_Name); - Check_Arg_Is_OK_Static_Expression (Arg2, Standard_String); - ----------------------------- -- Export_Valued_Procedure -- ----------------------------- @@ -16408,11 +16443,8 @@ package body Sem_Prag is Check_Arg_Is_One_Of (Arg1, Name_On, Name_Off); if Chars (Get_Pragma_Arg (Arg1)) = Name_On then - Extensions_Allowed := True; - Ada_Version := Ada_Version_Type'Last; - + Ada_Version := Ada_With_Extensions; else - Extensions_Allowed := False; Ada_Version := Ada_Version_Explicit; Ada_Version_Pragma := Empty; end if; @@ -20409,7 +20441,8 @@ package body Sem_Prag is elsif Chars (Argx) = Name_Eliminated then if Ttypes.Standard_Long_Long_Integer_Size /= 64 then Error_Pragma_Arg - ("Eliminated not implemented on this target", Argx); + ("Eliminated requires Long_Long_Integer'Size = 64", + Argx); else return Eliminated; end if; @@ -24925,16 +24958,6 @@ package body Sem_Prag is Record_Rep_Item (E, N); end Universal_Alias; - -------------------- - -- Universal_Data -- - -------------------- - - -- pragma Universal_Data [(library_unit_NAME)]; - - when Pragma_Universal_Data => - GNAT_Pragma; - Error_Pragma ("??pragma% ignored (applies only to AAMP)"); - ---------------- -- Unmodified -- ---------------- @@ -31206,7 +31229,6 @@ package body Sem_Prag is Pragma_Export_Function => -1, Pragma_Export_Object => -1, Pragma_Export_Procedure => -1, - Pragma_Export_Value => -1, Pragma_Export_Valued_Procedure => -1, Pragma_Extend_System => -1, Pragma_Extensions_Allowed => 0, @@ -31361,7 +31383,6 @@ package body Sem_Prag is Pragma_Unevaluated_Use_Of_Old => 0, Pragma_Unimplemented_Unit => 0, Pragma_Universal_Aliasing => 0, - Pragma_Universal_Data => 0, Pragma_Unmodified => 0, Pragma_Unreferenced => 0, Pragma_Unreferenced_Objects => 0, diff --git a/gcc/ada/sem_prag.ads b/gcc/ada/sem_prag.ads index 75856c8..c620beb 100644 --- a/gcc/ada/sem_prag.ads +++ b/gcc/ada/sem_prag.ads @@ -115,7 +115,6 @@ package Sem_Prag is Pragma_Type_Invariant => True, Pragma_Unchecked_Union => True, Pragma_Universal_Aliasing => True, - Pragma_Universal_Data => True, Pragma_Unmodified => True, Pragma_Unreferenced => True, Pragma_Unreferenced_Objects => True, diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 3ca4569..be09453 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -57,6 +57,7 @@ with Sem; use Sem; with Sem_Aggr; use Sem_Aggr; with Sem_Attr; use Sem_Attr; with Sem_Aux; use Sem_Aux; +with Sem_Case; use Sem_Case; with Sem_Cat; use Sem_Cat; with Sem_Ch3; use Sem_Ch3; with Sem_Ch4; use Sem_Ch4; @@ -3390,12 +3391,9 @@ package body Sem_Res is -- Here we are resolving the corresponding expanded body, so we do -- need to perform normal freezing. - -- As elsewhere we do not emit freeze node within a generic. We make - -- an exception for entities that are expressions, only to detect - -- misuses of deferred constants and preserve the output of various - -- tests. + -- As elsewhere we do not emit freeze node within a generic. - if not Inside_A_Generic or else Is_Entity_Name (N) then + if not Inside_A_Generic then Freeze_Expression (N); end if; @@ -4772,6 +4770,13 @@ package body Sem_Res is -- Expand_Actuals routine in Exp_Ch6. end if; + -- If the formal is of an unconstrained array subtype with fixed + -- lower bound, then sliding to that bound may be needed. + + if Is_Fixed_Lower_Bound_Array_Subtype (F_Typ) then + Expand_Sliding_Conversion (A, F_Typ); + end if; + -- An actual associated with an access parameter is implicitly -- converted to the anonymous access type of the formal and must -- satisfy the legality checks for access conversions. @@ -7768,10 +7773,12 @@ package body Sem_Res is -- Case of (sub)type name appearing in a context where an expression -- is expected. This is legal if occurrence is a current instance. - -- See RM 8.6 (17/3). + -- See RM 8.6 (17/3). It is also legal if the expression is + -- part of a choice pattern for a case stmt/expr having a + -- non-discrete selecting expression. elsif Is_Type (E) then - if Is_Current_Instance (N) then + if Is_Current_Instance (N) or else Is_Case_Choice_Pattern (N) then null; -- Any other use is an error diff --git a/gcc/ada/sem_type.adb b/gcc/ada/sem_type.adb index 2998d2f..396f616 100644 --- a/gcc/ada/sem_type.adb +++ b/gcc/ada/sem_type.adb @@ -1810,26 +1810,42 @@ package body Sem_Type is It2 := It; Nam2 := It.Nam; - -- Check whether one of the entities is an Ada 2005/2012 and we are - -- operating in an earlier mode, in which case we discard the Ada - -- 2005/2012 entity, so that we get proper Ada 95 overload resolution. + -- Check whether one of the entities is an Ada 2005/2012/2022 and we + -- are operating in an earlier mode, in which case we discard the Ada + -- 2005/2012/2022 entity, so that we get proper Ada 95 overload + -- resolution. if Ada_Version < Ada_2005 then - if Is_Ada_2005_Only (Nam1) or else Is_Ada_2012_Only (Nam1) then + if Is_Ada_2005_Only (Nam1) + or else Is_Ada_2012_Only (Nam1) + or else Is_Ada_2022_Only (Nam1) + then return It2; - elsif Is_Ada_2005_Only (Nam2) or else Is_Ada_2012_Only (Nam1) then + + elsif Is_Ada_2005_Only (Nam2) + or else Is_Ada_2012_Only (Nam2) + or else Is_Ada_2022_Only (Nam2) + then + return It1; + end if; + + -- Check whether one of the entities is an Ada 2012/2022 entity and we + -- are operating in Ada 2005 mode, in which case we discard the Ada 2012 + -- Ada 2022 entity, so that we get proper Ada 2005 overload resolution. + + elsif Ada_Version = Ada_2005 then + if Is_Ada_2012_Only (Nam1) or else Is_Ada_2022_Only (Nam1) then + return It2; + elsif Is_Ada_2012_Only (Nam2) or else Is_Ada_2022_Only (Nam2) then return It1; end if; - end if; - -- Check whether one of the entities is an Ada 2012 entity and we are - -- operating in Ada 2005 mode, in which case we discard the Ada 2012 - -- entity, so that we get proper Ada 2005 overload resolution. + -- Ditto for Ada 2012 vs Ada 2022. - if Ada_Version = Ada_2005 then - if Is_Ada_2012_Only (Nam1) then + elsif Ada_Version = Ada_2012 then + if Is_Ada_2022_Only (Nam1) then return It2; - elsif Is_Ada_2012_Only (Nam2) then + elsif Is_Ada_2022_Only (Nam2) then return It1; end if; end if; diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 6481d86..fb44823 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -1007,11 +1007,7 @@ package body Sem_Util is and then Is_Entity_Name (Name (Expr)) and then Is_RTE (Entity (Name (Expr)), RE_To_Address) then - Expr := First (Parameter_Associations (Expr)); - - if Nkind (Expr) = N_Parameter_Association then - Expr := Explicit_Actual_Parameter (Expr); - end if; + Expr := First_Actual (Expr); -- We finally have the real expression @@ -1683,6 +1679,7 @@ package body Sem_Util is Subt : Entity_Id; Disc_Type : Entity_Id; Obj : Node_Id; + Index : Node_Id; begin Loc := Sloc (N); @@ -1713,6 +1710,8 @@ package body Sem_Util is if Is_Array_Type (T) then Constraints := New_List; + Index := First_Index (T); + for J in 1 .. Number_Dimensions (T) loop -- Build an array subtype declaration with the nominal subtype and @@ -1720,13 +1719,24 @@ package body Sem_Util is -- local declarations for the subprogram, for analysis before any -- reference to the formal in the body. - Lo := - Make_Attribute_Reference (Loc, - Prefix => - Duplicate_Subexpr_No_Checks (Obj, Name_Req => True), - Attribute_Name => Name_First, - Expressions => New_List ( - Make_Integer_Literal (Loc, J))); + -- If this is for an index with a fixed lower bound, then use + -- the fixed lower bound as the lower bound of the actual + -- subtype's corresponding index. + + if not Is_Constrained (T) + and then Is_Fixed_Lower_Bound_Index_Subtype (Etype (Index)) + then + Lo := New_Copy_Tree (Type_Low_Bound (Etype (Index))); + + else + Lo := + Make_Attribute_Reference (Loc, + Prefix => + Duplicate_Subexpr_No_Checks (Obj, Name_Req => True), + Attribute_Name => Name_First, + Expressions => New_List ( + Make_Integer_Literal (Loc, J))); + end if; Hi := Make_Attribute_Reference (Loc, @@ -1737,6 +1747,8 @@ package body Sem_Util is Make_Integer_Literal (Loc, J))); Append (Make_Range (Loc, Lo, Hi), Constraints); + + Next_Index (Index); end loop; -- If the type has unknown discriminants there is no constrained @@ -7294,150 +7306,128 @@ package body Sem_Util is ----------------------- function Is_Valid_Renaming (N : Node_Id) return Boolean is - function Check_Renaming (N : Node_Id) return Boolean; - -- Recursive function used to traverse all the prefixes of N - - -------------------- - -- Check_Renaming -- - -------------------- + begin + if Is_Renaming (N) + and then not Is_Valid_Renaming (Renamed_Entity (Entity (N))) + then + return False; + end if; - function Check_Renaming (N : Node_Id) return Boolean is - begin - if Is_Renaming (N) - and then not Check_Renaming (Renamed_Entity (Entity (N))) - then - return False; - end if; + -- Check if any expression within the renamed object_name contains no + -- references to variables nor calls on nonstatic functions. - if Nkind (N) = N_Indexed_Component then - declare - Indx : Node_Id; + if Nkind (N) = N_Indexed_Component then + declare + Indx : Node_Id; - begin - Indx := First (Expressions (N)); - while Present (Indx) loop - if not Is_OK_Static_Expression (Indx) then - return False; - end if; + begin + Indx := First (Expressions (N)); + while Present (Indx) loop + if not Is_OK_Static_Expression (Indx) then + return False; + end if; - Next_Index (Indx); - end loop; - end; - end if; + Next_Index (Indx); + end loop; + end; - if Has_Prefix (N) then - declare - P : constant Node_Id := Prefix (N); + elsif Nkind (N) = N_Slice then + declare + Rng : constant Node_Id := Discrete_Range (N); + begin + -- Bounds specified as a range - begin - if Nkind (N) = N_Explicit_Dereference - and then Is_Variable (P) - then + if Nkind (Rng) = N_Range then + if not Is_OK_Static_Range (Rng) then return False; + end if; - elsif Is_Entity_Name (P) - and then Ekind (Entity (P)) = E_Function - then - return False; + -- Bounds specified as a constrained subtype indication - elsif Nkind (P) = N_Function_Call then + elsif Nkind (Rng) = N_Subtype_Indication then + if not Is_OK_Static_Range + (Range_Expression (Constraint (Rng))) + then return False; end if; - -- Recursion to continue traversing the prefix of the - -- renaming expression + -- Bounds specified as a subtype name - return Check_Renaming (P); - end; - end if; + elsif not Is_OK_Static_Expression (Rng) then + return False; + end if; + end; + end if; - return True; - end Check_Renaming; + if Has_Prefix (N) then + declare + P : constant Node_Id := Prefix (N); - -- Start of processing for Is_Valid_Renaming + begin + if Nkind (N) = N_Explicit_Dereference + and then Is_Variable (P) + then + return False; - begin - return Check_Renaming (N); - end Is_Valid_Renaming; + elsif Is_Entity_Name (P) + and then Ekind (Entity (P)) = E_Function + then + return False; - -- Local variables + elsif Nkind (P) = N_Function_Call then + return False; + end if; - Obj1 : Node_Id := A1; - Obj2 : Node_Id := A2; + -- Recursion to continue traversing the prefix of the + -- renaming expression + + return Is_Valid_Renaming (P); + end; + end if; + + return True; + end Is_Valid_Renaming; -- Start of processing for Denotes_Same_Object begin - -- Both names statically denote the same stand-alone object or parameter - -- (RM 6.4.1(6.5/3)) + -- Both names statically denote the same stand-alone object or + -- parameter (RM 6.4.1(6.6/3)). - if Is_Entity_Name (Obj1) - and then Is_Entity_Name (Obj2) - and then Entity (Obj1) = Entity (Obj2) + if Is_Entity_Name (A1) + and then Is_Entity_Name (A2) + and then Entity (A1) = Entity (A2) then return True; - end if; - - -- For renamings, the prefix of any dereference within the renamed - -- object_name is not a variable, and any expression within the - -- renamed object_name contains no references to variables nor - -- calls on nonstatic functions (RM 6.4.1(6.10/3)). - - if Is_Renaming (Obj1) then - if Is_Valid_Renaming (Obj1) then - Obj1 := Renamed_Entity (Entity (Obj1)); - else - return False; - end if; - end if; - - if Is_Renaming (Obj2) then - if Is_Valid_Renaming (Obj2) then - Obj2 := Renamed_Entity (Entity (Obj2)); - else - return False; - end if; - end if; - - -- No match if not same node kind (such cases are handled by - -- Denotes_Same_Prefix) - - if Nkind (Obj1) /= Nkind (Obj2) then - return False; - - -- After handling valid renamings, one of the two names statically - -- denoted a renaming declaration whose renamed object_name is known - -- to denote the same object as the other (RM 6.4.1(6.10/3)) - - elsif Is_Entity_Name (Obj1) then - if Is_Entity_Name (Obj2) then - return Entity (Obj1) = Entity (Obj2); - else - return False; - end if; -- Both names are selected_components, their prefixes are known to -- denote the same object, and their selector_names denote the same - -- component (RM 6.4.1(6.6/3)). + -- component (RM 6.4.1(6.7/3)). - elsif Nkind (Obj1) = N_Selected_Component then - return Denotes_Same_Object (Prefix (Obj1), Prefix (Obj2)) + elsif Nkind (A1) = N_Selected_Component + and then Nkind (A2) = N_Selected_Component + then + return Denotes_Same_Object (Prefix (A1), Prefix (A2)) and then - Entity (Selector_Name (Obj1)) = Entity (Selector_Name (Obj2)); + Entity (Selector_Name (A1)) = Entity (Selector_Name (A2)); -- Both names are dereferences and the dereferenced names are known to - -- denote the same object (RM 6.4.1(6.7/3)) + -- denote the same object (RM 6.4.1(6.8/3)). - elsif Nkind (Obj1) = N_Explicit_Dereference then - return Denotes_Same_Object (Prefix (Obj1), Prefix (Obj2)); + elsif Nkind (A1) = N_Explicit_Dereference + and then Nkind (A2) = N_Explicit_Dereference + then + return Denotes_Same_Object (Prefix (A1), Prefix (A2)); -- Both names are indexed_components, their prefixes are known to denote -- the same object, and each of the pairs of corresponding index values -- are either both static expressions with the same static value or both - -- names that are known to denote the same object (RM 6.4.1(6.8/3)) + -- names that are known to denote the same object (RM 6.4.1(6.9/3)). - elsif Nkind (Obj1) = N_Indexed_Component then - if not Denotes_Same_Object (Prefix (Obj1), Prefix (Obj2)) then + elsif Nkind (A1) = N_Indexed_Component + and then Nkind (A2) = N_Indexed_Component + then + if not Denotes_Same_Object (Prefix (A1), Prefix (A2)) then return False; else declare @@ -7445,8 +7435,8 @@ package body Sem_Util is Indx2 : Node_Id; begin - Indx1 := First (Expressions (Obj1)); - Indx2 := First (Expressions (Obj2)); + Indx1 := First (Expressions (A1)); + Indx2 := First (Expressions (A2)); while Present (Indx1) loop -- Indexes must denote the same static value or same object @@ -7473,33 +7463,60 @@ package body Sem_Util is -- Both names are slices, their prefixes are known to denote the same -- object, and the two slices have statically matching index constraints - -- (RM 6.4.1(6.9/3)) + -- (RM 6.4.1(6.10/3)). - elsif Nkind (Obj1) = N_Slice - and then Denotes_Same_Object (Prefix (Obj1), Prefix (Obj2)) + elsif Nkind (A1) = N_Slice + and then Nkind (A2) = N_Slice then - declare - Lo1, Lo2, Hi1, Hi2 : Node_Id; + if not Denotes_Same_Object (Prefix (A1), Prefix (A2)) then + return False; + else + declare + Lo1, Lo2, Hi1, Hi2 : Node_Id; - begin - Get_Index_Bounds (Etype (Obj1), Lo1, Hi1); - Get_Index_Bounds (Etype (Obj2), Lo2, Hi2); + begin + Get_Index_Bounds (Discrete_Range (A1), Lo1, Hi1); + Get_Index_Bounds (Discrete_Range (A2), Lo2, Hi2); - -- Check whether bounds are statically identical. There is no - -- attempt to detect partial overlap of slices. + -- Check whether bounds are statically identical. There is no + -- attempt to detect partial overlap of slices. - return Denotes_Same_Object (Lo1, Lo2) - and then - Denotes_Same_Object (Hi1, Hi2); - end; + return Denotes_Same_Object (Lo1, Lo2) + and then + Denotes_Same_Object (Hi1, Hi2); + end; + end if; - -- In the recursion, literals appear as indexes + -- One of the two names statically denotes a renaming declaration whose + -- renamed object_name is known to denote the same object as the other; + -- the prefix of any dereference within the renamed object_name is not a + -- variable, and any expression within the renamed object_name contains + -- no references to variables nor calls on nonstatic functions (RM + -- 6.4.1(6.11/3)). - elsif Nkind (Obj1) = N_Integer_Literal - and then - Nkind (Obj2) = N_Integer_Literal + elsif Is_Renaming (A1) + and then Is_Valid_Renaming (A1) + then + return Denotes_Same_Object (Renamed_Entity (Entity (A1)), A2); + + elsif Is_Renaming (A2) + and then Is_Valid_Renaming (A2) + then + return Denotes_Same_Object (A1, Renamed_Entity (Entity (A2))); + + -- In the recursion, integer literals appear as slice bounds + + elsif Nkind (A1) = N_Integer_Literal + and then Nkind (A2) = N_Integer_Literal + then + return Intval (A1) = Intval (A2); + + -- Likewise for character literals + + elsif Nkind (A1) = N_Character_Literal + and then Nkind (A2) = N_Character_Literal then - return Intval (Obj1) = Intval (Obj2); + return Char_Literal_Value (A1) = Char_Literal_Value (A2); else return False; @@ -11523,12 +11540,13 @@ package body Sem_Util is -- Has_Access_Values -- ----------------------- - function Has_Access_Values (T : Entity_Id) return Boolean is + function Has_Access_Values (T : Entity_Id) return Boolean + is Typ : constant Entity_Id := Underlying_Type (T); begin -- Case of a private type which is not completed yet. This can only - -- happen in the case of a generic format type appearing directly, or + -- happen in the case of a generic formal type appearing directly, or -- as a component of the type to which this function is being applied -- at the top level. Return False in this case, since we certainly do -- not know that the type contains access types. @@ -14722,17 +14740,11 @@ package body Sem_Util is -- Private or Taft amendment type case - declare - Pkg_Decl : Node_Id; - - begin - if Present (S) and then Is_Package_Or_Generic_Package (S) then - Pkg_Decl := S; - - while Nkind (Pkg_Decl) /= N_Package_Specification loop - Pkg_Decl := Parent (Pkg_Decl); - end loop; + if Present (S) and then Is_Package_Or_Generic_Package (S) then + declare + Pkg_Decl : constant Node_Id := Package_Specification (S); + begin -- It is knows that Typ has a private view, look for it in the -- visible declarations of the enclosing scope. A special case -- of this is when the two views have been exchanged - the full @@ -14756,8 +14768,8 @@ package body Sem_Util is elsif In_Package_Body (S) then return Inspect_Decls (Private_Declarations (Pkg_Decl), True); end if; - end if; - end; + end; + end if; -- The type has no incomplete or private view @@ -25199,7 +25211,7 @@ package body Sem_Util is Domain : constant Node_Id := Name (Parent (Ent)); begin - -- TBD : in the full version of the construct, the + -- ??? In the full version of the construct, the -- domain of iteration can be given by an expression. if Is_Entity_Name (Domain) then @@ -26715,6 +26727,7 @@ package body Sem_Util is if Present (Typ) and then not Is_Frozen (Typ) + and then Is_Base_Type (Typ) and then (Is_Record_Type (Typ) or else Is_Concurrent_Type (Typ) or else Is_Incomplete_Or_Private_Type (Typ)) diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index b8ad382..0519b3c 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -1313,13 +1313,13 @@ package Sem_Util is -- is False, don't look inside packed array types. function Has_Access_Values (T : Entity_Id) return Boolean; - -- Returns true if type or subtype T is an access type, or has a component - -- (at any recursive level) that is an access type. This is a conservative - -- predicate, if it is not known whether or not T contains access values - -- (happens for generic formals in some cases), then False is returned. - -- Note that tagged types return False. Even though the tag is implemented - -- as an access type internally, this function tests only for access types - -- known to the programmer. See also Has_Tagged_Component. + -- Returns true if the underlying type of T is an access type, or has a + -- component (at any recursive level) that is an access type. This is a + -- conservative predicate, if it is not known whether or not T contains + -- access values (happens for generic formals in some cases), then False is + -- returned. Note that tagged types return False. Even though the tag is + -- implemented as an access type internally, this function tests only for + -- access types known to the programmer. See also Has_Tagged_Component. function Has_Anonymous_Access_Discriminant (Typ : Entity_Id) return Boolean; -- Returns True if Typ has one or more anonymous access discriminants @@ -3349,7 +3349,7 @@ package Sem_Util is -- Returns True iff every value belonging to some interval of -- Subset also belongs to some interval of Of_Set. - -- TBD: When we get around to implementing "is statically compatible" + -- When we get around to implementing "is statically compatible" -- correctly for real types with static predicates, we may need -- an analogous Real_Interval_List type. Most of the language -- rules that reference "is statically compatible" pertain to diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb index 5a6a402..23f2771 100644 --- a/gcc/ada/sem_warn.adb +++ b/gcc/ada/sem_warn.adb @@ -1180,7 +1180,8 @@ package body Sem_Warn is -- Case of an unassigned variable -- First gather any Unset_Reference indication for E1. In the - -- case of a parameter, it is the Spec_Entity that is relevant. + -- case of an 'out' parameter, it is the Spec_Entity that is + -- relevant. if Ekind (E1) = E_Out_Parameter and then Present (Spec_Entity (E1)) @@ -1219,8 +1220,8 @@ package body Sem_Warn is -- the wanted effect is included in Never_Set_In_Source. elsif Warn_On_Constant - and then (Ekind (E1) = E_Variable - and then Has_Initial_Value (E1)) + and then Ekind (E1) = E_Variable + and then Has_Initial_Value (E1) and then Never_Set_In_Source_Check_Spec (E1) and then not Generic_Package_Spec_Entity (E1) then @@ -1298,9 +1299,9 @@ package body Sem_Warn is -- never referenced, since again it seems odd to rely on -- default initialization to set an out parameter value. - and then (Is_Access_Type (E1T) - or else Ekind (E1) = E_Out_Parameter - or else not Is_Fully_Initialized_Type (E1T)) + and then (Is_Access_Type (E1T) + or else Ekind (E1) = E_Out_Parameter + or else not Is_Fully_Initialized_Type (E1T)) then -- Do not output complaint about never being assigned a -- value if a pragma Unmodified applies to the variable @@ -1354,9 +1355,11 @@ package body Sem_Warn is -- Suppress warning if composite type contains any access -- component, since the logical effect of modifying a -- parameter may be achieved by modifying a referenced - -- object. + -- object. This rationale does not apply to private + -- types, so we warn in that case. elsif Is_Composite_Type (E1T) + and then not Is_Private_Type (E1T) and then Has_Access_Values (E1T) then null; @@ -3030,7 +3033,7 @@ package body Sem_Warn is -- if we have seen the address of the subprogram being taken, or if the -- subprogram is used as a generic actual (in the latter cases the -- context may force use of IN OUT, even if the parameter is not - -- modifies for this particular case. + -- modified for this particular case. ----------------------- -- No_Warn_On_In_Out -- @@ -3090,7 +3093,7 @@ package body Sem_Warn is -- Here we generate the warning else - -- If -gnatwk is set then output message that we could be IN + -- If -gnatwk is set then output message that it could be IN if not Is_Trivial_Subprogram (Scope (E1)) then if Warn_On_Constant then @@ -3666,6 +3669,9 @@ package body Sem_Warn is --------------------------------- procedure Warn_On_Overlapping_Actuals (Subp : Entity_Id; N : Node_Id) is + function Explicitly_By_Reference (Formal_Id : Entity_Id) return Boolean; + -- Returns True iff the type of Formal_Id is explicitly by-reference + function Refer_Same_Object (Act1 : Node_Id; Act2 : Node_Id) return Boolean; @@ -3677,6 +3683,24 @@ package body Sem_Warn is -- object_name is known to refer to the same object as the other name -- (RM 6.4.1(6.11/3)) + ----------------------------- + -- Explicitly_By_Reference -- + ----------------------------- + + function Explicitly_By_Reference + (Formal_Id : Entity_Id) + return Boolean + is + Typ : constant Entity_Id := Underlying_Type (Etype (Formal_Id)); + begin + if Present (Typ) then + return Is_By_Reference_Type (Typ) + or else Convention (Typ) = Convention_Ada_Pass_By_Reference; + else + return False; + end if; + end Explicitly_By_Reference; + ----------------------- -- Refer_Same_Object -- ----------------------- @@ -3693,24 +3717,17 @@ package body Sem_Warn is -- Local variables - Act1 : Node_Id; - Act2 : Node_Id; - Form1 : Entity_Id; - Form2 : Entity_Id; + Act1 : Node_Id; + Act2 : Node_Id; + Form1 : Entity_Id; + Form2 : Entity_Id; -- Start of processing for Warn_On_Overlapping_Actuals begin - - if Ada_Version < Ada_2012 and then not Warn_On_Overlap then - return; - end if; - -- Exclude calls rewritten as enumeration literals - if Nkind (N) not in N_Subprogram_Call - and then Nkind (N) /= N_Entry_Call_Statement - then + if Nkind (N) not in N_Subprogram_Call | N_Entry_Call_Statement then return; end if; @@ -3741,175 +3758,116 @@ package body Sem_Warn is Form1 := First_Formal (Subp); Act1 := First_Actual (N); while Present (Form1) and then Present (Act1) loop - if Is_Generic_Type (Etype (Act1)) then - return; - end if; - - -- One of the formals must be either (in)-out or composite. - -- The other must be (in)-out. - - if Is_Elementary_Type (Etype (Act1)) - and then Ekind (Form1) = E_In_Parameter - then - null; - - else - Form2 := Next_Formal (Form1); - Act2 := Next_Actual (Act1); - while Present (Form2) and then Present (Act2) loop - if Refer_Same_Object (Act1, Act2) then - if Is_Generic_Type (Etype (Act2)) then - return; - end if; - -- First case : two writable elementary parameters - -- that overlap. + Form2 := Next_Formal (Form1); + Act2 := Next_Actual (Act1); + while Present (Form2) and then Present (Act2) loop - if (Is_Elementary_Type (Etype (Form1)) - and then Is_Elementary_Type (Etype (Form2)) - and then Ekind (Form1) /= E_In_Parameter - and then Ekind (Form2) /= E_In_Parameter) + -- Ignore formals of generic types; they will be examined when + -- instantiated. - -- Second case : two composite parameters that overlap, - -- one of which is writable. - - or else (Is_Composite_Type (Etype (Form1)) - and then Is_Composite_Type (Etype (Form2)) - and then (Ekind (Form1) /= E_In_Parameter - or else Ekind (Form2) /= E_In_Parameter)) - - -- Third case : an elementary writable parameter that - -- overlaps a composite one. + if Is_Generic_Type (Etype (Form1)) + or else Is_Generic_Type (Etype (Form2)) + then + null; - or else (Is_Elementary_Type (Etype (Form1)) - and then Ekind (Form1) /= E_In_Parameter - and then Is_Composite_Type (Etype (Form2))) + elsif Refer_Same_Object (Act1, Act2) then - or else (Is_Elementary_Type (Etype (Form2)) - and then Ekind (Form2) /= E_In_Parameter - and then Is_Composite_Type (Etype (Form1))) - then + -- Case 1: two writable elementary parameters that overlap - -- Guard against previous errors + if (Is_Elementary_Type (Etype (Form1)) + and then Is_Elementary_Type (Etype (Form2)) + and then Ekind (Form1) /= E_In_Parameter + and then Ekind (Form2) /= E_In_Parameter) - if Error_Posted (N) - or else No (Etype (Act1)) - or else No (Etype (Act2)) - then - null; + -- Case 2: two composite parameters that overlap, one of + -- which is writable. - -- If the actual is a function call in prefix notation, - -- there is no real overlap. + or else (Is_Composite_Type (Etype (Form1)) + and then Is_Composite_Type (Etype (Form2)) + and then (Ekind (Form1) /= E_In_Parameter + or else Ekind (Form2) /= E_In_Parameter)) - elsif Nkind (Act2) = N_Function_Call then - null; + -- Case 3: an elementary writable parameter that overlaps + -- a composite one. - -- If type is explicitly not by-copy, assume that - -- aliasing is intended. + or else (Is_Elementary_Type (Etype (Form1)) + and then Ekind (Form1) /= E_In_Parameter + and then Is_Composite_Type (Etype (Form2))) - elsif - Present (Underlying_Type (Etype (Form1))) - and then - (Is_By_Reference_Type - (Underlying_Type (Etype (Form1))) - or else - Convention (Underlying_Type (Etype (Form1))) = - Convention_Ada_Pass_By_Reference) - then - null; + or else (Is_Elementary_Type (Etype (Form2)) + and then Ekind (Form2) /= E_In_Parameter + and then Is_Composite_Type (Etype (Form1))) + then - -- Under Ada 2012 we only report warnings on overlapping - -- arrays and record types if switch is set. + -- Guard against previous errors - elsif Ada_Version >= Ada_2012 - and then not Is_Elementary_Type (Etype (Form1)) - and then not Warn_On_Overlap - then - null; + if Error_Posted (N) + or else No (Etype (Act1)) + or else No (Etype (Act2)) + then + null; - -- Here we may need to issue overlap message + -- If type is explicitly by-reference, then it is not + -- covered by the legality rule, which only applies to + -- elementary types. Actually, the aliasing is most + -- likely intended, so don't emit a warning either. - else - Error_Msg_Warn := + elsif Explicitly_By_Reference (Form1) + or else Explicitly_By_Reference (Form2) + then + null; - -- Overlap checking is an error only in Ada 2012. - -- For earlier versions of Ada, this is a warning. + -- We only report warnings on overlapping arrays and record + -- types if switch is set. - Ada_Version < Ada_2012 + elsif not Warn_On_Overlap + and then not (Is_Elementary_Type (Etype (Form1)) + and then + Is_Elementary_Type (Etype (Form2))) + then + null; - -- Overlap is only illegal in Ada 2012 in the case - -- of elementary types (passed by copy). For other - -- types we always have a warning in all versions. - -- This is clarified by AI12-0216. + -- Here we may need to issue overlap message - or else not - (Is_Elementary_Type (Etype (Form1)) - and then Is_Elementary_Type (Etype (Form2))) + else + Error_Msg_Warn := - -- debug flag -gnatd.E changes the error to a - -- warning even in Ada 2012 mode. + -- Overlap checking is an error only in Ada 2012. For + -- earlier versions of Ada, this is a warning. - or else Error_To_Warning; + Ada_Version < Ada_2012 - if Is_Elementary_Type (Etype (Act1)) - and then Ekind (Form2) = E_In_Parameter - then - null; -- No real aliasing + -- Overlap is only illegal since Ada 2012 and only for + -- elementary types (passed by copy). For other types + -- we always have a warning in all versions. This is + -- clarified by AI12-0216. - elsif Is_Elementary_Type (Etype (Act2)) - and then Ekind (Form2) = E_In_Parameter - then - null; -- Ditto + or else not + (Is_Elementary_Type (Etype (Form1)) + and then Is_Elementary_Type (Etype (Form2))) - -- If the call was written in prefix notation, and - -- thus its prefix before rewriting was a selected - -- component, count only visible actuals in call. + -- debug flag -gnatd.E changes the error to a warning + -- even in Ada 2012 mode. - elsif Is_Entity_Name (First_Actual (N)) - and then Nkind (Original_Node (N)) = Nkind (N) - and then Nkind (Name (Original_Node (N))) = - N_Selected_Component - and then - Is_Entity_Name (Prefix (Name (Original_Node (N)))) - and then - Entity (Prefix (Name (Original_Node (N)))) = - Entity (First_Actual (N)) - then - if Act1 = First_Actual (N) then - Error_Msg_FE - ("<I<`IN OUT` prefix overlaps with " - & "actual for&", Act1, Form2); - - else - -- For greater clarity, give name of formal + or else Error_To_Warning; - Error_Msg_Node_2 := Form2; - Error_Msg_FE - ("<I<writable actual for & overlaps with " - & "actual for&", Act1, Form2); - end if; - - else - -- For greater clarity, give name of formal + -- For greater clarity, give name of formal - Error_Msg_Node_2 := Form2; + Error_Msg_Node_2 := Form2; - -- This is one of the messages + -- This is one of the messages - Error_Msg_FE - ("<I<writable actual for & overlaps with " - & "actual for&", Act1, Form1); - end if; - end if; + Error_Msg_FE + ("<I<writable actual for & overlaps with actual for &", + Act1, Form1); end if; - - return; end if; + end if; - Next_Formal (Form2); - Next_Actual (Act2); - end loop; - end if; + Next_Formal (Form2); + Next_Actual (Act2); + end loop; Next_Formal (Form1); Next_Actual (Act1); diff --git a/gcc/ada/set_targ.adb b/gcc/ada/set_targ.adb index 2b0c6ee..5af7f1a 100644 --- a/gcc/ada/set_targ.adb +++ b/gcc/ada/set_targ.adb @@ -309,7 +309,6 @@ package body Set_Targ is Write_Str ("pragma Float_Representation ("); case Float_Rep is - when AAMP => Write_Str ("AAMP"); when IEEE_Binary => Write_Str ("IEEE"); end case; @@ -532,7 +531,6 @@ package body Set_Targ is AddC (' '); case E.FLOAT_REP is - when AAMP => AddC ('A'); when IEEE_Binary => AddC ('I'); end case; @@ -795,9 +793,6 @@ package body Set_Targ is when 'I' => E.FLOAT_REP := IEEE_Binary; - when 'A' => - E.FLOAT_REP := AAMP; - when others => FailN ("bad float rep field for"); end case; @@ -880,7 +875,7 @@ begin argv := save_argv; argc := save_argc; else - -- Case of a non gcc compiler, e.g. gnat2why or gnat2scil + -- Case of a non-GCC compiler, e.g. gnat2why or gnat2scil argv := gnat_argv; argc := gnat_argc; end if; diff --git a/gcc/ada/set_targ.ads b/gcc/ada/set_targ.ads index cfd9b70..4afd7b0 100644 --- a/gcc/ada/set_targ.ads +++ b/gcc/ada/set_targ.ads @@ -143,12 +143,14 @@ package Set_Targ is -- -- name digs float_rep precision alignment -- - -- where name is the string name of the type (which can have single - -- spaces embedded in the name (e.g. long double). The name is followed - -- by at least two blanks. The following fields are as described above - -- for a Mode_Entry (where float_rep is I/V/A for IEEE-754-Binary, - -- Vax_Native, AAMP), fields are separated by at least one blank, and - -- a LF character immediately follows the alignment field. + -- where name is the string name of the type (which can have + -- single spaces embedded in the name (e.g. long double). The + -- name is followed by at least two blanks. The following fields + -- are as described above for a Mode_Entry (where float_rep is + -- I for IEEE-754-Binary, which is the only Float_Rep_Kind + -- currently supported), fields are separated by at least one + -- blank, and a LF character immediately follows the alignment + -- field. -- -- ??? We do not write the size for backward compatibility reasons, -- which means that target.atp will not be a complete description for diff --git a/gcc/ada/sigtramp-vxworks-target.inc b/gcc/ada/sigtramp-vxworks-target.inc index 13601c6..5a37b87 100644 --- a/gcc/ada/sigtramp-vxworks-target.inc +++ b/gcc/ada/sigtramp-vxworks-target.inc @@ -100,7 +100,7 @@ #define FUNCTION "%function" #ifdef __aarch64__ -#define REGNO_PC_OFFSET 80 /* aka V16, a scratch register */ +#define REGNO_PC_OFFSET 96 /* DWARF_ALT_FRAME_RETURN_COLUMN */ #else #define REGNO_PC_OFFSET 15 /* PC_REGNUM */ #endif @@ -375,7 +375,7 @@ TCR(COMMON_CFI(G_REG_OFFSET(14))) \ TCR(COMMON_CFI(G_REG_OFFSET(15))) \ TCR(COMMON_CFI(G_REG_OFFSET(16))) \ TCR(COMMON_CFI(G_REG_OFFSET(17))) \ -TCR(COMMON_CFI(G_REG_OFFSET(18))) \ +CR("# Leave alone R18, VxWorks reserved\n") \ TCR(COMMON_CFI(G_REG_OFFSET(19))) \ TCR(COMMON_CFI(G_REG_OFFSET(20))) \ TCR(COMMON_CFI(G_REG_OFFSET(21))) \ diff --git a/gcc/ada/sinfo-cn.adb b/gcc/ada/sinfo-cn.adb index b4473c1..9a9af9b 100644 --- a/gcc/ada/sinfo-cn.adb +++ b/gcc/ada/sinfo-cn.adb @@ -45,7 +45,7 @@ package body Sinfo.CN is (N : Node_Id) is begin - Reinit_Field_To_Zero (N, Char_Literal_Value); + Reinit_Field_To_Zero (N, F_Char_Literal_Value); Extend_Node (N); end Change_Character_Literal_To_Defining_Character_Literal; @@ -130,7 +130,7 @@ package body Sinfo.CN is (N : Node_Id) is begin - Reinit_Field_To_Zero (N, Strval); + Reinit_Field_To_Zero (N, F_Strval); Extend_Node (N); end Change_Operator_Symbol_To_Defining_Operator_Symbol; @@ -140,7 +140,7 @@ package body Sinfo.CN is procedure Change_Operator_Symbol_To_String_Literal (N : Node_Id) is begin - Reinit_Field_To_Zero (N, Chars); + Reinit_Field_To_Zero (N, F_Chars); Set_Entity (N, Empty); Mutate_Nkind (N, N_String_Literal); end Change_Operator_Symbol_To_String_Literal; diff --git a/gcc/ada/sinfo-utils.adb b/gcc/ada/sinfo-utils.adb index b066461..f9db669 100644 --- a/gcc/ada/sinfo-utils.adb +++ b/gcc/ada/sinfo-utils.adb @@ -239,7 +239,7 @@ package body Sinfo.Utils is begin for J in Fields'Range loop - if Fields (J) /= Link then -- Don't walk Parent! + if Fields (J) /= F_Link then -- Don't walk Parent! declare Desc : Field_Descriptor renames Node_Field_Descriptors (Fields (J)); @@ -264,7 +264,7 @@ package body Sinfo.Utils is begin for J in Fields'Range loop - if Fields (J) /= Link then -- Don't walk Parent! + if Fields (J) /= F_Link then -- Don't walk Parent! declare Desc : Field_Descriptor renames Node_Field_Descriptors (Fields (J)); diff --git a/gcc/ada/sinfo-utils.ads b/gcc/ada/sinfo-utils.ads index 27b19a6..ab8e528 100644 --- a/gcc/ada/sinfo-utils.ads +++ b/gcc/ada/sinfo-utils.ads @@ -139,12 +139,6 @@ package Sinfo.Utils is (N : N_Inclusive_Has_Entity; Val : Node_Id) renames Set_Entity_Or_Associated_Node; - function Associated_Node return Node_Field renames - Entity_Or_Associated_Node; - function Entity return Node_Field renames - Entity_Or_Associated_Node; - -- Note that we are renaming the enumeration literals here - --------------- -- Debugging -- --------------- diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index f62d2d1..f210c49 100644 --- a/gcc/ada/sinfo.ads +++ b/gcc/ada/sinfo.ads @@ -1099,7 +1099,7 @@ package Sinfo is -- Do_Accessibility_Check -- This flag is set on N_Parameter_Specification nodes to indicate -- that an accessibility check is required for the parameter. It is - -- not yet decided who takes care of this check (TBD ???). + -- not yet decided who takes care of this check???. -- Do_Discriminant_Check -- This flag is set on N_Selected_Component nodes to indicate that a @@ -1190,7 +1190,7 @@ package Sinfo is -- N_Procedure_Call_Statement, N_Type_Conversion, -- N_Simple_Return_Statement, or N_Extended_Return_Statement -- node to indicate that the tag check can be suppressed. It is not - -- yet decided how this flag is used (TBD ???). + -- yet decided how this flag is used???. -- Elaborate_Present -- This flag is set in the N_With_Clause node to indicate that pragma @@ -4114,6 +4114,7 @@ package Sinfo is -- Loop_Actions -- Box_Present -- Inherited_Discriminant + -- Binding_Chars -- Note: this structure is used for both record component associations -- and array component associations, since the two cases aren't always @@ -4121,7 +4122,11 @@ package Sinfo is -- list of selector names in the record aggregate case, or a list of -- discrete choices in the array aggregate case or an N_Others_Choice -- node (which appears as a singleton list). Box_Present gives support - -- to Ada 2005 (AI-287). + -- to Ada 2005 (AI-287). Binding_Chars is only set if GNAT extensions + -- are enabled and the given component association occurs within a + -- choice_expression; in this case, it is the Name_Id, if any, specified + -- via either of two syntactic forms: "Foo => Bar is Abc" or + -- "Foo => <Abc>". ---------------------------------- -- 4.3.1 Component Choice List -- @@ -5013,11 +5018,16 @@ package Sinfo is -- Discrete_Choices -- Statements -- Has_SP_Choice + -- Multidefined_Bindings -- Note: in the list of Discrete_Choices, the tree passed to the back -- end does not have choice entries corresponding to names of statically -- predicated subtypes. Such entries are always expanded out to the list - -- of equivalent values or ranges. + -- of equivalent values or ranges. Multidefined_Bindings is True iff + -- more than one choice is present and each choice contains + -- at least one component association having a non-null Binding_Chars + -- attribute; this can only occur if GNAT extensions are enabled + -- and the type of the case selector is composite. ------------------------- -- 5.5 Loop Statement -- diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl index 3d5e0de..2611541 100644 --- a/gcc/ada/snames.ads-tmpl +++ b/gcc/ada/snames.ads-tmpl @@ -387,10 +387,6 @@ package Snames is -- Ada 83, Ada 95, and Ada 2005 mode as well, where they are technically -- considered to be implementation dependent pragmas. - -- The entries marked AAMP are AAMP specific pragmas that are recognized - -- only in GNAT for the AAMP. They are ignored in other versions with - -- appropriate warnings. - First_Pragma_Name : constant Name_Id := N + $; -- Configuration pragmas are grouped at start. Note that there is a list @@ -482,7 +478,6 @@ package Snames is Name_Suppress_Exception_Locations : constant Name_Id := N + $; -- GNAT Name_Task_Dispatching_Policy : constant Name_Id := N + $; Name_Unevaluated_Use_Of_Old : constant Name_Id := N + $; -- GNAT - Name_Universal_Data : constant Name_Id := N + $; -- AAMP Name_Unsuppress : constant Name_Id := N + $; -- Ada 05 Name_Use_VADS_Size : constant Name_Id := N + $; -- GNAT Name_Validity_Checks : constant Name_Id := N + $; -- GNAT @@ -547,7 +542,6 @@ package Snames is Name_Export_Function : constant Name_Id := N + $; -- GNAT Name_Export_Object : constant Name_Id := N + $; -- GNAT Name_Export_Procedure : constant Name_Id := N + $; -- GNAT - Name_Export_Value : constant Name_Id := N + $; -- GNAT Name_Export_Valued_Procedure : constant Name_Id := N + $; -- GNAT Name_Extensions_Visible : constant Name_Id := N + $; -- GNAT Name_External : constant Name_Id := N + $; -- GNAT @@ -1706,7 +1700,6 @@ package Snames is -- in Sem_Prag. for Convention_Id'Size use 8; - -- Plenty of space for expansion subtype Convention_C_Family is Convention_Id range Convention_C .. Convention_CPP; @@ -1811,7 +1804,6 @@ package Snames is Pragma_Suppress_Exception_Locations, Pragma_Task_Dispatching_Policy, Pragma_Unevaluated_Use_Of_Old, - Pragma_Universal_Data, Pragma_Unsuppress, Pragma_Use_VADS_Size, Pragma_Validity_Checks, @@ -1862,7 +1854,6 @@ package Snames is Pragma_Export_Function, Pragma_Export_Object, Pragma_Export_Procedure, - Pragma_Export_Value, Pragma_Export_Valued_Procedure, Pragma_Extensions_Visible, Pragma_External, diff --git a/gcc/ada/sprint.adb b/gcc/ada/sprint.adb index 2eeea52..7fc7340 100644 --- a/gcc/ada/sprint.adb +++ b/gcc/ada/sprint.adb @@ -3072,7 +3072,13 @@ package body Sprint is when N_Range => Sprint_Node (Low_Bound (Node)); Write_Str_Sloc (" .. "); - Sprint_Node (High_Bound (Node)); + if Present (Etype (Node)) + and then Is_Fixed_Lower_Bound_Index_Subtype (Etype (Node)) + then + Write_Str ("<>"); + else + Sprint_Node (High_Bound (Node)); + end if; Update_Itype (Node); when N_Range_Constraint => @@ -4841,7 +4847,10 @@ package body Sprint is Write_Int (Int (L)); Write_Str (": "); - while Src (Loc) not in Line_Terminator loop + -- We need to check for EOF here, in case the last line of the source + -- file does not have a Line_Terminator. + + while Src (Loc) not in Line_Terminator | EOF loop Write_Char (Src (Loc)); Loc := Loc + 1; end loop; diff --git a/gcc/ada/switch-c.adb b/gcc/ada/switch-c.adb index 10f5f77..020be63 100644 --- a/gcc/ada/switch-c.adb +++ b/gcc/ada/switch-c.adb @@ -112,7 +112,7 @@ package body Switch.C is when '3' => if Standard_Long_Long_Integer_Size /= 64 then - Bad_Switch ("-gnato3 not implemented for this configuration"); + Bad_Switch ("-gnato3 requires Long_Long_Integer'Size = 64"); else return Eliminated; end if; @@ -1392,9 +1392,8 @@ package body Switch.C is when 'X' => Ptr := Ptr + 1; - Extensions_Allowed := True; - Ada_Version := Ada_Version_Type'Last; - Ada_Version_Explicit := Ada_Version_Type'Last; + Ada_Version := Ada_With_Extensions; + Ada_Version_Explicit := Ada_With_Extensions; Ada_Version_Pragma := Empty; -- -gnaty (style checks) diff --git a/gcc/ada/switch.ads b/gcc/ada/switch.ads index 6460db9..8ea9c27 100644 --- a/gcc/ada/switch.ads +++ b/gcc/ada/switch.ads @@ -79,7 +79,7 @@ package Switch is -- Returns True iff Switch_Chars represents an internal GCC switch to be -- followed by a single argument, such as -dumpbase, or --param. -- Even though passed by the "gcc" driver, these need not be stored in ALI - -- files and may safely be ignored by non GCC back-ends. + -- files and may safely be ignored by non-GCC back ends. function Switch_Last (Switch_Chars : String) return Natural; -- Index in Switch_Chars of the last relevant character for later string diff --git a/gcc/ada/targparm.ads b/gcc/ada/targparm.ads index cc192fc..28465ea 100644 --- a/gcc/ada/targparm.ads +++ b/gcc/ada/targparm.ads @@ -177,12 +177,12 @@ package Targparm is -- The default values here are used if no value is found in system.ads. -- This should normally happen if the special version of system.ads used -- by the compiler itself is in use or if the value is only relevant to a - -- particular target (e.g. AAMP). The default values are suitable for use - -- in normal environments. This approach allows the possibility of new - -- versions of the compiler (possibly with new system parameters added) - -- being used to compile older versions of the compiler sources, as well as - -- avoiding duplicating values in all system-*.ads files for flags that are - -- used on a few platforms only. + -- particular target. The default values are suitable for use in normal + -- environments. This approach allows the possibility of new versions of + -- the compiler (possibly with new system parameters added) being used to + -- compile older versions of the compiler sources, as well as avoiding + -- duplicating values in all system-*.ads files for flags that are used on + -- a few platforms only. -- All these parameters should be regarded as read only by all clients -- of the package. The only way they get modified is by calling the @@ -469,10 +469,10 @@ package Targparm is -- Command Line Arguments -- ---------------------------- - -- For most ports of GNAT, command line arguments are supported. The - -- following flag is set to False for targets that do not support - -- command line arguments (VxWorks and AAMP). Note that support of - -- command line arguments is not required on such targets (RM A.15(13)). + -- Command line arguments are supported on most targets. The following flag + -- is set to False for targets that do not support command line arguments + -- (i.e. VxWorks). Note that support for command line arguments is not + -- required on such targets (RM A.15(13)). Command_Line_Args_On_Target : Boolean := True; -- Set False if no command line arguments on target. Note that if this @@ -480,8 +480,8 @@ package Targparm is -- this causes suppression of generation of the argv/argc variables -- used to record command line arguments. - -- Similarly, most ports support the use of an exit status, but AAMP - -- is an exception (as allowed by RM A.15(18-20)) + -- Similarly, most targets support the use of an exit status, but other + -- targets might not, as allowed by RM A.15(18-20). Exit_Status_Supported_On_Target : Boolean := True; -- Set False if returning of an exit status is not supported on target. diff --git a/gcc/ada/treepr.adb b/gcc/ada/treepr.adb index 98ccd9a..519242e 100644 --- a/gcc/ada/treepr.adb +++ b/gcc/ada/treepr.adb @@ -284,110 +284,120 @@ package body Treepr is function Image (F : Node_Field) return String is begin case F is - when Alloc_For_BIP_Return => + when F_Alloc_For_BIP_Return => return "Alloc_For_BIP_Return"; - when Assignment_OK => + when F_Assignment_OK => return "Assignment_OK"; - when Backwards_OK => + when F_Backwards_OK => return "Backwards_OK"; - when Conversion_OK => + when F_Conversion_OK => return "Conversion_OK"; - when Forwards_OK => + when F_Forwards_OK => return "Forwards_OK"; - when Has_SP_Choice => + when F_Has_SP_Choice => return "Has_SP_Choice"; - when Is_Elaboration_Checks_OK_Node => + when F_Is_Elaboration_Checks_OK_Node => return "Is_Elaboration_Checks_OK_Node"; - when Is_Elaboration_Warnings_OK_Node => + when F_Is_Elaboration_Warnings_OK_Node => return "Is_Elaboration_Warnings_OK_Node"; - when Is_Known_Guaranteed_ABE => + when F_Is_Known_Guaranteed_ABE => return "Is_Known_Guaranteed_ABE"; - when Is_SPARK_Mode_On_Node => + when F_Is_SPARK_Mode_On_Node => return "Is_SPARK_Mode_On_Node"; - when Local_Raise_Not_OK => + when F_Local_Raise_Not_OK => return "Local_Raise_Not_OK"; - when SCIL_Controlling_Tag => + when F_SCIL_Controlling_Tag => return "SCIL_Controlling_Tag"; - when SCIL_Entity => + when F_SCIL_Entity => return "SCIL_Entity"; - when SCIL_Tag_Value => + when F_SCIL_Tag_Value => return "SCIL_Tag_Value"; - when SCIL_Target_Prim => + when F_SCIL_Target_Prim => return "SCIL_Target_Prim"; - when Shift_Count_OK => + when F_Shift_Count_OK => return "Shift_Count_OK"; - when Split_PPC => + when F_Split_PPC => return "Split_PPC"; - when TSS_Elist => + when F_TSS_Elist => return "TSS_Elist"; when others => - return Capitalize (F'Img); + declare + Result : constant String := Capitalize (F'Img); + begin + return Result (3 .. Result'Last); -- Remove "F_" + end; end case; end Image; function Image (F : Entity_Field) return String is begin case F is - when BIP_Initialization_Call => + when F_BIP_Initialization_Call => return "BIP_Initialization_Call"; - when Body_Needed_For_SAL => + when F_Body_Needed_For_SAL => return "Body_Needed_For_SAL"; - when CR_Discriminant => + when F_CR_Discriminant => return "CR_Discriminant"; - when DT_Entry_Count => + when F_DT_Entry_Count => return "DT_Entry_Count"; - when DT_Offset_To_Top_Func => + when F_DT_Offset_To_Top_Func => return "DT_Offset_To_Top_Func"; - when DT_Position => + when F_DT_Position => return "DT_Position"; - when DTC_Entity => + when F_DTC_Entity => return "DTC_Entity"; - when Has_Inherited_DIC => + when F_Has_Inherited_DIC => return "Has_Inherited_DIC"; - when Has_Own_DIC => + when F_Has_Own_DIC => return "Has_Own_DIC"; - when Has_RACW => + when F_Has_RACW => return "Has_RACW"; - when Ignore_SPARK_Mode_Pragmas => + when F_Ignore_SPARK_Mode_Pragmas => return "Ignore_SPARK_Mode_Pragmas"; - when Is_Constr_Subt_For_UN_Aliased => + when F_Is_Constr_Subt_For_UN_Aliased => return "Is_Constr_Subt_For_UN_Aliased"; - when Is_CPP_Class => + when F_Is_CPP_Class => return "Is_CPP_Class"; - when Is_CUDA_Kernel => + when F_Is_CUDA_Kernel => return "Is_CUDA_Kernel"; - when Is_DIC_Procedure => + when F_Is_DIC_Procedure => return "Is_DIC_Procedure"; - when Is_Discrim_SO_Function => + when F_Is_Discrim_SO_Function => return "Is_Discrim_SO_Function"; - when Is_Elaboration_Checks_OK_Id => + when F_Is_Elaboration_Checks_OK_Id => return "Is_Elaboration_Checks_OK_Id"; - when Is_Elaboration_Warnings_OK_Id => + when F_Is_Elaboration_Warnings_OK_Id => return "Is_Elaboration_Warnings_OK_Id"; - when Is_RACW_Stub_Type => + when F_Is_RACW_Stub_Type => return "Is_RACW_Stub_Type"; - when OK_To_Rename => + when F_LSP_Subprogram => + return "LSP_Subprogram"; + when F_OK_To_Rename => return "OK_To_Rename"; - when Referenced_As_LHS => + when F_Referenced_As_LHS => return "Referenced_As_LHS"; - when RM_Size => + when F_RM_Size => return "RM_Size"; - when SPARK_Aux_Pragma => + when F_SPARK_Aux_Pragma => return "SPARK_Aux_Pragma"; - when SPARK_Aux_Pragma_Inherited => + when F_SPARK_Aux_Pragma_Inherited => return "SPARK_Aux_Pragma_Inherited"; - when SPARK_Pragma => + when F_SPARK_Pragma => return "SPARK_Pragma"; - when SPARK_Pragma_Inherited => + when F_SPARK_Pragma_Inherited => return "SPARK_Pragma_Inherited"; - when SSO_Set_High_By_Default => + when F_SSO_Set_High_By_Default => return "SSO_Set_High_By_Default"; - when SSO_Set_Low_By_Default => + when F_SSO_Set_Low_By_Default => return "SSO_Set_Low_By_Default"; when others => - return Capitalize (F'Img); + declare + Result : constant String := Capitalize (F'Img); + begin + return Result (3 .. Result'Last); -- Remove "F_" + end; end case; end Image; @@ -646,8 +656,8 @@ package body Treepr is Should_Print : constant Entity_Field_Set := -- Set of fields that should be printed. False for fields that were -- already printed above. - (Ekind - | Basic_Convention => False, -- Convention was printed + (F_Ekind + | F_Basic_Convention => False, -- Convention was printed others => True); begin -- Outer loop makes flags come out last @@ -1264,14 +1274,22 @@ package body Treepr is Print_Eol; end if; - -- Print Entity field if operator (other cases of Entity - -- are in the table, so are handled in the normal circuit) + -- Deal with Entity_Or_Associated_Node. If N has both, then just + -- print Entity; they are the same thing. - if Nkind (N) in N_Op and then Present (Entity (N)) then + if N in N_Inclusive_Has_Entity and then Present (Entity (N)) then Print_Str (Prefix); Print_Str ("Entity = "); Print_Node_Ref (Entity (N)); Print_Eol; + + elsif N in N_Has_Associated_Node + and then Present (Associated_Node (N)) + then + Print_Str (Prefix); + Print_Str ("Associated_Node = "); + Print_Node_Ref (Associated_Node (N)); + Print_Eol; end if; -- Print special fields if we have a subexpression @@ -1372,31 +1390,31 @@ package body Treepr is -- Set of fields that should be printed. False for fields that were -- already printed above, and for In_List, which we don't bother -- printing. - (Nkind - | Chars - | Comes_From_Source - | Analyzed - | Error_Posted - | Is_Ignored_Ghost_Node - | Check_Actuals - | Link -- Parent was printed - | Sloc - | Left_Opnd - | Right_Opnd - | Entity - | Assignment_OK - | Do_Range_Check - | Has_Dynamic_Length_Check - | Has_Aspects - | Is_Controlling_Actual - | Is_Overloaded - | Is_Static_Expression - | Must_Not_Freeze - | Small_Paren_Count -- Paren_Count was printed - | Raises_Constraint_Error - | Do_Overflow_Check - | Etype - | In_List + (F_Nkind + | F_Chars + | F_Comes_From_Source + | F_Analyzed + | F_Error_Posted + | F_Is_Ignored_Ghost_Node + | F_Check_Actuals + | F_Link -- Parent was printed + | F_Sloc + | F_Left_Opnd + | F_Right_Opnd + | F_Entity_Or_Associated_Node -- one of them was printed + | F_Assignment_OK + | F_Do_Range_Check + | F_Has_Dynamic_Length_Check + | F_Has_Aspects + | F_Is_Controlling_Actual + | F_Is_Overloaded + | F_Is_Static_Expression + | F_Must_Not_Freeze + | F_Small_Paren_Count -- Paren_Count was printed + | F_Raises_Constraint_Error + | F_Do_Overflow_Check + | F_Etype + | F_In_List => False, others => True); @@ -1415,7 +1433,7 @@ package body Treepr is -- Special case for End_Span, which also prints the -- End_Location. - if Fields (Field_Index) = End_Span then + if Fields (Field_Index) = F_End_Span then Print_End_Span (N); else @@ -2227,7 +2245,7 @@ package body Treepr is -- but what concerns us now is looking for descendants in -- the tree. - and then F /= Next_Entity -- See below for why we skip this + and then F /= F_Next_Entity -- See below for why we skip this then Visit_Descendant (Get_Union_Id (N, FD.Offset)); end if; diff --git a/gcc/ada/types.ads b/gcc/ada/types.ads index ef87a5a..a74bfb6 100644 --- a/gcc/ada/types.ads +++ b/gcc/ada/types.ads @@ -837,9 +837,10 @@ package Types is -- Floating Point Representation -- ----------------------------------- - type Float_Rep_Kind is ( - IEEE_Binary, -- IEEE 754p conforming binary format - AAMP); -- AAMP format + type Float_Rep_Kind is (IEEE_Binary); + -- The only one supported now is IEEE 754p conforming binary format, but + -- other formats were supported in the past, and could conceivably be + -- supported in the future, so we keep this singleton enumeration type. ---------------------------- -- Small_Paren_Count_Type -- diff --git a/gcc/ada/uintp.adb b/gcc/ada/uintp.adb index 045b8e5..8183469 100644 --- a/gcc/ada/uintp.adb +++ b/gcc/ada/uintp.adb @@ -2179,9 +2179,9 @@ package body Uintp is end if; end UI_To_CC; - ---------------- + --------------- -- UI_To_Int -- - ---------------- + --------------- function UI_To_Int (Input : Uint) return Int is pragma Assert (Input /= No_Uint); @@ -2230,6 +2230,46 @@ package body Uintp is end if; end UI_To_Int; + ----------------- + -- UI_To_Uns64 -- + ----------------- + + function UI_To_Unsigned_64 (Input : Uint) return Unsigned_64 is + pragma Assert (Input /= No_Uint); + + begin + if Input < Uint_0 then + raise Constraint_Error; + end if; + + if Direct (Input) then + return Unsigned_64 (Direct_Val (Input)); + + -- Case of input is more than one digit + + else + if Input >= Uint_2**Int'(64) then + raise Constraint_Error; + end if; + + declare + In_Length : constant Int := N_Digits (Input); + In_Vec : UI_Vector (1 .. In_Length); + Ret_Int : Unsigned_64 := 0; + + begin + Init_Operand (Input, In_Vec); + + for Idx in In_Vec'Range loop + Ret_Int := + Ret_Int * Unsigned_64 (Base) + Unsigned_64 (In_Vec (Idx)); + end loop; + + return Ret_Int; + end; + end if; + end UI_To_Unsigned_64; + -------------- -- UI_Write -- -------------- diff --git a/gcc/ada/uintp.ads b/gcc/ada/uintp.ads index 0465702..607e7ef 100644 --- a/gcc/ada/uintp.ads +++ b/gcc/ada/uintp.ads @@ -252,6 +252,11 @@ package Uintp is -- Converts universal integer value to Int. Constraint_Error if value is -- not in appropriate range. + type Unsigned_64 is mod 2**64; + function UI_To_Unsigned_64 (Input : Uint) return Unsigned_64; + -- Converts universal integer value to Unsigned_64. Constraint_Error if + -- value is not in appropriate range. + function UI_To_CC (Input : Uint) return Char_Code; -- Converts universal integer value to Char_Code. Constraint_Error if value -- is not in Char_Code range. diff --git a/gcc/analyzer/ChangeLog b/gcc/analyzer/ChangeLog index b8f7a2b..84fa208 100644 --- a/gcc/analyzer/ChangeLog +++ b/gcc/analyzer/ChangeLog @@ -1,3 +1,38 @@ +2021-06-18 David Malcolm <dmalcolm@redhat.com> + + * store.cc (binding_cluster::get_any_binding): Make symbolic reads + from a cluster with concrete bindings return unknown. + +2021-06-18 David Malcolm <dmalcolm@redhat.com> + + * region-model-manager.cc + (region_model_manager::get_or_create_int_cst): New. + (region_model_manager::maybe_undo_optimize_bit_field_compare): Use + it to simplify away a local tree. + * region-model.cc (region_model::on_setjmp): Likewise. + (region_model::on_longjmp): Likewise. + * region-model.h (region_model_manager::get_or_create_int_cst): + New decl. + * store.cc (binding_cluster::zero_fill_region): Use it to simplify + away a local tree. + +2021-06-18 David Malcolm <dmalcolm@redhat.com> + + * checker-path.cc (class custom_event): Make abstract to allow for + custom vfuncs, splitting existing implementation into... + (class precanned_custom_event): New subclass. + (custom_event::get_desc): Move to... + (precanned_custom_event::get_desc): ...subclass. + * checker-path.h (class custom_event): Make abstract to allow for + custom vfuncs, splitting existing implementation into... + (class precanned_custom_event): New subclass. + * diagnostic-manager.cc (diagnostic_manager::add_events_for_eedge): + Use precanned_custom_event. + * engine.cc + (stale_jmp_buf::maybe_add_custom_events_for_superedge): Likewise. + * sm-signal.cc (signal_delivery_edge_info_t::add_events_to_path): + Likewise. + 2021-06-15 David Malcolm <dmalcolm@redhat.com> PR analyzer/99212 diff --git a/gcc/analyzer/checker-path.cc b/gcc/analyzer/checker-path.cc index e6f838b..e10c8e2 100644 --- a/gcc/analyzer/checker-path.cc +++ b/gcc/analyzer/checker-path.cc @@ -162,14 +162,14 @@ debug_event::get_desc (bool) const return label_text::borrow (m_desc); } -/* class custom_event : public checker_event. */ +/* class precanned_custom_event : public custom_event. */ /* Implementation of diagnostic_event::get_desc vfunc for - custom_event. + precanned_custom_event. Use the saved string as the event's description. */ label_text -custom_event::get_desc (bool) const +precanned_custom_event::get_desc (bool) const { return label_text::borrow (m_desc); } diff --git a/gcc/analyzer/checker-path.h b/gcc/analyzer/checker-path.h index f76bb94..1843c4b 100644 --- a/gcc/analyzer/checker-path.h +++ b/gcc/analyzer/checker-path.h @@ -56,6 +56,7 @@ extern const char *event_kind_to_string (enum event_kind ek); checker_event debug_event (EK_DEBUG) custom_event (EK_CUSTOM) + precanned_custom_event statement_event (EK_STMT) function_entry_event (EK_FUNCTION_ENTRY) state_change_event (EK_STATE_CHANGE) @@ -144,19 +145,30 @@ private: char *m_desc; }; -/* A concrete event subclass for custom events. These are not filtered, +/* An abstract event subclass for custom events. These are not filtered, as they are likely to be pertinent to the diagnostic. */ class custom_event : public checker_event { +protected: + custom_event (location_t loc, tree fndecl, int depth) + : checker_event (EK_CUSTOM, loc, fndecl, depth) + { + } +}; + +/* A concrete custom_event subclass with a precanned message. */ + +class precanned_custom_event : public custom_event +{ public: - custom_event (location_t loc, tree fndecl, int depth, - const char *desc) - : checker_event (EK_CUSTOM, loc, fndecl, depth), + precanned_custom_event (location_t loc, tree fndecl, int depth, + const char *desc) + : custom_event (loc, fndecl, depth), m_desc (xstrdup (desc)) { } - ~custom_event () + ~precanned_custom_event () { free (m_desc); } diff --git a/gcc/analyzer/diagnostic-manager.cc b/gcc/analyzer/diagnostic-manager.cc index 443ff05..7eb4ed8 100644 --- a/gcc/analyzer/diagnostic-manager.cc +++ b/gcc/analyzer/diagnostic-manager.cc @@ -1587,7 +1587,7 @@ diagnostic_manager::add_events_for_eedge (const path_builder &pb, "this path would have been rejected as infeasible" " at this edge: "); pb.get_feasibility_problem ()->dump_to_pp (&pp); - emission_path->add_event (new custom_event + emission_path->add_event (new precanned_custom_event (dst_point.get_location (), dst_point.get_fndecl (), dst_stack_depth, diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc index 529965a..f322fdb 100644 --- a/gcc/analyzer/engine.cc +++ b/gcc/analyzer/engine.cc @@ -1395,7 +1395,7 @@ public: { /* Compare with diagnostic_manager::add_events_for_superedge. */ const int src_stack_depth = src_point.get_stack_depth (); - m_stack_pop_event = new custom_event + m_stack_pop_event = new precanned_custom_event (src_point.get_location (), src_point.get_fndecl (), src_stack_depth, diff --git a/gcc/analyzer/region-model-manager.cc b/gcc/analyzer/region-model-manager.cc index 621eff0..1ee6663 100644 --- a/gcc/analyzer/region-model-manager.cc +++ b/gcc/analyzer/region-model-manager.cc @@ -210,6 +210,17 @@ region_model_manager::get_or_create_constant_svalue (tree cst_expr) return cst_sval; } +/* Return the svalue * for a constant_svalue for the INTEGER_CST + for VAL of type TYPE, creating it if necessary. */ + +const svalue * +region_model_manager::get_or_create_int_cst (tree type, poly_int64 val) +{ + gcc_assert (type); + tree tree_cst = build_int_cst (type, val); + return get_or_create_constant_svalue (tree_cst); +} + /* Return the svalue * for a unknown_svalue for TYPE (which can be NULL), creating it if necessary. The unknown_svalue instances are reused, based on pointer equality @@ -475,8 +486,7 @@ maybe_undo_optimize_bit_field_compare (tree type, shift it by the correct number of bits. */ const svalue *lhs = get_or_create_cast (type, sval); HOST_WIDE_INT bit_offset = bits.get_start_bit_offset ().to_shwi (); - tree shift_amt = build_int_cst (type, bit_offset); - const svalue *shift_sval = get_or_create_constant_svalue (shift_amt); + const svalue *shift_sval = get_or_create_int_cst (type, bit_offset); const svalue *shifted_sval = get_or_create_binop (type, LSHIFT_EXPR, lhs, shift_sval); /* Reapply the mask (needed for negative diff --git a/gcc/analyzer/region-model.cc b/gcc/analyzer/region-model.cc index e02a897..462fe6d 100644 --- a/gcc/analyzer/region-model.cc +++ b/gcc/analyzer/region-model.cc @@ -1259,8 +1259,8 @@ region_model::on_setjmp (const gcall *call, const exploded_node *enode, /* Direct calls to setjmp return 0. */ if (tree lhs = gimple_call_lhs (call)) { - tree zero = build_int_cst (TREE_TYPE (lhs), 0); - const svalue *new_sval = m_mgr->get_or_create_constant_svalue (zero); + const svalue *new_sval + = m_mgr->get_or_create_int_cst (TREE_TYPE (lhs), 0); const region *lhs_reg = get_lvalue (lhs, ctxt); set_value (lhs_reg, new_sval, ctxt); } @@ -1291,15 +1291,14 @@ region_model::on_longjmp (const gcall *longjmp_call, const gcall *setjmp_call, if (tree lhs = gimple_call_lhs (setjmp_call)) { /* Passing 0 as the val to longjmp leads to setjmp returning 1. */ - tree t_zero = build_int_cst (TREE_TYPE (fake_retval), 0); - const svalue *zero_sval = m_mgr->get_or_create_constant_svalue (t_zero); + const svalue *zero_sval + = m_mgr->get_or_create_int_cst (TREE_TYPE (fake_retval), 0); tristate eq_zero = eval_condition (fake_retval_sval, EQ_EXPR, zero_sval); /* If we have 0, use 1. */ if (eq_zero.is_true ()) { - tree t_one = build_int_cst (TREE_TYPE (fake_retval), 1); const svalue *one_sval - = m_mgr->get_or_create_constant_svalue (t_one); + = m_mgr->get_or_create_int_cst (TREE_TYPE (fake_retval), 1); fake_retval_sval = one_sval; } else diff --git a/gcc/analyzer/region-model.h b/gcc/analyzer/region-model.h index 7b12d35..a4b584d 100644 --- a/gcc/analyzer/region-model.h +++ b/gcc/analyzer/region-model.h @@ -238,6 +238,7 @@ public: /* svalue consolidation. */ const svalue *get_or_create_constant_svalue (tree cst_expr); + const svalue *get_or_create_int_cst (tree type, poly_int64); const svalue *get_or_create_unknown_svalue (tree type); const svalue *get_or_create_setjmp_svalue (const setjmp_record &r, tree type); diff --git a/gcc/analyzer/sm-signal.cc b/gcc/analyzer/sm-signal.cc index d7e7e7c..42be809 100644 --- a/gcc/analyzer/sm-signal.cc +++ b/gcc/analyzer/sm-signal.cc @@ -238,9 +238,10 @@ public: FINAL OVERRIDE { emission_path->add_event - (new custom_event (UNKNOWN_LOCATION, NULL_TREE, 0, - "later on," - " when the signal is delivered to the process")); + (new precanned_custom_event + (UNKNOWN_LOCATION, NULL_TREE, 0, + "later on," + " when the signal is delivered to the process")); } }; diff --git a/gcc/analyzer/store.cc b/gcc/analyzer/store.cc index d75fb2c..3203703 100644 --- a/gcc/analyzer/store.cc +++ b/gcc/analyzer/store.cc @@ -1043,8 +1043,8 @@ binding_cluster::zero_fill_region (store_manager *mgr, const region *reg) /* Add a default binding to zero. */ region_model_manager *sval_mgr = mgr->get_svalue_manager (); - tree cst_zero = build_int_cst (integer_type_node, 0); - const svalue *cst_sval = sval_mgr->get_or_create_constant_svalue (cst_zero); + const svalue *cst_sval + = sval_mgr->get_or_create_int_cst (integer_type_node, 0); const svalue *bound_sval = cst_sval; if (reg->get_type ()) bound_sval = sval_mgr->get_or_create_unaryop (reg->get_type (), NOP_EXPR, @@ -1177,6 +1177,16 @@ binding_cluster::get_any_binding (store_manager *mgr, return rmm_mgr->get_or_create_unknown_svalue (reg->get_type ()); } + /* Alternatively, if this is a symbolic read and the cluster has any bindings, + then we don't know if we're reading those values or not, so the result + is also "UNKNOWN". */ + if (reg->get_offset ().symbolic_p () + && m_map.elements () > 0) + { + region_model_manager *rmm_mgr = mgr->get_svalue_manager (); + return rmm_mgr->get_or_create_unknown_svalue (reg->get_type ()); + } + if (const svalue *compound_sval = maybe_get_compound_binding (mgr, reg)) return compound_sval; diff --git a/gcc/calls.c b/gcc/calls.c index a7c78ed..4bf2b5d 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -3729,7 +3729,7 @@ expand_call (tree exp, rtx target, int ignore) So the entire argument block must then be preallocated (i.e., we ignore PUSH_ROUNDING in that case). */ - int must_preallocate = !PUSH_ARGS; + int must_preallocate = !targetm.calls.push_argument (0); /* Size of the stack reserved for parameter registers. */ int reg_parm_stack_space = 0; @@ -3838,7 +3838,7 @@ expand_call (tree exp, rtx target, int ignore) #endif if (! OUTGOING_REG_PARM_STACK_SPACE ((!fndecl ? fntype : TREE_TYPE (fndecl))) - && reg_parm_stack_space > 0 && PUSH_ARGS) + && reg_parm_stack_space > 0 && targetm.calls.push_argument (0)) must_preallocate = 1; /* Set up a place to return a structure. */ @@ -5479,7 +5479,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, } else { - if (!PUSH_ARGS) + if (!targetm.calls.push_argument (0)) argblock = push_block (gen_int_mode (args_size.constant, Pmode), 0, 0); } diff --git a/gcc/cfgloopanal.c b/gcc/cfgloopanal.c index fdd8d3f..2db46c8 100644 --- a/gcc/cfgloopanal.c +++ b/gcc/cfgloopanal.c @@ -504,7 +504,7 @@ auto_vec<basic_block> get_loop_hot_path (const class loop *loop) { basic_block bb = loop->header; - vec<basic_block> path = vNULL; + auto_vec<basic_block> path; bitmap visited = BITMAP_ALLOC (NULL); while (true) diff --git a/gcc/common/config/arm/arm-common.c b/gcc/common/config/arm/arm-common.c index 9980af6..481aa9e 100644 --- a/gcc/common/config/arm/arm-common.c +++ b/gcc/common/config/arm/arm-common.c @@ -627,9 +627,15 @@ public: The options array consists of couplets of information where the first item in each couplet is the string describing which option name was selected (arch, cpu, fpu) and the second is the value - passed for that option. */ -const char * -arm_canon_arch_option (int argc, const char **argv) + passed for that option. + + arch_for_multilib is boolean variable taking value true or false. + arch_for_multilib is false when the canonical representation is for -march + option and it is true when canonical representation is for -mlibarch option. + On passing arch_for_multilib true the canonical string generated will be + without the compiler options which are not required for multilib linking. */ +static const char * +arm_canon_arch_option_1 (int argc, const char **argv, bool arch_for_multilib) { const char *arch = NULL; const char *cpu = NULL; @@ -694,8 +700,8 @@ arm_canon_arch_option (int argc, const char **argv) /* First build up a bitmap describing the target architecture. */ if (arch) { - selected_arch = arm_parse_arch_option_name (all_architectures, - "-march", arch); + selected_arch = arm_parse_arch_option_name (all_architectures, "-march", + arch, !arch_for_multilib); if (selected_arch == NULL) return ""; @@ -703,6 +709,15 @@ arm_canon_arch_option (int argc, const char **argv) arm_initialize_isa (target_isa, selected_arch->common.isa_bits); arm_parse_option_features (target_isa, &selected_arch->common, strchr (arch, '+')); + if (arch_for_multilib) + { + const enum isa_feature removable_bits[] = {ISA_IGNORE_FOR_MULTILIB, + isa_nobit}; + sbitmap isa_bits = sbitmap_alloc (isa_num_bits); + arm_initialize_isa (isa_bits, removable_bits); + bitmap_and_compl (target_isa, target_isa, isa_bits); + } + if (fpu && strcmp (fpu, "auto") != 0) { /* We assume that architectures do not have any FPU bits @@ -719,7 +734,8 @@ arm_canon_arch_option (int argc, const char **argv) else if (cpu) { const cpu_option *selected_cpu - = arm_parse_cpu_option_name (all_cores, "-mcpu", cpu); + = arm_parse_cpu_option_name (all_cores, "-mcpu", cpu, + !arch_for_multilib); if (selected_cpu == NULL) return ""; @@ -1069,3 +1085,22 @@ arm_asm_auto_mfpu (int argc, const char **argv) #define TARGET_EXCEPT_UNWIND_INFO arm_except_unwind_info struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER; + +/* Returns a canonical representation of the -march option from the current + -march string (if given) and other options on the command line that might + affect the architecture. */ +const char * +arm_canon_arch_option (int argc, const char **argv) +{ + return arm_canon_arch_option_1 (argc, argv, false); +} + +/* Returns a canonical representation of the -mlibarch option from the current + -march string (if given) and other options on the command line that might + affect the architecture after removing the compiler extension options which + are not required for multilib linking. */ +const char * +arm_canon_arch_multilib_option (int argc, const char **argv) +{ + return arm_canon_arch_option_1 (argc, argv, true); +} diff --git a/gcc/config.in b/gcc/config.in index e54f59c..18e6271 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -1431,6 +1431,12 @@ #endif +/* Define if your assembler has fixed global_load functions. */ +#ifndef USED_FOR_TARGET +#undef HAVE_GCN_ASM_GLOBAL_LOAD_FIXED +#endif + + /* Define to 1 if you have the `getchar_unlocked' function. */ #ifndef USED_FOR_TARGET #undef HAVE_GETCHAR_UNLOCKED diff --git a/gcc/config/arm/arm-cpus.in b/gcc/config/arm/arm-cpus.in index 0becb43..ab4b6ac 100644 --- a/gcc/config/arm/arm-cpus.in +++ b/gcc/config/arm/arm-cpus.in @@ -324,6 +324,8 @@ define implied vfp_base MVE MVE_FP ALL_FP # need to ignore it for matching purposes. define fgroup ALL_QUIRKS quirk_no_volatile_ce quirk_armv6kz quirk_cm3_ldrd xscale quirk_no_asmcpu +define fgroup IGNORE_FOR_MULTILIB cdecp0 cdecp1 cdecp2 cdecp3 cdecp4 cdecp5 cdecp6 cdecp7 + # Architecture entries # format: # begin arch <name> diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 8e5bd57..015299c 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -2444,10 +2444,14 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #endif const char *arm_canon_arch_option (int argc, const char **argv); +const char *arm_canon_arch_multilib_option (int argc, const char **argv); #define CANON_ARCH_SPEC_FUNCTION \ { "canon_arch", arm_canon_arch_option }, +#define CANON_ARCH_MULTILIB_SPEC_FUNCTION \ + { "canon_arch_multilib", arm_canon_arch_multilib_option }, + const char *arm_be8_option (int argc, const char **argv); #define BE8_SPEC_FUNCTION \ { "be8_linkopt", arm_be8_option }, @@ -2456,6 +2460,7 @@ const char *arm_be8_option (int argc, const char **argv); MCPU_MTUNE_NATIVE_FUNCTIONS \ ASM_CPU_SPEC_FUNCTIONS \ CANON_ARCH_SPEC_FUNCTION \ + CANON_ARCH_MULTILIB_SPEC_FUNCTION \ TARGET_MODE_SPEC_FUNCTIONS \ BE8_SPEC_FUNCTION @@ -2476,12 +2481,22 @@ const char *arm_be8_option (int argc, const char **argv); " %{mfloat-abi=*: abi %*}" \ " %<march=*) " +/* Generate a canonical string to represent the architecture selected ignoring + the options not required for multilib linking. */ +#define MULTILIB_ARCH_CANONICAL_SPECS \ + "-mlibarch=%:canon_arch_multilib(%{mcpu=*: cpu %*} " \ + " %{march=*: arch %*} " \ + " %{mfpu=*: fpu %*} " \ + " %{mfloat-abi=*: abi %*}" \ + " %<mlibarch=*) " + /* Complete set of specs for the driver. Commas separate the individual rules so that any option suppression (%<opt...)is completed before starting subsequent rules. */ #define DRIVER_SELF_SPECS \ MCPU_MTUNE_NATIVE_SPECS, \ TARGET_MODE_SPECS, \ + MULTILIB_ARCH_CANONICAL_SPECS, \ ARCH_CANONICAL_SPECS #define TARGET_SUPPORTS_WIDE_INT 1 diff --git a/gcc/config/arm/arm.opt b/gcc/config/arm/arm.opt index d332eb6..af478a9 100644 --- a/gcc/config/arm/arm.opt +++ b/gcc/config/arm/arm.opt @@ -81,6 +81,12 @@ Specify the name of the target architecture. EnumValue Enum(arm_arch) String(native) Value(-1) DriverOnly +; Set to the name of target architecture which is required for +; multilib linking. This option is undocumented becuase it +; should not be used by the users. +mlibarch= +Target RejectNegative JoinedOrMissing NoDWARFRecord DriverOnly Undocumented + marm Target RejectNegative Negative(mthumb) InverseMask(THUMB) Generate code in 32 bit ARM state. diff --git a/gcc/config/arm/t-rmprofile b/gcc/config/arm/t-rmprofile index 1959189..3e75fcc 100644 --- a/gcc/config/arm/t-rmprofile +++ b/gcc/config/arm/t-rmprofile @@ -53,10 +53,15 @@ MULTILIB_REQUIRED += mthumb/march=armv8.1-m.main+mve/mfloat-abi=hard # Arch Matches MULTILIB_MATCHES += march?armv6s-m=march?armv6-m +# For all MULITIB_MATCHES for v8-m and above add mlibarch? on the right hand side +# of = in the variant string instead of march?. This is needed becuase all the +# MULITIB_MATCHES variant strings are compared with mlibarch option for multilib +# linking. + # Map all v8-m.main+dsp FP variants down to the variant without DSP. -MULTILIB_MATCHES += march?armv8-m.main=march?armv8-m.main+dsp \ +MULTILIB_MATCHES += march?armv8-m.main=mlibarch?armv8-m.main+dsp \ $(foreach FP, +fp +fp.dp, \ - march?armv8-m.main$(FP)=march?armv8-m.main+dsp$(FP)) + march?armv8-m.main$(FP)=mlibarch?armv8-m.main+dsp$(FP)) # For single-precision only fpv5, use the base fp libraries MULTILIB_MATCHES += march?armv7e-m+fp=march?armv7e-m+fpv5 @@ -65,10 +70,9 @@ MULTILIB_MATCHES += march?armv7e-m+fp=march?armv7e-m+fpv5 MULTILIB_REUSE += $(foreach ARCH, armv6s-m armv7-m armv7e-m armv8-m\.base armv8-m\.main, \ mthumb/march.$(ARCH)/mfloat-abi.soft=mthumb/march.$(ARCH)/mfloat-abi.softfp) - # Map v8.1-M to v8-M. -MULTILIB_MATCHES += march?armv8-m.main=march?armv8.1-m.main -MULTILIB_MATCHES += march?armv8-m.main=march?armv8.1-m.main+dsp +MULTILIB_MATCHES += march?armv8-m.main=mlibarch?armv8.1-m.main +MULTILIB_MATCHES += march?armv8-m.main=mlibarch?armv8.1-m.main+dsp MULTILIB_REUSE += mthumb/march.armv8-m\.main/mfloat-abi.soft=mthumb/march.armv8\.1-m\.main+mve/mfloat-abi.soft MULTILIB_REUSE += mthumb/march.armv8-m\.main/mfloat-abi.soft=mthumb/march.armv8\.1-m\.main+mve/mfloat-abi.softfp @@ -77,8 +81,15 @@ v8_1m_dp_variants = +fp.dp +dsp+fp.dp +fp.dp+mve +fp.dp+mve.fp # Map all v8.1-m.main FP sp variants down to v8-m. MULTILIB_MATCHES += $(foreach FP, $(v8_1m_sp_variants), \ - march?armv8-m.main+fp=march?armv8.1-m.main$(FP)) + march?armv8-m.main+fp=mlibarch?armv8.1-m.main$(FP)) # Map all v8.1-m.main FP dp variants down to v8-m. MULTILIB_MATCHES += $(foreach FP, $(v8_1m_dp_variants), \ - march?armv8-m.main+fp.dp=march?armv8.1-m.main$(FP)) + march?armv8-m.main+fp.dp=mlibarch?armv8.1-m.main$(FP)) + +# For all the MULTILIB_REQUIRED for v8-m and above, add MULTILIB_MATCHES which +# maps mlibarch with march for multilib linking. +MULTILIB_MATCHES += march?armv8-m.main=mlibarch?armv8-m.main +MULTILIB_MATCHES += march?armv8-m.main+fp=mlibarch?armv8-m.main+fp +MULTILIB_MATCHES += march?armv8-m.main+fp.dp=mlibarch?armv8-m.main+fp.dp +MULTILIB_MATCHES += march?armv8.1-m.main+mve=mlibarch?armv8.1-m.main+mve diff --git a/gcc/config/bpf/bpf.h b/gcc/config/bpf/bpf.h index 4c5b19e..80195ce 100644 --- a/gcc/config/bpf/bpf.h +++ b/gcc/config/bpf/bpf.h @@ -288,9 +288,6 @@ enum reg_class never used when passing arguments. However, we still have to define the constants below. */ -/* If nonzero, push insns will be used to pass outgoing arguments. */ -#define PUSH_ARGS 0 - /* If nonzero, function arguments will be evaluated from last to first, rather than from first to last. */ #define PUSH_ARGS_REVERSED 1 diff --git a/gcc/config/cr16/cr16.c b/gcc/config/cr16/cr16.c index 6c81c39..aaa2260 100644 --- a/gcc/config/cr16/cr16.c +++ b/gcc/config/cr16/cr16.c @@ -158,6 +158,8 @@ static void cr16_print_operand_address (FILE *, machine_mode, rtx); #define TARGET_CLASS_LIKELY_SPILLED_P cr16_class_likely_spilled_p /* Passing function arguments. */ +#undef TARGET_PUSH_ARGUMENT +#define TARGET_PUSH_ARGUMENT hook_bool_uint_true #undef TARGET_FUNCTION_ARG #define TARGET_FUNCTION_ARG cr16_function_arg #undef TARGET_FUNCTION_ARG_ADVANCE diff --git a/gcc/config/cr16/cr16.h b/gcc/config/cr16/cr16.h index 4ce9e81..a3ad035 100644 --- a/gcc/config/cr16/cr16.h +++ b/gcc/config/cr16/cr16.h @@ -376,8 +376,6 @@ enum reg_class #define ACCUMULATE_OUTGOING_ARGS 0 -#define PUSH_ARGS 1 - #define PUSH_ROUNDING(BYTES) cr16_push_rounding (BYTES) #ifndef CUMULATIVE_ARGS diff --git a/gcc/config/gcn/gcn.c b/gcc/config/gcn/gcn.c index 283a91f..54a1c0b 100644 --- a/gcc/config/gcn/gcn.c +++ b/gcc/config/gcn/gcn.c @@ -5481,13 +5481,22 @@ print_operand_address (FILE *file, rtx mem) if (vgpr_offset == NULL_RTX) /* In this case, the vector offset is zero, so we use the first lane of v1, which is initialized to zero. */ - fprintf (file, "v[1:2]"); + { + if (HAVE_GCN_ASM_GLOBAL_LOAD_FIXED) + fprintf (file, "v1"); + else + fprintf (file, "v[1:2]"); + } else if (REG_P (vgpr_offset) && VGPR_REGNO_P (REGNO (vgpr_offset))) { - fprintf (file, "v[%d:%d]", - REGNO (vgpr_offset) - FIRST_VGPR_REG, - REGNO (vgpr_offset) - FIRST_VGPR_REG + 1); + if (HAVE_GCN_ASM_GLOBAL_LOAD_FIXED) + fprintf (file, "v%d", + REGNO (vgpr_offset) - FIRST_VGPR_REG); + else + fprintf (file, "v[%d:%d]", + REGNO (vgpr_offset) - FIRST_VGPR_REG, + REGNO (vgpr_offset) - FIRST_VGPR_REG + 1); } else output_operand_lossage ("bad ADDR_SPACE_GLOBAL address"); diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index 1077a2b..2b88325 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -1950,7 +1950,7 @@ h8300_select_cc_mode (enum rtx_code cond, rtx op0, rtx op1) || GET_CODE (op0) == NEG || GET_CODE (op0) == AND || GET_CODE (op0) == IOR || GET_CODE (op0) == XOR || GET_CODE (op0) == NOT || GET_CODE (op0) == ASHIFT - || GET_CODE (op0) == MULT + || GET_CODE (op0) == MULT || GET_CODE (op0) == SYMBOL_REF || GET_CODE (op0) == SIGN_EXTEND || GET_CODE (op0) == ZERO_EXTEND || REG_P (op0) || MEM_P (op0))) return CCZNmode; diff --git a/gcc/config/h8300/logical.md b/gcc/config/h8300/logical.md index cb4c638..07d36cf 100644 --- a/gcc/config/h8300/logical.md +++ b/gcc/config/h8300/logical.md @@ -4,7 +4,27 @@ (logicals:QHSI (match_operand:QHSI 1 "register_operand" "") (match_operand:QHSI 2 "h8300_src_operand" "")))] "" - "") + " + { + enum machine_mode mode = GET_MODE (operands[0]); + /* DImodes are not considered tieable, as a result operations involving + subregs of DImode objects are considered expensive which can prevent + CSE from doing obvious simplifications. + + We may ultimately change what is tieable, but this is an immediate + workaround while we evaluate changes to tieable modes. + + The key in terms of what we want to handle is then the result of + the operation is not a constant. */ + if ((<CODE> == AND && operands[2] == CONSTM1_RTX (mode)) + || (<CODE> == IOR && operands[2] == CONST0_RTX (mode)) + || (<CODE> == XOR && operands[2] == CONST0_RTX (mode)) + || ((<CODE> == AND || <CODE> == IOR) && operands[1] == operands[2])) + { + emit_move_insn (operands[0], operands[1]); + DONE; + } + }") ;; There's a ton of cleanup to do from here below. ;; ---------------------------------------------------------------------- diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c index eb6f9b0..8f4e4e4 100644 --- a/gcc/config/i386/i386-expand.c +++ b/gcc/config/i386/i386-expand.c @@ -13811,10 +13811,17 @@ ix86_expand_vector_init_duplicate (bool mmx_ok, machine_mode mode, wsmode = GET_MODE_INNER (wvmode); val = convert_modes (wsmode, smode, val, true); - x = expand_simple_binop (wsmode, ASHIFT, val, - GEN_INT (GET_MODE_BITSIZE (smode)), - NULL_RTX, 1, OPTAB_LIB_WIDEN); - val = expand_simple_binop (wsmode, IOR, val, x, x, 1, OPTAB_LIB_WIDEN); + + if (smode == QImode && !TARGET_PARTIAL_REG_STALL) + emit_insn (gen_insv_1 (wsmode, val, val)); + else + { + x = expand_simple_binop (wsmode, ASHIFT, val, + GEN_INT (GET_MODE_BITSIZE (smode)), + NULL_RTX, 1, OPTAB_LIB_WIDEN); + val = expand_simple_binop (wsmode, IOR, val, x, x, 1, + OPTAB_LIB_WIDEN); + } x = gen_reg_rtx (wvmode); ok = ix86_expand_vector_init_duplicate (mmx_ok, wvmode, x, val); @@ -14788,6 +14795,9 @@ ix86_expand_vector_set_var (rtx target, rtx val, rtx idx) case E_V8DFmode: cmp_mode = V8DImode; break; + case E_V2SFmode: + cmp_mode = V2SImode; + break; case E_V4SFmode: cmp_mode = V4SImode; break; @@ -14809,9 +14819,11 @@ ix86_expand_vector_set_var (rtx target, rtx val, rtx idx) idxv = gen_reg_rtx (cmp_mode); idx_tmp = convert_to_mode (GET_MODE_INNER (cmp_mode), idx, 1); - ok = ix86_expand_vector_init_duplicate (false, mode, valv, val); + ok = ix86_expand_vector_init_duplicate (TARGET_MMX_WITH_SSE, + mode, valv, val); gcc_assert (ok); - ok = ix86_expand_vector_init_duplicate (false, cmp_mode, idxv, idx_tmp); + ok = ix86_expand_vector_init_duplicate (TARGET_MMX_WITH_SSE, + cmp_mode, idxv, idx_tmp); gcc_assert (ok); vec[0] = target; vec[1] = valv; diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index a612558..7d0d414 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -4191,6 +4191,18 @@ ix86_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED) } } +/* Implement TARGET_PUSH_ARGUMENT. */ + +static bool +ix86_push_argument (unsigned int npush) +{ + /* If SSE2 is available, use vector move to put large argument onto + stack. NB: In 32-bit mode, use 8-byte vector move. */ + return ((!TARGET_SSE2 || npush < (TARGET_64BIT ? 16 : 8)) + && TARGET_PUSH_ARGS + && !ACCUMULATE_OUTGOING_ARGS); +} + /* Create the va_list data type. */ @@ -23695,6 +23707,8 @@ ix86_run_selftests (void) #define TARGET_C_EXCESS_PRECISION ix86_get_excess_precision #undef TARGET_PROMOTE_PROTOTYPES #define TARGET_PROMOTE_PROTOTYPES hook_bool_const_tree_true +#undef TARGET_PUSH_ARGUMENT +#define TARGET_PUSH_ARGUMENT ix86_push_argument #undef TARGET_SETUP_INCOMING_VARARGS #define TARGET_SETUP_INCOMING_VARARGS ix86_setup_incoming_varargs #undef TARGET_MUST_PASS_IN_STACK diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 182b327..6e0340a 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -1462,13 +1462,8 @@ enum reg_class || TARGET_64BIT_MS_ABI \ || (TARGET_MACHO && crtl->profile)) -/* If defined, a C expression whose value is nonzero when we want to use PUSH - instructions to pass outgoing arguments. */ - -#define PUSH_ARGS (TARGET_PUSH_ARGS && !ACCUMULATE_OUTGOING_ARGS) - /* We want the stack and args grow in opposite directions, even if - PUSH_ARGS is 0. */ + targetm.calls.push_argument returns false. */ #define PUSH_ARGS_REVERSED 1 /* Offset of first parameter from the argument pointer register value. */ diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md index 59a16f4..a107ac5 100644 --- a/gcc/config/i386/mmx.md +++ b/gcc/config/i386/mmx.md @@ -1279,11 +1279,14 @@ (define_expand "vec_setv2sf" [(match_operand:V2SF 0 "register_operand") (match_operand:SF 1 "register_operand") - (match_operand 2 "const_int_operand")] + (match_operand 2 "vec_setm_mmx_operand")] "TARGET_MMX || TARGET_MMX_WITH_SSE" { - ix86_expand_vector_set (TARGET_MMX_WITH_SSE, operands[0], operands[1], - INTVAL (operands[2])); + if (CONST_INT_P (operands[2])) + ix86_expand_vector_set (TARGET_MMX_WITH_SSE, operands[0], operands[1], + INTVAL (operands[2])); + else + ix86_expand_vector_set_var (operands[0], operands[1], operands[2]); DONE; }) @@ -2989,11 +2992,14 @@ (define_expand "vec_setv2si" [(match_operand:V2SI 0 "register_operand") (match_operand:SI 1 "register_operand") - (match_operand 2 "const_int_operand")] + (match_operand 2 "vec_setm_mmx_operand")] "TARGET_MMX || TARGET_MMX_WITH_SSE" { - ix86_expand_vector_set (TARGET_MMX_WITH_SSE, operands[0], operands[1], - INTVAL (operands[2])); + if (CONST_INT_P (operands[2])) + ix86_expand_vector_set (TARGET_MMX_WITH_SSE, operands[0], operands[1], + INTVAL (operands[2])); + else + ix86_expand_vector_set_var (operands[0], operands[1], operands[2]); DONE; }) @@ -3145,11 +3151,14 @@ (define_expand "vec_setv4hi" [(match_operand:V4HI 0 "register_operand") (match_operand:HI 1 "register_operand") - (match_operand 2 "const_int_operand")] + (match_operand 2 "vec_setm_mmx_operand")] "TARGET_MMX || TARGET_MMX_WITH_SSE" { - ix86_expand_vector_set (TARGET_MMX_WITH_SSE, operands[0], operands[1], - INTVAL (operands[2])); + if (CONST_INT_P (operands[2])) + ix86_expand_vector_set (TARGET_MMX_WITH_SSE, operands[0], operands[1], + INTVAL (operands[2])); + else + ix86_expand_vector_set_var (operands[0], operands[1], operands[2]); DONE; }) @@ -3177,11 +3186,14 @@ (define_expand "vec_setv8qi" [(match_operand:V8QI 0 "register_operand") (match_operand:QI 1 "register_operand") - (match_operand 2 "const_int_operand")] + (match_operand 2 "vec_setm_mmx_operand")] "TARGET_SSE4_1 && TARGET_MMX_WITH_SSE" { - ix86_expand_vector_set (TARGET_MMX_WITH_SSE, operands[0], operands[1], - INTVAL (operands[2])); + if (CONST_INT_P (operands[2])) + ix86_expand_vector_set (TARGET_MMX_WITH_SSE, operands[0], operands[1], + INTVAL (operands[2])); + else + ix86_expand_vector_set_var (operands[0], operands[1], operands[2]); DONE; }) diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md index 3dd134e..e7a8968 100644 --- a/gcc/config/i386/predicates.md +++ b/gcc/config/i386/predicates.md @@ -1026,6 +1026,12 @@ (match_test "TARGET_AVX2")) (match_code "const_int"))) +(define_predicate "vec_setm_mmx_operand" + (ior (and (match_operand 0 "register_operand") + (match_test "TARGET_SSE4_1") + (match_test "TARGET_MMX_WITH_SSE")) + (match_code "const_int"))) + ;; True for registers, or 1 or -1. Used to optimize double-word shifts. (define_predicate "reg_or_pm1_operand" (ior (match_operand 0 "register_operand") diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index b1cb359..d22bdd7 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -1296,6 +1296,9 @@ m32c_push_rounding (poly_int64 n) return (n + 1) & ~1; } +#undef TARGET_PUSH_ARGUMENT +#define TARGET_PUSH_ARGUMENT hook_bool_uint_true + /* Passing Arguments in Registers */ /* Implements TARGET_FUNCTION_ARG. Arguments are passed partly in diff --git a/gcc/config/m32c/m32c.h b/gcc/config/m32c/m32c.h index 635f592..228a73d 100644 --- a/gcc/config/m32c/m32c.h +++ b/gcc/config/m32c/m32c.h @@ -472,7 +472,6 @@ enum reg_class /* Passing Function Arguments on the Stack */ -#define PUSH_ARGS 1 #define PUSH_ROUNDING(N) m32c_push_rounding (N) #define CALL_POPS_ARGS(C) 0 diff --git a/gcc/config/nios2/nios2.h b/gcc/config/nios2/nios2.h index 1840a46..dfca12c 100644 --- a/gcc/config/nios2/nios2.h +++ b/gcc/config/nios2/nios2.h @@ -297,7 +297,6 @@ typedef struct nios2_args ((REGNO) >= FIRST_ARG_REGNO && (REGNO) <= LAST_ARG_REGNO) /* Passing function arguments on stack. */ -#define PUSH_ARGS 0 #define ACCUMULATE_OUTGOING_ARGS 1 /* We define TARGET_RETURN_IN_MEMORY, so set to zero. */ diff --git a/gcc/config/pru/pru.h b/gcc/config/pru/pru.h index 4c35a7d..9b6be32 100644 --- a/gcc/config/pru/pru.h +++ b/gcc/config/pru/pru.h @@ -339,7 +339,6 @@ typedef struct pru_args ((REGNO) >= FIRST_ARG_REGNUM && (REGNO) <= LAST_ARG_REGNUM) /* Passing function arguments on stack. */ -#define PUSH_ARGS 0 #define ACCUMULATE_OUTGOING_ARGS 1 /* We define TARGET_RETURN_IN_MEMORY, so set to zero. */ diff --git a/gcc/config/rs6000/fusion.md b/gcc/config/rs6000/fusion.md index e642ff5..516baa0 100644 --- a/gcc/config/rs6000/fusion.md +++ b/gcc/config/rs6000/fusion.md @@ -358,7 +358,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar and -> and (define_insn "*fuse_and_and" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "%r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -376,7 +376,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar andc -> and (define_insn "*fuse_andc_and" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -394,7 +394,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar eqv -> and (define_insn "*fuse_eqv_and" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -412,7 +412,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar nand -> and (define_insn "*fuse_nand_and" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -430,7 +430,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar nor -> and (define_insn "*fuse_nor_and" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -448,7 +448,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar or -> and (define_insn "*fuse_or_and" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -466,7 +466,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar orc -> and (define_insn "*fuse_orc_and" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -484,7 +484,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar xor -> and (define_insn "*fuse_xor_and" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -502,7 +502,7 @@ ;; add-logical fusion pattern generated by gen_logical_addsubf ;; scalar add -> and (define_insn "*fuse_add_and" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (plus:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -520,7 +520,7 @@ ;; add-logical fusion pattern generated by gen_logical_addsubf ;; scalar subf -> and (define_insn "*fuse_subf_and" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (minus:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -538,7 +538,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar and -> andc (define_insn "*fuse_and_andc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -556,7 +556,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar andc -> andc (define_insn "*fuse_andc_andc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -574,7 +574,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar eqv -> andc (define_insn "*fuse_eqv_andc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -592,7 +592,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar nand -> andc (define_insn "*fuse_nand_andc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -610,7 +610,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar nor -> andc (define_insn "*fuse_nor_andc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -628,7 +628,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar or -> andc (define_insn "*fuse_or_andc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -646,7 +646,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar orc -> andc (define_insn "*fuse_orc_andc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -664,7 +664,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar xor -> andc (define_insn "*fuse_xor_andc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -682,7 +682,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar and -> eqv (define_insn "*fuse_and_eqv" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (not:GPR (xor:GPR (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -700,7 +700,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar andc -> eqv (define_insn "*fuse_andc_eqv" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (not:GPR (xor:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -718,7 +718,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar eqv -> eqv (define_insn "*fuse_eqv_eqv" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (not:GPR (xor:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "%r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -736,7 +736,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar nand -> eqv (define_insn "*fuse_nand_eqv" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (not:GPR (xor:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -754,7 +754,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar nor -> eqv (define_insn "*fuse_nor_eqv" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (not:GPR (xor:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -772,7 +772,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar or -> eqv (define_insn "*fuse_or_eqv" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (not:GPR (xor:GPR (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -790,7 +790,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar orc -> eqv (define_insn "*fuse_orc_eqv" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (not:GPR (xor:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -808,7 +808,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar xor -> eqv (define_insn "*fuse_xor_eqv" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (not:GPR (xor:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -826,7 +826,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar and -> nand (define_insn "*fuse_and_nand" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (not:GPR (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -844,7 +844,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar andc -> nand (define_insn "*fuse_andc_nand" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (not:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -862,7 +862,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar eqv -> nand (define_insn "*fuse_eqv_nand" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (not:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -880,7 +880,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar nand -> nand (define_insn "*fuse_nand_nand" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (not:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -898,7 +898,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar nor -> nand (define_insn "*fuse_nor_nand" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (not:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -916,7 +916,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar or -> nand (define_insn "*fuse_or_nand" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (not:GPR (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -934,7 +934,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar orc -> nand (define_insn "*fuse_orc_nand" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (not:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -952,7 +952,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar xor -> nand (define_insn "*fuse_xor_nand" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -970,7 +970,7 @@ ;; add-logical fusion pattern generated by gen_logical_addsubf ;; scalar add -> nand (define_insn "*fuse_add_nand" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (not:GPR (plus:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -988,7 +988,7 @@ ;; add-logical fusion pattern generated by gen_logical_addsubf ;; scalar subf -> nand (define_insn "*fuse_subf_nand" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (not:GPR (minus:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -1006,7 +1006,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar and -> nor (define_insn "*fuse_and_nor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (not:GPR (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -1024,7 +1024,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar andc -> nor (define_insn "*fuse_andc_nor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (not:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -1042,7 +1042,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar eqv -> nor (define_insn "*fuse_eqv_nor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (not:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -1060,7 +1060,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar nand -> nor (define_insn "*fuse_nand_nor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (not:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -1078,7 +1078,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar nor -> nor (define_insn "*fuse_nor_nor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (not:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -1096,7 +1096,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar or -> nor (define_insn "*fuse_or_nor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (not:GPR (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -1114,7 +1114,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar orc -> nor (define_insn "*fuse_orc_nor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (not:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -1132,7 +1132,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar xor -> nor (define_insn "*fuse_xor_nor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -1150,7 +1150,7 @@ ;; add-logical fusion pattern generated by gen_logical_addsubf ;; scalar add -> nor (define_insn "*fuse_add_nor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (not:GPR (plus:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -1168,7 +1168,7 @@ ;; add-logical fusion pattern generated by gen_logical_addsubf ;; scalar subf -> nor (define_insn "*fuse_subf_nor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (and:GPR (not:GPR (minus:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -1186,7 +1186,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar and -> or (define_insn "*fuse_and_or" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -1204,7 +1204,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar andc -> or (define_insn "*fuse_andc_or" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -1222,7 +1222,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar eqv -> or (define_insn "*fuse_eqv_or" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -1240,7 +1240,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar nand -> or (define_insn "*fuse_nand_or" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -1258,7 +1258,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar nor -> or (define_insn "*fuse_nor_or" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -1276,7 +1276,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar or -> or (define_insn "*fuse_or_or" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "%r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -1294,7 +1294,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar orc -> or (define_insn "*fuse_orc_or" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -1312,7 +1312,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar xor -> or (define_insn "*fuse_xor_or" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -1330,7 +1330,7 @@ ;; add-logical fusion pattern generated by gen_logical_addsubf ;; scalar add -> or (define_insn "*fuse_add_or" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (plus:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -1348,7 +1348,7 @@ ;; add-logical fusion pattern generated by gen_logical_addsubf ;; scalar subf -> or (define_insn "*fuse_subf_or" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (minus:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -1366,7 +1366,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar and -> orc (define_insn "*fuse_and_orc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -1384,7 +1384,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar andc -> orc (define_insn "*fuse_andc_orc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -1402,7 +1402,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar eqv -> orc (define_insn "*fuse_eqv_orc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -1420,7 +1420,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar nand -> orc (define_insn "*fuse_nand_orc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -1438,7 +1438,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar nor -> orc (define_insn "*fuse_nor_orc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -1456,7 +1456,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar or -> orc (define_insn "*fuse_or_orc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -1474,7 +1474,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar orc -> orc (define_insn "*fuse_orc_orc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -1492,7 +1492,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar xor -> orc (define_insn "*fuse_xor_orc" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (ior:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r")))) @@ -1510,7 +1510,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar and -> xor (define_insn "*fuse_and_xor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (xor:GPR (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -1528,7 +1528,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar andc -> xor (define_insn "*fuse_andc_xor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (xor:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -1546,7 +1546,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar eqv -> xor (define_insn "*fuse_eqv_xor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (xor:GPR (not:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -1564,7 +1564,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar nand -> xor (define_insn "*fuse_nand_xor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (xor:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -1582,7 +1582,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar nor -> xor (define_insn "*fuse_nor_xor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (xor:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -1600,7 +1600,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar or -> xor (define_insn "*fuse_or_xor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (xor:GPR (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -1618,7 +1618,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar orc -> xor (define_insn "*fuse_orc_xor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (xor:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -1636,7 +1636,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; scalar xor -> xor (define_insn "*fuse_xor_xor" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (xor:GPR (xor:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "%r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -1654,7 +1654,7 @@ ;; logical-add fusion pattern generated by gen_logical_addsubf ;; scalar and -> add (define_insn "*fuse_and_add" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (plus:GPR (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -1672,7 +1672,7 @@ ;; logical-add fusion pattern generated by gen_logical_addsubf ;; scalar nand -> add (define_insn "*fuse_nand_add" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (plus:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -1690,7 +1690,7 @@ ;; logical-add fusion pattern generated by gen_logical_addsubf ;; scalar nor -> add (define_insn "*fuse_nor_add" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (plus:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -1708,7 +1708,7 @@ ;; logical-add fusion pattern generated by gen_logical_addsubf ;; scalar or -> add (define_insn "*fuse_or_add" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (plus:GPR (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -1726,7 +1726,7 @@ ;; logical-add fusion pattern generated by gen_logical_addsubf ;; scalar and -> subf (define_insn "*fuse_and_subf" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (minus:GPR (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -1744,7 +1744,7 @@ ;; logical-add fusion pattern generated by gen_logical_addsubf ;; scalar nand -> subf (define_insn "*fuse_nand_subf" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (minus:GPR (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -1762,7 +1762,7 @@ ;; logical-add fusion pattern generated by gen_logical_addsubf ;; scalar nor -> subf (define_insn "*fuse_nor_subf" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (minus:GPR (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -1780,7 +1780,7 @@ ;; logical-add fusion pattern generated by gen_logical_addsubf ;; scalar or -> subf (define_insn "*fuse_or_subf" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (minus:GPR (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")) (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r"))) @@ -1798,7 +1798,7 @@ ;; logical-add fusion pattern generated by gen_logical_addsubf ;; scalar and -> rsubf (define_insn "*fuse_and_rsubf" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (minus:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r") (and:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")))) @@ -1816,7 +1816,7 @@ ;; logical-add fusion pattern generated by gen_logical_addsubf ;; scalar nand -> rsubf (define_insn "*fuse_nand_rsubf" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (minus:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r") (ior:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))))) @@ -1834,7 +1834,7 @@ ;; logical-add fusion pattern generated by gen_logical_addsubf ;; scalar nor -> rsubf (define_insn "*fuse_nor_rsubf" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (minus:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r") (and:GPR (not:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r")) (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r"))))) @@ -1852,7 +1852,7 @@ ;; logical-add fusion pattern generated by gen_logical_addsubf ;; scalar or -> rsubf (define_insn "*fuse_or_rsubf" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (minus:GPR (match_operand:GPR 2 "gpc_reg_operand" "r,r,r,r") (ior:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "r,r,r,r")))) @@ -1870,7 +1870,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vand -> vand (define_insn "*fuse_vand_vand" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (and:VM (and:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "%v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) @@ -1888,7 +1888,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vandc -> vand (define_insn "*fuse_vandc_vand" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (and:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) @@ -1906,7 +1906,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector veqv -> vand (define_insn "*fuse_veqv_vand" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (and:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) @@ -1924,7 +1924,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vnand -> vand (define_insn "*fuse_vnand_vand" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (and:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) @@ -1942,7 +1942,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vnor -> vand (define_insn "*fuse_vnor_vand" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (and:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) @@ -1960,7 +1960,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vor -> vand (define_insn "*fuse_vor_vand" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (and:VM (ior:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) @@ -1978,7 +1978,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vorc -> vand (define_insn "*fuse_vorc_vand" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (and:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) @@ -1996,7 +1996,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vxor -> vand (define_insn "*fuse_vxor_vand" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (and:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) @@ -2014,7 +2014,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vand -> vandc (define_insn "*fuse_vand_vandc" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (and:VM (and:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2032,7 +2032,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vandc -> vandc (define_insn "*fuse_vandc_vandc" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (and:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2050,7 +2050,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector veqv -> vandc (define_insn "*fuse_veqv_vandc" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (and:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2068,7 +2068,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vnand -> vandc (define_insn "*fuse_vnand_vandc" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (and:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2086,7 +2086,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vnor -> vandc (define_insn "*fuse_vnor_vandc" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (and:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2104,7 +2104,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vor -> vandc (define_insn "*fuse_vor_vandc" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (and:VM (ior:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2122,7 +2122,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vorc -> vandc (define_insn "*fuse_vorc_vandc" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (and:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2140,7 +2140,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vxor -> vandc (define_insn "*fuse_vxor_vandc" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (and:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2158,7 +2158,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vand -> veqv (define_insn "*fuse_vand_veqv" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (not:VM (xor:VM (and:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2176,7 +2176,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vandc -> veqv (define_insn "*fuse_vandc_veqv" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (not:VM (xor:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2194,7 +2194,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector veqv -> veqv (define_insn "*fuse_veqv_veqv" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (not:VM (xor:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "%v,v,v,v"))) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2212,7 +2212,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vnand -> veqv (define_insn "*fuse_vnand_veqv" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (not:VM (xor:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2230,7 +2230,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vnor -> veqv (define_insn "*fuse_vnor_veqv" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (not:VM (xor:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2248,7 +2248,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vor -> veqv (define_insn "*fuse_vor_veqv" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (not:VM (xor:VM (ior:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2266,7 +2266,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vorc -> veqv (define_insn "*fuse_vorc_veqv" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (not:VM (xor:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2284,7 +2284,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vxor -> veqv (define_insn "*fuse_vxor_veqv" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (not:VM (xor:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2302,7 +2302,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vand -> vnand (define_insn "*fuse_vand_vnand" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (ior:VM (not:VM (and:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2320,7 +2320,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vandc -> vnand (define_insn "*fuse_vandc_vnand" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (ior:VM (not:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2338,7 +2338,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector veqv -> vnand (define_insn "*fuse_veqv_vnand" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (ior:VM (not:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2356,7 +2356,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vnand -> vnand (define_insn "*fuse_vnand_vnand" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (ior:VM (not:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2374,7 +2374,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vnor -> vnand (define_insn "*fuse_vnor_vnand" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (ior:VM (not:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2392,7 +2392,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vor -> vnand (define_insn "*fuse_vor_vnand" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (ior:VM (not:VM (ior:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2410,7 +2410,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vorc -> vnand (define_insn "*fuse_vorc_vnand" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (ior:VM (not:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2428,7 +2428,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vxor -> vnand (define_insn "*fuse_vxor_vnand" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (ior:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2446,7 +2446,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vand -> vnor (define_insn "*fuse_vand_vnor" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (and:VM (not:VM (and:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2464,7 +2464,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vandc -> vnor (define_insn "*fuse_vandc_vnor" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (and:VM (not:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2482,7 +2482,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector veqv -> vnor (define_insn "*fuse_veqv_vnor" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (and:VM (not:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2500,7 +2500,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vnand -> vnor (define_insn "*fuse_vnand_vnor" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (and:VM (not:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2518,7 +2518,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vnor -> vnor (define_insn "*fuse_vnor_vnor" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (and:VM (not:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2536,7 +2536,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vor -> vnor (define_insn "*fuse_vor_vnor" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (and:VM (not:VM (ior:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2554,7 +2554,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vorc -> vnor (define_insn "*fuse_vorc_vnor" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (and:VM (not:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2572,7 +2572,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vxor -> vnor (define_insn "*fuse_vxor_vnor" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (and:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2590,7 +2590,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vand -> vor (define_insn "*fuse_vand_vor" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (ior:VM (and:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) @@ -2608,7 +2608,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vandc -> vor (define_insn "*fuse_vandc_vor" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (ior:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) @@ -2626,7 +2626,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector veqv -> vor (define_insn "*fuse_veqv_vor" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (ior:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) @@ -2644,7 +2644,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vnand -> vor (define_insn "*fuse_vnand_vor" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (ior:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) @@ -2662,7 +2662,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vnor -> vor (define_insn "*fuse_vnor_vor" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (ior:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) @@ -2680,7 +2680,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vor -> vor (define_insn "*fuse_vor_vor" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (ior:VM (ior:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "%v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) @@ -2698,7 +2698,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vorc -> vor (define_insn "*fuse_vorc_vor" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (ior:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) @@ -2716,7 +2716,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vxor -> vor (define_insn "*fuse_vxor_vor" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (ior:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) @@ -2734,7 +2734,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vand -> vorc (define_insn "*fuse_vand_vorc" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (ior:VM (and:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2752,7 +2752,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vandc -> vorc (define_insn "*fuse_vandc_vorc" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (ior:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2770,7 +2770,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector veqv -> vorc (define_insn "*fuse_veqv_vorc" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (ior:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2788,7 +2788,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vnand -> vorc (define_insn "*fuse_vnand_vorc" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (ior:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2806,7 +2806,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vnor -> vorc (define_insn "*fuse_vnor_vorc" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (ior:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2824,7 +2824,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vor -> vorc (define_insn "*fuse_vor_vorc" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (ior:VM (ior:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2842,7 +2842,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vorc -> vorc (define_insn "*fuse_vorc_vorc" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (ior:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2860,7 +2860,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vxor -> vorc (define_insn "*fuse_vxor_vorc" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (ior:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 2 "altivec_register_operand" "v,v,v,v")))) @@ -2878,7 +2878,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vand -> vxor (define_insn "*fuse_vand_vxor" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (xor:VM (and:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) @@ -2896,7 +2896,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vandc -> vxor (define_insn "*fuse_vandc_vxor" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (xor:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) @@ -2914,7 +2914,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector veqv -> vxor (define_insn "*fuse_veqv_vxor" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (xor:VM (not:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) @@ -2932,7 +2932,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vnand -> vxor (define_insn "*fuse_vnand_vxor" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (xor:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) @@ -2950,7 +2950,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vnor -> vxor (define_insn "*fuse_vnor_vxor" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (xor:VM (and:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (not:VM (match_operand:VM 1 "altivec_register_operand" "v,v,v,v"))) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) @@ -2968,7 +2968,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vor -> vxor (define_insn "*fuse_vor_vxor" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (xor:VM (ior:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) @@ -2986,7 +2986,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vorc -> vxor (define_insn "*fuse_vorc_vxor" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (xor:VM (ior:VM (not:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 1 "altivec_register_operand" "v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) @@ -3004,7 +3004,7 @@ ;; logical-logical fusion pattern generated by gen_logical_addsubf ;; vector vxor -> vxor (define_insn "*fuse_vxor_vxor" - [(set (match_operand:VM 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:VM 3 "altivec_register_operand" "=&0,&1,&v,v") (xor:VM (xor:VM (match_operand:VM 0 "altivec_register_operand" "v,v,v,v") (match_operand:VM 1 "altivec_register_operand" "%v,v,v,v")) (match_operand:VM 2 "altivec_register_operand" "v,v,v,v"))) @@ -3021,7 +3021,7 @@ ;; add-add fusion pattern generated by gen_addadd (define_insn "*fuse_add_add" - [(set (match_operand:GPR 3 "gpc_reg_operand" "=0,1,&r,r") + [(set (match_operand:GPR 3 "gpc_reg_operand" "=&0,&1,&r,r") (plus:GPR (plus:GPR (match_operand:GPR 0 "gpc_reg_operand" "r,r,r,r") (match_operand:GPR 1 "gpc_reg_operand" "%r,r,r,r")) @@ -3039,7 +3039,7 @@ ;; vaddudm-vaddudm fusion pattern generated by gen_addadd (define_insn "*fuse_vaddudm_vaddudm" - [(set (match_operand:V2DI 3 "altivec_register_operand" "=0,1,&v,v") + [(set (match_operand:V2DI 3 "altivec_register_operand" "=&0,&1,&v,v") (plus:V2DI (plus:V2DI (match_operand:V2DI 0 "altivec_register_operand" "v,v,v,v") (match_operand:V2DI 1 "altivec_register_operand" "%v,v,v,v")) diff --git a/gcc/config/rs6000/genfusion.pl b/gcc/config/rs6000/genfusion.pl index 577b955..ac22852 100755 --- a/gcc/config/rs6000/genfusion.pl +++ b/gcc/config/rs6000/genfusion.pl @@ -263,7 +263,7 @@ sub gen_logical_addsubf ;; $ftype fusion pattern generated by gen_logical_addsubf ;; $kind $inner_op -> $outer_name (define_insn "*fuse_${inner_op}_${outer_name}" - [(set (match_operand:${mode} 3 "${pred}" "=0,1,&${constraint},${constraint}") + [(set (match_operand:${mode} 3 "${pred}" "=&0,&1,&${constraint},${constraint}") ${outer_exp}) (clobber (match_scratch:${mode} 4 "=X,X,X,&r"))] "(TARGET_P10_FUSION && $target_flag)" @@ -307,7 +307,7 @@ sub gen_addadd ;; ${op}-${op} fusion pattern generated by gen_addadd (define_insn "*fuse_${op}_${op}" - [(set (match_operand:${mode} 3 "${pred}" "=0,1,&${constraint},${constraint}") + [(set (match_operand:${mode} 3 "${pred}" "=&0,&1,&${constraint},${constraint}") (plus:${mode} (plus:${mode} (match_operand:${mode} 0 "${pred}" "${c4}") (match_operand:${mode} 1 "${pred}" "%${c4}")) diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 38f9281..2c249e1 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -16103,7 +16103,8 @@ rs6000_emit_minmax (rtx dest, enum rtx_code code, rtx op0, rtx op1) /* VSX/altivec have direct min/max insns. */ if ((code == SMAX || code == SMIN) && (VECTOR_UNIT_ALTIVEC_OR_VSX_P (mode) - || (mode == SFmode && VECTOR_UNIT_VSX_P (DFmode)))) + || (mode == SFmode && VECTOR_UNIT_VSX_P (DFmode)) + || (TARGET_POWER10 && TARGET_FLOAT128_HW && FLOAT128_IEEE_P (mode)))) { emit_insn (gen_rtx_SET (dest, gen_rtx_fmt_ee (code, mode, op0, op1))); return; diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 510dbff..abd825f 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -5214,6 +5214,17 @@ } [(set_attr "type" "fp")]) +;; Min/max for ISA 3.1 IEEE 128-bit floating point +(define_insn "s<minmax><mode>3" + [(set (match_operand:IEEE128 0 "altivec_register_operand" "=v") + (fp_minmax:IEEE128 + (match_operand:IEEE128 1 "altivec_register_operand" "v") + (match_operand:IEEE128 2 "altivec_register_operand" "v")))] + "TARGET_POWER10 && TARGET_FLOAT128_HW" + "xs<minmax>cqp %0,%1,%2" + [(set_attr "type" "vecfloat") + (set_attr "size" "128")]) + ;; The conditional move instructions allow us to perform max and min operations ;; even when we don't have the appropriate max/min instruction using the FSEL ;; instruction. diff --git a/gcc/configure b/gcc/configure index 4a9e4fa..dd0194a 100755 --- a/gcc/configure +++ b/gcc/configure @@ -28909,6 +28909,33 @@ case "$target" in ;; esac +# This tests if the assembler supports two registers for global_load functions +# (like in LLVM versions <12) or one register (like in LLVM 12). +case "$target" in + amdgcn-* | gcn-*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler fix for global_load functions" >&5 +$as_echo_n "checking assembler fix for global_load functions... " >&6; } + gcc_cv_as_gcn_global_load_fixed=yes + if test x$gcc_cv_as != x; then + cat > conftest.s <<EOF + global_store_dwordx2 v[1:2], v[4:5], s[14:15] +EOF + if $gcc_cv_as -triple=amdgcn--amdhsa -filetype=obj -mcpu=gfx900 -o conftest.o conftest.s > /dev/null 2>&1; then + gcc_cv_as_gcn_global_load_fixed=no + fi + rm -f conftest.s conftest.o conftest + fi + global_load_fixed=`if test x$gcc_cv_as_gcn_global_load_fixed = xyes; then echo 1; else echo 0; fi` + +cat >>confdefs.h <<_ACEOF +#define HAVE_GCN_ASM_GLOBAL_LOAD_FIXED $global_load_fixed +_ACEOF + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_gcn_global_load_fixed" >&5 +$as_echo "$gcc_cv_as_gcn_global_load_fixed" >&6; } + ;; +esac + # ??? Not all targets support dwarf2 debug_line, even within a version # of gas. Moreover, we need to emit a valid instruction to trigger any # info to the output file. So, as supported targets are added to gas 2.11, diff --git a/gcc/configure.ac b/gcc/configure.ac index d9fc3c2..5f30f80 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -5357,6 +5357,28 @@ case "$target" in ;; esac +# This tests if the assembler supports two registers for global_load functions +# (like in LLVM versions <12) or one register (like in LLVM 12). +case "$target" in + amdgcn-* | gcn-*) + AC_MSG_CHECKING(assembler fix for global_load functions) + gcc_cv_as_gcn_global_load_fixed=yes + if test x$gcc_cv_as != x; then + cat > conftest.s <<EOF + global_store_dwordx2 v[[1:2]], v[[4:5]], s[[14:15]] +EOF + if $gcc_cv_as -triple=amdgcn--amdhsa -filetype=obj -mcpu=gfx900 -o conftest.o conftest.s > /dev/null 2>&1; then + gcc_cv_as_gcn_global_load_fixed=no + fi + rm -f conftest.s conftest.o conftest + fi + global_load_fixed=`if test x$gcc_cv_as_gcn_global_load_fixed = xyes; then echo 1; else echo 0; fi` + AC_DEFINE_UNQUOTED(HAVE_GCN_ASM_GLOBAL_LOAD_FIXED, $global_load_fixed, + [Define if your assembler has fixed global_load functions.]) + AC_MSG_RESULT($gcc_cv_as_gcn_global_load_fixed) + ;; +esac + # ??? Not all targets support dwarf2 debug_line, even within a version # of gas. Moreover, we need to emit a valid instruction to trigger any # info to the output file. So, as supported targets are added to gas 2.11, diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8d14d38..5142210 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,14 @@ +2021-06-17 Jason Merrill <jason@redhat.com> + + PR c++/101106 + * decl.c (duplicate_decls): Make 'deleted after first declaration' + pedwarn on by default. + +2021-06-17 Jason Merrill <jason@redhat.com> + + PR c++/101029 + * init.c (build_vec_init): Preserve the type of base. + 2021-06-16 Jason Merrill <jason@redhat.com> PR c++/101078 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 02772e9..66bcc4b 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -2170,11 +2170,10 @@ duplicate_decls (tree newdecl, tree olddecl, bool hiding, bool was_hidden) if (DECL_DELETED_FN (newdecl)) { auto_diagnostic_group d; - pedwarn (newdecl_loc, OPT_Wpedantic, - "deleted definition of %qD is not first declaration", - newdecl); - inform (olddecl_loc, - "previous declaration of %qD", olddecl); + if (pedwarn (newdecl_loc, 0, "deleted definition of %qD " + "is not first declaration", newdecl)) + inform (olddecl_loc, + "previous declaration of %qD", olddecl); } DECL_DELETED_FN (newdecl) |= DECL_DELETED_FN (olddecl); } diff --git a/gcc/defaults.h b/gcc/defaults.h index 9121659..ba79a8e 100644 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -801,15 +801,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define NEXT_OBJC_RUNTIME 0 #endif -/* Supply a default definition for PUSH_ARGS. */ -#ifndef PUSH_ARGS -#ifdef PUSH_ROUNDING -#define PUSH_ARGS !ACCUMULATE_OUTGOING_ARGS -#else -#define PUSH_ARGS 0 -#endif -#endif - /* Decide whether a function's arguments should be processed from first to last or from last to first. @@ -820,7 +811,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #ifndef PUSH_ARGS_REVERSED #if defined (STACK_GROWS_DOWNWARD) != defined (ARGS_GROW_DOWNWARD) -#define PUSH_ARGS_REVERSED PUSH_ARGS +#define PUSH_ARGS_REVERSED targetm.calls.push_argument (0) #endif #endif diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index fc7eb77..2a41ae5 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -3900,14 +3900,17 @@ cases of mismatch, it also makes for better code on certain machines. The default is to not promote prototypes. @end deftypefn -@defmac PUSH_ARGS -A C expression. If nonzero, push insns will be used to pass -outgoing arguments. -If the target machine does not have a push instruction, set it to zero. -That directs GCC to use an alternate strategy: to -allocate the entire argument block and then store the arguments into -it. When @code{PUSH_ARGS} is nonzero, @code{PUSH_ROUNDING} must be defined too. -@end defmac +@deftypefn {Target Hook} bool TARGET_PUSH_ARGUMENT (unsigned int @var{npush}) +This target hook returns @code{true} if push instructions will be +used to pass outgoing arguments. When the push instruction usage is +optional, @var{npush} is nonzero to indicate the number of bytes to +push. Otherwise, @var{npush} is zero. If the target machine does not +have a push instruction or push instruction should be avoided, +@code{false} should be returned. That directs GCC to use an alternate +strategy: to allocate the entire argument block and then store the +arguments into it. If this target hook may return @code{true}, +@code{PUSH_ROUNDING} must be defined. +@end deftypefn @defmac PUSH_ARGS_REVERSED A C expression. If nonzero, function arguments will be evaluated from diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index 33532f0..f881cda 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -3100,14 +3100,7 @@ control passing certain arguments in registers. @hook TARGET_PROMOTE_PROTOTYPES -@defmac PUSH_ARGS -A C expression. If nonzero, push insns will be used to pass -outgoing arguments. -If the target machine does not have a push instruction, set it to zero. -That directs GCC to use an alternate strategy: to -allocate the entire argument block and then store the arguments into -it. When @code{PUSH_ARGS} is nonzero, @code{PUSH_ROUNDING} must be defined too. -@end defmac +@hook TARGET_PUSH_ARGUMENT @defmac PUSH_ARGS_REVERSED A C expression. If nonzero, function arguments will be evaluated from @@ -1823,7 +1823,7 @@ block_move_libcall_safe_for_call_parm (void) tree fn; /* If arguments are pushed on the stack, then they're safe. */ - if (PUSH_ARGS) + if (targetm.calls.push_argument (0)) return true; /* If registers go on the stack anyway, any argument is sure to clobber @@ -4639,11 +4639,19 @@ emit_push_insn (rtx x, machine_mode mode, tree type, rtx size, skip = (reg_parm_stack_space == 0) ? 0 : used; #ifdef PUSH_ROUNDING + /* NB: Let the backend known the number of bytes to push and + decide if push insns should be generated. */ + unsigned int push_size; + if (CONST_INT_P (size)) + push_size = INTVAL (size); + else + push_size = 0; + /* Do it with several push insns if that doesn't take lots of insns and if there is no difficulty with push insns that skip bytes on the stack for alignment purposes. */ if (args_addr == 0 - && PUSH_ARGS + && targetm.calls.push_argument (push_size) && CONST_INT_P (size) && skip == 0 && MEM_ALIGN (xinner) >= align @@ -4848,7 +4856,7 @@ emit_push_insn (rtx x, machine_mode mode, tree type, rtx size, anti_adjust_stack (gen_int_mode (extra, Pmode)); #ifdef PUSH_ROUNDING - if (args_addr == 0 && PUSH_ARGS) + if (args_addr == 0 && targetm.calls.push_argument (0)) emit_single_push_insn (mode, x, type); else #endif diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index f073f34..e57f613 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2021-06-18 Harald Anlauf <anlauf@gmx.de> + + PR fortran/100283 + PR fortran/101123 + * trans-intrinsic.c (gfc_conv_intrinsic_minmax): Unconditionally + convert result of min/max to result type. + 2021-06-16 Harald Anlauf <anlauf@gmx.de> PR fortran/95501 diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c index 73b0bcc..e578449 100644 --- a/gcc/fortran/trans-intrinsic.c +++ b/gcc/fortran/trans-intrinsic.c @@ -4147,10 +4147,7 @@ gfc_conv_intrinsic_minmax (gfc_se * se, gfc_expr * expr, enum tree_code op) build_empty_stmt (input_location)); gfc_add_expr_to_block (&se->pre, tmp); } - if (TREE_CODE (type) == INTEGER_TYPE) - se->expr = fold_build1_loc (input_location, FIX_TRUNC_EXPR, type, mvar); - else - se->expr = convert (type, mvar); + se->expr = convert (type, mvar); } diff --git a/gcc/gimple-range-cache.cc b/gcc/gimple-range-cache.cc index cc2b709..def604dc 100644 --- a/gcc/gimple-range-cache.cc +++ b/gcc/gimple-range-cache.cc @@ -385,7 +385,7 @@ block_range_cache::~block_range_cache () } // Set the range for NAME on entry to block BB to R. -// If it has not been // accessed yet, allocate it first. +// If it has not been accessed yet, allocate it first. void block_range_cache::set_bb_range (tree name, const basic_block bb, @@ -706,16 +706,13 @@ temporal_cache::set_always_current (tree name) // -------------------------------------------------------------------------- -ranger_cache::ranger_cache (gimple_ranger &q) : query (q) +ranger_cache::ranger_cache () { m_workback.create (0); m_workback.safe_grow_cleared (last_basic_block_for_fn (cfun)); m_update_list.create (0); m_update_list.safe_grow_cleared (last_basic_block_for_fn (cfun)); m_update_list.truncate (0); - m_poor_value_list.create (0); - m_poor_value_list.safe_grow_cleared (20); - m_poor_value_list.truncate (0); m_temporal = new temporal_cache; unsigned x, lim = last_basic_block_for_fn (cfun); // Calculate outgoing range info upfront. This will fully populate the @@ -727,13 +724,11 @@ ranger_cache::ranger_cache (gimple_ranger &q) : query (q) if (bb) m_gori.exports (bb); } - m_new_value_p = true; } ranger_cache::~ranger_cache () { delete m_temporal; - m_poor_value_list.release (); m_workback.release (); m_update_list.release (); } @@ -748,17 +743,6 @@ ranger_cache::dump (FILE *f) fprintf (f, "\n"); } -// Allow or disallow the cache to flag and query new values when propagation -// is forced to use an unknown value. The previous state is returned. - -bool -ranger_cache::enable_new_values (bool state) -{ - bool ret = m_new_value_p; - m_new_value_p = state; - return ret; -} - // Dump the caches for basic block BB to file F. void @@ -836,67 +820,36 @@ ranger_cache::set_global_range (tree name, const irange &r) m_temporal->set_timestamp (name); } -// Push a request for a new lookup in block BB of name. Return true if -// the request is actually made (ie, isn't a duplicate). - -bool -ranger_cache::push_poor_value (basic_block bb, tree name) -{ - if (!m_new_value_p) - return false; - if (m_poor_value_list.length ()) - { - // Don't push anything else to the same block. If there are multiple - // things required, another request will come during a later evaluation - // and this prevents oscillation building uneccessary depth. - if ((m_poor_value_list.last ()).bb == bb) - return false; - } - - struct update_record rec; - rec.bb = bb; - rec.calc = name; - m_poor_value_list.safe_push (rec); - return true; -} - // Provide lookup for the gori-computes class to access the best known range // of an ssa_name in any given basic block. Note, this does no additonal // lookups, just accesses the data that is already known. -// Get the range of NAME when the def occurs in block BB +// Get the range of NAME when the def occurs in block BB. If BB is NULL +// get the best global value available. void ranger_cache::range_of_def (irange &r, tree name, basic_block bb) { gcc_checking_assert (gimple_range_ssa_p (name)); - gcc_checking_assert (bb == gimple_bb (SSA_NAME_DEF_STMT (name))); + gcc_checking_assert (!bb || bb == gimple_bb (SSA_NAME_DEF_STMT (name))); + // Pick up the best global range available. if (!m_globals.get_global_range (r, name)) { - // If it doesn't have a value calculated, it means it's a - // "poor" value being used in some calculation. Queue it up - // as a poor value to be improved later. - r = gimple_range_global (name); - if (push_poor_value (bb, name)) - { - if (DEBUG_RANGE_CACHE) - { - fprintf (dump_file, - "*CACHE* no global def in bb %d for ", bb->index); - print_generic_expr (dump_file, name, TDF_SLIM); - fprintf (dump_file, " depth : %d\n", - m_poor_value_list.length ()); - } - } + // If that fails, try to calculate the range using just global values. + gimple *s = SSA_NAME_DEF_STMT (name); + if (gimple_get_lhs (s) == name) + fold_range (r, s, get_global_range_query ()); + else + r = gimple_range_global (name); } - if (r.varying_p () && m_non_null.non_null_deref_p (name, bb, false) && + + if (bb && r.varying_p () && m_non_null.non_null_deref_p (name, bb, false) && !cfun->can_throw_non_call_exceptions) r = range_nonzero (TREE_TYPE (name)); } -// Get the range of NAME as it occurs on entry to block BB. If it is not set, -// mark it as a poor value for possible later improvement. +// Get the range of NAME as it occurs on entry to block BB. void ranger_cache::entry_range (irange &r, tree name, basic_block bb) @@ -908,25 +861,10 @@ ranger_cache::entry_range (irange &r, tree name, basic_block bb) } // Look for the on-entry value of name in BB from the cache. + // Otherwise pick up the best available global value. if (!m_on_entry.get_bb_range (r, name, bb)) - { - // If it has no entry but should, then mark this as a poor value. - // Its not a poor value if it does not have *any* edge ranges, - // Then global range is as good as it gets. - if (m_gori.has_edge_range_p (name) && push_poor_value (bb, name)) - { - if (DEBUG_RANGE_CACHE) - { - fprintf (dump_file, - "*CACHE* no on entry range in bb %d for ", bb->index); - print_generic_expr (dump_file, name, TDF_SLIM); - fprintf (dump_file, " depth : %d\n", m_poor_value_list.length ()); - } - } - // Try to pick up any known global value as a best guess for now. - if (!m_globals.get_global_range (r, name)) - r = gimple_range_global (name); - } + range_of_def (r, name); + // Check if pointers have any non-null dereferences. Non-call // exceptions mean we could throw in the middle of the block, so just // punt for now on those. @@ -1195,7 +1133,6 @@ ranger_cache::fill_block_cache (tree name, basic_block bb, basic_block def_bb) edge e; int_range_max block_result; int_range_max undefined; - unsigned poor_list_start = m_poor_value_list.length (); // At this point we shouldn't be looking at the def, entry or exit block. gcc_checking_assert (bb != def_bb && bb != ENTRY_BLOCK_PTR_FOR_FN (cfun) && @@ -1301,49 +1238,5 @@ ranger_cache::fill_block_cache (tree name, basic_block bb, basic_block def_bb) propagate_cache (name); if (DEBUG_RANGE_CACHE) fprintf (dump_file, " Propagation update done.\n"); - - // Now that the cache has been updated, check to see if there were any - // SSA_NAMES used in filling the cache which were "poor values". - // Evaluate them, and inject any new values into the propagation - // list, and see if it improves any on-entry values. - if (poor_list_start != m_poor_value_list.length ()) - { - gcc_checking_assert (poor_list_start < m_poor_value_list.length ()); - while (poor_list_start < m_poor_value_list.length ()) - { - // Find a range for this unresolved value. - // Note, this may spawn new cache filling cycles, but by the time it - // is finished, the work vectors will all be back to the same state - // as before the call. The update record vector will always be - // returned to the current state upon return. - struct update_record rec = m_poor_value_list.pop (); - basic_block calc_bb = rec.bb; - int_range_max tmp; - - if (DEBUG_RANGE_CACHE) - { - fprintf (dump_file, "(%d:%d)Calculating ", - m_poor_value_list.length () + 1, poor_list_start); - print_generic_expr (dump_file, name, TDF_SLIM); - fprintf (dump_file, " used POOR VALUE for "); - print_generic_expr (dump_file, rec.calc, TDF_SLIM); - fprintf (dump_file, " in bb%d, trying to improve:\n", - calc_bb->index); - } - - // Calculate a range at the exit from the block so the caches feeding - // this block will be filled, and we'll get a "better" value. - // Disallow additonal "poor values" during this phase to avoid - // iterations that are unlikely to be profitable for this name. - // See PR 101014. - bool state = enable_new_values (false); - query.range_on_exit (tmp, calc_bb, rec.calc); - enable_new_values (state); - - // Then ask for NAME to be re-evaluated on outgoing edges and - // use any new values. - propagate_updated_value (name, calc_bb); - } - } } diff --git a/gcc/gimple-range-cache.h b/gcc/gimple-range-cache.h index 1a2aace..04150ea 100644 --- a/gcc/gimple-range-cache.h +++ b/gcc/gimple-range-cache.h @@ -90,7 +90,7 @@ private: class ranger_cache : public range_query { public: - ranger_cache (class gimple_ranger &q); + ranger_cache (); ~ranger_cache (); virtual bool range_of_expr (irange &r, tree name, gimple *stmt); @@ -115,7 +115,7 @@ private: void fill_block_cache (tree name, basic_block bb, basic_block def_bb); void propagate_cache (tree name); - void range_of_def (irange &r, tree name, basic_block bb); + void range_of_def (irange &r, tree name, basic_block bb = NULL); void entry_range (irange &r, tree expr, basic_block bb); void exit_range (irange &r, tree expr, basic_block bb); @@ -123,17 +123,6 @@ private: vec<basic_block> m_workback; vec<basic_block> m_update_list; - - // Iterative "poor value" calculations. - struct update_record - { - basic_block bb; // Block which value needs to be calculated in. - tree calc; // SSA_NAME which needs its value calculated. - }; - bool push_poor_value (basic_block bb, tree name); - vec<update_record> m_poor_value_list; - class gimple_ranger &query; - bool m_new_value_p; }; #endif // GCC_SSA_RANGE_CACHE_H diff --git a/gcc/gimple-range-gori.cc b/gcc/gimple-range-gori.cc index 647f496..b58f249 100644 --- a/gcc/gimple-range-gori.cc +++ b/gcc/gimple-range-gori.cc @@ -1065,7 +1065,7 @@ gori_compute::outgoing_edge_range_p (irange &r, edge e, tree name, e->src->index, e->dest->index); print_generic_expr (dump_file, name, TDF_SLIM); } - // Simply calculate DEF_STMT on edge E usng the range query Q. + // Simply calculate DEF_STMT on edge E using the range query Q. fold_range (r, def_stmt, e, &q); if (dump_file && (dump_flags & TDF_DETAILS)) { diff --git a/gcc/gimple-range.cc b/gcc/gimple-range.cc index 5810970..0a2c72b 100644 --- a/gcc/gimple-range.cc +++ b/gcc/gimple-range.cc @@ -135,20 +135,18 @@ fur_edge::query () return m_query; } - // Instantiate a stmt based fur_source. - fur_stmt::fur_stmt (gimple *s, range_query *q) { - m_stmt= s; + m_stmt = s; if (q) m_query = q; else m_query = get_global_range_query (); } -// Retirenve range of EXPR as it occurs as a use on stmt M_STMT. +// Retrieve range of EXPR as it occurs as a use on stmt M_STMT. bool fur_stmt::get_operand (irange &r, tree expr) @@ -175,8 +173,8 @@ fur_stmt::query () return m_query; } -// This version of fur_source will pick a range from a stmt, and register -// also dependencies via a gori_compute object. This is mostly an internal API. +// This version of fur_source will pick a range from a stmt, and also register +// dependencies via a gori_compute object. This is mostly an internal API. class fur_depend : public fur_stmt { @@ -187,16 +185,16 @@ private: gori_compute *m_gori; }; -// Instantiate a stmt based fur_source witrh a GORI object +// Instantiate a stmt based fur_source with a GORI object + inline fur_depend::fur_depend (gimple *s, gori_compute *gori, range_query *q) - : fur_stmt (s, q) + : fur_stmt (s, q) { gcc_checking_assert (gori); m_gori = gori; } - // find and add any dependnecy between LHS and RHS void @@ -205,7 +203,6 @@ fur_depend::register_dependency (tree lhs, tree rhs) m_gori->register_dependency (lhs, rhs); } - // This version of fur_source will pick a range up from a list of ranges // supplied by the caller. @@ -254,7 +251,7 @@ fur_list::fur_list (unsigned num, irange *list) m_limit = num; } -// Get the next operand from the vector, ensure types are compatible, +// Get the next operand from the vector, ensure types are compatible. bool fur_list::get_operand (irange &r, tree expr) @@ -305,7 +302,6 @@ fold_range (irange &r, gimple *s, unsigned num_elements, irange *vector) return f.fold_stmt (r, s, src); } - // Fold stmt S into range R using range query Q. bool @@ -960,32 +956,29 @@ fold_using_range::range_of_builtin_call (irange &r, gcall *call, src.get_operand (r, arg); // From clz of minimum we can compute result maximum. - if (r.constant_p () && !r.varying_p ()) + if (!r.undefined_p ()) { - int newmaxi = prec - 1 - wi::floor_log2 (r.lower_bound ()); - // Argument is unsigned, so do nothing if it is [0, ...] range. - if (newmaxi != prec) + // From clz of minimum we can compute result maximum. + if (wi::gt_p (r.lower_bound (), 0, TYPE_SIGN (r.type ()))) + { + maxi = prec - 1 - wi::floor_log2 (r.lower_bound ()); + if (mini == -2) + mini = 0; + } + else if (!range_includes_zero_p (&r)) { mini = 0; - maxi = newmaxi; + maxi = prec - 1; } - } - else if (!range_includes_zero_p (&r)) - { - maxi = prec - 1; - mini = 0; - } - if (mini == -2) - break; - // From clz of maximum we can compute result minimum. - if (r.constant_p ()) - { - int newmini = prec - 1 - wi::floor_log2 (r.upper_bound ()); - if (newmini == prec) + if (mini == -2) + break; + // From clz of maximum we can compute result minimum. + wide_int max = r.upper_bound (); + int newmini = prec - 1 - wi::floor_log2 (max); + if (max == 0) { - // Argument range is [0, 0]. If CLZ_DEFINED_VALUE_AT_ZERO - // is 2 with VALUE of prec, return [prec, prec], otherwise - // ignore the range. + // If CLZ_DEFINED_VALUE_AT_ZERO is 2 with VALUE of prec, + // return [prec, prec], otherwise ignore the range. if (maxi == prec) mini = prec; } @@ -1026,7 +1019,8 @@ fold_using_range::range_of_builtin_call (irange &r, gcall *call, src.get_operand (r, arg); if (!r.undefined_p ()) { - if (r.lower_bound () != 0) + // If arg is non-zero, then use [0, prec - 1]. + if (!range_includes_zero_p (&r)) { mini = 0; maxi = prec - 1; @@ -1173,9 +1167,7 @@ gimple_ranger::range_of_expr (irange &r, tree expr, gimple *stmt) // trigger new value calculations. PR 100781. if (is_gimple_debug (stmt)) { - bool state = m_cache.enable_new_values (false); m_cache.range_of_expr (r, expr, stmt); - m_cache.enable_new_values (state); return true; } basic_block bb = gimple_bb (stmt); diff --git a/gcc/gimple-range.h b/gcc/gimple-range.h index 9ac779a..fc28123 100644 --- a/gcc/gimple-range.h +++ b/gcc/gimple-range.h @@ -58,7 +58,6 @@ along with GCC; see the file COPYING3. If not see class gimple_ranger : public range_query { public: - gimple_ranger () : m_cache (*this) { } virtual bool range_of_stmt (irange &r, gimple *, tree name = NULL) OVERRIDE; virtual bool range_of_expr (irange &r, tree name, gimple * = NULL) OVERRIDE; virtual bool range_on_edge (irange &r, edge e, tree name) OVERRIDE; diff --git a/gcc/hooks.c b/gcc/hooks.c index 680271f..4f14abf 100644 --- a/gcc/hooks.c +++ b/gcc/hooks.c @@ -520,6 +520,14 @@ hook_void_gcc_optionsp (struct gcc_options *) { } +/* Generic hook that takes an unsigned int and returns true. */ + +bool +hook_bool_uint_true (unsigned int) +{ + return true; +} + /* Generic hook that takes an unsigned int, an unsigned int pointer and returns false. */ diff --git a/gcc/hooks.h b/gcc/hooks.h index add9a74..71781c7 100644 --- a/gcc/hooks.h +++ b/gcc/hooks.h @@ -89,6 +89,7 @@ extern void hook_void_tree (tree); extern void hook_void_tree_treeptr (tree, tree *); extern void hook_void_int_int (int, int); extern void hook_void_gcc_optionsp (struct gcc_options *); +extern bool hook_bool_uint_true (unsigned int); extern bool hook_bool_uint_uintp_false (unsigned int, unsigned int *); extern int hook_int_uint_mode_1 (unsigned int, machine_mode); diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index 712c2c28..55c338e 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -4870,7 +4870,7 @@ nonzero_bits1 (const_rtx x, scalar_int_mode mode, const_rtx known_x, /* If PUSH_ROUNDING is defined, it is possible for the stack to be momentarily aligned only to that amount, so we pick the least alignment. */ - if (x == stack_pointer_rtx && PUSH_ARGS) + if (x == stack_pointer_rtx && targetm.calls.push_argument (0)) { poly_uint64 rounded_1 = PUSH_ROUNDING (poly_int64 (1)); alignment = MIN (known_alignment (rounded_1), alignment); diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 4e3a41b..9f850c3 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -2172,6 +2172,9 @@ finish_bitfield_layout (tree t) tree field, prev; tree repr = NULL_TREE; + if (TREE_CODE (t) == QUAL_UNION_TYPE) + return; + for (prev = NULL_TREE, field = TYPE_FIELDS (t); field; field = DECL_CHAIN (field)) { diff --git a/gcc/target.def b/gcc/target.def index ebe5803..c009671 100644 --- a/gcc/target.def +++ b/gcc/target.def @@ -4753,6 +4753,20 @@ Most ports do not need to implement anything for this hook.", hook_void_void) DEFHOOK +(push_argument, + "This target hook returns @code{true} if push instructions will be\n\ +used to pass outgoing arguments. When the push instruction usage is\n\ +optional, @var{npush} is nonzero to indicate the number of bytes to\n\ +push. Otherwise, @var{npush} is zero. If the target machine does not\n\ +have a push instruction or push instruction should be avoided,\n\ +@code{false} should be returned. That directs GCC to use an alternate\n\ +strategy: to allocate the entire argument block and then store the\n\ +arguments into it. If this target hook may return @code{true},\n\ +@code{PUSH_ROUNDING} must be defined.", + bool, (unsigned int npush), + default_push_argument) + +DEFHOOK (strict_argument_naming, "Define this hook to return @code{true} if the location where a function\n\ argument is passed depends on whether or not it is a named argument.\n\ diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 08f676b..44a1fac 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -770,6 +770,18 @@ hook_void_CUMULATIVE_ARGS_tree (cumulative_args_t ca ATTRIBUTE_UNUSED, { } +/* Default implementation of TARGET_PUSH_ARGUMENT. */ + +bool +default_push_argument (unsigned int) +{ +#ifdef PUSH_ROUNDING + return !ACCUMULATE_OUTGOING_ARGS; +#else + return false; +#endif +} + void default_function_arg_advance (cumulative_args_t, const function_arg_info &) { diff --git a/gcc/targhooks.h b/gcc/targhooks.h index b537038..f70a307d 100644 --- a/gcc/targhooks.h +++ b/gcc/targhooks.h @@ -149,6 +149,7 @@ extern const char *hook_invalid_arg_for_unprototyped_fn (const_tree, const_tree, const_tree); extern void default_function_arg_advance (cumulative_args_t, const function_arg_info &); +extern bool default_push_argument (unsigned int); extern HOST_WIDE_INT default_function_arg_offset (machine_mode, const_tree); extern pad_direction default_function_arg_padding (machine_mode, const_tree); extern rtx default_function_arg (cumulative_args_t, const function_arg_info &); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c6e8817..c1a715f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,67 @@ +2021-06-18 Aaron Sawdey <acsawdey@linux.vnet.ibm.com> + + * gcc.target/powerpc/fusion-p10-2logical.c: Update pattern + match counts. + * gcc.target/powerpc/fusion-p10-addadd.c: Update pattern match + counts. + * gcc.target/powerpc/fusion-p10-ldcmpi.c: Update pattern match + counts. + * gcc.target/powerpc/fusion-p10-logadd.c: Update pattern match + counts. + +2021-06-18 Harald Anlauf <anlauf@gmx.de> + + PR fortran/100283 + PR fortran/101123 + * gfortran.dg/min0_max0_1.f90: New test. + * gfortran.dg/min0_max0_2.f90: New test. + +2021-06-18 David Malcolm <dmalcolm@redhat.com> + + * gcc.dg/analyzer/symbolic-7.c: New test. + +2021-06-18 Srinath Parvathaneni <srinath.parvathaneni@arm.com> + + PR target/100856 + * gcc.target/arm/acle/pr100856.c: New test. + * gcc.target/arm/multilib.exp: Add tests for cde options. + +2021-06-18 Michael Meissner <meissner@linux.ibm.com> + + * gcc.target/powerpc/float128-minmax-2.c: New test. + +2021-06-17 Jason Merrill <jason@redhat.com> + + PR c++/101106 + * g++.dg/cpp0x/deleted15.C: New test. + +2021-06-17 H.J. Lu <hjl.tools@gmail.com> + + PR target/100704 + * gcc.target/i386/pr100704-1.c: New test. + * gcc.target/i386/pr100704-2.c: Likewise. + * gcc.target/i386/pr100704-3.c: Likewise. + +2021-06-17 Uroš Bizjak <ubizjak@gmail.com> + + PR target/97194 + * gcc.target/i386/sse4_1-vec-set-1.c: New test. + * gcc.target/i386/sse4_1-vec-set-2.c: ditto. + +2021-06-17 Aldy Hernandez <aldyh@redhat.com> + + * gcc.dg/pr100790.c: New test. + +2021-06-17 Marius Hillenbrand <mhillen@linux.ibm.com> + + * gcc.target/s390/zvector/vec-doublee.c: New test. + * gcc.target/s390/zvector/vec-floate.c: New test. + +2021-06-17 Richard Biener <rguenther@suse.de> + + PR tree-optimization/54400 + * gcc.dg/vect/bb-slp-pr54400.c: New testcase. + 2021-06-16 Jason Merrill <jason@redhat.com> PR c++/101078 diff --git a/gcc/testsuite/g++.dg/cpp0x/deleted15.C b/gcc/testsuite/g++.dg/cpp0x/deleted15.C new file mode 100644 index 0000000..06d2171 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/deleted15.C @@ -0,0 +1,6 @@ +// PR c++/101106 +// { dg-do compile { target c++11 } } +// { dg-options "" } + +int f(); +int f() = delete; // { dg-message "not first declaration" } diff --git a/gcc/testsuite/gcc.dg/analyzer/symbolic-7.c b/gcc/testsuite/gcc.dg/analyzer/symbolic-7.c new file mode 100644 index 0000000..4f01367 --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/symbolic-7.c @@ -0,0 +1,44 @@ +#include "analyzer-decls.h" + +extern void maybe_write (int *); + +void test_1 (int i) +{ + /* An array with purely concrete bindings. */ + int arr[2]; + arr[0] = 1066; + arr[1] = 1776; + + /* Concrete reads. */ + __analyzer_eval (arr[0] == 1066); /* { dg-warning "TRUE" } */ + __analyzer_eval (arr[1] == 1776); /* { dg-warning "TRUE" } */ + + /* Symbolic read. */ + __analyzer_describe (0, arr[i]); /* { dg-warning "svalue: 'UNKNOWN\\(int\\)'" } */ + __analyzer_eval (arr[i] == 1776); /* { dg-warning "UNKNOWN" } */ +} + +void test_2 (int i) +{ + /* An array that could have been touched. */ + int arr[2]; + maybe_write (arr); + + /* Concrete reads. */ + __analyzer_eval (arr[0] == 42); /* { dg-warning "UNKNOWN" } */ + + /* Symbolic read. */ + __analyzer_eval (arr[i] == 42); /* { dg-warning "UNKNOWN" } */ +} + +void test_3 (int i) +{ + /* An array that can't have been touched. */ + int arr[2]; + + /* Concrete reads. */ + __analyzer_eval (arr[0] == 42); /* { dg-warning "UNKNOWN" } */ + + /* Symbolic read. */ + __analyzer_eval (arr[i] == 42); /* { dg-warning "UNKNOWN" } */ +} diff --git a/gcc/testsuite/gcc.dg/pr100790.c b/gcc/testsuite/gcc.dg/pr100790.c new file mode 100644 index 0000000..31e0eff --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr100790.c @@ -0,0 +1,4 @@ +// { dg-do compile } +// { dg-options "-O2 -w" } + +__builtin_clz(int x) { x ? __builtin_clz(x) : 32; } diff --git a/gcc/testsuite/gcc.target/arm/acle/pr100856.c b/gcc/testsuite/gcc.target/arm/acle/pr100856.c new file mode 100644 index 0000000..5bc030e --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/acle/pr100856.c @@ -0,0 +1,10 @@ +/* { dg-do run } */ +/* { dg-require-effective-target arm_v8_1m_main_cde_mve_ok } */ +/* { dg-add-options arm_v8_1m_main_cde_mve } */ + +#include "arm_cde.h" + +int main() +{ + return 0; +} diff --git a/gcc/testsuite/gcc.target/arm/multilib.exp b/gcc/testsuite/gcc.target/arm/multilib.exp index 46f2d86..4b30025 100644 --- a/gcc/testsuite/gcc.target/arm/multilib.exp +++ b/gcc/testsuite/gcc.target/arm/multilib.exp @@ -840,6 +840,119 @@ if {[multilib_config "rmprofile"] } { {-mcpu=cortex-m55+nomve+nofp -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main/nofp" {-mcpu=cortex-m55+nodsp+nofp -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp" {-mcpu=cortex-m55+nodsp+nofp -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+cdecp0 -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+fp+cdecp0 -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+fp.dp+cdecp0 -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+fp+dsp+cdecp0 -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+fp.dp+dsp+cdecp0 -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+cdecp0 -mfpu=vfpv3xd -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+fp+cdecp0 -mfpu=vfpv3xd -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+fp.dp+cdecp0 -mfpu=vfpv3xd -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+fp+dsp+cdecp0 -mfpu=vfpv3xd -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+fp.dp+dsp+cdecp0 -mfpu=vfpv3xd -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+cdecp0 -mfpu=vfpv3xd-fp16 -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+fp+cdecp0 -mfpu=vfpv3xd-fp16 -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+fp.dp+cdecp0 -mfpu=vfpv3xd-fp16 -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+fp+dsp+cdecp0 -mfpu=vfpv3xd-fp16 -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+fp.dp+dsp+cdecp0 -mfpu=vfpv3xd-fp16 -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+cdecp0 -mfpu=fpv4-sp-d16 -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+fp+cdecp0 -mfpu=fpv4-sp-d16 -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+fp.dp+cdecp0 -mfpu=fpv4-sp-d16 -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+fp+dsp+cdecp0 -mfpu=fpv4-sp-d16 -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+fp.dp+dsp+cdecp0 -mfpu=fpv4-sp-d16 -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+cdecp0 -mfpu=fpv5-sp-d16 -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+fp+cdecp0 -mfpu=fpv5-sp-d16 -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+fp.dp+cdecp0 -mfpu=fpv5-sp-d16 -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+fp+dsp+cdecp0 -mfpu=fpv5-sp-d16 -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+fp.dp+dsp+cdecp0 -mfpu=fpv5-sp-d16 -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+cdecp0 -mfpu=fpv5-d16 -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+fp+cdecp0 -mfpu=fpv5-d16 -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+fp.dp+cdecp0 -mfpu=fpv5-d16 -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+fp+dsp+cdecp0 -mfpu=fpv5-d16 -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+fp.dp+dsp+cdecp0 -mfpu=fpv5-d16 -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+fp+cdecp0 -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+fp/hard" + {-march=armv8-m.main+fp.dp+cdecp0 -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+dp/hard" + {-march=armv8-m.main+fp+dsp+cdecp0 -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+fp/hard" + {-march=armv8-m.main+fp.dp+dsp+cdecp0 -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+dp/hard" + {-march=armv8-m.main+cdecp0 -mfpu=vfpv3xd -mfloat-abi=hard} "thumb/v8-m.main+fp/hard" + {-march=armv8-m.main+fp+cdecp0 -mfpu=vfpv3xd -mfloat-abi=hard} "thumb/v8-m.main+fp/hard" + {-march=armv8-m.main+fp.dp+cdecp0 -mfpu=vfpv3xd -mfloat-abi=hard} "thumb/v8-m.main+dp/hard" + {-march=armv8-m.main+fp+dsp+cdecp0 -mfpu=vfpv3xd -mfloat-abi=hard} "thumb/v8-m.main+fp/hard" + {-march=armv8-m.main+fp.dp+dsp+cdecp0 -mfpu=vfpv3xd -mfloat-abi=hard} "thumb/v8-m.main+dp/hard" + {-march=armv8-m.main+cdecp0 -mfpu=vfpv3xd-fp16 -mfloat-abi=hard} "thumb/v8-m.main+fp/hard" + {-march=armv8-m.main+fp+cdecp0 -mfpu=vfpv3xd-fp16 -mfloat-abi=hard} "thumb/v8-m.main+fp/hard" + {-march=armv8-m.main+fp.dp+cdecp0 -mfpu=vfpv3xd-fp16 -mfloat-abi=hard} "thumb/v8-m.main+dp/hard" + {-march=armv8-m.main+fp+dsp+cdecp0 -mfpu=vfpv3xd-fp16 -mfloat-abi=hard} "thumb/v8-m.main+fp/hard" + {-march=armv8-m.main+fp.dp+dsp+cdecp0 -mfpu=vfpv3xd-fp16 -mfloat-abi=hard} "thumb/v8-m.main+dp/hard" + {-march=armv8-m.main+cdecp0 -mfpu=fpv4-sp-d16 -mfloat-abi=hard} "thumb/v8-m.main+fp/hard" + {-march=armv8-m.main+fp+cdecp0 -mfpu=fpv4-sp-d16 -mfloat-abi=hard} "thumb/v8-m.main+fp/hard" + {-march=armv8-m.main+fp.dp+cdecp0 -mfpu=fpv4-sp-d16 -mfloat-abi=hard} "thumb/v8-m.main+dp/hard" + {-march=armv8-m.main+fp+dsp+cdecp0 -mfpu=fpv4-sp-d16 -mfloat-abi=hard} "thumb/v8-m.main+fp/hard" + {-march=armv8-m.main+fp.dp+dsp+cdecp0 -mfpu=fpv4-sp-d16 -mfloat-abi=hard} "thumb/v8-m.main+dp/hard" + {-march=armv8-m.main+cdecp0 -mfpu=fpv5-sp-d16 -mfloat-abi=hard} "thumb/v8-m.main+fp/hard" + {-march=armv8-m.main+fp+cdecp0 -mfpu=fpv5-sp-d16 -mfloat-abi=hard} "thumb/v8-m.main+fp/hard" + {-march=armv8-m.main+fp.dp+cdecp0 -mfpu=fpv5-sp-d16 -mfloat-abi=hard} "thumb/v8-m.main+dp/hard" + {-march=armv8-m.main+fp+dsp+cdecp0 -mfpu=fpv5-sp-d16 -mfloat-abi=hard} "thumb/v8-m.main+fp/hard" + {-march=armv8-m.main+fp.dp+dsp+cdecp0 -mfpu=fpv5-sp-d16 -mfloat-abi=hard} "thumb/v8-m.main+dp/hard" + {-march=armv8-m.main+cdecp0 -mfpu=fpv5-d16 -mfloat-abi=hard} "thumb/v8-m.main+dp/hard" + {-march=armv8-m.main+fp+cdecp0 -mfpu=fpv5-d16 -mfloat-abi=hard} "thumb/v8-m.main+dp/hard" + {-march=armv8-m.main+fp.dp+cdecp0 -mfpu=fpv5-d16 -mfloat-abi=hard} "thumb/v8-m.main+dp/hard" + {-march=armv8-m.main+fp+dsp+cdecp0 -mfpu=fpv5-d16 -mfloat-abi=hard} "thumb/v8-m.main+dp/hard" + {-march=armv8-m.main+fp.dp+dsp+cdecp0 -mfpu=fpv5-d16 -mfloat-abi=hard} "thumb/v8-m.main+dp/hard" + {-march=armv8-m.main+cdecp0 -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main/nofp" + {-march=armv8-m.main+fp+cdecp0 -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+fp/softfp" + {-march=armv8-m.main+fp.dp+cdecp0 -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp" + {-march=armv8-m.main+fp+dsp+cdecp0 -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+fp/softfp" + {-march=armv8-m.main+fp.dp+dsp+cdecp0 -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp" + {-march=armv8-m.main+cdecp0 -mfpu=vfpv3xd -mfloat-abi=softfp} "thumb/v8-m.main+fp/softfp" + {-march=armv8-m.main+fp+cdecp0 -mfpu=vfpv3xd -mfloat-abi=softfp} "thumb/v8-m.main+fp/softfp" + {-march=armv8-m.main+fp.dp+cdecp0 -mfpu=vfpv3xd -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp" + {-march=armv8-m.main+fp+dsp+cdecp0 -mfpu=vfpv3xd -mfloat-abi=softfp} "thumb/v8-m.main+fp/softfp" + {-march=armv8-m.main+fp.dp+dsp+cdecp0 -mfpu=vfpv3xd -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp" + {-march=armv8-m.main+cdecp0 -mfpu=vfpv3xd-fp16 -mfloat-abi=softfp} "thumb/v8-m.main+fp/softfp" + {-march=armv8-m.main+fp+cdecp0 -mfpu=vfpv3xd-fp16 -mfloat-abi=softfp} "thumb/v8-m.main+fp/softfp" + {-march=armv8-m.main+fp.dp+cdecp0 -mfpu=vfpv3xd-fp16 -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp" + {-march=armv8-m.main+fp+dsp+cdecp0 -mfpu=vfpv3xd-fp16 -mfloat-abi=softfp} "thumb/v8-m.main+fp/softfp" + {-march=armv8-m.main+fp.dp+dsp+cdecp0 -mfpu=vfpv3xd-fp16 -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp" + {-march=armv8-m.main+cdecp0 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp} "thumb/v8-m.main+fp/softfp" + {-march=armv8-m.main+fp+cdecp0 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp} "thumb/v8-m.main+fp/softfp" + {-march=armv8-m.main+fp.dp+cdecp0 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp" + {-march=armv8-m.main+fp+dsp+cdecp0 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp} "thumb/v8-m.main+fp/softfp" + {-march=armv8-m.main+fp.dp+dsp+cdecp0 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp" + {-march=armv8-m.main+cdecp0 -mfpu=fpv5-sp-d16 -mfloat-abi=softfp} "thumb/v8-m.main+fp/softfp" + {-march=armv8-m.main+fp+cdecp0 -mfpu=fpv5-sp-d16 -mfloat-abi=softfp} "thumb/v8-m.main+fp/softfp" + {-march=armv8-m.main+fp.dp+cdecp0 -mfpu=fpv5-sp-d16 -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp" + {-march=armv8-m.main+fp+dsp+cdecp0 -mfpu=fpv5-sp-d16 -mfloat-abi=softfp} "thumb/v8-m.main+fp/softfp" + {-march=armv8-m.main+fp.dp+dsp+cdecp0 -mfpu=fpv5-sp-d16 -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp" + {-march=armv8-m.main+cdecp0 -mfpu=fpv5-d16 -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp" + {-march=armv8-m.main+fp+cdecp0 -mfpu=fpv5-d16 -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp" + {-march=armv8-m.main+fp.dp+cdecp0 -mfpu=fpv5-d16 -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp" + {-march=armv8-m.main+fp+dsp+cdecp0 -mfpu=fpv5-d16 -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp" + {-march=armv8-m.main+fp.dp+dsp+cdecp0 -mfpu=fpv5-d16 -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp" + {-march=armv8.1-m.main+cdecp0 -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8.1-m.main+dsp+cdecp0 -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8.1-m.main+dsp+fp+cdecp0 -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8.1-m.main+dsp+fp.dp+cdecp0 -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8.1-m.main+cdecp0 -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main/nofp" + {-march=armv8.1-m.main+dsp+cdecp0 -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main/nofp" + {-march=armv8.1-m.main+dsp+fp+cdecp0 -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+fp/softfp" + {-march=armv8.1-m.main+dsp+fp.dp+cdecp0 -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp" + {-march=armv8.1-m.main+dsp+fp+cdecp0 -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+fp/hard" + {-march=armv8.1-m.main+dsp+fp.dp+cdecp0 -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+dp/hard" + {-march=armv8.1-m.main+mve+cdecp0 -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8.1-m.main+mve.fp+cdecp0 -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8.1-m.main+mve+cdecp0 -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main/nofp" + {-march=armv8.1-m.main+mve.fp+cdecp0 -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+fp/softfp" + {-march=armv8.1-m.main+mve+cdecp0 -mfpu=auto -mfloat-abi=hard} "thumb/v8.1-m.main+mve/hard" + {-march=armv8.1-m.main+mve+fp+cdecp0 -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+fp/hard" + {-march=armv8.1-m.main+mve+fp+cdecp0 -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+fp/softfp" + {-march=armv8.1-m.main+mve.fp+cdecp0 -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+fp/hard" + {-march=armv8.1-m.main+mve+fp.dp+cdecp0 -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8.1-m.main+mve.fp+fp.dp+cdecp0 -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp" + {-march=armv8.1-m.main+mve+fp.dp+cdecp0 -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp" + {-march=armv8.1-m.main+mve.fp+fp.dp+cdecp0 -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp" + {-march=armv8.1-m.main+mve+fp.dp+cdecp0 -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+dp/hard" + {-march=armv8.1-m.main+mve.fp+fp.dp+cdecp0 -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+dp/hard" } { check_multi_dir $opts $dir } diff --git a/gcc/testsuite/gcc.target/i386/pr100704-1.c b/gcc/testsuite/gcc.target/i386/pr100704-1.c new file mode 100644 index 0000000..02461db --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr100704-1.c @@ -0,0 +1,24 @@ +/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-options "-O2 -march=x86-64" } */ + +struct S +{ + long long s1 __attribute__ ((aligned (8))); + unsigned s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14; +}; + +extern struct S a[]; + +void bar (struct S); + +void +foo (void) +{ + bar (a[0]); +} + +/* { dg-final { scan-assembler-not "pushq" } } */ +/* { dg-final { scan-assembler-times "movups\[\\t \]%xmm\[0-9\]+, \\(%\[\^,\]+\\)" 1 } } */ +/* { dg-final { scan-assembler-times "movups\[\\t \]%xmm\[0-9\]+, 16\\(%\[\^,\]+\\)" 1 } } */ +/* { dg-final { scan-assembler-times "movups\[\\t \]%xmm\[0-9\]+, 32\\(%\[\^,\]+\\)" 1 } } */ +/* { dg-final { scan-assembler-times "movups\[\\t \]%xmm\[0-9\]+, 48\\(%\[\^,\]+\\)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr100704-2.c b/gcc/testsuite/gcc.target/i386/pr100704-2.c new file mode 100644 index 0000000..07b9bd1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr100704-2.c @@ -0,0 +1,23 @@ +/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-options "-O2 -march=x86-64" } */ + +struct S +{ + char array[64]; +}; + +extern struct S a[]; + +void bar (struct S); + +void +foo (void) +{ + bar (a[0]); +} + +/* { dg-final { scan-assembler-not "pushq" } } */ +/* { dg-final { scan-assembler-times "movups\[\\t \]%xmm\[0-9\]+, \\(%\[\^,\]+\\)" 1 } } */ +/* { dg-final { scan-assembler-times "movups\[\\t \]%xmm\[0-9\]+, 16\\(%\[\^,\]+\\)" 1 } } */ +/* { dg-final { scan-assembler-times "movups\[\\t \]%xmm\[0-9\]+, 32\\(%\[\^,\]+\\)" 1 } } */ +/* { dg-final { scan-assembler-times "movups\[\\t \]%xmm\[0-9\]+, 48\\(%\[\^,\]+\\)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr100704-3.c b/gcc/testsuite/gcc.target/i386/pr100704-3.c new file mode 100644 index 0000000..65f9745 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr100704-3.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mno-sse" } */ + +struct S +{ + long long s1 __attribute__ ((aligned (8))); + unsigned s2, s3; +}; + +extern struct S foooo[]; + +void bar (int, int, int, int, int, int, struct S); + +void +foo (void) +{ + bar (1, 2, 3, 4, 5, 6, foooo[0]); +} + +/* { dg-final { scan-assembler "push\[lq\]\tfoooo\+" } } */ diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-vec-set-1.c b/gcc/testsuite/gcc.target/i386/sse4_1-vec-set-1.c new file mode 100644 index 0000000..7c7fd34 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse4_1-vec-set-1.c @@ -0,0 +1,26 @@ +/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-options "-msse4.1 -O2" } */ +/* { dg-final { scan-assembler-times {(?n)v?pcmpeq[bwd]} 4 } } */ +/* { dg-final { scan-assembler-times {(?n)v?p?blendv} 4 } } */ + +typedef char v8qi __attribute__ ((vector_size (8))); +typedef short v4hi __attribute__ ((vector_size (8))); +typedef int v2si __attribute__ ((vector_size (8))); +typedef float v2sf __attribute__ ((vector_size (8))); + +#define FOO(VTYPE, TYPE) \ + VTYPE \ + __attribute__ ((noipa)) \ + foo_##VTYPE (VTYPE a, TYPE b, unsigned int c) \ + { \ + a[c] = b; \ + return a; \ + } \ + +FOO (v8qi, char); + +FOO (v4hi, short); + +FOO (v2si, int); + +FOO (v2sf, float); diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-vec-set-2.c b/gcc/testsuite/gcc.target/i386/sse4_1-vec-set-2.c new file mode 100644 index 0000000..24f8041 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse4_1-vec-set-2.c @@ -0,0 +1,45 @@ +/* { dg-do run { target { ! ia32 } } } */ +/* { dg-require-effective-target sse4 } */ +/* { dg-options "-O2 -msse4.1" } */ + + +#ifndef CHECK +#define CHECK "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK + +#include "sse4_1-vec-set-1.c" + +#define CALC_TEST(vtype, type, N, idx) \ +do \ + { \ + int i,val = idx * idx - idx * 3 + 16; \ + type res[N],exp[N]; \ + vtype resv; \ + for (i = 0; i < N; i++) \ + { \ + res[i] = i * i - i * 3 + 15; \ + exp[i] = res[i]; \ + } \ + exp[idx] = val; \ + resv = foo_##vtype (*(vtype *)&res[0], val, idx); \ + for (i = 0; i < N; i++) \ + { \ + if (resv[i] != exp[i]) \ + abort (); \ + } \ + } \ +while (0) + +static void +TEST (void) +{ + CALC_TEST (v8qi, char, 8, 5); + CALC_TEST (v4hi, short, 4, 2); + CALC_TEST (v2si, int, 2, 1); +} diff --git a/gcc/testsuite/gcc.target/powerpc/float128-minmax-2.c b/gcc/testsuite/gcc.target/powerpc/float128-minmax-2.c new file mode 100644 index 0000000..c71ba08 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/float128-minmax-2.c @@ -0,0 +1,15 @@ +/* { dg-require-effective-target ppc_float128_hw } */ +/* { dg-require-effective-target power10_ok } */ +/* { dg-options "-mdejagnu-cpu=power10 -O2 -ffast-math" } */ + +#ifndef TYPE +#define TYPE _Float128 +#endif + +/* Test that the fminf128/fmaxf128 functions generate if/then/else and not a + call. */ +TYPE f128_min (TYPE a, TYPE b) { return __builtin_fminf128 (a, b); } +TYPE f128_max (TYPE a, TYPE b) { return __builtin_fmaxf128 (a, b); } + +/* { dg-final { scan-assembler {\mxsmaxcqp\M} } } */ +/* { dg-final { scan-assembler {\mxsmincqp\M} } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fusion-p10-2logical.c b/gcc/testsuite/gcc.target/powerpc/fusion-p10-2logical.c index de22176..009a5f2 100644 --- a/gcc/testsuite/gcc.target/powerpc/fusion-p10-2logical.c +++ b/gcc/testsuite/gcc.target/powerpc/fusion-p10-2logical.c @@ -64,262 +64,151 @@ TEST(vboolchar_t); TEST(vuint_t); /* Recreate with: - grep ' \*fuse_' fusion-p10-2logical.s|sed -e 's,^.*\*,,' |sort -k 7,7 |uniq -c|awk '{l=30-length($2); printf("/%s* { %s { scan-assembler-times \"%s\"%-*s %4d { target lp64 } } } *%s/\n","","dg-final",$2,l,"",$1,"");}' + grep ' \*fuse_' fusion-p10-2logical.s|sed -e 's,^.*\*,,' -e 's,/[0-9],/,' |sort -k 7,7 |uniq -c|awk '{l=30-length($2); printf("/%s* { %s { scan-assembler-times {\\m%s\\M}%-*s %4d { target lp64 } } } *%s/\n","","dg-final",$2,l,"",$1,"");}' */ - -/* { dg-final { scan-assembler-times "fuse_and_and/1" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_and/2" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_andc_and/0" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_andc_and/1" 26 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_andc_and/2" 48 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_andc_and/3" 6 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_andc_or/0" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_andc_or/1" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_andc_or/2" 32 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_andc_orc/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_andc_orc/1" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_andc_orc/2" 48 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_andc_xor/0" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_andc_xor/1" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_andc_xor/2" 32 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_eqv/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_eqv/2" 24 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_or/0" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_or/2" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_orc/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_orc/2" 24 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_xor/0" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_xor/2" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_eqv_and/0" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_eqv_and/2" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_eqv_andc/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_eqv_andc/2" 24 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_eqv_or/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_eqv_or/2" 24 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_and/0" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_and/2" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_andc/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_andc/2" 24 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_or/0" 14 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_or/1" 2 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_or/2" 72 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_or/3" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_orc/2" 24 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_orc/3" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_and/0" 28 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_and/1" 4 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_and/2" 48 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_and/3" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_andc/2" 24 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_andc/3" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_or/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_or/2" 24 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_orc/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_orc/2" 24 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_and/0" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_and/2" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_andc/0" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_andc/2" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_orc_and/0" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_orc_and/1" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_orc_and/2" 32 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_orc_andc/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_orc_andc/1" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_orc_andc/2" 48 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_orc_or/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_orc_or/1" 10 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_orc_or/2" 72 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_orc_or/3" 6 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_orc_xor/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_orc_xor/1" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_orc_xor/2" 48 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_eqv/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_eqv/2" 24 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_or/1" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_or/2" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_xor/0" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_xor/2" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vandc_vand/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vandc_vand/1" 10 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vandc_vand/3" 6 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vandc_vor/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vandc_vor/1" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vandc_vorc/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vandc_vorc/1" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vandc_vxor/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vandc_vxor/1" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vand_vand/1" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vand_veqv/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vand_vor/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vand_vorc/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vand_vxor/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_veqv_vand/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_veqv_vandc/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_veqv_vor/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vnand_vand/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vnand_vandc/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vnand_vor/0" 14 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vnand_vor/1" 2 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vnand_vor/3" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vnand_vorc/3" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vnor_vand/0" 14 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vnor_vand/1" 2 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vnor_vand/3" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vnor_vandc/3" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vnor_vor/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vnor_vorc/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vorc_vand/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vorc_vand/1" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vorc_vandc/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vorc_vandc/1" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vorc_vor/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vorc_vor/1" 10 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vorc_vor/3" 6 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vorc_vxor/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vorc_vxor/1" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vor_vand/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vor_vandc/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vor_veqv/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vor_vor/1" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vor_vxor/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vxor_vand/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vxor_vandc/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vxor_veqv/3" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vxor_vnand/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vxor_vor/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vxor_vorc/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vxor_vxor/1" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_xor_and/0" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_xor_and/2" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_xor_andc/0" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_xor_andc/2" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_xor_eqv/2" 24 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_xor_eqv/3" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_xor_nand/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_xor_nand/2" 24 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_xor_or/0" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_xor_or/2" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_xor_orc/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_xor_orc/2" 24 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_xor_xor/1" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_xor_xor/2" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_and/1" 40 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_andc_and/0" 40 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_andc_and/1" 56 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_andc_and/3" 24 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_andc_or/0" 40 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_andc_or/1" 40 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_andc_orc/0" 32 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_andc_orc/1" 32 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_andc_orc/2" 16 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_andc_xor/0" 40 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_andc_xor/1" 40 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_eqv/0" 32 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_eqv/2" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_or/0" 40 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_orc/0" 32 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_orc/2" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_xor/0" 40 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_eqv_and/0" 40 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_eqv_andc/0" 32 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_eqv_andc/2" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_eqv_or/0" 32 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_eqv_or/2" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_and/0" 40 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_andc/0" 32 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_andc/2" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_or/0" 56 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_or/1" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_or/2" 24 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_or/3" 32 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_orc/2" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_orc/3" 32 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_and/0" 70 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_and/1" 10 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_and/3" 40 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_andc/2" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_andc/3" 32 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_or/0" 32 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_or/2" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_orc/0" 32 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_orc/2" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_and/0" 40 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_andc/0" 40 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_orc_and/0" 40 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_orc_and/1" 40 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_orc_andc/0" 32 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_orc_andc/1" 32 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_orc_andc/2" 16 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_orc_or/0" 32 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_orc_or/1" 40 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_orc_or/2" 24 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_orc_or/3" 24 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_orc_xor/0" 32 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_orc_xor/1" 32 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_orc_xor/2" 16 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_eqv/0" 32 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_eqv/2" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_or/1" 40 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_xor/0" 40 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vandc_vand/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vandc_vand/1" 10 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vandc_vand/3" 6 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vandc_vor/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vandc_vor/1" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vandc_vorc/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vandc_vorc/1" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vandc_vxor/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vandc_vxor/1" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vand_vand/1" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vand_veqv/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vand_vor/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vand_vorc/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vand_vxor/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_veqv_vand/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_veqv_vandc/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_veqv_vor/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vnand_vand/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vnand_vandc/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vnand_vor/0" 14 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vnand_vor/1" 2 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vnand_vor/3" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vnand_vorc/3" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vnor_vand/0" 14 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vnor_vand/1" 2 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vnor_vand/3" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vnor_vandc/3" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vnor_vor/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vnor_vorc/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vorc_vand/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vorc_vand/1" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vorc_vandc/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vorc_vandc/1" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vorc_vor/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vorc_vor/1" 10 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vorc_vor/3" 6 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vorc_vxor/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vorc_vxor/1" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vor_vand/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vor_vandc/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vor_veqv/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vor_vor/1" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vor_vxor/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vxor_vand/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vxor_vandc/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vxor_veqv/3" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vxor_vnand/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vxor_vor/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vxor_vorc/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vxor_vxor/1" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_xor_and/0" 40 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_xor_andc/0" 40 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_xor_eqv/2" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_xor_eqv/3" 32 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_xor_nand/0" 32 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_xor_nand/2" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_xor_or/0" 40 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_xor_orc/0" 32 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_xor_orc/2" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_xor_xor/1" 40 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_and_and\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_andc_and\M/} 96 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_andc_or\M/} 64 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_andc_orc\M/} 64 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_andc_xor\M/} 64 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_and_eqv\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_and_or\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_and_orc\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_and_xor\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_eqv_and\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_eqv_andc\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_eqv_or\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nand_and\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nand_andc\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nand_or\M/} 96 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nand_orc\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nor_and\M/} 96 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nor_andc\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nor_or\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nor_orc\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_or_and\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_or_andc\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_orc_and\M/} 64 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_orc_andc\M/} 64 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_orc_or\M/} 96 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_orc_xor\M/} 64 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_or_eqv\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_or_or\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_or_xor\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vandc_vand\M/} 24 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vandc_vor\M/} 16 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vandc_vorc\M/} 16 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vandc_vxor\M/} 16 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vand_vand\M/} 8 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vand_veqv\M/} 8 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vand_vor\M/} 8 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vand_vorc\M/} 8 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vand_vxor\M/} 8 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_veqv_vand\M/} 8 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_veqv_vandc\M/} 8 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_veqv_vor\M/} 8 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vnand_vand\M/} 8 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vnand_vandc\M/} 8 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vnand_vor\M/} 24 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vnand_vorc\M/} 8 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vnor_vand\M/} 24 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vnor_vandc\M/} 8 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vnor_vor\M/} 8 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vnor_vorc\M/} 8 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vorc_vand\M/} 16 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vorc_vandc\M/} 16 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vorc_vor\M/} 24 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vorc_vxor\M/} 16 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vor_vand\M/} 8 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vor_vandc\M/} 8 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vor_veqv\M/} 8 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vor_vor\M/} 8 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vor_vxor\M/} 8 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vxor_vand\M/} 8 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vxor_vandc\M/} 8 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vxor_veqv\M/} 8 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vxor_vnand\M/} 8 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vxor_vor\M/} 8 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vxor_vorc\M/} 8 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vxor_vxor\M/} 8 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_xor_and\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_xor_andc\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_xor_eqv\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_xor_nand\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_xor_or\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_xor_orc\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_xor_xor\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_and_and\M/} 40 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_andc_and\M/} 120 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_andc_or\M/} 80 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_andc_orc\M/} 80 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_andc_xor\M/} 80 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_and_eqv\M/} 40 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_and_or\M/} 40 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_and_orc\M/} 40 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_and_xor\M/} 40 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_eqv_and\M/} 40 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_eqv_andc\M/} 40 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_eqv_or\M/} 40 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nand_and\M/} 40 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nand_andc\M/} 40 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nand_or\M/} 120 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nand_orc\M/} 40 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nor_and\M/} 120 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nor_andc\M/} 40 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nor_or\M/} 40 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nor_orc\M/} 40 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_or_and\M/} 40 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_or_andc\M/} 40 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_orc_and\M/} 80 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_orc_andc\M/} 80 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_orc_or\M/} 120 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_orc_xor\M/} 80 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_or_eqv\M/} 40 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_or_or\M/} 40 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_or_xor\M/} 40 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vandc_vand\M/} 24 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vandc_vor\M/} 16 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vandc_vorc\M/} 16 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vandc_vxor\M/} 16 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vand_vand\M/} 8 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vand_veqv\M/} 8 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vand_vor\M/} 8 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vand_vorc\M/} 8 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vand_vxor\M/} 8 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_veqv_vand\M/} 8 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_veqv_vandc\M/} 8 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_veqv_vor\M/} 8 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vnand_vand\M/} 8 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vnand_vandc\M/} 8 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vnand_vor\M/} 24 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vnand_vorc\M/} 8 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vnor_vand\M/} 24 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vnor_vandc\M/} 8 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vnor_vor\M/} 8 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vnor_vorc\M/} 8 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vorc_vand\M/} 16 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vorc_vandc\M/} 16 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vorc_vor\M/} 24 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vorc_vxor\M/} 16 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vor_vand\M/} 8 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vor_vandc\M/} 8 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vor_veqv\M/} 8 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vor_vor\M/} 8 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vor_vxor\M/} 8 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vxor_vand\M/} 8 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vxor_vandc\M/} 8 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vxor_veqv\M/} 8 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vxor_vnand\M/} 8 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vxor_vor\M/} 8 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vxor_vorc\M/} 8 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vxor_vxor\M/} 8 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_xor_and\M/} 40 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_xor_andc\M/} 40 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_xor_eqv\M/} 40 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_xor_nand\M/} 40 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_xor_or\M/} 40 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_xor_orc\M/} 40 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_xor_xor\M/} 40 { target ilp32 } } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fusion-p10-addadd.c b/gcc/testsuite/gcc.target/powerpc/fusion-p10-addadd.c index f70b56a..68886b9 100644 --- a/gcc/testsuite/gcc.target/powerpc/fusion-p10-addadd.c +++ b/gcc/testsuite/gcc.target/powerpc/fusion-p10-addadd.c @@ -32,16 +32,7 @@ vlong vaddadd2(vlong s, vlong a, vlong b, vlong c) return a+b+c; } -/* { dg-final { scan-assembler-times "fuse_add_add/0" 1 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_add_add/1" 1 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_add_add/2" 1 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vaddudm_vaddudm/0" 1 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vaddudm_vaddudm/1" 1 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_vaddudm_vaddudm/2" 1 { target lp64 } } } */ - -/* { dg-final { scan-assembler-times "fuse_add_add/0" 1 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_add_add/1" 1 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_add_add/2" 1 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vaddudm_vaddudm/0" 0 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vaddudm_vaddudm/1" 0 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_vaddudm_vaddudm/2" 0 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_add_add\M/} 3 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vaddudm_vaddudm\M/} 3 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_add_add\M/} 3 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_vaddudm_vaddudm\M/} 0 { target ilp32 } } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fusion-p10-ldcmpi.c b/gcc/testsuite/gcc.target/powerpc/fusion-p10-ldcmpi.c index ea1d5d0..526a026 100644 --- a/gcc/testsuite/gcc.target/powerpc/fusion-p10-ldcmpi.c +++ b/gcc/testsuite/gcc.target/powerpc/fusion-p10-ldcmpi.c @@ -53,16 +53,16 @@ TEST(int16_t) TEST(uint8_t) TEST(int8_t) -/* { dg-final { scan-assembler-times "lbz_cmpldi_cr0_QI_clobber_CCUNS_zero" 2 { target lp64 } } } */ +/* { dg-final { scan-assembler-times "lbz_cmpldi_cr0_QI_clobber_CCUNS_zero" 4 { target lp64 } } } */ /* { dg-final { scan-assembler-times "ld_cmpdi_cr0_DI_DI_CC_none" 4 { target lp64 } } } */ /* { dg-final { scan-assembler-times "ld_cmpdi_cr0_DI_clobber_CC_none" 4 { target lp64 } } } */ /* { dg-final { scan-assembler-times "ld_cmpldi_cr0_DI_DI_CCUNS_none" 1 { target lp64 } } } */ /* { dg-final { scan-assembler-times "ld_cmpldi_cr0_DI_clobber_CCUNS_none" 1 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "lha_cmpdi_cr0_HI_clobber_CC_sign" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "lhz_cmpldi_cr0_HI_clobber_CCUNS_zero" 2 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "lwa_cmpdi_cr0_SI_EXTSI_CC_sign" 3 { target lp64 } } } */ +/* { dg-final { scan-assembler-times "lha_cmpdi_cr0_HI_clobber_CC_sign" 16 { target lp64 } } } */ +/* { dg-final { scan-assembler-times "lhz_cmpldi_cr0_HI_clobber_CCUNS_zero" 4 { target lp64 } } } */ +/* { dg-final { scan-assembler-times "lwa_cmpdi_cr0_SI_EXTSI_CC_sign" 0 { target lp64 } } } */ /* { dg-final { scan-assembler-times "lwa_cmpdi_cr0_SI_clobber_CC_none" 4 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "lwz_cmpldi_cr0_SI_EXTSI_CCUNS_zero" 2 { target lp64 } } } */ +/* { dg-final { scan-assembler-times "lwz_cmpldi_cr0_SI_EXTSI_CCUNS_zero" 0 { target lp64 } } } */ /* { dg-final { scan-assembler-times "lwz_cmpldi_cr0_SI_clobber_CCUNS_none" 2 { target lp64 } } } */ /* { dg-final { scan-assembler-times "lbz_cmpldi_cr0_QI_clobber_CCUNS_zero" 2 { target ilp32 } } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fusion-p10-logadd.c b/gcc/testsuite/gcc.target/powerpc/fusion-p10-logadd.c index 21d7f40..b2fefe9 100644 --- a/gcc/testsuite/gcc.target/powerpc/fusion-p10-logadd.c +++ b/gcc/testsuite/gcc.target/powerpc/fusion-p10-logadd.c @@ -49,94 +49,45 @@ TEST(uint32_t); TEST(int32_t); TEST(uint64_t); TEST(int64_t); - -/* { dg-final { scan-assembler-times "fuse_nand_rsubf/0" 2 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_rsubf/2" 2 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_rsubf/0" 2 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_rsubf/2" 2 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_add_nand/0" 4 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_add_nor/0" 4 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_add_or/0" 4 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_rsubf/0" 4 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_subf/0" 4 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_add/0" 4 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_subf/0" 4 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_add/0" 4 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_subf/0" 4 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_rsubf/0" 4 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_subf/0" 4 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_subf_nand/0" 4 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_subf_nand/1" 4 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_subf_nor/0" 4 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_subf_nor/1" 4 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_subf_or/0" 4 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_subf_or/1" 4 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_add/0" 6 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_add/0" 6 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_add_and/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_add_and/2" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_subf_and/0" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_subf_and/1" 8 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_add_nand/2" 12 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_add_nor/2" 12 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_add_or/2" 12 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_rsubf/2" 12 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_subf/2" 12 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_add/2" 12 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_subf/2" 12 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_add/2" 12 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_subf/2" 12 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_rsubf/2" 12 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_subf/2" 12 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_subf_and/2" 16 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_add/2" 22 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_add/2" 22 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_subf_nand/2" 24 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_subf_nor/2" 24 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_subf_or/2" 24 { target lp64 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_rsubf/0" 2 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_rsubf/2" 0 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_rsubf/0" 2 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_rsubf/2" 0 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_add_nand/0" 4 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_add_nor/0" 4 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_add_or/0" 4 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_rsubf/0" 4 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_subf/0" 4 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_add/0" 4 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_subf/0" 4 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_add/0" 4 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_subf/0" 4 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_rsubf/0" 4 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_subf/0" 4 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_subf_nand/0" 4 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_subf_nand/1" 4 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_subf_nor/0" 4 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_subf_nor/1" 4 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_subf_or/0" 4 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_subf_or/1" 4 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_add/0" 6 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_add/0" 6 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_add_and/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_add_and/2" 4 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_subf_and/0" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_subf_and/1" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_add_nand/2" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_add_nor/2" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_add_or/2" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_rsubf/2" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_subf/2" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_add/2" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nand_subf/2" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_add/2" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_nor_subf/2" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_rsubf/2" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_subf/2" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_subf_and/2" 8 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_and_add/2" 16 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_or_add/2" 16 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_subf_nand/2" 16 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_subf_nor/2" 16 { target ilp32 } } } */ -/* { dg-final { scan-assembler-times "fuse_subf_or/2" 16 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_add_and\M/} 16 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_add_nand\M/} 16 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_add_nor\M/} 16 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_add_or\M/} 16 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_and_add\M/} 28 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_and_rsubf\M/} 16 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_and_subf\M/} 16 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nand_add\M/} 16 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nand_rsubf\M/} 4 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nand_subf\M/} 16 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nor_add\M/} 16 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nor_rsubf\M/} 4 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nor_subf\M/} 16 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_or_add\M/} 28 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_or_rsubf\M/} 16 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_or_subf\M/} 16 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_subf_and\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_subf_nand\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_subf_nor\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_subf_or\M/} 32 { target lp64 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_add_and\M/} 12 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_add_nand\M/} 12 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_add_nor\M/} 12 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_add_or\M/} 12 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_and_add\M/} 22 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_and_rsubf\M/} 12 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_and_subf\M/} 12 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nand_add\M/} 12 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nand_rsubf\M/} 2 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nand_subf\M/} 12 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nor_add\M/} 12 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nor_rsubf\M/} 2 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_nor_subf\M/} 12 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_or_add\M/} 22 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_or_rsubf\M/} 12 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_or_subf\M/} 12 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_subf_and\M/} 24 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_subf_nand\M/} 24 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_subf_nor\M/} 24 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mfuse_subf_or\M/} 24 { target ilp32 } } } */ diff --git a/gcc/testsuite/gfortran.dg/min0_max0_1.f90 b/gcc/testsuite/gfortran.dg/min0_max0_1.f90 new file mode 100644 index 0000000..118b0f0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/min0_max0_1.f90 @@ -0,0 +1,9 @@ +! { dg-do compile } +! { dg-options "-std=gnu" } +! PR fortran/100283 + +subroutine s () + integer(kind=8) :: i,j,k + i = min0 (j,k) + i = max0 (-127_8, min0 (j,127_8)) +end subroutine s diff --git a/gcc/testsuite/gfortran.dg/min0_max0_2.f90 b/gcc/testsuite/gfortran.dg/min0_max0_2.f90 new file mode 100644 index 0000000..3fe4fcd --- /dev/null +++ b/gcc/testsuite/gfortran.dg/min0_max0_2.f90 @@ -0,0 +1,10 @@ +! { dg-do compile } +! { dg-options "-fdefault-integer-8 -std=gnu" } +! PR fortran/101123 + +SUBROUTINE TEST + IMPLICIT INTEGER*4 (I-N) + MAXMN=MAX0(M,N) + MINMN=MIN0(M,0_4) + MAXRS=MAX1(R,S) +END SUBROUTINE TEST diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 4c32f83..f126d2a 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -3752,6 +3752,15 @@ verify_gimple_assign_unary (gassign *stmt) case BIT_NOT_EXPR: case PAREN_EXPR: case CONJ_EXPR: + /* Disallow pointer and offset types for many of the unary gimple. */ + if (POINTER_TYPE_P (lhs_type) + || TREE_CODE (lhs_type) == OFFSET_TYPE) + { + error ("invalid types for %qs", code_name); + debug_generic_expr (lhs_type); + debug_generic_expr (rhs1_type); + return true; + } break; case ABSU_EXPR: @@ -4127,6 +4136,19 @@ verify_gimple_assign_binary (gassign *stmt) case ROUND_MOD_EXPR: case RDIV_EXPR: case EXACT_DIV_EXPR: + /* Disallow pointer and offset types for many of the binary gimple. */ + if (POINTER_TYPE_P (lhs_type) + || TREE_CODE (lhs_type) == OFFSET_TYPE) + { + error ("invalid types for %qs", code_name); + debug_generic_expr (lhs_type); + debug_generic_expr (rhs1_type); + debug_generic_expr (rhs2_type); + return true; + } + /* Continue with generic binary expression handling. */ + break; + case MIN_EXPR: case MAX_EXPR: case BIT_IOR_EXPR: diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c index 76f4e7e..02e26f9 100644 --- a/gcc/tree-ssa-phiopt.c +++ b/gcc/tree-ssa-phiopt.c @@ -419,6 +419,8 @@ replace_phi_edge_with_variable (basic_block cond_block, gsi = gsi_last_bb (cond_block); gsi_remove (&gsi, true); + statistics_counter_event (cfun, "Replace PHI with variable", 1); + if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, "COND_EXPR in block %d and PHI in block %d converted to straightline code.\n", @@ -618,6 +620,9 @@ factor_out_conditional_conversion (edge e0, edge e1, gphi *phi, /* Remove the original PHI stmt. */ gsi = gsi_for_stmt (phi); gsi_remove (&gsi, true); + + statistics_counter_event (cfun, "factored out cast", 1); + return newphi; } @@ -893,6 +898,11 @@ match_simplify_replacement (basic_block cond_bb, basic_block middle_bb, replace_phi_edge_with_variable (cond_bb, e1, phi, result); + /* Add Statistic here even though replace_phi_edge_with_variable already + does it as we want to be able to count when match-simplify happens vs + the others. */ + statistics_counter_event (cfun, "match-simplify PHI replacement", 1); + /* Note that we optimized this PHI. */ return true; } @@ -1196,6 +1206,8 @@ value_replacement (basic_block cond_bb, basic_block middle_bb, } else { + statistics_counter_event (cfun, "Replace PHI with variable/value_replacement", 1); + /* Replace the PHI arguments with arg. */ SET_PHI_ARG_DEF (phi, e0->dest_idx, arg); SET_PHI_ARG_DEF (phi, e1->dest_idx, arg); @@ -2320,6 +2332,7 @@ spaceship_replacement (basic_block cond_bb, basic_block middle_bb, gimple_stmt_iterator psi = gsi_for_stmt (phi); remove_phi_node (&psi, true); + statistics_counter_event (cfun, "spaceship replacement", 1); return true; } @@ -2982,6 +2995,7 @@ cond_store_replacement (basic_block middle_bb, basic_block join_bb, fprintf (dump_file, "\nInserted a new PHI statement in joint block:\n"); print_gimple_stmt (dump_file, new_stmt, 0, TDF_VOPS|TDF_MEMSYMS); } + statistics_counter_event (cfun, "conditional store replacement", 1); return true; } @@ -3056,6 +3070,8 @@ cond_if_else_store_replacement_1 (basic_block then_bb, basic_block else_bb, else gsi_insert_before (&gsi, new_stmt, GSI_NEW_STMT); + statistics_counter_event (cfun, "if-then-else store replacement", 1); + return true; } @@ -3469,6 +3485,7 @@ hoist_adjacent_loads (basic_block bb0, basic_block bb1, gsi_move_to_bb_end (&gsi2, bb0); gsi2 = gsi_for_stmt (def2); gsi_move_to_bb_end (&gsi2, bb0); + statistics_counter_event (cfun, "hoisted loads", 1); if (dump_file && (dump_flags & TDF_DETAILS)) { diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index 0c1f85b..f9c33c0 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -1482,13 +1482,9 @@ vect_slp_linearize_chain (vec_info *vinfo, stmt_vec_info def_stmt_info; bool res = vect_is_simple_use (op, vinfo, &dt, &def_stmt_info); gcc_assert (res); - if (dt == vect_internal_def) - { - stmt_vec_info orig_def_stmt_info = def_stmt_info; - def_stmt_info = vect_stmt_to_vectorize (def_stmt_info); - if (def_stmt_info != orig_def_stmt_info) - op = gimple_get_lhs (def_stmt_info->stmt); - } + if (dt == vect_internal_def + && is_pattern_stmt_p (def_stmt_info)) + op = gimple_get_lhs (def_stmt_info->stmt); gimple *use_stmt; use_operand_p use_p; if (dt == vect_internal_def diff --git a/gcc/value-range.h b/gcc/value-range.h index 3e58dad..a8adc50 100644 --- a/gcc/value-range.h +++ b/gcc/value-range.h @@ -657,7 +657,7 @@ irange_allocator::~irange_allocator () obstack_free (&m_obstack, NULL); } -// Provide a hunk of memory from the obstack +// Provide a hunk of memory from the obstack. inline void * irange_allocator::get_memory (unsigned num_bytes) { diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 975406a..98b85a0 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,92 @@ +2021-06-17 Chung-Lin Tang <cltang@codesourcery.com> + + * hashtab.h (htab_clear): New function with initialization code + factored out from... + (htab_create): ...here, adjust to use htab_clear function. + * libgomp.h (REFCOUNT_SPECIAL): New symbol to denote range of + special refcount values, add comments. + (REFCOUNT_INFINITY): Adjust definition to use REFCOUNT_SPECIAL. + (REFCOUNT_LINK): Likewise. + (REFCOUNT_STRUCTELEM): New special refcount range for structure + element siblings. + (REFCOUNT_STRUCTELEM_P): Macro for testing for structure element + sibling maps. + (REFCOUNT_STRUCTELEM_FLAG_FIRST): Flag to indicate first sibling. + (REFCOUNT_STRUCTELEM_FLAG_LAST): Flag to indicate last sibling. + (REFCOUNT_STRUCTELEM_FIRST_P): Macro to test _FIRST flag. + (REFCOUNT_STRUCTELEM_LAST_P): Macro to test _LAST flag. + (struct splay_tree_key_s): Add structelem_refcount and + structelem_refcount_ptr fields into a union with dynamic_refcount. + Add comments. + (gomp_map_vars): Delete declaration. + (gomp_map_vars_async): Likewise. + (gomp_unmap_vars): Likewise. + (gomp_unmap_vars_async): Likewise. + (goacc_map_vars): New declaration. + (goacc_unmap_vars): Likewise. + * oacc-mem.c (acc_map_data): Adjust to use goacc_map_vars. + (goacc_enter_datum): Likewise. + (goacc_enter_data_internal): Likewise. + * oacc-parallel.c (GOACC_parallel_keyed): Adjust to use goacc_map_vars + and goacc_unmap_vars. + (GOACC_data_start): Adjust to use goacc_map_vars. + (GOACC_data_end): Adjust to use goacc_unmap_vars. + * target.c (hash_entry_type): New typedef. + (htab_alloc): New function hook for hashtab.h. + (htab_free): Likewise. + (htab_hash): Likewise. + (htab_eq): Likewise. + (hashtab.h): Add file include. + (gomp_increment_refcount): New function. + (gomp_decrement_refcount): Likewise. + (gomp_map_vars_existing): Add refcount_set parameter, adjust to use + gomp_increment_refcount. + (gomp_map_fields_existing): Add refcount_set parameter, adjust calls + to gomp_map_vars_existing. + (gomp_map_vars_internal): Add refcount_set parameter, add local openmp_p + variable to guard OpenMP specific paths, adjust calls to + gomp_map_vars_existing, add structure element sibling splay_tree_key + sequence creation code, adjust Fortran map case to avoid increment + under OpenMP. + (gomp_map_vars): Adjust to static, add refcount_set parameter, manage + local refcount_set if caller passed in NULL, adjust call to + gomp_map_vars_internal. + (gomp_map_vars_async): Adjust and rename into... + (goacc_map_vars): ...this new function, adjust call to + gomp_map_vars_internal. + (gomp_remove_splay_tree_key): New function with code factored out from + gomp_remove_var_internal. + (gomp_remove_var_internal): Add code to handle removing multiple + splay_tree_key sequence for structure elements, adjust code to use + gomp_remove_splay_tree_key for splay-tree key removal. + (gomp_unmap_vars_internal): Add refcount_set parameter, adjust to use + gomp_decrement_refcount. + (gomp_unmap_vars): Adjust to static, add refcount_set parameter, manage + local refcount_set if caller passed in NULL, adjust call to + gomp_unmap_vars_internal. + (gomp_unmap_vars_async): Adjust and rename into... + (goacc_unmap_vars): ...this new function, adjust call to + gomp_unmap_vars_internal. + (GOMP_target): Manage refcount_set and adjust calls to gomp_map_vars and + gomp_unmap_vars. + (GOMP_target_ext): Likewise. + (gomp_target_data_fallback): Adjust call to gomp_map_vars. + (GOMP_target_data): Likewise. + (GOMP_target_data_ext): Likewise. + (GOMP_target_end_data): Adjust call to gomp_unmap_vars. + (gomp_exit_data): Add refcount_set parameter, adjust to use + gomp_decrement_refcount, adjust to queue splay-tree keys for removal + after main loop. + (GOMP_target_enter_exit_data): Manage refcount_set and adjust calls to + gomp_map_vars and gomp_exit_data. + (gomp_target_task_fn): Likewise. + * testsuite/libgomp.c-c++-common/refcount-1.c: New testcase. + * testsuite/libgomp.c-c++-common/struct-elem-1.c: New testcase. + * testsuite/libgomp.c-c++-common/struct-elem-2.c: New testcase. + * testsuite/libgomp.c-c++-common/struct-elem-3.c: New testcase. + * testsuite/libgomp.c-c++-common/struct-elem-4.c: New testcase. + * testsuite/libgomp.c-c++-common/struct-elem-5.c: New testcase. + 2021-06-15 Tobias Burnus <tobias@codesourcery.com> PR fortran/92568 diff --git a/libgomp/hashtab.h b/libgomp/hashtab.h index 25d6d94..26d8081 100644 --- a/libgomp/hashtab.h +++ b/libgomp/hashtab.h @@ -224,6 +224,15 @@ htab_mod_m2 (hashval_t hash, htab_t htab) return 1 + htab_mod_1 (hash, p->prime - 2, p->inv_m2, p->shift); } +static inline htab_t +htab_clear (htab_t htab) +{ + htab->n_elements = 0; + htab->n_deleted = 0; + memset (htab->entries, 0, htab->size * sizeof (hash_entry_type)); + return htab; +} + /* Create hash table of size SIZE. */ static htab_t @@ -238,11 +247,8 @@ htab_create (size_t size) result = (htab_t) htab_alloc (sizeof (struct htab) + size * sizeof (hash_entry_type)); result->size = size; - result->n_elements = 0; - result->n_deleted = 0; result->size_prime_index = size_prime_index; - memset (result->entries, 0, size * sizeof (hash_entry_type)); - return result; + return htab_clear (result); } /* Similar to htab_find_slot, but without several unwanted side effects: diff --git a/libgomp/libgomp.h b/libgomp/libgomp.h index ef1bb49..8d25dc8 100644 --- a/libgomp/libgomp.h +++ b/libgomp/libgomp.h @@ -1012,11 +1012,35 @@ struct target_mem_desc { struct target_var_desc list[]; }; +/* Special value for refcount - mask to indicate existence of special + values. Right now we allocate 3 bits. */ +#define REFCOUNT_SPECIAL (~(uintptr_t) 0x7) + /* Special value for refcount - infinity. */ -#define REFCOUNT_INFINITY (~(uintptr_t) 0) +#define REFCOUNT_INFINITY (REFCOUNT_SPECIAL | 0) /* Special value for refcount - tgt_offset contains target address of the artificial pointer to "omp declare target link" object. */ -#define REFCOUNT_LINK (~(uintptr_t) 1) +#define REFCOUNT_LINK (REFCOUNT_SPECIAL | 1) + +/* Special value for refcount - structure element sibling list items. + All such key refounts have REFCOUNT_STRUCTELEM bits set, with _FLAG_FIRST + and _FLAG_LAST indicating first and last in the created sibling sequence. */ +#define REFCOUNT_STRUCTELEM (REFCOUNT_SPECIAL | 4) +#define REFCOUNT_STRUCTELEM_P(V) \ + (((V) & REFCOUNT_STRUCTELEM) == REFCOUNT_STRUCTELEM) +/* The first leading key with _FLAG_FIRST set houses the actual reference count + in the structelem_refcount field. Other siblings point to this counter value + through its structelem_refcount_ptr field. */ +#define REFCOUNT_STRUCTELEM_FLAG_FIRST (1) +/* The last key in the sibling sequence has this set. This is required to + indicate the sequence boundary, when we remove the structure sibling list + from the map. */ +#define REFCOUNT_STRUCTELEM_FLAG_LAST (2) + +#define REFCOUNT_STRUCTELEM_FIRST_P(V) \ + (REFCOUNT_STRUCTELEM_P (V) && ((V) & REFCOUNT_STRUCTELEM_FLAG_FIRST)) +#define REFCOUNT_STRUCTELEM_LAST_P(V) \ + (REFCOUNT_STRUCTELEM_P (V) && ((V) & REFCOUNT_STRUCTELEM_FLAG_LAST)) /* Special offset values. */ #define OFFSET_INLINED (~(uintptr_t) 0) @@ -1044,8 +1068,22 @@ struct splay_tree_key_s { uintptr_t tgt_offset; /* Reference count. */ uintptr_t refcount; - /* Dynamic reference count. */ - uintptr_t dynamic_refcount; + union { + /* Dynamic reference count. */ + uintptr_t dynamic_refcount; + + /* Unified reference count for structure element siblings, this is used + when REFCOUNT_STRUCTELEM_FIRST_P(k->refcount) == true, the first sibling + in a structure element sibling list item sequence. */ + uintptr_t structelem_refcount; + + /* When REFCOUNT_STRUCTELEM_P (k->refcount) == true, this field points + into the (above) structelem_refcount field of the _FIRST splay_tree_key, + the first key in the created sequence. All structure element siblings + share a single refcount in this manner. Since these two fields won't be + used at the same time, they are stashed in a union. */ + uintptr_t *structelem_refcount_ptr; + }; struct splay_tree_aux *aux; }; @@ -1200,19 +1238,13 @@ extern void gomp_attach_pointer (struct gomp_device_descr *, extern void gomp_detach_pointer (struct gomp_device_descr *, struct goacc_asyncqueue *, splay_tree_key, uintptr_t, bool, struct gomp_coalesce_buf *); - -extern struct target_mem_desc *gomp_map_vars (struct gomp_device_descr *, - size_t, void **, void **, - size_t *, void *, bool, - enum gomp_map_vars_kind); -extern struct target_mem_desc *gomp_map_vars_async (struct gomp_device_descr *, - struct goacc_asyncqueue *, - size_t, void **, void **, - size_t *, void *, bool, - enum gomp_map_vars_kind); -extern void gomp_unmap_vars (struct target_mem_desc *, bool); -extern void gomp_unmap_vars_async (struct target_mem_desc *, bool, - struct goacc_asyncqueue *); +extern struct target_mem_desc *goacc_map_vars (struct gomp_device_descr *, + struct goacc_asyncqueue *, + size_t, void **, void **, + size_t *, void *, bool, + enum gomp_map_vars_kind); +extern void goacc_unmap_vars (struct target_mem_desc *, bool, + struct goacc_asyncqueue *); extern void gomp_init_device (struct gomp_device_descr *); extern bool gomp_fini_device (struct gomp_device_descr *); extern void gomp_unload_device (struct gomp_device_descr *); diff --git a/libgomp/oacc-mem.c b/libgomp/oacc-mem.c index 123fe15..c21508f 100644 --- a/libgomp/oacc-mem.c +++ b/libgomp/oacc-mem.c @@ -402,9 +402,8 @@ acc_map_data (void *h, void *d, size_t s) gomp_mutex_unlock (&acc_dev->lock); struct target_mem_desc *tgt - = gomp_map_vars (acc_dev, mapnum, &hostaddrs, &devaddrs, &sizes, - &kinds, true, - GOMP_MAP_VARS_OPENACC | GOMP_MAP_VARS_ENTER_DATA); + = goacc_map_vars (acc_dev, NULL, mapnum, &hostaddrs, &devaddrs, &sizes, + &kinds, true, GOMP_MAP_VARS_ENTER_DATA); assert (tgt); assert (tgt->list_count == 1); splay_tree_key n = tgt->list[0].key; @@ -572,9 +571,8 @@ goacc_enter_datum (void **hostaddrs, size_t *sizes, void *kinds, int async) goacc_aq aq = get_goacc_asyncqueue (async); struct target_mem_desc *tgt - = gomp_map_vars_async (acc_dev, aq, mapnum, hostaddrs, NULL, sizes, - kinds, true, (GOMP_MAP_VARS_OPENACC - | GOMP_MAP_VARS_ENTER_DATA)); + = goacc_map_vars (acc_dev, aq, mapnum, hostaddrs, NULL, sizes, + kinds, true, GOMP_MAP_VARS_ENTER_DATA); assert (tgt); assert (tgt->list_count == 1); n = tgt->list[0].key; @@ -1070,7 +1068,7 @@ find_group_last (int pos, size_t mapnum, size_t *sizes, unsigned short *kinds) } /* Map variables for OpenACC "enter data". We can't just call - gomp_map_vars_async once, because individual mapped variables might have + goacc_map_vars once, because individual mapped variables might have "exit data" called for them at different times. */ static void @@ -1202,10 +1200,9 @@ goacc_enter_data_internal (struct gomp_device_descr *acc_dev, size_t mapnum, gomp_mutex_unlock (&acc_dev->lock); struct target_mem_desc *tgt - = gomp_map_vars_async (acc_dev, aq, groupnum, &hostaddrs[i], NULL, - &sizes[i], &kinds[i], true, - (GOMP_MAP_VARS_OPENACC - | GOMP_MAP_VARS_ENTER_DATA)); + = goacc_map_vars (acc_dev, aq, groupnum, &hostaddrs[i], NULL, + &sizes[i], &kinds[i], true, + GOMP_MAP_VARS_ENTER_DATA); assert (tgt); gomp_mutex_lock (&acc_dev->lock); diff --git a/libgomp/oacc-parallel.c b/libgomp/oacc-parallel.c index 939e09f..83625ba 100644 --- a/libgomp/oacc-parallel.c +++ b/libgomp/oacc-parallel.c @@ -290,8 +290,8 @@ GOACC_parallel_keyed (int flags_m, void (*fn) (void *), goacc_aq aq = get_goacc_asyncqueue (async); - tgt = gomp_map_vars_async (acc_dev, aq, mapnum, hostaddrs, NULL, sizes, kinds, - true, GOMP_MAP_VARS_OPENACC); + tgt = goacc_map_vars (acc_dev, aq, mapnum, hostaddrs, NULL, sizes, kinds, + true, 0); if (profiling_p) { prof_info.event_type = acc_ev_enter_data_end; @@ -300,7 +300,7 @@ GOACC_parallel_keyed (int flags_m, void (*fn) (void *), goacc_profiling_dispatch (&prof_info, &enter_exit_data_event_info, &api_info); } - + devaddrs = gomp_alloca (sizeof (void *) * mapnum); for (i = 0; i < mapnum; i++) devaddrs[i] = (void *) gomp_map_val (tgt, hostaddrs, i); @@ -321,11 +321,8 @@ GOACC_parallel_keyed (int flags_m, void (*fn) (void *), &api_info); } - /* If running synchronously, unmap immediately. */ - if (aq == NULL) - gomp_unmap_vars (tgt, true); - else - gomp_unmap_vars_async (tgt, true, aq); + /* If running synchronously (aq == NULL), this will unmap immediately. */ + goacc_unmap_vars (tgt, true, aq); if (profiling_p) { @@ -456,8 +453,7 @@ GOACC_data_start (int flags_m, size_t mapnum, { prof_info.device_type = acc_device_host; api_info.device_type = prof_info.device_type; - tgt = gomp_map_vars (NULL, 0, NULL, NULL, NULL, NULL, true, - GOMP_MAP_VARS_OPENACC); + tgt = goacc_map_vars (NULL, NULL, 0, NULL, NULL, NULL, NULL, true, 0); tgt->prev = thr->mapped_data; thr->mapped_data = tgt; @@ -465,8 +461,8 @@ GOACC_data_start (int flags_m, size_t mapnum, } gomp_debug (0, " %s: prepare mappings\n", __FUNCTION__); - tgt = gomp_map_vars (acc_dev, mapnum, hostaddrs, NULL, sizes, kinds, true, - GOMP_MAP_VARS_OPENACC); + tgt = goacc_map_vars (acc_dev, NULL, mapnum, hostaddrs, NULL, sizes, kinds, + true, 0); gomp_debug (0, " %s: mappings prepared\n", __FUNCTION__); tgt->prev = thr->mapped_data; thr->mapped_data = tgt; @@ -542,7 +538,7 @@ GOACC_data_end (void) gomp_debug (0, " %s: restore mappings\n", __FUNCTION__); thr->mapped_data = tgt->prev; - gomp_unmap_vars (tgt, true); + goacc_unmap_vars (tgt, true, NULL); gomp_debug (0, " %s: mappings restored\n", __FUNCTION__); if (profiling_p) diff --git a/libgomp/target.c b/libgomp/target.c index 2150e5d..bb09d50 100644 --- a/libgomp/target.c +++ b/libgomp/target.c @@ -44,6 +44,23 @@ #include "plugin-suffix.h" #endif +typedef uintptr_t *hash_entry_type; +static inline void * htab_alloc (size_t size) { return gomp_malloc (size); } +static inline void htab_free (void *ptr) { free (ptr); } +#include "hashtab.h" + +static inline hashval_t +htab_hash (hash_entry_type element) +{ + return hash_pointer ((void *) element); +} + +static inline bool +htab_eq (hash_entry_type x, hash_entry_type y) +{ + return x == y; +} + #define FIELD_TGT_EMPTY (~(size_t) 0) static void gomp_target_init (void); @@ -360,6 +377,113 @@ gomp_free_device_memory (struct gomp_device_descr *devicep, void *devptr) } } +/* Increment reference count of a splay_tree_key region K by 1. + If REFCOUNT_SET != NULL, use it to track already seen refcounts, and only + increment the value if refcount is not yet contained in the set (used for + OpenMP 5.0, which specifies that a region's refcount is adjusted at most + once for each construct). */ + +static inline void +gomp_increment_refcount (splay_tree_key k, htab_t *refcount_set) +{ + if (k == NULL || k->refcount == REFCOUNT_INFINITY) + return; + + uintptr_t *refcount_ptr = &k->refcount; + + if (REFCOUNT_STRUCTELEM_FIRST_P (k->refcount)) + refcount_ptr = &k->structelem_refcount; + else if (REFCOUNT_STRUCTELEM_P (k->refcount)) + refcount_ptr = k->structelem_refcount_ptr; + + if (refcount_set) + { + if (htab_find (*refcount_set, refcount_ptr)) + return; + uintptr_t **slot = htab_find_slot (refcount_set, refcount_ptr, INSERT); + *slot = refcount_ptr; + } + + *refcount_ptr += 1; + return; +} + +/* Decrement reference count of a splay_tree_key region K by 1, or if DELETE_P + is true, set reference count to zero. If REFCOUNT_SET != NULL, use it to + track already seen refcounts, and only adjust the value if refcount is not + yet contained in the set (like gomp_increment_refcount). + + Return out-values: set *DO_COPY to true if we set the refcount to zero, or + it is already zero and we know we decremented it earlier. This signals that + associated maps should be copied back to host. + + *DO_REMOVE is set to true when we this is the first handling of this refcount + and we are setting it to zero. This signals a removal of this key from the + splay-tree map. + + Copy and removal are separated due to cases like handling of structure + elements, e.g. each map of a structure element representing a possible copy + out of a structure field has to be handled individually, but we only signal + removal for one (the first encountered) sibing map. */ + +static inline void +gomp_decrement_refcount (splay_tree_key k, htab_t *refcount_set, bool delete_p, + bool *do_copy, bool *do_remove) +{ + if (k == NULL || k->refcount == REFCOUNT_INFINITY) + { + *do_copy = *do_remove = false; + return; + } + + uintptr_t *refcount_ptr = &k->refcount; + + if (REFCOUNT_STRUCTELEM_FIRST_P (k->refcount)) + refcount_ptr = &k->structelem_refcount; + else if (REFCOUNT_STRUCTELEM_P (k->refcount)) + refcount_ptr = k->structelem_refcount_ptr; + + bool new_encountered_refcount; + bool set_to_zero = false; + bool is_zero = false; + + uintptr_t orig_refcount = *refcount_ptr; + + if (refcount_set) + { + if (htab_find (*refcount_set, refcount_ptr)) + { + new_encountered_refcount = false; + goto end; + } + + uintptr_t **slot = htab_find_slot (refcount_set, refcount_ptr, INSERT); + *slot = refcount_ptr; + new_encountered_refcount = true; + } + else + /* If no refcount_set being used, assume all keys are being decremented + for the first time. */ + new_encountered_refcount = true; + + if (delete_p) + *refcount_ptr = 0; + else if (*refcount_ptr > 0) + *refcount_ptr -= 1; + + end: + if (*refcount_ptr == 0) + { + if (orig_refcount > 0) + set_to_zero = true; + + is_zero = true; + } + + *do_copy = (set_to_zero || (!new_encountered_refcount && is_zero)); + *do_remove = (new_encountered_refcount && set_to_zero); +} + /* Handle the case where gomp_map_lookup, splay_tree_lookup or gomp_map_0len_lookup found oldn for newn. Helper function of gomp_map_vars. */ @@ -369,7 +493,8 @@ gomp_map_vars_existing (struct gomp_device_descr *devicep, struct goacc_asyncqueue *aq, splay_tree_key oldn, splay_tree_key newn, struct target_var_desc *tgt_var, unsigned char kind, bool always_to_flag, - struct gomp_coalesce_buf *cbuf) + struct gomp_coalesce_buf *cbuf, + htab_t *refcount_set) { assert (kind != GOMP_MAP_ATTACH); @@ -398,8 +523,7 @@ gomp_map_vars_existing (struct gomp_device_descr *devicep, (void *) newn->host_start, newn->host_end - newn->host_start, cbuf); - if (oldn->refcount != REFCOUNT_INFINITY) - oldn->refcount++; + gomp_increment_refcount (oldn, refcount_set); } static int @@ -453,7 +577,7 @@ gomp_map_fields_existing (struct target_mem_desc *tgt, struct goacc_asyncqueue *aq, splay_tree_key n, size_t first, size_t i, void **hostaddrs, size_t *sizes, void *kinds, - struct gomp_coalesce_buf *cbuf) + struct gomp_coalesce_buf *cbuf, htab_t *refcount_set) { struct gomp_device_descr *devicep = tgt->device_descr; struct splay_tree_s *mem_map = &devicep->mem_map; @@ -471,7 +595,7 @@ gomp_map_fields_existing (struct target_mem_desc *tgt, && n2->host_start - n->host_start == n2->tgt_offset - n->tgt_offset) { gomp_map_vars_existing (devicep, aq, n2, &cur_node, &tgt->list[i], - kind & typemask, false, cbuf); + kind & typemask, false, cbuf, refcount_set); return; } if (sizes[i] == 0) @@ -487,7 +611,7 @@ gomp_map_fields_existing (struct target_mem_desc *tgt, == n2->tgt_offset - n->tgt_offset) { gomp_map_vars_existing (devicep, aq, n2, &cur_node, &tgt->list[i], - kind & typemask, false, cbuf); + kind & typemask, false, cbuf, refcount_set); return; } } @@ -499,7 +623,7 @@ gomp_map_fields_existing (struct target_mem_desc *tgt, && n2->host_start - n->host_start == n2->tgt_offset - n->tgt_offset) { gomp_map_vars_existing (devicep, aq, n2, &cur_node, &tgt->list[i], - kind & typemask, false, cbuf); + kind & typemask, false, cbuf, refcount_set); return; } } @@ -671,11 +795,13 @@ gomp_map_vars_internal (struct gomp_device_descr *devicep, struct goacc_asyncqueue *aq, size_t mapnum, void **hostaddrs, void **devaddrs, size_t *sizes, void *kinds, bool short_mapkind, + htab_t *refcount_set, enum gomp_map_vars_kind pragma_kind) { size_t i, tgt_align, tgt_size, not_found_cnt = 0; bool has_firstprivate = false; bool has_always_ptrset = false; + bool openmp_p = (pragma_kind & GOMP_MAP_VARS_OPENACC) == 0; const int rshift = short_mapkind ? 8 : 3; const int typemask = short_mapkind ? 0xff : 0x7; struct splay_tree_s *mem_map = &devicep->mem_map; @@ -813,7 +939,7 @@ gomp_map_vars_internal (struct gomp_device_descr *devicep, } for (i = first; i <= last; i++) gomp_map_fields_existing (tgt, aq, n, first, i, hostaddrs, - sizes, kinds, NULL); + sizes, kinds, NULL, refcount_set); i--; continue; } @@ -909,7 +1035,8 @@ gomp_map_vars_internal (struct gomp_device_descr *devicep, } } gomp_map_vars_existing (devicep, aq, n, &cur_node, &tgt->list[i], - kind & typemask, always_to_cnt > 0, NULL); + kind & typemask, always_to_cnt > 0, NULL, + refcount_set); i += always_to_cnt; } else @@ -1022,6 +1149,7 @@ gomp_map_vars_internal (struct gomp_device_descr *devicep, splay_tree_node array = tgt->array; size_t j, field_tgt_offset = 0, field_tgt_clear = FIELD_TGT_EMPTY; uintptr_t field_tgt_base = 0; + splay_tree_key field_tgt_structelem_first = NULL; for (i = 0; i < mapnum; i++) if (has_always_ptrset @@ -1064,8 +1192,7 @@ gomp_map_vars_internal (struct gomp_device_descr *devicep, tgt->list[j].copy_from = false; tgt->list[j].always_copy_from = false; tgt->list[j].is_attach = false; - if (k->refcount != REFCOUNT_INFINITY) - k->refcount++; + gomp_increment_refcount (k, refcount_set); gomp_map_pointer (k->tgt, aq, (uintptr_t) *(void **) hostaddrs[j], k->tgt_offset + ((uintptr_t) hostaddrs[j] @@ -1153,13 +1280,14 @@ gomp_map_vars_internal (struct gomp_device_descr *devicep, field_tgt_base = (uintptr_t) hostaddrs[first]; field_tgt_offset = tgt_size; field_tgt_clear = last; + field_tgt_structelem_first = NULL; tgt_size += cur_node.host_end - (uintptr_t) hostaddrs[first]; continue; } for (i = first; i <= last; i++) gomp_map_fields_existing (tgt, aq, n, first, i, hostaddrs, - sizes, kinds, cbufp); + sizes, kinds, cbufp, refcount_set); i--; continue; case GOMP_MAP_ALWAYS_POINTER: @@ -1236,7 +1364,8 @@ gomp_map_vars_internal (struct gomp_device_descr *devicep, splay_tree_key n = splay_tree_lookup (mem_map, k); if (n && n->refcount != REFCOUNT_LINK) gomp_map_vars_existing (devicep, aq, n, k, &tgt->list[i], - kind & typemask, false, cbufp); + kind & typemask, false, cbufp, + refcount_set); else { k->aux = NULL; @@ -1252,10 +1381,33 @@ gomp_map_vars_internal (struct gomp_device_descr *devicep, size_t align = (size_t) 1 << (kind >> rshift); tgt->list[i].key = k; k->tgt = tgt; + k->refcount = 0; + k->dynamic_refcount = 0; if (field_tgt_clear != FIELD_TGT_EMPTY) { k->tgt_offset = k->host_start - field_tgt_base + field_tgt_offset; + if (openmp_p) + { + k->refcount = REFCOUNT_STRUCTELEM; + if (field_tgt_structelem_first == NULL) + { + /* Set to first structure element of sequence. */ + k->refcount |= REFCOUNT_STRUCTELEM_FLAG_FIRST; + field_tgt_structelem_first = k; + } + else + /* Point to refcount of leading element, but do not + increment again. */ + k->structelem_refcount_ptr + = &field_tgt_structelem_first->structelem_refcount; + + if (i == field_tgt_clear) + { + k->refcount |= REFCOUNT_STRUCTELEM_FLAG_LAST; + field_tgt_structelem_first = NULL; + } + } if (i == field_tgt_clear) field_tgt_clear = FIELD_TGT_EMPTY; } @@ -1265,14 +1417,17 @@ gomp_map_vars_internal (struct gomp_device_descr *devicep, k->tgt_offset = tgt_size; tgt_size += k->host_end - k->host_start; } + /* First increment, from 0 to 1. gomp_increment_refcount + encapsulates the different increment cases, so use this + instead of directly setting 1 during initialization. */ + gomp_increment_refcount (k, refcount_set); + tgt->list[i].copy_from = GOMP_MAP_COPY_FROM_P (kind & typemask); tgt->list[i].always_copy_from = GOMP_MAP_ALWAYS_FROM_P (kind & typemask); tgt->list[i].is_attach = false; tgt->list[i].offset = 0; tgt->list[i].length = k->host_end - k->host_start; - k->refcount = 1; - k->dynamic_refcount = 0; tgt->refcount++; array->left = NULL; array->right = NULL; @@ -1328,8 +1483,14 @@ gomp_map_vars_internal (struct gomp_device_descr *devicep, tgt->list[j].always_copy_from = false; tgt->list[j].is_attach = false; tgt->list[i].has_null_ptr_assoc |= !(*(void **) hostaddrs[j]); - if (k->refcount != REFCOUNT_INFINITY) - k->refcount++; + /* For OpenMP, the use of refcount_sets causes + errors if we set k->refcount = 1 above but also + increment it again here, for decrementing will + not properly match, since we decrement only once + for each key's refcount. Therefore avoid this + increment for OpenMP constructs. */ + if (!openmp_p) + gomp_increment_refcount (k, refcount_set); gomp_map_pointer (tgt, aq, (uintptr_t) *(void **) hostaddrs[j], k->tgt_offset @@ -1426,24 +1587,41 @@ gomp_map_vars_internal (struct gomp_device_descr *devicep, return tgt; } -attribute_hidden struct target_mem_desc * +static struct target_mem_desc * gomp_map_vars (struct gomp_device_descr *devicep, size_t mapnum, void **hostaddrs, void **devaddrs, size_t *sizes, void *kinds, - bool short_mapkind, enum gomp_map_vars_kind pragma_kind) + bool short_mapkind, htab_t *refcount_set, + enum gomp_map_vars_kind pragma_kind) { - return gomp_map_vars_internal (devicep, NULL, mapnum, hostaddrs, devaddrs, - sizes, kinds, short_mapkind, pragma_kind); + /* This management of a local refcount_set is for convenience of callers + who do not share a refcount_set over multiple map/unmap uses. */ + htab_t local_refcount_set = NULL; + if (refcount_set == NULL) + { + local_refcount_set = htab_create (mapnum); + refcount_set = &local_refcount_set; + } + + struct target_mem_desc *tgt; + tgt = gomp_map_vars_internal (devicep, NULL, mapnum, hostaddrs, devaddrs, + sizes, kinds, short_mapkind, refcount_set, + pragma_kind); + if (local_refcount_set) + htab_free (local_refcount_set); + + return tgt; } attribute_hidden struct target_mem_desc * -gomp_map_vars_async (struct gomp_device_descr *devicep, - struct goacc_asyncqueue *aq, size_t mapnum, - void **hostaddrs, void **devaddrs, size_t *sizes, - void *kinds, bool short_mapkind, - enum gomp_map_vars_kind pragma_kind) +goacc_map_vars (struct gomp_device_descr *devicep, + struct goacc_asyncqueue *aq, size_t mapnum, + void **hostaddrs, void **devaddrs, size_t *sizes, + void *kinds, bool short_mapkind, + enum gomp_map_vars_kind pragma_kind) { return gomp_map_vars_internal (devicep, aq, mapnum, hostaddrs, devaddrs, - sizes, kinds, short_mapkind, pragma_kind); + sizes, kinds, short_mapkind, NULL, + GOMP_MAP_VARS_OPENACC | pragma_kind); } static void @@ -1481,22 +1659,56 @@ gomp_unref_tgt_void (void *ptr) (void) gomp_unref_tgt (ptr); } -static inline __attribute__((always_inline)) bool -gomp_remove_var_internal (struct gomp_device_descr *devicep, splay_tree_key k, - struct goacc_asyncqueue *aq) +static void +gomp_remove_splay_tree_key (splay_tree sp, splay_tree_key k) { - bool is_tgt_unmapped = false; - splay_tree_remove (&devicep->mem_map, k); + splay_tree_remove (sp, k); if (k->aux) { if (k->aux->link_key) - splay_tree_insert (&devicep->mem_map, - (splay_tree_node) k->aux->link_key); + splay_tree_insert (sp, (splay_tree_node) k->aux->link_key); if (k->aux->attach_count) free (k->aux->attach_count); free (k->aux); k->aux = NULL; } +} + +static inline __attribute__((always_inline)) bool +gomp_remove_var_internal (struct gomp_device_descr *devicep, splay_tree_key k, + struct goacc_asyncqueue *aq) +{ + bool is_tgt_unmapped = false; + + if (REFCOUNT_STRUCTELEM_P (k->refcount)) + { + if (REFCOUNT_STRUCTELEM_FIRST_P (k->refcount) == false) + /* Infer the splay_tree_key of the first structelem key using the + pointer to the first structleme_refcount. */ + k = (splay_tree_key) ((char *) k->structelem_refcount_ptr + - offsetof (struct splay_tree_key_s, + structelem_refcount)); + assert (REFCOUNT_STRUCTELEM_FIRST_P (k->refcount)); + + /* The array created by gomp_map_vars is an array of splay_tree_nodes, + with the splay_tree_keys embedded inside. */ + splay_tree_node node = + (splay_tree_node) ((char *) k + - offsetof (struct splay_tree_node_s, key)); + while (true) + { + /* Starting from the _FIRST key, and continue for all following + sibling keys. */ + gomp_remove_splay_tree_key (&devicep->mem_map, k); + if (REFCOUNT_STRUCTELEM_LAST_P (k->refcount)) + break; + else + k = &(++node)->key; + } + } + else + gomp_remove_splay_tree_key (&devicep->mem_map, k); + if (aq) devicep->openacc.async.queue_callback_func (aq, gomp_unref_tgt_void, (void *) k->tgt); @@ -1530,7 +1742,7 @@ gomp_remove_var_async (struct gomp_device_descr *devicep, splay_tree_key k, static inline __attribute__((always_inline)) void gomp_unmap_vars_internal (struct target_mem_desc *tgt, bool do_copyfrom, - struct goacc_asyncqueue *aq) + htab_t *refcount_set, struct goacc_asyncqueue *aq) { struct gomp_device_descr *devicep = tgt->device_descr; @@ -1573,23 +1785,17 @@ gomp_unmap_vars_internal (struct target_mem_desc *tgt, bool do_copyfrom, if (tgt->list[i].is_attach) continue; - bool do_unmap = false; - if (k->refcount > 1 && k->refcount != REFCOUNT_INFINITY) - k->refcount--; - else if (k->refcount == 1) - { - k->refcount--; - do_unmap = true; - } + bool do_copy, do_remove; + gomp_decrement_refcount (k, refcount_set, false, &do_copy, &do_remove); - if ((do_unmap && do_copyfrom && tgt->list[i].copy_from) + if ((do_copy && do_copyfrom && tgt->list[i].copy_from) || tgt->list[i].always_copy_from) gomp_copy_dev2host (devicep, aq, (void *) (k->host_start + tgt->list[i].offset), (void *) (k->tgt->tgt_start + k->tgt_offset + tgt->list[i].offset), tgt->list[i].length); - if (do_unmap) + if (do_remove) { struct target_mem_desc *k_tgt = k->tgt; bool is_tgt_unmapped = gomp_remove_var (devicep, k); @@ -1610,17 +1816,30 @@ gomp_unmap_vars_internal (struct target_mem_desc *tgt, bool do_copyfrom, gomp_mutex_unlock (&devicep->lock); } -attribute_hidden void -gomp_unmap_vars (struct target_mem_desc *tgt, bool do_copyfrom) +static void +gomp_unmap_vars (struct target_mem_desc *tgt, bool do_copyfrom, + htab_t *refcount_set) { - gomp_unmap_vars_internal (tgt, do_copyfrom, NULL); + /* This management of a local refcount_set is for convenience of callers + who do not share a refcount_set over multiple map/unmap uses. */ + htab_t local_refcount_set = NULL; + if (refcount_set == NULL) + { + local_refcount_set = htab_create (tgt->list_count); + refcount_set = &local_refcount_set; + } + + gomp_unmap_vars_internal (tgt, do_copyfrom, refcount_set, NULL); + + if (local_refcount_set) + htab_free (local_refcount_set); } attribute_hidden void -gomp_unmap_vars_async (struct target_mem_desc *tgt, bool do_copyfrom, - struct goacc_asyncqueue *aq) +goacc_unmap_vars (struct target_mem_desc *tgt, bool do_copyfrom, + struct goacc_asyncqueue *aq) { - gomp_unmap_vars_internal (tgt, do_copyfrom, aq); + gomp_unmap_vars_internal (tgt, do_copyfrom, NULL, aq); } static void @@ -2130,12 +2349,15 @@ GOMP_target (int device, void (*fn) (void *), const void *unused, || !(fn_addr = gomp_get_target_fn_addr (devicep, fn))) return gomp_target_fallback (fn, hostaddrs, devicep); + htab_t refcount_set = htab_create (mapnum); struct target_mem_desc *tgt_vars = gomp_map_vars (devicep, mapnum, hostaddrs, NULL, sizes, kinds, false, - GOMP_MAP_VARS_TARGET); + &refcount_set, GOMP_MAP_VARS_TARGET); devicep->run_func (devicep->target_id, fn_addr, (void *) tgt_vars->tgt_start, NULL); - gomp_unmap_vars (tgt_vars, true); + htab_clear (refcount_set); + gomp_unmap_vars (tgt_vars, true, &refcount_set); + htab_free (refcount_set); } static inline unsigned int @@ -2269,6 +2491,8 @@ GOMP_target_ext (int device, void (*fn) (void *), size_t mapnum, } struct target_mem_desc *tgt_vars; + htab_t refcount_set = NULL; + if (devicep->capabilities & GOMP_OFFLOAD_CAP_SHARED_MEM) { if (!fpc_done) @@ -2285,13 +2509,21 @@ GOMP_target_ext (int device, void (*fn) (void *), size_t mapnum, tgt_vars = NULL; } else - tgt_vars = gomp_map_vars (devicep, mapnum, hostaddrs, NULL, sizes, kinds, - true, GOMP_MAP_VARS_TARGET); + { + refcount_set = htab_create (mapnum); + tgt_vars = gomp_map_vars (devicep, mapnum, hostaddrs, NULL, sizes, kinds, + true, &refcount_set, GOMP_MAP_VARS_TARGET); + } devicep->run_func (devicep->target_id, fn_addr, tgt_vars ? (void *) tgt_vars->tgt_start : hostaddrs, args); if (tgt_vars) - gomp_unmap_vars (tgt_vars, true); + { + htab_clear (refcount_set); + gomp_unmap_vars (tgt_vars, true, &refcount_set); + } + if (refcount_set) + htab_free (refcount_set); } /* Host fallback for GOMP_target_data{,_ext} routines. */ @@ -2314,7 +2546,7 @@ gomp_target_data_fallback (struct gomp_device_descr *devicep) would get out of sync. */ struct target_mem_desc *tgt = gomp_map_vars (NULL, 0, NULL, NULL, NULL, NULL, false, - GOMP_MAP_VARS_DATA); + NULL, GOMP_MAP_VARS_DATA); tgt->prev = icv->target_data; icv->target_data = tgt; } @@ -2333,7 +2565,7 @@ GOMP_target_data (int device, const void *unused, size_t mapnum, struct target_mem_desc *tgt = gomp_map_vars (devicep, mapnum, hostaddrs, NULL, sizes, kinds, false, - GOMP_MAP_VARS_DATA); + NULL, GOMP_MAP_VARS_DATA); struct gomp_task_icv *icv = gomp_icv (true); tgt->prev = icv->target_data; icv->target_data = tgt; @@ -2352,7 +2584,7 @@ GOMP_target_data_ext (int device, size_t mapnum, void **hostaddrs, struct target_mem_desc *tgt = gomp_map_vars (devicep, mapnum, hostaddrs, NULL, sizes, kinds, true, - GOMP_MAP_VARS_DATA); + NULL, GOMP_MAP_VARS_DATA); struct gomp_task_icv *icv = gomp_icv (true); tgt->prev = icv->target_data; icv->target_data = tgt; @@ -2366,7 +2598,7 @@ GOMP_target_end_data (void) { struct target_mem_desc *tgt = icv->target_data; icv->target_data = tgt->prev; - gomp_unmap_vars (tgt, true); + gomp_unmap_vars (tgt, true, NULL); } } @@ -2465,7 +2697,8 @@ GOMP_target_update_ext (int device, size_t mapnum, void **hostaddrs, static void gomp_exit_data (struct gomp_device_descr *devicep, size_t mapnum, - void **hostaddrs, size_t *sizes, unsigned short *kinds) + void **hostaddrs, size_t *sizes, unsigned short *kinds, + htab_t *refcount_set) { const int typemask = 0xff; size_t i; @@ -2489,6 +2722,9 @@ gomp_exit_data (struct gomp_device_descr *devicep, size_t mapnum, false, NULL); } + int nrmvars = 0; + splay_tree_key remove_vars[mapnum]; + for (i = 0; i < mapnum; i++) { struct splay_tree_key_s cur_node; @@ -2510,22 +2746,32 @@ gomp_exit_data (struct gomp_device_descr *devicep, size_t mapnum, if (!k) continue; - if (k->refcount > 0 && k->refcount != REFCOUNT_INFINITY) - k->refcount--; - if ((kind == GOMP_MAP_DELETE - || kind == GOMP_MAP_DELETE_ZERO_LEN_ARRAY_SECTION) - && k->refcount != REFCOUNT_INFINITY) - k->refcount = 0; + bool delete_p = (kind == GOMP_MAP_DELETE + || kind == GOMP_MAP_DELETE_ZERO_LEN_ARRAY_SECTION); + bool do_copy, do_remove; + gomp_decrement_refcount (k, refcount_set, delete_p, &do_copy, + &do_remove); - if ((kind == GOMP_MAP_FROM && k->refcount == 0) + if ((kind == GOMP_MAP_FROM && do_copy) || kind == GOMP_MAP_ALWAYS_FROM) gomp_copy_dev2host (devicep, NULL, (void *) cur_node.host_start, (void *) (k->tgt->tgt_start + k->tgt_offset + cur_node.host_start - k->host_start), cur_node.host_end - cur_node.host_start); - if (k->refcount == 0) - gomp_remove_var (devicep, k); + + /* Structure elements lists are removed altogether at once, which + may cause immediate deallocation of the target_mem_desc, causing + errors if we still have following element siblings to copy back. + While we're at it, it also seems more disciplined to simply + queue all removals together for processing below. + + Structured block unmapping (i.e. gomp_unmap_vars_internal) should + not have this problem, since they maintain an additional + tgt->refcount = 1 reference to the target_mem_desc to start with. + */ + if (do_remove) + remove_vars[nrmvars++] = k; break; case GOMP_MAP_DETACH: @@ -2537,6 +2783,9 @@ gomp_exit_data (struct gomp_device_descr *devicep, size_t mapnum, } } + for (int i = 0; i < nrmvars; i++) + gomp_remove_var (devicep, remove_vars[i]); + gomp_mutex_unlock (&devicep->lock); } @@ -2616,6 +2865,8 @@ GOMP_target_enter_exit_data (int device, size_t mapnum, void **hostaddrs, } } + htab_t refcount_set = htab_create (mapnum); + /* The variables are mapped separately such that they can be released independently. */ size_t i, j; @@ -2624,7 +2875,8 @@ GOMP_target_enter_exit_data (int device, size_t mapnum, void **hostaddrs, if ((kinds[i] & 0xff) == GOMP_MAP_STRUCT) { gomp_map_vars (devicep, sizes[i] + 1, &hostaddrs[i], NULL, &sizes[i], - &kinds[i], true, GOMP_MAP_VARS_ENTER_DATA); + &kinds[i], true, &refcount_set, + GOMP_MAP_VARS_ENTER_DATA); i += sizes[i]; } else if ((kinds[i] & 0xff) == GOMP_MAP_TO_PSET) @@ -2634,7 +2886,8 @@ GOMP_target_enter_exit_data (int device, size_t mapnum, void **hostaddrs, && !GOMP_MAP_ALWAYS_POINTER_P (get_kind (true, kinds, j) & 0xff)) break; gomp_map_vars (devicep, j-i, &hostaddrs[i], NULL, &sizes[i], - &kinds[i], true, GOMP_MAP_VARS_ENTER_DATA); + &kinds[i], true, &refcount_set, + GOMP_MAP_VARS_ENTER_DATA); i += j - i - 1; } else if (i + 1 < mapnum && (kinds[i + 1] & 0xff) == GOMP_MAP_ATTACH) @@ -2642,14 +2895,15 @@ GOMP_target_enter_exit_data (int device, size_t mapnum, void **hostaddrs, /* An attach operation must be processed together with the mapped base-pointer list item. */ gomp_map_vars (devicep, 2, &hostaddrs[i], NULL, &sizes[i], &kinds[i], - true, GOMP_MAP_VARS_ENTER_DATA); + true, &refcount_set, GOMP_MAP_VARS_ENTER_DATA); i += 1; } else gomp_map_vars (devicep, 1, &hostaddrs[i], NULL, &sizes[i], &kinds[i], - true, GOMP_MAP_VARS_ENTER_DATA); + true, &refcount_set, GOMP_MAP_VARS_ENTER_DATA); else - gomp_exit_data (devicep, mapnum, hostaddrs, sizes, kinds); + gomp_exit_data (devicep, mapnum, hostaddrs, sizes, kinds, &refcount_set); + htab_free (refcount_set); } bool @@ -2674,7 +2928,7 @@ gomp_target_task_fn (void *data) if (ttask->state == GOMP_TARGET_TASK_FINISHED) { if (ttask->tgt) - gomp_unmap_vars (ttask->tgt, true); + gomp_unmap_vars (ttask->tgt, true, NULL); return false; } @@ -2688,7 +2942,7 @@ gomp_target_task_fn (void *data) { ttask->tgt = gomp_map_vars (devicep, ttask->mapnum, ttask->hostaddrs, NULL, ttask->sizes, ttask->kinds, true, - GOMP_MAP_VARS_TARGET); + NULL, GOMP_MAP_VARS_TARGET); actual_arguments = (void *) ttask->tgt->tgt_start; } ttask->state = GOMP_TARGET_TASK_READY_TO_RUN; @@ -2707,21 +2961,27 @@ gomp_target_task_fn (void *data) if (ttask->flags & GOMP_TARGET_FLAG_UPDATE) gomp_update (devicep, ttask->mapnum, ttask->hostaddrs, ttask->sizes, ttask->kinds, true); - else if ((ttask->flags & GOMP_TARGET_FLAG_EXIT_DATA) == 0) - for (i = 0; i < ttask->mapnum; i++) - if ((ttask->kinds[i] & 0xff) == GOMP_MAP_STRUCT) - { - gomp_map_vars (devicep, ttask->sizes[i] + 1, &ttask->hostaddrs[i], - NULL, &ttask->sizes[i], &ttask->kinds[i], true, - GOMP_MAP_VARS_ENTER_DATA); - i += ttask->sizes[i]; - } - else - gomp_map_vars (devicep, 1, &ttask->hostaddrs[i], NULL, &ttask->sizes[i], - &ttask->kinds[i], true, GOMP_MAP_VARS_ENTER_DATA); else - gomp_exit_data (devicep, ttask->mapnum, ttask->hostaddrs, ttask->sizes, - ttask->kinds); + { + htab_t refcount_set = htab_create (ttask->mapnum); + if ((ttask->flags & GOMP_TARGET_FLAG_EXIT_DATA) == 0) + for (i = 0; i < ttask->mapnum; i++) + if ((ttask->kinds[i] & 0xff) == GOMP_MAP_STRUCT) + { + gomp_map_vars (devicep, ttask->sizes[i] + 1, &ttask->hostaddrs[i], + NULL, &ttask->sizes[i], &ttask->kinds[i], true, + &refcount_set, GOMP_MAP_VARS_ENTER_DATA); + i += ttask->sizes[i]; + } + else + gomp_map_vars (devicep, 1, &ttask->hostaddrs[i], NULL, &ttask->sizes[i], + &ttask->kinds[i], true, &refcount_set, + GOMP_MAP_VARS_ENTER_DATA); + else + gomp_exit_data (devicep, ttask->mapnum, ttask->hostaddrs, ttask->sizes, + ttask->kinds, &refcount_set); + htab_free (refcount_set); + } return false; } diff --git a/libgomp/testsuite/libgomp.c-c++-common/refcount-1.c b/libgomp/testsuite/libgomp.c-c++-common/refcount-1.c new file mode 100644 index 0000000..5ccd908 --- /dev/null +++ b/libgomp/testsuite/libgomp.c-c++-common/refcount-1.c @@ -0,0 +1,61 @@ +#include <omp.h> +#include <stdlib.h> + +int main (void) +{ + int d = omp_get_default_device (); + int id = omp_get_initial_device (); + + if (d < 0 || d >= omp_get_num_devices ()) + d = id; + + unsigned int a = 0xcdcdcdcd; + #pragma omp target enter data map (to:a) + + a = 0xabababab; + unsigned char *p = (unsigned char *) &a; + unsigned char *q = p + 2; + + #pragma omp target enter data map (alloc:p[:1], q[:1]) + + if (d != id) + { + if (!omp_target_is_present (&a, d)) + abort (); + if (!omp_target_is_present (&p[0], d)) + abort (); + if (!omp_target_is_present (&q[0], d)) + abort (); + } + + #pragma omp target exit data map (release:a) + + if (d != id) + { + if (!omp_target_is_present (&a, d)) + abort (); + if (!omp_target_is_present (&p[0], d)) + abort (); + if (!omp_target_is_present (&q[0], d)) + abort (); + } + + #pragma omp target exit data map (from:q[:1]) + + if (d != id) + { + if (omp_target_is_present (&a, d)) + abort (); + if (omp_target_is_present (&p[0], d)) + abort (); + if (omp_target_is_present (&q[0], d)) + abort (); + + if (q[0] != 0xcd) + abort (); + if (p[0] != 0xab) + abort (); + } + + return 0; +} diff --git a/libgomp/testsuite/libgomp.c-c++-common/struct-elem-1.c b/libgomp/testsuite/libgomp.c-c++-common/struct-elem-1.c new file mode 100644 index 0000000..5f40fd7 --- /dev/null +++ b/libgomp/testsuite/libgomp.c-c++-common/struct-elem-1.c @@ -0,0 +1,29 @@ +#include <omp.h> +#include <stdlib.h> + +struct S +{ + int a, b; +}; +typedef struct S S; + +int main (void) +{ + int d = omp_get_default_device (); + int id = omp_get_initial_device (); + + if (d < 0 || d >= omp_get_num_devices ()) + d = id; + + S s; + #pragma omp target enter data map (alloc: s.a, s.b) + #pragma omp target exit data map (release: s.b) + + /* OpenMP 5.0 structure element mapping rules describe that elements of same + structure variable should allocate/deallocate in a uniform fashion, so + "s.a" should be removed together by above 'exit data'. */ + if (d != id && omp_target_is_present (&s.a, d)) + abort (); + + return 0; +} diff --git a/libgomp/testsuite/libgomp.c-c++-common/struct-elem-2.c b/libgomp/testsuite/libgomp.c-c++-common/struct-elem-2.c new file mode 100644 index 0000000..c50b299 --- /dev/null +++ b/libgomp/testsuite/libgomp.c-c++-common/struct-elem-2.c @@ -0,0 +1,47 @@ +#include <omp.h> +#include <stdlib.h> + +struct S +{ + int a, b, c, d; +}; +typedef struct S S; + +int main (void) +{ + int d = omp_get_default_device (); + int id = omp_get_initial_device (); + + if (d < 0 || d >= omp_get_num_devices ()) + d = id; + + S s; + #pragma omp target enter data map (alloc: s.a, s.b, s.c, s.d) + #pragma omp target enter data map (alloc: s.c) + #pragma omp target enter data map (alloc: s.b, s.d) + #pragma omp target enter data map (alloc: s.a, s.c, s.b) + + #pragma omp target exit data map (release: s.a) + #pragma omp target exit data map (release: s.d) + #pragma omp target exit data map (release: s.c) + #pragma omp target exit data map (release: s.b) + + /* OpenMP 5.0 structure element mapping rules describe that elements of same + structure variable should allocate/deallocate in a uniform fashion, so + all elements of 's' should be removed together by above 'exit data's. */ + if (d != id) + { + if (omp_target_is_present (&s, d)) + abort (); + if (omp_target_is_present (&s.a, d)) + abort (); + if (omp_target_is_present (&s.b, d)) + abort (); + if (omp_target_is_present (&s.c, d)) + abort (); + if (omp_target_is_present (&s.d, d)) + abort (); + } + + return 0; +} diff --git a/libgomp/testsuite/libgomp.c-c++-common/struct-elem-3.c b/libgomp/testsuite/libgomp.c-c++-common/struct-elem-3.c new file mode 100644 index 0000000..e2b6a6a --- /dev/null +++ b/libgomp/testsuite/libgomp.c-c++-common/struct-elem-3.c @@ -0,0 +1,69 @@ +#include <omp.h> +#include <stdlib.h> + +struct S +{ + int a, b, c, d; +}; +typedef struct S S; + +int main (void) +{ + int d = omp_get_default_device (); + int id = omp_get_initial_device (); + + if (d < 0 || d >= omp_get_num_devices ()) + d = id; + + S s; + + #pragma omp target enter data map (alloc: s) + #pragma omp target enter data map (alloc: s) + + #pragma omp target exit data map (release: s.a) + #pragma omp target exit data map (release: s.b) + + /* OpenMP 5.0 structure element mapping rules describe that elements of same + structure variable should allocate/deallocate in a uniform fashion, so + all elements of 's' should be removed together by above 'exit data's. */ + if (d != id) + { + if (omp_target_is_present (&s, d)) + abort (); + if (omp_target_is_present (&s.a, d)) + abort (); + if (omp_target_is_present (&s.b, d)) + abort (); + if (omp_target_is_present (&s.c, d)) + abort (); + if (omp_target_is_present (&s.d, d)) + abort (); + } + + #pragma omp target enter data map (alloc: s.a, s.b) + #pragma omp target enter data map (alloc: s.a) + #pragma omp target enter data map (alloc: s.b) + + #pragma omp target exit data map (release: s) + #pragma omp target exit data map (release: s) + #pragma omp target exit data map (release: s) + + /* OpenMP 5.0 structure element mapping rules describe that elements of same + structure variable should allocate/deallocate in a uniform fashion, so + all elements of 's' should be removed together by above 'exit data's. */ + if (d != id) + { + if (omp_target_is_present (&s, d)) + abort (); + if (omp_target_is_present (&s.a, d)) + abort (); + if (omp_target_is_present (&s.b, d)) + abort (); + if (omp_target_is_present (&s.c, d)) + abort (); + if (omp_target_is_present (&s.d, d)) + abort (); + } + + return 0; +} diff --git a/libgomp/testsuite/libgomp.c-c++-common/struct-elem-4.c b/libgomp/testsuite/libgomp.c-c++-common/struct-elem-4.c new file mode 100644 index 0000000..9a23b4f --- /dev/null +++ b/libgomp/testsuite/libgomp.c-c++-common/struct-elem-4.c @@ -0,0 +1,56 @@ +#include <omp.h> +#include <stdlib.h> + +struct S +{ + int a, b, c, d, e; +}; +typedef struct S S; + +int main (void) +{ + int d = omp_get_default_device (); + int id = omp_get_initial_device (); + + if (d < 0 || d >= omp_get_num_devices ()) + d = id; + + S s = { 1, 2, 3, 4, 5 }; + #pragma omp target enter data map (to:s) + + int *p = &s.b; + int *q = &s.d; + #pragma omp target enter data map (alloc: p[:1], q[:1]) + + s.b = 88; + s.d = 99; + + #pragma omp target exit data map (release: s) + if (d != id) + { + if (!omp_target_is_present (&s, d)) + abort (); + if (!omp_target_is_present (&p[0], d)) + abort (); + if (!omp_target_is_present (&q[0], d)) + abort (); + } + + #pragma omp target exit data map (from: q[:1]) + if (d != id) + { + if (omp_target_is_present (&s, d)) + abort (); + if (omp_target_is_present (&p[0], d)) + abort (); + if (omp_target_is_present (&q[0], d)) + abort (); + + if (q[0] != 4) + abort (); + if (p[0] != 88) + abort (); + } + + return 0; +} diff --git a/libgomp/testsuite/libgomp.c-c++-common/struct-elem-5.c b/libgomp/testsuite/libgomp.c-c++-common/struct-elem-5.c new file mode 100644 index 0000000..814c301 --- /dev/null +++ b/libgomp/testsuite/libgomp.c-c++-common/struct-elem-5.c @@ -0,0 +1,20 @@ +/* { dg-do run } */ + +struct S +{ + int a, b, c; +}; +typedef struct S S; + +int main (void) +{ + S s; + #pragma omp target data map (alloc: s.a, s.c) + { + #pragma omp target enter data map (alloc: s.b) + } + + return 0; +} +/* { dg-output "Trying to map into device \\\[\[0-9a-fA-FxX\]+..\[0-9a-fA-FxX\]+\\\) structure element when other mapped elements from the same structure weren't mapped together with it" } */ +/* { dg-shouldfail "" } */ diff --git a/libitm/ChangeLog b/libitm/ChangeLog index 7b3dff0..cffd7e1 100644 --- a/libitm/ChangeLog +++ b/libitm/ChangeLog @@ -1,3 +1,8 @@ +2021-06-17 Jonathan Wakely <jwakely@redhat.com> + + PR libstdc++/91488 + * testsuite/libitm.c++/libstdc++-pr91488.C: New test. + 2021-01-15 Jakub Jelinek <jakub@redhat.com> PR target/70454 diff --git a/libitm/testsuite/libitm.c++/libstdc++-pr91488.C b/libitm/testsuite/libitm.c++/libstdc++-pr91488.C new file mode 100644 index 0000000..e9e82bd --- /dev/null +++ b/libitm/testsuite/libitm.c++/libstdc++-pr91488.C @@ -0,0 +1,9 @@ +// PR libstdc++/91488 "inlining failed in call to always_inline" +// { dg-do run } +// { dg-additional-options "-O1" } + +#include <string> + +int main() { + return std::char_traits<char>::length(""); +} diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index eaebcea..bab0964 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,218 @@ +2021-06-20 Patrick Palka <ppalka@redhat.com> + + * include/std/ranges (__non_propagating_cache::operator bool): + Define for split_view::begin(). + (split_view): Define as per P2210. + (views::__detail::__can_split_view): Define. + (views::_Split, views::split): Define. + * testsuite/std/ranges/adaptors/100577.cc (test01, test02): + Test views::split. + * testsuite/std/ranges/adaptors/split.cc: New test. + * testsuite/std/ranges/p2325.cc (test08a): New test. + * testsuite/std/ranges/p2367.cc (test01): Test views::split. + +2021-06-20 Patrick Palka <ppalka@redhat.com> + + * include/std/ranges: Rename views::split to views::lazy_split, + split_view to lazy_split_view, etc. throughout. + * testsuite/std/ranges/*: Likewise. + * testsuite/std/ranges/adaptors/lazy_split.cc: New file. + * testsuite/std/ranges/adaptors/lazy_split_neg.cc: New file. + +2021-06-20 Patrick Palka <ppalka@redhat.com> + + * include/std/ranges (split_view::_OuterIter::__at_end): + Check _M_trailing_empty. + (split_view::_OuterIter::_M_trailing_empty): Define this + data member. + (split_view::_OuterIter::operator++): Set _M_trailing_empty + appropriately. + (split_view::_OuterIter::operator==): Compare + _M_trailing_empty. + * testsuite/std/ranges/adaptors/100479.cc (test03): Expect two + split parts instead of one. + * testsuite/std/ranges/adaptors/split.cc (test11): New test. + +2021-06-20 Patrick Palka <ppalka@redhat.com> + + * include/std/ranges (split_view::_InnerIter::base): Define as + per P2210. + +2021-06-19 Patrick Palka <ppalka@redhat.com> + + * include/std/ranges (transform_view::_Iterator::_S_iter_concept): + Consider _Base instead of _Vp as per LWG 3555. + (elements_view::_Iterator::_S_iter_concept): Likewise. + +2021-06-19 Patrick Palka <ppalka@redhat.com> + + * include/std/ranges (split_view::_OuterIter::value_type::begin): + Remove the non-const overload, and remove the copyable constraint + on the const overload as per LWG 3553. + +2021-06-19 Patrick Palka <ppalka@redhat.com> + + * include/bits/stl_iterator.h + (__detail::__common_iter_use_postfix_proxy): Add + move_constructible constraint as per LWG 3546. + (common_iterator::__postfix_proxy): Adjust initializer of + _M_keep as per LWG 3546. + +2021-06-18 Patrick Palka <ppalka@redhat.com> + + PR libstdc++/100387 + * include/bits/ranges_algo.h (__minmax_fn::operator()): Rewrite + to limit comparison complexity to 3*N/2. + (__minmax_element_fn::operator()): Likewise. + (shift_right): Avoid premature std::move of __result. + * testsuite/25_algorithms/minmax/constrained.cc (test04, test05): + New tests. + * testsuite/25_algorithms/minmax_element/constrained.cc (test02): + Likewise. + +2021-06-18 Patrick Palka <ppalka@redhat.com> + + * include/std/concepts (convertible_to): Just use declval as per + LWG 3557. + +2021-06-18 Jonathan Wakely <jwakely@redhat.com> + + PR libstdc++/95833 + * include/std/numeric (reduce(Iter, Iter, T, BinaryOp)): Replace + incorrect static_assert with ones matching the 'Mandates' + conditions in the standard. + * testsuite/26_numerics/reduce/95833.cc: New test. + +2021-06-18 Jonathan Wakely <jwakely@redhat.com> + + * testsuite/21_strings/basic_string/cons/char/1.cc: Use + diagnostic pragma to suppress -Wstringop-overread error. + +2021-06-18 Patrick Palka <ppalka@redhat.com> + + * include/bits/ranges_algo.h (__find_fn, find, __find_if_fn) + (find_if, __find_if_not_fn, find_if_not, _in_in_result) + (__mismatch_fn, mismatch, __search_fn, search): Move to ... + * include/bits/ranges_util.h: ... here. + * include/std/ranges (__detail::find, __detail::find_if) + (__detail::find_if_not, __detail::mismatch): Remove. + (filter_view): Use ranges::find_if instead. + (drop_while_view): Use ranges::find_if_not instead. + (split_view): Use ranges::find and ranges::mismatch instead. + +2021-06-18 Patrick Palka <ppalka@redhat.com> + + * include/bits/iterator_concepts.h (weakly_incrementable): Remove + default_initializable requirement. + * include/bits/ranges_base.h (ranges::view): Likewise. + * include/bits/ranges_util.h (subrange): Constrain the default + ctor. + * include/bits/stl_iterator.h (back_insert_iterator): Remove the + default ctor. + (front_insert_iterator): Likewise. + (insert_iterator): Likewise. Remove NSDMIs. + (common_iterator): Constrain the default ctor. + (counted_iterator): Likewise. + * include/bits/stream_iterator.h (ostream_iterator): Remove the + default ctor. + * include/std/ranges (__detail::__box::operator=): Handle + self-assignment in the primary template. + (__detail::__box): In the partial specialization: adjust + constraints as per P2325. Add specialized operator= for the + case when the wrapped type is not copyable. Constrain the + default ctor. Avoid list-initialization. + (single_view): Constraint the default ctor. + (iota_view): Relax semiregular constraint to copyable. + Constrain the default ctor. + (iota_view::_Iterator): Constraint the default ctor. + (basic_istream_view): Remove the default ctor. Remove NSDMIs. + Remove redundant checks for empty _M_stream. + (basic_istream_view::_Iterator): Likewise. + (ref_view): Remove the default ctor. Remove NSDMIs. + (ref_view::_Iterator): Constrain the default ctor. + (__detail::__non_propagating_cache::operator=): Define overload + for assigning from a value of the underlying type. + (filter_view): Likewise. + (filter_view::_Iterator): Likewise. + (transform_view): Likewise. + (transform_view::_Iterator): Likewise. + (take_view): Likewise. + (take_view::_Iterator): Likewise. + (take_while_view): Likewise. + (take_while_view::_Iterator): Likewise. + (drop_while_view): Likewise. + (drop_while_view::_Iterator): Likewise. + (join_view): Likewise. + (split_view::_OuterIter::__current): Adjust after changing the + type of _M_current. + (split_view::_M_current): Wrap it in a __non_propagating_cache. + (split_view::split_view): Constrain the default ctor. + (common_view): Constrain the default ctor. + (reverse_view): Likewise. + (elements_view): Likewise. + * include/std/span (enable_view<span<_ElementType, _Extent>>): + Define this partial specialization to true unconditionally. + * include/std/version (__cpp_lib_ranges): Adjust value. + * testsuite/24_iterators/back_insert_iterator/constexpr.cc: + Don't attempt to default construct a back_insert_iterator. + * testsuite/24_iterators/front_insert_iterator/constexpr.cc: + Don't attempt to default construct a front_insert_iterator. + * testsuite/24_iterators/insert_iterator/constexpr.cc: + Don't attempt to default construct an insert_iterator. + * testsuite/24_iterators/ostream_iterator/requirements/constexpr.cc: + Remove this test for default constructibility of ostream_iterator. + * testsuite/std/ranges/97600.cc: Don't attempt to default + construct a basic_istream_view. + * testsuite/std/ranges/adaptors/detail/semiregular_box.cc: + Rename to ... + * testsuite/std/ranges/adaptors/detail/copyable_box.cc: ... this. + (test02): Adjust now that __box is copyable-box not + semiregular-box. + (test03): New test. + * testsuite/std/ranges/p2325.cc: New test. + * testsuite/std/ranges/single_view.cc (test06): New test. + * testsuite/std/ranges/view.cc: Adjust now that view doesn't + require default_initializable. + +2021-06-17 Jonathan Wakely <jwakely@redhat.com> + + PR libstdc++/91488 + * include/bits/basic_string.h (__cpp_lib_constexpr_string): Only + define when is_constant_evaluated is available. + * include/bits/char_traits.h (__cpp_lib_constexpr_char_traits): + Likewise. + (__constant_string_p, __constant_array_p): Remove. + (char_traits): Use is_constant_evaluated directly. + * include/std/version (__cpp_lib_constexpr_char_traits) + (__cpp_lib_constexpr_string): Only define when + is_constant_evaluated is available. + +2021-06-17 Patrick Palka <ppalka@redhat.com> + + PR libstdc++/100940 + * include/std/ranges (__adaptor::_Partial): For the "simple" + forwarding partial specializations, also require that + the extra arguments are trivially copyable. + * testsuite/std/ranges/adaptors/100577.cc (test04): New test. + +2021-06-17 Patrick Palka <ppalka@redhat.com> + + PR libstdc++/100940 + * include/std/ranges (__adaptor::_RangeAdaptor): Document the + template form of _S_has_simple_extra_args. + (__adaptor::__adaptor_has_simple_extra_args): Add _Args template + parameter pack. Try to treat _S_has_simple_extra_args as a + variable template parameterized by _Args. + (__adaptor::_Partial): Pass _Arg/_Args to the constraint + __adaptor_has_simple_extra_args. + (views::_Take::_S_has_simple_extra_args): Templatize according + to the type of the extra argument. + (views::_Drop::_S_has_simple_extra_args): Likewise. + (views::_Split::_S_has_simple_extra_args): Define. + * testsuite/std/ranges/adaptors/100577.cc (test01, test02): + Adjust after changes to _S_has_simple_extra_args mechanism. + (test03): Define. + 2021-06-16 Jonathan Wakely <jwakely@redhat.com> * include/bits/iterator_concepts.h (__decay_copy): Name type. diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h index 84356ad..9911d4d 100644 --- a/libstdc++-v3/include/bits/basic_string.h +++ b/libstdc++-v3/include/bits/basic_string.h @@ -52,12 +52,13 @@ namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION -#if __cplusplus == 201703L +#ifdef __cpp_lib_is_constant_evaluated +// Support P1032R1 in C++20 (but not P0980R1 yet). +# define __cpp_lib_constexpr_string 201811L +#elif __cplusplus >= 201703L && _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED // Support P0426R1 changes to char_traits in C++17. # define __cpp_lib_constexpr_string 201611L #elif __cplusplus > 201703L -// Also support P1032R1 in C++20 (but not P0980R1 yet). -# define __cpp_lib_constexpr_string 201811L #endif #if _GLIBCXX_USE_CXX11_ABI diff --git a/libstdc++-v3/include/bits/char_traits.h b/libstdc++-v3/include/bits/char_traits.h index 95fb7c1..3da6e28 100644 --- a/libstdc++-v3/include/bits/char_traits.h +++ b/libstdc++-v3/include/bits/char_traits.h @@ -235,62 +235,12 @@ namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION -#if __cplusplus >= 201703L - -#if __cplusplus == 201703L -// Unofficial macro indicating P0426R1 support -# define __cpp_lib_constexpr_char_traits 201611L -#else -// Also support P1032R1 in C++20 +#ifdef __cpp_lib_is_constant_evaluated +// Unofficial macro indicating P1032R1 support in C++20 # define __cpp_lib_constexpr_char_traits 201811L -#endif - - /** - * @brief Determine whether the characters of a NULL-terminated - * string are known at compile time. - * @param __s The string. - * - * Assumes that _CharT is a built-in character type. - */ - template<typename _CharT> - static _GLIBCXX_ALWAYS_INLINE constexpr bool - __constant_string_p(const _CharT* __s) - { -#ifdef _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED - (void) __s; - // In constexpr contexts all strings should be constant. - return __builtin_is_constant_evaluated(); -#else - while (__builtin_constant_p(*__s) && *__s) - __s++; - return __builtin_constant_p(*__s); -#endif - } - - /** - * @brief Determine whether the characters of a character array are - * known at compile time. - * @param __a The character array. - * @param __n Number of characters. - * - * Assumes that _CharT is a built-in character type. - */ - template<typename _CharT> - static _GLIBCXX_ALWAYS_INLINE constexpr bool - __constant_char_array_p(const _CharT* __a, size_t __n) - { -#ifdef _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED - (void) __a; - (void) __n; - // In constexpr contexts all character arrays should be constant. - return __builtin_is_constant_evaluated(); -#else - size_t __i = 0; - while (__i < __n && __builtin_constant_p(__a[__i])) - __i++; - return __i == __n; -#endif - } +#elif __cplusplus >= 201703L && _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED +// Unofficial macro indicating P0426R1 support in C++17 +# define __cpp_lib_constexpr_char_traits 201611L #endif // 21.1 @@ -345,10 +295,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { if (__n == 0) return 0; -#if __cplusplus >= 201703L - if (__builtin_constant_p(__n) - && __constant_char_array_p(__s1, __n) - && __constant_char_array_p(__s2, __n)) +#if __cplusplus >= 201703L && _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED + if (__builtin_is_constant_evaluated()) { for (size_t __i = 0; __i < __n; ++__i) if (lt(__s1[__i], __s2[__i])) @@ -364,8 +312,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION static _GLIBCXX17_CONSTEXPR size_t length(const char_type* __s) { -#if __cplusplus >= 201703L - if (__constant_string_p(__s)) +#if __cplusplus >= 201703L && _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED + if (__builtin_is_constant_evaluated()) return __gnu_cxx::char_traits<char_type>::length(__s); #endif return __builtin_strlen(__s); @@ -376,10 +324,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { if (__n == 0) return 0; -#if __cplusplus >= 201703L - if (__builtin_constant_p(__n) - && __builtin_constant_p(__a) - && __constant_char_array_p(__s, __n)) +#if __cplusplus >= 201703L && _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED + if (__builtin_is_constant_evaluated()) return __gnu_cxx::char_traits<char_type>::find(__s, __n, __a); #endif return static_cast<const char_type*>(__builtin_memchr(__s, __a, __n)); @@ -476,10 +422,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { if (__n == 0) return 0; -#if __cplusplus >= 201703L - if (__builtin_constant_p(__n) - && __constant_char_array_p(__s1, __n) - && __constant_char_array_p(__s2, __n)) +#if __cplusplus >= 201703L && _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED + if (__builtin_is_constant_evaluated()) return __gnu_cxx::char_traits<char_type>::compare(__s1, __s2, __n); #endif return wmemcmp(__s1, __s2, __n); @@ -488,8 +432,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION static _GLIBCXX17_CONSTEXPR size_t length(const char_type* __s) { -#if __cplusplus >= 201703L - if (__constant_string_p(__s)) +#if __cplusplus >= 201703L && _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED + if (__builtin_is_constant_evaluated()) return __gnu_cxx::char_traits<char_type>::length(__s); #endif return wcslen(__s); @@ -500,10 +444,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { if (__n == 0) return 0; -#if __cplusplus >= 201703L - if (__builtin_constant_p(__n) - && __builtin_constant_p(__a) - && __constant_char_array_p(__s, __n)) +#if __cplusplus >= 201703L && _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED + if (__builtin_is_constant_evaluated()) return __gnu_cxx::char_traits<char_type>::find(__s, __n, __a); #endif return wmemchr(__s, __a, __n); @@ -597,10 +539,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { if (__n == 0) return 0; -#if __cplusplus > 201402 - if (__builtin_constant_p(__n) - && __constant_char_array_p(__s1, __n) - && __constant_char_array_p(__s2, __n)) +#if __cplusplus >= 201703L && _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED + if (__builtin_is_constant_evaluated()) return __gnu_cxx::char_traits<char_type>::compare(__s1, __s2, __n); #endif return __builtin_memcmp(__s1, __s2, __n); @@ -609,8 +549,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION static _GLIBCXX17_CONSTEXPR size_t length(const char_type* __s) { -#if __cplusplus > 201402 - if (__constant_string_p(__s)) +#if __cplusplus >= 201703L && _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED + if (__builtin_is_constant_evaluated()) return __gnu_cxx::char_traits<char_type>::length(__s); #endif size_t __i = 0; @@ -624,10 +564,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { if (__n == 0) return 0; -#if __cplusplus > 201402 - if (__builtin_constant_p(__n) - && __builtin_constant_p(__a) - && __constant_char_array_p(__s, __n)) +#if __cplusplus >= 201703L && _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED + if (__builtin_is_constant_evaluated()) return __gnu_cxx::char_traits<char_type>::find(__s, __n, __a); #endif return static_cast<const char_type*>(__builtin_memchr(__s, __a, __n)); diff --git a/libstdc++-v3/include/bits/iterator_concepts.h b/libstdc++-v3/include/bits/iterator_concepts.h index 11748e5..c273056 100644 --- a/libstdc++-v3/include/bits/iterator_concepts.h +++ b/libstdc++-v3/include/bits/iterator_concepts.h @@ -594,8 +594,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// Requirements on types that can be incremented with ++. template<typename _Iter> - concept weakly_incrementable = default_initializable<_Iter> - && movable<_Iter> + concept weakly_incrementable = movable<_Iter> && requires(_Iter __i) { typename iter_difference_t<_Iter>; diff --git a/libstdc++-v3/include/bits/ranges_algo.h b/libstdc++-v3/include/bits/ranges_algo.h index ecf1378..83371a4 100644 --- a/libstdc++-v3/include/bits/ranges_algo.h +++ b/libstdc++-v3/include/bits/ranges_algo.h @@ -234,91 +234,7 @@ namespace ranges inline constexpr __for_each_n_fn for_each_n{}; - struct __find_fn - { - template<input_iterator _Iter, sentinel_for<_Iter> _Sent, typename _Tp, - typename _Proj = identity> - requires indirect_binary_predicate<ranges::equal_to, - projected<_Iter, _Proj>, const _Tp*> - constexpr _Iter - operator()(_Iter __first, _Sent __last, - const _Tp& __value, _Proj __proj = {}) const - { - while (__first != __last - && !(std::__invoke(__proj, *__first) == __value)) - ++__first; - return __first; - } - - template<input_range _Range, typename _Tp, typename _Proj = identity> - requires indirect_binary_predicate<ranges::equal_to, - projected<iterator_t<_Range>, _Proj>, - const _Tp*> - constexpr borrowed_iterator_t<_Range> - operator()(_Range&& __r, const _Tp& __value, _Proj __proj = {}) const - { - return (*this)(ranges::begin(__r), ranges::end(__r), - __value, std::move(__proj)); - } - }; - - inline constexpr __find_fn find{}; - - struct __find_if_fn - { - template<input_iterator _Iter, sentinel_for<_Iter> _Sent, - typename _Proj = identity, - indirect_unary_predicate<projected<_Iter, _Proj>> _Pred> - constexpr _Iter - operator()(_Iter __first, _Sent __last, - _Pred __pred, _Proj __proj = {}) const - { - while (__first != __last - && !(bool)std::__invoke(__pred, std::__invoke(__proj, *__first))) - ++__first; - return __first; - } - - template<input_range _Range, typename _Proj = identity, - indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> - _Pred> - constexpr borrowed_iterator_t<_Range> - operator()(_Range&& __r, _Pred __pred, _Proj __proj = {}) const - { - return (*this)(ranges::begin(__r), ranges::end(__r), - std::move(__pred), std::move(__proj)); - } - }; - - inline constexpr __find_if_fn find_if{}; - - struct __find_if_not_fn - { - template<input_iterator _Iter, sentinel_for<_Iter> _Sent, - typename _Proj = identity, - indirect_unary_predicate<projected<_Iter, _Proj>> _Pred> - constexpr _Iter - operator()(_Iter __first, _Sent __last, - _Pred __pred, _Proj __proj = {}) const - { - while (__first != __last - && (bool)std::__invoke(__pred, std::__invoke(__proj, *__first))) - ++__first; - return __first; - } - - template<input_range _Range, typename _Proj = identity, - indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> - _Pred> - constexpr borrowed_iterator_t<_Range> - operator()(_Range&& __r, _Pred __pred, _Proj __proj = {}) const - { - return (*this)(ranges::begin(__r), ranges::end(__r), - std::move(__pred), std::move(__proj)); - } - }; - - inline constexpr __find_if_not_fn find_if_not{}; + // find, find_if and find_if_not are defined in <bits/ranges_util.h>. struct __find_first_of_fn { @@ -421,134 +337,7 @@ namespace ranges inline constexpr __count_if_fn count_if{}; - template<typename _Iter1, typename _Iter2> - struct in_in_result - { - [[no_unique_address]] _Iter1 in1; - [[no_unique_address]] _Iter2 in2; - - template<typename _IIter1, typename _IIter2> - requires convertible_to<const _Iter1&, _IIter1> - && convertible_to<const _Iter2&, _IIter2> - constexpr - operator in_in_result<_IIter1, _IIter2>() const & - { return {in1, in2}; } - - template<typename _IIter1, typename _IIter2> - requires convertible_to<_Iter1, _IIter1> - && convertible_to<_Iter2, _IIter2> - constexpr - operator in_in_result<_IIter1, _IIter2>() && - { return {std::move(in1), std::move(in2)}; } - }; - - template<typename _Iter1, typename _Iter2> - using mismatch_result = in_in_result<_Iter1, _Iter2>; - - struct __mismatch_fn - { - template<input_iterator _Iter1, sentinel_for<_Iter1> _Sent1, - input_iterator _Iter2, sentinel_for<_Iter2> _Sent2, - typename _Pred = ranges::equal_to, - typename _Proj1 = identity, typename _Proj2 = identity> - requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2> - constexpr mismatch_result<_Iter1, _Iter2> - operator()(_Iter1 __first1, _Sent1 __last1, - _Iter2 __first2, _Sent2 __last2, _Pred __pred = {}, - _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const - { - while (__first1 != __last1 && __first2 != __last2 - && (bool)std::__invoke(__pred, - std::__invoke(__proj1, *__first1), - std::__invoke(__proj2, *__first2))) - { - ++__first1; - ++__first2; - } - return { std::move(__first1), std::move(__first2) }; - } - - template<input_range _Range1, input_range _Range2, - typename _Pred = ranges::equal_to, - typename _Proj1 = identity, typename _Proj2 = identity> - requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>, - _Pred, _Proj1, _Proj2> - constexpr mismatch_result<iterator_t<_Range1>, iterator_t<_Range2>> - operator()(_Range1&& __r1, _Range2&& __r2, _Pred __pred = {}, - _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const - { - return (*this)(ranges::begin(__r1), ranges::end(__r1), - ranges::begin(__r2), ranges::end(__r2), - std::move(__pred), - std::move(__proj1), std::move(__proj2)); - } - }; - - inline constexpr __mismatch_fn mismatch{}; - - struct __search_fn - { - template<forward_iterator _Iter1, sentinel_for<_Iter1> _Sent1, - forward_iterator _Iter2, sentinel_for<_Iter2> _Sent2, - typename _Pred = ranges::equal_to, - typename _Proj1 = identity, typename _Proj2 = identity> - requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2> - constexpr subrange<_Iter1> - operator()(_Iter1 __first1, _Sent1 __last1, - _Iter2 __first2, _Sent2 __last2, _Pred __pred = {}, - _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const - { - if (__first1 == __last1 || __first2 == __last2) - return {__first1, __first1}; - - for (;;) - { - for (;;) - { - if (__first1 == __last1) - return {__first1, __first1}; - if (std::__invoke(__pred, - std::__invoke(__proj1, *__first1), - std::__invoke(__proj2, *__first2))) - break; - ++__first1; - } - auto __cur1 = __first1; - auto __cur2 = __first2; - for (;;) - { - if (++__cur2 == __last2) - return {__first1, ++__cur1}; - if (++__cur1 == __last1) - return {__cur1, __cur1}; - if (!(bool)std::__invoke(__pred, - std::__invoke(__proj1, *__cur1), - std::__invoke(__proj2, *__cur2))) - { - ++__first1; - break; - } - } - } - } - - template<forward_range _Range1, forward_range _Range2, - typename _Pred = ranges::equal_to, - typename _Proj1 = identity, typename _Proj2 = identity> - requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>, - _Pred, _Proj1, _Proj2> - constexpr borrowed_subrange_t<_Range1> - operator()(_Range1&& __r1, _Range2&& __r2, _Pred __pred = {}, - _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const - { - return (*this)(ranges::begin(__r1), ranges::end(__r1), - ranges::begin(__r2), ranges::end(__r2), - std::move(__pred), - std::move(__proj1), std::move(__proj2)); - } - }; - - inline constexpr __search_fn search{}; + // in_in_result, mismatch and search are defined in <bits/ranges_util.h>. struct __search_n_fn { @@ -3287,26 +3076,59 @@ namespace ranges template<input_range _Range, typename _Proj = identity, indirect_strict_weak_order<projected<iterator_t<_Range>, _Proj>> _Comp = ranges::less> - requires indirectly_copyable_storable<iterator_t<_Range>, - range_value_t<_Range>*> + requires indirectly_copyable_storable<iterator_t<_Range>, range_value_t<_Range>*> constexpr minmax_result<range_value_t<_Range>> operator()(_Range&& __r, _Comp __comp = {}, _Proj __proj = {}) const { auto __first = ranges::begin(__r); auto __last = ranges::end(__r); __glibcxx_assert(__first != __last); + auto __comp_proj = __detail::__make_comp_proj(__comp, __proj); minmax_result<range_value_t<_Range>> __result = {*__first, *__first}; + if (++__first == __last) + return __result; + else + { + // At this point __result.min == __result.max, so a single + // comparison with the next element suffices. + auto&& __val = *__first; + if (__comp_proj(__val, __result.min)) + __result.min = std::forward<decltype(__val)>(__val); + else + __result.max = std::forward<decltype(__val)>(__val); + } while (++__first != __last) { - auto __tmp = *__first; - if (std::__invoke(__comp, - std::__invoke(__proj, __tmp), - std::__invoke(__proj, __result.min))) - __result.min = std::move(__tmp); - if (!(bool)std::__invoke(__comp, - std::__invoke(__proj, __tmp), - std::__invoke(__proj, __result.max))) - __result.max = std::move(__tmp); + // Now process two elements at a time so that we perform at most + // 1 + 3*(N-2)/2 comparisons in total (each of the (N-2)/2 + // iterations of this loop performs three comparisons). + range_value_t<_Range> __val1 = *__first; + if (++__first == __last) + { + // N is odd; in this final iteration, we perform at most two + // comparisons, for a total of 1 + 3*(N-3)/2 + 2 comparisons, + // which is not more than 3*N/2, as required. + if (__comp_proj(__val1, __result.min)) + __result.min = std::move(__val1); + else if (!__comp_proj(__val1, __result.max)) + __result.max = std::move(__val1); + break; + } + auto&& __val2 = *__first; + if (!__comp_proj(__val2, __val1)) + { + if (__comp_proj(__val1, __result.min)) + __result.min = std::move(__val1); + if (!__comp_proj(__val2, __result.max)) + __result.max = std::forward<decltype(__val2)>(__val2); + } + else + { + if (__comp_proj(__val2, __result.min)) + __result.min = std::forward<decltype(__val2)>(__val2); + if (!__comp_proj(__val1, __result.max)) + __result.max = std::move(__val1); + } } return __result; } @@ -3412,21 +3234,50 @@ namespace ranges operator()(_Iter __first, _Sent __last, _Comp __comp = {}, _Proj __proj = {}) const { - if (__first == __last) - return {__first, __first}; - + auto __comp_proj = __detail::__make_comp_proj(__comp, __proj); minmax_element_result<_Iter> __result = {__first, __first}; - auto __i = __first; - while (++__i != __last) + if (__first == __last || ++__first == __last) + return __result; + else { - if (std::__invoke(__comp, - std::__invoke(__proj, *__i), - std::__invoke(__proj, *__result.min))) - __result.min = __i; - if (!(bool)std::__invoke(__comp, - std::__invoke(__proj, *__i), - std::__invoke(__proj, *__result.max))) - __result.max = __i; + // At this point __result.min == __result.max, so a single + // comparison with the next element suffices. + if (__comp_proj(*__first, *__result.min)) + __result.min = __first; + else + __result.max = __first; + } + while (++__first != __last) + { + // Now process two elements at a time so that we perform at most + // 1 + 3*(N-2)/2 comparisons in total (each of the (N-2)/2 + // iterations of this loop performs three comparisons). + auto __prev = __first; + if (++__first == __last) + { + // N is odd; in this final iteration, we perform at most two + // comparisons, for a total of 1 + 3*(N-3)/2 + 2 comparisons, + // which is not more than 3*N/2, as required. + if (__comp_proj(*__prev, *__result.min)) + __result.min = __prev; + else if (!__comp_proj(*__prev, *__result.max)) + __result.max = __prev; + break; + } + if (!__comp_proj(*__first, *__prev)) + { + if (__comp_proj(*__prev, *__result.min)) + __result.min = __prev; + if (!__comp_proj(*__first, *__result.max)) + __result.max = __first; + } + else + { + if (__comp_proj(*__first, *__result.min)) + __result.min = __first; + if (!__comp_proj(*__prev, *__result.max)) + __result.max = __prev; + } } return __result; } @@ -3753,8 +3604,7 @@ namespace ranges // i.e. we are shifting out at least half of the range. In // this case we can safely perform the shift with a single // move. - std::move(std::move(__first), std::move(__dest_head), - std::move(__result)); + std::move(std::move(__first), std::move(__dest_head), __result); return __result; } ++__dest_head; diff --git a/libstdc++-v3/include/bits/ranges_base.h b/libstdc++-v3/include/bits/ranges_base.h index 25af4b7..9d749c8 100644 --- a/libstdc++-v3/include/bits/ranges_base.h +++ b/libstdc++-v3/include/bits/ranges_base.h @@ -619,8 +619,7 @@ namespace ranges /// [range.view] The ranges::view concept. template<typename _Tp> concept view - = range<_Tp> && movable<_Tp> && default_initializable<_Tp> - && enable_view<_Tp>; + = range<_Tp> && movable<_Tp> && enable_view<_Tp>; // [range.refinements] diff --git a/libstdc++-v3/include/bits/ranges_util.h b/libstdc++-v3/include/bits/ranges_util.h index dd829ed..9a07079 100644 --- a/libstdc++-v3/include/bits/ranges_util.h +++ b/libstdc++-v3/include/bits/ranges_util.h @@ -241,7 +241,7 @@ namespace ranges [[no_unique_address]] _Size<__size_type> _M_size = {}; public: - subrange() = default; + subrange() requires default_initializable<_It> = default; constexpr subrange(__detail::__convertible_to_non_slicing<_It> auto __i, _Sent __s) @@ -420,7 +420,226 @@ namespace ranges using borrowed_subrange_t = conditional_t<borrowed_range<_Range>, subrange<iterator_t<_Range>>, dangling>; +} // namespace ranges + +// The following ranges algorithms are used by <ranges>, and are defined here +// so that <ranges> can avoid including all of <bits/ranges_algo.h>. +namespace ranges +{ + struct __find_fn + { + template<input_iterator _Iter, sentinel_for<_Iter> _Sent, typename _Tp, + typename _Proj = identity> + requires indirect_binary_predicate<ranges::equal_to, + projected<_Iter, _Proj>, const _Tp*> + constexpr _Iter + operator()(_Iter __first, _Sent __last, + const _Tp& __value, _Proj __proj = {}) const + { + while (__first != __last + && !(std::__invoke(__proj, *__first) == __value)) + ++__first; + return __first; + } + + template<input_range _Range, typename _Tp, typename _Proj = identity> + requires indirect_binary_predicate<ranges::equal_to, + projected<iterator_t<_Range>, _Proj>, + const _Tp*> + constexpr borrowed_iterator_t<_Range> + operator()(_Range&& __r, const _Tp& __value, _Proj __proj = {}) const + { + return (*this)(ranges::begin(__r), ranges::end(__r), + __value, std::move(__proj)); + } + }; + + inline constexpr __find_fn find{}; + + struct __find_if_fn + { + template<input_iterator _Iter, sentinel_for<_Iter> _Sent, + typename _Proj = identity, + indirect_unary_predicate<projected<_Iter, _Proj>> _Pred> + constexpr _Iter + operator()(_Iter __first, _Sent __last, + _Pred __pred, _Proj __proj = {}) const + { + while (__first != __last + && !(bool)std::__invoke(__pred, std::__invoke(__proj, *__first))) + ++__first; + return __first; + } + + template<input_range _Range, typename _Proj = identity, + indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> + _Pred> + constexpr borrowed_iterator_t<_Range> + operator()(_Range&& __r, _Pred __pred, _Proj __proj = {}) const + { + return (*this)(ranges::begin(__r), ranges::end(__r), + std::move(__pred), std::move(__proj)); + } + }; + + inline constexpr __find_if_fn find_if{}; + + struct __find_if_not_fn + { + template<input_iterator _Iter, sentinel_for<_Iter> _Sent, + typename _Proj = identity, + indirect_unary_predicate<projected<_Iter, _Proj>> _Pred> + constexpr _Iter + operator()(_Iter __first, _Sent __last, + _Pred __pred, _Proj __proj = {}) const + { + while (__first != __last + && (bool)std::__invoke(__pred, std::__invoke(__proj, *__first))) + ++__first; + return __first; + } + + template<input_range _Range, typename _Proj = identity, + indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> + _Pred> + constexpr borrowed_iterator_t<_Range> + operator()(_Range&& __r, _Pred __pred, _Proj __proj = {}) const + { + return (*this)(ranges::begin(__r), ranges::end(__r), + std::move(__pred), std::move(__proj)); + } + }; + + inline constexpr __find_if_not_fn find_if_not{}; + + template<typename _Iter1, typename _Iter2> + struct in_in_result + { + [[no_unique_address]] _Iter1 in1; + [[no_unique_address]] _Iter2 in2; + + template<typename _IIter1, typename _IIter2> + requires convertible_to<const _Iter1&, _IIter1> + && convertible_to<const _Iter2&, _IIter2> + constexpr + operator in_in_result<_IIter1, _IIter2>() const & + { return {in1, in2}; } + + template<typename _IIter1, typename _IIter2> + requires convertible_to<_Iter1, _IIter1> + && convertible_to<_Iter2, _IIter2> + constexpr + operator in_in_result<_IIter1, _IIter2>() && + { return {std::move(in1), std::move(in2)}; } + }; + + template<typename _Iter1, typename _Iter2> + using mismatch_result = in_in_result<_Iter1, _Iter2>; + + struct __mismatch_fn + { + template<input_iterator _Iter1, sentinel_for<_Iter1> _Sent1, + input_iterator _Iter2, sentinel_for<_Iter2> _Sent2, + typename _Pred = ranges::equal_to, + typename _Proj1 = identity, typename _Proj2 = identity> + requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2> + constexpr mismatch_result<_Iter1, _Iter2> + operator()(_Iter1 __first1, _Sent1 __last1, + _Iter2 __first2, _Sent2 __last2, _Pred __pred = {}, + _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const + { + while (__first1 != __last1 && __first2 != __last2 + && (bool)std::__invoke(__pred, + std::__invoke(__proj1, *__first1), + std::__invoke(__proj2, *__first2))) + { + ++__first1; + ++__first2; + } + return { std::move(__first1), std::move(__first2) }; + } + + template<input_range _Range1, input_range _Range2, + typename _Pred = ranges::equal_to, + typename _Proj1 = identity, typename _Proj2 = identity> + requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>, + _Pred, _Proj1, _Proj2> + constexpr mismatch_result<iterator_t<_Range1>, iterator_t<_Range2>> + operator()(_Range1&& __r1, _Range2&& __r2, _Pred __pred = {}, + _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const + { + return (*this)(ranges::begin(__r1), ranges::end(__r1), + ranges::begin(__r2), ranges::end(__r2), + std::move(__pred), + std::move(__proj1), std::move(__proj2)); + } + }; + + inline constexpr __mismatch_fn mismatch{}; + + struct __search_fn + { + template<forward_iterator _Iter1, sentinel_for<_Iter1> _Sent1, + forward_iterator _Iter2, sentinel_for<_Iter2> _Sent2, + typename _Pred = ranges::equal_to, + typename _Proj1 = identity, typename _Proj2 = identity> + requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2> + constexpr subrange<_Iter1> + operator()(_Iter1 __first1, _Sent1 __last1, + _Iter2 __first2, _Sent2 __last2, _Pred __pred = {}, + _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const + { + if (__first1 == __last1 || __first2 == __last2) + return {__first1, __first1}; + + for (;;) + { + for (;;) + { + if (__first1 == __last1) + return {__first1, __first1}; + if (std::__invoke(__pred, + std::__invoke(__proj1, *__first1), + std::__invoke(__proj2, *__first2))) + break; + ++__first1; + } + auto __cur1 = __first1; + auto __cur2 = __first2; + for (;;) + { + if (++__cur2 == __last2) + return {__first1, ++__cur1}; + if (++__cur1 == __last1) + return {__cur1, __cur1}; + if (!(bool)std::__invoke(__pred, + std::__invoke(__proj1, *__cur1), + std::__invoke(__proj2, *__cur2))) + { + ++__first1; + break; + } + } + } + } + + template<forward_range _Range1, forward_range _Range2, + typename _Pred = ranges::equal_to, + typename _Proj1 = identity, typename _Proj2 = identity> + requires indirectly_comparable<iterator_t<_Range1>, iterator_t<_Range2>, + _Pred, _Proj1, _Proj2> + constexpr borrowed_subrange_t<_Range1> + operator()(_Range1&& __r1, _Range2&& __r2, _Pred __pred = {}, + _Proj1 __proj1 = {}, _Proj2 __proj2 = {}) const + { + return (*this)(ranges::begin(__r1), ranges::end(__r1), + ranges::begin(__r2), ranges::end(__r2), + std::move(__pred), + std::move(__proj1), std::move(__proj2)); + } + }; + inline constexpr __search_fn search{}; } // namespace ranges using ranges::get; diff --git a/libstdc++-v3/include/bits/stl_iterator.h b/libstdc++-v3/include/bits/stl_iterator.h index 8768624..7fe727d 100644 --- a/libstdc++-v3/include/bits/stl_iterator.h +++ b/libstdc++-v3/include/bits/stl_iterator.h @@ -639,8 +639,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef _Container container_type; #if __cplusplus > 201703L using difference_type = ptrdiff_t; - - constexpr back_insert_iterator() noexcept : container(nullptr) { } #endif /// The only way to create this %iterator is with a container. @@ -742,8 +740,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef _Container container_type; #if __cplusplus > 201703L using difference_type = ptrdiff_t; - - constexpr front_insert_iterator() noexcept : container(nullptr) { } #endif /// The only way to create this %iterator is with a container. @@ -843,17 +839,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { #if __cplusplus > 201703L && defined __cpp_lib_concepts using _Iter = std::__detail::__range_iter_t<_Container>; - - protected: - _Container* container = nullptr; - _Iter iter = _Iter(); #else typedef typename _Container::iterator _Iter; - +#endif protected: _Container* container; _Iter iter; -#endif public: /// A nested typedef for the type of whatever container you used. @@ -861,8 +852,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #if __cplusplus > 201703L && defined __cpp_lib_concepts using difference_type = ptrdiff_t; - - insert_iterator() = default; #endif /** @@ -1683,7 +1672,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename _It> concept __common_iter_use_postfix_proxy = (!requires (_It& __i) { { *__i++ } -> __can_reference; }) - && constructible_from<iter_value_t<_It>, iter_reference_t<_It>>; + && constructible_from<iter_value_t<_It>, iter_reference_t<_It>> + && move_constructible<iter_value_t<_It>>; } // namespace __detail /// An iterator/sentinel adaptor for representing a non-common range. @@ -1726,7 +1716,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION iter_value_t<_It> _M_keep; __postfix_proxy(iter_reference_t<_It>&& __x) - : _M_keep(std::move(__x)) { } + : _M_keep(std::forward<iter_reference_t<_It>>(__x)) { } friend class common_iterator; @@ -1740,6 +1730,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION constexpr common_iterator() noexcept(is_nothrow_default_constructible_v<_It>) + requires default_initializable<_It> : _M_it(), _M_index(0) { } @@ -2117,7 +2108,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // iterator_concept defined in __counted_iter_concept // iterator_category defined in __counted_iter_cat - constexpr counted_iterator() = default; + constexpr counted_iterator() requires default_initializable<_It> = default; constexpr counted_iterator(_It __i, iter_difference_t<_It> __n) diff --git a/libstdc++-v3/include/bits/stream_iterator.h b/libstdc++-v3/include/bits/stream_iterator.h index fd8920b..d07474d 100644 --- a/libstdc++-v3/include/bits/stream_iterator.h +++ b/libstdc++-v3/include/bits/stream_iterator.h @@ -192,11 +192,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const _CharT* _M_string; public: -#if __cplusplus > 201703L - constexpr ostream_iterator() noexcept - : _M_stream(nullptr), _M_string(nullptr) { } -#endif - /// Construct from an ostream. ostream_iterator(ostream_type& __s) : _M_stream(std::__addressof(__s)), _M_string(0) {} diff --git a/libstdc++-v3/include/std/concepts b/libstdc++-v3/include/std/concepts index 4490f53..7f5421f 100644 --- a/libstdc++-v3/include/std/concepts +++ b/libstdc++-v3/include/std/concepts @@ -70,9 +70,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// [concept.convertible], concept convertible_to template<typename _From, typename _To> concept convertible_to = is_convertible_v<_From, _To> - && requires(add_rvalue_reference_t<_From> (&__f)()) { - static_cast<_To>(__f()); - }; + && requires { static_cast<_To>(std::declval<_From>()); }; /// [concept.commonref], concept common_reference_with template<typename _Tp, typename _Up> diff --git a/libstdc++-v3/include/std/numeric b/libstdc++-v3/include/std/numeric index f36c1f9..2ab337a 100644 --- a/libstdc++-v3/include/std/numeric +++ b/libstdc++-v3/include/std/numeric @@ -278,9 +278,11 @@ namespace __detail reduce(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOperation __binary_op) { - using value_type = typename iterator_traits<_InputIterator>::value_type; + using __ref = typename iterator_traits<_InputIterator>::reference; + static_assert(is_invocable_r_v<_Tp, _BinaryOperation&, _Tp&, __ref>); + static_assert(is_invocable_r_v<_Tp, _BinaryOperation&, __ref, _Tp&>); static_assert(is_invocable_r_v<_Tp, _BinaryOperation&, _Tp&, _Tp&>); - static_assert(is_convertible_v<value_type, _Tp>); + static_assert(is_invocable_r_v<_Tp, _BinaryOperation&, __ref, __ref>); if constexpr (__is_random_access_iter<_InputIterator>::value) { while ((__last - __first) >= 4) diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges index b294349..f552caa 100644 --- a/libstdc++-v3/include/std/ranges +++ b/libstdc++-v3/include/std/ranges @@ -113,10 +113,13 @@ namespace ranges noexcept(is_nothrow_copy_constructible_v<_Tp>) requires (!copyable<_Tp>) { - if ((bool)__that) - this->emplace(*__that); - else - this->reset(); + if (this != std::__addressof(__that)) + { + if ((bool)__that) + this->emplace(*__that); + else + this->reset(); + } return *this; } @@ -125,37 +128,42 @@ namespace ranges noexcept(is_nothrow_move_constructible_v<_Tp>) requires (!movable<_Tp>) { - if ((bool)__that) - this->emplace(std::move(*__that)); - else - this->reset(); + if (this != std::__addressof(__that)) + { + if ((bool)__that) + this->emplace(std::move(*__that)); + else + this->reset(); + } return *this; } }; - // For types which are already semiregular, this specialization of the - // semiregular wrapper stores the object directly without going through + // For types which are already copyable, this specialization of the + // copyable wrapper stores the object directly without going through // std::optional. It provides just the subset of the primary template's // API that we currently use. - template<__boxable _Tp> requires semiregular<_Tp> + template<__boxable _Tp> + requires copyable<_Tp> || (is_nothrow_move_constructible_v<_Tp> + && is_nothrow_copy_constructible_v<_Tp>) struct __box<_Tp> { private: [[no_unique_address]] _Tp _M_value = _Tp(); public: - __box() = default; + __box() requires default_initializable<_Tp> = default; constexpr explicit __box(const _Tp& __t) noexcept(is_nothrow_copy_constructible_v<_Tp>) - : _M_value{__t} + : _M_value(__t) { } constexpr explicit __box(_Tp&& __t) noexcept(is_nothrow_move_constructible_v<_Tp>) - : _M_value{std::move(__t)} + : _M_value(std::move(__t)) { } template<typename... _Args> @@ -166,6 +174,38 @@ namespace ranges : _M_value(std::forward<_Args>(__args)...) { } + __box(const __box&) = default; + __box(__box&&) = default; + __box& operator=(const __box&) requires copyable<_Tp> = default; + __box& operator=(__box&&) requires copyable<_Tp> = default; + + // When _Tp is nothrow_copy_constructible but not copy_assignable, + // copy assignment is implemented via destroy-then-copy-construct. + constexpr __box& + operator=(const __box& __that) noexcept + { + static_assert(is_nothrow_copy_constructible_v<_Tp>); + if (this != std::__addressof(__that)) + { + _M_value.~_Tp(); + std::construct_at(std::__addressof(_M_value), *__that); + } + return *this; + } + + // Likewise for move assignment. + constexpr __box& + operator=(__box&& __that) noexcept + { + static_assert(is_nothrow_move_constructible_v<_Tp>); + if (this != std::__addressof(__that)) + { + _M_value.~_Tp(); + std::construct_at(std::__addressof(_M_value), std::move(*__that)); + } + return *this; + } + constexpr bool has_value() const noexcept { return true; }; @@ -193,7 +233,7 @@ namespace ranges class single_view : public view_interface<single_view<_Tp>> { public: - single_view() = default; + single_view() requires default_initializable<_Tp> = default; constexpr explicit single_view(const _Tp& __t) @@ -308,7 +348,7 @@ namespace ranges template<weakly_incrementable _Winc, semiregular _Bound = unreachable_sentinel_t> requires std::__detail::__weakly_eq_cmp_with<_Winc, _Bound> - && semiregular<_Winc> + && copyable<_Winc> class iota_view : public view_interface<iota_view<_Winc, _Bound>> { private: @@ -337,7 +377,7 @@ namespace ranges using value_type = _Winc; using difference_type = __detail::__iota_diff_t<_Winc>; - _Iterator() = default; + _Iterator() requires default_initializable<_Winc> = default; constexpr explicit _Iterator(_Winc __value) @@ -534,7 +574,7 @@ namespace ranges [[no_unique_address]] _Bound _M_bound = _Bound(); public: - iota_view() = default; + iota_view() requires default_initializable<_Winc> = default; constexpr explicit iota_view(_Winc __value) @@ -643,8 +683,6 @@ namespace views : public view_interface<basic_istream_view<_Val, _CharT, _Traits>> { public: - basic_istream_view() = default; - constexpr explicit basic_istream_view(basic_istream<_CharT, _Traits>& __stream) : _M_stream(std::__addressof(__stream)) @@ -653,8 +691,7 @@ namespace views constexpr auto begin() { - if (_M_stream != nullptr) - *_M_stream >> _M_object; + *_M_stream >> _M_object; return _Iterator{this}; } @@ -663,8 +700,8 @@ namespace views { return default_sentinel; } private: - basic_istream<_CharT, _Traits>* _M_stream = nullptr; - _Val _M_object = _Val(); + basic_istream<_CharT, _Traits>* _M_stream; + _Val _M_object; struct _Iterator { @@ -673,8 +710,6 @@ namespace views using difference_type = ptrdiff_t; using value_type = _Val; - _Iterator() = default; - constexpr explicit _Iterator(basic_istream_view* __parent) noexcept : _M_parent(__parent) @@ -688,7 +723,6 @@ namespace views _Iterator& operator++() { - __glibcxx_assert(_M_parent->_M_stream != nullptr); *_M_parent->_M_stream >> _M_parent->_M_object; return *this; } @@ -699,21 +733,18 @@ namespace views _Val& operator*() const - { - __glibcxx_assert(_M_parent->_M_stream != nullptr); - return _M_parent->_M_object; - } + { return _M_parent->_M_object; } friend bool operator==(const _Iterator& __x, default_sentinel_t) { return __x._M_at_end(); } private: - basic_istream_view* _M_parent = nullptr; + basic_istream_view* _M_parent; bool _M_at_end() const - { return _M_parent == nullptr || !*_M_parent->_M_stream; } + { return !*_M_parent->_M_stream; } }; friend _Iterator; @@ -796,7 +827,9 @@ namespace views::__adaptor // // The optional static data member _Derived::_S_has_simple_extra_args should // be defined to true if the behavior of this adaptor is independent of the - // constness/value category of the extra arguments. + // constness/value category of the extra arguments. This data member could + // also be defined as a variable template parameterized by the types of the + // extra arguments. template<typename _Derived> struct _RangeAdaptor { @@ -818,9 +851,10 @@ namespace views::__adaptor concept __closure_has_simple_call_op = _Adaptor::_S_has_simple_call_op; // True if the behavior of the range adaptor non-closure _Adaptor is - // independent of the value category of its extra arguments. - template<typename _Adaptor> - concept __adaptor_has_simple_extra_args = _Adaptor::_S_has_simple_extra_args; + // independent of the value category of its extra arguments _Args. + template<typename _Adaptor, typename... _Args> + concept __adaptor_has_simple_extra_args = _Adaptor::_S_has_simple_extra_args + || _Adaptor::template _S_has_simple_extra_args<_Args...>; // A range adaptor closure that represents partial application of // the range adaptor _Adaptor with arguments _Args. @@ -893,11 +927,12 @@ namespace views::__adaptor }; // Partial specialization of the primary template for the case where the extra - // arguments of the adaptor can always be safely forwarded by const reference. - // This lets us get away with a single operator() overload, which makes - // overload resolution failure diagnostics more concise. + // arguments of the adaptor can always be safely and efficiently forwarded by + // const reference. This lets us get away with a single operator() overload, + // which makes overload resolution failure diagnostics more concise. template<typename _Adaptor, typename... _Args> - requires __adaptor_has_simple_extra_args<_Adaptor> + requires __adaptor_has_simple_extra_args<_Adaptor, _Args...> + && (is_trivially_copyable_v<_Args> && ...) struct _Partial<_Adaptor, _Args...> : _RangeAdaptorClosure { tuple<_Args...> _M_args; @@ -926,7 +961,8 @@ namespace views::__adaptor // A lightweight specialization of the above template for the common case // where _Adaptor accepts a single extra argument. template<typename _Adaptor, typename _Arg> - requires __adaptor_has_simple_extra_args<_Adaptor> + requires __adaptor_has_simple_extra_args<_Adaptor, _Arg> + && is_trivially_copyable_v<_Arg> struct _Partial<_Adaptor, _Arg> : _RangeAdaptorClosure { _Arg _M_arg; @@ -1012,15 +1048,12 @@ namespace views::__adaptor class ref_view : public view_interface<ref_view<_Range>> { private: - _Range* _M_r = nullptr; + _Range* _M_r; static void _S_fun(_Range&); // not defined static void _S_fun(_Range&&) = delete; public: - constexpr - ref_view() noexcept = default; - template<__detail::__not_same_as<ref_view> _Tp> requires convertible_to<_Tp, _Range&> && requires { _S_fun(declval<_Tp>()); } @@ -1111,54 +1144,6 @@ namespace views::__adaptor using all_t = decltype(all(std::declval<_Range>())); } // namespace views - // The following simple algos are transcribed from ranges_algo.h to avoid - // having to include that entire header. - namespace __detail - { - template<typename _Iter, typename _Sent, typename _Tp> - constexpr _Iter - find(_Iter __first, _Sent __last, const _Tp& __value) - { - while (__first != __last - && !(bool)(*__first == __value)) - ++__first; - return __first; - } - - template<typename _Iter, typename _Sent, typename _Pred> - constexpr _Iter - find_if(_Iter __first, _Sent __last, _Pred __pred) - { - while (__first != __last - && !(bool)std::__invoke(__pred, *__first)) - ++__first; - return __first; - } - - template<typename _Iter, typename _Sent, typename _Pred> - constexpr _Iter - find_if_not(_Iter __first, _Sent __last, _Pred __pred) - { - while (__first != __last - && (bool)std::__invoke(__pred, *__first)) - ++__first; - return __first; - } - - template<typename _Iter1, typename _Sent1, typename _Iter2, typename _Sent2> - constexpr pair<_Iter1, _Iter2> - mismatch(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2) - { - while (__first1 != __last1 && __first2 != __last2 - && (bool)ranges::equal_to{}(*__first1, *__first2)) - { - ++__first1; - ++__first2; - } - return { std::move(__first1), std::move(__first2) }; - } - } // namespace __detail - namespace __detail { template<typename _Tp> @@ -1200,6 +1185,20 @@ namespace views::__adaptor return *this; } + constexpr __non_propagating_cache& + operator=(_Tp __val) + { + this->_M_reset(); + std::construct_at(std::__addressof(this->_M_payload._M_payload), + std::in_place, std::move(__val)); + this->_M_payload._M_engaged = true; + return *this; + } + + constexpr explicit + operator bool() const noexcept + { return this->_M_is_engaged(); } + constexpr _Tp& operator*() noexcept { return this->_M_get(); } @@ -1377,7 +1376,7 @@ namespace views::__adaptor using value_type = range_value_t<_Vp>; using difference_type = range_difference_t<_Vp>; - _Iterator() = default; + _Iterator() requires default_initializable<_Vp_iter> = default; constexpr _Iterator(filter_view* __parent, _Vp_iter __current) @@ -1406,9 +1405,9 @@ namespace views::__adaptor constexpr _Iterator& operator++() { - _M_current = __detail::find_if(std::move(++_M_current), - ranges::end(_M_parent->_M_base), - std::ref(*_M_parent->_M_pred)); + _M_current = ranges::find_if(std::move(++_M_current), + ranges::end(_M_parent->_M_base), + std::ref(*_M_parent->_M_pred)); return *this; } @@ -1489,7 +1488,9 @@ namespace views::__adaptor _Vp _M_base = _Vp(); public: - filter_view() = default; + filter_view() requires (default_initializable<_Vp> + && default_initializable<_Pred>) + = default; constexpr filter_view(_Vp __base, _Pred __pred) @@ -1515,9 +1516,9 @@ namespace views::__adaptor return {this, _M_cached_begin._M_get(_M_base)}; __glibcxx_assert(_M_pred.has_value()); - auto __it = __detail::find_if(ranges::begin(_M_base), - ranges::end(_M_base), - std::ref(*_M_pred)); + auto __it = ranges::find_if(ranges::begin(_M_base), + ranges::end(_M_base), + std::ref(*_M_pred)); _M_cached_begin._M_set(_M_base, __it); return {this, std::move(__it)}; } @@ -1616,11 +1617,11 @@ namespace views::__adaptor static auto _S_iter_concept() { - if constexpr (random_access_range<_Vp>) + if constexpr (random_access_range<_Base>) return random_access_iterator_tag{}; - else if constexpr (bidirectional_range<_Vp>) + else if constexpr (bidirectional_range<_Base>) return bidirectional_iterator_tag{}; - else if constexpr (forward_range<_Vp>) + else if constexpr (forward_range<_Base>) return forward_iterator_tag{}; else return input_iterator_tag{}; @@ -1638,7 +1639,7 @@ namespace views::__adaptor = remove_cvref_t<invoke_result_t<_Fp&, range_reference_t<_Base>>>; using difference_type = range_difference_t<_Base>; - _Iterator() = default; + _Iterator() requires default_initializable<_Base_iter> = default; constexpr _Iterator(_Parent* __parent, _Base_iter __current) @@ -1853,7 +1854,9 @@ namespace views::__adaptor _Vp _M_base = _Vp(); public: - transform_view() = default; + transform_view() requires (default_initializable<_Vp> + && default_initializable<_Fp>) + = default; constexpr transform_view(_Vp __base, _Fp __fun) @@ -1988,7 +1991,7 @@ namespace views::__adaptor _Vp _M_base = _Vp(); public: - take_view() = default; + take_view() requires default_initializable<_Vp> = default; constexpr take_view(_Vp base, range_difference_t<_Vp> __count) @@ -2112,7 +2115,12 @@ namespace views::__adaptor using _RangeAdaptor<_Take>::operator(); static constexpr int _S_arity = 2; - static constexpr bool _S_has_simple_extra_args = true; + // The count argument of views::take is not always simple -- it can be + // e.g. a move-only class that's implicitly convertible to the difference + // type. But an integer-like count argument is surely simple. + template<typename _Tp> + static constexpr bool _S_has_simple_extra_args + = ranges::__detail::__is_integer_like<_Tp>; }; inline constexpr _Take take; @@ -2167,7 +2175,9 @@ namespace views::__adaptor _Vp _M_base = _Vp(); public: - take_while_view() = default; + take_while_view() requires (default_initializable<_Vp> + && default_initializable<_Pred>) + = default; constexpr take_while_view(_Vp base, _Pred __pred) @@ -2255,7 +2265,7 @@ namespace views::__adaptor _M_cached_begin; public: - drop_view() = default; + drop_view() requires default_initializable<_Vp> = default; constexpr drop_view(_Vp __base, range_difference_t<_Vp> __count) @@ -2352,7 +2362,9 @@ namespace views::__adaptor using _RangeAdaptor<_Drop>::operator(); static constexpr int _S_arity = 2; - static constexpr bool _S_has_simple_extra_args = true; + template<typename _Tp> + static constexpr bool _S_has_simple_extra_args + = _Take::_S_has_simple_extra_args<_Tp>; }; inline constexpr _Drop drop; @@ -2369,7 +2381,9 @@ namespace views::__adaptor _Vp _M_base = _Vp(); public: - drop_while_view() = default; + drop_while_view() requires (default_initializable<_Vp> + && default_initializable<_Pred>) + = default; constexpr drop_while_view(_Vp __base, _Pred __pred) @@ -2395,9 +2409,9 @@ namespace views::__adaptor return _M_cached_begin._M_get(_M_base); __glibcxx_assert(_M_pred.has_value()); - auto __it = __detail::find_if_not(ranges::begin(_M_base), - ranges::end(_M_base), - std::cref(*_M_pred)); + auto __it = ranges::find_if_not(ranges::begin(_M_base), + ranges::end(_M_base), + std::cref(*_M_pred)); _M_cached_begin._M_set(_M_base, __it); return __it; } @@ -2559,7 +2573,9 @@ namespace views::__adaptor = common_type_t<range_difference_t<_Base>, range_difference_t<range_reference_t<_Base>>>; - _Iterator() = default; + _Iterator() requires (default_initializable<_Outer_iter> + && default_initializable<_Inner_iter>) + = default; constexpr _Iterator(_Parent* __parent, _Outer_iter __outer) @@ -2712,7 +2728,7 @@ namespace views::__adaptor _Vp _M_base = _Vp(); public: - join_view() = default; + join_view() requires default_initializable<_Vp> = default; constexpr explicit join_view(_Vp __base) @@ -2814,19 +2830,19 @@ namespace views::__adaptor && (remove_reference_t<_Range>::size() <= 1); template<typename _Base> - struct __split_view_outer_iter_cat + struct __lazy_split_view_outer_iter_cat { }; template<forward_range _Base> - struct __split_view_outer_iter_cat<_Base> + struct __lazy_split_view_outer_iter_cat<_Base> { using iterator_category = input_iterator_tag; }; template<typename _Base> - struct __split_view_inner_iter_cat + struct __lazy_split_view_inner_iter_cat { }; template<forward_range _Base> - struct __split_view_inner_iter_cat<_Base> + struct __lazy_split_view_inner_iter_cat<_Base> { private: static constexpr auto @@ -2848,7 +2864,7 @@ namespace views::__adaptor && indirectly_comparable<iterator_t<_Vp>, iterator_t<_Pattern>, ranges::equal_to> && (forward_range<_Vp> || __detail::__tiny_range<_Pattern>) - class split_view : public view_interface<split_view<_Vp, _Pattern>> + class lazy_split_view : public view_interface<lazy_split_view<_Vp, _Pattern>> { private: template<bool _Const> @@ -2859,17 +2875,17 @@ namespace views::__adaptor template<bool _Const> struct _OuterIter - : __detail::__split_view_outer_iter_cat<_Base<_Const>> + : __detail::__lazy_split_view_outer_iter_cat<_Base<_Const>> { private: - using _Parent = __detail::__maybe_const_t<_Const, split_view>; - using _Base = split_view::_Base<_Const>; + using _Parent = __detail::__maybe_const_t<_Const, lazy_split_view>; + using _Base = lazy_split_view::_Base<_Const>; constexpr bool __at_end() const - { return __current() == ranges::end(_M_parent->_M_base); } + { return __current() == ranges::end(_M_parent->_M_base) && !_M_trailing_empty; } - // [range.split.outer] p1 + // [range.lazy.split.outer] p1 // Many of the following specifications refer to the notional member // current of outer-iterator. current is equivalent to current_ if // V models forward_range, and parent_->current_ otherwise. @@ -2879,7 +2895,7 @@ namespace views::__adaptor if constexpr (forward_range<_Vp>) return _M_current; else - return _M_parent->_M_current; + return *_M_parent->_M_current; } constexpr auto& @@ -2888,7 +2904,7 @@ namespace views::__adaptor if constexpr (forward_range<_Vp>) return _M_current; else - return _M_parent->_M_current; + return *_M_parent->_M_current; } _Parent* _M_parent = nullptr; @@ -2897,12 +2913,13 @@ namespace views::__adaptor [[no_unique_address]] __detail::__maybe_present_t<forward_range<_Vp>, iterator_t<_Base>> _M_current; + bool _M_trailing_empty = false; public: using iterator_concept = conditional_t<forward_range<_Base>, forward_iterator_tag, input_iterator_tag>; - // iterator_category defined in __split_view_outer_iter_cat + // iterator_category defined in __lazy_split_view_outer_iter_cat using difference_type = range_difference_t<_Base>; struct value_type : view_interface<value_type> @@ -2920,14 +2937,8 @@ namespace views::__adaptor constexpr _InnerIter<_Const> begin() const - requires copyable<_OuterIter> { return _InnerIter<_Const>{_M_i}; } - constexpr _InnerIter<_Const> - begin() - requires (!copyable<_OuterIter>) - { return _InnerIter<_Const>{std::move(_M_i)}; } - constexpr default_sentinel_t end() const { return default_sentinel; } @@ -2962,28 +2973,37 @@ namespace views::__adaptor operator++() { // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 3505. split_view::outer-iterator::operator++ misspecified + // 3505. lazy_split_view::outer-iterator::operator++ misspecified const auto __end = ranges::end(_M_parent->_M_base); if (__current() == __end) - return *this; + { + _M_trailing_empty = false; + return *this; + } const auto [__pbegin, __pend] = subrange{_M_parent->_M_pattern}; if (__pbegin == __pend) ++__current(); else if constexpr (__detail::__tiny_range<_Pattern>) { - __current() = __detail::find(std::move(__current()), __end, - *__pbegin); + __current() = ranges::find(std::move(__current()), __end, + *__pbegin); if (__current() != __end) - ++__current(); + { + ++__current(); + if (__current() == __end) + _M_trailing_empty = true; + } } else do { auto [__b, __p] - = __detail::mismatch(__current(), __end, __pbegin, __pend); + = ranges::mismatch(__current(), __end, __pbegin, __pend); if (__p == __pend) { __current() = __b; + if (__current() == __end) + _M_trailing_empty = true; break; } } while (++__current() != __end); @@ -3006,7 +3026,10 @@ namespace views::__adaptor friend constexpr bool operator==(const _OuterIter& __x, const _OuterIter& __y) requires forward_range<_Base> - { return __x._M_current == __y._M_current; } + { + return __x._M_current == __y._M_current + && __x._M_trailing_empty == __y._M_trailing_empty; + } friend constexpr bool operator==(const _OuterIter& __x, default_sentinel_t) @@ -3018,10 +3041,10 @@ namespace views::__adaptor template<bool _Const> struct _InnerIter - : __detail::__split_view_inner_iter_cat<_Base<_Const>> + : __detail::__lazy_split_view_inner_iter_cat<_Base<_Const>> { private: - using _Base = split_view::_Base<_Const>; + using _Base = lazy_split_view::_Base<_Const>; constexpr bool __at_end() const @@ -3069,7 +3092,7 @@ namespace views::__adaptor public: using iterator_concept = typename _OuterIter<_Const>::iterator_concept; - // iterator_category defined in __split_view_inner_iter_cat + // iterator_category defined in __lazy_split_view_inner_iter_cat using value_type = range_value_t<_Base>; using difference_type = range_difference_t<_Base>; @@ -3080,6 +3103,14 @@ namespace views::__adaptor : _M_i(std::move(__i)) { } + constexpr iterator_t<_Base> + base() const& requires copyable<iterator_t<_Base>> + { return _M_i_current(); } + + constexpr iterator_t<_Base> + base() && + { return std::move(_M_i_current()); } + constexpr decltype(auto) operator*() const { return *_M_i_current(); } @@ -3134,15 +3165,17 @@ namespace views::__adaptor // XXX: _M_current is "present only if !forward_range<V>" [[no_unique_address]] __detail::__maybe_present_t<!forward_range<_Vp>, - iterator_t<_Vp>> _M_current; + __detail::__non_propagating_cache<iterator_t<_Vp>>> _M_current; _Vp _M_base = _Vp(); public: - split_view() = default; + lazy_split_view() requires (default_initializable<_Vp> + && default_initializable<_Pattern>) + = default; constexpr - split_view(_Vp __base, _Pattern __pattern) + lazy_split_view(_Vp __base, _Pattern __pattern) : _M_pattern(std::move(__pattern)), _M_base(std::move(__base)) { } @@ -3150,7 +3183,7 @@ namespace views::__adaptor requires constructible_from<_Vp, views::all_t<_Range>> && constructible_from<_Pattern, single_view<range_value_t<_Range>>> constexpr - split_view(_Range&& __r, range_value_t<_Range> __e) + lazy_split_view(_Range&& __r, range_value_t<_Range> __e) : _M_pattern(views::single(std::move(__e))), _M_base(views::all(std::forward<_Range>(__r))) { } @@ -3202,10 +3235,216 @@ namespace views::__adaptor }; template<typename _Range, typename _Pattern> + lazy_split_view(_Range&&, _Pattern&&) + -> lazy_split_view<views::all_t<_Range>, views::all_t<_Pattern>>; + + template<input_range _Range> + lazy_split_view(_Range&&, range_value_t<_Range>) + -> lazy_split_view<views::all_t<_Range>, single_view<range_value_t<_Range>>>; + + namespace views + { + namespace __detail + { + template<typename _Range, typename _Pattern> + concept __can_lazy_split_view + = requires { lazy_split_view(std::declval<_Range>(), std::declval<_Pattern>()); }; + } // namespace __detail + + struct _LazySplit : __adaptor::_RangeAdaptor<_LazySplit> + { + template<viewable_range _Range, typename _Pattern> + requires __detail::__can_lazy_split_view<_Range, _Pattern> + constexpr auto + operator()(_Range&& __r, _Pattern&& __f) const + { + return lazy_split_view(std::forward<_Range>(__r), std::forward<_Pattern>(__f)); + } + + using _RangeAdaptor<_LazySplit>::operator(); + static constexpr int _S_arity = 2; + // The pattern argument of views::lazy_split is not always simple -- it can be + // a non-view range, the value category of which affects whether the call + // is well-formed. But a scalar or a view pattern argument is surely + // simple. + template<typename _Pattern> + static constexpr bool _S_has_simple_extra_args + = is_scalar_v<_Pattern> || (view<_Pattern> + && copy_constructible<_Pattern>); + }; + + inline constexpr _LazySplit lazy_split; + } // namespace views + + template<forward_range _Vp, forward_range _Pattern> + requires view<_Vp> && view<_Pattern> + && indirectly_comparable<iterator_t<_Vp>, iterator_t<_Pattern>, + ranges::equal_to> + class split_view : public view_interface<split_view<_Vp, _Pattern>> + { + private: + _Pattern _M_pattern = _Pattern(); + __detail::__non_propagating_cache<subrange<iterator_t<_Vp>>> _M_cached_begin; + _Vp _M_base = _Vp(); + + struct _Iterator; + struct _Sentinel; + + public: + split_view() requires (default_initializable<_Vp> + && default_initializable<_Pattern>) + = default; + + constexpr + split_view(_Vp __base, _Pattern __pattern) + : _M_pattern(std::move(__pattern)), + _M_base(std::move(__base)) + { } + + template<forward_range _Range> + requires constructible_from<_Vp, views::all_t<_Range>> + && constructible_from<_Pattern, single_view<range_value_t<_Range>>> + constexpr + split_view(_Range&& __r, range_value_t<_Range> __e) + : _M_pattern(views::single(__e)), + _M_base(views::all(std::forward<_Range>(__r))) + { } + + constexpr _Vp + base() const& requires copyable<_Vp> + { return _M_base; } + + constexpr _Vp + base() && + { return std::move(_M_base); } + + constexpr _Iterator + begin() + { + if (!_M_cached_begin) + _M_cached_begin = _M_find_next(ranges::begin(_M_base)); + return {this, ranges::begin(_M_base), *_M_cached_begin}; + } + + constexpr auto + end() + { + if constexpr (common_range<_Vp>) + return _Iterator{this, ranges::end(_M_base), {}}; + else + return _Sentinel{this}; + } + + constexpr subrange<iterator_t<_Vp>> + _M_find_next(iterator_t<_Vp> __it) + { + auto [__b, __e] = ranges::search(subrange(__it, ranges::end(_M_base)), _M_pattern); + if (__b != ranges::end(_M_base) && ranges::empty(_M_pattern)) + { + ++__b; + ++__e; + } + return {__b, __e}; + } + + private: + struct _Iterator + { + private: + split_view* _M_parent = nullptr; + iterator_t<_Vp> _M_cur = iterator_t<_Vp>(); + subrange<iterator_t<_Vp>> _M_next = subrange<iterator_t<_Vp>>(); + bool _M_trailing_empty = false; + + friend struct _Sentinel; + + public: + using iterator_concept = forward_iterator_tag; + using iterator_category = input_iterator_tag; + using value_type = subrange<iterator_t<_Vp>>; + using difference_type = range_difference_t<_Vp>; + + _Iterator() requires default_initializable<iterator_t<_Vp>> = default; + + constexpr + _Iterator(split_view* __parent, + iterator_t<_Vp> __current, + subrange<iterator_t<_Vp>> __next) + : _M_parent(__parent), + _M_cur(std::move(__current)), + _M_next(std::move(__next)) + { } + + constexpr iterator_t<_Vp> + base() const + { return _M_cur; } + + constexpr value_type + operator*() const + { return {_M_cur, _M_next.begin()}; } + + constexpr _Iterator& + operator++() + { + _M_cur = _M_next.begin(); + if (_M_cur != ranges::end(_M_parent->_M_base)) + { + _M_cur = _M_next.end(); + if (_M_cur == ranges::end(_M_parent->_M_base)) + { + _M_trailing_empty = true; + _M_next = {_M_cur, _M_cur}; + } + else + _M_next = _M_parent->_M_find_next(_M_cur); + } + else + _M_trailing_empty = false; + return *this; + } + + constexpr _Iterator + operator++(int) + { + auto __tmp = *this; + ++*this; + return __tmp; + } + + friend constexpr bool + operator==(const _Iterator& __x, const _Iterator& __y) + { + return __x._M_cur == __y._M_cur + && __x._M_trailing_empty == __y._M_trailing_empty; + } + }; + + struct _Sentinel + { + private: + sentinel_t<_Vp> _M_end = sentinel_t<_Vp>(); + + constexpr bool + _M_equal(const _Iterator& __x) const + { return __x._M_cur == _M_end && !__x._M_trailing_empty; } + + public: + constexpr explicit + _Sentinel(split_view* __parent) + : _M_end(ranges::end(__parent->_M_base)) + { } + + friend constexpr bool + operator==(const _Iterator& __x, const _Sentinel& __y) + { return __y._M_equal(__x); } + }; + }; + + template<typename _Range, typename _Pattern> split_view(_Range&&, _Pattern&&) -> split_view<views::all_t<_Range>, views::all_t<_Pattern>>; - template<input_range _Range> + template<forward_range _Range> split_view(_Range&&, range_value_t<_Range>) -> split_view<views::all_t<_Range>, single_view<range_value_t<_Range>>>; @@ -3230,9 +3469,9 @@ namespace views::__adaptor using _RangeAdaptor<_Split>::operator(); static constexpr int _S_arity = 2; - // The second argument of views::split is _not_ simple -- it can be a - // non-view range, the value category of which affects whether the call is - // well-formed. So we must not define _S_has_simple_extra_args to true. + template<typename _Pattern> + static constexpr bool _S_has_simple_extra_args + = _LazySplit::_S_has_simple_extra_args<_Pattern>; }; inline constexpr _Split split; @@ -3265,7 +3504,7 @@ namespace views::__adaptor _Vp _M_base = _Vp(); public: - common_view() = default; + common_view() requires default_initializable<_Vp> = default; constexpr explicit common_view(_Vp __r) @@ -3396,7 +3635,7 @@ namespace views::__adaptor _Vp _M_base = _Vp(); public: - reverse_view() = default; + reverse_view() requires default_initializable<_Vp> = default; constexpr explicit reverse_view(_Vp __r) @@ -3538,7 +3777,7 @@ namespace views::__adaptor class elements_view : public view_interface<elements_view<_Vp, _Nm>> { public: - elements_view() = default; + elements_view() requires default_initializable<_Vp> = default; constexpr explicit elements_view(_Vp base) @@ -3640,11 +3879,11 @@ namespace views::__adaptor static auto _S_iter_concept() { - if constexpr (random_access_range<_Vp>) + if constexpr (random_access_range<_Base>) return random_access_iterator_tag{}; - else if constexpr (bidirectional_range<_Vp>) + else if constexpr (bidirectional_range<_Base>) return bidirectional_iterator_tag{}; - else if constexpr (forward_range<_Vp>) + else if constexpr (forward_range<_Base>) return forward_iterator_tag{}; else return input_iterator_tag{}; @@ -3659,7 +3898,7 @@ namespace views::__adaptor = remove_cvref_t<tuple_element_t<_Nm, range_value_t<_Base>>>; using difference_type = range_difference_t<_Base>; - _Iterator() = default; + _Iterator() requires default_initializable<iterator_t<_Base>> = default; constexpr explicit _Iterator(iterator_t<_Base> current) diff --git a/libstdc++-v3/include/std/span b/libstdc++-v3/include/std/span index 09bdcd6..63f0a8f 100644 --- a/libstdc++-v3/include/std/span +++ b/libstdc++-v3/include/std/span @@ -447,8 +447,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Opt-in to view concept template<typename _ElementType, size_t _Extent> inline constexpr bool - enable_view<span<_ElementType, _Extent>> - = _Extent == 0 || _Extent == dynamic_extent; + enable_view<span<_ElementType, _Extent>> = true; } _GLIBCXX_END_NAMESPACE_VERSION } // namespace std diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version index 8d0b2b9..27bcd32 100644 --- a/libstdc++-v3/include/std/version +++ b/libstdc++-v3/include/std/version @@ -130,8 +130,10 @@ #define __cpp_lib_chrono 201611 #define __cpp_lib_clamp 201603 #if __cplusplus == 201703L // N.B. updated value in C++20 -# define __cpp_lib_constexpr_char_traits 201611L -# define __cpp_lib_constexpr_string 201611L +# if _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED +# define __cpp_lib_constexpr_char_traits 201611L +# define __cpp_lib_constexpr_string 201611L +# endif #endif #define __cpp_lib_enable_shared_from_this 201603 #define __cpp_lib_execution 201902L // FIXME: should be 201603L @@ -213,14 +215,18 @@ // FIXME: #define __cpp_lib_execution 201902L #define __cpp_lib_integer_comparison_functions 202002L #define __cpp_lib_constexpr_algorithms 201806L -#define __cpp_lib_constexpr_char_traits 201811L +#ifdef __cpp_lib_is_constant_evaluated +# define __cpp_lib_constexpr_char_traits 201811L +#endif #define __cpp_lib_constexpr_complex 201711L #define __cpp_lib_constexpr_dynamic_alloc 201907L #define __cpp_lib_constexpr_functional 201907L #define __cpp_lib_constexpr_iterator 201811L #define __cpp_lib_constexpr_memory 201811L #define __cpp_lib_constexpr_numeric 201911L -#define __cpp_lib_constexpr_string 201811L +#ifdef __cpp_lib_is_constant_evaluated +# define __cpp_lib_constexpr_string 201811L +#endif #define __cpp_lib_constexpr_string_view 201811L #define __cpp_lib_constexpr_tuple 201811L #define __cpp_lib_constexpr_utility 201811L @@ -240,7 +246,7 @@ #define __cpp_lib_math_constants 201907L #define __cpp_lib_polymorphic_allocator 201902L #if __cpp_lib_concepts -# define __cpp_lib_ranges 201911L +# define __cpp_lib_ranges 202106L #endif #if __cpp_lib_atomic_wait || _GLIBCXX_HAVE_POSIX_SEMAPHORE # define __cpp_lib_semaphore 201907L diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/1.cc index 5549094..099921f 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/1.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/1.cc @@ -36,7 +36,6 @@ using namespace std; void test01(void) { typedef string::size_type csize_type; - typedef string::iterator citerator; csize_type npos = string::npos; csize_type csz01; @@ -68,6 +67,8 @@ void test01(void) // basic_string(const char* s, size_type n, alloc) csz01 = str01.max_size(); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstringop-overread" // NB: As strlen(str_lit01) != csz01, this test is undefined. It // should not crash, but what gets constructed is a bit arbitrary. try { @@ -94,6 +95,7 @@ void test01(void) catch(...) { VERIFY( false ); } +#pragma GCC diagnostic pop // Build a maxsize - 1 lengthed string consisting of all A's try { diff --git a/libstdc++-v3/testsuite/24_iterators/back_insert_iterator/constexpr.cc b/libstdc++-v3/testsuite/24_iterators/back_insert_iterator/constexpr.cc index bef2289..27acd07 100644 --- a/libstdc++-v3/testsuite/24_iterators/back_insert_iterator/constexpr.cc +++ b/libstdc++-v3/testsuite/24_iterators/back_insert_iterator/constexpr.cc @@ -42,8 +42,7 @@ constexpr bool test01() { container c; - std::back_insert_iterator<container> iter; - iter = std::back_inserter(c); + std::back_insert_iterator<container> iter = std::back_inserter(c); *iter++ = 1; int i = 2; *iter = i; diff --git a/libstdc++-v3/testsuite/24_iterators/front_insert_iterator/constexpr.cc b/libstdc++-v3/testsuite/24_iterators/front_insert_iterator/constexpr.cc index 7b4c990..cff7f6a 100644 --- a/libstdc++-v3/testsuite/24_iterators/front_insert_iterator/constexpr.cc +++ b/libstdc++-v3/testsuite/24_iterators/front_insert_iterator/constexpr.cc @@ -42,8 +42,7 @@ constexpr bool test01() { container c; - std::front_insert_iterator<container> iter; - iter = std::front_inserter(c); + std::front_insert_iterator<container> iter = std::front_inserter(c); *iter++ = 1; int i = 2; *iter = i; diff --git a/libstdc++-v3/testsuite/24_iterators/insert_iterator/constexpr.cc b/libstdc++-v3/testsuite/24_iterators/insert_iterator/constexpr.cc index e74df3e..e326b01 100644 --- a/libstdc++-v3/testsuite/24_iterators/insert_iterator/constexpr.cc +++ b/libstdc++-v3/testsuite/24_iterators/insert_iterator/constexpr.cc @@ -51,8 +51,7 @@ constexpr bool test01() { container c; - std::insert_iterator<container> iter; - iter = std::inserter(c, c.begin()); + std::insert_iterator<container> iter = std::inserter(c, c.begin()); *iter++ = 1; int i = 2; *iter = i; diff --git a/libstdc++-v3/testsuite/24_iterators/ostream_iterator/requirements/constexpr.cc b/libstdc++-v3/testsuite/24_iterators/ostream_iterator/requirements/constexpr.cc deleted file mode 100644 index 4edaaa8..0000000 --- a/libstdc++-v3/testsuite/24_iterators/ostream_iterator/requirements/constexpr.cc +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (C) 2019-2021 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library 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, or (at your option) -// any later version. - -// This 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 General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// { dg-options "-std=gnu++2a" } -// { dg-do compile { target c++2a } } - -#include <iterator> - -constexpr std::ostream_iterator<int> iter1; -constexpr std::ostream_iterator<int> iter2{}; diff --git a/libstdc++-v3/testsuite/25_algorithms/minmax/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/minmax/constrained.cc index 7869224..c365152 100644 --- a/libstdc++-v3/testsuite/25_algorithms/minmax/constrained.cc +++ b/libstdc++-v3/testsuite/25_algorithms/minmax/constrained.cc @@ -19,6 +19,8 @@ // { dg-do run { target c++2a } } #include <algorithm> +#include <string> +#include <vector> #include <testsuite_hooks.h> #include <testsuite_iterators.h> @@ -89,10 +91,50 @@ test03() == res_t(1,4) ); } +void +test04() +{ + // Verify we perform at most 3*N/2 applications of the comparison predicate. + static int counter; + struct counted_less + { bool operator()(int a, int b) { ++counter; return a < b; } }; + + ranges::minmax({1,2}, counted_less{}); + VERIFY( counter == 1 ); + + counter = 0; + ranges::minmax({1,2,3}, counted_less{}); + VERIFY( counter == 3 ); + + counter = 0; + ranges::minmax({1,2,3,4,5,6,7,8,9,10}, counted_less{}); + VERIFY( counter <= 15 ); + + counter = 0; + ranges::minmax({10,9,8,7,6,5,4,3,2,1}, counted_less{}); + VERIFY( counter <= 15 ); +} + +void +test05() +{ + // PR libstdc++/100387 + using namespace std::literals::string_literals; + auto comp = [](const auto& a, const auto& b) { + return a.size() == b.size() ? a.front() < b.front() : a.size() > b.size(); + }; + auto result = ranges::minmax({"b"s, "a"s}, comp); + VERIFY( result.min == "a"s && result.max == "b"s ); + result = ranges::minmax({"c"s, "b"s, "a"s}, comp); + VERIFY( result.min == "a"s && result.max == "c"s ); +} + int main() { test01(); test02(); test03(); + test04(); + test05(); } diff --git a/libstdc++-v3/testsuite/25_algorithms/minmax_element/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/minmax_element/constrained.cc index 3b11c0d..0919f7d 100644 --- a/libstdc++-v3/testsuite/25_algorithms/minmax_element/constrained.cc +++ b/libstdc++-v3/testsuite/25_algorithms/minmax_element/constrained.cc @@ -61,8 +61,35 @@ test01() static_assert(ranges::minmax_element(y, y+3, {}, &X::i).max->j == 3); } +void +test02() +{ + // Verify we perform at most 3*N/2 applications of the comparison predicate. + static int counter; + struct counted_less + { bool operator()(int a, int b) { ++counter; return a < b; } }; + + int x[] = {1,2,3,4,5,6,7,8,9,10}; + ranges::minmax_element(x, x+2, counted_less{}); + VERIFY( counter == 1 ); + + counter = 0; + ranges::minmax_element(x, x+3, counted_less{}); + VERIFY( counter == 3 ); + + counter = 0; + ranges::minmax_element(x, counted_less{}); + VERIFY( counter <= 15 ); + + ranges::reverse(x); + counter = 0; + ranges::minmax_element(x, counted_less{}); + VERIFY( counter <= 15 ); +} + int main() { test01(); + test02(); } diff --git a/libstdc++-v3/testsuite/26_numerics/reduce/95833.cc b/libstdc++-v3/testsuite/26_numerics/reduce/95833.cc new file mode 100644 index 0000000..cf4644f --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/reduce/95833.cc @@ -0,0 +1,16 @@ +// { dg-do compile { target c++17 } } +// PR libstdc++/95833 - Incorrect static_assert in std::reduce overload + +#include <numeric> + +struct A { }; +struct B { }; + +struct binop +{ + template<typename T, typename U> + A operator()(T&&, U&&) const { return A{}; } +}; + +B b; +A a = std::reduce(&b, &b + 1, A{}, binop{}); diff --git a/libstdc++-v3/testsuite/std/ranges/97600.cc b/libstdc++-v3/testsuite/std/ranges/97600.cc index 7435de0..c642b9d 100644 --- a/libstdc++-v3/testsuite/std/ranges/97600.cc +++ b/libstdc++-v3/testsuite/std/ranges/97600.cc @@ -24,9 +24,8 @@ #include <ranges> void -test01() +test01(std::ranges::basic_istream_view<int, char, std::char_traits<char>> v) { - std::ranges::basic_istream_view<int, char, std::char_traits<char>> v; v.begin(); static_assert(std::ranges::range<decltype(v)>); } diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/100479.cc b/libstdc++-v3/testsuite/std/ranges/adaptors/100479.cc index ba10b7b..b8c1e6f 100644 --- a/libstdc++-v3/testsuite/std/ranges/adaptors/100479.cc +++ b/libstdc++-v3/testsuite/std/ranges/adaptors/100479.cc @@ -90,16 +90,16 @@ test03() // Propagating cached iterators during copy/move would cause these asserts // to fail here. auto v = views::single(1) - | views::split(1) + | views::lazy_split(1) | views::drop(0) | views::drop_while([](auto) { return false; }) | views::filter([](auto) { return true; }); static_assert(ranges::forward_range<decltype(v)>); - VERIFY( ranges::next(v.begin()) == v.end() ); + VERIFY( ranges::distance(v) == 2 ); auto w = v; - VERIFY( ranges::next(w.begin()) == w.end() ); + VERIFY( ranges::distance(v) == 2 ); auto z = std::move(w); - VERIFY( ranges::next(z.begin()) == z.end() ); + VERIFY( ranges::distance(v) == 2 ); return true; } diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/100577.cc b/libstdc++-v3/testsuite/std/ranges/adaptors/100577.cc index 29176c8..26da497 100644 --- a/libstdc++-v3/testsuite/std/ranges/adaptors/100577.cc +++ b/libstdc++-v3/testsuite/std/ranges/adaptors/100577.cc @@ -21,6 +21,7 @@ // PR libstdc++/100577 #include <ranges> +#include <functional> namespace ranges = std::ranges; namespace views = std::ranges::views; @@ -28,19 +29,19 @@ namespace views = std::ranges::views; void test01() { - // Verify all multi-argument adaptors except for views::split are denoted - // to have simple extra arguments. + // Verify adaptors are deemed to have simple extra arguments when appropriate. using views::__adaptor::__adaptor_has_simple_extra_args; - static_assert(__adaptor_has_simple_extra_args<decltype(views::transform)>); - static_assert(__adaptor_has_simple_extra_args<decltype(views::filter)>); - static_assert(__adaptor_has_simple_extra_args<decltype(views::drop)>); - static_assert(__adaptor_has_simple_extra_args<decltype(views::take)>); - static_assert(__adaptor_has_simple_extra_args<decltype(views::take_while)>); - static_assert(__adaptor_has_simple_extra_args<decltype(views::drop_while)>); - static_assert(!__adaptor_has_simple_extra_args<decltype(views::split)>); - - // Verify all adaptor closures except for views::split(pattern) have a simple - // operator(). + using std::identity; + static_assert(__adaptor_has_simple_extra_args<decltype(views::transform), identity>); + static_assert(__adaptor_has_simple_extra_args<decltype(views::filter), identity>); + static_assert(__adaptor_has_simple_extra_args<decltype(views::drop), int>); + static_assert(__adaptor_has_simple_extra_args<decltype(views::take), int>); + static_assert(__adaptor_has_simple_extra_args<decltype(views::take_while), identity>); + static_assert(__adaptor_has_simple_extra_args<decltype(views::drop_while), identity>); + static_assert(__adaptor_has_simple_extra_args<decltype(views::lazy_split), std::string_view>); + static_assert(__adaptor_has_simple_extra_args<decltype(views::lazy_split), char>); + static_assert(!__adaptor_has_simple_extra_args<decltype(views::lazy_split), std::string>); + using views::__adaptor::__closure_has_simple_call_op; __closure_has_simple_call_op auto a00 = views::all; __closure_has_simple_call_op auto a01 = views::transform(std::identity{}); @@ -53,15 +54,24 @@ test01() __closure_has_simple_call_op auto a08 = views::common; __closure_has_simple_call_op auto a09 = views::reverse; __closure_has_simple_call_op auto a10 = views::keys; + __closure_has_simple_call_op auto a11 = views::lazy_split(' '); + __closure_has_simple_call_op auto a11a = views::split(' '); // Verify composition of simple closures is simple. __closure_has_simple_call_op auto b - = (a00 | a01) | (a02 | a03) | (a04 | a05 | a06) | (a07 | a08 | a09 | a10); + = (a00 | a01) | (a02 | a03) | (a04 | a05 | a06) | (a07 | a08 | a09 | a10) | a11; + + // Verify views::lazy_split(non_view_range) is an exception. + extern std::string s; + auto a12 = views::lazy_split(s); + static_assert(!__closure_has_simple_call_op<decltype(a12)>); + static_assert(!__closure_has_simple_call_op<decltype(a12 | a00)>); + static_assert(!__closure_has_simple_call_op<decltype(a00 | a12)>); - // Verify views::split is the exception. - auto a11 = views::split(' '); - static_assert(!__closure_has_simple_call_op<decltype(a11)>); - static_assert(!__closure_has_simple_call_op<decltype(a11 | a00)>); - static_assert(!__closure_has_simple_call_op<decltype(a00 | a11)>); + // Likewise views::split(non_view_range). + auto a12a = views::split(s); + static_assert(!__closure_has_simple_call_op<decltype(a12a)>); + static_assert(!__closure_has_simple_call_op<decltype(a12a | a00)>); + static_assert(!__closure_has_simple_call_op<decltype(a00 | a12a)>); } void @@ -71,18 +81,14 @@ test02() // fallback deleted overload, so when a call is ill-formed overload resolution // fails. extern int x[10]; - auto badarg = nullptr; + struct { } badarg; views::transform(badarg)(x); // { dg-error "no match" } views::filter(badarg)(x); // { dg-error "no match" } - views::take(badarg)(x); // { dg-error "no match" } - views::drop(badarg)(x); // { dg-error "no match" } views::take_while(badarg)(x); // { dg-error "no match" } views::drop_while(badarg)(x); // { dg-error "no match" } (views::transform(badarg) | views::all)(x); // { dg-error "no match" } (views::filter(badarg) | views::all)(x); // { dg-error "no match" } - (views::take(badarg) | views::all)(x); // { dg-error "no match" } - (views::drop(badarg) | views::all)(x); // { dg-error "no match" } (views::take_while(badarg) | views::all)(x); // { dg-error "no match" } (views::drop_while(badarg) | views::all)(x); // { dg-error "no match" } @@ -90,12 +96,47 @@ test02() // implemented using a fallback deleted overload, so when a call is // ill-formed overload resolution succeeds but selects the deleted overload // (but only when the closure is invoked as an rvalue). - views::split(badarg)(x); // { dg-error "deleted function" } - (views::split(badarg) | views::all)(x); // { dg-error "deleted function" } - auto a0 = views::split(badarg); + views::lazy_split(badarg)(x); // { dg-error "deleted function" } + (views::lazy_split(badarg) | views::all)(x); // { dg-error "deleted function" } + auto a0 = views::lazy_split(badarg); a0(x); // { dg-error "no match" }; auto a1 = a0 | views::all; a1(x); // { dg-error "no match" } + + views::split(badarg)(x); // { dg-error "deleted function" } + (views::split(badarg) | views::all)(x); // { dg-error "deleted function" } + auto a0a = views::split(badarg); + a0a(x); // { dg-error "no match" }; + auto a1a = a0a | views::all; + a1a(x); // { dg-error "no match" } + + views::take(badarg)(x); // { dg-error "deleted" } + views::drop(badarg)(x); // { dg-error "deleted" } + (views::take(badarg) | views::all)(x); // { dg-error "deleted" } + (views::drop(badarg) | views::all)(x); // { dg-error "deleted" } +} + +void +test03() +{ + // PR libstdc++/100940 + extern int x[10]; + struct S { operator int() && { return 5; }; }; + x | std::views::take(S{}); + x | std::views::drop(S{}); +} + +void +test04() +{ + // Non-trivially-copyable extra arguments make a closure not simple. + using F = std::function<bool(bool)>; + static_assert(!std::is_trivially_copyable_v<F>); + using views::__adaptor::__closure_has_simple_call_op; + static_assert(!__closure_has_simple_call_op<decltype(views::take_while(std::declval<F>()))>); + static_assert(!__closure_has_simple_call_op<decltype(views::drop_while(std::declval<F>()))>); + static_assert(!__closure_has_simple_call_op<decltype(views::filter(std::declval<F>()))>); + static_assert(!__closure_has_simple_call_op<decltype(views::transform(std::declval<F>()))>); } // { dg-prune-output "in requirements" } diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/detail/semiregular_box.cc b/libstdc++-v3/testsuite/std/ranges/adaptors/detail/copyable_box.cc index ed694e0..fa6d4d5 100644 --- a/libstdc++-v3/testsuite/std/ranges/adaptors/detail/semiregular_box.cc +++ b/libstdc++-v3/testsuite/std/ranges/adaptors/detail/copyable_box.cc @@ -82,9 +82,10 @@ test01() } static_assert(test01()); -template<bool make_semiregular> +template<bool make_copyable> struct A { - A() requires make_semiregular; + A(const A&) = default; + A& operator=(const A&) requires make_copyable; A(int, int); A(std::initializer_list<int>) = delete; }; @@ -93,9 +94,51 @@ void test02() { // PR libstdc++/100475 - static_assert(std::semiregular<A<true>>); + static_assert(std::copyable<A<true>>); __box<A<true>> x2(std::in_place, 0, 0); - static_assert(!std::semiregular<A<false>>); + static_assert(!std::copyable<A<false>>); __box<A<false>> x1(std::in_place, 0, 0); } + +constexpr bool +test03() +{ + // Verify correctness of the non-defaulted operator= for the partial + // specialization of __box. + struct B { + constexpr B(int* p) : p(p) { } + constexpr ~B() { ++*p; }; + B(const B&) = default; + B& operator=(const B&) = delete; + int* p; + }; + static_assert(!std::copyable<B>); + static_assert(std::is_nothrow_copy_constructible_v<B>); + static_assert(sizeof(__box<B>) == sizeof(B)); + + int m = 0; + __box<B> x(std::in_place, &m); + __glibcxx_assert(m == 0); + x = x; + __glibcxx_assert(m == 0); + x = std::move(x); + __glibcxx_assert(m == 0); + + int n = 0; + __box<B> y(std::in_place, &n); + auto z = x; + x = y; + __glibcxx_assert(m == 1); + __glibcxx_assert(n == 0); + __glibcxx_assert(x->p == &n); + __glibcxx_assert(y->p == &n); + y = std::move(z); + __glibcxx_assert(m == 1); + __glibcxx_assert(n == 1); + __glibcxx_assert(y->p == &m); + __glibcxx_assert(z->p == &m); + + return true; +} +static_assert(test03()); diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/join.cc b/libstdc++-v3/testsuite/std/ranges/adaptors/join.cc index d774e8d..50af3fd 100644 --- a/libstdc++-v3/testsuite/std/ranges/adaptors/join.cc +++ b/libstdc++-v3/testsuite/std/ranges/adaptors/join.cc @@ -93,7 +93,7 @@ test05() { using namespace std::literals; std::vector<std::string> x = {"the", " ", "quick", " ", "brown", " ", "fox"}; - auto v = x | views::join | views::split(' '); + auto v = x | views::join | views::lazy_split(' '); auto i = v.begin(); VERIFY( ranges::equal(*i++, "the"sv) ); VERIFY( ranges::equal(*i++, "quick"sv) ); diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/lazy_split.cc b/libstdc++-v3/testsuite/std/ranges/adaptors/lazy_split.cc new file mode 100644 index 0000000..cfd9983 --- /dev/null +++ b/libstdc++-v3/testsuite/std/ranges/adaptors/lazy_split.cc @@ -0,0 +1,229 @@ +// Copyright (C) 2020-2021 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library 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, or (at your option) +// any later version. + +// This 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 General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// { dg-options "-std=gnu++2a" } +// { dg-do run { target c++2a } } + +#include <algorithm> +#include <ranges> +#include <string> +#include <string_view> +#include <testsuite_hooks.h> +#include <testsuite_iterators.h> + +using __gnu_test::test_range; +using __gnu_test::forward_iterator_wrapper; +using __gnu_test::input_iterator_wrapper; + +namespace ranges = std::ranges; +namespace views = std::ranges::views; + +using namespace std::literals; + +void +test01() +{ + auto x = "the quick brown fox"sv; + auto p = std::string{" "}; + auto v = x | views::lazy_split(views::all(p)); // views::all is needed here after P2281. + auto i = v.begin(); + VERIFY( ranges::equal(*i++, "the"sv) ); + VERIFY( ranges::equal(*i++, "quick"sv) ); + VERIFY( ranges::equal(*i++, "brown"sv) ); + VERIFY( ranges::equal(*i++, "fox"sv) ); + VERIFY( i == v.end() ); +} + +void +test02() +{ + auto x = "the quick brown fox"sv; + auto v = x | views::lazy_split(' '); + auto i = v.begin(); + VERIFY( ranges::equal(*i++, "the"sv) ); + VERIFY( ranges::equal(*i++, "quick"sv) ); + VERIFY( ranges::equal(*i++, "brown"sv) ); + VERIFY( ranges::equal(*i++, "fox"sv) ); + VERIFY( i == v.end() ); +} + +void +test03() +{ + char x[] = "the quick brown fox"; + test_range<char, forward_iterator_wrapper> rx(x, x+sizeof(x)-1); + auto v = rx | views::lazy_split(' '); + auto i = v.begin(); + VERIFY( ranges::equal(*i++, "the"sv) ); + VERIFY( ranges::equal(*i++, "quick"sv) ); + VERIFY( ranges::equal(*i++, "brown"sv) ); + VERIFY( ranges::equal(*i++, "fox"sv) ); + VERIFY( i == v.end() ); +} + +void +test04() +{ + auto x = "the quick brown fox"sv; + std::initializer_list<char> p = {' ', ' '}; + static_assert(!ranges::view<decltype(p)>); + static_assert(std::same_as<decltype(p | views::all), + ranges::ref_view<decltype(p)>>); + auto v = x | views::lazy_split(views::all(p)); // views::all is needed here after P2281. + auto i = v.begin(); + VERIFY( ranges::equal(*i++, "the"sv) ); + VERIFY( ranges::equal(*i++, "quick"sv) ); + VERIFY( ranges::equal(*i++, "brown"sv) ); + VERIFY( ranges::equal(*i++, "fox"sv) ); + VERIFY( i == v.end() ); +} + +void +test05() +{ + auto as_string = [](ranges::view auto rng) { + auto in = rng | views::common; + return std::string(in.begin(), in.end()); + }; + std::string str + = "Now is the time for all good men to come to the aid of their county."; + auto rng + = str | views::lazy_split(' ') | views::transform(as_string) | views::common; + std::vector<std::string> words(rng.begin(), rng.end()); + auto not_space_p = [](char c) { return c != ' '; }; + VERIFY( ranges::equal(words | views::join, + str | views::filter(not_space_p)) ); +} + +void +test06() +{ + std::string str = "hello world"; + auto v = str | views::transform(std::identity{}) | views::lazy_split(' '); + + // Verify that _Iterator<false> is implicitly convertible to _Iterator<true>. + static_assert(!std::same_as<decltype(ranges::begin(v)), + decltype(ranges::cbegin(v))>); + auto b = ranges::cbegin(v); + b = ranges::begin(v); +} + +void +test07() +{ + char str[] = "banana split"; + auto split = str | views::lazy_split(' '); + auto val = *split.begin(); + auto b = val.begin(); + auto b2 = b++; + static_assert( noexcept(iter_move(b)) ); + static_assert( noexcept(iter_swap(b, b2)) ); +} + +void +test08() +{ + char x[] = "the quick brown fox"; + test_range<char, input_iterator_wrapper> rx(x, x+sizeof(x)-1); + auto v = rx | views::lazy_split(' '); + auto i = v.begin(); + VERIFY( ranges::equal(*i, "the"sv) ); + ++i; + VERIFY( ranges::equal(*i, "quick"sv) ); + ++i; + VERIFY( ranges::equal(*i, "brown"sv) ); + ++i; + VERIFY( ranges::equal(*i, "fox"sv) ); + ++i; + VERIFY( i == v.end() ); +} + +template<auto lazy_split = views::lazy_split> +void +test09() +{ + // Verify SFINAE behavior. + std::string s, p; + static_assert(!requires { lazy_split(); }); + static_assert(!requires { lazy_split(s, p, 0); }); + static_assert(!requires { lazy_split(p)(); }); + static_assert(!requires { s | lazy_split; }); + + static_assert(!requires { s | lazy_split(p); }); + static_assert(!requires { lazy_split(p)(s); }); + static_assert(!requires { s | (lazy_split(p) | views::all); }); + static_assert(!requires { (lazy_split(p) | views::all)(s); }); + + static_assert(requires { s | lazy_split(views::all(p)); }); + static_assert(requires { lazy_split(views::all(p))(s); }); + static_assert(requires { s | (lazy_split(views::all(p)) | views::all); }); + static_assert(requires { (lazy_split(views::all(p)) | views::all)(s); }); + + auto adapt = lazy_split(p); + static_assert(requires { s | adapt; }); + static_assert(requires { adapt(s); }); + + auto adapt2 = lazy_split(p) | views::all; + static_assert(requires { s | adapt2; }); + static_assert(requires { adapt2(s); }); +} + +void +test10() +{ + // LWG 3505 + auto to_string = [] (auto r) { + return std::string(r.begin(), ranges::next(r.begin(), r.end())); + }; + auto v = "xxyx"sv | views::lazy_split("xy"sv) | views::transform(to_string); + VERIFY( ranges::equal(v, (std::string_view[]){"x", "x"}) ); +} + +void +test11() +{ + // LWG 3478 + auto v = views::lazy_split("text"sv, "text"sv); + auto i = v.begin(); + VERIFY( ranges::empty(*i++) ); + VERIFY( ranges::empty(*i++) ); + VERIFY( i == v.end() ); + + static_assert(ranges::distance(views::lazy_split(" text "sv, ' ')) == 3); + static_assert(ranges::distance(views::lazy_split(" t e x t "sv, ' ')) == 6); + static_assert(ranges::distance(views::lazy_split(" text "sv, " "sv)) == 3); + static_assert(ranges::distance(views::lazy_split(" text "sv, " "sv)) == 4); + static_assert(ranges::distance(views::lazy_split(" text "sv, " "sv)) == 4); + static_assert(ranges::distance(views::lazy_split("t"sv, 't')) == 2); + static_assert(ranges::distance(views::lazy_split("text"sv, ""sv)) == 4); +} + +int +main() +{ + test01(); + test02(); + test03(); + test04(); + test05(); + test06(); + test07(); + test08(); + test09(); + test10(); + test11(); +} diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/split_neg.cc b/libstdc++-v3/testsuite/std/ranges/adaptors/lazy_split_neg.cc index 4229314..c59f828 100644 --- a/libstdc++-v3/testsuite/std/ranges/adaptors/split_neg.cc +++ b/libstdc++-v3/testsuite/std/ranges/adaptors/lazy_split_neg.cc @@ -30,7 +30,7 @@ test01() { using namespace std::literals; auto x = "the quick brown fox"sv; - auto v = views::split(x, std::initializer_list<char>{' ', ' '}); // { dg-error "no match" } + auto v = views::lazy_split(x, std::initializer_list<char>{' ', ' '}); // { dg-error "no match" } } void @@ -38,8 +38,8 @@ test02() { using namespace std::literals; auto x = "the quick brown fox"sv; - auto v1 = views::split(std::initializer_list<char>{' ', ' '})(x); // { dg-error "deleted" } - auto v2 = x | views::split(std::initializer_list<char>{' ', ' '}); // { dg-error "no match" } + auto v1 = views::lazy_split(std::initializer_list<char>{' ', ' '})(x); // { dg-error "deleted" } + auto v2 = x | views::lazy_split(std::initializer_list<char>{' ', ' '}); // { dg-error "no match" } } // { dg-prune-output "in requirements" } diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/p2281.cc b/libstdc++-v3/testsuite/std/ranges/adaptors/p2281.cc index c916a5e..7950c43 100644 --- a/libstdc++-v3/testsuite/std/ranges/adaptors/p2281.cc +++ b/libstdc++-v3/testsuite/std/ranges/adaptors/p2281.cc @@ -34,7 +34,7 @@ void test01() { auto split_into_strings = [] (auto p) { - return views::split(p) | views::transform([](auto r){ + return views::lazy_split(p) | views::transform([](auto r){ return std::string(r.begin(), ranges::next(r.begin(), r.end())); }); }; @@ -60,19 +60,19 @@ struct move_only_range template<> inline constexpr bool std::ranges::enable_view<move_only_range> = true; -template<auto split = views::split> +template<auto lazy_split = views::lazy_split> void test02() { std::string_view s; move_only_range p; - static_assert(requires { s | split(std::move(p)); }); - static_assert(requires { split(std::move(p))(s); }); - static_assert(requires { split(std::move(p)) | views::all; }); - static_assert(requires { views::all | split(std::move(p)); }); - static_assert(!requires { split(p); }); - static_assert(!requires { split(p) | views::all; }); - static_assert(!requires { views::all | split(p); }); + static_assert(requires { s | lazy_split(std::move(p)); }); + static_assert(requires { lazy_split(std::move(p))(s); }); + static_assert(requires { lazy_split(std::move(p)) | views::all; }); + static_assert(requires { views::all | lazy_split(std::move(p)); }); + static_assert(!requires { lazy_split(p); }); + static_assert(!requires { lazy_split(p) | views::all; }); + static_assert(!requires { views::all | lazy_split(p); }); } int diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/sizeof.cc b/libstdc++-v3/testsuite/std/ranges/adaptors/sizeof.cc index 80326f8..219e2a6 100644 --- a/libstdc++-v3/testsuite/std/ranges/adaptors/sizeof.cc +++ b/libstdc++-v3/testsuite/std/ranges/adaptors/sizeof.cc @@ -46,7 +46,7 @@ static_assert(sizeof(ranges::take_while_view<V, decltype(pred_l)>) == 3*ptr); static_assert(sizeof(ranges::drop_while_view<V, decltype(pred_l)>) == 3*ptr); static_assert(sizeof(ranges::transform_view<V, decltype(func_l)>) == 3*ptr); -static_assert(sizeof(ranges::split_view<V, std::string_view>) == 4*ptr); +static_assert(sizeof(ranges::lazy_split_view<V, std::string_view>) == 4*ptr); static_assert (sizeof(ranges::reverse_view<ranges::filter_view<V, decltype(pred_l)>>) == 4*ptr); diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/split.cc b/libstdc++-v3/testsuite/std/ranges/adaptors/split.cc index 9d2cfa8..02c6073 100644 --- a/libstdc++-v3/testsuite/std/ranges/adaptors/split.cc +++ b/libstdc++-v3/testsuite/std/ranges/adaptors/split.cc @@ -37,6 +37,21 @@ using namespace std::literals; void test01() { + auto from_chars = [] (auto v) { + return std::stoi(std::string(v.data(), v.data() + v.size())); + }; + auto ints = "1.2.3.4"sv + | views::split('.') + | views::transform(from_chars); + VERIFY( ranges::equal(ints, (int[]){1,2,3,4}) ); +} + +// The following testcases are adapted from lazy_split.cc. +namespace from_lazy_split_cc +{ +void +test01() +{ auto x = "the quick brown fox"sv; auto p = std::string{" "}; auto v = x | views::split(views::all(p)); // views::all is needed here after P2281. @@ -109,52 +124,9 @@ test05() str | views::filter(not_space_p)) ); } -void -test06() -{ - std::string str = "hello world"; - auto v = str | views::transform(std::identity{}) | views::split(' '); - - // Verify that _Iterator<false> is implicitly convertible to _Iterator<true>. - static_assert(!std::same_as<decltype(ranges::begin(v)), - decltype(ranges::cbegin(v))>); - auto b = ranges::cbegin(v); - b = ranges::begin(v); -} - -void -test07() -{ - char str[] = "banana split"; - auto split = str | views::split(' '); - auto val = *split.begin(); - auto b = val.begin(); - auto b2 = b++; - static_assert( noexcept(iter_move(b)) ); - static_assert( noexcept(iter_swap(b, b2)) ); -} - -void -test08() -{ - char x[] = "the quick brown fox"; - test_range<char, input_iterator_wrapper> rx(x, x+sizeof(x)-1); - auto v = rx | views::split(' '); - auto i = v.begin(); - VERIFY( ranges::equal(*i, "the"sv) ); - ++i; - VERIFY( ranges::equal(*i, "quick"sv) ); - ++i; - VERIFY( ranges::equal(*i, "brown"sv) ); - ++i; - VERIFY( ranges::equal(*i, "fox"sv) ); - ++i; - VERIFY( i == v.end() ); -} - template<auto split = views::split> void -test09() +test06() { // Verify SFINAE behavior. std::string s, p; @@ -193,17 +165,37 @@ test10() VERIFY( ranges::equal(v, (std::string_view[]){"x", "x"}) ); } +void +test11() +{ + // LWG 3478 + auto v = views::split("text"sv, "text"sv); + auto i = v.begin(); + VERIFY( ranges::empty(*i++) ); + VERIFY( ranges::empty(*i++) ); + VERIFY( i == v.end() ); + + static_assert(ranges::distance(views::split(" text "sv, ' ')) == 3); + static_assert(ranges::distance(views::split(" t e x t "sv, ' ')) == 6); + static_assert(ranges::distance(views::split(" text "sv, " "sv)) == 3); + static_assert(ranges::distance(views::split(" text "sv, " "sv)) == 4); + static_assert(ranges::distance(views::split(" text "sv, " "sv)) == 4); + static_assert(ranges::distance(views::split("t"sv, 't')) == 2); + static_assert(ranges::distance(views::split("text"sv, ""sv)) == 4); +} +} // namespace from_lazy_split_cc + int main() { test01(); - test02(); - test03(); - test04(); - test05(); - test06(); - test07(); - test08(); - test09(); - test10(); + + from_lazy_split_cc::test01(); + from_lazy_split_cc::test02(); + from_lazy_split_cc::test03(); + from_lazy_split_cc::test04(); + from_lazy_split_cc::test05(); + from_lazy_split_cc::test06(); + from_lazy_split_cc::test10(); + from_lazy_split_cc::test11(); } diff --git a/libstdc++-v3/testsuite/std/ranges/p2259.cc b/libstdc++-v3/testsuite/std/ranges/p2259.cc index 1b422e4..0ec7e21 100644 --- a/libstdc++-v3/testsuite/std/ranges/p2259.cc +++ b/libstdc++-v3/testsuite/std/ranges/p2259.cc @@ -49,12 +49,12 @@ test01() // Verify the changes to transform_view. only_cxx20_input_range auto v2 = v0 | views::transform([](int& c) -> auto& { return c; }); - // Verify the changes to split_view. - only_cxx20_input_range auto v3 = v0 | views::split(12); + // Verify the changes to lazy_split_view. + only_cxx20_input_range auto v3 = v0 | views::lazy_split(12); static_assert(only_cxx20_input_range<decltype(*v3.begin())>); // Verify the changes to join_view. - only_cxx20_input_range auto v4 = v0 | views::split(12) | views::join; + only_cxx20_input_range auto v4 = v0 | views::lazy_split(12) | views::join; // Verify the changes to elements_view. only_cxx20_input_range auto v5 diff --git a/libstdc++-v3/testsuite/std/ranges/p2325.cc b/libstdc++-v3/testsuite/std/ranges/p2325.cc new file mode 100644 index 0000000..d2ebe9a --- /dev/null +++ b/libstdc++-v3/testsuite/std/ranges/p2325.cc @@ -0,0 +1,169 @@ +// { dg-options "-std=gnu++20" } +// { dg-do compile { target c++20 } } +// P2325R3 "Views should not be required to be default constructible" + +#include <ranges> +#include <iterator> +#include <span> +#include <sstream> +#include <vector> +#include <testsuite_iterators.h> + +using namespace std; + +template<default_initializable T> void f(); +template<typename T> requires weakly_incrementable<T> || ranges::view<T> void f(); + +void +test01() +{ + // Verify neither std::weakly_incrementable nor ranges::view require + // default_initializable. + f<int>(); // { dg-error "ambiguous" } +} + +void +test02() +{ + // Verify these iterators are not default constructible. + static_assert(!default_initializable<insert_iterator<vector<int>>>); + static_assert(!default_initializable<front_insert_iterator<vector<int>>>); + static_assert(!default_initializable<back_insert_iterator<vector<int>>>); + static_assert(!default_initializable<ostream_iterator<int>>); + + using iter = ostream_iterator<int>; + + // Verify common_iterator is conditionally default constructible. + static_assert(!default_initializable<common_iterator<iter, unreachable_sentinel_t>>); + static_assert(default_initializable<common_iterator<int*, unreachable_sentinel_t>>); + + // Verify counted_iterator is conditionally default constructible. + static_assert(!default_initializable<counted_iterator<iter>>); + static_assert(default_initializable<counted_iterator<int*>>); +} + +void +test03() +{ + using iter = ostream_iterator<int>; + + // Verify iota_view is conditionally default constructible. + static_assert(!default_initializable<ranges::iota_view<iter>>); + static_assert(!default_initializable<decltype(declval<ranges::iota_view<iter>>().begin())>); + static_assert(default_initializable<ranges::iota_view<int>>); + static_assert(default_initializable<decltype(declval<ranges::iota_view<int>>().begin())>); + + // Verify subrange is conditionally default constructible. + static_assert(!default_initializable<ranges::subrange<iter, unreachable_sentinel_t>>); + static_assert(default_initializable<ranges::subrange<int*, unreachable_sentinel_t>>); + + // Verify single_view is conditionally default constructible. + static_assert(!default_initializable<ranges::single_view<iter>>); + static_assert(default_initializable<ranges::single_view<int*>>); +} + +void +test04() +{ + // Verify basic_istream_view is not default constructible. + using type = ranges::basic_istream_view<int, char, char_traits<char>>; + static_assert(!default_initializable<type>); + static_assert(!default_initializable<decltype(declval<type>().begin())>); +} + +void +test05() +{ + // Verify ref_view is not default constructible. + static_assert(!default_initializable<ranges::ref_view<int[5]>>); +} + +template<auto adaptor> +void +test06() +{ + auto f1 = [] (auto) { return true; }; + auto f2 = [i=0] (auto) { return true; }; + static_assert(default_initializable<decltype(views::single(0) | adaptor(f1))>); + static_assert(!default_initializable<decltype(views::single(0) | adaptor(f2))>); + + struct S { S() = delete; }; + static_assert(!default_initializable<decltype(views::single(declval<S>()) | adaptor(f1))>); + static_assert(!default_initializable<decltype(views::single(declval<S>()) | adaptor(f2))>); +} + +// Verify filter_view, transform_view, take_while_view and drop_while_view are +// conditionally default constructible. +template void test06<views::filter>(); +template void test06<views::transform>(); +template void test06<views::take_while>(); +template void test06<views::drop_while>(); + +void +test07() +{ + // Verify join_view is conditionally default constructible. + struct S { S() = delete; }; + using type1 = ranges::join_view<ranges::single_view<ranges::single_view<S>>>; + static_assert(!default_initializable<type1>); + using type2 = ranges::join_view<ranges::single_view<ranges::single_view<int>>>; + static_assert(default_initializable<type2>); +} + +void +test08() +{ + // Verify lazy_split_view is conditionally default constructible. + using type1 = ranges::lazy_split_view<ranges::ref_view<int[2]>, ranges::single_view<int>>; + static_assert(!default_initializable<type1>); + using type2 = ranges::lazy_split_view<ranges::single_view<int>, ranges::ref_view<int[2]>>; + static_assert(!default_initializable<type2>); + using type3 = ranges::lazy_split_view<ranges::ref_view<int[2]>, ranges::ref_view<int[2]>>; + static_assert(!default_initializable<type3>); + using type4 = ranges::lazy_split_view<ranges::single_view<int>, ranges::single_view<int>>; + static_assert(default_initializable<type4>); +} + +void +test08a() +{ + // Verify split_view is conditionally default constructible. + using type1 = ranges::split_view<ranges::ref_view<int[2]>, ranges::single_view<int>>; + static_assert(!default_initializable<type1>); + using type2 = ranges::split_view<ranges::single_view<int>, ranges::ref_view<int[2]>>; + static_assert(!default_initializable<type2>); + using type3 = ranges::split_view<ranges::ref_view<int[2]>, ranges::ref_view<int[2]>>; + static_assert(!default_initializable<type3>); + using type4 = ranges::split_view<ranges::single_view<int>, ranges::single_view<int>>; + static_assert(default_initializable<type4>); +} + +void +test09() +{ + // Verify common_view is conditionally default constructible. + using type1 = ranges::common_view<ranges::iota_view<ostream_iterator<int>>>; + static_assert(!default_initializable<type1>); + using type2 = ranges::common_view<ranges::iota_view<int*>>; + static_assert(default_initializable<type2>); +} + +void +test10() +{ + // Verify reverse_view is conditionally default constructible. + using type1 = ranges::reverse_view<ranges::ref_view<int[2]>>; + static_assert(!default_initializable<type1>); + using type2 = ranges::reverse_view<ranges::single_view<int>>; + static_assert(default_initializable<type2>); +} + +void +test11() +{ + // Verify elements_view is conditionally default constructible. + using type1 = ranges::elements_view<ranges::ref_view<pair<int,int>[2]>, 0>; + static_assert(!default_initializable<type1>); + using type2 = ranges::elements_view<ranges::single_view<pair<int,int>>, 0>; + static_assert(default_initializable<type2>); +} diff --git a/libstdc++-v3/testsuite/std/ranges/p2367.cc b/libstdc++-v3/testsuite/std/ranges/p2367.cc index 4087523..70a0304 100644 --- a/libstdc++-v3/testsuite/std/ranges/p2367.cc +++ b/libstdc++-v3/testsuite/std/ranges/p2367.cc @@ -43,6 +43,7 @@ test01() // Verify changes to views::drop. auto v5 = views::drop(x, 0ull); - // Verify changes to views::split. - auto v6 = views::split(x, 5u); + // Verify changes to views::lazy_split. + auto v6 = views::lazy_split(x, 5u); + auto v7 = views::split(x, 5u); } diff --git a/libstdc++-v3/testsuite/std/ranges/single_view.cc b/libstdc++-v3/testsuite/std/ranges/single_view.cc index c036fc89..f1d8e10 100644 --- a/libstdc++-v3/testsuite/std/ranges/single_view.cc +++ b/libstdc++-v3/testsuite/std/ranges/single_view.cc @@ -96,6 +96,20 @@ test05() static_assert(noexcept(cs.empty())); // view_interface::empty() } +void +test06() +{ + // PR libstdc++/100475 comment #7 + struct S { + S() = default; + S(std::initializer_list<S>) = delete; + S(const S&) {} + }; + S obj; + auto x = std::views::single(obj); + auto y = std::views::single(std::move(obj)); +} + int main() { test01(); @@ -103,4 +117,5 @@ int main() test03(); test04(); test05(); + test06(); } diff --git a/libstdc++-v3/testsuite/std/ranges/view.cc b/libstdc++-v3/testsuite/std/ranges/view.cc index d8972ab..dd82582 100644 --- a/libstdc++-v3/testsuite/std/ranges/view.cc +++ b/libstdc++-v3/testsuite/std/ranges/view.cc @@ -31,7 +31,7 @@ static_assert(std::ranges::view<std::span<int>>); static_assert(std::ranges::view<std::span<int, 0>>); -static_assert(!std::ranges::view<std::span<int, 1>>); +static_assert(std::ranges::view<std::span<int, 1>>); // Changed with P2325R3 static_assert(std::ranges::view<std::string_view>); static_assert(std::ranges::view<std::experimental::string_view>); |