This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Strict aliasing affects glibc 2.1.1 as well as Linux




On Tue, 20 Jul 1999, Martin v. Loewis wrote:
> 
> There is nothing wrong with trying it out in assembler first.

OF COURSE there is something wrong with trying it out in assember first.

If you're prototyping something, the LAST thing you want to do is do it in
assembler. You want to do it in C, exactly because you can change things
much more easily.

You go to assembler as the very last stage, if ever.

>							 However,
> adding it to the compiler later would make it accessible to all users
> of the compiler, not just the kernel.

Read the subject line.

This is the C library. The kernel never uses it.

I think it is absolutely STUPID to move more functionality than needed
into the C compiler. If it can be done in plain C, without aving to do it
with some built-in logic, it should be done in plain C as far as possible. 

If you need extensions, they should be extensions that can be used for
many different problems. Like "norestrict".

Just generating good code for "memcpy()" is important. But what about the
people who want to do a "memcpy_and_checksum()" routine? Are you going to
add a __builtin_memcpy_and_checksum() too? I didn't think so.

Instead, wouldn't it be nice to have a few low-level primitives that can
be used to build up things like that WITHOUT needing to recompile the
compiler every time you change your low-level routines?

> Also, you seem to be talking about inline assembly here.

No. I'm definitely not talking about inline assembly.

I think

> I believe Linux could do

It's not Linux. It's the GNU C library.

> #define memcpy(t, f, n) \
> (__builtin_constant_p(n) ? \
>  __builtin_memcpy((t),(f),(n)) : \
>  __memcpy((t),(f),(n)))

And should the library maintainers wait for gcc to catch up every time
they want to make an improvement?

Should the library maintainers require everybody who uses the library to
have the latest version of gcc?

Should the library maintainers be stupid clods that cannot do things on
their own?

Guys, let people be clever. HELP people be clever. Instead of shooting
down everybody who does something outside your limited scope.

		Linus


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]