summaryrefslogtreecommitdiff
path: root/gcc/ada/switch-c.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-06 11:11:15 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-06 11:11:15 +0000
commit0df9d43fd26ed0f083bd65e59a097d75dd067a44 (patch)
treebf5fc789888a9885070c8aefd76af66e8c2fcc68 /gcc/ada/switch-c.adb
parent104ebae15f1b1c9fa250763c65413edde6e5f15a (diff)
downloadgcc-0df9d43fd26ed0f083bd65e59a097d75dd067a44.tar.gz
2012-11-06 Robert Dewar <dewar@adacore.com>
* checks.ads, checks.adb, exp_ch4.adb: Minor changes throughout for new overflow checking. * exp_util.adb (Insert_Actions): Remove special casing of Overflow_Check. * gnat1drv.adb (Adjust_Global_Switches): Fixes for new handling of overflow checks. * sem.adb (Analyze): Remove special casing of Overflow_Check (Analyze_List): ditto. * sem_prag.adb (Analyze_Pragma, case Overflow_Checks): Remove SUPPRESSED and change CHECKED to STRICT. * sem_res.adb (Analyze_And_Resolve): No longer treat Overflow_Check specially. (Preanalyze_And_Resolve): ditto. (Resolve): ditto. * snames.ads-tmpl: Replace Name_Checked by Name_Strict. * switch-c.adb (Get_Overflow_Mode): Eliminate 0 setting, CHECKED => STRICT. * types.ads (Overflow_Check_Type): Remove Suppressed, change Checked to Strict (Suppress_Record): Overflow check controlled by Suppress array. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193233 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/switch-c.adb')
-rw-r--r--gcc/ada/switch-c.adb17
1 files changed, 6 insertions, 11 deletions
diff --git a/gcc/ada/switch-c.adb b/gcc/ada/switch-c.adb
index 2a96c06d11a..e7d517e794e 100644
--- a/gcc/ada/switch-c.adb
+++ b/gcc/ada/switch-c.adb
@@ -97,11 +97,8 @@ package body Switch.C is
function Get_Overflow_Mode (C : Character) return Overflow_Check_Type is
begin
case C is
- when '0' =>
- return Suppressed;
-
when '1' =>
- return Checked;
+ return Strict;
when '2' =>
return Minimized;
@@ -801,12 +798,13 @@ package body Switch.C is
when 'o' =>
Ptr := Ptr + 1;
+ Suppress_Options.Suppress (Overflow_Check) := False;
-- Case of no digits after the -gnato
- if Ptr > Max or else Switch_Chars (Ptr) not in '0' .. '3' then
- Suppress_Options.Overflow_Checks_General := Checked;
- Suppress_Options.Overflow_Checks_Assertions := Checked;
+ if Ptr > Max or else Switch_Chars (Ptr) not in '1' .. '3' then
+ Suppress_Options.Overflow_Checks_General := Strict;
+ Suppress_Options.Overflow_Checks_Assertions := Strict;
-- At least one digit after the -gnato
@@ -821,7 +819,7 @@ package body Switch.C is
-- be the same as general mode.
if Ptr > Max
- or else Switch_Chars (Ptr) not in '0' .. '3'
+ or else Switch_Chars (Ptr) not in '1' .. '3'
then
Suppress_Options.Overflow_Checks_Assertions :=
Suppress_Options.Overflow_Checks_General;
@@ -869,9 +867,6 @@ package body Switch.C is
end if;
end loop;
- Suppress_Options.Overflow_Checks_General := Suppressed;
- Suppress_Options.Overflow_Checks_Assertions := Suppressed;
-
Validity_Checks_On := False;
Opt.Suppress_Checks := True;
end if;