This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] C undefined behavior fix
- From: dewar at gnat dot com
- To: bernd at gams dot at, gcc at gcc dot gnu dot org, linux-kernel at vger dot kernel dot org
- Date: Wed, 9 Jan 2002 05:42:20 -0500 (EST)
- Subject: Re: [PATCH] C undefined behavior fix
<<Especially if there are cases were this optimization yields a slower =
access (or even worse indirect bugs).
E.g. if the referenced "volatile short" is a hardware register and the
access is multiplexed over a slow 8 bit bus. There are embedded systems
around where this is the case and the (cross-)compiler has no way to
know this (except it can be told by the programmer).
>>
Well that of course is a situation where the compiler is being deliberately
misinformed as to the relative costs of various machine instructions, and
that is definitely a problem. One can even imagine hardware (not such a hard
feat, one of our customers had such hardware) where a word access works, but
a byte access fails due to hardware shortcuts,