On Friday 22 December 2006 00:58, Denis Vlasenko wrote:
> On Tuesday 19 December 2006 23:39, Denis Vlasenko wrote:
> > There are a lot of 100.00% safe optimizations which gcc
> > can do. Value range propagation for bitwise operations, for one
>
> Or this, absolutely typical C code. i386 arch can compare
> 16 bits at a time here (luckily, no alighment worries on this arch):
>
> int f(char *p)
> {
>     if (p[0] == 1 && p[1] == 2) return 1;
>     return 0;
> }

Definitely not 100% safe. p may point to memory that is sensitive to the 
access width and/or number of accesses. (ie. memory mapped IO).

Paul

Reply via email to