diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-09-02 09:27:35 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-09-02 09:27:35 +0000 |
commit | 134520e85a8d8fd0ad136995ceb371addbd88fe4 (patch) | |
tree | 2bf0b4228751a24323d9793ec7e3e4af6fe92fe1 /gcc/ada/sem_attr.adb | |
parent | a15d8d347f13ffff51c89f06c606b79a1afa2e67 (diff) | |
download | gcc-134520e85a8d8fd0ad136995ceb371addbd88fe4.tar.gz |
2011-09-02 Hristian Kirtchev <kirtchev@adacore.com>
* exp_ch9.adb (Install_Private_Data_Declarations): Add guards
which ensure that restriction No_Dynamic_Attachment has not been
violated.
(Make_Initialize_Protection): Protected types with attach or
interrupt handlers must not violate restriction No_Dynamic_Attachment.
* exp_util.adb (Corresponding_Runtime_Package): Add a guard
which ensures that restriction No_Dynamic_Attachment has not been
violated.
* sem_attr.adb: (Eval_Attribute): Transform
VAX_Float_Type'First and 'Last into references to
the temporaries which store the corresponding bounds. The
transformation is needed since the back end cannot evaluate
'First and 'Last on VAX.
(Is_VAX_Float): New routine.
2011-09-02 Ed Schonberg <schonberg@adacore.com>
* sem_ch12.adb (Analyze_Subprogram_Instantiation): If the
generic unit is not intrinsic and has an explicit convention,
the instance inherits it.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178449 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_attr.adb')
-rw-r--r-- | gcc/ada/sem_attr.adb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 480e9a62c8e..5efa6896370 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -5260,6 +5260,9 @@ package body Sem_Attr is -- Computes the Fore value for the current attribute prefix, which is -- known to be a static fixed-point type. Used by Fore and Width. + function Is_VAX_Float (Typ : Entity_Id) return Boolean; + -- Determine whether Typ denotes a VAX floating point type + function Mantissa return Uint; -- Returns the Mantissa value for the prefix type @@ -5390,6 +5393,19 @@ package body Sem_Attr is return R; end Fore_Value; + ------------------ + -- Is_VAX_Float -- + ------------------ + + function Is_VAX_Float (Typ : Entity_Id) return Boolean is + begin + return + Is_Floating_Point_Type (Typ) + and then + (Float_Format = 'V' + or else Float_Rep (Typ) = VAX_Native); + end Is_VAX_Float; + -------------- -- Mantissa -- -------------- @@ -6337,6 +6353,16 @@ package body Sem_Attr is Fold_Uint (N, Expr_Value (Lo_Bound), Static); end if; + -- Replace VAX Float_Type'First with a reference to the temporary + -- which represents the low bound of the type. This transformation + -- is needed since the back end cannot evaluate 'First on VAX. + + elsif Is_VAX_Float (P_Type) + and then Nkind (Lo_Bound) = N_Identifier + then + Rewrite (N, New_Reference_To (Entity (Lo_Bound), Sloc (N))); + Analyze (N); + else Check_Concurrent_Discriminant (Lo_Bound); end if; @@ -6528,6 +6554,16 @@ package body Sem_Attr is Fold_Uint (N, Expr_Value (Hi_Bound), Static); end if; + -- Replace VAX Float_Type'Last with a reference to the temporary + -- which represents the high bound of the type. This transformation + -- is needed since the back end cannot evaluate 'Last on VAX. + + elsif Is_VAX_Float (P_Type) + and then Nkind (Hi_Bound) = N_Identifier + then + Rewrite (N, New_Reference_To (Entity (Hi_Bound), Sloc (N))); + Analyze (N); + else Check_Concurrent_Discriminant (Hi_Bound); end if; |