public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/36389]  New: [tuples] gimplify_cond_expr should be smarter
@ 2008-05-30 13:15 jakub at gcc dot gnu dot org
  2008-05-30 15:57 ` [Bug tree-optimization/36389] " jakub at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-05-30 13:15 UTC (permalink / raw)
  To: gcc-bugs

gimplify_cond_expr creates a lot of garbage later passes need to clean up, e.g.
in the common case where gimplifying COND_EXPR with one branch GOTO_EXPR and
the other NULL, or both GOTO_EXPRs.
if (D.2106 == (struct B *) &b)
  {
    goto <D.2124>;
  }
becomes:
if (D.2106 == &b[0]) goto <D.2125> else goto <D.2126>
<D.2125>:
gimple_goto <D.2124>
gimple_goto <D.2127>
<D.2126>:
<D.2127>:
while obviously:
if (D.2106 == &b[0]) goto <D.2124> else goto <D.2125>
<D.2125>:
would be enough.


-- 
           Summary: [tuples] gimplify_cond_expr should be smarter
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: dnovillo at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org


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


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

* [Bug tree-optimization/36389] [tuples] gimplify_cond_expr should be smarter
  2008-05-30 13:15 [Bug tree-optimization/36389] New: [tuples] gimplify_cond_expr should be smarter jakub at gcc dot gnu dot org
@ 2008-05-30 15:57 ` jakub at gcc dot gnu dot org
  2008-05-30 16:18 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-05-30 15:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jakub at gcc dot gnu dot org  2008-05-30 15:56 -------
Created an attachment (id=15705)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15705&action=view)
tuples-pr36389.patch

Very lightly tested patch (basically, make check-target-libgomp still passes,
nothing regresses in gomp.exp and pr26823-1.C FAIL goes away).
Given that it is a non-OpenMP patch, full bootstrap/regtest is needed.


-- 


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


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

* [Bug tree-optimization/36389] [tuples] gimplify_cond_expr should be smarter
  2008-05-30 13:15 [Bug tree-optimization/36389] New: [tuples] gimplify_cond_expr should be smarter jakub at gcc dot gnu dot org
  2008-05-30 15:57 ` [Bug tree-optimization/36389] " jakub at gcc dot gnu dot org
@ 2008-05-30 16:18 ` jakub at gcc dot gnu dot org
  2008-06-02 18:21 ` jakub at gcc dot gnu dot org
  2008-08-11  2:14 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-05-30 16:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jakub at gcc dot gnu dot org  2008-05-30 16:17 -------
Created an attachment (id=15706)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15706&action=view)
tuples-pr36389.patch

Updated patch to optimize even when one of the branches is NULL.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #15705|0                           |1
        is obsolete|                            |


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


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

* [Bug tree-optimization/36389] [tuples] gimplify_cond_expr should be smarter
  2008-05-30 13:15 [Bug tree-optimization/36389] New: [tuples] gimplify_cond_expr should be smarter jakub at gcc dot gnu dot org
  2008-05-30 15:57 ` [Bug tree-optimization/36389] " jakub at gcc dot gnu dot org
  2008-05-30 16:18 ` jakub at gcc dot gnu dot org
@ 2008-06-02 18:21 ` jakub at gcc dot gnu dot org
  2008-08-11  2:14 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-06-02 18:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jakub at gcc dot gnu dot org  2008-06-02 18:20 -------
Subject: Bug 36389

Author: jakub
Date: Mon Jun  2 18:19:29 2008
New Revision: 136287

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=136287
Log:
        PR tree-optimization/36389
        * gimplify.c (gimplify_cond_expr): If one or both branches are
        GOTO_EXPRs jumping to LABEL_DECLs, don't create unnecessary
        extra LABEL_DECLs and jumps around.
        * tree-cfg.c (remove_useless_stmts_cond): Set may_branch also
        for GIMPLE_COND stmts.
        * tree-eh.c (replace_goto_queue_cond_clause): Set label to
        create_artificial_label () rather than LABEL_EXPR.

Modified:
    branches/gimple-tuples-branch/gcc/ChangeLog.tuples
    branches/gimple-tuples-branch/gcc/gimplify.c
    branches/gimple-tuples-branch/gcc/tree-cfg.c
    branches/gimple-tuples-branch/gcc/tree-eh.c


-- 


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


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

* [Bug tree-optimization/36389] [tuples] gimplify_cond_expr should be smarter
  2008-05-30 13:15 [Bug tree-optimization/36389] New: [tuples] gimplify_cond_expr should be smarter jakub at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-06-02 18:21 ` jakub at gcc dot gnu dot org
@ 2008-08-11  2:14 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-08-11  2:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2008-08-11 02:13 -------
Fixed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
            Version|4.4.0                       |unknown


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


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

end of thread, other threads:[~2008-08-11  2:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-30 13:15 [Bug tree-optimization/36389] New: [tuples] gimplify_cond_expr should be smarter jakub at gcc dot gnu dot org
2008-05-30 15:57 ` [Bug tree-optimization/36389] " jakub at gcc dot gnu dot org
2008-05-30 16:18 ` jakub at gcc dot gnu dot org
2008-06-02 18:21 ` jakub at gcc dot gnu dot org
2008-08-11  2:14 ` pinskia at gcc dot gnu dot 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).