Commit 2b557972 by Jan Hubicka Committed by Jan Hubicka

re PR gcov-profile/20815 (-fprofile-use barfs with "coverage mismatch for…

re PR gcov-profile/20815 (-fprofile-use barfs with "coverage mismatch for function '...' while reading counter 'arcs'.")


	PR profile/20815
	* coverage.c (coverage_checksum_string): Fix code to stip random seeds
	from symbol names while computing checkup.

From-SVN: r106283
parent 0432a5de
2005-10-31 Jan Hubicka <jh@suse.cz> 2005-10-31 Jan Hubicka <jh@suse.cz>
PR profile/20815
* coverage.c (coverage_checksum_string): Fix code to stip random seeds
from symbol names while computing checkup.
PR profile/24487 PR profile/24487
* predict.c (predict_loops): Do not estimate more than * predict.c (predict_loops): Do not estimate more than
MAX_PRED_LOOP_ITERATIONS in PRED_LOOP_ITERATIONS heuristic. MAX_PRED_LOOP_ITERATIONS in PRED_LOOP_ITERATIONS heuristic.
......
...@@ -445,36 +445,42 @@ coverage_checksum_string (unsigned chksum, const char *string) ...@@ -445,36 +445,42 @@ coverage_checksum_string (unsigned chksum, const char *string)
as the checksums are used only for sanity checking. */ as the checksums are used only for sanity checking. */
for (i = 0; string[i]; i++) for (i = 0; string[i]; i++)
{ {
int offset = 0;
if (!strncmp (string + i, "_GLOBAL__N_", 11))
offset = 11;
if (!strncmp (string + i, "_GLOBAL__", 9)) if (!strncmp (string + i, "_GLOBAL__", 9))
for (i = i + 9; string[i]; i++) offset = 9;
if (string[i]=='_')
{ /* C++ namespaces do have scheme:
int y; _GLOBAL__N_<filename>_<wrongmagicnumber>_<magicnumber>functionname
unsigned seed; since filename might contain extra underscores there seems
int scan; to be no better chance then walk all possible offsets looking
for magicnuber. */
for (y = 1; y < 9; y++) if (offset)
if (!(string[i + y] >= '0' && string[i + y] <= '9') for (;string[offset]; offset++)
&& !(string[i + y] >= 'A' && string[i + y] <= 'F')) for (i = i + offset; string[i]; i++)
break; if (string[i]=='_')
if (y != 9 || string[i + 9] != '_') {
continue; int y;
for (y = 10; y < 18; y++)
if (!(string[i + y] >= '0' && string[i + y] <= '9') for (y = 1; y < 9; y++)
&& !(string[i + y] >= 'A' && string[i + y] <= 'F')) if (!(string[i + y] >= '0' && string[i + y] <= '9')
break; && !(string[i + y] >= 'A' && string[i + y] <= 'F'))
if (y != 18) break;
continue; if (y != 9 || string[i + 9] != '_')
scan = sscanf (string + i + 10, "%X", &seed); continue;
gcc_assert (scan); for (y = 10; y < 18; y++)
if (seed != crc32_string (0, flag_random_seed)) if (!(string[i + y] >= '0' && string[i + y] <= '9')
continue; && !(string[i + y] >= 'A' && string[i + y] <= 'F'))
string = dup = xstrdup (string); break;
for (y = 10; y < 18; y++) if (y != 18)
dup[i + y] = '0'; continue;
break; if (!dup)
} string = dup = xstrdup (string);
break; for (y = 10; y < 18; y++)
dup[i + y] = '0';
}
break;
} }
chksum = crc32_string (chksum, string); chksum = crc32_string (chksum, string);
......
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