This is the mail archive of the
mailing list for the GCC project.
Re: Handling non-constant bounds in extract_range_from_cond
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: laurent at guerby dot net
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 29 Nov 04 18:36:17 EST
- Subject: 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.