Re: [PATCH] Always define `WIN32_LEAN_AND_MEAN` before

2023-01-06 Thread Jonathan Yong via Gcc-patches
On 1/6/23 18:10, Jakub Jelinek wrote: On Sat, Jan 07, 2023 at 02:01:05AM +0800, LIU Hao via Gcc-patches wrote: libgomp/ PR middle-end/108300 * config/mingw32/proc.c: Define `WIN32_LEAN_AND_MEAN` before . This change is ok for trunk. Jakub Pushed to master b

[PATCH] xtensa: Optimize bitwise splicing operation

2023-01-06 Thread Takayuki 'January June' Suwa via Gcc-patches
This patch optimizes the operation of cutting and splicing two register values at a specified bit position, in other words, combining (bitwise ORing) bits 0 through (C-1) of the register with bits C through 31 of the other, where C is the specified immediate integer 1 through 31. This typically ap

[PATCH v2] xtensa: Optimize stack frame adjustment more

2023-01-06 Thread Takayuki 'January June' Suwa via Gcc-patches
This patch introduces a convenient helper function for integer immediate addition with scratch register as needed, that splits and emits either up to two ADDI/ADDMI machine instructions or an addition by register following an integer immediate load (which may later be transformed by constantsynth).

Re: [PATCH] xtensa: Optimize stack frame adjustment more

2023-01-06 Thread Takayuki 'January June' Suwa via Gcc-patches
On 2023/01/06 17:05, Max Filippov wrote: > On Thu, Jan 5, 2023 at 10:57 PM Takayuki 'January June' Suwa > wrote: >> By using the helper function, it makes stack frame adjustment logic >> simplified and instruction count less in some cases. > > I've built a couple linux configurations with and wit

Re: [RFC/PATCH] Remove the workaround for _Float128 precision [PR107299]

