public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Michael Matz <matz@suse.de>
To: Mike Stump <mikestump@comcast.net>
Cc: Richard Sandiford <rdsandiford@googlemail.com>,
	gcc-patches Patches <gcc-patches@gcc.gnu.org>
Subject: Re: remove wrong code in immed_double_const
Date: Thu, 22 Mar 2012 14:12:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.64.1203221444100.25409@wotan.suse.de> (raw)
In-Reply-To: <DF6339D4-BFF6-45FA-A5E0-8141F0BD4199@comcast.net>

Hi,

On Wed, 21 Mar 2012, Mike Stump wrote:

> --- a/gcc/emit-rtl.c
> +++ b/gcc/emit-rtl.c
> @@ -531,10 +531,9 @@ immed_double_const (HOST_WIDE_INT i0, HOST_WIDE_INT i1, enum machine_mode mode)
>  
>       1) If GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT, then we use
>  	gen_int_mode.
> -     2) GET_MODE_BITSIZE (mode) == 2 * HOST_BITS_PER_WIDE_INT, but the value of
> -	the integer fits into HOST_WIDE_INT anyway (i.e., i1 consists only
> -	from copies of the sign bit, and sign of i0 and i1 are the same),  then
> -	we return a CONST_INT for i0.
> +     2) If the value of the integer fits into HOST_WIDE_INT anyway
> +        (i.e., i1 consists only from copies of the sign bit, and sign
> +	of i0 and i1 are the same), then we return a CONST_INT for i0.

I see that you didn't remove the assert as part of this patch.  I'd like 
to see what you like to do to this routine once the rest goes in.  In 
particular I don't think just removing the assert will be enough, at the 
very least the block comment should be saying something about what the 
routine exactly does (or doesn't do) for modes where the two HWI arguments 
can't specify all bits.

My point is, for large modes i0 and i1 will only specify the low 2*HWIbits 
bits.  Something needs to document what the upper bits will be (be they 
implicit or explicit), otherwise people reading the comment will always 
wonder what exactly is supposed to happen.  I'm not 100% sure what it 
should say, though.  Probably the interpretation of the upper bits depends 
on the users of the so generated CONST_DOUBLEs.


Ciao,
Michael.

  parent reply	other threads:[~2012-03-22 14:12 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-16 21:54 Mike Stump
2012-03-16 22:04 ` Steven Bosscher
2012-03-17  1:03   ` Mike Stump
2012-03-17  7:37 ` Richard Sandiford
2012-03-18  0:29   ` Mike Stump
2012-03-18 10:16     ` Richard Sandiford
2012-03-18 16:35       ` Mike Stump
2012-03-19 21:44         ` Richard Sandiford
2012-03-19 23:31           ` Mike Stump
2012-03-20 10:32             ` Richard Guenther
2012-03-20 10:50               ` Richard Sandiford
2012-03-20 11:38                 ` Richard Guenther
2012-03-20 12:27                   ` Richard Sandiford
2012-03-20 12:47                     ` Richard Guenther
2012-03-20 13:55                     ` Michael Matz
2012-03-20 20:44                       ` Mike Stump
2012-03-21 13:47                         ` Michael Matz
2012-03-21 17:01                           ` Mike Stump
2012-03-22 13:16                             ` Michael Matz
2012-03-22 18:37                               ` Mike Stump
2012-03-20 19:41                     ` Mike Stump
2012-03-21  1:01                     ` Mike Stump
2012-03-21 13:17                       ` Richard Sandiford
2012-03-21 21:36                         ` Mike Stump
2012-03-22 10:16                           ` Richard Sandiford
2012-03-22 10:25                             ` Richard Sandiford
2012-03-22 20:28                             ` Mike Stump
2012-03-23 10:02                               ` Richard Sandiford
2012-03-26 19:14                                 ` Mike Stump
2012-03-26 20:04                                   ` Richard Sandiford
2012-03-26 23:57                                     ` Mike Stump
2012-04-04 21:07                                       ` Mike Stump
2012-03-22 14:12                           ` Michael Matz [this message]
2012-03-22 18:55                             ` Mike Stump

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.1203221444100.25409@wotan.suse.de \
    --to=matz@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mikestump@comcast.net \
    --cc=rdsandiford@googlemail.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).