public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
To: Mike Stump <mikestump@comcast.net>
Cc: "gcc-patches\@gcc.gnu.org Patches" <gcc-patches@gcc.gnu.org>
Subject: Re: [wide-int] resolve bootstrap issue
Date: Tue, 14 Jan 2014 15:25:00 -0000	[thread overview]
Message-ID: <874n56k2le.fsf@sandifor-thinkpad.stglab.manchester.uk.ibm.com> (raw)
In-Reply-To: <925647AB-F4A2-484B-8CDA-010C0DE847BF@comcast.net> (Mike Stump's	message of "Tue, 14 Jan 2014 06:52:09 -0800")

Mike Stump <mikestump@comcast.net> writes:
> diff --git a/gcc/expmed.c b/gcc/expmed.c
> index ce063eb..720d8c1 100644
> --- a/gcc/expmed.c
> +++ b/gcc/expmed.c
> @@ -4963,6 +4963,7 @@ make_tree (tree type, rtx x)
>        return t;
>  
>      case CONST_DOUBLE:
> +      gcc_assert (HOST_BITS_PER_WIDE_INT * 2 <= MAX_BITSIZE_MODE_ANY_INT);
>        if (TARGET_SUPPORTS_WIDE_INT == 0 && GET_MODE (x) == VOIDmode)
>  	t = wide_int_to_tree (type,
>  			      wide_int::from_array (&CONST_DOUBLE_LOW (x), 2,

I think this would be better as a STATIC_ASSERT.

> @@ -1440,10 +1442,10 @@ real_to_integer (const REAL_VALUE_TYPE *r, bool *fail, int precision)
>  	}
>  #endif
>        w = SIGSZ * HOST_BITS_PER_LONG + words * HOST_BITS_PER_WIDE_INT;
> -      result = wide_int::from_array
> +      tmp = real_int::from_array
>  	(val, (w + HOST_BITS_PER_WIDE_INT - 1) / HOST_BITS_PER_WIDE_INT, w);
> -      result = wi::lrshift (result, (words * HOST_BITS_PER_WIDE_INT) - exp);
> -      result = wide_int::from (result, precision, UNSIGNED);
> +      tmp = wi::lrshift<real_int> (tmp, (words * HOST_BITS_PER_WIDE_INT) - exp);
> +      result = wide_int::from (tmp, precision, UNSIGNED);

Why did you need the <real_int>?  It was supposed to work without.

> diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
> index 00b5439..7c21afa 100644
> --- a/gcc/simplify-rtx.c
> +++ b/gcc/simplify-rtx.c
> @@ -5384,6 +5384,7 @@ simplify_immed_subreg (enum machine_mode outermode, rtx op,
>  		tmp[u] = buf;
>  		base += HOST_BITS_PER_WIDE_INT;
>  	      }
> +	    gcc_assert (GET_MODE_PRECISION (outer_submode) <= MAX_BITSIZE_MODE_ANY_INT);
>  	    r = wide_int::from_array (tmp, units,
>  				      GET_MODE_PRECISION (outer_submode));
>  	    elems[elem] = immed_wide_int_const (r, outer_submode);

Long line.

Looks good to me otherwise FWIW.

Thanks,
Richard

  reply	other threads:[~2014-01-14 15:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-14 14:52 Mike Stump
2014-01-14 15:25 ` Richard Sandiford [this message]
2014-01-15 21:51   ` Mike Stump
2014-01-16 10:55     ` Richard Sandiford
2014-01-17 20:29       ` 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=874n56k2le.fsf@sandifor-thinkpad.stglab.manchester.uk.ibm.com \
    --to=rsandifo@linux.vnet.ibm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mikestump@comcast.net \
    /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).