From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: torvalds@transmeta.com (Linus Torvalds)
Cc: alan@lxorguk.ukuu.org.uk (Alan Cox), linux-kernel@vger.kernel.org
Subject: Re: VM-related Oops: 2.4.15pre1
Date: Mon, 19 Nov 2001 10:15:14 +0000 (GMT) [thread overview]
Message-ID: <E165lSM-000666-00@the-village.bc.nu> (raw)
In-Reply-To: <Pine.LNX.4.33.0111181756260.7482-100000@penguin.transmeta.com> from "Linus Torvalds" at Nov 18, 2001 06:02:17 PM
> There's no point being a language lawyer and saying that gcc "could write
> anything to value before it writes the final 2". Tha's not true. A compile
> rthat does that is
>
> (a) buggy as hell from a POSIX standpoint
It would mean someone misdefined sig_atomic_t if it broke for assignment
> And yes, the argument for "page->flags" is _exactly_ the same. Writing
> intermediate values to "page->flags" that were never referenced by the
> programmer is clearly such a violation of QoI that it is a bug even if
> "sig_atomic_t" happens to be "int", and "page->flags" happens to be
> "unsigned int".
If the code execution path is faster why shouldnt the compiler generate
those patterns. You haven't told the variable that its volatile. Therefore
the compiler is supposed to be optimising it.
You can in theory get even stranger effects. Consider
if(!(flag&4))
{
blahblah++;
flag|=4;
}
The compiler is completely at liberty to turn that into
test bit 2
jz 1f
inc blahblah
add #4, flag
1f:
because it knows the bit was clear and it knows the variable is not
volatile.
Having your own personal custom language dialect might be tempting but it is
normally something only the lisp community do.
Alan
next prev parent reply other threads:[~2001-11-19 10:07 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-16 22:23 Simon Kirby
2001-11-17 22:53 ` Christian Ehrhardt
2001-11-18 3:12 ` Linus Torvalds
2001-11-18 4:10 ` Andrea Arcangeli
2001-11-18 6:24 ` Linus Torvalds
2001-11-18 6:37 ` Andrea Arcangeli
2001-11-18 7:31 ` Linus Torvalds
2001-11-18 12:05 ` Alan Cox
2001-11-19 2:02 ` Linus Torvalds
2001-11-19 2:27 ` Linus Torvalds
2001-11-19 18:40 ` kuznet
2001-11-19 10:15 ` Alan Cox [this message]
2001-11-19 16:39 ` Linus Torvalds
2001-11-19 18:03 ` Eric W. Biederman
2001-11-19 19:04 ` Linus Torvalds
2001-11-19 23:52 ` John Alvord
2001-11-21 2:31 ` Pavel Machek
[not found] ` <200111180731.fAI7VFa01371@penguin.transmeta.com>
2001-11-18 7:51 ` Andrea Arcangeli
2001-11-18 17:10 ` Horst von Brand
2001-11-19 2:04 ` Linus Torvalds
2001-11-19 3:22 ` Jeff V. Merkey
2001-11-19 8:44 ` David Woodhouse
2001-11-19 16:57 ` Linus Torvalds
2001-11-19 17:56 ` Simon Kirby
2001-11-19 18:03 ` Linus Torvalds
2001-11-19 18:31 ` Simon Kirby
2001-11-19 20:01 ` Marcelo Tosatti
2001-11-19 21:26 ` Linus Torvalds
2001-11-19 21:49 ` Rik van Riel
2001-11-19 22:40 ` Linus Torvalds
2001-11-19 22:59 ` Rik van Riel
2001-11-19 23:03 ` Linus Torvalds
2001-11-20 0:06 ` Rik van Riel
2001-11-20 0:08 ` Linus Torvalds
2001-11-20 0:27 ` Rik van Riel
2001-11-19 23:27 ` Simon Kirby
2001-11-19 23:38 ` Linus Torvalds
2001-11-19 23:52 ` Simon Kirby
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=E165lSM-000666-00@the-village.bc.nu \
--to=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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
all inboxes | Powered by JetHome®