This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Memory corruption due to word sharing
- From: Peter Bergner <bergner at vnet dot ibm dot com>
- To: David Miller <davem at davemloft dot net>
- Cc: matz at suse dot de, jkosina at suse dot cz, torvalds at linux-foundation dot org, walters at verbum dot org, jack at suse dot cz, linux-kernel at vger dot kernel dot org, linux-ia64 at vger dot kernel dot org, dsterba at suse dot cz, ptesarik at suse dot cz, rguenther at suse dot de, gcc at gcc dot gnu dot org
- Date: Wed, 01 Feb 2012 13:04:01 -0600
- Subject: Re: Memory corruption due to word sharing
- References: <CA+55aFxmdskUXX1iBaPx7rUGD95UqNJxhe1BLeVtZjqHjBpsPA@mail.gmail.com> <alpine.LRH.2.00.1202011808240.22725@twin.jikos.cz> <Pine.LNX.4.64.1202011818570.25409@wotan.suse.de> <20120201.130905.1131458895704793597.davem@davemloft.net>
On Wed, 2012-02-01 at 13:09 -0500, David Miller wrote:
> From: Michael Matz <matz@suse.de>
> Date: Wed, 1 Feb 2012 18:41:05 +0100 (CET)
>
> > One problem is that it's not a new problem, GCC emitted similar code since
> > about forever, and still they turned up only now (well, probably because
> > ia64 is dead, but sparc64 should have similar problems).
>
> Indeed, on sparc64 it does do the silly 64-bit access too:
>
> wrong:
> ldx [%o0+8], %g2
> sethi %hi(2147483648), %g1
> or %g2, %g1, %g1
> jmp %o7+8
> stx %g1, [%o0+8]
Ditto for powerpc64-linux:
ld 9,8(3)
li 10,1
rldimi 9,10,31,32
std 9,8(3)
blr
Peter