Boost logo

Boost :

From: Steven Watanabe (steven_at_[hidden])
Date: 2007-10-10 23:22:27


Simonson, Lucanus J <lucanus.j.simonson <at>> writes:

> If the function call is inline the compiler knows whether the pointer is
> the same or not and if it does not know it does not reorder the
> instructions because it *might* be the same.

What I'm saying is that compiler "knows" that the two pointers
are not the same because if they are the same you have undefined
behavior anyway so it's not non-conformant if it does something

> In the back-end the
> compiler doesn't have any idea what object type the pointer was anymore
> and certainly doesn't use that information to outsmart itself. The
> compiler is pessimistic and conservative in nature in the optimizations
> it makes. If compiler providers chose to do what you suggest they might
> then they would catch no end of grief until they rolled back the change.

I remember seeing something related a while back. Ah,
here it is.

In Christ,
Steven Watanabe

Boost list run by bdawes at, gregod at, cpdaniel at, john at