public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/14758] New: [tree-ssa] another missed forward propagation opportunity
@ 2004-03-28  1:54 kazu at cs dot umass dot edu
  2004-03-28  7:35 ` [Bug optimization/14758] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: kazu at cs dot umass dot edu @ 2004-03-28  1:54 UTC (permalink / raw)
  To: gcc-bugs

void bar (void);

void
foo (int a)
{
  a = !a;
  a = !a;
  a = !a;
  a = !a;
  a = !a;

  if (a)
    bar ();
}

Here is the last tree in SSA form:

foo (a)
{
<bb 0>:
  a_2 = a_1 == 0;
  a_3 = a_2 == 0;
  if (a_3 == 0) goto <L0>; else goto <L1>;

<L0>:;
  bar () [tail call];

<L1>:;
  return;

}

Note that a_2 and a_3 still remain.

-- 
           Summary: [tree-ssa] another missed forward propagation
                    opportunity
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Keywords: pessimizes-code
          Severity: enhancement
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kazu at cs dot umass dot edu
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14758


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

* [Bug optimization/14758] [tree-ssa] another missed forward propagation opportunity
  2004-03-28  1:54 [Bug optimization/14758] New: [tree-ssa] another missed forward propagation opportunity kazu at cs dot umass dot edu
@ 2004-03-28  7:35 ` pinskia at gcc dot gnu dot org
  2004-03-30 20:30 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-28  7:35 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-28 07:35 -------
I noticed something like this too, see PR 14731 (that code does not come from real code but it was just 
to show the problem). Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |14731
              nThis|                            |
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-03-28 07:35:45
               date|                            |
   Target Milestone|---                         |tree-ssa


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14758


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

* [Bug optimization/14758] [tree-ssa] another missed forward propagation opportunity
  2004-03-28  1:54 [Bug optimization/14758] New: [tree-ssa] another missed forward propagation opportunity kazu at cs dot umass dot edu
  2004-03-28  7:35 ` [Bug optimization/14758] " pinskia at gcc dot gnu dot org
@ 2004-03-30 20:30 ` pinskia at gcc dot gnu dot org
  2004-03-30 21:31 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-30 20:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-30 20:30 -------
I am going to take care of this one.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pinskia at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14758


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

* [Bug optimization/14758] [tree-ssa] another missed forward propagation opportunity
  2004-03-28  1:54 [Bug optimization/14758] New: [tree-ssa] another missed forward propagation opportunity kazu at cs dot umass dot edu
  2004-03-28  7:35 ` [Bug optimization/14758] " pinskia at gcc dot gnu dot org
  2004-03-30 20:30 ` pinskia at gcc dot gnu dot org
@ 2004-03-30 21:31 ` pinskia at gcc dot gnu dot org
  2004-03-30 21:35 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-30 21:31 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-30 21:31 -------
Here is an example which is easier to put into the testsuite, there should be no references to 
link_error.

void link_error (void);
void
foo (int a)
{
  int old_a=a;
  a = !a;
  a = !a;
  a = !a;
  a = !a;
  a = !a;

  if (a)
    if (old_a)
      link_error ();
}



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2004-03-28 07:35:45         |2004-03-30 21:31:27
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14758


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

* [Bug optimization/14758] [tree-ssa] another missed forward propagation opportunity
  2004-03-28  1:54 [Bug optimization/14758] New: [tree-ssa] another missed forward propagation opportunity kazu at cs dot umass dot edu
                   ` (2 preceding siblings ...)
  2004-03-30 21:31 ` pinskia at gcc dot gnu dot org
@ 2004-03-30 21:35 ` pinskia at gcc dot gnu dot org
  2004-03-31  0:02 ` dnovillo at redhat dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-30 21:35 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-30 21:35 -------
The reason why forwprop does not catch all of the them is that it does not run over and over on 
the same statement.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14758


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

* [Bug optimization/14758] [tree-ssa] another missed forward propagation opportunity
  2004-03-28  1:54 [Bug optimization/14758] New: [tree-ssa] another missed forward propagation opportunity kazu at cs dot umass dot edu
                   ` (3 preceding siblings ...)
  2004-03-30 21:35 ` pinskia at gcc dot gnu dot org
@ 2004-03-31  0:02 ` dnovillo at redhat dot com
  2004-03-31  0:04 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: dnovillo at redhat dot com @ 2004-03-31  0:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dnovillo at redhat dot com  2004-03-31 00:02 -------
Subject: Re:  [tree-ssa] another missed forward
	propagation opportunity

On Tue, 2004-03-30 at 15:30, pinskia at gcc dot gnu dot org wrote:

> I am going to take care of this one.
>
Andrew, I'm planning to generalize CCPs propagation engine after the
merge into mainline.  Long term, the forward propagation pass will
probably be subsumed by this.

At this point I'm not sure if it's even worth our time trying to extend
it to handle more cases.


Diego.



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14758


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

* [Bug optimization/14758] [tree-ssa] another missed forward propagation opportunity
  2004-03-28  1:54 [Bug optimization/14758] New: [tree-ssa] another missed forward propagation opportunity kazu at cs dot umass dot edu
                   ` (4 preceding siblings ...)
  2004-03-31  0:02 ` dnovillo at redhat dot com
