This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] C undefined behavior fix
- From: Tom Rini <trini at kernel dot crashing dot org>
- To: Momchil Velikov <velco at fadata dot bg>
- Cc: linux-kernel at vger dot kernel dot org, gcc at gcc dot gnu dot org,linuxppc-dev at lists dot linuxppc dot org
- Date: Tue, 1 Jan 2002 16:43:50 -0700
- Subject: Re: [PATCH] C undefined behavior fix
- References: <87g05py8qq.fsf@fadata.bg>
On Wed, Jan 02, 2002 at 01:03:25AM +0200, Momchil Velikov wrote:
> The appended patch fix incorrect code, which interferes badly with
> optimizations in GCC 3.0.4 and GCC 3.1.
>
> The GCC tries to replace the strcpy from a constant string source with
> a memcpy, since the length is know at compile time.
Check the linuxppc-dev archives, but this has been discussed before, and
it came down to a few things.
1) gcc shouldn't be making this optimization, and Paulus (who wrote the
code) disliked this new feature. As a subnote, what you sent was sent
to Linus with a comment about working around a gcc-3.0 bug/feature, and
was rejected because of this.
2) We could modify the RELOC macro, and not have this problem. The
patch was posted, but not acted upon.
3) We could also try turning off this particular optimization
(-fno-builtin perhaps) on this file, and not worry about it.
--
Tom Rini (TR1265)
http://gate.crashing.org/~trini/