aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2025-03-21gccrs: Use name resolver 2.0 in CompileTraitItemOwen Avery1-4/+32
gcc/rust/ChangeLog: * backend/rust-compile-implitem.cc (CompileTraitItem::visit): Use name resolver 2.0 (when enabled) to obtain canonical paths for instances of TraitItemConst and TraitItemFunc. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
2025-03-21gccrs: Use name resolution 2.0 in TraitItemReferenceOwen Avery1-2/+21
gcc/rust/ChangeLog: * typecheck/rust-hir-type-check.cc: Add includes. (TraitItemReference::get_type_from_fn): Use ForeverStack::to_canonical_path when name resolution 2.0 is enabled. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
2025-03-21gccrs: Rename some PathIdentSegment functionsOwen Avery2-15/+24
This makes PathIdentSegment more similar to other classes used to represent path segments. gcc/rust/ChangeLog: * ast/rust-path.h (PathIdentSegment::is_super_segment): Rename to... (PathIdentSegment::is_super_path_seg): ...here. (PathIdentSegment::is_crate_segment): Rename to... (PathIdentSegment::is_crate_path_seg): ...here. (PathIdentSegment::is_lower_self): Rename to... (PathIdentSegment::is_lower_self_seg): ...here. (PathIdentSegment::is_big_self): Rename to... (PathIdentSegment::is_big_self_seg): ...here. (PathExprSegment::is_super_path_seg): Handle renames. (PathExprSegment::is_crate_path_seg): Likewise. (PathExprSegment::is_lower_self_seg): Likewise. (TypePathSegment::is_crate_path_seg): Likewise. (TypePathSegment::is_super_path_seg): Likewise. (TypePathSegment::is_big_self_seg): Likewise. (TypePathSegment::is_lower_self_seg): Likewise. * ast/rust-ast-collector.cc (TokenCollector::visit): Likewise. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
2025-03-21gccrs: Add a newline to the end of nr2/excludeOwen Avery1-1/+2
gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Add trailing newline along with comment. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
2025-03-21gccrs: Fix variable shadowing in late resolution 2.0Owen Avery2-5/+8
gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Visit the initialization expressions of let statements before visiting their patterns. gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove entries. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
2025-03-21gccrs: Insert trait names during toplevel resolution 2.0Owen Avery1-0/+3
gcc/rust/ChangeLog: * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Insert trait names into the type namespace. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
2025-03-21gccrs: Fix bad recursive operator overload callPhilip Herron6-6/+134
When we are typechecking the impl block for DerefMut for &mut T the implementation follows the usual operator overload check but this ended up just resolving directly to the Trait definition which ends up being recursive which we usually handle. The issue we had is that a dereference call can be for either the DEREF or DEREF_MUT lang item here it was looking for a recurisve call to the DEREF lang item but we were in the DEREF_MUT lang item so this case was not accounted for. Fixes #3032 gcc/rust/ChangeLog: * typecheck/rust-hir-trait-reference.h: new get locus helper * typecheck/rust-hir-trait-resolve.cc (AssociatedImplTrait::get_locus): implemention * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::resolve_operator_overload): fix overload gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: nr2 cant handle this * rust/compile/issue-3032-1.rs: New test. * rust/compile/issue-3032-2.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
2025-03-21icf: Punt for musttail call flag differences in ICF [PR119376]Jakub Jelinek2-1/+33
The following testcase shows we were ignoring musttail flags on calls when deciding if two functions are the same. That can result in problems in both directions, either we silently lose musttail attribute because there is a similar function without it earlier and then we e.g. don't diagnose if it can't be tail called or don't try harder to do a tail call, or we get it even in functions which didn't have it before. The following patch for now just punts if it differs. Perhaps we could just merge it and get musttail flag if any of the merged functions had one in such position, but it feels to me that it is now too late in GCC 15 cycle to play with this. 2025-03-21 Jakub Jelinek <jakub@redhat.com> PR ipa/119376 * ipa-icf-gimple.cc (func_checker::compare_gimple_call): Return false for gimple_call_must_tail_p mismatches. * c-c++-common/musttail27.c: New test.
2025-03-21fnsplit: Set musttail call during function splitting if there are musttail ↵Jakub Jelinek2-0/+37
calls [PR119376] The just posted inliner patch can regress musttail calls if we perform function splitting and then inline the outlined body back into the original (or inline both the small function and outlined large body into something else). If there are any musttail calls, I think we need to call the outlined body using a musttail call, so that the inliner will preserve musttail attributes in the body. 2025-03-21 Jakub Jelinek <jakub@redhat.com> PR ipa/119376 * ipa-split.cc (split_function): Call gimple_call_set_must_tail on the call to outlined partition if has_musttail and !add_tsan_func_exit. * g++.dg/opt/musttail1.C: New test.
2025-03-21inliner: Silently drop musttail flag on calls during inlining unless the ↵Jakub Jelinek2-0/+42
inlined routine was musttail called [PR119376] As discussed in the PR, some packages fail to build because they use musttail attribute on calls in functions which we inline, and if they are inlined into a middle of the function, that results in an error because we have a musttail call in the middle of a function and so it can't be tail called there. Now, guess the primary intent of the musttail attribute is ensuring we don't get an extra stack frame in the backtrace. Inlining itself removes one extra stack frame from the backtrace as well (sure, not counting virtual backtraces in gdb), so I think erroring out on that is unnecessary. Except when we are inlining a musttail call which has musttail calls in it, in that case we are being asked to remove 2 stack frames from the backtrace, inlining removes one, so we need to keep musttail on the calls so that another stack frame is removed through a tail call. The following patch implements that, keeping previous behavior when id->call_stmt is NULL (i.e. when versioning/cloning etc.). 2025-03-21 Jakub Jelinek <jakub@redhat.com> PR ipa/119376 * tree-inline.cc (remap_gimple_stmt): Silently clear gimple_call_must_tail_p on inlined call stmts if id->call_stmt is a call without that flag set. * c-c++-common/musttail26.c: New test.
2025-03-21libstdc++: Fix localized %c formatting for non-UTC times [PR117214]Jonathan Wakely5-9/+287
The previous commit fixed most cases of %c formatting, but it incorrectly prints times using the system's local time zone. This only matters if the locale's %c format includes %Z, but some do. To print a correct value for %Z we can set tm.tm_zone to either "UTC" or the abbreviation passed to the formatter in the local-time-format-t structure. For local times with no info and for systems that don't support tm_zone (which is new in POSIX.1-2024) we just set tm_isdst = -1 so that no zone name is printed. In theory, a locale's %c format could use %z which should print a +hhmm offset from UTC. I'm unsure how to control that though. The new tm_gmtoff field in combination with tm_isdst != -1 seems like it should work, but using that without also setting tm_zone causes the system zone to be used for %Z again. That means local_time_format(lt, nullptr, &off) might work for a locale that uses %z but prints the wrong thing for %Z. This commit doesn't set tm_gmtoff even if _M_offset_sec is provided for a local-time-format-t value. libstdc++-v3/ChangeLog: PR libstdc++/117214 * configure.ac: Use AC_STRUCT_TIMEZONE. * config.h.in: Regenerate. * configure: Regenerate. * include/bits/chrono_io.h (__formatter_chrono::_M_c): Set tm_isdst and tm_zone. * testsuite/std/time/format/pr117214.cc: Check %c formatting of zoned_time and local time.
2025-03-21libstdc++: Fix localized D_T_FMT %c formatting for <chrono> [PR117214]XU Kailiang2-16/+53
Formatting a time point with %c was implemented by calling std::vprint_to with format string constructed from locale's D_T_FMT string, but in some locales this string contains strftime specifiers which are not valid for chrono-specs, e.g. %l. So just use _M_locale_fmt to avoid this problem. libstdc++-v3/ChangeLog: PR libstdc++/117214 * include/bits/chrono_io.h (__formatter_chrono::_M_c): Use _M_locale_fmt to format %c time point. * testsuite/std/time/format/pr117214.cc: New test. Signed-off-by: XU Kailiang <xu2k3l4@outlook.com> Co-authored-by: Jonathan Wakely <jwakely@redhat.com>
2025-03-21libstdc++: Use formatting locale for std::time_put formatsJonathan Wakely2-0/+34
When using std::time_put to format a chrono value, we should imbue the formatting locale into the stream. This ensures that when std::time_put::do_put uses a ctype or __timepunct facet from the locale, it gets the correct facets. libstdc++-v3/ChangeLog: * include/bits/chrono_io.h (__formatter_chrono::_M_locale_fmt): Imbue locale into ostringstream. * testsuite/std/time/format/localized.cc: Check that correct locale is used for call to time_put::put. Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
2025-03-21libstdc++: Simplify std::vector::vector(from_range_t, const Alloc&)Jonathan Wakely1-18/+2
Tomasz suggested replacing this constructor with just append_range(rg), after using a delegating constructor so that the destructor will run if append_range exits via an exception. This is slightly less simple than his suggestion, because I want to avoid the overhead of reserve's slow path and the ASan annotations. Neither of those is needed for this constructor, because we have no existing storage to reallocate and no unused capacity to tell ASan about. libstdc++-v3/ChangeLog: * include/bits/stl_vector.h (vector(from_range_t, Alloc)): Use delegating constructor instead of RAII guards. Use append_range for unsized input range case. Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
2025-03-21cobol: Rename COB_{BLOCK,UNSIGNED,SIGNED} to {BLOCK,UNSIGNED,SIGNED}_kw for ↵Jakub Jelinek3-18/+18
consistency On Wed, Mar 19, 2025 at 06:03:24PM -0400, James K. Lowden wrote: > Elsewhere in the parser where there was a conflict like that, I renamed > the token. For example, the COBOL word TRUE uses a token named > TRUE_kw. I don't mind either way; your solution has less impact on the > parser. I think consistency is good and when it is a suffix rather than prefix, it also sorts alphabetically together with the actual keywords. 2025-03-21 Jakub Jelinek <jakub@redhat.com> * parse.y: Rename COB_BLOCK to BLOCK_kw, COB_SIGNED to SIGNED_kw and COB_UNSIGNED to UNSIGNED_kw. * scan.l: Likewise. * token_names.h: Regenerate.
2025-03-21libstdc++: Fix std.compat exports of <stdbit.h> and <stdckdint.h>Jonathan Wakely1-2/+9
libstdc++-v3/ChangeLog: * src/c++23/std.compat.cc.in: Only export <stdbit.h> and <stdckdint.h> contents for C++26 and later. Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
2025-03-21libstdc++: Add views::cache_latest and views::to_input to std moduleJonathan Wakely1-3/+20
Also export the tuple-like helpers from <complex>, and the std::from_range_t and std::from_range tag. libstdc++-v3/ChangeLog: * src/c++23/std.cc.in (tuple_element, tuple_element_t) (tuple_size, tuple_size_v, get): Export. (ranges::cache_latest_view, views::cache_latest): Export. (ranges::to_input_view, views::to_input): Export. (from_range_t, from_range): Export. Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
2025-03-21move global data to symbol_table_initRichard Biener1-89/+84
The following avoids early runtime initialization of cbl_field_t objects which, when using tree to represent the current _Float128 data, segfaults as tree data like float128_type_node is not yet initialized. The solution is to move the global data to symbol_table_init which is the only user and it already has one such instance locally, the 'constants' array. * symbols.cc (empty_float, empty_comp5, empty_literal, empty_conditional, debug_registers, special_registers): Move global cbl_field_t typed data to ... (symbol_table_init): ... local scope here.
2025-03-21s390: Accept only Pmode for registers AP/FP/RA [PR119235]Stefan Schulze Frielinghaus1-2/+2
gcc/ChangeLog: PR target/119235 * config/s390/s390.cc (s390_hard_regno_mode_ok): Accept only Pmode for registers AP/FP/RA.
2025-03-21make sources coretypes.h and tree.h cleanRichard Biener15-31/+40
The following removes HOWEVER_GCC_DEFINES_TREE and the alternate definition of tree from symbols.h and instead ensures that both coretypes.h and tree.h are included where required. This required putting GCCs own 'NONE' in a scoped enum (see separate patch) and renaming the cobol use of UNSIGNED, SIGNED and BLOCK which conflict with enums from tree.h. There's a few things in conflict with options.h defines, notably cobol_dialect and cobol_exceptions but also yy_flex_debug (wherever that comes from). I've chosen to simply #undef those where appropriate. I've refrained from putting the coretypes.h and tree.h includes in cobol-system.h since not all files require this. This helps in making use of real.h instead of using _Float128. PR cobol/119241 gcc/cobol/ * symbols.h: Do not typedef tree. * cdf.y: Include coretypes.h and tree.h. * symbols.cc: Likewise. * symfind.cc: Likewise. * util.cc: Likewise. * parse.y: Include coretypes.h and tree.h where appropriate. Rename BLOCK to COB_BLOCK, SIGNED to COB_SIGNED, UNSIGNED to COB_UNSIGNED. * scan.l: Likewise. * token_names.h: Likewise. * cobol1.cc: Do not define HOWEVER_GCC_DEFINES_TREE. * except.cc: Likewise. * genapi.cc: Likewise. * gengen.cc: Likewise. * genmath.cc: Likewise. * genutil.cc: Likewise. * structs.cc: Likewise.
2025-03-21Fortran: Fix double free on polymorphic array dummy argument [PR119349]Andre Vehreschild2-1/+30
Calling elemental routines with polymorphic formals leads to generation of a temporary polymorphic variable and code for its deallocation. Sourcing this element from an array constructor the latter now is prevented from generating a second deallocation. PR fortran/119349 gcc/fortran/ChangeLog: * trans-expr.cc (gfc_conv_procedure_call): Prevent deallocation of array temporary for polymorphic temporary argument. gcc/testsuite/ChangeLog: * gfortran.dg/class_79.f90: New test.
2025-03-21Put early debug generation under TV_SYMOUTRichard Biener1-0/+4
Like all other debug info generation this should be with TV_SYMOUT, otherwise it's recorded as TV_CGRAPH. * cgraphunit.cc (symbol_table::finalize_compilation_unit): Put early debug generation under TV_SYMOUT.
2025-03-21Daily bump.GCC Administrator12-1/+313
2025-03-20combine: Add REG_DEAD notes to the last instruction after a split [PR118914]Andrew Pinski1-15/+31
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 <quic_apinski@quicinc.com>
2025-03-21d: Fix quoted command-line options to match lang.opt [PR118545]Iain Buclaw1-3/+3
It was noticed that not all D language options get a url in diagnostics. These have been checked and fixed as necessary. PR d/118545 gcc/d/ChangeLog: * d-lang.cc (d_handle_option): Adjust quoted options.
2025-03-20modula2: Defend against no ENOTBLK definitionGaius Mulley1-2/+10
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 <gaiusmod2@gmail.com>
2025-03-20PR modula2/118600 Assigning to a record causes alignment exceptionGaius Mulley10-20/+255
This patch recursively tests every assignment (of a constructor to a designator) to ensure the types are GCC equivalent. If they are equivalent then it uses gimple assignment and if not then it copies a structure by field and uses __builtin_strncpy to copy a string cst into an array. Unions are copied by __builtin_memcpy. gcc/m2/ChangeLog: PR modula2/118600 * gm2-compiler/M2GenGCC.mod (PerformCodeBecomes): New procedure. (CodeBecomes): Refactor and call PerformCodeBecomes. * gm2-gcc/m2builtins.cc (gm2_strncpy_node): New global variable. (DoBuiltinStrNCopy): New function. (m2builtins_BuiltinStrNCopy): New function. (m2builtins_init): Initialize gm2_strncpy_node. * gm2-gcc/m2builtins.def (BuiltinStrNCopy): New procedure function. * gm2-gcc/m2builtins.h (m2builtins_BuiltinStrNCopy): New function. * gm2-gcc/m2statement.cc (copy_record_fields): New function. (copy_array): Ditto. (copy_strncpy): Ditto. (copy_memcpy): Ditto. (CopyByField_Lower): Ditto. (m2statement_CopyByField): Ditto. * gm2-gcc/m2statement.def (CopyByField): New procedure function. * gm2-gcc/m2statement.h (m2statement_CopyByField): New function. * gm2-gcc/m2type.cc (check_record_fields): Ditto. (check_array_types): Ditto. (m2type_IsGccStrictTypeEquivalent): Ditto. * gm2-gcc/m2type.def (IsGccStrictTypeEquivalent): New procedure function. * gm2-gcc/m2type.h (m2type_IsAddress): Replace return type int with bool. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2025-03-20cobol: Do not overload int64_t, overload long and long long.Iain Sandoe1-1/+1
Since the type that is ued for int64_t varies between platforms trying to overload it creates ambiguous or conflicting overloads. gcc/cobol/ChangeLog: * cdfval.h (struct cdfval_t): Overload long instead of int64_t. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
2025-03-20libgcobol: Add configure checks for iconv.Iain Sandoe6-4/+933
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 <iain@sandoe.co.uk>
2025-03-20Update gcc hr.poJoseph Myers1-689/+484
* hr.po: Update.
2025-03-20tree-optimization/119389 - limit edge processing in dominated_by_p_w_unexRichard Biener1-1/+5
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.
2025-03-20Update cpplib de.poJoseph Myers1-11/+7
* de.po: Update.
2025-03-20Revert "s390: Deprecate ESA/390 support"Stefan Schulze Frielinghaus26-34/+10
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.
2025-03-20gimple: sccopy: Don't increment i after vec::unordered_remove()Filip Kastl1-1/+3
I increment the index variable in a loop even when I do vec::unordered_remove() which causes the vector traversal to miss some elements. Mikael notified me of this mistake I made in my last patch. gcc/ChangeLog: * gimple-ssa-sccopy.cc (scc_copy_prop::propagate): Don't increment after vec::unordered_remove(). Reported-by: Mikael Morin <mikael@gcc.gnu.org> Signed-off-by: Filip Kastl <fkastl@suse.cz>
2025-03-20libstdc++: Add from_range_t constructors to debug unordered containersTomasz Kamiński2-0/+272
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 <jwakely@redhat.com> Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
2025-03-20libstdc++: Add from_range_t constructors to debug ordered containersJonathan Wakely4-1/+133
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 <tkaminsk@redhat.com>
2025-03-20libstdc++: Fix comment typoJakub Jelinek1-1/+1
Another IEE typo. 2025-03-20 Jakub Jelinek <jakub@redhat.com> * testsuite/18_support/numeric_limits/traps.cc (main): Fix comment typo.
2025-03-20Make function_decl_type a scoped enumRichard Biener6-13/+19
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.
2025-03-20i386: Fix AVX10.2 SAT CVT testcases.Hu, Lin115-90/+165
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.
2025-03-20openmp: Fix up cloning of dynamic C++ initializers for OpenMP target [PR119370]Jakub Jelinek2-0/+28
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 <jakub@redhat.com> 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.
2025-03-19Use ix86_fp_comparison_operator in cbranchbf4 to avoid ICE.liuhongt2-1/+13
*jcc only supports ix86_fp_comparison_operator for CCFP, when comparison code is LT, there's an ICE. W/o AVX10.2, it's ok since do_compare_rtx_and_jump will transform LT to GT, but w/ AVX10.2 it goes directly into ix86_expand_branch which doesn't handle it. Use ix86_fp_comparison_operator in cbranchbf4. gcc/ChangeLog: PR target/117452 * config/i386/i386.md (cbranchbf4): Use ix86_fp_comparison_operator instead of comparison_operator. gcc/testsuite/ChangeLog: * gcc.target/i386/pr117452.c: New test.
2025-03-20i386: Add "s_" as Saturation for AVX10.2 SAT CVT Intrinsics.Hu, Lin130-760/+760
This patch aims to add "s_" before intrinsic core name represent saturation. gcc/ChangeLog: * config/i386/avx10_2-512satcvtintrin.h: Add "s_" before intrinsics' core name. * config/i386/avx10_2satcvtintrin.h: Ditto. gcc/testsuite/ChangeLog: * gcc.target/i386/avx10_2-512-satcvt-1.c: Modify intrinsic name. * gcc.target/i386/avx10_2-512-vcvtbf162ibs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvtbf162iubs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvtph2ibs-2.c: Ditto. * 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-vcvttbf162ibs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttbf162iubs-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-vcvttph2iubs-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. * gcc.target/i386/avx10_2-satcvt-1.c: Ditto. * gcc.target/i386/avx10_2-vcvttsd2sis-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttsd2usis-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttss2sis-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttss2usis-2.c: Ditto. * gcc.target/i386/sse-14.c: Ditto. * gcc.target/i386/sse-22.c: Ditto.
2025-03-20i386: Fix AVX10.2 SAT CVT testcases.Hu, Lin123-97/+565
Add missing testcases. gcc/testsuite/ChangeLog: * gcc.target/i386/avx10_2-512-satcvt-1.c: Add testcase. * gcc.target/i386/avx10_2-512-vcvtph2ibs-2.c: Ditto * 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-vcvttph2iubs-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 * gcc.target/i386/avx10_2-satcvt-1.c: Ditto * gcc.target/i386/avx10_2-vcvttsd2sis-2.c: Ditto * gcc.target/i386/avx10_2-vcvttsd2usis-2.c: Ditto * gcc.target/i386/avx10_2-vcvttss2sis-2.c: Ditto * gcc.target/i386/avx10_2-vcvttss2usis-2.c: Ditto
2025-03-20i386: Add AVX10.2 SAT CVT Intrinsics without Rounding ControlHu, Lin15-0/+1098
gcc/ChangeLog: * config/i386/avx10_2-512satcvtintrin.h: Add new intrinsics. * config/i386/avx10_2satcvtintrin.h: Ditto. * config/i386/i386-builtin-types.def: Add DEF_FUNCTION_TYPE (V32HI, V32HF, V32HI, USI), (V16SI, V16SF, V16SI, UHI), (V8DI, V8SF, V8DI, UQI), (V8DI, V8DF, V8DI, UQI), (V8SI, V8DF, V8SI, UQI). * config/i386/i386-builtin.def: Add new builtins. * config/i386/i386-expand.cc: Handle V16SI_FTYPE_V16SF_V16SI_UHI, V32HI_FTYPE_V32HF_V32HI_USI, V8DI_FTYPE_V8SF_V8DI_UQI, V8DI_FTYPE_V8DF_V8DI_UQI, V8SI_FTYPE_V8DF_V8SI_UQI.
2025-03-20i386: Update Suffix for AVX10.2 SAT CVT IntrinsicsHu, Lin118-458/+458
The intrinsic names for *[i|u]bs instructions in AVX10.2 are missing the required _ep[i|u]8 suffix. This patch aims to fix the issue. gcc/ChangeLog: * config/i386/avx10_2-512satcvtintrin.h: Change *i[u]bs's type suffix of intrin name. * config/i386/avx10_2satcvtintrin.h: Ditto. gcc/testsuite/ChangeLog: * gcc.target/i386/avx10_2-512-satcvt-1.c: Modify intrin name. * gcc.target/i386/avx10_2-512-vcvtbf162ibs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvtbf162iubs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvtph2ibs-2.c: Ditto. * 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-vcvttbf162ibs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttbf162iubs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttph2ibs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttph2iubs-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-satcvt-1.c: Ditto. * gcc.target/i386/sse-14.c: Ditto. * gcc.target/i386/sse-22.c: Ditto.
2025-03-20Daily bump.GCC Administrator10-1/+2029
2025-03-19libstdc++: Correct statement about default -std optionJonathan Wakely2-4/+4
The default is -std=gnu++17 now, not -std=gnu++14. libstdc++-v3/ChangeLog: * doc/xml/manual/test.xml: Fix default for -std option. * doc/html/manual/test.html: Regenerate.
2025-03-19libstdc++: Fix "IEE" typo in comment in std::time_put::do_putJonathan Wakely1-1/+1
libstdc++-v3/ChangeLog: * include/bits/locale_facets_nonio.tcc (time_put::do_put): Fix typo in comment.
2025-03-19Fortran: fix bogus bounds check for reallocation on assignment [PR116706]Harald Anlauf2-3/+46
PR fortran/116706 gcc/fortran/ChangeLog: * trans-array.cc (gfc_is_reallocatable_lhs): Fix check on allocatable components of derived type or class objects. gcc/testsuite/ChangeLog: * gfortran.dg/bounds_check_27.f90: New test.
2025-03-19c++: mangling of array new [PR119316]Jason Merrill2-3/+20
Because we build an array type to represent an array new, we hit a VLA error in compute_array_index_type for a variable length array new. To avoid this, let's build the MINUS_EXPR and index type directly. I also noticed that the non-constant case in write_array_type was assuming MINUS_EXPR without verifying it, so I added a checking_assert. I also noticed that Clang doesn't mangle the length of an array new at all, so I opened https://github.com/itanium-cxx-abi/cxx-abi/issues/199 to clarify this. PR c++/119316 gcc/cp/ChangeLog: * mangle.cc (write_expression) [NEW_EXPR]: Avoid using compute_array_index_type. (write_array_type): Add checking_assert. gcc/testsuite/ChangeLog: * g++.dg/abi/mangle-new1.C: New test.