[PATCH] c++: testsuite: require lto_incremental in pr90990_0.C

2022-06-20 Thread Alexandre Oliva via Gcc-patches
Other LTO tests that use -r require the lto_incremental effective target. I suppose pr90990_0.C is missing it due to an oversight. This patch arranges for this test to also be skipped on non-lto_incremental targets. Regstrapped on x86_64-linux-gnu, also tested with a cross to aarch64-rtems6.

[PATCH] Introduce -nolibstdc++ option

2022-06-20 Thread Alexandre Oliva via Gcc-patches
Using g++ to link without libstdc++, as in g++.dg/abi/pure-virtual1.C, is error prone, because there's no way to tell g++ to drop libstdc++ without also dropping libc and any other libraries that the target implicitly links in. This has often led to the need for manual adjustments to this

[PATCH] libstdc++: testsuite: call sched_yield for nonpreemptive targets

2022-06-20 Thread Alexandre Oliva via Gcc-patches
As in the gcc testsuite, systems without preemptive multi-threading require sched_yield calls to be placed at points in which a context switch might be needed to enable the test to complete. Regstrapped on x86_64-linux-gnu, also tested with a cross to aarch64-rtems6. Ok to install? for

[PATCH] testsuite: pthread: call sched_yield for non-preemptive targets

2022-06-20 Thread Alexandre Oliva via Gcc-patches
Systems without preemptive multi-threading require sched_yield calls to be placed at points in which a context switch might be needed to enable the test to complete. Regstrapped on x86_64-linux-gnu, also tested with a cross to aarch64-rtems6. Ok to install? for gcc/testsuite/ChangeLog

[PATCH] testsuite: outputs.exp: cleanup before running tests (was: Re: [PATCH] testsuite: outputs.exp: test for skip_atsave more thoroughly)

2022-06-20 Thread Alexandre Oliva via Gcc-patches
On Jun 21, 2022, Alexandre Oliva wrote: > * gcc.misc-tests/outputs.exp (outest): Introduce quiet mode, Use the just-added dry-run infrastructure to clean up files that may have been left over by interrupted runs of outputs.exp, which used to lead to spurious non-repeatable (self-fixing)

[PATCH] testsuite: outputs.exp: test for skip_atsave more thoroughly

2022-06-20 Thread Alexandre Oliva via Gcc-patches
The presence of -I or -L flags in link command lines changes the driver's, and thus the linker's behavior, WRT naming files with command-line options. With such flags, the driver creates .args.0 and .args.1 files, whereas without them it's the linker (collect2, really) that creates .ld1_args.

[PATCH] aarch64: testsuite: symbol-range compile only

2022-06-20 Thread Alexandre Oliva via Gcc-patches
On some of our embedded aarch64 targets, RAM size is too small for this test to fit. It doesn't look like this test requires linking, and if it does, the -tiny version may presumably get most of the coverage without going overboard in target system requirements. Regstrapped on

[PATCH] libstdc++-v3: testsuite: complex proj requirements

2022-06-20 Thread Alexandre Oliva via Gcc-patches
The template version of complex::proj returns its argument without testing for infinities, and that's all we have when neither C99 complex nor C99 math functions are available, and it seems too hard to do better without isinf and copysign. I suppose just calling them and expecting users will

[PATCH] libstdc++: testsuite: use cmath long double overloads

2022-06-20 Thread Alexandre Oliva via Gcc-patches
In case we need to supplement the C standard library with additional definitions for float and long double, the declarations expected to be in the C headers may not be there. Rely on the cmath overloads instead. Regstrapped on x86_64-linux-gnu, also tested with a cross to aarch64-rtems6. Ok

[PATCH] libstdc++: testsuite: require cmath for exp simd

2022-06-20 Thread Alexandre Oliva via Gcc-patches
simd_math.h assumes declarations for many C99 functions to be present, that libstdc++ doesn't add to target systems that don't have them in the C library. Add the C99 math requirement to tests for simd features, so that they don't fail because of limitations of the target C library.

[PATCH] libstdc++: testsuite: require cmath for nexttowardl

2022-06-20 Thread Alexandre Oliva via Gcc-patches
nexttowardl is only expected to be available with C99 math, but 20_util/to_chars/long_double.cc uses it unconditionally. State the cmath requirement in the test. Regstrapped on x86_64-linux-gnu, also tested with a cross to aarch64-rtems6. Ok to install? for libstdc++-v3/ChangeLog

[PATCH] libstdc++: testsuite: work around bitset namespace pollution

2022-06-20 Thread Alexandre Oliva via Gcc-patches
rtems6 declares a global struct bitset in a header file included indirectly by sys/types.h, that ambiguates the unqualified references to bitset after "using namespace std" in the testsuite. Work around the namespace pollution with using declarations of std::bitset. Regstrapped on

Re: [PATCH] x86-64: Remove HAVE_LD_PIE_COPYRELOC

2022-06-20 Thread Fangrui Song via Gcc-patches
On Wed, Jun 15, 2022 at 2:34 AM Fangrui Song wrote: > > This was introduced in 2014-12 to use local binding for external symbols > for -fPIE. It avoids a GOT indirection but the same optimizationis > obtained with ld's R_X86_64_[REX_]GOTPCRELX optimization (albeit with > slightly longer code). >

Re: [PATCH] Revert "[PATCH] RISC-V: Use new linker emulations for glibc ABI."

