public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [C++ PATCH] Fix build_noexcept_spec ICE (PR c++/54207)
Date: Thu, 06 Dec 2012 14:07:00 -0000	[thread overview]
Message-ID: <50C0A6AF.9090007@redhat.com> (raw)
In-Reply-To: <20121206072442.GG2315@tucnak.redhat.com>

On 12/06/2012 02:24 AM, Jakub Jelinek wrote:
> +  if (TREE_CODE (expr) == INTEGER_CST)
> +    {
> +      if (operand_equal_p (expr, boolean_true_node, 0))
> +	return noexcept_true_spec;
> +      else if (operand_equal_p (expr, boolean_false_node, 0))
> +	return noexcept_false_spec;
> +    }

These are the only two possibilities for a boolean INTEGER_CST, so let's 
assert that it's false if it isn't true.

You can then leave the 'else' on the "if (expr == error_mark_node)".

> +      if (TREE_CODE (expr) == INTEGER_CST)
> +	{
> +	  if (operand_equal_p (expr, boolean_true_node, 0)
> +	      || operand_equal_p (expr, boolean_false_node, 0))
> +	    new_specs = expr;
> +	}

And here you don't need to check the value at all unless in an assert.

Jason

  reply	other threads:[~2012-12-06 14:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-06  7:24 Jakub Jelinek
2012-12-06 14:07 ` Jason Merrill [this message]
2012-12-06 14:31   ` Jakub Jelinek
2012-12-06 15:08     ` Jason Merrill

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=50C0A6AF.9090007@redhat.com \
    --to=jason@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.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).