From 461c69f75bf19e74373577de843c071388503365 Mon Sep 17 00:00:00 2001 From: charlet Date: Mon, 4 Aug 2014 10:11:51 +0000 Subject: [PATCH] 2014-08-04 Robert Dewar * exp_ch5.adb, sem_ch5.adb, einfo.ads: Minor reformatting. 2014-08-04 Arnaud Charlet * sem_ch4.adb (Operator_Check): Refine previous change. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213561 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/ChangeLog | 8 ++++++++ gcc/ada/einfo.ads | 6 +++--- gcc/ada/exp_ch5.adb | 6 +++--- gcc/ada/sem_ch4.adb | 16 ++++++++-------- gcc/ada/sem_ch5.adb | 4 ++-- 5 files changed, 24 insertions(+), 16 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 441e2a0fb5c..5684a668265 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,11 @@ +2014-08-04 Robert Dewar + + * exp_ch5.adb, sem_ch5.adb, einfo.ads: Minor reformatting. + +2014-08-04 Arnaud Charlet + + * sem_ch4.adb (Operator_Check): Refine previous change. + 2014-08-04 Arnaud Charlet * sem_scil.ads: Improve comments. diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index 7dd8257e009..23516be7612 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -2844,9 +2844,9 @@ package Einfo is -- as well as for record with private types as subtypes -- Is_Processed_Transient (Flag252) --- Defined in entities of variables and constants, including the loop --- parameters of generalized iterators. Set when a transient object needs --- to be finalized and it has already been processed by the transient +-- Defined in variables, loop parameters, and constants, including the +-- loop parameters of generalized iterators. Set when a transient object +-- needs to be finalized and has already been processed by the transient -- scope machinery. This flag signals the general finalization mechanism -- to ignore the transient object. diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb index 363279580a2..12c50a152f2 100644 --- a/gcc/ada/exp_ch5.adb +++ b/gcc/ada/exp_ch5.adb @@ -3198,8 +3198,8 @@ package body Exp_Ch5 is Id : constant Entity_Id := Defining_Identifier (I_Spec); Loc : constant Source_Ptr := Sloc (N); - Container : constant Node_Id := Name (I_Spec); - Container_Typ : constant Entity_Id := Base_Type (Etype (Container)); + Container : constant Node_Id := Name (I_Spec); + Container_Typ : constant Entity_Id := Base_Type (Etype (Container)); I_Kind : constant Entity_Kind := Ekind (Id); Cursor : Entity_Id; Iterator : Entity_Id; @@ -3594,7 +3594,7 @@ package body Exp_Ch5 is -- The cursor is only modified in expanded code, so it appears -- as unassigned to the warning machinery. We must suppress -- this spurious warning explicitly. The cursor's kind is that of - -- the original loop parameter (it is a constant if the doamin of + -- the original loop parameter (it is a constant if the domain of -- iteration is constant). Set_Warnings_Off (Cursor); diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index c675f056ccf..6c260313c9c 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -6446,14 +6446,6 @@ 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, @@ -6608,6 +6600,14 @@ package body Sem_Ch4 is end if; return; + + 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; end if; -- If we fall through then just give general message. Note that in diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 8552a7caaa0..4ece78b8e98 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -3114,8 +3114,8 @@ package body Sem_Ch5 is -- If the expander is not active, or in SPARK mode, then we want to -- analyze the loop body now even in the Ada 2012 iterator case, since -- the rewriting will not be done. Insert the loop variable in the - -- current scope, if not done when analysing the iteration scheme. Set - -- is kind properly to detect improper uses in the loop body. + -- current scope, if not done when analysing the iteration scheme. + -- Set its kind properly to detect improper uses in the loop body. if Present (Iter) and then Present (Iterator_Specification (Iter)) -- 2.11.4.GIT