aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2009-04-09 10:15:20 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2009-04-09 12:15:20 +0200
commitf17889b313b679f7c6461634369eb74bb4f02179 (patch)
tree246c07f323cb22bcd5cf53f9276522e9d6fb7ebb
parent3070bab4c9421f35fd4149a238768befd2717ddb (diff)
downloadgcc-f17889b313b679f7c6461634369eb74bb4f02179.zip
gcc-f17889b313b679f7c6461634369eb74bb4f02179.tar.gz
gcc-f17889b313b679f7c6461634369eb74bb4f02179.tar.bz2
exp_util.adb (Silly_Boolean_Array_Xor_Test): Simplify existing code.
2009-04-09 Robert Dewar <dewar@adacore.com> * exp_util.adb (Silly_Boolean_Array_Xor_Test): Simplify existing code. * atree.h: Add Elist26 * gnat_ugn.texi: Complete documentation deprecating -gnatN for non-gcc backends. From-SVN: r145818
-rw-r--r--gcc/ada/ChangeLog9
-rw-r--r--gcc/ada/atree.h3
-rw-r--r--gcc/ada/exp_util.adb42
-rw-r--r--gcc/ada/gnat_ugn.texi31
4 files changed, 52 insertions, 33 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index ebbc4d9..fc35d44 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,12 @@
+2009-04-09 Robert Dewar <dewar@adacore.com>
+
+ * exp_util.adb (Silly_Boolean_Array_Xor_Test): Simplify existing code.
+
+ * atree.h: Add Elist26
+
+ * gnat_ugn.texi: Complete documentation deprecating -gnatN for non-gcc
+ backends.
+
2009-04-09 Javier Miranda <miranda@adacore.com>
* exp_disp.adb (Export_DT): Addition of a new argument (Index); used to
diff --git a/gcc/ada/atree.h b/gcc/ada/atree.h
index 9dda243..7ad985d 100644
--- a/gcc/ada/atree.h
+++ b/gcc/ada/atree.h
@@ -6,7 +6,7 @@
* *
* C Header File *
* *
- * Copyright (C) 1992-2007, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2008, 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- *
@@ -473,6 +473,7 @@ extern Node_Id Current_Error_Node;
#define Elist21(N) Field21 (N)
#define Elist23(N) Field23 (N)
#define Elist25(N) Field25 (N)
+#define Elist26(N) Field26 (N)
#define Name1(N) Field1 (N)
#define Name2(N) Field2 (N)
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index 241132f..b61801c 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -5147,7 +5147,7 @@ package body Exp_Util is
-- This procedure implements an odd and silly test. We explicitly check
-- for the XOR case where the component type is True .. True, since this
-- will raise constraint error. A special check is required since CE
- -- will not be required otherwise (cf Expand_Packed_Not).
+ -- will not be generated otherwise (cf Expand_Packed_Not).
-- No such check is required for AND and OR, since for both these cases
-- False op False = False, and True op True = True.
@@ -5155,34 +5155,46 @@ package body Exp_Util is
procedure Silly_Boolean_Array_Xor_Test (N : Node_Id; T : Entity_Id) is
Loc : constant Source_Ptr := Sloc (N);
CT : constant Entity_Id := Component_Type (T);
- BT : constant Entity_Id := Base_Type (CT);
begin
+ -- The check we install is
+
+ -- constraint_error when
+ -- Boolean (component_type'First)
+ -- and then Boolean (component_type'Last)
+ -- and then array_type'Length /= 0)
+
+ -- We need the last guard because we don't want to raise CE for empty
+ -- arrays since no out of range values result (Empty arrays with a
+ -- component type of True .. True -- very useful -- even the ACATS
+ -- does not test that marginal case!).
+
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition =>
- Make_Op_And (Loc,
+ Make_And_Then (Loc,
Left_Opnd =>
- Make_Op_Eq (Loc,
+ Make_And_Then (Loc,
Left_Opnd =>
- Make_Attribute_Reference (Loc,
- Prefix => New_Occurrence_Of (CT, Loc),
- Attribute_Name => Name_First),
+ Convert_To (Standard_Boolean,
+ Make_Attribute_Reference (Loc,
+ Prefix => New_Occurrence_Of (CT, Loc),
+ Attribute_Name => Name_First)),
Right_Opnd =>
- Convert_To (BT,
- New_Occurrence_Of (Standard_True, Loc))),
+ Convert_To (Standard_Boolean,
+ Make_Attribute_Reference (Loc,
+ Prefix => New_Occurrence_Of (CT, Loc),
+ Attribute_Name => Name_Last))),
Right_Opnd =>
- Make_Op_Eq (Loc,
+ Make_Op_Ne (Loc,
Left_Opnd =>
Make_Attribute_Reference (Loc,
- Prefix => New_Occurrence_Of (CT, Loc),
- Attribute_Name => Name_Last),
+ Prefix => New_Reference_To (T, Loc),
+ Attribute_Name => Name_Length),
+ Right_Opnd => Make_Integer_Literal (Loc, 0))),
- Right_Opnd =>
- Convert_To (BT,
- New_Occurrence_Of (Standard_True, Loc)))),
Reason => CE_Range_Check_Failed));
end Silly_Boolean_Array_Xor_Test;
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index 6d4390d..9b17e2c 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -2372,9 +2372,6 @@ The use of @option{-gnatN} activates inlining optimization
that is performed by the front end of the compiler. This inlining does
not require that the code generation be optimized. Like @option{-gnatn},
the use of this switch generates additional dependencies.
-Note that
-@option{-gnatN} automatically implies @option{-gnatn} so it is not necessary
-to specify both options.
When using a gcc-based back end (in practice this means using any version
of GNAT other than the JGNAT, .NET or GNAAMP versions), then the use of
@@ -4014,14 +4011,12 @@ Activate front end inlining for subprograms for which
pragma @code{Inline} is specified. This inlining is performed
by the front end and will be visible in the
@option{-gnatG} output.
-In some cases, this has proved more effective than the back end
-inlining resulting from the use of
-@option{-gnatn}.
-Note that
-@option{-gnatN} automatically implies
-@option{-gnatn} so it is not necessary
-to specify both options. There are a few cases that the back-end inlining
-catches that cannot be dealt with in the front-end.
+
+When using a gcc-based back end (in practice this means using any version
+of GNAT other than the JGNAT, .NET or GNAAMP versions), then the use of
+@option{-gnatN} is deprecated, and the use of @option{-gnatn} is preferred.
+Historically front end inlining was more extensive than the gcc back end
+inlining, but that is no longer the case.
@item -gnato
@cindex @option{-gnato} (@command{gcc})
@@ -6716,12 +6711,14 @@ see @ref{Inlining of Subprograms}.
@item -gnatN
@cindex @option{-gnatN} (@command{gcc})
-The front end inlining activated by this switch is generally more extensive,
-and quite often more effective than the standard @option{-gnatn} inlining mode.
-It will also generate additional dependencies.
-Note that
-@option{-gnatN} automatically implies @option{-gnatn} so it is not necessary
-to specify both options.
+This switch activates front-end inlining which also
+generates additional dependencies.
+
+When using a gcc-based back end (in practice this means using any version
+of GNAT other than the JGNAT, .NET or GNAAMP versions), then the use of
+@option{-gnatN} is deprecated, and the use of @option{-gnatn} is preferred.
+Historically front end inlining was more extensive than the gcc back end
+inlining, but that is no longer the case.
@end table
@node Auxiliary Output Control