1. 08 Jul, 2019 40 commits
    • rs6000: Ignore GFXOPT (and GPOPT) for choosing machine · c83faba1
      The function rs6000_machine_from_flags chooses what .machine string to
      used based on the rs6000_isa_flags flags.  For that it checks for each
      ISA level if something for its ISA_*_MASKS is selected.
      
      This does not work for GFXOPT and GPOPT: these are set as flags in
      ISA_2_5_MASKS_SERVER, but they aren't actually new there, they just
      are not selected by default for older ISAs (they were optional).
      
      This patch makes OPTION_MASK_PPC_GFXOPT and OPTION_MASK_PPC_GPOPT not
      influence the .machine selection.
      
      
      	* config/rs6000/rs6000.c (rs6000_machine_from_flags): Ignore
      	OPTION_MASK_PPC_GFXOPT and OPTION_MASK_PPC_GPOPT for selecting the
      	.machine string.
      
      From-SVN: r273246
      Segher Boessenkool committed
    • rs6000: Add testcase for PR88233 · 9d917155
      This testcase tests that with -mcpu=power8 we do not generate any
      mtvsr* instructions, and we do the copy with {l,st}xvd2x.
      
      
      gcc/testsuite/
      	PR rtl-optimization/88233
      	* gcc.target/powerpc/pr88233.c: New testcase.
      
      From-SVN: r273245
      Segher Boessenkool committed
    • subreg: Add -fsplit-wide-types-early (PR88233) · b18081df
      Currently the second lower-subreg pass is run right before RA.  This
      is much too late to be very useful.  At least for targets that do not
      have RTL patterns for operations on multi-register modes it is a lot
      better to split patterns earlier, before combine and all related
      passes.
      
      This adds an option -fsplit-wide-types-early that does that, and
      enables it by default for rs6000.
      
      
      	PR rtl-optimization/88233
      	* common.opt (fsplit-wide-types-early): New option.
      	* common/config/rs6000/rs6000-common.c
      	(rs6000_option_optimization_table): Add OPT_fsplit_wide_types_early for
      	OPT_LEVELS_ALL.
      	* doc/invoke.texi (Optimization Options): Add -fsplit-wide-types-early.
      	* lower-subreg.c (pass_lower_subreg2::gate): Add test for
      	flag_split_wide_types_early.
      	(pass_data_lower_subreg3): New.
      	(pass_lower_subreg3): New.
      	(make_pass_lower_subreg3): New.
      	* passes.def (pass_lower_subreg2): Move after the loop passes.
      	(pass_lower_subreg3): New, inserted where pass_lower_subreg2 was.
      	* tree-pass.h (make_pass_lower_subreg2): Move up, to its new place in
      	the pass pipeline; its previous place is taken by ...
      	(make_pass_lower_subreg3): ... this.
      
      From-SVN: r273240
      Segher Boessenkool committed
    • Turn of ipa-ra in builtins test (PR91059) · 8f783191
      The gcc.c-torture/execute/builtins/lib directory contains a reimplementation
      of many C library string functions, which causes non-trivial register allocation
      bugs with LTO and static linked libraries.  To fix this long-standing test
      issue, turn off ipa-ra which avoids the register corruption across calls.  All
      builtin torture tests now pass on aarch64-none-elf.  Committed as obvious.
      
          testsuite/
      	PR testsuite/91059
      	PR testsuite/78529
      	* gcc.c-torture/execute/builtins/builtins.exp: Add -fno-ipa-ra.
      
      From-SVN: r273238
      Wilco Dijkstra committed
    • S/390: Define shift_truncation_mask. · 5fad9d33
      Define s390_shift_truncation_mask to allow the optabs optimization
      
          sh = (64 - sh)
       -> sh = -sh
      
      for a rotation operation.
      
      gcc/ChangeLog:
      
      2019-07-08  Robin Dapp  <rdapp@linux.ibm.com>
      
      	* config/s390/s390.c (s390_shift_truncation_mask): Define.
      	(TARGET_SHIFT_TRUNCATION_MASK): Define.
      
      gcc/testsuite/ChangeLog:
      
      2019-07-08  Robin Dapp  <rdapp@linux.ibm.com>
      
      	* gcc.target/s390/rotate-truncation-mask.c: New test.
      
      From-SVN: r273237
      Robin Dapp committed
    • S/390: Rework shift count handling. · e2839e47
      Add s390_valid_shift_count to determine the validity of a
      shift-count operand.  This is used to replace increasingly
      complex substitutions that should have allowed address-style
      shift-count handling, an and mask as well as no-op subregs
      on the operand.
      
      gcc/ChangeLog:
      
      2019-07-08  Robin Dapp  <rdapp@linux.ibm.com>
      
              * config/s390/constraints.md: Add new jsc constraint.
              * config/s390/predicates.md: New predicates.
              * config/s390/s390-protos.h (s390_valid_shift_count): New function.
              * config/s390/s390.c (s390_valid_shift_count): New function.
              (print_shift_count_operand): Use s390_valid_shift_count.
              (print_operand): Likewise.
              * config/s390/s390.md: Use new predicate.
              * config/s390/subst.md: Remove addr_style_op and masked_op substs.
              * config/s390/vector.md: Use new predicate.
      
      2019-07-08  Robin Dapp  <rdapp@linux.ibm.com>
      
              * gcc.target/s390/combine-rotate-modulo.c: New test.
              * gcc.target/s390/combine-shift-rotate-add-mod.c: New test.
              * gcc.target/s390/vector/combine-shift-vec.c: New test.
      
      From-SVN: r273236
      Robin Dapp committed
    • MAINTAINERS (Write After Approval): Remove myself, already listed in RISC-V port maitainer. · f069f0f2
      2019-07-08  Kito Cheng  <kito.cheng@sifive.com>
      
      	* MAINTAINERS (Write After Approval): Remove myself, already listed in
      	RISC-V port maitainer.
      
      From-SVN: r273235
      Kito Cheng committed
    • re PR tree-optimization/91108 (Fails to pun through unions) · 08dfb1d6
      2019-07-08  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/91108
      	* tree-ssa-sccvn.c: Include builtins.h.
      	(vn_reference_lookup_3): Use only alignment constraints to
      	verify same-valued store disambiguation.
      
      	* gcc.dg/tree-ssa/ssa-fre-61.c: Adjust back.
      	* gcc.dg/tree-ssa/ssa-fre-78.c: New testcase.
      
      From-SVN: r273232
      Richard Biener committed
    • Avoid clash with system header declaration. · b68cae81
      	* testsuite/gcc.dg/vect/slp-reduc-sad.c (uint32_t):
      	Remove unused declaration.
      
      From-SVN: r273231
      Joern Rennecke committed
    • RISC-V: Fix splitter for 32-bit AND on 64-bit target. · ace4317a
      Fixes github.com/riscv/riscv-gcc issue #161.  We were accidentally using
      BITS_PER_WORD to compute shift counts when we should have been using the
      bitsize of the operand modes.  This was wrong when we had an SImode shift
      and a 64-bit target.
      
      	Andrew Waterman  <andrew@sifive.com>
      	gcc/
      	* config/riscv/riscv.md (lshrsi3_zero_extend_3+1): Use operands[1]
      	bitsize	instead of BITS_PER_WORD.
      	gcc/testsuite/
      	* gcc.target/riscv/shift-shift-2.c: Add one more test.
      
      From-SVN: r273230
      Jim Wilson committed
    • Revert r254460 (collect2 LTO for AIX). · ce79110f
      2019-07-08  Martin Liska  <mliska@suse.cz>
      
      	* collect2.c (defined): Revert to before r254460.
      	(scan_prog_file): Revert to before r254460.
      
      From-SVN: r273229
      Martin Liska committed
    • re PR c++/65143 ([C++11] missing devirtualization for virtual base in "final" classes) · 75b41faa
      2019-07-08  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	PR c++/65143
      	* g++.dg/tree-ssa/final2.C: New.
      	* g++.dg/tree-ssa/final3.C: Likewise.
      
      From-SVN: r273228
      Paolo Carlini committed
    • MAINTAINERS (Write After Approval): Fix the list sorted by surname. · 9118c5e1
      2019-07-08  Kito Cheng  <kito.cheng@sifive.com>
      
      	* MAINTAINERS (Write After Approval): Fix the list sorted by surname.
      
      From-SVN: r273227
      Kito Cheng committed
    • [Ada] Small overhaul in Repinfo unit · 6f65c7ee
      This creates a List_Type_Info procedure to deal with type entities other
      than arrays and records at top level and a List_Common_Type_Info
      procedure to handle the common part between them.  No functional
      changes.
      
      2019-07-08  Eric Botcazou  <ebotcazou@adacore.com>
      
      gcc/ada/
      
      	* repinfo.adb (List_Common_Type_Info): New procedure extracted
      	from...
      	(List_Type_Info): ...here.  Call it for the common information,
      	start with a blank line and output the linker section at the
      	end, if any.
      	(List_Mechanisms): Rename to...
      	(List_Subprogram_Info): ...this.
      	(List_Array_Info): Call List_Common_Type_Info.
      	(List_Entities): Adjust to above change and renaming.
      	(List_Record_Info): Call List_Common_Type_Info.
      
      From-SVN: r273226
      Eric Botcazou committed
    • [Ada] GNAT.Serial_Communications: simplify the Serial_Port structure · 55d4e2ba
      2019-07-08  Dmitriy Anisimkov  <anisimko@adacore.com>
      
      gcc/ada/
      
      	* libgnat/g-sercom.ads
      	(Serial_Port_Descriptor): New type.
      	(Serial_Port): Add a comment, make it hold a
      	Serial_Port_Descriptor.
      	(To_Ada, To_C): New procedures.
      	(Port_Data, Port_Data_Access): Remove types.
      	* libgnat/g-sercom.adb (To_Ada): New stub.
      	* libgnat/g-sercom__linux.adb, libgnat/g-sercom__mingw.adb:
      	Update implementations accordingly.
      	* s-oscons-tmplt.c: Bind Serial_Port_Descriptor to
      	System.Win32.HANDLE on Windows, and to Interfaces.C.int on
      	Linux. Add "Interfaces.C." prefix for other basic integer type
      	bindings.
      	* xoscons.adb (Output_Info): Remove the "Interfaces.C." prefix
      	for subtypes generation.
      
      From-SVN: r273225
      Dmitriy Anisimkov committed
    • [Ada] GNAT RM: Update documentation on No_Exceptions restriction · aec80f20
      2019-07-08  Arnaud Charlet  <charlet@adacore.com>
      
      gcc/ada/
      
      	* doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
      	Update documentation on No_Exceptions restriction.
      	* gnat_rm.texi: Regenerate.
      
      From-SVN: r273224
      Arnaud Charlet committed
    • [Ada] Os_Lib: do not call __gnat_kill for Invalid_Pid · 3a4a60d1
      2019-07-08  Dmitriy Anisimkov  <anisimko@adacore.com>
      
      gcc/ada/
      
      	* libgnat/s-os_lib.adb: Do not call __gnat_kill for Invalid_Pid.
      
      From-SVN: r273223
      Dmitriy Anisimkov committed
    • [Ada] Remove dead code from Enclosing_Package_Or_Subprogram routine · 4fe5bbcf
      Calls to Scope always return unique entities, i.e. package/subprogram
      and not their bodies, so there is no need to expect them.
      
      Cleanup only; semantics unaffected. (This routine was only used in CCG
      and GNATprove backends anyway.)
      
      2019-07-08  Piotr Trojanek  <trojanek@adacore.com>
      
      gcc/ada/
      
      	* sem_util.adb (Enclosing_Package_Or_Subprogram): Do not expect
      	package and subprogram bodies.
      
      From-SVN: r273222
      Piotr Trojanek committed
    • [Ada] Remove documentation of ignored GNATpp switch · b7234265
      2019-07-08  Bob Duff  <duff@adacore.com>
      
      gcc/ada/
      
      	* doc/gnat_ugn/gnat_utility_programs.rst: Remove documentation
      	of ignored GNATpp switch.
      
      From-SVN: r273221
      Bob Duff committed
    • [Ada] In-place initialization for Initialize_Scalars · 156187ef
      Update the documentation of pragma Initialize_Scalars in the GNAT
      Reference Manual.
      
      2019-07-08  Hristian Kirtchev  <kirtchev@adacore.com>
      
      gcc/ada/
      
      	* doc/gnat_rm/implementation_defined_pragmas.rst:
      	Update the documentation of pragma Initialize_Scalars.
      	* gnat_rm.texi: Regenerate.
      
      From-SVN: r273220
      Hristian Kirtchev committed
    • [Ada] Wrong evaluation of membership test · fa2538c7
      The code generated by the compiler erroneously evaluates to True
      membership tests when their left operand is a a class-wide interface
      object and the right operand is a tagged type that implements such
      interface type.
      
      2019-07-08  Javier Miranda  <miranda@adacore.com>
      
      gcc/ada/
      
      	* exp_ch4.adb (Tagged_Membership): Fix regression silently
      	introduced in r260738 that erroneouslusy causes the evaluation
      	to True of the membership test when the left operand of the
      	membership test is a class-wide interface object and the right
      	operand is a type that implements such interface type.
      
      gcc/testsuite/
      
      	* gnat.dg/interface10.adb: New testcase.
      
      From-SVN: r273219
      Javier Miranda committed
    • [Ada] Assertion failure on validity check for Address · 570d5bbc
      This patch corrects the verification of 'Address clauses to avoid
      processing a clause where the prefix of the attribute is a generic
      formal object.
      
      2019-07-08  Hristian Kirtchev  <kirtchev@adacore.com>
      
      gcc/ada/
      
      	* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
      	register an address clause when its prefix denotes a generic
      	formal object.
      
      gcc/testsuite/
      
      	* gnat.dg/addr13.adb, gnat.dg/addr13.ads: New testcase.
      
      From-SVN: r273218
      Hristian Kirtchev committed
    • [Ada] Diagnostics for Elaboration order v4.0 · 47bcd81f
      This patch adds a missing case to the output of cycle diagnostics here a
      transition from an Elaborate_Body pair may reach a destination which is
      in the context of an active Elaborate_All.
      
      2019-07-08  Hristian Kirtchev  <kirtchev@adacore.com>
      
      gcc/ada/
      
      	* bindo-diagnostics.adb (Diagnose_Cycle): Capture the presence
      	of an Elaborate_All edge before iterating over the edges of the
      	cycle.
      	(Output_Elaborate_Body_Transition): Update the parameter profile
      	and the comment on usage. Add a missing case where the edge is
      	within the context of an Elaborate_All.
      	(Output_Transition): Update the call to
      	Output_Elaborate_Body_Transition.
      	* bindo-graphs.ads, bindo-graphs.adb
      	(Contains_Elaborate_All_Edge): New routine.
      
      From-SVN: r273217
      Hristian Kirtchev committed
    • [Ada] Set dummy Etype for the fake __HEAP entity in GNATprove · 56730418
      GNATprove represents reads and writes via pointers as operations on a
      fake __HEAP entity. This entity already had various properties set to
      dummy values (e.g. Scope set to Standard_Standard), so that it can be
      processed like other entities without crashing and not special-cased
      everywhere. Now it also has a dummy Etype, so it can be processed with
      Is_Single_Concurrent_Object.
      
      The modified code is only executed by GNATprove; frontend is not
      affected.
      
      2019-07-08  Piotr Trojanek  <trojanek@adacore.com>
      
      gcc/ada/
      
      	* lib-xref-spark_specific.adb (Create_Heap): Set dummy Etype for
      	the fake __HEAP entity.
      
      From-SVN: r273216
      Piotr Trojanek committed
    • [Ada] Suppress warnings on memory representation in CodePeer mode · f6d606c7
      2019-07-08  Daniel Mercier  <mercier@adacore.com>
      
      gcc/ada/
      
      	* gnat1drv.adb: Suppress warnings on memory representation in
      	CodePeer compiler mode.
      
      From-SVN: r273215
      Daniel Mercier committed
    • [Ada] Remove dependency on Win32 GDI (Graphical Interface) · 900dd840
      CommandLineToArgvW drags a dependency on SHELL32.DLL and thus GDI32.DLL.
      By loading GDI32.DLL some default GDI objects are allocated. On some
      Windows versions this cause the use of a lock on the graphical interface
      during process termination. This can impact parallelism significantly as
      termination of processes is serialized.
      
      2019-07-08  Nicolas Roche  <roche@adacore.com>
      
      gcc/ada/
      
      	* rtinit.c (__gnat_runtime_initialize): Remove dependency on
      	CommandLineToArgvW.
      
      From-SVN: r273214
      Nicolas Roche committed
    • [Ada] New port for x86_64-vx7 · eaec429d
      2019-07-08  Doug Rupp  <rupp@adacore.com>
      
      gcc/ada/
      
      	* Makefile.rtl: Handle vxworks7r2 in x86_64 and x86 vxworks7.
      
      From-SVN: r273213
      Doug Rupp committed
    • [Ada] Use g-sercom__linux.adb for all Linuxes · 589721af
      2019-07-08  Dmitriy Anisimkov  <anisimko@adacore.com>
      
      gcc/ada/
      
      	* Makefile.rtl: Use g-sercom__linux.adb for all linuxes.
      
      From-SVN: r273212
      Dmitriy Anisimkov committed
    • [Ada] Do not erase precise type on fixed-point real literal · 7800a8fb
      Real literals of fixed-point type are expected to keep their precise
      fixed-point type in GNATprove. This is now correctly enforced.
      
      There is no impact on compilation.
      
      2019-07-08  Yannick Moy  <moy@adacore.com>
      
      gcc/ada/
      
      	* expander.adb (Expand): Do not reset Analyzed flag always.
      	* sem_eval.adb (Fold_Ureal): Mark node as analyzed.
      
      From-SVN: r273211
      Yannick Moy committed
    • [Ada] Crash on timed entry call with a delay given by a type conversion · 1bb2e1d9
      This patch fixes a compiler crash in the compiler on a timed entry call
      whose delay expression is a type conversion, when FLoat_Overflow checks
      are enabled.
      
      2019-07-08  Ed Schonberg  <schonberg@adacore.com>
      
      gcc/ada/
      
      	* exp_ch9.adb (Expand_N_Timed_Entry_Call): Do not insert twice
      	the assignment statement that computes the delay value, to
      	prevent improper tree sharing when the value is a type
      	conversion and Float_Overflow checks are enabled.
      
      gcc/testsuite/
      
      	* gnat.dg/entry1.adb, gnat.dg/entry1.ads: New testcase.
      
      From-SVN: r273210
      Ed Schonberg committed
    • [Ada] New algorithm for Elaboration order v4.0 · 92c7734d
      This patch introduces several changes to the new elaboration order
      mechanism:
      
         * The concept of "strong" and "weak" edges is introduced. Strong
           edges are the byproduct of language-defined relations between
           units, such as with clauses. Weak edges are the byproduct of
           specilative invocations at elaboration time, which may or may not
           take place depending on control flow.
      
         * The elaboration order algorithm has been heavily modified to make
           use of the strong and weak edges, and operate on units compiled
           with different elaboration models.
      
         * The elaboration order algorithm employs the following logic:
      
              - Maintain two sets of vertices, one for all elaborable
                vertices, and one for all waiting vertices.
      
              - Pick the best elaborable vertex, and elaborate its component.
      
              - If no such elaborable vertex is available, pick the best
                weakly elaborable vertex whose unit has been compiled with the
                dynamic model, and elaborate its component.
      
              - If no such weakly elaborable vertex is available, then either
                all vertices were already elaborated, or the graph contains a
                cycle.
      
           The elaboration of a component employs the same logic, with an
           added step where all successors of some predecessor currently being
           elaborated are notified that they have one fewer predecessor to
           wait on. This may cause certain successors to become elaborable, in
           which case they are moved from the set of waiting vertices to the
           set of elaborable vertices.
      
         * Three new GNATbind debug switches are introduced, -d_a, -d_b, and
           -d_e, to eliminate the effects of pragmas Elaborate_All,
           Elaborate_Body, and Elaborate respectively.
      
         * The section on terminology is updated to include new entries.
      
      2019-07-08  Hristian Kirtchev  <kirtchev@adacore.com>
      
      gcc/ada/
      
      	* bindo.adb: Update the section on terminology to include new
      	concepts.  Update the section on switches to include new
      	entries.
      	* bindo.ads: Add type Precedence_Kind.
      	* bindo-builders.adb: Add with and use clauses for Debug and
      	Bindo.Validators.  Add use clauses for
      	Bindo.Validators.Invocation_Graph_Validators and
      	Bindo.Validators.Library_Graph_Validators.
      	(Build_Invocation_Graph): Validate the graph immediately after
      	it was built.
      	(Build_Library_Graph): Update the parameter profile. The
      	creation of the graph is now elaboration model-agnostic.
      	Validate the graph immediately after it was built.
      	(Create_With_Edge): Create regular with edges for Elaborate and
      	Elaborate_All edges when the appropriate debug switches are in
      	effect.
      	* bindo-builders.ads (Build_Library_Graph): Update the parameter
      	profile.
      	* bindo-diagnostics.adb (Diagnose_Cycle): Track the presence of
      	an Elaborate_All edge throughout the inspection of the cycle's
      	edges.
      	(Output_Dynamic_Model_Suggestions): Output the suggestion only
      	when the cycle contains at least one weak edge where the
      	successor was statically elaborated.
      	(Output_Elaborate_Body_Transition, Output_Forced_Transition,
      	Output_With_Transition): Update the assertions.
      	* bindo-elaborators.adb: Remove use clauses for
      	Bindo.Validators.Invocation_Graph_Validators and
      	Bindo.Validators.Library_Graph_Validators.  Remove strings
      	Add_To_All_Candidates_Msg and Add_To_Comp_Candidates_Msg.
      	Remove type String_Ptr.
      	(Add_Vertex, Add_Vertex_If_Elaborable, Create_All_Candidates_Set
      	Create_Component_Candidates_Set): Remove.
      	(Create_Component_Vertex_Sets, Create_Vertex_Sets): New routine.
      	(Elaborate_Component): Update the parameter profile and the
      	comment on usage.  Reimplement the elaboration of a component.
      	The algorithm will now attempt to elaborate as many vertices
      	possible. If this is not possible, and a weakly elaborable
      	vertex is available use unit was compiled using the dynamic
      	model, the algorithm will elaborate it.
      	(Elaborate_Library_Graph): Reimplement the elaboration of the
      	graph. The algorithm will now attempt to elaborate as many
      	vertices along with their components as possible. If this is not
      	possible, and a weakly elaborable vertex is available use unit
      	was compiled using the dynamic model, the algorithm will
      	elaborate it along with its component.
      	(Elaborate_Units): Merge with the functionality of
      	Elaborate_Units_Common.
      	(Elaborate_Units_Common, Elaborate_Units_Dynamic,
      	Elaborate_Units_Static): Remove.
      	(Elaborate_Vertex): Update the parameter profile and the comment
      	on usage.  Reimplemented.
      	(Find_Best_Candidate): Remove.
      	(Find_Best_Elaborable_Vertex, Find_Best_Vertex,
      	Find_Best_Weakly_Elaborable_Vertex, Has_Elaborable_Body,
      	Insert_Elaborable_Successor, Insert_Vertex): New routines.
      	(Is_Better_Candidate): Remove.
      	(Is_Better_Elaborable_Vertex,
      	Is_Better_Weakly_Elaborable_Vertex,
      	Is_Suitable_Elaborable_Vertex,
      	Is_Suitable_Weakly_Elaborable_Vertex): New routines.
      	(Trace_Candidate_Vertices): Remove.
      	(Trace_Component): Output the number of strong and weak
      	predecessors.
      	(Trace_Unelaborated_Vertices): Remove.
      	(Trace_Vertex): Output the number of strong and weak
      	predecessors.
      	(Trace_Vertices): New routine.
      	(Update_Successor, Update_Successors): Update the parameter
      	profile and the comment on usage.
      	* bindo-graphs.adb: Remove type Precedence_Kind.
      	(Add_Edge_With_Return): Update the increment of pending
      	predecessors.
      	(Add_Vertex): Provide default values for strong and weak
      	predecessors.
      	(Complementary_Vertex): Move the initial declaration to the
      	spec. Update the parameter profile and the comment on usage.
      	(Contains_Weak_Static_Successor): New routine.
      	(Create): Update the parameter profile. The creation of the
      	graph is now elaboration model-agnostic.
      	(Decrement_Pending_Predecessors): Update the parameter profile
      	and the comment on usage. Reimplemented.
      	(Delete_Edge): Update the decrement of pending predecesors.
      	(Has_Elaborate_Body): Do not treat a vertex as being subject to
      	Elaborate_Body when a debug switch is in effect.
      	(Increment_Pending_Predecessors): Update the parameter profile
      	and the comment on usage. Reimplemented.
      	(Is_Elaborable_Component): Reimplemented.
      	(Is_Elaborable_Vertex): Move the initial declaration to the
      	spec.  Reimplemented.
      	(Is_Elaborate_Body_Pair): New routine.
      	(Is_Dynamically_Elaborated): Update the parameter profile.
      	Reimplemented.
      	(Is_Weakly_Elaborable_Vertex): New routine.
      	(Pending_Predecessors): Removed.
      	(Pending_Predecessors_For_Elaboration,
      	Pending_Strong_Predecessors, Pending_Weak_Predecessors,
      	Update_Pending_Predecessors): New routines.
      	(Update_Pending_Predecessors_Of_Components): Update the
      	increment of pending predecessors.
      	* bindo-graphs.ads: Update the components of type
      	Component_Attributes.  Update the components of type
      	Library_Graph_Attributes.  Update the components of type
      	Library_Graph_Vertex_Attributes.  Update the initialization of
      	No_Component_Attributes.  Update the initialization of
      	No_Library_Graph_Vertex_Attributes.
      	(Complementary_Vertex, Contains_Weak_Static_Successor): New
      	routines.
      	(Create): Update the parameter profile and the comment on usage.
      	(Decrement_Pending_Predecessors, Is_Dynamically_Elaborated):
      	Update the parameter profile and the comment on usage.
      	(Is_Elaborate_Body_Pair, Is_Weakly_Elaborable_Vertex): New
      	routines.
      	(Pending_Predecessors): Removed.
      	(Pending_Predecessors_For_Elaboration,
      	Pending_Strong_Predecessors, Pending_Weak_Predecessors): New
      	routines.
      	* bindo-writers.adb (Write_Components): Moved from the spec.
      	(Write_Component): Output the strong and weak predecessors.
      	(Write_Library_Graph): Output the components as part of the
      	graph.
      	(Write_Library_Graph_Vertex): Output the strong and weak
      	predecessors.
      	* bindo-writers.ads (Write_Components): Moved to the body.
      	* debug.adb: Add and document new GNATbind switches -d_a, -d_b,
      	-d_e.
      	* bindo-validators.adb: Minor reformattings.
      
      From-SVN: r273209
      Hristian Kirtchev committed
    • [Ada] More data rates supported on Linux · 79ee9e32
      This patch adds additional data rates to the GNAT.Serial_Communications
      package (Linux version).
      
      2019-07-08  Bob Duff  <duff@adacore.com>
      
      gcc/ada/
      
      	* libgnat/g-sercom.ads, libgnat/g-sercom__linux.adb (Data_Rate):
      	Support additional data rates.
      
      From-SVN: r273208
      Bob Duff committed
    • [Ada] Arrange not to set DECL_ARTIFICIAL on elab procs · 19d9ce46
      Unlike, say, clones created internally by the compiler, elab procs
      materialize specific user code and flagging them artificial now takes
      elab code away from gcov's analysis, a regression compared to previous
      releases.
      
      On the testcase below:
      
      package Gcov_Q is
         function F (X : Integer) return Integer is (X + 1);
      end;
      
      with Gcov_Q;
      package Gcov_P is
         Y : Integer := Gcov_Q.F (X => 1);
      end;
      
      with Gcov_P;
      procedure Gcov_Test is
      begin
         if Gcov_P.Y /= 2 then
            raise Program_Error;
         end if;
      end;
      
      After compiling with:
      
        gnatmake -f -g gcov_test.adb \
          -cargs -ftest-coverage -fprofile-arcs \
          -largs -fprofile-generate
      
      and executing with
      
        ./gcov_test
      
      We expect
      
         gcov gcov_p
      
      to produce a gcov_p.ads.gcov report.
      
      2019-07-08  Olivier Hainque  <hainque@adacore.com>
      
      gcc/ada/
      
      	* gcc-interface/trans.c (Compilation_Unit_to_gnu): Don't request
      	DECL_ARTIFICIAL_P on elab proc declarations.
      
      From-SVN: r273207
      Olivier Hainque committed
    • [Ada] Fix crash on extension of private type with -gnatRj · abbc4546
      This fixes a crash (or an assertion failure) during the processing done
      for -gnatRj on the declaration of an extension of a private type.
      Generally speaking, extension declarations are delicate in this context
      because the front-end does not duplicate the structure of the parent
      type, so the processing required to output the structural layout needs
      to go up to the declaration of the parent type, which may or may not be
      available or usable.
      
      The change also makes the processing more robust by falling back to the
      flat layout if the declaration of the parent type cannot be processed.
      
      2019-07-08  Eric Botcazou  <ebotcazou@adacore.com>
      
      gcc/ada/
      
      	* repinfo.adb (List_Record_Info): Declare Incomplete_Layout and
      	Not_In_Extended_Main local exceptions.
      	(List_Structural_Record_Layout): For an extension, raise the
      	former if the parent subtype has not been built and the latter
      	if it is not declared in the main source unit.  Fall back to the
      	flat layout if either exception has been raised.
      
      From-SVN: r273206
      Eric Botcazou committed
    • [Ada] Semantics of Delete for fixed strings · 4962dc44
      This patch corrects a bug in the implementation of Delete in an unusual
      boundary case: the RM describes the semantics of Delete as equivalent to
      that of Replace_String with a null argument. As a result, deleting a
      null string that starts past the end of its argument is a noop and must
      not raise Index_Error.
      
      2019-07-08  Ed Schonberg  <schonberg@adacore.com>
      
      gcc/ada/
      
      	* libgnat/a-strfix.adb (Delete): The RM describes the semantics
      	of Delete as equivalent to that of Replace_String with a null
      	argument. As a result, deleting a null string that starts past
      	the end of its argument is a noop and must not raise
      	Index_Error.
      
      gcc/testsuite/
      
      	* gnat.dg/fixed_delete.adb: New testcase.
      
      From-SVN: r273205
      Ed Schonberg committed
    • [Ada] Crash in interface derivation with null primitive · 4a0e6ac1
      The frontend crashes processing the derivation of a tagged type whose
      ultimate ancestor is an interface type I1 that has a null primitive,
      implements another interface I2 derived from I2, and does not override
      the null primitive.
      
      2019-07-08  Javier Miranda  <miranda@adacore.com>
      
      gcc/ada/
      
      	* exp_disp.adb (Register_Primitive): When registering a
      	primitive in the secondary dispatch table, handle primitive
      	inherited through several levels of type derivation (required to
      	properly handle inherited 'null' primitive).
      
      gcc/testsuite/
      
      	* gnat.dg/interface9.adb, gnat.dg/interface9_root-child.ads,
      	gnat.dg/interface9_root.ads: New testcase.
      
      From-SVN: r273204
      Javier Miranda committed
    • [Ada] Document handling of preprocessor directives in GNATpp · 23eb3cb2
      2019-07-08  Bob Duff  <duff@adacore.com>
      
      gcc/ada/
      
      	* doc/gnat_ugn/gnat_utility_programs.rst: Document handling of
      	preprocessor directives in GNATpp.
      
      From-SVN: r273203
      Bob Duff committed
    • [Ada] Code reorganization · f56e04e8
      This patch performs a code reorganization of the implementation of
      pragma Compile_Time_Error. No functional change.
      
      No test required.
      
      2019-07-08  Javier Miranda  <miranda@adacore.com>
      
      gcc/ada/
      
      	* gnat1drv.adb (Post_Compilation_Validation_Checks:
      	Validate_Compile_Time_Warning_Errors is now located in sem_prag
      	(instead of sem_ch13).
      	* sem_ch13.ads (Validate_Compile_Time_Warning_Error,
      	Validate_Compile_Time_Warning_Errors): Move to sem_prag.
      	* sem_ch13.adb
      	(Compile_Time_Warnings_Errors): Move to sem_prag.
      	(Initialize): Remove initialization of table
      	Compile_Time_Warning_Errors.
      	(Validate_Compile_Time_Warning_Error,
      	Validate_Compile_Time_Warning_Errors): Move to sem_prag.
      	* sem_prag.ads (Validate_Compile_Time_Warning_Errors): New
      	procedure.
      	* sem_prag.adb (Initialize): Initialize table
      	Compile_Time_Warning_Errors.
      
      From-SVN: r273202
      Javier Miranda committed
    • [Ada] Crash on named actual in postcondition for generic subprogram · 5291985c
      This patch fixes a crash on compiling the postcondtion for a generic
      subprogram, when the postcondition is a call with both positional and
      named parameter associations.
      
      2019-07-08  Ed Schonberg  <schonberg@adacore.com>
      
      gcc/ada/
      
      	* sem_ch13.adb (Analyze_Aspect_Specifications): For a
      	pre/postcondition of a generic subprogram declaration, do not
      	use Relocate_Node on the aspect expression to construct the
      	corresponding attribute specification, to prevent tree anomalies
      	when the expression is a call with named actual parameters.
      
      gcc/testsuite/
      
      	* gnat.dg/predicate9.adb: New testcase.
      
      From-SVN: r273201
      Ed Schonberg committed
    • [Ada] Spurious error reported by pragma Compile_Time_Error · b91cdf75
      The compiler may trigger spurious errors on pragmas Compile_Time_Error
      and Compile_Time_Warning when their boolean expression computes the size
      of a type. After this patch the following test compiles fine.
      
      with Interfaces; use Interfaces;
      package Types is
         type Arr is array (1 .. 6) of Unsigned_8
           with Size      => 48,
                Alignment => 1;
      
         type Rec is record
            Comp_1 : Unsigned_32;
            Comp_2 : Unsigned_16;
         end record
           with Size      => 48,
                Alignment => 1;
      end Types;
      
      with Types; use Types;
      package Main is
         pragma Compile_Time_Error
           (Arr'Size  = 12, "ERROR: Arr'Size is 48, not 12");
         pragma Compile_Time_Error
           (Arr'Size  = 48, "OK: Arr");
         pragma Compile_Time_Error
           (Arr'Size /= 48, "ERROR: Arr'Size is 48");
      
         pragma Compile_Time_Error
           (Rec'Size  = 34, "ERROR: Rec'Size is 48, not 34");
         pragma Compile_Time_Error
           (Rec'Size  = 48, "OK: Rec");
         pragma Compile_Time_Error
           (Rec'Size /= 48, "ERROR: Rec'Size is 48");
      end Main;
      
      Command: gcc -c main.ads
       Output: main.ads:7:07: OK: Arr
               main.ads:14:07: OK: Rec
      
      2019-07-08  Javier Miranda  <miranda@adacore.com>
      
      gcc/ada/
      
      	* sem_attr.adb (Analyze_Attribute [Attribute_Size]): For pragmas
      	used to report user defined compile time warning or errors
      	handle 'Size for types with known static RM size.
      
      From-SVN: r273200
      Javier Miranda committed