gcc.git
4 years agolibstdc++: Define std::bad_optional_access constructor as defaulted
Jonathan Wakely [Tue, 9 Jun 2020 21:13:37 +0000 (22:13 +0100)]
libstdc++: Define std::bad_optional_access constructor as defaulted

The standard requires that std::bad_optional_access' default
constructor has a non-throwing exception specification.

* include/std/optional (bad_optional_access): Define default
constructor and destructor as defaulted.
* testsuite/20_util/optional/bad_access.cc: New test.

4 years agoPowerPC: Add future hwcap2 bits
Michael Meissner [Tue, 9 Jun 2020 20:35:43 +0000 (15:35 -0500)]
PowerPC: Add future hwcap2 bits

This patch adds support for the two new HWCAP2 fields used by the
__builtin_cpu_supports function.  It adds support in the target_clones
attribute for -mcpu=future.

The two new __builtin_cpu_supports tests are:
__builtin_cpu_supports ("isa_3_1")
__builtin_cpu_supports ("mma")

The bits used are the bits that the Linux kernel engineers will be using for
these new features.

gcc/
2020-06-09  Michael Meissner  <meissner@linux.ibm.com>

* config/rs6000/ppc-auxv.h (PPC_PLATFORM_FUTURE): Allocate
'future' PowerPC platform.
(PPC_FEATURE2_ARCH_3_1): New HWCAP2 bit for ISA 3.1.
(PPC_FEATURE2_MMA): New HWCAP2 bit for MMA.
* config/rs6000/rs6000-call.c (cpu_supports_info): Add ISA 3.1 and
MMA HWCAP2 bits.
* config/rs6000/rs6000.c (CLONE_ISA_3_1): New clone support.
(rs6000_clone_map): Add 'future' system target_clones support.

testsuite/
2020-06-09  Michael Meissner  <meissner@linux.ibm.com>

* gcc.target/powerpc/clone3.c: New test for using 'future' with
the target_clones attribute.

4 years agoPowerPC: Add future hwcap2 bits
Michael Meissner [Tue, 9 Jun 2020 20:32:52 +0000 (15:32 -0500)]
PowerPC: Add future hwcap2 bits

This patch adds support for the two new HWCAP2 fields used by the
__builtin_cpu_supports function.  It adds support in the target_clones
attribute for -mcpu=future.

The two new __builtin_cpu_supports tests are:
__builtin_cpu_supports ("isa_3_1")
__builtin_cpu_supports ("mma")

The bits used are the bits that the Linux kernel engineers will be using for
these new features.

testsuite/
2020-06-05  Michael Meissner  <meissner@linux.ibm.com>

* gcc.target/powerpc/clone3.c: New test for using 'future' with
the target_clones attribute.

4 years agoPowerPC: Add future hwcap2 bits
Michael Meissner [Tue, 9 Jun 2020 20:32:02 +0000 (15:32 -0500)]
PowerPC: Add future hwcap2 bits

This patch adds support for the two new HWCAP2 fields used by the
__builtin_cpu_supports function.  It adds support in the target_clones
attribute for -mcpu=future.

The two new __builtin_cpu_supports tests are:
__builtin_cpu_supports ("isa_3_1")
__builtin_cpu_supports ("mma")

The bits used are the bits that the Linux kernel engineers will be using for
these new features.

gcc/
2020-06-05  Michael Meissner  <meissner@linux.ibm.com>

* config/rs6000/ppc-auxv.h (PPC_PLATFORM_FUTURE): Allocate
'future' PowerPC platform.
(PPC_FEATURE2_ARCH_3_1): New HWCAP2 bit for ISA 3.1.
(PPC_FEATURE2_MMA): New HWCAP2 bit for MMA.
* config/rs6000/rs6000-call.c (cpu_supports_info): Add ISA 3.1 and
MMA HWCAP2 bits.
* config/rs6000/rs6000.c (CLONE_ISA_3_1): New clone support.
(rs6000_clone_map): Add 'future' system target_clones support.

4 years agoPowerPC: Add pcrel/prefixed target supports.
Michael Meissner [Tue, 9 Jun 2020 20:17:12 +0000 (15:17 -0500)]
PowerPC: Add pcrel/prefixed target supports.

2020-06-09  Michael Meissner  <meissner@linux.ibm.com>

* lib/target-supports.exp (check_effective_target_powerpc_pcrel):
New.
(check_effective_target_powerpc_prefixed_addr): New.

4 years agoWhen specifying a non-system prefix with --with-zstd, the build fails because the...
Michael Kuhn [Tue, 9 Jun 2020 20:05:07 +0000 (14:05 -0600)]
When specifying a non-system prefix with --with-zstd, the build fails because the header and library cannot be found (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95005).

The attached patch fixes the problem and is what we use in Spack to
make GCC build with zstd support.

gcc/
* Makefile.in (ZSTD_INC): Define.
(ZSTD_LIB): Include ZSTD_LDFLAGS.
(CFLAGS-lto-compress.o): Add ZSTD_INC.
* configure.ac (ZSTD_CPPFLAGS, ZSTD_LDFLAGS): New variables for
AC_SUBST.
* configure: Rebuilt.

4 years agoasan: fix wrong options for a test-case.
Martin Liska [Tue, 9 Jun 2020 19:54:35 +0000 (21:54 +0200)]
asan: fix wrong options for a test-case.

gcc/testsuite/ChangeLog:

* c-c++-common/asan/inline-kernel.c: Add missing
-fno-sanitize-address option.

4 years agocoroutines: Ensure distinct DTOR trees [PR95137].
Iain Sandoe [Tue, 9 Jun 2020 18:17:14 +0000 (19:17 +0100)]
coroutines: Ensure distinct DTOR trees [PR95137].

Part of the PR notes that there are UBSAN fails for the coroutines
test suite.  These are primarily related to the use of the same DTOR
tree in the two edges from the await block.  Fixed by building a new
tree for each.

gcc/cp/ChangeLog:

PR c++/95137
* coroutines.cc (expand_one_await_expression): Build separate
DTOR trees for the awaitable object on the destroy and resume
paths.

4 years agogcc-changelog: Use non-zero exit status on error
Jonathan Wakely [Tue, 9 Jun 2020 19:39:39 +0000 (20:39 +0100)]
gcc-changelog: Use non-zero exit status on error

Also add comment explaining what the script does.

contrib/ChangeLog:

* gcc-changelog/git_email.py: Set exit status on error.

4 years agotree-inline: Fix VLA handling [PR95552]
Jason Merrill [Fri, 5 Jun 2020 20:36:27 +0000 (16:36 -0400)]
tree-inline: Fix VLA handling [PR95552]

The problem in this testcase comes from cloning the constructor into
complete and base variants.  When we clone the body the first time,
walk_tree_1 calls copy_tree_body_r on the type of the artificial TYPE_DECL
we made for the VLA type without calling it on the decl itself, so we
overwrite the type of the TYPE_DECL without copying the decl first.

This has been broken since we started inserting a TYPE_DECL for anonymous
VLAs in r7-457.

This patch fixes walk_tree_1 to call the function on the TYPE_DECL, as we do
for other decls of a DECL_EXPR.

gcc/ChangeLog:

PR c++/95552
* tree.c (walk_tree_1): Call func on the TYPE_DECL of a DECL_EXPR.

gcc/testsuite/ChangeLog:

PR c++/95552
* g++.dg/ext/vla23.C: New test.

4 years agotsan: Add optional support for distinguishing volatiles
Marco Elver [Tue, 9 Jun 2020 13:15:39 +0000 (15:15 +0200)]
tsan: Add optional support for distinguishing volatiles

Add support to optionally emit different instrumentation for accesses to
volatile variables. While the default TSAN runtime likely will never
require this feature, other runtimes for different environments that
have subtly different memory models or assumptions may require
distinguishing volatiles.

One such environment are OS kernels, where volatile is still used in
various places, and often declare volatile to be appropriate even in
multi-threaded contexts. One such example is the Linux kernel, which
implements various synchronization primitives using volatile
(READ_ONCE(), WRITE_ONCE()).

