mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: linux-kernel@vger.kernel.org
Subject: Re: GCC 3.4 Heads-up
Date: 25 Dec 2003 23:07:35 -0800	[thread overview]
Message-ID: <bsgmnn$5ef$1@cesium.transmeta.com> (raw)
In-Reply-To: <20031226005840.A30827@hexapodia.org>

Followup to:  <20031226005840.A30827@hexapodia.org>
By author:    Andy Isaacson <adi@hexapodia.org>
In newsgroup: linux.dev.kernel
>
> On Thu, Dec 25, 2003 at 08:34:33PM -0800, Linus Torvalds wrote:
> > The cast/conditional expression as lvalue are _particularly_ ugly 
> > extensions, since there is absolutely zero point to them. They are very 
> > much against what C is all about, and writing something like this:
> > 
> > 	a ? b : c = d;
> > 
> > is something that only a high-level language person could have come up 
> > with. The _real_ way to do this in C is to just do
> > 
> > 	*(a ? &b : &c) = d;
> > 
> > which is portable C, does the same thing, and has no strange semantics.
> 
> But doesn't the first one potentially let the compiler avoid spilling to
> memory, if b and c are both in registers?
> 
> Not that I'm fond of gccisms, but this one at least seems to have a
> potential value.  And I'm sure I came up with an instance of it making
> my head ache, a while back, but I can't come up with a bad example now.
> Care to elaborate on your "strange semantics"?
> 

A decent compiler should be able to avoid spills in either case.

	-hpa
-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
If you send me mail in HTML format I will assume it's spam.
"Unix gives you enough rope to shoot yourself in the foot."
Architectures needed: ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64

  reply	other threads:[~2003-12-26  7:08 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-26  1:46 Chris Meadors
2003-12-26  3:46 ` H. Peter Anvin
2003-12-26  4:34   ` Linus Torvalds
2003-12-26  6:04     ` H. Peter Anvin
2003-12-26  6:58     ` Andy Isaacson
2003-12-26  7:07       ` H. Peter Anvin [this message]
2003-12-26  7:08       ` Linus Torvalds
2003-12-29 16:13       ` David Lloyd
2004-01-02 21:57     ` Bill Davidsen
2004-01-03 21:11       ` Krzysztof Halasa
2004-01-04  5:48         ` Bill Davidsen
2004-01-04 20:41           ` Linus Torvalds
2004-01-05  1:28             ` Bill Davidsen
2004-01-05  1:38               ` Måns Rullgård
2004-01-05 23:49                 ` Ingo Oeser
2004-01-05  2:25               ` Linus Torvalds
2004-01-05  4:15                 ` Bill Davidsen
2004-01-05  4:36                   ` Linus Torvalds
2003-12-30  1:37 ` Rusty Russell
2003-12-26 11:02 linux
2003-12-26 20:05 ` Linus Torvalds
2003-12-27 16:39 ` Andreas Schwab
     [not found] <16PqK-8eK-1@gated-at.bofh.it>
     [not found] ` <16RiU-2kO-1@gated-at.bofh.it>
     [not found]   ` <16S5h-3no-5@gated-at.bofh.it>
2004-01-06 21:06     ` David Mosberger-Tang
2004-01-06 22:33       ` Richard Henderson
2004-01-06 23:23         ` Linus Torvalds
2004-01-07  9:54           ` Richard Henderson

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='bsgmnn$5ef$1@cesium.transmeta.com' \
    --to=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.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

Powered by JetHome