aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch4.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-08-04 12:10:23 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-08-04 12:10:23 +0200
commit1e3689bd20d682d6f10373abccea6445d901c499 (patch)
treeb4be9bc9da828ac384e6c02e31a9563d3e2d742f /gcc/ada/sem_ch4.adb
parentaa4997841cb29b30253449c8efc85446072b5a53 (diff)
downloadgcc-1e3689bd20d682d6f10373abccea6445d901c499.zip
gcc-1e3689bd20d682d6f10373abccea6445d901c499.tar.gz
gcc-1e3689bd20d682d6f10373abccea6445d901c499.tar.bz2
[multiple changes]
2014-08-04 Arnaud Charlet <charlet@adacore.com> * sem_scil.ads: Improve comments. * sem_ch4.adb (Analyze_Equality_Op): Add support for Allow_Integer_Address (equality between Address and Integer). 2014-08-04 Yannick Moy <moy@adacore.com> * a-cfhama.adb, a-cforse.adb: Minor fixes to avoid using prefix notation on untagged objects. * sem.ads: Update comment. * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Do not inline subprograms declared in the visible part of a package. From-SVN: r213560
Diffstat (limited to 'gcc/ada/sem_ch4.adb')
-rw-r--r--gcc/ada/sem_ch4.adb30
1 files changed, 27 insertions, 3 deletions
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index 2e1722e..c675f05 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -6446,6 +6446,14 @@ package body Sem_Ch4 is
return;
end if;
+ elsif Nkind_In (N, N_Op_Eq, N_Op_Ne) then
+ if Address_Integer_Convert_OK (Etype (R), Etype (L)) then
+ Rewrite (R,
+ Unchecked_Convert_To (Etype (L), Relocate_Node (R)));
+ Analyze_Equality_Op (N);
+ return;
+ end if;
+
-- For an arithmetic operator or comparison operator, if one
-- of the operands is numeric, then we know the other operand
-- is not the same numeric type. If it is a non-numeric type,
@@ -6472,11 +6480,16 @@ package body Sem_Ch4 is
if Address_Integer_Convert_OK (Etype (R), Etype (L)) then
Rewrite (R,
Unchecked_Convert_To (Etype (L), Relocate_Node (R)));
- Analyze_Arithmetic_Op (N);
+ if Nkind_In (N, N_Op_Ge, N_Op_Gt, N_Op_Le, N_Op_Lt) then
+ Analyze_Comparison_Op (N);
+ else
+ Analyze_Arithmetic_Op (N);
+ end if;
else
Resolve (R, Etype (L));
end if;
+
return;
elsif Is_Numeric_Type (Etype (R))
@@ -6485,7 +6498,13 @@ package body Sem_Ch4 is
if Address_Integer_Convert_OK (Etype (L), Etype (R)) then
Rewrite (L,
Unchecked_Convert_To (Etype (R), Relocate_Node (L)));
- Analyze_Arithmetic_Op (N);
+
+ if Nkind_In (N, N_Op_Ge, N_Op_Gt, N_Op_Le, N_Op_Lt) then
+ Analyze_Comparison_Op (N);
+ else
+ Analyze_Arithmetic_Op (N);
+ end if;
+
return;
else
@@ -6509,7 +6528,12 @@ package body Sem_Ch4 is
Rewrite (R,
Unchecked_Convert_To (
Standard_Integer, Relocate_Node (R)));
- Analyze_Arithmetic_Op (N);
+
+ if Nkind_In (N, N_Op_Ge, N_Op_Gt, N_Op_Le, N_Op_Lt) then
+ Analyze_Comparison_Op (N);
+ else
+ Analyze_Arithmetic_Op (N);
+ end if;
-- If this is an operand in an enclosing arithmetic
-- operation, Convert the result as an address so that