From 8a6a52dcb9b0a1f64fcaee58936fc84d416c7651 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Fri, 5 Mar 2004 11:58:59 +0100 Subject: [multiple changes] 2004-03-05 Richard Kenner * trans.c: Reflect GCC changes to fix bootstrap problem. Add warning for suspicious aliasing unchecked conversion. 2004-03-05 Robert Dewar * 56taprop.adb, 5ataprop.adb: Remove unneeded unchecked conversions * a-tags.adb, a-tags.ads, s-finimp.adb, s-finroo.ads, i-cpoint.ads, i-cpoint.adb, i-cstrin.adb, i-cstrin.ads, 5iosinte.ads, 5sosinte.ads, 5staspri.ads, 5itaprop.adb, 5staprop.adb, 5wtaprop.adb, s-tataat.ads, s-tataat.adb: Move unchecked conversion to spec to avoid warnings. * s-tasini.adb, s-taskin.ads, 5atpopsp.adb: Correct spelling Task_Id to Task_ID * 7stpopsp.adb: Correct casing in To_Task_ID call * a-strsea.ads, a-strsea.adb: Minor reformatting * einfo.ads, einfo.adb: Define new flag No_Strict_Aliasing * errout.ads: Switch for VMS is now NO_STRICT_ALIASING. Adjust Max_Msg_Length to be clearly large enough. * fe.h: Define In_Same_Source_Unit * osint.adb: Add pragma Warnings Off to suppress warnings * g-dyntab.adb, g-table.adb, g-thread.adb: Add Warnings (Off) to kill aliasing warnings. * opt.ads: Put entries in alpha order. Add entry for No_Strict_Aliasing * par-prag.adb: Add dummy entry for No_Strict_Aliasing pragma * sem_ch13.adb: Generate validate unchecked conversion nodes for gcc. * sem_ch3.adb: Set No_Strict_Aliasing flag if config pragma set. * sem_prag.adb: Implement pragma No_Strict_Aliasing. * sinfo.ads: Remove obsolete comment on validate unchecked conversion node. We now do generate them for gcc back end. * table.adb, sinput.adb: Add pragma Warnings Off to suppress aliasing warning. * sinput-c.adb: Fix bad name in header. Add pragma Warnings Off to suppress aliasing warning. * sinput-l.adb: Add pragma Warnings Off to suppress aliasing warning. * snames.h, snames.ads, snames.adb: Add entry for pragma No_Strict_Aliasing. 2004-03-05 Vincent Celier * prj-com.ads: Add hash table Files_Htable to check when a file name is already a source of another project. * prj-nmsc.adb (Record_Source): Before recording a new source, check if its file name is not already a source of another project. Report an error if it is. * gnatcmd.adb: When GNAT PRETTY is invoked with a project file and no source file name, call gnatpp with all the sources of the main project. * vms_conv.adb (Initialize): GNAT PRETTY may be called with any number of file names. * vms_data.ads: Correct documentation of new /OPTIMIZE keyword NO_STRICT_ALIASING. Add new qualifier for GNAT PRETTY: /RUNTIME_SYSTEM=, converted to --RTS= /NOTABS, converted to -notabs 2004-03-05 Pascal Obry * make.adb: Minor reformatting. 2004-03-05 Ed Schonberg Part of implemention of AI-262. * par-ch10.adb (P_Context_Clause): Recognize private with_clauses. * sem_ch10.ads, sem_ch10.adb: (Install_Private_With_Clauses): New procedure. * sem_ch3.adb (Analyze_Component_Declaration): Improve error message when component type is a partially constrained class-wide subtype. (Constrain_Discriminated_Type): If parent type has unknown discriminants, a constraint is illegal, even if full view has discriminants. (Build_Derived_Record_Type): Inherit discriminants when deriving a type with unknown discriminants whose full view is a discriminated record. * sem_ch7.adb (Preserve_Full_Attributes): Preserve Has_Discriminants flag, to handle properly derivations of tagged types with unknown discriminants. (Analyze_Package_Spec, Analyze_Package_Body): Install Private_With_Clauses before analyzing private part or body. * einfo.ads: Indicate that both Has_Unknown_Discriminants and Has_Discriminants can be true for a given type (documentation). 2004-03-05 Arnaud Charlet * s-restri.ads: Fix license (GPL->GMGPL). * s-tassta.adb: Minor reformatting. * s-tasren.adb: Replace manual handling of Self_Id.ATC_Nesting_Level by calls to Exit_One_ATC_Level, since additional clean up is performed by this function. * s-tpobop.adb: Replace manual handling of Self_Id.ATC_Nesting_Level by calls to Exit_One_ATC_Level, since additional clean up is performed by this function. 2004-03-05 GNAT Script * Make-lang.in: Makefile automatically updated From-SVN: r78964 --- gcc/ada/sem_prag.adb | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'gcc/ada/sem_prag.adb') diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index acf7ae1..f0aad74 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -2333,7 +2333,6 @@ package body Sem_Prag is and then Paren_Count (Arg_Parameter_Types) = 0 then Ptype := First (Expressions (Arg_Parameter_Types)); - while Present (Ptype) or else Present (Formal) loop if No (Ptype) or else No (Formal) @@ -3431,7 +3430,6 @@ package body Sem_Prag is if not Is_Check_Name (Chars (Expression (Arg1))) then Error_Pragma_Arg ("argument of pragma% is not valid check name", Arg1); - else C := Get_Check_Id (Chars (Expression (Arg1))); end if; @@ -7484,6 +7482,36 @@ package body Sem_Prag is end if; end No_Return; + ------------------------ + -- No_Strict_Aliasing -- + ------------------------ + + when Pragma_No_Strict_Aliasing => No_Strict_Alias : declare + E_Id : Entity_Id; + + begin + GNAT_Pragma; + Check_At_Most_N_Arguments (1); + + if Arg_Count = 0 then + Check_Valid_Configuration_Pragma; + Opt.No_Strict_Aliasing := True; + + else + Check_Optional_Identifier (Arg2, Name_Entity); + Check_Arg_Is_Local_Name (Arg1); + E_Id := Entity (Expression (Arg1)); + + if E_Id = Any_Type then + return; + elsif No (E_Id) or else not Is_Access_Type (E_Id) then + Error_Pragma_Arg ("pragma% requires access type", Arg1); + end if; + + Set_No_Strict_Aliasing (Base_Type (E_Id)); + end if; + end No_Strict_Alias; + ----------------- -- Obsolescent -- ----------------- @@ -9899,6 +9927,7 @@ package body Sem_Prag is Pragma_Memory_Size => -1, Pragma_No_Return => 0, Pragma_No_Run_Time => -1, + Pragma_No_Strict_Aliasing => -1, Pragma_Normalize_Scalars => -1, Pragma_Obsolescent => 0, Pragma_Optimize => -1, -- cgit v1.1