From: charlet Date: Fri, 18 Jul 2014 09:51:43 +0000 (+0000) Subject: 2014-07-18 Robert Dewar X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7de4cba3cf929b5064693a09b6548c50f9e78a51;p=thirdparty%2Fgcc.git 2014-07-18 Robert Dewar * sem_ch13.adb (Is_Type_Ref): Check that type name is not parenthesized. 2014-07-18 Vincent Celier * s-osinte-vms.ads: Fix style errors. 2014-07-18 Thomas Quinot * s-oscons-tmplt.c (_POSIX_SOURCE): Define in order to get NAME_MAX and PATH_MAX. 2014-07-18 Bob Duff * exp_strm.adb (Build_Record_Or_Elementary_Input_Function, Build_Record_Or_Elementary_Output_Procedure): For Input and Output attributes, do not read/write the discriminants if they have default values; that will be done by Read/Write. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212798 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 965216ca1e3f..c02198c367e3 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,24 @@ +2014-07-18 Robert Dewar + + * sem_ch13.adb (Is_Type_Ref): Check that type name is not + parenthesized. + +2014-07-18 Vincent Celier + + * s-osinte-vms.ads: Fix style errors. + +2014-07-18 Thomas Quinot + + * s-oscons-tmplt.c (_POSIX_SOURCE): Define in order to get + NAME_MAX and PATH_MAX. + +2014-07-18 Bob Duff + + * exp_strm.adb (Build_Record_Or_Elementary_Input_Function, + Build_Record_Or_Elementary_Output_Procedure): For Input and + Output attributes, do not read/write the discriminants if they + have default values; that will be done by Read/Write. + 2014-07-18 Robert Dewar * sem_aggr.adb, exp_ch5.adb, sem_ch3.adb, layout.adb, sem_type.adb, diff --git a/gcc/ada/exp_strm.adb b/gcc/ada/exp_strm.adb index ce313c6c4b39..288b1bfe30b9 100644 --- a/gcc/ada/exp_strm.adb +++ b/gcc/ada/exp_strm.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. -- -- -- -- 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- -- @@ -1124,7 +1124,10 @@ package body Exp_Strm is J := 1; - if Has_Discriminants (B_Typ) then + if Has_Discriminants (Typ) + and then + No (Discriminant_Default_Value (First_Discriminant (Typ))) + then Discr := First_Discriminant (B_Typ); -- If the prefix subtype is constrained, then retrieve the first @@ -1250,10 +1253,15 @@ package body Exp_Strm is begin Stms := New_List; - -- Note that of course there will be no discriminants for the - -- elementary type case, so Has_Discriminants will be False. + -- Note that of course there will be no discriminants for the elementary + -- type case, so Has_Discriminants will be False. Note that the + -- language rules do not require writing the discriminants in the + -- defaulted case, because those are written by 'Write. - if Has_Discriminants (Typ) then + if Has_Discriminants (Typ) + and then + No (Discriminant_Default_Value (First_Discriminant (Typ))) + then Disc := First_Discriminant (Typ); while Present (Disc) loop diff --git a/gcc/ada/s-oscons-tmplt.c b/gcc/ada/s-oscons-tmplt.c index 0d79d6fdbb96..2b16448aafca 100644 --- a/gcc/ada/s-oscons-tmplt.c +++ b/gcc/ada/s-oscons-tmplt.c @@ -80,9 +80,11 @@ pragma Style_Checks ("M32766"); /* Feature macro definitions */ +/* Define _POSIX_SOURCE to get NAME_MAX, PATH_MAX */ +#define _POSIX_SOURCE + #if defined (__linux__) && !defined (_XOPEN_SOURCE) -/** For Linux _XOPEN_SOURCE must be defined, otherwise IOV_MAX is not defined - **/ +/* For Linux, define _XOPEN_SOURCE to get IOV_MAX */ #define _XOPEN_SOURCE 500 #endif diff --git a/gcc/ada/s-osinte-vms.ads b/gcc/ada/s-osinte-vms.ads index e8cc6b8cb42c..2b2b135d0e9e 100644 --- a/gcc/ada/s-osinte-vms.ads +++ b/gcc/ada/s-osinte-vms.ads @@ -7,7 +7,7 @@ -- S p e c -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2012, Free Software Foundation, Inc. -- +-- Copyright (C) 1995-2014, 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- -- @@ -496,7 +496,7 @@ package System.OS_Interface is type struct_sched_param is record sched_priority : int; -- scheduling priority end record; - for struct_sched_param'Size use 8*4; + for struct_sched_param'Size use 8 * 4; pragma Convention (C, struct_sched_param); function pthread_setschedparam @@ -614,7 +614,7 @@ private sequence : unsigned; block : pthreadLongAddr_t_ptr; end record; - for pthread_cond_t'Size use 8*32; + for pthread_cond_t'Size use 8 * 32; pragma Convention (C, pthread_cond_t); type pthread_attr_t is record @@ -623,7 +623,7 @@ private arg : pthreadLongUint_t; reserved : pthreadLongUint_array (0 .. 18); end record; - for pthread_attr_t'Size use 8*176; + for pthread_attr_t'Size use 8 * 176; pragma Convention (C, pthread_attr_t); type pthread_mutex_t is record @@ -636,21 +636,21 @@ private owner : unsigned; depth : unsigned; end record; - for pthread_mutex_t'Size use 8*40; + for pthread_mutex_t'Size use 8 * 40; pragma Convention (C, pthread_mutex_t); type pthread_mutexattr_t is record valid : long; reserved : pthreadLongUint_array (0 .. 14); end record; - for pthread_mutexattr_t'Size use 8*128; + for pthread_mutexattr_t'Size use 8 * 128; pragma Convention (C, pthread_mutexattr_t); type pthread_condattr_t is record valid : long; reserved : pthreadLongUint_array (0 .. 12); end record; - for pthread_condattr_t'Size use 8*112; + for pthread_condattr_t'Size use 8 * 112; pragma Convention (C, pthread_condattr_t); type pthread_key_t is new unsigned; diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 84e62db555ea..335e4f41bbf2 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -6247,7 +6247,8 @@ package body Sem_Ch13 is pragma Inline (Is_Type_Ref); -- Returns if True if N is a reference to the type for the predicate in -- the expression (i.e. if it is an identifier whose Chars field matches - -- the Nam given in the call). + -- the Nam given in the call). N must not be parenthesized, if the type + -- name appears in parens, this routine will return False. function Lo_Val (N : Node_Id) return Uint; -- Given static expression or static range from a Static_Predicate list, @@ -6770,7 +6771,9 @@ package body Sem_Ch13 is function Is_Type_Ref (N : Node_Id) return Boolean is begin - return Nkind (N) = N_Identifier and then Chars (N) = Nam; + return Nkind (N) = N_Identifier + and then Chars (N) = Nam + and then Paren_Count (N) = 0; end Is_Type_Ref; ------------