public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-1620] [Ada] New debug switch to disable large static aggregates
@ 2021-06-18 8:38 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-06-18 8:38 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:73b670e3b1b6a2c0ecfba711401210a284fce0c6
commit r12-1620-g73b670e3b1b6a2c0ecfba711401210a284fce0c6
Author: Bob Duff <duff@adacore.com>
Date: Tue Mar 16 15:45:48 2021 -0400
[Ada] New debug switch to disable large static aggregates
gcc/ada/
* debug.adb: Document switch.
* exp_aggr.adb: If -gnatd_g was given, then do not bump the
limit to 500_000.
Diff:
---
gcc/ada/debug.adb | 6 +++++-
gcc/ada/exp_aggr.adb | 6 ++++--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb
index e2c72289f6d..0694f23647c 100644
--- a/gcc/ada/debug.adb
+++ b/gcc/ada/debug.adb
@@ -145,7 +145,7 @@ package body Debug is
-- d_d
-- d_e Ignore entry calls and requeue statements for elaboration
-- d_f Issue info messages related to GNATprove usage
- -- d_g
+ -- d_g Disable large static aggregates
-- d_h Disable the use of (perfect) hash functions for enumeration Value
-- d_i Ignore activations and calls to instances for elaboration
-- d_j Read JSON files and populate Repinfo tables (opposite of -gnatRjs)
@@ -965,6 +965,10 @@ package body Debug is
-- beginners find them confusing. Set automatically by GNATprove when
-- switch --info is used.
+ -- d_g Disable large static aggregates. The maximum size for a static
+ -- aggregate will be fairly modest, which is useful if the compiler
+ -- is using too much memory and time at compile time.
+
-- d_h The compiler does not make use of (perfect) hash functions in the
-- implementation of the Value attribute for enumeration types.
diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb
index 8f3147e5be7..2e772ed799a 100644
--- a/gcc/ada/exp_aggr.adb
+++ b/gcc/ada/exp_aggr.adb
@@ -684,9 +684,11 @@ package body Exp_Aggr is
begin
-- We bump the maximum size unless the aggregate has a single component
-- association, which will be more efficient if implemented with a loop.
+ -- The -gnatd_g switch disables this bumping.
- if No (Expressions (N))
- and then No (Next (First (Component_Associations (N))))
+ if (No (Expressions (N))
+ and then No (Next (First (Component_Associations (N)))))
+ or else Debug_Flag_Underscore_G
then
Max_Aggr_Size := Max_Aggregate_Size (N);
else
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-18 8:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-18 8:38 [gcc r12-1620] [Ada] New debug switch to disable large static aggregates Pierre-Marie de Rodat
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).