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]

Re: Optimization failure



  In message <E10H3Id-0004jn-00@khms.westfalen.de>you write:
  > The following example code demonstrates a problem with the optimizer:
  > Only the first range of constants is recognized.
  > 
  > I hope this is enough information, but if you need more, just ask :-)
  > 
  > Source (generated by a script, otherwise I would already have hand-optimize > d
  > it):
[ ... ]
Yea.  This is a problem with the range checking optimizations.  I actually
reported problems of this nature soon after the revamped range checking code
was installed into gcc2 (in ~1996).

Basically we build an optimized range test for the first group of
consecutive elements.  We'll call that A.  Then we try to optimize
(A || (c == 0x7f).  There's no additional optimization that can be done, so
we then try

((A || (c == 0x7f)) || (c == 0x80))

And so-on.

I believe the way to fix this is to


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