public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak-uu@muc.de>
To: bernds@cygnus.co.uk
Cc: gcc@gcc.gnu.org
Subject: Re: type based aliasing again
Date: Thu, 30 Sep 1999 18:02:00 -0000	[thread overview]
Message-ID: <m3btb5zc5b.fsf@fred.muc.de> (raw)
Message-ID: <19990930180200.PSGJCJFW3TzxhNT0B1RyVz07EMvWRkGa3vCN7mUW3e4@z> (raw)
In-Reply-To: <Pine.LNX.4.10.9909141328450.20868-100000@biriani.cygnus.co.uk>

bernds@cygnus.co.uk (Bernd Schmidt) writes:

> > BTW, it seems to me that this `cast to union' is something particular
> > to gcc, not a general solution, right?  I mean, other compilers might
> > not pay as much attention to the unions as gcc does, since accessing
> > any type other than the one that was actually stored in the union is
> > undefined behavior anyway.
> 
> If, by "cast to union", you mean code of the form
> 
>    union foo
>    {
>       double a;
>       int b[2];
>    };
>    double x;
>    x = 2.0;
>    ((union foo *)&x)->b[1] = 0;
> 
> then this is not even going to work with gcc, regardless of whether
> -fstrict-aliasing is on or not.  We found code like this in some math
> library code here at Cygnus a few weeks ago.  The problem is that gcc's
> MEM_IN_STRUCT/MEM_SCALAR_P alias analysis will catch cases like this and
> determine that the integer memory access can't alias the variable x.

Sigh. I fixed the TCP code in the Linux kernel to (mostly) do that. It
is also compiled with -fno-strict-aliasing. If I understood you and
Jonathan right it may be misoptimized even in with that option, because it 
is not dependent on the type based analysis.

Any chance to fix that problem, or at least offer a flag to turn that
additional alias checking off?

-Andi

-- 
This is like TV. I don't like TV.

  parent reply	other threads:[~1999-09-30 18:02 UTC|newest]

Thread overview: 408+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-08 19:13 Mike Stump
1999-09-08 19:31 ` Joe Buck
1999-09-30 18:02   ` Joe Buck
1999-09-09  7:12 ` Marc Espie
1999-09-09 20:35   ` Jeffrey A Law
1999-09-10 12:29     ` Sudish Joseph
1999-09-30 18:02       ` Sudish Joseph
1999-09-30 18:02     ` Jeffrey A Law
1999-09-30 18:02   ` Marc Espie
1999-09-09 23:25 ` Richard Stallman
1999-09-08 18:11   ` Joe Buck
1999-09-08 18:43     ` Mark Mitchell
1999-09-08 19:25       ` Joe Buck
1999-09-08 19:51         ` David Edelsohn
1999-09-30 18:02           ` David Edelsohn
1999-09-30 18:02         ` Joe Buck
1999-09-08 19:44       ` Joe Buck
1999-09-08 20:26         ` Mark Mitchell
1999-09-08 20:43           ` Joe Buck
1999-09-08 21:45             ` Mark Mitchell
1999-09-08 22:04               ` Joe Buck
1999-09-08 22:25                 ` Mark Mitchell
1999-09-30 18:02                   ` Mark Mitchell
1999-09-09  2:08                 ` Jeffrey A Law
1999-09-09 10:51                   ` Joe Buck
1999-09-09 16:51                     ` John Vickers
1999-09-09 17:04                       ` Joe Buck
1999-09-09 17:12                         ` John Vickers
1999-09-30 18:02                           ` John Vickers
1999-09-30 18:02                         ` Joe Buck
1999-09-30 18:02                       ` John Vickers
1999-09-15  2:07                     ` Jeffrey A Law
1999-09-30 18:02                       ` Jeffrey A Law
1999-09-30 18:02                     ` Joe Buck
1999-09-09 23:26                   ` Richard Stallman
1999-09-30 18:02                     ` Richard Stallman
1999-09-09 23:26                   ` Richard Stallman
1999-09-09 23:38                     ` Jeffrey A Law
1999-09-30 18:02                       ` Jeffrey A Law
1999-09-30 18:02                     ` Richard Stallman
1999-09-30 18:02                   ` Jeffrey A Law
1999-09-09 23:25                 ` Richard Stallman
1999-09-10  0:06                   ` Mark Mitchell
1999-09-10  0:13                     ` Joe Buck
1999-09-30 18:02                       ` Joe Buck
1999-09-11  0:17                     ` Richard Stallman
1999-09-30 18:02                       ` Richard Stallman
1999-09-30 18:02                     ` Mark Mitchell
1999-09-30 18:02                   ` Richard Stallman
1999-09-30 18:02                 ` Joe Buck
1999-09-08 23:20               ` Richard Henderson
1999-09-08 23:41                 ` Mark Mitchell
1999-09-08 23:44                   ` Richard Henderson
1999-09-08 23:51                     ` Mark Mitchell
1999-09-30 18:02                       ` Mark Mitchell
1999-09-09  2:45                     ` Jeffrey A Law
1999-09-30 18:02                       ` Jeffrey A Law
1999-09-30 18:02                     ` Richard Henderson
1999-09-30 18:02                   ` Mark Mitchell
1999-09-30 18:02                 ` Richard Henderson
1999-09-30 18:02               ` Mark Mitchell
1999-09-30 18:02             ` Joe Buck
1999-09-08 21:33           ` Joe Buck
1999-09-08 21:56             ` Mark Mitchell
1999-09-30 18:02               ` Mark Mitchell
1999-09-09  1:38             ` Martin v. Loewis
1999-09-30 18:02               ` Martin v. Loewis
1999-09-09 23:25             ` Richard Stallman
1999-09-30 18:02               ` Richard Stallman
1999-09-30 18:02             ` Joe Buck
1999-09-09  2:20           ` Jeffrey A Law
1999-09-09  7:58             ` craig
1999-09-09 10:36               ` Joe Buck
1999-09-09 10:55                 ` Mark Mitchell
1999-09-11  0:15                   ` Richard Stallman
1999-09-30 18:02                     ` Richard Stallman
1999-09-30 18:02                   ` Mark Mitchell
1999-09-09 11:51                 ` craig
1999-09-09 12:45                   ` Joe Buck
1999-09-30 18:02                     ` Joe Buck
1999-09-30 18:02                   ` craig
1999-09-30 18:02                 ` Joe Buck
1999-09-30 18:02               ` craig
1999-09-30 18:02             ` Jeffrey A Law
1999-09-09 23:26           ` Richard Stallman
1999-09-30 18:02             ` Richard Stallman
1999-09-30 18:02           ` Mark Mitchell
1999-09-30 18:02         ` Joe Buck
1999-09-09 23:25       ` Richard Stallman
1999-09-10  0:03         ` Mark Mitchell
1999-09-10  0:23           ` Joe Buck
1999-09-11  0:17             ` Richard Stallman
1999-09-30 18:02               ` Richard Stallman
1999-09-30 18:02             ` Joe Buck
1999-09-11  0:17           ` Richard Stallman
1999-09-30 18:02             ` Richard Stallman
1999-09-30 18:02           ` Mark Mitchell
1999-09-10 14:29         ` Marc Lehmann
1999-09-30 18:02           ` Marc Lehmann
1999-09-15  2:05         ` Jeffrey A Law
1999-09-15  7:55           ` Nick Ing-Simmons
1999-09-30 18:02             ` Nick Ing-Simmons
1999-09-15 23:14           ` Richard Stallman
1999-09-30 18:02             ` Richard Stallman
1999-09-30 18:02           ` Jeffrey A Law
1999-09-30 18:02         ` Richard Stallman
1999-09-30 18:02       ` Mark Mitchell
1999-09-08 20:44     ` Joe Buck
1999-09-30 18:02       ` Joe Buck
1999-09-14  3:04     ` Alexandre Oliva
1999-09-14  5:34       ` Bernd Schmidt
1999-09-14  5:45         ` Alexandre Oliva
1999-09-14  5:52           ` Bernd Schmidt
1999-09-30 18:02             ` Bernd Schmidt
1999-09-21  1:16           ` Rask Ingemann Lambertsen
1999-09-21  2:02             ` Jamie Lokier
1999-09-30 18:02               ` Jamie Lokier
1999-09-30 18:02             ` Rask Ingemann Lambertsen
1999-09-30 18:02           ` Alexandre Oliva
1999-09-14  9:31         ` Andi Kleen [this message]
1999-09-30 18:02           ` Andi Kleen
1999-09-30 18:02         ` Bernd Schmidt
1999-09-14 22:22       ` Richard Stallman
1999-09-30 18:02         ` Richard Stallman
1999-09-30 18:02       ` Alexandre Oliva
1999-09-30 18:02     ` Joe Buck
1999-09-10  0:11   ` Joe Buck
1999-09-10  8:43     ` craig
1999-09-10 18:25       ` Jonathan Larmour
1999-09-11  3:50         ` craig
1999-09-30 18:02           ` craig
1999-09-30 18:02         ` Jonathan Larmour
1999-09-11  0:15       ` Richard Stallman
1999-09-11  3:51         ` craig
1999-09-12  0:51           ` Richard Stallman
1999-09-12  8:54             ` craig
1999-09-13  0:47               ` Richard Stallman
1999-09-30 18:02                 ` Richard Stallman
1999-09-30 18:02               ` craig
1999-09-30 18:02             ` Richard Stallman
1999-09-30 18:02           ` craig
1999-09-30 18:02         ` Richard Stallman
1999-09-30 18:02       ` craig
1999-09-11  0:14     ` Richard Stallman
1999-09-11 15:20       ` Mark Mitchell
1999-09-11 18:04         ` David Edelsohn
1999-09-11 18:20           ` Mark Mitchell
1999-09-11 23:40             ` Sudish Joseph
1999-09-30 18:02               ` Sudish Joseph
1999-09-12  8:16             ` Robert Lipe
1999-09-30 18:02               ` Robert Lipe
1999-09-30 18:02             ` Mark Mitchell
1999-09-13  0:47           ` Richard Stallman
1999-09-15  2:06             ` Jeffrey A Law
1999-09-15  8:02               ` Nick Ing-Simmons
1999-09-15  9:20                 ` Jeffrey A Law
1999-09-15  9:31                   ` David Edelsohn
1999-09-15 10:02                     ` craig
1999-09-16 23:13                       ` Richard Stallman
1999-09-17  1:51                         ` craig
1999-09-17 22:16                           ` Richard Stallman
1999-09-30 18:02                             ` Richard Stallman
1999-09-30 18:02                           ` craig
1999-09-30 18:02                         ` Richard Stallman
1999-09-30 18:02                       ` craig
1999-09-30 18:02                     ` David Edelsohn
1999-09-15  9:56                   ` Nick Ing-Simmons
1999-09-15 10:08                     ` craig
1999-09-15 10:48                       ` Nick Ing-Simmons
1999-09-15 14:32                         ` craig
1999-09-30 18:02                           ` craig
1999-09-30 18:02                         ` Nick Ing-Simmons
1999-09-16 10:54                       ` Andi Kleen
1999-09-16 12:08                         ` Joern Rennecke
1999-09-16 12:18                           ` Mark Mitchell
1999-09-17  7:07                             ` __typealias qualifier (was Re: type based aliasing again) patl
1999-09-17  8:32                               ` Mark Mitchell
1999-09-30 18:02                                 ` Mark Mitchell
1999-09-30 18:02                               ` Patrick J. LoPresti
1999-09-30 18:02                             ` type based aliasing again Mark Mitchell
1999-09-30 18:02                           ` Joern Rennecke
1999-09-16 14:29                         ` craig
1999-09-16 22:19                           ` Andi Kleen
1999-09-30 18:02                             ` Andi Kleen
1999-09-30 18:02                           ` craig
1999-09-30 18:02                         ` Andi Kleen
1999-09-16 23:13                       ` Richard Stallman
1999-09-30 18:02                         ` Richard Stallman
1999-09-30 18:02                       ` craig
1999-09-30 18:02                     ` Nick Ing-Simmons
1999-09-30 18:02                   ` Jeffrey A Law
1999-09-30 18:02                 ` Nick Ing-Simmons
1999-09-15 23:14               ` Richard Stallman
1999-09-30 18:02                 ` Richard Stallman
1999-09-30 18:02               ` Jeffrey A Law
1999-09-30 18:02             ` Richard Stallman
1999-09-30 18:02           ` David Edelsohn
1999-09-12  9:45         ` Jonathan Larmour
1999-09-30 18:02           ` Jonathan Larmour
1999-09-13  0:47         ` Richard Stallman
1999-09-30 18:02           ` Richard Stallman
1999-09-13  4:05         ` Richard Earnshaw
1999-09-15  2:05           ` Jeffrey A Law
1999-09-30 18:02             ` Jeffrey A Law
1999-09-30 18:02           ` Richard Earnshaw
1999-09-30 18:02         ` Mark Mitchell
1999-09-30 18:02       ` Richard Stallman
1999-09-30 18:02     ` Joe Buck
1999-09-30 18:02   ` Richard Stallman
1999-09-30 18:02 ` Mike Stump
1999-09-09 14:26 Mike Stump
1999-09-09 14:38 ` Mark Mitchell
1999-09-11  0:16   ` Richard Stallman
1999-09-15  2:07     ` Jeffrey A Law
1999-09-30 18:02       ` Jeffrey A Law
1999-09-30 18:02     ` Richard Stallman
1999-09-30 18:02   ` Mark Mitchell
1999-09-30 18:02 ` Mike Stump
1999-09-09 15:40 Claus Fischer
1999-09-09 15:57 ` David Starner
1999-09-09 16:24   ` Claus Fischer
1999-09-09 16:55     ` Joe Buck
1999-09-09 17:31       ` Claus Fischer
1999-09-30 18:02         ` Claus Fischer
1999-09-30 18:02       ` Joe Buck
1999-09-10  8:42     ` craig
1999-09-30 18:02       ` craig
1999-09-30 18:02     ` Claus Fischer
1999-09-30 18:02   ` David Starner
1999-09-09 16:37 ` Jeffrey A Law
1999-09-09 17:15   ` Claus Fischer
1999-09-30 18:02     ` Claus Fischer
1999-09-30 18:02   ` Jeffrey A Law
1999-09-30 18:02 ` Claus Fischer
1999-09-09 21:54 Alex Rosenberg
1999-09-30 18:02 ` Alex Rosenberg
1999-09-10  8:43 craig
1999-09-12  0:49 ` Richard Stallman
1999-09-30 18:02   ` Richard Stallman
1999-09-30 18:02 ` craig
1999-09-11 18:21 Phil Edwards
1999-09-30 18:02 ` Phil Edwards
1999-09-11 21:48 N8TM
1999-09-30 18:02 ` N8TM
     [not found] <9377.936981585@upchuck.cygnus.com>
