From 93a87598b928f58f9e467bea8c718c5e2c91e498 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Wed, 30 Jul 2014 13:01:18 +0200 Subject: [PATCH] [multiple changes] 2014-07-30 Doug Rupp * adaint.c (__gnat_tmp_name) [__ANDROID__]: Default to putting temp files in /cache directory unless overridden by TMPDIR. 2014-07-30 Jose Ruiz * s-tassta.adb, s-tarest.adb (Initialize, Create_Task, Create_Restricted_Task): Remove redundant check. Number_Of_CPUs returns type CPU, so it can never be greater than CPU_Range'Last. 2014-07-30 Bob Duff * s-taskin.ads: Minor comment fix. 2014-07-30 Thomas Quinot * g-socket.adb: Remove now useless WITH, USE, and USE TYPE clauses. 2014-07-30 Yannick Moy * debug.adb: Free debug flag dQ used for frontend inlining in GNATprove mode.. * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Remove test of debug flag.. 2014-07-30 Thomas Quinot * Make-generated.in: Remove generation of s-oscons.ads, only generate the xoscons utility, in runtime-agnostic rules. * gcc-interface/Makefile.in: Clean up rules. Remove VMS parts, no longer supported. From-SVN: r213250 --- gcc/ada/ChangeLog | 34 ++++ gcc/ada/Make-generated.in | 40 +---- gcc/ada/adaint.c | 6 +- gcc/ada/debug.adb | 9 +- gcc/ada/g-socket.adb | 6 - gcc/ada/gcc-interface/Makefile.in | 251 +++++++++++++----------------- gcc/ada/s-tarest.adb | 1 - gcc/ada/s-taskin.ads | 8 +- gcc/ada/s-tassta.adb | 4 +- gcc/ada/sem_ch6.adb | 3 - 10 files changed, 160 insertions(+), 202 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 1d457eb784f..897057909ce 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,37 @@ +2014-07-30 Doug Rupp + + * adaint.c (__gnat_tmp_name) [__ANDROID__]: Default to putting + temp files in /cache directory unless overridden by TMPDIR. + +2014-07-30 Jose Ruiz + + * s-tassta.adb, s-tarest.adb (Initialize, Create_Task, + Create_Restricted_Task): Remove redundant check. Number_Of_CPUs returns + type CPU, so it can never be greater than CPU_Range'Last. + +2014-07-30 Bob Duff + + * s-taskin.ads: Minor comment fix. + +2014-07-30 Thomas Quinot + + * g-socket.adb: Remove now useless WITH, USE, and USE TYPE + clauses. + +2014-07-30 Yannick Moy + + * debug.adb: Free debug flag dQ used for frontend inlining in + GNATprove mode.. + * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Remove test of + debug flag.. + +2014-07-30 Thomas Quinot + + * Make-generated.in: Remove generation of s-oscons.ads, only + generate the xoscons utility, in runtime-agnostic rules. + * gcc-interface/Makefile.in: Clean up rules. Remove VMS parts, + no longer supported. + 2014-07-30 Bob Duff * exp_ch6.adb (Add_Task_Actuals_To_Build_In_Place_Call): New diff --git a/gcc/ada/Make-generated.in b/gcc/ada/Make-generated.in index 412e18b58c0..17200c77861 100644 --- a/gcc/ada/Make-generated.in +++ b/gcc/ada/Make-generated.in @@ -66,47 +66,11 @@ $(ADA_GEN_SUBDIR)/stamp-nmake: $(ADA_GEN_SUBDIR)/sinfo.ads $(ADA_GEN_SUBDIR)/nma $(MOVE_IF_CHANGE) $(ADA_GEN_SUBDIR)/bldtools/nmake/nmake.adb $(ADA_GEN_SUBDIR)/nmake.adb touch $(ADA_GEN_SUBDIR)/stamp-nmake -# GCC_FOR_TARGET has paths relative to the gcc directory, so we need to adjust -# for running it from $(ADA_GEN_SUBDIR)/bldtools/oscons. - -OSCONS_CC=$(subst ./xgcc,../../../xgcc,$(subst -B./, -B../../../,$(GCC_FOR_TARGET))) - -# The main ada source directory must be on the include path for #include "..." -# because s-oscons-tmplt.c requires adaint.h, gsocket.h, and any file included -# by these headers. However note that we must use -iquote, not -I, so that -# ada/types.h does not conflict with a same-named system header (VxWorks -# has a header). - -OSCONS_SRCDIR=$${_oscons_srcdir} -OSCONS_CPP=$(OSCONS_CC) $(GNATLIBCFLAGS) -E -C \ - -DTARGET=\"$(target)\" -iquote $(OSCONS_SRCDIR) s-oscons-tmplt.c > s-oscons-tmplt.i -OSCONS_EXTRACT=$(OSCONS_CC) -iquote $(OSCONS_SRCDIR) -S s-oscons-tmplt.i - -# Note: if you need to build with a non-GNU compiler, you could adapt the -# following definitions (written for VMS DEC-C) -#OSCONS_CPP=../../../$(DECC) -E /comment=as_is -DNATIVE \ -# -DTARGET='""$(target)""' -I$(OSCONS_SRCDIR) s-oscons-tmplt.c -# -#OSCONS_EXTRACT=../../../$(DECC) -DNATIVE \ -# -DTARGET='""$(target)""' -I$(OSCONS_SRCDIR) s-oscons-tmplt.c ; \ -# ld -o s-oscons-tmplt.exe s-oscons-tmplt.obj; \ -# ./s-oscons-tmplt.exe > s-oscons-tmplt.s - -# Note: the first dependency of s-oscons.ads *must* remain s-oscons-tmplt.c, as -# we use $( MAX_SAFE_PATH) +#ifdef __ANDROID__ + strcpy (tmp_filename, "/cache/gnat-XXXXXX"); +#else strcpy (tmp_filename, "/tmp/gnat-XXXXXX"); +#endif else sprintf (tmp_filename, "%s/gnat-XXXXXX", tmpdir); diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb index 1f7c8e28304..b96ce833c8b 100644 --- a/gcc/ada/debug.adb +++ b/gcc/ada/debug.adb @@ -80,7 +80,7 @@ package body Debug is -- dN No file name information in exception messages -- dO Output immediate error messages -- dP Do not check for controlled objects in preelaborable packages - -- dQ Enable inlining in GNATprove mode + -- dQ Enable inlining of bodies-without-decl in GNATprove mode -- dR Bypass check for correct version of s-rpc -- dS Never convert numbers to machine numbers in Sem_Eval -- dT Convert to machine numbers only for constant declarations @@ -438,9 +438,10 @@ package body Debug is -- in preelaborable packages, but this restriction is a huge pain, -- especially in the predefined library units. - -- dQ Enable inlining in GNATprove mode. Although expansion is not set in - -- GNATprove mode, inlining is useful for improving the precision of - -- formal verification. Under a debug flag until fully reliable. + -- dQ Enable inlining of bodies-without-decl in GNATprove mode. A decl is + -- created by the frontend so that the usual frontend inlining + -- mechanism can be used for formal verification. Under a debug flag + -- until fully reliable. -- dR Bypass the check for a proper version of s-rpc being present -- to use the -gnatz? switch. This allows debugging of the use diff --git a/gcc/ada/g-socket.adb b/gcc/ada/g-socket.adb index ee4d52a4cca..b70c2cf2028 100644 --- a/gcc/ada/g-socket.adb +++ b/gcc/ada/g-socket.adb @@ -34,8 +34,6 @@ with Ada.Exceptions; use Ada.Exceptions; with Ada.Finalization; with Ada.Unchecked_Conversion; -with Interfaces.C.Strings; - with GNAT.Sockets.Thin_Common; use GNAT.Sockets.Thin_Common; with GNAT.Sockets.Thin; use GNAT.Sockets.Thin; @@ -1412,7 +1410,6 @@ package body GNAT.Sockets is function Inet_Addr (Image : String) return Inet_Addr_Type is use Interfaces.C; - use Interfaces.C.Strings; Img : aliased char_array := To_C (Image); Addr : aliased C.int; @@ -1710,7 +1707,6 @@ package body GNAT.Sockets is ------------------------ procedure Raise_Socket_Error (Error : Integer) is - use type C.Strings.chars_ptr; begin raise Socket_Error with Err_Code_Image (Error) & Socket_Error_Message (Error); @@ -2421,7 +2417,6 @@ package body GNAT.Sockets is function To_Host_Entry (E : Hostent_Access) return Host_Entry_Type is use type C.size_t; - use C.Strings; Aliases_Count, Addresses_Count : Natural; @@ -2549,7 +2544,6 @@ package body GNAT.Sockets is ---------------------- function To_Service_Entry (E : Servent_Access) return Service_Entry_Type is - use C.Strings; use type C.size_t; Aliases_Count : Natural; diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in index 5c36962ef3b..a05e8524a0a 100644 --- a/gcc/ada/gcc-interface/Makefile.in +++ b/gcc/ada/gcc-interface/Makefile.in @@ -1,5 +1,5 @@ # Makefile for GNU Ada Compiler (GNAT). -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. #This file is part of GCC. @@ -454,6 +454,16 @@ EXTRA_LIBGNAT_OBJS= # file (included files). EXTRA_LIBGNAT_SRCS= +# GCC spec files to be installed in $(libsubdir), so --specs= +# finds them at runtime. Sequences of alphanum characters prefixed with '_' in +# the filename are stripped off at installation time. This is used to strip +# the architecture indications in vxsim spec filenames, installing e.g. +# vxsim_ppc.spec as vxsim.spec. This allows setting up pretty general self +# specs to perform -vxsim -> --specs=<...> translations without causing +# conflicts since the specs are installed in a target specific subdirectory. +# +GCC_SPEC_FILES= + # $(filter-out PATTERN...,TEXT) removes all PATTERN words from TEXT. # $(strip STRING) removes leading and trailing spaces from STRING. # If what's left is null then it's a match. @@ -563,6 +573,9 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworks,$(target_cpu) $(target_vendor) $ s-vxwext.adb s-oscons-tmplt.s +OSCONS_CC=$(subst ./xgcc,../../xgcc,$(subst -B./, -B../../,$(GCC_FOR_TARGET))) -else -# GCC_FOR_TARGET has paths relative to the gcc directory, so we need to adjust -# for running it from $(RTSDIR) -OSCONS_CC=`echo "$(GCC_FOR_TARGET)" \ - | sed -e 's^\./xgcc^../../xgcc^' -e 's^-B./^-B../../^'` -OSCONS_CPP=$(OSCONS_CC) $(GNATLIBCFLAGS) -E -C \ - -DTARGET=\"$(target)\" $(fsrcpfx)ada/s-oscons-tmplt.c > s-oscons-tmplt.i -OSCONS_EXTRACT=$(OSCONS_CC) $(GNATLIBCFLAGS) -S s-oscons-tmplt.i -endif +# The main ada source directory must be on the include path for #include "..." +# because s-oscons-tmplt.c requires adaint.h, gsocket.h, and any file included +# by these headers. However note that we must use -iquote, not -I, so that +# ada/types.h does not conflict with a same-named system header (VxWorks +# has a header). + +OSCONS_CPP=$(OSCONS_CC) $(GNATLIBCFLAGS) $(GNATLIBCFLAGS_FOR_C) -E -C \ + -DTARGET=\"$(target)\" -iquote $(fsrcpfx)ada $(fsrcpfx)ada/s-oscons-tmplt.c > s-oscons-tmplt.i +OSCONS_EXTRACT=$(OSCONS_CC) -S s-oscons-tmplt.i + +# Note: if you need to build with a non-GNU compiler, you could adapt the +# following definitions (written for VMS DEC-C) +#OSCONS_CPP=../../../$(DECC) -E /comment=as_is -DNATIVE \ +# -DTARGET='""$(target)""' -I$(OSCONS_SRCDIR) s-oscons-tmplt.c +# +#OSCONS_EXTRACT=../../../$(DECC) -DNATIVE \ +# -DTARGET='""$(target)""' -I$(OSCONS_SRCDIR) s-oscons-tmplt.c ; \ +# ld -o s-oscons-tmplt.exe s-oscons-tmplt.obj; \ +# ./s-oscons-tmplt.exe > s-oscons-tmplt.s ./bldtools/oscons/xoscons: xoscons.adb xutil.ads xutil.adb -$(MKDIR) ./bldtools/oscons @@ -2759,13 +2730,8 @@ $(RTSDIR)/s-oscons.ads: ../stamp-gnatlib1-$(RTSDIR) s-oscons-tmplt.c gsocket.h . $(OSCONS_EXTRACT) ; \ ../bldtools/oscons/xoscons s-oscons) -# Don't use semicolon separated shell commands that involve list expansions. -# The semicolon triggers a call to DCL on VMS and DCL can't handle command -# line lengths in excess of 256 characters. -# Example: cd $(RTSDIR); ar rc libfoo.a $(LONG_LIST_OF_OBJS) -# is guaranteed to overflow the buffer. - gnatlib: ../stamp-gnatlib1-$(RTSDIR) ../stamp-gnatlib2-$(RTSDIR) $(RTSDIR)/s-oscons.ads + test -f $(RTSDIR)/s-oscons.ads || exit 1 # C files $(MAKE) -C $(RTSDIR) \ CC="`echo \"$(GCC_FOR_TARGET)\" \ @@ -3107,8 +3073,7 @@ socket.o : socket.c gsocket.h sysdep.o : sysdep.c raise.o : raise.c raise.h sigtramp-armdroid.o : sigtramp-armdroid.c sigtramp.h -sigtramp-armvxw.o : sigtramp-armvxw.c sigtramp.h -sigtramp-ppcvxw.o : sigtramp-ppcvxw.c sigtramp.h +sigtramp-vxworks.o : sigtramp-vxworks.c sigtramp.h terminals.o : terminals.c vx_stack_info.o : vx_stack_info.c diff --git a/gcc/ada/s-tarest.adb b/gcc/ada/s-tarest.adb index 1436f2a01aa..22343c660e2 100644 --- a/gcc/ada/s-tarest.adb +++ b/gcc/ada/s-tarest.adb @@ -538,7 +538,6 @@ package body System.Tasking.Restricted.Stages is if CPU /= Unspecified_CPU and then (CPU < Integer (System.Multiprocessors.CPU_Range'First) - or else CPU > Integer (System.Multiprocessors.CPU_Range'Last) or else CPU > Integer (System.Multiprocessors.Number_Of_CPUs)) then raise Tasking_Error with "CPU not in range"; diff --git a/gcc/ada/s-taskin.ads b/gcc/ada/s-taskin.ads index 8f1bb05feb0..fc9975c661f 100644 --- a/gcc/ada/s-taskin.ads +++ b/gcc/ada/s-taskin.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2013, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2014, Free Software Foundation, Inc. -- -- -- -- GNARL 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- -- @@ -86,8 +86,10 @@ package System.Tasking is -- Sometimes we need to hold two ATCB locks at the same time. To allow us -- to order the locking, each ATCB is given a unique serial number. If one - -- needs to hold locks on several ATCBs at once, the locks with lower - -- serial numbers must be locked first. + -- needs to hold locks on two ATCBs at once, the lock with lower serial + -- number must be locked first. We avoid holding three or more ATCB locks, + -- because that can easily lead to complications that cause race conditions + -- and deadlocks. -- We don't always need to check the serial numbers, since the serial -- numbers are assigned sequentially, and so: diff --git a/gcc/ada/s-tassta.adb b/gcc/ada/s-tassta.adb index decfcab0f83..fb02a5365ae 100644 --- a/gcc/ada/s-tassta.adb +++ b/gcc/ada/s-tassta.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2013, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2014, Free Software Foundation, Inc. -- -- -- -- GNARL 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- -- @@ -537,8 +537,6 @@ package body System.Tasking.Stages is if CPU /= Unspecified_CPU and then (CPU < Integer (System.Multiprocessors.CPU_Range'First) or else - CPU > Integer (System.Multiprocessors.CPU_Range'Last) - or else CPU > Integer (System.Multiprocessors.Number_Of_CPUs)) then raise Tasking_Error with "CPU not in range"; diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index f7d79f969af..41ddca237f3 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -3470,7 +3470,6 @@ package body Sem_Ch6 is -- the body, which can be defined by a pragma inside the body. elsif GNATprove_Mode - and then Debug_Flag_QQ and then Full_Analysis and then not Inside_A_Generic and then Present (Spec_Id) @@ -3499,7 +3498,6 @@ package body Sem_Ch6 is -- body, which can be defined by a pragma inside the body. elsif GNATprove_Mode - and then Debug_Flag_QQ and then Full_Analysis and then not Inside_A_Generic and then Present (Spec_Id) @@ -3637,7 +3635,6 @@ package body Sem_Ch6 is if SPARK_Mode /= On and then GNATprove_Mode - and then Debug_Flag_QQ and then Present (Spec_Id) and then Nkind (Parent (Parent (Spec_Id))) = N_Subprogram_Declaration then -- 2.30.2