Commit Graph

177536 Commits

Author SHA1 Message Date
Tobias Burnus e70fbee1a3 testsuite: Add offloading_enabled check and use it for xfail (PR95622)
gcc/testsuite/ChangeLog:

	PR middle-end/95622
	* lib/target-supports.exp (check_effective_target_offloading_enabled):
	New.
	* c-c++-common/goacc/kernels-alias-ipa-pta-2.c: Use it for xfail.
	* c-c++-common/goacc/kernels-alias-ipa-pta-4.c: Likewise.
	* c-c++-common/goacc/kernels-alias-ipa-pta.c: Likewise.

Reviewed-by: Thomas Schwinge <thomas@codesourcery.com>
2020-06-16 15:14:13 +02:00
Tobias Burnus 6a893783f9 OpenMP/Fortran: Permit impure ELEMENTAL in omp directives
OpenMP since 4.5 permits IMPURE ELEMENTAL in directives and
the code already only checked for PURE.

gcc/fortran/ChangeLog:

	* parse.c (decode_omp_directive): Remove "or ELEMENTAL"
	from "in PURE" error message.

gcc/testsuite/ChangeLog:

	* gfortran.dg/gomp/pr79154-1.f90: Update dg-*;
	add an impure elemental example.
	* gfortran.dg/gomp/pr79154-2.f90: Likewise.
2020-06-16 15:11:12 +02:00
Eric Botcazou f193b29e42 [Ada] Expand 'Pos and 'Val for enumeration types with standard representation
2020-06-16  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* sinfo.ads (Conversion_OK): Document use for 'Pos and 'Val.
	* exp_attr.adb (Get_Integer_Type): New function returning a
	small integer type appropriate for an enumeration type.
	(Expand_N_Attribute_Reference) <Attribute_Enum_Rep>: Call it.
	<Attribute_Pos>: For an enumeration type with a standard
	representation, expand to a conversion with Conversion_OK.
	<Attribute_Val>: Likewise.
	* exp_ch4.adb (Expand_N_Type_Conversion): Do not expand when
	the target is an enumeration type and Conversion_OK is set.
2020-06-16 09:07:18 -04:00
Eric Botcazou dad94b3aca [Ada] Fix spurious error on derived private type with predicate
2020-06-16  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* sem_ch4.adb (Common_Type): Go to Underlying_Full_View, if any.
2020-06-16 09:07:18 -04:00
Richard Kenner eb6dc6f301 [Ada] Change how we detect internal protected subprograms
2020-06-16  Richard Kenner  <kenner@adacore.com>

gcc/ada/

	* exp_unst.adb (Subp_Index): Change way we detect internal
	protected subprograms.
2020-06-16 09:07:18 -04:00
Richard Kenner 27e64b8451 [Ada] Improve bug box customer language
2020-06-16  Richard Kenner  <kenner@adacore.com>

gcc/ada/

	* comperr.adb (Compiler_Abort): Clarify message displayed to
	customers.
2020-06-16 09:07:18 -04:00
Piotr Trojanek e8bb6ff959 [Ada] Minor casing of " The " after a comma in docs and comments
2020-06-16  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* checks.adb, doc/gnat_ugn/the_gnat_compilation_model.rst,
	einfo.ads, exp_ch5.adb, exp_ch7.adb, lib-xref.ads,
	libgnat/g-spitbo.ads, make.adb, sem_aux.adb, sem_ch3.adb,
	sem_ch4.adb, sem_ch5.adb, urealp.adb: Fix wrong casing.
	* gnat_ugn.texi: Regenerate.
2020-06-16 09:07:17 -04:00
Piotr Trojanek a1447c2a84 [Ada] Reuse Is_Object where possible
2020-06-16  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* einfo.adb, exp_spark.adb, exp_util.adb, sem_eval.adb: Replace
	"Ekind ... in Object_Kind" with "Is_Object (...)".
2020-06-16 09:07:17 -04:00
Piotr Trojanek 96bd3460c9 [Ada] Fix typo in comment about overlapping actuals
2020-06-16  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* sem_warn.adb (Warn_On_Overlapping_Actuals): Fix typo in
	comment.
2020-06-16 09:07:17 -04:00
Piotr Trojanek 1a3680ffe3 [Ada] Force evaluation of qualified aggregates
2020-06-16  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* exp_util.adb (Evaluate_Name): Force evaluation of aggregates;
	recursively evaluate expression of a qualified expression; fix
	location of the comment for an attribute referenced and an
	indexed component.
2020-06-16 09:07:17 -04:00
Eric Botcazou 9d2e727e9a [Ada] Couple of formatting and stylistic fixes
2020-06-16  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* freeze.adb (Freeze_Expression): Use consistent style and
	formatting in a couple of cases.
