From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15652 invoked by alias); 23 Jun 2010 09:08:54 -0000 Received: (qmail 15642 invoked by uid 22791); 23 Jun 2010 09:08:53 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (212.99.106.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 23 Jun 2010 09:08:49 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id C861BCB0260; Wed, 23 Jun 2010 11:08:52 +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 NxsjkUuUGNPo; Wed, 23 Jun 2010 11:08:52 +0200 (CEST) Received: from saumur.act-europe.fr (saumur.act-europe.fr [10.10.0.183]) by mel.act-europe.fr (Postfix) with ESMTP id AF73ECB025B; Wed, 23 Jun 2010 11:08:52 +0200 (CEST) Received: by saumur.act-europe.fr (Postfix, from userid 525) id 99AB7D9BA8; Wed, 23 Jun 2010 11:08:52 +0200 (CEST) Date: Wed, 23 Jun 2010 09:32:00 -0000 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Vincent Celier Subject: [Ada] gnatmake -s -gnatC always recompiles Message-ID: <20100623090852.GA15452@adacore.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="tKW2IUtsqtDRztdT" Content-Disposition: inline User-Agent: Mutt/1.5.9i X-IsSubscribed: yes 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: 2010-06/txt/msg02294.txt.bz2 --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 378 When compiler switch -gnatC is used, invoking gnatmake with switch -s was always recompiling. This patch ensures that switch -gnatC does not trigger recompilation, same for -gnateS switch. Tested on x86_64-pc-linux-gnu, committed on trunk 2010-06-23 Vincent Celier * switch-m.adb (Normalize_Compiler_Switches): Take into account -gnatC and -gnateS. --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=difs Content-length: 2778 Index: switch-m.adb =================================================================== --- switch-m.adb (revision 161213) +++ switch-m.adb (working copy) @@ -71,7 +71,7 @@ package body Switch.M is procedure Add_Switch_Component (S : String); -- Add a new String_Access component in Switches. If a string equal -- to S is already stored in the table Normalized_Switches, use it. - -- Other wise add a new component to the table. + -- Otherwise add a new component to the table. -------------------------- -- Add_Switch_Component -- @@ -215,10 +215,10 @@ package body Switch.M is -- One-letter switches - when 'a' | 'A' | 'b' | 'c' | 'D' | 'E' | 'f' | 'F' | - 'g' | 'h' | 'H' | 'l' | 'L' | 'n' | 'N' | 'o' | - 'O' | 'p' | 'P' | 'q' | 'Q' | 'r' | 's' | 't' | - 'u' | 'U' | 'v' | 'x' | 'X' | 'Z' => + when 'a' | 'A' | 'b' | 'c' | 'C' | 'D' | 'E' | 'f' | + 'F' | 'g' | 'h' | 'H' | 'l' | 'L' | 'n' | 'N' | + 'o' | 'O' | 'p' | 'P' | 'q' | 'Q' | 'r' | 's' | + 't' | 'u' | 'U' | 'v' | 'x' | 'X' | 'Z' => Storing (First_Stored) := C; Add_Switch_Component (Storing (Storing'First .. First_Stored)); @@ -268,8 +268,9 @@ package body Switch.M is when 'e' => - -- Store -gnateD, -gnatep= and -gnateG in the ALI file. - -- The other -gnate switches do not need to be stored. + -- Store -gnateD, -gnatep=, -gnateG and -gnateS in the + -- ALI file. The other -gnate switches do not need to be + -- stored. Storing (First_Stored) := 'e'; Ptr := Ptr + 1; @@ -277,7 +278,8 @@ package body Switch.M is if Ptr > Max or else (Switch_Chars (Ptr) /= 'D' and then Switch_Chars (Ptr) /= 'G' - and then Switch_Chars (Ptr) /= 'p') + and then Switch_Chars (Ptr) /= 'p' + and then Switch_Chars (Ptr) /= 'S') then Last := 0; return; @@ -322,6 +324,9 @@ package body Switch.M is elsif Switch_Chars (Ptr) = 'G' then Add_Switch_Component ("-gnateG"); + + elsif Switch_Chars (Ptr) = 'S' then + Add_Switch_Component ("-gnateS"); end if; return; --tKW2IUtsqtDRztdT--