Handling non-constant bounds in extract_range_from_cond

Richard Kenner kenner@vlsi1.ultra.nyu.edu
Mon Nov 29 23:49:00 GMT 2004


    But this transformation is a performance loss if the expression can be
    proved true by the compiler or if one of the two bound checks can be
    omitted due to compiler knowledge. 

Well sure, but is this really going to occur in real life?

In other words, are there really going to be such code written when the
programmer *didn't* mean X'Valid?

This isn't C where this sort of stuff pops up all the time due to macros:
this can only occur if the code is specifically written that way.

If the programmer *didn't* know about 'Valid, we can be sure that he meant
to write 'Valid and so the optimization would be unfriendly.  But if the
programmer *did* know about 'Valid and also knew that this would always be
true, then why would he write it?

I don't see a single case where the optimization would be appropriate.



More information about the Gcc-patches mailing list