summaryrefslogtreecommitdiffstats
path: root/gcc/rtl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rtl.c')
-rw-r--r--gcc/rtl.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/gcc/rtl.c b/gcc/rtl.c
index ec48839f61e..0f59991702a 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -135,12 +135,10 @@ const char * const reg_note_name[REG_NOTE_MAX] =
#undef DEF_REG_NOTE
};
-#ifdef GATHER_STATISTICS
static int rtx_alloc_counts[(int) LAST_AND_UNUSED_RTX_CODE];
static int rtx_alloc_sizes[(int) LAST_AND_UNUSED_RTX_CODE];
static int rtvec_alloc_counts;
static int rtvec_alloc_sizes;
-#endif
/* Allocate an rtx vector of N elements.
@@ -157,10 +155,11 @@ rtvec_alloc (int n)
PUT_NUM_ELEM (rt, n);
-#ifdef GATHER_STATISTICS
- rtvec_alloc_counts++;
- rtvec_alloc_sizes += n * sizeof (rtx);
-#endif
+ if (GATHER_STATISTICS)
+ {
+ rtvec_alloc_counts++;
+ rtvec_alloc_sizes += n * sizeof (rtx);
+ }
return rt;
}
@@ -205,10 +204,11 @@ rtx_alloc_stat (RTX_CODE code MEM_STAT_DECL)
memset (rt, 0, RTX_HDR_SIZE);
PUT_CODE (rt, code);
-#ifdef GATHER_STATISTICS
- rtx_alloc_counts[code]++;
- rtx_alloc_sizes[code] += RTX_CODE_SIZE (code);
-#endif
+ if (GATHER_STATISTICS)
+ {
+ rtx_alloc_counts[code]++;
+ rtx_alloc_sizes[code] += RTX_CODE_SIZE (code);
+ }
return rt;
}
@@ -706,10 +706,16 @@ iterative_hash_rtx (const_rtx x, hashval_t hash)
void
dump_rtx_statistics (void)
{
-#ifdef GATHER_STATISTICS
int i;
int total_counts = 0;
int total_sizes = 0;
+
+ if (! GATHER_STATISTICS)
+ {
+ fprintf (stderr, "No RTX statistics\n");
+ return;
+ }
+
fprintf (stderr, "\nRTX Kind Count Bytes\n");
fprintf (stderr, "---------------------------------------\n");
for (i = 0; i < LAST_AND_UNUSED_RTX_CODE; i++)
@@ -731,7 +737,6 @@ dump_rtx_statistics (void)
fprintf (stderr, "%-20s %7d %10d\n",
"Total", total_counts, total_sizes);
fprintf (stderr, "---------------------------------------\n");
-#endif
}
#if defined ENABLE_RTL_CHECKING && (GCC_VERSION >= 2007)
OpenPOWER on IntegriCloud