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

List:       glibc-alpha
Subject:    Re: Support for memcpy with equal source and destination
From:       Ralf Jung <post () ralfj ! de>
Date:       2023-11-27 14:45:45
Message-ID: 5dc45a47-3266-4ae6-80ec-17601be8454a () ralfj ! de
[Download RAW message or body]

Hi all,

>> However, at that point it seems unclear why that branch should live inside
>> `memcpy`, rather than being performed by the caller. The entire argument made
>> all along by compiler developers (as I understood it) was that the existing
>> `memcpy` are already working fine for the src==dest case; if new branches need
>> to be added, that's a different discussion.
> 
> Existing implementations don't need (or want) any extra branches. We also don't
> want to complicate inline memcpy expansions. They all work fine if src==dst.
> 
> Paul's example was to show that with restrict you could write a conformant
> C implementation. I think it is sufficient to cast away restrict without adding an
> extra branch (the existing generic C version does this).

I don't think it is possible to cast away restrict. The restrict rules apply to 
all pointers derived from the restrict pointer.

Kind regards,
Ralf
[prev in list] [next in list] [prev in thread] [next in thread] 

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