Apparently older GDB versions didn't handle this test right and so while
it has been properly printing 42 on line 14 (e.g. on x86_64), it issued
a weird error on line 17 (and because it didn't print any value, guality
testsuite wasn't marking it as FAIL).
That has been apparently fixed in GDB 10, where it now (on x86_64) prints
properly.
Unfortunately that revealed that the test can suffer from instruction
scheduling, where e.g. on i686 (but various other arches) the very first
insn of the function (or whatever b 14 is on) happens to be load of the
S::i variable from memory and that insn has the inner lexical scope, so
GDB 10 prints there 24 instead of 42. The following insn is then
the first store to l and there the automatic i is in scope and prints as 42
and then the second store to l where the inner lexical scope is current
and prints 24 again.
The test wasn't meant about insn scheduling but about whether we emit the
DIEs properly, so this hack attempts to prevent the undesirable scheduling.
2020-11-13 Jakub Jelinek <jakub@redhat.com>
* g++.dg/guality/redeclaration1.C (p): New variable.
(S::f): Increment what p points to before storing S::i into l. Adjust
gdb-test line numbers.
(main): Initialize p to address of an automatic variable.
The following patch predefines __STDCPP_THREADS__ macro to 1 if c++11 or
later and thread model (e.g. printed by gcc -v) is not single.
There are two targets not handled by this patch, those that define
THREAD_MODEL_SPEC. In one case - QNX - it looks just like a mistake
to me, instead of setting thread_model=posix in config.gcc it uses
THREAD_MODEL_SPEC macro to set it unconditionally to posix.
The other is hpux10, which uses -threads option to decide if threads
are enabled or not, but that option isn't really passed to the compiler.
I think that is something that really should be solved in config/pa/
instead, e.g. in the config/xxx/xxx-c.c targets usually set their own
predefined macros and it could handle this, and either pass the option
also to the compiler, or say predefine __STDCPP_THREADS__ if _DCE_THREADS
macro is defined already (or -D_DCE_THREADS found on the command line),
or whatever else.
2020-11-13 Jakub Jelinek <jakub@redhat.com>
PR c++/63287
* c-cppbuiltin.c: Include configargs.h.
(c_cpp_builtins): For C++11 and later if THREAD_MODEL_SPEC is not
defined, predefine __STDCPP_THREADS__ to 1 unless thread_model is
"single".
In particular, more precisely highlight what applies generally vs. the special
handling for the current 'parloops'-based OpenACC 'kernels' implementation.
gcc/
* omp-low.c (scan_sharing_clauses, scan_omp_for)
(lower_oacc_reductions, lower_omp_target): More explicit checking
of which OMP constructs we're expecting.
This allows for making some things more explicit, later on.
gcc/
* omp-expand.c (expand_omp_target): Attach an attribute to all
outlined OpenACC compute regions.
* omp-offload.c (execute_oacc_device_lower): Adjust.
gcc/testsuite/
* c-c++-common/goacc/classify-parallel.c: Adjust.
* gfortran.dg/goacc/classify-parallel.f95: Likewise.
* c-c++-common/goacc/classify-serial.c: New.
* gfortran.dg/goacc/classify-serial.f95: Likewise.
Document status quo re PR94358 "[OMP] Privatize internal array variables
introduced by the Fortran FE".
libgomp/
PR fortran/94358
* testsuite/libgomp.oacc-fortran/pr94358-1.f90: New.
Co-authored-by: Thomas Schwinge <thomas@codesourcery.com>
This fixes another overflow in code converting a std::chrono::seconds
duration to a time_t. This time in the new code using a futex wait with
an absolute timeout (so this one doesn't need to be backported to the
release branches).
A timeout after the epochalypse would overflow the tv_sec field,
producing an incorrect value. If that incorrect value happened to be
negative, the syscall would return with EINVAL and then the caller would
keep retrying, spinning until the timeout was reached. If the value
happened to be positive, we would wake up too soon and incorrectly
report a timeout
libstdc++-v3/ChangeLog:
* src/c++11/futex.cc (relative_timespec): Add [[unlikely]]
attributes.
(__atomic_futex_unsigned_base::_M_futex_wait_until)
(__atomic_futex_unsigned_base::_M_futex_wait_until_steady):
Check for overflow.
* testsuite/30_threads/future/members/wait_until_overflow.cc:
New test.
have gimple_expr_code return the correct code for GIMPLE_ASSIGN.
use gassign and gcond in gimple_range_handler.
* gimple-range.h (gimple_range_handler): Cast to gimple stmt
kinds before asking for code and type.
* gimple.h (gimple_expr_code): Call gassign and gcond routines
to get their expr_code.
This feature allows the programmer to import enumerator names into the
current scope so later mentions don't need to use the fully-qualified name.
These usings are not subject to the usual restrictions on using-decls: in
particular, they can move between class and non-class scopes, and between
classes that are not related by inheritance. This last caused difficulty
for our normal approach to using-decls within a class hierarchy, as we
assume that the class where we looked up a used declaration is derived from
the class where it was first declared. So to simplify things, in that case
we make a clone of the CONST_DECL in the using class.
Thanks to Nathan for the start of this work: in particular, the
lookup_using_decl rewrite.
The changes to dwarf2out revealed an existing issue with the D front-end: we
were doing the wrong thing for importing a D CONST_DECL, because
dwarf2out_imported_module_or_decl_1 was looking through it to its type,
expecting it to be an enumerator, but in one case in thread.d, the constant
had type int. Adding the ability to import a C++ enumerator also fixed
that, but that led to a crash in force_decl_die, which didn't know what to
do with a CONST_DECL. So now it does.
Co-authored-by: Nathan Sidwell <nathan@acm.org>
gcc/cp/ChangeLog:
* cp-tree.h (USING_DECL_UNRELATED_P): New.
(CONST_DECL_USING_P): New.
* class.c (handle_using_decl): If USING_DECL_UNRELATED_P,
clone the CONST_DECL.
* name-lookup.c (supplement_binding_1): A clone hides its
using-declaration.
(lookup_using_decl): Rewrite to separate lookup and validation.
(do_class_using_decl): Adjust.
(finish_nonmember_using_decl): Adjust.
* parser.c (make_location): Add cp_token overload.
(finish_using_decl): Split out from...
(cp_parser_using_declaration): ...here. Don't look through enums.
(cp_parser_using_enum): New.
(cp_parser_block_declaration): Call it.
(cp_parser_member_declaration): Call it.
* semantics.c (finish_id_expression_1): Handle enumerator
used from class scope.
gcc/ChangeLog:
* dwarf2out.c (gen_enumeration_type_die): Call
equate_decl_number_to_die for enumerators.
(gen_member_die): Don't move enumerators to their
enclosing class.
(dwarf2out_imported_module_or_decl_1): Allow importing
individual enumerators.
(force_decl_die): Handle CONST_DECL.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/inh-ctor28.C: Adjust expected diagnostic.
* g++.dg/cpp0x/inh-ctor33.C: Likewise.
* g++.dg/cpp0x/using-enum-1.C: Add comment.
* g++.dg/cpp0x/using-enum-2.C: Allowed in C++20.
* g++.dg/cpp0x/using-enum-3.C: Likewise.
* g++.dg/cpp1z/class-deduction69.C: Adjust diagnostic.
* g++.dg/inherit/using5.C: Likewise.
* g++.dg/cpp2a/using-enum-1.C: New test.
* g++.dg/cpp2a/using-enum-2.C: New test.
* g++.dg/cpp2a/using-enum-3.C: New test.
* g++.dg/cpp2a/using-enum-4.C: New test.
* g++.dg/cpp2a/using-enum-5.C: New test.
* g++.dg/cpp2a/using-enum-6.C: New test.
* g++.dg/debug/dwarf2/using-enum.C: New test.
gcc/
* cfgexpand.c (expand_asm_stmt): Output asm goto with outputs too.
Place insns after asm goto on edges.
* doc/extend.texi: Reflect the changes in asm goto documentation.
* gimple.c (gimple_build_asm_1): Remove an assert checking output
absence for asm goto.
* gimple.h (gimple_asm_label_op, gimple_asm_set_label_op): Take
possible asm goto outputs into account.
* ira.c (ira): Remove critical edges for potential asm goto output
reloads.
(ira_nullify_asm_goto): New function.
* ira.h (ira_nullify_asm_goto): New prototype.
* lra-assigns.c (lra_split_hard_reg_for): Use ira_nullify_asm_goto.
Check that splitting is done inside a basic block.
* lra-constraints.c (curr_insn_transform): Permit output reloads
for any jump insn.
* lra-spills.c (lra_final_code_change): Remove USEs added in ira
for asm gotos.
* lra.c (lra_process_new_insns): Place output reload insns after
jumps in the beginning of destination BBs.
* reload.c (find_reloads): Report error for asm gotos with
outputs. Modify them to keep CFG consistency to avoid crashes.
* tree-into-ssa.c (rewrite_stmt): Don't put debug stmt after asm
goto.
gcc/c/
* c-parser.c (c_parser_asm_statement): Parse outputs for asm
goto too.
* c-typeck.c (build_asm_expr): Remove an assert checking output
absence for asm goto.
gcc/cp
* parser.c (cp_parser_asm_definition): Parse outputs for asm
goto too.
gcc/testsuite/
* c-c++-common/asmgoto-2.c: Permit output in asm goto.
* gcc.c-torture/compile/asmgoto-2.c: New.
* gcc.c-torture/compile/asmgoto-3.c: New.
* gcc.c-torture/compile/asmgoto-4.c: New.
* gcc.c-torture/compile/asmgoto-5.c: New.
This adds allocate clause support for array section reductions.
Furthermore, it fixes one bug that would cause inscan reductions with
allocate to be rejected by C, and for now just ignores allocate for
inscan/task reductions, that will need slightly more work.
2020-11-13 Jakub Jelinek <jakub@redhat.com>
gcc/
* omp-low.c (scan_sharing_clauses): For now remove for reduction
clauses with inscan or task modifiers decl from allocate_map.
(lower_private_allocate): Handle TYPE_P (new_var).
(lower_rec_input_clauses): Handle allocate clause for C/C++ array
reductions.
gcc/c/
* c-typeck.c (c_finish_omp_clauses): Don't clear
OMP_CLAUSE_REDUCTION_INSCAN unless reduction_seen == -2.
libgomp/
* testsuite/libgomp.c-c++-common/allocate-1.c (foo): Add tests
for array reductions.
(main): Adjust foo callers.
The new behavior of safe_add triggered an ICE because of one use where
it had not been used instead of a simple addition. I'll fix it with the
following obvious patch so that periodic benchmarkers can continue
working because a proper fix (see below) will need a review.
The testcase showed me, however, that we can propagate time and cost
from one lattice to another more than once even when that was not the
intent. I'll address that as a follow-up after I verify it does not
affect the IPA-CP heuristics too much or change the corresponding
params accordingly.
Bootstrapped and tested on x86_64-linux.
gcc/ChangeLog:
2020-11-13 Martin Jambor <mjambor@suse.cz>
PR ipa/97816
* ipa-cp.c (value_topo_info<valtype>::propagate_effects): Use
safe_add instead of a simple addition.
The existing code doesn't check whether the chrono::seconds value is out
of range of time_t. When using a timeout before the epoch (with a
negative value) subtracting the current time (as time_t) and then
assigning it to a time_t can overflow to a large positive value. This
means that we end up waiting several years even though the specific
timeout was in the distant past.
We do have a check for negative timeouts, but that happens after the
conversion to time_t so happens after the overflow.
The conversion to a relative timeout is done in two places, so this
factors it into a new function and adds the overflow checks there.
libstdc++-v3/ChangeLog:
* src/c++11/futex.cc (relative_timespec): New function to
create relative time from two absolute times.
(__atomic_futex_unsigned_base::_M_futex_wait_until)
(__atomic_futex_unsigned_base::_M_futex_wait_until_steady):
Use relative_timespec.
To access the "n - 100000"th element of "a" in this test, GCC will
generate the following code for msp430-elf with -mcpu=msp430x:
RLAM.W #1, R12
MOV.W a-3392(R12), R12
Since there aren't actually 100,000 elements in a, this means that
"a-3392" offset calculated by the linker can overflow, as the address of
"a" can validly be less than 3392.
The relocations used for -mcpu=msp430 and -mlarge are not as strict and
the calculated value is allowed to wrap around the address space,
avoiding relocation overflows.
gcc/testsuite/ChangeLog:
* gcc.c-torture/execute/index-1.c: Skip for the default MSP430 430X ISA.
The length of an insn can be used to calculate its cost, when optimizing
for size. When optimizing for speed, this is a good estimate, since the
cycle cost of an MSP430 instruction increases with its length.
gcc/ChangeLog:
* config/msp430/msp430.c (TARGET_INSN_COST): Define.
(msp430_insn_cost): New function.
* config/msp430/msp430.h (BRANCH_COST): Define.
(LOGICAL_OP_NON_SHORT_CIRCUIT): Define.
gcc/testsuite/ChangeLog:
* gcc.target/msp430/rtx-cost-O3-default.c: New test.
* gcc.target/msp430/rtx-cost-O3-f5series.c: New test.
* gcc.target/msp430/rtx-cost-Os-default.c: New test.
* gcc.target/msp430/rtx-cost-Os-f5series.c: New test.
The length of MSP430 instructions is mostly just a function of the type
and number of operands. Setting the "type" attribute on all insns
describes the number of operands, and the position of the source and
destination operands.
In most cases, defaulting in the "length" and "extension" attribute
definitions can then be used to calculate the total length of the
instruction by using the value of the "type" attribute to examine the
operands.
gcc/ChangeLog:
* config/msp430/msp430-protos.h (msp430x_extendhisi): Return int
instead of char *.
(msp430_output_asm_shift_insns): Likewise.
Add new return_length argument.
(msp430x_insn_required): Add prototype.
* config/msp430/msp430.c (msp430_output_asm_shift_insns): Return the
total length, in bytes, of the emitted instructions.
(msp430x_insn_required): New function.
(msp430x_extendhisi): Return the total length, in bytes, of the
emitted instructions.
* config/msp430/msp430.h (ADJUST_INSN_LENGTH): Define.
* config/msp430/msp430.md: New define_attr "type".
New define_attr "extension".
New define_attr "length_multiplier".
New define_attr "extra_length".
Rewrite define_attr "length".
Set type, extension, length, length_multiplier or extra_length insn
attributes on all insns, as appropriate.
(andneghi3): Rewrite using constraints instead of C code to decide
output insns.
* config/msp430/predicates.md (msp430_cheap_operand): New predicate.
(msp430_high_memory_operand): New predicate.
Costs of MSP430 instructions are mostly just a function of the type and
number of operands; knowledge of the specific instruction often
isn't required to calculate the cost.
In these cases, TARGET_RTX_COSTS just needs to examine the operands to
calculate the cost of the expression.
For more complicated operations where library helper functions are
required, if the cost cannot be accurately calculated, it is estimated
and disparaged relative to the cost of a single instruction.
gcc/ChangeLog:
* config/msp430/msp430.c (use_helper_for_const_shift): Add forward
declaration.
Remove unused argument.
(struct msp430_multlib_costs): New struct.
(msp430_is_mem_indirect): New function.
(msp430_costs): Likewise.
(msp430_shift_costs): Likewise.
(msp430_muldiv_costs): Likewise.
(msp430_get_inner_dest_code): Likewise.
(msp430_single_op_cost): Likewise.
(msp430_rtx_costs): Rewrite from scratch.
(msp430_expand_shift): Adjust use_helper_for_const_shift call.
The cycle and size cost of a MOV instruction in different addressing
modes can be used to calculate the TARGET_MEMORY_MOVE_COST relative to
TARGET_REGISTER_MOVE_COST.
gcc/ChangeLog:
* config/msp430/msp430.c (struct single_op_cost): New struct.
(struct double_op_cost): Likewise.
(TARGET_REGISTER_MOVE_COST): Don't define but add comment.
(TARGET_MEMORY_MOVE_COST): Define to...
(msp430_memory_move_cost): New function.
(BRANCH_COST): Don't define but add comment.
this patch iplements new class ao_compare that is derived from operand_compare
and adds a method to compare and hash ao_refs. This is used by ICF to enable
more merging.
Comparsion is done as follows
1) Verify that the memory access will happen at the same address
and will have same size.
For constant addresses this is done by comparing ao_ref_base
and offset/size
For varable accesses it uses operand_equal_p but with OEP_ADDRESS
(that does not match TBAA metadata) and then operand_equal_p on
type size.
2) Compare alignments. I use get_object_alignment_1 like ipa-icf
did before revamp to operand_equal_p in gcc 9.
I noticed that return value is bitodd so added a comment
3) Match MR_DEPENDENCE_CLIQUE
At this point the memory refrences are same except for TBAA information.
We continue by checking
4) ref and base alias sets. Now if lto streaming is going to happen
instead of comparing alias sets themselves we compare alias_ptr_types
(the patch depends on the ao_ref_alias_ptr_tyep and
ao_ref_base_alias_ptr_type acessors I sent yesterday)
5) See if accesses are view converted.
If they are we are done since access path is not present
6) Compare the part of access path relevant for TBAA.
I recall FRE relies on the fact that if base and ref types are same the
access path is, but I do not thing this is 100% reliable especially with LTO
alias sets.
The access path comparsion logic is also useful for modref (for next stage1).
Tracking the access paths improves quite noticeably disambiguation in C++
code by being able to distinquish different fields of same type within a
struct. I had the comparsion logic in my tree for some time and it seems to
work quite well.
During cc1plus build we have some cases where we find mismatch after matching
the base/ref alias sets. These are due to failed type merging: access path
oracle in LTO uses TYPE_MAIN_VARIANTs.
I implemented relatively basic hashing using base and offset.
gcc/ChangeLog:
* ipa-icf-gimple.c: Include tree-ssa-alias-compare.h.
(find_checker::func_checker): Initialize m_tbaa.
(func_checker::hash_operand): Use hash_ao_ref for memory accesses.
(func_checker::compare_operand): Use compare_ao_refs for memory
accesses.
(func_checker::cmopare_gimple_assign): Do not check LHS types
of memory stores.
* ipa-icf-gimple.h (func_checker): Derive from ao_compare;
add m_tbaa.
* ipa-icf.c: Include tree-ssa-alias-compare.h.
(sem_function::equals_private): Update call of
func_checker::func_checker.
* ipa-utils.h (lto_streaming_expected_p): New inline
predicate.
* tree-ssa-alias-compare.h: New file.
* tree-ssa-alias.c: Include tree-ssa-alias-compare.h
and bultins.h
(view_converted_memref_p): New function.
(types_equal_for_same_type_for_tbaa_p): New function.
(ao_ref_alias_ptr_type, ao_ref_base_alias_ptr_type): New functions.
(ao_compare::compare_ao_refs): New member function.
(ao_compare::hash_ao_ref): New function
* tree-ssa-alias.h (ao_ref_base_alias_ptr_type,
ao_ref_alias_ptr_type): Declare.
gcc/testsuite/ChangeLog:
* c-c++-common/Wstringop-overflow-2.c: Disable ICF.
* g++.dg/warn/Warray-bounds-8.C: Disable ICF.
This patch adds logic to determine access type (normal or memory) for every
operand. This makes it possible to compare memory accesses more carefully
which will be implemented in a followup patch.
* ipa-icf-gimple.c: Include gimple-walk.h.
(func_checker::compare_ssa_name): Update call of compare_operand.
(func_checker::hash_operand): Fix comment and add variant taking
operand_access_type parameter.
(func_checker::compare_operand): Add operand_access_type parameter.
(func_checker::compare_asm_inputs_outputs): Add
operand_access_type_map parameter; update use of
func_checker::compare_operand.
(func_checker::compare_gimple_call): Update use of
func_checker::compare_operand.
(func_checker::compare_gimple_assign): Likewise.
(func_checker::compare_gimple_cond): Likewise.
(func_checker::compare_gimple_switch): Likewise.
(func_checker::compare_gimple_return): Likewise.
(func_checker::compare_gimple_goto): Likewise.
(func_checker::compare_gimple_asm): Likewise.
(visit_load_store): New static functio.
(func_checker::classify_operands): New member function.
(func_checker::get_operand_access_type): New member function.
* ipa-icf-gimple.h (func_checker::operand_access_type): New enum
(func_checker::operand_access_type_map): New typedef.
(func_checker::compare_operand): Update prototype.
(func_checker::compare_asm_inputs_outputs): Likewise.
(func_checker::cleassify_operands): Declare.
(func_checker::get_operand_access_type): Declare.
(func_checker::hash_operand): New variant with operand_access_type.
* ipa-icf.c (sem_function::hash_stmt): Update uses of hash_operand.
(sem_function::compare_phi_node): Update use of compare_operand.
Align EVRP and ranger for how ranges of ADDR_EXPR are calculated.
gcc/
* gimple-range.cc: (gimple_ranger::range_of_range_op): Check for
ADDR_EXPR and call range_of_address.
(gimple_ranger::range_of_address): Rename from
range_of_non_trivial_assignment and match vrp_stmt_computes_nonzero.
* gimple-range.h: (range_of_address): Renamed.
* range-op.cc: (pointer_table): Add INTEGER_CST handler.
gcc/testsuite/
* gcc.dg/tree-ssa/pr78655.c: New.
This patch makes the entry point to loop invariant motion public, so
that it can be called after loop interchange when that pass has
swapped loops. This avoids the non-LTO -Ofast run-time regressions of
410.bwaves and 503.bwaves_r (which are 19% and 15% faster than current
master on an AMD zen2 machine) while not introducing a full LIM pass
into the pass pipeline.
The patch also adds a parameter which allows not to perform any store
motion so that it is not done after an interchange.
gcc/ChangeLog:
2020-11-12 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/94406
* tree-ssa-loop-im.c (tree_ssa_lim): Renamed to
loop_invariant_motion_in_fun, added a parameter to control store
motion.
(pass_lim::execute): Adjust call to tree_ssa_lim, now
loop_invariant_motion_in_fun.
* tree-ssa-loop-manip.h (loop_invariant_motion_in_fun): Declare.
* gimple-loop-interchange.cc (pass_linterchange::execute): Call
loop_invariant_motion_in_fun if any interchange has been done.
This reduces the number of collisions for PHIs in the VN hashtable
by always hashing the number of predecessors and separately hashing
the block number when we never merge PHIs from different blocks.
This improves collisions seen for the PR69609 testcase dramatically.
2020-11-13 Richard Biener <rguenther@suse.de>
* tree-ssa-sccvn.c (vn_phi_compute_hash): Always hash the
number of predecessors. Hash the block number also for
loop header PHIs.
(expressions_equal_p): Short-cut SSA name compares, remove
test for NULL operands.
(vn_phi_eq): Cache number of predecessors, change inlined
test from expressions_equal_p.
This is so that the library is not to conflict with gcc-10.
libphobos/ChangeLog:
* configure: Regenerate.
* configure.ac (libtool_VERSION): Update to 2:0.0.
For some targets, mathfn_built_in returns NULL as copysign is not
implicitly available, causing an ICE. Now copysign is explicitly
requested when expanding the intrinsic.
gcc/d/ChangeLog:
* intrinsics.cc (expand_intrinsic_copysign): Explicitly determine
which built-in copysign function to call.
Because this what the upstream reference compiler did, thunks for the D
front-end were associated with the class definition, so were forced
code-gen even if the target function was extern. This has now been
changed so there are now only generated if there is a function
definition, fixing the ICE that occurred in PR 97644, which was caused
by calling expand_thunk() early.
gcc/d/ChangeLog:
PR d/97644
* dmd/MERGE: Merge upstream dmd 95044d8e4.
* d-target.cc (TargetCPP::thunkMangle): New function.
* decl.cc (finish_thunk): Don't force expand thunks for external
functions.
(make_thunk): Emit thunks only if the function has a definition.
Generate correct mangling for thunks to C++ classes.
gcc/testsuite/ChangeLog:
* gdc.dg/pr92216.d: Update scan-assember.
gcc/c-family/c-attribs.c:4698:5: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
gcc/c-family/ChangeLog:
* c-attribs.c (build_attr_access_from_parms): Format properly.
Some tex tools don't allow the @r{} command to be split across
lines. Fixed by making the change occupy a long line.
gcc/ChangeLog:
* doc/extend.texi: Don't try to line-wrap an @r command.
This makes sure to properly extend the input range before seeing
whether it fits the target.
2020-11-13 Richard Biener <rguenther@suse.de>
PR tree-optimization/97812
* tree-vrp.c (register_edge_assert_for_2): Extend the range
according to its sign before seeing whether it fits.
* gcc.dg/torture/pr97812.c: New testcase.
For linux targets this test doesn't need -lpthread because it only uses
atomics, but for all other targets std::call_once still needs pthreads.
Add the necessary test directives to make that work.
The timings in this test might be too fragile or too target-specific, so
it might need to be adjusted in future, or restricted to only run on
specific targets. For now I've increased the allowed ratio between
wait_for calls before and after the future is made ready, because it was
failing with -O3 -march=native sometimes.
libstdc++-v3/ChangeLog:
* testsuite/30_threads/future/members/poll.cc: Require gthreads
and add -pthread for targets that require it. Relax required
ratio of wait_for calls before/after the future is ready.
This patch implements aarch64 backend expansion for __builtin_memset. Most of
the implementation is based on the expansion of __builtin_memcpy. We change the
values of SET_RATIO and MOVE_RATIO for cases where we do not have to strictly
align and where we can benefit from NEON instructions in the backend.
gcc/ChangeLog:
* config/aarch64/aarch64-protos.h (aarch64_expand_setmem): New
declaration.
* config/aarch64/aarch64.c (aarch64_gen_store_pair): Add case for
E_V16QImode.
(aarch64_set_one_block_and_progress_pointer): New helper for
aarch64_expand_setmem.
(aarch64_expand_setmem): Define the expansion for memset.
* config/aarch64/aarch64.h (CLEAR_RATIO): Tweak to favor
aarch64_expand_setmem when allowed and profitable.
(SET_RATIO): Likewise.
* config/aarch64/aarch64.md: Define pattern for setmemdi.
gcc/testsuite/ChangeLog:
* g++.dg/tree-ssa/pr90883.C: Remove xfail for aarch64.
* gcc.dg/tree-prof/stringop-2.c: Add xfail for aarch64.
* gcc.target/aarch64/memset-corner-cases.c: New test.
* gcc.target/aarch64/memset-q-reg.c: New test.
This part of the implementation covers property nullability attributes
and includes the changes to common code. Follow-on changes will be needed
to cover Objective-C method definitions, but those are expected to be
local to the Objective-C front end.
The basis of the implementation is to translate the Objective-C-specific
keywords into an attribute (objc_nullability) which has the required
states to carry the attribute markup.
We introduce the keywords, and these are parsed and validated in the same
manner as other property attributes. The resulting value is attached to
the property as an objc_nullability attribute.
gcc/c-family/ChangeLog:
PR objc/90707
* c-common.c (c_common_reswords): null_unspecified, nullable,
nonnull, null_resettable: New keywords.
* c-common.h (enum rid): RID_NULL_UNSPECIFIED, RID_NULLABLE,
RID_NONNULL, RID_NULL_RESETTABLE: New.
(OBJC_IS_PATTR_KEYWORD): Include nullability keywords in the
ranges accepted for property attributes.
* c-attribs.c (handle_objc_nullability_attribute): New.
* c-objc.h (enum objc_property_attribute_group): Add
OBJC_PROPATTR_GROUP_NULLABLE.
(enum objc_property_attribute_kind):Add
OBJC_PROPERTY_ATTR_NULL_UNSPECIFIED, OBJC_PROPERTY_ATTR_NULLABLE,
OBJC_PROPERTY_ATTR_NONNULL, OBJC_PROPERTY_ATTR_NULL_RESETTABLE.
gcc/objc/ChangeLog:
PR objc/90707
* objc-act.c (objc_prop_attr_kind_for_rid): Handle nullability.
(objc_add_property_declaration): Handle nullability attributes.
Check that these are applicable to the property type.
* objc-act.h (enum objc_property_nullability): New.
gcc/testsuite/ChangeLog:
PR objc/90707
* obj-c++.dg/property/at-property-4.mm: Add basic nullability
tests.
* objc.dg/property/at-property-4.m: Likewise.
* obj-c++.dg/attributes/nullability-00.mm: New test.
* obj-c++.dg/property/nullability-00.mm: New test.
* objc.dg/attributes/nullability-00.m: New test.
* objc.dg/property/nullability-00.m: New test.
gcc/ChangeLog:
PR objc/90707
* doc/extend.texi: Document the objc_nullability attribute.
This warning catches the case that the user has left the
superclass specification from a class interface. Root
classes are, of course, permitted and an attribute is added
to mark these so that the diagnostic is suppressed.
The warning and attribute spellings have been kept in sync
with the language reference implementation (clang).
The diagnostic location information present in the objective-c
interface and class definitions is relatively poor. This patch
adds a location for the class name to the interface and makes use
of it in existing warnings.
Part 1 is the changes to code and added tests.
Many entries in the testsuite make use of root classes so
there are a large number of mechanical changes there adding
"-Wno-objc-root-class" to the options.
The test changes are parts 2 (objective-c) and 3 (objective-c++)
in the patch series.
gcc/c-family/ChangeLog:
PR objc/77404
* c-attribs.c (handle_objc_root_class_attribute): New
* c-objc.h (objc_start_class_interface): Add a location
value for the position of the class name.
* c.opt: Add Wobjc-root-class.
* stub-objc.c (objc_start_class_interface): Add a location
value for the position of the class name.
gcc/c/ChangeLog:
PR objc/77404
* c-parser.c (c_parser_objc_class_definition): Pass the
location of the class name to the interface declaration.
gcc/cp/ChangeLog:
PR objc/77404
* parser.c (cp_parser_objc_class_interface): Pass the
location of the class name to the interface declaration.
gcc/objc/ChangeLog:
PR objc/77404
* objc-act.c (objc_start_class_interface): Accept the location
of the class name, use it in existing diagnostic.
(start_class): Accept obj_root_class type attributes. Warn when
the interface for an implementation does not contain a super
class (unless the diagnostic is suppressed by the the command
line flag or the objc_root_class type attribute).
gcc/testsuite/ChangeLog:
PR objc/77404
* objc.dg/attributes/root-class-01.m: New test.
* objc.dg/root-class-00.m: New test.
* obj-c++.dg/attributes/root-class-01.mm: New test.
* obj-c++.dg/root-class-00.mm: New test.
gcc/ChangeLog:
PR objc/77404
* doc/extend.texi: Document the objc_root_class attribute.
* doc/invoke.texi: Document -Wobjc-root-class.