2020-06-16 09:07:16 -04:00
Steve Baird 0951b918ca [Ada] Enable literal aspect specifications in Big_Numbers specs
2020-06-16  Steve Baird  <baird@adacore.com>

gcc/ada/

	* libgnat/a-nbnbin.ads, libgnat/a-nbnbre.ads: Uncomment the
	commented-out Integer_Literal aspect specification for type
	Big_Integer.
2020-06-16 09:07:16 -04:00
Javier Miranda 82af729163 [Ada] Crash in tagged type constructor with task components
2020-06-16  Javier Miranda  <miranda@adacore.com>

gcc/ada/

	* exp_ch6.adb (BIP_Suffix_Kind, Check_BIP_Actuals,
	Is_Build_In_Place_Entity): New subprograms.
	(Make_Build_In_Place_Call_In_Allocator,
	Make_Build_In_Place_Call_In_Anonymous_Context,
	Make_Build_In_Place_Call_In_Assignment,
	Make_Build_In_Place_Call_In_Object_Declaration): Add assertions.
	(Needs_BIP_Task_Actuals): Add missing support for thunks.
	(Expand_Actuals): Ensure that the BIP call has available an
	activation chain and the _master variable.
	* exp_ch9.adb (Find_Enclosing_Context): Initialize the list of
	declarations of empty blocks when the _master variable must be
	declared and the list was not available.
2020-06-16 09:07:16 -04:00
Bob Duff bcc0f556a7 [Ada] Declare expressions
2020-06-16  Bob Duff  <duff@adacore.com>

gcc/ada/

	* par-ch4.adb (P_Case_Expression): Move to be local.
	(P_Declare_Expression): New parsing routine.
	(P_Unparen_Cond_Expr_Etc): New name for
	P_Unparen_Cond_Case_Quant_Expression which was missing one case
	in its name (iterated component association), and we're adding a
	new case (declare expression), so lets use "Etc" instead of
	trying to pack all those things into the name.  Add call to
	P_Declare_Expression, and check for missing parens.
	(P_Expression_If_OK, P_Expression_Or_Range_Attribute_If_OK): Add
	Tok_Declare.
	* par.adb (P_Basic_Declarative_Items): Add parameter
	Declare_Expression so we can tailor the error message about
	incorrect bodies.
	(P_Case_Expression): Move to body.
	* par-ch3.adb (P_Basic_Declarative_Items): Tailor the error
	message about incorrect bodies.
	* par-ch7.adb (P_Package): Pass Declare_Expression => False to
	P_Basic_Declarative_Items.
	* sem.ads (In_Declare_Expr): Counter used to determine whether
	we are analyzing a declare_expression. Needed to give errors
	about things that are not allowed in declare_expression, such as
	the 'Access attribute.
	* sem.adb (Do_Analyze): Save/restore In_Declare_Expr.
	* sem_ch4.adb (Analyze_Expression_With_Actions): Give this node
	its own scope.  That seems better in general, but it is
	necessary for declare_expressions.  For example, an identifier
	declared in a declare_expression should not clash with the same
	identifier in an outer scope.  If this is a declare_expression,
	indicated by Comes_From_Source, then check legality rules, and
	incr/decr In_Declare_Expr.
	* sem_aggr.adb (Resolve_Aggregate): Allow an applicable index
	constraint for a declare_expression, so if its expression is an
	array aggregate, it can have "others => ...".
	* sem_attr.adb (Analyze_Access_Attribute): Disallow these
	attributes in declare_expressions. Add comment to make it clear
	that Unrestricted_Access is included.
	* sinfo.ads, sinfo.adb, atree.ads, atree.adb: Remove the
	now-incorrect comment in sinfo.ads that says
	N_Expression_With_Actions has no proper scope.  Add 17-parameter
	versions of Nkind_In.  Remove the 16-parameter versions of
	Nkind_In.
2020-06-16 09:07:16 -04:00
Arnaud Charlet d51bf619f7 [Ada] ACATS C452005/C452006 memberships use wrong equality operation
2020-06-16  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* sem_aux.ads, sem_aux.adb (Is_Record_Or_Limited_Type): New
	function.
	* exp_ch4.adb, sem_ch4.adb (Analyze_Membership_Op,
	Expand_Set_Membership.Make_Cond): Choose between primitive and
	predefined equality for membership tests.
2020-06-16 09:07:15 -04:00
Ed Schonberg 3c9a82fec0 [Ada] Implement AI12-0216 on restricting overlap errors in calls
2020-06-16  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* sem_warn.adb (Warn_On_Overlapping_Actuals): Simplify code and
	implement AI12-0216 which clarifies the conditions under which
	overlapping actuals in a call are illegal. If proper warnings
	are enabled, GNAT also emits warnings in legal cases of
	overlopping actuals.
