From 783d035ba7b56cde1b862ee9f276a3af1e35a1d1 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Fri, 18 Jul 2014 11:37:41 +0200 Subject: [PATCH] [multiple changes] 2014-07-18 Robert Dewar * gnat_ugn.texi: Remove note that -gnatR not allowed with -gnatc. * switch-c.adb: Remove prohibition of -gnatR and -gnatc together. 2014-07-18 Eric Botcazou * sem_ch13.adb (Kill_Rep_Clause): Clear Comes_From_Source flag on the null statement. 2014-07-18 Thomas Quinot * adaint.c: Minor comment rewording. * socket.c: Define macros _REENTRANT and _THREAD_SAFE so that use of errno in this file is thread safe. From-SVN: r212791 --- gcc/ada/ChangeLog | 16 ++++++++++++++++ gcc/ada/adaint.c | 2 +- gcc/ada/gnat_ugn.texi | 5 +---- gcc/ada/sem_ch13.adb | 12 ++++++++++++ gcc/ada/socket.c | 4 ++++ gcc/ada/switch-c.adb | 17 ----------------- 6 files changed, 34 insertions(+), 22 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 33e45e970a3..77c7a7f8c6c 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,19 @@ +2014-07-18 Robert Dewar + + * gnat_ugn.texi: Remove note that -gnatR not allowed with -gnatc. + * switch-c.adb: Remove prohibition of -gnatR and -gnatc together. + +2014-07-18 Eric Botcazou + + * sem_ch13.adb (Kill_Rep_Clause): Clear Comes_From_Source flag + on the null statement. + +2014-07-18 Thomas Quinot + + * adaint.c: Minor comment rewording. + * socket.c: Define macros _REENTRANT and _THREAD_SAFE so that + use of errno in this file is thread safe. + 2014-07-18 Arnaud Charlet * gnat_ugn.texi: Doc clarification. diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index 6e0e4a3db0e..9bfb6895f33 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -34,7 +34,7 @@ package Osint. Many of the subprograms in OS_Lib import standard library calls directly. This file contains all other routines. */ -/* Ensure accesses to errno are thread safe. */ +/* Ensure access to errno is thread safe. */ #define _REENTRANT #define _THREAD_SAFE diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 57939c3d6b7..04633a23920 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -4213,13 +4213,10 @@ Treat pragma Restrictions as Restriction_Warnings. @cindex @option{-gnatR} (@command{gcc}) Output representation information for declared types and objects. Note that this switch is not allowed if a previous @code{-gnatD} switch has -been given, since these two switches are not compatible. It is also not allowed -if a previous @code{-gnatc} switch has been given, since we must be generating -code to be able to determine representation information. +been given, since these two switches are not compatible. @item ^-gnatRm[s]^/REPRESENTATION_INFO^ Output convention and parameter passing mechanisms for all subprograms. -This form is also incompatible with the use of @code{-gnatc}. @item -gnats @cindex @option{-gnats} (@command{gcc}) diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index b89bd74c76f..317510ada17 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -10295,7 +10295,19 @@ package body Sem_Ch13 is procedure Kill_Rep_Clause (N : Node_Id) is begin pragma Assert (Ignore_Rep_Clauses); + + -- Note: we use Replace rather than Rewrite, because we don't want + -- ASIS to be able to use Original_Node to dig out the (undecorated) + -- rep clause that is being replaced. + Replace (N, Make_Null_Statement (Sloc (N))); + + -- The null statement must be marked as not coming from source. This is + -- so that ASIS ignores if, and also the back end does not expect bogus + -- "from source" null statements in weird places (e.g. in declarative + -- regions where such null statements are not allowed). + + Set_Comes_From_Source (N, False); end Kill_Rep_Clause; ------------------ diff --git a/gcc/ada/socket.c b/gcc/ada/socket.c index ab5368f6d0c..310de25029f 100644 --- a/gcc/ada/socket.c +++ b/gcc/ada/socket.c @@ -31,6 +31,10 @@ /* This file provides a portable binding to the sockets API */ +/* Ensure access to errno is thread safe. */ +#define _REENTRANT +#define _THREAD_SAFE + #include "gsocket.h" #if defined(VMS) diff --git a/gcc/ada/switch-c.adb b/gcc/ada/switch-c.adb index e2f7c2ec494..04a6fa188f3 100644 --- a/gcc/ada/switch-c.adb +++ b/gcc/ada/switch-c.adb @@ -310,15 +310,6 @@ package body Switch.C is ("-gnatc must be first if combined with other switches"); end if; - -- Not allowed if previous -gnatR given - - if List_Representation_Info /= 0 - or else List_Representation_Info_Mechanisms - then - Osint.Fail - ("-gnatc not allowed since -gnatR given previously"); - end if; - Ptr := Ptr + 1; Operating_Mode := Check_Semantics; @@ -1057,14 +1048,6 @@ package body Switch.C is ("-gnatR not permitted since -gnatD given previously"); end if; - -- Not allowed if previous -gnatc was given, since we must - -- call the code generator to determine rep information. - - if Operating_Mode = Check_Semantics then - Osint.Fail - ("-gnatR not permitted since -gnatc given previously"); - end if; - -- Set to annotate rep info, and set default -gnatR mode Back_Annotate_Rep_Info := True; -- 2.30.2