Re: [PATCH] middle-end/104854: Avoid overread warning for strnlen and strndup

2022-07-09 Thread Siddhesh Poyarekar
On 10/07/2022 08:59, Jeff Law via Gcc-patches wrote: On 3/9/2022 5:39 PM, Siddhesh Poyarekar wrote: The size argument larger than size of SRC for strnlen and strndup is problematic only if SRC is not NULL terminated, which invokes undefined behaviour.  In all other cases, as long as SRC is lar

Re: [PATCH] c: Fix location for _Pragma tokens [PR97498]

2022-07-09 Thread Jeff Law via Gcc-patches
On 7/9/2022 2:52 PM, Lewis Hyatt via Gcc-patches wrote: Hello- PR97498 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97498) is another PR related to the fact that imprecise locations for _Pragma result in counterintuitive behavior for GCC diagnostic pragmas, which inhibit the ability to make

Re: [PATCH 0/2] loongarch: improve code generation for integer division

2022-07-09 Thread Xi Ruoyao via Gcc-patches
On Sun, 2022-07-10 at 10:20 +0800, Lulu Cheng wrote: > > 在 2022/7/7 上午10:23, Xi Ruoyao 写道: > > We were generating some unnecessary instructions for integer > > division. > > These two patches improve the code generation to compile > > > > template T div(T a, T b) { return a / b; } > > > >

Re: [PATCH v3] loongarch: fix mulsidi3_64bit instruction

2022-07-09 Thread Xi Ruoyao via Gcc-patches
On Sun, 2022-07-10 at 09:45 +0800, Lulu Cheng wrote: > > 在 2022/7/9 上午10:56, Xi Ruoyao 写道: > > v3: Relax scan-assembler pattern in test case mulw_d_w.c.  It's > > because > > multiplication is Abelian and the compiler may switch the order of > > operands in the future. > > -- >8 -- > > > > (mult

Re: [PATCH] Implement global ranges for all vrange types (SSA_NAME_RANGE_INFO).

2022-07-09 Thread Jeff Law via Gcc-patches
On 7/9/2022 1:31 PM, Aldy Hernandez wrote: On Sat, Jul 9, 2022 at 6:16 PM Jeff Law via Gcc-patches wrote: On 7/6/2022 11:10 AM, Aldy Hernandez via Gcc-patches wrote: Currently SSA_NAME_RANGE_INFO only handles integer ranges, and loses half the precision in the process because its use of l

Re: [PING^2][PATCH][final] Handle compiler-generated asm insn

2022-07-09 Thread Jeff Law via Gcc-patches
On 3/21/2022 10:14 AM, Tom de Vries via Gcc-patches wrote: On 3/21/22 14:49, Richard Biener wrote: On Mon, Mar 21, 2022 at 12:50 PM Tom de Vries wrote: On 3/21/22 08:58, Richard Biener wrote: On Thu, Mar 17, 2022 at 4:10 PM Tom de Vries via Gcc-patches wrote: On 3/9/22 13:50, Tom de Vr

Re: [PATCH] middle-end/104854: Avoid overread warning for strnlen and strndup

2022-07-09 Thread Jeff Law via Gcc-patches
On 3/9/2022 5:39 PM, Siddhesh Poyarekar wrote: The size argument larger than size of SRC for strnlen and strndup is problematic only if SRC is not NULL terminated, which invokes undefined behaviour. In all other cases, as long as SRC is large enough to have a NULL char (i.e. size 1 or more),

Re: PING^2: [PATCH] Add --enable-first-stage-cross configure option

2022-07-09 Thread Jeff Law via Gcc-patches
On 1/9/2022 2:26 PM, Serge Belyshev wrote: Ping: [PATCH] Add --enable-first-stage-cross configure option https://gcc.gnu.org/pipermail/gcc-patches/2021-July/575318.html Add --enable-first-stage-cross configure option Build static-only, C-only compiler that is sufficient to cross compile gli

Re: [PATCH 0/2] loongarch: improve code generation for integer division

