[PATCH] separate reading past the end from -Wstringop-overflow

Jeff Law law@redhat.com
Tue Sep 1 22:22:18 GMT 2020


On Tue, 2020-09-01 at 16:13 -0600, Martin Sebor wrote:
> On 9/1/20 2:09 AM, Christophe Lyon wrote:
> > On Mon, 31 Aug 2020 at 23:50, Martin Sebor <msebor@gmail.com> wrote:
> > > On 8/31/20 4:51 AM, Christophe Lyon wrote:
> > > > Hi,
> > > > 
> > > ...
> > > > I pushed a small aarch64 patch as obvious:
> > > >       2020-08-31  Christophe Lyon  <christophe.lyon@linaro.org>
> > > > 
> > > >           gcc/testsuite/
> > > >           * gcc.target/aarch64/strcmpopt_6.c: Suppress -Wstringop-overread.
> > > > (same as you added for i386)
> > > 
> > > Thank you!
> > > 
> > > > On arm, there is a regression:
> > > > FAIL: c-c++-common/Warray-bounds-6.c  -Wc++-compat  (test for excess errors)
> > > > Excess errors:
> > > > /gcc/testsuite/c-c++-common/Warray-bounds-6.c:16:3: warning: 'strncpy'
> > > > writing 1 or more bytes into a region of size 0 overflows the
> > > > destination [-Wstringop-overflow=]
> > > > 
> > > > and the new test has several failures:
> > > >       gcc.dg/Wstringop-overread.c  (test for warnings, line 100)
> > > >       gcc.dg/Wstringop-overread.c  (test for warnings, line 110)
> > > >       gcc.dg/Wstringop-overread.c  (test for warnings, line 167)
> > > >       gcc.dg/Wstringop-overread.c  (test for warnings, line 177)
> > > >       gcc.dg/Wstringop-overread.c  (test for warnings, line 279)
> > > >       gcc.dg/Wstringop-overread.c  (test for warnings, line 289)
> > > >       gcc.dg/Wstringop-overread.c  (test for warnings, line 338)
> > > >       gcc.dg/Wstringop-overread.c  (test for warnings, line 372)
> > > >       gcc.dg/Wstringop-overread.c  (test for warnings, line 374)
> > > >       gcc.dg/Wstringop-overread.c  (test for warnings, line 532)
> > > >       gcc.dg/Wstringop-overread.c  (test for warnings, line 566)
> > > >       gcc.dg/Wstringop-overread.c  (test for warnings, line 568)
> > > >       gcc.dg/Wstringop-overread.c  (test for warnings, line 74)
> > > >       gcc.dg/Wstringop-overread.c  (test for warnings, line 84)
> > > > FAIL: gcc.dg/Wstringop-overread.c (test for excess errors)
> > > > Excess errors:
> > > > /gcc/testsuite/gcc.dg/Wstringop-overread.c:302:3: warning: 'strnlen'
> > > > specified bound [1, 4294967295] exceeds source size 0
> > > > [-Wstringop-overread]
> > > > /gcc/testsuite/gcc.dg/Wstringop-overread.c:306:3: warning: 'strnlen'
> > > > specified bound [1, 4294967295] exceeds source size 0
> > > > [-Wstringop-overread]
> > > > /gcc/testsuite/gcc.dg/Wstringop-overread.c:312:3: warning: 'strnlen'
> > > > specified bound [1, 4294967295] exceeds source size 0
> > > > [-Wstringop-overread]
> > > > /gcc/testsuite/gcc.dg/Wstringop-overread.c:323:3: warning: 'strnlen'
> > > > reading 1 or more bytes from a region of size 0 [-Wstringop-overread]
> > > > /gcc/testsuite/gcc.dg/Wstringop-overread.c:351:3: warning: 'strnlen'
> > > > reading 1 or more bytes from a region of size 0 [-Wstringop-overread]
> > > > /gcc/testsuite/gcc.dg/Wstringop-overread.c:498:3: warning: 'strndup'
> > > > specified bound [1, 4294967295] exceeds source size 0
> > > > [-Wstringop-overread]
> > > > /gcc/testsuite/gcc.dg/Wstringop-overread.c:502:3: warning: 'strndup'
> > > > specified bound [1, 4294967295] exceeds source size 0
> > > > [-Wstringop-overread]
> > > > /gcc/testsuite/gcc.dg/Wstringop-overread.c:508:3: warning: 'strndup'
> > > > specified bound [1, 4294967295] exceeds source size 0
> > > > [-Wstringop-overread]
> > > > /gcc/testsuite/gcc.dg/Wstringop-overread.c:518:3: warning: 'strndup'
> > > > reading 1 or more bytes from a region of size 0 [-Wstringop-overread]
> > > > /gcc/testsuite/gcc.dg/Wstringop-overread.c:545:3: warning: 'strndup'
> > > > reading 1 or more bytes from a region of size 0 [-Wstringop-overread]
> > > > 
> > > > Can you check these?
> > > 
> > > They should be fixed as of yesterday:
> > >     https://gcc.gnu.org/pipermail/gcc-patches/2020-August/552976.html
> > > 
> > > Can you please retest with an updated build?
> > 
> > Indeed, thanks!
> > 
> 
> With this commit:
> https://gcc.gnu.org/pipermail/gcc-patches/2020-September/553109.html
> the remaining failures should now be gone.  Please let me know if
> any persist.
There's a related glibc build failure, but I think Joseph ack'd a fix for it
today.

jeff
> 



More information about the Gcc-patches mailing list