gcc/ada/
* freeze.adb (Check_Inherited_Conditions): Setting of Ekind,
LSP_Subprogram, and Is_Wrapper needs to happen for null
procedures as well as other wrapper cases, so the code is moved
from the else part in front of the if statement. (Fixes a
latent bug encountered while working on this set of changes.)
* sem_attr.adb (Resolve_Attribute): Report an error for the case
of an Access attribute applied to a primitive of an abstract
type when the primitive has any nonstatic Pre'Class or
Post'Class expressions.
* sem_ch8.adb (Analyze_Subprogram_Renaming): Report an error for
the case of a actual subprogram associated with a nonabstract
formal subprogram when the actual is a primitive of an abstract
type and the primitive has any nonstatic Pre'Class or Post'Class
expressions.
* sem_disp.adb (Check_Dispatching_Context): Remove special
testing for null procedures, and replace it with a relaxed test
that avoids getting an error about illegal calls to abstract
subprograms in cases where RM 6.1.1(7/5) applies in
Pre/Post'Class aspects. Also, remove special test for
Postcondition, which seems to be unnecessary, update associated
comments, and fix a typo in one comment.
(Check_Dispatching_Call): Remove an unneeded return statement,
and report an error for the case of a nondispatching call to a
nonabstract subprogram of an abstract type where the subprogram
has nonstatic Pre/Post'Class aspects.
* sem_util.ads
(Is_Prim_Of_Abst_Type_With_Nonstatic_CW_Pre_Post): New function.
(In_Pre_Post_Condition): Add a flag formal Class_Wide_Only,
defaulted to False, for indicating whether the function should
only test for the node being within class-wide pre- and
postconditions.
* sem_util.adb
(Is_Prim_Of_Abst_Type_With_Nonstatic_CW_Pre_Post): New function
to determine whether a subprogram is a primitive of an abstract
type where the primitive has class-wide Pre/Post'Class aspects
specified with nonstatic expressions.
(In_Pre_Post_Condition): Extend testing to account for the new
formal Class_Wide_Only.
gcc/ada/
* sem_ch12.adb (Check_Shared_Variable_Control_Aspects): Errors
emitted via Check_Volatility_Compatibility are now emitted at
Actual, just like other errors emitted by
Check_Shared_Variable_Control_Aspects.
gcc/ada/
* uname.adb (Get_Body_Name, Get_Parent_Body_Name,
Get_Parent_Spec_Name, Get_Spec_Name, Is_Child_Name,
Is_Body_Name, Is_Spec_Name, Name_To_Unit_Name): Use a local
instead of the global buffer.
gcc/ada/
* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Combine
processing of Size and Value_Size clauses. Ensure that
Value_Size is treated the same as Size, in the cases where both
are allowed (i.e. the prefix denotes a first subtype). Misc
cleanup.
* einfo-utils.adb (Init_Size): Add assertions.
(Size_Clause): Return a Value_Size clause if present, instead of
just looking for a Size clause.
* einfo.ads (Has_Size_Clause, Size_Clause): Change documentation
to include Value_Size.
* sem_ch13.ads, layout.ads, layout.adb: Comment modifications.
gcc/ada/
* exp_dist.adb (Add_RACW_Primitive_Declarations_And_Bodies): Add
TSS_Put_Image to list of predefined primitives that need special
treatment.
(Build_General_Calling_Stubs, Build_Subprogram_Receiving_Stubs):
Remove previous hack for dealing with TSS_Put_Image procedures.
gcc/ada/
* libgnat/g-socket.adb (Get_Socket_Option): Add 500ms only when
Minus_500ms_Windows_Timeout is True.
(Set_Socket_Option): Use "* 1000" instead of "/ 0.001" to
convert to milliseconds.
gcc/ada/
* tbuild.adb (Unchecked_Convert_To): Set the Parent of the new
node to the Parent of the old node.
* tbuild.ads (Unchecked_Convert_To): Document differences
between Convert_To and Unchecked_Convert_To. The previous
documentation claimed they are identical except for the
uncheckedness of the conversion.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
/
* 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>
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.
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.
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.
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.
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.
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.