1999-09-12  0:52 ` Richard Stallman
1999-09-30 18:02   ` Richard Stallman
1999-09-12 11:20 Josh Stern
1999-09-30 18:02 ` Josh Stern
1999-09-13 10:55 R. Kelley Cook
1999-09-13 13:22 ` craig
1999-09-30 18:02   ` craig
1999-09-30 18:02 ` R. Kelley Cook
1999-09-13 16:34 Mike Stump
1999-09-14 22:20 ` Richard Stallman
1999-09-30 18:02   ` Richard Stallman
1999-09-30 18:02 ` Mike Stump
1999-09-13 21:45 N8TM
1999-09-14  4:01 ` Marc Espie
1999-09-14  9:56   ` David Edelsohn
1999-09-14 10:10     ` Richard Earnshaw
1999-09-14 10:31       ` Nick Ing-Simmons
1999-09-14 10:52         ` David Edelsohn
1999-09-14 11:11           ` craig
1999-09-14 14:44             ` David Edelsohn
1999-09-30 18:02               ` David Edelsohn
1999-09-14 15:06             ` David Edelsohn
1999-09-14 17:35               ` Marc Lehmann
1999-09-30 18:02                 ` Marc Lehmann
1999-09-14 23:41               ` craig
1999-09-15  8:28                 ` Marc Lehmann
1999-09-30 18:02                   ` Marc Lehmann
1999-09-15  9:19                 ` David Edelsohn
1999-09-15  9:59                   ` Nick Ing-Simmons
1999-09-15 15:33                     ` David Edelsohn
1999-09-30 18:02                       ` David Edelsohn
1999-09-30 18:02                     ` Nick Ing-Simmons
1999-09-15 10:01                   ` craig
1999-09-30 18:02                     ` craig
1999-09-30 18:02                   ` David Edelsohn
1999-09-30 18:02                 ` craig
1999-09-30 18:02               ` David Edelsohn
1999-09-30 18:02             ` craig
1999-09-14 11:58           ` Gerald Pfeifer
1999-09-30 18:02             ` Gerald Pfeifer
1999-09-30 18:02           ` David Edelsohn
1999-09-14 11:01         ` craig
1999-09-14 11:14           ` craig
1999-09-30 18:02             ` craig
1999-09-14 11:39           ` Mark Mitchell
1999-09-14 14:48             ` Toon Moene
1999-09-14 15:00               ` David Edelsohn
1999-09-14 16:01                 ` Toon Moene
1999-09-14 16:15                   ` David Edelsohn
1999-09-14 16:43                     ` Mark Mitchell
1999-09-30 18:02                       ` Mark Mitchell
1999-09-14 17:39                     ` Marc Lehmann
1999-09-30 18:02                       ` Marc Lehmann
1999-09-30 18:02                     ` David Edelsohn
1999-09-14 16:19                   ` dvv
1999-09-14 17:38                     ` Michael Meissner
1999-09-30 18:02                       ` Michael Meissner
1999-09-30 18:02                     ` Dima Volodin
1999-09-30 18:02                   ` Toon Moene
1999-09-30 18:02                 ` David Edelsohn
1999-09-14 15:08               ` Mark Mitchell
1999-09-30 18:02                 ` Mark Mitchell
1999-09-30 18:02               ` Toon Moene
1999-09-30 18:02             ` Mark Mitchell
1999-09-30 18:02           ` craig
1999-09-14 23:46         ` Geoff Keating
1999-09-15  7:47           ` Nick Ing-Simmons
1999-09-30 18:02             ` Nick Ing-Simmons
1999-09-30 18:02           ` Geoff Keating
1999-09-30 18:02         ` Nick Ing-Simmons
1999-09-30 18:02       ` Richard Earnshaw
1999-09-14 17:22     ` Marc Lehmann
1999-09-30 18:02       ` Marc Lehmann
1999-09-30 18:02     ` David Edelsohn
1999-09-14 17:23   ` Marc Lehmann
1999-09-15  1:59     ` Marc Espie
1999-09-15  8:28       ` Marc Lehmann
1999-09-30 18:02         ` Marc Lehmann
1999-09-30 18:02       ` Marc Espie
1999-09-30 18:02     ` Marc Lehmann
1999-09-15  2:01   ` Jeffrey A Law
1999-09-30 18:02     ` Jeffrey A Law
1999-09-30 18:02   ` Marc Espie
1999-09-30 18:02 ` N8TM
1999-09-14  6:46 Marcel Cox
1999-09-14  6:50 ` Bernd Schmidt
1999-09-14  7:14   ` Marcel Cox
1999-09-14  8:45     ` Jamie Lokier
1999-09-30 18:02       ` Jamie Lokier
1999-09-30 18:02     ` Marcel Cox
1999-09-30 18:02   ` Bernd Schmidt
1999-09-30 18:02 ` Marcel Cox
1999-09-15  7:02 David Ronis
1999-09-30 18:02 ` David Ronis
1999-09-15  8:27 Kaveh R. Ghazi
1999-09-15  8:57 ` Nathan Sidwell
1999-09-30 18:02   ` Nathan Sidwell
1999-09-30 18:02 ` Kaveh R. Ghazi
1999-09-15 11:42 Michael J. Bedy
1999-09-15 14:32 ` craig
1999-09-16 23:14   ` Richard Stallman
1999-09-30 18:02     ` Richard Stallman
1999-09-30 18:02   ` craig
1999-09-30 18:02 ` Michael J. Bedy
1999-09-15 21:47 Florin Mateoc
1999-09-16  2:18 ` craig
1999-09-30 18:02   ` craig
1999-09-30 18:02 ` Florin Mateoc
     [not found] <Pine.SO4.4.05.9909160153420.23533-100000@tamarack.cs.mtu.edu>
1999-09-16  2:19 ` craig
1999-09-30 18:02   ` craig
1999-09-16  6:12 Artem Hodyush
1999-09-16 23:15 ` Richard Stallman
1999-09-16 23:38   ` Gabriel Dos_Reis
1999-09-17 22:16     ` Richard Stallman
1999-09-30 18:02       ` Richard Stallman
1999-09-30 18:02     ` Gabriel Dos_Reis
1999-09-30 18:02   ` Richard Stallman
1999-09-30 18:02 ` Artem Hodyush
     [not found] <199909161750.LAA12073@basho.fc.hp.com>