Here the Kernel Concurrency Sanitizer (KCSAN), is a runtime that uses
TSAN instrumentation but otherwise implements a very different approach
to race detection from TSAN:

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

Due to recent changes in requirements by the Linux kernel, KCSAN
requires that the compiler supports tsan-distinguish-volatile (among
several new requirements):

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

gcc/
* params.opt: Define --param=tsan-distinguish-volatile=[0,1].
* sanitizer.def (BUILT_IN_TSAN_VOLATILE_READ1): Define new
builtin for volatile instrumentation of reads/writes.
(BUILT_IN_TSAN_VOLATILE_READ2): Likewise.
(BUILT_IN_TSAN_VOLATILE_READ4): Likewise.
(BUILT_IN_TSAN_VOLATILE_READ8): Likewise.
(BUILT_IN_TSAN_VOLATILE_READ16): Likewise.
(BUILT_IN_TSAN_VOLATILE_WRITE1): Likewise.
(BUILT_IN_TSAN_VOLATILE_WRITE2): Likewise.
(BUILT_IN_TSAN_VOLATILE_WRITE4): Likewise.
(BUILT_IN_TSAN_VOLATILE_WRITE8): Likewise.
(BUILT_IN_TSAN_VOLATILE_WRITE16): Likewise.
* tsan.c (get_memory_access_decl): Argument if access is
volatile. If param tsan-distinguish-volatile is non-zero, and
access if volatile, return volatile instrumentation decl.
(instrument_expr): Check if access is volatile.

gcc/testsuite/
* c-c++-common/tsan/volatile.c: New test.

4 years agoPowerPC: PowerPC tests: Add prefixed/pcrel tests.
Michael Meissner [Tue, 9 Jun 2020 18:48:24 +0000 (14:48 -0400)]
PowerPC: PowerPC tests: Add prefixed/pcrel tests.

testsuite/
2020-06-09  Michael Meissner  <meissner@linux.ibm.com>

* lib/target-supports.exp (check_effective_target_powerpc_pcrel):
New.
(check_effective_target_powerpc_prefixed_addr): New.

4 years agoRemove dead code
Richard Biener [Tue, 9 Jun 2020 16:23:22 +0000 (18:23 +0200)]
Remove dead code

This removes dead code left over from the reduction vectorization
refactoring last year.

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

* tree-vect-loop.c (vectorizable_induction): Remove dead code.

4 years agod: Merge upstream dmd 13d67c575.
Iain Buclaw [Tue, 9 Jun 2020 16:56:52 +0000 (18:56 +0200)]
d: Merge upstream dmd 13d67c575.

Reviewed-on: https://github.com/dlang/dmd/pull/11224

gcc/d/ChangeLog:

* dmd/MERGE: Merge upstream dmd 13d67c575.
* d-builtins.cc (build_frontend_type): Update call to
TypeVector::create.
* d-frontend.cc (Global::_init): Move setting of errorLimit to ...
* d-lang.cc (d_init_options): ... here.  Update for new field
location of errorLimit.
(d_post_options): Likewise.
* d-port.cc (Port::readwordLE): Update signature.
(Port::readwordBE): Likewise.
(Port::readlongLE): Likewise.
(Port::readlongBE): Likewise.
* decl.cc (get_symbol_decl): Update for new field types.

4 years agoc++: Tweak predeclare_vla.
Jason Merrill [Sat, 6 Jun 2020 04:07:21 +0000 (00:07 -0400)]
c++: Tweak predeclare_vla.

We only need to predeclare a VLA type if it's wrapped in a pointer type;
otherwise gimplify_type_sizes will handle it.

gcc/cp/ChangeLog:

PR c++/95552
* cp-gimplify.c (predeclare_vla): Only predeclare a VLA if it's
wrapped in a pointer type.

4 years agoopenmp: ensure variables in offload table are streamed out (PRs 94848 + 95551)
Tobias Burnus [Tue, 9 Jun 2020 14:31:22 +0000 (16:31 +0200)]
openmp: ensure variables in offload table are streamed out (PRs 94848 + 95551)

gcc/ChangeLog:

* omp-offload.c (add_decls_addresses_to_decl_constructor,
omp_finish_file): With in_lto_p, stream out all offload-table
items even if the symtab_node does not exist.

4 years agoRemove dead code
Richard Biener [Tue, 9 Jun 2020 14:00:43 +0000 (16:00 +0200)]
Remove dead code

This removes dead code that was left over from the reduction
vectorization refactoring last year.

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

* tree-vect-stmts.c (vect_transform_stmt): Remove dead code.

4 years agoFix some ChangeLog entries
Patrick Palka [Tue, 9 Jun 2020 13:57:25 +0000 (09:57 -0400)]
Fix some ChangeLog entries

4 years agogcov-dump: fix --help spacing
Martin Liska [Tue, 9 Jun 2020 12:39:26 +0000 (14:39 +0200)]
gcov-dump: fix --help spacing

Pushed to master.

gcc/ChangeLog:

* gcov-dump.c (print_usage): Fix spacing for --raw option
in --help.

4 years agosanitizer: do not inline no-sanitize into sanitizer fn
Martin Liska [Tue, 9 Jun 2020 11:03:55 +0000 (13:03 +0200)]
sanitizer: do not inline no-sanitize into sanitizer fn

gcc/ChangeLog:

* cif-code.def (ATTRIBUTE_MISMATCH): Rename to...
(SANITIZE_ATTRIBUTE_MISMATCH): ...this.
* ipa-inline.c (sanitize_attrs_match_for_inline_p):
Handle all sanitizer options.
(can_inline_edge_p): Use renamed CIF_* enum value.

gcc/testsuite/ChangeLog:

* c-c++-common/asan/inline.c: New test.
* c-c++-common/asan/inline-kernel.c: New test.
* c-c++-common/tsan/inline.c: New test.
* c-c++-common/ubsan/inline.c: New test.

4 years agoAArch64+SVE: Add support for unpacked unary ops and BIC
Joe Ramsay [Tue, 9 Jun 2020 11:23:56 +0000 (12:23 +0100)]
AArch64+SVE: Add support for unpacked unary ops and BIC

MD patterns extended for unary ops ABS, CLS, CLZ, CNT, NEG and NOT
to support unpacked vectors. Also extended patterns for BIC to
support unpacked vectors where input elements are of the same width.

gcc/ChangeLog:

2020-06-09  Joe Ramsay  <joe.ramsay@arm.com>

* config/aarch64/aarch64-sve.md (<optab><mode>2): Add support for
unpacked vectors.
(@aarch64_pred_<optab><mode>): Add support for unpacked vectors.
(@aarch64_bic<mode>): Enable unpacked BIC.
(*bic<mode>3): Enable unpacked BIC.

gcc/testsuite/ChangeLog:

2020-06-09  Joe Ramsay  <joe.ramsay@arm.com>

* gcc.target/aarch64/sve/logical_unpacked_abs.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_bic_1.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_bic_2.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_bic_3.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_bic_4.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_neg.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_not.c: New test.

4 years agogcov: improve --coverage small example
Martin Liska [Tue, 9 Jun 2020 11:14:57 +0000 (13:14 +0200)]
gcov: improve --coverage small example

Pushed to master.

gcc/ChangeLog:

PR gcov-profile/95365
* doc/gcov.texi: Compile and link one example in 2 steps.

4 years agolibgcov: fix TOPN type casting
Martin Liska [Mon, 8 Jun 2020 18:07:08 +0000 (20:07 +0200)]
libgcov: fix TOPN type casting

The patch fixes tree-prof.exp tests on solaris11 and i686-linux-gnu,
problem was that sizeof of a pointer is different from sizeof gcov_type.

I'm going to install it if there are no objections.
Thanks,
Martin

libgcc/ChangeLog:

PR gcov-profile/95494
* libgcov-driver.c (write_top_counters): Cast first to
intptr_t as sizeof(*) != sizeof(gcov_type).
* libgcov.h (gcov_counter_set_if_null): Remove.
(gcov_topn_add_value): Cast first to intptr_t and update
linked list directly.

