Bob Duff [Tue, 5 Jan 2021 19:16:00 +0000 (14:16 -0500)]
[Ada] Clean up ??? marks
gcc/ada/
* binde.adb: No need for ??? marks in Binde, because it is
superseded by Bindo.
* bindo-writers.adb (Write_Unit_Closure): Verified that -Ra
works.
* exp_ch4.adb, sinfo.ads (Expand_N_Type_Conversion): Rules for
conversions passed to gigi are documented in sinfo.ads.
(Expand_N_Unchecked_Type_Conversion): Comment is a duplicate of
one in sinfo.ads.
(Expand_N_In): Robert already added sufficient comments years
after the ??? comment was inserted.
(Expand_Membership_Minimize_Eliminate_Overflow): I don't see any
reason why Stand should export Long_Long_Integer'Base -- it
doesn't export any other base types.
(Size_In_Storage_Elements): We are doing an allocator, so we
don't care about sizes in bits.
(Expand_N_Allocator): PolyORB isn't going to be significantly
improved, so we're not going to mess with remote access to
class-wide types.
(Optimize_Return_Stmt): It's not important to optimize return
statements in predicate functions -- there are many
more-important optimizations we could do. Keep part of the
comment without "???", to clarify why the "and then ...".
(User_Defined_Primitive_Equality_Op): The optimization doesn't
seem important enough.
(Expand_N_Unchecked_Type_Conversion): Refactor to use
Expand_N_Unchecked_Expression.
(Make_Array_Comparison_Op): This seems like a case of "it it's
not broken, don't fix it". Too much risk of causing bugs.
* debug_a.adb: Remove ??? comments asking why Current_Error_Node
is maintained unconditionally, and add a comment explaining why.
* errout.adb: These kinds of minor bugs do indeed exist, but
we're never going to get around to fixing them "properly", so we
need this code for robustness.
* gnatchop.adb (Read_File): Document when read can fail.
* gnatdll.adb (Parse_Command_Line): Nobody is complaining about
these arbitrary limits, so no need to use Table. Increase the
limits just in case. It is clear from the names what they are
limits on.
* gnatlink.adb: Add needed comments.
(Delete): An existing comment makes clear it's intentional, and
it's been like that since 1996.
(Process_Args): Improve comments.
(Search_Library_Path): Refactoring to avoid deep nesting.
* inline.adb (Build_Body_To_Inline): Probably won't get around
to doing that optimization.
(Is_Unit_Subprogram): No, this should not be moved to Sem_Aux,
because it is too specialized to this context.
(Do_Reset): No comment is needed here; it's clear from the
comment on Reset_Dispatching_Calls. Do_Reset is an artificial
subprogram; if we had proper iterators, it would just be an if
statement in the loop.
(Rewrite_Function_Call): Probably won't get around to doing that
optimization.
* layout.adb (Layout_Type): The gigi comment doesn't need to be
a ??? comment, and it's been that way since 2000. The
limitation to scalars will likely never be investigated, and
it's been that way since 2009.
* lib.adb (Check_Same_Extended_Unit): This doesn't look like
something that needs fixing; it looks like a permanent
workaround.
* lib-load.adb (Change_Main_Unit_To_Spec): It is good enough in
practice.
(Load_Unit): Nobody will ever get around to investigating the
obscure PMES oddity, and the optimization is not worth the
trouble.
* live.adb: It's not worth documenting this. It is used only
with a debug switch. Nobody who has done significant work on it
is still around, so it would require substantial investigation.
* mdll.ads: I see no reason for USE.
* namet.ads: Routines are obsolete, but they're not going
anywhere anytime soon (too much work, and surprisingly delicate
because of dependences on global variables).
* osint.ads: Minor.
* osint.adb: Improve comments.
(Full_Lib_File_Name): Use Smart_Find_File.
Piotr Trojanek [Tue, 5 Jan 2021 22:54:09 +0000 (23:54 +0100)]
[Ada] Reject constants of access-to-variable type as function globals
gcc/ada/
* sem_prag.adb (Analyze_Global_Item): Take subprogram kind into
account when accepting or rejecting a constant of an
access-to-variable type as a global Output/In_Out; do this check
inside an ELSIF branch to avoid unnecessary evaluation of the
subsequent condition.
Ed Schonberg [Mon, 4 Jan 2021 20:28:55 +0000 (15:28 -0500)]
[Ada] Ongoing work for AI12-0212: container aggregates
gcc/ada/
* exp_aggr.adb (Build_Siz_Exp): new function, subsidiary of
Expand_Container_Aggregate, to create an expression to be used
in the dynamic allocation of a container with a single container
element association.
(Add_Range): Handle static bounds of ranges over enumerations.
(Expand_Container_Aggregate): Add declaration for size
expression when needed, and use it in container object
declaration for container.
Arnaud Charlet [Thu, 17 Dec 2020 08:09:00 +0000 (03:09 -0500)]
[Ada] Missing finalization on generic instantiation
gcc/ada/
* exp_ch7.adb (Build_Finalizer_Helper.New_Finalizer_Name):
Unnest so that it can be reused.
(Build_Finalizer_Helper.Process_Declarations): Call the
xxx__finalize_body procedure of a package instantiation in case
it contains finalization statements. Code clean ups.
(Build_Finalizer_Helper.Create_Finalizer): Export and set an
Interface_Name for library level finalizers since these may be
imported now.
(Build_Finalizer_Helper): Need to process library level package
body instantiations which may contain objects requiring
finalization.
* libgnat/s-finmas.ads: Fix typo.
Piotr Trojanek [Tue, 22 Dec 2020 00:06:31 +0000 (01:06 +0100)]
[Ada] Reject formals of mode IN appearing as global outputs
gcc/ada/
* sem_prag.adb (Check_Mode_Restriction_In_Enclosing_Context):
Apply the rule even with no explicit Global contract (and remove
a dead condition for Refined_Global).
Eric Botcazou [Mon, 21 Dec 2020 07:37:34 +0000 (08:37 +0100)]
[Ada] Preliminary cleanup in floating-point output implementation
gcc/ada/
* exp_intr.adb: Remove with/use clauses for Urealp.
(Expand_Is_Negative): Delete.
(Expand_Intrinsic_Call): Do not call it.
* rtsfind.ads (RE_Id): Remove RE_Float_Unsigned.
(RE_Unit_Table): Remove entry for RE_Float_Unsigned.
* snames.ads-tmpl (Name_Is_Negative): Delete.
* libgnat/s-imgrea.ads (Set_Image_Real): Fix mode of S parameter.
* libgnat/s-imgrea.adb: Add with/use clauses for System.Img_Util.
(LLU): New subtype.
(Maxdigs): Use it.
(Is_Negative): Reimplement.
(Image_Floating_Point): Simplify.
(Set_Image_Real): Fix mode of S parameter. Remove the low-level
processing on characters. Flip the sign of the Scale variable.
Compute the maximum number of digits for the straight notation.
Call Set_Decimal_Digits at the end to do the final formatting.
* libgnat/s-imguti.ads (Floating_Invalid_Value): New type.
(Set_Floating_Invalid_Value): New procedure.
* libgnat/s-imguti.adb (Set_Floating_Invalid_Value): Implement it
based on existing code from Set_Image_Real.
* libgnat/s-unstyp.ads (Float_Unsigned): Delete.
Piotr Trojanek [Fri, 1 Jan 2021 23:51:21 +0000 (00:51 +0100)]
[Ada] Fix inconsistent handling of character set control switches
gcc/ada/
* csets.adb (Initialize): Refactor into CASE statement; raise
exception on unsupported code of character set (it will be
gently rejected earlier when scanning command line switches).
* switch-b.adb (Scan_Binder_Switches): Refactor into a
membership expression; add missing '9' choice; reorder as
described by GNAT UG, section 4.3.11.
* switch-c.adb (Scan_Front_End_Switches): Refactor into a
membership expression and reorder as above.
* doc/gnat_ugn/building_executable_programs_with_gnat.rst
(gnatic): Mention '5' as an allowed value for "c".
* gnat_ugn.texi: Regenerate.
Tobias Burnus [Tue, 4 May 2021 07:22:36 +0000 (09:22 +0200)]
OpenMP/Fortran - fix pasto + testcase in depobj [PR100397]
gcc/fortran/ChangeLog:
PR testsuite/100397
* trans-openmp.c (gfc_trans_omp_depobj): Fix pasto in enum values.
libgomp/ChangeLog:
PR testsuite/100397
* testsuite/libgomp.fortran/depobj-1.f90 (dep2, dep3): Move var
declaration to scope of non-'depend'-guarded assignment to avoid races.
Alexandre Oliva [Tue, 4 May 2021 01:48:47 +0000 (22:48 -0300)]
introduce try store by multiple pieces
The ldist pass turns even very short loops into memset calls. E.g.,
the TFmode emulation calls end with a loop of up to 3 iterations, to
zero out trailing words, and the loop distribution pass turns them
into calls of the memset builtin.
Though short constant-length clearing memsets are usually dealt with
efficiently, for non-constant-length ones, the options are setmemM, or
a function calls.
RISC-V doesn't have any setmemM pattern, so the loops above end up
"optimized" into memset calls, incurring not only the overhead of an
explicit call, but also discarding the information the compiler has
about the alignment of the destination, and that the length is a
multiple of the word alignment.
This patch handles variable lengths with multiple conditional
power-of-2-constant-sized stores-by-pieces, so as to reduce the
overhead of length compares.
It also changes the last copy-prop pass into ccp, so that pointer
alignment and length's nonzero bits are detected and made available
for the expander, even for ldist-introduced SSA_NAMEs.
for gcc/ChangeLog
* builtins.c (try_store_by_multiple_pieces): New.
(expand_builtin_memset_args): Use it. If target_char_cast
fails, proceed as for non-constant val. Pass len's ctz to...
* expr.c (clear_storage_hints): ... this. Try store by
multiple pieces after setmem.
(clear_storage): Adjust.
* expr.h (clear_storage_hints): Likewise.
(try_store_by_multiple_pieces): Declare.
* passes.def: Replace the last copy_prop with ccp.
Tom de Vries [Mon, 3 May 2021 09:36:14 +0000 (11:36 +0200)]
[openmp, simt] Disable SIMT for user-defined reduction
The test-case included in this patch contains this target region:
...
for (int i0 = 0 ; i0 < N0 ; i0++ )
counter_N0.i += 1;
...
When running with nvptx accelerator, the counter variable is expected to
be N0 after the region, but instead is N0 / 32. The problem is that rather
than getting the result for all warp lanes, we get it for just one lane.
This is caused by the implementation of SIMT being incomplete. It handles
regular reductions, but appearantly not user-defined reductions.
For now, handle this by disabling SIMT in this case, specifically by setting
sctx->max_vf to 1.
Tested libgomp on x86_64-linux with nvptx accelerator.
gcc/ChangeLog:
2021-05-03 Tom de Vries <tdevries@suse.de>
PR target/100321
* omp-low.c (lower_rec_input_clauses): Disable SIMT for user-defined
reduction.
libgomp/ChangeLog:
2021-05-03 Tom de Vries <tdevries@suse.de>
PR target/100321
* testsuite/libgomp.c/target-44.c: New test.
Patrick Palka [Mon, 3 May 2021 17:35:37 +0000 (13:35 -0400)]
c++: base-clause parsing and implicit 'this' [PR100362]
My r11-6815 change to defer access checking when processing a
base-clause removed a pair of pushclass / popclass calls that seemed to
be unnecessary now that we'd also defer access checking while parsing
the base-clause.
But it turns out these calls make a difference in the below testcase,
where we have a local class whose base-clause implicitly uses the 'this'
of the enclosing class. Before r11-6815, while parsing the base-clause
of the local class, maybe_resolve_dummy would fail to resolve the dummy
'this' object because the current scope would be the local class. Now,
since the current scope is the lambda, maybe_resolve_dummy succeeds and
returns the 'this' for the enclosing class Qux. Later, during deferred
instantiation of the local class, we get confused trying to resolve the
access of 'a_' through this non-dummy 'this'.
So this patch just reinstates the calls to pushclass / popclass that
were removed in r11-6815.
gcc/cp/ChangeLog:
PR c++/100362
* parser.c (cp_parser_class_head): Reinstate calls to pushclass
and popclass when parsing the base-clause that were removed in
r11-6815.
gcc/testsuite/ChangeLog:
PR c++/100362
* g++.dg/cpp1y/lambda-generic-100362.C: New test.
Patrick Palka [Mon, 3 May 2021 17:35:26 +0000 (13:35 -0400)]
c++: mark_used and ADL with template-id [PR100344]
My r11-295 patch for PR68942 didn't consider that the callee of an
ADL-eligible function call can be a TEMPLATE_ID_EXPR, and we don't want
to disable mark_used when substituting into the template arguments of
this TEMPLATE_ID_EXPR because the arguments are clearly used regardless
of the outcome of ADL. In the first testcase below, this oversight
causes us to trip over the assert in build_call_a for the call to
find_index<int> because the function no longer had its TREE_USED bit set
from mark_used.
So this patch restricts the original fix to disable mark_used only when
the callee is a FUNCTION_DECL, which seems to be the only case that
matters for PR68942. For instance, in the second testcase below we
already don't mark_used the deleted function specialization even before
r11-295.
gcc/cp/ChangeLog:
PR c++/68942
PR c++/100344
* pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Set tf_conv
only when the callee is a FUNCTION_DECL.
gcc/testsuite/ChangeLog:
PR c++/68942
PR c++/100344
* g++.dg/template/call8.C: New test.
* g++.dg/template/koenig12a.C: New test.
Marek Polacek [Thu, 22 Apr 2021 21:32:01 +0000 (17:32 -0400)]
c++: Fix ICE with invalid requires-expression [PR100055]
This fixes a crash on invalid requires-expression: in this test,
current_template_parms is null so accessing TEMPLATE_PARMS_CONSTRAINTS
is going to fail. So don't crash, but make sure we've complained
already.
Richard Biener [Mon, 3 May 2021 10:07:58 +0000 (12:07 +0200)]
Improve PHI handling in DSE
This improves handling of PHI defs when walking uses in
dse_classify_store to track two PHI defs. This happens
when there are CFG merges and one PHI feeds into another.
If we decide to want more then using a sbitmap for this might be
the way to go.
2021-05-03 Richard Biener <rguenther@suse.de>
* tree-ssa-dse.c (dse_classify_store): Track two PHI defs.
* gcc.dg/tree-ssa/ssa-dse-42.c: New testcase.
* gcc.dg/pr81192.c: Disable DSE.
Richard Biener [Mon, 3 May 2021 07:17:55 +0000 (09:17 +0200)]
Perform reverse program order walk for GIMPLE DSE
The following changes the post-dominator domwalk done by GIMPLE DSE
to a reverse program order walk. This enables 2% more stmts do be
DSEd during bootstrap and in particular for testcases like the one
added where it is important to visit post dominators in a particular
order.
2021-05-03 Richard Biener <rguenther@suse.de>
* tree-ssa-dse.c: Do not include domwalk.h but cfganal.h.
(dse_dom_walker): Remove.
(dse_dom_walker::dse_optimize_stmt): Rename...
(dse_optimize_stmt): ... to this, pass in live_bytes sbitmap.
(dse_dom_walker::before_dom_children): Inline ...
(pass_dse::execute): ... here. Perform a reverse program
order walk.
IBM Z: Handle hard registers in s390_md_asm_adjust()
gen_fprx2_to_tf() and gen_tf_to_fprx2() cannot handle hard registers,
since the subregs they create do not pass validation. Change
s390_md_asm_adjust() to manually copy between hard VRs and FPRs instead
of using these two functions.
gcc/ChangeLog:
PR target/100217
* config/s390/s390.c (s390_hard_fp_reg_p): New function.
(s390_md_asm_adjust): Handle hard registers.
gcc/testsuite/ChangeLog:
PR target/100217
* gcc.target/s390/vector/long-double-asm-in-out-hard-fp-reg.c: New test.
* gcc.target/s390/vector/long-double-asm-inout-hard-fp-reg.c: New test.
Jakub Jelinek [Mon, 3 May 2021 10:03:02 +0000 (12:03 +0200)]
tree-ssa-dse: Fix up go.test/test/fixedbugs/issue16095.go miscompilation [PR100382]
The new DCE code inside of tree DSE removes in -fnon-call-exceptions
go code a load from NULL pointer the testcase relies on throwing an
exception and so the test hangs.
The following patch just repeats a check that e.g. tree-ssa-dce.c
uses to prevent this.
2021-05-03 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/100382
* tree-ssa-dse.c: Include tree-eh.h.
(dse_dom_walker::before_dom_children): Don't remove stmts if
stmt_unremovable_because_of_non_call_eh_p is true.
Arnaud Charlet [Fri, 1 Jan 2021 10:35:47 +0000 (05:35 -0500)]
[Ada] Ada.Strings.Unbounded.Aux.Set_String
gcc/ada/
* libgnat/a-stunau.ads, libgnat/a-stunau.adb,
libgnat/a-stunau__shared.adb (Set_String): Remove old version,
replace by a new version taking a callback to set the string.
Piotr Trojanek [Tue, 1 Dec 2020 11:03:10 +0000 (12:03 +0100)]
[Ada] Reuse a wrapper for Resolve with implicit type where possible
gcc/ada/
* sem_attr.adb (Analyze_Attribute): Reuse Resolve with implicit
type when analysing attribute Priority.
* sem_ch5.adb (Analyze_Case_Statement): Likewise for a rare case
in analysis of case statements.
(Analyze_Iterator_Specification): Likewise for non-overloaded
domain of iteration.
Piotr Trojanek [Thu, 31 Dec 2020 14:02:36 +0000 (15:02 +0100)]
[Ada] Refine type of a counter object from Int to Nat
gcc/ada/
* exp_ch7.adb (Build_Finalize_Statements): Refine type of a
local counter variable.
* exp_dist.adb (Append_Record_Traversal): Refine type of Counter
parameter.
(Add_Process_Element): Likewise.
(Build_From_Any_Call): Refine type of a local counter variable.
(Build_From_Any_Function): Likewise.
(Build_To_Any_Function): Likewise.
(FA_Rec_Add_Process_Element): Likewise.
(TA_Append_Record_Traversal): Likewise.
(TA_Rec_Add_Process_Element): Likewise.
Piotr Trojanek [Mon, 28 Dec 2020 23:42:25 +0000 (00:42 +0100)]
[Ada] Remove unused initial values in expansion of distributed calls
gcc/ada/
* exp_dist.adb (Build_From_Any_Call): Remove initial value for
Fnam; fix style.
(Build_To_Any_Call): Remove initial value for Fnam.
(Build_TypeCode_Call): Likewise.
Ed Schonberg [Wed, 30 Dec 2020 21:59:55 +0000 (16:59 -0500)]
[Ada] Error message on invalid prefixed procedure call
gcc/ada/
* sem_ch4.adb (Try_Object_Operation): When a prefixed call is
overloaded and illegal, and the All_Errors flag is off, generate
an error message if the re-analysis of some candidate
interpretation fails to produce one.
Piotr Trojanek [Wed, 23 Dec 2020 23:54:40 +0000 (00:54 +0100)]
[Ada] Allow attributes Version and Body_Version prefixed by entries
gcc/ada/
* sem_attr.adb (Check_Program_Unit): Replace tests for Task_Kind
and Protected_Kind with a collective test for Concurrent_Kind;
likewise, replace calls to Is_Task_Type and Is_Protected_Type
with a collective call to Is_Concurrent_Type; simplify into a
single membership test; add missing Entry_Kind alternative.
Piotr Trojanek [Wed, 23 Dec 2020 17:57:18 +0000 (18:57 +0100)]
[Ada] Fix calls to Error_Msg_NE instead of Error_Msg_N
gcc/ada/
* freeze.adb (Freeze_Profile): Replace Error_Msg_NE with
Error_Msg_N; change to continuation message.
* sem_cat.adb, sem_ch10.adb, sem_ch12.adb, sem_ch5.adb: Replace
calls to Error_Msg_NE with calls to Error_Msg_N.
Piotr Trojanek [Wed, 23 Dec 2020 17:51:43 +0000 (18:51 +0100)]
[Ada] Remove leading and trailing spaces in error messages
gcc/ada/
* exp_disp.adb, sem_aggr.adb, sem_cat.adb, sem_ch10.adb,
sem_ch12.adb, sem_ch3.adb, sem_ch4.adb, sem_ch5.adb,
sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_prag.adb,
sem_res.adb: Remove extra leading and trailing space in error
messages.
Ed Schonberg [Thu, 24 Dec 2020 01:21:13 +0000 (20:21 -0500)]
[Ada] Spurious warning about premature use of selected component
gcc/ada/
* sem_warn.adb (Check_References): Do not emit warning on a
selected component when enclosing type has no discriminant and
type of component has partial initialization.
Justin Squirek [Wed, 23 Dec 2020 18:06:22 +0000 (13:06 -0500)]
[Ada] Expansion in _postconditions confusing CodePeer
gcc/ada/
* contracts.adb (Build_Postconditions_Procedure): Remove
internally generated if statement used to control finalization
actions.
* exp_ch6.adb (Add_Return, Expand_Non_Function_Return,
Expand_Simple_Function_Return): Add if statement around
_postconditions to control finalization.
* exp_ch7.adb (Build_Finalizer): Likewise.
* sem_prag.adb (Find_Related_Declaration_Or_Body): Add case to
handle Context itself being a handled sequence of statements.
Justin Squirek [Tue, 22 Dec 2020 14:58:43 +0000 (09:58 -0500)]
[Ada] Spurious accessibility error on call in return statement
gcc/ada/
* sem_util.adb (In_Return_Value): Modified to detect when
implicit dereference is specified on the return type of a
function call within the expression being checked.
Ed Schonberg [Wed, 23 Dec 2020 00:46:37 +0000 (19:46 -0500)]
[Ada] Crash on aggregate in function call in object declaration
gcc/ada/
* exp_aggr.adb (Expand_Array_Aggregate): If the parent node of
the aggregate is a subprogram call there is no target in which
to build the aggregate, and it has to be expanded into component
assignments.
Piotr Trojanek [Wed, 23 Dec 2020 10:35:19 +0000 (11:35 +0100)]
[Ada] Code and style cleanups for CUDA
gcc/ada/
* exp_prag.adb (Expand_Pragma_CUDA_Execute): Refill comments;
remove periods after single-line comments; use procedural
variant of Next_Entity.
* gnat_cuda.adb: Refill comments; remove periods after
single-line comments; replace calls to UI_From_Int with
constants; change iteration bounds so they match the comments.
* sem_prag.adb (Analyze_Pragma): Add checks for malformed pragma
CUDA_Kernel aggregate; simplify processing of pragma CUDA_Global
with Check_Arg_Count; sync comment with code for CUDA_Global.
Arnaud Charlet [Tue, 22 Dec 2020 15:34:37 +0000 (10:34 -0500)]
[Ada] Spurious warning on postcondition and result
gcc/ada/
* sem_util.adb (Check_Result_And_Post_State): Replace custom
Has_In_Out_Parameter with existing Has_Out_Or_In_Out_Parameter
flag which corresponds exactly to what we need.
Piotr Trojanek [Mon, 21 Dec 2020 12:37:27 +0000 (13:37 +0100)]
[Ada] Cleanup processing of aspect Dynamic_Predicate
gcc/ada/
* sem_ch13.adb (Build_Predicate_Functions): Fix typo in comment.
(Resolve_Aspect_Expressions): Fix typo in comment; remove
redundant check for no aspects; simplify with Discard_Node.
Ed Schonberg [Mon, 21 Dec 2020 01:18:33 +0000 (20:18 -0500)]
[Ada] Compiler aborts on a constrained subtype of a predicated type
gcc/ada/
* sem_util.adb (Build_Constrained_Itype): Remove prior patch,
issue is better handled in Sem_Ch13.Build_Predicate_Functions.
* sem_ch13.adb (Build_Predicate_Functions): Do not build
predicate function for an Itype with a defined
Predicated_Parent, even if that designated parent does not yet
have a Predicate_Function. This can happen in instance bodies
nested within a generic unit.
David Edelsohn [Tue, 6 Apr 2021 15:41:49 +0000 (11:41 -0400)]
aix: Redesign section encoding and selection
AIX symbol references can refer to either the symbol (a label) or a
symbol with a qualifier (the storage mapping class). The storage mapping
class provide information about the underlying COFF section into which the
symbol will be placed, e.g. [RO] for read-only in the text section,
[RW] for read-writer in the data section, or [BS] for the BSS section.
A label is distinct from a qualname in the assembler language, e.g.,
foo and foo[RW] are different, but the symbol table of an object file strips
the storage mapping class from the name, so that it no longer is relevant
when referring to symbols across object files and libraries.
.csect .data[RW]
i:
is a label "i" in the .data CSECT, which has storage mapping class [RW]
so that it is placed in the read-write COFF section.
.csect i[RW]
is a CSECT "i[RW]". BSS does not allow interior labels.
The AIX port of GCC had been emitting the storage mapping class where
appropriate but not consistently using the storage mapping class on
the DECL or SYM name. This patch updates the section encoding to properly
place storage mapping class on symbol names and remove the decorations
placed when emitting the symbol.
The mapping classes correspond to sections and the encoding choices must
exactly match the section choices made by get_section, so the logic for
the computation of reloc in get_variable_section is split into its own
function that XCOFF encode section info can call.
gcc/ChangeLog:
* varasm.c (compute_reloc_for_var): Split out from...
(get_variable_section): Use it.
* output.h (compute_reloc_for_var): Declare.
* config/rs6000/rs6000-protos.h
(rs6000_xcoff_asm_output_aligned_decl_common): Change alignment to
unsigned int.
* config/rs6000/rs6000.c (rs6000_legitimize_tls_address_aix):
Don't append storage mapping class to symbol.
(rs6000_xcoff_asm_named_section): Add BS and UL mapping classes.
Don't convert TLS BSS to common.
(rs6000_xcoff_unique_section): Don't fall back to select_secton.
(rs6000_xcoff_section_type_flags): Add SECTION_BSS if DECL is
bss_initializer.
(rs6000_xcoff_asm_globalize_decl_name): Don't strip storage
mapping class.
(rs6000_xcoff_asm_output_aligned_decl_common): Align is unsigned int.
If align is 0 from TLS class, use the same rules as varasm.c
If not common, switch to BSS section manually.
If common, emit appropriate comm or lcomm directive.
(rs6000_xcoff_encode_section_info): Add logic to append all
storage mapping classes.
(rs6000_asm_weaken_decl): Adjust for qualname symbols.
* config/rs6000/xcoff.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use
rs6000_xcoff_asm_output_aligned_decl_common.
(ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use
rs6000_xcoff_asm_output_aligned_decl_common.
(ASM_OUTPUT_TLS_COMMON): Use
rs6000_xcoff_asm_output_aligned_decl_common.
gcc/testsuite/ChangeLog:
* g++.dg/ext/visibility/fvisibility-inlines-hidden-4.C: Expect [BS]
mapping class on AIX.
* gcc.c-torture/compile/pr61159.c: XFAIL on AIX.
* gcc.c-torture/execute/alias-2.c: Same.
* gcc.dg/alias-7.c: Same.
Follow up to PR100352, which moved unit unlocking to st_*_done_worker to
avoid lock order reversal; however, as async_io uses a different lock,
the (unlocked locked) unit lock shall not be unlocked there.
libgfortran/ChangeLog:
PR libgomp/100352
* io/transfer.c (st_read_done_worker, st_write_done_worker): Add new
arg whether to unlock unit.
(st_read_done, st_write_done): Call it with true.
* io/async.c (async_io): Call it with false.
* io/io.h (st_write_done_worker, st_read_done_worker): Update prototype.
Jakub Jelinek [Sun, 2 May 2021 12:17:23 +0000 (14:17 +0200)]
nvptx: Fix up nvptx build against latest libstdc++ [PR100375]
The r12-220-gd96db15967e78d7cecea3b1cf3169ceb924678ac change
deprecated some non-standard std::pair constructors and that apparently
broke nvptx.c build, where pseudo_node_t is std::pair<struct basic_block_def *, int>
and so nullptr (or NULL) needs to be used for the first argument of the
ctors instead of 0.
2021-05-02 Jakub Jelinek <jakub@redhat.com>
PR target/100375
* config/nvptx/nvptx.c (nvptx_sese_pseudo): Use nullptr instead of 0
as first argument of pseudo_node_t constructors.
Jakub Jelinek [Sun, 2 May 2021 08:28:11 +0000 (10:28 +0200)]
i386: Fix up plugin header install on x86 [PR100336]
The recent addition of i386-isa.def which is included from i386.h results
in failures to build gcc plugins, the i386.h header is installed, but
i386-isa.def is not.
Jason Merrill [Tue, 2 Mar 2021 21:30:41 +0000 (16:30 -0500)]
c++: C++11 range-for and ovl/lkp_iterator
We can't use C++11 range-based 'for' over a tree directly, because we don't
know what kind of range we want to use it as. I suppose in some cases we
could guess, but it seems better to tersely make it explicit. This patch
adds range adaptors ovl_range and lkp_range for use as the range of a
range-for, e.g.
for (tree fn : lkp_range (fns)) { ... }
This patch also removes the private copy ops from ovl_iterator; it's
necessary for range-for, and these are effectively C++ forward_iterators,
which allow copying, so I don't see a reason to prevent it. A bit more
would need to be done to make them actually conform as C++11 forward
iterators, but I don't think we particularly want to #include <iterator>
yet.
Right now we have GTY support for static storage iranges
(int_range<>). However, there's no reason why the base
class can't be used with GC, other than it was an oversight.
For that matter, the base class has a pointer to the sub-range
storage, so we can use the same implementation for both. This
patch does so.
I have also removed the DEFINE_INT_RANGE_GC_STUBS
stuff, and have documented why we need a separate
gt_pch_nx (int_range<1> *&) version. This has to do with
hash-traits.h, which ipa-prop.c is using to store a value_range.
The header file hash-traits.h is defining an extern of
gt_pch_nx (int_range<1> *&) etc, instead of calling the
more generic (int_range<1> *) which is already available.
It seems suspect that has-traits.h has their own externs
for GC functions, and if someone has a better solution, I'd
be glad to hear it.
gcc/ChangeLog:
* value-range.cc (DEFINE_INT_RANGE_GC_STUBS): Remove.
(gt_pch_nx (int_range<1> *&)): New.
(gt_ggc_mx (int_range<1> *&)): New.
* value-range.h (class irange): Add GTY support for
the base class.
Patrick Palka [Fri, 30 Apr 2021 22:45:46 +0000 (18:45 -0400)]
libstdc++: Implement P2328 changes to join_view
This implements the wording changes of P2328R0 "join_view should join
all views of ranges".
libstdc++-v3/ChangeLog:
* include/std/ranges (__detail::__non_propating_cache): Define
as per P2328.
(join_view): Remove constraints on the value and reference types
of the wrapped iterator type as per P2328.
(join_view::_Iterator::_M_satisfy): Adjust as per P2328.
(join_view::_Iterator::operator++): Likewise.
(join_view::_M_inner): Use __non_propating_cache as per P2328.
Remove now-redundant use of __maybe_present_t.
* testsuite/std/ranges/adaptors/join.cc: Include <array>.
(test10): New test.
Jonathan Wakely [Fri, 30 Apr 2021 19:32:05 +0000 (20:32 +0100)]
libstdc++: Fix inconsistent feature test macros
The __cpp_lib_constexpr_string and __cpp_lib_semaphore feature test
macros are not defined consistently in <version> and the relevant header
for the feature.
libstdc++-v3/ChangeLog:
* include/bits/basic_string.h (__cpp_lib_constexpr_string):
Only define for C++17 and later.
* include/std/version (__cpp_lib_semaphore): Fix condition
to match the one in <semaphore>.
Jonathan Wakely [Fri, 30 Apr 2021 14:54:14 +0000 (15:54 +0100)]
libstdc++: Remove GLIBCXX_CHECK_INT64_T checks
This simplifies the definition of std::streamoff by using the predefined
__INT64_TYPE__ macro, instead of the _GLIBCXX_HAVE_INT64_T_LONG,
_GLIBCXX_HAVE_INT64_T_LONG_LONG and _GLIBCXX_HAVE_INT64_T macros defined
by configure.
By using the __INT64_TYPE__ macro (which all of GCC, Clang and Intel
define) we do not need to determine the type of int64_t in configure, we
can just use that type directly.
The background for the change was explained by David Edelsohn:
Currently the type of streamoff is determined at libstdc++ configure
time, chosen by the definitions of _GLIBCXX_HAVE_INT64_T_LONG and
_GLIBCXX_HAVE_INT64_T_LONG_LONG. For a multilib configuration, the
difference is encoded in the different multilib header file paths.
For "FAT" library targets that package 32 bit and 64 bit libraries
together, G++ also expects a single header file directory hierarchy,
causing an incorrect value for streamoff in some situations.
And in a subsequent mail:
Most of the libstdc++ headers are architecture-neutral, OS neutral and
ABI neutral. The differences are localized in bits/c++config.h. And
most of c++config.h is identical for 32 bit AIX and 64 bit AIX. The
only differences that matter are __int128 and __int64_t.
This change removes some of those differences. With the only uses of the
INT64_T configure macros removed, the configure checks themselves can
also be removed.
Co-authored-by: David Edelsohn <dje.gcc@gmail.com>
libstdc++-v3/ChangeLog:
* acinclude.m4 (GLIBCXX_CHECK_INT64_T): Delete.
* config.h.in: Regenerate.
* configure: Regenerate.
* configure.ac: Do not use GLIBCXX_CHECK_INT64_T.
* include/bits/postypes.h: Remove include of <stdint.h> and
definition/undefinition of the __STDC_LIMIT_MACROS and
__STDC_CONSTANT_MACROS macros.
(streamoff): Use __INT64_TYPE__ if defined.
Jonathan Wright [Mon, 15 Feb 2021 23:52:47 +0000 (23:52 +0000)]
testsuite: aarch64: Add fusion tests for FP vml[as] intrinsics
Add compilation tests to make sure that the output of vmla/vmls
floating-point Neon intrinsics (fmul, fadd/fsub) is not fused into
fmla/fmls instructions.
gcc/testsuite/ChangeLog:
2021-02-16 Jonathan Wright <jonathan.wright@arm.com>
* gcc.target/aarch64/advsimd-intrinsics/vmla_float_not_fused.c:
New test.
* gcc.target/aarch64/advsimd-intrinsics/vmls_float_not_fused.c:
New test.
Jonathan Wright [Wed, 17 Feb 2021 13:13:52 +0000 (13:13 +0000)]
aarch64: Use RTL builtins for FP ml[as][q]_laneq intrinsics
Rewrite floating-point vml[as][q]_laneq Neon intrinsics to use RTL
builtins rather than relying on the GCC vector extensions. Using RTL
builtins allows control over the emission of fmla/fmls instructions
(which we don't want here.)
With this commit, the code generated by these intrinsics changes from
a fused multiply-add/subtract instruction to an fmul followed by an
fadd/fsub instruction. If the programmer really wants fmla/fmls
instructions, they can use the vfm[as] intrinsics.
gcc/ChangeLog:
2021-02-17 Jonathan Wright <jonathan.wright@arm.com>
Jonathan Wright [Tue, 16 Feb 2021 23:59:22 +0000 (23:59 +0000)]
aarch64: Use RTL builtins for FP ml[as][q]_lane intrinsics
Rewrite floating-point vml[as][q]_lane Neon intrinsics to use RTL
builtins rather than relying on the GCC vector extensions. Using RTL
builtins allows control over the emission of fmla/fmls instructions
(which we don't want here.)
With this commit, the code generated by these intrinsics changes from
a fused multiply-add/subtract instruction to an fmul followed by an
fadd/fsub instruction. If the programmer really wants fmla/fmls
instructions, they can use the vfm[as] intrinsics.
gcc/ChangeLog:
2021-02-16 Jonathan Wright <jonathan.wright@arm.com>
Jonathan Wright [Tue, 16 Feb 2021 15:42:36 +0000 (15:42 +0000)]
aarch64: Use RTL builtins for FP ml[as] intrinsics
Rewrite floating-point vml[as][q] Neon intrinsics to use RTL builtins
rather than relying on the GCC vector extensions. Using RTL builtins
allows control over the emission of fmla/fmls instructions (which we
don't want here.)
With this commit, the code generated by these intrinsics changes from
a fused multiply-add/subtract instruction to an fmul followed by an
fadd/fsub instruction. If the programmer really wants fmla/fmls
instructions, they can use the vfm[as] intrinsics.
gcc/ChangeLog:
2021-02-16 Jonathan Wright <jonathan.wright@arm.com>
Jonathan Wright [Mon, 18 Jan 2021 12:42:52 +0000 (12:42 +0000)]
aarch64: Use RTL builtins for FP ml[as]_n intrinsics
Rewrite floating-point vml[as][q]_n Neon intrinsics to use RTL
builtins rather than inline assembly code, allowing for better
scheduling and optimization.
gcc/ChangeLog:
2021-01-18 Jonathan Wright <jonathan.wright@arm.com>
This patch adjusts peepholes to match and generate parallels with
a clobber of REG_CC.
It also sets mov<mode>_insn as the name of the pattern for the split
insn (rather than the define_insn_and_split), so that
avr_2word_insn_p, which looks for CODE_FOR_mov<mode>_insn, works
correctly. This is required for the *cpse.eq peephole to fire, and
also helps generate better code for avr_out_sbxx_branch.
gcc/ChangeLog:
* config/avr/avr.md: Adjust peepholes to match and
generate parallels with clobber of REG_CC.
(mov<mode>_insn): Rename to mov<mode>_insn_split.
(*mov<mode>_insn): Rename to mov<mode>_insn.
David Edelsohn [Thu, 29 Apr 2021 18:44:01 +0000 (14:44 -0400)]
middle-end: Disable section anchors for VAR_DECLs if -fdata-sections
-fdata-sections places data symbols into their own, unique, named sections.
-fsection-anchors create an anchor to access neighboring symbols
within a section.
When both are enabled, a separate section anchor is created for each
symbol, which provides no benefit.
This patch updates the common gating function use_blocks_for_decl_p() to
return false if -fdata-sections is enabled.
gcc/ChangeLog:
* varasm.c (use_blocks_for_decl_p): Don't use section anchors
for VAR_DECLs if -fdata-sections enabled.
Michael Meissner [Fri, 30 Apr 2021 16:32:08 +0000 (12:32 -0400)]
Define target hook to emit KFmode constants for libgcc.
This patch defines a target hook so that the KFmode constants
(__LIBGCC_KF_MAX__, __LIBGCC_KF_MIN__, and __LIBGCC_KF_EPSILON__) needed to
build _divkc3.c in libgcc are defined. The need for these constants were added
in the April 28th changes to libgcc that added complex division optimizations.
We only define the KFmode constants if IEEE 128-bit floating point is
supported, but long double does not use the IEEE 128-bit format. If long
double uses the IEEE 128-bit format, it will use TFmode and not KFmode.
gcc/
2021-04-30 Michael Meissner <meissner@linux.ibm.com>
PR bootstrap/100327
* config/rs6000/rs6000.c
(TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P): Define.
(rs6000_libgcc_floating_mode_supported_p): New target hook.
Refactor backward threader registry and profitability code into classes.
This refactors the registry and the profitability code from the
backwards threader into two separate classes. It cleans up the code,
and makes it easier for alternate implementations to share code.
gcc/ChangeLog:
* tree-ssa-threadbackward.c (class thread_jumps): Split out code
from here...
(class back_threader_registry): ...to here...
(class back_threader_profitability): ...and here...
(thread_jumps::thread_through_all_blocks): Remove argument.
(back_threader_registry::back_threader_registry): New.
(back_threader_registry::~back_threader_registry): New.
(back_threader_registry::thread_through_all_blocks): New.
(thread_jumps::profitable_jump_thread_path): Move from here...
(back_threader_profitability::profitable_path_p): ...to here.
(thread_jumps::find_taken_edge): New.
(thread_jumps::convert_and_register_current_path): Move...
(back_threader_registry::register_path): ...to here.
(thread_jumps::register_jump_thread_path_if_profitable): Move...
(thread_jumps::maybe_register_path): ...to here.
(thread_jumps::handle_phi): Call find_taken_edge and
maybe_register_path.
(thread_jumps::handle_assignment): Same.
(thread_jumps::fsm_find_control_statement_thread_paths): Remove
tree argument to handle_phi and handle_assignment.
(thread_jumps::find_jump_threads_backwards): Set m_name. Remove
set of m_speed_p and m_max_threaded_paths.
(pass_thread_jumps::execute): Remove second argument from
find_jump_threads_backwards.
(pass_early_thread_jumps::execute): Same.
Aldy Hernandez [Sat, 21 Nov 2020 17:26:21 +0000 (18:26 +0100)]
Jump threader refactor.
This is an overall refactor of the jump threader, both for the low level
bits in tree-ssa-threadupdate.* and the high level bits in
tree-ssa-threadedge.*.
There should be no functional changes.
Some of the benefits of the refactor are:
a) Eliminates some icky global state (for example the x_vr_values hack).
b) Provides some semblance of an API for the threader.
c) Makes it clearer to see what parts are from the high level
threader, and what parts belong in the low level path registry and
BB threading mechanism.
d) Avoids passing a ton of variables around.
e) Provides for easier sharing with the backward threader.
f) Merged simplify stmt code in VRP and DOM as they were nearly
identical.
This has been bootstrapped and regression tested on x86-64 Linux.
Jeff had also been testing this path as part of his Fedora throughout the
off-season.
gcc/ChangeLog:
* tree-ssa-dom.c (class dom_jump_threader_simplifier): New.
(class dom_opt_dom_walker): Initialize some class variables.
(pass_dominator::execute): Pass evrp_range_analyzer and
dom_jump_threader_simplifier to dom_opt_dom_walker.
Adjust for some functions moving into classes.
(simplify_stmt_for_jump_threading): Adjust and move to...
(jump_threader_simplifier::simplify): ...here.
(dom_opt_dom_walker::before_dom_children): Adjust for
m_evrp_range_analyzer.
(dom_opt_dom_walker::after_dom_children): Remove x_vr_values hack.
(test_for_singularity): Place in dom_opt_dom_walker class.
(dom_opt_dom_walker::optimize_stmt): The argument
evrp_range_analyzer is now a class field.
* tree-ssa-threadbackward.c (class thread_jumps): Add m_registry.
(thread_jumps::thread_through_all_blocks): New.
(thread_jumps::convert_and_register_current_path): Use m_registry.
(pass_thread_jumps::execute): Adjust for thread_through_all_blocks
being in the threader class.
(pass_early_thread_jumps::execute): Same.
* tree-ssa-threadedge.c (threadedge_initialize_values): Move...
(jump_threader::jump_threader): ...here.
(threadedge_finalize_values): Move...
(jump_threader::~jump_threader): ...here.
(jump_threader::remove_jump_threads_including): New.
(jump_threader::thread_through_all_blocks): New.
(record_temporary_equivalences_from_phis): Move...
(jump_threader::record_temporary_equivalences_from_phis): ...here.
(record_temporary_equivalences_from_stmts_at_dest): Move...
(jump_threader::record_temporary_equivalences_from_stmts_at_dest):
Here...
(simplify_control_stmt_condition_1): Move to jump_threader class.
(simplify_control_stmt_condition): Move...
(jump_threader::simplify_control_stmt_condition): ...here.
(thread_around_empty_blocks): Move...
(jump_threader::thread_around_empty_blocks): ...here.
(thread_through_normal_block): Move...
(jump_threader::thread_through_normal_block): ...here.
(thread_across_edge): Move...
(jump_threader::thread_across_edge): ...here.
(thread_outgoing_edges): Move...
(jump_threader::thread_outgoing_edges): ...here.
* tree-ssa-threadedge.h: Move externally facing functings...
(class jump_threader): ...here...
(class jump_threader_simplifier): ...and here.
* tree-ssa-threadupdate.c (struct redirection_data): Remove comment.
(jump_thread_path_allocator::jump_thread_path_allocator): New.
(jump_thread_path_allocator::~jump_thread_path_allocator): New.
(jump_thread_path_allocator::allocate_thread_edge): New.
(jump_thread_path_allocator::allocate_thread_path): New.
(jump_thread_path_registry::jump_thread_path_registry): New.
(jump_thread_path_registry::~jump_thread_path_registry): New.
(jump_thread_path_registry::allocate_thread_edge): New.
(jump_thread_path_registry::allocate_thread_path): New.
(dump_jump_thread_path): Make extern.
(debug (const vec<jump_thread_edge *> &path)): New.
(struct removed_edges): Move to tree-ssa-threadupdate.h.
(struct thread_stats_d): Remove.
(remove_ctrl_stmt_and_useless_edges): Make static.
(lookup_redirection_data): Move...
(jump_thread_path_registry::lookup_redirection_data): ...here.
(ssa_redirect_edges): Make static.
(thread_block_1): Move...
(jump_thread_path_registry::thread_block_1): ...here.
(thread_block): Move...
(jump_thread_path_registry::thread_block): ...here.
(thread_through_loop_header): Move...
(jump_thread_path_registry::thread_through_loop_header): ...here.
(mark_threaded_blocks): Move...
(jump_thread_path_registry::mark_threaded_blocks): ...here.
(debug_path): Move...
(jump_thread_path_registry::debug_path): ...here.
(debug_all_paths): Move...
(jump_thread_path_registry::dump): ..here.
(rewire_first_differing_edge): Move...
(jump_thread_path_registry::rewire_first_differing_edge): ...here.
(adjust_paths_after_duplication): Move...
(jump_thread_path_registry::adjust_paths_after_duplication): ...here.
(duplicate_thread_path): Move...
(jump_thread_path_registry::duplicate_thread_path): ..here.
(remove_jump_threads_including): Move...
(jump_thread_path_registry::remove_jump_threads_including): ...here.
(thread_through_all_blocks): Move to...
(jump_thread_path_registry::thread_through_all_blocks): ...here.
(delete_jump_thread_path): Remove.
(register_jump_thread): Move...
(jump_thread_path_registry::register_jump_thread): ...here.
* tree-ssa-threadupdate.h: Move externally facing functions...
(class jump_thread_path_allocator): ...here...
(class jump_thread_path_registry): ...and here.
(thread_through_all_blocks): Remove.
(struct removed_edges): New.
(register_jump_thread): Remove.
(remove_jump_threads_including): Remove.
(delete_jump_thread_path): Remove.
(remove_ctrl_stmt_and_useless_edges): Remove.
(free_dom_edge_info): New prototype.
* tree-vrp.c: Remove x_vr_values hack.
(class vrp_jump_threader_simplifier): New.
(vrp_jump_threader_simplifier::simplify): New.
(vrp_jump_threader::vrp_jump_threader): Adjust method signature.
Remove m_dummy_cond.
Instantiate m_simplifier and m_threader.
(vrp_jump_threader::thread_through_all_blocks): New.
(vrp_jump_threader::simplify_stmt): Remove.
(vrp_jump_threader::after_dom_children): Do not set m_dummy_cond.
Remove x_vr_values hack.
(execute_vrp): Adjust for thread_through_all_blocks being in a
class.
Patrick Palka [Fri, 30 Apr 2021 14:59:20 +0000 (10:59 -0400)]
libstdc++: Implement P2367 changes to avoid some list-initialization
This implements the wording changes of P2367R0 "Remove misuses of
list-initialization from Clause 24", modulo the parts that depend
on P1739R4 which we don't yet implement (due to LWG 3407).
libstdc++-v3/ChangeLog:
* include/bits/ranges_util.h (subrange::subrange): Avoid
list-initialization in delegating constructor.
* include/std/ranges (single_view): Replace implicit guide
with explicit deduction guide that decays its argument.
(_Single::operator()): Avoid CTAD when constructing the
single_view object.
(_Iota::operator()): Avoid list-initialization.
(__detail::__can_filter_view, _Filter::operator()): Likewise.
(__detail::__can_transform_view, _Transform::operator()): Likewise.
(take_view::begin): Likewise.
(__detail::__can_take_view, _Take::operator()): Likewise.
(__detail::__can_take_while_view, _TakeWhile::operator()): Likewise.
(__detail::__can_drop_view, _Drop::operator()): Likewise.
(__detail::__can_drop_while_view, _DropWhile::operator()): Likewise.
(split_view::split_view): Use views::single when initializing
_M_pattern.
(__detail::__can_split_view, _Split::operator()): Avoid
list-initialization.
(_Counted::operator()): Likewise.
* testsuite/std/ranges/p2367.cc: New test.
Jonathan Wakely [Fri, 30 Apr 2021 13:45:42 +0000 (14:45 +0100)]
libstdc++: Use std::addressof to avoid ADL for operator& [PR 60497]
This is another small step towards avoiding the problems described in PR
60497, by using std::addressof to avoid ADL, so that we don't require
all template arguments to be complete.
Jonathan Wakely [Fri, 30 Apr 2021 13:07:28 +0000 (14:07 +0100)]
libstdc++: Implement LWG 1203 for rvalue iostreams
This implements the resolution of LWG 1203 so that the constraints for
rvalue stream insertion/extraction are simpler, and the return type is
the original rvalue stream type not its base class.
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:
* include/std/istream (operator>>(Istream&&, x&)): Simplify, as
per LWG 1203.
* include/std/ostream (operator<<(Ostream&&, const x&)):
Likewise.
* testsuite/27_io/basic_istream/extractors_character/char/lwg2499_neg.cc:
Adjust dg-error pattern.
* testsuite/27_io/basic_istream/extractors_character/wchar_t/lwg2499_neg.cc:
Likewise.
* testsuite/27_io/basic_istream/extractors_other/char/4.cc: Define
is_extractable trait to replace std::__is_extractable. Make it
work with rvalue streams as well as lvalues, to replace f() and
g() helper functions.
* testsuite/27_io/basic_istream/extractors_other/wchar_t/4.cc:
Likewise.
* testsuite/27_io/basic_ostream/inserters_other/char/6.cc:
Define is_insertable trait to replace std::__is_insertable. Make
it work with rvalue streams as well as lvalues, to replace f()
and g() helper functions.
* testsuite/27_io/basic_ostream/inserters_other/wchar_t/6.cc:
Likewise.
* testsuite/27_io/filesystem/path/io/dr2989.cc: Prune additional
errors from new constraints.
* testsuite/27_io/rvalue_streams-2.cc: Remove PR 80675 checks,
which are no longer expected to compile.
* testsuite/27_io/rvalue_streams.cc: Adjust existing test.
Verify LWG 1203 changes.
Jonathan Wakely [Fri, 30 Apr 2021 13:25:25 +0000 (14:25 +0100)]
libstdc++: Use <sys/socket.h> features conditionally [PR 100285]
This makes the uses of getsockopt and setsockopt in
<experimental/socket> conditional on the availability of <sys/socket.h>.
It also fixes a test to check for <sys/socket.h> instead of <socket.h>.
libstdc++-v3/ChangeLog:
PR libstdc++/100285
* include/experimental/socket (__basic_socket_impl::set_option)
(__basic_socket_impl::get_option) [!_GLIBCXX_HAVE_SYS_SOCKET_H]:
Just set error code.
* testsuite/experimental/net/socket/socket_base.cc: CHeck
for <sys/socket.h> not <socket.h>.
Jonathan Wakely [Fri, 30 Apr 2021 10:45:07 +0000 (11:45 +0100)]
libstdc++: Define effective-target for net::ip features [PR 100351]
Define a new effective-target keyword so that tests for the Networking
TS <experimental/internet> header can be skipped on targets where none
of it can be usefully defined.