[Bug tree-optimization/23429] New: Operations involving unsigneds could be simplified

Andrew Pinski pinskia@physics.uc.edu
Tue Aug 16 21:11:00 GMT 2005


> 
> This could just return 1.
> 
> $ cat unsigned-arith.c
> int foo(unsigned int *a, unsigned int *b, unsigned int *c)
> {
>     unsigned int s1, s2;
> 
>     s1 = *a + *b;
>     s2 = *c + *b;
> 
>     return s1 + *c == s2 + *a;
> }

The issue here is the reassociater needs to be a fully reassociater
and that has a couple of different bugs about this filed already.

-- Pinski



More information about the Gcc-bugs mailing list