This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: gprof on powerpc fails if compiled with older gcc
- To: Brad Parker <brad at parker dot boston dot ma dot us>
- Subject: Re: gprof on powerpc fails if compiled with older gcc
- From: Alan Modra <alan at linuxcare dot com dot au>
- Date: Fri, 31 Mar 2000 13:11:40 +1000 (EST)
- cc: binutils at sourceware dot cygnus dot com, linuxppc-dev at lists dot linuxppc dot org, dan at netx4 dot com, maxwell at parc dot xerox dot com, patrik at ucolick dot org
On Thu, 30 Mar 2000, Brad Parker wrote:
> in malloc. Turns out the real crash is caused by a bug in gcc which
> messes up a structure copy if the lvalue is a post incremented pointer...
Thanks for the report. I checked in your workaround since it is simple
and it's good practice anyway to only use {post,pre}{increment,decrement}
dereferenced pointers when both sides of an assignment have the same
post/pre operator. Putting the dst++ on a separate line makes it more
obvious when skimming through code that there's no corresponding src++.
<
--- gprof/symtab.c~ Wed Jul 7 23:02:44 1999
+++ gprof/symtab.c Fri Mar 31 12:40:32 2000
@@ -132,7 +132,8 @@
/* retain sym only if it has a non-empty address range: */
if (!src->end_addr || src->addr <= src->end_addr)
{
- *dst++ = *src;
+ *dst = *src;
+ dst++;
prev_addr = src->addr;
}
}
--
Linuxcare. Support for the Revolution.