public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/65658] New: Jump threading too pessimistic when optimizing for size
@ 2015-04-02  3:05 law at redhat dot com
  2015-04-02  8:44 ` [Bug tree-optimization/65658] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: law at redhat dot com @ 2015-04-02  3:05 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65658

            Bug ID: 65658
           Summary: Jump threading too pessimistic when optimizing for
                    size
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: law at redhat dot com

Created attachment 35209
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35209&action=edit
testcase, compile with -O2 -Wall note uninitialized warnings for SRA's
variables and trivially threadable block in setup()

The jump threader will cancel jump threads when optimizing for size and the
block will need to be duplicated.  But that heuristic fails for something a
block like this:

  # _36 = PHI <1(2), 1(4), 0(7)>
  # problem$l3_101 = PHI <problem$l3_8(D)(2), problem$l3_8(D)(4),
problem$l3_35(7)>
  # problem$l4_100 = PHI <problem$l4_124(D)(2), problem$l4_124(D)(4),
problem$l4_34(7)>
  amt ={v} {CLOBBER};
  if (_36 != 0)
    goto <bb 25>;
  else
    goto <bb 9>;


All incoming edges are threadable and the block produces no code.  It's really
just a redirection block that's not recognized as such -- probably due to the
clobber statement.  

The net result is we cancel the jump thread, get worse code and issue false
positive warnings for uninitialized variables.  All around a lose.


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

* [Bug tree-optimization/65658] Jump threading too pessimistic when optimizing for size
  2015-04-02  3:05 [Bug tree-optimization/65658] New: Jump threading too pessimistic when optimizing for size law at redhat dot com
@ 2015-04-02  8:44 ` rguenth at gcc dot gnu.org
  2015-04-20 17:14 ` law at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-04-02  8:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65658

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-04-02
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.


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

* [Bug tree-optimization/65658] Jump threading too pessimistic when optimizing for size
  2015-04-02  3:05 [Bug tree-optimization/65658] New: Jump threading too pessimistic when optimizing for size law at redhat dot com
  2015-04-02  8:44 ` [Bug tree-optimization/65658] " rguenth at gcc dot gnu.org
@ 2015-04-20 17:14 ` law at gcc dot gnu.org
  2015-04-20 19:36 ` law at gcc dot gnu.org
  2015-04-20 19:37 ` law at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: law at gcc dot gnu.org @ 2015-04-20 17:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65658

--- Comment #2 from Jeffrey A. Law <law at gcc dot gnu.org> ---
Author: law
Date: Mon Apr 20 17:13:52 2015
New Revision: 222242

URL: https://gcc.gnu.org/viewcvs?rev=222242&root=gcc&view=rev
Log:
    PR tree-optimization/65658
    * tree-ssa-threadupdate.c (redirection_block_p): Ignore clobber
    statements too.

    PR tree-optimization/65658
    * gcc.dg/pr65658.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr65658.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-threadupdate.c


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

* [Bug tree-optimization/65658] Jump threading too pessimistic when optimizing for size
  2015-04-02  3:05 [Bug tree-optimization/65658] New: Jump threading too pessimistic when optimizing for size law at redhat dot com
  2015-04-02  8:44 ` [Bug tree-optimization/65658] " rguenth at gcc dot gnu.org
  2015-04-20 17:14 ` law at gcc dot gnu.org
@ 2015-04-20 19:36 ` law at gcc dot gnu.org
  2015-04-20 19:37 ` law at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: law at gcc dot gnu.org @ 2015-04-20 19:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65658

--- Comment #3 from Jeffrey A. Law <law at gcc dot gnu.org> ---
Author: law
Date: Mon Apr 20 19:35:50 2015
New Revision: 222247

URL: https://gcc.gnu.org/viewcvs?rev=222247&root=gcc&view=rev
Log:
       PR tree-optimization/65658
        * tree-ssa-threadupdate.c (redirection_block_p): Remove
        redundant test for GIMPLE_ASSIGN in last change.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-ssa-threadupdate.c


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

* [Bug tree-optimization/65658] Jump threading too pessimistic when optimizing for size
  2015-04-02  3:05 [Bug tree-optimization/65658] New: Jump threading too pessimistic when optimizing for size law at redhat dot com
                   ` (2 preceding siblings ...)
  2015-04-20 19:36 ` law at gcc dot gnu.org
@ 2015-04-20 19:37 ` law at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: law at redhat dot com @ 2015-04-20 19:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65658

Jeffrey A. Law <law at redhat dot com> changed:

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

--- Comment #4 from Jeffrey A. Law <law at redhat dot com> ---
Fixed with trunk commits.


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

end of thread, other threads:[~2015-04-20 19:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-02  3:05 [Bug tree-optimization/65658] New: Jump threading too pessimistic when optimizing for size law at redhat dot com
2015-04-02  8:44 ` [Bug tree-optimization/65658] " rguenth at gcc dot gnu.org
2015-04-20 17:14 ` law at gcc dot gnu.org
2015-04-20 19:36 ` law at gcc dot gnu.org
2015-04-20 19:37 ` law at redhat dot com

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