public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* PR 108846 regression
@ 2023-04-03 19:59 François Dumont
  2023-04-03 20:06 ` Jonathan Wakely
  0 siblings, 1 reply; 3+ messages in thread
From: François Dumont @ 2023-04-03 19:59 UTC (permalink / raw)
  To: libstdc++

After a full rebuild and run of testsuite based on master I have this 
regression:

FAIL: 23_containers/vector/bool/allocator/copy.cc (test for excess errors)
Excess errors:
/home/fdumont/dev/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:437: 
warning: 'void* __builtin_memmove(void*, const void*, long unsigned 
int)' writing between 9 and 9223372036854775807 bytes into a region of 
size 8 overflows the destination [-Wstringop-overflow=]

It comes from the change related to PR 108846, revision 
822a11a1e642e0abe92a996e7033a5066905a447

The compiler seems to have enough info to find out that destination 
memory area is 8 bytes large but not enough to see that _Num is 1 and so 
never going to call the __builtin_memmove. Maybe a compiler bug.

I'm working on a patch to restore previous code when src and dst pointer 
types are the same.

But I won't be able to continue my work on it before Wednesday so I 
prefer to let you know just in case you would like to fix it before that 
and maybe differently.

François



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PR 108846 regression
  2023-04-03 19:59 PR 108846 regression François Dumont
@ 2023-04-03 20:06 ` Jonathan Wakely
  2023-04-05 17:03   ` François Dumont
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Wakely @ 2023-04-03 20:06 UTC (permalink / raw)
  To: François Dumont; +Cc: libstdc++

On Mon, 3 Apr 2023 at 21:00, François Dumont via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> After a full rebuild and run of testsuite based on master I have this
> regression:
>
> FAIL: 23_containers/vector/bool/allocator/copy.cc (test for excess errors)
> Excess errors:
> /home/fdumont/dev/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:437:
> warning: 'void* __builtin_memmove(void*, const void*, long unsigned
> int)' writing between 9 and 9223372036854775807 bytes into a region of
> size 8 overflows the destination [-Wstringop-overflow=]
>
> It comes from the change related to PR 108846, revision
> 822a11a1e642e0abe92a996e7033a5066905a447
>
> The compiler seems to have enough info to find out that destination
> memory area is 8 bytes large but not enough to see that _Num is 1 and so
> never going to call the __builtin_memmove. Maybe a compiler bug.

Yes, it's a compiler bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109353

> I'm working on a patch to restore previous code when src and dst pointer
> types are the same.

How will that avoid the PR 108846 problem of overwriting tail padding?

>
> But I won't be able to continue my work on it before Wednesday so I
> prefer to let you know just in case you would like to fix it before that
> and maybe differently.
>
> François
>
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PR 108846 regression
  2023-04-03 20:06 ` Jonathan Wakely
@ 2023-04-05 17:03   ` François Dumont
  0 siblings, 0 replies; 3+ messages in thread
From: François Dumont @ 2023-04-05 17:03 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: libstdc++


On 03/04/2023 22:06, Jonathan Wakely wrote:
> On Mon, 3 Apr 2023 at 21:00, François Dumont via Libstdc++
> <libstdc++@gcc.gnu.org> wrote:
>> After a full rebuild and run of testsuite based on master I have this
>> regression:
>>
>> FAIL: 23_containers/vector/bool/allocator/copy.cc (test for excess errors)
>> Excess errors:
>> /home/fdumont/dev/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:437:
>> warning: 'void* __builtin_memmove(void*, const void*, long unsigned
>> int)' writing between 9 and 9223372036854775807 bytes into a region of
>> size 8 overflows the destination [-Wstringop-overflow=]
>>
>> It comes from the change related to PR 108846, revision
>> 822a11a1e642e0abe92a996e7033a5066905a447
>>
>> The compiler seems to have enough info to find out that destination
>> memory area is 8 bytes large but not enough to see that _Num is 1 and so
>> never going to call the __builtin_memmove. Maybe a compiler bug.
> Yes, it's a compiler bug:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109353
>
>> I'm working on a patch to restore previous code when src and dst pointer
>> types are the same.
> How will that avoid the PR 108846 problem of overwriting tail padding?

Indeed, test cases have shown me that copy was called with pointers on 
the same type. No way to find out that the fix is not necessary in this 
case.

We just need to wait for the compiler to be fixed then.

Bests


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-04-05 17:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-03 19:59 PR 108846 regression François Dumont
2023-04-03 20:06 ` Jonathan Wakely
2023-04-05 17:03   ` François Dumont

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).