2020-06-16 09:07:15 -04:00
Eric Botcazou 7e7cb6eee4 [Ada] Fix premature freezing of artificial array subtype
2020-06-16  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* freeze.adb (Freeze_Expression): Stop climbing the parent chain
	at a N_{Case,If}_Expression node for a type or an entity that
	does not come from source.
2020-06-16 09:07:15 -04:00
Steve Baird 158b52c961 [Ada] Implement AI12-0249, AI12-0295 (user-defined numeric & string literals)
2020-06-16  Steve Baird  <baird@adacore.com>

gcc/ada/

	* snames.ads-tmpl: Define names of the three new aspects.
	* aspects.ads: Define the three new aspects.
	* sem_util.ads, sem_util.adb, sem_dim.adb: Move the function
	String_From_Numeric_Literal from being declared in the body of
	package Sem_Dim to being declared in the visible part of package
	Sem_Util.
	* sem_ch13.ads, sem_ch13.adb: Declare new visible procedure
	Validate_Literal_Aspect. This is where most of the legality
	checking occurs for an aspect specification for one of the three
	new aspects, as well as resolution of the subprogram named in
	the aspect specification. Follow example of other aspects (e.g.,
	Validate_Literal_Aspect is called in much the same way as
	Validate_Iterable_Aspect in Analyze_Aspects_At_Freeze_Point; a
	small amount of legality checking is performed in
	Analyze_One_Aspect in much the same way as for Default_Value or
	Default_Component_Value aspects). Most of the work is done in
	Validate_Literal_Aspect.
	* contracts.adb (Add_Contract_Item): Call
	Validate_Literal_Aspect in much the same way that
	Validate_Iterable_Aspect was already being called.
	* sem_res.adb (Resolve): Rewrite a literal as a call if it is a
	user-defined literal.  This is where the dynamic semantics of
	the 3 new aspects are implemented.
	* sem_ch6.adb (Fully_Conformant_Expressions): Two numeric
	literals that have different text but the same value (e.g.,
	12345 and 12_345) do not conform if they are user-defined
	literals. Introduce a new function
	User_Defined_Numeric_Literal_Mismatch to avoid duplication in
	making this check.
	* sem_type.adb (Has_Compatible_Type): A numeric literal can be
	compatible with a non-numeric type (and a string literal can be
	compatible with a non-string type) if it can be interpreted as a
	user-defined literal.
2020-06-16 09:07:15 -04:00
Arnaud Charlet 51e2de474e [Ada] ACATS 4.1P - C432003 - Errors missed on extension aggregates
2020-06-16  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* sem_aggr.adb (Resolve_Extension_Aggregate): Fix implementation
	of AI05-0115 by checking the correct type.
2020-06-16 09:07:14 -04:00
Arnaud Charlet e7680763df [Ada] ACATS 4.1P - BC55001 - Error missed
2020-06-16  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* sem_ch6.adb (Analyze_Subprogram_Specification): Generate error
	message for functions returning interfaces.
2020-06-16 09:07:14 -04:00
Piotr Trojanek eaf3414d0a [Ada] Fix assertion failure on qualified type names in predicates
2020-06-16  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* sem_ch13.adb (Membership_Entry): Relax assertion to also
	recognize qualified identifiers.
2020-06-16 09:07:14 -04:00
Piotr Trojanek df7507a637 [Ada] Force evaluation of operator calls in renamings
2020-06-16  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* exp_util.adb (Evaluate_Name): Force evaluation of operators.
2020-06-16 09:07:14 -04:00
Arnaud Charlet 81c356975f [Ada] ACATS 4.1K - B452001 - No errors detected
2020-06-16  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* sem_ch4.adb (Analyze_Membership_Op): Reset entity of equality
	nodes for membership tests with singletons.
	(Analyze_User_Defined_Binary_Op): Always perform the analysis
	since nodes coming from the expander also may refer to non
	standard operators as part of membership expansion.
	* exp_ch4.adb (Expand_Set_Membership.Make_Cond): Reset entity of
	equality node.
	* sem_type.ads: Fix typo in comment.
2020-06-16 09:07:13 -04:00
Ghjuvan Lacambre 29b82c7d55 [Ada] Check if attribute Passed_By_Reference is called on incomplete types
2020-06-16  Ghjuvan Lacambre  <lacambre@adacore.com>

gcc/ada/

	* sem_attr.adb (Analyze_Attribute): Add
	Check_Not_Incomplete_Type call.
