aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/checks.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2009-10-27 14:16:48 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2009-10-27 14:16:48 +0100
commitfdfcc663025bcdca7562b2d16211a0588e484927 (patch)
tree75fc96285c761beaf46e117da46ba26e1193adfb /gcc/ada/checks.adb
parent477b99b63b10d050198e60bf44d8c1d3d89d5a0b (diff)
downloadgcc-fdfcc663025bcdca7562b2d16211a0588e484927.zip
gcc-fdfcc663025bcdca7562b2d16211a0588e484927.tar.gz
gcc-fdfcc663025bcdca7562b2d16211a0588e484927.tar.bz2
[multiple changes]
2009-10-27 Vincent Celier <celier@adacore.com> * makeutl.adb (Check_Source_Info_In_ALI): Do not recompile if a subunit from the runtime is found, except if gnatmake switch -a is used and this subunit cannot be found. 2009-10-27 Ed Schonberg <schonberg@adacore.com> * gnatbind.adb (gnatbind): When the -R option is selected, list subunits as well, for tools that need the complete closure of the main program. 2009-10-27 Sergey Rybin <rybin@adacore.com> * gnat_ugn.texi: Minor updates. 2009-10-27 Emmanuel Briot <briot@adacore.com> * prj-tree.adb (Free): Fix memory leak. 2009-10-27 Vasiliy Fofanov <fofanov@adacore.com> * adaint.c, s-os_lib.adb (__gnat_create_output_file_new): New function that ensures the file that is created is new. Use this function to make sure there is no race condition if several processes are creating temp files concurrently. * s-os_lib.ads: Update comment. 2009-10-27 Thomas Quinot <quinot@adacore.com> * sem_ch12.adb: Minor reformatting 2009-10-27 Javier Miranda <miranda@adacore.com> * exp_ch4.ads (Integer_Promotion_Possible): New subprogram. * exp_ch4.adb (Integer_Promotion_Possible): New subprogram. (Expand_N_Type_Conversion): Replace code that checks if the integer promotion of the operands is possible by a call to the new function Integer_Promotion_Possible. Minor reformating because an enclosing block is now not needed. * checks.adb (Apply_Arithmetic_Overflow_Check): Add missing check to see if the integer promotion is possible; in such case the runtime checks are not generated. From-SVN: r153592
Diffstat (limited to 'gcc/ada/checks.adb')
-rw-r--r--gcc/ada/checks.adb9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index d1a2b46..5f7e990 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -28,6 +28,7 @@ with Debug; use Debug;
with Einfo; use Einfo;
with Errout; use Errout;
with Exp_Ch2; use Exp_Ch2;
+with Exp_Ch4; use Exp_Ch4;
with Exp_Ch11; use Exp_Ch11;
with Exp_Pakd; use Exp_Pakd;
with Exp_Util; use Exp_Util;
@@ -844,7 +845,10 @@ package body Checks is
begin
-- Skip check if back end does overflow checks, or the overflow flag
- -- is not set anyway, or we are not doing code expansion.
+ -- is not set anyway, or we are not doing code expansion, or the
+ -- parent node is a type conversion whose operand is an arithmetic
+ -- operation on signed integers on which the expander can promote
+ -- later the operands to type integer (see Expand_N_Type_Conversion).
-- Special case CLI target, where arithmetic overflow checks can be
-- performed for integer and long_integer
@@ -852,6 +856,9 @@ package body Checks is
if Backend_Overflow_Checks_On_Target
or else not Do_Overflow_Check (N)
or else not Expander_Active
+ or else (Present (Parent (N))
+ and then Nkind (Parent (N)) = N_Type_Conversion
+ and then Integer_Promotion_Possible (Parent (N)))
or else
(VM_Target = CLI_Target and then Siz >= Standard_Integer_Size)
then