From patchwork Mon Oct 11 09:27:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Ada] Fix oversight in new handling of -Oxxx switches Date: Sun, 10 Oct 2010 23:27:16 -0000 From: Arnaud Charlet X-Patchwork-Id: 67396 Message-Id: <20101011092716.GA11537@adacore.com> To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou The -Oxxx switches are now passed to both the compiler and the linker. But the original change overlooked -O, which is a synonym for -O1 and should therefore be passed as well. This is fixed by this patchlet. Tested on x86_64-pc-linux-gnu, committed on trunk 2010-10-11 Eric Botcazou * make.adb (Scan_Make_Arg): Also pass -O to both compiler and linker. Index: make.adb =================================================================== --- make.adb (revision 165256) +++ make.adb (working copy) @@ -8115,7 +8115,7 @@ package body Make is or else Argv (2 .. Argv'Last) = "pg" or else (Argv (2) = 'm' and then Argv'Last > 2) or else (Argv (2) = 'f' and then Argv'Last > 2) - or else (Argv (2) = 'O' and then Argv'Last > 2) + or else Argv (2) = 'O' then Add_Switch (Argv, Compiler, And_Save => And_Save); Add_Switch (Argv, Linker, And_Save => And_Save);