aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-07-18 11:51:43 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-07-18 11:51:43 +0200
commit623267dc190af4ed37d179d8ee7c0b62c5c5d3d0 (patch)
tree359e3c9b15bfd003219f4e79902aa546b859328a
parent8ca597af97cb20a9a0b98358880bd3a488d49cc2 (diff)
downloadgcc-623267dc190af4ed37d179d8ee7c0b62c5c5d3d0.zip
gcc-623267dc190af4ed37d179d8ee7c0b62c5c5d3d0.tar.gz
gcc-623267dc190af4ed37d179d8ee7c0b62c5c5d3d0.tar.bz2
[multiple changes]
2014-07-18 Robert Dewar <dewar@adacore.com> * sem_ch13.adb (Is_Type_Ref): Check that type name is not parenthesized. 2014-07-18 Vincent Celier <celier@adacore.com> * s-osinte-vms.ads: Fix style errors. 2014-07-18 Thomas Quinot <quinot@adacore.com> * s-oscons-tmplt.c (_POSIX_SOURCE): Define in order to get NAME_MAX and PATH_MAX. 2014-07-18 Bob Duff <duff@adacore.com> * 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. From-SVN: r212798
-rw-r--r--gcc/ada/ChangeLog21
-rw-r--r--gcc/ada/exp_strm.adb18
-rw-r--r--gcc/ada/s-oscons-tmplt.c6
-rw-r--r--gcc/ada/s-osinte-vms.ads14
-rw-r--r--gcc/ada/sem_ch13.adb7
5 files changed, 50 insertions, 16 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 965216c..c02198c 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,26 @@
2014-07-18 Robert Dewar <dewar@adacore.com>
+ * sem_ch13.adb (Is_Type_Ref): Check that type name is not
+ parenthesized.
+
+2014-07-18 Vincent Celier <celier@adacore.com>
+
+ * s-osinte-vms.ads: Fix style errors.
+
+2014-07-18 Thomas Quinot <quinot@adacore.com>
+
+ * s-oscons-tmplt.c (_POSIX_SOURCE): Define in order to get
+ NAME_MAX and PATH_MAX.
+
+2014-07-18 Bob Duff <duff@adacore.com>
+
+ * 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 <dewar@adacore.com>
+
* sem_aggr.adb, exp_ch5.adb, sem_ch3.adb, layout.adb, sem_type.adb,
exp_util.adb, exp_attr.adb, einfo.adb, einfo.ads, exp_pakd.adb,
checks.adb, exp_pakd.ads, freeze.adb, sem_util.adb, exp_dbug.adb,
diff --git a/gcc/ada/exp_strm.adb b/gcc/ada/exp_strm.adb
index ce313c6..288b1bf 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 0d79d6f..2b16448 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 e8cc6b8..2b2b135 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 84e62db..335e4f4 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;
------------