1. 06 Sep, 2017 26 commits
    • [multiple changes] · a316b3fc
      2017-09-06  Gary Dismukes  <dismukes@adacore.com>
      
      	* exp_ch5.adb, s-diinio.ads, sem_ch4.adb, s-diflio.ads: Minor spelling
      	adjustments and a typo fix.
      
      2017-09-06  Yannick Moy  <moy@adacore.com>
      
      	* sem_res.adb (Resolve_Call): Do not issue info
      	message about inlining of calls to functions in assertions,
      	for functions whose body has not been seen yet.
      
      2017-09-06  Bob Duff  <duff@adacore.com>
      
      	* a-comlin.ads, a-comlin.adb (Argument): Simplify the code, now that
      	we can use modern Ada in this package.
      	* s-resfil.ads, s-resfil.adb, a-clrefi.ads, a-clrefi.adb:
      	Move Ada.Command_Line.Response_File to System.Response_File,
      	and make Ada.Command_Line.Response_File into a rename of
      	System.Response_File. This is to avoid having gnatbind depend
      	Ada.Command_Line, which would damage the bootstrap process now
      	that Ada.Command_Line contains modern Ada (the raise expression).
      	* gnatbind.adb: Avoid dependence on
      	Ada.Command_Line. Depend on System.Response_File instead
      	of Ada.Command_Line.Response_File. Change one call to
      	Ada.Command_Line.Command_Name to use Fill_Arg.	Change one call
      	to Ada.Command_Line.Argument_Count to use Arg_Count.
      	* gcc-interface/Make-lang.in, Makefile.rtl: Take note of the new files.
      
      From-SVN: r251775
      Arnaud Charlet committed
    • frontend.adb (Frontend): Skip -gnatec=gnat.adc switch, because we've already… · 9caf55e3
      frontend.adb (Frontend): Skip -gnatec=gnat.adc switch, because we've already read gnat.adc by default.
      
      2017-09-06  Bob Duff  <duff@adacore.com>
      
      	* frontend.adb (Frontend): Skip -gnatec=gnat.adc
      	switch, because we've already read gnat.adc by default.
      
      2017-09-06  Bob Duff  <duff@adacore.com>
      
      	* exp_ch5.adb (Get_Default_Iterator): Replace
      	"Assert(False)" with "return Iter", because if an iterable
      	type is derived from a noniterable one, then we won't find an
      	overriding or inherited default iterator.
      
      From-SVN: r251774
      Bob Duff committed
    • [multiple changes] · 6877306f
      2017-09-06  Yannick Moy  <moy@adacore.com>
      
      	* sem_warn.adb (Warn_On_Suspicious_Index): Improve warning when the
      	literal index used to access a string is null or negative.
      
      2017-09-06  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* einfo.adb (Status_Flag_Or_Transient_Decl): The attribute is now
      	allowed on loop parameters.
      	(Set_Status_Flag_Or_Transient_Decl): The attribute is now allowed
      	on loop parameters.
      	(Write_Field15_Name): Update the output for
      	Status_Flag_Or_Transient_Decl.
      	* einfo.ads: Attribute Status_Flag_Or_Transient_Decl now applies
      	to loop parameters. Update the documentation of the attribute
      	and the E_Loop_Parameter entity.
      	* exp_ch7.adb (Process_Declarations): Remove the bogus guard
      	which assumes that cursors can never be controlled.
      	* exp_util.adb (Requires_Cleanup_Actions): Remove the bogus
      	guard which assumes that cursors can never be controlled.
      
      From-SVN: r251773
      Arnaud Charlet committed
    • exp_attr.adb, [...]: Minor reformatting. · c99ab5f9
      2017-09-06  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* exp_attr.adb, sem_util.adb, sem_attr.adb, sem_ch6.adb, sem_ch8.adb,
      	sem_warn.adb: Minor reformatting.
      
      From-SVN: r251772
      Hristian Kirtchev committed
    • [multiple changes] · 3c0ae05d
      2017-09-06  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_warn.adb (Warn_On_Overlapping_Actuals): Refine previous
      	fix and preserve older GNAT warning on overlapping actuals that
      	are not elementary types.
      
      2017-09-06  Justin Squirek  <squirek@adacore.com>
      
      	* sem_attr.adb: Comment correction.
      
      From-SVN: r251771
      Arnaud Charlet committed
    • [multiple changes] · 62bb5423
      2017-09-06  Gary Dismukes  <dismukes@adacore.com>
      
      	* sem_util.adb: Minor reformatting.
      
      2017-09-06  Yannick Moy  <moy@adacore.com>
      
      	* a-comlin.ads (Argument): Add precondition for analysis.
      
      From-SVN: r251770
      Arnaud Charlet committed
    • Minor reformatting. · 95edbf5e
      From-SVN: r251769
      Arnaud Charlet committed
    • [multiple changes] · e9238cc1
      2017-09-06  Yannick Moy  <moy@adacore.com>
      
      	* sem_res.adb (Resolve): Update message for function call as statement.
      
      2017-09-06  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_ch6.adb (Check_Returns): Clean up warnings coming from
      	generated bodies for renamings that are completions, when renamed
      	procedure is No_Return.
      	* sem_ch8.adb (Analyze_Subprogram_Renaming): Implement legality
      	rule in 6.5.1 (7/2): if a renaming is a completion of a subprogram
      	with No_Return, the renamed entity must be No_Return as well.
      
      From-SVN: r251768
      Arnaud Charlet committed
    • [multiple changes] · a4f4dbdb
      2017-09-06  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* exp_ch5.adb, freeze.adb, exp_ch4.adb, exp_ch6.adb, lib-xref.adb:
      	Minor reformatting.
      
      2017-09-06  Justin Squirek  <squirek@adacore.com>
      
      	* exp_attr.adb (Expand_N_Attribute_Reference): Modified Image
      	attribute cases (Rewrite_Object_Reference_Image): Created to
      	aid the rewriting of new-style 'Image attributes.
      	* sem_attr.adb (Analyze_Attribute): Modified Image attribute cases
      	(Check_Object_Reference_Image): Created to handle verification of
      	'Image with object-references as prefixes.
      	* sem_util.ads, sem_util.adb (Is_Image_Applied_To_Object):
      	Create predicate to identify cases where an 'Image attribute's
      	prefix applies to an object reference.
      
      From-SVN: r251767
      Arnaud Charlet committed
    • freeze.adb (Freeze_Entity): Do not generate a freeze node for a generic unit... · 3e699954
      2017-09-06  Ed Schonberg  <schonberg@adacore.com>
      
      	* freeze.adb (Freeze_Entity): Do not generate a freeze
      	node for a generic unit, even if it includes delayed aspect
      	specifications. Freeze nodes for generic entities must never
      	appear in the tree that reaches the back-end of the compiler.
      
      From-SVN: r251766
      Ed Schonberg committed
    • [multiple changes] · 9fb1e654
      2017-09-06  Yannick Moy  <moy@adacore.com>
      
      	* treepr.adb (Print_Entity_Info): Do not print empty Elist.
      
      2017-09-06  Yannick Moy  <moy@adacore.com>
      
      	* inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Do not consider calls
      	to subprograms in other units as possibly inlined.
      
      2017-09-06  Ed Schonberg  <schonberg@adacore.com>
      
      	* freeze.adb (Freeze_Entity): For a derived type that has no
      	explicit delayed aspects but may inherit delayed aspects from its
      	parent type, analyze aspect at freeze point for proper capture
      	of an inherited aspect.
      
      2017-09-06  Arnaud Charlet  <charlet@adacore.com>
      
      	* lib-xref.adb (Get_Through_Renamings): Get through subprogram
      	renamings; also, avoid repeated calls to Renamed_Object when getting
      	through object renamings.
      
      2017-09-06  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_ch3.adb (Array_Type_Declaration): Handle properly an
      	array type declaration in a private part, when an index is a
      	subtype indication of a discrete type with a private partial view.
      
      2017-09-06  Javier Miranda  <miranda@adacore.com>
      
      	* exp_ch4.adb (Expand_Modular_Op): Force generating
      	temporary to improve the generated code.
      
      2017-09-06  Tristan Gingold  <gingold@adacore.com>
      
      	* s-fatgen.adb: Minor typo fix in comment.
      
      2017-09-06  Ed Schonberg  <schonberg@adacore.com>
      
      	* exp_ch5.adb (Make_Field_Assign): If the type
      	of the right-hand side has stored constraint, use its values
      	(except for those that are renamings of parent discriminants)
      	to produce additional assignments for the discriminants of the
      	left-hand side, which are invisible in the righ-hand side and
      	not retrievable as selected components.
      
      2017-09-06  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_util.adb (Needs_One_Formal): The first formal of such a
      	function must be a controlling formal, so that Obj.F (X, Y)
      	can have the interpretation F(Obj)(X, Y).
      	* sem_util.ads: Clarify documentation.
      
      2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
      
      	* table.ads, table.adb: Restore original implementation.
      	* namet.h (Names_Ptr): Adjust back.
      	(Name_Chars_Ptr): Likewise.
      	* uintp.h (Uints_Ptr): Likewise.
      	(Udigits_Ptr): Likewise.
      	* g-table.ads: Remove pragma Compiler_Unit_Warning.
      	* par_sco.adb: Do not with GNAT.Table and use Table consistently.
      	* scos.ads: Replace GNAT.Table with Table and adjust instantiations.
      	* spark_xrefs.ads: Likewise.
      	* scos.h: Undo latest changes.
      
      2017-09-06  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_ch12.adb (Analyze_Subprogram_Instantiation): Propagate
      	No_Return flag to instance if pragma applies to generic unit. This
      	must be done explicitly because the pragma does not appear
      	directly in the generic declaration (unlike the corresponding
      	aspect specification).
      
      From-SVN: r251765
      Arnaud Charlet committed
    • Fix typo. · 68ec1a49
      From-SVN: r251764
      Arnaud Charlet committed
    • [multiple changes] · 7c15c6dd
      2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
      
      	* sem_ch7.adb (Has_Referencer): Move up and expand comment
      	explaining the test used to detect inlining.  Use same test
      	in second occurrence.
      	(Analyze_Package_Body_Helper): Minor formatting fixes.
      
      2017-09-06  Ed Schonberg  <schonberg@adacore.com>
      
      	* exp_ch4.adb (Handle_Changed_Representation): For an untagged
      	derived type with a mixture of renamed and constrained parent
      	discriminants, the constraint for the target must obtain the
      	discriminant values from both the operand and from the stored
      	constraint for it, given that the constrained discriminants are
      	not visible in the object.
      	* exp_ch5.adb (Make_Field_Assign): The type of the right-hand
      	side may be derived from that of the left-hand side (as in the
      	case of an assignment with a change of representation) so the
      	discriminant to be used in the retrieval of the value of the
      	component must be the entity in the type of the right-hand side.
      
      From-SVN: r251763
      Arnaud Charlet committed
    • [multiple changes] · c23c86bb
      2017-09-06  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* sem_ch3.adb, sem_ch7.adb, sem_util.adb, g-debpoo.adb, sem_ch4.adb,
      	sem_ch6.adb, sem_ch8.adb: Minor reformatting.
      	* exp_util.adb (Is_Source_Object): Account for
      	the cases where the source object may appear as a dereference
      	or within a type conversion.
      	* exp_ch6.adb: Fix missing space in error message.
      
      2017-09-06  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_prag.adb: Update description of Eliminate.
      
      From-SVN: r251762
      Arnaud Charlet committed
    • [multiple changes] · 6376a3c6
      2017-09-06  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_attr.adb (Analyze_Attribute, case 'Loop_Entry): Handle
      	properly an attribute reference 'Loop_Entry that appears in the
      	list of indices of an indexed expression, to prevent an infinite
      	loop in the compiler.
      
      2017-09-06  Bob Duff  <duff@adacore.com>
      
      	* s-fileio.adb (Name): Do not raise Use_Error for temp files.
      
      2017-09-06  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_ch4.adb (Analyze_Set_Membership):  If an alternative
      	in a set membership is an overloaded enumeration literal, and
      	the type of the alternative is resolved from a previous one,
      	replace the entity of the alternative as well as the type,
      	to prevent inconsistencies between the entity and the type.
      
      From-SVN: r251761
      Arnaud Charlet committed
    • [multiple changes] · 8489c295
      2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
      
      	* ali.ads (ALIs_Record): Add No_Component_Reordering component.
      	(No_Component_Reordering_Specified): New switch.
      	* ali.adb (Initialize_ALI): Set No_Component_Reordering_Specified.
      	(Scan_ALI): Set No_Component_Reordering and deal with NC marker.
      	* bcheck.adb (Check_Consistent_No_Component_Reordering):
      	New check.
      	(Check_Configuration_Consistency): Invoke it.
      	* debug.adb (d.r): Toggle the effect of the switch.
      	(d.v): Change to no-op.
      	* einfo.ads (Has_Complex_Representation):
      	Restrict to record types.
      	(No_Reordering): New alias for Flag239.
      	(OK_To_Reorder_Components): Delete.
      	(No_Reordering): Declare.
      	(Set_No_Reordering): Likewise.
      	(OK_To_Reorder_Components): Delete.
      	(Set_OK_To_Reorder_Components): Likewise.
      	* einfo.adb (Has_Complex_Representation): Expect record types.
      	(No_Reordering): New function.
      	(OK_To_Reorder_Components): Delete.
      	(Set_Has_Complex_Representation): Expect base record types.
      	(Set_No_Reordering): New procedure.
      	(Set_OK_To_Reorder_Components): Delete.
      	(Write_Entity_Flags): Adjust to above change.
      	* fe.h (Debug_Flag_Dot_R): New macro and declaration.
      	* freeze.adb (Freeze_Record_Type): Remove conditional code setting
      	OK_To_Reorder_Components on record types with convention Ada.
      	* lib-writ.adb (Write_ALI): Deal with NC marker.
      	* opt.ads (No_Component_Reordering): New flag.
      	(No_Component_Reordering_Config): Likewise.
      	(Config_Switches_Type): Add No_Component_Reordering component.
      	* opt.adb (Register_Opt_Config_Switches): Copy
      	No_Component_Reordering onto No_Component_Reordering_Config.
      	(Restore_Opt_Config_Switches): Restore No_Component_Reordering.
      	(Save_Opt_Config_Switches): Save No_Component_Reordering.
      	(Set_Opt_Config_Switches): Set No_Component_Reordering.
      	* par-prag.adb (Prag): Deal with Pragma_No_Component_Reordering.
      	* sem_ch3.adb (Analyze_Private_Extension_Declaration): Also set the
      	No_Reordering flag from the default.
      	(Build_Derived_Private_Type): Likewise.
      	(Build_Derived_Record_Type): Likewise.	Then inherit it
      	for untagged types and clean up handling of similar flags.
      	(Record_Type_Declaration): Likewise.
      	* sem_ch13.adb (Same_Representation): Deal with No_Reordering and
      	remove redundant test on Is_Tagged_Type.
      	* sem_prag.adb (Analyze_Pragma): Handle No_Component_Reordering.
      	(Sig_Flags): Likewise.
      	* snames.ads-tmpl (Name_No_Component_Reordering): New name.
      	(Pragma_Id): Add Pragma_No_Component_Reordering value.
      	* warnsw.adb (Set_GNAT_Mode_Warnings): Enable -gnatw.q as well.
      	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>:
      	Copy the layout of the parent type only if the No_Reordering
      	settings match.
      	(components_to_record): Reorder record types with
      	convention Ada by default unless No_Reordering is set or -gnatd.r
      	is specified and do not warn if No_Reordering is set in GNAT mode.
      
      2017-09-06  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_util.ads, sem_util.adb (Check_Previous_Null_Procedure):
      	new predicate to reject declarations that can be completions,
      	when there is a visible prior homograph that is a null procedure.
      	* sem_ch6.adb (Analyze_Null_Procedure): use it.
      	* sem_ch8.adb (Analyze_Subprogram_Renaming): ditto.
      
      2017-09-06  Thomas Quinot  <quinot@adacore.com>
      
      	* s-regpat.adb (Compile.Parse_Literal): Fix handling of literal
      	run of 253 characters or more.
      
      From-SVN: r251760
      Arnaud Charlet committed
    • [multiple changes] · dd89dddf
      2017-09-06  Ed Schonberg  <schonberg@adacore.com>
      
      	* einfo.adb (Designated_Type): Use Is_Incomplete_Type to handle
      	properly incomplete subtypes that may be created by explicit or
      	implicit declarations.
      	(Is_Base_Type): Take E_Incomplete_Subtype into account.
      	(Subtype_Kind): Ditto.
      	* sem_ch3.adb (Build_Discriminated_Subtype): Set properly the
      	Ekind of a subtype of a discriminated incomplete type.
      	(Fixup_Bad_Constraint): Use Subtype_Kind in all cases, including
      	incomplete types, to preserve error reporting.
      	(Process_Incomplete_Dependents): Do not create a subtype
      	declaration for an incomplete subtype that is created internally.
      	* sem_ch7.adb (Analyze_Package_Specification): Handle properly
      	incomplete subtypes that do not require a completion, either
      	because they are limited views, of they are generic actuals.
      
      2017-09-06  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* checks.adb (Insert_Valid_Check): Remove the
      	suspicious manipulation of the Do_Range_Check flag as ths is
      	no linger needed. Suppress validity check when analysing the
      	validation variable.
      
      2017-09-06  Philippe Gil  <gil@adacore.com>
      
      	* g-debpoo.adb: adapt GNAT.Debug_Pools to allow safe thread
      	GNATCOLL.Memory
      
      2017-09-06  Bob Duff  <duff@adacore.com>
      
      	* sem_elim.adb: Minor comment fix.
      
      2017-09-06  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_util.adb (Is_Object_Reference): A function call is an
      	object reference, and thus attribute references for attributes
      	that are functions (such as Pred and Succ) as well as predefined
      	operators are legal in contexts that require an object, such as
      	the prefix of attribute Img and the Ada2020 version of 'Image.
      
      From-SVN: r251759
      Arnaud Charlet committed
    • exp_util.adb, [...]: Minor reformatting. · 3e720c96
      2017-09-06  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* exp_util.adb, einfo.adb, sem_attr.adb, exp_ch4.adb, gnatls.adb,
      	exp_ch3.adb, xoscons.adb: Minor reformatting.
      
      From-SVN: r251758
      Hristian Kirtchev committed
    • [multiple changes] · f8159014
      2017-09-06  Raphael Amiard  <amiard@adacore.com>
      
      	* a-chtgop.ads, a-chtgop.adb: Add versions of First and Next with
      	Position parameter. If supplied, use it to provide efficient iteration.
      	* a-cohase.ads, a-cohase.adb, a-cihama.ads, a-cihama.adb,
      	a-cohama.ads, a-cohama.adb: Add/Use Position to provide efficient
      	iteration.
      
      2017-09-06  Ed Schonberg  <schonberg@adacore.com>
      
      	* exp_util.adb (Build_Allocate_Deallocate_Proc): If the
      	designated type is class-wide and the expression is an unchecked
      	conversion, preserve the conversion when checking the tag of the
      	designated object, to prevent spurious semantic errors when the
      	expression in the conversion has an untagged type (for example
      	an address attribute).
      
      From-SVN: r251757
      Arnaud Charlet committed
    • Enqueue all SRA links for write flag propagation · e9982c6a
      2017-09-06  Martin Jambor  <mjambor@suse.cz>
      
      	PR tree-optimization/82078
      gcc/
      	* tree-sra.c (sort_and_splice_var_accesses): Move call to
      	add_access_to_work_queue...
      	(build_accesses_from_assign): ...here.
      	(propagate_all_subaccesses): Make sure racc is the group
      	representative, if there is one.
      
      gcc/testsuite/
      	* gcc.dg/tree-ssa/pr82078.c: New test.
      
      From-SVN: r251756
      Martin Jambor committed
    • [multiple changes] · c7a494c9
      2017-09-06  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_res.adb (Resolve_Entry_Call): Check whether a protected
      	operation is subject to a pragma Eliminate.
      
      2017-09-06  Ed Schonberg  <schonberg@adacore.com>
      
      	* sem_elim.ads, exp_ch4.adb: Minor reformatting.
      
      2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
      
      	* fe.h (Eliminate_Error_Msg): Remove.
      
      From-SVN: r251755
      Arnaud Charlet committed
    • re PR middle-end/82095 (ICE in tree_nop_conversion at tree.c:11793 on ppc64le) · 3581d5db
      	PR middle-end/82095
      	* varasm.c (categorize_decl_for_section): Use SECCAT_TBSS for TLS vars with
      	NULL DECL_INITIAL.
      
      	* gcc.dg/tls/pr82095.c: New test.
      
      From-SVN: r251754
      Jakub Jelinek committed
    • 2017-09-06 Richard Biener <rguenther@suse.de> · 58565a2e
      	* gimple-ssa-strength-reduction.c
      	(find_candidates_dom_walker::before_doom_children): Use a
      	type and not a mode check.
      
      From-SVN: r251753
      Richard Biener committed
    • re PR target/77308 (surprisingly large stack usage for sha512 on arm) · fb117b1c
      2017-09-06  Bernd Edlinger  <bernd.edlinger@hotmail.de>
      
              PR target/77308
              * config/arm/predicates.md (arm_general_adddi_operand): Create new
              non-vfp predicate.
              * config/arm/arm.md (*arm_adddi3, *arm_subdi3): Use new predicates.
      
      From-SVN: r251752
      Bernd Edlinger committed
    • re PR tree-optimization/64910 (tree reassociation results in poor code) · 5aa102aa
      	PR tree-optimization/64910
      	* tree-ssa-reassoc.c (reassociate_bb): Restrict last change to
      	cases where we have 3 or more operands.
      
      From-SVN: r251751
      Jeff Law committed
    • Daily bump. · 1d441507
      From-SVN: r251750
      GCC Administrator committed
  2. 05 Sep, 2017 14 commits
    • re PR middle-end/81768 (error: control flow in the middle of basic block) · 0fe4bc78
      	PR middle-end/81768
      	* omp-low.c (lower_omp_for): Recompute tree invariant if
      	gimple_omp_for_initial/final is ADDR_EXPR.
      
      	* gcc.dg/gomp/pr81768-2.c: New test.
      
      From-SVN: r251742
      Jakub Jelinek committed
    • re PR middle-end/81768 (error: control flow in the middle of basic block) · bcc6842b
      	PR middle-end/81768
      	* omp-expand.c (expand_omp_simd): Force second operands of COND_EXPR
      	into gimple val before gimplification fo the COND_EXPR.
      
      	* gcc.dg/gomp/pr81768-1.c: New test.
      
      From-SVN: r251741
      Jakub Jelinek committed
    • tree-ssa-threadupdate.c (duplicate_thread_path): Remove unused REGION_COPY argument. · 3d178f0c
      	* tree-ssa-threadupdate.c (duplicate_thread_path): Remove unused
      	REGION_COPY argument.
      	(thread_through_all_blocks): Remove unused argument to
      	duplicate_thread_path.
      
      From-SVN: r251740
      Aldy Hernandez committed
    • name-lookup.c (do_class_using_decl): Elide read-once temps. · 0c29f2a2
      	* name-lookup.c (do_class_using_decl): Elide read-once temps.
      	Move declarations to initializations.
      
      From-SVN: r251738
      Nathan Sidwell committed
    • class.c (add_method): Move slot search and insertion to ... · fcaf3065
      	* class.c (add_method): Move slot search and insertion to ...
      	* name-lookup.c (get_method_slot): ... this new function.
      	(lookup_fnfields_slot_nolazy): Cope with NULL slot.
      	* name-lookup.h (get_method_slot): Declare.
      	* decl.c (cxx_init_decl_processinng): Give conv_op_marker a more
      	realistic type.
      	(grok_special_member_properties): Set
      	TYPE_HAS_CONVERSION. Expicitly look at DECL_NAME for specialness.
      	Improve TYPE_HAS_CONSTEXPR_CTOR setting.
      
      From-SVN: r251737
      Nathan Sidwell committed
    • [75/77] Use scalar_mode in the AArch64 port · 146c2e3a
      Similar to the previous scalar_int_mode patch.
      
      2017-09-05  Richard Sandiford  <richard.sandiford@linaro.org>
      	    Alan Hayward  <alan.hayward@arm.com>
      	    David Sherwood  <david.sherwood@arm.com>
      
      gcc/
      	* config/aarch64/aarch64-protos.h (aarch64_gen_adjusted_ldpstp):
      	Take a scalar_mode rather than a machine_mode.
      	(aarch64_operands_adjust_ok_for_ldpstp): Likewise.
      	* config/aarch64/aarch64.c (aarch64_simd_container_mode): Likewise.
      	(aarch64_operands_adjust_ok_for_ldpstp): Likewise.
      	(aarch64_gen_adjusted_ldpstp): Likewise.
      	(aarch64_expand_vector_init): Use scalar_mode instead of machine_mode.
      
      Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
      Co-Authored-By: David Sherwood <david.sherwood@arm.com>
      
      From-SVN: r251736
      Richard Sandiford committed
    • [61/77] Use scalar_int_mode in the AArch64 port · 77e994c9
      This patch makes the AArch64 port use scalar_int_mode in various places.
      Other ports won't need this kind of change; we only need it for AArch64
      because of the variable-sized SVE modes.
      
      The only change in functionality is in the rtx_costs handling
      of CONST_INT.  If the caller doesn't supply a mode, we now pass
      word_mode rather than VOIDmode to aarch64_internal_mov_immediate.
      aarch64_movw_imm will therefore not now truncate large constants
      in this situation.
      
      2017-09-05  Richard Sandiford  <richard.sandiford@linaro.org>
      	    Alan Hayward  <alan.hayward@arm.com>
      	    David Sherwood  <david.sherwood@arm.com>
      
      gcc/
      	* config/aarch64/aarch64-protos.h (aarch64_is_extend_from_extract):
      	Take a scalar_int_mode instead of a machine_mode.
      	(aarch64_mask_and_shift_for_ubfiz_p): Likewise.
      	(aarch64_output_scalar_simd_mov_immediate): Likewise.
      	(aarch64_simd_scalar_immediate_valid_for_move): Likewise.
      	(aarch64_simd_attr_length_rglist): Delete.
      	* config/aarch64/aarch64.c (aarch64_is_extend_from_extract): Take
      	a scalar_int_mode instead of a machine_mode.
      	(aarch64_add_offset): Likewise.
      	(aarch64_internal_mov_immediate): Likewise
      	(aarch64_add_constant_internal): Likewise.
      	(aarch64_add_constant): Likewise.
      	(aarch64_movw_imm): Likewise.
      	(aarch64_rtx_arith_op_extract_p): Likewise.
      	(aarch64_mask_and_shift_for_ubfiz_p): Likewise.
      	(aarch64_simd_scalar_immediate_valid_for_move): Likewise.
      	Remove assert that the mode isn't a vector.
      	(aarch64_output_scalar_simd_mov_immediate): Likewise.
      	(aarch64_expand_mov_immediate): Update calls after above changes.
      	(aarch64_output_casesi): Use as_a <scalar_int_mode>.
      	(aarch64_and_bitmask_imm): Check for scalar integer modes.
      	(aarch64_move_imm): Likewise.
      	(aarch64_can_const_movi_rtx_p): Likewise.
      	(aarch64_strip_extend): Likewise.
      	(aarch64_extr_rtx_p): Likewise.
      	(aarch64_rtx_costs): Likewise, using wode_mode as the mode of
      	a CONST_INT when the mode parameter is VOIDmode.
      	(aarch64_float_const_rtx_p): Use scalar_int_mode for a temporary.
      
      Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
      Co-Authored-By: David Sherwood <david.sherwood@arm.com>
      
      From-SVN: r251735
      Richard Sandiford committed
    • cp-tree.h (lang_decl_base): Rename template_conv_p to unknown_bound_p. · 40300fa4
      	* cp-tree.h (lang_decl_base): Rename template_conv_p to
      	unknown_bound_p.
      	(DECL_CONV_FN_P): Don't check NULL DECL_NAME.
      	(DECL_CONV_FN_TYPE): FN must be conv op.
      	(DECL_TEMPLATE_CONV_FN_P): Delete.
      	(VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): Adjust.
      	* pt.c (push_template_decl_real): Delete DECL_TEMPLATE_CONV_FN_P
      
      From-SVN: r251734
      Nathan Sidwell committed
    • Make bitsize_mode_for_mode return an opt_mode · 6657c1f9
      2017-09-05  Richard Sandiford  <richard.sandiford@linaro.org>
      
      gcc/
      	* machmode.h (bitwise_mode_for_mode): Return opt_mode.
      	* stor-layout.c (bitwise_mode_for_mode): Likewise.
      	(bitwise_type_for_mode): Update accordingly.
      
      From-SVN: r251733
      Richard Sandiford committed
    • Make mode_for_size_tree return an opt_mode · 798014c5
      ...for consistency with mode_for_size
      
      2017-09-05  Richard Sandiford  <richard.sandiford@linaro.org>
      
      gcc/
      	* stor-layout.h (mode_for_size_tree): Return an opt_mode.
      	* stor-layout.c (mode_for_size_tree): Likewise.
      	(mode_for_array): Update accordingly.
      	(layout_decl): Likewise.
      	(compute_record_mode): Likewise.  Only set the mode once.
      
      gcc/ada/
      	* gcc-interface/utils.c (make_packable_type): Update call to
      	mode_for_size_tree.
      
      From-SVN: r251732
      Richard Sandiford committed
    • Make targetm.get_mask_mode return an opt_mode · 3981fbb6
      ...for consistency with mode_for_vector.
      
      2017-09-05  Richard Sandiford  <richard.sandiford@linaro.org>
      
      gcc/
      	* target.def (get_mask_mode): Change return type to opt_mode.
      	Expand commentary.
      	* doc/tm.texi: Regenerate.
      	* targhooks.h (default_get_mask_mode): Return an opt_mode.
      	* targhooks.c (default_get_mask_mode): Likewise.
      	* config/i386/i386.c (ix86_get_mask_mode): Likewise.
      	* optabs-query.c (can_vec_mask_load_store_p): Update use of
      	targetm.get_mask_mode.
      	* tree.c (build_truth_vector_type): Likewise.
      
      From-SVN: r251731
      Richard Sandiford committed
    • Make mode_for_vector return an opt_mode · 9da15d40
      ...following on from the mode_for_size change.  The patch also removes
      machmode.h versions of the stor-layout.c comments, since the comments
      in the .c file are more complete.
      
      2017-09-05  Richard Sandiford  <richard.sandiford@linaro.org>
      
      gcc/
      	* machmode.h (mode_for_vector): Return an opt_mode.
      	* stor-layout.c (mode_for_vector): Likewise.
      	(mode_for_int_vector): Update accordingly.
      	(layout_type): Likewise.
      	* config/i386/i386.c (emit_memmov): Likewise.
      	(ix86_expand_set_or_movmem): Likewise.
      	(ix86_expand_vector_init): Likewise.
      	(ix86_get_mask_mode): Likewise.
      	* config/powerpcspe/powerpcspe.c (rs6000_expand_vec_perm_const_1):
      	Likewise.
      	* config/rs6000/rs6000.c (rs6000_expand_vec_perm_const_1): Likewise.
      	* expmed.c (extract_bit_field_1): Likewise.
      	* expr.c (expand_expr_real_2): Likewise.
      	* optabs-query.c (can_vec_perm_p): Likewise.
      	(can_vec_mask_load_store_p): Likewise.
      	* optabs.c (expand_vec_perm): Likewise.
      	* targhooks.c (default_get_mask_mode): Likewise.
      	* tree-vect-stmts.c (vectorizable_store): Likewise.
      	(vectorizable_load): Likewise.
      	(get_vectype_for_scalar_type_and_size): Likewise.
      
      From-SVN: r251730
      Richard Sandiford committed
    • Add mode_for_int_vector helper functions · ddc203a7
      There are at least a few places that want to create an integer vector
      with a specified element size and element count, or to create the
      integer equivalent of an existing mode.  This patch adds helpers
      for doing that.
      
      The require ()s are all used in functions that go on to emit
      instructions that use the result as a vector mode.
      
      2017-09-05  Richard Sandiford  <richard.sandiford@linaro.org>
      
      gcc/
      	* machmode.h (mode_for_int_vector): New function.
      	* stor-layout.c (mode_for_int_vector): Likewise.
      	* config/aarch64/aarch64.c (aarch64_emit_approx_sqrt): Use it.
      	* config/powerpcspe/powerpcspe.c (rs6000_do_expand_vec_perm): Likewise.
      	* config/rs6000/rs6000.c (rs6000_do_expand_vec_perm): Likewise.
      	* config/s390/s390.c (s390_expand_vec_compare_cc): Likewise.
      	(s390_expand_vcond): Likewise.
      
      From-SVN: r251729
      Richard Sandiford committed
    • Make mode_for_size return an opt_mode · 61b2290a
      ...to make it consistent with int_mode_for_size etc.
      
      require () seems like the right choice in replace_reg_with_saved_mem
      because we use the chosen mode for saving and restoring registers,
      which cannot be done in BLKmode.  Similarly require () seems like
      the right choice in calls related to secondary memory reloads (the ones
      in config/, and in get_secondary_mem) because the reload must always
      have a defined mode, which e.g. determines the size of the slot.
      
      We can use require () in simplify_subreg_concatn and assemble_integer
      because it isn't meaningful to create a subreg with BLKmode (for one
      thing, we couldn't tell then whether it was partial, paradoxical, etc.).
      
      make_fract_type and make_accum_type must find a mode because that's
      what distinguishes accumulator FIXED_POINT_TYPEs from fractional
      FIXED_POINT_TYPEs.
      
      2017-09-05  Richard Sandiford  <richard.sandiford@linaro.org>
      
      gcc/
      	* machmode.h (opt_machine_mode): New type.
      	(opt_mode<T>): Allow construction from anything that can be
      	converted to a T.
      	(is_a, as_a, dyn_cast): Add overloads for opt_mode.
      	(mode_for_size): Return an opt_machine_mode.
      	* stor-layout.c (mode_for_size): Likewise.
      	(mode_for_size_tree): Update call accordingly.
      	(bitwise_mode_for_mode): Likewise.
      	(make_fract_type): Likewise.
      	(make_accum_type): Likewise.
      	* caller-save.c (replace_reg_with_saved_mem): Update call
      	accordingly.
      	* config/alpha/alpha.h (SECONDARY_MEMORY_NEEDED_MODE): Likewise.
      	* config/i386/i386.h (SECONDARY_MEMORY_NEEDED_MODE): Likewise.
      	* config/s390/s390.h (SECONDARY_MEMORY_NEEDED_MODE): Likewise.
      	* config/sparc/sparc.h (SECONDARY_MEMORY_NEEDED_MODE): Likewise.
      	* expmed.c (extract_bit_field_1): Likewise.
      	* reload.c (get_secondary_mem): Likewise.
      	* varasm.c (assemble_integer): Likewise.
      	* lower-subreg.c (simplify_subreg_concatn): Likewise.  Move
      	early-out.
      
      From-SVN: r251728
      Richard Sandiford committed