optimization/3329: optimization large memory copies uses kern el memcpy function without user's knowledge.

Araneda, Dorian dorian.araneda@intel.com
Tue Apr 2 14:32:00 GMT 2002


this may be the case, but I don't think 
a developer should know the kernel-hacking tricks 
to get their code to be portable across kernels.

x=y; 
is not intuitively interpreted as 
memcpy(&x,y,sizeof(x));

I can assure you that if gcc did a survey of all
the developers using gcc, the vast majority
would not have realized this was occurring
in their code.

if this is not the case and I am a twink when 
it comes to kernel development, gcc should still
be idiot proof. the compiler  should not make
assumptions that the user is ok with linking
unapproved kernel function calls.

is simple, I don't appreciate a compiler feature
that goes behind my back to include code I did not
ask for.

It is like someone who thinks they are being
polite by pushing someone in a wheelchair because
they feel that they need the help.
It is not good etiquette to do that when that
person neither asked for help or gave permission
to be pushed.
 
gcc may have had good intentions but is still
not right to override the user's intent in that
way.

I do not see why it is so hard to understand
what I am trying to explain.  It is not about
what method is better.  It's about common courtesy
to the user.

-Dorian

-----Original Message-----
From: Richard Henderson [mailto:rth@redhat.com]
Sent: Tuesday, April 02, 2002 5:02 PM
To: Araneda, Dorian
Cc: 'Andrew Pinski'; 'rth@gcc.gnu.org'; 'gcc-bugs@gcc.gnu.org';
'gcc-prs@gcc.gnu.org'; 'nobody@gcc.gnu.org'; 'gcc-gnats@gcc.gnu.org'
Subject: Re: optimization/3329: optimization large memory copies uses
kern el memcpy function without user's knowledge.


There are two markups that export symbols from the kernel:

 (1) EXPORT_SYMBOL

	This is used for symbols with which there are no
	restrictions for use.

 (2) EXPORT_SYMBOL_GPL

	This is used for symbols that may only be used with
	modules that carry a GPL compatible license.

See linux/Documentation/DocBook/kernel-hacking.tmpl or
some post-processing thereof.

You will find that memcpy and all of the other gcc support
routines are exported with EXPORT_SYMBOL, and thus do not
contaminate your code.


r~



More information about the Gcc-bugs mailing list