Missed optimization of strcpy(3) (or stpcpy(3))

2023-11-12 Thread Alejandro Colomar via Gcc
Hi, The following code can be optimized to use memcpy(3), since the length of the copy is known (we've just called strnlen(3), and discarded the possibility of truncated lengths). $ cat strxcpy.c #include #include #include ssize_t strxcpy(char *restrict dst, const char *restrict src, size_t d

gcc-14-20231112 is now available

2023-11-12 Thread GCC Administrator via Gcc
Snapshot gcc-14-20231112 is now available on https://gcc.gnu.org/pub/gcc/snapshots/14-20231112/ and on various mirrors, see http://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 14 git branch with the following options: git://gcc.gnu.org/git/gcc.git branch

Re: Missed optimization of strcpy(3) (or stpcpy(3))

2023-11-12 Thread Richard Biener via Gcc
On Sun, Nov 12, 2023 at 10:10 PM Alejandro Colomar via Gcc wrote: > > Hi, > > The following code can be optimized to use memcpy(3), since the length > of the copy is known (we've just called strnlen(3), and discarded the > possibility of truncated lengths). > > $ cat strxcpy.c > #include > #inclu

Question about vectorization optimization during RTL-PASS

2023-11-12 Thread Hanke Zhang via Gcc
Hi, I've been working on vectorization-related optimization lately. GCC seems to have some optimization vulnerabilities. I would like to ask if it can be solved. For example, for the following program using AVX2: #include // reg->node2[i].state is an unsigned long long variable // reg->size is a