gcc.git
5 years ago[Ada] Crash on exported build-in-place function
Bob Duff [Fri, 5 Jul 2019 07:02:37 +0000 (07:02 +0000)]
[Ada] Crash on exported build-in-place function

This patch fixes a bug where if a function is build-in-place, and is
exported, and contains an extended_return_statement whose object is
initialized with another build-in-place function call, then the compiler
will crash.

2019-07-05  Bob Duff  <duff@adacore.com>

gcc/ada/

* exp_ch6.adb (Is_Build_In_Place_Function): Narrow the check for
Has_Foreign_Convention to the imported case only.  If a
build-in-place function is exported, and called from Ada code,
build-in-place protocols should be used.

gcc/testsuite/

* gnat.dg/bip_export.adb, gnat.dg/bip_export.ads: New testcase.

From-SVN: r273113

5 years ago[Ada] Spurious error on aggregate with choice that is predicted subtype
Ed Schonberg [Fri, 5 Jul 2019 07:02:32 +0000 (07:02 +0000)]
[Ada] Spurious error on aggregate with choice that is predicted subtype

This patch fixes a spurious error on a record aggregate for a variant
record when a choice in the aggregate is given by a subtype with a
static predicate. The same expansion mechanism for such a variant, used
in case statements, must be used here as well.

2019-07-05  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_util.adb (Encloing_Subprogram): If Enclosing_Dynamic_Scope
is a loop, continue climbing the scope stack to find the
enclosing subprogram.
(Gather_Components): Handle properly a choice in a record
aggregate that is given by a subtype with a static predicate.

gcc/testsuite/

* gnat.dg/aggr25.adb, gnat.dg/aggr25.ads: New testcase.

From-SVN: r273112

5 years ago[Ada] Removing support for SCIL "contract-only" subprogram bodies
Javier Miranda [Fri, 5 Jul 2019 07:02:28 +0000 (07:02 +0000)]
[Ada] Removing support for SCIL "contract-only" subprogram bodies

Remove support added for CodePeer (which was never enabled by default;
it was controlled by the -gnatd.K option) for generation of SCIL
"contract-only" subprogram bodies. These were intended for use when a
subprogram's "real" body is unavailable but the subprogram spec has
pre/post-conditions specified.

2019-07-05  Javier Miranda  <miranda@adacore.com>

gcc/ada/

* debug.adb (-gnatd.K): Leave available this switch.
* contracts.adb (Build_And_Analyze_Contract_Only_Subprograms):
Remove.
* scil_ll.ads, scil_ll.adb (Contract_Only_Body_Flag,
Contract_Only_Body_Nodes, Get_Contract_Only_Body,
Is_Contract_Only_Body, Set_Contract_Only_Body): Remove.

From-SVN: r273111

5 years ago[Ada] Import documentation from the RM for Ada.Strings.Unbounded
Pierre-Marie de Rodat [Fri, 5 Jul 2019 07:02:23 +0000 (07:02 +0000)]
[Ada] Import documentation from the RM for Ada.Strings.Unbounded

2019-07-05  Pierre-Marie de Rodat  <derodat@adacore.com>

gcc/ada/

* libgnat/a-strunb.ads: Import documentation from the RM

From-SVN: r273110

5 years ago[Ada] Import documentation from the RM for Ada.Strings.Fixed
Pierre-Marie de Rodat [Fri, 5 Jul 2019 07:02:17 +0000 (07:02 +0000)]
[Ada] Import documentation from the RM for Ada.Strings.Fixed

2019-07-05  Pierre-Marie de Rodat  <derodat@adacore.com>

gcc/ada/

* libgnat/a-strfix.ads: Import documentation from the RM

From-SVN: r273109

5 years ago[Ada] Accept compilation switches -Og/-Ofast in non-GCC backends
Yannick Moy [Fri, 5 Jul 2019 07:02:13 +0000 (07:02 +0000)]
[Ada] Accept compilation switches -Og/-Ofast in non-GCC backends

Tools like GNATprove built as GNAT backends rely on adabkend.adb to
handle generic switches like the optimisation switches -Oxxx.
This patch adds support for -Og and -Ofast that was missing.

There is no impact on compilation.

2019-07-05  Yannick Moy  <moy@adacore.com>

gcc/ada/

* adabkend.adb (Scan_Back_End_Switches): Accept -Og and -Ofast
switches.

From-SVN: r273108

5 years ago[Ada] Diagnostics in Elaboration order v4.0
Hristian Kirtchev [Fri, 5 Jul 2019 07:02:08 +0000 (07:02 +0000)]
[Ada] Diagnostics in Elaboration order v4.0

This patch introduces several changes to the new elaboration order
mechanism:

  * The library graph can now discover, store, and organize the various
    cycles it contains.

  * The elaboration order mechanism can now diagnose one or all cycles
    within the library graph. Diagnostics consist of describing the
    reason for the cycle, listing all units comprising the circuit, and
    offering suggestions on how to break the cycle.

The patch also modifies unit ALI to hide all invocation-related data
structures and several implementation-specific types by relocating them
in the body of the unit.

The patch cleans up most children of Bindo by using better names of
routines and formal parameters.

------------
-- Source --
------------

--  a.ads

with B; pragma Elaborate_All (B);
with C; pragma Elaborate_All (C);

package A is
end A;

--  b.ads

package B is
   procedure Force_Body;
end B;

--  b.adb

with D;

package body B is
   procedure Force_Body is null;

   Elab : constant Integer := D.Func;
end B;

--  c.ads

package C is
   procedure Force_Body;
end C;

--  c.adb

with E;

package body C is
   procedure Force_Body is null;
end C;

--  d.ads

package D is
   function Func return Integer;
end D;

--  d.adb

with A;

package body D is
   Local : Integer := 123;

   function Func return Integer is
   begin
      return Local;
   end Func;
end D;

--  e.ads

with A;

package E is
end E;

--  main.adb

with B;

--             Elaborate_All             Elaborate_All               with
--    C spec <--------------- A spec ---------------------> B spec <------ Main
--      ^                      ^  ^                           ^
--      |                      |  |                           |
--  sbb |                      |  |                           | sbb
--      |                      |  |                           |
--    C body -----------> E spec  |       D spec <--------- B body
--               with             |         ^       with      |
--                                |         |                 |
--                                |     sbb |                 |
--                                |         |                 |
--                                +------ D body <------------+
--                                  with           Invocation
--
--  The cycles are
--
--    A spec --> C spec --> E spec --> A spec
--               C body
--
--    A spec --> B spec --> D body --> A spec
--               B body

procedure Main is begin null; end Main;

----------------------------
-- Compilation and output --
----------------------------

$ gnatmake -q main.adb -bargs -d_C -d_N
error: Elaboration circularity detected
info:
info:    Reason:
info:
info:      unit "a (spec)" depends on its own elaboration
info:
info:    Circularity:
info:
info:      unit "a (spec)" has with clause and pragma Elaborate_All for unit
             "b (spec)"
info:      unit "b (body)" is in the closure of pragma Elaborate_All
info:      unit "b (body)" has with clause for unit "d (spec)"
info:      unit "d (body)" is in the closure of pragma Elaborate_All
info:      unit "d (body)" has with clause for unit "a (spec)"
info:
info:    Suggestions:
info:
info:      change pragma Elaborate_All for unit "b (spec)" to Elaborate in unit
             "a (spec)"
info:      remove pragma Elaborate_All for unit "b (spec)" in unit "a (spec)"
info:
error: Elaboration circularity detected
info:
info:    Reason:
info:
info:      unit "a (spec)" depends on its own elaboration
info:
info:    Circularity:
info:
info:      unit "a (spec)" has with clause and pragma Elaborate_All for unit
             "c (spec)"
info:      unit "c (body)" is in the closure of pragma Elaborate_All
info:      unit "c (body)" has with clause for unit "e (spec)"
info:      unit "e (spec)" has with clause for unit "a (spec)"
info:
info:    Suggestions:
info:
info:      change pragma Elaborate_All for unit "c (spec)" to Elaborate in unit
             "a (spec)"
info:      remove pragma Elaborate_All for unit "c (spec)" in unit "a (spec)"
info:
gnatmake: *** bind failed.

