platform/upstream/gcc.git
3 years ago[Ada] Reduce scope of local variables
Piotr Trojanek [Wed, 19 May 2021 10:07:42 +0000 (12:07 +0200)]
[Ada] Reduce scope of local variables

gcc/ada/

* sem_ch6.adb (Check_For_Primitive_Subprogram): Move
declarations of local variables after nested subprogram bodies.

3 years ago[Ada] Simplify code by reusing List_Length
Piotr Trojanek [Wed, 19 May 2021 10:06:55 +0000 (12:06 +0200)]
[Ada] Simplify code by reusing List_Length

gcc/ada/

* exp_disp.adb (CPP_Num_Prims): Reuse List_Length.

3 years ago[Ada] Replace low-level membership tests with Is_Private_Type
Piotr Trojanek [Wed, 19 May 2021 10:05:31 +0000 (12:05 +0200)]
[Ada] Replace low-level membership tests with Is_Private_Type

gcc/ada/

* exp_ch3.adb, exp_ch6.adb, sem_ch6.adb: Replace Ekind
membership test in Private_Kind with a call to Is_Private_Type.

3 years ago[Ada] Linker_Section_Pragma cleanup
Bob Duff [Mon, 17 May 2021 19:39:29 +0000 (15:39 -0400)]
[Ada] Linker_Section_Pragma cleanup

gcc/ada/

* gen_il-gen-gen_entities.adb: Remove Linker_Section_Pragma
field from Record_Field_Kind.  Minor comment improvement.

3 years ago[Ada] Fix precondition of Cot for code analyzers
Yannick Moy [Mon, 17 May 2021 13:58:26 +0000 (15:58 +0200)]
[Ada] Fix precondition of Cot for code analyzers

gcc/ada/

* libgnat/a-ngelfu.ads (Cot): Fix precondition.

3 years ago[Ada] Replace chopped string copy with renaming
Piotr Trojanek [Tue, 18 May 2021 22:26:30 +0000 (00:26 +0200)]
[Ada] Replace chopped string copy with renaming

gcc/ada/

* par.adb (Par): A local Name variable is now a renaming of a
constant slice.

3 years ago[Ada] Simplify handling of Generate_Code flag for compilation units
Piotr Trojanek [Tue, 18 May 2021 12:54:24 +0000 (14:54 +0200)]
[Ada] Simplify handling of Generate_Code flag for compilation units

gcc/ada/

* gnat1drv.adb (Gnat1drv): Remove flagging of main unit and its
corresponding spec as requiring code generation; now the flags
are set much earlier.
* lib-load.adb (Load_Main_Source): Set Generate_Code flag on the
main unit source.
(Make_Instance_Unit): Copy Generate_Code flag from the main unit
to instance units.
* lib-writ.adb (Write_ALI): Remove redundant condition;
Generate_Code flag is always set for the main unit.
* par-load.adb (Load): Set Generate_Code flag on the main unit's
corresponding spec, if any.

3 years ago[Ada] Add socket options to control keepalive on TCP connection
Dmitriy Anisimkov [Tue, 18 May 2021 05:03:31 +0000 (11:03 +0600)]
[Ada] Add socket options to control keepalive on TCP connection

gcc/ada/

* libgnat/g-socket.ads (Option_Name): Add Keep_Alive_Count,
Keep_Alive_Idle, and Keep_Alive_Interval items to enumeration.
(Option_Type): Add Keep_Alive_Count, Keep_Alive_Idle, and
Keep_Alive_Interval alternatives to the case of discriminated
record.
* libgnat/g-socket.adb (Options): Add Keep_Alive_Count,
Keep_Alive_Idle, and Keep_Alive_Interval to items enumerator to
OS constant converter.
(Set_Socket_Option): Process Keep_Alive_Count, Keep_Alive_Idle,
and Keep_Alive_Interval socket options.
(Get_Socket_Option): Idem.

3 years ago[Ada] Tune discovery of No_Elaboration_Code restriction
Piotr Trojanek [Mon, 17 May 2021 22:55:27 +0000 (00:55 +0200)]
[Ada] Tune discovery of No_Elaboration_Code restriction

gcc/ada/

* lib-writ.adb (Write_ALI): Exit from loop after seeing first
unit that violates No_Elaboration_Code restriction.

3 years ago[Ada] Simplify iteration over pending instantiations
Piotr Trojanek [Mon, 17 May 2021 21:06:56 +0000 (23:06 +0200)]
[Ada] Simplify iteration over pending instantiations

gcc/ada/

* inline.adb (Instantiate_Bodies): Fix white in declaration.
(Remove_Dead_Instance): Change iteration from WHILE to FOR.

3 years ago[Ada] Transient scope cleanup
Bob Duff [Mon, 17 May 2021 16:42:20 +0000 (12:42 -0400)]
[Ada] Transient scope cleanup

gcc/ada/

* checks.adb, exp_attr.adb, exp_ch4.adb, exp_ch6.adb,
exp_ch9.adb, exp_disp.adb, exp_util.adb, inline.adb,
sem_res.adb: Change all calls to Make_Unchecked_Type_Conversion
to call Unchecked_Convert_To instead. This involves removing
New_Occurrence_Of on the first parameter, because
Unchecked_Convert_To expects a type entity, rather than the name
of one. Also, removed calls to Relocate_Node, because
Unchecked_Convert_To takes care of that.
* sinfo.ads: Change comment to be worded more firmly.

3 years ago[Ada] Unsynchronized access to a Boolean in tasking state
Steve Baird [Fri, 14 May 2021 22:03:02 +0000 (15:03 -0700)]
[Ada] Unsynchronized access to a Boolean in tasking state

gcc/ada/

* libgnarl/s-tassta.adb (Free_Task): Acquire the Task_Lock
before, rather than after, querying the task's Terminated flag.
Add a corresponding Task_Unlock call.

3 years agoaarch64: Remove a vestigial %K [PR101363]
Martin Sebor [Wed, 7 Jul 2021 14:49:13 +0000 (08:49 -0600)]
aarch64: Remove a vestigial %K [PR101363]

gcc/ChangeLog:
PR target/101363
* config/aarch64/aarch64.c (aarch64_simd_lane_bounds): Remove
a stray %K from error_at() missed in r12-2088.

3 years agotestsuite: gcc.dg/debug/btf/btf-bitfields-3.c remove -fno-short-enums PR debug/101321
Christophe Lyon [Wed, 7 Jul 2021 12:42:34 +0000 (12:42 +0000)]
testsuite: gcc.dg/debug/btf/btf-bitfields-3.c remove -fno-short-enums PR debug/101321

After r12-2094, -fno-short-enums is non longer necessary.

2021-07-07  Christophe Lyon  <christophe.lyon@foss.st.com>

PR debug/101321
gcc/testsuite/
* gcc.dg/debug/btf/btf-bitfields-3.c: Remove -fno-short-enums.

3 years agotree-optimization/34195 - testcase for fixed vectorization
Richard Biener [Wed, 7 Jul 2021 11:46:48 +0000 (13:46 +0200)]
tree-optimization/34195 - testcase for fixed vectorization

This adds a testcase for an old fixed PR.

2021-07-07  Richard Biener  <rguenther@suse.de>

PR tree-optimization/34195
* gcc.dg/vect/pr34195.c: New testcase.

3 years agotree-optimization/99728 - improve LIM for loops with aggregate copies
Richard Biener [Wed, 7 Jul 2021 09:41:03 +0000 (11:41 +0200)]
tree-optimization/99728 - improve LIM for loops with aggregate copies

This improves LIM by recording aggregate copies for disambiguation
purposes instead of as UNANALYZABLE_MEM which will prevent any
invariant or store motion across it.  This allows four of the six
references in the loop of the testcase to be promoted.

2021-07-07  Richard Biener  <rguenther@suse.de>

PR tree-optimization/99728
* tree-ssa-loop-im.c (gather_mem_refs_stmt): Record
aggregate copies.
(mem_refs_may_alias_p): Add assert we handled aggregate
copies elsewhere.
(sm_seq_valid_bb): Give up when running into aggregate copies.
(ref_indep_loop_p): Handle aggregate copies as never
being invariant themselves but allow other refs to be
disambiguated against them.
(can_sm_ref_p): Do not try to apply store-motion to aggregate
copies.

* g++.dg/opt/pr99728.C: New testcase.

3 years agoAdd avx512 tests for MADDSUB and FMSUBADD SLP vectorization patterns.
liuhongt [Wed, 7 Jul 2021 07:19:42 +0000 (15:19 +0800)]
Add avx512 tests for MADDSUB and FMSUBADD SLP vectorization patterns.

gcc/testsuite/ChangeLog:

* gcc.target/i386/avx512f-vect-fmaddsubXXXpd.c: New test.
* gcc.target/i386/avx512f-vect-fmaddsubXXXps.c: New test.
* gcc.target/i386/avx512f-vect-fmsubaddXXXpd.c: New test.
* gcc.target/i386/avx512f-vect-fmsubaddXXXps.c: New test.

3 years agoDaily bump.
GCC Administrator [Wed, 7 Jul 2021 00:17:12 +0000 (00:17 +0000)]
Daily bump.

3 years agoBTF testsuite: Remove explicit check on btm_type
Indu Bhagat [Tue, 6 Jul 2021 23:11:47 +0000 (16:11 -0700)]
BTF testsuite: Remove explicit check on btm_type

The value of btm_type is the BTF type ID of the referred type.  The order in
which the BTF types are added can change across platforms and also as the code
evolves, hence changing the BTF type ID. As there is no direct and portable
method of testing that a BTF type refers to another BTF type of a specific
kind, remove the explicit check on btm_type.

