aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcov.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2011-11-26 21:44:24 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2011-11-26 21:44:24 +0000
commit84ec53b6ac3b2f94a3d5fa9ecbd0cb3f66fd9d69 (patch)
treede59294aa4f30eaaa5e5fa683d4826bdce1a5f00 /gcc/gcov.c
parent7546aa9db2c3002376076fc37b02678f42cdfbc7 (diff)
downloadgcc-84ec53b6ac3b2f94a3d5fa9ecbd0cb3f66fd9d69.zip
gcc-84ec53b6ac3b2f94a3d5fa9ecbd0cb3f66fd9d69.tar.gz
gcc-84ec53b6ac3b2f94a3d5fa9ecbd0cb3f66fd9d69.tar.bz2
re PR gcov-profile/51297 (Many gcov tests FAIL on Tru64, Solaris 8 and 9)
PR gcov-profile/51297 * gcov.c (main): Allocate initial names and sources arrays. (find_source): Don't check for null name or source arrays here. From-SVN: r181745
Diffstat (limited to 'gcc/gcov.c')
-rw-r--r--gcc/gcov.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/gcov.c b/gcc/gcov.c
index c5cc0ef..29907a3 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -406,6 +406,11 @@ main (int argc, char **argv)
/* Handle response files. */
expandargv (&argc, &argv);
+ a_names = 10;
+ names = XNEWVEC (name_map_t, a_names);
+ a_sources = 10;
+ sources = XNEWVEC (source_t, a_sources);
+
argno = process_args (argc, argv);
if (optind == argc)
print_usage (true);
@@ -874,8 +879,6 @@ find_source (const char *file_name)
{
/* Extend the name map array -- we'll be inserting one or two
entries. */
- if (!a_names)
- a_names = 10;
a_names *= 2;
name_map = XNEWVEC (name_map_t, a_names);
memcpy (name_map, names, n_names * sizeof (*names));
@@ -894,8 +897,6 @@ find_source (const char *file_name)
if (n_sources == a_sources)
{
- if (!a_sources)
- a_sources = 10;
a_sources *= 2;
src = XNEWVEC (source_t, a_sources);
memcpy (src, sources, n_sources * sizeof (*sources));