mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-22 07:49:19 +08:00
re PR gcov-profile/20815 (-fprofile-use barfs with "coverage mismatch for function '...' while reading counter 'arcs'.")
PR profile/20815 PR profile/26399 * coverage.c (coverage_checksum_string): Reorganize loop to not read after buffer. * g++.dg/bprob/g++-bprob-2.C: New testcase. From-SVN: r112738
This commit is contained in:
parent
3425c35fca
commit
1f651229f0
@ -1,3 +1,10 @@
|
||||
2006-04-06 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
PR profile/20815
|
||||
PR profile/26399
|
||||
* coverage.c (coverage_checksum_string): Reorganize loop to not read
|
||||
after buffer.
|
||||
|
||||
2006-04-06 Mike Stump <mrs@apple.com>
|
||||
|
||||
* builtins.c (expand_builtin_longjmp):Use #ifdef instead of #if
|
||||
|
@ -457,30 +457,31 @@ coverage_checksum_string (unsigned chksum, const char *string)
|
||||
to be no better chance then walk all possible offsets looking
|
||||
for magicnuber. */
|
||||
if (offset)
|
||||
for (;string[offset]; offset++)
|
||||
for (i = i + offset; string[i]; i++)
|
||||
if (string[i]=='_')
|
||||
{
|
||||
int y;
|
||||
{
|
||||
for (i = i + offset; string[i]; i++)
|
||||
if (string[i]=='_')
|
||||
{
|
||||
int y;
|
||||
|
||||
for (y = 1; y < 9; y++)
|
||||
if (!(string[i + y] >= '0' && string[i + y] <= '9')
|
||||
&& !(string[i + y] >= 'A' && string[i + y] <= 'F'))
|
||||
break;
|
||||
if (y != 9 || string[i + 9] != '_')
|
||||
continue;
|
||||
for (y = 10; y < 18; y++)
|
||||
if (!(string[i + y] >= '0' && string[i + y] <= '9')
|
||||
&& !(string[i + y] >= 'A' && string[i + y] <= 'F'))
|
||||
break;
|
||||
if (y != 18)
|
||||
continue;
|
||||
if (!dup)
|
||||
string = dup = xstrdup (string);
|
||||
for (y = 10; y < 18; y++)
|
||||
dup[i + y] = '0';
|
||||
}
|
||||
break;
|
||||
for (y = 1; y < 9; y++)
|
||||
if (!(string[i + y] >= '0' && string[i + y] <= '9')
|
||||
&& !(string[i + y] >= 'A' && string[i + y] <= 'F'))
|
||||
break;
|
||||
if (y != 9 || string[i + 9] != '_')
|
||||
continue;
|
||||
for (y = 10; y < 18; y++)
|
||||
if (!(string[i + y] >= '0' && string[i + y] <= '9')
|
||||
&& !(string[i + y] >= 'A' && string[i + y] <= 'F'))
|
||||
break;
|
||||
if (y != 18)
|
||||
continue;
|
||||
if (!dup)
|
||||
string = dup = xstrdup (string);
|
||||
for (y = 10; y < 18; y++)
|
||||
dup[i + y] = '0';
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
chksum = crc32_string (chksum, string);
|
||||
|
@ -1,3 +1,8 @@
|
||||
2006-04-06 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
PR profile/26399
|
||||
* g++.dg/bprob/g++-bprob-2.C: New testcase.
|
||||
|
||||
2006-04-06 Roger Sayle <roger@eyesopen.com>
|
||||
|
||||
* g++.dg/conversion/nullptr1.C: New test case.
|
||||
|
15
gcc/testsuite/g++.dg/bprob/g++-bprob-2.C
Normal file
15
gcc/testsuite/g++.dg/bprob/g++-bprob-2.C
Normal file
@ -0,0 +1,15 @@
|
||||
namespace {
|
||||
|
||||
int calc(int j)
|
||||
{
|
||||
if (j==0) return 0;
|
||||
return calc(j-1)*j % 17;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
return calc(25);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user