4 years ago[Ada] Missing check on private overriding of dispatching primitive
Javier Miranda [Sun, 1 Mar 2020 19:04:48 +0000 (14:04 -0500)]
[Ada] Missing check on private overriding of dispatching primitive

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

gcc/ada/

* sem_ch6.adb (New_Overloaded_Entity): Add missing call to check
subtype conformance of overriding dispatching primitive.
* sem_eval.adb (Subtypes_Statically_Match): Handle derivations
of private subtypes.
* libgnat/g-exptty.adb, libgnat/g-exptty.ads
(Set_Up_Communications): Fix the profile since null-exclusion is
missing in the access type formals.
* sem_disp.ads (Check_Operation_From_Private_View): Adding
documentation.

4 years ago[Ada] Small enhancement in XEinfo utility
Eric Botcazou [Tue, 3 Mar 2020 15:13:20 +0000 (16:13 +0100)]
[Ada] Small enhancement in XEinfo utility

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

gcc/ada/

* einfo.ads (XEINFO section): Update format description.
(Is_Subprogram_Or_Entry): Move pragma to regular section.
(Is_Subprogram_Or_Generic_Subprogram): Likewise.
* xeinfo.adb (Get_B4): Rename to...
(Get_B0): ...this.
(Translate_Expr): New procedure extracted from...
(XEinfo): ...here.  Try to apply Get_B0 first and then
call Translate_Expr to translate supported constructs.

4 years ago[Ada] Implement AI12-0028: Import of variadic C functions
Eric Botcazou [Tue, 3 Mar 2020 11:44:18 +0000 (12:44 +0100)]
[Ada] Implement AI12-0028: Import of variadic C functions

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

gcc/ada/

* exp_ch6.adb (Freeze_Subprogram): Deal with convention C_Family.
* freeze.adb (Freeze_Profile): Likewise.  Add missing guard.
* sem_mech.adb (Set_Mechanisms): Likewise.
* lib-xref.adb (Output_Import_Export_Info): Ditto for C_Variadic.
* repinfo.adb (List_Subprogram_Info): Likewise.
* sem_prag.adb (Set_Convention_From_Pragma): Move main checks for
Stdcall to...
(Process_Convention): ...here.  Add checks for C_Variadic.
* snames.ads-tmpl: Add Name_C_Variadic_0 .. Name_C_Variadic_16.
Use consistent format for subtype declarations.
(Convention_Id): Add Convention_C_Variadic_0 .. C_Variadic_16
and move Convention_CPP up.
(Convention_C_Family): New subtype of Convention_Id.
(Convention_C_Variadic): Likewise.
(Foreign_Convention): Use explicit upper bound.
Add pragma Inline for Is_Configuration_Pragma_Name,
Is_Function_Attribute_Name, Is_Internal_Attribute_Name
and Is_Procedure_Attribute_Name.
* snames.adb-tmpl (Get_Convention_Id): Deal with Name_Variadic_n.
(Get_Convention_Name): Deal with Convention_Variadic_n.
* types.h (Convention_Id): New typedef.
* xsnamest.adb (Name2): New variable.
(Is_Conv): New pattern.
(Get_Subt1): Likewise.
(Get_Subt2): Likewise.
Output subtypes of Convention_Id into the C header file.

4 years ago[Ada] Code clean ups and comments updates
Arnaud Charlet [Tue, 3 Mar 2020 16:51:49 +0000 (11:51 -0500)]
[Ada] Code clean ups and comments updates

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

gcc/ada/

* exp_ch3.adb, exp_ch4.adb, exp_ch6.adb, exp_ch9.adb,
exp_disp.adb, exp_util.adb: Add comments related to errors that
should be moved to semantic analysis. Also replace "?" with "??"
in warning messages.

4 years ago[Ada] Improve handling of null unbounded strings
Arnaud Charlet [Sun, 1 Mar 2020 15:07:11 +0000 (10:07 -0500)]
[Ada] Improve handling of null unbounded strings

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

gcc/ada/

* libgnat/a-strunb__shared.ads, libgnat/a-strunb__shared.adb
(Reference, Unreference): No-op for Empty_Shared_String.
Remove unneeded calls to Reference.

4 years ago[Ada] Remove kludge for AI05-0087
Arnaud Charlet [Mon, 2 Mar 2020 11:58:01 +0000 (06:58 -0500)]
[Ada] Remove kludge for AI05-0087

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

gcc/ada/

* exp_ch5.adb (Expand_N_Assignment): Remove kludge for
AI05-0087.
* sem_ch12.adb (Validate_Derived_Type_Instance): Implement
AI05-0087 retroactively since it's a binding interpretation.

4 years ago[Ada] Small cleanup in Einfo unit
Eric Botcazou [Mon, 2 Mar 2020 11:46:14 +0000 (12:46 +0100)]
[Ada] Small cleanup in Einfo unit

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

gcc/ada/

* einfo.ads (Has_Foreign_Convention): Fix description.
(Component_Alignment): Move around.
(Has_DIC): Likewise.
(Has_Interrupt_Handler): Likewise.
(Has_Invariants): Likewise.
(Is_Atomic_Or_VFA): Likewise.
(Next_Index): Likewise.
(Scope_Depth): Likewise.
(Init_Component_Size): Likewise.
(Init_Component_Location): Likewise.
(Init_Size): Likewise.
(Inline Pragmas for functions): Add Corresponding_Function,
Corresponding_Procedure, Entry_Max_Queue_Lengths_Array,
Finalize_Storage_Only, Has_DIC, Has_Invariants,
Initialization_Statements, Is_Anonymous_Access_Type,
Next_Stored_Discriminant, Address_Clause, Alignment_Clause,
Float_Rep, Has_Foreign_Convention, Has_Non_Limited_View,
Is_Constant_Object, Is_Discriminal, Is_Finalizer, Is_Null_State,
Is_Prival, Is_Protected_Component, Is_Protected_Record_Type,
Is_Subprogram_Or_Entry, Is_Task_Record_Type, Size_Clause,
Stream_Size_Clause, Type_High_Bound, Type_Low_Bound, Known_*,
Unknown_*.
(Inline Pragmas for procedures): Add Set_Corresponding_Function,
Set_Corresponding_Procedure, Set_Finalize_Storage_Only,
Set_Float_Rep, Set_Initialization_Statements,
Init_Normalized_First_Bit, Init_Normalized_Position,
Init_Normalized_Position_Max.
* einfo.adb (Was_Hidden): Move around.
(Is_Packed_Array): Likewise.
(Model_Emin_Value): Likewise.
(Model_Epsilon_Value): Likewise.
(Model_Mantissa_Value): Likewise.
(Model_Small_Value): Likewise.

4 years ago[Ada] Ada2020 AI12-0282: Shared variable control aspects in generics
Ed Schonberg [Fri, 28 Feb 2020 19:26:02 +0000 (14:26 -0500)]
[Ada] Ada2020 AI12-0282: Shared variable control aspects in generics

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

gcc/ada/

* sem_ch12.adb (Check_Shared_Variable_Control_Aspects): Require
exact match between formal and actual for aspects Atomic and
Volatile only for formal derived types.

4 years ago[Ada] Improve handling of aggregates in Side_Effect_Free
Arnaud Charlet [Mon, 2 Mar 2020 08:58:02 +0000 (03:58 -0500)]
[Ada] Improve handling of aggregates in Side_Effect_Free

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

gcc/ada/

* exp_util.adb (Side_Effect_Free): Improve handling of
N_Aggregate.

4 years ago[Ada] Fix wrong type being used for range check generation
Ghjuvan Lacambre [Fri, 28 Feb 2020 13:56:31 +0000 (14:56 +0100)]
[Ada] Fix wrong type being used for range check generation

2020-06-09  Ghjuvan Lacambre  <lacambre@adacore.com>

gcc/ada/

* sem_res.adb (Resolve_Qualified_Expression): Use Subtype_Mark
type.

4 years ago[Ada] Expand more others aggregates statically
Arnaud Charlet [Sun, 1 Mar 2020 16:12:11 +0000 (11:12 -0500)]
[Ada] Expand more others aggregates statically

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

