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

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