aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-10-14Daily bump.GCC Administrator9-1/+241
2022-10-14Fix bogus -Wstringop-overflow warningEric Botcazou2-2/+22
If you compile the testcase with -O2 -fno-inline -Wall, you get: In function 'process_array3': cc1: warning: 'process_array4' accessing 4 bytes in a region of size 3 [- Wstringop-overflow=] cc1: note: referencing argument 1 of type 'char[4]' t.c:6:6: note: in a call to function 'process_array4' 6 | void process_array4 (char a[4], int n) | ^~~~~~~~~~~~~~ cc1: warning: 'process_array4' accessing 4 bytes in a region of size 3 [- Wstringop-overflow=] cc1: note: referencing argument 1 of type 'char[4]' t.c:6:6: note: in a call to function 'process_array4' That's because the ICF IPA pass has identified the two functions and turned process_array3 into a wrapper of process_array4. gcc/ * gimple-ssa-warn-access.cc (pass_waccess::check_call): Return early for calls made from thunks. gcc/testsuite/ * gcc.dg/Wstringop-overflow-89.c: New test.
2022-10-13c++: trivial formatting cleanupsJason Merrill5-15/+17
Split out from the C++ contracts patch. gcc/cp/ChangeLog: * cp-tree.h: Fix whitespace. * parser.h: Fix whitespace. * decl.cc: Fix whitespace. * parser.cc: Fix whitespace. * pt.cc: Fix whitespace.
2022-10-13analyzer: fix ICE introduced in r13-3168 [PR107210]David Malcolm2-1/+18
gcc/analyzer/ChangeLog: PR analyzer/107210 * svalue.cc (constant_svalue::maybe_fold_bits_within): Only attempt to extract individual bits when tree_fits_uhwi_p. gcc/testsuite/ChangeLog: PR analyzer/107210 * gfortran.dg/analyzer/pr107210.f90: New test. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2022-10-13libgomp: Add Fortran testcases for omp_in_explicit_taskTobias Burnus7-0/+247
Fortranized testcases of commits r13-3257-ga58a965eb73 and r13-3258-g0ec4e93fb9f. libgomp/ChangeLog: * testsuite/libgomp.fortran/task-7.f90: New test. * testsuite/libgomp.fortran/task-8.f90: New test. * testsuite/libgomp.fortran/task-in-explicit-1.f90: New test. * testsuite/libgomp.fortran/task-in-explicit-2.f90: New test. * testsuite/libgomp.fortran/task-in-explicit-3.f90: New test. * testsuite/libgomp.fortran/task-reduction-17.f90: New test. * testsuite/libgomp.fortran/task-reduction-18.f90: New test.
2022-10-13Fix emit_group_store regression on big-endianEric Botcazou1-12/+32
The recent optimization implemented for complex modes contains an oversight for big-endian platforms: it uses a lowpart SUBREG when the integer modes have different sizes, but this does not match the semantics of the PARALLELs which have a bundled byte offset; this offset is always zero in the code path and the lowpart is not at offset zero on big-endian platforms. gcc/ * expr.cc (emit_group_stote): Fix handling of modes of different sizes for big-endian targets in latest change and add commentary.
2022-10-13use proper DECL_INITIAL for VTVMartin Liska3-23/+12
gcc/cp/ChangeLog: * vtable-class-hierarchy.cc (vtv_generate_init_routine): Emit an artificial variable that would be put into .preinit_array section. gcc/ChangeLog: * output.h (assemble_vtv_preinit_initializer): Remove. * varasm.cc (assemble_vtv_preinit_initializer): Remove.
2022-10-13propagate partial equivs in the cache.Andrew MacLeod3-6/+66
Adjust on-entry cache propagation to look for and propagate both full and partial equivalences. gcc/ PR tree-optimization/102540 PR tree-optimization/102872 * gimple-range-cache.cc (ranger_cache::fill_block_cache): Handle partial equivs. (ranger_cache::range_from_dom): Cleanup dump output. gcc/testsuite/ * gcc.dg/pr102540.c: New. * gcc.dg/pr102872.c: New.
2022-10-13Add partial equivalence recognition to cast and bitwise and.Andrew MacLeod1-0/+65
This provides the hooks that will register partial equivalencies for casts and bitwise AND operations with the appropriate bit pattern. * range-op.cc (operator_cast::lhs_op1_relation): New. (operator_bitwise_and::lhs_op1_relation): New.
2022-10-13Add equivalence iterator to relation oracle.Andrew MacLeod3-11/+118
Instead of looping over an exposed equivalence bitmap, provide iterators to loop over equivalences, partial equivalences, or both. * gimple-range-cache.cc (ranger_cache::fill_block_cache): Use iterator. * value-relation.cc (equiv_relation_iterator::equiv_relation_iterator): New. (equiv_relation_iterator::next): New. (equiv_relation_iterator::get_name): New. * value-relation.h (class relation_oracle): Privatize some methods. (class equiv_relation_iterator): New. (FOR_EACH_EQUIVALENCE): New. (FOR_EACH_PARTIAL_EQUIV): New. (FOR_EACH_PARTIAL_AND_FULL_EQUIV): New.
2022-10-13Add partial equivalence support to the relation oracle.Andrew MacLeod2-14/+229
This provides enhancements to the equivalence oracle to also track partial equivalences. They are tracked similar to equivalences, except it tracks a 'slice' of another ssa name. 8, 16, 32 and 64 bit slices are tracked. This will allow casts and mask of the same value to compare equal. * value-relation.cc (equiv_chain::dump): Don't print empty equivalences. (equiv_oracle::equiv_oracle): Allocate a partial equiv table. (equiv_oracle::~equiv_oracle): Release the partial equiv table. (equiv_oracle::add_partial_equiv): New. (equiv_oracle::partial_equiv_set): New. (equiv_oracle::partial_equiv): New. (equiv_oracle::query_relation): Check for partial equivs too. (equiv_oracle::dump): Also dump partial equivs. (dom_oracle::register_relation): Handle partial equivs. (dom_oracle::query_relation): Check for partial equivs. * value-relation.h (enum relation_kind_t): Add partial equivs. (relation_partial_equiv_p): New. (relation_equiv_p): New. (class pe_slice): New. (class equiv_oracle): Add prototypes. (pe_to_bits): New. (bits_to_pe): New. (pe_min): New.
2022-10-13c++: ICE with VEC_INIT_EXPR and defarg [PR106925]Marek Polacek2-2/+18
Since r12-8066, in cxx_eval_vec_init we perform expand_vec_init_expr while processing the default argument in this test. At this point start_preparsed_function hasn't yet set current_function_decl. expand_vec_init_expr then leads to maybe_splice_retval_cleanup which checks DECL_CONSTRUCTOR_P (current_function_decl) without checking that c_f_d is non-null first. It seems correct that c_f_d is null here, so it seems to me that maybe_splice_retval_cleanup should check c_f_d as in the following patch. PR c++/106925 gcc/cp/ChangeLog: * except.cc (maybe_splice_retval_cleanup): Check current_function_decl. Make the bool const. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/initlist-defarg3.C: New test.
2022-10-13tree-optimization/107247 - reduce SLP reduction accumulatorRichard Biener1-1/+13
The following makes sure to reduce a multi-vector SLP reduction accumulator to a single vector using vector operations if easily possible (if the number of lanes in the vector type is a multiple of the number of scalar accumulators). PR tree-optimization/107247 * tree-vect-loop.cc (vect_create_epilog_for_reduction): Reduce multi vector SLP reduction accumulators. Check the adjusted number of accumulator vectors against one for the re-use in the epilogue.
2022-10-13machmode: Introduce GET_MODE_NEXT_MODE with previous GET_MODE_WIDER_MODE ↵Jakub Jelinek5-14/+101
meaning, add new GET_MODE_WIDER_MODE On Wed, Oct 05, 2022 at 04:02:25PM -0400, Jason Merrill wrote: > > > > @@ -5716,7 +5716,13 @@ emit_store_flag_1 (rtx target, enum rtx_ > > > > { > > > > machine_mode optab_mode = mclass == MODE_CC ? CCmode : compare_mode; > > > > icode = optab_handler (cstore_optab, optab_mode); > > > > - if (icode != CODE_FOR_nothing) > > > > + if (icode != CODE_FOR_nothing > > > > + /* Don't consider [BH]Fmode as usable wider mode, as neither is > > > > + a subset or superset of the other. */ > > > > + && (compare_mode == mode > > > > + || !SCALAR_FLOAT_MODE_P (compare_mode) > > > > + || maybe_ne (GET_MODE_PRECISION (compare_mode), > > > > + GET_MODE_PRECISION (mode)))) > > > > > > Why do you need to do this here (and in prepare_cmp_insn, and similarly in > > > can_compare_p)? Shouldn't get_wider skip over modes that are not actually > > > wider? > > > > I'm afraid too many places rely on all modes of a certain class to be > > visible when walking from "narrowest" to "widest" mode, say > > FOR_EACH_MODE_IN_CLASS/FOR_EACH_MODE/FOR_EACH_MODE_UNTIL/FOR_EACH_WIDER_MODE > > etc. wouldn't work at all if GET_MODE_WIDER_MODE (BFmode) == SFmode > > && GET_MODE_WIDER_MODE (HFmode) == SFmode. > > Yes, it seems they need to change now that their assumptions have been > violated. I suppose FOR_EACH_MODE_IN_CLASS would need to change to not use > get_wider, and users of FOR_EACH_MODE/FOR_EACH_MODE_UNTIL need to decide > whether they want an iteration that uses get_wider (likely with a new name) > or not. Here is a patch which does that. Though I admit I didn't go carefully through all 24 GET_MODE_WIDER_MODE uses, 54 FOR_EACH_MODE_IN_CLASS uses, 3 FOR_EACH_MODE uses, 24 FOR_EACH_MODE_FROM, 6 FOR_EACH_MODE_UNTIL and 15 FOR_EACH_WIDER_MODE uses. It is more important to go through the GET_MODE_WIDER_MODE and FOR_EACH_WIDER_MODE uses because the patch changes behavior for those, the rest keep their previous meaning and so can be changed incrementally if the other meaning is desirable to them (I've of course changed the 3 spots I had to change in the previous BFmode patch and whatever triggered during the bootstraps). 2022-10-13 Jakub Jelinek <jakub@redhat.com> * genmodes.cc (emit_mode_wider): Emit previous content of mode_wider array into mode_next array and for mode_wider emit always VOIDmode for !CLASS_HAS_WIDER_MODES_P classes, otherwise skip through modes with the same precision. * machmode.h (mode_next): Declare. (GET_MODE_NEXT_MODE): New inline function. (mode_iterator::get_next, mode_iterator::get_known_next): New function templates. (FOR_EACH_MODE_IN_CLASS): Use get_next instead of get_wider. (FOR_EACH_MODE): Use get_known_next instead of get_known_wider. (FOR_EACH_MODE_FROM): Use get_next instead of get_wider. (FOR_EACH_WIDER_MODE_FROM): Define. (FOR_EACH_NEXT_MODE): Define. * expmed.cc (emit_store_flag_1): Use FOR_EACH_WIDER_MODE_FROM instead of FOR_EACH_MODE_FROM. * optabs.cc (prepare_cmp_insn): Likewise. Remove redundant !CLASS_HAS_WIDER_MODES_P check. (prepare_float_lib_cmp): Use FOR_EACH_WIDER_MODE_FROM instead of FOR_EACH_MODE_FROM. * config/i386/i386-expand.cc (get_mode_wider_vector): Use GET_MODE_NEXT_MODE instead of GET_MODE_WIDER_MODE.
2022-10-13[AArch64] Improve bit tests [PR105773]Wilco Dijkstra7-96/+107
Since AArch64 sets all flags on logical operations, comparisons with zero can be combined into an AND even if the condition is LE or GT. Add a new CC_NZV mode used by ANDS/BICS/TST instructions. gcc/ PR target/105773 * config/aarch64/aarch64.cc (aarch64_select_cc_mode): Allow GT/LE for merging compare with zero into AND. (aarch64_get_condition_code_1): Add CC_NZVmode support. * config/aarch64/aarch64-modes.def: Add CC_NZV. * config/aarch64/aarch64.md: Use CC_NZV in cmp+and patterns. gcc/testsuite/ PR target/105773 * gcc.target/aarch64/ands_2.c: Test for ANDS. * gcc.target/aarch64/bics_2.c: Test for BICS. * gcc.target/aarch64/tst_2.c: Test for TST. * gcc.target/aarch64/tst_imm_split_1.c: Fix test.
2022-10-13tree-optimization/107160 - avoid reusing multiple accumulatorsRichard Biener2-1/+43
Epilogue vectorization is not set up to re-use a vectorized accumulator consisting of more than one vector. For non-SLP we always reduce to a single but for SLP that isn't happening. In such case we currenlty miscompile the epilog so avoid this. PR tree-optimization/107160 * tree-vect-loop.cc (vect_create_epilog_for_reduction): Do not register accumulator if we failed to reduce it to a single vector. * gcc.dg/vect/pr107160.c: New testcase.
2022-10-13Add op1_op2_relation for float operands.Aldy Hernandez3-1/+16
op1_op2_relation can be called for relops (bool = a < b) as well as regular binary operators (z = a + b). This patch adds the overloaded method for floating point results. gcc/ChangeLog: * range-op-float.cc (range_operator_float::op1_op2_relation): New. (class foperator_equal): Add using. (class foperator_not_equal): Same. (class foperator_lt): Same. (class foperator_le): Same. (class foperator_gt): Same. (class foperator_ge): Same. * range-op.cc (range_op_handler::op1_op2_relation): New. * range-op.h (range_operator_float::op1_op2_relation): New.
2022-10-13diagnose return statement in match.pd (with { ... } expressionsRichard Biener2-150/+150
The expression in (with { ... } is used like a statement expression which means control flow that leaves it is not allowed. The following explicitely diagnoses 'return' and fixes up the few cases that crept into match.pd (oops). Any such return will prematurely end matching the current expression. * genmatch.cc (parser::parse_c_expr): Diagnose 'return'. * match.pd: Replace 'return' statements in with expressions with appropriate variants.
2022-10-13ifcvt: Fix bitpos calculation in bitfield lowering [PR107229]Andre Vieira4-4/+81
The bitposition calculation for the bitfield lowering in loop if conversion was not taking DECL_FIELD_OFFSET into account, which meant that it would result in wrong bitpositions for bitfields that did not end up having representations starting at the beginning of the struct. gcc/ChangeLog: PR tree-optimization/107229 * tree-if-conv.cc (get_bitfield_rep): Fix bitposition calculation. gcc/testsuite/ChangeLog: * gcc.dg/vect/pr107229-1.c: New test. * gcc.dg/vect/pr107229-2.c: New test. * gcc.dg/vect/pr107229-3.c: New test.
2022-10-13LoongArch: implement count_{leading,trailing}_zerosXi Ruoyao1-0/+12
LoongArch always support clz and ctz instructions, so we can always use __builtin_{clz,ctz} for count_{leading,trailing}_zeros. This improves the code of libgcc, and also benefits Glibc once we merge longlong.h there. Bootstrapped and regtested on loongarch64-linux-gnu. include/ChangeLog: * longlong.h [__loongarch__] (count_leading_zeros): Define. [__loongarch__] (count_trailing_zeros): Likewise. [__loongarch__] (COUNT_LEADING_ZEROS_0): Likewise.
2022-10-13vect: Don't pattern match BITFIELD_REF's of non-integrals [PR107226]Andre Vieira1-19/+2
The original patch supported matching the vect_recog_bitfield_ref_pattern for BITFIELD_REF's where the first operand didn't have a INTEGRAL_TYPE_P type. That means it would also match vectors, leading to regressions in targets that supported vectorization of those. gcc/ChangeLog: PR tree-optimization/107226 * tree-vect-patterns.cc (vect_recog_bitfield_ref_pattern): Reject BITFIELD_REF's with non integral typed first operands.
2022-10-13LoongArch: Fixed a bug in the loongarch architecture of libitm package.Lulu Cheng1-0/+3
Add a soft floating point condition to the register recovery part of the code. libitm/ChangeLog: * config/loongarch/sjlj.S: Add a soft floating point condition to the register recovery part of the code.
2022-10-13c: Do not use *_IS_IEC_60559 == 2Joseph Myers3-12/+7
A late change for C2x (addressing comments from the second round of editorial review before the CD ballot, postdating the most recent public working draft) removed the value 2 for *_IS_IEC_60559 (a new <float.h> macro added in C2x). Adjust the implementation accordingly not to use this value. Bootstrapped with no regressions for x86_64-pc-linux-gnu. gcc/ * ginclude/float.h (FLT_IS_IEC_60559, DBL_IS_IEC_60559) (LDBL_IS_IEC_60559): Update comment. gcc/c-family/ * c-cppbuiltin.cc (builtin_define_float_constants): Do not use value 2 for *_IS_IEC_60559. gcc/testsuite/ * gcc.dg/c2x-float-10.c: Do not expect value 2 for *_IS_IEC_60559.
2022-10-13Daily bump.GCC Administrator25-1/+308
2022-10-12preprocessor: Fix tracking of system header state [PR60014,PR60723]Lewis Hyatt7-7/+52
The token_streamer class (which implements gcc mode -E and -save-temps/-no-integrated-cpp) needs to keep track whether the last tokens output were in a system header, so that it can generate line marker annotations as necessary for a downstream consumer to reconstruct the state. The logic for tracking it, which was added by r5-1863 to resolve PR60723, has some edge case issues as revealed by the three new test cases. The first, coming from the original PR60014, was incidentally fixed by r9-1926 for unrelated reasons. The other two were still failing on master prior to this commit. Such code paths were not realizable prior to r13-1544, which made it possible for the token streamer to see CPP_PRAGMA tokens in more contexts. The two main issues being corrected here are: 1) print.prev_was_system_token needs to indicate whether the previous token output was in a system location. However, it was not being set on every token, only on those that triggered the main code path; specifically it was not triggered on a CPP_PRAGMA token. Testcase 2 covers this case. 2) The token_streamer uses a variable "line_marker_emitted" to remember whether a line marker has been emitted while processing a given token, so that it wouldn't be done more than once in case multiple conditions requiring a line marker are true. There was no reason for this to be a member variable that retains its value from token to token, since it is just needed for tracking the state locally while processing a single given token. The fact that it could retain its value for a subsequent token is rather difficult to observe, but testcase 3 demonstrates incorrect behavior resulting from that. Moving this to a local variable also simplifies understanding the control flow going forward. gcc/c-family/ChangeLog: PR preprocessor/60014 PR preprocessor/60723 * c-ppoutput.cc (class token_streamer): Remove member line_marker_emitted to... (token_streamer::stream): ...a local variable here. Set print.prev_was_system_token on all code paths. gcc/testsuite/ChangeLog: PR preprocessor/60014 PR preprocessor/60723 * gcc.dg/cpp/pr60014-1.c: New test. * gcc.dg/cpp/pr60014-1.h: New test. * gcc.dg/cpp/pr60014-2.c: New test. * gcc.dg/cpp/pr60014-2.h: New test. * gcc.dg/cpp/pr60014-3.c: New test. * gcc.dg/cpp/pr60014-3.h: New test.
2022-10-12libstdc++: Add __gnu_debug::basic_string<>::compare overloadsFrançois Dumont11-50/+41
Rather than adding those implementations we are adding a: using _Base::compare; so that any compare method not implemented at __gnu_debug::basic_string level are injected from the base class. Also review how __gnu_debug::basic_string is tested. Now require to define _GLIBCXX_TEST_DEBUG_STRING when running 'make check-debug'. libstdc++-v3/ChangeLog * include/debug/string: Add using _Base::compare. (__gnu_debug::basic_string<>::compare(const basic_string<>&)): Remove. (__gnu_debug::basic_string<>::compare(size_type, size_type, const basic_string<>&)): Remove. (__gnu_debug::basic_string<>::compare(size_type, size_type, const basic_string<>&, size_type, size_type)): Remove. * testsuite/util/testsuite_string.h [_GLIBCXX_TEST_DEBUG_STRING]: Include <debug/string>. * testsuite/21_strings/basic_string/operations/compare/char/1.cc: Include testsuite_string.h and use __gnu_test::string. * testsuite/21_strings/basic_string/operations/compare/char/13650.cc: Likewise. * testsuite/21_strings/basic_string/operations/compare/char/2.cc: Likewise. * testsuite/21_strings/basic_string/operations/rfind/char/1.cc: Likewise. * testsuite/21_strings/basic_string/operations/rfind/char/2.cc: Likewise. * testsuite/21_strings/basic_string/operations/rfind/char/3.cc: Likewise. * testsuite/21_strings/basic_string/operations/compare/wchar_t/1.cc: Include testsuite_string.h and use __gnu_test::wstring. * testsuite/21_strings/basic_string/operations/compare/wchar_t/13650.cc: Likewise. * testsuite/21_strings/basic_string/operations/compare/wchar_t/2.cc: Likewise.
2022-10-12c++: Remove maybe-rvalue OR in implicit moveMarek Polacek10-97/+41
This patch removes the two-stage overload resolution when performing implicit move, whereby the compiler does two separate overload resolutions: one treating the operand as an rvalue, and then (if that resolution fails) another one treating the operand as an lvalue. In the standard this was introduced via CWG 1579 and implemented in gcc in r251035. In r11-2412, we disabled the fallback OR in C++20 (but not in C++17). Then C++23 P2266 removed the fallback overload resolution, and changed the implicit move rules once again. So we wound up with three different behaviors. The two overload resolutions approach was complicated and quirky, so users should transition to the newer model. Removing the maybe-rvalue OR also allows us to simplify our code, for instance, now we can get rid of LOOKUP_PREFER_RVALUE altogether. This change means that code that previously didn't compile in C++17 will now compile, for example: struct S1 { S1(S1 &&); }; struct S2 : S1 {}; S1 f (S2 s) { return s; // OK, derived-to-base, use S1::S1(S1&&) } And conversely, code that used to work in C++17 may not compile anymore: struct W { W(); }; struct F { F(W&); F(W&&) = delete; }; F fn () { W w; return w; // use w as rvalue -> use of deleted function F::F(W&&) } I plan to add a note to porting_to.html. gcc/cp/ChangeLog: * call.cc (standard_conversion): Remove LOOKUP_PREFER_RVALUE code. (reference_binding): Honor clk_implicit_rval even pre-C++20. (implicit_conversion_1): Remove LOOKUP_PREFER_RVALUE code. (build_user_type_conversion_1): Likewise. (convert_like_internal): Likewise. (build_over_call): Likewise. * cp-tree.h (LOOKUP_PREFER_RVALUE): Remove. (LOOKUP_NO_NARROWING): Adjust definition. * except.cc (build_throw): Don't perform two overload resolutions. * typeck.cc (maybe_warn_pessimizing_move): Don't use LOOKUP_PREFER_RVALUE. (check_return_expr): Don't perform two overload resolutions. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/Wredundant-move10.C: Adjust dg-warning. * g++.dg/cpp0x/Wredundant-move7.C: Likewise. * g++.dg/cpp0x/move-return2.C: Remove dg-error. * g++.dg/cpp0x/move-return4.C: Likewise. * g++.dg/cpp0x/ref-qual20.C: Adjust expected return value. * g++.dg/cpp0x/move-return5.C: New test.
2022-10-12Add range-op entry for floating point NEGATE_EXPR.Aldy Hernandez1-0/+62
gcc/ChangeLog: * range-op-float.cc (class foperator_negate): New. (floating_op_table::floating_op_table): Add NEGATE_EXPR (range_op_float_tests): Add negate tests.
2022-10-12Fortran: check types of operands of arithmetic binary operations [PR107217]Harald Anlauf2-0/+33
gcc/fortran/ChangeLog: PR fortran/107217 * arith.cc (gfc_arith_plus): Compare consistency of types of operands. (gfc_arith_minus): Likewise. (gfc_arith_times): Likewise. (gfc_arith_divide): Likewise. (arith_power): Check that both operands are of numeric type. gcc/testsuite/ChangeLog: PR fortran/107217 * gfortran.dg/pr107217.f90: New test.
2022-10-12libgomp: Fix up OpenMP 5.2 feature bulletJakub Jelinek1-1/+1
The previous bullet correctly mentions 5.2 added for Fortran allocators directive which is a replacement of allocate directive associated with ALLOCATE statement to differentiate it at parse time from allocate directive as declarative one not associated with ALLOCATE statement, but the deprecation bullet talks about non-existing allocator directive. 2022-10-12 Jakub Jelinek <jakub@redhat.com> * libgomp.texi (OpenMP 5.2): Fix up allocator -> allocate directive in deprecation bullet.
2022-10-12libgomp: Add omp_in_explicit_task supportJakub Jelinek10-2/+202
This is pretty straightforward, if gomp_thread ()->task is NULL, it can't be explicit task, otherwise if gomp_thread ()->task->kind == GOMP_TASK_IMPLICIT, it is an implicit task, otherwise explicit task. 2022-10-12 Jakub Jelinek <jakub@redhat.com> * omp.h.in (omp_in_explicit_task): Declare. * omp_lib.h.in (omp_in_explicit_task): Likewise. * omp_lib.f90.in (omp_in_explicit_task): New interface. * libgomp.map (OMP_5.2): New symbol version, export omp_in_explicit_task and omp_in_explicit_task_. * task.c (omp_in_explicit_task): New function. * fortran.c (omp_in_explicit_task): Add ialias_redirect. (omp_in_explicit_task_): New function. * libgomp.texi (OpenMP 5.2): Mark omp_in_explicit_task as implemented. * testsuite/libgomp.c-c++-common/task-in-explicit-1.c: New test. * testsuite/libgomp.c-c++-common/task-in-explicit-2.c: New test. * testsuite/libgomp.c-c++-common/task-in-explicit-3.c: New test.
2022-10-12libgomp: Fix up creation of artificial teamsJakub Jelinek6-6/+117
When not in explicit parallel/target/teams construct, we in some cases create an artificial parallel with a single thread (either to handle target nowait or for task reduction purposes). In those cases, it handled again artificially created implicit task (created by gomp_new_icv for cases where we needed to write to some ICVs), but as the testcases show, didn't take into account possibility of this being done from explicit task(s). The code would destroy/free the previous task and replace it with the new implicit task. If task is an explicit task (when teams is NULL, all explicit tasks behave like if (0)), it is a pointer to a local stack variable, so freeing it doesn't work, and additionally we shouldn't lose the explicit tasks - the new implicit task should instead replace the ancestor task which is the first implicit one. 2022-10-12 Jakub Jelinek <jakub@redhat.com> * task.c (gomp_create_artificial_team): Fix up handling of invocations from within explicit task. * target.c (GOMP_target_ext): Likewise. * testsuite/libgomp.c/task-7.c: New test. * testsuite/libgomp.c/task-8.c: New test. * testsuite/libgomp.c-c++-common/task-reduction-17.c: New test. * testsuite/libgomp.c-c++-common/task-reduction-18.c: New test.
2022-10-12c++: defer all consteval in default args [DR2631]Jason Merrill10-111/+95
The proposed resolution of CWG2631 extends our current handling of source_location::current to all consteval functions: default arguments are not evaluated until they're used in a call, the same should apply to evaluation of immediate invocations. And similarly for default member initializers. Previously we folded source_location::current in cp_fold_r; now we fold all consteval calls in default arguments/member initializers in bot_replace. DR 2631 gcc/cp/ChangeLog: * cp-tree.h (source_location_current_p): Remove. * name-lookup.h (struct cp_binding_level): Remove immediate_fn_ctx_p. * call.cc (in_immediate_context): All default args and DMI are potentially immediate context. (immediate_invocation_p): Don't treat source_location specially. (struct in_consteval_if_p_temp_override): Move to cp-tree.h. * constexpr.cc (get_nth_callarg): Move to cp-tree.h. * cp-gimplify.cc (cp_fold_r): Don't fold consteval. * name-lookup.cc (begin_scope): Don't set immediate_fn_ctx_p. * parser.cc (cp_parser_lambda_declarator_opt): Likewise. (cp_parser_direct_declarator): Likewise. * pt.cc (tsubst_default_argument): Open sk_function_parms level. * tree.cc (source_location_current_p): Remove. (bot_replace): Fold consteval here. (break_out_target_exprs): Handle errors. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/consteval-defarg3.C: New test.
2022-10-12libstdc++: Implement ranges::repeat_view from P2474R2Patrick Palka2-0/+303
libstdc++-v3/ChangeLog: * include/std/ranges (repeat_view): Define. (repeat_view::_Iterator): Define. (views::__detail::__can_repeat_view): Define. (views::__detail::__can_bounded_repeat_view): Define. (views::_Repeat, views::repeat): Define. * testsuite/std/ranges/repeat/1.cc: New test.
2022-10-12RISC-V: Remove TUPLE size macro define. [NFC]Ju-Zhe Zhong1-3/+0
gcc/ChangeLog: * config/riscv/riscv-vector-builtins.h: Remove unused macro.
2022-10-12RISC-V: Apply clang-format for riscv-vector-builtins.* [NFC]Ju-Zhe Zhong3-7/+6
gcc/ChangeLog: * config/riscv/riscv-vector-builtins.cc (DEF_RVV_TYPE): Apply clang-format. (add_vector_type_attribute): Ditto. * config/riscv/riscv-vector-builtins.def (DEF_RVV_TYPE): Apply clang-format. * config/riscv/riscv-vector-builtins.h (DEF_RVV_TYPE): Apply clang-format.
2022-10-12RISC-V: Refine register_builtin_types function. [NFC]Ju-Zhe Zhong2-40/+50
gcc/ChangeLog: * config/riscv/riscv-vector-builtins.cc (builtin_types): Redefine vector types. (build_const_pointer): New function. (register_builtin_type): Ditto. (DEF_RVV_TYPE): Simplify macro. (register_vector_type): Refine implementation. * config/riscv/riscv-vector-builtins.h (rvv_builtin_types_t): New.
2022-10-12RISC-V: Move function place to make it looks better. [NFC]Ju-Zhe Zhong2-19/+19
gcc/ChangeLog: * config/riscv/riscv-vector-builtins.h (class rvv_switcher): Move to this to .... * config/riscv/riscv-vector-builtins.cc (class rvv_switcher): here.
2022-10-12Remove AVX512_VP2INTERSECT from PTA_SAPPHIRERAPIDSCui,Lili3-16/+12
gcc/ChangeLog: * config/i386/driver-i386.cc (host_detect_local_cpu): Move sapphirerapids out of AVX512_VP2INTERSECT. * config/i386/i386.h: Remove AVX512_VP2INTERSECT from PTA_SAPPHIRERAPIDS * doc/invoke.texi: Remove AVX512_VP2INTERSECT from SAPPHIRERAPIDS
2022-10-12MAINTAINERS: Add myself for write after approvalCui,Lili1-0/+1
ChangeLog: * MAINTAINERS (Write After Approval): Add myself.
2022-10-12gcov: rename gcov_write_summaryMartin Liska4-9/+8
gcc/ChangeLog: * gcov-io.cc (gcov_write_summary): Rename to ... (gcov_write_object_summary): ... this. * gcov-io.h (GCOV_TAG_OBJECT_SUMMARY_LENGTH): Rename from ... (GCOV_TAG_SUMMARY_LENGTH): ... this. libgcc/ChangeLog: * libgcov-driver.c: Use new function. * libgcov.h (gcov_write_summary): Rename to ... (gcov_write_object_summary): ... this.
2022-10-12regenerate configure filesMartin Liska19-44/+44
Needed after a recent change. gcc/ChangeLog: * configure: Regenerate. libatomic/ChangeLog: * configure: Regenerate. libbacktrace/ChangeLog: * configure: Regenerate. libcc1/ChangeLog: * configure: Regenerate. libffi/ChangeLog: * configure: Regenerate. libgfortran/ChangeLog: * configure: Regenerate. libgomp/ChangeLog: * configure: Regenerate. libitm/ChangeLog: * configure: Regenerate. libobjc/ChangeLog: * configure: Regenerate. liboffloadmic/ChangeLog: * configure: Regenerate. * plugin/configure: Regenerate. libphobos/ChangeLog: * configure: Regenerate. libquadmath/ChangeLog: * configure: Regenerate. libsanitizer/ChangeLog: * configure: Regenerate. libssp/ChangeLog: * configure: Regenerate. libstdc++-v3/ChangeLog: * configure: Regenerate. libvtv/ChangeLog: * configure: Regenerate. lto-plugin/ChangeLog: * configure: Regenerate. zlib/ChangeLog: * configure: Regenerate.
2022-10-12Add stubs for floating point range-op tests.Aldy Hernandez2-0/+29
gcc/ChangeLog: * range-op-float.cc (frange_float): New. (range_op_float_tests): New. * range-op.cc (range_op_tests): Call range_op_float_tests.
2022-10-12Add method to query the sign of a NAN.Aldy Hernandez1-0/+17
In writing some range-op entries I noticed we don't have a way to query the sign of the NAN in a range, unless the range only contains NAN, in which case you can just use frange::signbit_p. This patch adds a method that returns TRUE if there exists the possiblity of a NAN and we know its sign. gcc/ChangeLog: * value-range.h (frange::nan_signbit_p): New.
2022-10-12Disable tree to bool conversion in frange::update_nan.Aldy Hernandez2-1/+2
We have a set_nan(type) method which can be confused with update_nan(bool) because of the silent conversion of pointers to bool. Currently, if you call update_nan(tree), you'll set the possibility of NAN with a sign of true if tree is non-null. This is prone to error and this patch disallows this behavior. gcc/ChangeLog: * value-range.cc (frange::set_nonnegative): Pass bool to update_nan. * value-range.h: Disallow conversion to bool in update_nan().
2022-10-12Add an frange(type) constructor analogous to the irange version.Aldy Hernandez1-0/+8
gcc/ChangeLog: * value-range.h (frange::frange): Add constructor taking type.
2022-10-12Add default relation_kind to floating point range-op entries.Aldy Hernandez1-40/+40
The methods from which these derive all have a default relation_kind. This patch just adds the default, to make it easier to write unit tests later. gcc/ChangeLog: * range-op-float.cc: Add relation_kind = VREL_VARYING to all methods.
2022-10-12Libvtv-test: Fix bug that scansarif.exp cannot be found in libvtv regression ↵Lulu Cheng1-0/+2
test. SARIF support was added in r13-967 but libvtv wasn't updated. libvtv/ChangeLog: * testsuite/lib/libvtv-dg.exp: Add load_gcc_lib of scansarif.exp.
2022-10-12Daily bump.GCC Administrator26-1/+512
2022-10-12Enable support for atomic primitives on SPARC/LinuxEric Botcazou1-0/+1
The SPARC/Linux port is very similar to the SPARC/Solaris port nowadays so it makes sense to copy the setting of the support for atomic primitives. This fixes the single regression in the gnat.dg testsuite: FAIL: gnat.dg/prot7.adb (test for excess errors) gcc/ada/ * libgnat/system-linux-sparc.ads (Support_Atomic_Primitives): New constant set to True.