2022-06-20 Thread Fangrui Song via Gcc-patches
On Mon, Jun 20, 2022 at 1:21 AM Kito Cheng wrote: > > Generally I agree we should fix that by GCC driver rather than ld > emulation, but I think this should be reverted with the -L path fix, > otherwise that will break multilib on GNU toolchain for linux > immediately? Thanks for the good

Re: [PATCH] if-to-switch: Don't skip the first condition bb when find_conditions in if-to-switch [PR105740]

2022-06-20 Thread Xionghu Luo via Gcc-patches
Correct the format...  test2: .LFB0:         .cfi_startproc         xorl    %edx, %edx         cmpl    $3, (%rdi)         jle     .L1         movl    16(%rdi), %eax         cmpl    $1, %eax         je      .L4         subl    $2, %eax         cmpl    $4, %eax         ja      .L1         movl    

Re: [PING][PATCH][WIP] have configure probe prefix for gmp/mpfr/mpc [PR44425]

2022-06-20 Thread Alexandre Oliva via Gcc-patches
Hello, Eric, On Jun 9, 2022, Eric Gallager wrote: > (cc-ing the build machinery maintainers listed in MAINTAINERS this time) Thanks, I'd missed it the first time. > On Thu, Jun 2, 2022 at 11:53 AM Eric Gallager wrote: >> So, I'm working on fixing PR bootstrap/44425, and have this patch to

[PATCH] if-to-switch: Don't skip the first condition bb when find_conditions in if-to-switch [PR105740]

2022-06-20 Thread 罗雄虎
Current GCC generates: test2: .LFB0: .cfi_startproc xorl %edx, %edx cmpl $3, (%rdi) jle .L1 movl 16(%rdi), %eax cmpl $1, %eax je .L4 subl $2, %eax cmpl $4, %eax ja .L1 movl CSWTCH.1(,%rax,4), %edx .L1: movl %edx, %eax ret

RE: [PATCH] i386: Add syscall to enable AMX for latest kernels

2022-06-20 Thread Jiang, Haochen via Gcc-patches
> -Original Message- > From: Uros Bizjak > Sent: Monday, June 20, 2022 10:54 PM > To: Jiang, Haochen > Cc: gcc-patches@gcc.gnu.org; Liu, Hongtao > Subject: Re: [PATCH] i386: Add syscall to enable AMX for latest kernels > > On Mon, Jun 20, 2022 at 10:04 AM Haochen Jiang > wrote: > > >

Re: [rs6000 PATCH] PR target/105991: Recognize PLUS and XOR forms of rldimi.

2022-06-20 Thread Kewen.Lin via Gcc-patches
on 2022/6/21 06:10, Segher Boessenkool wrote: > Hi! > > On Fri, Jun 17, 2022 at 07:13:37AM +0200, Roger Sayle wrote: >> This patch addresses PR target/105991 where a change to prefer representing >> shifts and adds at the tree-level as multiplications, causes problems for >> the rldimi patterns

Re: [PATCH 2/2]middle-end: Support recognition of three-way max/min.

2022-06-20 Thread Andrew Pinski via Gcc-patches
On Thu, Jun 16, 2022 at 4:11 AM Tamar Christina via Gcc-patches wrote: > > Hi All, > > This patch adds support for three-way min/max recognition in phi-opts. > > Concretely for e.g. > > #include > > uint8_t three_min (uint8_t xc, uint8_t xm, uint8_t xy) { > uint8_t xk; > if (xc <

Re: [PATCH v5, rs6000] Implemented f[min/max]_optab by xs[min/max]dp [PR103605]

2022-06-20 Thread Segher Boessenkool
Hi! On Mon, Jun 20, 2022 at 11:12:50AM +0800, HAO CHEN GUI wrote: > --- a/gcc/config/rs6000/rs6000-builtins.def > +++ b/gcc/config/rs6000/rs6000-builtins.def You don't have this in the changelog. Please fix. > --- a/gcc/config/rs6000/rs6000.md > +++ b/gcc/config/rs6000/rs6000.md This, too.

Re: [PATCH] c: Extend the -Wpadded message with actual padding size

2022-06-20 Thread Andrew Pinski via Gcc-patches
On Mon, Jun 20, 2022 at 6:50 AM Vit Kabele wrote: > > I fixed the formatting and added the test. > > The test has first element 32bit so that it should work on both 32 and > 64bit architectures, even without the aligned attribute. > > If there is some better way how to write the test properly

[PATCH] tsystem.h: Add missing stdint.h include.

2022-06-20 Thread Kacper Słomiński via Gcc-patches
Users of tsystem.h expect stdint.h to be included (for example, gcc/gcov-io.h included by libgcc/libgcov.h), but it is not included, and it is not provided by any other header included here according to POSIX. gcc/ChangeLog: * tsystem.h: Add missing stdint.h include. --- Proposed fix for

Re: [rs6000 PATCH] PR target/105991: Recognize PLUS and XOR forms of rldimi.

2022-06-20 Thread Segher Boessenkool
Hi! On Fri, Jun 17, 2022 at 07:13:37AM +0200, Roger Sayle wrote: > This patch addresses PR target/105991 where a change to prefer representing > shifts and adds at the tree-level as multiplications, causes problems for > the rldimi patterns in the powerpc backend. Because it now is converted to

[PATCH v2] tree-optimization/95821 - Convert strlen + strchr to memchr

2022-06-20 Thread Noah Goldstein via Gcc-patches
This patch allows for strchr(x, c) to the replace with memchr(x, c, strlen(x) + 1) if strlen(x) has already been computed earlier in the tree. Handles PR95821: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95821 Since memchr doesn't need to re-find the null terminator it is faster than strchr.

