This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] C undefined behavior fix
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Linus Torvalds <torvalds at transmeta dot com>
- Cc: Richard Henderson <rth at redhat dot com>, Tom Rini <trini at kernel dot crashing dot org>, <gcc at gcc dot gnu dot org>
- Date: 07 Jan 2002 03:35:38 -0200
- Subject: Re: [PATCH] C undefined behavior fix
- Organization: GCC Team, Red Hat
- References: <Pine.LNX.4.33.0201062056580.6011-100000@penguin.transmeta.com>
On Jan 7, 2002, Linus Torvalds <torvalds@transmeta.com> wrote:
> On 7 Jan 2002, Alexandre Oliva wrote:
>> On Jan 7, 2002, Linus Torvalds <torvalds@transmeta.com> wrote:
>>
>> > Which choice do you think is the _intelligent_ one?
>>
>> I'd surely go with the implementation that makes code with defined
>> behavior work correctly and as fast as possible.
> But _both_ do that for the constant case. And have you ever seen the
> non-constant case?
I had got the impression that RELOC would add an offset that was not
known at compile time, because the built-in strcpy will not be
optimized to memcpy if the constant offset is outside the bounds of
the string in the current CVS version of GCC, so there isn't any
problem in this case.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me