platform/upstream/gcc.git
4 years ago[Ada] Implement AI12-0216 on restricting overlap errors in calls
Ed Schonberg [Tue, 7 Apr 2020 18:16:14 +0000 (14:16 -0400)]
[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.

4 years ago[Ada] Fix premature freezing of artificial array subtype
Eric Botcazou [Tue, 7 Apr 2020 07:39:06 +0000 (09:39 +0200)]
[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.

4 years ago[Ada] Implement AI12-0249, AI12-0295 (user-defined numeric & string literals)
Steve Baird [Sat, 4 Apr 2020 00:34:38 +0000 (17:34 -0700)]
[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.

4 years ago[Ada] ACATS 4.1P - C432003 - Errors missed on extension aggregates
Arnaud Charlet [Tue, 7 Apr 2020 09:22:52 +0000 (05:22 -0400)]
[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.

4 years ago[Ada] ACATS 4.1P - BC55001 - Error missed
Arnaud Charlet [Mon, 6 Apr 2020 12:33:13 +0000 (08:33 -0400)]
[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.

4 years ago[Ada] Fix assertion failure on qualified type names in predicates
Piotr Trojanek [Mon, 6 Apr 2020 12:52:27 +0000 (14:52 +0200)]
[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.

4 years ago[Ada] Force evaluation of operator calls in renamings
Piotr Trojanek [Sun, 5 Apr 2020 21:37:18 +0000 (23:37 +0200)]
[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.

4 years ago[Ada] ACATS 4.1K - B452001 - No errors detected
Arnaud Charlet [Fri, 3 Apr 2020 10:10:22 +0000 (06:10 -0400)]
[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.

4 years ago[Ada] Check if attribute Passed_By_Reference is called on incomplete types
Ghjuvan Lacambre [Fri, 3 Apr 2020 14:57:40 +0000 (16:57 +0200)]
[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.

4 years ago[Ada] Fix two typos
Gary Dismukes [Fri, 3 Apr 2020 18:19:43 +0000 (14:19 -0400)]
[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).

4 years ago[Ada] Crash in tagged type constructor with task components
Javier Miranda [Sat, 4 Apr 2020 18:21:40 +0000 (14:21 -0400)]
[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.

4 years ago[Ada] Fix small fallout of freezing change for expression functions
Eric Botcazou [Sun, 5 Apr 2020 08:25:44 +0000 (10:25 +0200)]
[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.

4 years ago[Ada] Fix spurious error on implicit dereference for private type
Eric Botcazou [Fri, 3 Apr 2020 21:34:07 +0000 (23:34 +0200)]
[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.

4 years ago[Ada] Crash in tagged type constructor with task components
Javier Miranda [Fri, 3 Apr 2020 21:29:48 +0000 (17:29 -0400)]
[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.

4 years ago[Ada] Spurious undefined symbol with nested call to expression function
Ed Schonberg [Thu, 2 Apr 2020 20:47:17 +0000 (16:47 -0400)]
[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.

4 years ago[Ada] Accept renamings of folded string aggregates
Piotr Trojanek [Fri, 3 Apr 2020 09:36:55 +0000 (11:36 +0200)]
[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.

4 years ago[Ada] Implement AI12-0351 Matching for actuals for formal derived types
Eric Botcazou [Fri, 3 Apr 2020 10:37:45 +0000 (12:37 +0200)]
[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.

4 years agoc++: TI_DEFERRED_ACCESS_CHECKS and dependent decls
Patrick Palka [Tue, 16 Jun 2020 12:51:34 +0000 (08:51 -0400)]
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.

4 years agoc++: Clean up previous change [PR41437]
Patrick Palka [Tue, 16 Jun 2020 12:21:36 +0000 (08:21 -0400)]
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.

4 years agoc++: Improve access checking inside templates [PR41437]
Patrick Palka [Tue, 16 Jun 2020 12:21:33 +0000 (08:21 -0400)]
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.

4 years agomiddle-end/95690 - avoid MEM_EXPRs for constants
Richard Biener [Tue, 16 Jun 2020 07:36:09 +0000 (09:36 +0200)]
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.

4 years agoUn-XFAIL 'gcc.dg/graphite/pr80906.c'
Thomas Schwinge [Sat, 6 Jun 2020 16:23:28 +0000 (18:23 +0200)]
Un-XFAIL 'gcc.dg/graphite/pr80906.c'

The recent commit b6ff3ddecfa93d53867afaaa078f85fc848abbbd
"tree-optimization/94988 - enhance SM some more" fixed this.

gcc/testsuite/
PR tree-optimization/94988
* gcc.dg/graphite/pr80906.c: Un-XFAIL.

4 years agoFurther adjust 'dg-lto-options' in 'gcc.dg/lto/pr52634'
Thomas Schwinge [Sat, 6 Jun 2020 11:50:24 +0000 (13:50 +0200)]
Further adjust 'dg-lto-options' in 'gcc.dg/lto/pr52634'

The recent commit f8a4141bae53f9125d374e5873dcda3f75392f1f "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'.

4 years agoRISC-V: Fix ICE on riscv_gpr_save_operation_p [PR95683]
Kito Cheng [Tue, 16 Jun 2020 02:14:13 +0000 (10:14 +0800)]
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.

4 years agoDaily bump.
GCC Administrator [Tue, 16 Jun 2020 00:16:28 +0000 (00:16 +0000)]
Daily bump.

4 years agogcc/jit: Rename libgccjit.dll to libgccjit-0.dll.
Nicolas Bertolo [Tue, 9 Jun 2020 14:37:51 +0000 (11:37 -0300)]
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.

4 years agolibgo: update x/sys/cpu to add all GOARCHes supported by gccgo
Tobias Klauser [Mon, 15 Jun 2020 19:49:13 +0000 (21:49 +0200)]
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

4 years agointernal/syscall/unix: use getrandom_linux_generic.go on riscv
Tobias Klauser [Mon, 15 Jun 2020 11:57:39 +0000 (13:57 +0200)]
internal/syscall/unix: use getrandom_linux_generic.go on riscv

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

4 years agoOptimize assignment to volatile aggregate variable
Eric Botcazou [Mon, 15 Jun 2020 17:56:00 +0000 (19:56 +0200)]
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.

4 years agoFix ICE in verify_sra_access_forest
Eric Botcazou [Mon, 15 Jun 2020 17:42:11 +0000 (19:42 +0200)]
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.

4 years agolibstdc++: Update value of __cpp_lib_constexpr_char_traits for C++20
Jonathan Wakely [Mon, 15 Jun 2020 13:31:26 +0000 (14:31 +0100)]
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.

4 years agolibstdc++: Fix char_traits move with overlap
Paul Keir [Mon, 15 Jun 2020 13:31:26 +0000 (14:31 +0100)]
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.

4 years agogcc: xtensa: make TARGET_HAVE_TLS definition static
Max Filippov [Sun, 14 Jun 2020 08:07:01 +0000 (01:07 -0700)]
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.

4 years agogcc: xtensa: add -mabi option for call0/windowed ABI
Max Filippov [Mon, 13 Apr 2020 06:53:32 +0000 (23:53 -0700)]
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__.

4 years agogcc: xtensa: make register elimination data static
Max Filippov [Mon, 15 Jun 2020 05:09:36 +0000 (22:09 -0700)]
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.

4 years agoBRIG FE testsuite: Fix all dump-scans
Martin Jambor [Mon, 15 Jun 2020 09:45:24 +0000 (11:45 +0200)]
BRIG FE testsuite: Fix all dump-scans

since Alexandre's revamp of dump files handling in
r11-627-g1dedc12d186, BRIG FE has been receiving slightly different
-dumpbase (e.g. smoke_test.brig instead of smoke_test.hsail.brig when
compiling file smoke_test.hsail.brig) and the testsuite then could not
find the generated dump files it wanted to scan.  I have not really
looked into why that changed, the easiest fix seems to me to remove
the hsail part already when generating the binary brig file from the
textual HSAIL representation.

gcc/testsuite/ChangeLog:

2020-06-09  Martin Jambor  <mjambor@suse.cz>

* lib/brig.exp (brig_target_compile): Strip hsail extension when
gnerating the name of the binary brig file.

4 years agovect: Use LOOP_VINFO_DATAREFS and LOOP_VINFO_DDRS consistently
Fei Yang [Sat, 13 Jun 2020 02:42:49 +0000 (10:42 +0800)]
vect: Use LOOP_VINFO_DATAREFS and LOOP_VINFO_DDRS consistently

Minor code refactorings in tree-vect-data-refs.c and tree-vect-loop.c.
Use LOOP_VINFO_DATAREFS and LOOP_VINFO_DDRS when possible and rename
several parameters to make code more consistent.

2020-06-13  Felix Yang  <felix.yang@huawei.com>

gcc/
* tree-vect-data-refs.c (vect_verify_datarefs_alignment): Rename
parameter to loop_vinfo and update uses.  Use LOOP_VINFO_DATAREFS
when possible.
(vect_analyze_data_refs_alignment): Likewise, and use LOOP_VINFO_DDRS
when possible.
* tree-vect-loop.c (vect_dissolve_slp_only_groups): Use
LOOP_VINFO_DATAREFS when possible.
(update_epilogue_loop_vinfo): Likewise.

4 years ago[Ada] Rewrite Sem_Eval.Predicates_Match predicate
Eric Botcazou [Thu, 2 Apr 2020 20:14:04 +0000 (22:14 +0200)]
[Ada] Rewrite Sem_Eval.Predicates_Match predicate

2020-06-15  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* sem_eval.ads (Predicates_Match): Fix description.
* sem_eval.adb (Predicates_Match): Rewrite.

4 years ago[Ada] Makefile.rtl: minor file renamings
Ed Falis [Wed, 1 Apr 2020 18:20:15 +0000 (14:20 -0400)]
[Ada] Makefile.rtl: minor file renamings

2020-06-15  Ed Falis  <falis@adacore.com>

gcc/ada/

* Makefile.rtl: Change name of hie/g-io__vxworks-ppc-cert.adb.

4 years ago[Ada] Improve error message on premature usage of subtypes
Arnaud Charlet [Thu, 2 Apr 2020 07:39:15 +0000 (03:39 -0400)]
[Ada] Improve error message on premature usage of subtypes

2020-06-15  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

* sem_ch8.adb (Premature_Usage): Add support for subtype
references and replace set of if-then-else by a case statement.

4 years ago[Ada] Do expect task discriminants in Global and Depends contracts
Piotr Trojanek [Wed, 1 Apr 2020 16:19:40 +0000 (18:19 +0200)]
[Ada] Do expect task discriminants in Global and Depends contracts

2020-06-15  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* sem_prag.adb (Analyze_Depends_In_Decl_Part,
Analyze_Global_In_Decl_Part): Bring back task discriminants for
analysis of the Global/Depends contracts; add comments.

4 years ago[Ada] Implement AI12-0343 Return Statement Checks
Eric Botcazou [Wed, 1 Apr 2020 17:13:06 +0000 (19:13 +0200)]
[Ada] Implement AI12-0343 Return Statement Checks

2020-06-15  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* einfo.ads (Return_Applies_To): Document special usage for E_Block.
* einfo.adb (Write_Field8_Name): Write it for E_Block too.
* exp_ch4.adb (Expand_N_Type_Conversion): Remove implementation of
the check prescribed by AI05-0073.
* exp_ch6.adb (Apply_CW_Accessibility_Check): New procedure to apply
the check prescribed by AI95-344 extracted from...
(Expand_N_Extended_Return_Statement): Apply the check prescribed by
AI95-344 to the expression, if present.  Suppress only access checks
when analyzing the rewritten result.
(Expand_Simple_Function_Return): ...here.  Rename local variable.
Call Apply_CW_Accessibility_Check to apply the check prescribed by
AI95-344, but do not do it for the simple return statement generated
by the expansion of an extended return statement.  Apply the check
prescribed by AI05-0073 to all functions returning anonymous access
type designating a specific tagged type, but not if the expression
was null or tag checks are suppressed for the type, and use Not In
operator rather than comparing the tags explicitly.
* sem.adb (Analyze): Handle all Suppress values.
* sem_ch6.adb (Analyze_Function_Return): Do not explicitly apply
predicate checks in the case of an extended return statement.
Do not apply an implicit conversion to the anonymous access result
type in the case of the simple return statement generated by the
expansion of an extended return statement.
(New_Overloaded_Entity): Small comment tweak.
* treepr.adb (Print_Node): Fix typo in flag string.

4 years ago[Ada] T'Image calls T'Put_Image
Bob Duff [Tue, 31 Mar 2020 22:59:11 +0000 (18:59 -0400)]
[Ada] T'Image calls T'Put_Image

2020-06-15  Bob Duff  <duff@adacore.com>

gcc/ada/

* exp_put_image.ads, exp_put_image.adb
(Image_Should_Call_Put_Image): New function to determine whether
the call to Put_Image should be generated.
(Build_Image_Call): New procedure to generate the call to
Put_Image.
* exp_imgv.adb (Expand_Image_Attribute): Use underlying types to
bypass privacy (only in Ada 2020). If
Image_Should_Call_Put_Image is True (which happens only in Ada
2020), then call Build_Image_Call.
* rtsfind.ads, rtsfind.adb: Add the necessary declarations in
Ada.Strings.Text_Output.Buffers.
* sem_attr.adb (Check_Image_Type): Enable the Ada 2020 case.
* libgnat/a-stoufo.ads, libgnat/a-stoufo.adb: Use the less
restrictive type that allows newline characters.

4 years ago[Ada] Minor editorial changes in comments
Gary Dismukes [Wed, 1 Apr 2020 16:38:16 +0000 (12:38 -0400)]
[Ada] Minor editorial changes in comments

2020-06-15  Gary Dismukes  <dismukes@adacore.com>

gcc/ada/

* exp_ch9.ads (Build_Master_Declaration): Add commas.
* exp_ch9.adb (Build_Master_Entity): Spelling fix ("build" =>
"built").
(Build_Task_Activation_Call): Fix word order.

4 years ago[Ada] Allow uninitialized values on Big_Positive/Natural
Arnaud Charlet [Wed, 1 Apr 2020 15:46:22 +0000 (11:46 -0400)]
[Ada] Allow uninitialized values on Big_Positive/Natural

2020-06-15  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

* libgnat/a-nbnbin.ads (Big_Positive, Big_Natural): Fix
predicate.

4 years ago[Ada] Fix analysis of Relaxed_Initialization for bodies-as-specs
Piotr Trojanek [Wed, 1 Apr 2020 09:43:39 +0000 (11:43 +0200)]
[Ada] Fix analysis of Relaxed_Initialization for bodies-as-specs

2020-06-15  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* sem_ch13.adb (Analyze_Aspect_Relaxed_Initialization): Fix
dealing with scopes on subprogram bodies that act as specs.
* sem_util.adb (Has_Relaxed_Initialization): Fix trivial
mistake.

4 years ago[Ada] Crash in tagged type constructor with task components
Javier Miranda [Sat, 28 Mar 2020 18:52:14 +0000 (14:52 -0400)]
[Ada] Crash in tagged type constructor with task components

2020-06-15  Javier Miranda  <miranda@adacore.com>

gcc/ada/

* restrict.ads (Set_Global_No_Tasking, Global_No_Tasking): New
subprograms.
* restrict.adb (Set_Global_No_Tasking, Global_No_Tasking): New
subprograms.
* sem_ch3.adb (Access_Definition): Do not skip building masters
since they may be required for BIP calls.
(Analyze_Subtype_Declaration): Propagate attribute
Is_Limited_Record in class-wide subtypes and subtypes with
cloned subtype attribute; propagate attribute
Is_Limited_Interface.
* sem_ch6.adb (Check_Anonymous_Return): Do not skip building
masters since they may be required for BIP calls. Use
Build_Master_Declaration to declare the _master variable.
(Create_Extra_Formals): Add decoration of Has_Master_Entity when
the _master formal is added.
* exp_ch3.adb (Init_Formals): Adding formal to decorate it with
attribute Has_Master_Entity when the _master formal is added.
(Build_Master): Do not skip building masters since they may be
required for BIP calls.
(Expand_N_Object_Declaration): Ensure activation chain and
master entity for objects initialized with BIP function calls.
* sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
Adding support to detect and save restriction No_Tasking when
set in the run-time package System or in a global configuration
pragmas file.
* sem_util.adb (Current_Entity_In_Scope): Overload this
subprogram to allow searching for an entity by its Name.
* sem_util.ads (Current_Entity_In_Scope): Update comment.
* exp_ch4.adb (Expand_N_Allocator): Do not skip building masters
since they may be required for BIP calls.
* exp_ch6.ads (Might_Have_Tasks): New subprogram.
* exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Add
support for BIP calls returning objects that may have tasks.
(Make_Build_In_Place_Call_In_Allocator): Build the activation
chain if the result might have tasks.
(Make_Build_In_Place_Iface_Call_In_Allocator): Build the class
wide master for the result type.
(Might_Have_Tasks): New subprogram.
(Needs_BIP_Task_Actuals): Returns False when restriction
No_Tasking is globally set.
* exp_ch9.ads (Build_Master_Declaration): New subprogram.
* exp_ch9.adb (Build_Activation_Chain_Entity): No action
performed when restriction No_Tasking is globally set.
(Build_Class_Wide_Master): No action performed when restriction
No_Tasking is globally set; use Build_Master_Declaration to
declare the _master variable.
(Build_Master_Declaration): New subprogram.
(Build_Master_Entity): No action performed when restriction
No_Tasking is globally set; added support to handle transient
scopes and _finalizer routines.
(Build_Master_Renaming): No action performed when restriction
No_Tasking is globally set.
(Build_Task_Activation_Call): Skip generating the call when
the chain is an ignored ghost entity.
(Find_Master_Scope): Generalize the code that detects transient
scopes with master entity.
* einfo.ads (Has_Nested_Subprogram): Minor comment reformatting.

4 years ago[Ada] Missing errors on aspect checking
Arnaud Charlet [Wed, 25 Mar 2020 10:15:26 +0000 (06:15 -0400)]
[Ada] Missing errors on aspect checking

2020-06-15  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

* sem_attr.adb (Eval_Attribute): Protect against previous
errors.
* sem_ch13.adb (Analyze_Aspect_Default_Value): Remove redundant
error checking, handling in Analyze_Aspect_Specifications.
(Analyze_Aspect_Specifications): Refine error messages on
Default_[Component_]Value.
(Check_Aspect_Too_Late): New procedure.
(Rep_Item_Too_Late.Is_Derived_Type_With_Constraint): Remove,
dead code.
* aspects.ads (Is_Representation_Aspect): Default_Value is a
representation aspect.

4 years ago[Ada] AI12-0260 Functions Is_Basic and To_Basic in Wide_Characters.Handling
Arnaud Charlet [Tue, 31 Mar 2020 11:47:17 +0000 (07:47 -0400)]
[Ada] AI12-0260 Functions Is_Basic and To_Basic in Wide_Characters.Handling

2020-06-15  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

* libgnat/a-wichha.ads, libgnat/a-wichha.adb,
libgnat/a-wichun.ads, libgnat/a-wichun.adb (Is_Basic, To_Basic):
New.
* libgnat/s-utf_32.ads, libgnat/s-utf_32.adb (Is_UTF_32_Basic,
To_UTF_32_Basic, Decomposition_Search): New subprograms.
(Unicode_Decomposition): New table.

4 years ago[Ada] Passing actual parameter values to out formals when Default_Value is set
Gary Dismukes [Tue, 31 Mar 2020 22:27:06 +0000 (18:27 -0400)]
[Ada] Passing actual parameter values to out formals when Default_Value is set

2020-06-15  Gary Dismukes  <dismukes@adacore.com>

gcc/ada/

* exp_ch6.adb (Add_Call_By_Copy_Code): In the case of a view
conversion passed to a scalar out-mode parameter where the
formal has Default_Value set, declare the copy temp with the
base type of the formal's subtype and initialize the copy temp
with the actual's value.

4 years ago[Ada] Bad access checks on if/case expression as actual
Justin Squirek [Thu, 12 Mar 2020 11:01:43 +0000 (07:01 -0400)]
[Ada] Bad access checks on if/case expression as actual

2020-06-15  Justin Squirek  <squirek@adacore.com>

gcc/ada/

* exp_ch4.adb (Expand_N_Case_Expression): Set default value for
Target to silence potential warnings.
(Expand_N_If_Expression): Add calculation to check when the if
expression is used directly in the context of an actual of an
anonymous access type and add a special path to force expansion
of the if expression in this case.
* exp_ch6.adb (Expand_Branch): Generate an assignment to the
level temporary for a given branch.
(Expand_Call_Helper): Add expansion to allow for creating a
temporary to store associated accessiblity levels on each branch
of the conditional expression.  Also perform expansion of
function calls into expressions with actions, and fixup
references to N with Call_Node.
(Insert_Level_Assign): Move through nested conditional
expressions to each branch.
* sem_util.ads, sem_util.adb (Is_Anonymous_Access_Actual): Added
to detect when to force expansion of if expressions.

4 years ago[Ada] Do not expect task discriminants in Global and Depends contracts
Piotr Trojanek [Tue, 31 Mar 2020 12:49:14 +0000 (14:49 +0200)]
[Ada] Do not expect task discriminants in Global and Depends contracts

2020-06-15  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* sem_prag.adb (Analyze_Depends_In_Decl_Part,
Analyze_Global_In_Decl_Part): Do not install task discriminants
for analysis of the Global/Depends contracts.

4 years ago[Ada] Do not expect Global or Depends on single protected objects
Piotr Trojanek [Thu, 26 Mar 2020 19:31:21 +0000 (20:31 +0100)]
[Ada] Do not expect Global or Depends on single protected objects

2020-06-15  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* contracts.adb (Analyze_Object_Contract): Do not expect
Global/Depends on single protected units.

4 years ago[Ada] Incorrect accessibility checks on functions calls
Justin Squirek [Mon, 30 Mar 2020 09:35:22 +0000 (05:35 -0400)]
[Ada] Incorrect accessibility checks on functions calls

2020-06-15  Justin Squirek  <squirek@adacore.com>

gcc/ada/

* sem_res.adb (Valid_Conversion): Add missing condition to
trigger proper static accessiblity failiures when the target
type is an anonymous access.

4 years ago[Ada] Replace repeated Ekind with Ekind_In
Piotr Trojanek [Mon, 23 Mar 2020 23:04:11 +0000 (00:04 +0100)]
[Ada] Replace repeated Ekind with Ekind_In

2020-06-15  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* exp_ch6.adb (Expand_Call_Helper): Replace repeated Ekind with
Ekind_In.

4 years ago[Ada] Remove excessive parens
Piotr Trojanek [Tue, 24 Mar 2020 09:27:10 +0000 (10:27 +0100)]
[Ada] Remove excessive parens

2020-06-15  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* exp_ch6.adb, sem_util.adb: Remove excessive parents,
especially since they don't make the code any easier to read.

4 years ago[Ada] Support aspect Relaxed_Initialization and attribute Initialized
Piotr Trojanek [Fri, 27 Mar 2020 22:39:03 +0000 (23:39 +0100)]
[Ada] Support aspect Relaxed_Initialization and attribute Initialized

2020-06-15  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* aspects.ads (Aspect_Id): Add Aspect_Relaxed_Initialization.
(Implementation_Defined_Aspect): Add new aspect.
(Aspect_Argument): Add new aspect with Optional_Expression
argument.
(Is_Representation_Aspect): Add new aspect as a
non-representation one.
(Aspect_Names): Add name for the new aspect.
(Aspect_Delay): Add new aspect as a non-delayed one.
* sem_ch3.adb: Minor reformatting.
* einfo.ads, einfo.adb (Is_Relaxed_Initialization_State): New
query; reuses existing code for querying abstract state options.
* exp_attr.adb (Expand_N_Attribute_Reference): For now ignore
attribute 'Initialized.
* sem_attr.adb (Analyze_Attribute_Old_Result): Allow attribute
'Result to be used in the aspect Relaxed_Initialization
expression.
(Analyze_Attribute): Analyze attribute 'Initialized; based on
existing code for attribute 'Valid_Scalars.
(Eval_Attribute): Do not expect attribute 'Initialized, just
like attribute 'Valid_Scalars is not expected.
* sem_ch13.adb (Analyze_Aspect_Relaxed_Initialization): New
routine.
(Analyze_Aspect_Specifications): Analyze new aspect in a
dedicated routine.
(Check_Aspect_At_Freeze_Point): Do not expect new aspect.
* sem_prag.adb (Analyze_Abstract_State): Support option
Relaxed_Initialization on abstract states.
* sem_util.ads, sem_util.adb (Has_Relaxed_Initialization): New
query for the GNATprove backend.
* snames.ads-tmpl (Snames): Add Name_Ids for the new aspect and
attribute; add an Attribute_Id for the new attribute.

4 years ago[Ada] Put_Image: Enable for access-to-subprogram types
Bob Duff [Mon, 30 Mar 2020 19:34:28 +0000 (15:34 -0400)]
[Ada] Put_Image: Enable for access-to-subprogram types

2020-06-15  Bob Duff  <duff@adacore.com>

gcc/ada/

* exp_put_image.adb, libgnat/s-putima.adb, libgnat/s-putima.ads,
rtsfind.ads: Enable Put_Image if Is_Access_Subprogram_Type (Typ).
Remove comment saying it's disabled in that case.  Rename
Put_Image_Access_Prot to be Put_Image_Access_Prot_Subp to
clarify that we're talking about access-to-subprogram, not
access-to-protected-object.

4 years ago[Ada] Clean up error handling of 'Image
Bob Duff [Mon, 30 Mar 2020 14:20:33 +0000 (10:20 -0400)]
[Ada] Clean up error handling of 'Image

2020-06-15  Bob Duff  <duff@adacore.com>

gcc/ada/

* sem_attr.adb (Check_Image_Type): New procedure for checking
the type, depending on language version. Disable the Ada 2020
support until the corresponding expander work is done.
(Analyze_Image_Attribute): Call Check_Image_Type.  Rearrange the
code to be simplier and more logical.  When P_Type is modified,
modify P_Base_Type accordingly.
* sem_util.adb (Is_Object_Image): Do not return False if the
prefix is a type. X'Image should be considered an image of an
object iff X is an object (albeit illegal pre-2020 if
nonscalar).

4 years ago[Ada] Put_Image: Enable for access-to-subprogram types
Bob Duff [Mon, 30 Mar 2020 14:18:34 +0000 (10:18 -0400)]
[Ada] Put_Image: Enable for access-to-subprogram types

2020-06-15  Bob Duff  <duff@adacore.com>

gcc/ada/

* libgnat/s-putima.ads, libgnat/s-putima.adb
(Put_Image_Access_Subp, Put_Image_Access_Prot): New procedures
for printing access-to-subprogram objects.  Remove an explicit
" ", because Put_Image includes the annoying leading blank.
* rtsfind.ads: Add new procedures in s-putima.
* exp_put_image.adb: Call new procedures as appropriate.

4 years ago[Ada] Put_Image: Implement for private types with full real type
Bob Duff [Mon, 30 Mar 2020 14:16:49 +0000 (10:16 -0400)]
[Ada] Put_Image: Implement for private types with full real type

2020-06-15  Bob Duff  <duff@adacore.com>

gcc/ada/

* exp_imgv.adb (Expand_Image_Attribute): Allow private types.
Put_Image generates Image for numeric types, and private types
whose full type is numeric. This requires the Conversion_OK flag
for integer and floating-point types. For fixed point, we need
the extra conversion.
* exp_put_image.adb (Build_Elementary_Put_Image_Call): Remove
special handling of real types.
(Enable_Put_Image): Enable for reals.

4 years ago[Ada] Put_Image improvements for strings
Bob Duff [Mon, 30 Mar 2020 14:14:27 +0000 (10:14 -0400)]
[Ada] Put_Image improvements for strings

2020-06-15  Bob Duff  <duff@adacore.com>

gcc/ada/

* exp_attr.adb (Put_Image): Use underlying type for strings.
Remove unchecked union processing.
* exp_put_image.adb (Tagged_Put_Image_Enabled): Use -gnatd_z to
enable default Put_Image for tagged types.  This allows testing
that feature.
(Build_String_Put_Image_Call): Set Conversion_OK flag.
(Make_Component_List_Attributes): Remove unchecked union
processing.
(Enable_Put_Image): Disable for unchecked unions.  Enable for
nonscalar types (which were mistakenly disabled in earlier
changes).
* debug.adb: Document -gnatd_z switch.
* libgnat/s-putima.adb (Put_Image_String, Put_Image_Wide_String,
Put_Image_Wide_Wide_String): Double double-quote characters.
Forget about special handling of control characters for now --
that's rare enough to not be a priority, and it's not clear what
the right thing to do is anyway.
* namet.adb: Minor: Improve debugger-friendliness.
* sinfo.ads: Minor: Add "???" comment.

4 years ago[Ada] Remove unreferenced and dubious Is_Renaming_Declaration
Piotr Trojanek [Wed, 25 Mar 2020 19:04:54 +0000 (20:04 +0100)]
[Ada] Remove unreferenced and dubious Is_Renaming_Declaration

2020-06-15  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* sem_util.ads, sem_util.adb (Is_Renaming_Declaration): Remove.

4 years ago[Ada] Link failure with call to expression function in precondition
Ed Schonberg [Mon, 30 Mar 2020 12:26:27 +0000 (08:26 -0400)]
[Ada] Link failure with call to expression function in precondition

2020-06-15  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* freeze.adb (Freeze_Expression): When traversing the tree
looking for the proper insertion point for the freeze node of an
entity that is declared in an outer scope, set the candidate
subprogram body node properly.  Previous code has an off-by-one
error.

4 years ago[Ada] Implement AI12-0077 Has_Same_Storage on objects of size zero
Eric Botcazou [Mon, 30 Mar 2020 10:38:01 +0000 (12:38 +0200)]
[Ada] Implement AI12-0077 Has_Same_Storage on objects of size zero

2020-06-15  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* exp_attr.adb (Expand_N_Attribute_Reference) <Has_Same_Storage>:
Do not do superfluous work.  Add the condition (X'Size /= 0) on
both paths and turn binary AND into short-circuit AND THEN.

4 years ago[Ada] Update 'Loop_Entry checking to match changes in 'Old rules.
Steve Baird [Fri, 27 Mar 2020 22:50:29 +0000 (15:50 -0700)]
[Ada] Update 'Loop_Entry checking to match changes in 'Old rules.

2020-06-15  Steve Baird  <baird@adacore.com>

gcc/ada/

* sem_attr.adb (Analyze_Attribute): In the Loop_Entry case,
replace a call to Statically_Denotes_Object with a call to
Statically_Names_Object and clean up the preceding comment.

4 years ago[Ada] Use uniform type resolution for membership tests
Eric Botcazou [Sun, 29 Mar 2020 13:42:31 +0000 (15:42 +0200)]
[Ada] Use uniform type resolution for membership tests

2020-06-15  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* sem_res.adb (Resolve_Set_Membership): Remove local variable.
In the non-overloaded case, call Intersect_Types on the left
operand and the first alternative to get the resolution type.
But test the subtype of the left operand to give the warning.

4 years agoRISC-V: Suppress warning for signed and unsigned integer comparison.
Kito Cheng [Mon, 15 Jun 2020 03:51:13 +0000 (11:51 +0800)]
RISC-V: Suppress warning for signed and unsigned integer comparison.

gcc/ChangeLog:

* config/riscv/riscv.c (riscv_gen_gpr_save_insn): Change type to
unsigned for i.
(riscv_gpr_save_operation_p): Change type to unsigned for i and
len.

4 years agoOptimize multiplication for V8QI,V16QI,V32QI under TARGET_AVX512BW.
liuhongt [Wed, 3 Jun 2020 09:25:47 +0000 (17:25 +0800)]
Optimize multiplication for V8QI,V16QI,V32QI under TARGET_AVX512BW.

2020-06-13   Hongtao Liu  <hongtao.liu@intel.com>

gcc/ChangeLog:
PR target/95488
* config/i386/i386-expand.c (ix86_expand_vecmul_qihi): New
function.
* config/i386/i386-protos.h (ix86_expand_vecmul_qihi): Declare.
* config/i386/sse.md (mul<mode>3): Drop mask_name since
there's no real simd int8 multiplication instruction with
mask. Also optimize it under TARGET_AVX512BW.
(mulv8qi3): New expander.

gcc/testsuite/ChangeLog:
* gcc.target/i386/avx512bw-pr95488-1.c: New test.
* gcc.target/i386/avx512bw-pr95488-2.c: Ditto.
* gcc.target/i386/avx512vl-pr95488-1.c: Ditto.
* gcc.target/i386/avx512vl-pr95488-2.c: Ditto.

4 years agoDaily bump.
GCC Administrator [Mon, 15 Jun 2020 00:16:21 +0000 (00:16 +0000)]
Daily bump.

4 years agoAvoid crash when global symbol table is empty with -fdump-fortran-global.
Thomas Koenig [Sun, 14 Jun 2020 15:37:49 +0000 (17:37 +0200)]
Avoid crash when global symbol table is empty with -fdump-fortran-global.

This just avoids a crash with -fdump-fortran-global when the
global symbol table is empty.  This is strictly a developer's
option, no user impact.

gcc/fortran/ChangeLog:

2020-06-14  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/42122
* dump-parse-tree.c (gfc_dump_global_symbols):  If the symroot is
empty, just output "empty".

4 years agoPR fortran/95088 - Buffer overflows with PDTs, submodules and long symbols
Harald Anlauf [Sun, 14 Jun 2020 14:12:47 +0000 (16:12 +0200)]
PR fortran/95088 - Buffer overflows with PDTs, submodules and long symbols

With PDTs (parameterized derived types) and submodules, name mangling
results in variably long internal symbols.  Instead of using a fixed-size
intermediate buffer, which is actually not really needed, just use a
pointer to strings.

2020-06-14  Harald Anlauf  <anlauf@gmx.de>

gcc/fortran/
PR fortran/95088
* class.c (get_unique_type_string): Replace use of fixed size
buffer by internally passing a pointer to strings.

4 years agoAlways use locations from get and put arguments for error messages.
Thomas Koenig [Sun, 14 Jun 2020 12:39:03 +0000 (14:39 +0200)]
Always use locations from get and put arguments for error messages.

A simple and obvios patch - the error location was taken
from a variable that was not initialized for optional
variables.

gcc/fortran/ChangeLog:

* check.c (gfc_check_random_seed): Always use locations
from get and put arguments for error messages.

gcc/testsuite/ChangeLog:

* gfortran.dg/random_seed_4.f90: New test.

4 years agoWhen avoiding double deallocation, look at namespace, expression and component.
Thomas Koenig [Sun, 14 Jun 2020 11:01:24 +0000 (13:01 +0200)]
When avoiding double deallocation, look at namespace, expression and component.

Our finalization handling is a mess.  Really, we should get to try and get
this fixed for gcc 11.

In the meantime, here is a patch which fixes a regression I introduced
when fixing a regression with a memory leak.  The important thing
here is to realize that we do not need to finalize (and deallocate)
multiple times for the same expression and the same component
in the same namespace.  It might cause code size regressions, but
better big code than wrong code...

gcc/fortran/ChangeLog:

PR fortran/94109
* class.c (finalize_component): Return early if finalization has
already happened for expression and component within namespace.
* gfortran.h (gfc_was_finalized): New type.
(gfc_namespace): Add member was_finalzed.
(gfc_expr): Remove finalized.
* symbol.c (gfc_free_namespace): Free was_finalized.

gcc/testsuite/ChangeLog:

PR fortran/94109
* gfortran.dg/finalize_34.f90: Adjust free counts.
* gfortran.dg/finalize_36.f90: New test.

4 years agod: Fix line lengths after mechanical field renames.
Iain Buclaw [Sun, 14 Jun 2020 09:42:01 +0000 (11:42 +0200)]
d: Fix line lengths after mechanical field renames.

gcc/d/ChangeLog:

* expr.cc (ExprVisitor::visit (AssocArrayLiteralExp *)): Fix line
lengths, no functional change.
* typeinfo.cc (TypeInfoVisitor::layout_interfaces): Likewise.
(layout_classinfo_interfaces): Likewise.

4 years agotestsuite: Re-add gdc.test prefix in test names (PR testsuite/95575)
Iain Buclaw [Sun, 14 Jun 2020 09:02:52 +0000 (11:02 +0200)]
testsuite: Re-add gdc.test prefix in test names (PR testsuite/95575)

gcc/testsuite/ChangeLog:

PR testsuite/95575
* lib/gdc-utils.exp (gdc-do-test): Re-add $subdir link and inclusion
in filename.

4 years agoDaily bump.
GCC Administrator [Sun, 14 Jun 2020 00:16:18 +0000 (00:16 +0000)]
Daily bump.

4 years agoCorrect test to avoid failures in ILP32.
Martin Sebor [Sat, 13 Jun 2020 17:29:01 +0000 (11:29 -0600)]
Correct test to avoid failures in ILP32.

Amends: PR middle-end/95353 - spurious -Wstringop-overflow writing to a trailing array plus offset.

gcc/testsuite/ChangeLog:
* gcc.dg/builtin-stringop-chk-5.c: Make assertions independent of
data model.

4 years agoRemove failing test case accidentally committed.
Thomas Koenig [Sat, 13 Jun 2020 09:40:52 +0000 (11:40 +0200)]
Remove failing test case accidentally committed.

When committing 0cfc34ad1293a5e19f1dc67c461c58d99222ac9d, I
accidentylly committed gcc/testsuite/gfortran.dg/finalize_36.f90 .
This removes this, again.

gcc/testsuite/ChangeLog:

* gfortran.dg/finalize_36.f90: Remove accidentally
committed test case.

4 years agoDisable -Wstringop-overflow warning after checking code path of caller.
Thomas Koenig [Sat, 13 Jun 2020 08:04:33 +0000 (10:04 +0200)]
Disable -Wstringop-overflow warning after checking code path of caller.

The warning that is disabled, only on this single line, has been
inspected and found to be not applicable; it is known that the size
of the buffer is safe.

libgfortran/ChangeLog:

2020-06-13  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR libfortran/95313
* io/write.c (ztoa_big): Disable -Wstringop-overflow for one
line.

4 years agoDaily bump.
GCC Administrator [Sat, 13 Jun 2020 00:16:25 +0000 (00:16 +0000)]
Daily bump.

4 years agoruntime: fix arenaBaseOffset for aix/ppc
Clément Chigot [Tue, 9 Jun 2020 09:36:01 +0000 (11:36 +0200)]
runtime: fix arenaBaseOffset for aix/ppc

The arenaBaseOffset modifications was aimed only for aix/ppc64.

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

4 years agogo.test: update issue4085b.go to version from Go 1.13
Ian Lance Taylor [Fri, 12 Jun 2020 21:00:11 +0000 (14:00 -0700)]
go.test: update issue4085b.go to version from Go 1.13

This lets the test pass on AIX.

Not updating to master because we get slightly different error messages,
so that is a more complex change.

4 years agotsan: Add param to disable func-entry-exit instrumentation
Marco Elver [Wed, 10 Jun 2020 14:21:21 +0000 (16:21 +0200)]
tsan: Add param to disable func-entry-exit instrumentation

Adds param tsan-instrument-func-entry-exit, which controls if
__tsan_func_{entry,exit} calls should be emitted or not. The default
behaviour is to emit the calls.

This may be required by alternative race detection runtimes. One such
runtime is the Kernel Concurrency Sanitizer (KCSAN):

https://github.com/google/ktsan/wiki/KCSAN

After this change, GCC should satisfy all requirements for KCSAN:

https://lore.kernel.org/lkml/20200515150338.190344-7-elver@google.com/

gcc/ChangeLog:

* gimplify.c (gimplify_function_tree): Optimize and do not emit
IFN_TSAN_FUNC_EXIT in a finally block if we do not need it.
* params.opt: Add --param=tsan-instrument-func-entry-exit=.
* tsan.c (instrument_memory_accesses): Make
fentry_exit_instrument bool depend on new param.

gcc/testsuite/ChangeLog:

* c-c++-common/tsan/func_entry_exit.c: New test.
* c-c++-common/tsan/func_entry_exit_disabled.c: New test.

4 years agoAdd .clang-tidy to git ignored.
Martin Liska [Fri, 12 Jun 2020 14:02:18 +0000 (16:02 +0200)]
Add .clang-tidy to git ignored.

Installed as obvious.

ChangeLog:

* .gitignore: Add .clang-tidy.

4 years agotestcase for shared DR alignment
Richard Biener [Fri, 12 Jun 2020 11:02:56 +0000 (13:02 +0200)]
testcase for shared DR alignment

This adds a reduced C testcase from libgomp.fortran/examples-4/target-1.f90
and libgomp.fortran/examples-4/target_data-1.f90 FAILs, showing a case
of SLP instance stmt sharing that affects the shared dataref alignment
info.

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

* gcc.dg/vect/bb-slp-44.c: New testcase.

4 years agovect: Fix an ICE in vect_loop_versioning [PR95570]
Fei Yang [Fri, 12 Jun 2020 10:37:00 +0000 (11:37 +0100)]
vect: Fix an ICE in vect_loop_versioning [PR95570]

In the test case for PR95570, the only data reference in the loop is a
gather-statter access.  Scalar evolution analysis for this data reference
failed, so DR_STEP is NULL_TREE.  This leads to the segmentation fault.
We should filter out scatter-gather access in vect_enhance_data_refs_alignment.

2020-06-12  Felix Yang  <felix.yang@huawei.com>

gcc/
PR tree-optimization/95570
* tree-vect-data-refs.c (vect_relevant_for_alignment_p): New function.
(vect_verify_datarefs_alignment): Call it to filter out data references
in the loop whose alignment is irrelevant.
(vect_get_peeling_costs_all_drs): Likewise.
(vect_peeling_supportable): Likewise.
(vect_enhance_data_refs_alignment): Likewise.

gcc/testsuite/

PR tree-optimization/95570
* gcc.dg/vect/pr95570.c: New test.

4 years agofix vectorizable_condition ICE with EXTRACT_LAST_REDUCTION
Richard Biener [Fri, 12 Jun 2020 10:06:53 +0000 (12:06 +0200)]
fix vectorizable_condition ICE with EXTRACT_LAST_REDUCTION

The previous reorg missed a guard around the else clause access.

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

PR tree-optimization/95633
* tree-vect-stmts.c (vectorizable_condition): Properly
guard the vec_else_clause access with EXTRACT_LAST_REDUCTION.

4 years agolibstdc++: Improve tests for std::atomic_flag
Jonathan Wakely [Fri, 12 Jun 2020 09:33:37 +0000 (10:33 +0100)]
libstdc++: Improve tests for std::atomic_flag

The tests for clear() and test_and_set() didn't cover all cases.

* testsuite/29_atomics/atomic_flag/clear/1.cc: Also test clear()
when the value is currently set.
* testsuite/29_atomics/atomic_flag/test_and_set/explicit.cc:
Actually check the return value.
* testsuite/29_atomics/atomic_flag/test_and_set/implicit.cc:
Likewise.

4 years agolibstdc++: Make std::atomic_flag::test members const
Jonathan Wakely [Fri, 12 Jun 2020 09:22:05 +0000 (10:22 +0100)]
libstdc++: Make std::atomic_flag::test members const

Also fix the tests so they run without an explicit -std=gnu++2a in the
RUNTESTFLAGS, and test the new function on const-qualified objects.

* include/bits/atomic_base.h (atomic_flag::test): Add missing
const qualifiers.
* testsuite/29_atomics/atomic_flag/test/explicit.cc: Add
dg-options and verify results of test function.
* testsuite/29_atomics/atomic_flag/test/implicit.cc: Likewise.

4 years ago[Ada] Fix anonymous-to-named access type implicit conversion legality checking
Steve Baird [Fri, 27 Mar 2020 18:56:40 +0000 (11:56 -0700)]
[Ada] Fix anonymous-to-named access type implicit conversion legality checking

2020-06-12  Steve Baird  <baird@adacore.com>

gcc/ada/

* sem_res.adb (Valid_Conversion): The simpler cases of
violations of the aforementioned 8.6 rule are already handled
correctly. These include cases where the operand of the type
conversion is an access parameter or a stand-alone object of an
anonymous access type. Add code to detect violations where the
operand of the type conversion is an access discriminant whose
accessibility level is tied to one of the other simpler cases.
This is implemented in a new function,
Valid_Conversion.Is_Discrim_Of_Bad_Access_Conversion_Argument,
which is called in place of the previous test.

4 years ago[Ada] Enable Put_Image in pre-Ada-2020 modes
Bob Duff [Fri, 27 Mar 2020 12:26:19 +0000 (08:26 -0400)]
[Ada] Enable Put_Image in pre-Ada-2020 modes

2020-06-12  Bob Duff  <duff@adacore.com>

gcc/ada/

* exp_attr.adb (Put_Image): Remove assertion. This assertion is
False in mixed-Ada-version programs.
* exp_put_image.adb (Tagged_Put_Image_Enabled): New flag to make
it easy to experiment with Put_Image on tagged types. False in
this version.
(Enable_Put_Image): Enable in pre-2020.  Workarounds: Disable
for tagged types if Tagged_Put_Image_Enabled is False. Disable
for access-to-subprogram types.  Disable if errors have been
detected, or Sink is unavailable.
(Preload_Sink): Move all conditionals here, from Sem_Ch10, so
they can be nearby related code in Enable_Put_Image.  Load Sink
only if we have seen a tagged type.  This removes the dilemma
about calling Preload_Sink when compiling the compiler, which
caused unwanted dependences.
* exp_put_image.ads (Preload_Sink): New formal Compilation_Unit,
needed to move all conditionals here, from Sem_Ch10.
* libgnat/a-stouut.adb (Put_UTF_8): Make this suitable for
inlining, so we don't get warnings about inlining in some tests.
And so it can be inlined!
* opt.ads (Tagged_Seen): New flag (see Preload_Sink).
* scng.adb (Scan): Set new Tagged_Seen flag.
* sem_ch10.adb (Analyze_Compilation_Unit): Move conditionals and
comments regarding Preload_Sink into Preload_Sink.

4 years ago[Ada] AI12-0074 View conversions and out parameters passed by copy
Arnaud Charlet [Thu, 26 Mar 2020 09:53:30 +0000 (05:53 -0400)]
[Ada] AI12-0074 View conversions and out parameters passed by copy

2020-06-12  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

* sem_res.adb (Resolve_Actuals): Check for AI12-0074.

4 years ago[Ada] Bump secondary stack alignment factor in full runtimes
Olivier Hainque [Tue, 24 Mar 2020 08:49:29 +0000 (08:49 +0000)]
[Ada] Bump secondary stack alignment factor in full runtimes

2020-06-12  Olivier Hainque  <hainque@adacore.com>

gcc/ada/

* libgnat/s-secsta.ads (Memory_Alignment): New constant, memory
alignment for chunks and allocated blocks. Initialize to
Standard'Maximum_Alignment * 2.
(Chunk_Memory): Use it.
* libgnat/s-secsta.adb (Round_Up): Likewise.

4 years ago[Ada] Alphabetic ordering for name and pragmas
Piotr Trojanek [Wed, 25 Mar 2020 17:59:04 +0000 (18:59 +0100)]
[Ada] Alphabetic ordering for name and pragmas

2020-06-12  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* par-prag.adb: Fix ordering.
* snames.ads-tmpl (Name_Test_Case, Pragma_Test_Case): Likewise.
* sem_prag.adb (Sig_Flags): Likewise.

4 years ago[Ada] Fix handling of Ada 83 OUT parameter rule
Arnaud Charlet [Wed, 25 Mar 2020 17:39:46 +0000 (13:39 -0400)]
[Ada] Fix handling of Ada 83 OUT parameter rule

2020-06-12  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

* sem_res.adb (Resolve_Entity_Name): Fix handling of expressions
containing array attributes wrt Ada 83 detection.

4 years ago[Ada] Implement AI12-0369
Steve Baird [Mon, 23 Mar 2020 23:20:17 +0000 (16:20 -0700)]
[Ada] Implement AI12-0369

2020-06-12  Steve Baird  <baird@adacore.com>

gcc/ada/

* sem_util.ads, sem_util.adb: Define 3 new Boolean-valued
functions - Statically_Denotes_Entity,
Statically_Denotes_Object, and Statically_Names_Object. The
first two were taken from sem_attr.adb. The term "statically
names" is defined in the Ada RM and the new function
Statically_Names_Object is intended to reflect that definition,
or more precisely, as described in a comment in the code, to
reflect the expected future definition of that term.
* sem_attr.adb: Delete functions Statically_Denotes_Object and
Statically_Denotes_Entity; these two functions have been moved
to package Sem_Util. Replace call to Statically_Denotes_Object
with a call to Statically_Names_Object as per AI12-0217 (a
binding interpretation, so no Ada_Version check).
* exp_ch9.adb (Expand_Entry_Barrier.Is_Simple_Barrier): Change
name of function (it was previously Is_Simple_Barrier_Name)
because the function should return True in the case of a static
expression; implement this requirement.  Change function to
include a call to Statically_Names_Object so that, for Ada_2020
and later, it will return True for appropriate subcomponent
names.
(Expand_Entry_Barrier.Is_Pure_Barrier): Handle
N_Indexed_Component and N_Selected_Component cases by calling
Statically_Names_Object.
(Expand_Entry_Barrier): Reorganize to treat Simple_Barriers and
Pure_Barriers more uniformly.  Prevent cascaded errors.

4 years ago[Ada] Compiler locks up with -gnatX and formal subprogram with aspects
Ed Schonberg [Wed, 25 Mar 2020 16:49:13 +0000 (12:49 -0400)]
[Ada] Compiler locks up with -gnatX and formal subprogram with aspects

2020-06-12  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_ch12.adb (Find_Matching_Actual): Add guard on search loops
to detect a compilation error when using a compiler built
without assertions.
(Instantiate_Formal_Subprogram): Create a new subprogram name
for the actual only if formal has contract aspects and expansion
is enabled.

4 years ago[Ada] Improve code generated for assignment of dynamic record aggregates
Eric Botcazou [Tue, 24 Mar 2020 13:57:09 +0000 (14:57 +0100)]
[Ada] Improve code generated for assignment of dynamic record aggregates

2020-06-12  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* exp_aggr.adb: Add with and use clauses for Sem_Mech.
(Get_Base_Object): New function to get the base object of a node.
(In_Place_Assign_OK): Add Target_Object parameter.  Deal with a
qualified expression on entry.  Remove short-circuit for array
aggregates with a single "others" choice.  Do not look into the
components of the aggregate if the parent is an allocator.
(Check_Component): Add T_OK parameter and rewrite.
(Safe_Component): Invoke Check_Component with T_OK set to False.
(Convert_To_Assignments): Try to use an in-place assignment for
any target; for that, call Get_Base_Object on the target and pass
the result to In_Place_Assign_OK.
(Expand_Array_Aggregate): Use Parent_Kind and Parent_Node more
consistently.  For an assignment, call Get_Base_Object on the
target and pass the result to In_Place_Assign_OK.

4 years ago[Ada] Don't correct socket timeout on Windows Server 2019
Dmitriy Anisimkov [Mon, 23 Mar 2020 10:16:51 +0000 (16:16 +0600)]
[Ada] Don't correct socket timeout on Windows Server 2019

2020-06-12  Dmitriy Anisimkov  <anisimko@adacore.com>

gcc/ada/

* socket.c (__gnat_minus_500ms): Use GetVersionEx to detect
Windows Server version.
* libgnat/g-sothco.ads (Minus_500ms_Windows_Timeout): Remade to
Boolean constant.
* libgnat/g-socket.adb (Set_Socket_Option): Use
Minus_500ms_Windows_Timeout constant instead of function call.