public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: optimization/5244: Dead code in simplify_logical()
@ 2003-02-23 20:30 neroden
  0 siblings, 0 replies; 7+ messages in thread
From: neroden @ 2003-02-23 20:30 UTC (permalink / raw)
  To: Kai.Tietz, gcc-bugs, gcc-prs, nobody

Synopsis: Dead code in simplify_logical()

State-Changed-From-To: feedback->closed
State-Changed-By: neroden
State-Changed-When: Sun Feb 23 20:30:05 2003
State-Changed-Why:
    > 3 months in feedback.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5244


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: optimization/5244: Dead code in simplify_logical()
@ 2002-11-06  7:18 Wolfgang Bangerth
  0 siblings, 0 replies; 7+ messages in thread
From: Wolfgang Bangerth @ 2002-11-06  7:18 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: Craig Rodrigues <rodrigc@mediaone.net>, <Kai.Tietz@onevision.de>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: optimization/5244: Dead code in simplify_logical()
Date: Wed, 6 Nov 2002 09:11:57 -0600 (CST)

 [Sifting through old reports...]
 
 Craig, Kai,
 Can you tell me what the state of this report is? A patch was appended to 
 the audit trail, but I don't know whether a conclusion was reached. The 
 discussion ended somewhen in January.
 
 Thanks
   Wolfgang
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth              email:           bangerth@ticam.utexas.edu
                                www: http://www.ticam.utexas.edu/~bangerth
 
 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: optimization/5244: Dead code in simplify_logical()
@ 2002-01-29  5:36 Kai.Tietz
  0 siblings, 0 replies; 7+ messages in thread
From: Kai.Tietz @ 2002-01-29  5:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Kai.Tietz@onevision.de
To: Craig Rodrigues <rodrigc@mediaone.net>
Cc:  
Subject: Re: optimization/5244: Dead code in simplify_logical()
Date: Tue, 29 Jan 2002 11:21:39 +0100

 Hallo,
 
 the reason for this patch is the elimination of dead code., because it will
 be checked if GET_CODE(op1) is IOR or XOR and if so returned. But
 it follows code which checks also for GET_CODE(op1) is XOR, what will be
 never reached.
 
 
      if (GET_CODE (op1) == IOR || GET_CODE (op1) == XOR)
      return apply_distributive_law
        (gen_binary (GET_CODE (op1), mode,
                  gen_binary (AND, mode, XEXP (op1, 0), op0),
                  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 /* Condition is
 always false, see above */)
      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 /* Condition
 is always false, see above */)
      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:
 
 I hope this helps
 Cheers


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: optimization/5244: Dead code in simplify_logical()
@ 2002-01-28 20:06 Craig Rodrigues
  0 siblings, 0 replies; 7+ messages in thread
From: Craig Rodrigues @ 2002-01-28 20:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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
 
 
 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: optimization/5244: Dead code in simplify_logical()
@ 2002-01-03  1:56 Kai.Tietz
  0 siblings, 0 replies; 7+ messages in thread
From: Kai.Tietz @ 2002-01-03  1:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Kai.Tietz@onevision.de
To: rodrigc@gcc.gnu.org, Kai.Tietz@onevision.de, gcc-bugs@gcc.gnu.org,
   gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: optimization/5244: Dead code in simplify_logical()