Re: [PATCH v1] tree-optimization/95821 - Convert strlen + strchr to memchr

2022-06-20 Thread Noah Goldstein via Gcc-patches
On Mon, Jun 20, 2022 at 10:29 AM Jakub Jelinek wrote: > > On Mon, Jun 20, 2022 at 09:35:36AM -0700, Noah Goldstein via Gcc-patches > wrote: > > This patch allows for strchr(x, c) to the replace with memchr(x, c, > > strlen(x) + 1) if strlen(x) has already been computed earlier in the > > tree. >

Re: [PATCH RFA] ubsan: default to trap on unreachable at -O0 and -Og [PR104642]

2022-06-20 Thread Jason Merrill via Gcc-patches
On 6/16/22 09:14, Jakub Jelinek wrote: On Wed, Jun 15, 2022 at 04:38:49PM -0400, Jason Merrill wrote: Furthermore, handling it the UBSan way means we slow down the compiler (enable a bunch of extra passes, like sanopt, ubsan), which is undesirable e.g. for -O0 compilation speed. The ubsan

Re: [PATCH RFA] ubsan: do return check with -fsanitize=unreachable

2022-06-20 Thread Jason Merrill via Gcc-patches
On 6/20/22 07:05, Jakub Jelinek wrote: On Fri, Jun 17, 2022 at 05:20:02PM -0400, Jason Merrill wrote: Related to PR104642, the current situation where we get less return checking with just -fsanitize=unreachable than no sanitize flags seems undesirable; I propose that we do return checking when

Re: [PATCH] c++, v2: Add support for __real__/__imag__ modifications in constant expressions [PR88174]

2022-06-20 Thread Jason Merrill via Gcc-patches
On 6/17/22 13:06, Jakub Jelinek wrote: On Fri, Jun 10, 2022 at 09:57:06PM +0200, Jakub Jelinek via Gcc-patches wrote: On Fri, Jun 10, 2022 at 01:27:28PM -0400, Jason Merrill wrote: Doesn't this assert mean that complex_expr will always be == valp? No, even when handling the pushed

Re: [PATCH v1] tree-optimization/95821 - Convert strlen + strchr to memchr

2022-06-20 Thread Jakub Jelinek via Gcc-patches
On Mon, Jun 20, 2022 at 12:12:53PM -0700, Noah Goldstein wrote: > Got it. Will have that in V2. Thanks. > > We could also make the initial: > bool is_strchr_zerop = integer_zerop (chr); > > Only check the lower 8 bits. Sure. Though, in that case it is just an optimization, it is ok to not to

Re: PING^1 [PATCH] x86: Skip ENDBR when emitting direct call/jmp to local function

2022-06-20 Thread Uros Bizjak via Gcc-patches
On Mon, Jun 20, 2022 at 8:14 PM H.J. Lu wrote: > > On Tue, May 10, 2022 at 9:25 AM H.J. Lu wrote: > > > > Mark a function with SYMBOL_FLAG_FUNCTION_ENDBR when inserting ENDBR at > > function entry. Skip the 4-byte ENDBR when emitting a direct call/jmp > > to a local function with ENDBR at

Re: [PATCH v1] tree-optimization/95821 - Convert strlen + strchr to memchr

2022-06-20 Thread Noah Goldstein via Gcc-patches
On Mon, Jun 20, 2022 at 12:04 PM Jakub Jelinek wrote: > > On Mon, Jun 20, 2022 at 11:48:24AM -0700, Noah Goldstein wrote: > > > I think we should differentiate more. If integer_nonzerop (chr) > > > or perhaps better tree_expr_nonzero_p (chr), then it is better > > > to optimize t = strlen (x);

[PATCH] Fortran: handle explicit-shape specs with constant bounds [PR105954]

2022-06-20 Thread Harald Anlauf via Gcc-patches
Dear all, after simplification of constant bound expressions of an explicit shape spec of an array, we need to ensure that we never obtain negative extents. In some cases this did happen, and we ICEd as we hit an assert that this should never happen... The original testcase by Gerhard exhibited

Re: [PATCH v1] tree-optimization/95821 - Convert strlen + strchr to memchr

