From patchwork Tue Jul 17 10:15:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 171389 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 047CD2C0127 for ; Tue, 17 Jul 2012 20:15:56 +1000 (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=1343124957; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Cc:Subject:Message-ID: MIME-Version:Content-Type:Content-Disposition:User-Agent: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=YjcIKr+mqyMo8qj27JNX n+0BYcg=; b=dNUhVfSdxm2K+hxhPUjmM6bQqAJaiNtBHdYPAq2lLf0LtPj3rClo nFDJwsRVg5Mu9ZPL1J627iMtvu1ypCA5XBcC5/Mfy7MQWtDLR9XQfd06FNL85DB/ 2l5euvRABgy7n3h5Ly8C7jy5Wt9qKuWEarPJ80fmLcRXyFh/mcCo46c= 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:Received:Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type:Content-Disposition:User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=KCf4xrQeqnqY7a9Da2V30CdAHtHMombhBBH7FxQLnTijbabkbDQn6Av6F89Hv2 KetiPZIRCTcdI9W7B8gTACbP/Su8ly+jtgXB65yUE0Ol+pgDvZnCuZG7ebvDYepm ozml4q/xq0P1O3ziSXmEa/Y5Rxq4cdF+Y7cKGgXP75WmM=; Received: (qmail 31850 invoked by alias); 17 Jul 2012 10:15:35 -0000 Received: (qmail 31805 invoked by uid 22791); 17 Jul 2012 10:15:33 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_HOSTKARMA_NO X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 Jul 2012 10:15:20 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id F324C1C6EEC; Tue, 17 Jul 2012 06:15:18 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Tw90FJ17GDhg; Tue, 17 Jul 2012 06:15:18 -0400 (EDT) Received: from kwai.gnat.com (kwai.gnat.com [205.232.38.4]) by rock.gnat.com (Postfix) with ESMTP id CFE111C6E13; Tue, 17 Jul 2012 06:15:18 -0400 (EDT) Received: by kwai.gnat.com (Postfix, from userid 4192) id CCA4F3FF09; Tue, 17 Jul 2012 06:15:18 -0400 (EDT) Date: Tue, 17 Jul 2012 06:15:18 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Vincent Celier Subject: [Ada] gnatmake -s -gnatn1 always recompiles Message-ID: <20120717101518.GA26226@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) 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 This patch ensures that when -gnatn1 is used gnatmake -s will not always recompile. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-07-17 Vincent Celier * switch-m.adb (Normalize_Compiler_Switches): Recognize new switches -gnatn1 and -gnatn2. Index: switch-m.adb =================================================================== --- switch-m.adb (revision 189565) +++ switch-m.adb (working copy) @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2001-2011, Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2012, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -236,7 +236,7 @@ -- One-letter switches when 'a' | 'A' | 'b' | 'B' | 'c' | 'C' | 'E' | 'f' | - 'F' | 'g' | 'h' | 'H' | 'I' | 'L' | 'n' | 'N' | + 'F' | 'g' | 'h' | 'H' | 'I' | 'L' | 'N' | 'o' | 'p' | 'P' | 'q' | 'Q' | 'r' | 's' | 'S' | 't' | 'u' | 'U' | 'v' | 'x' | 'X' | 'Z' => Storing (First_Stored) := C; @@ -423,6 +423,24 @@ return; end if; + -- -gnatn may be -gnatn, -gnatn1 or -gnat2 + + when 'n' => + Last_Stored := First_Stored; + Storing (Last_Stored) := 'n'; + Ptr := Ptr + 1; + + if Ptr <= Max + and then Switch_Chars (Ptr) in '1' .. '2' + then + Last_Stored := Last_Stored + 1; + Storing (Last_Stored) := Switch_Chars (Ptr); + Ptr := Ptr + 1; + end if; + + Add_Switch_Component + (Storing (Storing'First .. Last_Stored)); + -- -gnatR may be followed by '0', '1', '2' or '3', -- then by 's'