1. 03 Jul, 2019 40 commits
    • PR debug/90981 Empty .debug_addr crashes -gdwarf-5 -gsplit-dwarf · 6c47a87b
      Even if there was no, or an empty address list we would try to generate
      a header for the .debug_addr section with -gdwarf-5 and -gsplit-dwarf.
      The skeleton DIE would also get a (dangling) DW_AT_addr_base in that case.
      
      	PR debug/90981
      	* dwarf2out.c (add_top_level_skeleton_die_attrs): Only add
      	DW_AT_addr_base if there is actually a .debug_addr section with
      	addresses.
      	(output_addr_table): Add DWARF5 table header generation here after
      	checking there are actually any addresses from...
      	(dwarf2out_finish): ...here.
      	* testsuite/g++.dg/pr90981.C: New test.
      
      From-SVN: r273008
      Mark Wielaard committed
    • re PR tree-optimization/91069 (Miscompare of 453.povray since r272843) · cc49641a
      2019-07-03  Richard Biener  <rguenther@suse.de>
      
      	PR middle-end/91069
      	* match.pd (vec_perm -> bit_insert): Fix element read from
      	first vector.
      
      	* gcc.dg/pr91069.c: New testcase.
      
      From-SVN: r273007
      Richard Biener committed
    • Add dbgcnt for gimple_match and generic_match. · d398999d
      2019-07-03  Martin Liska  <mliska@suse.cz>
      
      	* dbgcnt.def (DEBUG_COUNTER): Add match debug counter.
      	* genmatch.c (dt_simplify::gen_1): Generate dbgcnt
      	condition.
      	* generic-match-head.c: Include dbgcnt.h.
      	* gimple-match-head.c: Likewise.
      
      From-SVN: r273006
      Martin Liska committed
    • Rename SINGE_VALUE to TOPN_VALUES counters. · 596341c7
      2019-07-03  Martin Liska  <mliska@suse.cz>
      
      	* gcov-counter.def (GCOV_COUNTER_V_SINGLE): Remove.
      	(GCOV_COUNTER_V_TOPN): New.
      	(GCOV_COUNTER_V_INDIR): Use _topn.
      	* gcov-io.h (GCOV_DISK_SINGLE_VALUES): Remove.
      	(GCOV_TOPN_VALUES): New.
      	(GCOV_SINGLE_VALUE_COUNTERS): Remove.
      	(GCOV_TOPN_VALUES_COUNTERS): New.
      	* profile.c (instrument_values): Use HIST_TYPE_TOPN_VALUES.
      	* tree-profile.c:
      	(gimple_init_gcov_profiler): Rename variables from one_value
      	to topn_values.
      	(gimple_gen_one_value_profiler): Remove.
      	(gimple_gen_topn_values_profiler): New function.
      	* value-prof.c (dump_histogram_value): Use TOPN_VALUES
      	names instead of SINGLE_VALUE.
      	(stream_out_histogram_value): Likewise.
      	(stream_in_histogram_value): Likewise.
      	(get_most_common_single_value): Likewise.
      	(gimple_divmod_fixed_value_transform): Likewise.
      	(gimple_stringops_transform): Likewise.
      	(gimple_divmod_values_to_profile): Likewise.
      	(gimple_stringops_values_to_profile): Likewise.
      	(gimple_find_values_to_profile): Likewise.
      	* value-prof.h (enum hist_type): Rename to TOPN.
      	(gimple_gen_one_value_profiler): Remove.
      	(gimple_gen_topn_values_profiler): New.
      2019-07-03  Martin Liska  <mliska@suse.cz>
      
      	* Makefile.in: Use topn_values instead of one_value names.
      	* libgcov-merge.c (__gcov_merge_single): Move to ...
      	(__gcov_merge_topn): ... this.
      	(merge_single_value_set): Move to ...
      	(merge_topn_values_set): ... this.
      	* libgcov-profiler.c (__gcov_one_value_profiler_body): Move to
      	...
      	(__gcov_topn_values_profiler_body): ... this.
      	(__gcov_one_value_profiler_v2): Move to ...
      	(__gcov_topn_values_profiler): ... this.
      	(__gcov_one_value_profiler_v2_atomic): Move to ...
      	(__gcov_topn_values_profiler_atomic): ... this.
      	(__gcov_indirect_call_profiler_v4): Remove.
      	* libgcov-util.c (__gcov_single_counter_op): Move to ...
      	(__gcov_topn_counter_op): ... this.
      	* libgcov.h (L_gcov_merge_single): Remove.
      	(L_gcov_merge_topn): New.
      	(__gcov_merge_single): Remove.
      	(__gcov_merge_topn): New.
      	(__gcov_one_value_profiler_v2): Move to ..
      	(__gcov_topn_values_profiler): ... this.
      	(__gcov_one_value_profiler_v2_atomic): Move to ...
      	(__gcov_topn_values_profiler_atomic): ... this.
      
      From-SVN: r273005
      Martin Liska committed
    • Support N values in libgcov for single value counter type. · 1b309ca5
      2019-07-03  Martin Liska  <mliska@suse.cz>
      
      	* gcc.dg/tree-prof/val-prof-2.c: Update scanned pattern
      	as we do now better.
      2019-07-03  Martin Liska  <mliska@suse.cz>
      
      	* libgcov-merge.c (merge_single_value_set): Support N values.
      	* libgcov-profiler.c (__gcov_one_value_profiler_body): Likewise.
      
      From-SVN: r273004
      Martin Liska committed
    • dwarf2out.c (add_scalar_info): Add back refererence to existing DIE if it has… · e157be91
      dwarf2out.c (add_scalar_info): Add back refererence to existing DIE if it has the DW_AT_data_member_location...
      
      	* dwarf2out.c (add_scalar_info): Add back refererence to existing DIE
      	if it has the DW_AT_data_member_location attribute.
      
      From-SVN: r273002
      Eric Botcazou committed
    • gimple-pretty-print.c (dump_ternary_rhs): Fix BIT_INSERT_EXPR dumping. · 6235b078
      2019-07-03  Richard Biener  <rguenther@suse.de>
      
      	* gimple-pretty-print.c (dump_ternary_rhs): Fix BIT_INSERT_EXPR
      	dumping.
      
      From-SVN: r273001
      Richard Biener committed
    • [aarch64]: force frame pointer setup before tlsdesc call · 0e510d18
      The operation that sets up the tlsdesc register is really a function
      call; as such, the frame pointer should really be correctly set up
      before this happens.  However, because it does not appear as a
      call_insn in the RTL the normal dependencies are not added
      automatically.  We fix this by adding a USE of FP_REGNUM to prevent
      migration of the frame-pointer setup past the call by the scheduler.
      If a frame pointer is not being used, this is harmless since it only
      represents a scheduling constraint.
      
      2019-07-03  Sylvia Taylor  <sylvia.taylor@arm.com>
      
      	* config/aarch64/aarch64.md (FP_REGNUM): New constant.
      	(tlsdesc_small_advsimd_<mode>): Add use of FP_REGNUM.
      	(tlsdesc_small_sve_<mode>): Likewise.
      
      From-SVN: r273000
      Sylvia Taylor committed
    • Fix ChangeLog date for last commit · e676d704
      From-SVN: r272999
      Andrea Corallo committed
    • Add myself to MAINTAINERS · e7dbf7f0
      2019-07-02  Andrea Corallo  <andrea.corallo@arm.com>
      
      	* MAINTAINERS (Write After Approval): Add myself.
      
      From-SVN: r272997
      Andrea Corallo committed
    • Add zstd support for LTO bytecode compression. · 87741e51
      2019-07-03  Martin Liska  <mliska@suse.cz>
      
      	* Makefile.in: Define ZSTD_LIB.
      	* common.opt: Adjust compression level
      	to support also zstd levels.
      	* config.in: Regenerate.
      	* configure: Likewise.
      	* configure.ac: Add --with-zstd and --with-zstd-include options
      	and detect ZSTD.
      	* doc/install.texi: Mention zstd dependency.
      	* gcc.c: Print supported LTO compression algorithms.
      	* lto-compress.c (lto_normalized_zstd_level): Likewise.
      	(lto_compression_zstd): Likewise.
      	(lto_uncompression_zstd): Likewise.
      	(lto_end_compression): Dispatch in between zlib and zstd.
      	(lto_compression_zlib): Mark with ATTRIBUTE_UNUSED.
      	(lto_uncompression_zlib): Make it static.
      	* lto-compress.h (lto_end_uncompression): Fix GNU coding style.
      	* lto-section-in.c (lto_get_section_data): Pass info
      	about used compression.
      	* lto-streamer-out.c: By default use zstd when possible.
      	* timevar.def (TV_IPA_LTO_DECOMPRESS): Rename to decompression
      	(TV_IPA_LTO_COMPRESS): Likewise for compression.
      
      From-SVN: r272996
      Martin Liska committed
    • Add .gnu.lto_.lto section. · 88614dfa
      2019-07-03  Martin Liska  <mliska@suse.cz>
      
      	* lto-section-in.c (lto_get_section_data): Add "lto" section.
      	* lto-section-out.c (lto_destroy_simple_output_block): Never
      	compress LTO_section_lto section.
      	* lto-streamer-out.c (produce_asm): Do not set major_version
      	and minor_version.
      	(lto_output_toplevel_asms): Likewise.
      	(produce_lto_section): New function.
      	(lto_output): Call produce_lto_section.
      	(lto_write_mode_table): Do not set major_version and
      	minor_version.
      	(produce_asm_for_decls): Likewise.
      	* lto-streamer.h (enum lto_section_type): Add LTO_section_lto
      	type.
      	(struct lto_header): Remove.
      	(struct lto_section): New struct.
      	(struct lto_simple_header): Do not inherit from lto_header.
      	(struct lto_file_decl_data): Add lto_section_header field.
      2019-07-03  Martin Liska  <mliska@suse.cz>
      
      	* lto-common.c: Read LTO section and verify header.
      
      From-SVN: r272995
      Martin Liska committed
    • Remove another bunch of dead assignment. · 8ba6ea87
      2019-07-03  Martin Liska  <mliska@suse.cz>
      
      	* lra-eliminations.c (eliminate_regs_in_insn): Remove
      	dead assignemts.
      	* reg-stack.c (check_asm_stack_operands): Likewise.
      	* tree-ssa-structalias.c (create_function_info_for): Likewise.
      	* tree-vect-generic.c (expand_vector_operations_1): Likewise.
      	* config/i386/i386-expand.c (ix86_expand_sse2_mulvxdi3): Use
      	force_expand_binop.
      2019-07-03  Martin Liska  <mliska@suse.cz>
      
      	* c-common.c (try_to_locate_new_include_insertion_point): Remove
      	dead assignemts.
      2019-07-03  Martin Liska  <mliska@suse.cz>
      
      	* call.c (build_new_op_1): Remove
      	dead assignemts.
      	* typeck.c (cp_build_binary_op): Likewise.
      2019-07-03  Martin Liska  <mliska@suse.cz>
      
      	* check.c (gfc_check_c_funloc): Remove
      	dead assignemts.
      	* decl.c (variable_decl): Likewise.
      	* resolve.c (resolve_typebound_function): Likewise.
      	* simplify.c (gfc_simplify_matmul): Likewise.
      	(gfc_simplify_scan): Likewise.
      	* trans-array.c (gfc_could_be_alias): Likewise.
      	* trans-common.c (add_equivalences): Likewise.
      	* trans-expr.c (trans_class_vptr_len_assignment): Likewise.
      	(gfc_trans_array_constructor_copy): Likewise.
      	(gfc_trans_assignment_1): Likewise.
      	* trans-intrinsic.c (conv_intrinsic_atomic_op): Likewise.
      	* trans-openmp.c (gfc_omp_finish_clause): Likewise.
      	* trans-types.c (gfc_get_array_descriptor_base): Likewise.
      	* trans.c (gfc_build_final_call): Likewise.
      2019-07-03  Martin Liska  <mliska@suse.cz>
      
      	* line-map.c (linemap_get_expansion_filename): Remove
      	dead assignemts.
      	* mkdeps.c (make_write): Likewise.
      
      From-SVN: r272994
      Martin Liska committed
    • Handle '\0' in strcmp in RTL expansion (PR tree-optimization/90892). · 6aa2e42c
      2019-07-03  Martin Liska  <mliska@suse.cz>
      
      	PR tree-optimization/90892
      	* builtins.c (inline_expand_builtin_string_cmp): Handle '\0'
      	in string constants.
      2019-07-03  Martin Liska  <mliska@suse.cz>
      
      	PR tree-optimization/90892
      	* gcc.dg/pr90892.c: New test.
      
      From-SVN: r272993
      Martin Liska committed
    • Add to same comdate group only if set (PR middle-end/90899) · d04295d2
      2019-07-03  Martin Liska  <mliska@suse.cz>
      
      	PR middle-end/90899
      	* multiple_target.c (create_dispatcher_calls): Add to comdat
      	group only if set for ifunc.
      2019-07-03  Martin Liska  <mliska@suse.cz>
      
      	PR middle-end/90899
      	* gcc.target/i386/pr90899.c: New test.
      
      From-SVN: r272992
      Martin Liska committed
    • Fix use-after-scope in host-mingw32.c (PR target/88056). · 22dfc3e8
      2019-07-03  Martin Liska  <mliska@suse.cz>
      
      	PR target/88056
      	* config/i386/host-mingw32.c (mingw32_gt_pch_use_address):
      	Define local_object_name in outer scope in order to handle
      	use-after-scope issue.
      
      From-SVN: r272991
      Martin Liska committed
    • Add -fprofile-note option. · 8e37c995
      2019-07-03  Martin Liska  <mliska@suse.cz>
      
      	* common.opt: Add fprofile-note.
      	* coverage.c (coverage_init): Append the option
      	to bbg_file_name.
      	* doc/invoke.texi: Document -fprofile-note.
      
      From-SVN: r272990
      Martin Liska committed
    • re PR tree-optimization/91033 (ICE in vect_analyze_loop, at tree-vect-loop.c:2416) · a7b3509e
      	PR tree-optimization/91033
      	* tree-vectorizer.h (vect_mark_stmts_to_be_vectorized,
      	vect_analyze_data_refs): Add bool * arguments.
      	* tree-vect-data-refs.c (vect_analyze_data_refs): Add fatal argument,
      	if failure is due to scatter/gather, set *fatal to false if non-NULL.
      	* tree-vect-stmts.c (vect_mark_stmts_to_be_vectorized): Likewise.
      	* tree-vect-loop.c (vect_analyze_loop_2): Adjust
      	vect_mark_stmts_to_be_vectorized and vect_analyze_data_refs callers.
      	* tree-vect-slp.c (vect_slp_analyze_bb_1): Adjust
      	vect_analyze_data_refs caller.
      
      	* gcc.target/i386/pr91033.c: New test.
      
      From-SVN: r272989
      Jakub Jelinek committed
    • [Ada] Document new flags in GNATpp · 49d0d5fc
      2019-07-03  Bob Duff  <duff@adacore.com>
      
      gcc/ada/
      
      	* doc/gnat_ugn/gnat_utility_programs.rst: Document new flags in
      	GNATpp.
      
      From-SVN: r272988
      Bob Duff committed
    • [Ada] Forced elaboration order in Elaboration order v4.0 · 76b4158b
      This patch refactors the forced elaboration order functionality,
      reintegrates it in Binde, and impelements it in Bindo.
      
      ------------
      -- Source --
      ------------
      
      --  server.ads
      
      package Server is
      end Server;
      
      --  client.ads
      
      with Server;
      
      package Client is
      end Client;
      
      --  main.adb
      
      with Client;
      
      procedure Main is begin null; end Main;
      
      --  duplicate_1.txt
      
      server (spec)
      client (spec)
      server (spec)
      
      --  error_unit_1.txt
      
      no such unit
      client (spec)
      
      --  error_unit_2.txt
      
      no such unit
      client (spec)
      
      --  error_unit_3.txt
      
      no such unit     --  comment
      client (spec)
      
      --  error_unit_4.txt
      
               no such unit     --  comment
      
      client (spec)
      
      --  error_unit_5.txt
      
      no such unit (body)
      client (spec)
      
      --  error_unit_6.txt
      
          no such unit (body)
      client (spec)
      
      --  error_unit_7.txt
      
          no such unit (body)    --  comment
      client (spec)
      
      --  error_unit_8.txt
      
          no such unit (body)--  comment
      client (spec)
      
      --  error_unit_9.txt
      
          no such unit--  comment
      client (spec)
      
      --  no_unit_1.txt
      
      --  no_unit_2.txt
      
      --  no_unit_3.txt
      
            --  comment
      
      --  no_unit_4.txt
      
      --  no_unit_5.txt
      
      --  no_unit_6.txt
      
             --  comment
      
      --  no_unit_7.txt
      
      --  no_unit_8.txt
      
          --  comment
      --  comment
      
      --  ok_unit_1.txt
      
      server (spec)
      client (spec)
      
      --  ok_unit_2.txt
      
          server (spec)
      client (spec)
      
      --  ok_unit_3.txt
      
          server (spec)
      client (spec)
      
      --  ok_unit_4.txt
      
          server (spec)      --  comment
      client (spec)
      
      --  ok_unit_5.txt
      
      server (spec)
      client (spec)
      
      --  ok_unit_6.txt
      
      server (spec)
      client (spec)    --  comment
      
      --  ok_unit_7.txt
      
      server (spec)
      client (spec)    --  comment
      
      --  ok_unit_8.txt
      
          --  comment
      --  comment
          server (spec)
      
         --  comment
      --  comment
      
      client (spec)    --  comment
      
      --  ok_unit_9.txt
      
      server (spec)--  comment
      client (spec)
      
      ----------------------------
      -- Compilation and output --
      ----------------------------
      $ gnatmake -q main.adb
      $ gnatbind -fno_unit_1.txt main.ali
      $ gnatbind -fno_unit_2.txt main.ali
      $ gnatbind -fno_unit_3.txt main.ali
      $ gnatbind -fno_unit_4.txt main.ali
      $ gnatbind -fno_unit_5.txt main.ali
      $ gnatbind -fno_unit_6.txt main.ali
      $ gnatbind -fno_unit_7.txt main.ali
      $ gnatbind -fno_unit_8.txt main.ali
      $ gnatbind -ferror_unit_1.txt main.ali
      $ gnatbind -ferror_unit_2.txt main.ali
      $ gnatbind -ferror_unit_3.txt main.ali
      $ gnatbind -ferror_unit_4.txt main.ali
      $ gnatbind -ferror_unit_5.txt main.ali
      $ gnatbind -ferror_unit_6.txt main.ali
      $ gnatbind -ferror_unit_7.txt main.ali
      $ gnatbind -ferror_unit_8.txt main.ali
      $ gnatbind -ferror_unit_9.txt main.ali
      $ gnatbind -fduplicate_1.txt main.ali
      $ gnatbind -fok_unit_1.txt main.ali
      $ gnatbind -fok_unit_2.txt main.ali
      $ gnatbind -fok_unit_3.txt main.ali
      $ gnatbind -fok_unit_4.txt main.ali
      $ gnatbind -fok_unit_5.txt main.ali
      $ gnatbind -fok_unit_6.txt main.ali
      $ gnatbind -fok_unit_7.txt main.ali
      $ gnatbind -fok_unit_8.txt main.ali
      $ gnatbind -fok_unit_9.txt main.ali
      "no such unit": not present; ignored
      "no such unit": not present; ignored
      "no such unit": not present; ignored
      "no such unit": not present; ignored
      "no such unit%b": not present; ignored
      "no such unit%b": not present; ignored
      "no such unit%b": not present; ignored
      "no such unit%b": not present; ignored
      "no such unit": not present; ignored
      server (spec) <-- client (spec)
      error: duplicate_1.txt:3: duplicate unit name "server (spec)" from line 1
      server (spec) <-- client (spec)
      server (spec) <-- client (spec)
      server (spec) <-- client (spec)
      server (spec) <-- client (spec)
      server (spec) <-- client (spec)
      server (spec) <-- client (spec)
      server (spec) <-- client (spec)
      server (spec) <-- client (spec)
      server (spec) <-- client (spec)
      
      2019-07-03  Hristian Kirtchev  <kirtchev@adacore.com>
      
      gcc/ada/
      
      	* binde.adb: Remove with clause for System.OS_Lib.
      	(Force_Elab_Order): Refactor the majority of the code in Butil.
      	Use the new forced units iterator to obtain unit names.
      	* bindo-builders.adb: Add with and use clauses for Binderr,
      	Butil, Opt, Output, Types, GNAT, and GNAT.Dynamic_HTables.  Add
      	a hash table which maps units to line number in the forced
      	elaboration order file.
      	(Add_Unit): New routine.
      	(Build_Library_Graph): Create forced edges between pairs of
      	units listed in the forced elaboration order file.
      	(Create_Forced_Edge, Create_Forced_Edges, Destroy_Line_Number,
      	Duplicate_Unit_Error, Hash_Unit, Internal_Unit_Info,
      	Is_Duplicate_Unit, Missing_Unit_Info): New routines.
      	* bindo-graphs.adb (Is_Internal_Unit, Is_Predefined_Unit):
      	Refactor some of the behavior to Bindo-Units.
      	* bindo-graphs.ads: Enable the enumeration literal for forced
      	edges.
      	* bindo-units.adb, bindo-units.ads (Is_Internal_Unit,
      	Is_Predefined_Unit): New routines.
      	* butil.adb: Add with and use clauses for Opt, GNAT, and
      	System.OS_Lib.  Add with clause for Unchecked_Deallocation.
      	(Has_Next, Iterate_Forced_Units, Next, Parse_Next_Unit_Name,
      	Read_Forced_Elab_Order_File): New routines.
      	* butil.ads: Add with and use clauses for Types.  Add new
      	iterator over the units listed in the forced elaboration order
      	file.
      	(Has_Next, Iterate_Forced_Units, Next): New routine.
      	* namet.adb, namet.ads (Present): New routine.
      
      From-SVN: r272987
      Hristian Kirtchev committed
    • [Ada] Crash on anonymous access-to-class-wide with tasks · 336878fc
      This patch fixes a bug in which if an object declaration is of an
      anonymous access type whose designated type is a limited class-wide type
      (but not an interface), and the object is initialized with an allocator,
      and the designated type of the allocator contains tasks, the compiler
      would crash.
      
      2019-07-03  Bob Duff  <duff@adacore.com>
      
      gcc/ada/
      
      	* sem_ch3.adb (Access_Definition): The code was creating a
      	master in the case where the designated type is a class-wide
      	interface type. Create a master in the noninterface case as
      	well. That is, create a master for all limited class-wide types.
      
      gcc/testsuite/
      
      	* gnat.dg/task2.adb, gnat.dg/task2_pkg.adb,
      	gnat.dg/task2_pkg.ads: New testcase.
      
      From-SVN: r272986
      Bob Duff committed
    • [Ada] Suppress warnings in generic instantiations with pragma Warnings · 3f3dbb7b
      Warnings issued by GNAT or GNATprove inside generic instantiations can
      now be suppressed by using pragma Warnings Off/On around the instance.
      This has mostly an effect on GNATprove, since GNAT typically does not
      issue warnings on instantiations, only on the generic code itself.
      
      2019-07-03  Yannick Moy  <moy@adacore.com>
      
      gcc/ada/
      
      	* erroutc.adb (Sloc_In_Range): New function to determine whether
      	the range of a pragma Warnings covers a location, taking
      	instantiations into account.
      
      From-SVN: r272985
      Yannick Moy committed
    • [Ada] New routine to access file on command line · 10aea826
      This patch adds a new routine to query the first file argument of the
      commandline without moving to the next file. This is needed in SPARK.
      
      There is no impact on compilation.
      
      2019-07-03  Johannes Kanig  <kanig@adacore.com>
      
      gcc/ada/
      
      	* osint.ads, osint.adb (Get_First_Main_File_Name): New routine
      	to access the first file provided on the command line.
      
      From-SVN: r272984
      Johannes Kanig committed
    • [Ada] Crash on front-end inlining of subp. with aspect specifications · 5460389b
      This patch fixes a gap in the handling of formals when inlining a call
      to a subprogram marked Inline_Always. For the inlining, the formals are
      replaced by the actuals in the block constructed for inlining, The
      traversal that performs this replacement does not apply to aspect
      specifications that may appear in the original body, because these
      aspects are only indirectly reachable from the nodes to which they
      apply: a separate traversal is required to perform the replacement in
      the expressions for any aspect specification present in the source.
      
      2019-07-03  Ed Schonberg  <schonberg@adacore.com>
      
      gcc/ada/
      
      	* inline.adb (Process_Formals_In_Aspects): New procedure within
      	Expand_Inlined_Call, to perform a replacement of references to
      	formals that appear in aspect specifications within the body
      	being inlined.
      
      gcc/testsuite/
      
      	* gnat.dg/inline16.adb, gnat.dg/inline16_gen.adb,
      	gnat.dg/inline16_gen.ads, gnat.dg/inline16_types.ads: New
      	testcase.
      
      From-SVN: r272983
      Ed Schonberg committed
    • [Ada] Incorrect expansion on renamings of formal parameters · eee51f3d
      This patch fixes an issue whereby a renaming of an unconstrained formal
      parameter leads to spurious runtime errors; manifesting either as a
      storage or constraint error due to incorrect bounds being assumed.
      
      This issue also occurs when the renamings are implicit such as through
      generic instantiations.
      
      2019-07-03  Justin Squirek  <squirek@adacore.com>
      
      gcc/ada/
      
      	* sem_ch8.adb (Analyze_Object_Renaming): Add call to search for
      	the appropriate actual subtype of the object renaming being
      	analyzed.
      	(Check_Constrained_Object): Minor cleanup.
      
      gcc/testsuite/
      
      	* gnat.dg/renaming13.adb, gnat.dg/renaming14.adb: New testcases.
      
      From-SVN: r272982
      Justin Squirek committed
    • [Ada] Refine pointer support in SPARK · f4c16c58
      Refine the implementation of pointer support for SPARK analysis.
      
      There is no impact on compilation.
      
      2019-07-03  Yannick Moy  <moy@adacore.com>
      
      gcc/ada/
      
      	* sem_spark.adb (Get_Observed_Or_Borrowed_Expr): New function to
      	return go through traversal function call.
      	(Check_Type): Consistently use underlying type.
      	(Get_Perm): Adapt for case of elaboration code where variables
      	are not declared in the environment. Remove incorrect handling
      	of borrow and observe.
      
      From-SVN: r272981
      Yannick Moy committed
    • [Ada] Spurious visibility error in inlined function · abc856cf
      This patch corrects the use of tree replication when inlining a function
      that returns an unconstrained result, and its sole statement is an
      extended return statement. The use of New_Copy_Tree ensires that global
      references saved in a generic template are properly carried over when
      the function is instantiated and inlined.
      
      2019-07-03  Hristian Kirtchev  <kirtchev@adacore.com>
      
      gcc/ada/
      
      	* inline.adb (Build_Return_Object_Formal): New routine.
      	(Can_Split_Unconstrained_Function): Code clean up.
      	(Copy_Formals,Copy_Return_Object): New routines.
      	(Split_Unconstrained_Function): Code clean up and refactoring.
      
      gcc/testsuite/
      
      	* gnat.dg/inline15.adb, gnat.dg/inline15_gen.adb,
      	gnat.dg/inline15_gen.ads, gnat.dg/inline15_types.ads: New
      	testcase.
      
      From-SVN: r272980
      Hristian Kirtchev committed
    • [Ada] Minor editorial corrections and reformatting · 866000e7
      2019-07-03  Gary Dismukes  <dismukes@adacore.com>
      
      gcc/ada/
      
      	* bindo-augmentors.adb, bindo-augmentors.ads,
      	bindo-builders.ads, bindo-elaborators.adb, sem_ch12.adb,
      	sem_ch13.adb, sem_spark.adb, sinfo.ads: Minor editorial
      	corrections and reformatting.
      
      From-SVN: r272979
      Gary Dismukes committed
    • [Ada] Improve warnings about infinite loops · e08a896b
      The compiler now has fewer false alarms when warning about infinite
      loops. For example, a loop of the form "for X of A ...", where A is an
      array, cannot be infinite.  The compiler no longer warns in this case.
      
      2019-07-03  Bob Duff  <duff@adacore.com>
      
      gcc/ada/
      
      	* sem_warn.adb (Check_Infinite_Loop_Warning): Avoid the warning
      	if an Iterator_Specification is present.
      
      gcc/testsuite/
      
      	* gnat.dg/warn20.adb, gnat.dg/warn20_pkg.adb,
      	gnat.dg/warn20_pkg.ads: New testcase.
      
      From-SVN: r272978
      Bob Duff committed
    • [Ada] Document default new-line behavior for GNATpp · 07fb741a
      2019-07-03  Bob Duff  <duff@adacore.com>
      
      gcc/ada/
      
      	* doc/gnat_ugn/gnat_utility_programs.rst: Document default
      	new-line behavior.
      
      From-SVN: r272977
      Bob Duff committed
    • [Ada] ABE checks v3.0, foundations of Elaboration order v4.0 · 69e6ee2f
      ------------------------
      -- Elaboration checks --
      ------------------------
      
      The dynamic ABE checks model now emits the same diagnostics as those of the
      static ABE checks model.
      
      The ABE checks mechanism has been redesigned and refactored in the face of
      increasing requirements. Most of the functionality can now be toggled, thus
      allowing for various combinations of behavior. The combinations are defined
      as "initial states" and may be further altered.
      
      Scenarios and targets have been distinctly separated at the higher level,
      instead of directly working with nodes and entitites. Scenarios and targets
      now carry a representation which removes the need to constantly recompute
      relevant attributes, and offers a common interface for the various processors.
      
      Most processing has now been refactored into "services" which perform a single
      ABE-related function.
      
      -----------------------
      -- Elaboration order --
      -----------------------
      
      A new elaboration order mechanism based on the use of an invocation graph to
      provide extra information about the flow of execution at elaboration time has
      been introduced.
      
      The ABE checks mechanism has been altered to encode pieces of the invocation
      graph in the associated ALI files of units.
      
      The new elaboration order mechanism reconstructs the full invocation graph at
      bind time, and coupled with the library item graph, determines the elaboration
      order of units.
      
      The new elaboration order mechanism is currently inaccessible.
      
      ------------
      -- Source --
      ------------
      
      --  pack.ads
      
      package Pack is
         procedure ABE_Proc;
         procedure Safe_Proc;
      end Pack;
      
      --  pack.adb
      
      with Ada.Text_IO; use Ada.Text_IO;
      
      package body Pack is
         function Call_Proc (ABE : Boolean) return Integer;
      
         procedure Safe_Proc is
         begin
            Put_Line ("safe");
         end Safe_Proc;
      
         function Call_Proc (ABE : Boolean) return Integer is
         begin
            if ABE then
               ABE_Proc;
            else
               Safe_Proc;
            end if;
      
            return 0;
         end Call_Proc;
      
         Elab_1 : constant Integer := Call_Proc (ABE => False);
         Elab_2 : constant Integer := Call_Proc (ABE => True);
      
         procedure ABE_Proc is
         begin
            Put_Line ("ABE");
         end ABE_Proc;
      end Pack;
      
      --  main.adb
      
      with Pack;
      
      procedure Main is begin null; end Main;
      
      ----------------------------
      -- Compilation and output --
      ----------------------------
      
      $ gnatmake -f -q -gnatE main.adb
      $ ./main
      $ gnatmake -f -q -gnatE main.adb -gnatDG -gnatwL
      $ grep -c "safeE" pack.adb.dg
      pack.adb:14:10: warning: cannot call "ABE_Proc" before body seen
      pack.adb:14:10: warning: Program_Error may be raised at run time
      pack.adb:14:10: warning:   body of unit "Pack" elaborated
      pack.adb:14:10: warning:   function "Call_Proc" called at line 22
      pack.adb:14:10: warning:   procedure "ABE_Proc" called at line 14
      pack.adb:14:10: warning: cannot call "ABE_Proc" before body seen
      pack.adb:14:10: warning: Program_Error may be raised at run time
      pack.adb:14:10: warning:   body of unit "Pack" elaborated
      pack.adb:14:10: warning:   function "Call_Proc" called at line 23
      pack.adb:14:10: warning:   procedure "ABE_Proc" called at line 14
      safe
      
      raised PROGRAM_ERROR : pack.adb:14 access before elaboration
      0
      
      2019-07-03  Hristian Kirtchev  <kirtchev@adacore.com>
      
      gcc/ada/
      
      	* ali.adb: Add with and use clauses for GNAT,
      	GNAT.Dynamic_HTables, and Snames.  Add a map from invocation
      	signature records to invocation signature ids.  Add various
      	encodings of invocation-related attributes.  Sort and update
      	table Known_ALI_Lines.
      	(Add_Invocation_Construct, Add_Invocation_Relation,
      	Body_Placement_Kind_To_Code, Code_To_Body_Placement_Kind,
      	Code_To_Invocation_Construct_Kind, Code_To_Invocation_Kind,
      	Code_To_Invocation_Graph_Line_Kind, Destroy, Hash): New
      	routines.
      	(Initialize_ALI): Sort the initialization sequence. Add
      	initialization for all invocation-related tables.
      	(Invocation_Construct_Kind_To_Code,
      	Invocation_Graph_Line_Kind_To_Code, Invocation_Kind_To_Code,
      	Invocation_Signature_Of, Present): New routines.
      	(Scan_ALI): Add the default values for invocation-related ids.
      	Scan invocation graph lines.
      	(Scan_Invocation_Graph_Line): New routine.
      	* ali.ads: Add with clause for GNAT.Dynamic_Tables.  Add types
      	for invocation constructs, relations, and signatures.  Add
      	tables for invocation constructs, relations, and signatures.
      	Update Unit_Record to capture invocation-related ids.  Relocate
      	table Unit_Id_Tables and subtypes Unit_Id_Table, Unit_Id_Array
      	from Binde.
      	(Add_Invocation_Construct, Add_Invocation_Relation,
      	Body_Placement_Kind_To_Code, Code_To_Body_Placement_Kind,
      	Code_To_Invocation_Construct_Kind, Code_To_Invocation_Kind,
      	Code_To_Invocation_Graph_Line_Kind,
      	Invocation_Construct_Kind_To_Code,
      	Invocation_Graph_Line_Kind_To_Code, Invocation_Kind_To_Code,
      	Invocation_Signature_Of, Present): New routines.
      	* binde.adb: Add with and use clause for Types.  Add use clause
      	for ALI.Unit_Id_Tables;
      	* binde.ads: Relocate table Unit_Id_Tables and subtypes
      	Unit_Id_Table, Unit_Id_Array to ALI.
      	* bindgen.adb: Remove with and use clause for ALI.
      	* bindgen.ads: Remove with and use clause for Binde.  Add with
      	and use clause for ALI.
      	* bindo.adb,  bindo.ads, bindo-augmentors.adb,
      	bindo-augmentors.ads, bindo-builders.adb, bindo-builders.ads,
      	bindo-diagnostics.adb, bindo-diagnostics.ads,
      	bindo-elaborators.adb, bindo-elaborators.ads, bindo-graphs.adb,
      	bindo-graphs.ads, bindo-units.adb, bindo-units.ads,
      	bindo-validators.adb, bindo-validators.ads, bindo-writers.adb,
      	bindo-writers.ads: New units.
      	* debug.adb: Use and describe GNAT debug switches -gnatd_F and
      	-gnatd_G.  Add GNATbind debug switches in the ranges dA .. dZ,
      	d.a .. d.z, d.A .. d.Z, d.1 .. d.9, d_a .. d_z, d_A .. d_Z, and
      	d_1 .. d_9.  Use and describe GNATbind debug switches -d_A,
      	-d_I, -d_L, -d_N, -d_O, -d_T, and -d_V.
      	* exp_util.adb, exp_util.ads (Exceptions_OK): Relocate to
      	Sem_Util.
      	* gnatbind.adb: Add with and use clause for Bindo.  Use the new
      	Bindo elaboration order only when -d_N is in effect.
      	* lib-writ.adb
      	(Column, Extra, Invoker, Kind, Line, Locations, Name, Placement,
      	Scope, Signature, Target): New routines.
      	(Write_ALI): Output all invocation-related data.
      	(Write_Invocation_Graph): New routine.
      	* lib-writ.ads: Document the invocation graph ALI line.
      	* namet.adb, namet.ads (Present): New routines.
      	* sem_ch8.adb (Find_Direct_Name): Capture the status of
      	elaboration checks and warnings of an identifier.
      	(Find_Expanded_Name): Capture the status of elaboration checks
      	and warnings of an expanded name.
      	* sem_ch12.adb (Analyze_Generic_Package_Declaration): Ensure
      	that invocation graph-related data within the body of the main
      	unit is encoded in the ALI file.
      	(Analyze_Generic_Subprogram_Declaration): Ensure that invocation
      	graph-related data within the body of the main unit is encoded
      	in the ALI file.
      	(Analyze_Package_Instantiation): Perform minimal decoration of
      	the instance entity.
      	(Analyze_Subprogram_Instantiation): Perform minimal decoration
      	of the instance entity.
      	* sem_elab.adb: Perform heavy refactoring of all code. The unit
      	is now split into "services" which specialize in one area of ABE
      	checks.  Add processing in order to capture invocation-graph
      	related attributes of the main unit, and encode them in the ALI
      	file.  The Processing phase can now operate in multiple modes,
      	all described by type Processing_Kind.  Scenarios and targets
      	are now distinct at the higher level, and carry their own
      	representations. This eliminates the need to constantly
      	recompute their attributes, and offers the various processors a
      	uniform interface.  The various initial states of the Processing
      	phase are now encoded using type Processing_In_State, and
      	xxx_State constants.
      	* sem_elab.ads: Update the literals of type
      	Enclosing_Level_Kind.  Add Inline pragmas on several routines.
      	* sem_prag.adb (Process_Inline): Ensure that invocation
      	graph-related data within the body of the main unit is encoded
      	in the ALI file.
      	* sem_util.adb (Enclosing_Generic_Body, Enclosing_Generic_Unit):
      	Code clean up.
      	(Exceptions_OK): Relocated from Sem_Util.
      	(Mark_Save_Invocation_Graph_Of_Body): New routine.
      	* sem_util.ads (Exceptions_OK): Relocated from Sem_Util.
      	(Mark_Save_Invocation_Graph_Of_Body): New routine.
      	* sinfo.adb (Is_Elaboration_Checks_OK_Node): Now applicable to
      	N_Variable_Reference_Marker.
      	(Is_Elaboration_Warnings_OK_Node): Now applicable to
      	N_Expanded_Name, N_Identifier, N_Variable_Reference_Marker.
      	(Is_Read): Use Flag4.
      	(Is_SPARK_Mode_On_Node): New applicable to
      	N_Variable_Reference_Marker.
      	(Is_Write): Use Flag5.
      	(Save_Invocation_Graph_Of_Body): New routine.
      	(Set_Is_Elaboration_Checks_OK_Node): Now applicable to
      	N_Variable_Reference_Marker.
      	(Set_Is_Elaboration_Warnings_OK_Node): Now applicable to
      	N_Expanded_Name, N_Identifier, N_Variable_Reference_Marker.
      	(Set_Is_SPARK_Mode_On_Node): New applicable to
      	N_Variable_Reference_Marker.
      	(Set_Save_Invocation_Graph_Of_Body): New routine.
      	* sinfo.ads: Update the documentation of attributes
      	Is_Elaboration_Checks_OK_Node, Is_Elaboration_Warnings_OK_Node,
      	Is_SPARK_Mode_On_Node.  Update the flag usage of attributes
      	Is_Read, Is_Write.  Add attribute Save_Invocation_Graph_Of_Body
      	and update its occurrence in nodes.
      	(Save_Invocation_Graph_Of_Body): New routine along with pragma
      	Inline.
      	(Set_Save_Invocation_Graph_Of_Body): New routine along with
      	pragma Inline.
      	* switch-b.adb (Scan_Binder_Switches): Refactor the scanning of
      	debug switches.
      	(Scan_Debug_Switches): New routine.
      	* libgnat/g-dynhta.adb, libgnat/g-dynhta.ads (Contains): New routine.
      	* libgnat/g-graphs.adb (Associate_Vertices): Update the use of
      	Component_Vertex_Iterator.
      	(Contains_Component, Contains_Edge, Contains_Vertex, Has_Next):
      	Reimplemented.
      	(Iterate_Component_Vertices): New routine.
      	(Iterate_Vertices): Removed.
      	(Next): Update the parameter profile.
      	(Number_Of_Component_Vertices, Number_Of_Outgoing_Edges): New
      	routines.
      	* libgnat/g-graphs.ads: Update the initialization of
      	No_Component.  Add type Component_Vertex_Iterator.  Remove type
      	Vertex_Iterator.
      	(Has_Next): Add new versions and remove old ones.
      	(Iterate_Component_Vertices): New routine.
      	(Iterate_Vertices): Removed.
      	(Next): Add new versions and remove old ones.
      	(Number_Of_Component_Vertices, Number_Of_Outgoing_Edges): New
      	routines.
      	* libgnat/g-sets.adb (Contains): Reimplemented.
      	* gcc-interface/Make-lang.in (GNATBIND_OBJS): Add
      	GNAT.Dynamic_HTables, GNAT.Graphs and Bindo units.
      	* rtsfind.ads: Remove extra space.
      
      From-SVN: r272976
      Hristian Kirtchev committed
    • [Ada] SPARK pointer support extended to local borrowers and observers · 14bc12f0
      SPARK rules allow local borrowers and observers to be declared. During
      their lifetime, the access to the borrowed/observed object is
      restricted.
      
      There is no impact on compilation.
      
      2019-07-03  Yannick Moy  <moy@adacore.com>
      
      gcc/ada/
      
      	* sem_spark.adb: Add support for locally borrowing and observing
      	a path.
      	(Get_Root_Object): Add parameter Through_Traversal to denote
      	when we are interesting in getting to the traversed parameter.
      	(Is_Prefix_Or_Almost): New function to support detection of
      	illegal access to borrowed or observed paths.
      	(Check_Pragma): Add analysis of assertion pragmas.
      
      From-SVN: r272975
      Yannick Moy committed
    • [Ada] Spurious error with static predicate in generic unit · 558241c0
      This patch fixes a spurious error in a generic unit that invludes a
      subtype with a static predicate, when the type is used in a case
      expression.
      
      2019-07-03  Ed Schonberg  <schonberg@adacore.com>
      
      gcc/ada/
      
      	* sem_ch13.adb (Build_Predicate_Functions): In a generic context
      	we do not build the bodies of predicate fuctions, but the
      	expression in a static predicate must be elaborated to allow
      	case coverage checking within the generic unit.
      	(Build_Discrete_Static_Predicate): In a generic context, return
      	without building function body once the
      	Static_Discrete_Predicate expression for the type has been
      	constructed.
      
      gcc/testsuite/
      
      	* gnat.dg/predicate6.adb, gnat.dg/predicate6.ads: New testcase.
      	* gnat.dg/static_pred1.adb: Remove expected error.
      
      From-SVN: r272974
      Ed Schonberg committed
    • [Ada] Minor reformatting · b5c8da6b
      2019-07-03  Hristian Kirtchev  <kirtchev@adacore.com>
      
      gcc/ada/
      
      	* bindgen.adb, inline.adb, layout.adb, sem_ch12.adb,
      	sem_ch13.adb, sem_ch7.adb, styleg.adb: Minor reformatting.
      
      From-SVN: r272973
      Hristian Kirtchev committed
    • [Ada] Style check for mixed-case identifiers · c4487c3b
      This patch implements a new switch, -gnatyD, enables a style check that
      requires defining identifiers to be in mixed case.
      
      2019-07-03  Bob Duff  <duff@adacore.com>
      
      gcc/ada/
      
      	* par-ch3.adb (P_Defining_Identifier): Call
      	Check_Defining_Identifier_Casing.
      	* style.ads, styleg.ads, styleg.adb
      	(Check_Defining_Identifier_Casing): New procedure to check for
      	mixed-case defining identifiers.
      	* stylesw.ads, stylesw.adb (Style_Check_Mixed_Case_Decls): New
      	flag for checking for mixed-case defining identifiers.
      	* doc/gnat_ugn/building_executable_programs_with_gnat.rst:
      	Document new feature.
      	* gnat_ugn.texi: Regenerate.
      
      From-SVN: r272972
      Bob Duff committed
    • [Ada] Extend -gnatw.z warning to array types · bf4f18bd
      The -gnatw.z switch causes the compiler to issue a warning on record
      types subject to both an alignment clause and a size clause, when the
      specified size is not a multiple of the alignment in bits, because this
      means that the Object_Size will be strictly larger than the specified
      size.
      
      It makes sense to extend this warning to array types, but not to the
      cases of bit-packed arrays where the size is not a multiple of storage
      unit and the specified alignment is the minimum one, because there would
      be no way to get rid of it apart from explicitly silencing it.
      
      The compiler must issue the warning:
      
      p.ads:5:03: warning: size is not a multiple of alignment for "Triplet"
      p.ads:5:03: warning: size of 24 specified at line 4
      p.ads:5:03: warning: Object_Size will be increased to 32
      
      on the following package:
      
      package P is
      
        type Triplet is new String (1 .. 3);
        for Triplet'Size use 24;
        for Triplet'Alignment use 4;
      
        type Arr is array (1 .. 7) of Boolean;
        pragma Pack (Arr);
        for Arr'Size use 7;
        for Arr'Alignment use 1;
      
      end P;
      
      2019-07-03  Eric Botcazou  <ebotcazou@adacore.com>
      
      gcc/ada/
      
      	* doc/gnat_ugn/building_executable_programs_with_gnat.rst
      	(Warning message control): Document that -gnatw.z/Z apply to
      	array types.
      	* freeze.adb (Freeze_Entity): Give -gnatw.z warning for array
      	types as well, but not if the specified alignment is the minimum
      	one.
      	* gnat_ugn.texi: Regenerate.
      
      From-SVN: r272971
      Eric Botcazou committed
    • [Ada] Spell "laid" correctly · 1f159b86
      2019-07-03  Bob Duff  <duff@adacore.com>
      
      gcc/ada/
      
      	* einfo.ads, exp_util.adb, layout.ads, sinfo.ads: Spell "laid"
      	correctly.
      
      From-SVN: r272970
      Bob Duff committed
    • [Ada] Spurious error on dynamic predicate in a generic context · 8334176a
      This patch fixes a spurious error on the conformance checking between
      the expression for an aspect analyzed at the freeze point of the type,
      and the analysis of a copy of the expression performed at the end of the
      enclosing list of declarationss. In a generic context the first may not
      have been analyzed yet and this must be done before the conformance
      check.
      
      2019-07-03  Ed Schonberg  <schonberg@adacore.com>
      
      gcc/ada/
      
      	* sem_ch13.adb (Analyze_Attribute_Definition_Clause): No error
      	message on attribute applied to a renaming when the renamed
      	object is an aggregate (from code reading).
      	(Check_Aspect_At_End_Of_Declarations): In a generic context
      	where freeze nodes are not generated, the original expression
      	for an aspect may need to be analyzed to precent spurious
      	conformance errors when compared with the expression that is
      	anakyzed at the end of the current declarative list.
      
      gcc/testsuite/
      
      	* gnat.dg/predicate5.adb, gnat.dg/predicate5.ads: New testcase.
      
      From-SVN: r272969
      Ed Schonberg committed
    • [Ada] Fix bogus error on array with overaligned scalar component · 09c9ed5b
      The compiler would wrongly reject an alignment clause larger than 8 on
      the component type of an array of scalars, which is valid albeit
      pathological.
      
      2019-07-03  Eric Botcazou  <ebotcazou@adacore.com>
      
      gcc/ada/
      
      	* layout.adb (Layout_Type): Do not set the component size of an
      	array with a scalar component if the component type is
      	overaligned.
      
      gcc/testsuite/
      
      	* gnat.dg/alignment14.adb: New testcase.
      
      From-SVN: r272968
      Eric Botcazou committed
    • [Ada] Make loop labels unique for front-end inlined calls · 6cbd53c2
      This patch transforms loop labels in the body of subprograms that are to
      be inlined by the front-end, to prevent accidental duplication of loop
      labels, which might make the resulting source illegal.
      
      ----
      Source program:
      ----
      package P is
         procedure Get_Rom_Addr_Offset
           with Inline_Always;
      end P;
      ----
      package body P is
         procedure Get_Rom_Addr_Offset is
            X : Integer;
         begin
            Main_Block :
            for I in 1 .. 10 loop
               X := 2;
               exit Main_Block when I > 4;
            other_loop:
               for J in character'('a') .. 'z' loop
                  if I < 5 then
                     exit Main_Block when J = 'k';
                  else
                     Exit Other_Loop;
                  end if;
               end loop other_loop;
            end loop Main_Block;
         end Get_Rom_Addr_Offset;
      
         procedure P2 is
         begin
            Main_Block :
            for I in 1 .. 1 loop
               Get_Rom_Addr_Offset;
            end loop Main_Block;
         end P2;
      end P;
      ----
      Command:
      
         gcc -c -gnatN -gnatd.u -gnatDG p.adb
      
      ----
      Output
      ----
      
      package body p is
      
         procedure p__get_rom_addr_offset is
            x : integer;
            other_loop : label
            main_block : label
         begin
            main_block : for i in 1 .. 10 loop
               x := 2;
               exit main_block when i > 4;
               other_loop : for j in 'a' .. 'z' loop
                  if i < 5 then
                     exit main_block when j = 'k';
                  else
                     exit other_loop;
                  end if;
               end loop other_loop;
            end loop main_block;
            return;
         end p__get_rom_addr_offset;
      
         procedure p__p2 is
            main_block : label
         begin
            main_block : for i in 1 .. 1 loop
               B6b : declare
                  x : integer;
                  other_loopL10b : label
                  main_blockL9b : label
               begin
                  main_blockL9b : for i in 1 .. 10 loop
                     x := 2;
                     exit main_blockL9b when i > 4;
                     other_loopL10b : for j in 'a' .. 'z' loop
                        if i < 5 then
                           exit main_blockL9b when j = 'k';
                        else
                           exit other_loopL10b;
                        end if;
                     end loop other_loopL10b;
                  end loop main_blockL9b;
               end B6b;
            end loop main_block;
            return;
         end p__p2;
      begin
         null;
      end p;
      
      2019-07-03  Ed Schonberg  <schonberg@adacore.com>
      
      gcc/ada/
      
      	* inline.adb (Make_Loop_Labels_Unique):  New procedure to modify
      	the source code of subprograms that are inlined by the
      	front-end, to prevent accidental duplication between loop labels
      	in the inlined code and the code surrounding the inlined call.
      
      From-SVN: r272967
      Ed Schonberg committed