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


------- Additional Comments From kazu at cs dot umass dot edu  2004-05-03 08:33 -------
The following example is not strictly a seuqence of "if"s, but
do note that it is a real-world example extracted from function.c of GCC.

<L21>:;
  T.1674_116 = type_1->common.code;
  T.1675_117 = T.1674_116 == 18;
  T.1676_118 = T.1674_116 == 20;
  T.1677_119 = T.1675_117 || T.1676_118;
  if (T.1677_119) goto <L25>; else goto <L22>;

<L22>:;
  if (T.1674_116 == 21) goto <L25>; else goto <L23>;

<L23>:;
  if (T.1674_116 == 22) goto <L25>; else goto <L24>;

<L24>:;
  if (T.1674_116 == 19) goto <L25>; else goto <L26>;

<L25>:;
  return 1;

Here, we could do a simple range check like "if ((t - 18) <= 4)".


-- 


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]