2020-06-16 09:07:13 -04:00
Gary Dismukes 93b0021d8c [Ada] Fix two typos
2020-06-16  Gary Dismukes  <dismukes@adacore.com>

gcc/ada/

	* sem_ch6.adb: Add closing paren in a comment.
	* sem_util.adb: Correct comment typo (aggreate => aggregate).
2020-06-16 09:07:13 -04:00
Javier Miranda 55153b7b4d [Ada] Crash in tagged type constructor with task components
2020-06-16  Javier Miranda  <miranda@adacore.com>

gcc/ada/

	* sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
	Code cleanup.
2020-06-16 09:07:12 -04:00
Eric Botcazou fa75faedb1 [Ada] Fix small fallout of freezing change for expression functions
2020-06-16  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* freeze.adb (In_Expanded_Body): Remove unreachable code.
	(Freeze_Expression): Rename a couple of local variables.
	In the case of an expanded body, also freeze locally the
	entities declared in a nested block.
2020-06-16 09:07:12 -04:00
Eric Botcazou 7ba5e7464b [Ada] Fix spurious error on implicit dereference for private type
2020-06-16  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* sem_ch4.adb (Transform_Object_Operation): Document that it
	may be partially destructive for the parent of the node.
	(Try_Object_Operation): Undo the changes made above on failure.
2020-06-16 09:07:12 -04:00
Javier Miranda dae4f504c6 [Ada] Crash in tagged type constructor with task components
2020-06-16  Javier Miranda  <miranda@adacore.com>

gcc/ada/

	* restrict.adb (Global_No_Tasking): Adding
	Targparm.Restrictions_On_Target Fixes regressions with zfp.
2020-06-16 09:07:12 -04:00
Ed Schonberg 1fe73fd696 [Ada] Spurious undefined symbol with nested call to expression function
2020-06-16  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* freeze.adb: (Freeze_Expression, In_Expanded_Body): Treat the
	generated body of an expression function like other bodies
	generated during expansion (e.g. stream subprograms) so that
	those bodies are not treated as freezing points. Handle properly
	other global references in such completions.
2020-06-16 09:07:11 -04:00
Piotr Trojanek d7769a80a8 [Ada] Accept renamings of folded string aggregates
2020-06-16  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* sem_ch8.adb (Analyze_Object_Renaming): Remove trivially
	useless initialization of Is_Object_Reference.
	* sem_util.adb (Is_Object_Reference): Simplify detection of
	binary and unary operators; literally implement rules about
	aggregates and qualified expressions; recognize string literals
	as object references.
2020-06-16 09:07:11 -04:00
Eric Botcazou 0faf050331 [Ada] Implement AI12-0351 Matching for actuals for formal derived types
2020-06-16  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* sem_ch12.adb (Validate_Derived_Type_Instance): Reword error
	message for 12.5.1(8) subclause and add secondary message if
	the incompatibility comes from the predicates.
	* sem_ch3.adb (Check_Constraining_Discriminant): New procedure
	to give the error required by the 3.7(15) subclause.  Mention
	"statically" in the error message and add secondary message
	if the incompatibility comes from the predicates.
	(Build_Derived_Concurrent_Type): Call it when a new discriminant
	constrains an old one.
	(Build_Derived_Record_Type): Likewise.
	* sem_eval.ads (Predicates_Compatible): Declare.
	* sem_eval.adb (Predicates_Compatible): New function to implement
	the compatibility of predicates specified by the 4.9.1 clause.
	(Subtypes_Statically_Compatible): Call it.
2020-06-16 09:07:11 -04:00
Patrick Palka 28462a4496 c++: TI_DEFERRED_ACCESS_CHECKS and dependent decls
This adds an assert to enforce_access to verify that we don't defer
access checks of dependent decls -- we should instead be rechecking the
access of such a decl after tsubst'ing into the user of the decl.

gcc/cp/ChangeLog:

	* pt.c (perform_instantiation_time_access_checks): No need to
	tsubst into decl.
	* semantics.c (enforce_access): Verify that decl is not
	dependent.
2020-06-16 08:51:34 -04:00
Patrick Palka 668ef28fbb c++: Clean up previous change [PR41437]
The previous patch mostly avoided making any changes that had no
functional impact, such as adjusting now-outdated comments and
performing renamings.  Such changes have been consolidated to this
followup patch for easier review.

The main change here is that we now reuse struct deferred_access_check
as the element type of the vector TI_TYPEDEFS_NEEDING_ACCESS_CHECKING
(now renamed to TI_DEFERRED_ACCESS_CHECKS, since it may contain any kind
of access check).

