From 3afcdce09e2796d0456cc8cf832b5dec9f9f0cf7 Mon Sep 17 00:00:00 2001 From: charlet Date: Tue, 15 Nov 2005 13:57:37 +0000 Subject: 2005-11-14 Cyrille Comar Thomas Quinot * exp_ch5.adb (Expand_N_Assignment_Statement, Tagged_Case): For an assignment of a value of a tagged type that has been rewritten to a block statement, it is known by construction that no checks are necessary for the statements within the block: analyze it with checks suppressed. (Expand_N_If_Statement): When killing a dead then-branch in an if-statement that has elsif_parts, recompute the Current_Value node for any entity whose value is known from the condition of the first elsif_part. (Expand_N_Return_Statement): When returning a mutable record, convert the return value into its actual subtype in order to help the backend to return the actual size instead of the maximum. This is another aftermath of not returning mutable records on the sec-stack anymore. * sem_ch5.ads, sem_ch5.adb (Analyze_Iteration_Scheme): Minor change to handling of error msg for suspicious reverse range iteration. (Check_Possible_Current_Value_Condition): Move declaration from body to spec, to allow this subprogram to be called from exp_ch5. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@106972 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/sem_ch5.ads | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'gcc/ada/sem_ch5.ads') diff --git a/gcc/ada/sem_ch5.ads b/gcc/ada/sem_ch5.ads index 1c945335e5e..0ea538eb118 100644 --- a/gcc/ada/sem_ch5.ads +++ b/gcc/ada/sem_ch5.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2002 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -47,6 +47,15 @@ package Sem_Ch5 is -- care of setting Reachable, since labels defined by the expander can -- be assumed to be reachable. + procedure Check_Possible_Current_Value_Condition (Cnode : Node_Id); + -- Cnode is N_If_Statement, N_Elsif_Part, or N_Iteration_Scheme + -- (the latter when a WHILE condition is present). This call checks + -- if Condition (Cnode) is of the form ([NOT] var op val), where var + -- is a simple object, val is known at compile time, and op is one + -- of the six relational operators. If this is the case, and the + -- Current_Value field of "var" is not set, then it is set to Cnode. + -- See Exp_Util.Set_Current_Value_Condition for further details. + procedure Check_Unreachable_Code (N : Node_Id); -- This procedure is called with N being the node for a statement that -- is an unconditional transfer of control. It checks to see if the -- cgit v1.2.1