public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Craig Rodrigues <rodrigc@mediaone.net>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: optimization/5244: Dead code in simplify_logical()
Date: Mon, 28 Jan 2002 20:06:00 -0000	[thread overview]
Message-ID: <20020129040610.22341.qmail@sources.redhat.com> (raw)

The following reply was made to PR optimization/5244; it has been noted by GNATS.

From: Craig Rodrigues <rodrigc@mediaone.net>
To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, Kai.Tietz@onevision.de,
   gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org
Cc:  
Subject: Re: optimization/5244: Dead code in simplify_logical()
Date: Mon, 28 Jan 2002 23:06:21 -0500

 In PR 5244:
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5244
 
 you submitted a patch, which I have reproduced here
 
 in unified context diff format.  Can you explain
 
 why this patch is necessary?  I did not
 
 understand your explanation.
 
 Index: combine.c
 ===================================================================
 RCS file: /cvs/gcc/gcc/gcc/combine.c,v
 retrieving revision 1.183.2.8
 diff -u -r1.183.2.8 combine.c
 --- combine.c   2001/11/05 19:10:32     1.183.2.8
 +++ combine.c   2002/01/29 03:58:03
 @@ -5391,8 +5391,25 @@
          If we have (and (ior A B) C), apply the distributive law and then
          the inverse distributive law to see if things simplify.  */
 
 +      /* Similarly, taking advantage of the fact that
 +        (and (not A) (xor B C)) == (xor (ior A B) (ior A C))  */
 +
 +      if (GET_CODE (op0) == NOT && GET_CODE (op1) == XOR)
 +       return apply_distributive_law
 +         (gen_binary (XOR, mode,
 +                      gen_binary (IOR, mode, XEXP (op0, 0), XEXP (op1, 0)),
 +                      gen_binary (IOR, mode, copy_rtx (XEXP (op0, 0)),
 +                                  XEXP (op1, 1))));
 +
 +      else if (GET_CODE (op1) == NOT && GET_CODE (op0) == XOR)
 +       return apply_distributive_law
 +         (gen_binary (XOR, mode,
 +                      gen_binary (IOR, mode, XEXP (op1, 0), XEXP (op0, 0)),
 +                      gen_binary (IOR, mode, copy_rtx (XEXP (op1, 0)), XEXP (op0, 1))));
 +
        if (GET_CODE (op0) == IOR || GET_CODE (op0) == XOR)
         {
 +         /* ??? May we get better code, if we do this optimization anyway  */
           x = apply_distributive_law
             (gen_binary (GET_CODE (op0), mode,
                          gen_binary (AND, mode, XEXP (op0, 0), op1),
 @@ -5409,21 +5426,6 @@
                        gen_binary (AND, mode, XEXP (op1, 1),
                                    copy_rtx (op0))));
 
 -      /* Similarly, taking advantage of the fact that
 -        (and (not A) (xor B C)) == (xor (ior A B) (ior A C))  */
 -
 -      if (GET_CODE (op0) == NOT && GET_CODE (op1) == XOR)
 -       return apply_distributive_law
 -         (gen_binary (XOR, mode,
 -                      gen_binary (IOR, mode, XEXP (op0, 0), XEXP (op1, 0)),
 -                      gen_binary (IOR, mode, copy_rtx (XEXP (op0, 0)),
 -                                  XEXP (op1, 1))));
 -
 -      else if (GET_CODE (op1) == NOT && GET_CODE (op0) == XOR)
 -       return apply_distributive_law
 -         (gen_binary (XOR, mode,
 -                      gen_binary (IOR, mode, XEXP (op1, 0), XEXP (op0, 0)),
 -                      gen_binary (IOR, mode, copy_rtx (XEXP (op1, 0)), XEXP (op0, 1))));
        break;
 
      case IOR:
 
 --
 Craig Rodrigues
 http://www.gis.net/~craigr
 rodrigc@mediaone.net
 
 
 


             reply	other threads:[~2002-01-29  4:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-28 20:06 Craig Rodrigues [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-02-23 20:30 neroden
2002-11-06  7:18 Wolfgang Bangerth
2002-01-29  5:36 Kai.Tietz
2002-01-03  1:56 Kai.Tietz
2002-01-02 22:51 rodrigc
2002-01-02  4:56 Kai.Tietz

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=20020129040610.22341.qmail@sources.redhat.com \
    --to=rodrigc@mediaone.net \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    /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).