gcc/cp/ChangeLog:

	PR c++/41437
	PR c++/47346
	* cp-tree.h (qualified_typedef_usage_s): Delete.
	(qualified_typedef_usage_t): Delete.
	(deferred_access_check): Move up in file.
	(tree_template_info::typedefs_needing_access_checking): Delete.
	(tree_template_info::deferred_access_checks): New field.
	(TI_TYPEDEFS_NEEDING_ACCESS_CHECKING): Rename to ...
	(TI_DEFERRED_ACCESS_CHECKS): ... this, and adjust accordingly.
	* pt.c (perform_typedefs_access_check): Rename to ...
	(perform_instantiation_time_access_checks): ... this, and adjust
	accordingly.  Remove unnecessary tree tests.
	(instantiate_class_template_1): Adjust accordingly.
	(instantiate_decl): Likewise.
	* semantics.c (enforce_access): Likewise.
2020-06-16 08:21:36 -04:00
Patrick Palka 92bed03609 c++: Improve access checking inside templates [PR41437]
This patch generalizes our existing functionality for deferring access
checking of typedefs when parsing a function or class template to now
defer all kinds of access checks until template instantiation time,
including member function and member object accesses.

Since all access checks eventually go through enforce_access, the main
component of this patch is new handling inside enforce_access to defer
the current access check if we're inside a template.  The bulk of the
rest of the patch consists of removing now-unneeded code pertaining to
suppressing access checks inside templates or pertaining to
typedef-specific access handling.  Renamings and other changes with no
functional impact have been split off into the followup patch.

gcc/cp/ChangeLog:

	PR c++/41437
	PR c++/47346
	* call.c (enforce_access): Move to semantics.c.
	* cp-tree.h (enforce_access): Delete.
	(get_types_needing_access_check): Delete.
	(add_typedef_to_current_template_for_access_check): Delete.
	* decl.c (make_typename_type): Adjust accordingly.  Use
	check_accessibility_of_qualified_id instead of directly using
	perform_or_defer_access_check.
	* parser.c (cp_parser_template_declaration_after_parameters):
	Don't push a dk_no_check access state when parsing a template.
	* pt.c (get_types_needing_access_check): Delete.
	(append_type_to_template_for_access_check_1): Delete.
	(perform_typedefs_access_check): Adjust.  If type_decl is a
	FIELD_DECL, also check its DECL_CONTEXT for dependence. Use
	tsubst_copy instead of tsubst to substitute into type_decl so
	that we substitute into the DECL_CONTEXT of a FIELD_DECL.
	(append_type_to_template_for_access_check): Delete.
	* search.c (accessible_p): Remove the processing_template_decl
	early exit.
	* semantics.c (enforce_access): Moved from call.c.  If we're
	parsing a template and the access check failed, add the check to
	TI_TYPEDEFS_NEEDING_ACCESS_CHECKING.
	(perform_or_defer_access_check): Adjust comment.
	(add_typedef_to_current_template_for_access_check): Delete.
	(check_accessibility_of_qualified_id):  Adjust accordingly.
	Exit early if the scope is dependent.

gcc/testsuite/ChangeLog:

	PR c++/41437
	PR c++/47346
	* g++.dg/cpp2a/concepts-using2.C: Adjust.
	* g++.dg/lto/20081219_1.C: Adjust.
	* g++.dg/lto/20091002-1_0.C: Adjust.
	* g++.dg/lto/pr65475c_0.C: Adjust.
	* g++.dg/opt/dump1.C: Adjust.
	* g++.dg/other/pr53574.C: Adjust.
	* g++.dg/template/access30.C: New test.
	* g++.dg/template/access31.C: New test.
	* g++.dg/wrappers/wrapper-around-type-pack-expansion.C: Adjust.

libstdc++-v3/ChangeLog:

	PR libstdc++/94003
	* testsuite/20_util/is_constructible/94003.cc: New test.
2020-06-16 08:21:33 -04:00
Richard Biener a97e49a89d middle-end/95690 - avoid MEM_EXPRs for constants
The following avoids calling set_mem_attributes on the
DECL_INITIAL of a CONST_DECL which seems pointless since there
cannot be a sensible MEM_EXPR derived from that.  We're overwriting
both other possibly useful info, alias-set and alignment immediately
so the following patch simply removes the call instead of making
the function deal with even more (unexpected) trees that are not
memory accesses.

2020-06-16  Richard Biener  <rguenther@suse.de>

	PR middle-end/95690
	* varasm.c (build_constant_desc): Remove set_mem_attributes call.

	* gfortran.dg/pr95690.f90: New testcase.
2020-06-16 13:56:55 +02:00
Thomas Schwinge 2210ef7d3d Un-XFAIL 'gcc.dg/graphite/pr80906.c'
The recent commit b6ff3ddecf
"tree-optimization/94988 - enhance SM some more" fixed this.

	gcc/testsuite/
	PR tree-optimization/94988
	* gcc.dg/graphite/pr80906.c: Un-XFAIL.
