aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-10-06doc: Focus on DWARF for FreeBSDGerald Pfeifer1-3/+1
gcc: PR target/69374 * doc/install.texi (Specific) <*-*-freebsd*>: Focus on DWARF only.
2024-10-06Daily bump.GCC Administrator5-1/+53
2024-10-05hppa: Don't clobber frame_pointer_rtx in expandersJohn David Anglin1-2/+0
Noticed testing LRA. Clobbers cause internal compiler errors. 2024-10-05 John David Anglin <danglin@gcc.gnu.org> gcc/ChangeLog: * config/pa/pa.md (nonlocal_goto): Don't clobber frame_pointer_rtx. (builtin_longjmp): Likewise.
2024-10-05hppa: Fix indirect_goto constraintJohn David Anglin1-1/+1
Noticed testing LRA. 2024-10-05 John David Anglin <danglin@gcc.gnu.org> gcc/ChangeLog: * config/pa/pa.md: Fix indirect_got constraint.
2024-10-05libstdc++: add std::is_virtual_base_ofGiuseppe D'Angelo4-0/+67
Added by P2985R0 for C++26. This simply exposes the compiler builtin, and adds the feature-testing macro. libstdc++-v3/ChangeLog: * include/bits/version.def: Added the feature-testing macro. * include/bits/version.h: Regenerated. * include/std/type_traits: Add support for std::is_virtual_base_of and std::is_virtual_base_of_v, implemented in terms of the compiler builtin. * testsuite/20_util/is_virtual_base_of/value.cc: New test. Signed-off-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
2024-10-05libstdc++: Implement LWG 3664 changes to ranges::distancePatrick Palka2-7/+18
libstdc++-v3/ChangeLog: * include/bits/ranges_base.h (__distance_fn::operator()): Adjust iterator/sentinel overloads as per LWG 3664. * testsuite/24_iterators/range_operations/distance.cc: Test LWG 3664 example. Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
2024-10-05Fix various issues of -ftrivial-auto-var-init=zero with AdaEric Botcazou5-8/+47
This polishes a few rough edges that prevent -ftrivial-auto-var-init=zero from working in Ada: - build_common_builtin_nodes declares BUILT_IN_CLEAR_PADDING with 3 instead 2 parameters, now gimple_fold_builtin_clear_padding contains the assertion: gcc_assert (gimple_call_num_args (stmt) == 2) This causes gimple_builtin_call_types_compatible_p to always return false in Ada (this works in C/C++ because another declaration is used). - gimple_add_init_for_auto_var uses EXPR_LOCATION to fetch the location of a DECL node, which always returns UNKNOWN_LOCATION. - the machinery attempts to initialize Out parameters. gcc/ PR middle-end/116933 * gimplify.cc (gimple_add_init_for_auto_var): Use the correct macro to fetch the source location of the variable. * tree.cc (common_builtin_nodes): Remove the 3rd parameter in the type of BUILT_IN_CLEAR_PADDING. gcc/ada/ PR middle-end/116933 * gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Out_Parameter>: Add the "uninitialized" attribute on Out parameters. * gcc-interface/utils.cc (gnat_internal_attributes): Add entry for the "uninitialized" attribute. (handle_uninitialized_attribute): New function. gcc/testsuite/ * gnat.dg/auto_var_init.adb: New test.
2024-10-05Improve load permutation loweringRichard Biener1-14/+17
The following makes sure the emitted even/odd extraction scheme follows one that ends up with actual trivial even/odd extract permutes. When we choose a level 2 extract we generate { 0, 1, 4, 5, ... } which for example the x86 backend doesn't recognize with just SSE and QImode elements. So this now follows what the non-SLP interleaving code would do which is element granular even/odd extracts. This resolves gcc.dg/vect/vect-strided[-a]-u8-i8-gap*.c FAILs with --param vect-force-slp=1 on x86_64. * tree-vect-slp.cc (vect_lower_load_permutations): Prefer level 1 even/odd extracts.
2024-10-05Daily bump.GCC Administrator8-1/+307
2024-10-04MAINTAINERS: Add myself to write after approvalThiago Jung Bauermann1-0/+1
ChangeLog: * MAINTAINERS: Add myself to write after approval.
2024-10-04diagnostics: bulletproof opening of SARIF output [PR116978]David Malcolm5-24/+165
Introduce a new RAII class diagnostic_output_file to track ownership of the FILE * for SARIF output. In particular, the .sarif file is now opened immediately, rather than at the end of the compile, and so will fail earlier if the file can't be opened. Doing so fixes a couple of ICEs in -fdiagnostics-format=sarif-file when invoking, say, cc1 directly, rather than from the driver. gcc/ChangeLog: PR other/116978 * diagnostic-format-sarif.cc (sarif_builder::sarif_builder): Gracefully handle "main_input_filename_" being NULL. (sarif_output_format::sarif_output_format): Replace param "base_file_name" with "output_file" and assert that the file was opened successfully and has a non-NULL filename. (sarif_output_format::~sarif_file_output_format): Move responsibility for building the filename and opening the file from here to the creator of the instance. (sarif_output_format::m_base_file_name): Replace with... (sarif_output_format::m_output_file): ...this. (diagnostic_output_format_init_sarif_file): Make "line_maps" param non-const. Gracefully handle "base_file_name" being NULL. Construct the filename and open the file here, rather than in ~sarif_file_output_format, and handle failures immediately here, rather than at the end of the compile. * diagnostic-format-sarif.h: Include "diagnostic-output-file.h". (diagnostic_output_format_init_sarif_file): Make "line_maps" param non-const. * diagnostic-output-file.h: New file. * diagnostic.cc (diagnostic_context::emit_diagnostic): New. (diagnostic_context::emit_diagnostic_va): New. * diagnostic.h (diagnostic_context::emit_diagnostic): New decl. (diagnostic_context::emit_diagnostic_va): New decl. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2024-10-05x86: Disable stack protector for naked functionsH.J. Lu2-0/+21
Since naked functions should not enable stack protector, define TARGET_STACK_PROTECT_RUNTIME_ENABLED_P to disable stack protector for naked functions. gcc/ PR target/116962 * config/i386/i386.cc (ix86_stack_protect_runtime_enabled_p): New function. (TARGET_STACK_PROTECT_RUNTIME_ENABLED_P): New. gcc/testsuite/ PR target/116962 * gcc.target/i386/pr116962.c: New file. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2024-10-04aarch64: Fix bug with max/min (PR116934)Saurabh Jha2-4/+17
In ac4cdf5cb43c0b09e81760e2a1902ceebcf1a135, I introduced a bug where I put the new unspecs, UNSPEC_COND_SMAX and UNSPEC_COND_SMIN, into the wrong iterator. I should have put new unspecs in SVE_COND_FP_MAXMIN but I put it in SVE_COND_FP_BINARY_REG instead. That was incorrect because the SVE_COND_FP_MAXMIN iterator is being used for predicated floating-point maximum/minimum, not SVE_COND_FP_BINARY_REG. Also added a testcase to validate the new change. Regression tested on aarch64-unknown-linux-gnu and found no regressions. There are some test cases with "libitm" in their directory names which appear in compare_tests output as changed tests but it looks like they are in the output just because of changed build directories, like from build-patched/aarch64-unknown-linux-gnu/./libitm/* to build-pristine/aarch64-unknown-linux-gnu/./libitm/*. I didn't think it was a cause of concern and have pushed this for review. gcc/ChangeLog: PR target/116934 * config/aarch64/iterators.md: Move UNSPEC_COND_SMAX and UNSPEC_COND_SMIN to correct iterators. gcc/testsuite/ChangeLog: PR target/116934 * gcc.target/aarch64/sve2/pr116934.c: New test.
2024-10-04AVR: target/116953 - ICE due to operands clobber in avr_out_sbxx_branch.Georg-Johann Lay2-1/+12
PR target/116953 gcc/ * config/avr/avr.cc (avr_out_sbxx_branch): Work on a copy of the operands rather than on operands itself, which is just recog_data.operand and may be clobbered by jump_over_one_insn_p. gcc/testsuite/ * gcc.target/avr/torture/pr116953.c: New test.
2024-10-04testsuite - Some float64 and float32x test require double64plus.Georg-Johann Lay7-0/+17
Some of the float64 and float32x test cases are using double built-ins and hence require double64plus resp. that double is at least as good as float32x (double_float32xplus). gcc/testsuite/ * lib/target-supports.exp (check_effective_target_double_float32xplus): New proc. * gcc.dg/torture/float32x-builtin.c: Add dg-require-effective-target double_float32xplus. * gcc.dg/torture/float32x-tg-2.c: Same. * gcc.dg/torture/float32x-tg.c: Same. * gcc.dg/torture/float64-builtin.c: Add dg-require-effective-target double64plus. * gcc.dg/torture/float64-tg-2.c: Same. * gcc.dg/torture/float64-tg.c: Same.
2024-10-04cfgexpand: Expand comment on when non-var clobbers can show upAndrew Pinski1-2/+3
The comment here is not wrong, just it would be better if mentioning the C++ front-end instead of just the nested function lowering. gcc/ChangeLog: * cfgexpand.cc (add_scope_conflicts_1): Expand comment on when non-var clobbers show up. Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
2024-10-04testsuite: Fix fallout of turning warnings into errors on 32-bit ArmThiago Jung Bauermann4-4/+4
Since commits 2c3db94d9fd ("c: Turn int-conversion warnings into permerrors") and 55e94561e97e ("c: Turn -Wimplicit-function-declaration into a permerror") these tests fail with errors such as: FAIL: gcc.target/arm/pr59858.c (test for excess errors) FAIL: gcc.target/arm/pr65647.c (test for excess errors) FAIL: gcc.target/arm/pr65710.c (test for excess errors) FAIL: gcc.target/arm/pr97969.c (test for excess errors) Here's one example of the excess errors: FAIL: gcc.target/arm/pr65647.c (test for excess errors) Excess errors: /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:6:17: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion] /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:6:51: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion] /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:6:62: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion] /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:7:48: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion] /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:8:9: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion] /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:24:5: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion] /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:25:5: error: initialization of 'int' from 'struct S1 *' makes integer from pointer without a cast [-Wint-conversion] /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:41:3: error: implicit declaration of function 'fn3'; did you mean 'fn2'? [-Wimplicit-function-declaration] /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:46:3: error: implicit declaration of function 'fn5'; did you mean 'fn4'? [-Wimplicit-function-declaration] /path/gcc.git/gcc/testsuite/gcc.target/arm/pr65647.c:57:16: error: implicit declaration of function 'fn6'; did you mean 'fn4'? [-Wimplicit-function-declaration] PR rtl-optimization/59858 and PR target/65710 test the fix of an ICE. PR target/65647 and PR target/97969 test for a compilation infinite loop. Therefore, add -fpermissive so that the tests behave as they did previously. Tested on armv8l-linux-gnueabihf. gcc/testsuite/ChangeLog: * gcc.target/arm/pr59858.c: Add -fpermissive. * gcc.target/arm/pr65647.c: Likewise. * gcc.target/arm/pr65710.c: Likewise. * gcc.target/arm/pr97969.c: Likewise.
2024-10-04Revert: AVR: Implement TARGET_FLOATN_MODE.Georg-Johann Lay1-21/+0
Revert r15-4073 / 98a1a886e4c0c58ad9f9846caf5697ff00e4f24a The default TARGET_FLOATN_MODE is just fine. gcc/ * config/avr/avr.cc (avr_floatn_mode): Remove. (TARGET_FLOATN_MODE): Remove.
2024-10-04AVR: Implement TARGET_FLOATN_MODE.Georg-Johann Lay1-0/+21
gcc/ * config/avr/avr.cc (avr_floatn_mode): New static function. (TARGET_FLOATN_MODE): New define.
2024-10-04PR modula2/116918 -fswig correct syntax fixupGaius Mulley1-1/+1
This patch adds a missing % escape in DoCheckUnbounded. gcc/m2/ChangeLog: PR modula2/116918 * gm2-compiler/M2Swig.mod (DoCheckUnbounded): Escape the % character used in array_functions with %%. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2024-10-04[PATCH] RISC-V/libgcc: Fix incorrect .cfi_offset for saving ra in ↵Tsung Chun Lin1-1/+1
__riscv_save_[0-3] on ilp32e. From 8b3c5ebe8aacbcc4ddf1be8dea9a555e7e1bcc39 Mon Sep 17 00:00:00 2001 From: Jim Lin <jim@andestech.com> Date: Fri, 4 Oct 2024 14:48:12 +0800 Subject: [PATCH] RISC-V/libgcc: Fix incorrect .cfi_offset for saving ra in __riscv_save_[0-3] on ilp32e. libgcc/ChangeLog: * config/riscv/save-restore.S: Fix .cfi_offset for saving ra in __riscv_save_[0-3] on ilp32e.
2024-10-04libstdc++/ranges: Implement various small LWG issuesPatrick Palka7-8/+135
This implements the following small LWG issues: 3848. adjacent_view, adjacent_transform_view and slide_view missing base accessor 3851. chunk_view::inner-iterator missing custom iter_move and iter_swap 3947. Unexpected constraints on adjacent_transform_view::base() 4001. iota_view should provide empty 4012. common_view::begin/end are missing the simple-view check 4013. lazy_split_view::outer-iterator::value_type should not provide default constructor 4035. single_view should provide empty 4053. Unary call to std::views::repeat does not decay the argument 4054. Repeating a repeat_view should repeat the view libstdc++-v3/ChangeLog: * include/std/ranges (single_view::empty): Define as per LWG 4035. (iota_view::empty): Define as per LWG 4001. (lazy_split_view::_OuterIter::value_type): Remove default constructor and make other constructor private as per LWG 4013. (common_view::begin): Disable non-const overload for simple views as per LWG 4012. (common_view::end): Likewise. (adjacent_view::base): Define as per LWG 3848. (adjacent_transform_view::base): Likewise. (chunk_view::_InnerIter::iter_move): Define as per LWG 3851. (chunk_view::_InnerIter::itep_swap): Likewise. (slide_view::base): Define as per LWG 3848. (repeat_view): Adjust deduction guide as per LWG 4053. (_Repeat::operator()): Adjust single-parameter overload as per LWG 4054. * testsuite/std/ranges/adaptors/adjacent/1.cc: Verify existence of base member function. * testsuite/std/ranges/adaptors/adjacent_transform/1.cc: Likewise. * testsuite/std/ranges/adaptors/chunk/1.cc: Test LWG 3851 example. * testsuite/std/ranges/adaptors/slide/1.cc: Verify existence of base member function. * testsuite/std/ranges/iota/iota_view.cc: Test LWG 4001 example. * testsuite/std/ranges/repeat/1.cc: Test LWG 4053/4054 examples. Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
2024-10-04testsuite: Fix up unevalstr2.C testJakub Jelinek2-20/+92
The CWG2521 changes adjusted the unevalstr1.C test but didn't adjust unevalstr2.C test, which now FAILs in C++23 mode. The intent in both of those tests was to test the separate (now deprecated) syntax, so instead of removing the space between closing " and _ I've adjusted the testcase to expect those 17 extra warnings. And I've also adjusted the unevalstr1.C testcase to do the same, when it is removed from C++29 or whatever, that can be just guarded by #if. But it is actually useful to also test the UDL variant without space between closing " and _, so I've added new test coverage for that too to both tests. 2024-10-04 Jakub Jelinek <jakub@redhat.com> * g++.dg/cpp26/unevalstr1.C: Revert the 2024-10-03 changes, instead expect extra warnings. Add another set of tests without space between " and _. * g++.dg/cpp26/unevalstr2.C: Expect extra warnings for C++23. Add another set of tests without space between " and _.
2024-10-04aarch64: Set Armv9-A generic L1 cache line size to 64 bytesKyrylo Tkachov1-1/+13
I'd like to use a value of 64 bytes for the L1 cache size for Armv9-A generic tuning. As described in g:9a99559a478111f7fbeec29bd78344df7651c707 this value is used to set the std::hardware_destructive_interference_size value which we want to be not overly large when running concurrent applications on large core-count systems. The generic value for Armv8-A systems and the port baseline is 256 bytes because that's what the A64FX CPU has, as set de-facto in aarch64_override_options_internal. But for Armv9-A CPUs as far as I know there isn't anything larger than 64 bytes, so we should be able to use the smaller value here and reduce the size of concurrent structs that use std::hardware_destructive_interference_size to pad their fields. Bootstrapped and tested on aarch64-none-linux-gnu. Signed-off-by: Kyrylo Tkachov <ktkachov@nvidia.com> * config/aarch64/tuning_models/generic_armv9_a.h (generic_armv9a_prefetch_tune): Define. (generic_armv9_a_tunings): Use the above.
2024-10-04libstdc++: Fix some Parallel Mode testsuite failuresJonathan Wakely11-7/+32
Some of these are due to no longer using #pragma GCC system_header in libstdc++ headers, some have been failing for longer and weren't noticed. libstdc++-v3/ChangeLog: * include/parallel/algobase.h (search): Use sequential algorithm for constant evaluation. * include/parallel/algorithmfwd.h (search): Add _GLIBCXX20_CONSTEXPR. * include/parallel/multiway_merge.h: Remove stray semi-colon. * include/parallel/multiseq_selection.h: Add diagnostic pragmas for -Wlong-long warning. * include/parallel/quicksort.h: Likewise. * include/parallel/random_number.h: Likewise. * include/parallel/settings.h: Likewise. * include/parallel/workstealing.h: Replace ++ and -- on volatile variables. * testsuite/17_intro/names.cc: Skip names defined by <tr1/random>. * testsuite/20_util/pair/dangling_ref.cc: Skip test if Parallel Mode is enabled. * testsuite/20_util/tuple/dangling_ref.cc: Likewise.
2024-10-04arm: Fix missed CE optimization for armv8.1-m.main [PR 116444]Andre Vieira2-0/+88
This patch restores missed optimizations for armv8.1-m.main targets that were missed when the generation of csinc, csinv and csneg were enabled for the same with patch series containing: commit c2bb84be4a6e581bbf45891457ee632a07416982 Author: Sudi Das <sudi.das@arm.com> Date: Fri Sep 18 15:47:46 2020 +0100 [PATCH 2/5][Arm] New pattern for CSINV instructions The original patch series makes use of the "noce" machinery to transform RTL into patterns that later match the Armv8.1-M Mainline, by getting the target hook TARGET_HAVE_CONDITIONAL_EXECUTION, to return FALSE for such targets prior to reload_completed. The same machinery however was transforming other RTL patterns which were later on causing the "ce" pass post reload_completed to no longer optimize conditional execution opportunities, which was causing the regression observed in PR target/116444, a regression of 'testsuite/gcc.target/arm/thumb-ifcvt-2.c' when ran for an Armv8.1-M Mainline target. This patch implements the target hook TARGET_NOCE_CONVERSION_PROFITABLE_P to only allow "noce" to generate patterns that match CSINV, CSINC and CSNEG. Thus ensuring that the early "ce" passes do not ruin things for later ones. gcc/ChangeLog: PR target/116444 * config/arm/arm-protos.h (arm_noce_conversion_profitable_p): New declaration. * config/arm/arm.cc (arm_is_v81m_cond_insn): New helper function used in ... (arm_noce_conversion_profitable_p): ... here. New function to implement ... (TARGET_NOCE_PROFITABLE_P): ... this target hook. New define.
2024-10-04Fixup dumping of re-trying without/with single-lane SLPRichard Biener1-3/+3
The following fixes the order of decrementing the SLP mode and the dumping. * tree-vect-loop.cc (vect_analyze_loop_2): Derement 'slp' before dumping which stage we're starting.
2024-10-04diagnostic, pch: Fix up the new diagnostic PCH methods for ubsan checking ↵Jakub Jelinek1-10/+14
[PR116936] The PR notes that the new pch_save/pch_restore methods I've added recently invoke UB if either m_classification_history.address () or m_push_list.address () is NULL (which can happen if those vectors are empty (and in the pch_save case nothing has been pushed into them before either). While the corresponding length is necessarily 0, fwrite (NULL, something, 0, f) or fread (NULL, something, 0, f) still invoke UB. The following patch fixes that by not calling fwrite/fread if the corresponding length is 0. 2024-10-04 Jakub Jelinek <jakub@redhat.com> PR pch/116936 * diagnostic.cc (diagnostic_option_classifier::pch_save): Only call fwrite if corresponding length is non-zero. (diagnostic_option_classifier::pch_restore): Only call fread if corresponding length is non-zero.
2024-10-04i386: Fix up ix86_expand_int_compare with TImode comparisons of SUBREGs from ↵Jakub Jelinek2-0/+14
V8{H,B}Fmode against zero [PR116921] The following testcase ICEs, because the ix86_expand_int_compare optimization to use {,v}ptest assumes there are instructions for all 16-byte vector modes. That isn't the case, we only have one for V16QI, V8HI, V4SI, V2DI, V1TI, V4SF and V2DF, not for V8HF nor V8BF. The following patch fixes that by using the V8HI instruction instead for those 2 modes. tmp can't be a SUBREG, because it is SUBREG_REG of another SUBREG, so we don't need to worry about gen_lowpart failing. 2024-10-04 Jakub Jelinek <jakub@redhat.com> PR target/116921 * config/i386/i386-expand.cc (ix86_expand_int_compare): Add a SUBREG to V8HImode from V8HFmode or V8BFmode before generating a ptest. * gcc.target/i386/pr116921.c: New test.
2024-10-04i386: Fix up *minmax<mode>3_2 splitter [PR116925]Jakub Jelinek2-1/+13
While *minmax<mode>3_1 correctly uses if (MEM_P (operands[1])) operands[1] = force_reg (<MODE>mode, operands[1]); to ensure operands[1] is not a MEM, *minmax<mode>3_2 does it wrongly by calling force_reg but ignoring its return value. The following borderingly obvious patch fixes that. Didn't find similar other errors in the backend with force_reg calls. 2024-10-04 Jakub Jelinek <jakub@redhat.com> PR target/116925 * config/i386/sse.md (*minmax<mode>3_2): Assign force_reg result back to operands[2] instead of throwing it away. * g++.target/i386/avx-pr116925.C: New test.
2024-10-04c++: Allow references to internal-linkage vars in C++11 [PR113266]Nathaniel Shead2-5/+31
[temp.arg.nontype] changed in C++11 to allow naming internal-linkage variables and functions. We currently already handle internal-linkage functions, but variables were missed; this patch updates this. PR c++/113266 PR c++/116911 gcc/cp/ChangeLog: * parser.cc (cp_parser_template_argument): Allow internal-linkage variables since C++11. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/nontype6.C: New test. Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
2024-10-04c++: Return the underlying decl rather than the USING_DECL from ↵Nathaniel Shead2-2/+15
update_binding [PR116913] Users of pushdecl assume that the returned decl will be a possibly updated decl matching the one that was passed in. My r15-3910 change broke this since in some cases we would now return USING_DECLs; this patch fixes the situation. PR c++/116913 gcc/cp/ChangeLog: * name-lookup.cc (update_binding): Return the strip_using'd old decl rather than the binding. gcc/testsuite/ChangeLog: * g++.dg/lookup/using70.C: New test. Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
2024-10-04Relax gcc.dg/vect/pr65947-8.cRichard Biener1-1/+1
When failing using forced SLP we do not print the non-SLP failure mode which reads slightly different. Massage the expectation a bit. * gcc.dg/vect/pr65947-8.c: Adjust.
2024-10-04libstdc++: Replace implicit lambda capture of 'this' [PR116964]Jonathan Wakely1-6/+6
C++20 deprecates implicit capture of 'this', so change [=] to [this] for all lambda expressions in <shared_mutex>. This only shows up on targets where _GLIBCXX_USE_PTHREAD_RWLOCK_T is not defined, as we have an alternative implementation of shared mutexes in that case. libstdc++-v3/ChangeLog: PR libstdc++/116964 * include/std/shared_mutex (__shared_mutex_cv): Use [this] for lambda captures. (shared_timed_mutex) [!_GLIBCXX_USE_PTHREAD_RWLOCK_T]: Likewise.
2024-10-04tree-optimization/99856 - fix testcaseRichard Biener1-2/+2
When making the testcase use aligned accesses I botched up the copy&paste. Fixed. PR tree-optimization/99856 * gcc.dg/vect/pr99856.c: Fix copy&paste errors.
2024-10-04testsuite: fix two newly-running -Wstringop-overflow test directivesSam James2-6/+6
This didn't show up until the previous commit which fixed the directive syntax. The indexing was off for the notes. gcc/testsuite/ChangeLog: * gcc.dg/Wstringop-overflow-79.c: Fix index for notes. * gcc.dg/Wstringop-overflow-80.c: Ditto.
2024-10-04testsuite: add missing braces around dejagnu directivesSam James4-30/+30
gcc/testsuite/ChangeLog: * c-c++-common/analyzer/flex-without-call-summaries.c: Add missing brace. * c-c++-common/analyzer/malloc-callbacks.c: Ditto. * gcc.dg/Wstringop-overflow-79.c: Ditto. * gcc.dg/Wstringop-overflow-80.c: Ditto.
2024-10-04testsuite - Fix gcc.c-torture/execute/ieee/pr108540-1.cGeorg-Johann Lay2-3/+10
PR testsuite/108540 gcc/testsuite/ * gcc.c-torture/execute/ieee/pr108540-1.c: Un-preprocess __SIZE_TYPE__ and __INT64_TYPE__. * gcc.c-torture/execute/ieee/pr108540-1.x: New file, requires double64.
2024-10-04doc: Drop GCC 2.6 ABI change note for H8/h8300-hmsGerald Pfeifer1-5/+0
gcc: PR target/69374 * doc/install.texi (Specific) <h8300-hms>: Drop GCC 2.6 ABI change note.
2024-10-04gcc: fix typo in gimplifySam James1-1/+1
gcc/ChangeLog: * gimplify.cc (gimple_add_init_for_auto_var): Fix 'variable' typo.
2024-10-04testsuite: gnat.dg: fix dg-do directive syntaxSam James3-3/+3
Fix incorrect use of '[' rather than '{' in 'dg-...' directives. gcc/testsuite/ChangeLog: * gnat.dg/pack13.adb: Fix 'dg-...' directive syntax. * gnat.dg/size_attribute.adb: Ditto. * gnat.dg/subp_elim_errors.adb: Ditto.
2024-10-03c++: record template specialization hashJason Merrill2-23/+23
A lot of compile time of template-heavy code is spent in re-hashing hashtable elements upon expansion. The following records the hash in the hash element. This speeds up C++20 compilation of stdc++.h by about 25% for about a 0.1% increase in memory usage. With the hash value in the entry, we don't need to pass it separately to the find functions. Adding default arguments to the spec and hash fields simplifies spec_entry initialization and avoids problems from hash starting with an indeterminate value. gcc/cp/ChangeLog: * cp-tree.h (spec_entry::hash): New member. * pt.cc (spec_hasher::hash): Set it and return it. (maybe_process_partial_specialization): Clear it when changing tmpl/args. (lookup_template_class): Likewise, don't pass hash to find. (retrieve_specialization): Set it, don't pass hash to find. (register_specialization): Don't pass hash to find. (reregister_specialization): Likewise. (match_mergeable_specialization): Likewise. (add_mergeable_specialization): Likewise. Co-authored-by: Richard Biener <rguenther@suse.de>
2024-10-04Daily bump.GCC Administrator6-1/+265
2024-10-03c++: free garbage vec in coerce_template_parmsJason Merrill1-1/+9
coerce_template_parms can create two different vecs for the inner template arguments, new_inner_args and (potentially) the result of expand_template_argument_pack. One or the other, or possibly both, end up being garbage: in the typical case, the expanded vec is garbage because it's only used as the source for convert_template_argument. In some dependent cases, the new vec is garbage because we decide to return the original args instead. In these cases, ggc_free the garbage vec to reduce the memory overhead of overload resolution. gcc/cp/ChangeLog: * pt.cc (coerce_template_parms): Free garbage vecs. Co-authored-by: Richard Biener <rguenther@suse.de>
2024-10-03Aarch64: Define WIDEST_HARDWARE_FP_SIZEEric Botcazou2-0/+14
The macro is documented like this in the internal manual: -- Macro: WIDEST_HARDWARE_FP_SIZE A C expression for the size in bits of the widest floating-point format supported by the hardware. If you define this macro, you must specify a value less than or equal to mode precision of the mode used for C type 'long double' (from hook 'targetm.c.mode_for_floating_type' with argument 'TI_LONG_DOUBLE_TYPE'). If you do not define this macro, mode precision of the mode used for C type 'long double' is the default. AArch64 uses 128-bit TFmode for long double but, as far as I know, no FPU implemented in hardware supports it. gcc/ * config/aarch64/aarch64.h (WIDEST_HARDWARE_FP_SIZE): Define to 64. gcc/testsuite/ * gnat.dg/specs/size_clause6.ads: New test.
2024-10-03Revert "c++: free garbage vec in coerce_template_parms"Jason Merrill1-30/+6
This broke bootstrap, improving. This reverts commit 5b08ae503dd4aef2789a667daaf1984e7cc94aaa.
2024-10-03c++: -Wdeprecated enables later standard deprecationsJason Merrill2-11/+28
By default -Wdeprecated warns about deprecations in the active standard. When specified explicitly, let's also warn about deprecations in later standards. gcc/c-family/ChangeLog: * c-opts.cc (c_common_post_options): Explicit -Wdeprecated enables deprecations from later standards. gcc/ChangeLog: * doc/invoke.texi: Explicit -Wdeprecated enables more warnings.
2024-10-03c++: add -Wdeprecated-literal-operator [CWG2521]Jason Merrill77-315/+373
C++23 CWG issue 2521 (https://wg21.link/cwg2521) deprecates user-defined literal operators declared with the optional space between "" and the suffix. Many testcases used that syntax; I removed the space from most of them, and added C++23 warning tests to a few. CWG 2521 gcc/ChangeLog: * doc/invoke.texi: Document -Wdeprecated-literal-operator. gcc/c-family/ChangeLog: * c.opt: Add -Wdeprecated-literal-operator. * c-opts.cc (c_common_post_options): Default on in C++23. * c.opt.urls: Regenerate. gcc/cp/ChangeLog: * parser.cc (location_between): New. (cp_parser_operator): Handle -Wdeprecated-literal-operator. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/udlit-string-literal.h * g++.dg/cpp0x/Wliteral-suffix2.C * g++.dg/cpp0x/constexpr-55708.C * g++.dg/cpp0x/gnu_fext-numeric-literals.C * g++.dg/cpp0x/gnu_fno-ext-numeric-literals.C * g++.dg/cpp0x/pr51420.C * g++.dg/cpp0x/pr60209-neg.C * g++.dg/cpp0x/pr60209.C * g++.dg/cpp0x/pr61038.C * g++.dg/cpp0x/std_fext-numeric-literals.C * g++.dg/cpp0x/std_fno-ext-numeric-literals.C * g++.dg/cpp0x/udlit-addr.C * g++.dg/cpp0x/udlit-args-neg.C * g++.dg/cpp0x/udlit-args.C * g++.dg/cpp0x/udlit-args2.C * g++.dg/cpp0x/udlit-clink-neg.C * g++.dg/cpp0x/udlit-concat-neg.C * g++.dg/cpp0x/udlit-concat.C * g++.dg/cpp0x/udlit-constexpr.C * g++.dg/cpp0x/udlit-cpp98-neg.C * g++.dg/cpp0x/udlit-declare-neg.C * g++.dg/cpp0x/udlit-embed-quote.C * g++.dg/cpp0x/udlit-extended-id-1.C * g++.dg/cpp0x/udlit-extended-id-3.C * g++.dg/cpp0x/udlit-extern-c.C * g++.dg/cpp0x/udlit-friend.C * g++.dg/cpp0x/udlit-general.C * g++.dg/cpp0x/udlit-implicit-conv-neg-char8_t.C * g++.dg/cpp0x/udlit-implicit-conv-neg.C * g++.dg/cpp0x/udlit-inline.C * g++.dg/cpp0x/udlit-mangle.C * g++.dg/cpp0x/udlit-member-neg.C * g++.dg/cpp0x/udlit-namespace.C * g++.dg/cpp0x/udlit-nofunc-neg.C * g++.dg/cpp0x/udlit-nonempty-str-neg.C * g++.dg/cpp0x/udlit-nosuffix-neg.C * g++.dg/cpp0x/udlit-nounder-neg.C * g++.dg/cpp0x/udlit-operator-neg.C * g++.dg/cpp0x/udlit-overflow-neg.C * g++.dg/cpp0x/udlit-overflow.C * g++.dg/cpp0x/udlit-preproc-neg.C * g++.dg/cpp0x/udlit-raw-length.C * g++.dg/cpp0x/udlit-raw-op-string-neg.C * g++.dg/cpp0x/udlit-raw-op.C * g++.dg/cpp0x/udlit-raw-str.C * g++.dg/cpp0x/udlit-resolve-char8_t.C * g++.dg/cpp0x/udlit-resolve.C * g++.dg/cpp0x/udlit-shadow-neg.C * g++.dg/cpp0x/udlit-string-length.C * g++.dg/cpp0x/udlit-suffix-neg.C * g++.dg/cpp0x/udlit-template.C * g++.dg/cpp0x/udlit-tmpl-arg-neg.C * g++.dg/cpp0x/udlit-tmpl-arg-neg2.C * g++.dg/cpp0x/udlit-tmpl-arg.C * g++.dg/cpp0x/udlit-tmpl-parms-neg.C * g++.dg/cpp0x/udlit-tmpl-parms.C * g++.dg/cpp1y/pr57640.C * g++.dg/cpp1y/pr88872.C * g++.dg/cpp26/unevalstr1.C * g++.dg/cpp2a/concepts-pr60391.C * g++.dg/cpp2a/consteval-prop21.C * g++.dg/cpp2a/nontype-class6.C * g++.dg/cpp2a/udlit-class-nttp-ctad-neg.C * g++.dg/cpp2a/udlit-class-nttp-ctad-neg2.C * g++.dg/cpp2a/udlit-class-nttp-ctad.C * g++.dg/cpp2a/udlit-class-nttp-neg.C * g++.dg/cpp2a/udlit-class-nttp-neg2.C * g++.dg/cpp2a/udlit-class-nttp.C * g++.dg/ext/is_convertible2.C * g++.dg/lookup/pr87269.C * g++.dg/cpp0x/udlit_system_header: Adjust for C++23 deprecated operator "" _suffix. * g++.dg/DRs/dr2521.C: New test.
2024-10-03c++: free garbage vec in coerce_template_parmsJason Merrill1-6/+30
coerce_template_parms can create two different vecs for the inner template arguments, new_inner_args and (potentially) the result of expand_template_argument_pack. One or the other, or possibly both, end up being garbage: in the typical case, the expanded vec is garbage because it's only used as the source for convert_template_argument. In some dependent cases, the new vec is garbage because we decide to return the original args instead. In these cases, ggc_free the garbage vec to reduce the memory overhead of overload resolution. gcc/cp/ChangeLog: * pt.cc (struct free_if_changed_proxy): New. (coerce_template_parms): Use it. Co-authored-by: Richard Biener <rguenther@suse.de>
2024-10-03AVR: Make gcc.dg/c23-stdarg-9.c work.Georg-Johann Lay1-0/+5
gcc/testsuite/ * gcc.dg/c23-stdarg-9.c (struct S) [AVR]: Only use int a[500].