From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30495 invoked by alias); 11 Apr 2011 13:28:12 -0000 Received: (qmail 30486 invoked by uid 22791); 11 Apr 2011 13:28:11 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 11 Apr 2011 13:28:07 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 5D3CBCB01B2; Mon, 11 Apr 2011 15:28:05 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tWKguGx10X-A; Mon, 11 Apr 2011 15:28:02 +0200 (CEST) Received: from [192.168.1.2] (bon31-9-83-155-120-49.fbx.proxad.net [83.155.120.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 482FDCB01EF; Mon, 11 Apr 2011 15:28:02 +0200 (CEST) From: Eric Botcazou To: Richard Guenther Subject: Re: [PATCH] Remove VRPs use of TYPE_MIN/MAX_VALUE Date: Mon, 11 Apr 2011 13:28:00 -0000 User-Agent: KMail/1.9.9 Cc: gcc-patches@gcc.gnu.org References: In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201104111522.39216.ebotcazou@adacore.com> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-04/txt/msg00752.txt.bz2 > The middle-end treats conversions between integral types that differ > in TYPE_MIN/MAX_VALUE but not in TYPE_PRECISION or signedness as useless. > This is inconsistent with VRP extracting range information from such > types (and it is not clear how NOP conversions behave here anyway). IIRC we agreed, by the time I fixed the Ada compiler, that the IL shouldn't contain types with non-canonical bounds, except for constructs that don't generate code like the TYPE_DOMAIN of arrays. My understanding is that this has been the case (modulo bugs) for some time now, so I don't understand your remark about NOP conversions. > The following patch thus simply removes VRPs looking at TYPE_MIN/MAX_VALUE > in favor of using a canonical min/max value based on signedness and > precision. This exposes a latent bug in upper_bound_in_type and > lower_bound_in_type which do not properly sign-extend sizetype constants. Wouldn't it be better performance-wise to keep using TYPE_MIN/MAX_VALUE and add an appropriate check for non-standard types at the end of gimplification? -- Eric Botcazou