From 2db15b1d05e7c42b11a0a7cdff27266189187ea3 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Wed, 8 Apr 2009 15:59:47 +0200 Subject: [PATCH] [multiple changes] 2009-04-08 Robert Dewar * ug_words: Add /ASSUME_VALID for -gnatB * vms_data.ads: Add /ASSUME_VALID for -gnatB * sem_cat.adb: Add clarifying commment * a-direio.ads (Bytes): Make sure value is non-zero 2009-04-08 Ed Schonberg * sem_util.adb (Is_Variable): If the prefix is an explicit dereference that does not come from source, check for a rewritten function call in prefixed notation before other forms of rewriting. 2009-04-08 Robert Dewar * Makefile.rtl: Remove s-strops and s-sopco? from the run time, since these are now obsolescent units used only for bootrapping with an older compiler. From-SVN: r145733 --- gcc/ada/ChangeLog | 22 ++++++++++++++++++++++ gcc/ada/Makefile.rtl | 4 ---- gcc/ada/a-direio.ads | 8 ++++++-- gcc/ada/sem_cat.adb | 2 +- gcc/ada/sem_util.adb | 7 ++++--- gcc/ada/ug_words | 1 + gcc/ada/vms_data.ads | 12 ++++++++++++ 7 files changed, 46 insertions(+), 10 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index b6d0aca4a09..d844d08cedb 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,25 @@ +2009-04-08 Robert Dewar + + * ug_words: Add /ASSUME_VALID for -gnatB + + * vms_data.ads: Add /ASSUME_VALID for -gnatB + + * sem_cat.adb: Add clarifying commment + + * a-direio.ads (Bytes): Make sure value is non-zero + +2009-04-08 Ed Schonberg + + * sem_util.adb (Is_Variable): If the prefix is an explicit dereference + that does not come from source, check for a rewritten function call in + prefixed notation before other forms of rewriting. + +2009-04-08 Robert Dewar + + * Makefile.rtl: Remove s-strops and s-sopco? from the run time, since + these are now obsolescent units used only for bootrapping with an + older compiler. + 2009-04-08 Robert Dewar * gnat_rm.texi: Add documentation for pragma Thread_Local_Storage diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl index fd32cfe6898..1a85461669c 100644 --- a/gcc/ada/Makefile.rtl +++ b/gcc/ada/Makefile.rtl @@ -545,9 +545,6 @@ GNATRTL_NONTASKING_OBJS= \ s-secsta$(objext) \ s-sequio$(objext) \ s-shasto$(objext) \ - s-sopco3$(objext) \ - s-sopco4$(objext) \ - s-sopco5$(objext) \ s-stache$(objext) \ s-stausa$(objext) \ s-stchop$(objext) \ @@ -555,7 +552,6 @@ GNATRTL_NONTASKING_OBJS= \ s-stoele$(objext) \ s-stopoo$(objext) \ s-stratt$(objext) \ - s-strops$(objext) \ s-ststop$(objext) \ s-soflin$(objext) \ s-memory$(objext) \ diff --git a/gcc/ada/a-direio.ads b/gcc/ada/a-direio.ads index 70ff5ed3ca9..544a31a98e5 100644 --- a/gcc/ada/a-direio.ads +++ b/gcc/ada/a-direio.ads @@ -167,8 +167,12 @@ private type File_Type is new System.Direct_IO.File_Type; Bytes : constant Interfaces.C_Streams.size_t := - Element_Type'Max_Size_In_Storage_Elements; - -- Size of an element in storage units + Interfaces.C_Streams.size_t'Max + (1, Element_Type'Max_Size_In_Storage_Elements); + -- Size of an element in storage units. The Max operation here is to ensure + -- that we allocate a single byte for zero-sized elements. It's a bit weird + -- to instantiate Direct_IO with zero sized elements, but it is legal and + -- this adjustment ensures that we don't get anomolous behavior. pragma Inline (Close); pragma Inline (Create); diff --git a/gcc/ada/sem_cat.adb b/gcc/ada/sem_cat.adb index 273c04f8185..03461d169cd 100644 --- a/gcc/ada/sem_cat.adb +++ b/gcc/ada/sem_cat.adb @@ -199,7 +199,7 @@ package body Sem_Cat is if With_Category > Unit_Category then -- Special case: Remote_Types and Remote_Call_Interface are allowed - -- to be with'ed in package body. + -- with anything in the package body, per (RM E.2(5)). if (Unit_Category = Remote_Types or else Unit_Category = Remote_Call_Interface) diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 7535808076f..9f43f2f7315 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -6802,10 +6802,11 @@ package body Sem_Util is and then Present (Etype (Orig_Node)) and then Is_Access_Type (Etype (Orig_Node)) then - return Is_Variable_Prefix (Original_Node (Prefix (N))) + return + (Nkind (Orig_Node) = N_Function_Call + and then not Is_Access_Constant (Etype (Prefix (N)))) or else - (Nkind (Orig_Node) = N_Function_Call - and then not Is_Access_Constant (Etype (Prefix (N)))); + Is_Variable_Prefix (Original_Node (Prefix (N))); -- A function call is never a variable diff --git a/gcc/ada/ug_words b/gcc/ada/ug_words index 532bf0ae513..eb490b203be 100644 --- a/gcc/ada/ug_words +++ b/gcc/ada/ug_words @@ -52,6 +52,7 @@ gcc -c ^ GNAT COMPILE -gnata ^ /CHECKS=ASSERTIONS -gnatA ^ /NO_GNAT_ADC -gnatb ^ /REPORT_ERRORS=BRIEF +-gnatB ^ /ASSUME_VALID -gnatc ^ /NOLOAD -gnatdc ^ /TRACE_UNITS -gnatdO ^ /REPORT_ERRORS=IMMEDIATE diff --git a/gcc/ada/vms_data.ads b/gcc/ada/vms_data.ads index 6795a0a5110..6af3479b191 100644 --- a/gcc/ada/vms_data.ads +++ b/gcc/ada/vms_data.ads @@ -1228,6 +1228,17 @@ package VMS_Data is -- filetype, instead of the object file. This may be useful if you need -- to examine the generated assembly code. + S_GCC_AValid : aliased constant S := "/ASSUME_VALID " & + "-gnatB"; + -- /NO_ASSUME_VALID (D) + -- /ASSUME_VALID + -- + -- Use to tell the compiler to assume that all objects have valid values + -- except those occurring as prefixes to 'Valid attributes. In the default + -- mode, the compiler assumes that values may be invalid unless it can + -- be sure that they are valid, and code is generated to allow for this + -- possibility. The use of /ASSUME_VALID will improve the code. + S_GCC_Checks : aliased constant S := "/CHECKS=" & "FULL " & "-gnato,!-gnatE,!-gnatp " & @@ -3346,6 +3357,7 @@ package VMS_Data is S_GCC_Ada_05 'Access, S_GCC_Add 'Access, S_GCC_Asm 'Access, + S_GCC_AValid 'Access, S_GCC_Checks 'Access, S_GCC_ChecksX 'Access, S_GCC_Compres 'Access, -- 2.30.2