This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] PR64703, glibc sysdeps/powerpc/powerpc64/dl-machine.h miscompile
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 30 Jan 2015 10:33:06 +0100
- Subject: Re: [RFC] PR64703, glibc sysdeps/powerpc/powerpc64/dl-machine.h miscompile
- Authentication-results: sourceware.org; auth=none
- References: <20150123232339 dot GS12931 at bubble dot grove dot modra dot org> <CAFiYyc1YFTYb3uEE10pU03=hycOALXiyPJeNPOA6OqKOE2Cf-g at mail dot gmail dot com> <20150127123323 dot GU12931 at bubble dot grove dot modra dot org> <20150129141437 dot GA14796 at bubble dot grove dot modra dot org> <CAFiYyc0QHSetUYiNDsv8WR-rcYjst7d98jCN_pHtTGFds1fwZQ at mail dot gmail dot com> <CAFiYyc1meNf4q=geOxeBqS0c6v1jT2t5-rNG-dE5Lu+Dmasa4A at mail dot gmail dot com> <CAFiYyc2uFxKyToseh2kFE50QqRFQgMVtgLrR3-TJVym3T0Jhxg at mail dot gmail dot com> <20150130024951 dot GD14796 at bubble dot grove dot modra dot org> <20150130051236 dot GE14796 at bubble dot grove dot modra dot org> <CAFiYyc2kntyTWr9YmtGmucPRkuFg9BoS6fPo36kZb17o8gX_6A at mail dot gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Jan 30, 2015 at 10:12:35AM +0100, Richard Biener wrote:
> Ok - without digging into why the above would fail with your patch
> (don't see that - the use in the function call can't be &opdd) - let's
> take a step back and decide whether we want to allow user-created
> function descriptors. And if we do that if we should rather expose
> this in a more sensible way to GCC, like with using a (target) builtin.
> Say, force you to do
>
> int (*f) (int) = __builtin_fdesc (opd.fd_func, opd.fd_toc, opd.fd_aux);
> return f (3);
>
> which would allow GCC to even optimize the call to a direct one
> if it (or the target) can fold reads from the __builtin_fdesc argument
> to a function decl. Similar builtins could allow you to inspect
> a function descriptor. That way the actual memory operations
> would be hidden from the middle-end.
That would be my preference too. Constructing the calls this way is so rare
that pessimizing 99.9% of code out there that doesn't ever need this is
IMHO undesirable.
Jakub
- References:
- [RFC] PR64703, glibc sysdeps/powerpc/powerpc64/dl-machine.h miscompile
- Re: [RFC] PR64703, glibc sysdeps/powerpc/powerpc64/dl-machine.h miscompile
- Re: [RFC] PR64703, glibc sysdeps/powerpc/powerpc64/dl-machine.h miscompile
- Re: [RFC] PR64703, glibc sysdeps/powerpc/powerpc64/dl-machine.h miscompile
- Re: [RFC] PR64703, glibc sysdeps/powerpc/powerpc64/dl-machine.h miscompile
- Re: [RFC] PR64703, glibc sysdeps/powerpc/powerpc64/dl-machine.h miscompile
- Re: [RFC] PR64703, glibc sysdeps/powerpc/powerpc64/dl-machine.h miscompile
- Re: [RFC] PR64703, glibc sysdeps/powerpc/powerpc64/dl-machine.h miscompile
- Re: [RFC] PR64703, glibc sysdeps/powerpc/powerpc64/dl-machine.h miscompile
- Re: [RFC] PR64703, glibc sysdeps/powerpc/powerpc64/dl-machine.h miscompile