[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
strict aliasing issue in action
- To: petsc-dev@xxxxxxxxxxx
- Subject: strict aliasing issue in action
- From: "Lisandro Dalcin" <dalcinl@xxxxxxxxx>
- Date: Mon, 1 Oct 2007 11:54:11 -0300
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=kaPv/gCmXi8QfDnsz9MEB9W/+5bNTA4NnXko7IDifIE=; b=aVSOWDG+Olx8uoIHs6ggeuEwdjlG6sq6abaWSZ1yZc55Q+QzE3d4ydD9NXMOZy2QdDnlrwNgTgLfD3nTEqPVOvmTaGci9YlmjFysF1S88EcTk73sk/CVQB1n2FYjmK3A4HAOo3EdXptIOS1DavQxYB8yTLyHvA1MXgmdBJ+30r0=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=IoRy3kh8XFTIRZjTSRQeGNXcJvX6DUECW8B1He12SB7/dB+46TXpRXhfjKm1IYLqoZyVDJbzZXx474uAMehhmYQ90AY6gqDl4uDsXAxggcLzAk7splLE6jjTPIKFjRP83hGUm3/acrIJANLKQ+qp3Ena9Qo2+uXWyM/evBesLMk=
- Reply-to: petsc-dev@xxxxxxxxxxx
- Sender: owner-petsc-dev@xxxxxxxxxxx
Please, try the small example attached. You will see in action the
issues related to strict aliasing with current PETSc state. The
example is perhpas a bit artificial, but you know, bad things can
always happen, and worse if that happens with optimization, as it is
much hard to debug.
- Use a optimized build for $PETSC_ARCH with a recent GCC (I used
4.1.1 in my Fedora 6 box)
- First, build the example disabling strict aliasing. Run it, and you
will get the expected output.
$ make SA_FLAG=-fno-strict-aliasing
$ main
v->refct: 1
- Next, build the example enabling strict aliasing. Run it, and you
will get unexpected output
$ make SA_FLAG=-fstrict-aliasing
$ main
v->refct: 11
I realy thing we have to take this seriously. That the reason I'm
trying to solve this at home. I'm near to finishing it. After that, I
would ask you to create a clone in your server, in order to push it
and you test it.
--
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594