From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id 96C783858C2F for ; Thu, 18 Aug 2022 07:54:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 96C783858C2F Received: by mail-wr1-x434.google.com with SMTP id a4so782083wrq.1 for ; Thu, 18 Aug 2022 00:54:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=mTKGIL2BbXcO4ArQ53Hmo3OAPCkkzFqHCUNAB/9nUBQ=; b=EWPiLvJGnaet+bT6+NZIFePIR9mpbSyCcgah6YmEm1OEKDuuRYcd51G0QN5OqY7N0s OzSNTwjUYMlJPlV1/7IuZ5EqEaw97oRDXxkUA6/jmoOiBcgXAmtLQ0ffKDx3jEKd8iPA 2r1YzFI9D+2QnnUgFhzr7PHoKulynsbGnjE3Lx9emsr2fF8do58RxknLd6rhPLDjGYRd 36sNT3F8B+dgKa/XEh88uyrroTrT8XjBTwZ34FElgXgfJPMStFfwzUSvGDLmqbAgfwCL k2sh6X0BDxtH0wxzpazEbibhUVhiFQfW2keUHKTj2YD668YM3APenrI0PmGeMY258VQ8 wlYQ== X-Gm-Message-State: ACgBeo2V3F4rwI+tz1kjwBJ7NS61GqFrNGVqVFkOD10fRtnsJ5bGiy9D QhILXVpLEv9u9u+MC3YTDbsunA== X-Google-Smtp-Source: AA6agR7WorSd8CJvoeDGk6QlalJBgxUCcz3Wjv/quGpnbxd8IViOLv1+P0W0GCqZOuHyB0P3u/zShg== X-Received: by 2002:adf:ecce:0:b0:225:2c58:246f with SMTP id s14-20020adfecce000000b002252c58246fmr834154wro.460.1660809280420; Thu, 18 Aug 2022 00:54:40 -0700 (PDT) Received: from arcturus.localnet ([2a01:cb10:8647:7500:603a:7837:893c:1da4]) by smtp.gmail.com with ESMTPSA id g13-20020adfe40d000000b0021f15514e7fsm872548wrm.0.2022.08.18.00.54.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 00:54:39 -0700 (PDT) From: Eric Botcazou X-Google-Original-From: Eric Botcazou To: Richard Biener Cc: GCC Patches Subject: Re: [PATCH] Fix bogus -Wstringop-overflow warning in Ada Date: Thu, 18 Aug 2022 09:55:16 +0200 Message-ID: <2251622.ElGaqSPkdT@arcturus> In-Reply-To: References: <3184807.aeNJFYEL58@arcturus> <1825906.tdWV9SEqCh@arcturus> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Aug 2022 07:54:44 -0000 > Meh. OK, eventually would need "indirection" through a wide-int then. > Like > > offset_int::from (wi::to_wide (lowbnd), TYPE_SIGN (TREE_TYPE (lowbnd))) That would be OK if get_offset_range did the same, but it does not since it forces a sign-extension whatever the sign of a large type: signop sgn = SIGNED; /* Only convert signed integers or unsigned sizetype to a signed offset and avoid converting large positive values in narrower types to negative offsets. */ if (TYPE_UNSIGNED (type) && wr[0].get_precision () < TYPE_PRECISION (sizetype)) sgn = UNSIGNED; > I think it should extend according to sing of lowbnd? Or does Ada > use an unsigned lowbnd to represent a signed value here? At least > that's what I had issues with with your patch. It uses sizetype like everyone else and the signedness was forced on it because of the POINTER_PLUS_EXPR thing, i.e. it was signed before. -- Eric Botcazou