This patch adjusts the testcase without affecting the test coverage as other
testcases already have similar constructs. It also fixes a subset of failures
as seen on Darwin.

2021-07-06  Indu Bhagat  <indu.bhagat@oracle.com>

gcc/testsuite/ChangeLog:

PR debug/101283
* gcc.dg/debug/btf/btf-bitfields-3.c: Remove the check on btm_type.

3 years agoCTF testsuite: Remove explicit check on ctv_typeidx
Indu Bhagat [Tue, 6 Jul 2021 23:02:38 +0000 (16:02 -0700)]
CTF testsuite: Remove explicit check on ctv_typeidx

The value of ctv_typeidx is the CTF type ID of the data type of the associated
variable.  The order in which the CTF types are added can change across
platforms and also as the code evolves, hence changing the CTF type ID. As
there is no direct and portable method of testing that the data type of a CTF
variable is of a specific kind, remove the check on ctv_typeidx.

This also fixes a subset of failures as seen on Darwin.

2021-07-06  Indu Bhagat  <indu.bhagat@oracle.com>

gcc/testsuite/ChangeLog:

PR debug/101283
* gcc.dg/debug/ctf/ctf-attr-mode-1.c: Remove the check for ctv_typeidx.

3 years agoAdd test for [PR55881].
Martin Sebor [Tue, 6 Jul 2021 21:58:02 +0000 (15:58 -0600)]
Add test for [PR55881].

PR c++/55881

gcc/testsuite/ChangeLog:

* g++.dg/warn/uninit-pr55881.C: New test.

3 years agoAdd test for [PR86650].
Martin Sebor [Tue, 6 Jul 2021 21:15:53 +0000 (15:15 -0600)]
Add test for [PR86650].

PR tree-optimization/86650 - -Warray-bounds missing inlining context

gcc/testsuite/ChangeLog:
PR tree-optimization/86650
* gcc.dg/Warray-bounds-76.c: New test.

3 years agodwarf2ctf: the unit of sou field location is bits [PR101283]
Indu Bhagat [Tue, 6 Jul 2021 20:53:58 +0000 (13:53 -0700)]
dwarf2ctf: the unit of sou field location is bits [PR101283]

If the value of the DW_AT_data_member_location attribute is constant, the
associated unit is bytes. This patch amends incorrect behaviour which was being
exercised with -gdwarf-2. This caused some of the failures as noted in PR
debug/101283 (specifically the BTF tests involving btm_offset).

The testcase ctf-struct-array-2.c was erroneously checking for the value of
ctm_offset in number of bytes.

The patch fixes the calculation of the field location value for a struct member
in dwarf2ctf and adjusts the testcase. This patch also fixes some of the
failing tests as noted in PR debug/101283.

2021-07-06  Indu Bhagat  <indu.bhagat@oracle.com>

gcc/ChangeLog:

PR debug/101283
* dwarf2ctf.c (ctf_get_AT_data_member_location): Multiply by 8 to get
number of bits.

gcc/testsuite/ChangeLog:

PR debug/101283
* gcc.dg/debug/ctf/ctf-struct-array-2.c: Adjust the value in the testcase.

3 years agoRemove support for %G and %K.
Martin Sebor [Tue, 6 Jul 2021 20:13:31 +0000 (14:13 -0600)]
Remove support for %G and %K.

gcc/c-family/ChangeLog:

* c-format.c (gcc_tdiag_char_table): Remove support for %G and %K.
 (gcc_cdiag_char_table): Same.
 (gcc_cxxdiag_char_table): Same.

gcc/c/ChangeLog:

* c-objc-common.c (c_tree_printer): Remove support for %G and %K.

gcc/cp/ChangeLog:

* error.c (cp_printer):  Remove support for %G and %K.

gcc/ChangeLog:

* gimple-pretty-print.c (percent_G_format): Remove.
* tree-diagnostic.c (default_tree_printer): Remove calls.
* tree-pretty-print.c (percent_K_format): Remove.
* tree-pretty-print.h (percent_K_format): Remove.

gcc/testsuite/ChangeLog:

* gcc.dg/format/gcc_diag-10.c: Update expected warnings.
* gcc.dg/plugin/diagnostic_plugin_test_inlining.c: Remove %G.

3 years agoImprove warning suppression for inlined functions.
Martin Sebor [Tue, 6 Jul 2021 19:45:54 +0000 (13:45 -0600)]
Improve warning suppression for inlined functions.

gcc/ChangeLog:

* config/aarch64/aarch64-builtins.c (aarch64_simd_expand_builtin):
Remove %K and use error_at.
(aarch64_expand_fcmla_builtin): Same.
(aarch64_expand_builtin_tme): Same.
(aarch64_expand_builtin_memtag): Same.
* config/arm/arm-builtins.c (arm_expand_acle_builtin): Same.
(arm_expand_builtin): Same.
* config/arm/arm.c (bounds_check): Same.

3 years agoImprove warning suppression for inlined functions.
Martin Sebor [Tue, 6 Jul 2021 19:41:02 +0000 (13:41 -0600)]
Improve warning suppression for inlined functions.

Resolves:
PR middle-end/98871 - Cannot silence -Wmaybe-uninitialized at declaration site
PR middle-end/98512 - #pragma GCC diagnostic ignored ineffective in conjunction with alias attribute

gcc/ChangeLog:

* builtins.c (warn_string_no_nul): Remove %G.
(maybe_warn_for_bound): Same.
(warn_for_access): Same.
(check_access): Same.
(check_strncat_sizes): Same.
(expand_builtin_strncat): Same.
(expand_builtin_strncmp): Same.
(expand_builtin): Same.
(expand_builtin_object_size): Same.
(warn_dealloc_offset): Same.
(maybe_emit_free_warning): Same.
* calls.c (maybe_warn_alloc_args_overflow): Same.
(maybe_warn_nonstring_arg): Same.
(maybe_warn_rdwr_sizes): Same.
* expr.c (expand_expr_real_1): Remove %K.
* gimple-fold.c (gimple_fold_builtin_strncpy): Remove %G.
(gimple_fold_builtin_strncat): Same.
* gimple-ssa-sprintf.c (format_directive): Same.
(handle_printf_call): Same.
* gimple-ssa-warn-alloca.c (pass_walloca::execute): Same.
* gimple-ssa-warn-restrict.c (maybe_diag_overlap): Same.
(maybe_diag_access_bounds): Same.  Call gimple_location.
(check_bounds_or_overlap): Same.
* trans-mem.c (ipa_tm_scan_irr_block): Remove %K.  Simplify.
* tree-ssa-ccp.c (pass_post_ipa_warn::execute): Remove %G.
* tree-ssa-strlen.c (maybe_warn_overflow): Same.
(maybe_diag_stxncpy_trunc): Same.
(handle_builtin_stxncpy_strncat): Same.
(maybe_warn_pointless_strcmp): Same.
* tree-ssa-uninit.c (maybe_warn_operand): Same.

gcc/testsuite/ChangeLog:

* gcc.dg/Wobjsize-1.c: Prune expected output.
* gcc.dg/Warray-bounds-71.c: New test.
* gcc.dg/Warray-bounds-71.h: New test header.
* gcc.dg/Warray-bounds-72.c: New test.
* gcc.dg/Warray-bounds-73.c: New test.
* gcc.dg/Warray-bounds-74.c: New test.
* gcc.dg/Warray-bounds-75.c: New test.
* gcc.dg/Wfree-nonheap-object-4.c: Adjust expected output.
* gcc.dg/Wfree-nonheap-object-5.c: New test.
* gcc.dg/Wfree-nonheap-object-6.c: New test.
* gcc.dg/pragma-diag-10.c: New test.
* gcc.dg/pragma-diag-9.c: New test.
* gcc.dg/uninit-suppress_3.c: New test.
* gcc.dg/pr79214.c: Xfail tests.
* gcc.dg/tree-ssa/builtin-sprintf-warn-27.c: New test.
* gcc.dg/format/c90-printf-1.c: Adjust expected output.

3 years agofixincludes: AIX socket.h.
Clément Chigot [Mon, 5 Jul 2021 15:19:44 +0000 (11:19 -0400)]
fixincludes: AIX socket.h.

Add more context to aix_externcpp1 selection to ensure
that the fix is correctly applied even in future AIX versions.

fixincludes/Changelog:
2021-07-01  Clément Chigot  <clement.chigot@atos.net>

* inclhack.def (aix_externcpp1): Improve select regexp.
* fixincl.x: Regenerate.
* tests/base/sys/socket.h: Update.

3 years agoi386: Add variable vec_set for 32bit vectors [PR97194]
Uros Bizjak [Tue, 6 Jul 2021 17:27:34 +0000 (19:27 +0200)]
i386: Add variable vec_set for 32bit vectors [PR97194]

To generate sane code a SSE4.1 variable PBLENDV instruction is needed.

Also enable variable vec_set through vec_setm_operand predicate
for TARGET_SSE4_1 instead of TARGET_AVX2.  ix86_expand_vector_init_duplicate
is able to emulate vpbroadcast{b,w} with pxor/pshufb.

2021-07-06  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
PR target/97194
* config/i386/predicates.md (vec_setm_operand): Enable
register_operand for TARGET_SSE4_1.
* config/i386/mmx.md (vec_setv2hi): Use vec_setm_operand
as operand 2 predicate.  Call ix86_expand_vector_set_var
for non-constant index operand.
(vec_setv4qi): Use vec_setm_mmx_operand as operand 2 predicate.
Call ix86_expand_vector_set_var for non-constant index operand.

