public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Michael Matz <matz@suse.de>
To: Richard Guenther <rguenther@suse.de>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Make VRP optimize useless conversions
Date: Mon, 11 Jul 2011 14:04:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.64.1107111433350.14485@wotan.suse.de> (raw)
In-Reply-To: <alpine.LNX.2.00.1107111412220.810@zhemvz.fhfr.qr>

Hi,

On Mon, 11 Jul 2011, Richard Guenther wrote:

> The following actually works.
> 
> Bootstrapped and tested on x86_64-unknown-linux-gnu.
> 
> Can you double-check it?

Seems sensible.  Given this:

  short s;
  int i;
  for (s = 0; s <= 127; s++)
    i += (signed char)(unsigned char)s;
  return i;

(or similar), does it remove the conversions to signed and unsigned char 
now?  And does it _not_ remove them if the upper bound is 128, or the 
lower bound is -1 ?

Similar (now with extensions):
  signed char c;
  unsigned u;
  for (c = 1; c < 127; c++)
    u += (unsigned)(int)c;

The conversion to int is not necessary; but it is when the lower bound 
is -1.


Ciao,
Michael.

  reply	other threads:[~2011-07-11 12:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-07 13:41 Richard Guenther
2011-07-07 15:59 ` Michael Matz
2011-07-08 10:44   ` Richard Guenther
2011-07-08 12:40     ` Michael Matz
2011-07-08 13:38       ` Richard Guenther
2011-07-11 12:23         ` Richard Guenther
2011-07-11 14:04           ` Michael Matz [this message]
2011-07-12 18:02           ` Build failure (Re: [PATCH] Make VRP optimize useless conversions) Ulrich Weigand
2011-07-13  8:43             ` Richard Guenther
2011-07-13 13:13               ` H.J. Lu
2011-07-13 13:57               ` Ulrich Weigand
2011-08-13 10:17           ` [PATCH] Make VRP optimize useless conversions H.J. Lu

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=Pine.LNX.4.64.1107111433350.14485@wotan.suse.de \
    --to=matz@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rguenther@suse.de \
    /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).