From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) by sourceware.org (Postfix) with ESMTPS id 3802F385841E for ; Mon, 27 Nov 2023 15:02:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3802F385841E Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=google.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3802F385841E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::735 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701097363; cv=none; b=TQK/K/gebkEe59gYOg+pNLW9/vB8ye0bFd7YurtHpPEYkHsD5d66w/N9LvIGY9rR8RjcYhcj0OLLW4Q/UUuGInkzceQO0K4Pg+jx0TNSUjY/JOjZ4ykdWNrlaC3evjkwA+AbESdK9EBGk0ouIzJkrTDAZxizKAA47CyPRn4jN/0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701097363; c=relaxed/simple; bh=YrHzXSsLsH7xIeSmma95IvqU5j0VhQcJ06kG6FnnFIM=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=pTo1LGp6yOZBokFpHEOmJnZFWKuwjqPj/qnnldL+j35L5W4HNqFMz569lSqE+UQM5NwgH3lCL6sxT8V1YYpBcPp8uLS1gHc2oJeCvMyHVeBiz7WTkpij0oDmKSVT4zYylNVH5EzGha0yP8wjWxnoIAtdx9itX52a7AGBGfPSZb8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-qk1-x735.google.com with SMTP id af79cd13be357-77d6f853ba0so336838785a.0 for ; Mon, 27 Nov 2023 07:02:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701097361; x=1701702161; darn=sourceware.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=r/3P+dGmrnUwMmcvz97u3AogeWqfFI/aGzeGtHX6lJM=; b=oPDYgbloxZfIgEOK7qec9qnqb9b2Z3SfxU1iPUqpNLyzksAkzTVfSoMrrn5fteNeQ0 uMrqU6TAzzH/v8dFA3UrMQ83fUnA2xU6wjsdMsEFIYWhinHyOGAies2+5xlfjJXb6QKQ 9yoewJY/ysGAZ+w+cHj1aUW9HBn7Zj4bH6H5KkqatUidrTQwLlxX7odW2ArwlMiKZ1g2 18g59dBm7JD37+4EiZA80DOphd66/tQAfVGZ4tNSE06qVyHsctrf1BeozsPP4+qviuZi RbMWJAn6iqRHhrI+9PNkSG7MnpEbL1rAQg3kf8nBfNe99BMx87dWD5F47SPflojwdWbw 7KNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701097361; x=1701702161; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r/3P+dGmrnUwMmcvz97u3AogeWqfFI/aGzeGtHX6lJM=; b=Elv2XYfGkw7GCRNBYIYf9bMqztbmVcTVNvjHfgEVBE5+T/S9rcfU4IZSHYWtKVDwBt BCfoeDpwbG6eQlKbR8HWLZQYDt7QAGhrjW/8nwgG/qBct+2Xdp1gI44pKBoDWCOXo/5P qiVryL/LSlR3dS+kXKtN4xx9+ffXilmBnp+NB014uqufQiVIRQQVoAJI/Clrw2AeSujE M6BH52h6ct6VwbiDyZ1BnakvkXPnLGAwgomNEU3JLLBAb48MPrkLqeVisB9dZ2Em8/Ol U23zXdlDnhxtmYcx1yAD88dkgEM0OW6gPdlScIB4Qas4oczuxZiwLJozpPEMsdhPQzy+ 4aOA== X-Gm-Message-State: AOJu0YxEGA/iHwm1UHWTuQXAFgmHzpOOX6zxsTmtkIVmVhJX4f1Hua1u YbfAINViKq1qbD0RALlwgqb/Yi92kd5Noy72SdvRuQ== X-Google-Smtp-Source: AGHT+IGBIQTdClHbswngyU5cFktOozk8XhVGWjr2MlccHOF3BP/vw7+CiB1ZfTHnLY6dP6o0WWX2+uPDUB1rd+6WVGE= X-Received: by 2002:a05:6214:184f:b0:67a:26fc:bbe0 with SMTP id d15-20020a056214184f00b0067a26fcbbe0mr9675664qvy.32.1701097361164; Mon, 27 Nov 2023 07:02:41 -0800 (PST) MIME-Version: 1.0 References: <5dc45a47-3266-4ae6-80ec-17601be8454a@ralfj.de> In-Reply-To: From: enh Date: Mon, 27 Nov 2023 07:02:26 -0800 Message-ID: Subject: Re: Support for memcpy with equal source and destination To: Zack Weinberg Cc: Ralf Jung , Wilco Dijkstra , GNU libc development Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.7 required=5.0 tests=BAYES_00,DKIMWL_WL_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, Nov 27, 2023 at 6:54=E2=80=AFAM Zack Weinberg w= rote: > > On Mon, Nov 27, 2023, at 9:45 AM, Ralf Jung wrote: > >> Paul's example was to show that with restrict you could write a confor= mant > >> C implementation. I think it is sufficient to cast away restrict witho= ut 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. > > As a practical matter, if we remove restrict annotations from the public = memcpy > declaration in string.h, _someone_ is going to think that's a bug, and al= so I > wouldn't be surprised if future compilers started complaining about misma= tches > with their internal prototype. (Neither GCC 13 nor clang 16 does this _n= ow_.) fwiw, bionic doesn't use `restrict` at all in headers, and no human or compiler has noticed yet. > zw