This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug optimization/14799] New: [tree-ssa] convert a sequence of "if"s to a "switch" statement


void bar (void);

void
foo (int a)
{
  if (a == 30)
    bar ();
  else if (a == 31)
    bar ();
  else if (a == 53)
    bar ();
  else if (a == 23)
    bar ();
}

The idea comes from LLVM.
Of course we should do this only if switch statements are expanded in
an (almost?) optimal way.

-- 
           Summary: [tree-ssa] convert a sequence of "if"s to a "switch"
                    statement
           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=14799


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]