Optimization failure

Jeffrey A Law law@hurl.cygnus.com
Sun Feb 28 23:30:00 GMT 1999


  In message < 01ef01be6367$8da402f0$237196c0@seaspace.com >you write:
  > >I believe the way to fix this is to
  > >
  > 
  > So, you just gonna leave us hanging???? :)
Did it get cut off?

Hmmm, apparently so.


I believe the way to fix this problem is to perform reassociations on the
tree of comparisons.

ie, given:

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

That can be reassociated into

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

Which then turns into

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

And so on for the entire comparison.

I believe it would need to be structured similar to simplify_plus_minus,
except that it would work on trees instead of rtl and would have to hook
into the range checking code.


jeff





More information about the Gcc-bugs mailing list