This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PowerPC/23404] gij trashes args of functions
On Tue, Sep 06, 2005 at 09:47:10AM +0100, Andrew Haley wrote:
> Alan Modra writes:
> > On Mon, Sep 05, 2005 at 02:51:32PM +0100, Andrew Haley wrote:
> > > While we're looking at PowerPC libffi, isn't this
> > >
> > > unsigned *next_arg = stack + 2;
> > >
> > > ...
> > >
> > > *(double *)next_arg = double_tmp;
> > >
> > > an aliasing bug?
> >
> > I don't think so. The memory pointed to by next_arg is not read or
> > written by anything else in the function.
>
> Sure, but there's no need for gcc to generate any code at all for that
> assignment, is there?
I really don't know, I'm no language lawyer. I'd hate to see gcc making
use of such a loophole if there is one..
However, if you are telling me that a compiler is indeed allowed to
elide an assignment like this, then I'll fix ffi.c to use a pointer to a
union.
--
Alan Modra
IBM OzLabs - Linux Technology Centre