Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Mar 2004 01:28:48 +0200
From:      Ruslan Ermilov <ru@freebsd.org>
To:        Dag-Erling Sm?rgrav <des@des.no>
Cc:        net@freebsd.org
Subject:   Re: libalias patch for review / testing
Message-ID:  <20040316232848.GR3462@ip.net.ua>
In-Reply-To: <xzpllm0ie5z.fsf@dwp.des.no>
References:  <xzp7jxkjv98.fsf@dwp.des.no> <xzp3c88jv7k.fsf@dwp.des.no> <20040316225230.GO3462@ip.net.ua> <xzpllm0ie5z.fsf@dwp.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help

--soWJpSPh+l8Y6Fy7
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Mar 17, 2004 at 12:07:52AM +0100, Dag-Erling Sm?rgrav wrote:
> Ruslan Ermilov <ru@FreeBSD.org> writes:
> > I know this code quite well.  Where do you suspect could be a bug
> > affecting -O2 compiles, or you just simply fixed -O2 and hope it
> > will auto-fix the (possible) bugs in -O2?
>=20
> Since there is no inline asm, the most likely suspect is aliasing,
> which is what my patch tries to address.
>=20
Hmm, read this again:

: `-fstrict-aliasing'
:      Allows the compiler to assume the strictest aliasing rules
:      applicable to the language being compiled.  For C (and C++), this
:      activates optimizations based on the type of expressions.  In
:      particular, an object of one type is assumed never to reside at
:      the same address as an object of a different type, unless the
:      types are almost the same.  For example, an `unsigned int' can
:      alias an `int', but not a `void*' or a `double'.  A character type
:      may alias any other type.

And asking myself a question: should those (void *)'s in your patch
be (char *)'s instead, e.g., in twowords() and DifferentialChecksum(),
or am I misreading the above?

Also, the easiest way to check if strict aliasing is guilty for not
working libalias compiled with -O2, is to compile the original code
with -O2 -fno-strict-aliasing.  You guys who have seen a problem,
can you please check and confirm that?


Cheers,
--=20
Ruslan Ermilov
FreeBSD committer
ru@FreeBSD.org

--soWJpSPh+l8Y6Fy7
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFAV42wUkv4P6juNwoRAjfoAKCFmQfpsRXd7YlDm94ly3fatLaGgQCfb0kR
H9QhpVVaijqCfWVt877nLd8=
=UvNf
-----END PGP SIGNATURE-----

--soWJpSPh+l8Y6Fy7--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040316232848.GR3462>