turning off range simplification

Joe Buck Joe.Buck@synopsys.COM
Fri Jun 25 19:00:00 GMT 2004


On Fri, Jun 25, 2004 at 09:51:33AM -0400, Conway, Christopher L (Christopher)** CTR ** wrote:

> I am working on a static analysis tool that operates the tree-ssa
> representation. We're having trouble with what I *think* is a tree
> dominator optimization.

> C code: 
>   if( i==1 || i==2 ) { ... }
> 
> tree-ssa code:   
>   T.1 = i - 1;
>   T.2 = (unsigned int)T.1;
>   if (T.2 <= 1) { ... }

> This alteration gives our bounds checker fits (we're not inspecting
> types), so we'd like to be able to suppress it.

It seems that you're asking for GCC to do extra work so that you don't
have to do extra work: you are asking for a flag that benefits no one but
you.  You'll wind up with a better result if you teach your bounds checker
at least enough about types so that you can handle the properties of
signed and unsigned integers.

Once you do that, then within the { ... } code you know that T.2 is 0U or
1U, therefore T.1 is 0 or 1, therefore i is 1 or 2.



More information about the Gcc mailing list