1. 04 Jul, 2019 40 commits
    • Fix arm XFAIL in cunroll-15.c · e2c3bbbf
      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
      Wilco Dijkstra committed
    • Support __builtin_expect_with_probability for analysis of # of loop iterations. · c80ab4a3
      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
      Martin Liska committed
    • introduce gcc_jit_context_new_bitfield · ee118c14
      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
      Andrea Corallo committed
    • introduce EH_ELSE_EXPR tree and gimplifier · ebebc928
      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
      Alexandre Oliva committed
    • re PR ipa/91062 (gcc.dg/ipa/ipa-pta-1.c dump contains garbage when gcc was… · e57c896e
      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
      Richard Biener committed
    • re PR tree-optimization/90911 (456.hmmer regression with r272239) · 5cee3239
      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
      Richard Biener committed
    • s-osinte__kfreebsd-gnu.ads (clockid_t): Make type definition public. · 5bb8f281
      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
      James Clarke committed
    • tree-ssa-alias.c (decl_refs_may_alias_p): Add size1 and size2 parameters; return… · f5fa046f
      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
      Jan Hubicka committed
    • Improve OpenMP map diagnostics. · 8862ed13
      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
      Andrew Stubbs committed
    • Fix loading of lto_section on strict alignment targets (PR lto/91078). · 70980ea2
      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
      Martin Liska committed
    • [Ada] Spurious error on non-default C++ constructor · 07c91770
      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
      Javier Miranda committed
    • [Ada] Clean up support for validity checks in the compiler · 7cbe60de
      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
      Eric Botcazou committed
    • [Ada] Minor reformatting · eedc5882
      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
      Hristian Kirtchev committed
    • [Ada] Add preconditions in Ada.Task_Identification · 38818659
      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
      Joffrey Huguet committed
    • [Ada] Fix capitalization and parenthesis glitches in GNAT RM · 2beb5444
      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
      Eric Botcazou committed
    • [Ada] Spurious error on instantiation and limited_with_clause · cb2ce45b
      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
      Ed Schonberg committed
    • [Ada] Management of internal data structures in Sem_Elab · 0839ffce
      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
      Hristian Kirtchev committed
    • [Ada] Expr. func. with private formal rejected in nested Ghost package · 901a52ba
      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
      Gary Dismukes committed
    • [Ada] SPARK_Mode Off now allowed inside subprogram · 3cc0fae4
      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
      Yannick Moy committed
    • [Ada] Spurious error on incomplete tagged formal parameter · e3a79ce3
      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
      Justin Squirek committed
    • [Ada] Bug in composition of equality for variant records · bdbb2a40
      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
      Ed Schonberg committed
    • [Ada] Missing actual for generated initialization procedure · fa528281
      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
      Justin Squirek committed
    • [Ada] Do not create a master unless Tasking_Allowed · b27f2c40
      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
      Bob Duff committed
    • [Ada] Assertion failure on Default_Initial_Condition · dd4d8a71
      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
      Hristian Kirtchev committed
    • [Ada] Spurious error on 'First in a generic context · 7cbdab5a
      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
      Ed Schonberg committed
    • [Ada] Minor typo fixes · 965a269d
      2019-07-04  Piotr Trojanek  <trojanek@adacore.com>
      
      gcc/ada/
      
      	* sem_util.adb (Yields_Synchronized_Object): Fix typos in
      	comments.
      
      From-SVN: r273057
      Piotr Trojanek committed
    • [Ada] Synchronized object definition in SPARK updated · 9193307b
      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
      Yannick Moy committed
    • [Ada] Fix crash in SPARK ownership checking · 194dc648
      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
      Yannick Moy committed
    • [Ada] Hang on expansion of library-level instantiation · 7273107b
      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
      Justin Squirek committed
    • [Ada] Unnesting: handle conditional expressions · c3c41b29
      2019-07-04  Ed Schonberg  <schonberg@adacore.com>
      
      gcc/ada/
      
      	* exp_unst.adb: Handle conditional expressions.
      
      From-SVN: r273053
      Ed Schonberg committed
    • [Ada] Skip code not in SPARK for ownership analysis · 3d53efa6
      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
      Yannick Moy committed
    • [Ada] Minor reformatting · bc1146e5
      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
      Hristian Kirtchev committed
    • [Ada] Better error messages for ownership errors in SPARK · b04fe972
      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
      Yannick Moy committed
    • [Ada] CCG: reduce generated temporaries · 4ff5aa0c
      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
      Arnaud Charlet committed
    • [Ada] Keep assertions in internal units enabled for GNATprove · d8be36d2
      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
      Piotr Trojanek committed
    • [Ada] CCG: restrict folding for boolean tests · a0766a82
      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
      Arnaud Charlet committed
    • [Ada] Reduce emitted code size in CCG for aggregate assignment · cd93d2d8
      2019-07-04  Arnaud Charlet  <charlet@adacore.com>
      
      gcc/ada/
      
      	* exp_aggr.adb (Check_Component): Take into account type
      	conversions.
      
      From-SVN: r273046
      Arnaud Charlet committed
    • [Ada] GNAT.Sockets: fix socket timeout on recent Windows versions · b7d5159e
      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
      Dmitriy Anisimkov committed
    • [Ada] Get_Scos: Remove bogus, dead code · 1708a783
      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
      Thomas Quinot committed
    • [Ada] Spurious dimensionality error on aggregate with "others" assoc. · dcd59a99
      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
      Ed Schonberg committed