mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-05 13:41:18 +08:00
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
This commit is contained in:
parent
3070bab4c9
commit
f17889b313
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user