gcc/ada/

* exp_aggr.adb (Max_Aggregate_Size): New function to factorize
code.
(Convert_To_Positional, Aggr_Size_OK): Use Max_Aggregate_Size.

4 years ago[Ada] Code refactoring on calls to Set_Debug_Info_Needed
Arnaud Charlet [Sun, 1 Mar 2020 11:59:11 +0000 (06:59 -0500)]
[Ada] Code refactoring on calls to Set_Debug_Info_Needed

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

gcc/ada/

* sem_util.ads, sem_util.adb (Set_Debug_Info_Defining_Id): New.
* exp_ch3.adb, exp_ch8.adb: Call Set_Debug_Info_Defining_Id when
relevant.

4 years ago[Ada] Missing documentation for Returns_By_Ref
Justin Squirek [Sun, 1 Mar 2020 09:18:57 +0000 (04:18 -0500)]
[Ada] Missing documentation for Returns_By_Ref

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

gcc/ada/

* einfo.ads (Returns_By_Ref): Modify documentation to reflect
that Returns_By_Ref can be applied to E_Subprogram_Type
entities.

4 years ago[Ada] Spurious overlap error on zero-sized arrays with -gnateV
Justin Squirek [Fri, 28 Feb 2020 21:21:59 +0000 (16:21 -0500)]
[Ada] Spurious overlap error on zero-sized arrays with -gnateV

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

gcc/ada/

* exp_attr.adb (Expand_N_Attribute_Reference): Modify expansion
of 'Overlaps_Storage to take into account zero sized arrays.

4 years ago[Ada] Write_Invocation_Graph_Vertex: include lib item name
Bob Duff [Fri, 28 Feb 2020 18:50:49 +0000 (13:50 -0500)]
[Ada] Write_Invocation_Graph_Vertex: include lib item name

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

gcc/ada/

* bindo-graphs.adb, bindo-graphs.ads: For each invocation graph,
record the corresponding library graph.
* bindo-writers.adb (Write_Invocation_Graph_Vertex): Print the
lib item name. Remove library graph parameters.
* bindo-augmentors.adb, bindo-augmentors.ads,
bindo-builders.adb, bindo-diagnostics.adb,
bindo-diagnostics.ads, bindo-elaborators.adb: Remove library
graph parameters.

4 years ago[Ada] Propagate DIC, Invariant and Predicate attributes to views
Eric Botcazou [Fri, 28 Feb 2020 11:46:58 +0000 (12:46 +0100)]
[Ada] Propagate DIC, Invariant and Predicate attributes to views

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

gcc/ada/

* checks.adb (Apply_Predicate_Check): Extend trick used for
aggregates to qualified aggregates and object declarations
* einfo.ads (Has_Own_DIC): Mention the underlying full view.
(Has_Own_Invariants): Likewise.
(Has_Predicates): Likewise.
* exp_util.adb (Build_DIC_Procedure_Declaration): Do not deal
with base types explicitly but with underlying full views.
(Build_Invariant_Procedure_Declaration): Likewise.
* sem_ch13.adb (Build_Predicate_Functions): Do not deal with
the full view manually but call Propagate_Predicate_Attributes
to propagate attributes to views.
(Build_Predicate_Function_Declaration): Likewise.
* sem_ch3.adb (Build_Assertion_Bodies_For_Type): Build bodies
for private full views with an underlying full view.
(Build_Derived_Private_Type): Small comment tweak.
(Complete_Private_Subtype): Call Propagate_Predicate_Attributes.
(Process_Full_View): Do not deal with base types explicitly for
DIC and Invariant attributes.  Deal with underlying full views
for them.  Call Propagate_Predicate_Attributes and deal with
underlying full views for them.
* sem_ch7.adb (Preserve_Full_Attributes): Do not cross propagate
DIC and Invariant attributes between full type and its base type.
Propagate Predicate attributes from the full to the private view.
* sem_ch9.adb (Analyze_Protected_Type_Declaration): Likewise.
(Analyze_Task_Type_Declaration): Likewise.
* sem_util.ads (Get_Views): Remove Full_Base parameter and add
UFull_Typ parameter.
(Propagate_Predicate_Attributes): New procedure.
* sem_util.adb (Get_Views): Remove Full_Base parameter and add
UFull_Typ parameter.  Retrieve the Corresponding_Record_Type
from the underlying full view, if any.
(Propagate_DIC_Attributes): Remove useless tests.
(Propagate_Invariant_Attributes): Likewise.
(Propagate_Predicate_Attributes): New procedure.

4 years ago[Ada] Crash on exit statement within predicated loop
Justin Squirek [Fri, 28 Feb 2020 15:21:38 +0000 (10:21 -0500)]
[Ada] Crash on exit statement within predicated loop

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

gcc/ada/

* exp_ch5.adb (Expand_Predicated_Loop): Perserve the original
loop identifier within the expansion.

4 years ago[Ada] gnatbind: Correct assertions in Add_Edge_Kind_Check
Bob Duff [Fri, 28 Feb 2020 14:46:07 +0000 (09:46 -0500)]
[Ada] gnatbind: Correct assertions in Add_Edge_Kind_Check

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

gcc/ada/

* bindo-graphs.ads (Library_Graph_Edge_Kind): Reorder enumerals
to reflect the order of adding edges. Clarify comments.
* bindo-graphs.adb (Add_Edge_Kind_Check): Correct the
assertions.  Reorder the "when"s to match the order of adding
edges, and therefore the order of enumerals in type
Library_Graph_Edge_Kind.  Change names to "Old_" and "New_" to
clarify what's what.  Combine Invocation_Edge into the "<="
test.  Fix the "raise Program_Error" message, which was
backwards.

4 years ago[Ada] Add debugging message
Bob Duff [Thu, 27 Feb 2020 15:49:47 +0000 (10:49 -0500)]
[Ada] Add debugging message

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

gcc/ada/

* bindo-graphs.adb (Add_Edge_Kind_Check): Add the Image of the
old and new Kinds to the raise Program_Error message.

4 years ago[Ada] Remove bypass for instance bodies from Is_Visible_Component
Eric Botcazou [Thu, 27 Feb 2020 16:02:14 +0000 (17:02 +0100)]
[Ada] Remove bypass for instance bodies from Is_Visible_Component

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

gcc/ada/

* sem_ch3.adb (Is_Visible_Component): Do not special-case
bodies of instances.

4 years ago[Ada] Membership test against a non-excluding subtype
Arnaud Charlet [Thu, 27 Feb 2020 09:28:04 +0000 (04:28 -0500)]
[Ada] Membership test against a non-excluding subtype

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

gcc/ada/

* exp_ch4.adb (Expand_N_In): Fix handling of null exclusion.

4 years ago[Ada] Ada2020 AI12-0282: Shared variable control aspects in generics
Ed Schonberg [Tue, 25 Feb 2020 21:58:06 +0000 (16:58 -0500)]
[Ada] Ada2020 AI12-0282: Shared variable control aspects in generics

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

gcc/ada/

* sem_ch12.adb (Check_Shared_Variable_Control_Aspects): Require
exact match between formal and actual for aspects Atomic,
Atomic_Component, Volatile, and Volatile_Components.

4 years ago[Ada] gnatpp: documentation for --no-separate-return switch
Bob Duff [Wed, 26 Feb 2020 14:51:56 +0000 (09:51 -0500)]
[Ada] gnatpp: documentation for --no-separate-return switch

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

gcc/ada/

* doc/gnat_ugn/gnat_utility_programs.rst: Add documentation for
the --no-separate-return switch of gnatpp.

4 years ago[Ada] Add missing tag with -gnatw.d
Arnaud Charlet [Wed, 26 Feb 2020 10:01:53 +0000 (05:01 -0500)]
[Ada] Add missing tag with -gnatw.d

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

gcc/ada/

* sem_warn.adb (Warn_On_Constant_Valid_Condition): Add proper
warning tag.

