diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-09 10:15:20 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-09 10:15:20 +0000 |
commit | bfd188a4e2828f54120df76e1339453a716d6d89 (patch) | |
tree | 246c07f323cb22bcd5cf53f9276522e9d6fb7ebb /gcc | |
parent | 1e057e9bb0a329a9819696c3efbe6fcf4c7ececf (diff) | |
download | gcc-bfd188a4e2828f54120df76e1339453a716d6d89.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145818 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/ada/atree.h | 3 | ||||
-rw-r--r-- | gcc/ada/exp_util.adb | 42 | ||||
-rw-r--r-- | gcc/ada/gnat_ugn.texi | 31 |
4 files changed, 52 insertions, 33 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index ebbc4d94553..fc35d44a530 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 9dda243499c..7ad985d139d 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 241132ff04c..b61801cbaba 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 6d4390d6f3b..9b17e2c119a 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 |