From 09494c325c52f55c72ab1448371ab03d25e13c50 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Wed, 22 Jul 2009 15:16:44 +0200 Subject: [PATCH] [multiple changes] 2009-07-22 Brett Porter * init.c (__gnat_init_float): For SPE, set bits in SPEFSCR instead of FPSCR. * sysdep.c (__gnat_get_task_options): Set task option enabling SPE. 2009-07-22 Gary Dismukes * exp_ch5.adb, sem_util.adb, sem_attr.adb, exp_dbug.ads, exp_ch2.adb, exp_tss.ads, exp_ch4.adb, sem_ch4.adb: Correct spelling error. Minor reformatting. * sem_res.adb (Resolve_Explicit_Dereference): Reword one comment that used poor terminology. 2009-07-22 Robert Dewar * freeze.adb, sem_ch3.adb, sem_prag.adb: Minor reformatting * sem_eval.adb, exp_tss.adb: Minor comment update. * stylesw.adb: Code clean up. From-SVN: r149932 --- gcc/ada/ChangeLog | 20 ++++++++++++++++++++ gcc/ada/exp_ch2.adb | 4 ++-- gcc/ada/exp_ch4.adb | 2 +- gcc/ada/exp_ch5.adb | 4 ++-- gcc/ada/exp_dbug.ads | 2 +- gcc/ada/exp_tss.ads | 5 +++-- gcc/ada/freeze.adb | 15 ++++++--------- gcc/ada/init.c | 10 ++++++++++ gcc/ada/sem_attr.adb | 8 ++++---- gcc/ada/sem_ch3.adb | 16 +++++++--------- gcc/ada/sem_ch4.adb | 10 +++++----- gcc/ada/sem_eval.adb | 2 +- gcc/ada/sem_prag.adb | 4 ++-- gcc/ada/sem_res.adb | 7 +++---- gcc/ada/sem_util.adb | 4 ++-- gcc/ada/stylesw.adb | 35 +++++++++++++++++++++++++++++++++-- gcc/ada/sysdep.c | 6 +++++- 17 files changed, 107 insertions(+), 47 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 5bce84d..cc55f1c 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,23 @@ +2009-07-22 Brett Porter + + * init.c (__gnat_init_float): For SPE, set bits in SPEFSCR instead of + FPSCR. + * sysdep.c (__gnat_get_task_options): Set task option enabling SPE. + +2009-07-22 Gary Dismukes + + * exp_ch5.adb, sem_util.adb, sem_attr.adb, exp_dbug.ads, exp_ch2.adb, + exp_tss.ads, exp_ch4.adb, sem_ch4.adb: Correct spelling error. + Minor reformatting. + * sem_res.adb (Resolve_Explicit_Dereference): Reword one comment that + used poor terminology. + +2009-07-22 Robert Dewar + + * freeze.adb, sem_ch3.adb, sem_prag.adb: Minor reformatting + * sem_eval.adb, exp_tss.adb: Minor comment update. + * stylesw.adb: Code clean up. + 2009-07-22 Ed Schonberg * freeze.adb (Freeze_Entity): If Implicit_Packing is enabled, and the diff --git a/gcc/ada/exp_ch2.adb b/gcc/ada/exp_ch2.adb index 47b1748..5d1822d 100644 --- a/gcc/ada/exp_ch2.adb +++ b/gcc/ada/exp_ch2.adb @@ -519,8 +519,8 @@ package body Exp_Ch2 is -- For all types of parameters, the constructed parameter record object -- contains a pointer to the parameter. Thus we must dereference them to - -- access them (this will often be redundant, since the needed deference - -- is implicit, but no harm is done by making it explicit). + -- access them (this will often be redundant, since the dereference is + -- implicit, but no harm is done by making it explicit). Rewrite (N, Make_Explicit_Dereference (Loc, P_Comp_Ref)); diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 8343ea1..8eabfc7 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -4655,7 +4655,7 @@ package body Exp_Ch4 is end if; -- If the prefix is an access type, then we unconditionally rewrite if - -- as an explicit deference. This simplifies processing for several + -- as an explicit dereference. This simplifies processing for several -- cases, including packed array cases and certain cases in which checks -- must be generated. We used to try to do this only when it was -- necessary, but it cleans up the code to do it all the time. diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb index 29095c8..94a038e 100644 --- a/gcc/ada/exp_ch5.adb +++ b/gcc/ada/exp_ch5.adb @@ -378,8 +378,8 @@ package body Exp_Ch5 is -- do this, we get the wrong length computed for the array to be -- moved. The two cases we need to worry about are: - -- Explicit deference of an unconstrained packed array type as in the - -- following example: + -- Explicit dereference of an unconstrained packed array type as in + -- the following example: -- procedure C52 is -- type BITS is array(INTEGER range <>) of BOOLEAN; diff --git a/gcc/ada/exp_dbug.ads b/gcc/ada/exp_dbug.ads index 842456e..2b30248 100644 --- a/gcc/ada/exp_dbug.ads +++ b/gcc/ada/exp_dbug.ads @@ -1053,7 +1053,7 @@ package Exp_Dbug is -- Here f is the field name for the selection - -- For an explicit deference (.all), we have a single entry + -- For an explicit dereference (.all), we have a single entry -- XA diff --git a/gcc/ada/exp_tss.ads b/gcc/ada/exp_tss.ads index b81199c..87038a0 100644 --- a/gcc/ada/exp_tss.ads +++ b/gcc/ada/exp_tss.ads @@ -72,7 +72,8 @@ package Exp_Tss is -- The following codes are used to denote TSSs: - -- Note: When making additions to this list, update the list in snames.adb + -- Note: When making additions to this list, update the list in + -- snames.adb-tmpl type TSS_Name_Type is new String (1 .. 2); subtype TNT is TSS_Name_Type; @@ -84,7 +85,7 @@ package Exp_Tss is TSS_From_Any : constant TNT := "FA"; -- PolyORB/DSA From_Any TSS_Init_Proc : constant TNT := "IP"; -- Initialization Procedure TSS_RAS_Access : constant TNT := "RA"; -- RAS type access - TSS_RAS_Dereference : constant TNT := "RD"; -- RAS type deference + TSS_RAS_Dereference : constant TNT := "RD"; -- RAS type dereference TSS_Rep_To_Pos : constant TNT := "RP"; -- Rep to Pos conversion TSS_Slice_Assign : constant TNT := "SA"; -- Slice assignment TSS_Stream_Input : constant TNT := "SI"; -- Stream Input attribute diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index 036e927..d0c9718 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -5108,15 +5108,12 @@ package body Freeze is exception when Cannot_Be_Static => - -- If the object that cannot be static is imported or exported, - -- then we give an error message saying that this object cannot - -- be imported or exported. If it has an address clause it is - -- an overlay in the current partition and the static requirement - -- is not relevant. - - if Is_Imported (E) - and then No (Address_Clause (E)) - then + -- If the object that cannot be static is imported or exported, then + -- issue an error message saying that this object cannot be imported + -- or exported. If it has an address clause it is an overlay in the + -- current partition and the static requirement is not relevant. + + if Is_Imported (E) and then No (Address_Clause (E)) then Error_Msg_N ("& cannot be imported (local type is not constant)", E); diff --git a/gcc/ada/init.c b/gcc/ada/init.c index 3193dff..2f10505 100644 --- a/gcc/ada/init.c +++ b/gcc/ada/init.c @@ -1932,9 +1932,19 @@ __gnat_init_float (void) overflow settings are an OS configuration issue. The instructions below have no effect. */ #if defined (_ARCH_PPC) && !defined (_SOFT_FLOAT) && !defined (VTHREADS) +#if defined (_SPE_) + { + const unsigned long spefscr_mask = 0xfffffff3; + unsigned long spefscr; + asm ("mfspr %0, 512" : "=r" (spefscr)); + spefscr = spefscr & spefscr_mask; + asm ("mtspr 512, %0\n\tisync" : : "r" (spefscr)); + } +#else asm ("mtfsb0 25"); asm ("mtfsb0 26"); #endif +#endif #if (defined (__i386__) || defined (i386)) && !defined (VTHREADS) /* This is used to properly initialize the FPU on an x86 for each diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index bc68b86..d4f4f51 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -234,7 +234,7 @@ package body Sem_Attr is procedure Check_Dereference; -- If the prefix of attribute is an object of an access type, then - -- introduce an explicit deference, and adjust P_Type accordingly. + -- introduce an explicit dereference, and adjust P_Type accordingly. procedure Check_Discrete_Type; -- Verify that prefix of attribute N is a discrete type @@ -4410,9 +4410,9 @@ package body Sem_Attr is Check_Not_Incomplete_Type; Set_Etype (N, RTE (RE_Type_Class)); - ------------ - -- To_Any -- - ------------ + -------------- + -- TypeCode -- + -------------- when Attribute_TypeCode => Check_E0; diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 9fe88de..3f1d85c 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -2332,11 +2332,11 @@ package body Sem_Ch3 is if Present (Prev_Entity) and then - -- If the homograph is an implicit subprogram, it is overridden - -- by the current declaration. + -- If the homograph is an implicit subprogram, it is overridden + -- by the current declaration. ((Is_Overloadable (Prev_Entity) - and then Is_Inherited_Operation (Prev_Entity)) + and then Is_Inherited_Operation (Prev_Entity)) -- The current object is a discriminal generated for an entry -- family index. Even though the index is a constant, in this @@ -2353,12 +2353,10 @@ package body Sem_Ch3 is or else (Ekind (Prev_Entity) = E_Package - and then - Nkind (Parent (Prev_Entity)) = N_Package_Renaming_Declaration - and then - not Comes_From_Source (Prev_Entity) - and then - Is_Generic_Instance (Renamed_Entity (Prev_Entity)))) + and then Nkind (Parent (Prev_Entity)) = + N_Package_Renaming_Declaration + and then not Comes_From_Source (Prev_Entity) + and then Is_Generic_Instance (Renamed_Entity (Prev_Entity)))) then Prev_Entity := Empty; end if; diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index 774d7ae..600a95f 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -2814,9 +2814,9 @@ package body Sem_Ch4 is Set_Etype (N, Etype (Comp)); Set_Etype (Nam, It.Typ); - -- For access type case, introduce explicit deference for - -- more uniform treatment of entry calls. Do this only - -- once if several interpretations yield an access type. + -- For access type case, introduce explicit dereference for + -- more uniform treatment of entry calls. Do this only once + -- if several interpretations yield an access type. if Is_Access_Type (Etype (Nam)) and then Nkind (Nam) /= N_Explicit_Dereference @@ -3570,8 +3570,8 @@ package body Sem_Ch4 is Set_Original_Discriminant (Sel, Comp); end if; - -- For access type case, introduce explicit deference for more - -- uniform treatment of entry calls. + -- For access type case, introduce explicit dereference for + -- more uniform treatment of entry calls. if Is_Access_Type (Etype (Name)) then Insert_Explicit_Dereference (Name); diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb index d06d1d0..432ceb7 100644 --- a/gcc/ada/sem_eval.adb +++ b/gcc/ada/sem_eval.adb @@ -1960,7 +1960,7 @@ package body Sem_Eval is -- the context to determine that Any_Integer is meant. ---------------------------- - -- To_Any_Integer_Context -- + -- In_Any_Integer_Context -- ---------------------------- function In_Any_Integer_Context return Boolean is diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index c76e5bc..9ba8ec5 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -9160,8 +9160,8 @@ package body Sem_Prag is Check_Arg_Count (0); Check_Valid_Configuration_Pragma; - -- Normalize_Scalars creates false positives in CodePeer, - -- so ignore this pragma in this mode. + -- Normalize_Scalars creates false positives in CodePeer, so + -- ignore this pragma in this mode. if not CodePeer_Mode then Normalize_Scalars := True; diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index ca478bd..b43ab51 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -1036,7 +1036,7 @@ package body Sem_Res is and then (Ekind (Entity (N)) /= E_Enumeration_Literal or else Is_Overloaded (N))) - -- Rewrite as call if it is an explicit deference of an expression of + -- Rewrite as call if it is an explicit dereference of an expression of -- a subprogram access type, and the subprogram type is not that of a -- procedure or entry. @@ -6411,9 +6411,8 @@ package body Sem_Res is Set_Etype (N, Get_Actual_Subtype (N)); end if; - -- Note: there is no Eval processing required for an explicit deference, - -- because the type is known to be an allocators, and allocator - -- expressions can never be static. + -- Note: No Eval processing is required for an explicit dereference, + -- because such a name can never be static. end Resolve_Explicit_Dereference; diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 61e0d33..25793ac 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -5235,8 +5235,8 @@ package body Sem_Util is if Is_Overloaded (New_Prefix) then - -- The deference is also overloaded, and its interpretations are the - -- designated types of the interpretations of the original node. + -- The dereference is also overloaded, and its interpretations are + -- the designated types of the interpretations of the original node. Set_Etype (N, Any_Type); diff --git a/gcc/ada/stylesw.adb b/gcc/ada/stylesw.adb index 41275b7..2f987fd 100644 --- a/gcc/ada/stylesw.adb +++ b/gcc/ada/stylesw.adb @@ -28,6 +28,37 @@ with Opt; use Opt; package body Stylesw is + -- The following constant defines the default style options for -gnaty + + Default_Style : constant String := + "3" & -- indentation level is 3 + "a" & -- check attribute casing + "A" & -- check array attribute indexes + "b" & -- check no blanks at end of lines + "c" & -- check comment formats + "e" & -- check end/exit labels present + "f" & -- check no form/feeds vertical tabs in source + "h" & -- check no horizontal tabs in source + "i" & -- check if-then layout + "k" & -- check casing rules for keywords + "l" & -- check reference manual layout + "m" & -- check line length <= 79 characters + "n" & -- check casing of package Standard idents + "p" & -- check pragma casing + "r" & -- check casing for identifier references + "s" & -- check separate subprogram specs present + "t"; -- check token separation rules + + -- The following constant defines the GNAT style options, showing them + -- as additions to the standard default style check options. + + GNAT_Style : constant String := Default_Style & + "d" & -- check no DOS line terminators + "I" & -- check mode IN + "S" & -- check separate lines after THEN or ELSE + "u" & -- check no unnecessary blank lines + "x"; -- check extra parentheses around conditionals + ------------------------------- -- Reset_Style_Check_Options -- ------------------------------- @@ -171,7 +202,7 @@ package body Stylesw is procedure Set_Default_Style_Check_Options is begin Reset_Style_Check_Options; - Set_Style_Check_Options ("3aAbcefhiklmnprst"); + Set_Style_Check_Options (Default_Style); end Set_Default_Style_Check_Options; ---------------------------------- @@ -181,7 +212,7 @@ package body Stylesw is procedure Set_GNAT_Style_Check_Options is begin Reset_Style_Check_Options; - Set_Style_Check_Options ("3aAbcdefhiIklmnprsStux"); + Set_Style_Check_Options (GNAT_Style); end Set_GNAT_Style_Check_Options; ----------------------------- diff --git a/gcc/ada/sysdep.c b/gcc/ada/sysdep.c index a27c147..a60b83e 100644 --- a/gcc/ada/sysdep.c +++ b/gcc/ada/sysdep.c @@ -940,7 +940,8 @@ __gnat_localtime_tzoff (const time_t *timer, long *off) function returns the options to be set when creating a new task. It fetches the options assigned to the current task (parent), so offering some user level control over the options for a task hierarchy. It forces VX_FP_TASK - because it is almost always required. */ + because it is almost always required. On processors with the SPE + category, VX_SPE_TASK is needed to enable the SPE. */ extern int __gnat_get_task_options (void); int @@ -953,6 +954,9 @@ __gnat_get_task_options (void) /* Force VX_FP_TASK because it is almost always required */ options |= VX_FP_TASK; +#if defined (_SPE_) + options |= VX_SPE_TASK; +#endif /* Mask those bits that are not under user control */ #ifdef VX_USR_TASK_OPTIONS -- 2.7.4