public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Michael Hayes <m.hayes@elec.canterbury.ac.nz>
To: law@cygnus.com
Cc: Michael Hayes <m.hayes@elec.canterbury.ac.nz>, egcs@cygnus.com
Subject: Re: Ternary operator in loop condition
Date: Sun, 31 Jan 1999 23:58:00 -0000	[thread overview]
Message-ID: <13980.26939.10991.979841@ongaonga.elec.canterbury.ac.nz> (raw)
In-Reply-To: <23825.916133948@hurl.cygnus.com>

Jeffrey A Law writes:
 >   > build_binary_op in c-typeck.c seems to do the damage.   The next 
 >   > question concerns whether the transformation is useful in general 
 >   > and how it should be disabled without pessimizing other stuff.
 > Where precisely does this happen within build_binary_op?

The transformation (damage) is actually done by fold
(fold-const.c:4222) called from build_binary_op.

i < (a ? b : c) ==>  a ? (i < b) : (i < c)

Now under some circumstances I can see that this generates better code
but it sure makes it harder to determine a loop iteration count.

Michael.

  reply	other threads:[~1999-01-31 23:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-31 23:58 Michael Hayes
1999-01-31 23:58 ` Jeffrey A Law
1999-01-31 23:58   ` Michael Hayes
1999-01-31 23:58     ` Michael Hayes
1999-01-31 23:58       ` Jeffrey A Law
1999-01-31 23:58         ` Michael Hayes [this message]
1999-01-31 23:58           ` Jeffrey A Law
1999-01-31 23:58             ` Michael Hayes
1999-01-31 23:58               ` Unswitching [Was: Re: Ternary operator in loop condition] Jeffrey A Law
1999-01-31 23:58                 ` Unswitching Michael Hayes
1999-01-31 23:58                   ` Unswitching Jeffrey A Law
1999-01-31 23:58                     ` cmov [Re: Unswitching] Richard Henderson
1999-01-31 23:58     ` Ternary operator in loop condition Jeffrey A Law
1999-01-31 23:58       ` Michael Hayes
1999-01-31 23:58         ` Jeffrey A Law

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=13980.26939.10991.979841@ongaonga.elec.canterbury.ac.nz \
    --to=m.hayes@elec.canterbury.ac.nz \
    --cc=egcs@cygnus.com \
    --cc=law@cygnus.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).