public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Linux and aliasing?
@ 1999-06-06 15:08 Ross Harvey
  1999-06-06 15:46 ` Linus Torvalds
                   ` (2 more replies)
  0 siblings, 3 replies; 212+ messages in thread
From: Ross Harvey @ 1999-06-06 15:08 UTC (permalink / raw)
  To: mark, torvalds; +Cc: chip, craig, davem, egcs, rth, tim

> From: Linus Torvalds <torvalds@transmeta.com>
>
> On Sun, 6 Jun 1999 mark@codesourcery.com wrote:
> > 
> > Right.  But the part that's causing aliasing issues is just a memcpy;
> > that's the `*(u32 *) p' bit.   You could write:
> > 
> >   memcpy (&a, p, sizeof (a));
> >   a = ntohl (a);
>
> Which is crap.
>
> And a compiler that requires you to write code like that is, by
> implication..
>:::
> If you can't see why
>
> 	a = ntohl((u32 *) p);
>
> is better than the horrible thing you're suggesting (regardless of whether
> the code generated is the same or not), then I might as well throw in the
> towel immediately. The whole point of my suggestion was to make good code
> generation possible with an interface that you can actually use without
> barfing..
>
> 		Linus

Umm, the ice is getting thin, here. From time to time, I have to change
kernel code FROM things like ``a = ntohl((u32 *) p);'' TO things like
``memcpy (&a, p, sizeof a);  a = ntohl (a);''.

Why? Because it's illegal for a reason, and the alpha platform I support
has alignment requirements for which I have a guarantee that the memcpy
approach will work and be reasonably efficient. The cast can generate a
kernel alignment fault and will either panic or have a hideous run-time
fixup cost.  I know we are talking about aliasing, but in terms of why the
rules are there, I think this is an illuminating example.

LP64 is coming to the PeeCee world, and even if the fixup is in hardware,
you still have a runtime penalty for making addressibility assumptions that
are properly the domain of the compiler.

	Ross.Harvey@Computer.Org

^ permalink raw reply	[flat|nested] 212+ messages in thread
* Re: Linux and aliasing?
@ 1999-06-04 11:54 Mike Stump
  1999-06-04 12:13 ` Jeffrey A Law
  1999-06-30 15:43 ` Mike Stump
  0 siblings, 2 replies; 212+ messages in thread
From: Mike Stump @ 1999-06-04 11:54 UTC (permalink / raw)
  To: jbuck, law; +Cc: chip, craig, davem, egcs, mark, torvalds

> From: Joe Buck <jbuck@Synopsys.COM>
> Date: Fri, 4 Jun 99 10:28:34 PDT

> In that case, then all release announcements and NEWS should prominently
> mention the effect of this new optimization and the -fno-strict-aliasing
> flag, so that everyone has fair warning.

I agree.  I am trying to figure out how to alert my entire company of
this new feature.  I am sure we have old networking code and tons of
programmers that probably aren't used to optimizing compilers.  :-)

I can see them wanting to rip the skin off my body if I tried to
surprise this one on them, then I would have to do all this back
pedaling....

The recent mini-flame war is useful to me,  in that it realerted me of
the `problem' (one of education from my perspective).

^ permalink raw reply	[flat|nested] 212+ messages in thread
* Linux and aliasing?
@ 1999-06-03 10:23 Chip Salzenberg
  1999-06-03 10:37 ` mark
  1999-06-30 15:43 ` Chip Salzenberg
  0 siblings, 2 replies; 212+ messages in thread
From: Chip Salzenberg @ 1999-06-03 10:23 UTC (permalink / raw)
  To: egcs

Linus continues to complain on linux-kernel that egcs lacks a way to
*selectively* turn off the new stronger alias analysis.  Is this not
easy, or is it just not an important issue to the egcs team?
-- 
Chip Salzenberg      - a.k.a. -      <chip@perlsupport.com>
      "When do you work?"   "Whenever I'm not busy."

^ permalink raw reply	[flat|nested] 212+ messages in thread

end of thread, other threads:[~1999-07-31 23:33 UTC | newest]

Thread overview: 212+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-06 15:08 Linux and aliasing? Ross Harvey
1999-06-06 15:46 ` Linus Torvalds
1999-06-30 15:43   ` Linus Torvalds
1999-06-06 17:29 ` David S. Miller
1999-06-30 15:43   ` David S. Miller
1999-06-30 15:43 ` Ross Harvey
  -- strict thread matches above, loose matches on Subject: below --