2023-01-06 Thread Michael Meissner via Gcc-patches
On Wed, Dec 21, 2022 at 09:40:24PM +, Joseph Myers wrote: > On Wed, 21 Dec 2022, Segher Boessenkool wrote: > > > > --- a/gcc/tree.cc > > > +++ b/gcc/tree.cc > > > @@ -9442,15 +9442,6 @@ build_common_tree_nodes (bool signed_char) > > >if (!targetm.floatn_mode (n, extended).exists (&mode

[PATCH, modula2] PR-108182 gm2 driver mishandles target and multilib options

2023-01-06 Thread Gaius Mulley via Gcc-patches
ChangeLog entry follows: regards, Gaius [PATCH, modula2] PR-108182 gm2 driver mishandles target and multilib options here are some patches which attempt to allow target specific include paths and library paths in the gm2 driver. I admit that the patch has flaws in that it only processes op

[PATCH, modula2] PR-108182 gm2 driver mishandles target and multilib options

2023-01-06 Thread Gaius Mulley via Gcc-patches
Hi, here are some patches which attempt to allow target specific include paths and library paths in the gm2 driver. I admit that the patch has flaws in that it only processes options -f, -m in the lang_specific_driver. [Called after driver::set_up_specs but before read_specs is called]. I susp

[committed] libstdc++: Suppress -Waddress warning in tzdb.cc [PR108228]

2023-01-06 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux and powerpc-aix. Pushed to trunk. -- >8 -- For some tarets the weak symbol is always defined, so we get a warning that its address is never null. The warning isn't useful in this case, so suppress it. libstdc++-v3/ChangeLog: PR libstdc++/108228 * src/c++20/tz

[committed] libstdc++: Refactor time_zone::_Impl::rules_counter [PR108235]

2023-01-06 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux and powerpc-aix. Pushed to trunk. -- >8 -- Abstract the atomic counter used to synchronize access to time_zone infos behind a Lockable class API, and use atomic_signed_lock_free instead of atomic, as that should be the most efficient type. (For futex-supporting targets it make

[committed] c: C2x semantics for __builtin_tgmath

2023-01-06 Thread Joseph Myers
__builtin_tgmath implements semantics for integer generic arguments that handle cases involving _FloatN / _FloatNx types as specified in TS 18661-3 plus some defect fixes. C2x has further changes to the semantics for macros with such types, which should also be considered defect fixes (although

Re: [PATCH] Remove legacy pre-C++ 11 definitions

2023-01-06 Thread Jonathan Wakely via Gcc-patches
On Fri, 6 Jan 2023, 17:21 Andrew Pinski, wrote: > On Fri, Jan 6, 2023 at 4:21 AM Martin Liška wrote: > > > > As mentioned in the PRs, both are defined in C++ 11 > > which is a version we depend on. > > > > Ready to be installed now? > > There is another #define NULL below: > /* System headers ma

Re: [PATCH] Always define `WIN32_LEAN_AND_MEAN` before

2023-01-06 Thread Jakub Jelinek via Gcc-patches
On Sat, Jan 07, 2023 at 02:01:05AM +0800, LIU Hao via Gcc-patches wrote: > libgomp/ > > PR middle-end/108300 > * config/mingw32/proc.c: Define `WIN32_LEAN_AND_MEAN` before > . This change is ok for trunk. Jakub

[PATCH] Always define `WIN32_LEAN_AND_MEAN` before

2023-01-06 Thread LIU Hao via Gcc-patches
This fixes bootstrap issues with current mingw-w64 headers: ``` ../../gcc/gcc/system.h:791:30: error: expected identifier before string constant 791 | #define abort() fancy_abort (__FILE__, __LINE__, __FUNCTION__) | ^~~~ ``` The changes i

libbacktrace patch committed: Only test --build-id if supported

2023-01-06 Thread Ian Lance Taylor via Gcc-patches
PR 108297 points out that there are systems that use ELF but for which the linker does not support the --build-id option. This libbacktrace patch skips --build-id tests when it doesn't work. Bootstrapped and ran libbacktrace tests on x86_64-pc-linux-gnu. Committed to mainline. Ian PR libbacktr

Re: [PATCH] Remove legacy pre-C++ 11 definitions

2023-01-06 Thread Andrew Pinski via Gcc-patches
On Fri, Jan 6, 2023 at 4:21 AM Martin Liška wrote: > > As mentioned in the PRs, both are defined in C++ 11 > which is a version we depend on. > > Ready to be installed now? There is another #define NULL below: /* System headers may define NULL to be an integer (e.g. 0L), which cannot be used s

Re: [PATCH] ipa: Sort ipa_param_body_adjustments::m_replacements (PR 108110)

2023-01-06 Thread Martin Jambor
Hi, On Fri, Jan 06 2023, Martin Liška wrote: > Hi Martin > >> + key.unit_offset = unit_offset; >> + ipa_param_body_replacement *res >> += std::lower_bound (m_replacements.begin (), m_replacements.end (), key, >> +[] (const ipa_param_body_replacement &elt, >> +

Re: [PATCH] libstdc++: Add feature-test macros for implemented C++23 views [PR108260]

2023-01-06 Thread Jonathan Wakely via Gcc-patches
On Fri, 6 Jan 2023 at 15:07, Patrick Palka via Libstdc++ wrote: > > On Fri, 6 Jan 2023, Patrick Palka wrote: > > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk? > > > > PR libstdc++/108620 > > > > libstdc++-v3/ChangeLog: > > > > * include/bits/utility.h (__cpp_lib_ranges_

Re: [PATCH] libstdc++: Add feature-test macros for implemented C++23 views [PR108260]

2023-01-06 Thread Patrick Palka via Gcc-patches
On Fri, 6 Jan 2023, Patrick Palka wrote: > Tested on x86_64-pc-linux-gnu, does this look OK for trunk? > > PR libstdc++/108620 > > libstdc++-v3/ChangeLog: > > * include/bits/utility.h (__cpp_lib_ranges_zip): Define. > * include/std/ranges (__cpp_lib_ranges_zip): Define. >

[PATCH] libstdc++: Add feature-test macros for implemented C++23 views [PR108260]

2023-01-06 Thread Patrick Palka via Gcc-patches
Tested on x86_64-pc-linux-gnu, does this look OK for trunk? PR libstdc++/108620 libstdc++-v3/ChangeLog: * include/bits/utility.h (__cpp_lib_ranges_zip): Define. * include/std/ranges (__cpp_lib_ranges_zip): Define. (__cpp_lib_ranges_chunk): Define. (__cpp_l

[committed] libstdc++: Fix misuse of alloca in std::bitset [PR108214]

2023-01-06 Thread Jonathan Wakely via Gcc-patches
I done a silly. Tested x86_64-linux, pushed to trunk. -- >8 -- The use of alloca in a constructor is wrong, because the memory is gone after the constructor returns, and will be overwritten by a subsequent function call. This didn't show up in testing because function inlining alters the stack us

[committed] libstdc++: Disable broken std::format for floating-point types [PR108221]

2023-01-06 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, built (but not tested) on h8300-elf. Pushed to trunk. -- >8 -- If we don't have std::to_chars for floating-point types (either because float and double are not IEEE format, or size_t is 16-bit) then we can't use them with std::format. This causes a bootstrap failure since st

Re: [PATCH] diagnostics: fix crash with -fdiagnostics-format=json-file

2023-01-06 Thread David Malcolm via Gcc-patches
On Fri, 2023-01-06 at 12:33 +0100, Martin Liška wrote: > Patch can bootstrap on x86_64-linux-gnu and survives regression > tests. Thanks for the patch. I noticed that you marked PR 108307 as a dup of this, which covers -fdiagnostics-format=sarif-file (and a .S file as input). The patch doesn't a

[PATCH] rs6000: mark tieable between INT and FLOAT

2023-01-06 Thread Jiufu Guo via Gcc-patches
Hi, During discussing/review patches in maillist, we find more modes are tieable, e.g. DI<->DF. With some discussion, I drafted this patch to mark more tieable modes. Bootstrap and regtest pass on ppc64{,le}. Is this ok for trunk? BR, Jeff (Jiufu) gcc/ChangeLog: * config/rs6000/rs6000

[PATCH] Remove legacy pre-C++ 11 definitions

2023-01-06 Thread Martin Liška
As mentioned in the PRs, both are defined in C++ 11 which is a version we depend on. Ready to be installed now? Thanks, Martin PR middle-end/108311 PR middle-end/108312 gcc/ChangeLog: * system.h (va_copy): Remove as it is defined in C++ 11. (NULL): Likewise. ---

Re: [PATCH 3/3] vect: inbranch SIMD clones

2023-01-06 Thread Andrew Stubbs
Here's a new version of the patch. On 01/12/2022 14:16, Jakub Jelinek wrote: +void __attribute__((noinline)) You should use noipa attribute instead of noinline on callers which aren't declare simd (on declare simd it would prevent cloning which is essential for the declare simd behavior), so t

[committed] libstdc++: Fix deadlock in debug iterator increment [PR108288]

2023-01-06 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. I think we should backport this too, after some soak time on trunk. -- >8 -- With -fno-elide-constructors the debug iterator post-increment and post-decrement operators are susceptible to deadlock. They take a mutex lock and then return a temporary, which al

Re: [PATCH] ipa: Sort ipa_param_body_adjustments::m_replacements (PR 108110)

2023-01-06 Thread Martin Liška
Hi Martin > + key.unit_offset = unit_offset; > + ipa_param_body_replacement *res > += std::lower_bound (m_replacements.begin (), m_replacements.end (), key, > + [] (const ipa_param_body_replacement &elt, > + const ipa_param_body_replacement &val) >

[PATCH] diagnostics: fix crash with -fdiagnostics-format=json-file

2023-01-06 Thread Martin Liška
Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin PR middle-end/106133 gcc/ChangeLog: * diagnostic.cc (diagnostic_output_format_init): If -fdiagnostics-format=json-file and -E is used, then base_file_name

[wwwdocs] Fix typo in libstdc++ release notes

2023-01-06 Thread Jonathan Wakely via Gcc-patches
The monadic ops for std::optional were in GCC 12, I meant to say std::expected in the GCC 13 release notes. --- htdocs/gcc-13/changes.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/gcc-13/changes.html b/htdocs/gcc-13/changes.html index d9879d79..41a117b4 100644 --

[wwwdocs] Document libstdc++ additions for GCC 12 and 13

2023-01-06 Thread Jonathan Wakely via Gcc-patches
Pushed to wwwdocs. --- htdocs/gcc-12/changes.html | 1 + htdocs/gcc-13/changes.html | 18 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/htdocs/gcc-12/changes.html b/htdocs/gcc-12/changes.html index b3775f82..1cefaf13 100644 --- a/htdocs/gcc-12/changes.html +++

[PATCH] libsanitizer/mips: always build with largefile support

2023-01-06 Thread YunQiang Su
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 is always used for mips when build libsanitizer in LLVM. Thus FIRST_32_SECOND_64((_MIPS_SIM == _ABIN32) ? 176 : 160, 216); instead of FIRST_32_SECOND_64((_MIPS_SIM == _ABIN32) ? 160 : 144, 216); in sanitizer_platform_limits_posix.h. To keep sync wit

[PATCH] Set CROSS_SYSTEM_HEADER_DIR according includedir

2023-01-06 Thread YunQiang Su
For cross building with option: --sysroot=/ --prefix=/usr --includedir=/usr/ just like Debian does, fixinc.sh will use the wrong header files from /usr/include. gcc/ * Makefile.in (CROSS_SYSTEM_HEADER_DIR): set according the value of includedir. --- gcc/Makefile.in | 6 +-

[committed] testsuite: Add testcases from PR108292 and PR108308

2023-01-06 Thread Jakub Jelinek via Gcc-patches
Hi! These PRs were for now fixed by reversion of the r13-4977 patch, but so that the problems don't reappear during stage 1, I'm adding testcase coverage from those PRs. Tested on x86_64-linux -m32/-m64 before r13-5038 (where all tests FAIL) and after it (where they PASS), committed to trunk as o

Re: [PATCH] rs6000: Make P10_FUSION honour tuning setting

2023-01-06 Thread Kewen.Lin via Gcc-patches
Hi Pat, on 2023/1/6 03:30, Pat Haugen wrote: > On 1/4/23 3:20 AM, Kewen.Lin via Gcc-patches wrote: >> diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc >> index 88c865b6b4b..6fa084c0807 100644 >> --- a/gcc/config/rs6000/rs6000.cc >> +++ b/gcc/config/rs6000/rs6000.cc >> @@ -437

[PATCH] rs6000: Allow powerpc64 to be unset for implicit 64 bit [PR108240]

2023-01-06 Thread Kewen.Lin via Gcc-patches
Hi, Before r13-4894, if 64 bit is explicitly specified, option powerpc64 is explicitly enabled too; while if 64 bit is implicitly enabled and there is no explicit setting for option powerpc64, option powerpc64 is eventually enabled or not would rely on the default value of the used cpu. It's initi

[PATCH] rs6000: Teach rs6000_opaque_type_invalid_use_p about inline asm [PR108272]

2023-01-06 Thread Kewen.Lin via Gcc-patches
Hi, As PR108272 shows, there are some invalid uses of MMA opaque types in inline asm statements. This patch is to teach the function rs6000_opaque_type_invalid_use_p for inline asm, check and error any invalid use of MMA opaque types in input and output operands. Bootstrapped and regtested on po

Re: [PATCH] configure: remove dependencies on gmp and mpfr when gdb is disabled

2023-01-06 Thread Richard Biener via Gcc-patches
> Am 06.01.2023 um 09:44 schrieb Clément Chigot via Gcc-patches > : > > On Fri, Jan 6, 2023 at 9:39 AM Clément Chigot wrote: >> >> Since 91e0d22025e0bf2af2e364cb7214a05512a0c431, the configure checks >> about GMP and MPFR for gdb builds have been moved to the toplevel >> configure. >> Howev

Re: [PATCH] configure: remove dependencies on gmp and mpfr when gdb is disabled

2023-01-06 Thread Clément Chigot via Gcc-patches
On Fri, Jan 6, 2023 at 9:39 AM Clément Chigot wrote: > > Since 91e0d22025e0bf2af2e364cb7214a05512a0c431, the configure checks > about GMP and MPFR for gdb builds have been moved to the toplevel > configure. > However, it doesn't take into account the --disable-gdb option. Meaning > that a build wi

[PATCH] configure: remove dependencies on gmp and mpfr when gdb is disabled

2023-01-06 Thread Clément Chigot via Gcc-patches
Since 91e0d22025e0bf2af2e364cb7214a05512a0c431, the configure checks about GMP and MPFR for gdb builds have been moved to the toplevel configure. However, it doesn't take into account the --disable-gdb option. Meaning that a build without gdb will require these libraries even if not needed. Change

[PATCH] Handle Windows nul device in unlink-if-ordinary.c

2023-01-06 Thread anothername27-unity--- via Gcc-patches
From: Himal Hi, This might be a better fix. Regards. PS. I had to use a different email. --- libiberty/unlink-if-ordinary.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/libiberty/unlink-if-ordinary.c b/libiberty/unlink-if-ordinary.c index 84328b216..e765ac8b1 100644 --- a/libibe

[PATCH] Handle Windows nul device in unlink-if-ordinary.c

2023-01-06 Thread anothername27-unity--- via Gcc-patches
From: Himal Hi, This might be a better fix. Thanks. --- libiberty/unlink-if-ordinary.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/libiberty/unlink-if-ordinary.c b/libiberty/unlink-if-ordinary.c index 84328b216..e765ac8b1 100644 --- a/libiberty/unlink-if-ordinary.c +++ b/libiber

Re: [PATCH] xtensa: Optimize stack frame adjustment more

2023-01-06 Thread Max Filippov via Gcc-patches
On Thu, Jan 5, 2023 at 10:57 PM Takayuki 'January June' Suwa wrote: > By using the helper function, it makes stack frame adjustment logic > simplified and instruction count less in some cases. I've built a couple linux configurations with and without this change and I observe consistent code size