From patchwork Thu Apr 24 18:55:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mike Stump X-Patchwork-Id: 342468 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2D52614011D for ; Fri, 25 Apr 2014 04:55:19 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; q=dns; s= default; b=qmjqXzidnv8ii9RGftU+2r8MmW0d8kUZ25c11kJqU6ZvnPdOK2Z8I eEAN0wTWBAkWIia7T7GhoPReE82IDuG+kwalMxl0eaZ7fR/Jce2RT8rKRl29T1+C tyA6lCEIcXY6UiGxPxVHRMtMrs4uBFATiI1csUwThgYRHewErw7dps= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=default; bh=BhWq3SNqDk36d1cMz61McQLCatU=; b=pcB5O4xYudyH5yWuL5AgSwZtXrt4 U3IPf5gk59fjegw8nb9u+daQiTLiV3N1qUsasdyTRUDtAqpKFa1p14RGGmirP+3E t09cmTP0H6nksjqSKZtFERPjZfHP5RnPZgyfus+5vYVXDog0AEaJNQUG2jZSM4ss cdJgECP7vUtrD7s= Received: (qmail 6691 invoked by alias); 24 Apr 2014 18:55:12 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 6678 invoked by uid 89); 24 Apr 2014 18:55:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: qmta10.emeryville.ca.mail.comcast.net Received: from qmta10.emeryville.ca.mail.comcast.net (HELO qmta10.emeryville.ca.mail.comcast.net) (76.96.30.17) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 24 Apr 2014 18:55:10 +0000 Received: from omta14.emeryville.ca.mail.comcast.net ([76.96.30.60]) by qmta10.emeryville.ca.mail.comcast.net with comcast id ttf91n0011HpZEsAAuv96G; Thu, 24 Apr 2014 18:55:09 +0000 Received: from up.mrs.kithrup.com ([24.4.193.248]) by omta14.emeryville.ca.mail.comcast.net with comcast id tuv81n0015N1HX48auv8qr; Thu, 24 Apr 2014 18:55:09 +0000 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: wide-int, ada From: Mike Stump In-Reply-To: <1464599.QpNUskFgRu@polaris> Date: Thu, 24 Apr 2014 11:55:07 -0700 Cc: "gcc-patches@gcc.gnu.org Patches" , Kenneth Zadeck Message-Id: References: <0075C6DB-B432-4E6F-8A48-3AE0C4D842FE@comcast.net> <1464599.QpNUskFgRu@polaris> To: Eric Botcazou X-IsSubscribed: yes On Nov 25, 2013, at 12:46 AM, Eric Botcazou wrote: >> Richi has asked the we break the wide-int patch so that the individual port >> and front end maintainers can review their parts without have to go through >> the entire patch. This patch covers the ada front-end. > > I don't think that the mechanical change in UI_From_gnu is correct, see the > comment just above. The annotate_value change is very likely correct, but > please double check and, upon positive outcome, remove the last sentence of > the comment just above. The rest looks good, thanks. So, given the last change, the remaining bit is: We need this to ensure that 32 to 63 bit values with the high bit set don’t return No_Uint. This should also address the performance concerns as well. Ok? Index: gcc/ada/gcc-interface/cuintp.c =================================================================== --- gcc/ada/gcc-interface/cuintp.c (revision 209754) +++ gcc/ada/gcc-interface/cuintp.c (working copy) @@ -160,7 +160,11 @@ UI_From_gnu (tree Input) in a signed 64-bit integer. */ if (tree_fits_shwi_p (Input)) return UI_From_Int (tree_to_shwi (Input)); - else if (wi::neg_p (Input) && TYPE_UNSIGNED (gnu_type)) + + gcc_assert (TYPE_PRECISION (gnu_type) <= 64); + if (TYPE_UNSIGNED (gnu_type) + && TYPE_PRECISION (gnu_type) == 64 + && wi::neg_p (Input, SIGNED)) return No_Uint; #endif