diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2012-10-29 10:55:29 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2012-10-29 10:55:29 +0100 |
commit | f66369942fcc7a0c39398541e17a82fba7e0518e (patch) | |
tree | 35075f04a4eff3f855363e9e27266e1278710f45 /gcc | |
parent | e63f29e814a7b2d9e4dbac86a8a3780f1bd50f80 (diff) | |
download | gcc-f66369942fcc7a0c39398541e17a82fba7e0518e.zip gcc-f66369942fcc7a0c39398541e17a82fba7e0518e.tar.gz gcc-f66369942fcc7a0c39398541e17a82fba7e0518e.tar.bz2 |
[multiple changes]
2012-10-29 Yannick Moy <moy@adacore.com>
* checks.adb (Apply_Arithmetic_Overflow_Minimized_Eliminated):
Add special case for case expression alternative.
(Is_Signed_Integer_Arithmetic_Op): Remove special case for case
expression alternative.
* exp_ch4.adb Minor reformatting.
2012-10-29 Thomas Quinot <quinot@adacore.com>
* sem_elab.adb: Minor reformatting.
2012-10-29 Bob Duff <duff@adacore.com>
* sem_res.adb: Minor: Remove redundant test.
From-SVN: r192914
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 16 | ||||
-rw-r--r-- | gcc/ada/checks.adb | 9 | ||||
-rw-r--r-- | gcc/ada/exp_ch4.adb | 12 | ||||
-rw-r--r-- | gcc/ada/sem_elab.adb | 17 | ||||
-rw-r--r-- | gcc/ada/sem_res.adb | 4 |
5 files changed, 33 insertions, 25 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 2fb2753..0b7f541 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,19 @@ +2012-10-29 Yannick Moy <moy@adacore.com> + + * checks.adb (Apply_Arithmetic_Overflow_Minimized_Eliminated): + Add special case for case expression alternative. + (Is_Signed_Integer_Arithmetic_Op): Remove special case for case + expression alternative. + * exp_ch4.adb Minor reformatting. + +2012-10-29 Thomas Quinot <quinot@adacore.com> + + * sem_elab.adb: Minor reformatting. + +2012-10-29 Bob Duff <duff@adacore.com> + + * sem_res.adb: Minor: Remove redundant test. + 2012-10-29 Arnaud Charlet <charlet@adacore.com> * pprint.ads, pprint.adb, adabkend.ads, adabkend.adb, diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 061f979..406d292f 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -1108,7 +1108,11 @@ package body Checks is or else Nkind (P) in N_Membership_Test or else Nkind (P) in N_Op_Compare - -- We may also be a range operand in a membership test + -- This is also true for an alternative in a case expression + + or else Nkind (P) = N_Case_Expression_Alternative + + -- This is also true for a range operand in a membership test or else (Nkind (P) = N_Range and then Nkind (Parent (P)) in N_Membership_Test) @@ -6268,9 +6272,6 @@ package body Checks is when N_If_Expression | N_Case_Expression => return Is_Signed_Integer_Type (Etype (N)); - when N_Case_Expression_Alternative => - return Is_Signed_Integer_Type (Etype (Parent (N))); - when others => return False; end case; diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index ee9ce0c..ebdbcde 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -3877,8 +3877,8 @@ package body Exp_Ch4 is end if; -- Right operand is a subtype name and the subtype has a predicate. We - -- have to make sure predicate is checked, and for that we need to use - -- the standard N_In circuitry with appropriate types. + -- have to make sure the predicate is checked, and for that we need to + -- use the standard N_In circuitry with appropriate types. else pragma Assert (Present (Predicate_Function (Etype (Rop)))); @@ -3921,7 +3921,7 @@ package body Exp_Ch4 is -- Bnn -- end - -- A bit gruesome, but here goes. + -- A bit gruesome, but there doesn't seem to be a simpler way declare Blk : constant Node_Id := Make_Bignum_Block (Loc); @@ -3937,10 +3937,8 @@ package body Exp_Ch4 is Nin := Make_In (Loc, - Left_Opnd => - Convert_To (Base_Type (Etype (Rop)), - New_Occurrence_Of (Lnn, Loc)), - Right_Opnd => New_Occurrence_Of (Etype (Rop), Loc)); + Left_Opnd => Convert_To (TB, New_Occurrence_Of (Lnn, Loc)), + Right_Opnd => New_Occurrence_Of (T, Loc)); Set_No_Minimize_Eliminate (Nin); -- Now decorate the block diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb index be3d7c5..4065eb3 100644 --- a/gcc/ada/sem_elab.adb +++ b/gcc/ada/sem_elab.adb @@ -1137,15 +1137,13 @@ package body Sem_Elab is -- Here we definitely have a bad instantiation - Error_Msg_NE - ("?cannot instantiate& before body seen", N, Ent); + Error_Msg_NE ("?cannot instantiate& before body seen", N, Ent); if Present (Instance_Spec (N)) then Supply_Bodies (Instance_Spec (N)); end if; - Error_Msg_N - ("\?Program_Error will be raised at run time", N); + Error_Msg_N ("\?Program_Error will be raised at run time", N); Insert_Elab_Check (N); Set_ABE_Is_Certain (N); end Check_Bad_Instantiation; @@ -1997,7 +1995,7 @@ package body Sem_Elab is then return Abandon; - -- If we have a function call, check it + -- If we have a function call, check it elsif Nkind (N) = N_Function_Call then Check_Elab_Call (N, Outer_Scope); @@ -2078,8 +2076,7 @@ package body Sem_Elab is Elab_Visited.Append (E); - -- If the call is to a function that renames a literal, no check - -- is needed. + -- If the call is to a function that renames a literal, no check needed if Ekind (E) = E_Enumeration_Literal then return; @@ -2188,12 +2185,10 @@ package body Sem_Elab is Error_Msg_NE ("?cannot instantiate& before body seen", N, Orig_Ent); else - Error_Msg_NE - ("?cannot call& before body seen", N, Orig_Ent); + Error_Msg_NE ("?cannot call& before body seen", N, Orig_Ent); end if; - Error_Msg_N - ("\?Program_Error will be raised at run time", N); + Error_Msg_N ("\?Program_Error will be raised at run time", N); Insert_Elab_Check (N); -- Call is not at outer level diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 4383754..72c5725 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -6115,9 +6115,7 @@ package body Sem_Res is -- Check comparison on unordered enumeration - if Comes_From_Source (N) - and then Bad_Unordered_Enumeration_Reference (N, Etype (L)) - then + if Bad_Unordered_Enumeration_Reference (N, Etype (L)) then Error_Msg_N ("comparison on unordered enumeration type?", N); end if; |