[gcc r14-11426] c++: Don't prune constant capture proxies only used in array dimensions [PR114292]
https://gcc.gnu.org/g:f86d274ab76fdd89d7afd9b2eab28f3a61749cfb commit r14-11426-gf86d274ab76fdd89d7afd9b2eab28f3a61749cfb Author: Simon Martin Date: Thu Mar 20 20:36:26 2025 +0100 c++: Don't prune constant capture proxies only used in array dimensions [PR114292] We currently ICE upon the following valid (under -Wno-vla) code === cut here === void f(int c) { constexpr int r = 4; [&](auto) { int t[r * c]; }(0); } === cut here === When parsing the lambda body, and more specifically the multiplication, we mark the lambda as LAMBDA_EXPR_CAPTURE_OPTIMIZED, which indicates to prune_lambda_captures that it might be possible to optimize out some captures. The problem is that prune_lambda_captures then misses the use of the r capture (because neither walk_tree_1 nor cp_walk_subtrees walks the dimensions of array types - here "r * c"), hence believes the capture can be pruned... and we trip on an assert when instantiating the lambda. This patch changes cp_walk_subtrees so that (1) when walking a DECL_EXPR, it also walks the DECL's type, and (2) when walking an INTEGER_TYPE and processing a template declaration, it also walks its TYPE_{MIN,MAX}_VALUE. PR c++/114292 gcc/cp/ChangeLog: * tree.cc (cp_walk_subtrees): Walk the type of DECL_EXPR declarations, as well as the TYPE_{MIN,MAX}_VALUE of INTEGER_TYPEs for template declarations. gcc/testsuite/ChangeLog: * g++.dg/cpp1y/lambda-ice4.C: New test. Diff: --- gcc/cp/tree.cc | 10 + gcc/testsuite/g++.dg/cpp1y/lambda-ice4.C | 63 2 files changed, 73 insertions(+) diff --git a/gcc/cp/tree.cc b/gcc/cp/tree.cc index abed2ce859c7..c6a4d89f4a34 100644 --- a/gcc/cp/tree.cc +++ b/gcc/cp/tree.cc @@ -5701,6 +5701,7 @@ cp_walk_subtrees (tree *tp, int *walk_subtrees_p, walk_tree_fn func, && !TREE_STATIC (TREE_OPERAND (t, 0) { tree decl = TREE_OPERAND (t, 0); + WALK_SUBTREE (TREE_TYPE (decl)); WALK_SUBTREE (DECL_INITIAL (decl)); WALK_SUBTREE (DECL_SIZE (decl)); WALK_SUBTREE (DECL_SIZE_UNIT (decl)); @@ -5751,6 +5752,15 @@ cp_walk_subtrees (tree *tp, int *walk_subtrees_p, walk_tree_fn func, WALK_SUBTREE (STATIC_ASSERT_MESSAGE (t)); break; +case INTEGER_TYPE: + if (processing_template_decl) + { + /* Removed from walk_type_fields in r119481. */ + WALK_SUBTREE (TYPE_MIN_VALUE (t)); + WALK_SUBTREE (TYPE_MAX_VALUE (t)); + } + break; + default: return NULL_TREE; } diff --git a/gcc/testsuite/g++.dg/cpp1y/lambda-ice4.C b/gcc/testsuite/g++.dg/cpp1y/lambda-ice4.C new file mode 100644 index ..d8b7af9f9920 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/lambda-ice4.C @@ -0,0 +1,63 @@ +// PR c++/114292 +// { dg-do "compile" { target c++14 } } +// { dg-additional-options "-Wno-vla" } + +#define ASSERT_CAPTURE_NUMBER(Lambda, NumCaptures) \ + { \ +auto oneCapture = [&](auto) { int t[c]; }; \ +const auto sizeOneCapture = sizeof (oneCapture); \ +const auto expected = NumCaptures ? NumCaptures * sizeOneCapture : 1; \ +static_assert (sizeof (Lambda) == expected, ""); \ + } + +template +struct Want_a_Typedef { typedef int Type[r*c]; }; + +void foo (int c) +{ + constexpr int r = 4; + + // This used to ICE. + auto ice_1 = [&](auto) { int t[c * r]; }; + ice_1 (0); + ASSERT_CAPTURE_NUMBER (ice_1, 2); + + // Another ICE identified following a great question in the patch submission + // mail thread. + auto ice_2 = [&](auto) { typedef int MyT[c*r]; }; + ice_2 (0); + ASSERT_CAPTURE_NUMBER (ice_2, 2); + + // All those worked already, but were not covered by any test - do it here. + auto ok_0 = [&](auto) { typedef int MyT[c*r]; MyT t; }; + ok_0 (0); + ASSERT_CAPTURE_NUMBER (ok_0, 2); + + auto ok_1 = [&](auto) { Want_a_Typedef::Type t; }; + ok_1 (0); + ASSERT_CAPTURE_NUMBER (ok_1, 0); + + auto ok_2 = [&](auto) { int t[c]; }; + ok_2 (0); + ASSERT_CAPTURE_NUMBER (ok_2, 1); + + auto ok_3 = [&](auto) { int n = r * c; int t[n]; }; + ok_3 (0); + ASSERT_CAPTURE_NUMBER (ok_3, 2); + + auto ok_4 = [&](auto) { int t[r]; }; + ok_4 (0); + ASSERT_CAPTURE_NUMBER (ok_4, 0); + + auto ok_5 = [&](auto) { int t[c * 4]; }; + ok_5 (0); + ASSERT_CAPTURE_NUMBER (ok_5, 1); + + auto ok_6 = [&](auto) { int t[1]; }; + ok_6 (0); + ASSERT_CAPTURE_NUMBER (ok_6, 0); + + auto ok_7 = [&](auto) { int t[c * r]; }; + ok_7 (0); + ASSERT_CAPTURE_NUMBER (ok_7, 2); +}
[gcc r15-8471] tree-optimization/119389 - limit edge processing in dominated_by_p_w_unex
https://gcc.gnu.org/g:607f92597c3047d7813a981450a7493bca014324 commit r15-8471-g607f92597c3047d7813a981450a7493bca014324 Author: Richard Biener Date: Thu Mar 20 15:08:33 2025 +0100 tree-optimization/119389 - limit edge processing in dominated_by_p_w_unex The following removes quadraticness when visiting each predecessor of a large CFG merge with dominated_by_p_w_unex. PR tree-optimization/119389 * tree-ssa-sccvn.cc (dominated_by_p_w_unex): Limit the number of predecessors of a CFG merge we try to skip. Diff: --- gcc/tree-ssa-sccvn.cc | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc index 40c38fa020a6..481ab8b243d7 100644 --- a/gcc/tree-ssa-sccvn.cc +++ b/gcc/tree-ssa-sccvn.cc @@ -5172,7 +5172,11 @@ dominated_by_p_w_unex (basic_block bb1, basic_block bb2, bool allow_back) /* Iterate to the single successor of bb2 with only a single executable incoming edge. */ else if (EDGE_COUNT (bb2->succs) == 1 - && EDGE_COUNT (single_succ (bb2)->preds) > 1) + && EDGE_COUNT (single_succ (bb2)->preds) > 1 + /* Limit the number of edges we check, we should bring in + context from the iteration and compute the single + executable incoming edge when visiting a block. */ + && EDGE_COUNT (single_succ (bb2)->preds) < 8) { edge prede = NULL; FOR_EACH_EDGE (e, ei, single_succ (bb2)->preds)
[gcc r15-8467] libstdc++: Add from_range_t constructors to debug unordered containers
https://gcc.gnu.org/g:7cc40201a135112824e44edeeb29017151652402 commit r15-8467-g7cc40201a135112824e44edeeb29017151652402 Author: Tomasz Kamiński Date: Thu Mar 20 12:08:00 2025 +0100 libstdc++: Add from_range_t constructors to debug unordered containers libstdc++-v3/ChangeLog: * include/debug/unordered_map (unordered_map): Add from_range constructors and deduction guides. (unordered_multimap): Likewise. * include/debug/unordered_set (unordered_set): Add from_range constructors and deduction guides. (unordered_multiset): Likewise. Reviewed-by: Jonathan Wakely Signed-off-by: Tomasz Kamiński Diff: --- libstdc++-v3/include/debug/unordered_map | 141 +++ libstdc++-v3/include/debug/unordered_set | 131 2 files changed, 272 insertions(+) diff --git a/libstdc++-v3/include/debug/unordered_map b/libstdc++-v3/include/debug/unordered_map index eb9590ac8e7e..16d4a4a98e0d 100644 --- a/libstdc++-v3/include/debug/unordered_map +++ b/libstdc++-v3/include/debug/unordered_map @@ -201,6 +201,34 @@ namespace __debug : unordered_map(__l, __n, __hf, key_equal(), __a) { } +#if __glibcxx_ranges_to_container // C++ >= 23 + template<__detail::__container_compatible_range _Rg> + unordered_map(from_range_t, _Rg&& __rg, + size_type __n = 0, + const hasher& __hf = hasher(), + const key_equal& __eql = key_equal(), + const allocator_type& __a = allocator_type()) + : _Base(from_range, std::forward<_Rg>(__rg), __n, __hf, __eql, __a) +{ } + + template<__detail::__container_compatible_range _Rg> + unordered_map(from_range_t, _Rg&& __rg, const allocator_type& __a) + : _Base(from_range, std::forward<_Rg>(__rg), __a) +{ } + + template<__detail::__container_compatible_range _Rg> + unordered_map(from_range_t, _Rg&& __rg, size_type __n, + const allocator_type& __a) + : _Base(from_range, std::forward<_Rg>(__rg), __n, __a) +{ } + + template<__detail::__container_compatible_range _Rg> + unordered_map(from_range_t, _Rg&& __rg, size_type __n, + const hasher& __hf, const allocator_type& __a) + : _Base(from_range, std::forward<_Rg>(__rg), __n, __hf, __a) +{ } +#endif + ~unordered_map() = default; unordered_map& @@ -841,6 +869,47 @@ namespace __debug _Hash, _Allocator) -> unordered_map<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>; +#if __glibcxx_ranges_to_container // C++ >= 23 + template>, + __not_allocator_like _Pred = equal_to<__detail::__range_key_type<_Rg>>, + __allocator_like _Allocator = +allocator<__detail::__range_to_alloc_type<_Rg>>> +unordered_map(from_range_t, _Rg&&, unordered_map::size_type = {}, + _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator()) +-> unordered_map<__detail::__range_key_type<_Rg>, +__detail::__range_mapped_type<_Rg>, +_Hash, _Pred, _Allocator>; + + template +unordered_map(from_range_t, _Rg&&, unordered_map::size_type, + _Allocator) +-> unordered_map<__detail::__range_key_type<_Rg>, +__detail::__range_mapped_type<_Rg>, +hash<__detail::__range_key_type<_Rg>>, +equal_to<__detail::__range_key_type<_Rg>>, +_Allocator>; + + template +unordered_map(from_range_t, _Rg&&, _Allocator) +-> unordered_map<__detail::__range_key_type<_Rg>, +__detail::__range_mapped_type<_Rg>, +hash<__detail::__range_key_type<_Rg>>, +equal_to<__detail::__range_key_type<_Rg>>, +_Allocator>; + + template +unordered_map(from_range_t, _Rg&&, unordered_map::size_type, + _Hash, _Allocator) +-> unordered_map<__detail::__range_key_type<_Rg>, +__detail::__range_mapped_type<_Rg>, +_Hash, equal_to<__detail::__range_key_type<_Rg>>, +_Allocator>; +#endif #endif template= 23 + template<__detail::__container_compatible_range _Rg> + unordered_multimap(from_range_t, _Rg&& __rg, + size_type __n = 0, + const hasher& __hf = hasher(), + const key_equal& __eql = key_equal(), + const allocator_type& __a = allocator_type()) + : _Base(from_range, std::forward<_Rg>(__rg), __n, __hf, __eql, __a) +{ } + + template<__detail::__container_compatible_range _Rg> + unordered_multimap(from_range_t, _Rg&& __rg, const allocator_type& __a) + : _Base(from_range, std::forward<_Rg>(__rg), __a) +{ } + + template<__detail::__c
[gcc r15-8398] gccrs: nr2.0: Cleanup import mappings and factor into a class.
https://gcc.gnu.org/g:1f556f071636fa2bd850958aaad33ec18d04c698 commit r15-8398-g1f556f071636fa2bd850958aaad33ec18d04c698 Author: Arthur Cohen Date: Wed Apr 10 17:38:19 2024 +0200 gccrs: nr2.0: Cleanup import mappings and factor into a class. gcc/rust/ChangeLog: * resolve/rust-early-name-resolver-2.0.h: New class for imports. * resolve/rust-finalize-imports-2.0.cc (finalize_simple_import): Use the new API. (finalize_glob_import): Likewise. (finalize_rebind_import): Likewise. (FinalizeImports::FinalizeImports): Likewise. (FinalizeImports::visit): Likewise. * resolve/rust-finalize-imports-2.0.h: Likewise. * resolve/rust-early-name-resolver-2.0.cc (Early::resolve_glob_import): Likewise. (Early::resolve_simple_import): Likewise. (Early::resolve_rebind_import): Likewise. Diff: --- gcc/rust/resolve/rust-early-name-resolver-2.0.cc | 33 +-- gcc/rust/resolve/rust-early-name-resolver-2.0.h | 51 ++-- gcc/rust/resolve/rust-finalize-imports-2.0.cc| 39 -- gcc/rust/resolve/rust-finalize-imports-2.0.h | 11 ++--- 4 files changed, 75 insertions(+), 59 deletions(-) diff --git a/gcc/rust/resolve/rust-early-name-resolver-2.0.cc b/gcc/rust/resolve/rust-early-name-resolver-2.0.cc index 5201c32e24dc..c4f9b27e297a 100644 --- a/gcc/rust/resolve/rust-early-name-resolver-2.0.cc +++ b/gcc/rust/resolve/rust-early-name-resolver-2.0.cc @@ -85,8 +85,9 @@ Early::resolve_glob_import (NodeId use_dec_id, TopLevel::ImportKind &&glob) // up the module proper in `FinalizeImports` // The namespace does not matter here since we are dealing with a glob // TODO: Ugly - import_mappings.insert ( -{use_dec_id, {{std::move (glob), ImportData::Glob (*resolved)}}}); + import_mappings.insert (use_dec_id, + ImportPair (std::move (glob), + ImportData::Glob (*resolved))); return true; } @@ -100,19 +101,11 @@ Early::resolve_simple_import (NodeId use_dec_id, TopLevel::ImportKind &&import) if (definitions.empty ()) return false; - // We insert an empty vector, unless an element was already present for - // `use_dec_id` - which is returned in the tuple's first member - auto tuple = import_mappings.insert ({use_dec_id, {}}); - // We then get that tuple's first member, which will be an iterator to the - // existing vec> OR an iterator to our newly - // created empty vector (plus its key since this is a hashmap iterator). - // we then access the second member of the pair to get access to the - // vector directly. - auto &imports = tuple.first->second; + auto &imports = import_mappings.new_or_access (use_dec_id); imports.emplace_back ( -std::make_pair (std::move (import), - ImportData::Simple (std::move (definitions; +ImportPair (std::move (import), + ImportData::Simple (std::move (definitions; return true; } @@ -127,19 +120,11 @@ Early::resolve_rebind_import (NodeId use_dec_id, if (definitions.empty ()) return false; - // We insert an empty vector, unless an element was already present for - // `use_dec_id` - which is returned in the tuple's first member - auto tuple = import_mappings.insert ({use_dec_id, {}}); - // We then get that tuple's first member, which will be an iterator to the - // existing vec> OR an iterator to our newly - // created empty vector (plus its key since this is a hashmap iterator). - // we then access the second member of the pair to get access to the - // vector directly. - auto &imports = tuple.first->second; + auto &imports = import_mappings.new_or_access (use_dec_id); imports.emplace_back ( -std::make_pair (std::move (rebind_import), - ImportData::Rebind (std::move (definitions; +ImportPair (std::move (rebind_import), + ImportData::Rebind (std::move (definitions; return true; } diff --git a/gcc/rust/resolve/rust-early-name-resolver-2.0.h b/gcc/rust/resolve/rust-early-name-resolver-2.0.h index 7d0864ee1008..ec1d914c05da 100644 --- a/gcc/rust/resolve/rust-early-name-resolver-2.0.h +++ b/gcc/rust/resolve/rust-early-name-resolver-2.0.h @@ -114,6 +114,52 @@ public: Rib::Definition glob_module; }; + struct ImportPair + { +TopLevel::ImportKind import_kind; +ImportData data; + +explicit ImportPair (TopLevel::ImportKind &&kind, ImportData &&data) + : import_kind (std::move (kind)), data (std::move (data)) +{} + }; + + class ImportMappings + { + public: +std::vector &new_or_access (NodeId path_id) +{ + // We insert an empty vector, unless an element was already present for + // `use_dec_id` - which is returned in the tuple's first member + auto iter = mappings.insert ({{path_id}, {}}); + + // We then get that tuple's first member,
[gcc r15-8447] diagnostics: fix crash in urlifier with -Wfatal-errors [PR119366]
https://gcc.gnu.org/g:24b6d2014035073870d9d8dae9152fc16fc319fd commit r15-8447-g24b6d2014035073870d9d8dae9152fc16fc319fd Author: David Malcolm Date: Wed Mar 19 15:03:42 2025 -0400 diagnostics: fix crash in urlifier with -Wfatal-errors [PR119366] diagnostic_context's dtor assumed that it owned the m_urlifier pointer and would delete it. As of r15-5988-g5a022062d22e0b this isn't always the case - auto_urlify_attributes is used in various places in the C/C++ frontends and in the middle-end to temporarily override the urlifier with an on-stack instance, which would lead to delete-of-on-stack-buffer crashes with -Wfatal-errors as the global_dc was cleaned up. Fix by explicitly tracking the stack of urlifiers within diagnostic_context, tracking for each node whether the pointer is owned or borrowed. gcc/ChangeLog: PR c/119366 * diagnostic-format-sarif.cc (test_message_with_embedded_link): Convert diagnostic_context from one urlifier to a stack of urlifiers, where each node in the stack tracks whether the urlifier is owned or borrowed. * diagnostic.cc (diagnostic_context::initialize): Likewise. (diagnostic_context::finish): Likewise. (diagnostic_context::set_urlifier): Delete. (diagnostic_context::push_owned_urlifier): New. (diagnostic_context::push_borrowed_urlifier): New. (diagnostic_context::pop_urlifier): New. (diagnostic_context::get_urlifier): Reimplement in terms of stack. (diagnostic_context::override_urlifier): Delete. * diagnostic.h (diagnostic_context::set_urlifier): Delete decl. (diagnostic_context::override_urlifier): Delete decl. (diagnostic_context::push_owned_urlifier): New decl. (diagnostic_context::push_borrowed_urlifier): New decl. (diagnostic_context::pop_urlifier): New decl. (diagnostic_context::get_urlifier): Make return value const; hide implementation. (diagnostic_context::m_urlifier): Replace with... (diagnostic_context::urlifier_stack_node): ... this and... (diagnostic_context::m_urlifier_stack): ...this. * gcc-urlifier.cc (auto_override_urlifier::auto_override_urlifier): Reimplement. (auto_override_urlifier::~auto_override_urlifier): Reimplement. * gcc-urlifier.h (class auto_override_urlifier): Reimplement. (auto_urlify_attributes::auto_urlify_attributes): Update for pass-by-reference. * gcc.cc (driver::global_initializations): Update for reimplementation of urlifiers in terms of a stack. * toplev.cc (general_init): Likewise. gcc/testsuite/ChangeLog: PR c/119366 * gcc.dg/Wfatal-bad-attr-pr119366.c: New test. Signed-off-by: David Malcolm Diff: --- gcc/diagnostic-format-sarif.cc | 2 +- gcc/diagnostic.cc | 57 ++--- gcc/diagnostic.h| 23 +++--- gcc/gcc-urlifier.cc | 7 ++- gcc/gcc-urlifier.h | 7 +-- gcc/gcc.cc | 2 +- gcc/testsuite/gcc.dg/Wfatal-bad-attr-pr119366.c | 8 gcc/toplev.cc | 2 +- 8 files changed, 74 insertions(+), 34 deletions(-) diff --git a/gcc/diagnostic-format-sarif.cc b/gcc/diagnostic-format-sarif.cc index 554992bddba1..8dbc91ee8f32 100644 --- a/gcc/diagnostic-format-sarif.cc +++ b/gcc/diagnostic-format-sarif.cc @@ -4365,7 +4365,7 @@ test_message_with_embedded_link (enum sarif_version version) }; test_sarif_diagnostic_context dc ("test.c", version); -dc.set_urlifier (::make_unique ()); +dc.push_owned_urlifier (::make_unique ()); rich_location richloc (line_table, UNKNOWN_LOCATION); dc.report (DK_ERROR, richloc, nullptr, 0, "foo %<-foption%> % bar"); diff --git a/gcc/diagnostic.cc b/gcc/diagnostic.cc index c2f6714c24aa..82d7f946818b 100644 --- a/gcc/diagnostic.cc +++ b/gcc/diagnostic.cc @@ -254,7 +254,7 @@ diagnostic_context::initialize (int n_opts) m_text_callbacks.m_start_span = default_diagnostic_start_span_fn; m_text_callbacks.m_end_diagnostic = default_diagnostic_text_finalizer; m_option_mgr = nullptr; - m_urlifier = nullptr; + m_urlifier_stack = new auto_vec (); m_last_location = UNKNOWN_LOCATION; m_client_aux_data = nullptr; m_lock = 0; @@ -424,8 +424,13 @@ diagnostic_context::finish () delete m_option_mgr; m_option_mgr = nullptr; - delete m_urlifier; - m_urlifier = nullptr; + if (m_urlifier_stack) +{ + while (!m_urlifier_stack->is_empty ()) + pop_urlifier (); + delete m_urlifier_stack; + m_urlifier_stack = nullptr; +} freear
[gcc r15-8472] Update gcc hr.po
https://gcc.gnu.org/g:e0ac33bf0e3b609d42b0554588df66d09e70909b commit r15-8472-ge0ac33bf0e3b609d42b0554588df66d09e70909b Author: Joseph Myers Date: Thu Mar 20 19:34:30 2025 + Update gcc hr.po * hr.po: Update. Diff: --- gcc/po/hr.po | 1173 -- 1 file changed, 484 insertions(+), 689 deletions(-) diff --git a/gcc/po/hr.po b/gcc/po/hr.po index cb166ff01353..b4d8eaa63045 100644 --- a/gcc/po/hr.po +++ b/gcc/po/hr.po @@ -1,15 +1,15 @@ # Translation of gcc to Croatian. -# Copyright (C) 2012 Free Software Foundation, Inc. +# Copyright (C) 2025 Free Software Foundation, Inc. # This file is distributed under the same license as the gcc package. # # Tomislav Krznar , 2012, 2022. -# Božidar Putanec , 2022, 2023, 2024. +# Božidar Putanec , 2022-2025. msgid "" msgstr "" -"Project-Id-Version: gcc 14.2.0\n" +"Project-Id-Version: gcc-15.1-b20250316\n" "Report-Msgid-Bugs-To: https://gcc.gnu.org/bugs/\n"; "POT-Creation-Date: 2025-03-14 22:06+\n" -"PO-Revision-Date: 2024-08-02 17:19+0200\n" +"PO-Revision-Date: 2025-03-20 12:26-0700\n" "Last-Translator: Božidar Putanec \n" "Language-Team: Croatian \n" "Language: hr\n" @@ -144,7 +144,7 @@ msgstr "fatalna greška: " #. when reporting fatal signal in the compiler. #: diagnostic.def:34 diagnostic.def:55 msgid "internal compiler error: " -msgstr "interna greška kompajlera: " +msgstr "interna greška kompilatora: " #. This one is just for counting DK_WARNING promoted to DK_ERROR #. due to -Werror and -Werror=warning. @@ -202,7 +202,7 @@ msgstr "Fatalna greška" #. when reporting fatal signal in the compiler. #: fortran/gfc-diagnostic.def:34 fortran/gfc-diagnostic.def:50 msgid "internal compiler error" -msgstr "interna greška kompajlera" +msgstr "interna greška kompilatora" #: fortran/gfc-diagnostic.def:35 msgid "Error" @@ -278,7 +278,7 @@ msgstr "-fvtable-verify=preinit nije podržan u ovoj konfiguraciji" #: gcc.cc:1283 ada/gcc-interface/lang-specs.h:37 msgid "-pg and -fomit-frame-pointer are incompatible" -msgstr "-pg i -fomit-frame-pointer su nekompatibilni" +msgstr "-pg i -fomit-frame-pokazivač su nekompatibilni" #: gcc.cc:1458 msgid "GNU C no longer supports -traditional without -E" @@ -4778,7 +4778,7 @@ msgstr "" #: analyzer/analyzer.opt:139 #, no-c-format msgid "Warn about code paths which appear to lead to an infinite loop." -msgstr "Upozori na kodne puteve koje bi mogle dovesti do beskonačnih petlji." +msgstr "Upozori na kodove puteve koje bi mogle dovesti do beskonačnih petlji." #: analyzer/analyzer.opt:143 #, no-c-format @@ -4886,10 +4886,9 @@ msgid "Warn about code paths in which an unsanitized value is used as a size." msgstr "" #: analyzer/analyzer.opt:227 -#, fuzzy, no-c-format -#| msgid "Warn about code paths which appear to lead to an infinite loop." +#, no-c-format msgid "Warn about code paths in which pointer subtraction involves undefined behavior." -msgstr "Upozori na kodne puteve koje bi mogle dovesti do beskonačnih petlji." +msgstr "Upozori na staze koda u kojima oduzimanje pokazivača može uzrokovati medfinirano ponašanje." #: analyzer/analyzer.opt:231 #, no-c-format @@ -6035,10 +6034,9 @@ msgid "-mbranch-cost=N\tSet the cost of branches to roughly N instructions." msgstr "" #: config/riscv/riscv.opt:38 -#, fuzzy, no-c-format -#| msgid "This switch is deprecated; use -Wextra instead." +#, no-c-format msgid "This option is deprecated; use -fplt or -fno-plt instead." -msgstr "taj šalter je zastario; koristite -Wextra" +msgstr "Ova opcija je zastarjela; umjesto nje koristite -fplt ili -fno-plt" #: config/riscv/riscv.opt:42 #, no-c-format @@ -7022,10 +7020,9 @@ msgid "Target the software simulator." msgstr "" #: config/ft32/ft32.opt:27 -#, fuzzy, no-c-format -#| msgid "Does nothing. Preserved for backward compatibility." +#, no-c-format msgid "Ignored, but preserved for backward compatibility." -msgstr "Ne radi ništa. Zadržano radi kompatibilnosti s ranijim inačicama." +msgstr "Zanemareno, ali je zadržano radi kompatibilnosti s starijim inačicama." #: config/ft32/ft32.opt:31 #, no-c-format @@ -8311,52 +8308,44 @@ msgid "Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, and AVX10 msgstr "" #: config/i386/i386.opt:1378 -#, fuzzy, no-c-format -#| msgid "Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX and SHA512 built-in functions and code generation." +#, no-c-format msgid "Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, AVX10.1 and AVX10.2 built-in functions and code generation." -msgstr "Podržava MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX i SHA512 ugrađene funkcije i generiranje koda." +msgstr "Podržava MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, AVX10.1 i AVX10.2 ugrađene funkcije i generiranje koda." #: config/i386/i386.opt:1383 config/i386/i386.opt:1388 -#, fuzzy, no-c-format -#| msgid "Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.
[gcc r15-8473] libgcobol: Add configure checks for iconv.
https://gcc.gnu.org/g:4f68873e0d2f590c575fb82d08da01c229ef6cb0 commit r15-8473-g4f68873e0d2f590c575fb82d08da01c229ef6cb0 Author: Iain Sandoe Date: Sun Mar 16 08:58:09 2025 + libgcobol: Add configure checks for iconv. Some targets might need to add libraries to get iconv support. libgcobol/ChangeLog: * Makefile.am: Use LIBICONV. * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * config.h.in: Regenerate. * configure: Regenerate. * configure.ac: Check for iconv support. Signed-off-by: Iain Sandoe Diff: --- libgcobol/Makefile.am | 2 +- libgcobol/Makefile.in | 8 +- libgcobol/aclocal.m4 | 4 + libgcobol/config.h.in | 6 + libgcobol/configure| 914 - libgcobol/configure.ac | 3 + 6 files changed, 933 insertions(+), 4 deletions(-) diff --git a/libgcobol/Makefile.am b/libgcobol/Makefile.am index eddf209807e6..888cbf2b0b04 100644 --- a/libgcobol/Makefile.am +++ b/libgcobol/Makefile.am @@ -48,7 +48,7 @@ libgcobol_la_LINK = $(LIBTOOL) --mode=link --tag=CXX $(CXX) \ -Wc,-shared-libgcc \ -version-info $(LIBGCOBOL_VERSION) \ -lstdc++\ - $(LTLDFLAGS) + $(LTLDFLAGS) $(LTLIBICONV) WARN_CFLAGS = -W -Wall -Wwrite-strings diff --git a/libgcobol/Makefile.in b/libgcobol/Makefile.in index a6096d2a64aa..1a1e2ee39eb0 100644 --- a/libgcobol/Makefile.in +++ b/libgcobol/Makefile.in @@ -113,7 +113,11 @@ target_triplet = @target@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \ + $(top_srcdir)/../config/iconv.m4 \ $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/lib-ld.m4 \ + $(top_srcdir)/../config/lib-link.m4 \ + $(top_srcdir)/../config/lib-prefix.m4 \ $(top_srcdir)/../config/multi.m4 \ $(top_srcdir)/../config/override.m4 \ $(top_srcdir)/../config/toolexeclibdir.m4 \ @@ -300,11 +304,13 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGCOBOL_VERSION = @LIBGCOBOL_VERSION@ +LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ @@ -422,7 +428,7 @@ libgcobol_la_LINK = $(LIBTOOL) --mode=link --tag=CXX $(CXX) \ -Wc,-shared-libgcc \ -version-info $(LIBGCOBOL_VERSION) \ -lstdc++\ - $(LTLDFLAGS) + $(LTLDFLAGS) $(LTLIBICONV) WARN_CFLAGS = -W -Wall -Wwrite-strings diff --git a/libgcobol/aclocal.m4 b/libgcobol/aclocal.m4 index 1d5125ec2f0f..25c8b71df870 100644 --- a/libgcobol/aclocal.m4 +++ b/libgcobol/aclocal.m4 @@ -1188,7 +1188,11 @@ AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([../config/depstand.m4]) +m4_include([../config/iconv.m4]) m4_include([../config/lead-dot.m4]) +m4_include([../config/lib-ld.m4]) +m4_include([../config/lib-link.m4]) +m4_include([../config/lib-prefix.m4]) m4_include([../config/multi.m4]) m4_include([../config/override.m4]) m4_include([../config/toolexeclibdir.m4]) diff --git a/libgcobol/config.h.in b/libgcobol/config.h.in index 39b20448078a..a7e5675c43c8 100644 --- a/libgcobol/config.h.in +++ b/libgcobol/config.h.in @@ -6,6 +6,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H +/* Define if you have the iconv() function and it works. */ +#undef HAVE_ICONV + /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H @@ -36,6 +39,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H +/* Define as const if the declaration of iconv() needs const. */ +#undef ICONV_CONST + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR diff --git a/libgcobol/configure b/libgcobol/configure index 73433ebb13de..1db4e792e030 100755 --- a/libgcobol/configure +++ b/libgcobol/configure @@ -634,6 +634,8 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +LTLIBICONV +LIBICONV extra_darwin_ldflags_libgcobol VERSION_SUFFIX LIBGCOBOL_VERSION @@ -804,6 +806,9 @@ enable_fast_install with_gnu_ld enable_libtool_lock enable_darwin_at_rpath +enable_rpath +with_libiconv_prefix +with_libiconv_type ' ac_precious_vars='build_alias host_alias @@ -1456,6 +1461,7 @@ Optional Features: --enable-darwin-at-rpath install libraries with @rpath/library-name, requires rpaths to be added to executables + --disable-rpath do not hardcode runtime library paths Optional Packages: --with-PACKAGE[=ARG]use PACK
[gcc r15-8478] combine: Add REG_DEAD notes to the last instruction after a split [PR118914]
https://gcc.gnu.org/g:e8a5f747cfa9c79ab7d95ff95d17d3e31afede50 commit r15-8478-ge8a5f747cfa9c79ab7d95ff95d17d3e31afede50 Author: Andrew Pinski Date: Wed Feb 19 16:10:31 2025 -0800 combine: Add REG_DEAD notes to the last instruction after a split [PR118914] So gcc.target/aarch64/rev16_2.c started to fail after r15-268-g9dbff9c05520a7, the problem is combine now rejects the instruction combine. This happens because after a different combine which uses a define_split and that define_split creates a new pseudo register. That new pseudo register is dead after the last instruction in the stream BUT combine never creates a REG_DEAD for it. So combine thinks it is still needed after and now with the i2 not changing, combine rejects the combine. Now combine should be creating a REG_DEAD for the new pseudo registers for the last instruction of the split. This fixes rev16_2.c and also improves the situtation in other cases by removing other dead instructions. Bootstrapped and tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ChangeLog: PR rtl-optimization/118914 * combine.cc (recog_for_combine): Add old_nregs and new_nregs argument (defaulting to 0). Update call to recog_for_combine_1. (combine_split_insns): Add old_nregs and new_nregs arguments, store the old and new max registers to them. (try_combine): Update calls to combine_split_insns and pass old_nregs and new_nregs for the i3 call to recog_for_combine. (find_split_point): Update call to combine_split_insns; ignoring the values there. (recog_for_combine_1): Add old_nregs and new_nregs arguments, if the insn was recognized (and not to no-op move), add the REG_DEAD notes to pnotes argument. Signed-off-by: Andrew Pinski Diff: --- gcc/combine.cc | 46 +++--- 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/gcc/combine.cc b/gcc/combine.cc index 1b2bd34748ec..ef13f5d5e900 100644 --- a/gcc/combine.cc +++ b/gcc/combine.cc @@ -454,7 +454,7 @@ static bool merge_outer_ops (enum rtx_code *, HOST_WIDE_INT *, enum rtx_code, static rtx simplify_shift_const_1 (enum rtx_code, machine_mode, rtx, int); static rtx simplify_shift_const (rtx, enum rtx_code, machine_mode, rtx, int); -static int recog_for_combine (rtx *, rtx_insn *, rtx *); +static int recog_for_combine (rtx *, rtx_insn *, rtx *, unsigned = 0, unsigned = 0); static rtx gen_lowpart_for_combine (machine_mode, rtx); static enum rtx_code simplify_compare_const (enum rtx_code, machine_mode, rtx *, rtx *); @@ -515,18 +515,22 @@ target_canonicalize_comparison (enum rtx_code *code, rtx *op0, rtx *op1, /* Try to split PATTERN found in INSN. This returns NULL_RTX if PATTERN cannot be split. Otherwise, it returns an insn sequence. + Updates OLD_NREGS with the max number of regs before the split + and NEW_NREGS after the split. This is a wrapper around split_insns which ensures that the reg_stat vector is made larger if the splitter creates a new register. */ static rtx_insn * -combine_split_insns (rtx pattern, rtx_insn *insn) +combine_split_insns (rtx pattern, rtx_insn *insn, +unsigned int *old_nregs, +unsigned int *new_regs) { rtx_insn *ret; unsigned int nregs; - + *old_nregs = max_reg_num (); ret = split_insns (pattern, insn); - nregs = max_reg_num (); + *new_regs = nregs = max_reg_num (); if (nregs > reg_stat.length ()) reg_stat.safe_grow_cleared (nregs, true); return ret; @@ -3566,12 +3570,13 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0, { rtx parallel, *split; rtx_insn *m_split_insn; + unsigned int old_nregs, new_nregs; /* See if the MD file can split NEWPAT. If it can't, see if letting it use I2DEST as a scratch register will help. In the latter case, convert I2DEST to the mode of the source of NEWPAT if we can. */ - m_split_insn = combine_split_insns (newpat, i3); + m_split_insn = combine_split_insns (newpat, i3, &old_nregs, &new_nregs); /* We can only use I2DEST as a scratch reg if it doesn't overlap any inputs of NEWPAT. */ @@ -3599,7 +3604,7 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0, gen_rtvec (2, newpat, gen_rtx_CLOBBER (VOIDmode, i2dest))); - m_split_insn = combine_split_insns (parallel, i3); + m_split_insn = combine_split_insns (parallel, i3, &old_nregs, &new_nregs); /* If that didn't work, try changing the mode of I2DEST if
[gcc r15-8476] modula2: Defend against no ENOTBLK definition
https://gcc.gnu.org/g:53dcff73dab134be596036e6bdd35e7b9d7a302b commit r15-8476-g53dcff73dab134be596036e6bdd35e7b9d7a302b Author: Gaius Mulley Date: Thu Mar 20 22:23:38 2025 + modula2: Defend against no ENOTBLK definition This patch defends against no ENOTBLK definition. libgm2/ChangeLog: * libm2iso/ErrnoCategory.cc (IsErrnoHard): Defend against lack of ENOTBLK. (UnAvailable): Ditto. (GetOpenResults): Ditto. Signed-off-by: Gaius Mulley Diff: --- libgm2/libm2iso/ErrnoCategory.cc | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libgm2/libm2iso/ErrnoCategory.cc b/libgm2/libm2iso/ErrnoCategory.cc index 053c75bb11ab..d1dcb155452f 100644 --- a/libgm2/libm2iso/ErrnoCategory.cc +++ b/libgm2/libm2iso/ErrnoCategory.cc @@ -50,7 +50,10 @@ EXPORT(IsErrnoHard) (int e) { #if defined(HAVE_ERRNO_H) || defined(HAVE_SYS_ERRNO_H) return ((e == EPERM) || (e == ENOENT) || (e == EIO) || (e == ENXIO) - || (e == EACCES) || (e == ENOTBLK) || (e == ENODEV) || (e == EINVAL) + || (e == EACCES) || (e == ENODEV) || (e == EINVAL) +#ifdef ENOTBLK + || (e == ENOTBLK) +#endif || (e == ENFILE) || (e == EROFS) || (e == EMLINK)); #else return false; @@ -79,7 +82,10 @@ EXPORT(UnAvailable) (int e) { #if defined(HAVE_ERRNO_H) || defined(HAVE_SYS_ERRNO_H) return ((e == ENOENT) || (e == ESRCH) || (e == ENXIO) || (e == ECHILD) - || (e == ENOTBLK) || (e == ENODEV) || (e == ENOTDIR)); +#ifdef ENOTBLK + || (e == ENOTBLK) +#endif + || (e == ENODEV) || (e == ENOTDIR)); #else return false; #endif @@ -108,9 +114,11 @@ EXPORT(GetOpenResults) (int e) case EACCES: return wrongPermissions; break; +#ifdef ENOTBLK case ENOTBLK: return wrongFileType; break; +#endif case EEXIST: return fileExists; break;
[gcc r15-8470] Update cpplib de.po
https://gcc.gnu.org/g:8b13fc68a10fc57ed5d995c55b0a79e0141e6b81 commit r15-8470-g8b13fc68a10fc57ed5d995c55b0a79e0141e6b81 Author: Joseph Myers Date: Thu Mar 20 17:30:54 2025 + Update cpplib de.po * de.po: Update. Diff: --- libcpp/po/de.po | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/libcpp/po/de.po b/libcpp/po/de.po index 9914e5723b25..72a33dec9e5b 100644 --- a/libcpp/po/de.po +++ b/libcpp/po/de.po @@ -9,10 +9,10 @@ # msgid "" msgstr "" -"Project-Id-Version: cpplib 15-b20250216\n" +"Project-Id-Version: cpplib 15.1-b20250316\n" "Report-Msgid-Bugs-To: https://gcc.gnu.org/bugs/\n"; "POT-Creation-Date: 2025-03-14 22:05+\n" -"PO-Revision-Date: 2025-03-10 22:32+0100\n" +"PO-Revision-Date: 2025-03-20 07:49+0100\n" "Last-Translator: Roland Illig \n" "Language-Team: German \n" "Language: de\n" @@ -211,10 +211,8 @@ msgstr "%<\\x{%> ohne dazugehöriges %<}%> nach %.*s" msgid "hex escape sequence out of range" msgstr "Hex-Escape-Sequenz außerhalb des Wertebereiches" -# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119202 #: charset.cc:2247 -#, fuzzy, gcc-internal-format -#| msgid "%<\\o%> not followed by %<}%>" +#, gcc-internal-format msgid "%<\\o%> not followed by %<{%>" msgstr "%<\\o%> ohne folgendes %<{%>" @@ -467,16 +465,14 @@ msgid "%<#embed%> not supported in traditional C" msgstr "%<#embed%> wird in traditionellem C nicht unterstützt" #: directives.cc:1370 -#, fuzzy, gcc-internal-format -#| msgid "%<#%s%> before C++23 is a GCC extension" +#, gcc-internal-format msgid "%<#%s%> before C++26 is a GCC extension" -msgstr "%<#%s%> vor C++23 ist eine GCC-Erweiterung" +msgstr "%<#%s%> vor C++26 ist eine GCC-Erweiterung" #: directives.cc:1379 -#, fuzzy, gcc-internal-format -#| msgid "%<#%s%> is a GCC extension" +#, gcc-internal-format msgid "%<#%s%> is a C23 feature" -msgstr "%<#%s%> ist eine GCC-Erweiterung" +msgstr "%<#%s%> ist ein C23-Feature" #: directives.cc:1436 #, gcc-internal-format
[gcc r15-8466] libstdc++: Add from_range_t constructors to debug ordered containers
https://gcc.gnu.org/g:f3253bd7bd49e54fe56cfb7e41fed4d8183803de commit r15-8466-gf3253bd7bd49e54fe56cfb7e41fed4d8183803de Author: Jonathan Wakely Date: Wed Mar 19 22:22:56 2025 + libstdc++: Add from_range_t constructors to debug ordered containers libstdc++-v3/ChangeLog: * include/debug/map.h (map): Add from_range constructors and deduction guides. * include/debug/multimap.h (multimap): Likewise. * include/debug/multiset.h (multiset): Likewise. * include/debug/set.h (set): Likewise. Reviewed-by: Tomasz Kamiński Diff: --- libstdc++-v3/include/debug/map.h | 36 +++ libstdc++-v3/include/debug/multimap.h | 36 +++ libstdc++-v3/include/debug/multiset.h | 30 + libstdc++-v3/include/debug/set.h | 32 ++- 4 files changed, 133 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/include/debug/map.h b/libstdc++-v3/include/debug/map.h index a9fac790b1c8..aa1c1dbd47aa 100644 --- a/libstdc++-v3/include/debug/map.h +++ b/libstdc++-v3/include/debug/map.h @@ -133,6 +133,25 @@ namespace __debug __gnu_debug::__base(__last), __a) { } +#if __glibcxx_ranges_to_container // C++ >= 23 + /** + * @brief Construct a map from a range. + * @since C++23 + */ + template _Rg> + map(std::from_range_t __t, _Rg&& __rg, + const _Compare& __c, + const allocator_type& __a = allocator_type()) + : _Base(__t, std::forward<_Rg>(__rg), __c, __a) + { } + + template _Rg> + map(std::from_range_t __t, _Rg&& __rg, + const allocator_type& __a = allocator_type()) + : _Base(__t, std::forward<_Rg>(__rg), __a) + { } +#endif + ~map() = default; #endif @@ -740,6 +759,23 @@ namespace __debug map(initializer_list>, _Allocator) -> map<_Key, _Tp, less<_Key>, _Allocator>; +#if __glibcxx_ranges_to_container // C++ >= 23 + template>, + __allocator_like _Alloc = + std::allocator<__detail::__range_to_alloc_type<_Rg>>> +map(from_range_t, _Rg&&, _Compare = _Compare(), _Alloc = _Alloc()) + -> map<__detail::__range_key_type<_Rg>, +__detail::__range_mapped_type<_Rg>, +_Compare, _Alloc>; + + template +map(from_range_t, _Rg&&, _Alloc) + -> map<__detail::__range_key_type<_Rg>, +__detail::__range_mapped_type<_Rg>, +less<__detail::__range_key_type<_Rg>>, +_Alloc>; +#endif #endif // deduction guides template= 23 + /** + * @brief Construct a multimap from a range. + * @since C++23 + */ + template _Rg> + multimap(std::from_range_t __t, _Rg&& __rg, +const _Compare& __c, +const allocator_type& __a = allocator_type()) + : _Base(__t, std::forward<_Rg>(__rg), __c, __a) + { } + + template _Rg> + multimap(std::from_range_t __t, _Rg&& __rg, +const allocator_type& __a = allocator_type()) + : _Base(__t, std::forward<_Rg>(__rg), __a) + { } +#endif + ~multimap() = default; #endif @@ -622,6 +641,23 @@ namespace __debug multimap(initializer_list>, _Allocator) -> multimap<_Key, _Tp, less<_Key>, _Allocator>; +#if __glibcxx_ranges_to_container // C++ >= 23 + template>, + __allocator_like _Alloc = + std::allocator<__detail::__range_to_alloc_type<_Rg>>> +multimap(from_range_t, _Rg&&, _Compare = _Compare(), _Alloc = _Alloc()) + -> multimap<__detail::__range_key_type<_Rg>, + __detail::__range_mapped_type<_Rg>, + _Compare, _Alloc>; + + template +multimap(from_range_t, _Rg&&, _Alloc) + -> multimap<__detail::__range_key_type<_Rg>, + __detail::__range_mapped_type<_Rg>, + less<__detail::__range_key_type<_Rg>>, + _Alloc>; +#endif #endif template= 23 + /** + * @brief Construct a multiset from a range. + * @since C++23 + */ + template _Rg> + multiset(std::from_range_t __t, _Rg&& __rg, +const _Compare& __c, +const allocator_type& __a = allocator_type()) + : _Base(__t, std::forward<_Rg>(__rg), __c, __a) + { } + + template _Rg> + multiset(std::from_range_t __t, _Rg&& __rg, +const allocator_type& __a = allocator_type()) + : _Base(__t, std::forward<_Rg>(__rg), __a) + { } +#endif + ~multiset() = default; #endif @@ -594,6 +613,17 @@ namespace __debug multiset(initializer_list<_Key>, _Allocator) -> multiset<_Key, less<_Key>, _Allocator>; +#if __glibcxx_ranges_to_container // C++ >= 23 + template>, + __allocator_like _Alloc = std::allocator>> +multiset(from_range_t, _Rg&&, _Compare = _Compare(), _Alloc = _Alloc()) + -> multise
[gcc r15-8465] libstdc++: Fix comment typo
https://gcc.gnu.org/g:d458020e19b686e0d46320e7d26fa876c19965a0 commit r15-8465-gd458020e19b686e0d46320e7d26fa876c19965a0 Author: Jakub Jelinek Date: Thu Mar 20 10:36:29 2025 +0100 libstdc++: Fix comment typo Another IEE typo. 2025-03-20 Jakub Jelinek * testsuite/18_support/numeric_limits/traps.cc (main): Fix comment typo. Diff: --- libstdc++-v3/testsuite/18_support/numeric_limits/traps.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libstdc++-v3/testsuite/18_support/numeric_limits/traps.cc b/libstdc++-v3/testsuite/18_support/numeric_limits/traps.cc index ecfbdeb02da8..4963b90e6d9a 100644 --- a/libstdc++-v3/testsuite/18_support/numeric_limits/traps.cc +++ b/libstdc++-v3/testsuite/18_support/numeric_limits/traps.cc @@ -48,7 +48,7 @@ int main() For floating points, trapping is a different, more complicated story. If is_iecxxx is true, then division by zero would not trap (infinity). If is_iecxxx is false, we don't know (VAX may trap for -0/0 -- I have to check). For most cases (i.e. IEE-754), trapping +0/0 -- I have to check). For most cases (i.e. IEEE-754), trapping for floating points have to do with whether there is a support for signaling NaN. - Gaby.
[gcc r15-8463] i386: Fix AVX10.2 SAT CVT testcases.
https://gcc.gnu.org/g:8d236c53c679ca920092ce9200785fcccd97d971 commit r15-8463-g8d236c53c679ca920092ce9200785fcccd97d971 Author: Hu, Lin1 Date: Thu Mar 20 11:55:49 2025 +0800 i386: Fix AVX10.2 SAT CVT testcases. Init res_ref2 for rounding control intrinsics. gcc/testsuite/ChangeLog: * gcc.target/i386/avx10_2-512-vcvtph2ibs-2.c: Fix testcase. * gcc.target/i386/avx10_2-512-vcvtph2iubs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvtps2ibs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvtps2iubs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttpd2dqs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttpd2qqs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttpd2udqs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttpd2uqqs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttph2ibs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttps2dqs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttps2ibs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttps2iubs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttps2qqs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttps2udqs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttps2uqqs-2.c: Ditto. Diff: --- .../gcc.target/i386/avx10_2-512-vcvtph2ibs-2.c | 17 +++-- .../gcc.target/i386/avx10_2-512-vcvtph2iubs-2.c | 17 +++-- .../gcc.target/i386/avx10_2-512-vcvtps2ibs-2.c | 17 +++-- .../gcc.target/i386/avx10_2-512-vcvtps2iubs-2.c | 17 +++-- .../gcc.target/i386/avx10_2-512-vcvttpd2dqs-2.c | 17 +++-- .../gcc.target/i386/avx10_2-512-vcvttpd2qqs-2.c | 17 +++-- .../gcc.target/i386/avx10_2-512-vcvttpd2udqs-2.c| 17 +++-- .../gcc.target/i386/avx10_2-512-vcvttpd2uqqs-2.c| 17 +++-- .../gcc.target/i386/avx10_2-512-vcvttph2ibs-2.c | 17 +++-- .../gcc.target/i386/avx10_2-512-vcvttps2dqs-2.c | 17 +++-- .../gcc.target/i386/avx10_2-512-vcvttps2ibs-2.c | 17 +++-- .../gcc.target/i386/avx10_2-512-vcvttps2iubs-2.c| 17 +++-- .../gcc.target/i386/avx10_2-512-vcvttps2qqs-2.c | 17 +++-- .../gcc.target/i386/avx10_2-512-vcvttps2udqs-2.c| 17 +++-- .../gcc.target/i386/avx10_2-512-vcvttps2uqqs-2.c| 17 +++-- 15 files changed, 165 insertions(+), 90 deletions(-) diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2ibs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2ibs-2.c index 0c860b02046f..523b3f0a4cb6 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2ibs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2ibs-2.c @@ -9,6 +9,7 @@ #endif #include "avx10-helper.h" #include +#include #define SIZE (AVX512F_LEN / 16) #include "avx512f-mask-type.h" @@ -37,7 +38,7 @@ TEST (void) UNION_TYPE (AVX512F_LEN, h) s; UNION_TYPE (AVX512F_LEN, i_w) res1, res2, res3; MASK_TYPE mask = MASK_VALUE; - short res_ref[SIZE] = { 0 }; + short res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; int i, sign = 1; for (i = 0; i < SIZE; i++) @@ -54,6 +55,7 @@ TEST (void) res3.x = INTRINSIC (_maskz_ipcvts_ph_epi8) (mask, s.x); CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref)) abort (); @@ -67,19 +69,22 @@ TEST (void) abort (); #if AVX512F_LEN != 128 + for (i = 0; i < SIZE; i++) +res2.a[i] = DEFAULT_VALUE; + res1.x = INTRINSIC (_ipcvts_roundph_epi8) (s.x, 8); res2.x = INTRINSIC (_mask_ipcvts_roundph_epi8) (res2.x, mask, s.x, 8); res3.x = INTRINSIC (_maskz_ipcvts_roundph_epi8) (mask, s.x, 8); - if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref)) + if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref2)) abort (); - MASK_MERGE (i_w) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref)) + MASK_MERGE (i_w) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref2)) abort (); - MASK_ZERO (i_w) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref)) + MASK_ZERO (i_w) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref2)) abort (); #endif } diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2iubs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2iubs-2.c index 75e4e1141be8..a8f6e57d46ab 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2iubs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2iubs-2.c @@ -9,6 +9,7 @@ #endif #include "avx10-helper.h" #include +#include #define SIZE (AVX512F_LEN / 16) #include "avx512f-mask-type.h" @@ -37,7 +38,7 @@ TEST (void) UNION_TYPE (AVX512F_LEN, h) s; UNION_TYPE (AVX512F_LEN, i_w) res1, res2, res3; MA
[gcc r15-8464] Make function_decl_type a scoped enum
https://gcc.gnu.org/g:56145ae79b89b823f306c2c241f6a1fe5d604816 commit r15-8464-g56145ae79b89b823f306c2c241f6a1fe5d604816 Author: Richard Biener Date: Wed Mar 19 15:02:23 2025 +0100 Make function_decl_type a scoped enum The enum currently has a member named NONE which pollutes the global namespace unnecessarily. Use a scoped enum instead. gcc/ * tree-core.h (function_decl_type): Make a scoped enum. * tree.h (set_function_decl_type): Adjust. (DECL_IS_OPERATOR_NEW_P): Likewise. (DECL_SET_IS_OPERATOR_NEW): Likewise. (DECL_IS_OPERATOR_DELETE_P): Likewise. (DECL_SET_IS_OPERATOR_DELETE): Likewise. (DECL_LAMBDA_FUNCTION_P): Likewise. (DECL_SET_LAMBDA_FUNCTION): Likewise. * lto-streamer-out.cc (hash_tree): Hash all of FUNCTION_DECL_DECL_TYPE. * tree-streamer-out.cc (pack_ts_function_decl_value_fields): Adjust. * config/aarch64/aarch64-simd-pragma-builtins.def (vcombine_mf8): Use literal zero instead of NONE. gcc/cp/ * module.cc (trees_out::core_bools): Convert scoped enum explicitly. Diff: --- .../aarch64/aarch64-simd-pragma-builtins.def | 2 +- gcc/cp/module.cc | 2 +- gcc/lto-streamer-out.cc| 2 +- gcc/tree-core.h| 2 +- gcc/tree-streamer-out.cc | 2 +- gcc/tree.h | 22 ++ 6 files changed, 19 insertions(+), 13 deletions(-) diff --git a/gcc/config/aarch64/aarch64-simd-pragma-builtins.def b/gcc/config/aarch64/aarch64-simd-pragma-builtins.def index 2c0dc11b0553..776823651031 100644 --- a/gcc/config/aarch64/aarch64-simd-pragma-builtins.def +++ b/gcc/config/aarch64/aarch64-simd-pragma-builtins.def @@ -203,7 +203,7 @@ ENTRY_TERNARY (vbslq_mf8, mf8q, u8q, mf8q, mf8q, UNSPEC_BSL, QUIET) #undef REQUIRED_EXTENSIONS // combine -#define REQUIRED_EXTENSIONS nonstreaming_only (NONE) +#define REQUIRED_EXTENSIONS nonstreaming_only (0) ENTRY_BINARY (vcombine_mf8, mf8q, mf8, mf8, UNSPEC_COMBINE, QUIET) #undef REQUIRED_EXTENSIONS diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc index 0d9e50bba7f9..beceafe05f6b 100644 --- a/gcc/cp/module.cc +++ b/gcc/cp/module.cc @@ -5757,7 +5757,7 @@ trees_out::core_bools (tree t, bits_out& bits) WB (t->function_decl.replaceable_operator); /* decl_type is a (misnamed) 2 bit discriminator. */ - unsigned kind = t->function_decl.decl_type; + unsigned kind = (unsigned)t->function_decl.decl_type; WB ((kind >> 0) & 1); WB ((kind >> 1) & 1); } diff --git a/gcc/lto-streamer-out.cc b/gcc/lto-streamer-out.cc index 96eb79b22897..d5b6ee74d573 100644 --- a/gcc/lto-streamer-out.cc +++ b/gcc/lto-streamer-out.cc @@ -1333,7 +1333,7 @@ hash_tree (struct streamer_tree_cache_d *cache, hash_map *map, hstate.add_int (DECL_BUILT_IN_CLASS (t)); hstate.add_flag (DECL_STATIC_CONSTRUCTOR (t)); hstate.add_flag (DECL_STATIC_DESTRUCTOR (t)); - hstate.add_flag (FUNCTION_DECL_DECL_TYPE (t)); + hstate.add_int ((unsigned)FUNCTION_DECL_DECL_TYPE (t)); hstate.add_flag (DECL_UNINLINABLE (t)); hstate.add_flag (DECL_POSSIBLY_INLINED (t)); hstate.add_flag (DECL_IS_NOVOPS (t)); diff --git a/gcc/tree-core.h b/gcc/tree-core.h index 6e76d2bdb80c..bd19c99d3262 100644 --- a/gcc/tree-core.h +++ b/gcc/tree-core.h @@ -2023,7 +2023,7 @@ struct GTY(()) tree_decl_non_common { /* Classify a special function declaration type. */ -enum function_decl_type +enum class function_decl_type : unsigned { NONE, OPERATOR_NEW, diff --git a/gcc/tree-streamer-out.cc b/gcc/tree-streamer-out.cc index 0b61422c5416..34227259b8aa 100644 --- a/gcc/tree-streamer-out.cc +++ b/gcc/tree-streamer-out.cc @@ -306,7 +306,7 @@ pack_ts_function_decl_value_fields (struct bitpack_d *bp, tree expr) bp_pack_value (bp, DECL_IS_NOVOPS (expr), 1); bp_pack_value (bp, DECL_IS_RETURNS_TWICE (expr), 1); bp_pack_value (bp, DECL_IS_MALLOC (expr), 1); - bp_pack_value (bp, FUNCTION_DECL_DECL_TYPE (expr), 2); + bp_pack_value (bp, (unsigned)FUNCTION_DECL_DECL_TYPE (expr), 2); bp_pack_value (bp, DECL_IS_OPERATOR_DELETE_P (expr), 1); bp_pack_value (bp, DECL_DECLARED_INLINE_P (expr), 1); bp_pack_value (bp, DECL_STATIC_CHAIN (expr), 1); diff --git a/gcc/tree.h b/gcc/tree.h index 6f45359f103d..55f97f9f9994 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -3424,12 +3424,12 @@ set_function_decl_type (tree decl, function_decl_type t, bool set) { if (set) { - gcc_assert (FUNCTION_DECL_DECL_TYPE (decl) == NONE + gcc_assert (FUNCTION_DECL_DECL_TYPE (decl) == function_decl_type::NONE || FUNCTION_DECL_DECL_TYPE (decl) == t); FUNCTION_DECL_DECL_TYPE (decl) = t; } else if (FUNCTION_DECL_DECL_TY
[gcc r15-8462] openmp: Fix up cloning of dynamic C++ initializers for OpenMP target [PR119370]
https://gcc.gnu.org/g:e0b3eeb67f6d3bfe95591d8fb0c7dfd3f1b3b4ef commit r15-8462-ge0b3eeb67f6d3bfe95591d8fb0c7dfd3f1b3b4ef Author: Jakub Jelinek Date: Thu Mar 20 09:06:17 2025 +0100 openmp: Fix up cloning of dynamic C++ initializers for OpenMP target [PR119370] The following testcase ICEs, because we emit the dynamic initialization twice, once for host and once for target initialization, and although we use copy_tree_body_r to unshare it, e.g. for the array initializers it can contain TARGET_EXPRs with local temporaries (or local temporaries alone). Now, these temporaries were created when current_function_decl was NULL, they are outside of any particular function, so they have DECL_CONTEXT NULL. That is normally fine, gimple_add_tmp_var will set DECL_CONTEXT for them later on to the host __static_init* function into which they are gimplified. The problem is that the copy_tree_body_r cloning happens before that (and has to, gimplification is destructive and so we couldn't gimplify the same tree again in __omp_static_init* function) and uses auto_var_in_fn_p to see what needs to be remapped. But that means it doesn't remap temporaries with NULL DECL_CONTEXT and having the same temporaries in two different functions results in ICEs (sure, one can e.g. use parent function's temporaries in a nested function). The following patch just arranges to set DECL_CONTEXT on the temporaries to the host dynamic initialization function, so that they get remapped. If gimplification cared whether DECL_CONTEXT is NULL or not, we could remember those that we've changed in a vector and undo it afterwards, but seems it doesn't really care. 2025-03-20 Jakub Jelinek PR c++/119370 * decl2.cc (set_context_for_auto_vars_r): New function. (emit_partial_init_fini_fn): Call walk_tree with that function on &init before walk_tree with copy_tree_body_r. * g++.dg/gomp/pr119370.C: New test. Diff: --- gcc/cp/decl2.cc | 18 ++ gcc/testsuite/g++.dg/gomp/pr119370.C | 10 ++ 2 files changed, 28 insertions(+) diff --git a/gcc/cp/decl2.cc b/gcc/cp/decl2.cc index a3149f266030..4987987daed7 100644 --- a/gcc/cp/decl2.cc +++ b/gcc/cp/decl2.cc @@ -4603,6 +4603,23 @@ decomp_finalize_var_list (tree sl, int save_stmts_are_full_exprs_p) } } +/* Helper for emit_partial_init_fini_fn OpenMP target handling, called via + walk_tree. Set DECL_CONTEXT on any automatic temporaries which still + have it NULL to id->src_fn, so that later copy_tree_body_r can remap those. + Otherwise DECL_CONTEXT would be set only during gimplification of the host + fn and when copy_tree_body_r doesn't remap those, we'd ICE during the + target fn gimplification because the same automatic VAR_DECL can't be + used in multiple functions (with the exception of nested functions). */ + +static tree +set_context_for_auto_vars_r (tree *tp, int *, void *data) +{ + copy_body_data *id = (copy_body_data *) data; + if (auto_var_in_fn_p (*tp, NULL_TREE) && DECL_ARTIFICIAL (*tp)) +DECL_CONTEXT (*tp) = id->src_fn; + return NULL_TREE; +} + /* Generate code to do the initialization or destruction of the decls in VARS, a TREE_LIST of VAR_DECL with static storage duration. Whether initialization or destruction is performed is specified by INITP. */ @@ -4661,6 +4678,7 @@ emit_partial_init_fini_fn (bool initp, unsigned priority, tree vars, id.transform_new_cfg = true; id.transform_return_to_modify = false; id.eh_lp_nr = 0; + walk_tree (&init, set_context_for_auto_vars_r, &id, NULL); walk_tree (&init, copy_tree_body_r, &id, NULL); } /* Do one initialization or destruction. */ diff --git a/gcc/testsuite/g++.dg/gomp/pr119370.C b/gcc/testsuite/g++.dg/gomp/pr119370.C new file mode 100644 index ..9ecc9b73db84 --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/pr119370.C @@ -0,0 +1,10 @@ +// PR c++/119370 +// { dg-do compile } + +#pragma omp declare target +struct S { + int s; + S () : s (0) {} +}; +S a[2]; +#pragma omp end declare target
[gcc r15-8469] Revert "s390: Deprecate ESA/390 support"
https://gcc.gnu.org/g:81166d54ca1b3a21bad387a862a87be9c389ac92 commit r15-8469-g81166d54ca1b3a21bad387a862a87be9c389ac92 Author: Stefan Schulze Frielinghaus Date: Thu Mar 20 16:48:24 2025 +0100 Revert "s390: Deprecate ESA/390 support" The intention of -m31 -mesa and -m31 -mzarch was that they are (ABI) compatible which is almost true except as it turns out they are not for attribute mode(word). After doing some archaeology and digging out an over 18 year old thread [1,2] which is about this very attribute, I come to the conclusion to revert this patch. The intention by deprecating and eventually removing ESA/390 support was to prepare for a future removal of -m31; though in smaller steps. Thus, instead of introducing some potential hick ups along the route, I will revert this patch and will revisit this topic when time for -m31 in its entirety has come---independent of -mesa/-mzarch. [1] https://gcc.gnu.org/pipermail/gcc-patches/2006-September/200465.html [2] https://gcc.gnu.org/pipermail/gcc-patches/2006-October/201154.html This reverts commit 3b1bd1fdcd241dd1e5b706b6937400d74ca43146. Diff: --- gcc/config.gcc| 6 +- gcc/config/s390/s390.cc | 7 ++- gcc/config/s390/s390.h| 2 +- gcc/config/s390/s390.opt | 2 +- gcc/doc/invoke.texi | 6 +- gcc/testsuite/gcc.target/s390/20020926-1.c| 1 - gcc/testsuite/gcc.target/s390/dwarfregtable-1.c | 1 - gcc/testsuite/gcc.target/s390/fp2int1.c | 1 - gcc/testsuite/gcc.target/s390/pr10.c | 1 - gcc/testsuite/gcc.target/s390/pr106355-3.c| 1 - gcc/testsuite/gcc.target/s390/pr61078.c | 1 - gcc/testsuite/gcc.target/s390/target-attribute/tattr-m31-10.c | 1 - gcc/testsuite/gcc.target/s390/target-attribute/tattr-m31-12.c | 1 - gcc/testsuite/gcc.target/s390/target-attribute/tattr-m31-14.c | 1 - gcc/testsuite/gcc.target/s390/target-attribute/tattr-m31-18.c | 1 - gcc/testsuite/gcc.target/s390/target-attribute/tattr-m31-2.c | 1 - gcc/testsuite/gcc.target/s390/target-attribute/tattr-m31-20.c | 1 - gcc/testsuite/gcc.target/s390/target-attribute/tattr-m31-22.c | 1 - gcc/testsuite/gcc.target/s390/target-attribute/tattr-m31-24.c | 1 - gcc/testsuite/gcc.target/s390/target-attribute/tattr-m31-26.c | 1 - gcc/testsuite/gcc.target/s390/target-attribute/tattr-m31-28.c | 1 - gcc/testsuite/gcc.target/s390/target-attribute/tattr-m31-30.c | 1 - gcc/testsuite/gcc.target/s390/target-attribute/tattr-m31-32.c | 1 - gcc/testsuite/gcc.target/s390/target-attribute/tattr-m31-4.c | 1 - gcc/testsuite/gcc.target/s390/target-attribute/tattr-m31-6.c | 1 - gcc/testsuite/gcc.target/s390/target-attribute/tattr-m31-8.c | 1 - 26 files changed, 10 insertions(+), 34 deletions(-) diff --git a/gcc/config.gcc b/gcc/config.gcc index c4816e26f82f..a518e976b82e 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -5768,13 +5768,9 @@ case "${target}" in done case ${with_mode} in - "" | zarch) + "" | esa | zarch) # OK ;; - esa) - echo "Support for ESA/390 is deprecated; use z/Architecture instead." 1>&2 - exit 1 - ;; *) echo "Unknown architecture mode used in --with-mode=$with_mode." 1>&2 exit 1 diff --git a/gcc/config/s390/s390.cc b/gcc/config/s390/s390.cc index d4e849b12de6..9df3c4edb0b2 100644 --- a/gcc/config/s390/s390.cc +++ b/gcc/config/s390/s390.cc @@ -16246,7 +16246,12 @@ s390_option_override_internal (struct gcc_options *opts, { /* Architecture mode defaults according to ABI. */ if (!(opts_set->x_target_flags & MASK_ZARCH)) -opts->x_target_flags |= MASK_ZARCH; +{ + if (TARGET_64BIT) + opts->x_target_flags |= MASK_ZARCH; + else + opts->x_target_flags &= ~MASK_ZARCH; +} /* Set the march default in case it hasn't been specified on cmdline. */ if (!opts_set->x_s390_arch) diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h index 5731ae99bcd5..6f7195db04e1 100644 --- a/gcc/config/s390/s390.h +++ b/gcc/config/s390/s390.h @@ -302,7 +302,7 @@ extern const char *s390_host_detect_local_cpu (int argc, const char **argv); #define DRIVER_SELF_SPECS \ MARCH_MTUNE_NATIVE_SPECS,\ "%{!m31:%{!m64:-m" S390_TARGET_BITS_STRING "}}", \ - "%{!mesa:%{!mzarch:-mzarch}}", \ + "%{!mesa:%{!mzarch:%{m31:-mesa}%{m64:-mzarch}}}",\ "%{!march=*:-march=z900}"