public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
[parent not found: <20040309003513.14495.kazu@gcc.gnu.org>]
* [Bug optimization/14495] New: [tree-ssa] Propagate range info into a switch statement
@ 2004-03-09  0:35 kazu at cs dot umass dot edu
  2004-05-24 15:57 ` [Bug tree-optimization/14495] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: kazu at cs dot umass dot edu @ 2004-03-09  0:35 UTC (permalink / raw)
  To: gcc-bugs

Consider:

void bar0 (void);
void bar1 (void);
void bar2 (void);
void bar3 (void);

void
foo (int a)
{
  if (a < 100)
    return;
  if (200 < a)
    return;

  switch (a)
    {
    case  99: bar0 (); return;
    case 100: bar1 (); return;
    case 101: bar2 (); return;
    case 102: bar3 (); return;
    }
}

case 99 won't trigger, but I still get:

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

<L0>:;
  return;

<L1>:;
  if (a > 200) goto <L2>; else goto <L3>;

<L2>:;
  return;

<L3>:;
  switch (a)
    {
      case 99: goto <L4>;
      case 100: goto <L5>;
      case 101: goto <L6>;
      case 102: goto <L7>;
      default : goto <L8>;
    }

<L4>:;
  bar0 () [tail call];
  return;

<L5>:;
  bar1 () [tail call];
  return;

<L6>:;
  bar2 () [tail call];
  return;

<L7>:;
  bar3 () [tail call];
  return;

<L8>:;
  return;

}

-- 
           Summary: [tree-ssa] Propagate range info into a switch statement
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Keywords: pessimizes-code
          Severity: normal
          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=14495


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

end of thread, other threads:[~2008-04-02 12:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-14495-5009@http.gcc.gnu.org/bugzilla/>
2006-04-20 10:58 ` [Bug tree-optimization/14495] [tree-ssa] Propagate range info into a switch statement wouter dot vermaelen at pi dot be
2007-04-13  9:31 ` rguenth at gcc dot gnu dot org
2007-04-17 13:05 ` patchapp at dberlin dot org
2008-04-02 12:53 ` rguenth at gcc dot gnu dot org
2008-04-02 12:55 ` rguenth at gcc dot gnu dot org
2008-04-02 12:56 ` rguenth at gcc dot gnu dot org
     [not found] <20040309003513.14495.kazu@gcc.gnu.org>
2005-09-10 18:10 ` pinskia at gcc dot gnu dot org
2004-03-09  0:35 [Bug optimization/14495] New: " kazu at cs dot umass dot edu
2004-05-24 15:57 ` [Bug tree-optimization/14495] " pinskia at gcc dot gnu dot org
2005-04-24 11:52 ` pinskia at gcc dot gnu dot org
2005-05-08 18:10 ` pinskia at gcc dot gnu dot org
2005-06-03 13:55 ` dnovillo 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).