4 years ago[Ada] Refine implementation of AI05-0149 missing conversion checks
Arnaud Charlet [Fri, 21 Feb 2020 16:36:40 +0000 (11:36 -0500)]
[Ada] Refine implementation of AI05-0149 missing conversion checks

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

gcc/ada/

* sem_type.adb (Covers): Fix implementation of AI05-0149.
* sem_res.adb: Fix typo.

4 years ago[Ada] Spurious error on instantiations with Taft_Amendment types and tasks
Ed Schonberg [Mon, 24 Feb 2020 18:37:58 +0000 (13:37 -0500)]
[Ada] Spurious error on instantiations with Taft_Amendment types and tasks

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

gcc/ada/

* exp_ch9.adb (Build_Master_Renaming): Make name in renaming
declaration unique by adding a numeric suffix, to prevent
accidental name conflict when several instantiations of a
package containing an access_to_incomplete type that designate
tasks appear in the same scope.

4 years ago[Ada] Annotate Ada.Synchronous_Barriers with SPARK_Mode => Off
Piotr Trojanek [Tue, 25 Feb 2020 12:58:04 +0000 (13:58 +0100)]
[Ada] Annotate Ada.Synchronous_Barriers with SPARK_Mode => Off

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

gcc/ada/

* libgnarl/a-synbar.ads, libgnarl/a-synbar.adb,
libgnarl/a-synbar__posix.ads, libgnarl/a-synbar__posix.adb
(Ada.Synchronous_Barriers): Annotate with SPARK_Mode => Off.

4 years ago[Ada] AI1-0201 Relational operators of static string types are now static
Arnaud Charlet [Mon, 24 Feb 2020 20:35:12 +0000 (15:35 -0500)]
[Ada] AI1-0201 Relational operators of static string types are now static

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

gcc/ada/

* sem_eval.adb (Eval_Relational_Op, Eval_String_Literal,
Eval_Type_Conversion): Relax rules on relational operators and
type conversions of static string types.

4 years ago[Ada] Ada2020: AI12-0301 Predicates and Default_Value
Arnaud Charlet [Sun, 23 Feb 2020 18:50:18 +0000 (13:50 -0500)]
[Ada] Ada2020: AI12-0301 Predicates and Default_Value

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

gcc/ada/

* sem_util.ads, sem_util.adb (Is_Partially_Initialized_Type):
Take Default_Value and Default_Component_Value into account.
* sem_ch3.adb (Analyze_Object_Declaration): Update comment.

4 years ago[Ada] Disable assertion regarding Body_Before_Spec_Edge
Bob Duff [Tue, 25 Feb 2020 00:22:56 +0000 (19:22 -0500)]
[Ada] Disable assertion regarding Body_Before_Spec_Edge

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

gcc/ada/

* bindo-graphs.adb (Add_Edge_Kind_Check): Disable failing part
of the assertion.

4 years agolibsanitizer: use gnu++14
Martin Liska [Mon, 8 Jun 2020 14:04:31 +0000 (16:04 +0200)]
libsanitizer: use gnu++14

libsanitizer/ChangeLog:

* asan/Makefile.am: Replace gnu++11 with gnu++14.
* interception/Makefile.am: Likewise.
* libbacktrace/Makefile.am: Likewise.
* lsan/Makefile.am: Likewise.
* sanitizer_common/Makefile.am: Likewise.
* tsan/Makefile.am: Likewise.
* ubsan/Makefile.am: Likewise.
* asan/Makefile.in: Regenerate.
* interception/Makefile.in: Likewise.
* libbacktrace/Makefile.in: Likewise.
* lsan/Makefile.in: Likewise.
* sanitizer_common/Makefile.in: Likewise.
* tsan/Makefile.in: Likewise.
* ubsan/Makefile.in: Likewise.

4 years agogcc-changelog: fix deduction for root ChangeLog
Martin Liska [Tue, 9 Jun 2020 08:01:05 +0000 (10:01 +0200)]
gcc-changelog: fix deduction for root ChangeLog

contrib/ChangeLog:

* gcc-changelog/git_commit.py: Fix ChangeLog regex in order to
match the top-level ChangeLog.
* gcc-changelog/test_email.py: Add test.
* gcc-changelog/test_patches.txt: Likewise.

4 years agoc-family: Fix up MEM_REF printing [PR95580]
Jakub Jelinek [Tue, 9 Jun 2020 06:39:36 +0000 (08:39 +0200)]
c-family: Fix up MEM_REF printing [PR95580]

The C FE in the MEM_REF printing ICEs if the type of the first argument
(which due to useless pointer conversions can be an arbitrary type) is a
pointer to an incomplete type.  The code just wants to avoid printing a cast
if it is a pointer to single byte elements.

2020-06-09  Jakub Jelinek  <jakub@redhat.com>

PR c/95580
* c-pretty-print.c (c_pretty_printer::unary_expression): Handle the
case when MEM_REF's first argument has type pointer to incomplete type.

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

4 years agomatch.pd: Optimize ffs comparisons against constants [PR95527]
Jakub Jelinek [Tue, 9 Jun 2020 06:38:19 +0000 (08:38 +0200)]
match.pd: Optimize ffs comparisons against constants [PR95527]

The following patch implements various optimizations of __builtin_ffs*
against constants.

2020-06-09  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/95527
* match.pd (__builtin_ffs (X) cmp CST): New optimizations.

* gcc.dg/tree-ssa/pr95527.c: New test.

4 years agotestsuite: Fix g++.dg/torture/pr95493.C FAIL on i686-linux with -O0.
Jakub Jelinek [Tue, 9 Jun 2020 06:34:13 +0000 (08:34 +0200)]
testsuite: Fix g++.dg/torture/pr95493.C FAIL on i686-linux with -O0.

2020-06-09  Jakub Jelinek  <jakub@redhat.com>

* g++.dg/torture/pr95493.C: Add -Wno-psabi -w to dg-additional-options.

4 years agoxtensa: libgcc: fix PR target/95571
Max Filippov [Sat, 6 Jun 2020 12:06:04 +0000 (05:06 -0700)]
xtensa: libgcc: fix PR target/95571

Rewrite uw_install_context without function calls to avoid register
spilling in _Unwind_RaiseException during return context installation.

2020-06-08  Max Filippov  <jcmvbkbc@gmail.com>
gcc/testsuite/
* g++.target/xtensa/pr95571.C: New test.
* g++.target/xtensa/xtensa.exp: New testsuite.

libgcc/
* config/xtensa/unwind-dw2-xtensa.c (uw_install_context): Merge
with uw_install_context_1.

4 years agors6000/testsuite: Allow xxperm* instead of only vperm*
Segher Boessenkool [Mon, 8 Jun 2020 22:34:21 +0000 (22:34 +0000)]
rs6000/testsuite: Allow xxperm* instead of only vperm*

Some testcases failed (esp. with --with-cpu=power9) after my change to
prefer xxperm over vperm when all else is equal.  Fix that.  (This also
tightens the relevant REs somewhat).

2020-06-09  Segher Boessenkool  <segher@kernel.crashing.org>

gcc/testsuite/
* gcc.target/powerpc/fold-vec-perm-char.c: Allow both vperm/vpermr and
xxperm/xxpermr.
* gcc.target/powerpc/fold-vec-perm-double.c: Ditto.
* gcc.target/powerpc/fold-vec-perm-float.c: Ditto.
* gcc.target/powerpc/fold-vec-perm-int.c: Ditto.
* gcc.target/powerpc/fold-vec-perm-longlong.c: Ditto.
* gcc.target/powerpc/fold-vec-perm-pixel.c: Ditto.
* gcc.target/powerpc/fold-vec-perm-short.c: Ditto.
* gcc.target/powerpc/lvsl-lvsr.c: Ditto.
* gcc.target/powerpc/vec-mult-char-2.c: Ditto.
* gcc.target/powerpc/vsx-vector-6.p9.c: Also allow xxpermr.

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

4 years agoopenmp: ensure variables in offload table are streamed out (PRs 94848 + 95551)
Tobias Burnus [Mon, 8 Jun 2020 21:24:57 +0000 (23:24 +0200)]
openmp: ensure variables in offload table are streamed out (PRs 94848 + 95551)

