This is the mail archive of the gcc-patches@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]

Re: Handling non-constant bounds in extract_range_from_cond


    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.


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