1999-09-16 14:29 ` craig
1999-09-20 15:17   ` John W. Stevens
1999-09-30 18:02     ` John W. Stevens
1999-09-30 18:02   ` craig
1999-09-17  9:02 Harvey J. Stein
1999-09-30 18:02 ` Harvey J. Stein
1999-09-18  2:51 Ross Morgan-Linial
     [not found] ` <19990918151905.F1650@cerebro.laendle>
1999-09-18 22:18   ` Ross Morgan-Linial
1999-09-30 18:02     ` Ross Morgan-Linial
1999-09-30 18:02 ` Ross Morgan-Linial
1999-09-18  3:25 Artem Hodyush
1999-09-18 11:29 ` Russ Allbery
1999-09-20  5:54   ` Joern Rennecke
1999-09-30 18:02     ` Joern Rennecke
1999-09-30 18:02   ` Russ Allbery
1999-09-19 13:54 ` Richard Stallman
1999-09-30 18:02   ` Richard Stallman
1999-09-21  8:50 ` Harvey J. Stein
1999-09-30 18:02   ` Harvey J. Stein
1999-09-30 18:02 ` Artem Hodyush
1999-09-18  7:30 Stephen L Moshier
1999-09-30 18:02 ` Stephen L Moshier
1999-09-18  8:33 N8TM
1999-09-30 18:02 ` N8TM
1999-09-21  8:48 Harvey J. Stein
1999-09-22 12:15 ` Richard Stallman
1999-09-22 13:08   ` Harvey J. Stein
1999-09-24 23:37     ` Richard Stallman
1999-09-30 18:02       ` Richard Stallman
1999-09-30 18:02     ` Harvey J. Stein
1999-09-30 18:02   ` Richard Stallman
1999-09-30 18:02 ` Harvey J. Stein
     [not found] <19990921182843.25292.qmail@deer>
1999-09-21 15:47 ` John W. Stevens
1999-09-21 16:15   ` craig
1999-09-21 20:37     ` David Edelsohn
1999-09-30 18:02       ` David Edelsohn
1999-09-23  9:06     ` John W. Stevens
1999-09-23 11:06       ` craig
1999-09-30 18:02         ` craig
1999-09-30 18:02       ` John W. Stevens
1999-09-30 18:02     ` craig
1999-09-27  6:56   ` Rask Ingemann Lambertsen
1999-09-27  8:32     ` Joe Buck
1999-09-30 18:02       ` Joe Buck
1999-09-30 18:02     ` Rask Ingemann Lambertsen
1999-09-30 18:02   ` John W. Stevens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3btb5zc5b.fsf@fred.muc.de \
    --to=ak-uu@muc.de \
    --cc=bernds@cygnus.co.uk \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).