2020-06-16 10:13:55 +02:00
Thomas Schwinge b70eeb248e Further adjust 'dg-lto-options' in 'gcc.dg/lto/pr52634'
The recent commit f8a4141bae "Fix various dg
directives" corrected the imbalanced curly braces in 'dg-lto-options', which
changes the testing as follows:

    -PASS: gcc.dg/lto/pr52634 c_lto_pr52634_0.o assemble, -O0 -flto -flto-partition=none -fuse-linker-plugin
    -PASS: gcc.dg/lto/pr52634 c_lto_pr52634_1.o assemble, -O0 -flto -flto-partition=none -fuse-linker-plugin
    -PASS: gcc.dg/lto/pr52634 c_lto_pr52634_0.o-c_lto_pr52634_1.o link, -O0 -flto -flto-partition=none -fuse-linker-plugin
    -PASS: gcc.dg/lto/pr52634 c_lto_pr52634_0.o assemble, -O2 -flto -flto-partition=none -fuse-linker-plugin -fno-fat-lto-objects
    -PASS: gcc.dg/lto/pr52634 c_lto_pr52634_1.o assemble, -O2 -flto -flto-partition=none -fuse-linker-plugin -fno-fat-lto-objects
    -PASS: gcc.dg/lto/pr52634 c_lto_pr52634_0.o-c_lto_pr52634_1.o link, -O2 -flto -flto-partition=none -fuse-linker-plugin -fno-fat-lto-objects
    -PASS: gcc.dg/lto/pr52634 c_lto_pr52634_0.o assemble, -O0 -flto -flto-partition=1to1 -fno-use-linker-plugin
    -PASS: gcc.dg/lto/pr52634 c_lto_pr52634_1.o assemble, -O0 -flto -flto-partition=1to1 -fno-use-linker-plugin
    -PASS: gcc.dg/lto/pr52634 c_lto_pr52634_0.o-c_lto_pr52634_1.o link, -O0 -flto -flto-partition=1to1 -fno-use-linker-plugin
    -PASS: gcc.dg/lto/pr52634 c_lto_pr52634_0.o assemble, -O2 -flto -flto-partition=1to1 -fno-use-linker-plugin
    -PASS: gcc.dg/lto/pr52634 c_lto_pr52634_1.o assemble, -O2 -flto -flto-partition=1to1 -fno-use-linker-plugin
    -PASS: gcc.dg/lto/pr52634 c_lto_pr52634_0.o-c_lto_pr52634_1.o link, -O2 -flto -flto-partition=1to1 -fno-use-linker-plugin
    -PASS: gcc.dg/lto/pr52634 c_lto_pr52634_0.o assemble, -O0 -flto -fuse-linker-plugin -fno-fat-lto-objects
    -PASS: gcc.dg/lto/pr52634 c_lto_pr52634_1.o assemble, -O0 -flto -fuse-linker-plugin -fno-fat-lto-objects
    -PASS: gcc.dg/lto/pr52634 c_lto_pr52634_0.o-c_lto_pr52634_1.o link, -O0 -flto -fuse-linker-plugin -fno-fat-lto-objects
    -PASS: gcc.dg/lto/pr52634 c_lto_pr52634_0.o assemble, -O2 -flto -fuse-linker-plugin
    -PASS: gcc.dg/lto/pr52634 c_lto_pr52634_1.o assemble, -O2 -flto -fuse-linker-plugin
    -PASS: gcc.dg/lto/pr52634 c_lto_pr52634_0.o-c_lto_pr52634_1.o link, -O2 -flto -fuse-linker-plugin
    +PASS: gcc.dg/lto/pr52634 c_lto_pr52634_0.o assemble, -flto
    +PASS: gcc.dg/lto/pr52634 c_lto_pr52634_1.o assemble, -flto
    +PASS: gcc.dg/lto/pr52634 c_lto_pr52634_0.o-c_lto_pr52634_1.o link, -flto
    +PASS: gcc.dg/lto/pr52634 c_lto_pr52634_0.o assemble, -r
    +PASS: gcc.dg/lto/pr52634 c_lto_pr52634_1.o assemble, -r
    +PASS: gcc.dg/lto/pr52634 c_lto_pr52634_0.o-c_lto_pr52634_1.o link, -r
    +PASS: gcc.dg/lto/pr52634 c_lto_pr52634_0.o assemble, -flto-partition=1to1
    +PASS: gcc.dg/lto/pr52634 c_lto_pr52634_1.o assemble, -flto-partition=1to1
    +PASS: gcc.dg/lto/pr52634 c_lto_pr52634_0.o-c_lto_pr52634_1.o link, -flto-partition=1to1

