[PATCH] C undefined behavior fix
Alexandre Oliva
aoliva@redhat.com
Sun Jan 6 21:35:00 GMT 2002
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
More information about the Gcc
mailing list