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: jtv at xs4all dot nl, tim dot mcdaniel at tuxia dot com, tim at hollebeek dot com
- Cc: Dautrevaux at microprocess dot com, dewar at gnat dot com, gcc at gcc dot gnu dot org,linux-kernel at vger dot kernel dot org, paulus at samba dot org,trini at kernel dot crashing dot org, velco at fadata dot bg
- Date: Mon, 7 Jan 2002 18:15:15 -0500 (EST)
- Subject: RE: [PATCH] C undefined behavior fix
<<In the above case it is unlikely that folding would present a problem,
but volatile was created because hardware, or even seemingly unrelated
software, can modify even the most unlikely memory locations. If you
want to break device drivers, go ahead and optimize your compiler. =20
>>
No, I think that is the wrong domain of discourse here. We are not talking
about compilers being friendly, but rather correct. Most cetainly volatile
in Ada would not permit this optimzation (i.e. it would not be an optimization
it would be a miscompilation), and I certainly thought that in this respect
C was identical to Ada in semantics of volatile.