diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-01-15 17:24:17 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-01-15 17:24:17 +0000 |
commit | ca14d7fa4e93eb368568f974f71e6c1d2eed481b (patch) | |
tree | 62222cc22dd847637e9f283dc7d0abbbcb358533 /gcc | |
parent | a76d79d9b97d072a702e5c530d4103c877102c7c (diff) | |
download | gcc-ca14d7fa4e93eb368568f974f71e6c1d2eed481b.tar.gz |
2004-01-15 Olivier Hainque <hainque@act-europe.fr>
* decl.c (gnat_to_gnu_entity, E_Variable): Retrieve the object size
also when not defining if a Size clause applies. That information is
not to be ignored.
2004-01-15 Arnaud Charlet <charlet@act-europe.fr>
* Makefile.in (install-gnatlib, gnatlib-shared-default): Set up
symbolic links for the shared gnat run time when needed.
2004-01-15 Vasiliy Fofanov <fofanov@act-europe.fr>
* memtrack.adb (Gmem_Initialize): check that gmem.out could be opened
for writing, and terminate with an error message if not.
2004-01-15 Ed Schonberg <schonberg@gnat.com>
* sem_attr.adb (Resolve_Attribute, case 'Access): Remove spurious
warning on an access to subprogram in an instance, when the target
type is declared in the same generic unit.
(Eval_Attribute): If 'access is known to fail accessibility check,
rewrite as a raise statement.
2004-01-15 GNAT Script <nobody@gnat.com>
* Make-lang.in: Makefile automatically updated
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75931 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 28 | ||||
-rw-r--r-- | gcc/ada/Make-lang.in | 8 | ||||
-rw-r--r-- | gcc/ada/Makefile.in | 19 | ||||
-rw-r--r-- | gcc/ada/decl.c | 9 | ||||
-rw-r--r-- | gcc/ada/memtrack.adb | 14 | ||||
-rw-r--r-- | gcc/ada/sem_attr.adb | 22 |
6 files changed, 81 insertions, 19 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 7e7a16a3eef..5775b6bf3d2 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,31 @@ +2004-01-15 Olivier Hainque <hainque@act-europe.fr> + + * decl.c (gnat_to_gnu_entity, E_Variable): Retrieve the object size + also when not defining if a Size clause applies. That information is + not to be ignored. + +2004-01-15 Arnaud Charlet <charlet@act-europe.fr> + + * Makefile.in (install-gnatlib, gnatlib-shared-default): Set up + symbolic links for the shared gnat run time when needed. + +2004-01-15 Vasiliy Fofanov <fofanov@act-europe.fr> + + * memtrack.adb (Gmem_Initialize): check that gmem.out could be opened + for writing, and terminate with an error message if not. + +2004-01-15 Ed Schonberg <schonberg@gnat.com> + + * sem_attr.adb (Resolve_Attribute, case 'Access): Remove spurious + warning on an access to subprogram in an instance, when the target + type is declared in the same generic unit. + (Eval_Attribute): If 'access is known to fail accessibility check, + rewrite as a raise statement. + +2004-01-15 GNAT Script <nobody@gnat.com> + + * Make-lang.in: Makefile automatically updated + 2004-01-15 Kelley Cook <kcook@gcc.gnu.org> * Make-lang.in (ada.srcextra): Dummy entry. diff --git a/gcc/ada/Make-lang.in b/gcc/ada/Make-lang.in index 626085f7998..99d21149590 100644 --- a/gcc/ada/Make-lang.in +++ b/gcc/ada/Make-lang.in @@ -2516,10 +2516,10 @@ ada/live.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \ ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \ ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads -ada/memtrack.o : ada/ada.ads ada/a-except.ads ada/system.ads \ - ada/s-memory.ads ada/memtrack.adb ada/s-soflin.ads ada/s-stache.ads \ - ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traceb.ads \ - ada/s-traent.ads ada/s-traent.adb ada/unchconv.ads +ada/memtrack.o : ada/ada.ads ada/a-except.ads ada/gnat.ads ada/g-io.ads \ + ada/system.ads ada/s-memory.ads ada/memtrack.adb ada/s-soflin.ads \ + ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \ + ada/s-traceb.ads ada/s-traent.ads ada/s-traent.adb ada/unchconv.ads ada/namet.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \ ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \ diff --git a/gcc/ada/Makefile.in b/gcc/ada/Makefile.in index df5ec6094d6..2ffc5e76780 100644 --- a/gcc/ada/Makefile.in +++ b/gcc/ada/Makefile.in @@ -1703,15 +1703,16 @@ install-gnatlib: ../stamp-gnatlib # of $(INSTALL_DATA). The latter may force a mode inappropriate # for shared libraries on some targets, e.g. on HP-UX where the x # permission is required. -ifeq ($(strip $(filter-out alpha% dec vms% openvms% alphavms%,$(targ))),) - -for file in rts/lib*$(soext);do \ - $(INSTALL) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \ + for file in gnat gnarl; do \ + if [ -f rts/lib$$file-$(LIBRARY_VERSION)$(soext) ]; then \ + $(INSTALL) rts/lib$$file-$(LIBRARY_VERSION)$(soext) \ + $(ADA_RTL_OBJ_DIR); \ + fi; \ + if [ -f rts/lib$$file$(soext) ]; then \ + $(LN_S) lib$$file-$(LIBRARY_VERSION)$(soext) \ + $(ADA_RTL_OBJ_DIR)/lib$$file$(soext); \ + fi; \ done -else - -for file in rts/lib*-*$(soext);do \ - $(INSTALL) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \ - done -endif # This copy must be done preserving the date on the original file. for file in rts/*.adb rts/*.ads; do \ $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_INCLUDE_DIR); \ @@ -1898,6 +1899,8 @@ gnatlib-shared-default: -o libgnarl-$(LIBRARY_VERSION)$(soext) \ $(GNATRTL_TASKING_OBJS) \ $(SO_OPTS)libgnarl-$(LIBRARY_VERSION)$(soext) $(THREADSLIB) + cd rts; $(LN_S) libgnat-$(LIBRARY_VERSION)$(soext) libgnat$(soext) + cd rts; $(LN_S) libgnarl-$(LIBRARY_VERSION)$(soext) libgnarl$(soext) gnatlib-shared-dual: $(MAKE) $(FLAGS_TO_PASS) \ diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c index 2de25fcd8af..1b0200e2c78 100644 --- a/gcc/ada/decl.c +++ b/gcc/ada/decl.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * Copyright (C) 1992-2003, Free Software Foundation, Inc. * + * Copyright (C) 1992-2004, 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- * @@ -548,11 +548,16 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) } /* If we are defining the object, see if it has a Size value and - validate it if so. Then get the new type, if any. */ + validate it if so. If we are not defining the object and a Size + clause applies, simply retrieve the value. We don't want to ignore + the clause and it is expected to have been validated already. Then + get the new type, if any. */ if (definition) gnu_size = validate_size (Esize (gnat_entity), gnu_type, gnat_entity, VAR_DECL, 0, Has_Size_Clause (gnat_entity)); + else if (Has_Size_Clause (gnat_entity)) + gnu_size = UI_To_gnu (Esize (gnat_entity), bitsizetype); if (gnu_size != 0) { diff --git a/gcc/ada/memtrack.adb b/gcc/ada/memtrack.adb index 30eb2e61ebf..75000b0421e 100644 --- a/gcc/ada/memtrack.adb +++ b/gcc/ada/memtrack.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2001-2003 Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2004 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- -- @@ -71,6 +71,7 @@ with Ada.Exceptions; with System.Soft_Links; with System.Traceback; with System.Traceback_Entries; +with GNAT.IO; package body System.Memory is @@ -78,6 +79,7 @@ package body System.Memory is use System.Soft_Links; use System.Traceback; use System.Traceback_Entries; + use GNAT.IO; function c_malloc (Size : size_t) return System.Address; pragma Import (C, c_malloc, "malloc"); @@ -89,11 +91,15 @@ package body System.Memory is (Ptr : System.Address; Size : size_t) return System.Address; pragma Import (C, c_realloc, "realloc"); - type File_Ptr is new System.Address; + subtype File_Ptr is System.Address; function fopen (Path : String; Mode : String) return File_Ptr; pragma Import (C, fopen); + procedure OS_Exit (Status : Integer); + pragma Import (C, OS_Exit, "__gnat_os_exit"); + pragma No_Return (OS_Exit); + procedure fwrite (Ptr : System.Address; Size : size_t; @@ -274,6 +280,10 @@ package body System.Memory is if Needs_Init then Needs_Init := False; Gmemfile := fopen (Gmemfname, "wb" & ASCII.NUL); + if Gmemfile = System.Null_Address then + Put_Line ("Couldn't open gnatmem log file for writing"); + OS_Exit (255); + end if; fwrite ("GMEM DUMP" & ASCII.LF, 10, 1, Gmemfile); end if; end Gmem_Initialize; diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 3887181a225..51fd7c9c9c1 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2003, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2004, 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- -- @@ -4457,6 +4457,18 @@ package body Sem_Attr is Compile_Time_Known_Attribute (N, Alignment (P_Entity)); return; + -- If this is an access attribute that is known to fail accessibility + -- check, rewrite accordingly. + + elsif Attribute_Name (N) = Name_Access + and then Raises_Constraint_Error (N) + then + Rewrite (N, + Make_Raise_Program_Error (Loc, + Reason => PE_Accessibility_Check_Failed)); + Set_Etype (N, C_Type); + return; + -- No other cases are foldable (they certainly aren't static, and at -- the moment we don't try to fold any cases other than these three). @@ -6501,6 +6513,9 @@ package body Sem_Attr is null; -- Nothing to check -- Check the static accessibility rule of 3.10.2(32) + -- In an instance body, if subprogram and type are both + -- local, other rules prevent dangling references, and no + -- warning is needed. elsif Attr_Id = Attribute_Access and then Subprogram_Access_Level (Entity (P)) @@ -6510,7 +6525,8 @@ package body Sem_Attr is Error_Msg_N ("subprogram must not be deeper than access type", P); - else + + elsif Scope (Entity (P)) /= Scope (Btyp) then Error_Msg_N ("subprogram must not be deeper than access type?", P); @@ -6521,7 +6537,7 @@ package body Sem_Attr is -- Check the restriction of 3.10.2(32) that disallows -- the type of the access attribute to be declared - -- outside a generic body when the attribute occurs + -- outside a generic body when the subprogram is declared -- within that generic body. elsif Enclosing_Generic_Body (Entity (P)) |