Re: Handling C2Y zero-length operations on null pointers

2024-10-03 Thread Paul Eggert
On 2024-10-03 15:42, Florian Weimer wrote: I think attribute access already covers part of it: The GCC documentation for attribute access[1] is unclear as to whether the pointer is allowed to be null when the size is zero. Perhaps we could ask the GCC maintainers to document that it's allowed

Re: Handling C2Y zero-length operations on null pointers

2024-10-03 Thread Florian Weimer
* Joseph Myers: > The real question is how to achieve optimal warnings in the absence of the > attribute. Should we have a variant of the nonnull attribute that warns > for NULL arguments but without optimizing based on them? I think attribute access already covers part of it: #include void

gcc-12-20241003 is now available

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

Handling C2Y zero-length operations on null pointers

2024-10-03 Thread Joseph Myers via Gcc
WG14 accepted https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3322.pdf at this week's meeting in Minneapolis, allowing various zero-length language and library operations on null pointers in C2Y (in support of the idiom where an empty array may be represented by a null pointer with zero lengt

Re: Where does this dead statement generated in switch conversion come from?

2024-10-03 Thread Andrew Pinski via Gcc
On Thu, Oct 3, 2024 at 7:51 AM Filip Kastl wrote: > > Hi All, > > While toying with the switch conversion GIMPLE pass I noticed that the pass > generates a dead statement. I wanted to investigate why this happens and > potentially fix this. However after looking into the part of the pass > respo

Re: n3369 New _Lengthof operator (v4)

2024-10-03 Thread Alejandro Colomar via Gcc
Hi all, On Wed, Oct 02, 2024 at 08:29:26PM GMT, Alejandro Colomar wrote: > > On Wed, Oct 02, 2024 at 11:41:20AM +0200, Alejandro Colomar wrote: > > > Hi! > > > > > > This operator is as voted in a WG14 meeting yesterday, with the only > > > difference that we name it __lengthof__ instead of _Leng

Where does this dead statement generated in switch conversion come from?

2024-10-03 Thread Filip Kastl
Hi All, While toying with the switch conversion GIMPLE pass I noticed that the pass generates a dead statement. I wanted to investigate why this happens and potentially fix this. However after looking into the part of the pass responsible for generating the code in question I still have no idea