This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] C undefined behavior fix
jtv@xs4all.nl (jtv) wrote on 03.01.02 in <20020103184414.D20936@xs4all.nl>:
> The arithmetic can't be helped--agreed.
Not agreed. It *can* be helped. It might not be pretty, but it is
possible. And after eliminating that, *any* future gcc optimization can no
longer break it (assuming it is otherwise correct, of course).
All of this mess is a consequence of lying to the compiler. The solution
is rather obvious: don't do that.
MfG Kai