I however assume the original idea however has not been to run variants
'-flto', '-r', '-flto-partition=1to1' individually, but rather to run one
variant '-flto -r -flto-partition=1to1'.

	gcc/testsuite/
	* gcc.dg/lto/pr52634_0.c: Further adjust 'dg-lto-options'.
2020-06-16 10:13:55 +02:00
Kito Cheng beaf12b49a RISC-V: Fix ICE on riscv_gpr_save_operation_p [PR95683]
- riscv_gpr_save_operation_p might try to match parallel on other
   patterns like inline asm pattern, and then it might trigger ther
   assertion checking there, so we could trun it into a early exit check.

gcc/ChangeLog:

	PR target/95683
	* config/riscv/riscv.c (riscv_gpr_save_operation_p): Remove
	assertion and turn it into a early exit check.

gcc/testsuite/ChangeLog

	PR target/95683
	* gcc.target/riscv/pr95683.c: New.
2020-06-16 10:14:13 +08:00
GCC Administrator 6fb94d67f1 Daily bump. 2020-06-16 00:16:28 +00:00
Nicolas Bertolo f8d6596c79 gcc/jit: Rename libgccjit.dll to libgccjit-0.dll.
2020-06-09  Nicolas Bértolo  <nicolasbertolo@gmail.com>

	* Make-lang.in: Always define version, minor and release
	numbers. Create the Windows shared library as
	libgccjit-$(LIBGCCJIT_VERSION_NUM).dll.
2020-06-16 00:10:31 +00:00
Tobias Klauser 882af4350b libgo: update x/sys/cpu to add all GOARCHes supported by gccgo
CL 237897 added additional GOARCHes supported by gccgo to x/sys/cpu.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/238038
2020-06-15 14:20:07 -07:00
Tobias Klauser 47ad09cb08 internal/syscall/unix: use getrandom_linux_generic.go on riscv
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/237899
2020-06-15 12:00:12 -07:00
Eric Botcazou c7bac01ab4 Optimize assignment to volatile aggregate variable
gimplify_modify_expr_rhs has an optimization whereby the assignment to
an aggregate variable from a read-only object with a DECL_INITIAL is
optimized into the direct assignment of the DECL_INITIAL, provided that
no temporary is created in the process.

The optimization is blocked if the read-only object is volatile, which
is OK as per the semantics of volatile, but also if the target variable
is volatile, on the grounds that the modified assignment might end up
being done on a per field basis, which is also OK.  But this latter
restriction is enforced a priori and there are cases where the modified
assignment would be OK, for example if there is only one field or the
DECL_INITIAL is equivalent to the empty CONSTRUCTOR, i.e. all zeros.

So, in the latter case, the patch changes gimplify_modify_expr_rhs to ask
gimplify_init_constructor whether the assignment would be done as a block,
which is easy because gimplify_init_constructor knows that it must create
a temporary if the LHS is volatile and this would not be the case, so it's
just a matter of completing the NOTIFY_TEMP_CREATION mechanism.

gcc/ChangeLog
	* gimplify.c (gimplify_init_constructor) <AGGREGATE_TYPE>: Declare
	new ENSURE_SINGLE_ACCESS constant and move variables down.  If it is
	true and all elements are zero, then always clear.  Return GS_ERROR
	if a temporary would be created for it and NOTIFY_TEMP_CREATION set.
	(gimplify_modify_expr_rhs) <VAR_DECL>: If the target is volatile but
	the type is aggregate non-addressable, ask gimplify_init_constructor
	whether it can generate a single access to the target.

gcc/testsuite/ChangeLog
	* gnat.dg/aggr30.ads, gnat.dg/aggr30.adb: New test.
2020-06-15 19:58:31 +02:00
Eric Botcazou fb149ebdfe Fix ICE in verify_sra_access_forest
This fixes an issue with reverse storage order in SRA, which is caught
by the built-in verifier in verify_sra_access_forest.  The problem is
that propagate_subaccesses_from_rhs changes the type of an access
from aggregate to scalar and, as discussed elsewhere, this must be
done with extra care in the presence of reverse storage order.

gcc/ChangeLog
	* tree-sra.c (propagate_subaccesses_from_rhs): When a non-scalar
	access on the LHS is replaced with a scalar access, propagate the
	TYPE_REVERSE_STORAGE_ORDER flag of the type of the original access.

gcc/testsuite/ChangeLog
	* gnat.dg/opt85.ads, gnat.dg/opt85.adb: New test.