gcc/ChangeLog:

PR lto/94848
PR middle-end/95551
* omp-offload.c (add_decls_addresses_to_decl_constructor,
omp_finish_file): Skip removed items.
* lto-cgraph.c (output_offload_tables): Likewise; set force_output
to this node for variables and functions.

libgomp/ChangeLog:

PR lto/94848
PR middle-end/95551
* testsuite/libgomp.fortran/target-var.f90: New test.

4 years agobootstrap: Fix --disable-bootstrap with older g++.
Jason Merrill [Fri, 5 Jun 2020 16:45:11 +0000 (12:45 -0400)]
bootstrap: Fix --disable-bootstrap with older g++.

Previously I had AX_CXX_COMPILE_STDCXX in the gcc directory configure, which
added -std=c++11 to CXX if needed, but then CXX is overridden from the
toplevel directory, so it didn't have the desired effect.  Fixed by moving
the check to the toplevel.  Currently it is only used when building GCC
without bootstrapping; other packages that share the toplevel directory
can adjust the condition if they also want to require C++11 support.

/ChangeLog:

* configure.ac: Check AX_CXX_COMPILE_STDCXX if not bootstrapping.
* configure: Regenerate.

gcc/ChangeLog:

* aclocal.m4: Remove ax_cxx_compile_stdcxx.m4.
* configure.ac: Remove AX_CXX_COMPILE_STDCXX.
* configure: Regenerate.

4 years agolibstdc++: Fix failing tests
Jonathan Wakely [Mon, 8 Jun 2020 20:34:46 +0000 (21:34 +0100)]
libstdc++: Fix failing tests

These started failing with the previous commit, because I forgot to add
the tests after adjusting them.

* testsuite/20_util/default_delete/48631_neg.cc: Adjust dg-error
line number.
* testsuite/20_util/default_delete/void_neg.cc: Likewise.

4 years agoAdd missing ChangeLog entries
Jason Merrill [Mon, 8 Jun 2020 19:22:24 +0000 (15:22 -0400)]
Add missing ChangeLog entries

4 years agolibstdc++: Implement operator<< for std::unique_ptr (LWG 2948)
Jonathan Wakely [Mon, 8 Jun 2020 17:08:14 +0000 (18:08 +0100)]
libstdc++: Implement operator<< for std::unique_ptr (LWG 2948)

libstdc++-v3/ChangeLog:

* include/bits/unique_ptr.h (operator<<): Define for C++20.
* testsuite/20_util/unique_ptr/io/lwg2948.cc: New test.

4 years agod: Fix regression caused by recent refactoring
Iain Buclaw [Mon, 8 Jun 2020 20:11:00 +0000 (22:11 +0200)]
d: Fix regression caused by recent refactoring

gcc/d/ChangeLog:

PR d/95573
* dmd/MERGE: Merge upstream dmd 5041e56f1.

4 years agod: Merge upstream dmd 955b8b36f.
Iain Buclaw [Mon, 8 Jun 2020 19:57:59 +0000 (21:57 +0200)]
d: Merge upstream dmd 955b8b36f.

Merges AndAndExp and OrOrExp into a LogicalExp AST node.

gcc/d/ChangeLog:

* dmd/MERGE: Merge upstream dmd 955b8b36f.
* expr.cc (ExprVisitor::visit (AndAndExp *)): Rename type to ...
(ExprVisitor::visit (LogicalExp *)): ... this.  Handle both 'and if'
and 'or if' expression nodes.
(ExprVisitor::visit (OrOrExp *)): Remove.

4 years agoPR fortran/95195 - Fortran testcase should clean up afterwards
Harald Anlauf [Mon, 8 Jun 2020 19:00:11 +0000 (21:00 +0200)]
PR fortran/95195 - Fortran testcase should clean up afterwards

Change testcase to check error message (iomsg) at runtime, rather than to crash.

libgfortran/
PR fortran/95091
* io/transfer.c (finalize_transfer): Fix type in error message.

gcc/testsuite/
PR fortran/95195
* gfortran.dg/namelist_97.f90: Adjust testcase.

4 years agoPR bootstrap/95555 - powepc64 bootstrap failure due to -Wmaybe-uninitialized in reloa...
Martin Sebor [Mon, 8 Jun 2020 15:06:48 +0000 (09:06 -0600)]
PR bootstrap/95555 - powepc64 bootstrap failure due to -Wmaybe-uninitialized in reload_cse_simplify_operands

gcc/ChangeLog:

* postreload.c (reload_cse_simplify_operands): Clear first array element
before using it.  Assert a precondition.

4 years agoFortran : ICE in maybe_canonicalize_comparison_1 PR92993
Mark Eggleston [Thu, 4 Jun 2020 04:53:31 +0000 (05:53 +0100)]
Fortran  : ICE in maybe_canonicalize_comparison_1 PR92993

This issue has been fixed by PR94090.  Add test case to ensure that
this does not re-occur.

2020-06-08  Mark Eggleston  <markeggleston@gcc.gnu.org>

gcc/testsuite/

PR fortran/92993
* gfortran.dg/pr92993.f90: New test.

4 years agoforwprop: Ignore scalar mode vectors in simplify_vector_constructor [PR95528]
Jakub Jelinek [Mon, 8 Jun 2020 09:05:10 +0000 (11:05 +0200)]
forwprop: Ignore scalar mode vectors in simplify_vector_constructor [PR95528]

As mentioned in the PR, the problem is that at least the x86 backend asumes
that the vec_unpack* and vec_pack* optabs with integral modes are for the
AVX512-ish vector masks rather than for very small vectors done in GPRs.
The only other target that seems to have a scalar mode vec_{,un}pack* optab
is aarch64 as discussed in the PR, so there is also a condition for that.
All other targets have just vector mode optabs.

2020-06-08  Jakub Jelinek  <jakub@redhat.com>

PR target/95528
* tree-ssa-forwprop.c (simplify_vector_constructor): Don't use
VEC_UNPACK*_EXPR or VEC_PACK_TRUNC_EXPR with scalar modes unless the
type is vector boolean.

* g++.dg/opt/pr95528.C: New test.

4 years agotestsuite: Fix up pr95548.C testcase.
Jakub Jelinek [Mon, 8 Jun 2020 08:30:48 +0000 (10:30 +0200)]
testsuite: Fix up pr95548.C testcase.

2020-06-08  Jakub Jelinek  <jakub@redhat.com>

PR lto/95548
* g++.dg/torture/pr95548.C: Change from dg-do compile to dg-do link,
add return type for main, for __SIZEOF_INT128__ test with __uint128_t
enumerator constants and add a test with unsigned long long
enumerators for all targets.

4 years agoAArch64: Expand on comment of stack-clash and implicit probing through LR.
Tamar Christina [Mon, 8 Jun 2020 08:23:10 +0000 (09:23 +0100)]
AArch64: Expand on comment of stack-clash and implicit probing through LR.

This expands the comment on an assert we have in aarch64_layout_frame
and points to an existing comment somewhere else that has a much longer
explanation of what's going on.

Committed under the GCC Obvious rule.

gcc/ChangeLog:

* config/aarch64/aarch64.c (aarch64_layout_frame): Expand comments.

4 years ago[arm] Fix vfp_operand_register for VFP HI regs
Christophe Lyon [Mon, 8 Jun 2020 08:17:20 +0000 (08:17 +0000)]
[arm] Fix vfp_operand_register for VFP HI regs

While looking at PR target/94743 I noticed an ICE when I tried to save
all the FP registers: this was because all HI registers wouldn't match
vfp_register_operand.

gcc/ChangeLog:

* config/arm/predicates.md (vfp_register_operand): Use VFP_HI_REGS
instead of VFP_REGS.

4 years agors6000: Replace FAIL with gcc_unreachable
Martin Liska [Tue, 2 Jun 2020 13:29:37 +0000 (15:29 +0200)]
rs6000: Replace FAIL with gcc_unreachable

gcc/ChangeLog:

* config/rs6000/vector.md: Replace FAIL with gcc_unreachable
in all vcond* patterns.

