aboutsummaryrefslogtreecommitdiff
path: root/gprof
diff options
context:
space:
mode:
Diffstat (limited to 'gprof')
-rw-r--r--gprof/cg_arcs.c14
-rw-r--r--gprof/testsuite/Makefile.am10
-rw-r--r--gprof/testsuite/Makefile.in12
3 files changed, 12 insertions, 24 deletions
diff --git a/gprof/cg_arcs.c b/gprof/cg_arcs.c
index a19686b..9085be0 100644
--- a/gprof/cg_arcs.c
+++ b/gprof/cg_arcs.c
@@ -89,7 +89,7 @@ void
arc_add (Sym *parent, Sym *child, unsigned long count)
{
static unsigned int maxarcs = 0;
- Arc *arc, **newarcs;
+ Arc *arc;
DBG (TALLYDEBUG, printf ("[arc_add] %lu arcs from %s to %s\n",
count, parent->name, child->name));
@@ -124,17 +124,7 @@ arc_add (Sym *parent, Sym *child, unsigned long count)
maxarcs = 1;
maxarcs *= 2;
- /* Allocate the new array. */
- newarcs = (Arc **)xmalloc(sizeof (Arc *) * maxarcs);
-
- /* Copy the old array's contents into the new array. */
- memcpy (newarcs, arcs, numarcs * sizeof (Arc *));
-
- /* Free up the old array. */
- free (arcs);
-
- /* And make the new array be the current array. */
- arcs = newarcs;
+ arcs = xrealloc (arcs, sizeof (*arcs) * maxarcs);
}
/* Place this arc in the arc array. */
diff --git a/gprof/testsuite/Makefile.am b/gprof/testsuite/Makefile.am
index c4d6c41..0c80b12 100644
--- a/gprof/testsuite/Makefile.am
+++ b/gprof/testsuite/Makefile.am
@@ -6,12 +6,12 @@ GPROF = ../gprof$(EXEEXT)
# NB: -O2 -fno-omit-frame-pointer is needed for expected call graph. See
# https://sourceware.org/bugzilla/show_bug.cgi?id=32768
-GPROF_FLAGS = -O2 -fno-omit-frame-pointer -pg
+# -g is needed for line number info checked by tst-gmon-gprof-l.sh. See
+# https://sourceware.org/bugzilla/show_bug.cgi?id=32779
+GPROF_FLAGS = -O2 -fno-omit-frame-pointer -pg -g
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(GPROF_FLAGS)
-LINK = $(CC) $(AM_CFLAGS) $(CFLAGS) $(OPT_NO_PLUGINS) $(GPROF_FLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
+COMPILE = $(CC) $(AM_CFLAGS) $(GPROF_FLAGS)
+LINK = $(CC) $(AM_CFLAGS) $(GPROF_FLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
# We will add to these later, for each individual test. Note
# that we add each test under check_SCRIPTS;
diff --git a/gprof/testsuite/Makefile.in b/gprof/testsuite/Makefile.in
index 008f6be..2ac5f24 100644
--- a/gprof/testsuite/Makefile.in
+++ b/gprof/testsuite/Makefile.in
@@ -496,13 +496,11 @@ GPROF = ../gprof$(EXEEXT)
# NB: -O2 -fno-omit-frame-pointer is needed for expected call graph. See
# https://sourceware.org/bugzilla/show_bug.cgi?id=32768
-GPROF_FLAGS = -O2 -fno-omit-frame-pointer -pg
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(GPROF_FLAGS)
-
-LINK = $(CC) $(AM_CFLAGS) $(CFLAGS) $(OPT_NO_PLUGINS) $(GPROF_FLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-
+# -g is needed for line number info checked by tst-gmon-gprof-l.sh. See
+# https://sourceware.org/bugzilla/show_bug.cgi?id=32779
+GPROF_FLAGS = -O2 -fno-omit-frame-pointer -pg -g
+COMPILE = $(CC) $(AM_CFLAGS) $(GPROF_FLAGS)
+LINK = $(CC) $(AM_CFLAGS) $(GPROF_FLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
# We will add to these later, for each individual test. Note
# that we add each test under check_SCRIPTS;