public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/autopar_devel] [Ada] Avoid creating temporaries in Universal_Integer, continued
@ 2020-08-22 21:55 Giuliano Belinassi
0 siblings, 0 replies; only message in thread
From: Giuliano Belinassi @ 2020-08-22 21:55 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:c26b3f7091ede3ff72d38002033919b876b4fd9f
commit c26b3f7091ede3ff72d38002033919b876b4fd9f
Author: Eric Botcazou <ebotcazou@adacore.com>
Date: Mon Jan 13 21:17:48 2020 +0100
[Ada] Avoid creating temporaries in Universal_Integer, continued
2020-06-03 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* exp_util.adb (Remove_Side_Effects): For a type conversion, do
not remove the side effects of the expression only if it is of
universal integer type.
Diff:
---
gcc/ada/exp_util.adb | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index 1f3cfcc1274..af7a7052511 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -11428,12 +11428,15 @@ package body Exp_Util is
goto Leave;
-- If this is a type conversion, leave the type conversion and remove
- -- the side effects in the expression. This is important in several
- -- circumstances: for change of representations, and also when this is a
- -- view conversion to a smaller object, where gigi can end up creating
- -- its own temporary of the wrong size.
-
- elsif Nkind (Exp) = N_Type_Conversion then
+ -- side effects in the expression, unless it is of universal integer,
+ -- which is a very large type for a temporary. This is important in
+ -- several circumstances: for change of representations and also when
+ -- this is a view conversion to a smaller object, where gigi can end
+ -- up creating its own temporary of the wrong size.
+
+ elsif Nkind (Exp) = N_Type_Conversion
+ and then Etype (Expression (Exp)) /= Universal_Integer
+ then
Remove_Side_Effects (Expression (Exp), Name_Req, Variable_Ref);
-- Generating C code the type conversion of an access to constrained
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-08-22 21:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-22 21:55 [gcc/devel/autopar_devel] [Ada] Avoid creating temporaries in Universal_Integer, continued Giuliano Belinassi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).