4 years ago[arm] (header usage fix) include c++ algorithm header via system.h
Christophe Lyon [Mon, 8 Jun 2020 08:04:19 +0000 (08:04 +0000)]
[arm] (header usage fix) include c++ algorithm header via system.h

After the recent commit that forces uses of c++11, the arm part failed
to build because it does not include <algorithm> via system.h as
should be done.

This results in:
from /gcc/common/config/arm/arm-common.c:34:
/usr/lib/gcc/x86_64-linux-gnu/5/include/mm_malloc.h:42:12: error:
attempt to use poisoned "malloc"
     return malloc (size);

This patch fixes the problem by defining INCLUDE_ALGORITHM before
including system.h and no longer includes <algorithm> directly.

gcc/ChangeLog:

* common/config/arm/arm-common.c (INCLUDE_ALGORITHM):
Define. No longer include <algorithm>.

4 years ago[Ada] Implement AI12-0073 (Ravenscar disallows Synchronous_Barriers)
Steve Baird [Thu, 20 Feb 2020 23:35:51 +0000 (15:35 -0800)]
[Ada] Implement AI12-0073 (Ravenscar disallows Synchronous_Barriers)

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

gcc/ada/

* sem_prag.adb (Analyze_Pragma.Set_Ravenscar_Profile): Add
appropriate call to Set_Restriction_No_Dependence if Ada_Version
>= Ada2012 and Profile is either Ravenscar or a GNAT-defined
Ravenscar variant (i.e., not Jorvik).

4 years ago[Ada] AI12-0204 Renaming of a prefixed view
Arnaud Charlet [Mon, 24 Feb 2020 10:41:00 +0000 (05:41 -0500)]
[Ada] AI12-0204 Renaming of a prefixed view

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

gcc/ada/

* sem_ch5.adb: Fix typo.
* sem_ch8.adb (Analyze_Renamed_Primitive_Operation): Check that
the prefix of a prefixed view must be renamable as an object.

4 years ago[Ada] AI12-0085 Missing aspect cases for Remote_Types
Arnaud Charlet [Fri, 21 Feb 2020 14:44:28 +0000 (09:44 -0500)]
[Ada] AI12-0085 Missing aspect cases for Remote_Types

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

gcc/ada/

* sem_cat.ads: Fix typo.
* sem_cat.adb (Validate_Remote_Access_To_Class_Wide_Type): Add
handling of N_Attribute_Definition_Clause.
* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Call
Validate_Remote_Access_To_Class_Wide_Type for Storage_Size and
Storage_Pool.
* sem_attr.adb, exp_ch4.adb: Update comments.

4 years ago[Ada] Spurious error on call to controlled primitive
Justin Squirek [Fri, 21 Feb 2020 21:12:35 +0000 (16:12 -0500)]
[Ada] Spurious error on call to controlled primitive

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

gcc/ada/

* sem_ch4.adb (Analyze_One_Call): Add extra condition to the
predicate for deciding when a given controlled call is visible.

4 years ago[Ada] Port a modified expansion of Enum_Rep from GNAT to GNATprove
Piotr Trojanek [Mon, 17 Feb 2020 17:00:41 +0000 (18:00 +0100)]
[Ada] Port a modified expansion of Enum_Rep from GNAT to GNATprove

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

gcc/ada/

* exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Port
changes in frontend expander.

4 years ago[Ada] Style cleanups in new code for Pure_Barriers
Piotr Trojanek [Thu, 20 Feb 2020 11:10:53 +0000 (12:10 +0100)]
[Ada] Style cleanups in new code for Pure_Barriers

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

gcc/ada/

* sem_ch13.adb (All_Membership_Choices_Static): Fix style.

4 years ago[Ada] Implement AI12-0291 (Jorvik profile)
Steve Baird [Thu, 20 Feb 2020 00:27:47 +0000 (16:27 -0800)]
[Ada] Implement AI12-0291 (Jorvik profile)

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

gcc/ada/

* libgnat/s-rident.ads: Add Jorvik to the Profile_Name
enumeration type.  Add an element for Jorvik to the array
aggregate that is the initial value of the constant
Profile_Info.
* targparm.adb (Get_Target_Parameters): Handle "pragma Profile
(Jorvik);" similarly to "pragma Profile (Ravenscar);".
* snames.ads-tmpl: Declare Name_Jorvik Name_Id. Unlike
Ravenscar, Jorvik is not a pragma name and has no corresponding
element in the Pragma_Id enumeration type; this means that its
declaration must not occur between those of First_Pragma_Name
and Last_Pragma_Name.
* sem_prag.adb (Analyze_Pragma): Add call to
Set_Ravenscar_Profile for Jorvik, similar to the existing calls
for Ravenscar and the GNAT Ravenscar variants.

4 years ago[Ada] AI12-0228 Properties of qualified expressions used as names
Arnaud Charlet [Mon, 17 Feb 2020 17:41:37 +0000 (12:41 -0500)]
[Ada] AI12-0228 Properties of qualified expressions used as names

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

gcc/ada/

* sem_ch8.adb (Analyze_Object_Renaming): Update Get_Object_Name
to go through N_Qualified_Expression and N_Type_Conversion.  Fix
another case of wrong usage of E_Anonymous_Access_Type instead
of Anonymous_Access_Kind.
* sem_util.adb (Is_Dependent_Component_Of_Mutable_Object): Work
on the original node.
(Is_Aliased_View): Take into account N_Qualified_Expression.

4 years ago[Ada] Fix handling of 'Enum_Rep and renamings
Arnaud Charlet [Fri, 14 Feb 2020 16:50:12 +0000 (11:50 -0500)]
[Ada] Fix handling of 'Enum_Rep and renamings

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

gcc/ada/

* sem_eval.adb (Eval_Type_Conversion): Fix handling of
enumeration to integer conversions.
* exp_attr.adb (Expand_N_Attribute_Reference
[Attribute_Enum_Rep]): Remove special casing for first-level
renaming, best left to the general folding mechanism via
Eval_Type_Conversion.

4 years ago[Ada] Remove the Has_Dynamic_Range_Check flag
Eric Botcazou [Sun, 9 Feb 2020 17:03:48 +0000 (18:03 +0100)]
[Ada] Remove the Has_Dynamic_Range_Check flag

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

gcc/ada/

* atree.adb (New_Copy): Do not clear Has_Dynamic_Range_Check.
* checks.ads (Append_Range_Checks): Remove Flag_Node parameter.
(Insert_Range_Checks): Likewise and remove default value of
Static_Loc parameter.
* checks.adb (Append_Range_Checks): Remove Flag_Node parameter.
Do not test and set Has_Dynamic_Range_Check.
(Insert_Range_Checks): Likewise and remove default value of
Static_Loc parameter.
* csinfo.adb (CSinfo): Remove 'L' from [NEUB]_Fields pattern and
do not handle Has_Dynamic_Range_Check.
* exp_ch5.adb (Expand_N_Assignment_Statement): Remove argument
in call to Insert_Range_Checks.
* sem_ch3.adb (Analyze_Subtype_Declaration): Do not fiddle
with Has_Dynamic_Range_Check.
(Process_Range_Expr_In_Decl): Remove argument in calls to
Insert_Range_Checks and Append_Range_Checks.
* sinfo.ads (Has_Dynamic_Range_Check): Delete.
(Set_Has_Dynamic_Range_Check): Likewise.
* sinfo.adb (Has_Dynamic_Range_Check): Delete.
(Set_Has_Dynamic_Range_Check): Likewise.
* treepr.adb (Print_Node): Do not print Has_Dynamic_Range_Check.

4 years ago[Ada] Implement AI12-0290 (Simple_Barriers restriction)
Steve Baird [Sat, 15 Feb 2020 00:24:47 +0000 (16:24 -0800)]
[Ada] Implement AI12-0290 (Simple_Barriers restriction)

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

gcc/ada/

