Commit dd7fa0d4 by Martin Liska Committed by Martin Liska

Dump -fdbg-cnt limit reach also to stderr stream.

2019-03-29  Martin Liska  <mliska@suse.cz>

	* dbgcnt.c (print_limit_reach): New function.
	(dbg_cnt): Use it.
2019-03-29  Martin Liska  <mliska@suse.cz>

	* gcc.dg/ipa/ipa-icf-39.c: Prine '***dbgcnt' output.
	* gcc.dg/pr68766.c: Likewise.

From-SVN: r270015
parent 2a7108b9
2019-03-29 Martin Liska <mliska@suse.cz>
* dbgcnt.c (print_limit_reach): New function.
(dbg_cnt): Use it.
2019-03-29 Martin Liska <mliska@suse.cz>
* dbgcnt.c (dbg_cnt_process_single_pair): Fix GNU coding style.
(dbg_cnt_process_opt): Parse first tokens aas
dbg_cnt_process_single_pair is also using strtok.
......
......@@ -58,21 +58,27 @@ dbg_cnt_is_enabled (enum debug_counter index)
return v > limit_low[index] && v <= limit_high[index];
}
static void
print_limit_reach (const char *counter, int limit, bool upper_p)
{
char buffer[128];
sprintf (buffer, "***dbgcnt: %s limit %d reached for %s.***\n",
upper_p ? "upper" : "lower", limit, counter);
fputs (buffer, stderr);
if (dump_file)
fputs (buffer, dump_file);
}
bool
dbg_cnt (enum debug_counter index)
{
count[index]++;
if (dump_file)
{
/* Do not print the info for default lower limit. */
if (count[index] == limit_low[index] && limit_low[index] > 0)
fprintf (dump_file, "***dbgcnt: lower limit %d reached for %s.***\n",
limit_low[index], map[index].name);
else if (count[index] == limit_high[index])
fprintf (dump_file, "***dbgcnt: upper limit %d reached for %s.***\n",
limit_high[index], map[index].name);
}
/* Do not print the info for default lower limit. */
if (count[index] == limit_low[index] && limit_low[index] > 0)
print_limit_reach (map[index].name, limit_low[index], false);
else if (count[index] == limit_high[index])
print_limit_reach (map[index].name, limit_high[index], true);
return dbg_cnt_is_enabled (index);
}
......
2019-03-29 Martin Liska <mliska@suse.cz>
* gcc.dg/ipa/ipa-icf-39.c: Prine '***dbgcnt' output.
* gcc.dg/pr68766.c: Likewise.
2019-03-29 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/87485
......
......@@ -2,6 +2,7 @@
/* { dg-require-alias "" } */
/* { dg-options "-O2 -fdump-ipa-icf -fmerge-all-constants -fdbg-cnt=merged_ipa_icf:1:3" } */
/* { dg-prune-output "dbg_cnt 'merged_ipa_icf' set to 1-3" } */
/* { dg-prune-output "\\*\\*\\*dbgcnt:.*limit.*reached" } */
static int a;
static int b;
......
......@@ -2,6 +2,7 @@
/* { dg-options "-O2 -ftree-vectorize -fdbg-cnt=vect_loop:1" } */
/* { dg-additional-options "-mavx2" { target { i?86-*-* x86_64-*-* } } } */
/* { dg-prune-output "dbg_cnt 'vect_loop' set to 0-1" } */
/* { dg-prune-output "\\*\\*\\*dbgcnt:.*limit.*reached" } */
int a, b, g, h;
int c[58];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment