From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 97ECA3858D1E for ; Tue, 20 Jun 2023 10:46:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 97ECA3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687257961; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gGrMpO7ZJDdsuSLJmBh6gbOn5Broi99n5InUA8JDs2Q=; b=X91WPe3E/JEHylhjZ+e6/uy0EP34ql9PI4I6mUobIbPRD/oSxxknzBfePQAS3dsXugwRFI wqcgpnfUkKYClpGdSXUUVkvJzksosRno+Z2nfiOlDN2eBeQL0YpPfvRj/EWjdQUH6lOUy8 WZ1AA4bvoKj2SczYcxTfaHWwbELFgI8= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-378-d3XBfSIMNnKNLJ1nO6Cc4A-1; Tue, 20 Jun 2023 06:45:59 -0400 X-MC-Unique: d3XBfSIMNnKNLJ1nO6Cc4A-1 Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2b46d5db8daso17940401fa.3 for ; Tue, 20 Jun 2023 03:45:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687257958; x=1689849958; h=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=gGrMpO7ZJDdsuSLJmBh6gbOn5Broi99n5InUA8JDs2Q=; b=j+1iIiPSAXOuPB/VGTjJ8JvmXF1W267Hs+5yton0ET71G8aicYkba0kmHDd+nHgwQ3 Hr6ruIJKI1AXoPmWIsxCCiMt4P1DYwn3/8+Ottr1uKdZ9WaySl+q+uu1f5qgq2biyWbD 4+40fsHms5jfW11rUut0XYZ4allPUxOoovehtnOZs463pKexriIHn1sVyKYAFeA25bze 7eo4oQv3Pix5+4QWWuQs+JlcswxZ6Q8ZENvWkw1s7XvDBtRMOv4QZ7oHwtnPcbcWnuKV TB12ikhOQFhPZIfMPHpVm8EVDGgEkGCUAhPU2+hh0/Jnc1N8oQvzDZyyjSWJ0KMu8tgJ 4UtA== X-Gm-Message-State: AC+VfDy0cZGrqfol0JaD9RCgSF4XMoz01Fb+cq6xX6CtCP11uGTYQkeS F7L2+sDWQtZXYXRm6t+Okng8puIkzB9xCJ8w/DvHg+D8X5E8RGOaHQXTF1uhTJeW8IgCiFnITBv m3k7AjTr2xd5dtJtyJ5VhKdE3/XaEl5hmsA== X-Received: by 2002:a2e:3508:0:b0:2b4:5b9c:a01b with SMTP id z8-20020a2e3508000000b002b45b9ca01bmr7312584ljz.53.1687257958305; Tue, 20 Jun 2023 03:45:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5WD+gmcGo9pByq6JRUonO2ugiYFZAhJl0hRWmtVM4dd37pCVB6dWV6CUdCiNwYsJw64taZ00Vy08+ea4BCDEI= X-Received: by 2002:a2e:3508:0:b0:2b4:5b9c:a01b with SMTP id z8-20020a2e3508000000b002b45b9ca01bmr7312570ljz.53.1687257958004; Tue, 20 Jun 2023 03:45:58 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Tue, 20 Jun 2023 11:45:46 +0100 Message-ID: Subject: Re: [libstdc++] Improve M_check_len To: Andreas Schwab Cc: Jakub Jelinek via Gcc-patches , Jan Hubicka , Jakub Jelinek , "libstdc++" X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="0000000000003b505505fe8d5b0b" X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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: --0000000000003b505505fe8d5b0b Content-Type: text/plain; charset="UTF-8" On Tue, 20 Jun 2023 at 09:21, Andreas Schwab wrote: > On Jun 20 2023, Jakub Jelinek via Gcc-patches wrote: > > > Is it safe even on 64bit targets? I mean, doesn't say PowerPC already > allow > > full 64-bit virtual address space? The assumption that one can't have > > more than half of virtual address space allocations is true right now at > > least on x86-64, aarch64 and others, but isn't that something that can > > change with newer versions of CPUs without the need to recompile > > applications (add another level or two of page tables)? > > At least s390 can allocate more than half the address space. That > triggered a failure in gawk. > Is PTRDIFF_MAX large enough to represent the difference between any two pointers? What we're considering for libstdc++ is treating PTRDIFF_MAX as an upper limit on allocation size. If there are targets that can really allocate a 2^63 byte array, they won't be able to represent the difference between the first element and the last element unless ptrdiff_t is wider than 64 bits. --0000000000003b505505fe8d5b0b--