* sem_ch13.ads: Export new function
All_Membership_Choices_Static.
* sem_ch13.adb: Implement new function
All_Membership_Choices_Static.  This involves moving the
functions Is_Static_Choice and All_Membership_Choices_Static,
which were previously declared within the function
Is_Predicate_Static, out to library level so that they can be
called by the new function. The already-exisiting code in
Is_Predicate_Static which became the body of
All_Membership_Choices_Static is replaced with a call to the new
function in order to avoid duplication.
* exp_ch9.adb (Is_Pure_Barrier): Several changes needed to
implement rules of AI12-0290 and RM D.7's definition of
"pure-barrier-eligible". These changes include adding a call to
the new function Sem_13.All_Membership_Choices_Static, as per
the "see 4.9" in RM D.7(1.6/5).

4 years ago[Ada] Issue with unnesting of 'First/Last and renaming
Richard Kenner [Mon, 17 Feb 2020 23:17:58 +0000 (18:17 -0500)]
[Ada] Issue with unnesting of 'First/Last and renaming

2020-06-08  Richard Kenner  <kenner@adacore.com>

gcc/ada/

* exp_unst.adb (Visit_Node): When visiting array attribute
nodes, in addition to checking the type of Get_Referenced_Object
of the prefix, also check the actual type of the prefix.

4 years ago[Ada] Implement predicate checks on qualified expressions (AI12-0100)
Gary Dismukes [Mon, 17 Feb 2020 06:31:57 +0000 (01:31 -0500)]
[Ada] Implement predicate checks on qualified expressions (AI12-0100)

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

gcc/ada/

* checks.adb (Apply_Predicate_Check): Refine test for being in a
subprogram body to account for no Corresponding_Body case,
avoiding blowups arising due to other changes here.
* exp_ch4.adb (Expand_N_Qualified_Expression): Apply predicate
checks, if any, after constraint checks are applied.
* sem_eval.ads (Check_Expression_Against_Static_Predicate): Add
Check_Failure_Is_Error formal for conditionalizing warning vs.
error messages.
* sem_eval.adb (Check_Expression_Against_Static_Predicate):
Issue an error message rather than a warning when the new
Check_Failure_Is_Error formal is True. In the nonstatic or
Dynamic_Predicate case where the predicate is known to fail,
emit the check to ensure that folded cases get checks applied.
* sem_res.adb (Resolve_Qualified_Expression): Call
Check_Expression_Against_Static_Predicate, passing True for
Check_Failure_Is_Error, to ensure we reject static predicate
violations. Remove code that was conditionally calling
Apply_Predicate_Check, which is no longer needed, and that check
procedure shouldn't be called from a resolution routine in any
case. Also remove associated comment about preventing infinite
recursion and consistency with Resolve_Type_Conversion, since
that handling was already similarly removed from
Resolve_Type_Convesion at some point.
(Resolve_Type_Conversion): Add passing of True for
Check_Failure_Is_Error parameter on call to
Check_Expression_Against_Static_Predicate, to ensure that static
conversion cases that violate a predicate are rejected as
errors.

4 years ago[Ada] Restore Snames.Name_SPARK as it used in the GNATprove backend
Piotr Trojanek [Mon, 17 Feb 2020 13:15:16 +0000 (14:15 +0100)]
[Ada] Restore Snames.Name_SPARK as it used in the GNATprove backend

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

gcc/ada/

* snames.ads-tmpl (Name_SPARK): Restore after being deleted.

4 years ago[Ada] Remove processing of SPARK_05 restriction
Arnaud Charlet [Mon, 10 Feb 2020 20:18:47 +0000 (15:18 -0500)]
[Ada] Remove processing of SPARK_05 restriction

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

gcc/ada/

* exp_aggr.adb, exp_ch6.adb, par-ch11.adb, par-ch6.adb,
par-ch7.adb, par-prag.adb, restrict.adb, restrict.ads,
scans.ads, scng.adb, sem_aggr.adb, sem_attr.adb, sem_ch11.adb,
sem_ch12.adb, sem_ch3.adb, sem_ch3.ads, sem_ch4.adb,
sem_ch5.adb, sem_ch6.adb, sem_ch7.adb, sem_ch8.adb, sem_ch9.adb,
sem_res.adb, sem_util.adb, sem_util.ads, snames.ads-tmpl,
gnatbind.adb, libgnat/s-rident.ads,
doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
Remove processing of SPARK_05 restriction.
* gnat_rm.texi: Regenerate.
* opt.ads: Remove processing of old checksum which is now
handled by gprbuild directly.

4 years ago[Ada] AI12-0287 Legality Rules for null exclusions in renaming are too fierce
Arnaud Charlet [Sun, 16 Feb 2020 12:16:45 +0000 (07:16 -0500)]
[Ada] AI12-0287 Legality Rules for null exclusions in renaming are too fierce

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

gcc/ada/

* sem_ch12.adb (Instantiate_Object): Relax rules related to null
exclusions and generic objects. Handle all anonymous types
consistently and not just E_Anonymous_Access_Type.
* sem_ch8.adb (Analyze_Object_Renaming): Change wording so that
it applies to both renamings and instantiations to avoid
confusion.

4 years ago[Ada] Ada.Text_IO: fix typo
Arnaud Charlet [Sat, 15 Feb 2020 17:37:13 +0000 (12:37 -0500)]
[Ada] Ada.Text_IO: fix typo

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

gcc/ada/

* libgnat/a-textio.ads (File_Mode): Fix typo in comment.

4 years ago[Ada] Do not warn on partial access to atomic object with address clause
Eric Botcazou [Sat, 15 Feb 2020 15:48:15 +0000 (16:48 +0100)]
[Ada] Do not warn on partial access to atomic object with address clause

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

gcc/ada/

* sem_res.adb (Resolve_Indexed_Component): Do not give a warning
for a nonatomic component of an atomic array which is subject to
an address clause in Ada 2020 mode.
(Resolve_Selected_Component): Likewise for an atomic record.

4 years ago[Ada] Add gnatname use for multiple units files support
Philippe Gil [Mon, 3 Feb 2020 13:56:23 +0000 (14:56 +0100)]
[Ada] Add gnatname use for multiple units files support

2020-06-08  Philippe Gil  <gil@adacore.com>

gcc/ada/

* doc/gnat_ugn/the_gnat_compilation_model.rst: in "Handling
Files with Multiple Units" part documents gnatname use for
unmodified files handling and gnatchop use for files
refactoring.
* gnat_ugn.texi: Regenerate.

4 years ago[Ada] Update doc on Enum_Rep/Enum_Val
Arnaud Charlet [Fri, 14 Feb 2020 08:12:30 +0000 (03:12 -0500)]
[Ada] Update doc on Enum_Rep/Enum_Val

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

gcc/ada/

* doc/gnat_rm/implementation_defined_attributes.rst:
Enum_Rep/Enum_Val are standard Ada 202x attributes.
* gnat_rm.texi: Regenerate.

4 years ago[Ada] Better code generation for nested aggregates
Javier Miranda [Mon, 10 Feb 2020 22:12:32 +0000 (17:12 -0500)]
[Ada] Better code generation for nested aggregates

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

gcc/ada/

* exp_aggr.adb (Safe_Component): Remove code that considers as
unsafe components that are aggregates; such removal allows the
frontend to proceed and evaluate if they are safe by means of
invoking Safe_Aggregate.

4 years ago[Ada] Reuse standard expansion of 'First and 'Last in GNATprove mode
Piotr Trojanek [Wed, 12 Feb 2020 10:00:38 +0000 (11:00 +0100)]
[Ada] Reuse standard expansion of 'First and 'Last in GNATprove mode

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

gcc/ada/

* exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Apply
standard expansion to attributes First and Last.

4 years ago[Ada] Reuse Get_Index_Subtype in the special expander for GNATprove
Piotr Trojanek [Tue, 11 Feb 2020 22:01:06 +0000 (23:01 +0100)]
[Ada] Reuse Get_Index_Subtype in the special expander for GNATprove

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

gcc/ada/

* exp_attr.adb, exp_util.ads, exp_util.adb (Get_Index_Subtype):
Move from the body of Exp_Attr to Exp_Util and expose from the
spec.
* exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Replace
duplicated code with a call to Get_Index_Subtype.