diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-24 13:14:22 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-24 13:14:22 +0000 |
commit | 148b247696d22ef807ff8a200c1fb70c8126e199 (patch) | |
tree | fae838193d6d95f860215a3cb43697786366724c /gcc/ada/exp_ch4.adb | |
parent | cf36214f7013e7be1b087d6c02647d3ddfe38630 (diff) | |
download | gcc-148b247696d22ef807ff8a200c1fb70c8126e199.tar.gz |
2009-04-24 Robert Dewar <dewar@adacore.com>
* einfo.adb (OK_To_Rename): New flag
* einfo.ads (OK_To_Rename): New flag
* exp_ch3.adb (Expand_N_Object_Declaration): Rewrite as renames if
OK_To_Rename set.
* exp_ch4.adb (Expand_Concatenate): Mark temp variable OK_To_Rename
* sem_ch7.adb (Uninstall_Declarations): Allow for renames from
OK_To_Rename.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146714 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_ch4.adb')
-rw-r--r-- | gcc/ada/exp_ch4.adb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 19dbf7aa77f..5a7d713eaf5 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2009, 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- -- @@ -2805,6 +2805,12 @@ package body Exp_Ch4 is High_Bound => High_Bound))))), Suppress => All_Checks); + -- If the result of the concatenation appears as the initializing + -- expression of an object declaration, we can just rename the + -- result, rather than copying it. + + Set_OK_To_Rename (Ent); + -- Catch the static out of range case now if Raises_Constraint_Error (High_Bound) then |