2022-07-09 Thread Lulu Cheng
在 2022/7/7 上午10:23, Xi Ruoyao 写道: We were generating some unnecessary instructions for integer division. These two patches improve the code generation to compile template T div(T a, T b) { return a / b; } into a single division instruction (along with a return instruction of course) as

Re: [PATCH v3] loongarch: fix mulsidi3_64bit instruction

2022-07-09 Thread Lulu Cheng
在 2022/7/9 上午10:56, Xi Ruoyao 写道: v3: Relax scan-assembler pattern in test case mulw_d_w.c. It's because multiplication is Abelian and the compiler may switch the order of operands in the future. -- >8 -- (mult (sign_extend:DI rj:SI) (sign_extend:DI rk:SI)) should be "mulw.d.w", not "mul.d".

[PATCH] c: Fix location for _Pragma tokens [PR97498]

2022-07-09 Thread Lewis Hyatt via Gcc-patches
Hello- PR97498 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97498) is another PR related to the fact that imprecise locations for _Pragma result in counterintuitive behavior for GCC diagnostic pragmas, which inhibit the ability to make convenient wrapper macros for enabling and disabling diagnost

Re: [PATCH] Implement global ranges for all vrange types (SSA_NAME_RANGE_INFO).

2022-07-09 Thread Aldy Hernandez via Gcc-patches
On Sat, Jul 9, 2022 at 6:16 PM Jeff Law via Gcc-patches wrote: > > > > On 7/6/2022 11:10 AM, Aldy Hernandez via Gcc-patches wrote: > > Currently SSA_NAME_RANGE_INFO only handles integer ranges, and loses > > half the precision in the process because its use of legacy > > value_range's. This patch

[COMMITTED] Set VR_VARYING in irange::irange_single_pair_union.

2022-07-09 Thread Aldy Hernandez via Gcc-patches
The fast union operation is sometimes setting a range of the entire domain, but leaving the kind bit as VR_RANGE instead of downgrading it to VR_VARYING. Tested on x86-64 Linux. gcc/ChangeLog: * value-range.cc (irange::irange_single_pair_union): Set VR_VARYING when appropriate. -

Re: [PATCH][v2] tree-optimization: Fold (type)X / (type)Y [PR103855]

2022-07-09 Thread Jeff Law via Gcc-patches
On 3/16/2022 6:49 PM, Zhao Wei Liew via Gcc-patches wrote: Thanks for the detailed review. I have uploaded patch v2 based on the review. v1: https://gcc.gnu.org/pipermail/gcc-patches/2022-February/590604.html Changes since v1: 1. Add patterns for the cases CST / (T)x and (T)x / CST as well. F

Re: [PATCH] postscan_insn hook not called after input_asm

2022-07-09 Thread Jeff Law via Gcc-patches
On 3/29/2022 8:10 AM, Paul Iannetta via Gcc-patches wrote: Hi, While working on the Kalray port of gcc, I noticed that the hook TARGET_ASM_FINAL_POSTSCAN_INSN is not called after emitting an instruction coming from a basic asm block. Here is a patch which fixes this behavior. The followin

Re: [PATCH v2] [PR100106] Reject unaligned subregs when strict alignment is required

2022-07-09 Thread Jeff Law via Gcc-patches
On 5/5/2022 8:41 PM, Alexandre Oliva via Gcc-patches wrote: On May 5, 2022, Segher Boessenkool wrote: On Thu, May 05, 2022 at 03:52:01AM -0300, Alexandre Oliva wrote: + else if (reg && MEM_P (reg) + && STRICT_ALIGNMENT && MEM_ALIGN (reg) < GET_MODE_ALIGNMENT (omode)) +return

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

2022-07-09 Thread Jeff Law via Gcc-patches
On 6/27/2022 2:04 AM, Vit Kabele wrote: gcc/ChangeLog: * stor-layout.cc (finalize_record_size): Extend warning message. gcc/testsuite/ChangeLog: * c-c++-common/Wpadded.c: New test. Thanks.  I've pushed this to the trunk. jeff

Re: [PATCH] Implement global ranges for all vrange types (SSA_NAME_RANGE_INFO).

