Commit 8b4230c8 by Arnaud Charlet

[multiple changes]

2014-01-27  Tristan Gingold  <gingold@adacore.com>

	* exp_ch7.adb, exp_ch9.adb: Adjust comments.

2014-01-27  Robert Dewar  <dewar@adacore.com>

	* exp_ch4.adb (Expand_N_Op_Expon): Remove unsigned type test
	for 2**X optimization.

2014-01-27  Ed Schonberg  <schonberg@adacore.com>

	* a-suenst.adb: strings.utf_encoding.strings (Decode): Check
	explicitly whether value is in range of Character, because the
	library is typically compiled with range checks disabled, and
	we cannot rely on the implicit check on the argument of 'Val.

2014-01-27  Vincent Celier  <celier@adacore.com>

	* a-ciorma.adb, a-cihama.adb (Assign): Copy the Source to the Target,
	not the Target to itself.

2014-01-27  Robert Dewar  <dewar@adacore.com>

	* vms_conv.ads, ali.adb, sem_ch6.ads, opt.ads, vms_cmds.ads: Minor
	changes to avoid incorrect use of unordered enum types.

2014-01-27  Thomas Quinot  <quinot@adacore.com>

	* sem_ch4.adb: Minor reformatting.

From-SVN: r207144
parent 29077c18
2014-01-27 Tristan Gingold <gingold@adacore.com>
* exp_ch7.adb, exp_ch9.adb: Adjust comments.
2014-01-27 Robert Dewar <dewar@adacore.com>
* exp_ch4.adb (Expand_N_Op_Expon): Remove unsigned type test
for 2**X optimization.
2014-01-27 Ed Schonberg <schonberg@adacore.com>
* a-suenst.adb: strings.utf_encoding.strings (Decode): Check
explicitly whether value is in range of Character, because the
library is typically compiled with range checks disabled, and
we cannot rely on the implicit check on the argument of 'Val.
2014-01-27 Vincent Celier <celier@adacore.com>
* a-ciorma.adb, a-cihama.adb (Assign): Copy the Source to the Target,
not the Target to itself.
2014-01-27 Robert Dewar <dewar@adacore.com>
* vms_conv.ads, ali.adb, sem_ch6.ads, opt.ads, vms_cmds.ads: Minor
changes to avoid incorrect use of unordered enum types.
2014-01-27 Thomas Quinot <quinot@adacore.com>
* sem_ch4.adb: Minor reformatting.
2014-01-27 Robert Dewar <dewar@adacore.com>
* scn.adb (Check_End_Of_Line): Removed.
......
......@@ -169,7 +169,7 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
Target.Reserve_Capacity (Source.Length);
end if;
Insert_Items (Target.HT);
Insert_Items (Source.HT);
end Assign;
--------------
......
......@@ -313,7 +313,7 @@ package body Ada.Containers.Indefinite_Ordered_Maps is
end if;
Target.Clear;
Insert_Items (Target.Tree);
Insert_Items (Source.Tree);
end Assign;
-------------
......
......@@ -154,16 +154,19 @@ package body Ada.Strings.UTF_Encoding.Strings is
end if;
Len := Len + 1;
-- The value may still be out of range of Standard.Character. We make
-- the check explicit because the library is typically compiled with
-- range checks disabled.
if R > Character'Pos (Character'Last) then
Raise_Encoding_Error (Iptr - 1);
end if;
Result (Len) := Character'Val (R);
end loop;
return Result (1 .. Len);
exception
-- 'Val may have been out of range
when others =>
Raise_Encoding_Error (Iptr - 1);
end Decode;
-- Decode UTF-16 input to String
......
......@@ -1290,7 +1290,7 @@ package body ALI is
begin
R := Restriction_Id'First;
while R < Not_A_Restriction_Id loop
while R /= Not_A_Restriction_Id loop
if Restriction_Id'Image (R) = RN then
goto R_Found;
end if;
......
......@@ -7469,12 +7469,16 @@ package body Exp_Ch4 is
-- a non-binary modulus in the multiplication case, since we get a wrong
-- result if the shift causes an overflow before the modular reduction.
-- Note: we used to check that Exptyp was an unsigned type. But that is
-- an unnecessary check, since if Exp is negative, we have a run-time
-- error that is either caught (so we get the right result) or we have
-- suppressed the check, in which case the code is erroneous anyway.
if Nkind (Base) = N_Integer_Literal
and then CRT_Safe_Compile_Time_Known_Value (Base)
and then Expr_Value (Base) = Uint_2
and then Is_Integer_Type (Root_Type (Exptyp))
and then Esize (Root_Type (Exptyp)) <= Esize (Standard_Integer)
and then Is_Unsigned_Type (Exptyp)
and then not Ovflo
then
-- First the multiply and divide cases
......
......@@ -532,11 +532,8 @@ package body Exp_Ch7 is
pragma Assert (Present (Param));
-- Historical note: In earlier versions of GNAT, there was code
-- at this point to generate stuff to service entry queues. But
-- that was wrong thinking. This was useless and resulted in
-- incoherencies between code generated with and without -gnatp.
-- All that is needed at this stage is a normal cleanup call
-- at this point to generate stuff to service entry queues. It is
-- now abstracted in Build_Protected_Subprogram_Call_Cleanup.
Build_Protected_Subprogram_Call_Cleanup
(Specification (N), Conc_Typ, Loc, Stmts);
......
......@@ -4278,6 +4278,10 @@ package body Exp_Ch9 is
Append (Unprot_Call, Stmts);
end if;
-- Historical note: Previously, call the the cleanup was inserted
-- here. This is now done by Build_Protected_Subprogram_Call_Cleanup,
-- which is also shared by the 'not Exc_Safe' path.
Build_Protected_Subprogram_Call_Cleanup (Op_Spec, Pid, Loc, Stmts);
if Nkind (Op_Spec) = N_Function_Specification then
......@@ -4298,6 +4302,10 @@ package body Exp_Ch9 is
Handled_Statement_Sequence =>
Make_Handled_Sequence_Of_Statements (Loc, Statements => Stmts));
-- Mark this subprogram as a protected subprogram body so that the
-- cleanup will be inserted. This is done only in the 'not Exc_Safe'
-- path as otherwise the cleanup has already been inserted.
if not Exc_Safe then
Set_Is_Protected_Subprogram_Body (Sub_Body);
end if;
......
......@@ -1064,6 +1064,7 @@ package Opt is
-- object directory, if project files are used.
type Operating_Mode_Type is (Check_Syntax, Check_Semantics, Generate_Code);
pragma Ordered (Operating_Mode_Type);
Operating_Mode : Operating_Mode_Type := Generate_Code;
-- GNAT
-- Indicates the operating mode of the compiler. The default is generate
......@@ -1072,7 +1073,8 @@ package Opt is
-- only mode. Operating_Mode can also be modified as a result of detecting
-- errors during the compilation process. In particular if any serious
-- error is detected then this flag is reset from Generate_Code to
-- Check_Semantics after generating an error message.
-- Check_Semantics after generating an error message. This is an ordered
-- type with the semantics that each value does more than the previous one.
Optimize_Alignment : Character := 'O';
-- Setting of Optimize_Alignment, set to T/S/O for time/space/off. Can
......
......@@ -28,8 +28,7 @@ package Sem_Ch6 is
type Conformance_Type is
(Type_Conformant, Mode_Conformant, Subtype_Conformant, Fully_Conformant);
-- pragma Ordered (Conformance_Type);
-- Why is above line commented out ???
pragma Ordered (Conformance_Type);
-- Conformance type used in conformance checks between specs and bodies,
-- and for overriding. The literals match the RM definitions of the
-- corresponding terms. This is an ordered type, since each conformance
......
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2010-2012, Free Software Foundation, Inc. --
-- Copyright (C) 2010-2013, 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- --
......@@ -50,4 +50,7 @@ package VMS_Cmds is
Test,
Xref,
Undefined);
subtype Real_Command_Type is Command_Type range Bind .. Xref;
-- All real command types (excludes only Undefined).
end VMS_Cmds;
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2003-2010, Free Software Foundation, Inc. --
-- Copyright (C) 2003-2013, 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- --
......@@ -104,8 +104,6 @@ package VMS_Conv is
Pp => Pretty);
-- Mapping of alternate commands to commands
subtype Real_Command_Type is Command_Type range Bind .. Xref;
type Command_Entry is record
Cname : String_Ptr;
-- Command name for GNAT xxx command
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment