From patchwork Wed Feb 1 09:52:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tristan Gingold X-Patchwork-Id: 138930 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]) by ozlabs.org (Postfix) with SMTP id 1D646B6EEE for ; Wed, 1 Feb 2012 20:52:26 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1328694747; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:Content-Type:Content-Transfer-Encoding:Subject: Date:Message-Id:To:Mime-Version:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=rP/vD78nn+XzvfSD7ToX6hut3yw=; b=eMGwVwcgYGeS71d 5DqX+zGPfJGWnmxLywLvSfu37oLFmnhCB/ZUi0laXrxO8HTQnxWnBBU9Aw6XRZQv dL3CgOny4qrc0uvyOUEKiwkZ20ebb4mc/s6/kTJ2uUEurlA2bAQluEHFWZ5ChSyo Xw86R7jLk8b4wqxXxqoP43QeYW7E= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:From:Content-Type:Content-Transfer-Encoding:Subject:Date:Message-Id:To:Mime-Version:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=i+rYS29HoLaDzMnzZ3+D4tqEG4IBEHxKj8OGRU8EgA1twTz5PM6RLcP3uQN8+Q 9sf4piq8npt9/PMMbFvDCc0rEiHi88k54dK77b/OO4J6FgKfhzBbOcfr56dVIePM VxUGrB3/6gMD7G5+WHLhoGs9RhrXQ+HkFN4AuJV9Zf1Z0=; Received: (qmail 15331 invoked by alias); 1 Feb 2012 09:52:24 -0000 Received: (qmail 15321 invoked by uid 22791); 1 Feb 2012 09:52:23 -0000 X-SWARE-Spam-Status: No, hits=-1.7 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; Wed, 01 Feb 2012 09:52:10 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 88C92290039 for ; Wed, 1 Feb 2012 10:52:10 +0100 (CET) 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 iScV4xr-035D for ; Wed, 1 Feb 2012 10:52:10 +0100 (CET) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 76034290026 for ; Wed, 1 Feb 2012 10:52:10 +0100 (CET) From: Tristan Gingold Subject: [Patch/ada] Fix thinko in Loop_Statement_to_gnu Date: Wed, 1 Feb 2012 10:52:09 +0100 Message-Id: <1349152F-107D-4496-86A3-DE3148A070E0@adacore.com> To: GCC Patches Mime-Version: 1.0 (Apple Message framework v1251.1) X-IsSubscribed: yes 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 Hi, this patchlet fixes a thinko in Loop_Statement_to_gnu: size_type_node was used instead of sizetype. Privately approved by Eric. Committed on trunk. Tristan. gcc/ada 2012-02-01 Tristan Gingold * gcc-interface/trans.c (Loop_Statement_to_gnu): Use sizetype instead of size_type_node. Index: ada/gcc-interface/trans.c =================================================================== --- ada/gcc-interface/trans.c (revision 183790) +++ ada/gcc-interface/trans.c (working copy) @@ -2380,15 +2380,14 @@ /* Otherwise, use the do-while form with the help of a special induction variable in the unsigned version of the base type - or the unsigned version of the size type, whichever is the + or the unsigned version of sizetype, whichever is the largest, in order to have wrap-around arithmetics for it. */ else { - if (TYPE_PRECISION (gnu_base_type) - > TYPE_PRECISION (size_type_node)) + if (TYPE_PRECISION (gnu_base_type) > TYPE_PRECISION (sizetype)) gnu_base_type = gnat_unsigned_type (gnu_base_type); else - gnu_base_type = size_type_node; + gnu_base_type = sizetype; gnu_first = convert (gnu_base_type, gnu_first); gnu_last = convert (gnu_base_type, gnu_last);