This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] C undefined behavior fix
- From: mike stump <mrs at windriver dot com>
- To: Dautrevaux at microprocess dot com, jtv at xs4all dot nl
- Cc: 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 16:16:32 -0800 (PST)
- Subject: Re: [PATCH] C undefined behavior fix
> Date: Mon, 7 Jan 2002 22:49:07 +0100
> From: jtv <jtv@xs4all.nl>
> To: Bernard Dautrevaux <Dautrevaux@microprocess.com>
> One problem I ran into considering 'char *volatile' was this one:
> the compiler is supposed to disable certain optimizations involving
> registerization and such, but isn't it still allowed to do constant
> folding?
No. That would be a bug. gcc used to have volatile bugs, most of
them are now gone. Please submit a bug report, if you can discover it
again.
I assume you meant something like this:
char * volatile cp;
main() {
return cp - cp;
}