summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch5.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-07 14:45:51 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-07 14:45:51 +0000
commit44e15e2b70813ee19bee3a5c422d30f869be93bb (patch)
tree547ce03558b4baf7b4fb08c1682c061d275f1ccc /gcc/ada/sem_ch5.adb
parent301d5ec3caa5836aaa51a008a6ff77cf307b3b43 (diff)
downloadgcc-44e15e2b70813ee19bee3a5c422d30f869be93bb.tar.gz
2012-03-07 Gary Dismukes <dismukes@adacore.com>
* exp_ch4.adb (Apply_Accessibility_Check): Call Remove_Side_Effects in the build-in-place case, to ensure that we capture the call and don't end up with two calls. 2012-03-07 Javier Miranda <miranda@adacore.com> * exp_ch6.adb (Expand_Inlined_Call): Skip inlining of functions that return unconstrained types using an extended return statement since the support for inlining these functions has not been yet added to the frontend. * s-vaflop.adb, s-vaflop-vms-alpha.adb: Code reorganization. * a-ngrear.ads: Replace all the Inline_Always pragmas by pragma Inline. * a-ngrear.adb (Eigenvalues, Transpose): Restructured to use extended return statement. * a-strsup.adb, a-stzsup.adb, a-stwisu.adb (Concat, Super_Slice, Super_To_String): Restructured to use extended return statement. * a-chahan.adb (To_Basic, To_Lower, To_Upper): Restructured to use extended return statement. * s-gearop.adb (Diagonal, Matrix_Elementwise_Operation, Vector_Elementwise_Operation, Matrix_Elementwise_Operation, Matrix_Matrix_Scalar_Elementwise_Operation, Vector_Vector_Elementwise_Operation, Vector_Vector_Scalar_Elementwise_Operation, Matrix_Scalar_Elementwise_Operation, Vector_Scalar_Elementwise_Operation, Scalar_Matrix_Elementwise_Operation, Scalar_Vector_Elementwise_Operation, Matrix_Matrix_Product, Matrix_Vector_Product, Outer_Product, Unit_Matrix, Unit_Vector, Vector_Matrix_Product): Restructured to use extended return statement. 2012-03-07 Vincent Pucci <pucci@adacore.com> * sem_ch5.adb (One_Bound): Minor reformatting. 2012-03-07 Tristan Gingold <gingold@adacore.com> * s-osinte-vms-ia64.adb, s-osinte-vms-ia64.ads, s-osinte-vms.adb, s-osinte-vms.ads, gcc-interface/Makefile.in: Merge s-osinte-vms and s-osinte-vms-ia64. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185051 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch5.adb')
-rw-r--r--gcc/ada/sem_ch5.adb22
1 files changed, 5 insertions, 17 deletions
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb
index fadfd6d292a..e776b58d80d 100644
--- a/gcc/ada/sem_ch5.adb
+++ b/gcc/ada/sem_ch5.adb
@@ -1654,10 +1654,9 @@ package body Sem_Ch5 is
(Original_Bound : Node_Id;
Analyzed_Bound : Node_Id) return Node_Id
is
- Assign : Node_Id;
- Id : Entity_Id;
- Decl : Node_Id;
-
+ Assign : Node_Id;
+ Decl : Node_Id;
+ Id : Entity_Id;
begin
-- If the bound is a constant or an object, no need for a separate
-- declaration. If the bound is the result of previous expansion
@@ -1677,10 +1676,6 @@ package body Sem_Ch5 is
return Original_Bound;
end if;
- -- Here we need to capture the value
-
- Analyze_And_Resolve (Original_Bound, Typ);
-
-- Normally, the best approach is simply to generate a constant
-- declaration that captures the bound. However, there is a nasty
-- case where this is wrong. If the bound is complex, and has a
@@ -1692,7 +1687,8 @@ package body Sem_Ch5 is
-- proper trace of the value, useful in optimizations that get rid
-- of junk range checks.
- if not Has_Call_Using_Secondary_Stack (Original_Bound) then
+ if not Has_Call_Using_Secondary_Stack (Analyzed_Bound) then
+ Analyze_And_Resolve (Original_Bound, Typ);
Force_Evaluation (Original_Bound);
return Original_Bound;
end if;
@@ -1712,14 +1708,6 @@ package body Sem_Ch5 is
Name => New_Occurrence_Of (Id, Loc),
Expression => Relocate_Node (Original_Bound));
- -- We must recursively clean in the relocated expression the flag
- -- analyzed to ensure that the expression is reanalyzed. Required
- -- to ensure that the transient scope is established now (because
- -- Establish_Transient_Scope discarded generating transient scopes
- -- in the analysis of the iteration scheme).
-
- Reset_Analyzed_Flags (Expression (Assign));
-
Insert_Actions (Parent (N), New_List (Decl, Assign));
-- Now that this temporary variable is initialized we decorate it