aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2012-12-05 11:29:59 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2012-12-05 11:29:59 +0100
commitbe4c5193199667c1e167ad558f4c8a9504eeeda6 (patch)
tree27d42a6a40c0b1df7a6ef429c67194c986a05316 /gcc
parent03a2b9ede1ee9a02d3c9dbb2aa1556913ebec531 (diff)
downloadgcc-be4c5193199667c1e167ad558f4c8a9504eeeda6.zip
gcc-be4c5193199667c1e167ad558f4c8a9504eeeda6.tar.gz
gcc-be4c5193199667c1e167ad558f4c8a9504eeeda6.tar.bz2
[multiple changes]
2012-12-05 Ed Schonberg <schonberg@adacore.com> * s-rident.ads, restrict.ads: Remove discrepancies between the documentation on implementation-defined restrictions, and the internal data structure used for warnings and errors on implementation-defined restriction violations. 2012-12-05 Ed Schonberg <schonberg@adacore.com> * sem_prag.adb (Chain_PPC): Pre- and postcondition aspects are legal on a subprogram body that acts as a spec. 2012-12-05 Ed Schonberg <schonberg@adacore.com> * sem_ch8.adb (Find_Selected_Component): If the selector name is an overloadable entity but the name is not overloaded, generate reference to it rather than delaying this until resolution. 2012-12-05 Robert Dewar <dewar@adacore.com> * checks.ads, checks.adb (Activate_Overflow_Check): No effect for MOD/REM/unary + * exp_ch4.adb (Expand_N_Op_Mod): Remove call to set Do_Overflow_Check. 2012-12-05 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Find_Non_Universal_Interpretation): Use the types of the right operand if the left operand is null. 2012-12-05 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi, vms_data.ads: document gnatpp -nn option. 2012-12-05 Jose Ruiz <ruiz@adacore.com> * init.c (__gnat_install_handler): For the LEON VxWorks kernel run-time library we need to install a trap handler directly in the trap table (no support by the OS) for the software trap 0. From-SVN: r194196
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog39
-rw-r--r--gcc/ada/checks.adb6
-rw-r--r--gcc/ada/checks.ads2
-rw-r--r--gcc/ada/exp_ch4.adb2
-rw-r--r--gcc/ada/gnat_ugn.texi12
-rw-r--r--gcc/ada/init.c53
-rw-r--r--gcc/ada/restrict.ads12
-rw-r--r--gcc/ada/s-rident.ads6
-rw-r--r--gcc/ada/sem_ch4.adb5
-rw-r--r--gcc/ada/sem_ch8.adb7
-rw-r--r--gcc/ada/sem_prag.adb8
-rw-r--r--gcc/ada/vms_data.ads25
12 files changed, 166 insertions, 11 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 7f77767..2503ca0 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,42 @@
+2012-12-05 Ed Schonberg <schonberg@adacore.com>
+
+ * s-rident.ads, restrict.ads: Remove discrepancies between the
+ documentation on implementation-defined restrictions, and
+ the internal data structure used for warnings and errors on
+ implementation-defined restriction violations.
+
+2012-12-05 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_prag.adb (Chain_PPC): Pre- and postcondition aspects
+ are legal on a subprogram body that acts as a spec.
+
+2012-12-05 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch8.adb (Find_Selected_Component): If the selector name is
+ an overloadable entity but the name is not overloaded, generate
+ reference to it rather than delaying this until resolution.
+
+2012-12-05 Robert Dewar <dewar@adacore.com>
+
+ * checks.ads, checks.adb (Activate_Overflow_Check): No effect for
+ MOD/REM/unary +
+ * exp_ch4.adb (Expand_N_Op_Mod): Remove call to set Do_Overflow_Check.
+
+2012-12-05 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch4.adb (Find_Non_Universal_Interpretation): Use the
+ types of the right operand if the left operand is null.
+
+2012-12-05 Sergey Rybin <rybin@adacore.com frybin>
+
+ * gnat_ugn.texi, vms_data.ads: document gnatpp -nn option.
+
+2012-12-05 Jose Ruiz <ruiz@adacore.com>
+
+ * init.c (__gnat_install_handler): For the LEON VxWorks kernel
+ run-time library we need to install a trap handler directly in the
+ trap table (no support by the OS) for the software trap 0.
+
2012-12-05 Eric Botcazou <ebotcazou@adacore.com>
* gnat_rm.texi (Interfacing to C++): Document new restrictions.
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index 841b178..8a73e25 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -387,8 +387,10 @@ package body Checks is
procedure Activate_Overflow_Check (N : Node_Id) is
begin
- Set_Do_Overflow_Check (N, True);
- Possible_Local_Raise (N, Standard_Constraint_Error);
+ if not Nkind_In (N, N_Op_Rem, N_Op_Mod, N_Op_Plus) then
+ Set_Do_Overflow_Check (N, True);
+ Possible_Local_Raise (N, Standard_Constraint_Error);
+ end if;
end Activate_Overflow_Check;
--------------------------
diff --git a/gcc/ada/checks.ads b/gcc/ada/checks.ads
index fa1c055..2221f0e 100644
--- a/gcc/ada/checks.ads
+++ b/gcc/ada/checks.ads
@@ -93,6 +93,8 @@ package Checks is
-- Sets Do_Overflow_Check flag in node N, and handles possible local raise.
-- Always call this routine rather than calling Set_Do_Overflow_Check to
-- set an explicit value of True, to ensure handling the local raise case.
+ -- Note that this call has no effect for MOD, REM, and unary "+" for which
+ -- overflow is never possible in any case.
procedure Activate_Range_Check (N : Node_Id);
pragma Inline (Activate_Range_Check);
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index 82af98e..80c27c4 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -7910,7 +7910,6 @@ package body Exp_Ch4 is
procedure Expand_N_Op_Mod (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Typ : constant Entity_Id := Etype (N);
- DOC : constant Boolean := Do_Overflow_Check (N);
DDC : constant Boolean := Do_Division_Check (N);
Left : Node_Id;
@@ -7975,7 +7974,6 @@ package body Exp_Ch4 is
Set_Entity (N, Standard_Entity (S_Op_Rem));
Set_Etype (N, Typ);
- Set_Do_Overflow_Check (N, DOC);
Set_Do_Division_Check (N, DDC);
Expand_N_Op_Rem (N);
Set_Analyzed (N);
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index 6d47f04..199f920 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -13384,6 +13384,18 @@ lower case. Overrides ^-n^/NAME_CASING^ casing setting.
Names introduced by type and subtype declarations are always in
mixed case. Overrides ^-n^/NAME_CASING^ casing setting.
+@item ^-nnU^/NUMBER_CASING=UPPER_CASE^
+Names introduced by number declarations are always in
+upper case. Overrides ^-n^/NAME_CASING^ casing setting.
+
+@item ^-nnL^/NUMBER_CASING=LOWER_CASE^
+Names introduced by number declarations are always in
+lower case. Overrides ^-n^/NAME_CASING^ casing setting.
+
+@item ^-nnM^/NUMBER_CASING=MIXED_CASE^
+Names introduced by number declarations are always in
+mixed case. Overrides ^-n^/NAME_CASING^ casing setting.
+
@cindex @option{^-p@var{x}^/PRAGMA_CASING^} (@command{gnatpp})
@item ^-pL^/PRAGMA_CASING=LOWER_CASE^
Pragma names are lower case
diff --git a/gcc/ada/init.c b/gcc/ada/init.c
index e7283a2..8a28bf6 100644
--- a/gcc/ada/init.c
+++ b/gcc/ada/init.c
@@ -1759,6 +1759,25 @@ __gnat_error_handler (int sig, void *si, struct sigcontext *sc)
#endif
}
+#if defined(__leon__) && defined(_WRS_KERNEL)
+/* For LEON VxWorks we need to install a trap handler for stack overflow */
+
+extern void excEnt (void);
+/* VxWorks exception handler entry */
+
+struct trap_entry {
+ unsigned long inst_first;
+ unsigned long inst_second;
+ unsigned long inst_third;
+ unsigned long inst_fourth;
+};
+/* Four instructions representing entries in the trap table */
+
+struct trap_entry *trap_0_entry;
+/* We will set the location of the entry for software trap 0 in the trap
+ table. */
+#endif
+
void
__gnat_install_handler (void)
{
@@ -1779,6 +1798,40 @@ __gnat_install_handler (void)
sigaction (SIGSEGV, &act, NULL);
sigaction (SIGBUS, &act, NULL);
+#if defined(__leon__) && defined(_WRS_KERNEL)
+ /* Specific to the LEON VxWorks kernel run-time library */
+
+ /* For stack checking the compiler triggers a software trap 0 (ta 0) in
+ case of overflow (we use the stack limit mechanism). We need to install
+ the trap handler here for this software trap (the OS does not handle
+ it) as if it were a data_access_exception (trap 9). We do the same as
+ if we put in the trap table a VXSPARC_BAD_TRAP(9). Software trap 0 is
+ located at vector 0x80, and each entry takes 4 words. */
+
+ trap_0_entry = (struct trap_entry *)(intVecBaseGet () + 0x80 * 4);
+
+ /* mov 0x9, %l7 */
+
+ trap_0_entry->inst_first = 0xae102000 + 9;
+
+ /* sethi %hi(excEnt), %l6 */
+
+ /* The 22 most significant bits of excEnt are obtained shifting 10 times
+ to the right. */
+
+ trap_0_entry->inst_second = 0x2d000000 + ((unsigned long)excEnt >> 10);
+
+ /* jmp %l6+%lo(excEnt) */
+
+ /* The 10 least significant bits of excEnt are obtained by masking */
+
+ trap_0_entry->inst_third = 0x81c5a000 + ((unsigned long)excEnt & 0x3ff);
+
+ /* rd %psr, %l0 */
+
+ trap_0_entry->inst_fourth = 0xa1480000;
+#endif
+
__gnat_handler_installed = 1;
}
diff --git a/gcc/ada/restrict.ads b/gcc/ada/restrict.ads
index 1d9d67f..54702ab 100644
--- a/gcc/ada/restrict.ads
+++ b/gcc/ada/restrict.ads
@@ -107,8 +107,9 @@ package Restrict is
Implementation_Restriction : array (All_Restrictions) of Boolean :=
(Simple_Barriers => True,
- No_Asynchronous_Control => True,
No_Calendar => True,
+ No_Default_Initialization => True,
+ No_Direct_Boolean_Operators => True,
No_Dispatching_Calls => True,
No_Dynamic_Attachment => True,
No_Elaboration_Code => True,
@@ -116,12 +117,16 @@ package Restrict is
No_Entry_Calls_In_Elaboration_Code => True,
No_Entry_Queue => True,
No_Exception_Handlers => True,
+ No_Exception_Propagation => True,
No_Exception_Registration => True,
+ No_Finalization => True,
No_Implementation_Attributes => True,
No_Implementation_Pragmas => True,
No_Implicit_Conditionals => True,
+ No_Implicit_Aliasing => True,
No_Implicit_Dynamic_Code => True,
No_Implicit_Loops => True,
+ No_Initialize_Scalars => True,
No_Local_Protected_Objects => True,
No_Protected_Type_Allocators => True,
No_Relative_Delay => True,
@@ -129,14 +134,15 @@ package Restrict is
No_Secondary_Stack => True,
No_Select_Statements => True,
No_Standard_Storage_Pools => True,
+ No_Stream_Optimizations => True,
No_Streams => True,
No_Task_Attributes_Package => True,
No_Task_Termination => True,
- No_Unchecked_Conversion => True,
- No_Unchecked_Deallocation => True,
+ No_Tasking => True,
No_Wide_Characters => True,
Static_Priorities => True,
Static_Storage_Size => True,
+ SPARK => True,
others => False);
-- The following table records entries made by Restrictions pragmas
diff --git a/gcc/ada/s-rident.ads b/gcc/ada/s-rident.ads
index 880a729..d0bc106 100644
--- a/gcc/ada/s-rident.ads
+++ b/gcc/ada/s-rident.ads
@@ -94,7 +94,7 @@ package System.Rident is
No_Allocators, -- (RM H.4(7))
No_Allocators_After_Elaboration, -- Ada 2012 (RM D.7(19.1/2))
No_Anonymous_Allocators, -- Ada 2012 (RM H.4(8/1))
- No_Asynchronous_Control, -- (RM D.7(10))
+ No_Asynchronous_Control, -- (RM J.13(3/2)
No_Calendar, -- GNAT
No_Default_Stream_Attributes, -- Ada 2012 (RM 13.12.1(4/2))
No_Delay, -- (RM H.4(21))
@@ -142,8 +142,8 @@ package System.Rident is
No_Tasking, -- GNAT
No_Terminate_Alternatives, -- (RM D.7(6))
No_Unchecked_Access, -- (RM H.4(18))
- No_Unchecked_Conversion, -- (RM H.4(16))
- No_Unchecked_Deallocation, -- (RM H.4(9))
+ No_Unchecked_Conversion, -- (RM J.13(4/2))
+ No_Unchecked_Deallocation, -- (RM J.13(5/2))
Static_Priorities, -- GNAT
Static_Storage_Size, -- GNAT
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index 10fd386..2c54fcd 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -192,7 +192,9 @@ package body Sem_Ch4 is
-- of the operand types. If one of the operands has a universal interpre-
-- tation, the legality check uses some compatible non-universal
-- interpretation of the other operand. N can be an operator node, or
- -- a function call whose name is an operator designator.
+ -- a function call whose name is an operator designator. Any_Access, which
+ -- is the initial type of the literal NULL, is a universal type for the
+ -- purpose of this routine.
function Find_Primitive_Operation (N : Node_Id) return Boolean;
-- Find candidate interpretations for the name Obj.Proc when it appears
@@ -5504,6 +5506,7 @@ package body Sem_Ch4 is
begin
if T1 = Universal_Integer
or else T1 = Universal_Real
+ or else T1 = Any_Access
then
if not Is_Overloaded (R) then
Add_One_Interp
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index 7b937a6..fb5c3c8 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -5521,6 +5521,13 @@ package body Sem_Ch8 is
null;
end if;
end if;
+
+ -- If there is a single interpretation for N we can generate a
+ -- reference to the unique entity found.
+
+ if Is_Overloadable (Id) and then not Is_Overloaded (N) then
+ Generate_Reference (Id, N);
+ end if;
end Find_Expanded_Name;
-------------------------
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 2765f10..fa3e066 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -2068,6 +2068,14 @@ package body Sem_Prag is
Error_Pragma
("aspect % requires ''Class for null procedure");
+ -- Pre/postconditions are legal on a subprogram body if it is not
+ -- a completion of a declaration.
+
+ elsif Nkind (PO) = N_Subprogram_Body
+ and then Acts_As_Spec (PO)
+ then
+ null;
+
elsif not Nkind_In (PO, N_Subprogram_Declaration,
N_Expression_Function,
N_Generic_Subprogram_Declaration,
diff --git a/gcc/ada/vms_data.ads b/gcc/ada/vms_data.ads
index e4b04b7..69fe509 100644
--- a/gcc/ada/vms_data.ads
+++ b/gcc/ada/vms_data.ads
@@ -6343,6 +6343,30 @@ package VMS_Data is
--
-- Replace all tabulations in comments with spaces.
+ S_Pretty_Numbers : aliased constant S := "/NUMBER_CASING=" &
+ "AS_DECLARED " &
+ "-ntD " &
+ "LOWER_CASE " &
+ "-ntL " &
+ "UPPER_CASE " &
+ "-ntU " &
+ "MIXED_CASE " &
+ "-ntM";
+ -- /NUMBER_CASING=name-option
+ --
+ -- Specify the casing of named number names. If not specified, the casing
+ -- of these names is defined by the NAME_CASING option. 'name-option'
+ -- is one of:
+ --
+ -- AS_DECLARED Names are cased as they appear in the declaration
+ -- in the source file.
+ --
+ -- LOWER_CASE Names are in lower case.
+ --
+ -- UPPER_CASE Names are in upper case.
+ --
+ -- MIXED_CASE Names are in mixed case.
+
S_Pretty_Output : aliased constant S := "/OUTPUT=@" &
"-o@";
-- /OUTPUT=file
@@ -6498,6 +6522,7 @@ package VMS_Data is
S_Pretty_Names 'Access,
S_Pretty_No_Labels 'Access,
S_Pretty_Notabs 'Access,
+ S_Pretty_Numbers 'Access,
S_Pretty_Output 'Access,
S_Pretty_Override 'Access,
S_Pretty_Pragma 'Access,