This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [PATCH] libdw: Don't reassign result pointer in dwarf_peel_type.
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Fri, 18 Sep 2015 09:39:31 +0200
- Subject: Re: [PATCH] libdw: Don't reassign result pointer in dwarf_peel_type.
On Tue, 2015-09-15 at 11:02 +0200, Mark Wielaard wrote:
> GCC6 will warn about the reassignement of the nonnull result pointer.
> The reassignment is indeed a little questionable. The compiler cannot
> see that the pointer will not actually be reassigned since the function
> will just return the same pointer value except when the dwarf_formref_die
> function fails. In which case we don't use the result anymore. So the
> compiler has to pessimistically assume the pointer will need to be
> reloaded in the loop every time. Help the compiler generate slightly
> better code by just checking whether the function fails directly instead
> of reusing the pointer value for this.
I pushed this to master.