2020-06-15 19:54:01 +02:00
Jonathan Wakely b6ab9ecd55 libstdc++: Update value of __cpp_lib_constexpr_char_traits for C++20
Although not required by SD-6 or the C++20 draft, we define the macro
__cpp_lib_constexpr_char_traits to indicate support for P0432R1. This
updates the value in C++20 mode for the P1032R1 changes to char_traits.

	* include/bits/char_traits.h (__cpp_lib_constexpr_char_traits):
	Update value for C++20.
	* include/std/version (__cpp_lib_constexpr_char_traits): Likewise.
	* testsuite/21_strings/char_traits/requirements/constexpr_functions_c++17.cc:
	Update expected value.
	* testsuite/21_strings/char_traits/requirements/constexpr_functions_c++20.cc:
	Likewise.
2020-06-15 14:31:26 +01:00
Paul Keir eb11134d0c libstdc++: Fix char_traits move with overlap
Upon constexpr evaluation, char_traits move uses copy_backward, but its
last argument should be to the range end rather than its beginning.

2020-06-12  Paul Keir  <paul.keir@uws.ac.uk>

	* include/bits/char_traits.h (char_traits::move): constexpr move with
	overlap was using copy_backward incorrectly.
	* testsuite/21_strings/char_traits/requirements/constexpr_functions_c++20.cc:
	New test.
2020-06-15 14:31:26 +01:00
Max Filippov e46dad5d8f gcc: xtensa: make TARGET_HAVE_TLS definition static
Remove TARGET_THREADPTR reference from TARGET_HAVE_TLS to avoid
static data initialization dependency on xtensa core configuration.

2020-06-15  Max Filippov  <jcmvbkbc@gmail.com>
gcc/
	* config/xtensa/xtensa.c (TARGET_HAVE_TLS): Remove
	TARGET_THREADPTR reference.
	(xtensa_tls_symbol_p, xtensa_tls_referenced_p): Use
	targetm.have_tls instead of TARGET_HAVE_TLS.
	(xtensa_option_override): Set targetm.have_tls to false in
	configurations without THREADPTR.
2020-06-15 03:36:16 -07:00
Max Filippov 8c8eb94914 gcc: xtensa: add -mabi option for call0/windowed ABI
2020-06-15  Max Filippov  <jcmvbkbc@gmail.com>
gcc/
	* config/xtensa/elf.h (ASM_SPEC, LINK_SPEC): Pass ABI switch to
	assembler/linker.
	* config/xtensa/linux.h (ASM_SPEC, LINK_SPEC): Ditto.
	* config/xtensa/uclinux.h (ASM_SPEC, LINK_SPEC): Ditto.
	* config/xtensa/xtensa.c (xtensa_option_override): Initialize
	xtensa_windowed_abi if needed.
	* config/xtensa/xtensa.h (TARGET_WINDOWED_ABI_DEFAULT): New
	macro.
	(TARGET_WINDOWED_ABI): Redefine to xtensa_windowed_abi.
	* config/xtensa/xtensa.opt (xtensa_windowed_abi): New target
	option variable.
	(mabi=call0, mabi=windowed): New options.
	* doc/invoke.texi: Document new -mabi= Xtensa-specific options.

gcc/testsuite/
	* gcc.target/xtensa/mabi-call0.c: New test.
	* gcc.target/xtensa/mabi-windowed.c: New test.

libgcc/
	* configure: Regenerate.
	* configure.ac: Use AC_COMPILE_IFELSE instead of manual
	preprocessor invocation to check for __XTENSA_CALL0_ABI__.
2020-06-15 03:35:50 -07:00
Max Filippov f50c32fa7a gcc: xtensa: make register elimination data static
Remove ABI reference from the ELIMINABLE_REGS to avoid static data
initialization dependency on xtensa core configuration.

2020-06-15  Max Filippov  <jcmvbkbc@gmail.com>
gcc/
	* config/xtensa/xtensa.c (xtensa_can_eliminate): New function.
	(TARGET_CAN_ELIMINATE): New macro.
	* config/xtensa/xtensa.h
	(XTENSA_WINDOWED_HARD_FRAME_POINTER_REGNUM)
	(XTENSA_CALL0_HARD_FRAME_POINTER_REGNUM): New macros.
	(HARD_FRAME_POINTER_REGNUM): Define using
	XTENSA_*_HARD_FRAME_POINTER_REGNUM.
	(ELIMINABLE_REGS): Replace lines with HARD_FRAME_POINTER_REGNUM
	by lines with XTENSA_WINDOWED_HARD_FRAME_POINTER_REGNUM and
	XTENSA_CALL0_HARD_FRAME_POINTER_REGNUM.
2020-06-15 03:24:23 -07:00