gcc/testsuite/

PR target/97194
* gcc.target/i386/sse4_1-vec-set-1a.c: New test.
* gcc.target/i386/sse4_1-vec-set-2a.c: Ditto.

3 years agoMAINTAINERS: Add myself for write after approval and DCO.
Gaius Mulley [Tue, 6 Jul 2021 15:47:36 +0000 (16:47 +0100)]
MAINTAINERS: Add myself for write after approval and DCO.

/
* MAINTAINERS: Add myself for write after approval and DCO.

2021-07-06  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
3 years agoUse H8 nop moves as tst insns
Jeff Law [Tue, 6 Jul 2021 14:55:53 +0000 (10:55 -0400)]
Use H8 nop moves as tst insns

gcc
* config/h8300/jumpcall.md (*branch): When possible, generate
the comparison in CCZN mode.
* config/h8300/predicates.md (simple_memory_operand): Reject all
auto-increment addressing modes.

3 years ago[Ada] Initialize Current_Error_Node
Bob Duff [Mon, 17 May 2021 10:28:18 +0000 (06:28 -0400)]
[Ada] Initialize Current_Error_Node

gcc/ada/

* atree.ads (Current_Error_Node): Initialize to Empty.

3 years ago[Ada] Enable Ada 2020 Put_Image and Image support for tagged types
Steve Baird [Tue, 11 May 2021 18:45:06 +0000 (11:45 -0700)]
[Ada] Enable Ada 2020 Put_Image and Image support for tagged types

gcc/ada/

* exp_put_image.adb: Eliminate references to
Debug_Flag_Underscore_Z.  Change the meaning of the function
Enable_Put_Image. Previously, a result of False for a tagged
type would mean that the type does not get a Put_Image (PI)
routine at all. Now, it means that the type gets a PI routine
with very abbreviated functionality (just a call to
Unknown_Put_Image). This resolves problems in mixing code
compiled with and without the -gnat2022 switch.
* exp_ch3.adb: Enable_Put_Image no longer participates in
determining whether a tagged type gets a Put_Image procedure.  A
tagged type does not get a Put_Image procedure if the type
Root_Buffer_Type is unavailable. This is needed to support cross
targets where tagged types are supported but the type
Root_Buffer_Type is not available.
* exp_dist.adb: Add workarounds for some problems that arise
when using the (obsolete?) Garlic implementation of the
distributed systems annex with Ada 2022 constructs.
* libgnat/a-sttebu.ads: Workaround a bootstrapping problem.
Older compilers do not support raise expressions, so revise the
the Pre'Class condition to meet this requirement without
changing the condition's behavior at run time.

3 years ago[Ada] Fix old typo in comment
Eric Botcazou [Wed, 12 May 2021 21:37:20 +0000 (23:37 +0200)]
[Ada] Fix old typo in comment

gcc/ada/

* repinfo-input.adb (JSON_Entity_Kind, Read_Variant_Part): Fix
typo in comment.

3 years ago[Ada] Implement missing constraint checks for default streaming operations
Steve Baird [Tue, 11 May 2021 18:43:31 +0000 (11:43 -0700)]
[Ada] Implement missing constraint checks for default streaming operations

gcc/ada/

* sem_ch5.adb (Analyze_Assignment): Add new nested function,
Omit_Range_Check_For_Streaming, and make call to
Apply_Scalar_Range_Check conditional on the result of this new
function.
* exp_attr.adb (Compile_Stream_Body_In_Scope): Eliminate Check
parameter, update callers.  The new
Omit_Range_Check_For_Streaming parameter takes the place of the
old use of calling Insert_Action with Suppress => All_Checks,
which was insufficiently precise (it did not allow suppressing
checks for one component but not for another).
(Expand_N_Attribute_Reference): Eliminate another "Suppress =>
All_Checks" from an Insert_Action call, this one in generating
the expansion of a T'Read attribute reference for a composite
type T.

3 years ago[Ada] Warn on statically known empty loop caused by constraint
Ghjuvan Lacambre [Wed, 12 May 2021 12:43:06 +0000 (14:43 +0200)]
[Ada] Warn on statically known empty loop caused by constraint

gcc/ada/

* sem_ch5.adb (Analyze_Loop_Parameter_Specification): Check for
empty loops caused by constraints.

3 years ago[Ada] Handle malformed command line on Win32
Nicolas Roche [Tue, 11 May 2021 05:58:42 +0000 (07:58 +0200)]
[Ada] Handle malformed command line on Win32

gcc/ada/

* rtinit.c (skip_quoted_string): Handle malformed command line
with no closing double quote.
(skip_argument): Handle case in which a null character is
encountered by skip_quote_string.

3 years ago[Ada] Simplify code by removing local constant
Piotr Trojanek [Tue, 11 May 2021 14:53:36 +0000 (16:53 +0200)]
[Ada] Simplify code by removing local constant

gcc/ada/

* uname.adb (Add_Node_Name): Replace local constant whose
initial expression was evaluated even when unnecessary with just
that expression that is evaluated at most once and only when
needed.

3 years ago[Ada] Replace a question mark comment with assertion
Piotr Trojanek [Tue, 11 May 2021 12:11:12 +0000 (14:11 +0200)]
[Ada] Replace a question mark comment with assertion

gcc/ada/

* lib.adb (Remove_Unit): Replace defensive code with an
assertion.
* par-load.adb (Load): Address a question mark in the comment.

3 years ago[Ada] Simplify returning from Enclosing_Comp_Unit_Node
Piotr Trojanek [Tue, 11 May 2021 11:01:35 +0000 (13:01 +0200)]
[Ada] Simplify returning from Enclosing_Comp_Unit_Node

gcc/ada/

* sem_util.adb (Enclosing_Comp_Unit_Node): When the loop exits
the Current_Node is either an N_Compilation_Unit node or Empty,
so simply return it without redundant checks.

3 years ago[Ada] Simplify unit loading with membership tests
Piotr Trojanek [Mon, 10 May 2021 16:00:46 +0000 (18:00 +0200)]
[Ada] Simplify unit loading with membership tests

gcc/ada/

* lib-load.adb (Load_Unit): Remove excessive whitespace.
* lib.adb (Is_Internal_Unit, Is_Predefined_Unit): Likewise.
* par-ch10.adb (P_Compilation_Unit): Simplify with membership
test.
* par-load.adb (Load): Likewise.
* uname.adb (Get_Unit_Name): Likewise.

3 years ago[Ada] Simplify dependency on System
Piotr Trojanek [Mon, 10 May 2021 16:55:37 +0000 (18:55 +0200)]
[Ada] Simplify dependency on System

gcc/ada/

* lib-writ.adb (Ensure_System_Dependency): Simplify by reusing a
constant name.

3 years ago[Ada] Fix bug in casing on composite values with -gnatX
Steve Baird [Tue, 11 May 2021 21:27:09 +0000 (14:27 -0700)]
[Ada] Fix bug in casing on composite values with -gnatX

gcc/ada/

* exp_ch5.adb
(Expand_N_Case_Statement.Expand_General_Case_Statement.Pattern_Match):
When generating an equality test for a statically known discrete
value, only generate the numeric value if the discrete type is
not an enumeration type.  If it is an enumeration type, then
call Get_Enum_Lit_From_Pos instead.

3 years ago[Ada] Return_when_statement not working for non identifier return values
Justin Squirek [Fri, 7 May 2021 18:49:57 +0000 (14:49 -0400)]
[Ada] Return_when_statement not working for non identifier return values

gcc/ada/

* par-ch6.adb (Get_Return_Kind): Removed.
(Is_Extended): Created to identify simple and "when" return
statements from extended return statements.
(P_Return_Statement): Merged simple and "when" return statement
processing.

3 years ago[Ada] Regression on overloaded prefixed calls related to prefixed-call extension
Gary Dismukes [Tue, 11 May 2021 18:49:46 +0000 (14:49 -0400)]
[Ada] Regression on overloaded prefixed calls related to prefixed-call extension

gcc/ada/

* sem_ch4.adb (Try_One_Prefix_Interpretation): Augment test of
"not Extensions_Allowed" with test for absence of Obj_Type's
primitive operations Elist, as an additional condition for early
return from this procedure.

3 years ago[Ada] Reformatting, typo corrections, and minor rewording of a comment.
Gary Dismukes [Mon, 10 May 2021 19:14:38 +0000 (15:14 -0400)]
[Ada] Reformatting, typo corrections, and minor rewording of a comment.

gcc/ada/

* exp_ch4.adb (Process_Transient_In_Expression): In one comment,
fix two typos and reorder wording of one sentence, plus minor
reformatting.

3 years ago[Ada] Spurious initialization of element iterators in "for of" loops
Justin Squirek [Sat, 8 May 2021 04:28:55 +0000 (00:28 -0400)]
[Ada] Spurious initialization of element iterators in "for of" loops

gcc/ada/

* exp_ch5.adb (Expand_Formal_Container_Element_Loop): Remove
legacy expansion of element iterators, and use expansion form
used by unconstrained element types in the general case.

3 years ago[Ada] Crash on use of 'Img on record type in expression
Ed Schonberg [Mon, 10 May 2021 13:40:22 +0000 (09:40 -0400)]
[Ada] Crash on use of 'Img on record type in expression

gcc/ada/

