public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
[parent not found: <bug-15353-4@http.gcc.gnu.org/bugzilla/>]
[parent not found: <bug-15353-5009@http.gcc.gnu.org/bugzilla/>]
* [Bug optimization/15353] New: [tree-ssa] Merge two "if"s if one subsumes the other.
@ 2004-05-09 20:07 kazu at cs dot umass dot edu
  2004-05-25  0:03 ` [Bug tree-optimization/15353] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: kazu at cs dot umass dot edu @ 2004-05-09 20:07 UTC (permalink / raw)
  To: gcc-bugs

void bar (void);

void
foo (int a, int b)
{
  do
    {
      if (a < b)
	break;
      if (a != b)
	break;
      bar ();
    }
  while (0);
}

I get:

foo (a, b)
{
<bb 0>:
  if (a_1 < b_2) goto <L2>; else goto <L0>;

<L0>:;
  if (a_1 != b_2) goto <L2>; else goto <L1>;

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

<L2>:;
  return;

}

Note that the second "if" completely subsumes the first.
We would like:

foo (a, b)
{
<bb 0>:
  if (a_1 == b_2) goto <L0>; else goto <L1>;

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

<L1>:;
  return;

}

This comes from shorten_compare from c-common.c.

-- 
           Summary: [tree-ssa] Merge two "if"s if one subsumes the other.
           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=15353


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

end of thread, other threads:[~2013-11-09 20:39 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20040509200719.15353.kazu@gcc.gnu.org>
2005-08-10 18:57 ` [Bug tree-optimization/15353] [tree-ssa] Merge two "if"s if one subsumes the other law at redhat dot com
2005-08-11 11:01 ` rguenth at gcc dot gnu dot org
2005-08-11 15:43 ` law at redhat dot com
2005-08-11 15:52 ` trt at acm dot org
2005-08-11 17:29 ` law at redhat dot com
     [not found] <bug-15353-4@http.gcc.gnu.org/bugzilla/>
2013-11-09 20:40 ` pinskia at gcc dot gnu.org
     [not found] <bug-15353-5009@http.gcc.gnu.org/bugzilla/>
2007-04-23 11:48 ` rguenth at gcc dot gnu dot org
2007-06-12 12:06 ` rguenth at gcc dot gnu dot org
2007-06-12 12:08 ` rguenth at gcc dot gnu dot org
2004-05-09 20:07 [Bug optimization/15353] New: " kazu at cs dot umass dot edu
2004-05-25  0:03 ` [Bug tree-optimization/15353] " pinskia at gcc dot gnu dot org
2005-06-11 19:06 ` rguenth at gcc dot gnu dot org
2005-06-11 19:16 ` 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).