aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-05-08Update ChangeLog and version files for releasereleases/gcc-12.3.0Richard Biener55-1/+217
2023-05-08Daily bump.GCC Administrator1-1/+1
2023-05-07Daily bump.GCC Administrator1-1/+1
2023-05-06Daily bump.GCC Administrator1-1/+1
2023-05-05Daily bump.GCC Administrator3-1/+26
2023-05-04Revert "c++: DMI in template with virtual base [PR106890]"Jason Merrill2-32/+0
The PR106890 patch caused PR109666; for 12.3 let's just revert it. PR c++/109666 This reverts commit 94569d91bd4c604da755b4aae84256e7fe21196a.
2023-05-04tree-optimization/109724 - new testcaseRichard Biener1-0/+32
The following adds a testcase for PR109724 which was caused by backporting r13-2375-gbe1b42de9c151d and fixed by r11-199-g2b42509f8b7bdf. PR tree-optimization/109724 * g++.dg/torture/pr109724.C: New testcase. (cherry picked from commit ee99aaae4aeecd55f1d945a959652cf07e3b2e9e)
2023-05-04Daily bump.GCC Administrator3-1/+28
2023-05-03libstdc++: Set _M_string_length before calling _M_dispose() [PR109703]Kefu Chai1-1/+1
This always sets _M_string_length in the constructor for ranges of input iterators, such as stream iterators. We copy from the source range to the local buffer, and then repeatedly reallocate a larger one if necessary. When disposing the old buffer, _M_is_local() is used to tell if the buffer is the local one or not (and so must be deallocated). In addition to comparing the buffer address with the local buffer, _M_is_local() has an optimization hint so that the compiler knows that for a string using the local buffer, there is an invariant that _M_string_length <= _S_local_capacity (added for PR109299 via r13-6915-gbf78b43873b0b7). But we failed to set _M_string_length in the constructor taking a pair of iterators, so the invariant might not hold, and __builtin_unreachable() is reached. This causes UBsan errors, and potentially misoptimization. To ensure the invariant holds, _M_string_length is initialized to zero before doing anything else, so that _M_is_local() doesn't see an uninitialized value. This issue only surfaces when constructing a string with a range of input iterator, and the uninitialized _M_string_length happens to be greater than _S_local_capacity, i.e., 15 for the std::string specialization. libstdc++-v3/ChangeLog: PR libstdc++/109703 * include/bits/basic_string.h (basic_string(Iter, Iter, Alloc)): Initialize _M_string_length. Signed-off-by: Kefu Chai <kefu.chai@scylladb.com> Co-authored-by: Jonathan Wakely <jwakely@redhat.com> (cherry picked from commit cbf6c7a1d16490a1e63e9a5ce00e9a5c44c4c2f2)
2023-05-03libstdc++: Strip absolute paths from files shown in Doxygen docsJonathan Wakely1-1/+2
This avoids showing absolute paths from the expansion of @srcdir@/libsupc++/ in the doxygen File List view. libstdc++-v3/ChangeLog: * doc/doxygen/user.cfg.in (STRIP_FROM_PATH): Remove prefixes from header paths. (cherry picked from commit 975e8e836ead0e9055a125a2a23463db5d847cb3)
2023-05-03c++: Fix up VEC_INIT_EXPR gimplification after r12-7069Jakub Jelinek1-10/+10
During patch backporting, I've noticed that while most cp_walk_tree calls with cp_fold_r callback callers were changed from &pset to cp_fold_data &data, the VEC_INIT_EXPR gimplifications has not, so it still passes just address of a hash_set<tree> and so if during the folding we ever touch data->genericize, we use uninitialized data there. The following patch changes it to do the same thing as cp_fold_function because the VEC_INIT_EXPR gimplifications will happen on function bodies only. 2023-05-03 Jakub Jelinek <jakub@redhat.com> * cp-gimplify.cc (cp_fold_data): Move definition earlier. (cp_gimplify_expr): Pass address of genericize = true constructed data rather than &pset to cp_walk_tree with cp_fold_r. (cherry picked from commit 8d193b12d6f07ae0196db8296a49c881c1638c01)
2023-05-03Daily bump.GCC Administrator1-1/+1
2023-05-02Daily bump.GCC Administrator1-1/+1
2023-05-01Daily bump.GCC Administrator3-1/+37
2023-04-30c++, coroutines: Fix block nests when the function has no top-level bind.Iain Sandoe1-0/+4
When the function contains no local vars and also no nested scopes, there is no top-level bind expression. Because the rewritten coroutine body will require both local vars and contain nested scopes, we add a bind expression to such functions. When this was done the necessary scope blocks were omitted which leads to disconnected function content. Fixed by adding a new block to the added bind expression. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/cp/ChangeLog: * coroutines.cc (coro_rewrite_function_body): Ensure that added bind expressions have scope blocks. (cherry picked from commit a8d7631d333c22e38a067d32d11fd2b60cf1d960)
2023-04-30c++,coroutines: Stabilize names of promoted slot vars [PR101118].Iain Sandoe1-1/+1
When we need to 'promote' a value (i.e. store it in the coroutine frame) it is given a frame entry name. This was based on the DECL_UID for slot vars. However, when LTO is used, the names from multiple TUs become visible at the same time, and the DECL_UIDs usually differ between units. This leads to a "ODR mismatch" warning for the frame type. The fix here is to use the current promoted temporaries count to produce the name, this is stable between TUs and computed per coroutine. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> PR c++/101118 gcc/cp/ChangeLog: * coroutines.cc (flatten_await_stmt): Use the current count of promoted temporaries to build a unique name for the frame entries. (cherry picked from commit fc4cde2e6aa4d6ebdf7f70b7b4359fb59a1915ae)
2023-04-30coroutines: Build pointer initializers with nullptr_node [PR107768]Andrew Pinski2-3/+29
The PR reports that using integer_zero_node triggers a warning for -Wzero-as-null-pointer-constant which comes from compiler-generated code so makes no sense to the end user. Co-Authored-By: Iain Sandoe <iain@sandoe.co.uk> PR c++/107768 gcc/cp/ChangeLog: * coroutines.cc (coro_rewrite_function_body): Initialize pointers from nullptr_node. (morph_fn_to_coro): Likewise. gcc/testsuite/ChangeLog: * g++.dg/coroutines/pr107768.C: New test. (cherry picked from commit 0b1d66658ecdcc3d9251641a0b902b4c73ace303)
2023-04-30Daily bump.GCC Administrator2-1/+45
2023-04-29libstdc++: Implement LWG 3904 change to lazy_split_view's iteratorPatrick Palka2-1/+18
libstdc++-v3/ChangeLog: * include/std/ranges (lazy_split_view::_OuterIter::_OuterIter): Propagate _M_trailing_empty in the const-converting constructor as per LWG 3904. * testsuite/std/ranges/adaptors/lazy_split.cc (test12): New test. (cherry picked from commit aa65771427d32299cffecea64cbb766411aa8faf)
2023-04-29libstdc++: Implement P2520R0 changes to move_iterator's iterator_conceptPatrick Palka3-1/+57
libstdc++-v3/ChangeLog: * include/bits/stl_iterator.h (move_iterator::_S_iter_concept): Define. (__cpp_lib_move_iterator_concept): Define for C++20. (move_iterator::iterator_concept): Strengthen as per P2520R0. * include/std/version (__cpp_lib_move_iterator_concept): Define for C++20. * testsuite/24_iterators/move_iterator/p2520r0.cc: New test. (cherry picked from commit 2b204accd07a3185b58b1edc6e9b019472857a5d)
2023-04-29libstdc++: Make views::single/iota/istream SFINAE-friendly [PR108362]Patrick Palka5-10/+65
PR libstdc++/108362 libstdc++-v3/ChangeLog: * include/std/ranges (__detail::__can_single_view): New concept. (_Single::operator()): Constrain it. Move [[nodiscard]] to the end of the function declarator. (__detail::__can_iota_view): New concept. (_Iota::operator()): Constrain it. Move [[nodiscard]] to the end of the function declarator. (__detail::__can_istream_view): New concept. (_Istream::operator()): Constrain it. Move [[nodiscard]] to the end of the function declarator. * testsuite/std/ranges/iota/lwg3292_neg.cc: Prune "in requirements" diagnostic. * testsuite/std/ranges/iota/iota_view.cc (test07): New test. * testsuite/std/ranges/istream_view.cc (test08): New test. * testsuite/std/ranges/single_view.cc (test07): New test. (cherry picked from commit 95827e1b9f7d5dd5a697bd60292e3876a7e8c15c)
2023-04-29Daily bump.GCC Administrator4-1/+60
2023-04-28libstdc++: Fix __max_diff_type::operator>>= for negative valuesPatrick Palka2-3/+12
This patch fixes sign bit propagation when right-shifting a negative __max_diff_type value by more than one, a bug that our existing test coverage didn't expose until r14-159-g03cebd304955a6 fixed the front end's 'signed typedef-name' handling that the test relies on (which is a non-standard extension to the language grammar). libstdc++-v3/ChangeLog: * include/bits/max_size_type.h (__max_diff_type::operator>>=): Fix propagation of sign bit. * testsuite/std/ranges/iota/max_size_type.cc: Avoid using the non-standard 'signed typedef-name'. Add some compile-time tests for right-shifting a negative __max_diff_type value by more than one. (cherry picked from commit 83470a5cd4c3d233e1d55b5e5553e1b9c553bf28)
2023-04-28c++: outer 'this' leaking into local class [PR106969]Patrick Palka3-5/+32
Here when resolving the implicit object for '&wrapped' within the local class Foo, we expect to obtain a dummy object of type Foo& since there's no 'this' available in this context. And yet at this point current_class_ref still corresponds to the outer class Context (and is const), which confuses maybe_dummy_object into propagating the cv-quals of current_class_ref and returning an object of type const Foo&. Thus decltype(&wrapped) wrongly yields const int* instead of int*. The problem ultimately seems to be that the 'this' from the enclosing class appears available for use when parsing the local class, but 'this' shouldn't persist across classes like that. This patch fixes this by clearing current_class_ptr/ref before parsing a class definition. After this change, for the test name-clash11.C in C++98 mode we would now complain about an invalid use of 'this' in e.g. ASSERT (sizeof (this->A) == 16); due to the way the test defines the ASSERT macro via a local class. This patch redefines the macro using a local typedef instead. PR c++/106969 gcc/cp/ChangeLog: * parser.cc (cp_parser_class_specifier): Clear current_class_ptr and current_class_ref sooner, before parsing a class definition. gcc/testsuite/ChangeLog: * g++.dg/lookup/name-clash11.C: Fix ASSERT macro definition in C++98 mode. * g++.dg/lookup/this2.C: New test. (cherry picked from commit bbf2424c57c2e13d1a972c4ef4e871c3119b9cb4)
2023-04-28c++: unevaluated array new-expr size constantness [PR108219]Patrick Palka4-3/+49
Here we're mishandling the unevaluated array new-expressions due to a supposed non-constant array size ever since r12-5253-g4df7f8c79835d569 made us no longer perform constant evaluation of non-manifestly-constant expressions within unevaluated contexts. This shouldn't make a difference here since the array sizes are constant literals, except they're expressed as NON_LVALUE_EXPR location wrappers around INTEGER_CST, wrappers which used to get stripped as part of constant evaluation and now no longer do. Moreover it means build_vec_init can't constant fold the MINUS_EXPR 'maxindex' passed from build_new_1 when in an unevaluated context (since it tries reducing it via maybe_constant_value called with mce_unknown). This patch fixes these issues by making maybe_constant_value (and fold_non_dependent_expr) try folding an unevaluated non-manifestly-constant operand via fold(), as long as it simplifies to a simple constant, rather than doing no simplification at all. This covers e.g. simple arithmetic and casts including stripping of location wrappers around INTEGER_CST. In passing, this patch also fixes maybe_constant_value to avoid constant evaluating an unevaluated operand when called with mce_false, by adjusting the early exit test appropriately. Co-authored-by: Jason Merrill <jason@redhat.com> PR c++/108219 PR c++/108218 gcc/cp/ChangeLog: * constexpr.cc (fold_to_constant): Define. (maybe_constant_value): Move up early exit test for unevaluated operands. Try reducing an unevaluated operand to a constant via fold_to_constant. (fold_non_dependent_expr_template): Add early exit test for CONSTANT_CLASS_P nodes. Try reducing an unevaluated operand to a constant via fold_to_constant. * cp-tree.h (fold_to_constant): Declare. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/new6.C: New test. * g++.dg/cpp2a/concepts-new1.C: New test. (cherry picked from commit 096f034a8f5df41f610e62c1592fb90a3f551cd5)
2023-04-28Daily bump.GCC Administrator4-1/+190
2023-04-27libstdc++: Fix error in doxygen comments in <atomic>Jonathan Wakely1-0/+1
libstdc++-v3/ChangeLog: * include/std/atomic: Add missing @endcond doxygen comment.
2023-04-27libstdc++: Call predicate with non-const values in std::erase_if [PR107850]Jonathan Wakely17-21/+121
As specified in the standard, the predicate for std::erase_if has to be invocable as non-const with a non-const lvalues argument. Restore support for predicates that only accept non-const arguments. It's not strictly nevessary to change it for the set and unordered_set overloads, because they only give const access to the elements anyway. I've done it for them too just to keep them all consistent. libstdc++-v3/ChangeLog: PR libstdc++/107850 * include/bits/erase_if.h (__erase_nodes_if): Use non-const reference to the container. * include/experimental/map (erase_if): Likewise. * include/experimental/set (erase_if): Likewise. * include/experimental/unordered_map (erase_if): Likewise. * include/experimental/unordered_set (erase_if): Likewise. * include/std/map (erase_if): Likewise. * include/std/set (erase_if): Likewise. * include/std/unordered_map (erase_if): Likewise. * include/std/unordered_set (erase_if): Likewise. * testsuite/23_containers/map/erasure.cc: Check with const-incorrect predicate. * testsuite/23_containers/set/erasure.cc: Likewise. * testsuite/23_containers/unordered_map/erasure.cc: Likewise. * testsuite/23_containers/unordered_set/erasure.cc: Likewise. * testsuite/experimental/map/erasure.cc: Likewise. * testsuite/experimental/set/erasure.cc: Likewise. * testsuite/experimental/unordered_map/erasure.cc: Likewise. * testsuite/experimental/unordered_set/erasure.cc: Likewise. (cherry picked from commit f54ceb2062c7fef294f85ae093914fa6c7ca35b8)
2023-04-27libstdc++: Replace non-ASCII character in commentJonathan Wakely1-1/+1
This has an unnecessary UTF-8 non-breaking space. libstdc++-v3/ChangeLog: * testsuite/26_numerics/random/subtract_with_carry_engine/cons/lwg3809.cc: Replace non-ASCII character. (cherry picked from commit c775e2b81fca39f366040d423e3e44f4abecf753)
2023-04-27libstdc++: Fix uses_allocator_construction_args for pair<T&&, U&&> [PR108952]Jonathan Wakely4-2/+118
This implements LWG 3527 which fixes the handling of pair<T&&, U&&> in std::uses_allocator_construction_args. libstdc++-v3/ChangeLog: PR libstdc++/108952 * include/bits/uses_allocator_args.h (uses_allocator_construction_args): Implement LWG 3527. * testsuite/20_util/pair/astuple/get-2.cc: New test. * testsuite/20_util/scoped_allocator/108952.cc: New test. * testsuite/20_util/uses_allocator/lwg3527.cc: New test. (cherry picked from commit 8e342c04550466ab088c33746091ce7f3498ee44)
2023-04-27libstdc++: Avoid -Wmaybe-uninitialized warning in std::stop_source [PR109339]Jonathan Wakely2-0/+11
We pass a const-reference to *this before it's constructed, and GCC assumes that all const-references are accessed. Add the access attribute to say it's not accessed. libstdc++-v3/ChangeLog: PR libstdc++/109339 * include/std/stop_token (_Stop_state_ptr(const stop_source&)): Add attribute access with access-mode 'none'. * testsuite/30_threads/stop_token/stop_source/109339.cc: New test. (cherry picked from commit a35e8042fbc7a3eb9cece1fba4cdd3b6cdfb906f)
2023-04-27libstdc++: Make 16-bit std::subtract_with_carry_engine work [PR107466]Jonathan Wakely3-5/+31
This implements the proposed resolution of LWG 3809, so that std::subtract_with_carry_engine can be used with a 16-bit result_type. Currently this produces a narrowing error when instantiating the std::linear_congruential_engine to create the initial state. It also truncates the default_seed constant when passing it as a result_type argument. Change the type of the constant to uint_least32_t and pass 0u when the default_seed should be used. libstdc++-v3/ChangeLog: PR libstdc++/107466 * include/bits/random.h (subtract_with_carry_engine): Use 32-bit type for default seed. Use 0u as default argument for subtract_with_carry_engine(result_type) constructor and seed(result_type) member function. * include/bits/random.tcc (subtract_with_carry_engine): Use 32-bit type for default seed and engine used for initial state. * testsuite/26_numerics/random/subtract_with_carry_engine/cons/lwg3809.cc: New test. (cherry picked from commit a64775a0edd46980036b757041f0c065ed9f8d22)
2023-04-27libstdc++: Fix typo in doxygen commentJonathan Wakely1-2/+1
libstdc++-v3/ChangeLog: * include/bits/mofunc_impl.h: Fix typo in doxygen comment. (cherry picked from commit 481281ccf41aa2bc596e548edaad4e57833f3340)
2023-04-27libstdc++: Reduce Doxygen output for PDFJonathan Wakely6-1/+11
Including the header source code in the doxygen-generated PDF file makes it too large, and causes pdflatex to run out of memory. If we only set SOURCE_BROWSER=YES for the HTML docs then we won't include the sources in the PDF file. There are several macros defined for std::valarray that are only used to generate repetitive code and then #undef'd. Those aren't useful in the doxygen docs, especially the ones that reuse the same name in different files. Omitting them avoids warnings about duplicate labels in the refman.tex file. libstdc++-v3/ChangeLog: * doc/doxygen/user.cfg.in (SOURCE_BROWSER): Only set to YES for HTML docs. * include/bits/gslice_array.h (_DEFINE_VALARRAY_OPERATOR): Omit from doxygen docs. * include/bits/indirect_array.h (_DEFINE_VALARRAY_OPERATOR): Likewise. * include/bits/mask_array.h (_DEFINE_VALARRAY_OPERATOR): Likewise. * include/bits/slice_array.h (_DEFINE_VALARRAY_OPERATOR): Likewise. * include/std/valarray (_DEFINE_VALARRAY_UNARY_OPERATOR) (_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT) (_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT) (_DEFINE_BINARY_OPERATOR): Likewise. (cherry picked from commit afa69618d1627435841c9164b019ef98000e0365)
2023-04-27PR tree-optimization/109392Jakub Jelinek2-1/+25
If we have an object with SSA_NAME_OCCURS_IN_ABNORMAL_PHI, then maybe_push_res_to_seq may fail. Directly build the extraction for that case. PR tree-optimization/109392 gcc/ * tree-vect-generic.cc (tree_vec_extract): Handle failure of maybe_push_res_to_seq better. gcc/testsuite/ * gcc.dg/pr109392.c: New test. (cherry picked from commit 101380a8394c22a7a2ea70de2060ee93716156e2)
2023-04-27tree-optimization/108791 - checking ICE with sloppy ADDR_EXPRRichard Biener2-1/+11
The following fixes a checking ICE by choosing a more appropriate type for an ADDR_EXPR built by forwprop. PR tree-optimization/108791 * tree-ssa-forwprop.cc (optimize_vector_load): Build the ADDR_EXPR of a TARGET_MEM_REF using a more meaningful type. * gcc.dg/torture/pr108791.c: New testcase. (cherry picked from commit 441c466fd4d8b9afd99f585f7c4bfade911c4652)
2023-04-27PR rtl-optimization/106421: ICE in bypass_block from non-local goto.Roger Sayle2-3/+19
This patch fixes PR rtl-optimization/106421, an ICE-on-valid (but undefined) regression. The fix, as proposed by Richard Biener, is to defend against BLOCK_FOR_INSN returning NULL in cprop's bypass_block. 2023-01-10 Roger Sayle <roger@nextmovesoftware.com> gcc/ChangeLog PR rtl-optimization/106421 * cprop.cc (bypass_block): Check that DEST is local to this function (non-NULL) before calling find_edge. gcc/testsuite/ChangeLog PR rtl-optimization/106421 * gcc.dg/pr106421.c: New test case. (cherry picked from commit 851e1ba03f9de699a754dd8648fc151c3e26d697)
2023-04-27x86: Disable -mforce-indirect-call for PIC in 32-bit modeH.J. Lu2-0/+14
-mforce-indirect-call generates invalid instruction in 32-bit MI thunk since there are no available scratch registers in 32-bit PIC mode. Disable -mforce-indirect-call for PIC in 32-bit mode when generating MI thunk. gcc/ PR target/105980 * config/i386/i386.cc (x86_output_mi_thunk): Disable -mforce-indirect-call for PIC in 32-bit mode. gcc/testsuite/ PR target/105980 * g++.target/i386/pr105980.C: New test. (cherry picked from commit a396a123596d82d4a2f14dc43a382cb17826411c)
2023-04-27Fix invalid devirtualization when combining final keyword and anonymous typesJan Hubicka2-8/+82
this patch fixes a wrong code issue where we incorrectly devirtualize to __builtin_unreachable. The problem occurs in combination of anonymous namespaces and final keyword used on methods. We do two optimizations here 1) when reacing final method we cut the search for possible new targets 2) if the type is anonymous we detect whether it is ever instatiated by looking if its vtable is referred to. Now this goes wrong when thre is an anonymous type with final method that is not instantiated while its derived type is. So if 1 triggers we need to make 2 to look for vtables of all derived types as done by this patch. Bootstrpaped/regtested x86_64-linux Honza gcc/ChangeLog: 2022-08-10 Jan Hubicka <hubicka@ucw.cz> PR middle-end/106057 * ipa-devirt.cc (type_or_derived_type_possibly_instantiated_p): New function. (possible_polymorphic_call_targets): Use it. gcc/testsuite/ChangeLog: 2022-08-10 Jan Hubicka <hubicka@ucw.cz> PR middle-end/106057 * g++.dg/tree-ssa/pr101839.C: New test. (cherry picked from commit 0f2c7ccd14a29a8af8318f50b8296098fb0ab218)
2023-04-27Daily bump.GCC Administrator4-1/+123
2023-04-26ipa: Fix double reference-count decrements for the same edge (PR 107769, PR ↵Martin Jambor7-17/+143
109318) It turns out that since addition of the code that can identify globals which are only read from, the code that keeps track of the references can decrement their count for the same calls, once during IPA-CP and then again during inlining. Fixed by adding a special flag to the pass-through variant and simply wiping out the reference to the refdesc structure from the constant ones. Moreover, during debugging of the issue I have discovered that the code removing references could remove a reference associated with the same statement but of a wrong type. In all cases it wanted to remove an IPA_REF_ADDR reference so removing a lesser one instead should do no harm in practice, but we should try to be consistent and so this patch extends symtab_node::find_reference so that it searches for a reference of a given type only. gcc/ChangeLog: 2023-04-14 Martin Jambor <mjambor@suse.cz> PR ipa/107769 PR ipa/109318 * cgraph.h (symtab_node::find_reference): Add parameter use_type. * ipa-prop.h (ipa_pass_through_data): New flag refdesc_decremented. (ipa_zap_jf_refdesc): New function. (ipa_get_jf_pass_through_refdesc_decremented): Likewise. (ipa_set_jf_pass_through_refdesc_decremented): Likewise. * ipa-cp.cc (ipcp_discover_new_direct_edges): Provide a value for the new parameter of find_reference. (adjust_references_in_caller): Likewise. Make sure the constant jump function is not used to decrement a refdec counter again. Only decrement refdesc counters when the pass_through jump function allows it. Added a detailed dump when decrementing refdesc counters. * ipa-prop.cc (ipa_print_node_jump_functions_for_edge): Dump new flag. (ipa_set_jf_simple_pass_through): Initialize the new flag. (ipa_set_jf_unary_pass_through): Likewise. (ipa_set_jf_arith_pass_through): Likewise. (remove_described_reference): Provide a value for the new parameter of find_reference. (update_jump_functions_after_inlining): Zap refdesc of new jfunc if the previous pass_through had a flag mandating that we do so. (propagate_controlled_uses): Likewise. Only decrement refdesc counters when the pass_through jump function allows it. (ipa_edge_args_sum_t::duplicate): Provide a value for the new parameter of find_reference. (ipa_write_jump_function): Assert the new flag does not have to be streamed. * symtab.cc (symtab_node::find_reference): Add parameter use_type, use it in searching. gcc/testsuite/ChangeLog: 2023-04-06 Martin Jambor <mjambor@suse.cz> PR ipa/107769 PR ipa/109318 * gcc.dg/ipa/pr109318.c: New test. * gcc.dg/lto/pr107769_0.c: Likewise. (cherry picked from commit 8e08c7886eed5824bebd0e011526ec302d622844)
2023-04-26powerpc: Fix up *branch_anddi3_dot for -m32 -mpowerpc64 [PR109566]Jakub Jelinek2-1/+28
The following testcase reduced from newlib ICEs on powerpc-linux, with -O2 -m32 -mpowerpc64 since r12-6433 PR102239 optimization was added and on the original testcase since some ranger improvements in GCC 13 made it no longer latent on newlib. The problem is that the *branch_anddi3_dot define_insn_and_split relies on the *rotldi3_mask_dot define_insn_and_split being recognized during splitting. The rs6000_is_valid_rotate_dot_mask function checks whether the mask is a CONST_INT which is a valid mask, but *rotl<mode>3_mask_dot in addition to checking that it is a valid mask also has (<MODE>mode == Pmode || UINTVAL (operands[3]) <= 0x7fffffff) test in the condition. For TARGET_64BIT that doesn't add any further requirements, but for !TARGET_64BIT && TARGET_POWERPC64 if the AND second operand is larger than INT_MAX it will not be recognized. The rs6000_is_valid_rotate_dot_mask function is used solely in one spot, condition of *branch_anddi3_dot, so the following patch adjusts it to check for that as well. 2023-04-25 Jakub Jelinek <jakub@redhat.com> PR target/109566 * config/rs6000/rs6000.cc (rs6000_is_valid_rotate_dot_mask): For !TARGET_64BIT, don't return true if UINTVAL (mask) << (63 - nb) is larger than signed int maximum. * gcc.target/powerpc/pr109566.c: New test. (cherry picked from commit 97f8f2d0a0384d377ca46da88495f9a3d18d4415)
2023-04-26tree-optimization/109609 - correctly interpret arg size in fnspecRichard Biener3-5/+43
By majority vote and a hint from the API name which is arg_max_access_size_given_by_arg_p this interprets a memory access size specified as given as other argument such as for strncpy in the testcase which has "1cO313" as specifying the _maximum_ size read/written rather than the exact size. There are two uses interpreting it that way already and one differing. The following adjusts the differing and clarifies the documentation. PR tree-optimization/109609 * attr-fnspec.h (arg_max_access_size_given_by_arg_p): Clarify semantics. * tree-ssa-alias.cc (check_fnspec): Correctly interpret the size given by arg_max_access_size_given_by_arg_p as maximum, not exact, size. * gcc.dg/torture/pr109609.c: New testcase. (cherry picked from commit e8d00353017f895d03a9eabae3506fd126ce1a2d)
2023-04-26rtl-optimization/109585 - alias analysis typoRichard Biener2-1/+34
When r10-514-gc6b84edb6110dd2b4fb improved access path analysis it introduced a typo that triggers when there's an access to a trailing array in the first access path leading to false disambiguation. PR rtl-optimization/109585 * tree-ssa-alias.cc (aliasing_component_refs_p): Fix typo. * gcc.dg/torture/pr109585.c: New testcase. (cherry picked from commit 6d4bd27a60447c7505cb4783e675e98a191a8904)
2023-04-26tree-optimization/109573 - avoid ICEing on unexpected live defRichard Biener2-3/+95
The following relaxes the assert in vectorizable_live_operation where we catch currently unhandled cases to also allow an intermediate copy as it happens here but also relax the assert to checking only. PR tree-optimization/109573 * tree-vect-loop.cc (vectorizable_live_operation): Allow unhandled SSA copy as well. Demote assert to checking only. * g++.dg/vect/pr109573.cc: New testcase. (cherry picked from commit cddfe6bc40b3dc0806e260bbfb4cac82d609a258)
2023-04-26Remove obsolete configure code in gnattoolsEric Botcazou2-96/+20
It was recently pointed out that we generate symbolic links to ghost files when building the GNAT tools, as the mlib-tgt-specific-*.adb files are gone. gnattools/ * configure.ac (TOOLS_TARGET_PAIRS): Remove obsolete settings. (EXTRA_GNATTOOLS): Likewise. * configure: Regenerate.
2023-04-26Daily bump.GCC Administrator1-1/+1
2023-04-25Daily bump.GCC Administrator1-1/+1
2023-04-24Daily bump.GCC Administrator3-1/+37
2023-04-23Fortran: resolve correct generic with TYPE(C_PTR) arguments [PR61615,PR99982]Harald Anlauf2-1/+112
gcc/fortran/ChangeLog: PR fortran/61615 PR fortran/99982 * interface.cc (compare_parameter): Enable type and rank checks for arguments of derived type from the intrinsic module ISO_C_BINDING. gcc/testsuite/ChangeLog: PR fortran/61615 PR fortran/99982 * gfortran.dg/interface_49.f90: New test. (cherry picked from commit c482995cc5bac4a2168ea0049041e712544e474b)