* exp_ch4.adb (Process_Transient_In_Expression): Ensure that
Fin_Context, used to insert finalization code for the
expression, is a list member: the value returned by
Find_Hook_Context may be an expression node when the transient
is part of a larger expression and it has a non-boolean type.

3 years ago[Ada] Missing space in error message for pattern matching
Yannick Moy [Mon, 10 May 2021 12:36:25 +0000 (14:36 +0200)]
[Ada] Missing space in error message for pattern matching

gcc/ada/

* sem_case.adb: Fix error message.

3 years ago[Ada] Tbuild cleanup
Bob Duff [Sat, 8 May 2021 15:39:52 +0000 (11:39 -0400)]
[Ada] Tbuild cleanup

gcc/ada/

* tbuild.adb (Convert_To): Add assert, along with a comment.
(Make_DT_Access): Remove this function, which is not used.  It
was incorrect anyway (the call to New_Occurrence_Of should not
be there).
(Unchecked_Convert_To): Add assert.  The previous version's test
for unchecked conversion to the same type was redundant and
could never be true, because the previous 'if' already checked
for ANY expression of the same type. Remove that, and replace
with a test for unchecked conversion to a related type.
Otherwise, we somethings get things like
"finalize(some_type!(some_type!(x)))" in the generated code,
where x is already of type some_type, but we're converting it to
the private type and then to the full type or vice versa (so the
types aren't equal, so the previous 'if' doesn't catch it).
Avoid updating the Parent. This is not necessary; the Parent
will be updated if/when the node is attached to the tree.
* tbuild.ads: Fix comments. No need to say "this is safe" when
we just explained that a few lines earlier.  Remove
Make_DT_Access.
* sinfo.ads: Add comments.
* exp_ch7.adb (Make_Finalize_Address_Stmts): Minor comment fix.
* gen_il-gen.adb, gen_il-gen.ads, gen_il-gen-gen_nodes.adb,
gen_il-internals.ads: Implement a feature where you can put:
Nmake_Assert => "expr" where expr is a boolean expression in a
call to Create_Concrete_Node_Type. It is added in a pragma
Assert in the Nmake.Make_... function for that type.

3 years ago[Ada] Removal of various ??? comments plus related code changes
Gary Dismukes [Sat, 8 May 2021 21:49:04 +0000 (17:49 -0400)]
[Ada] Removal of various ??? comments plus related code changes

gcc/ada/

