From: Arnaud Charlet Date: Fri, 18 Jul 2014 10:15:56 +0000 (+0200) Subject: [multiple changes] X-Git-Tag: releases/gcc-5.1.0~6219 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c74afd846db25c438a7f24254fe501a829109117;p=thirdparty%2Fgcc.git [multiple changes] 2014-07-18 Gary Dismukes * sem_util.adb: Minor typo correction. 2014-07-18 Ben Brosgol * gnat_rm.texi: Complete previous change. 2014-07-18 Pascal Obry * s-fileio.adb: Minor style fix. 2014-07-18 Ed Schonberg * sem_ch13.adb (Analyze_Aspect_Specifications): Detect improper specification of stream attributes for subtypes that are not first subtypes, to prevent malformed rep_item chains in the case of such illegal specifications for discriminated private subtypes. (Check_Overloaded_Name): Verify that the name is an entity name before other checks. 2014-07-18 Pascal Obry * adaint.c (__gnat_fputwc) Do not disable on cross-build. From-SVN: r212807 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 8bbebc024b2f..09ccb01eec6b 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,28 @@ +2014-07-18 Gary Dismukes + + * sem_util.adb: Minor typo correction. + +2014-07-18 Ben Brosgol + + * gnat_rm.texi: Complete previous change. + +2014-07-18 Pascal Obry + + * s-fileio.adb: Minor style fix. + +2014-07-18 Ed Schonberg + + * sem_ch13.adb (Analyze_Aspect_Specifications): Detect improper + specification of stream attributes for subtypes that are not + first subtypes, to prevent malformed rep_item chains in the case + of such illegal specifications for discriminated private subtypes. + (Check_Overloaded_Name): Verify that the name is an entity name + before other checks. + +2014-07-18 Pascal Obry + + * adaint.c (__gnat_fputwc) Do not disable on cross-build. + 2014-07-18 Robert Dewar * sem_prag.adb, sem_attr.adb, diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index 184d645881ce..2f3a7306e1ab 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -855,7 +855,7 @@ __gnat_rmdir (char *path) int __gnat_fputwc(int c, FILE *stream) { -#if ! defined (__vxworks) && ! defined (IS_CROSS) +#if ! defined (__vxworks) return fputwc ((wchar_t)c, stream); #else return fputc (c, stream); diff --git a/gcc/ada/aspects.ads b/gcc/ada/aspects.ads index 775611737cbb..bcc223467969 100644 --- a/gcc/ada/aspects.ads +++ b/gcc/ada/aspects.ads @@ -64,9 +64,9 @@ -- and fully analyzed (possibly with expansion) during the semantic -- analysis of subprogram bodies. -with Namet; use Namet; -with Snames; use Snames; -with Types; use Types; +with Namet; use Namet; +with Snames; use Snames; +with Types; use Types; package Aspects is @@ -205,10 +205,14 @@ package Aspects is -- The following array indicates aspects that accept 'Class Class_Aspect_OK : constant array (Aspect_Id) of Boolean := - (Aspect_Invariant => True, + (Aspect_Input => True, + Aspect_Invariant => True, + Aspect_Output => True, Aspect_Pre => True, Aspect_Predicate => True, Aspect_Post => True, + Aspect_Read => True, + Aspect_Write => True, Aspect_Type_Invariant => True, others => False); diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index 8c39be02723a..8ff1c646c0fc 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -502,6 +502,7 @@ The Implementation of Standard I/O * Text Translation:: * Shared Files:: * Filenames encoding:: +* File content encoding:: * Open Modes:: * Operations on C Streams:: * Interfacing to C Streams:: @@ -17288,6 +17289,7 @@ these additional facilities are also described in this chapter. * Text Translation:: * Shared Files:: * Filenames encoding:: +* File content encoding:: * Open Modes:: * Operations on C Streams:: * Interfacing to C Streams:: diff --git a/gcc/ada/s-fileio.adb b/gcc/ada/s-fileio.adb index c166729838e0..78dd34b9458c 100644 --- a/gcc/ada/s-fileio.adb +++ b/gcc/ada/s-fileio.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- -- @@ -763,7 +763,7 @@ package body System.File_IO is while Index < Form'Last loop Index := Index + 1; - -- Loop through the RMS Keys and dispatch. + -- Loop through the RMS Keys and dispatch for Key in RMS_Keys loop declare diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index d8cfad9ceecc..390fce7bd09c 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -1683,6 +1683,22 @@ package body Sem_Ch13 is Set_Never_Set_In_Source (E, False); end if; + -- Correctness of the profile of a stream operation is + -- verified at the freeze point, but we must detect the + -- illegal specification of this aspect for a subtype now, + -- to prevent malformed rep_item chains. + + if (A_Id = Aspect_Input + or else A_Id = Aspect_Output + or else A_Id = Aspect_Read + or else A_Id = Aspect_Write) + and not Is_First_Subtype (E) + then + Error_Msg_N + ("local name must be a first subtype", Aspect); + goto Continue; + end if; + -- Construct the attribute definition clause Aitem := @@ -8095,7 +8111,8 @@ package body Sem_Ch13 is procedure Check_Overloaded_Name is begin if not Is_Overloaded (End_Decl_Expr) then - Err := Entity (End_Decl_Expr) /= Entity (Freeze_Expr); + Err := not Is_Entity_Name (End_Decl_Expr) + or else Entity (End_Decl_Expr) /= Entity (Freeze_Expr); else Err := True; diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index ccebfe49e62a..1716095b5f98 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -3477,8 +3477,8 @@ package body Sem_Util is -- In Ada 2012, If the type has an incomplete partial view, there -- may be primitive operations declared before the full view, so - -- we need to start scanning from the the incomplete view, which - -- is earlier on the entity chain. + -- we need to start scanning from the incomplete view, which is + -- earlier on the entity chain. elsif Nkind (Parent (B_Type)) = N_Full_Type_Declaration and then Present (Incomplete_View (Parent (B_Type)))