From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by sourceware.org (Postfix) with ESMTPS id 454963858CDB for ; Thu, 18 May 2023 18:25:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 454963858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3f41d087a84so11168745e9.1 for ; Thu, 18 May 2023 11:25:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684434300; x=1687026300; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:from:to:cc:subject:date:message-id :reply-to; bh=WWTHqAgunrnOZp04orVaZGbm7hDbzVDBhJFW9T+Ktbw=; b=o/DPIUyXO6qgdLcEv0xkBvYfMgDNobO/eS1YN+jzaRVQTyyg9dVzaaQTy9F1Ne0AKB sehX0nOAh2pSc0WCCXCYf5LllJfAYr3b8eKBpaIAixO+44Tq0vgrXpi0Z7WmpNK66Zic NDcyj8LG6V0+jpxwXs6FQ7AqYTNI8lHw4VeMxLGCMbfhwAv6CzQ1Y/XkYdDklDTHAlqB CD83CY4gm0SWrHIlVo4+a/Shne8pvgCfcNmsWoaDlaNPZpj8zocAIjH8tPvREjmGTYBI 2bph70dTVJWP9tLjpjZCj/jM5SOBajEdRLCUefY6flcHmS7Zfla8LknvlD0u5BQNb5Q7 MpVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684434300; x=1687026300; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WWTHqAgunrnOZp04orVaZGbm7hDbzVDBhJFW9T+Ktbw=; b=kPnXE1s+3kvb6Si85ZScdx+nrKb4u2gfAX3CKJroqb+TnJBksZ+lsIrKcgtAcS8e7d Sx2yvRYx0ScdgpewXj/miw+oOiLPhC0NKCRAkeIwKnQ/uoivo+U8at0W4R1g0iiZGk6s AHO9lPmkBdBqjo5i6t1Uap0Ew8fcUTZRiAq7+eQPB8/5OoBE8h9dXwV9VqH5yPnBR6K3 FfCUQ2XxZo5ToF7+VjlaVbhRy21GzePSgbeI3nmNUMDeUD8vUWFJYxq7NFHdNaCRGZ/N SGwMhGZV0n8C4zLGOzF/MqQ96RTDGhrIdzGiNcMrYvBqXX2WlFiQi7yBqTWz3lMrWOBn eLWQ== X-Gm-Message-State: AC+VfDzf7yvO+MsjwuYLYVzS+41SsMJ1Fj/dbKzPnoAs3oY9UsYaCX/b hiPtyclbgH3TndYlcO/KJET34D23OGT45g== X-Google-Smtp-Source: ACHHUZ5PsJ0UeUL7EEt/AqD0UKLduSxu1Mb+7zt2cND2LhGvJkkmplWtYceExdqNRpth4gKhcEdwRQ== X-Received: by 2002:a05:600c:1c1b:b0:3f5:b15:87ee with SMTP id j27-20020a05600c1c1b00b003f50b1587eemr2177335wms.18.1684434299718; Thu, 18 May 2023 11:24:59 -0700 (PDT) Received: from smtpclient.apple ([2a02:3038:204:6794:197d:abb1:6f8c:d13d]) by smtp.gmail.com with ESMTPSA id k5-20020a7bc405000000b003f32f013c3csm50273wmi.6.2023.05.18.11.24.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 May 2023 11:24:59 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Richard Biener Mime-Version: 1.0 (1.0) Subject: Re: [PATCH] Fix internal error on small array with negative lower bound Date: Thu, 18 May 2023 20:24:48 +0200 Message-Id: <1623D788-786F-474C-9BBC-80EBF576AB0D@gmail.com> References: <1897759.taCxCBeP46@fomalhaut> Cc: gcc-patches@gcc.gnu.org In-Reply-To: <1897759.taCxCBeP46@fomalhaut> To: Eric Botcazou X-Mailer: iPhone Mail (20E252) X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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: > Am 18.05.2023 um 19:44 schrieb Eric Botcazou : >=20 > =EF=BB=BF >>=20 >> Would it be better to use >>=20 >> wi::to_uhwi (wi::to_wide (local->index) - wi::to_wide (local->min_index)= ) >>=20 >> to honor the actual sign of the indices? I think nothing forbids fronten= ds >> to use a signed TYPE_DOMAIN here? But the difference should be always >> representable in an unsigned value of course. >=20 > We use tree_to_uhwi everywhere else though, see categorize_ctor_elements_1= : >=20 > if (tree_fits_uhwi_p (lo_index) && tree_fits_uhwi_p (hi_index)) > mult =3D (tree_to_uhwi (hi_index) > - tree_to_uhwi (lo_index) + 1); >=20 > or store_constructor >=20 > this_node_count =3D (tree_to_uhwi (hi_index) > - tree_to_uhwi (lo_index) + 1); >=20 > so the proposed form looks better for the sake of consistency. Ok, thanks for checking. Richard=20 > --=20 > Eric Botcazou >=20 >=20