* checks.adb: Remove calls of Set_Do_Tag_Check (N, False).
* einfo.ads: Remove hanging unneeded ??? comment ("this real description
was clobbered").
* exp_util.ads (Insert_Actions_After): Remove ??? from spec comment.
* gen_il-fields.ads (Opt_Field_Enum): Remove literals
Do_Accessibility_Check and Do_Tag_Check.
* gen_il-gen-gen_nodes.adb: Remove all calls to Sm for
Do_Accessibility_Check and Do_Tag_Check.
* sem_type.ads (Is_Subtype_Of): Remove obsolete ???
comment (function is not limited to scalar subtypes).
* sem_util.ads (Is_Local_Variable_Reference): Revise comment to
mention out-mode parameters as well, and remove ???.
(Propagate_Concurrent_Flags): Minor reformatting.
(Propagate_Invariant_Attributes): Typo fix.
(Propagate_Predicate_Attributes): Indicate what is propagated
and remove ??? comment.
* sem_util.adb (Cannot_Raise_Constraint_Error): Remove unneeded
test of Do_Tag_Check.
(Is_Local_Variable_Reference): Extend function to testing for
formals of mode out as well.
* sinfo.ads: Remove ??? comment about flag
Convert_To_Return_False indicating that the flag is obsolete (in
fact it's used). Remove references to Do_Accessibility_Check and
Do_Tag_Check (and the two associated ??? comments), as these
flags are unneeded.
* sinfo-cn.adb (Change_Conversion_To_Unchecked): Remove call of
Set_Do_Tag_Check (N, False).
* targparm.ads (Support_Atomic_Primitives_On_Target): Remove ???
comment, plus minor reformatting.

3 years ago[Ada] Return when not working for procedures
Justin Squirek [Fri, 7 May 2021 16:26:09 +0000 (12:26 -0400)]
[Ada] Return when not working for procedures

gcc/ada/

* par-ch6.adb (Get_Return_Kind): Properly handle the case of a
"return when" statement in the procedure case.

3 years ago[Ada] Transient scope cleanup
Bob Duff [Fri, 7 May 2021 14:41:03 +0000 (10:41 -0400)]
[Ada] Transient scope cleanup

gcc/ada/

* sem.ads (Node_To_Be_Wrapped): Minor comment fix.
* exp_ch7.adb (Establish_Transient_Scope): Misc cleanups and
comment improvements.
(Set_Node_To_Be_Wrapped): Remove -- not worth putting this code
in a separate procedure, called only once.
* sem_util.adb (Requires_Transient_Scope): Assert that our
parameter has the right Kind. It probably shouldn't be E_Void,
but that is passed in in some cases.
(Ensure_Minimum_Decoration): Move the call later, so we know Typ
is Present, and remove "if Present (Typ)" from this procedure.
* exp_aggr.adb (Convert_To_Assignments): Use membership test,
and avoid the "if False" idiom.
(Expand_Array_Aggregate): Remove a ??? comment.
* sem_ch8.adb (Push_Scope): Take advantage of the full coverage
rules for aggregates.
* sem_res.adb (Resolve_Declare_Expression): Remove test for
Is_Type -- that's all it can be.  Use named notation in call to
Establish_Transient_Scope.
* libgnat/a-cdlili.adb (Adjust): Remove redundant code.
(Clear): Remove "pragma Warnings (Off);", which wasn't actually
suppressing any warnings.

3 years ago[Ada] Make parent of N_Exception_Declaration be N_Declaration
Bob Duff [Wed, 5 May 2021 22:29:28 +0000 (18:29 -0400)]
[Ada] Make parent of N_Exception_Declaration be N_Declaration

gcc/ada/

* gen_il-gen-gen_nodes.adb: Change the parent of
N_Exception_Declaration to be N_Declaration.  Minor comment fix.

3 years ago[Ada] Improper predicate check on view conversion
Ed Schonberg [Wed, 5 May 2021 12:50:23 +0000 (08:50 -0400)]
[Ada] Improper predicate check on view conversion

gcc/ada/

* exp_ch4.adb (Expand_N_Type_Conversion): If the conversion is
the name of an assignment operation do not apply predicate check
to it prior to the assignment.

3 years ago[Ada] Add assertions on tampering counts
Bob Duff [Tue, 4 May 2021 14:13:36 +0000 (10:13 -0400)]
[Ada] Add assertions on tampering counts

gcc/ada/

* libgnat/a-conhel.adb: Assert that tampering counts remain
between 0 and 2**31-1.  This makes debugging of
finalization-related bugs easier.

3 years ago[Ada] Unix Epochalypse (s-osprim.adb)
Doug Rupp [Mon, 3 May 2021 22:22:26 +0000 (15:22 -0700)]
[Ada] Unix Epochalypse (s-osprim.adb)

gcc/ada/

* Makefile.rtl (LIBGNAT_TARGET_PAIRS): Use s-osprim__posix.adb
vice s-osprim__vxworks.adb for all vxworks7r2 targets.

3 years ago[Ada] Add Void_Or_Type_Kind and Exception_Or_Object_Kind
Richard Kenner [Tue, 4 May 2021 01:05:59 +0000 (21:05 -0400)]
[Ada] Add Void_Or_Type_Kind and Exception_Or_Object_Kind

gcc/ada/

* gen_il-types.ads (Void_Or_Type_Kind,
Exception_Or_Object_Kind): Declare.
* gen_il-gen-gen_entities.adb: Likewise.

3 years ago[Ada] Support for Object.Op subprogram-call notation for untagged types
Gary Dismukes [Mon, 3 May 2021 05:56:38 +0000 (01:56 -0400)]
[Ada] Support for Object.Op subprogram-call notation for untagged types

gcc/ada/

* doc/gnat_rm/implementation_defined_pragmas.rst: Add a
description of the feature of prefixed-view calls for untagged
types to the section on pragma Extensions_Allowed.
* gnat_rm.texi: Regenerate.
* einfo.ads: Update specification for
Direct_Primitive_Operations to reflect its use for untagged
types when Extensions_Allowed is True.
* gen_il-gen-gen_entities.adb: Allow Direct_Primitive_Operations
as a field of untagged classes of types by removing the "Pre"
test of "Is_Tagged_Type (N)", and making that field generally
available for all types and subtypes by defining it for
Type_Kind and removing its specification for individual classes
of types.
* sem_ch3.adb (Analyze_Full_Type_Declaration): Initialize the
Direct_Primitive_Operations list when not already set for the
new (sub)type and its base type (except when Ekind of the type
is E_Void, which can happen due to errors in cases where
Derived_Type_Declaration is called and perhaps in other
situations).
(Analyze_Subtype_Declaration): Inherit
Direct_Primitive_Operations list from the base type, for record
and private cases.
(Build_Derived_Record_Type): Initialize the
Direct_Primitive_Operations list for derived record and private
types.
(Build_Derived_Type): Initialize the Direct_Primitive_Operations
list for derived types (and also for their associated base types
when needed).
(Process_Full_View): For full types that are untagged record and
private types, copy the primitive operations of the partial view
to the primitives list of the full view.
* sem_ch4.adb (Analyze_Selected_Component): Allow prefixed
notation for subprogram calls in the case of untagged
types (when Extensions_Allowed is True). In the case where
Is_Private_Type (Prefix_Type) is True, call Try_Object_Operation
when a discriminant selector wasn't found. Also call
Try_Object_Operation in other type kind cases (when
Extensions_Allowed is True).
(Try_Object_Operation.Try_One_Prefixed_Interpretation): Prevent
early return in the untagged case (when Extensions_Allowed is
True). Condition main call to Try_Primitive_Operation on the
type having primitives, and after that, if Prim_Result is False,
test for case where the prefix type is a named access type with
primitive operations and in that case call
Try_Primitive_Operation after temporarily resetting Obj_Type to
denote the access type (and restore it to the designated type
after the call)
(Try_Object_Operation.Valid_First_Argument_Of): Do matching type
comparison by testing Base_Type (Obj_Type) against
Base_Type (Typ), rather than against just Typ, to properly
handle cases where the object prefix has a constrained
subtype.  (Fixes a bug discovered while working on this
feature.)
* sem_ch6.adb
(New_Overloaded_Entity.Check_For_Primitive_Subprogram): Add a
primitive of an untagged type to the type's list of primitive
operations, for both explicit and implicit (derived, so
Comes_From_Source is False) subprogram declarations. In the case
where the new primitive overrides an inherited subprogram,
locate the primitives Elist that references the overridden
subprogram, and replace that element of the list with the new
subprogram (done by calling the new procedure
Add_Or_Replace_Untagged_Primitive on the result type and each
formal atype).
(Check_For_Primitive_Subprogram.Add_Or_Replace_Untagged_Primitive):
New nested procedure to either add or replace an untagged
primitive subprogram in a given type's list of primitive
operations (replacement happens in case where the new subprogram
overrides a primitive of the type).
* sem_ch7.adb (New_Private_Type): When Extensions_Allowed is
True, initialize the Direct_Primitive_Operations list of a
private type to New_Elmt_List in the case of untagged types.
* sem_ch8.adb (Find_Selected_Component): In the case where the
prefix is an entity name, relax condition that tests
Has_Components so that Analyze_Selected_Component will also be
called when Extensions_Allowed is True and the prefix type is
any type.

3 years ago[Ada] Spurious conformance error on expression function
Ed Schonberg [Sat, 1 May 2021 23:55:36 +0000 (19:55 -0400)]
[Ada] Spurious conformance error on expression function

gcc/ada/

* sem_ch6.adb (Analyze_Subprogram_Body_Helper): Do not perform
conformance check when the subprogram body has been created for
an expression function that is not a completion of a previous
specification, because the profile of the constructed body is
copied from the expression function itself.

3 years ago[Ada] Add GNAT RM text regarding Ada 2022 default Put_Image implementation
Steve Baird [Thu, 29 Apr 2021 22:29:16 +0000 (15:29 -0700)]
[Ada] Add GNAT RM text regarding Ada 2022 default Put_Image implementation

gcc/ada/

* doc/gnat_rm/implementation_of_specific_ada_features.rst: Add a
warning indicating that the details of the default (i.e.,
selected by the compiler) implementation of T'Put_Image for a
nonscalar type T are subject to change.
* gnat_rm.texi: Regenerate.

3 years agoX86: Provide a CTOR for stringop_algs [PR100246].
Iain Sandoe [Sat, 3 Jul 2021 18:47:48 +0000 (19:47 +0100)]
X86: Provide a CTOR for stringop_algs [PR100246].

Several older compilers fail to build modern GCC because of missing
or incomplete C++11 support.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
PR bootstrap/100246 - [11/12 Regression] GCC will not bootstrap with clang 3.4/3.5 [xcode 5/6, Darwin 12/13]

PR bootstrap/100246

gcc/ChangeLog:

* config/i386/i386.h (struct stringop_algs): Define a CTOR for
this type.

3 years agoAdd FMADDSUB and FMSUBADD SLP vectorization patterns and optabs
Richard Biener [Mon, 5 Jul 2021 13:51:49 +0000 (15:51 +0200)]
Add FMADDSUB and FMSUBADD SLP vectorization patterns and optabs

This adds named expanders for vec_fmaddsub<mode>4 and
vec_fmsubadd<mode>4 which map to x86 vfmaddsubXXXp{ds} and
vfmsubaddXXXp{ds} instructions.  This complements the previous
addition of ADDSUB support.

x86 lacks SUBADD and the negate variants of FMA with mixed
plus minus so I did not add optabs or patterns for those but
it would not be difficult if there's a target that has them.

2021-07-05  Richard Biener  <rguenther@suse.de>

* doc/md.texi (vec_fmaddsub<mode>4): Document.
(vec_fmsubadd<mode>4): Likewise.
* optabs.def (vec_fmaddsub$a4): Add.
(vec_fmsubadd$a4): Likewise.
* internal-fn.def (IFN_VEC_FMADDSUB): Add.
(IFN_VEC_FMSUBADD): Likewise.
* tree-vect-slp-patterns.c (addsub_pattern::recognize):
Refactor to handle IFN_VEC_FMADDSUB and IFN_VEC_FMSUBADD.
(addsub_pattern::build): Likewise.
* tree-vect-slp.c (vect_optimize_slp): CFN_VEC_FMADDSUB
and CFN_VEC_FMSUBADD are not transparent for permutes.
* config/i386/sse.md (vec_fmaddsub<mode>4): New expander.
(vec_fmsubadd<mode>4): Likewise.

* gcc.target/i386/vect-fmaddsubXXXpd.c: New testcase.
* gcc.target/i386/vect-fmaddsubXXXps.c: Likewise.
* gcc.target/i386/vect-fmsubaddXXXpd.c: Likewise.
* gcc.target/i386/vect-fmsubaddXXXps.c: Likewise.

3 years agoadd -fmove-loop-stores option to control GIMPLE loop store-motion
Richard Biener [Fri, 2 Jul 2021 11:48:07 +0000 (13:48 +0200)]
add -fmove-loop-stores option to control GIMPLE loop store-motion

This adds the -fmove-loop-stores option, mainly as a way to disable
the store-motion part of GIMPLE invariant motion (-ftree-loop-im)
which is enabled by default.  It might be sensible to turn off
-fmove-loop-stores at -O1 since it can result in compile-time
as well as memory usage issues but this patch tries to preserve
existing behavior besides introducing the new option with the
exception of -Og where I've disabled it.

Controlling store-motion has been made easy by earlier refactoring
for the invariant motion only use after loop interchange.

2021-07-02  Richard Biener  <rguenther@suse.de>

* doc/invoke.texi (fmove-loop-stores): Document.
* common.opt (fmove-loop-stores): New option.
* opts.c (default_options_table): Enable -fmove-loop-stores
at -O1 but not -Og.
* tree-ssa-loop-im.c (pass_lim::execute): Pass
flag_move_loop_stores instead of true to
loop_invariant_motion_in_fun.

3 years agoDocumentation : Describe --with-dsymutil configure option.
Iain Sandoe [Tue, 6 Jul 2021 08:19:30 +0000 (09:19 +0100)]
Documentation : Describe --with-dsymutil configure option.

This adds documentation for the dsymutil configuration option
introduced with commit r12-2037-g3b5e8ee4f1ec.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/ChangeLog:

* doc/install.texi: Document --with-dsymutil.

3 years agoFix 101256: Wrong code due to range incorrect from PHI-OPT
Andrew Pinski [Tue, 29 Jun 2021 21:30:34 +0000 (14:30 -0700)]
Fix 101256: Wrong code due to range incorrect from PHI-OPT

So the problem here is that replace_phi_edge_with_variable
will copy range information to a already (not newly) defined
ssa name.  This causes wrong code later on.
This fixes the problem by require the new ssa name to
be defined in the same bb as the conditional that is
about to be deleted.

OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

Changes from v1:
* this is a simplification of what was trying to be done before.

gcc/ChangeLog:

PR tree-optimization/101256
* dbgcnt.def (phiopt_edge_range): New counter.
* tree-ssa-phiopt.c (replace_phi_edge_with_variable):
Check to make sure the new name is defined in the same
bb as the conditional before duplicating range info.
Also add debug counter.

gcc/testsuite/ChangeLog:

PR tree-optimization/101256
* g++.dg/torture/pr101256.C: New test.

3 years agoDo not replace variable op variable in I/O implied DO loop replacement.
Thomas Koenig [Tue, 6 Jul 2021 05:04:09 +0000 (07:04 +0200)]
Do not replace variable op variable in I/O implied DO loop replacement.

This PR came about because index expressions of the form k+k in
implied DO loops in I/O statements were considered for replacement
by array slices.

Fixed by only doing the transformation if the expression is of the
type expr OP contastant.

gcc/fortran/ChangeLog:

PR fortran/100227
* frontend-passes.c (traverse_io_block): Adjust test for
when a variable is eligible for the transformation to
array slice.

gcc/testsuite/ChangeLog:

PR fortran/100227
* gfortran.dg/implied_do_io_7.f90: New test.

3 years agoi386: Disable param ira-consider-dup-in-all-alts [PR100328]
Kewen Lin [Tue, 6 Jul 2021 01:54:16 +0000 (20:54 -0500)]
i386: Disable param ira-consider-dup-in-all-alts [PR100328]

With Hongtao's SPEC2017 performance evaluation result here:
https://gcc.gnu.org/pipermail/gcc-patches/2021-June/573986.html
this new parameter ira-consider-dup-in-all-alts has negative
effects on i386, this patch is to disable it explicitly on
i386.

Bootstrapped & regtested on x86_64-redhat-linux.

gcc/ChangeLog:

PR rtl-optimization/100328
* config/i386/i386-options.c (ix86_option_override_internal):
Set param_ira_consider_dup_in_all_alts to 0.

3 years agoira: Support more matching constraint forms with param [PR100328]
Kewen Lin [Tue, 6 Jul 2021 01:53:19 +0000 (20:53 -0500)]
ira: Support more matching constraint forms with param [PR100328]

This patch is to make IRA consider matching constraint heavily,
even if there is at least one other alternative with non-NO_REG
register class constraint, it will continue and check matching
constraint in all available alternatives and respect the
matching constraint with preferred register class.

One typical case is destructive FMA style instruction on rs6000.
Without this patch, for the mentioned FMA instruction, IRA won't
respect the matching constraint on VSX_REG since there are some
alternative with FLOAT_REG which doesn't have matching constraint.
It can cause extra register copies since later reload has to make
code to respect the constraint.  This patch make IRA respect this
matching constraint on VSX_REG which is the preferred regclass,
but it excludes some cases where for one preferred register class
there can be two or more alternatives, one of them has the
matching constraint, while another doesn't have.  It also
considers the possibility of free register copy.

With option Ofast unroll, this patch can help to improve SPEC2017
bmk 508.namd_r +2.42% and 519.lbm_r +2.43% on Power8 while
508.namd_r +3.02% and 519.lbm_r +3.85% on Power9 without any
remarkable degradations.  It also improved something on SVE as
testcase changes showed and Richard's confirmation.

Bootstrapped & regtested on powerpc64le-linux-gnu P9,
x86_64-redhat-linux and aarch64-linux-gnu.

gcc/ChangeLog:

PR rtl-optimization/100328
* doc/invoke.texi (ira-consider-dup-in-all-alts): Document new
parameter.
* ira.c (ira_get_dup_out_num): Adjust as parameter
param_ira_consider_dup_in_all_alts.
* params.opt (ira-consider-dup-in-all-alts): New.
* ira-conflicts.c (process_regs_for_copy): Add one parameter
single_input_op_has_cstr_p.
(get_freq_for_shuffle_copy): New function.
(add_insn_allocno_copies): Adjust as single_input_op_has_cstr_p.
* ira-int.h (ira_get_dup_out_num): Add one bool parameter.

gcc/testsuite/ChangeLog:

PR rtl-optimization/100328
* gcc.target/aarch64/sve/acle/asm/div_f16.c: Remove one xfail.
* gcc.target/aarch64/sve/acle/asm/div_f32.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/div_f64.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/divr_f16.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/divr_f32.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/divr_f64.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/mad_f16.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/mad_f32.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/mad_f64.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/mla_f16.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/mla_f32.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/mla_f64.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/mls_f16.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/mls_f32.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/mls_f64.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/msb_f16.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/msb_f32.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/msb_f64.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/mulx_f16.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/mulx_f32.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/mulx_f64.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/nmad_f16.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/nmad_f32.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/nmad_f64.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/nmla_f16.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/nmla_f32.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/nmla_f64.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/nmls_f16.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/nmls_f32.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/nmls_f64.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/nmsb_f16.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/nmsb_f32.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/nmsb_f64.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/sub_f16.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/sub_f32.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/sub_f64.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/subr_f16.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/subr_f32.c: Likewise.
* gcc.target/aarch64/sve/acle/asm/subr_f64.c: Likewise.

3 years agoCTF,BTF testsuite: Use -gdwarf-4 for restrict type qualifier [PR101283]
Indu Bhagat [Tue, 6 Jul 2021 00:28:24 +0000 (17:28 -0700)]
CTF,BTF testsuite: Use -gdwarf-4 for restrict type qualifier [PR101283]

DWARF DIEs do not contain DW_TAG_restrict_type when DWARF version is 2. CTF/BTF
generation feeds off DWARF DIEs, and as such, CTF records of kind
CTF_K_RESTRICT cease to be generated when DWARF version is 2.

This patch fixes the failure of these testcases on Darwin by using an explicit
-gdwarf-4 in the dg-options. This keeps the CTF record generation for restrict
type qualifier tested.

  PR debug/101283 - Several tests fail on Darwin with -gctf/gbtf

2021-07-05  Indu Bhagat  <indu.bhagat@oracle.com>

gcc/testsuite/ChangeLog:

PR debug/101283
* gcc.dg/debug/btf/btf-cvr-quals-1.c: Use -gdwarf-4 on Darwin targets.
* gcc.dg/debug/ctf/ctf-cvr-quals-1.c: Likewise.

3 years agoDaily bump.
GCC Administrator [Tue, 6 Jul 2021 00:16:44 +0000 (00:16 +0000)]
Daily bump.

3 years agoRemove redundant compare in shift loop on H8
Jeff Law [Mon, 5 Jul 2021 21:23:43 +0000 (17:23 -0400)]
Remove redundant compare in shift loop on H8

gcc/ChangeLog

* config/h8300/shiftrotate.md (shift-by-variable patterns): Update to
generate condition code aware RTL directly.

3 years agoPort most of the A CMP 0 ? A : -A to match
Andrew Pinski [Sun, 13 Jun 2021 02:45:20 +0000 (19:45 -0700)]
Port most of the A CMP 0 ? A : -A to match

To improve phiopt and be able to remove abs_replacement, this ports
most of "A CMP 0 ? A : -A" from fold_cond_expr_with_comparison to
match.pd.  There is a few extra changes that are needed to remove
the "A CMP 0 ? A : -A" part from fold_cond_expr_with_comparison:
   * Need to handle (A - B) case
   * Need to handle UN* comparisons.

I will handle those in a different patch.

Note phi-opt-15.c test needed to be updated as we get ABSU now
instead of not getting ABS.  When ABSU was added phiopt was not
updated even to use ABSU instead of not creating ABS.

OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

gcc/ChangeLog:

PR tree-optimization/101039
* match.pd (A CMP 0 ? A : -A): New patterns.
* tree-ssa-phiopt.c (abs_replacement): Delete function.
(tree_ssa_phiopt_worker): Don't call abs_replacement.
Update comment about abs_replacement.

gcc/testsuite/ChangeLog:

PR tree-optimization/101039
* gcc.dg/tree-ssa/phi-opt-15.c: Update test to expect
ABSU and still not expect ABS_EXPR.
* gcc.dg/tree-ssa/phi-opt-23.c: New test.
* gcc.dg/tree-ssa/phi-opt-24.c: New test.

3 years agoTry inverted comparison for match_simplify in phiopt
Andrew Pinski [Sun, 13 Jun 2021 02:14:46 +0000 (19:14 -0700)]
Try inverted comparison for match_simplify in phiopt

Since match and simplify does not have all of the inverted
comparison patterns, it make sense to just have
phi-opt try to do the inversion and try match and simplify again.

OK? Bootstrapped and tested on x86_64-linux-gnu.

Thanks,
Andrew Pinski

gcc/ChangeLog:

* tree-ssa-phiopt.c (gimple_simplify_phiopt):
If "A ? B : C" fails to simplify, try "(!A) ? C : B".

3 years agoAllow match-and-simplified phiopt to run in early phiopt
Andrew Pinski [Fri, 11 Jun 2021 20:21:34 +0000 (13:21 -0700)]
Allow match-and-simplified phiopt to run in early phiopt

To move a few things more to match-and-simplify from phiopt,
we need to allow match_simplify_replacement to run in early
phiopt. To do this we add a replacement for gimple_simplify
that is explictly for phiopt.

OK? Bootstrapped and tested on x86_64-linux-gnu with no
regressions.

gcc/ChangeLog:

* tree-ssa-phiopt.c (match_simplify_replacement):
Add early_p argument. Call gimple_simplify_phiopt
instead of gimple_simplify.
(tree_ssa_phiopt_worker): Update call to
match_simplify_replacement and allow unconditionally.
(phiopt_early_allow): New function.
(gimple_simplify_phiopt): New function.

3 years agoFix PR 101237: Remove element_type call when used with the functions from real
Andrew Pinski [Tue, 29 Jun 2021 03:48:44 +0000 (20:48 -0700)]
Fix PR 101237: Remove element_type call when used with the functions from real

HONOR_SIGNED_ZEROS, HONOR_SIGN_DEPENDENT_ROUNDING, and HONOR_SNANS all
have an overload for taking a tree type now, so we should do that instead.

OK?  Bootstrapped and tested on x86_64-linux-gnu.

gcc/ChangeLog:

PR middle-end/101237
* fold-const.c (negate_expr_p): Remove call to element_mode
and TREE_MODE/TREE_TYPE when calling HONOR_SIGNED_ZEROS,
HONOR_SIGN_DEPENDENT_ROUNDING, and HONOR_SNANS.
(fold_negate_expr_1): Likewise.
(const_unop): Likewise.
(fold_cond_expr_with_comparison): Likewise.
(fold_binary_loc): Likewise.
(fold_ternary_loc): Likewise.
(tree_call_nonnegative_warnv_p): Likewise.
* match.pd (-(A + B) -> (-B) - A): Likewise.

3 years agoDarwin, configury : Allow for specification and detection of dsymutil.
Iain Sandoe [Sun, 13 Dec 2020 17:21:16 +0000 (17:21 +0000)]
Darwin, configury : Allow for specification and detection of dsymutil.

In order to enable DWARF versions > 2 we need a sufficiently modern
version of dsymutil (in addition to the assembler / linker).  This
allows the user to configure a different path from the installed one.

In addition, there are several sources of dsymutil so we differentiate
these in order to be get accurate version information.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/ChangeLog:

* configure.ac: Handle --with-dsymutil in the same way as we
do for the assembler and linker.  (DEFAULT_DSYMUTIL): New.
Extract the type and version for the dsymutil configured or
found by the default searches.
* config.in: Regenerated.
* configure: Regenerated.
* collect2.c (do_dsymutil): Handle locating dsymutil in the
same way as for the assembler and  linker.
* config/darwin.h (DSYMUTIL): Delete.
* gcc.c: Report a configured dsymutil correctly.
* exec-tool.in: Allow for dsymutil.

ChangeLog:

* Makefile.def: Add dsymutil defs.
* Makefile.in: Regenerated.
* Makefile.tpl: Add dsymutil to flags.
* configure: Regenerated.
* configure.ac: Add dsymutil to target and build recipes.

3 years agoi386: Implement 4-byte vector (V4QI/V2HI) constant permutations
Uros Bizjak [Mon, 5 Jul 2021 19:05:10 +0000 (21:05 +0200)]
i386: Implement 4-byte vector (V4QI/V2HI) constant permutations

2021-07-05  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
* config/i386/i386-expand.c (ix86_split_mmx_punpck):
Handle V4QI and V2HI modes.
(expand_vec_perm_blend): Allow 4-byte vector modes with TARGET_SSE4_1.
Handle V4QI mode. Emit mmx_pblendvb32 for 4-byte modes.
(expand_vec_perm_pshufb): Rewrite to use switch statemets.
Handle 4-byte dual operands with TARGET_XOP and single operands
with TARGET_SSSE3.  Emit mmx_ppermv32 for TARGET_XOP and
mmx_pshufbv4qi3 for TARGET_SSSE3.
(expand_vec_perm_pblendv): Allow 4-byte vector modes with TARGET_SSE4_1.
(expand_vec_perm_interleave2): Allow 4-byte vector modes.
(expand_vec_perm_pshufb2): Allow 4-byte vector modes with TARGET_SSSE3.
(expand_vec_perm_even_odd_1): Handle V4QI mode.
(expand_vec_perm_broadcast_1): Handle V4QI mode.
(ix86_vectorize_vec_perm_const): Handle V4QI mode.
* config/i386/mmx.md (mmx_ppermv32): New insn pattern.
(mmx_pshufbv4qi3): Ditto.
(*mmx_pblendw32): Ditto.
(*mmx_pblendw64): Rename from *mmx_pblendw.
(mmx_punpckhbw_low): New insn_and_split pattern.
(mmx_punpcklbw_low): Ditto.

3 years ago[Ada] Regenerate *.texi files with Sphinx 4.0.2
Pierre-Marie de Rodat [Wed, 23 Jun 2021 14:31:23 +0000 (14:31 +0000)]
[Ada] Regenerate *.texi files with Sphinx 4.0.2

gcc/ada/

* gnat-style.texi, gnat_rm.texi, gnat_ugn.texi: Regenerate.

3 years ago[Ada] Reject overlays in Global/Depends/Initializes contracts
Piotr Trojanek [Thu, 29 Apr 2021 22:29:33 +0000 (00:29 +0200)]
[Ada] Reject overlays in Global/Depends/Initializes contracts

gcc/ada/

* sem_prag.adb (Analyze_Depends_In_Decl_Part): Reject overlays
in Depends and Refined_Depends contracts.
(Analyze_Global_In_Decl_Part): Likewise for Global and
Refined_Global.
(Analyze_Initializes_In_Decl_Part): Likewise for Initializes
(when appearing both as a single item and as a initialization
clause).
* sem_util.ads (Ultimate_Overlaid_Entity): New routine.
* sem_util.adb (Report_Unused_Body_States): Ignore overlays.
(Ultimate_Overlaid_Entity): New routine.

3 years ago[Ada] Add Reference and Constant_Reference functions to formal containers
Claire Dross [Fri, 30 Apr 2021 08:24:30 +0000 (10:24 +0200)]
[Ada] Add Reference and Constant_Reference functions to formal containers

gcc/ada/

* libgnat/a-cfdlli.ads, libgnat/a-cfdlli.adb
libgnat/a-cfinve.ads, libgnat/a-cfinve.adb,
libgnat/a-cofove.ads, libgnat/a-cofove.adb,
libgnat/a-coboho.ads, libgnat/a-coboho.adb (Constant_Reference):
Get a read-only access to an element of the container.
(At_End): Ghost functions used to express pledges in the
postcondition of Reference.
(Reference): Get a read-write access to an element of the
container.
* libgnat/a-cfhama.ads, libgnat/a-cfhama.adb,
libgnat/a-cforma.ads, libgnat/a-cforma.adb: The full view of the
Map type is no longer a tagged type, but a wrapper over this
tagged type. This is to avoid issues with dispatching result in
At_End functions.
(Constant_Reference): Get a read-only access to an element of
the container.
(At_End): Ghost functions used to express pledges in the
postcondition of Reference.
(Reference): Get a read-write access to an element of the
container.

* libgnat/a-cfhase.ads, libgnat/a-cfhase.adb,
libgnat/a-cforse.ads, libgnat/a-cforse.adb: The full view of the
Map type is no longer a tagged type, but a wrapper over this
tagged type.
(Constant_Reference): Get a read-only access to an element of
the container.
* libgnat/a-cofuse.ads, libgnat/a-cofuve.ads (Copy_Element):
Expression function used to cause SPARK to make sure
Element_Type is copiable.
* libgnat/a-cofuma.ads (Copy_Key): Expression function used to
cause SPARK to make sure Key_Type is copiable.
(Copy_Element): Expression function used to cause SPARK to make
sure Element_Type is copiable.

3 years ago[Ada] Adapt SPARK RM rule on non-effectively volatile abstract state
Yannick Moy [Fri, 30 Apr 2021 10:41:22 +0000 (12:41 +0200)]
[Ada] Adapt SPARK RM rule on non-effectively volatile abstract state

gcc/ada/

* sem_prag.adb (Analyze_Global_Item): Adapt to update SPARK RM
rule.

3 years ago[Ada] Use runtime from base compiler during stage1 #2
Arnaud Charlet [Fri, 30 Apr 2021 15:52:35 +0000 (11:52 -0400)]
[Ada] Use runtime from base compiler during stage1 #2

gcc/ada/

* Make-generated.in: Add -f switch to ensure cp will never fail.

3 years ago[Ada] Fix some "current instance" bugs
Steve Baird [Thu, 29 Apr 2021 18:44:29 +0000 (11:44 -0700)]
[Ada] Fix some "current instance" bugs

gcc/ada/

* exp_ch3.adb (Build_Record_Init_Proc.Build_Assignment): When
building the assignment statement corresponding to the default
expression for a component, we make a copy of the expression.
When making that copy (and if we have seen a component that
requires late initialization), pass a Map parameter into the
call to New_Copy_Tree to redirect references to the type to
instead refer to the _Init formal parameter of the init proc.
This includes hoisting the declaration of Has_Late_Init_Comp out
one level so that it becomes available to Build_Assignment.
(Find_Current_Instance): Return True for other kinds of current
instance references, instead of just access-valued attribute
references such as T'Access.
* sem_util.adb (Is_Aliased_View): Return True for the _Init
formal parameter of an init procedure. The changes in
exp_ch3.adb can have the effect of replacing a "T'Access"
attribute reference in an init procedure with an "_Init'Access"
attribute reference. We want such an attribute reference to be
legal. However, we do not simply mark the formal parameter as
being aliased because that might impact callers.
(Is_Object_Image): Return True if Is_Current_Instance returns
True for the prefix of an Image (or related attribute) attribute
reference.

3 years ago[Ada] Simplify and reuse Is_Concurrent_Interface
Piotr Trojanek [Fri, 30 Apr 2021 10:02:35 +0000 (12:02 +0200)]
[Ada] Simplify and reuse Is_Concurrent_Interface

gcc/ada/

* exp_ch3.adb (Stream_Operation_OK): Reuse
Is_Concurrent_Interface.
* sem_ch3.adb (Analyze_Interface_Declaration,
Build_Derived_Record_Type): Likewise.
* sem_ch6.adb (Check_Limited_Return): Likewise.
* sem_util.adb (Is_Concurrent_Interface): Don't call
Is_Interface because each of the Is_Protected_Interface,
Is_Synchronized_Interface and Is_Task_Interface calls it anyway.

3 years ago[Ada] Fix missing error messages when returning limited type
Ghjuvan Lacambre [Fri, 30 Apr 2021 08:11:25 +0000 (10:11 +0200)]
[Ada] Fix missing error messages when returning limited type

gcc/ada/

* sem_ch6.adb (Check_Limited_Return): Replace Comes_From_Source
with Comes_From_Extended_Return_Statement.

3 years ago[Ada] Remove Ada.Strings.Text_Output and child units
Steve Baird [Thu, 29 Apr 2021 21:54:54 +0000 (14:54 -0700)]
[Ada] Remove Ada.Strings.Text_Output and child units

gcc/ada/

* libgnat/a-stobbu.adb, libgnat/a-stobbu.ads,
libgnat/a-stobfi.adb, libgnat/a-stobfi.ads,
libgnat/a-stoubu.adb, libgnat/a-stoubu.ads,
libgnat/a-stoufi.adb, libgnat/a-stoufi.ads,
libgnat/a-stoufo.adb, libgnat/a-stoufo.ads,
libgnat/a-stouut.adb, libgnat/a-stouut.ads,
libgnat/a-stteou.ads: Delete files.
* Makefile.rtl, impunit.adb: Remove references to deleted files.

3 years ago[Ada] Fix excessive check for alignment of overlaying objects
Piotr Trojanek [Thu, 29 Apr 2021 09:39:24 +0000 (11:39 +0200)]
[Ada] Fix excessive check for alignment of overlaying objects

gcc/ada/

* sem_util.adb (Has_Compatible_Alignment_Internal): If the
prefix of the Address expression is an entire object with a
known alignment, then skip checks related to its size.

3 years ago[Ada] The Unix Epochalyse of 2038 - OS_Time comparison
Doug Rupp [Wed, 28 Apr 2021 15:48:52 +0000 (08:48 -0700)]
[Ada] The Unix Epochalyse of 2038 - OS_Time comparison

gcc/ada/

* libgnat/s-os_lib.ads: Import OS_Time comparison ops as
intrinsic.
* libgnat/s-os_lib.adb: Remove OS_TIme comparison ops
implementation.

3 years ago[Ada] The Unix Epochalypse of 2038 (Warn about time_t in the compiler)
Doug Rupp [Wed, 28 Apr 2021 14:46:12 +0000 (07:46 -0700)]
[Ada] The Unix Epochalypse of 2038 (Warn about time_t in the compiler)

gcc/ada/

* libgnat/s-os_lib.ads: Add some comments about time_t.
* libgnat/s-os_lib.adb (GM_Split/To_GM_Time): Rename formal to
P_OS_Time.
(GM_Time_Of/To_OS_Time): Likewise.

3 years ago[Ada] Fix missing minus sign in literal translation
Ghjuvan Lacambre [Wed, 28 Apr 2021 09:03:03 +0000 (11:03 +0200)]
[Ada] Fix missing minus sign in literal translation

gcc/ada/

* sem_res.adb (Resolve): Insert minus sign if needed.

3 years ago[Ada] Temporarily disable Ada 2022 Image and Put_Image support for tagged types
Steve Baird [Tue, 27 Apr 2021 20:57:36 +0000 (13:57 -0700)]
[Ada] Temporarily disable Ada 2022 Image and Put_Image support for tagged types

gcc/ada/

* exp_put_image.adb:
(Enable_Put_Image, Preload_Root_Buffer_Type): Revert to querying
the -gnatd_z switch, as opposed to testing whether Ada_Version >= Ada_2022.

3 years ago[Ada] INOX: prototype alternative accessibility model
Justin Squirek [Mon, 29 Mar 2021 12:46:02 +0000 (08:46 -0400)]
[Ada] INOX: prototype alternative accessibility model

gcc/ada/

* checks.adb (Accessibility_Checks_Suppressed): Add check
against restriction No_Dynamic_Accessibility_Checks.
(Apply_Accessibility_Check): Add assertion to check restriction
No_Dynamic_Accessibility_Checks is not active.
* debug.adb: Add documentation for new debugging switch to
control which accessibility model gets employed under
restriction No_Dynamic_Accessibility_Checks.
* exp_attr.adb (Expand_N_Attribute_Reference): Disable dynamic
accessibility check generation when
No_Dynamic_Accessibility_Checks is active.
* exp_ch4.adb (Apply_Accessibility_Check): Skip check generation
when restriction No_Dynamic_Accessibility_Checks is active.
(Expand_N_Allocator): Disable dynamic accessibility checks when
No_Dynamic_Accessibility_Checks is active.
(Expand_N_In): Disable dynamic accessibility checks when
No_Dynamic_Accessibility_Checks is active.
(Expand_N_Type_Conversion): Disable dynamic accessibility checks
when No_Dynamic_Accessibility_Checks is active.
* exp_ch5.adb (Expand_N_Assignment_Statement): Disable
alternative accessibility model calculations when computing a
dynamic level for a SAOAAT.
* exp_ch6.adb (Add_Call_By_Copy_Code): Disable dynamic
accessibility check generation when
No_Dynamic_Accessibility_Checks is active.
(Expand_Branch): Disable alternative accessibility model
calculations.
(Expand_Call_Helper): Disable alternative accessibility model
calculations.
* restrict.adb, restrict.ads: Add new restriction
No_Dynamic_Accessibility_Checks.
(No_Dynamic_Accessibility_Checks_Enabled): Created to test when
experimental features (which are generally incompatible with
standard Ada) can be enabled.
* sem_attr.adb (Safe_Value_Conversions): Add handling of new
accessibility model under the restriction
No_Dynamic_Accessibility_Checks.
* sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
Disallow new restriction No_Dynamic_Accessibility_Checks from
being exclusively specified within a body or subunit without
being present in a specification.
* sem_res.adb (Check_Fully_Declared_Prefix): Minor comment
fixup.
(Valid_Conversion): Omit implicit conversion checks on anonymous
access types and perform static checking instead when
No_Dynamic_Accessibility_Checks is active.
* sem_util.adb, sem_util.ads (Accessibility_Level): Add special
handling of anonymous access objects, formal parameters,
anonymous access components, and function return objects.
(Deepest_Type_Access_Level): When
No_Dynamic_Accessibility_Checks is active employ an alternative
model. Add paramter Allow_Alt_Model to override the new behavior
in certain cases.
(Type_Access_Level): When No_Dynamic_Accessibility_Checks is
active employ an alternative model. Add parameter
Allow_Alt_Model to override the new behavior in certain cases.
(Typ_Access_Level): Created within Accessibility_Level for
convenience.
* libgnat/s-rident.ads, snames.ads-tmpl: Add handing for
No_Dynamic_Accessibility_Checks.

3 years ago[Ada] The Unix Epochalypse of 2038 - Use OS_Time
Doug Rupp [Mon, 26 Apr 2021 17:14:37 +0000 (10:14 -0700)]
[Ada] The Unix Epochalypse of 2038 - Use OS_Time

gcc/ada/

* adaint.h (__gnat_set_file_time_name): Use OS_Time.
* adaint.c (__gnat_set_file_time_name): Likewise.

3 years ago[Ada] The Unix Epochalyse of 2038 - OS_Time
Doug Rupp [Mon, 26 Apr 2021 04:52:09 +0000 (21:52 -0700)]
[Ada] The Unix Epochalyse of 2038 - OS_Time

gcc/ada/

* adaint.h (OS_Time): typedef as long long.
* osint.adb (Underlying_OS_Time): Declare as 64-bit signed type.
* libgnat/s-os_lib.adb ("<"): Compare OS_Time as
Long_Long_Integer.
("<="): Likewise.
(">"): Likewise.
(">="): Likewise.
* libgnat/s-os_lib.ads (OS_Time): Declare as 64-bit signed type.

3 years ago[Ada] Move overriding rename error message from declaration to use
Ghjuvan Lacambre [Tue, 27 Apr 2021 11:30:34 +0000 (13:30 +0200)]
[Ada] Move overriding rename error message from declaration to use

gcc/ada/

* sem_ch3.adb (Check_Abstract_Overriding): Post error message on
renaming node.

3 years ago[Ada] Adapt SPARK checking after change in rules regarding heap modeling
Yannick Moy [Wed, 7 Apr 2021 10:15:04 +0000 (12:15 +0200)]
[Ada] Adapt SPARK checking after change in rules regarding heap modeling

gcc/ada/

* libgnat/a-uncdea.ads: Add Depends/Post to
Ada.Unchecked_Deallocation.
* sem_ch4.adb (Analyze_Allocator): Remove checking of allocator
placement.
* sem_res.adb (Flag_Object): Same.

3 years ago[Ada] Turn GNAT_Annotate into its own pragma
Ghjuvan Lacambre [Wed, 17 Mar 2021 17:33:34 +0000 (18:33 +0100)]
[Ada] Turn GNAT_Annotate into its own pragma

gcc/ada/

* aspects.ads: Add GNAT_Annotate aspect.
* gnat1drv.adb (Adjust_Global_Switches): Stop defining
Name_Gnat_Annotate as an alias of Name_Annotate.
* snames.ads-tmpl: Define Gnat_Annotate.
* par-prag.adb, sem_prag.ads: Add Pragma_Gnat_Annotate to list
of pragmas.
* lib-writ.adb, sem_ch13.adb, sem_prag.adb: Handle Gnat_Annotate
like Aspect_Annotate.

3 years ago[Ada] Fix comment about the debug flag for strict alignment
Piotr Trojanek [Mon, 26 Apr 2021 14:09:49 +0000 (16:09 +0200)]
[Ada] Fix comment about the debug flag for strict alignment

gcc/ada/

* ttypes.ads (Target_Strict_Alignment): Fix comment.

3 years ago[Ada] Cleanup checking for compatible alignment
Piotr Trojanek [Mon, 26 Apr 2021 13:55:21 +0000 (15:55 +0200)]
[Ada] Cleanup checking for compatible alignment

gcc/ada/

* sem_util.adb (Has_Compatible_Alignment_Internal): Fix
indentation of ELSIF comments; remove explicit calls to
UI_To_Int; remove extra parens around the MOD operand.

3 years ago[Ada] Spurious error in instantiation with aggregate and private ancestor
Ed Schonberg [Mon, 26 Apr 2021 17:32:06 +0000 (13:32 -0400)]
[Ada] Spurious error in instantiation with aggregate and private ancestor

gcc/ada/

* sem_aggr.adb (Resolve_Record_Aggregate, Step_5): Do not check
for the need to use an extension aggregate for a given component
when within an instance and the type of the component hss a
private ancestor: the instantiation is legal if the generic
compiles, and spurious errors may be generated otherwise.