aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2019-09-19 08:12:34 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-09-19 08:12:34 +0000
commitf4437882fe972b14eb5f4163de34fa9c909b5fb6 (patch)
tree08cca9541d990caceebf84392e16bcd16903dfce
parenta7268fd7652406b41707af0c4b49e8523b667360 (diff)
downloadgcc-f4437882fe972b14eb5f4163de34fa9c909b5fb6.zip
gcc-f4437882fe972b14eb5f4163de34fa9c909b5fb6.tar.gz
gcc-f4437882fe972b14eb5f4163de34fa9c909b5fb6.tar.bz2
[Ada] Rtsfind: improve comment on RTE_Available
2019-09-19 Bob Duff <duff@adacore.com> gcc/ada/ * rtsfind.ads (RTE_Available): Improve comment. From-SVN: r275930
-rw-r--r--gcc/ada/ChangeLog4
-rw-r--r--gcc/ada/rtsfind.ads17
2 files changed, 21 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index c42498e..7b4bb47 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,7 @@
+2019-09-19 Bob Duff <duff@adacore.com>
+
+ * rtsfind.ads (RTE_Available): Improve comment.
+
2019-09-18 Bob Duff <duff@adacore.com>
* exp_ch5.adb (Expand_Assign_Array_Loop_Or_Bitfield): Move call
diff --git a/gcc/ada/rtsfind.ads b/gcc/ada/rtsfind.ads
index 9d5a86c..2467f85 100644
--- a/gcc/ada/rtsfind.ads
+++ b/gcc/ada/rtsfind.ads
@@ -3203,6 +3203,23 @@ package Rtsfind is
-- Returns true if a call to RTE will succeed without raising an exception
-- and without generating an error message, i.e. if the call will obtain
-- the desired entity without any problems.
+ --
+ -- If we call this and it returns True, we should generate a call to E.
+ -- In other words, the compiler should not call RTE_Available (E) until
+ -- it has decided it wants to generate a call to E. Otherwise we can get
+ -- spurious dependencies and elaboration orders.
+ --
+ -- if RTE_Available (E) -- WRONG!
+ -- and then <some condition>
+ -- then
+ -- generate call to E;
+ --
+ -- Should be:
+ --
+ -- if <some condition>
+ -- and then RTE_Available (E) -- Correct
+ -- then
+ -- generate call to E;
function RTE_Record_Component (E : RE_Id) return Entity_Id;
-- Given the entity defined in the above tables, as identified by the