2022-06-20 Thread Jakub Jelinek via Gcc-patches
On Mon, Jun 20, 2022 at 11:48:24AM -0700, Noah Goldstein wrote: > > I think we should differentiate more. If integer_nonzerop (chr) > > or perhaps better tree_expr_nonzero_p (chr), then it is better > > to optimize t = strlen (x); ... p = strchr (x, c); to > > t = strlen (x); ... p = memchr (x,

Re: [PATCH] rs6000: Improve .machine

2022-06-20 Thread Segher Boessenkool
On Mon, Jun 20, 2022 at 09:48:34AM +0200, Sebastian Huber wrote: > On 04/04/2022 11:31, Sebastian Huber wrote: > >Hello Segher, > > > >On 15/03/2022 23:29, Segher Boessenkool wrote: > >>On Tue, Mar 15, 2022 at 03:29:23PM +0100, Sebastian Huber wrote: > >>>now that the PR104829 is fixed could I

Re: [PATCH v1] tree-optimization/95821 - Convert strlen + strchr to memchr

2022-06-20 Thread Noah Goldstein via Gcc-patches
On Mon, Jun 20, 2022 at 10:29 AM Jakub Jelinek wrote: > > On Mon, Jun 20, 2022 at 09:35:36AM -0700, Noah Goldstein via Gcc-patches > wrote: > > This patch allows for strchr(x, c) to the replace with memchr(x, c, > > strlen(x) + 1) if strlen(x) has already been computed earlier in the > > tree. >

PING^1 [PATCH] x86: Skip ENDBR when emitting direct call/jmp to local function

2022-06-20 Thread H.J. Lu via Gcc-patches
On Tue, May 10, 2022 at 9:25 AM H.J. Lu wrote: > > Mark a function with SYMBOL_FLAG_FUNCTION_ENDBR when inserting ENDBR at > function entry. Skip the 4-byte ENDBR when emitting a direct call/jmp > to a local function with ENDBR at function entry. > > This has been tested on Linux kernel. > >

Re: [PATCH v1] tree-optimization/95821 - Convert strlen + strchr to memchr

2022-06-20 Thread H.J. Lu via Gcc-patches
On Mon, Jun 20, 2022 at 10:29 AM Jakub Jelinek wrote: > > On Mon, Jun 20, 2022 at 09:35:36AM -0700, Noah Goldstein via Gcc-patches > wrote: > > This patch allows for strchr(x, c) to the replace with memchr(x, c, > > strlen(x) + 1) if strlen(x) has already been computed earlier in the > > tree. >

Re: [PATCH v1] tree-optimization/95821 - Convert strlen + strchr to memchr

2022-06-20 Thread Jakub Jelinek via Gcc-patches
On Mon, Jun 20, 2022 at 09:35:36AM -0700, Noah Goldstein via Gcc-patches wrote: > This patch allows for strchr(x, c) to the replace with memchr(x, c, > strlen(x) + 1) if strlen(x) has already been computed earlier in the > tree. > > Handles PR95821:

Re: kernel sparse annotations vs. compiler attributes and debug_annotate_{type, decl} WAS: Re: [PATCH 0/9] Add debug_annotate attributes

2022-06-20 Thread Yonghong Song via Gcc-patches
On 6/17/22 10:18 AM, Jose E. Marchesi wrote: Hi Yonghong. On 6/15/22 1:57 PM, David Faust wrote: On 6/14/22 22:53, Yonghong Song wrote: On 6/7/22 2:43 PM, David Faust wrote: Hello, This patch series adds support for: - Two new C-language-level attributes that allow to associate (to

[PATCH 5/5][_Hahtable] Prealloc nodes on copy

2022-06-20 Thread François Dumont via Gcc-patches
libstdc++: [_Hashtable] Prealloc nodes on _Hashtable copy Prealloc nodes on copy to reduce memory fragmentation of nodes. Create a new assignment method which copy hashtable instances respecting order of nodes in the bucket rather than order of node in the singly-linked list.

[PATCH 4/5][_Hashtable] Before begin cache policy

2022-06-20 Thread François Dumont via Gcc-patches
libstdc++: [_Hashtable] Add before begin bucket index cache on range insert Add a policy to maintain a cache of the before begin bucket index in the context of range insertion. libstdc++-v3/ChangeLog:     * include/bits/hashtable_policy.h (_CacheBbeginPolicy): New, maintain     a cache.    

[PATCH 3/5][_Hashtable] std::initializer_list insertion

2022-06-20 Thread François Dumont via Gcc-patches
libstdc++: [_Hashtable] Consider all initializer_list elements are inserted When instantiated using an initializer_list the container is pre-sized based on initializer_list size. libstdc++-v3/ChangeLog:     * include/bits/hashtable_policy.h (_Insert_base<>::insert(initializer_list<>)):    

[PATCH 2/5][_Hashtable] New method to check current bucket

2022-06-20 Thread François Dumont via Gcc-patches
libstdc++: [_Hashtable] Use next bucket node and equal_to to check if same bucket To find out if we are still in the same bucket we can first check that current node is not the next bucket's before-begin and then that hash code are equals when cached. If not we can also use the equal_to

[PATCH 1/5][_Hashtable] Make more use of user provided hint

2022-06-20 Thread François Dumont via Gcc-patches
libstdc++: [_Hashtable] Make more use of insertion hint Make use of the user provided hint iterator in unordered containers operations. Hint is used: - As a hint for allocation to potentially reduce memory fragmentation. - For unordered_set/unordered_map we check if it does not match the key

[PATCH] Enhance _Hashtable for range insertion 0/5

2022-06-20 Thread François Dumont via Gcc-patches
Hi Here is a series of patch to enhance _Hashtable behavior mostly in the context of range insertion. I also start considering the problem of memory fragmentation in this container with 2 objectives: - It is easier to find out when you're done with the elements of a bucket if the last node

[PATCH v1] tree-optimization/95821 - Convert strlen + strchr to memchr

2022-06-20 Thread Noah Goldstein via Gcc-patches
This patch allows for strchr(x, c) to the replace with memchr(x, c, strlen(x) + 1) if strlen(x) has already been computed earlier in the tree. Handles PR95821: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95821 Since memchr doesn't need to re-find the null terminator it is faster than strchr.

Re: [PATCH] Add -fextra-libc-function=memcmpeq for __memcmpeq

2022-06-20 Thread H.J. Lu via Gcc-patches
On Mon, Jun 20, 2022 at 2:39 AM Richard Biener wrote: > > On Thu, Jun 16, 2022 at 1:38 AM Fangrui Song wrote: > > > > On Wed, Jun 15, 2022 at 2:44 PM H.J. Lu via Gcc-patches > > wrote: > > > > > > On Mon, Jun 13, 2022 at 9:01 AM Richard Biener > > > wrote: > > > > > > > > > > > > > > > > > Am

[PATCH v2] Enable __memcmpeq after seeing __memcmpeq prototype

2022-06-20 Thread H.J. Lu via Gcc-patches
extern int __memcmpeq (const void *, const void *, size_t); was was added to GLIBC 2.35. Expand BUILT_IN_MEMCMP_EQ to __memcmpeq after seeing __memcmpeq prototype gcc/ * builtins.cc (have_memcmpeq_prototype): New. (expand_builtin): Issue an error for BUILT_IN___MEMCMPEQ if

Re: [PATCH] testsuite, asan: Avoid color in asan test output.

2022-06-20 Thread Jakub Jelinek via Gcc-patches
On Mon, Jun 20, 2022 at 04:28:21PM +0100, Iain Sandoe wrote: > The presence of the color markers in the some of the asan tests > appears to confuse the dg-output matching (possibly a platform > TCL or termios bug) on some Darwin platforms. > > Since the color is not being tested, switch it off

[PATCH] testsuite, asan: Avoid color in asan test output.

2022-06-20 Thread Iain Sandoe via Gcc-patches
The presence of the color markers in the some of the asan tests appears to confuse the dg-output matching (possibly a platform TCL or termios bug) on some Darwin platforms. Since the color is not being tested, switch it off (makes the log files easier to read too). This fixes a large number of

[pushed] testsuite, Darwin: Skip an unsupported test.

2022-06-20 Thread Iain Sandoe via Gcc-patches
Darwin does not support patchable function entries, skip the test there. tested on x86_64 darwin / linux, pushed to master, thanks, Iain gcc/testsuite/ChangeLog: * g++.dg/modules/pr105169_a.C: Skip the test on Darwin. * g++.dg/modules/pr105169_b.C: Likewise. ---

[pushed] testsuite, Darwin: Allow for two CTOR bodies in array61 test.

2022-06-20 Thread Iain Sandoe via Gcc-patches
For targets without alias support, we emit two essentially identical function bodies into the gimple (complete and base CTORs). So this test needs to allow for that when the target does not support aliases. The target support alias test does not seem to be usable in the context of a single

[committed] arm: more testsutie fallout for mve move-immediate changes

2022-06-20 Thread Richard Earnshaw via Gcc-patches
Unfortunately, there is more fall-out in the testsuite for my changes to use MVE move-immediate operations instead of literal pool loads. Fixed as follows: gcc/testsuite/ChangeLog: * gcc.target/arm/simd/mve-vcmp-f32-2.c: Adjust expected output. * gcc.target/arm/simd/pr100757.c:

[pushed] testsuite: Add a missing USER_LABEL_PREFIX to a regex.

2022-06-20 Thread Iain Sandoe via Gcc-patches
Fixes this test on Darwin. tested on x86_64 darwin / linux, pushed to master, thanks Iain Signed-off-by: Iain Sandoe gcc/testsuite/ChangeLog: * g++.dg/modules/init-2_b.C: Add a missing USER_LABEL_PREFIX to a regex. --- gcc/testsuite/g++.dg/modules/init-2_b.C | 2 +- 1 file

[pushed] testsuite: Require init_priority target support in a test.

2022-06-20 Thread Iain Sandoe via Gcc-patches
The attr-cdtor-1 test fails on targets without init priority since the diagnostic emitted concerns the absence of support. Disable the test on such targets. tested on x86_64 darwin / linux, pushed to master, thanks Iain Signed-off-by: Iain Sandoe gcc/testsuite/ChangeLog: *

Re: [PATCH] i386: Add syscall to enable AMX for latest kernels

2022-06-20 Thread Uros Bizjak via Gcc-patches
On Mon, Jun 20, 2022 at 10:04 AM Haochen Jiang wrote: > > From: "Jiang, Haochen" > > Hi all, > > We need syscall to enable AMX for kernels>=5.4. It is missing in current > amx tests, which will cause test fail. So this new code is only valid for linux & co? Uros. > > This patch aims to add

Re: PING^1 [PATCH] i386: Disallow sibcall when calling ifunc functions with PIC register

2022-06-20 Thread Uros Bizjak via Gcc-patches
On Mon, Jun 20, 2022 at 4:03 PM H.J. Lu wrote: > > On Tue, Jun 14, 2022 at 12:25 PM H.J. Lu wrote: > > > > Disallow siball when calling ifunc functions with PIC register so that > > PIC register can be restored. > > > > gcc/ > > > > PR target/105960 > > * config/i386/i386.cc

[PATCH v4] tree-optimization/94899: Remove "+ 0x80000000" in int comparisons

2022-06-20 Thread Arjun Shankar via Gcc-patches
Expressions of the form "X + CST < Y + CST" where: * CST is an unsigned integer constant with only the MSB set, and * X and Y's types have integer conversion ranks <= CST's can be simplified to "(signed) X < (signed) Y". This is because, assuming a 32-bit signed numbers, (unsigned) INT_MIN +

PING^1 [PATCH] i386: Disallow sibcall when calling ifunc functions with PIC register

2022-06-20 Thread H.J. Lu via Gcc-patches
On Tue, Jun 14, 2022 at 12:25 PM H.J. Lu wrote: > > Disallow siball when calling ifunc functions with PIC register so that > PIC register can be restored. > > gcc/ > > PR target/105960 > * config/i386/i386.cc (ix86_function_ok_for_sibcall): Return > false if PIC register

Re: [PATCH] c: Extend the -Wpadded message with actual padding size

2022-06-20 Thread Vit Kabele
I fixed the formatting and added the test. The test has first element 32bit so that it should work on both 32 and 64bit architectures, even without the aligned attribute. If there is some better way how to write the test properly formatted (i.e. not on a single line), please let me know. -- >8

Re: [PATCH]middle-end Add optimized float addsub without needing VEC_PERM_EXPR.

2022-06-20 Thread Richard Sandiford via Gcc-patches
Tamar Christina via Gcc-patches writes: >> -Original Message- >> From: Richard Biener >> Sent: Monday, June 20, 2022 12:56 PM >> To: Tamar Christina >> Cc: Andrew Pinski via Gcc-patches ; nd >> >> Subject: RE: [PATCH]middle-end Add optimized float addsub without >> needing

[PATCH] middle-end/106027 - fix types in needle folding

2022-06-20 Thread Richard Biener via Gcc-patches
The fold_to_nonsharp_ineq_using_bound folding ends up creating invalid typed IL which confuses later foldings. The following fixes that. Bootstrapped and tested on x86_64-unknwon-linux-gnu, pushed. 2022-06-20 Richard Biener PR middle-end/106027 * fold-const.cc

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-06-20 Thread Martin Liška
On 6/20/22 11:35, Richard Biener wrote: > I think this is OK. Can we get buy-in from mold people? Sure, I've just pinged Rui: https://github.com/rui314/mold/issues/454#issuecomment-1160419030 Martin

Re: [PATCH] vect: Respect slp decision when applying suggested uf [PR105940]

2022-06-20 Thread Kewen.Lin via Gcc-patches
on 2022/6/20 15:47, Richard Biener wrote: > On Fri, Jun 17, 2022 at 12:53 PM Kewen.Lin wrote: >> >> Hi, >> >> This follows Richi's suggestion in PR105940, it aims to avoid >> inconsistent slp decision between when the suggested unroll >> factor is worked out and when the suggested unroll factor

RE: [PATCH]middle-end Add optimized float addsub without needing VEC_PERM_EXPR.

2022-06-20 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Biener > Sent: Monday, June 20, 2022 12:56 PM > To: Tamar Christina > Cc: Andrew Pinski via Gcc-patches ; nd > > Subject: RE: [PATCH]middle-end Add optimized float addsub without > needing VEC_PERM_EXPR. > > On Mon, 20 Jun 2022, Tamar Christina

RE: [PATCH]middle-end Add optimized float addsub without needing VEC_PERM_EXPR.

2022-06-20 Thread Richard Biener via Gcc-patches
On Mon, 20 Jun 2022, Tamar Christina wrote: > > -Original Message- > > From: Richard Biener > > Sent: Saturday, June 18, 2022 11:49 AM > > To: Andrew Pinski via Gcc-patches > > Cc: Tamar Christina ; nd > > Subject: Re: [PATCH]middle-end Add optimized float addsub without > > needing

Re: [PATCH RFA] ubsan: do return check with -fsanitize=unreachable

2022-06-20 Thread Jakub Jelinek via Gcc-patches
On Fri, Jun 17, 2022 at 05:20:02PM -0400, Jason Merrill wrote: > Related to PR104642, the current situation where we get less return checking > with just -fsanitize=unreachable than no sanitize flags seems undesirable; I > propose that we do return checking when -fsanitize=unreachable.

Re: [PATCH 2/3] lto-plugin: make claim_file_handler thread-safe

2022-06-20 Thread Martin Liška
On 6/20/22 11:32, Richard Biener wrote: > On Thu, Jun 16, 2022 at 9:01 AM Martin Liška wrote: >> >> lto-plugin/ChangeLog: >> >> * lto-plugin.c (plugin_lock): New lock. >> (claim_file_handler): Use mutex for critical section. >> (onload): Initialize mutex. >> --- >>

RE: [PATCH]middle-end Add optimized float addsub without needing VEC_PERM_EXPR.

2022-06-20 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Biener > Sent: Saturday, June 18, 2022 11:49 AM > To: Andrew Pinski via Gcc-patches > Cc: Tamar Christina ; nd > Subject: Re: [PATCH]middle-end Add optimized float addsub without > needing VEC_PERM_EXPR. > > > > > Am 17.06.2022 um 22:34 schrieb

Re: [PATCH V3] RISC-V:Fix a bug that is the CMO builtins are missing parameter

2022-06-20 Thread Kito Cheng via Gcc-patches
Committed, thanks! On Wed, Jun 8, 2022 at 10:20 AM wrote: > > From: yulong > > We changed builtins format about zicbom and zicboz subextensions and modified > test cases. > diff with the previous version: > 1.We modified the FUNCTION_TYPE from RISCV_VOID_FTYPE_SI/DI to >

Re: [PATCH v1.1] tree-optimization/105736: Don't let error_mark_node escape for ADDR_EXPR

2022-06-20 Thread Jakub Jelinek via Gcc-patches
On Tue, Jun 14, 2022 at 09:01:54PM +0530, Siddhesh Poyarekar wrote: > The addr_expr computation does not check for error_mark_node before > returning the size expression. This used to work in the constant case > because the conversion to uhwi would end up causing it to return > size_unknown, but

Re: [PATCH] Add -fextra-libc-function=memcmpeq for __memcmpeq

2022-06-20 Thread Richard Biener via Gcc-patches
On Thu, Jun 16, 2022 at 1:38 AM Fangrui Song wrote: > > On Wed, Jun 15, 2022 at 2:44 PM H.J. Lu via Gcc-patches > wrote: > > > > On Mon, Jun 13, 2022 at 9:01 AM Richard Biener > > wrote: > > > > > > > > > > > > > Am 13.06.2022 um 16:36 schrieb H.J. Lu : > > > > > > > > On Mon, Jun 13, 2022 at

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-06-20 Thread Richard Biener via Gcc-patches
On Thu, Jun 16, 2022 at 2:25 PM Martin Liška wrote: > > On 6/16/22 10:00, Alexander Monakov wrote: > > On Thu, 16 Jun 2022, Martin Liška wrote: > > > >> Hi. > >> > >> I'm sending updated version of the patch where I addressed the comments. > >> > >> Patch can bootstrap on x86_64-linux-gnu and

Re: [PATCH 2/3] lto-plugin: make claim_file_handler thread-safe

2022-06-20 Thread Richard Biener via Gcc-patches
On Thu, Jun 16, 2022 at 9:01 AM Martin Liška wrote: > > lto-plugin/ChangeLog: > > * lto-plugin.c (plugin_lock): New lock. > (claim_file_handler): Use mutex for critical section. > (onload): Initialize mutex. > --- > lto-plugin/lto-plugin.c | 16 +++- > 1 file

Re: [PATCH 1/3] lto-plugin: support LDPT_GET_SYMBOLS_V3

2022-06-20 Thread Richard Biener via Gcc-patches
On Thu, Jun 16, 2022 at 9:00 AM Martin Liška wrote: > > That supports skipping of an object file (LDPS_NO_SYMS). OK. Thanks, Richard. > lto-plugin/ChangeLog: > > * lto-plugin.c (struct plugin_file_info): Add skip_file flag. > (write_resolution): Write resolution only if

RE: [PATCH 2/2]middle-end: Support recognition of three-way max/min.

2022-06-20 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Biener > Sent: Monday, June 20, 2022 9:36 AM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd ; ja...@redhat.com > Subject: Re: [PATCH 2/2]middle-end: Support recognition of three-way > max/min. > > On Thu, 16 Jun 2022, Tamar Christina wrote:

Re: [PATCH]middle-end simplify complex if expressions where comparisons are inverse of one another.

2022-06-20 Thread Richard Biener via Gcc-patches
On Thu, 16 Jun 2022, Tamar Christina wrote: > Hi All, > > This optimizes the following sequence > > ((a < b) & c) | ((a >= b) & d) > > into > > (a < b ? c : d) & 1 > > for scalar. On vector we can omit the & 1. > > This changes the code generation from > > zoo2: > cmp w0, w1 >

RE: [PATCH 1/2]middle-end: Simplify subtract where both arguments are being bitwise inverted.

2022-06-20 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Sandiford > Sent: Monday, June 20, 2022 9:19 AM > To: Richard Biener via Gcc-patches > Cc: Tamar Christina ; Richard Biener > ; Richard Guenther ; > nd > Subject: Re: [PATCH 1/2]middle-end: Simplify subtract where both > arguments are being bitwise

Re: [PATCH v3] tree-optimization/94899: Remove "+ 0x80000000" in int comparisons

2022-06-20 Thread Jakub Jelinek via Gcc-patches
On Mon, Jun 20, 2022 at 09:36:28AM +0200, Richard Biener wrote: > > --- a/gcc/match.pd > > +++ b/gcc/match.pd > > @@ -2080,6 +2080,19 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) > >(if (ANY_INTEGRAL_TYPE_P (TREE_TYPE (@0)) > > && TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (@0))) > > (op @0

Re: [PATCH 2/2]middle-end: Support recognition of three-way max/min.

2022-06-20 Thread Richard Biener via Gcc-patches
On Thu, 16 Jun 2022, Tamar Christina wrote: > Hi All, > > This patch adds support for three-way min/max recognition in phi-opts. > > Concretely for e.g. > > #include > > uint8_t three_min (uint8_t xc, uint8_t xm, uint8_t xy) { > uint8_t xk; > if (xc < xm) { > xk =

Re: [PATCH 1/2]middle-end: Simplify subtract where both arguments are being bitwise inverted.

2022-06-20 Thread Richard Sandiford via Gcc-patches
Richard Biener via Gcc-patches writes: > On Thu, Jun 16, 2022 at 1:10 PM Tamar Christina via Gcc-patches > wrote: >> >> Hi All, >> >> This adds a match.pd rule that drops the bitwwise nots when both arguments >> to a >> subtract is inverted. i.e. for: >> >> float g(float a, float b) >> { >>

[PATCH] i386: Add syscall to enable AMX for latest kernels

2022-06-20 Thread Haochen Jiang via Gcc-patches
From: "Jiang, Haochen" Hi all, We need syscall to enable AMX for kernels>=5.4. It is missing in current amx tests, which will cause test fail. This patch aims to add them to fix this bug. BRs, Haochen gcc/testsuite/ChangeLog: * gcc.target/i386/amx-check.h (request_perm_xtile_data):

Re: [PATCH 1/2]middle-end: Simplify subtract where both arguments are being bitwise inverted.

2022-06-20 Thread Richard Biener via Gcc-patches
On Thu, Jun 16, 2022 at 1:10 PM Tamar Christina via Gcc-patches wrote: > > Hi All, > > This adds a match.pd rule that drops the bitwwise nots when both arguments to > a > subtract is inverted. i.e. for: > > float g(float a, float b) > { > return ~(int)a - ~(int)b; > } > > we instead generate >

Ping: [RFA configure parts] aarch64: Make cc1 handle --with options

2022-06-20 Thread Richard Sandiford via Gcc-patches
Ping for the configure bits Richard Sandiford via Gcc-patches writes: > On aarch64, --with-arch, --with-cpu and --with-tune only have an > effect on the driver, so “./xgcc -B./ -O3” can give significantly > different results from “./cc1 -O3”. --with-arch did have a limited > effect on ./cc1 in

Re: [PATCH]middle-end Use subregs to expand COMPLEX_EXPR to set the lowpart.

2022-06-20 Thread Richard Sandiford via Gcc-patches
Richard Sandiford via Gcc-patches writes: > Tamar Christina writes: >>> -Original Message- >>> From: Richard Sandiford >>> Sent: Monday, June 13, 2022 9:41 AM >>> To: Tamar Christina >>> Cc: gcc-patches@gcc.gnu.org; nd ; rguent...@suse.de >>> Subject: Re: [PATCH]middle-end Use subregs

Re: [PATCH] rs6000: Improve .machine

2022-06-20 Thread Sebastian Huber
On 04/04/2022 11:31, Sebastian Huber wrote: Hello Segher, On 15/03/2022 23:29, Segher Boessenkool wrote: On Tue, Mar 15, 2022 at 03:29:23PM +0100, Sebastian Huber wrote: now that the PR104829 is fixed could I back port Segher Boessenkool (2):    rs6000: Improve .machine    rs6000: Do not use

Re: [PATCH] vect: Respect slp decision when applying suggested uf [PR105940]

2022-06-20 Thread Richard Biener via Gcc-patches
On Fri, Jun 17, 2022 at 12:53 PM Kewen.Lin wrote: > > Hi, > > This follows Richi's suggestion in PR105940, it aims to avoid > inconsistent slp decision between when the suggested unroll > factor is worked out and when the suggested unroll factor is > applied. > > If the previous slp decision is

Re: [PATCH] [x86] Replace REGNO with reg_or_subregno in pre_reload splitter.

2022-06-20 Thread Uros Bizjak via Gcc-patches
On Mon, Jun 20, 2022 at 9:27 AM liuhongt wrote: > > The patch is similar to [1], but use reg_or_subregno instead of REGNO. > > [1] https://gcc.gnu.org/pipermail/gcc-patches/2022-June/596804.html > > Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. > Ok for trunk? > > gcc/ChangeLog: > >

Re: [PATCH] libgo: Recognize off64_t / loff_t type definition of musl libc

2022-06-20 Thread Eric Botcazou via Gcc-patches
> aarch64-suse-linux, of course. Likewise on x86_64-suse-linux. > > What is the output of > > > > grep loff_t TARGET/libgo/gen-sysinfo.go > > type ___loff_t int64 > type _loff_t int64 > type ___kernel_loff_t int64 Ditto. -- Eric Botcazou

Re: [PATCH v3] tree-optimization/94899: Remove "+ 0x80000000" in int comparisons

2022-06-20 Thread Richard Biener via Gcc-patches
On Fri, Jun 17, 2022 at 10:57 AM Arjun Shankar wrote: > > Expressions of the form "X + CST < Y + CST" where: > > * CST is an unsigned integer constant with only the MSB set, and > * X and Y's types have integer conversion ranks <= CST's > > can be simplified to "(signed) X < (signed) Y". > > This

Re: [PATCH] libgompd: Fix sizes in OMPD support and add local ICVs finctions.

2022-06-20 Thread Jakub Jelinek via Gcc-patches
On Fri, Jun 17, 2022 at 01:20:28AM +0200, Mohamed Atef wrote: > libgomp/ChangeLog > > 2022-06-17 Mohamed Atef > > * ompd-helper.h (DEREFERENCE, ACCESS_VALUE): New macros. > (gompd_get_proc_bind): Change the returned value from ompd_word_t > to const char *. > (gompd_get_max_task_priority):

[PATCH] [x86] Replace REGNO with reg_or_subregno in pre_reload splitter.

2022-06-20 Thread liuhongt via Gcc-patches
The patch is similar to [1], but use reg_or_subregno instead of REGNO. [1] https://gcc.gnu.org/pipermail/gcc-patches/2022-June/596804.html Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. Ok for trunk? gcc/ChangeLog: PR target/105993 * config/i386/sse.md

Re: [statistics.cc] Emit asm name of function with -fdump-statistics-asmname

2022-06-20 Thread Richard Biener via Gcc-patches
On Thu, Jun 16, 2022 at 5:05 PM Prathamesh Kulkarni via Gcc-patches wrote: > > Hi, > I just noticed -fdump-statistics supports asmname sub-option, which > according to the doc states: > "If DECL_ASSEMBLER_NAME has been set for a given decl, use that in the dump > instead of DECL_NAME. Its primary

Re: [PATCH] Revert "[PATCH] RISC-V: Use new linker emulations for glibc ABI."

2022-06-20 Thread Kito Cheng via Gcc-patches
Generally I agree we should fix that by GCC driver rather than ld emulation, but I think this should be reverted with the -L path fix, otherwise that will break multilib on GNU toolchain for linux immediately? On Wed, Jun 15, 2022 at 4:00 PM Fangrui Song via Gcc-patches wrote: > > This reverts