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] Rewrite TRUTH_NOT_EXPR as BIT_{NOT,XOR}_EXPR
Date: Tue, 19 Jul 2011 16:37:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.64.1107191733560.25049@wotan.suse.de> (raw)
In-Reply-To: <alpine.LNX.2.00.1107191233370.810@zhemvz.fhfr.qr>

Hi,

On Tue, 19 Jul 2011, Richard Guenther wrote:

> *************** forward_propagate_comparison (gimple stm
> *** 1164,1170 ****
>         }
>         /* We can propagate the condition into a statement that
>   	 computes the logical negation of the comparison result.  */
> !       else if (gimple_assign_rhs_code (use_stmt) == TRUTH_NOT_EXPR)
>   	{
>   	  tree type = TREE_TYPE (gimple_assign_rhs1 (stmt));
>   	  bool nans = HONOR_NANS (TYPE_MODE (type));
> --- 1165,1174 ----
>         }
>         /* We can propagate the condition into a statement that
>   	 computes the logical negation of the comparison result.  */
> !       else if ((gimple_assign_rhs_code (use_stmt) == BIT_NOT_EXPR
> ! 		&& TYPE_PRECISION (TREE_TYPE (lhs)) == 1)
> ! 	       || (gimple_assign_rhs_code (use_stmt) == BIT_XOR_EXPR
> ! 		   && integer_onep (gimple_assign_rhs2 (use_stmt))))

In XOR case you want either precision==1 or integer_all_onesp (the fixed 
variant), otherwise it's no inversion.


Ciao,
Michael.

  reply	other threads:[~2011-07-19 15:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-18 14:48 Richard Guenther
2011-07-19 11:43 ` Richard Guenther
2011-07-19 16:37   ` Michael Matz [this message]
2011-07-20  9:43     ` Richard Guenther

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.1107191733560.25049@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).