+2019-11-18 Martin Liska <mliska@suse.cz>
+
+ * dbgcnt.c (dbg_cnt_set_limit_by_name): Provide error
+ message for an unknown counter.
+ (dbg_cnt_process_single_pair): Support 0 as minimum value.
+ (dbg_cnt_process_opt): Remove unreachable code.
+
2019-11-18 Martin Liska <mliska@suse.cz>
PR ipa/92529
break;
if (i < 0)
- return false;
+ {
+ error ("cannot find a valid counter name %qs of %<-fdbg-cnt=%> option",
+ name);
+ return false;
+ }
return dbg_cnt_set_limit_by_index ((enum debug_counter) i, name, low, high);
}
if (value2 == NULL)
{
- low = 1;
high = strtol (value1, NULL, 10);
+ /* Let's allow 0:0. */
+ low = high == 0 ? 0 : 1;
}
else
{
}
start += strlen (tokens[i]) + 1;
}
-
- if (i != tokens.length ())
- {
- char *buffer = XALLOCAVEC (char, start + 2);
- sprintf (buffer, "%*c", start + 1, '^');
- error ("cannot find a valid counter:value pair:");
- error ("%<-fdbg-cnt=%s%>", arg);
- error (" %s", buffer);
- }
}
/* Print name, limit and count of all counters. */