2019-07-05  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* ali.adb: Relocate types Invocation_Construct_Record,
Invocation_Relation_Record, and Invocation_Signature_Record to
the body of ALI.  Relocate tables Invocation_Constructs,
Invocation_Relations, and Invocation_Signatures to the body of
ALI.  Remove type Body_Placement_Codes.  Add new types
Declaration_Placement_Codes, and
Invocation_Graph_Encoding_Codes.  Update the literals of type
Invocation_Graph_Line_Codes.
(Add_Invocation_Construct): Update the parameter profile. Add an
invocation construct built from all attributes provided.
(Add_Invocation_Relation): Update the parameter profile. Add an
invocation relation built from all attributes provided.
(Body_Placement): New routine.
(Body_Placement_Kind_To_Code, Code_To_Body_Placement_Kind):
Removed.
(Code_To_Declaration_Placement_Kind,
Code_To_Invocation_Graph_Encoding_Kind, Column,
Declaration_Placement_Kind_To_Code, Extra,
For_Each_Invocation_Construct, For_Each_Invocation_Relation,
Invocation_Graph_Encoding,
Invocation_Graph_Encoding_Kind_To_Code, Invoker, Kind, Line,
Locations, Name): New routine.
(Scan_Invocation_Construct_Line): Reimplement the scanning
mechanism.
(Scan_Invocation_Graph_Attributes_Line): New routine.
(Scan_Invocation_Graph_Line): Use a case statement to dispatch.
(Scan_Invocation_Relation_Line): Reimplement the scanning
mechanism.
(Scope): New routine.
(Set_Invocation_Graph_Encoding, Signature, Spec_Placement,
Target): New routine.
* ali.ads: Add new type Invocation_Graph_Encoding_Kind.  Add
component Invocation_Graph_Encoding to type Unit_Record.
Relocate various types and data structures to the body of ALI.
(Add_Invocation_Construct, Add_Invocation_Relation): Update the
parameter profile.
(Body_Placement): New routine.
(Body_Placement_Kind_To_Code, Code_To_Body_Placement_Kind):
Removed.
(Code_To_Declaration_Placement_Kind,
Code_To_Invocation_Graph_Encoding_Kind, Column,
Declaration_Placement_Kind_To_Code, Extra,
For_Each_Invocation_Construct, For_Each_Invocation_Relation,
Invocation_Graph_Encoding,
Invocation_Graph_Encoding_Kind_To_Code, Invoker, Kind, Line,
Locations, Name, Scope, Set_Invocation_Graph_Encoding,
Signature, Spec_Placement, Target): New routine.
* bindo.adb: Add with clause for Binde.  Add with and use
clauses for Debug.  Update the documentation.  Add new switches.
(Find_Elaboration_Order): Dispatch to the proper elaboration
mechanism.
* bindo-augmentors.adb:
Remove with and use clauses for GNAT and GNAT.Sets.  Remove
membership set VS.  Update the parameter profiles of most
routines to use better parameter names.  Update the
implementation of most routine to use the new parameter names.
Remove various redundant assertions.
* bindo-builders.adb: Use better names for instantiated data
structures. Update all references to these names.  Update the
parameter profiles of most routines to use better parameter
names.  Update the implementation of most routine to use the new
parameter names.
(Build_Library_Graph): Update the parameter profile. Update the
call to Create.
(Create_Vertex): Reimplemented.
(Declaration_Placement_Vertex): New routine.
* bindo-builders.ads (Build_Library_Graph): Update the parameter
profile and comment on usage.
* bindo-diagnostics.adb: Almost a new unit.
* bindo-diagnostics.ads: Add a use clause for
Bindo.Graphs.Invocation_Graphs.  Remove package
Cycle_Diagnostics.
(Diagnose_Circularities): New routine.
* bindo-elaborators.adb: Remove the with and use clauses for
Binderr and GNAT.Sets.  Remove the use clause for
Bindo.Diagnostics.Cycle_Diagnostics.  Remove membership set VS.
Update the parameter profiles of most routines to use better
parameter names.  Update the implementation of most routine to
use the new parameter names.  (Elaborate_Units_Common): Update
the parameter profile. Pass an infication to the library graph
builder whether the dynamic model is in effect.
(Elaborate_Units_Dynamic, Elaborate_Units_Static): Use
Diagnose_Circularities to provide diagnostics.
(Update_Successor): Use routine In_Same_Component to determine
whether the predecessor and successor reside in different
components.
* bindo-graphs.adb: Add with and use clauses for Butil, Debug,
Output, and Bindo.Writers.  Remove with and use clauses for
GNAT.Lists.  Update the parameter profiles of most routines to
use better parameter names.  Update the implementation of most
routine to use the new parameter names.  Remove various
redundant assertions.  Remove doubly linked list EL.  Add new
type Precedence_Kind.
(Add_Cycle): New routine.
(Add_Vertex): Update the parameter profile. Update the creation
of vertex attributes.
(Add_Vertex_And_Complement, Body_Vertex, Column,
Complementary_Vertex, Copy_Cycle_Path, Cycle_Kind_Of): New
routines.
(Destroy_Invocation_Graph_Edge, Destroy_Library_Graph_Cycle,
Destroy_Library_Graph_Edge, Extra, File_Name,
Find_All_Cycles_Through_Vertex, Find_All_Cycles_With_Edge,
Find_Cycles, Find_First_Lower_Precedence_Cycle,
Get_LGC_Attributes, Has_Next, Hash_Library_Graph_Cycle,
Hash_Library_Graph_Cycle_Attributes, Highest_Precedence_Cycle,
Highest_Precedence_Edge, In_Same_Component, Insert_And_Sort,
Invocation_Edge_Count, Invocation_Graph_Encoding,
Is_Cycle_Initiating_Edge, Is_Cyclic_Edge,
Is_Cyclic_Elaborate_All_Edge, Is_Cyclic_Elaborate_Body_Edge,
Is_Cyclic_Elaborate_Edge, Is_Cyclic_Forced_Edge,
Is_Cyclic_Invocation_Edge, Is_Cyclic_With_Edge,
Is_Dynamically_Elaborated, Is_Elaborate_All_Edge,
Is_Elaborate_Body_Edge, Is_Elaborate_Edge: New routines.
(Is_Existing_Predecessor_Successor_Relation): Removed.
(Is_Forced_Edge, Is_Invocation_Edge, Is_Recorded_Cycle,
Is_Recorded_Edge, Is_With_Edge, Iterate_Edges_Of_Cycle, Kind,
Length): New routine.
(Lib_Vertex): Removed.
(Line, Links_Vertices_In_Same_Component,
Maximum_Invocation_Edge_Count, Next, Normalize_And_Add_Cycle,
Normalize_Cycle_Path, Number_Of_Cycles, Path, Precedence,
Remove_Vertex_And_Complement, Sequence_Next_Cycle): New routines.
(Sequence_Next_IGE_Id): Renamed to Sequence_Next_Edge.
(Sequence_Next_IGV_Id): Renamed to Sequence_Next_Vertex.
(Sequence_Next_LGE_Id): Renamed to Sequence_Next_Edge.
(Sequence_Next_LGV_Id): Renamed to Sequence_Next_Vertex.
(Set_Is_Existing_Predecessor_Successor_Relation): Removed.
(Set_Is_Recorded_Cycle, Set_Is_Recorded_Edge,
Set_LGC_Attributes, Spec_Vertex, Trace_Cycle, Trace_Edge,
Trace_Eol, Trace_Vertex): New routines.
* bindo-graphs.ads: Add with and use clauses for Types and
GNAT.Lists.  Update the parameter profiles of most routines to
use better parameter names.  Update the implementation of most
routine to use the new parameter names.  Add the new
instantiated data structures IGE_Lists, IGV_Sets, LGC_Lists,
LGE_Lists, LGE_Sets, LGV_Sets, and RC_Sets.  Add new type
Library_Graph_Cycle_Id along with an empty and initial value.
Remove component Lib_Vertex and add new components Body_Vertex
and Spec_Vertex to type Invocation_Graph_Vertex_Attributes.  Add
new type Library_Graph_Cycle_Kind.  Add new iterators
All_Cycle_Iterator and Edges_Of_Cycle_Iterator.  Add new type
Library_Graph_Cycle_Attributes.  Add new components
Cycle_Attributes, Cycles, and Dynamically_Elaborated to type
Library_Graph_Attributes.
(Body_Vertex, Column, Destroy_Invocation_Graph_Edge,
Destroy_Library_Graph_Cycle_Attributes,
Destroy_Library_Graph_Edge, Extra, File_Name, Find_Cycles,
Has_Elaborate_All_Cycle, Has_Next, Hash_Library_Graph_Cycle,
Hash_Library_Graph_Cycle_Attributes, Highest_Precedence_Cycle,
In_Same_Component, Invocation_Edge_Count,
Invocation_Graph_Encoding, Is_Dynamically_Elaborated,
Is_Elaborate_All_Edge, Is_Elaborate_Body_Edge,
Is_Elaborate_Edge, Is_Forced_Edge, Is_Invocation_Edge,
Is_With_Edge, Iterate_All_Cycles, Iterate_Edges_Of_Cycle, Kind):
New routines.
(Length, Lib_Vertex, (Line, Next, Number_Of_Cycles, Present,
Same_Library_Graph_Cycle_Attributes, Spec_Vertex): New routines.
* bindo-units.adb (File_Name, Invocation_Graph_Encoding): New
routines.
* bindo-units.ads: Add new instantiated data structure
Unit_Sets.
(File_Name, Invocation_Graph_Encoding): New routine.
* bindo-validators.adb: Remove with and use clauses for GNAT and
GNAT.Sets.  Remove membership set US.  Update the parameter
profiles of most routines to use better parameter names.  Update
the implementation of most routine to use the new parameter
names.
(Validate_Cycle, Validate_Cycle_Path, Validate_Cycles,
Validate_Invocation_Graph_Vertex): Remove the validation of
component Lib_Vertex. Add the validation of components
Body_Vertex and Spec_Vertex.
(Write_Error): New routine.
* bindo-validators.ads (Validate_Cycles): New routine.
* bindo-writers.adb: Update the parameter profiles of most
routines to use better parameter names.  Update the
implementation of most routine to use the new parameter names.
(Write_Cycle, Write_Cyclic_Edge, Write_Cycles): New routines.
(Write_Invocation_Graph_Vertex): Remove the output of component
Lib_Vertex. Add the output of components Body_Vertex and
Spec_Vertex.
* bindo-writers.ads (Write_Cycles): New routine.
* debug.adb: Use binder switches -d_C and -d_P, add
documentation on their usage.
* gnatbind.adb: Remove with and use clauses for Binde.  Delegate
the choice of elaboration mechanism to Bindo.
* lib-writ.adb (Column, Extra, Invoker, Kind, Line, Locations,
Name, Placement, Scope, Signature, Target): Removed.
(Write_Invocation_Graph): Moved at the top level.
(Write_Invocation_Graph_Attributes): New routine.
(Write_Invocation_Relation, Write_Invocation_Signature): Moved
at the top level.
* lib-writ.ads: Add a documentation section on invocation graph
attributes.
* sem_elab.adb (Body_Placement_Of): New routine.
(Declare_Invocation_Construct): Update the call to
Add_Invocation_Construct.
(Declaration_Placement_Of_Node): New routine.
(Get_Invocation_Attributes): Correct the retrieval of the
enclosing subprogram where the postcondition procedure lives.
(Placement_Of, Placement_Of_Node): Removed.
(Record_Invocation_Graph): Record the encoding format used.
(Record_Invocation_Graph_Encoding): New routine.
(Record_Invocation_Relation): Update the call to
Add_Invocation_Relation.
(Spec_Placement_Of): Removed.
* libgnat/g-lists.ads, libgnat/g-lists.adb (Equal): New routine.

From-SVN: r273107

5 years ago[Ada] Compiler abort on a dynamic predicate used in a precondition
Ed Schonberg [Fri, 5 Jul 2019 07:02:03 +0000 (07:02 +0000)]
[Ada] Compiler abort on a dynamic predicate used in a precondition

This patch suppresses the generation of a predicate check when the
expression is a formal IN parameter of a subprogram S. If the check is
being applied to the actual in a call, the call is either in the body of
S, or in an aspect specfication for S, e.g. a precondition, In both
cases the check is redundant bevause it will be applied on any call to
S. In the second case the expansion of the predicate check may lead to
out-of-scope references the the formal.

2019-07-05  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* checks.adb (Apply_Predicate_Check): Except within the
subprogram body that defines the formal, do not apply predicate
check on a formal IN parameter: such a check is redundant and
its expansion can lead to out-of-scope references when it is
originates in a function call in a precondition,

gcc/testsuite/

* gnat.dg/predicate7.adb, gnat.dg/predicate7.ads,
gnat.dg/predicate7_pkg.ads: New testcase.

From-SVN: r273106

5 years ago[Ada] Fix inlining in GNATprove inside quantified expressions
Yannick Moy [Fri, 5 Jul 2019 07:01:58 +0000 (07:01 +0000)]
[Ada] Fix inlining in GNATprove inside quantified expressions

Calls to local subprograms in GNATprove may be inlined in some case, but
it should not be the case inside quantified expressions which are
handled as expressions inside GNATprove. Because quantified expressions
are only preanalayzed, the detection of the impossible inlining was not
performed.  Now fixed.

There is no impact on compilation.

2019-07-05  Yannick Moy  <moy@adacore.com>

gcc/ada/

* sem_res.adb (Resolve_Call): Cannot inline in quantified
expressions.
* sem_util.adb, sem_util.ads (In_Quantified_Expression): New
function.

From-SVN: r273105

5 years ago[Ada] Fix typo in GNAT RM
Bob Duff [Fri, 5 Jul 2019 07:01:54 +0000 (07:01 +0000)]
[Ada] Fix typo in GNAT RM

2019-07-05  Bob Duff  <duff@adacore.com>

gcc/ada/

* doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
Fix typo.
* gnat_rm.texi: Regenerate.

From-SVN: r273104

5 years ago[Ada] No_Stream_Optimizations ignored for 'Class'Input
Bob Duff [Fri, 5 Jul 2019 07:01:49 +0000 (07:01 +0000)]
[Ada] No_Stream_Optimizations ignored for 'Class'Input

This patch fixes a bug in which if pragma Restrictions
(No_Stream_Optimizations) is in effect, it is ignored for T'Class'Input.
Revision 251886  was causing the compiler to bypass
No_Stream_Optimizations.

2019-07-05  Bob Duff  <duff@adacore.com>

gcc/ada/

* exp_attr.adb (Input): Take the No_Stream_Optimizations
restriction into account.

From-SVN: r273103

5 years ago[Ada] Ada.Containers.Formal_Vectors: make vectors always bounded
Claire Dross [Fri, 5 Jul 2019 07:01:45 +0000 (07:01 +0000)]
[Ada] Ada.Containers.Formal_Vectors: make vectors always bounded

2019-07-05  Claire Dross  <dross@adacore.com>

gcc/ada/

* libgnat/a-cofove.ads, libgnat/a-cofove.adb: Definite formal
vectors are now always bounded so that they do not need to be
limited anymore.

From-SVN: r273102

5 years ago[Ada] GNAT.Traceback: add a Call_Chain function
Dmitriy Anisimkov [Fri, 5 Jul 2019 07:01:40 +0000 (07:01 +0000)]
[Ada] GNAT.Traceback: add a Call_Chain function

2019-07-05  Dmitriy Anisimkov  <anisimko@adacore.com>

gcc/ada/

* libgnat/g-traceb.ads, libgnat/g-traceb.adb (Call_Chain): New
function.

From-SVN: r273101

5 years agoDaily bump.
GCC Administrator [Fri, 5 Jul 2019 00:16:23 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r273100

5 years agore PR middle-end/78884 ([7/8] ICE when gimplifying VLA in OpenMP SIMD region)
Jakub Jelinek [Thu, 4 Jul 2019 21:41:49 +0000 (23:41 +0200)]
re PR middle-end/78884 ([7/8] ICE when gimplifying VLA in OpenMP SIMD region)

PR middle-end/78884
* gimplify.c (struct gimplify_omp_ctx): Add add_safelen1 member.
(gimplify_bind_expr): If seeing TREE_ADDRESSABLE VLA inside of simd
loop body, set ctx->add_safelen1 instead of making it GOVD_PRIVATE.
(gimplify_adjust_omp_clauses): Add safelen (1) clause if
ctx->add_safelen1 is set.

* gcc.dg/gomp/pr78884.c: New test.

From-SVN: r273096

5 years agoomp-expand.c (expand_omp_for_static_nochunk): Don't emit GOMP_loop_start at the start...
Jakub Jelinek [Thu, 4 Jul 2019 21:40:56 +0000 (23:40 +0200)]
omp-expand.c (expand_omp_for_static_nochunk): Don't emit GOMP_loop_start at the start of second worksharing loop in a scan.

* omp-expand.c (expand_omp_for_static_nochunk): Don't emit
GOMP_loop_start at the start of second worksharing loop in a scan.
For nowait, don't emit GOMP_loop_end_nowait at the end of first
worksharing loop in a scan even if there are conditional lastprivates,
and do emit GOMP_loop_end_nowait at the end of second worksharing loop.

* testsuite/libgomp.c/scan-9.c: New test.
* testsuite/libgomp.c/scan-10.c: New test.

From-SVN: r273095

5 years ago[Darwin] Revert one hunk from r273016 (TLC for older Darwin versions).
Iain Sandoe [Thu, 4 Jul 2019 18:28:59 +0000 (18:28 +0000)]
[Darwin] Revert one hunk from r273016 (TLC for older Darwin versions).

t-darwin8 is nolonger needed (or present) for pre-10.4 powerpc, so remove
the reference.

2019-07-04  Iain Sandoe  <iain@sandoe.co.uk>

* config.host: Remove reference to t-darwin8.

From-SVN: r273091

5 years agotree-ssa-alias.c (nonoverlapping_component_refs_since_match_p): Fix check for match...
Jan Hubicka [Thu, 4 Jul 2019 16:30:53 +0000 (18:30 +0200)]
tree-ssa-alias.c (nonoverlapping_component_refs_since_match_p): Fix check for match in the ref walk.

* tree-ssa-alias.c (nonoverlapping_component_refs_since_match_p):
Fix check for match in the ref walk.

From-SVN: r273090

5 years agojit: gcc_jit_context_new_binary_op check res type
Andrea Corallo [Thu, 4 Jul 2019 16:25:06 +0000 (16:25 +0000)]
jit: gcc_jit_context_new_binary_op check res type

gcc/jit/ChangeLog:
2019-07-04  Andrea Corallo <andrea.corallo@arm.com>

* libgccjit.c (gcc_jit_context_new_binary_op): Check result_type to be a
numeric type.

gcc/testsuite/ChangeLog:
2019-07-04  Andrea Corallo <andrea.corallo@arm.com>

* jit.dg/test-error-gcc_jit_context_new_binary_op-bad-res-type.c:
New testcase.

From-SVN: r273089

5 years agoFix arm XFAIL in cunroll-15.c
Wilco Dijkstra [Thu, 4 Jul 2019 16:00:26 +0000 (16:00 +0000)]
Fix arm XFAIL in cunroll-15.c

Remove the XFAIL on arm in cunroll-15.c since the test passes on trunk.
Committed as obvious.

testsuite/
* gcc.dg/tree-ssa/cunroll-15.c: Remove XFAIL on arm.

From-SVN: r273088

5 years agoSupport __builtin_expect_with_probability for analysis of # of loop iterations.
Martin Liska [Thu, 4 Jul 2019 15:59:19 +0000 (17:59 +0200)]
Support __builtin_expect_with_probability for analysis of # of loop iterations.

2019-07-04  Martin Liska  <mliska@suse.cz>

* tree-ssa-loop-niter.c (get_upper_bound_based_on_builtin_expr_with_prob):
New function.
(estimate_numbers_of_iterations):
Support __builtin_expect_with_probability for analysis
of # of loop iterations.

From-SVN: r273087

5 years agointroduce gcc_jit_context_new_bitfield
Andrea Corallo [Thu, 4 Jul 2019 15:46:00 +0000 (15:46 +0000)]
introduce gcc_jit_context_new_bitfield

gcc/jit/ChangeLog:
2019-07-04  Andrea Corallo <andrea.corallo@arm.com>

* docs/topics/compatibility.rst (LIBGCCJIT_ABI_12): New ABI tag.
* docs/topics/types.rst: Add gcc_jit_context_new_bitfield.
* jit-common.h (namespace recording): Add class bitfield.
* jit-playback.c:
(DECL_C_BIT_FIELD, SET_DECL_C_BIT_FIELD): Add macros.
(playback::context::new_bitfield): New method.
(playback::compound_type::set_fields): Add bitfield support.
(playback::lvalue::mark_addressable): Was jit_mark_addressable make this
a method of lvalue plus return a bool to communicate success.
(playback::lvalue::get_address): Check for jit_mark_addressable return
value.
* jit-playback.h (new_bitfield): New method.
(class bitfield): New class.
(class lvalue): Add jit_mark_addressable method.
* jit-recording.c (recording::context::new_bitfield): New method.
(recording::bitfield::replay_into): New method.
(recording::bitfield::write_to_dump): Likewise.
(recording::bitfield::make_debug_string): Likewise.
(recording::bitfield::write_reproducer): Likewise.
* jit-recording.h (class context): Add new_bitfield method.
(class field): Make it derivable by class bitfield.
(class bitfield): Add new class.
* libgccjit++.h (class context): Add new_bitfield method.
* libgccjit.c (struct gcc_jit_bitfield): New structure.
(gcc_jit_context_new_bitfield): New function.
* libgccjit.h
(LIBGCCJIT_HAVE_gcc_jit_context_new_bitfield) New macro.
(gcc_jit_context_new_bitfield): New function.
* libgccjit.map (LIBGCCJIT_ABI_12) New ABI tag.

gcc/testsuite/ChangeLog:
2019-07-04  Andrea Corallo <andrea.corallo@arm.com>

* jit.dg/all-non-failing-tests.h: Add test-accessing-bitfield.c.
* jit.dg/test-accessing-bitfield.c: New testcase.
* jit.dg/test-error-gcc_jit_context_new_bitfield-invalid-type.c:
Likewise.
* jit.dg/test-error-gcc_jit_context_new_bitfield-invalid-width.c:
Likewise.
* jit.dg/test-error-gcc_jit_lvalue_get_address-bitfield.c:
Likewise.

From-SVN: r273086

5 years agointroduce EH_ELSE_EXPR tree and gimplifier
Alexandre Oliva [Thu, 4 Jul 2019 15:00:00 +0000 (15:00 +0000)]
introduce EH_ELSE_EXPR tree and gimplifier

I found GIMPLE_EH_ELSE offered exactly the semantics I needed for some
Ada changes yet to be contributed, but GIMPLE_EH_ELSE was only built
by GIMPLE passes, and I needed to build earlier something that
eventually became GIMPLE_EH_ELSE.

This patch does that, introducing an EH_ELSE_EXPR tree, and logic to
dump it and to gimplify it.

for  gcc/ChangeLog

* doc/generic.texi (Cleanups): Document EH_ELSE_EXPR.
* except.c: Likewise.
* expr.c (expand_expr_real_1): Reject it.
* gimplify.c (gimplify_expr): Gimplify it, within
TRY_FINALLY_EXPR.
* tree-dump.c (dequeue_and_dump): Dump it.
* tree-pretty-print.c (dump_generic_node): Likewise.
* tree.c (block_may_fallthru): Handle it.
* tree.def (EH_ELSE_EXPR): Introduce it.
* gimple-pretty-print.c (dump_gimple_try): Dump TRY_FINALLY
with GIMPLE_EH_ELSE as try/finally/else.

From-SVN: r273084

5 years agore PR ipa/91062 (gcc.dg/ipa/ipa-pta-1.c dump contains garbage when gcc was configured...
Richard Biener [Thu, 4 Jul 2019 13:56:12 +0000 (13:56 +0000)]
re PR ipa/91062 (gcc.dg/ipa/ipa-pta-1.c dump contains garbage when gcc was configured with --enable-checking=all)

2019-07-04  Richard Biener  <rguenther@suse.de>

PR ipa/91062
* tree-pass.h (execute_all_ipa_transforms): Add a flag
parameter whether to disable GC collection.
* passes.c (execute_one_ipa_transform_pass): Likewise, and
honor it.
(execute_all_ipa_transforms): Likewise and pass it down.
* cgraph.c (cgraph_node::get_body): Do not invoke garbage
collection from applying IPA transforms.
* cgraphunit.c (cgraph_node::expand): Allow garbage collection
from applying IPA transforms.

From-SVN: r273083

5 years agore PR tree-optimization/90911 (456.hmmer regression with r272239)
Richard Biener [Thu, 4 Jul 2019 13:55:15 +0000 (13:55 +0000)]
re PR tree-optimization/90911 (456.hmmer regression with r272239)

2019-07-04  Richard Biener  <rguenther@suse.de>

PR tree-optimization/90911
* tree-vectorizer.h (_loop_vec_info::scalar_loop_scaling): New field.
(LOOP_VINFO_SCALAR_LOOP_SCALING): new.
* tree-vect-loop.c (_loop_vec_info::_loop_vec_info): Initialize
scalar_loop_scaling.
(vect_transform_loop): Scale scalar loop profile if needed.
* tree-vect-loop-manip.c (vect_loop_versioning): When re-using
the loop copy from if-conversion adjust edge probabilities
and scale the vectorized loop body profile, queue the scalar
profile for updating after peeling.

From-SVN: r273082

5 years agos-osinte__kfreebsd-gnu.ads (clockid_t): Make type definition public.
James Clarke [Thu, 4 Jul 2019 13:22:39 +0000 (13:22 +0000)]
s-osinte__kfreebsd-gnu.ads (clockid_t): Make type definition public.

2019-07-04  James Clarke <jrtc27@debian.org>

        * libgnarl/s-osinte__kfreebsd-gnu.ads (clockid_t): Make type
        definition public.
        (CLOCK_REALTIME): Make value public.

From-SVN: r273080

5 years agotree-ssa-alias.c (decl_refs_may_alias_p): Add size1 and size2 parameters; return...
Jan Hubicka [Thu, 4 Jul 2019 12:52:22 +0000 (14:52 +0200)]
tree-ssa-alias.c (decl_refs_may_alias_p): Add size1 and size2 parameters; return early for must-alias.

* tree-ssa-alias.c (decl_refs_may_alias_p): Add size1 and size2
parameters; return early for must-alias.
(indirect_ref_may_alias_decl_p): Likewise; when establishing
outer types match, try nonoverlapping_component_refs
if must-alias is not obvious.
(indirect_refs_may_alias_p): Likewise.
(refs_may_alias_p_2): Likewise.

* gcc.dg/tree-ssa/alias-access-path-3.c: New testcase.
* gcc.dg/tree-ssa/alias-access-path-8.c: New testcase.

From-SVN: r273079

5 years agoImprove OpenMP map diagnostics.
Andrew Stubbs [Thu, 4 Jul 2019 11:43:47 +0000 (11:43 +0000)]
Improve OpenMP map diagnostics.

2019-07-04  Andrew Stubbs  <ams@codesourcery.com>

gcc/cp/
* cp-tree.h (cp_omp_emit_unmappable_type_notes): New prototype.
* decl.c (cp_finish_decl): Call cp_omp_emit_unmappable_type_notes.
* decl2.c (cp_omp_mappable_type): Move contents to ...
(cp_omp_mappable_type_1):  ... here and add note output.
(cp_omp_emit_unmappable_type_notes): New function.
* semantics.c (finish_omp_clauses): Call
cp_omp_emit_unmappable_type_notes in four places.

gcc/testsuite/
* g++.dg/gomp/unmappable-1.C: New file.

From-SVN: r273078

5 years agoFix loading of lto_section on strict alignment targets (PR lto/91078).
Martin Liska [Thu, 4 Jul 2019 11:38:28 +0000 (13:38 +0200)]
Fix loading of lto_section on strict alignment targets (PR lto/91078).

2019-07-04  Martin Liska  <mliska@suse.cz>

PR lto/91078
* lto-common.c (lto_file_finalize): Use memcpy to set
file_data->lto_section_header.

From-SVN: r273077

5 years ago[Ada] Spurious error on non-default C++ constructor
Javier Miranda [Thu, 4 Jul 2019 08:07:24 +0000 (08:07 +0000)]
[Ada] Spurious error on non-default C++ constructor

The frontend reports spurious errors on C++ non-default constructors
that have formals whose type is an access to subprogram.

2019-07-04  Javier Miranda  <miranda@adacore.com>

gcc/ada/

* exp_tss.adb (Init_Proc): Adding missing support for access to
subprograms and access to protected subprograms of non-default
C++ constructors.

gcc/testsuite/

* gnat.dg/cpp_constructor.adb, gnat.dg/cpp_constructor_fp.ads,
gnat.dg/cpp_constructor_useit.ads: New testcase.

From-SVN: r273072

5 years ago[Ada] Clean up support for validity checks in the compiler
Eric Botcazou [Thu, 4 Jul 2019 08:07:19 +0000 (08:07 +0000)]
[Ada] Clean up support for validity checks in the compiler

This removes old code in the parser that serves no useful purpose and
fixes minor issues in the Validsw package.  No functional changes.

2019-07-04  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* gnat1drv.adb (Adjust_Global_Switches): Use proper interface to
set the validity settings in CodePeer mode.
* par-load.adb (Load): Remove all code dealing with validity
settings.
* validsw.ads (Validity_Check_Copies): Alphabetize.
* validsw.adb (Reset_Validity_Check_Options): Set all options to
off.
(Save_Validity_Check_Options): Save all options.

From-SVN: r273071

5 years ago[Ada] Minor reformatting
Hristian Kirtchev [Thu, 4 Jul 2019 08:07:14 +0000 (08:07 +0000)]
[Ada] Minor reformatting

2019-07-04  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* exp_ch3.adb, exp_ch4.adb, exp_ch4.ads, exp_ch5.adb,
exp_ch7.adb, exp_ch9.adb, exp_ch11.adb, exp_unst.adb,
rtsfind.ads, sem_attr.adb, sem_ch10.adb, sem_ch12.adb,
sem_ch13.adb, sem_dim.adb, sem_disp.adb, xref_lib.adb: Minor
reformatting.

From-SVN: r273070

5 years ago[Ada] Add preconditions in Ada.Task_Identification
Joffrey Huguet [Thu, 4 Jul 2019 08:07:09 +0000 (08:07 +0000)]
[Ada] Add preconditions in Ada.Task_Identification

This patch is needed to check for the Ada RM C.7.1(15) rule in SPARK.

2019-07-04  Joffrey Huguet  <huguet@adacore.com>

gcc/ada/

* libgnarl/a-taside.ads: Add assertion policy to ignore
preconditions.
(Abort_Task, Is_Terminated, Is_Callable): Add preconditions.

From-SVN: r273069

5 years ago[Ada] Fix capitalization and parenthesis glitches in GNAT RM
Eric Botcazou [Thu, 4 Jul 2019 08:07:04 +0000 (08:07 +0000)]
[Ada] Fix capitalization and parenthesis glitches in GNAT RM

2019-07-04  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* doc/gnat_rm/implementation_defined_pragmas.rst: Fix
capitalization and parenthesis glitches.
* gnat_rm.texi: Regenerate.

From-SVN: r273068

5 years ago[Ada] Spurious error on instantiation and limited_with_clause
Ed Schonberg [Thu, 4 Jul 2019 08:07:00 +0000 (08:07 +0000)]
[Ada] Spurious error on instantiation and limited_with_clause

This patch fixes a spurious error during the construction of an instance
body in the inlining phase of the frontend, when the package declaration
for the main unit has a limited_with_clause on some unit P, and the main
unit itself does not have a corresponding regular with_clause, but some
other unit in the context has with_clause that has compiled P.  P must
be removed from visibility to prevent conflicts with homonyms in the
generic body to be instantiated.

The following must compile quietly:

   gcc -c gpr2-project-view.adb

----
package GNATCOLL is
end GNATCOLL;
package GNATCOLL.Refcount is

   generic
      type Element_Type (<>) is private;
   package Shared_Pointers is
      type Ref is tagged private;

      type Element_Access is access all Element_Type;

      type Reference_Type (Element : access Element_Type)
         is limited null record;

      function Unchecked_Get (Self : Ref'Class) return Element_Access;

      function Get (Self : Ref'Class) return Reference_Type
         is ((Element => Unchecked_Get (Self)));
   private
      type Ref is tagged null record;
   end Shared_Pointers;

   type Refcounted is abstract tagged null record;

   generic
      type Encapsulated is abstract new Refcounted with private;
   package Smart_Pointers is
      type Encapsulated_Access is access all Encapsulated'Class;

      type Ref is tagged private;

      procedure Set (Self : in out Ref; Data : Encapsulated'Class);
      procedure Set (Self : in out Ref; Data : access Encapsulated'Class);
   private
      type Ref is tagged null record;
   end Smart_Pointers;

end GNATCOLL.Refcount;
----
package body GNATCOLL.Refcount is

   package body Shared_Pointers is

      function Unchecked_Get (Self : Ref'Class) return Element_Access is
      begin
         return null;
      end Unchecked_Get;

   end Shared_Pointers;

   package body Smart_Pointers is

      procedure Set (Self : in out Ref; Data : access Encapsulated'Class) is
      begin
         null;
      end Set;

      procedure Set (Self : in out Ref; Data : Encapsulated'Class) is
         Tmp : constant Encapsulated_Access := new Encapsulated'Class'(Data);
      begin
         Set (Self, Tmp);
      end Set;

   end Smart_Pointers;
end GNATCOLL.Refcount;
----
package GPR2 is
end GPR2;
----
package GPR2.Parser is
end GPR2.Parser;
----
with GPR_Parser.Analysis;
package GPR2.Parser.Project is
end GPR2.Parser.Project;
----
package GPR2.Project is
end GPR2.Project;
----
with GPR2.Parser.Project;
package GPR2.Project.Configuration is
end GPR2.Project.Configuration;
----
with GPR2.Project.Configuration;
with GPR2.Unit.Set;
package GPR2.Project.Definition is
end GPR2.Project.Definition;
----
limited with GPR2.Unit.Set;
package GPR2.Project.View is
   procedure Require_Body;
end GPR2.Project.View;
----
with GPR2.Project.Definition;
package body GPR2.Project.View is
   procedure Require_Body is null;
end GPR2.Project.View;
----
package GPR2.Unit is
end GPR2.Unit;

package GPR2.Unit.Set is
end GPR2.Unit.Set;
...
package GPR_Parser is
end GPR_Parser;
----
with GNATCOLL.Refcount;
package GPR_Parser.Analysis is

   type Unit_Provider_Interface is null record;

   package Unit_Provider_References is new GNATCOLL.Refcount.Shared_Pointers
     (Unit_Provider_Interface);

end GPR_Parser.Analysis;

2019-07-04  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_ch10.adb (Remove_Context_Clauses): Handle properly the
removal of a limited_with_clause which appears in the library
unit oF the main unit, when some other unit in the context has a
regular with_clause on the same unit, to prevent spurious
visibility errors in the subsequent analysis of pending instance
bodies.

From-SVN: r273067

5 years ago[Ada] Management of internal data structures in Sem_Elab
Hristian Kirtchev [Thu, 4 Jul 2019 08:06:54 +0000 (08:06 +0000)]
[Ada] Management of internal data structures in Sem_Elab

This patch modifies the timing of Sem_Elab's internal data structure
creation and destruction, and adds the concept of "active" elaboration
compiler phase.

The elaboration phase of the compiler is active after the frontend
initializes Sem_Elab. It is at this point that all internal data
structures of Sem_Elab are created and become ready to accept data.

The elaboration phase of the compiler is completed after all elaboration
scenarios are examined, all ABE checks are intalled, and diagnostics are
emitted. It is at this point that all internal data structures of
Sem_Elab are destroyed. Further attempts to reintroduce data into
Sem_Elab by subsequent compiler phases are cut off.

Compilation using GCC unaffected.

2019-07-04  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* sem_elab.adb: Add new type Elaboration_Phase_Status along with
a global to keep track of the elaboration phase status.
Initialize all internal data structures to Nil for services
Elaborated_Units, Internal_Representation, and Scenario_Storage.
(Build_Call_Marker): Do not create a call marker when the
elaboration phase is not active.
(Build_Variable_Reference_Marker): Do not create a call marker
when the elaboration phase is not active.
(Check_Elaboration_Scenarios): Destroy all internal structures
when the elaboration phase does not have to run. Do not execute
when the elaboration phase is not active.
(Elaboration_Phase_Active): New routine.
(Finalize_All_Data_Structures): New routine.
(Initialize): Initialize all internal data structures and signal
that the elaboration phase has started.
(Initialize_All_Data_Structures): New routine.
(Initialize_Elaborated_Units): Initialize all internal data
structures.
(Initialize_Internal_Representation): Initialize all internal
data structures.
(Initialize_Scenario_Storage): Initialize all internal data
structures.
(Kill_Elaboration_Scenario): Do not execute when the elaboration
phase is not active.
(Set_Elaboration_Phase): New routine.
(Update_Elaboration_Scenario): Do not execute when the
elaboration phase is not active.

From-SVN: r273066

5 years ago[Ada] Expr. func. with private formal rejected in nested Ghost package
Gary Dismukes [Thu, 4 Jul 2019 08:06:49 +0000 (08:06 +0000)]
[Ada] Expr. func. with private formal rejected in nested Ghost package

The compiler prematurely freezes a private type that is the type of a
formal parameter of an expression function declared within a nested,
inactivated Ghost package, resulting is an error complaining that the
private type must be fully defined at that point. This is fixed by
testing for Ignored_Ghost_Entity in the condition guarding the code that
performs Mask_Unfrozen_Types for an expression function without a
separate declaration, ensuring that the expression function's profile
isn't frozen prematurely.

2019-07-04  Gary Dismukes  <dismukes@adacore.com>

gcc/ada/

* sem_ch6.adb (Analyze_Subprogram_Body_Helper): The special
treatment of calling Mask_Unfrozen_Types must also be done in
the case of an Ignored_Ghost_Entity, because Expander_Active is
False in that case.

gcc/testsuite/

* gnat.dg/ghost5.adb, gnat.dg/ghost5.ads,
gnat.dg/ghost5_parent.ads: New testcase.

From-SVN: r273065

5 years ago[Ada] SPARK_Mode Off now allowed inside subprogram
Yannick Moy [Thu, 4 Jul 2019 08:06:45 +0000 (08:06 +0000)]
[Ada] SPARK_Mode Off now allowed inside subprogram

The rule on SPARK_Mode have been modified so that it is now possible to
have a subprogram or package declared with SPARK_Mode Off inside a
subprogram.

2019-07-04  Yannick Moy  <moy@adacore.com>

gcc/ada/

* sem_prag.adb (Check_Library_Level_Entity): Update for new rule
on SPARK_Mode.

gcc/testsuite/

* gnat.dg/spark3.adb: New testcase.

From-SVN: r273064

5 years ago[Ada] Spurious error on incomplete tagged formal parameter
Justin Squirek [Thu, 4 Jul 2019 08:06:40 +0000 (08:06 +0000)]
[Ada] Spurious error on incomplete tagged formal parameter

This patch fixes an issue whereby a check for competing controlling
formals led to a spurious dispatching error due to an incomplete type
being used within a subprogram specification.

2019-07-04  Justin Squirek  <squirek@adacore.com>

gcc/ada/

* sem_disp.adb (Check_Controlling_Formals): Obtain the full view
before type comparison.

gcc/testsuite/

* gnat.dg/tagged2.adb, gnat.dg/tagged2.ads: New testcase.

From-SVN: r273063

5 years ago[Ada] Bug in composition of equality for variant records
Ed Schonberg [Thu, 4 Jul 2019 08:06:35 +0000 (08:06 +0000)]
[Ada] Bug in composition of equality for variant records

This patch fixes an omission in the construction of equality routines
for variant records, to take into account user-defined equality
functions for components of the record. Previously the constructed
equality routine for variant records used the predefined equality for
all components, When composavility of equality was introduced for
untagged records, expansion of record equality was modified properly,
but not for the case of variant records, which use a different and more
complex process to build the equality function.

2019-07-04  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* exp_ch4.ads, exp_ch4.adb (Build_Eq_Call): New visible
subprogram, extracted from Expand_Composite_Equality, to handle
properly the composition of equality for variant record types.
* exp_ch3.adb (MAke_Eq_If): Use Build_Eq_Call for each
component, to handle properly the case of a component with a
user-defined equality. Revert to predefined equality if the
user-defined operation is abstract, to maintain compatibility
with older versions,

gcc/testsuite/

* gnat.dg/equal6.adb, gnat.dg/equal6_types.adb,
gnat.dg/equal6_types.ads: New testcase.

From-SVN: r273062

5 years ago[Ada] Missing actual for generated initialization procedure
Justin Squirek [Thu, 4 Jul 2019 08:06:30 +0000 (08:06 +0000)]
[Ada] Missing actual for generated initialization procedure

This patch fixes an issue whereby the use of an allocator with a
composite type containing null-excluding components may lead to a
compile time error due to incorrect code generation.

2019-07-04  Justin Squirek  <squirek@adacore.com>

gcc/ada/

* exp_ch3.adb (Build_Initialization_Call): Fixup
*_skip_null_excluding_check argument to handle new default.
(Init_Formals): Make *_skip_null_excluding_check formal default
to False
* exp_ch4.adb (Expand_N_Allocator): Add comment to note heavy
code duplication

gcc/testsuite/

* gnat.dg/allocator.adb: New testcase.

From-SVN: r273061

5 years ago[Ada] Do not create a master unless Tasking_Allowed
Bob Duff [Thu, 4 Jul 2019 08:06:25 +0000 (08:06 +0000)]
[Ada] Do not create a master unless Tasking_Allowed

2019-07-04  Bob Duff  <duff@adacore.com>

gcc/ada/

* sem_ch3.adb (Access_Definition): Do not create a master unless
Tasking_Allowed. Otherwise, this fails on restricted runtimes.

From-SVN: r273060

5 years ago[Ada] Assertion failure on Default_Initial_Condition
Hristian Kirtchev [Thu, 4 Jul 2019 08:06:19 +0000 (08:06 +0000)]
[Ada] Assertion failure on Default_Initial_Condition

This patch prevents the association of a Default_Initial_Condition with
an incomplete type whose full view is the private type or private
extension subject to the aspect/pragma.

2019-07-04  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* sem_util.adb (Propagate_DIC_Attributes): Do not propagate the
Default_Initial_Condition attributes to an incomplete type.

gcc/testsuite/

* gnat.dg/default_initial_condition.adb,
gnat.dg/default_initial_condition_pack.adb,
gnat.dg/default_initial_condition_pack.ads: New testcase.

From-SVN: r273059

5 years ago[Ada] Spurious error on 'First in a generic context
Ed Schonberg [Thu, 4 Jul 2019 08:06:14 +0000 (08:06 +0000)]
[Ada] Spurious error on 'First in a generic context

This patch fixes a spurious error on an attribute reference within an
aspect specification for an unconstrained array type when the
corresponding type  declaration appears within a generic unit.

2019-07-04  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_attr.adb (Check_Array_Type): An array type attribute such
as 'First can be applied to an unconstrained array tyope when
the attribute reference appears within an aspect specification
and the prefix is a current instance, given that the prefix of
the attribute will become a formal of the subprogram that
implements the aspect (typically a predicate check).

gcc/testsuite/

* gnat.dg/aspect2.adb, gnat.dg/aspect2.ads: New testcase.

From-SVN: r273058

5 years ago[Ada] Minor typo fixes
Piotr Trojanek [Thu, 4 Jul 2019 08:06:10 +0000 (08:06 +0000)]
[Ada] Minor typo fixes

2019-07-04  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* sem_util.adb (Yields_Synchronized_Object): Fix typos in
comments.

From-SVN: r273057

5 years ago[Ada] Synchronized object definition in SPARK updated
Yannick Moy [Thu, 4 Jul 2019 08:06:05 +0000 (08:06 +0000)]
[Ada] Synchronized object definition in SPARK updated

The definition of what types yield synchronized objected in SPARK has
been updated to see through the privacy boundary.

2019-07-04  Yannick Moy  <moy@adacore.com>

gcc/ada/

* sem_util.adb (Yields_Synchronized_Object): Adapt to new SPARK
rule.

gcc/testsuite/

* gnat.dg/synchronized2.adb, gnat.dg/synchronized2.ads,
gnat.dg/synchronized2_pkg.ads: New testcase.

From-SVN: r273056

5 years ago[Ada] Fix crash in SPARK ownership checking
Yannick Moy [Thu, 4 Jul 2019 08:06:00 +0000 (08:06 +0000)]
[Ada] Fix crash in SPARK ownership checking

Analysis could crash on extended return of a non-deep type, now fixed.
This has no impact on compilation.

2019-07-04  Yannick Moy  <moy@adacore.com>

gcc/ada/

* sem_spark.adb (Check_Statement): Only check permission of
object in extended return when it is of a deep type.

From-SVN: r273055

5 years ago[Ada] Hang on expansion of library-level instantiation
Justin Squirek [Thu, 4 Jul 2019 08:05:55 +0000 (08:05 +0000)]
[Ada] Hang on expansion of library-level instantiation

This patch fixes an issue whereby instantiation of a generic at the
library-level may cause a hang or crash during compilation due to
inappropriate expansion of generic actuals.

2019-07-04  Justin Squirek  <squirek@adacore.com>

gcc/ada/

* sem_ch12.adb (Perform_Appropriate_Analysis): Added for
selecting which type of analysis based on wheither the
instantiation is a generic at the library-level. In which case
expansion during analysis.
(Preanalyze_Actuals): Modify calls to Analyze to use the new
routine.

gcc/testsuite/

* gnat.dg/generic_inst4.adb, gnat.dg/generic_inst4_gen.ads,
gnat.dg/generic_inst4_inst.ads, gnat.dg/generic_inst4_typ.ads:
New testcase.

From-SVN: r273054

5 years ago[Ada] Unnesting: handle conditional expressions
Ed Schonberg [Thu, 4 Jul 2019 08:05:50 +0000 (08:05 +0000)]
[Ada] Unnesting: handle conditional expressions

2019-07-04  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* exp_unst.adb: Handle conditional expressions.

From-SVN: r273053

5 years ago[Ada] Skip code not in SPARK for ownership analysis
Yannick Moy [Thu, 4 Jul 2019 08:05:45 +0000 (08:05 +0000)]
[Ada] Skip code not in SPARK for ownership analysis

Ownership rules for pointer support should only apply to code marked in
SPARK. There is no impact on compilation.

2019-07-04  Yannick Moy  <moy@adacore.com>

gcc/ada/

* sem_spark.adb (Check_Package_Spec, Check_Package_Body): Only
analyze parts of the code marked in SPARK.

From-SVN: r273052

5 years ago[Ada] Minor reformatting
Hristian Kirtchev [Thu, 4 Jul 2019 08:05:40 +0000 (08:05 +0000)]
[Ada] Minor reformatting

2019-07-04  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* erroutc.adb, exp_aggr.adb, inline.adb, opt.adb, sem_ch3.adb:
Minor reformatting.

From-SVN: r273051

5 years ago[Ada] Better error messages for ownership errors in SPARK
Yannick Moy [Thu, 4 Jul 2019 08:05:36 +0000 (08:05 +0000)]
[Ada] Better error messages for ownership errors in SPARK

When SPARK code does not follow the ownership rules of SPARK RM 3.10,
the error message now points to a location explaining why the object has
a more restricted permission than the expected one.

There is no impact on compilation.

2019-07-04  Yannick Moy  <moy@adacore.com>

gcc/ada/

* sem_spark.adb (Explanation, Get_Expl): New functions to get
the explanation for a permission mismatch.
(Perm_Error, Perm_Mismatch, Perm_Error_Loop_Exit): Take
explanation into account for issuing a more precise error
message.
(Set_Perm_Prefixes, Set_Perm_Extensions,
Set_Perm_Extensions_Move): Pass suitable argument for the
explanation node.

From-SVN: r273050

5 years ago[Ada] CCG: reduce generated temporaries
Arnaud Charlet [Thu, 4 Jul 2019 08:05:31 +0000 (08:05 +0000)]
[Ada] CCG: reduce generated temporaries

2019-07-04  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

* exp_aggr.adb (In_Place_Assign_OK): Moved to top level and add
support for record aggregates.
(Component_Check): Use Is_CCG_Supported_Aggregate instead of a
similar local predicate.
(Convert_To_Assignments): Take advantage of In_Place_Assign_OK
predicate when possible.
(Is_CCG_Supported_Aggregate): Return False for records with
representation clauses and fix the logic for dealing with nested
aggregates.

From-SVN: r273049

5 years ago[Ada] Keep assertions in internal units enabled for GNATprove
Piotr Trojanek [Thu, 4 Jul 2019 08:05:27 +0000 (08:05 +0000)]
[Ada] Keep assertions in internal units enabled for GNATprove

In GNATprove mode the assertion policy is now always enabled, even when
analysing internal units. Otherwise, assertion expressions (e.g.
Default_Initial_Condition) in internal units (e.g. Ada.Text_IO)
disappear in the semantic analysis phase of the frontend and the
GNATprove backend can't see them.

No frontend test provided, because only the GNATprove backend is
affected (and there appear to be no difference in the output with -gnatG
switch, because the expansion of Default_Initial_Condition is not
attached to the AST).

2019-07-04  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* opt.adb (Set_Config_Switches): Keep assertions policy as
enabled when analysing internal units in GNATprove mode.

From-SVN: r273048

5 years ago[Ada] CCG: restrict folding for boolean tests
Arnaud Charlet [Thu, 4 Jul 2019 08:05:23 +0000 (08:05 +0000)]
[Ada] CCG: restrict folding for boolean tests

2019-07-04  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

* exp_ch4.adb (Expand_Short_Circuit_Operator): Strip
N_Variable_Reference_Marker when checking for the presence of
actions.

From-SVN: r273047

5 years ago[Ada] Reduce emitted code size in CCG for aggregate assignment
Arnaud Charlet [Thu, 4 Jul 2019 08:05:17 +0000 (08:05 +0000)]
[Ada] Reduce emitted code size in CCG for aggregate assignment

2019-07-04  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

* exp_aggr.adb (Check_Component): Take into account type
conversions.

From-SVN: r273046

5 years ago[Ada] GNAT.Sockets: fix socket timeout on recent Windows versions
Dmitriy Anisimkov [Thu, 4 Jul 2019 08:05:13 +0000 (08:05 +0000)]
[Ada] GNAT.Sockets: fix socket timeout on recent Windows versions

2019-07-04  Dmitriy Anisimkov  <anisimko@adacore.com>

gcc/ada/

* doc/gnat_ugn/platform_specific_information.rst: Document
Windows socket timeout particularity.
* gnat_ugn.texi: Regenerate.
* gsocket.h: Include versionhelpers.h.
* socket.c (__gnat_minus_500ms): New function.
* libgnat/g-sothco.ads (Minus_500ms_Windows_Timeout): New
imported function.
* libgnat/g-socket.adb (Set_Socket_Option): Refactor to remove
500ms from the requested timeout only on old Windows version.

From-SVN: r273045

5 years ago[Ada] Get_Scos: Remove bogus, dead code
Thomas Quinot [Thu, 4 Jul 2019 08:05:08 +0000 (08:05 +0000)]
[Ada] Get_Scos: Remove bogus, dead code

The nonsensical snippet was found by Codepeer. No behavior change.

2019-07-04  Thomas Quinot  <quinot@adacore.com>

gcc/ada/

* get_scos.adb: Remove bogus, dead code.

From-SVN: r273044

5 years ago[Ada] Spurious dimensionality error on aggregate with "others" assoc.
Ed Schonberg [Thu, 4 Jul 2019 08:05:03 +0000 (08:05 +0000)]
[Ada] Spurious dimensionality error on aggregate with "others" assoc.

This patch fixes a spurious dimensionality error on an array aggregate
with a single "others' clause whose expression is a dimensioned entity,
The expansion of the aggregate may create copies of the expression, and
the dimensionality check must use the type of the expression to retrieve
the proper dimension information to check against the dimensions of the
array component type.

2019-07-04  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_dim.adb (Analyze_Dimension_Array_Aggregate): If the
component is an entity name, its dimensions are those of its
type.

gcc/testsuite/

* gnat.dg/dimensions2.adb, gnat.dg/dimensions2_phys.ads,
gnat.dg/dimensions2_real_numbers.ads: New testcase.

From-SVN: r273043

5 years agotree-ssa-sccvn.h (vn_reference_lookup): Add last_vuse_ptr argument.
Richard Biener [Thu, 4 Jul 2019 07:35:12 +0000 (07:35 +0000)]
tree-ssa-sccvn.h (vn_reference_lookup): Add last_vuse_ptr argument.

2019-07-04  Richard Biener  <rguenther@suse.de>

* tree-ssa-sccvn.h (vn_reference_lookup): Add last_vuse_ptr
argument.
* tree-ssa-sccvn.c (last_vuse_ptr, vn_walk_kind): Move
globals into...
(struct vn_walk_cb_data): New callback data struct.
(vn_reference_lookup_2): Adjust.
(vn_reference_lookup_3): Likewise.
(vn_reference_lookup_pieces): Likewise.
(vn_reference_lookup): Likewise, get last_vuse_ptr argument.
(visit_reference_op_load): Adjust.

From-SVN: r273042

5 years agore PR tree-optimization/91063 (ICE in set_vinfo_for_stmt, at tree-vectorizer.c:676)
Jakub Jelinek [Thu, 4 Jul 2019 07:25:28 +0000 (09:25 +0200)]
re PR tree-optimization/91063 (ICE in set_vinfo_for_stmt, at tree-vectorizer.c:676)

PR tree-optimization/91063
* tree-vect-stmts.c (vect_init_vector): Call gsi_remove to remove
stmt from stmts sequence before calling vect_init_vector_1.
Formatting fix.

* gcc.dg/gomp/pr91063.c: New test.

From-SVN: r273041

5 years agore PR target/88833 ([SVE] Redundant moves for WHILELO-based loops)
Prathamesh Kulkarni [Thu, 4 Jul 2019 06:48:42 +0000 (06:48 +0000)]
re PR target/88833 ([SVE] Redundant moves for WHILELO-based loops)

2019-07-04  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

PR target/88833
* fwprop.c (reg_single_def_p): New function.
(propagate_rtx_1): Add unconditional else inside RTX_EXTRA case.
(forward_propagate_into): New parameter reg_prop_only
with default value false.
Propagate def's src into loop only if SET_SRC and SET_DEST
of def_set have single definitions.
Likewise if reg_prop_only is set to true.
(fwprop): New param fwprop_addr_p.
Integrate fwprop_addr into fwprop.
(fwprop_addr): Remove.
(pass_rtl_fwprop_addr::execute): Call fwprop with arg set
to true.
(pass_rtl_fwprop::execute): Call fwprop with arg set to false.
* simplify-rtx.c (simplify_subreg): Add case for vector comparison.
* config/i386/sse.md (UNSPEC_BLENDV): Adjust pattern.

testsuite/
* gfortran.dg/pr88833.f90: New test.

From-SVN: r273040

5 years agore PR tree-optimization/91069 (Miscompare of 453.povray since r272843)
Jakub Jelinek [Thu, 4 Jul 2019 05:10:52 +0000 (07:10 +0200)]
re PR tree-optimization/91069 (Miscompare of 453.povray since r272843)

PR middle-end/91069
* gcc.dg/pr91069.c (v2df): Use 2 * sizeof (double) instead of
hardcoded 16 for better portability.
(v2di): Change from long vector to long long vector.  Use
2 * sizeof (long long) instead of hardcoded 16.

From-SVN: r273039

5 years agoomp-low.c (lower_omp_scan): Call lower_omp on stmt's body in worksharing loop scans.
Jakub Jelinek [Thu, 4 Jul 2019 04:55:59 +0000 (06:55 +0200)]
omp-low.c (lower_omp_scan): Call lower_omp on stmt's body in worksharing loop scans.

* omp-low.c (lower_omp_scan): Call lower_omp on stmt's body
in worksharing loop scans.

From-SVN: r273038

5 years agore PR tree-optimization/91074 (c-c++-common/gomp/scan-3.c fails with ICE starting...
Jakub Jelinek [Thu, 4 Jul 2019 04:54:52 +0000 (06:54 +0200)]
re PR tree-optimization/91074 (c-c++-common/gomp/scan-3.c fails with ICE starting with r272958)

PR tree-optimization/91074
* omp-low.c (lower_omp_for_scan): Set DECL_GIMPLE_REG_P on cplx
temporary.

From-SVN: r273037

5 years agore PR rtl-optimization/90756 (g++ ICE in convert_move, at expr.c:218 on i686 and...
Jakub Jelinek [Thu, 4 Jul 2019 04:49:22 +0000 (06:49 +0200)]
re PR rtl-optimization/90756 (g++ ICE in convert_move, at expr.c:218 on i686 and s390x)

PR rtl-optimization/90756
* explow.c (promote_ssa_mode): Always use TYPE_MODE, don't bypass it
for VECTOR_TYPE_P.

* gcc.dg/pr90756.c: New test.

From-SVN: r273036

5 years agocompiler: optimize 0,1,2-case select statement
Ian Lance Taylor [Thu, 4 Jul 2019 02:20:37 +0000 (02:20 +0000)]
compiler: optimize 0,1,2-case select statement

    For a select statement with zero-, one-, or two-case with a
    default case, we can generate simpler code instead of calling the
    generic selectgo. A zero-case select is just blocking the
    execution. A one-case select is mostly just executing the case. A
    two-case select with a default case is a non-blocking send or
    receive. We add these special cases for lowering a select
    statement.

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/184998

From-SVN: r273034

5 years ago[MIPS][Testsuite] Specify msa-fmadd.c abis.
Chenghua Xu [Thu, 4 Jul 2019 01:54:02 +0000 (01:54 +0000)]
[MIPS][Testsuite] Specify msa-fmadd.c abis.

gcc/testsuite/

        * gcc.target/mips/mips-fmadd.c: Rename to ...
        * gcc.target/mips/mips-fmadd-o32.c: ... Here; add abi=32.
        * gcc.target/mips/mips-fmadd-n64.c: New.

From-SVN: r273033

5 years agocompiler: fix indentation of select statement AST dump
Ian Lance Taylor [Thu, 4 Jul 2019 01:48:57 +0000 (01:48 +0000)]
compiler: fix indentation of select statement AST dump

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/184997

From-SVN: r273032

5 years agoDaily bump.
GCC Administrator [Thu, 4 Jul 2019 00:16:21 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r273031

5 years agocompiler: set varargs lowered for imported call expressions
Ian Lance Taylor [Wed, 3 Jul 2019 22:27:51 +0000 (22:27 +0000)]
compiler: set varargs lowered for imported call expressions

    Fix compiler buglet: varargs lowering happens before inlinable
    function bodies are written out to export data, so set the "varargs
    lowered" flag on call expressions that we import.

    Fixes golang/go#32922

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/184919

From-SVN: r273026

5 years agoPR libstdc++/91067 fix missing exports for filesystem iterators
Jonathan Wakely [Wed, 3 Jul 2019 21:06:25 +0000 (22:06 +0100)]
PR libstdc++/91067 fix missing exports for filesystem iterators

The copy assignment operator for recursive_directory_iterator was not
exported despite being needed. The __shared_ptr default constructors are
not needed when compiling with GCC but Clang requires them for -O1.

PR libstdc++/91067
* acinclude.m4 (libtool_VERSION): Bump to 6:27:0.
* configure: Regenerate.
* config/abi/pre/gnu.ver (GLIBCXX_3.4.27): Add new version. Export
missing symbols.
* testsuite/27_io/filesystem/iterators/91067.cc: New test.
* testsuite/util/testsuite_abi.cc: Add new symbol version.

From-SVN: r273023

5 years ago[AArch64] Remove constraint strings from define_expand constructs
Dennis Zhang [Wed, 3 Jul 2019 19:52:04 +0000 (19:52 +0000)]
[AArch64] Remove constraint strings from define_expand constructs

A number of AArch64 define_expand patterns have specified constraints
for their operands. But the constraint strings are ignored at expand
time and are therefore redundant/useless. We now avoid specifying
constraints in new define_expands, but we should clean up the existing
define_expand definitions.

For example, the constraint "=w" is removed in the following case:
(define_expand "sqrt<mode>2"
    [(set (match_operand:GPF_F16 0 "register_operand" "=w")
The "" marks with an empty constraint in define_expand are removed as well.

2019-07-03  Dennis Zhang  <dennis.zhang@arm.com>

gcc/
* config/aarch64/aarch64.md: Remove redundant constraints from
define_expand but keep some patterns untouched if they are
specially selected by TARGET_SECONDARY_RELOAD hook.
* config/aarch64/aarch64-sve.md: Likewise.
* config/aarch64/atomics.md: Remove redundant constraints from
define_expand.
* config/aarch64/aarch64-simd.md: Likewise.

From-SVN: r273021

5 years ago[Darwin] Revise pie,no-pie and rdynamic driver specs.
Iain Sandoe [Wed, 3 Jul 2019 18:43:55 +0000 (18:43 +0000)]
[Darwin] Revise pie,no-pie and rdynamic driver specs.

Processing these early and pushing the corresponding Xlinker lines
has the effect that the driver then supposes that there are linker
inputs, and causes a link line to be created when it is not needed

The solution is to place these drive specs into the link spec and
claim them at the end of that.

2019-07-03  Iain Sandoe  <iain@sandoe.co.uk>

* config/darwin.h (DRIVER_SELF_SPECS): Remove the linker cases.
(RDYNAMIC): Rename to, DARWIN_RDYNAMIC.
(DARWIN_PIE_SPEC, DARWIN_NOPIE_SPEC): Adjust to remove the Xlinker
clauses.
(LINK_COMMAND_SPEC_A): Add DARWIN_RDYNAMIC, DARWIN_PIE_SPEC and
DARWIN_NOPIE_SPEC.

From-SVN: r273017

5 years ago[Darwin] Some TLC for older Darwin versions.
Iain Sandoe [Wed, 3 Jul 2019 18:36:28 +0000 (18:36 +0000)]
[Darwin] Some TLC for older Darwin versions.

The library handling and some of the options for creating the crts for
the older PPC Darwin versions had bit-rotted somewhat.  This adjusts the
build criteria for the crts to avoid newer ld64 versions warnings about
mismatches in build and object versions.

Added to some of the comments that it's documented why the specs are as
they are.

2019-07-03  Iain Sandoe  <iain@sandoe.co.uk>

gcc/

* config/darwin.h (REAL_LIBGCC_SPEC): Adjust for earlier Darwin.
(STARTFILE_SPEC): Split crt3 into a separate spec.
(DARWIN_EXTRA_SPECS): Add crt2 and crt3 spec.
(DARWIN_CRT2_SPEC): New.
(DARWIN_CRT3_SPEC): New.
(MIN_LD64_OMIT_STUBS): Revise to 62.1.
* config/rs6000/darwin.h (DARWIN_CRT2_SPEC): Revise conditions.
(DARWIN_CRT3_SPEC): New.

libgcc/

2019-07-03  Iain Sandoe  <iain@sandoe.co.uk>

* config.host (powerpc-*-darwin*,powerpc64-*-darwin*): Revise crt
list.
* config/rs6000/t-darwin: Build crt3_2 for older systems.  Revise
mmacosx-version-min for crts to run across all system versions.
* config/rs6000/t-darwin64 (LIB2ADD): Remove.
* config/t-darwin: Revise mmacosx-version-min for crts to run across
system versions >= 10.4.

From-SVN: r273016

5 years agoaltivec.md (altivec_mov<mode>, [...]): Change the RTL attribute "length" from "4...
Michael Meissner [Wed, 3 Jul 2019 17:42:09 +0000 (17:42 +0000)]
altivec.md (altivec_mov<mode>, [...]): Change the RTL attribute "length" from "4" to "*" to allow the length attribute...

2019-07-03  Michael Meissner  <meissner@linux.ibm.com>

* config/rs6000/altivec.md (altivec_mov<mode>, VM2 iterator):
Change the RTL attribute "length" from "4" to "*" to allow the
length attribute to be adjusted automatically for prefixed load,
store, and add immediate instructions.
* config/rs6000/rs6000.md (extendhi<mode>2, EXTHI iterator):
Likewise.
(extendsi<mode>2, EXTSI iterator): Likewise.
(movsi_internal1): Likewise.
(movsi_from_sf): Likewise.
(movdi_from_sf_zero_ext): Likewise.
(mov<mode>_internal): Likewise.
(movcc_internal1, QHI iterator): Likewise.
(mov<mode>_softfloat, FMOVE32 iterator): Likewise.
(movsf_from_si): Likewise.
(mov<mode>_hardfloat32, FMOVE64 iterator): Likewise.
(mov<mode>_softfloat64, FMOVE64 iterator): Likewise.
(mov<mode>, FMOVE128 iterator): Likewise.
(movdi_internal64): Likewise.
* config/rs6000/vsx.md (vsx_le_permute_<mode>, VSX_TI iterator):
Likewise.
(vsx_le_undo_permute_<mode>, VSX_TI iterator): Likewise.
(vsx_mov<mode>_64bit, VSX_M iterator): Likewise.
(vsx_mov<mode>_32bit, VSX_M iterator): Likewise.
(vsx_splat_v4sf): Likewise.

From-SVN: r273013

5 years agoFix store merging tests on Arm
Wilco Dijkstra [Wed, 3 Jul 2019 16:40:17 +0000 (16:40 +0000)]
Fix store merging tests on Arm

Fix the failing store merging test on Arm.  Aligning variables fixes a
few cases, otherwise disable the test on Arm.  All store merging tests
now pass.  Committed as obvious.

    testsuite/
* gcc.dg/store_merging_27.c: Fix test for Arm.
* gcc.dg/store_merging_28.c: Likewise.
* gcc.dg/store_merging_29.c: Likewise.
* gcc.dg/tree-ssa/dump-6.c: Likewise.

From-SVN: r273011

5 years agocompiler: include transitive imports in the type descriptor list
Ian Lance Taylor [Wed, 3 Jul 2019 13:23:39 +0000 (13:23 +0000)]
compiler: include transitive imports in the type descriptor list

    In CL 179598, we were using Gogo::packages_, when compiling the
    main package, as the list of packages of which we need to
    register the type descriptors. This is not complete. It only
    includes main's direct import and one-level indirect imports. It
    does not include all the packages transitively imported.

    To fix that, we need to track all the transitive imports. We
    have almost already done that, for init functions. However, there
    may be packages that don't need init functions but do need to
    register type descriptors. For them, we add a dummy init function
    to its export data. So when we compile the main package we will
    see all the transitive imports. The dummy init functions are not
    real functions and are not called.

    Fixes golang/go#32901.

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/184717

From-SVN: r273009

5 years agoPR debug/90981 Empty .debug_addr crashes -gdwarf-5 -gsplit-dwarf
Mark Wielaard [Wed, 3 Jul 2019 13:08:01 +0000 (13:08 +0000)]
PR debug/90981 Empty .debug_addr crashes -gdwarf-5 -gsplit-dwarf

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

5 years agore PR tree-optimization/91069 (Miscompare of 453.povray since r272843)
Richard Biener [Wed, 3 Jul 2019 12:47:07 +0000 (12:47 +0000)]
re PR tree-optimization/91069 (Miscompare of 453.povray since r272843)

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

5 years agoAdd dbgcnt for gimple_match and generic_match.
Martin Liska [Wed, 3 Jul 2019 12:43:44 +0000 (14:43 +0200)]
Add dbgcnt for gimple_match and generic_match.

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

5 years agoRename SINGE_VALUE to TOPN_VALUES counters.
Martin Liska [Wed, 3 Jul 2019 12:42:23 +0000 (14:42 +0200)]
Rename SINGE_VALUE to TOPN_VALUES counters.

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

5 years agoSupport N values in libgcov for single value counter type.
Martin Liska [Wed, 3 Jul 2019 12:42:02 +0000 (14:42 +0200)]
Support N values in libgcov for single value counter type.

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

5 years agodwarf2out.c (add_scalar_info): Add back refererence to existing DIE if it has the...
Eric Botcazou [Wed, 3 Jul 2019 11:58:49 +0000 (11:58 +0000)]
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

5 years agogimple-pretty-print.c (dump_ternary_rhs): Fix BIT_INSERT_EXPR dumping.
Richard Biener [Wed, 3 Jul 2019 11:01:01 +0000 (11:01 +0000)]
gimple-pretty-print.c (dump_ternary_rhs): Fix BIT_INSERT_EXPR dumping.

2019-07-03  Richard Biener  <rguenther@suse.de>

* gimple-pretty-print.c (dump_ternary_rhs): Fix BIT_INSERT_EXPR
dumping.

From-SVN: r273001

5 years ago[aarch64]: force frame pointer setup before tlsdesc call
Sylvia Taylor [Wed, 3 Jul 2019 10:57:28 +0000 (10:57 +0000)]
[aarch64]: force frame pointer setup before tlsdesc call

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

5 years agoFix ChangeLog date for last commit
Andrea Corallo [Wed, 3 Jul 2019 09:42:05 +0000 (09:42 +0000)]
Fix ChangeLog date for last commit

From-SVN: r272999

5 years agoAdd myself to MAINTAINERS
Andrea Corallo [Wed, 3 Jul 2019 09:09:26 +0000 (09:09 +0000)]
Add myself to MAINTAINERS

2019-07-02  Andrea Corallo  <andrea.corallo@arm.com>

* MAINTAINERS (Write After Approval): Add myself.

From-SVN: r272997

5 years agoAdd zstd support for LTO bytecode compression.
Martin Liska [Wed, 3 Jul 2019 08:36:54 +0000 (10:36 +0200)]
Add zstd support for LTO bytecode compression.

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

5 years agoAdd .gnu.lto_.lto section.
Martin Liska [Wed, 3 Jul 2019 08:36:35 +0000 (10:36 +0200)]
Add .gnu.lto_.lto section.

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

5 years agoRemove another bunch of dead assignment.
Martin Liska [Wed, 3 Jul 2019 08:34:20 +0000 (10:34 +0200)]
Remove another bunch of dead assignment.

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

5 years agoHandle '\0' in strcmp in RTL expansion (PR tree-optimization/90892).
Martin Liska [Wed, 3 Jul 2019 08:32:25 +0000 (10:32 +0200)]
Handle '\0' in strcmp in RTL expansion (PR tree-optimization/90892).

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

5 years agoAdd to same comdate group only if set (PR middle-end/90899)
Martin Liska [Wed, 3 Jul 2019 08:31:35 +0000 (10:31 +0200)]
Add to same comdate group only if set (PR middle-end/90899)

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

5 years agoFix use-after-scope in host-mingw32.c (PR target/88056).
Martin Liska [Wed, 3 Jul 2019 08:29:48 +0000 (10:29 +0200)]
Fix use-after-scope in host-mingw32.c (PR target/88056).

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

5 years agoAdd -fprofile-note option.
Martin Liska [Wed, 3 Jul 2019 08:29:08 +0000 (10:29 +0200)]
Add -fprofile-note option.

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

5 years agore PR tree-optimization/91033 (ICE in vect_analyze_loop, at tree-vect-loop.c:2416)
Jakub Jelinek [Wed, 3 Jul 2019 08:25:22 +0000 (10:25 +0200)]
re PR tree-optimization/91033 (ICE in vect_analyze_loop, at tree-vect-loop.c:2416)

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

5 years ago[Ada] Document new flags in GNATpp
Bob Duff [Wed, 3 Jul 2019 08:16:34 +0000 (08:16 +0000)]
[Ada] Document new flags in GNATpp

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

5 years ago[Ada] Forced elaboration order in Elaboration order v4.0
Hristian Kirtchev [Wed, 3 Jul 2019 08:16:29 +0000 (08:16 +0000)]
[Ada] Forced elaboration order in Elaboration order v4.0

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

5 years ago[Ada] Crash on anonymous access-to-class-wide with tasks
Bob Duff [Wed, 3 Jul 2019 08:16:24 +0000 (08:16 +0000)]
[Ada] Crash on anonymous access-to-class-wide with tasks

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

5 years ago[Ada] Suppress warnings in generic instantiations with pragma Warnings
Yannick Moy [Wed, 3 Jul 2019 08:16:20 +0000 (08:16 +0000)]
[Ada] Suppress warnings in generic instantiations with pragma Warnings

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