1999-06-04 11:54 Mike Stump
1999-06-04 12:13 ` Jeffrey A Law
1999-06-04 13:25   ` Sylvain Pion
1999-06-04 13:32     ` Jeffrey A Law
1999-06-30 15:43       ` Jeffrey A Law
1999-06-30 15:43     ` Sylvain Pion
1999-06-30 15:43   ` Jeffrey A Law
1999-06-30 15:43 ` Mike Stump
1999-06-03 10:23 Chip Salzenberg
1999-06-03 10:37 ` mark
1999-06-03 11:26   ` David S. Miller
1999-06-03 12:03     ` mark
1999-06-03 12:25       ` David S. Miller
1999-06-03 20:06         ` craig
1999-06-03 23:03           ` Linus Torvalds
1999-06-03 23:45             ` mark
1999-06-04  0:04               ` Linus Torvalds
1999-06-04  1:08                 ` Branko Cibej
1999-06-30 15:43                   ` Branko Cibej
1999-06-04  1:24                 ` Joe Buck
1999-06-04  1:50                   ` Linus Torvalds
1999-06-04  5:46                     ` craig
1999-06-04  8:35                       ` Linus Torvalds
1999-06-04 10:04                         ` Joe Buck
1999-06-04 10:22                           ` Jeffrey A Law
1999-06-04 10:31                             ` Joe Buck
1999-06-04 10:53                               ` Jeffrey A Law
1999-06-30 15:43                                 ` Jeffrey A Law
1999-06-30 15:43                               ` Joe Buck
1999-07-11 10:55                               ` Jeffrey A Law
1999-07-31 23:33                                 ` Jeffrey A Law
1999-06-04 11:11                             ` Toon Moene
1999-06-04 12:20                               ` Jeffrey A Law
1999-06-05  5:45                                 ` Toon Moene
1999-06-05  6:23                                   ` Andi Kleen
1999-06-05 10:32                                     ` Toon Moene
1999-06-05 13:26                                       ` Jamie Lokier
1999-06-05 19:35                                         ` Linus Torvalds
1999-06-06  1:18                                           ` Martin v. Loewis
1999-06-06 10:46                                             ` Linus Torvalds
1999-06-30 15:43                                               ` Linus Torvalds
1999-06-06 17:56                                             ` Jason Merrill
1999-06-06 19:24                                               ` Tim Hollebeek
1999-06-30 15:43                                                 ` Tim Hollebeek
1999-06-06 22:23                                               ` Jeffrey A Law
1999-06-30 15:43                                                 ` Jeffrey A Law
     [not found]                                               ` <199906070645.IAA00615@mira.isdn.cs.tu-berlin.de>
1999-06-07  2:14                                                 ` Jason Merrill
1999-06-07  8:02                                                   ` mark
1999-06-07  8:41                                                     ` David S. Miller
1999-06-07  9:24                                                       ` Jeffrey A Law
1999-06-07  9:29                                                         ` David S. Miller
1999-06-30 15:43                                                           ` David S. Miller
1999-06-30 15:43                                                         ` Jeffrey A Law
1999-06-07  9:32                                                       ` Joe Buck
1999-06-30 15:43                                                         ` Joe Buck
1999-06-30 15:43                                                       ` David S. Miller
1999-06-30 15:43                                                     ` mark
1999-06-07 13:11                                                   ` Jeffrey A Law
1999-06-30 15:43                                                     ` Jeffrey A Law
1999-06-30 15:43                                                   ` Jason Merrill
1999-06-30 15:43                                               ` Jason Merrill
1999-06-30 15:43                                             ` Martin v. Loewis
1999-06-30 15:43                                           ` Linus Torvalds
1999-06-30 15:43                                         ` Jamie Lokier
1999-06-05 18:48                                       ` Linus Torvalds
1999-06-30 15:43                                         ` Linus Torvalds
1999-06-30 15:43                                       ` Toon Moene
1999-06-05 10:37                                     ` mark
1999-06-05 11:09                                       ` David S. Miller
1999-06-05 12:11                                         ` Toon Moene
1999-06-05 12:21                                           ` David S. Miller
1999-06-05 16:51                                             ` mark
1999-06-30 15:43                                               ` mark
1999-06-30 15:43                                             ` David S. Miller
1999-06-30 15:43                                           ` Toon Moene
1999-06-07  6:01                                         ` Joern Rennecke
1999-06-30 15:43                                           ` Joern Rennecke
1999-06-30 15:43                                         ` David S. Miller
1999-06-05 11:35                                       ` Andi Kleen
1999-06-30 15:43                                         ` Andi Kleen
1999-06-05 12:41                                       ` Jamie Lokier
1999-06-05 14:43                                         ` Martin v. Loewis
1999-06-30 15:43                                           ` Martin v. Loewis
1999-06-05 16:53                                         ` mark
1999-06-07  2:36                                           ` Jamie Lokier
1999-06-07  8:04                                             ` mark
1999-06-30 15:43                                               ` mark
1999-06-30 15:43                                             ` Jamie Lokier
1999-06-30 15:43                                           ` mark
1999-06-30 15:43                                         ` Jamie Lokier
1999-06-30 15:43                                       ` mark
1999-06-30 15:43                                     ` Andi Kleen
1999-06-06 23:20                                   ` Jeffrey A Law
1999-06-30 15:43                                     ` Jeffrey A Law
1999-06-30 15:43                                   ` Toon Moene
1999-06-30 15:43                                 ` Jeffrey A Law
1999-06-05  4:05                               ` Andi Kleen
1999-06-30 15:43                                 ` Andi Kleen
1999-06-30 15:43                               ` Toon Moene
1999-06-30 15:43                             ` Jeffrey A Law
1999-06-04 11:49                           ` Linus Torvalds
1999-06-04 13:03                             ` Gabriel Dos_Reis
1999-06-04 13:13                               ` Joe Buck
1999-06-30 15:43                                 ` Joe Buck
1999-06-30 15:43                               ` Gabriel Dos_Reis
1999-06-30 15:43                             ` Linus Torvalds
1999-06-04 12:59                           ` Alexandre Oliva
1999-06-04 13:29                             ` Joe Buck
1999-06-04 13:39                               ` Alexandre Oliva
1999-06-30 15:43                                 ` Alexandre Oliva
1999-06-30 15:43                               ` Joe Buck
1999-06-30 15:43                             ` Alexandre Oliva
1999-06-30 15:43                           ` Joe Buck
1999-06-30 15:43                         ` Linus Torvalds
1999-06-30 15:43                       ` craig
1999-06-30 15:43                     ` Linus Torvalds
1999-06-30 15:43                   ` Joe Buck
1999-06-04  5:47                 ` craig
1999-06-30 15:43                   ` craig
1999-06-04  7:11                 ` mark
1999-06-04  8:38                   ` Linus Torvalds
1999-06-30 15:43                     ` Linus Torvalds
1999-06-30 15:43                   ` mark
1999-06-04  8:41                 ` Tim Hollebeek
1999-06-04  8:53                   ` Jeffrey A Law
1999-06-30 15:43                     ` Jeffrey A Law
1999-06-30 15:43                   ` Tim Hollebeek
1999-06-30 15:43                 ` Linus Torvalds
1999-06-30 15:43               ` mark
1999-06-04  5:47             ` craig
1999-06-04  8:17               ` Linus Torvalds
1999-06-04  8:49                 ` craig
1999-06-04  8:57                   ` Linus Torvalds
1999-06-04  9:02                     ` Jean-Pierre Radley
1999-06-30 15:43                       ` Jean-Pierre Radley
1999-06-30 15:43                     ` Linus Torvalds
1999-06-30 15:43                   ` craig
1999-06-30 15:43                 ` Linus Torvalds
1999-06-30 15:43               ` craig
1999-06-04  8:39             ` Tim Hollebeek
1999-06-04  8:55               ` Linus Torvalds
1999-06-04 15:20                 ` Richard Henderson
1999-06-05  9:50                   ` Linus Torvalds
1999-06-05 11:00                     ` mark
1999-06-06 10:30                       ` Linus Torvalds
1999-06-06 10:44                         ` mark
1999-06-06 14:17                           ` Linus Torvalds
1999-06-06 17:41                             ` mark
1999-06-07  8:58                               ` Linus Torvalds
1999-06-07  9:18                                 ` mark
1999-06-07  9:29                                   ` Linus Torvalds
1999-06-07  9:38                                     ` Tim Hollebeek
1999-06-07 10:05                                       ` Jamie Lokier
1999-06-30 15:43                                         ` Jamie Lokier
1999-06-07 10:44                                       ` Linus Torvalds
1999-06-07 11:22                                         ` Jeffrey A Law
1999-06-08  1:34                                           ` Nick Ing-Simmons
1999-06-08  1:48                                             ` Jeffrey A Law
1999-06-30 15:43                                               ` Jeffrey A Law
1999-06-30 15:43                                             ` Nick Ing-Simmons
1999-06-30 15:43                                           ` Jeffrey A Law
1999-06-30 15:43                                         ` Linus Torvalds
1999-06-30 15:43                                       ` Tim Hollebeek
1999-06-30 15:43                                     ` Linus Torvalds
1999-06-30 15:43                                   ` mark
1999-06-07 13:34                                 ` Jamie Lokier
1999-06-30 15:43                                   ` Jamie Lokier
1999-06-30 15:43                                 ` Linus Torvalds
1999-06-30 15:43                               ` mark
1999-06-30 15:43                             ` Linus Torvalds
1999-06-30 15:43                           ` mark
1999-06-30 15:43                         ` Linus Torvalds
1999-06-30 15:43                       ` mark
1999-06-30 15:43                     ` Linus Torvalds
1999-06-30 15:43                   ` Richard Henderson
1999-06-30 15:43                 ` Linus Torvalds
1999-06-30 15:43               ` Tim Hollebeek
1999-06-04 15:02             ` Richard Henderson
1999-06-04 16:50               ` Bernd Schmidt
1999-06-30 15:43                 ` Bernd Schmidt
1999-06-05  9:35               ` Linus Torvalds
1999-06-05 13:34                 ` Richard Henderson
1999-06-05 18:40                   ` Linus Torvalds
1999-06-30 15:43                     ` Linus Torvalds
1999-06-05 21:38                   ` Jakub Jelinek
1999-06-30 15:43                     ` Jakub Jelinek
1999-06-30 15:43                   ` Richard Henderson
1999-06-30 15:43                 ` Linus Torvalds
1999-06-30 15:43               ` Richard Henderson
1999-06-30 15:43             ` Linus Torvalds
1999-06-03 23:53           ` Martin v. Loewis
1999-06-30 15:43             ` Martin v. Loewis
     [not found]           ` <v04205101b37d700fbf8d@[192.168.1.254]>
1999-06-04  7:01             ` craig
1999-06-30 15:43               ` craig
1999-06-30 15:43           ` craig
1999-06-30 15:43         ` David S. Miller
1999-06-03 13:31       ` Andi Kleen
1999-06-30 15:43         ` Andi Kleen
1999-06-30 15:43       ` mark
1999-06-30 15:43     ` David S. Miller
1999-06-03 12:02   ` Andi Kleen
1999-06-03 15:38     ` Martin v. Loewis
1999-06-30 15:43       ` Martin v. Loewis
1999-06-30 15:43     ` Andi Kleen
1999-06-30 15:43   ` mark
1999-06-30 15:43 ` Chip Salzenberg

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).