2022-07-09 Thread Jeff Law via Gcc-patches
On 7/6/2022 11:10 AM, Aldy Hernandez via Gcc-patches wrote: Currently SSA_NAME_RANGE_INFO only handles integer ranges, and loses half the precision in the process because its use of legacy value_range's. This patch rewrites all the SSA_NAME_RANGE_INFO (nonzero bits included) to use the recent

Re: [PATCH v2] Support --disable-fixincludes.

2022-07-09 Thread Jeff Law via Gcc-patches
On 7/8/2022 5:14 AM, Martin Liška wrote: On 5/25/22 07:37, Alexandre Oliva wrote: On May 24, 2022, Martin Liška wrote: Allways install limits.h and syslimits.h header files to include folder. typo: s/Allways/Always/ Hello. Fixed. I'm a little worried about this bit, too. limitx.h inc

Re: [PATCH] match.pd: Add new bitwise arithmetic pattern [PR98304]

2022-07-09 Thread Jeff Law via Gcc-patches
On 7/7/2022 7:59 AM, Sam Feifer via Gcc-patches wrote: Hi! This patch is meant to solve a missed optimization in match.pd. It optimizes the following expression: n - (((n > 63) ? n : 63) & -64) where the constant being negated (in this case -64) is a power of 2 and the sum of the two consta

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

2022-07-09 Thread Jeff Law via Gcc-patches
On 6/21/2022 12:12 PM, 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: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95821 Since memchr doesn't

Re: [committed] libstdc++: Remove obsolete comment in

2022-07-09 Thread Jonathan Wakely via Gcc-patches
On Sat, 9 Jul 2022 at 13:26, François Dumont via Libstdc++ wrote: > > libstdc++: Remove obsolete comment in header > > The comment is obsolete because char_traits.h do not include > stl_algobase.h > anymore and stl_algobase.h is included directly from a few > lines > below. N

Re: Mips: Fix kernel_stat structure size

2022-07-09 Thread Hans-Peter Nilsson
On Sat, 9 Jul 2022, Xi Ruoyao wrote: > On Fri, 2022-07-08 at 21:42 -0400, Hans-Peter Nilsson wrote: > > On Fri, 1 Jul 2022, Dimitrije Milosevic wrote: > > > > > Fix kernel_stat structure size for non-Android 32-bit Mips. > > > LLVM currently has this value for the kernel_stat structure size, > > >

[committed] libstdc++: Remove obsolete comment in

2022-07-09 Thread François Dumont via Gcc-patches
   libstdc++: Remove obsolete comment in header     The comment is obsolete because char_traits.h do not include stl_algobase.h     anymore and stl_algobase.h is included directly from a few lines     below.     libstdc++-v3/ChangeLog:     * include/std/string: Remove obsolete comm

[x86_64 PATCH] Improved Scalar-To-Vector (STV) support for TImode to V1TImode.

2022-07-09 Thread Roger Sayle
This patch upgrades x86_64's scalar-to-vector (STV) pass to more aggressively transform 128-bit scalar TImode operations into vector V1TImode operations performed on SSE registers. TImode functionality already exists in STV, but only for move operations, this changes brings support for logical op

Modula-2: merge followup (brief update on the progress of the new linking implementation)

2022-07-09 Thread Gaius Mulley via Gcc-patches
A very brief update to say that I've merged the new linking implementation back onto the devel/modula-2 branch, regards, Gaius

Re: [gcc12 backport] PR target/105930: Split *xordi3_doubleword after reload on x86.

2022-07-09 Thread Uros Bizjak via Gcc-patches
On Sat, Jul 9, 2022 at 11:26 AM Roger Sayle wrote: > > > This is a backport of the fix for PR target/105930 from mainline to the > gcc12 release branch. This patch has been retested against the gcc12 > branch on x86_64-pc-linux-gnu with make bootstrap and make -k check, > both with and without --

[gcc12 backport] PR target/105930: Split *xordi3_doubleword after reload on x86.

2022-07-09 Thread Roger Sayle
This is a backport of the fix for PR target/105930 from mainline to the gcc12 release branch. This patch has been retested against the gcc12 branch on x86_64-pc-linux-gnu with make bootstrap and make -k check, both with and without --target_board=unix{-m32} with no new failures. Ok for the gcc12