Date: Thu, 3 Jan 2002 10:53:04 +0100

 --0__=C1256B3600360E2D8f9e8a93df938690918cC1256B3600360E2D
 Content-type: text/plain; charset=us-ascii
 
 
 Hallo,
 
 here is the wished patch. Hope this helps. (I used -aw option for diff)
 
 Cheers
 Kai
 (See attached file: combine.diff)
 
 
                                                                                                                                 
                     rodrigc@gcc.g                                                                                               
                     nu.org               To:     Kai.Tietz@onevision.de, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,             
                                          nobody@gcc.gnu.org                                                                     
                     03.01.2002           cc:                                                                                    
                     07:51                Subject:     Re: optimization/5244: Dead code in simplify_logical()                    
                     Please                                                                                                      
                     respond to                                                                                                  
                     rodrigc;                                                                                                    
                     Please                                                                                                      
                     respond to                                                                                                  
                     Kai.Tietz;                                                                                                  
                     Please                                                                                                      
                     respond to                                                                                                  
                     gcc-bugs;                                                                                                   
                     Please                                                                                                      
                     respond to                                                                                                  
                     gcc-prs;                                                                                                    
                     Please                                                                                                      
                     respond to                                                                                                  
                     nobody;                                                                                                     
                     Please                                                                                                      
                     respond to                                                                                                  
                     gcc-gnats                                                                                                   
                                                                                                                                 
                                                                                                                                 
 
 
 
 
 Synopsis: Dead code in simplify_logical()
 
 State-Changed-From-To: open->feedback
 State-Changed-By: rodrigc
 State-Changed-When: Wed Jan  2 22:51:38 2002
 State-Changed-Why:
     Can you use the diff command to submit a patch which illustrates this
 fix?
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5244
 
 
 
 
 
 --0__=C1256B3600360E2D8f9e8a93df938690918cC1256B3600360E2D
 Content-type: application/octet-stream; 
 	name="combine.diff"
 Content-Disposition: attachment; filename="combine.diff"
 Content-transfer-encoding: base64
 
 NTM5M2E1Mzk0LDU0MDkKPiAgICAgICAvKiBTaW1pbGFybHksIHRha2luZyBhZHZhbnRhZ2Ugb2Yg
 dGhlIGZhY3QgdGhhdAo+IAkgKGFuZCAobm90IEEpICh4b3IgQiBDKSkgPT0gKHhvciAoaW9yIEEg
 QikgKGlvciBBIEMpKSAgKi8KPiAKPiAgICAgICBpZiAoR0VUX0NPREUgKG9wMCkgPT0gTk9UICYm
 IEdFVF9DT0RFIChvcDEpID09IFhPUikKPiAJcmV0dXJuIGFwcGx5X2Rpc3RyaWJ1dGl2ZV9sYXcK
 PiAJICAoZ2VuX2JpbmFyeSAoWE9SLCBtb2RlLAo+IAkJICAgICAgIGdlbl9iaW5hcnkgKElPUiwg
 bW9kZSwgWEVYUCAob3AwLCAwKSwgWEVYUCAob3AxLCA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ICAgIGdlbl9iaW5hcnkgKElPUiwgbW9kZSwgY29weV9ydHggKFhFWFAg
 KG9wMCwgMCkpLAo8IAkJCQkgICBYRVhQIChvcDEsIDEpKSkpOwo8IAo8ICAgICAgIGVsc2UgaWYg
 KEdFVF9DT0RFIChvcDEpID09IE5PVCAmJiBHRVRfQ09ERSAob3AwKSA9PSBYT1IpCjwgCXJldHVy
 biBhcHBseV9kaXN0cmlidXRpdmVfbGF3CjwgCSAgKGdlbl9iaW5hcnkgKFhPUiwgbW9kZSwKPCAJ
 CSAgICAgICBnZW5fYmluYXJ5IChJT1IsIG1vZGUsIFhFWFAgKG9wMSwgMCksIFhFWFAgKG9wMCwg
 MCkpLAo8IAkJICAgICAgIGdlbl9iaW5hcnkgKElPUiwgbW9kZSwgY29weV9ydHggKFhFWFAgKG9w
 MSwgMCkpLCBYRVhQIChvcDAsIDEpKSkpOwo=
 
 --0__=C1256B3600360E2D8f9e8a93df938690918cC1256B3600360E2D--
 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: optimization/5244: Dead code in simplify_logical()
@ 2002-01-02 22:51 rodrigc
  0 siblings, 0 replies; 7+ messages in thread
From: rodrigc @ 2002-01-02 22:51 UTC (permalink / raw)
  To: Kai.Tietz, gcc-bugs, gcc-prs, nobody

Synopsis: Dead code in simplify_logical()

State-Changed-From-To: open->feedback
State-Changed-By: rodrigc
State-Changed-When: Wed Jan  2 22:51:38 2002
State-Changed-Why:
    Can you use the diff command to submit a patch which illustrates this fix?

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5244


^ permalink raw reply	[flat|nested] 7+ messages in thread

* optimization/5244: Dead code in simplify_logical()
@ 2002-01-02  4:56 Kai.Tietz
  0 siblings, 0 replies; 7+ messages in thread
From: Kai.Tietz @ 2002-01-02  4:56 UTC (permalink / raw)
  To: gcc-gnats


>Number:         5244
>Category:       optimization
>Synopsis:       Dead code in simplify_logical()
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 02 04:56:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     KT
>Release:        GCC 3.0.3
>Organization:
>Environment:
Any
>Description:
In file combine.c in function  simplify_logical() there some checks at line 5405 ( if (GET_CODE (op1) == IOR || GET_CODE (op1) == XOR))
which prevent to do the following optimizations at the following lines. (Line 5415 and 5422).
>How-To-Repeat:
See code
>Fix:
Just move checks before critical check 
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-02-23 20:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-23 20:30 optimization/5244: Dead code in simplify_logical() neroden
  -- strict thread matches above, loose matches on Subject: below --
2002-11-06  7:18 Wolfgang Bangerth
2002-01-29  5:36 Kai.Tietz
2002-01-28 20:06 Craig Rodrigues
2002-01-03  1:56 Kai.Tietz
2002-01-02 22:51 rodrigc
2002-01-02  4:56 Kai.Tietz

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