aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Schonberg <schonber@gnat.com>2004-10-04 16:56:49 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2004-10-04 16:56:49 +0200
commit27ad9660a8011119222121eb67aabb099cc43e1a (patch)
treea29d38223c50949eec392bebf701ed79b9286c0e
parent1c6c6771b61a8d083d8bf25bb97cf392599d1581 (diff)
downloadgcc-27ad9660a8011119222121eb67aabb099cc43e1a.zip
gcc-27ad9660a8011119222121eb67aabb099cc43e1a.tar.gz
gcc-27ad9660a8011119222121eb67aabb099cc43e1a.tar.bz2
exp_ch6.adb (Expand_N_Function_Call): If stack checking is enabled...
2004-10-04 Ed Schonberg <schonberg@gnat.com> * exp_ch6.adb (Expand_N_Function_Call): If stack checking is enabled, do not generate a declaration for a temporary if the call is part of a library-level instantiation. From-SVN: r88495
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/exp_ch6.adb7
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index fbd3a89..8daf6bac 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,11 @@
2004-10-04 Ed Schonberg <schonberg@gnat.com>
+ * exp_ch6.adb (Expand_N_Function_Call): If stack checking is enabled,
+ do not generate a declaration for a temporary if the call is part of a
+ library-level instantiation.
+
+2004-10-04 Ed Schonberg <schonberg@gnat.com>
+
* sem_util.adb (Explain_Limited_Type): Ignore internal components when
searching for a limited component to flag.
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index df976ad..4980155 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -2934,6 +2934,12 @@ package body Exp_Ch6 is
-- this because otherwise gigi may generate a large temporary on the
-- fly and this can cause trouble with stack checking.
+ -- This is unecessary if the call is the expression in an object
+ -- declaration, or if it appears outside of any library unit. This
+ -- can only happen if it appears as an actual in a library-level
+ -- instance, in which case a temporary will be generated for it once
+ -- the instance itself is installed.
+
if May_Generate_Large_Temp (Typ)
and then Nkind (Parent (N)) /= N_Assignment_Statement
and then
@@ -2943,6 +2949,7 @@ package body Exp_Ch6 is
(Nkind (Parent (N)) /= N_Object_Declaration
or else Expression (Parent (N)) /= N)
and then not Returned_By_Reference
+ and then Current_Scope /= Standard_Standard
then
if Stack_Checking_Enabled then