@ 2004-03-31  0:04 ` pinskia at gcc dot gnu dot org
  2004-03-31  5:36 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-31  0:04 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-31 00:04 -------
Thanks for the heads up, I will wait then.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|pinskia at gcc dot gnu dot  |unassigned at gcc dot gnu
                   |org                         |dot org
             Status|ASSIGNED                    |NEW


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14758


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

* [Bug optimization/14758] [tree-ssa] another missed forward propagation opportunity
  2004-03-28  1:54 [Bug optimization/14758] New: [tree-ssa] another missed forward propagation opportunity kazu at cs dot umass dot edu
                   ` (5 preceding siblings ...)
  2004-03-31  0:04 ` pinskia at gcc dot gnu dot org
@ 2004-03-31  5:36 ` pinskia at gcc dot gnu dot org
  2004-05-15  6:05 ` [Bug tree-optimization/14758] " pinskia at gcc dot gnu dot org
  2004-05-15 15:46 ` giovannibajo at libero dot it
  8 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-31  5:36 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-31 05:36 -------
*** Bug 14731 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
Bug 14758 depends on bug 14731, which changed state.

Bug 14731 Summary: [tree-ssa] missed jump threading on the tree level
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14731

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |DUPLICATEBug 14758 depends on bug 14731, which changed state.

Bug 14731 Summary: [tree-ssa] missed jump threading on the tree level
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14731

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |DUPLICATE

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14758


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

* [Bug tree-optimization/14758] [tree-ssa] another missed forward propagation opportunity
  2004-03-28  1:54 [Bug optimization/14758] New: [tree-ssa] another missed forward propagation opportunity kazu at cs dot umass dot edu
                   ` (6 preceding siblings ...)
  2004-03-31  5:36 ` pinskia at gcc dot gnu dot org
@ 2004-05-15  6:05 ` pinskia at gcc dot gnu dot org
  2004-05-15 15:46 ` giovannibajo at libero dot it
  8 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-15  6:05 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-14 17:41 -------
Fixed by:
	* tree-ssa-forwprop.c (record_single_argument_cond_exprs): Accept
	new parameters for the statement and variable worklist as well
	as a bitmap of interesting SSA_NAMEs.  Walk over the statement
	worklist recording interesting variables in the variable worklist
	and bitmap.  Handle casts between integral and boolean types.
	(substitute_single_use_vars): Accept new parameters for the statement
	and variable worklist.  When a substitution is made add a new
	entry to the statement worklist.  Handle casts between integral
	and boolean types.
	(tree_ssa_forward_propagate_single_use_vars): Rework to pass
	worklists to children.  Iterate until the statement worklist
	is empty.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14758


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

* [Bug tree-optimization/14758] [tree-ssa] another missed forward propagation opportunity
  2004-03-28  1:54 [Bug optimization/14758] New: [tree-ssa] another missed forward propagation opportunity kazu at cs dot umass dot edu
                   ` (7 preceding siblings ...)
  2004-05-15  6:05 ` [Bug tree-optimization/14758] " pinskia at gcc dot gnu dot org
@ 2004-05-15 15:46 ` giovannibajo at libero dot it
  8 siblings, 0 replies; 11+ messages in thread
From: giovannibajo at libero dot it @ 2004-05-15 15:46 UTC (permalink / raw)
  To: gcc-bugs



-- 
Bug 14758 depends on bug 14728, which changed state.

Bug 14728 Summary: [tree-ssa] missed jump threading due to casts
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14728

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14758


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

* [Bug tree-optimization/14758] [tree-ssa] another missed forward propagation opportunity
       [not found] <bug-14758-4@http.gcc.gnu.org/bugzilla/>
@ 2012-02-28  8:06 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-02-28  8:06 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14758

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-02-28 07:16:02 UTC ---
(In reply to comment #5)
> Andrew, I'm planning to generalize CCPs propagation engine after the
> merge into mainline.  Long term, the forward propagation pass will
> probably be subsumed by this.

I have patches to this simplifying in a generic way that other passes can use.


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

end of thread, other threads:[~2012-02-28  7:16 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-28  1:54 [Bug optimization/14758] New: [tree-ssa] another missed forward propagation opportunity kazu at cs dot umass dot edu
2004-03-28  7:35 ` [Bug optimization/14758] " pinskia at gcc dot gnu dot org
2004-03-30 20:30 ` pinskia at gcc dot gnu dot org
2004-03-30 21:31 ` pinskia at gcc dot gnu dot org
2004-03-30 21:35 ` pinskia at gcc dot gnu dot org
2004-03-31  0:02 ` dnovillo at redhat dot com
2004-03-31  0:04 ` pinskia at gcc dot gnu dot org
2004-03-31  5:36 ` pinskia at gcc dot gnu dot org
2004-05-15  6:05 ` [Bug tree-optimization/14758] " pinskia at gcc dot gnu dot org
2004-05-15 15:46 ` giovannibajo at libero dot it
     [not found] <bug-14758-4@http.gcc.gnu.org/bugzilla/>
2012-02-28  8:06 ` pinskia at gcc dot gnu.org

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