[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-bugs
Subject:    [Bug tree-optimization/114178] incorrect -Wstringop-overflow with freestanding + new w/ initializati
From:       "pinskia at gcc dot gnu.org via Gcc-bugs" <gcc-bugs () gcc ! gnu ! org>
Date:       2024-02-29 23:15:12
Message-ID: bug-114178-4-mF4nHgF14w () http ! gcc ! gnu ! org/bugzilla/
[Download RAW message or body]

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114178

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Evan Teran from comment #4)
> @Andrew, thanks for the quick analysis! Just to confirm, the warning is in
> fact incorrect and the emitted code is not stomping outside of the buffer
> bounds?
> 
> I ask because I did also one last bit, which is that changing the buffer
> size can make the warning go away. That is if I make the buffer in the
> example something like 132, then it's happy again, which at the very least,
> makes me wonder if the vectorized code is in fact going out of bounds when
> the size doesn't align with the vectorized code's expectations.

The code is not incorrect, It is the peel part for unaligned part of the
stores. Just the warning is not using the same information that the peeling
part had available to it and getting confused by it.

Basically -ffreestanding is needed to hit the warning because GCC will use
memset rather than vectorize the store loop. Adding
-fno-tree-loop-distribute-patterns instead of -ffreestanding will also cause
the warning for the same reason.=
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic