This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

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


I dont think you understand what i am talking about.

if i say,

static const some_struct_type x = { "data of some sort, in my case about 85
bytes};
some_struct_type y;
y = x;

The assembly output shows that memcopy is being used
when optimizations are turned on even a the minimum level.
The code above is a legitamate call which does not
need memcopy in place of optimized assembly code.

This is not intuitive to the normal programmer.
If the programmer wanted the external symbol memcopy() in
their code they would add it themselves. 

It is an annoying feature to debug when
a programmer is unaware of the latest
gcc optimization techniques and is trying to write
a kernel independent, closed source, device driver library.
Or any code that needs to be kernel independent.

gcc should only be optimizing the assembly code, not introducing
external dependencies the programmer did not ask for.

I had to add a hack to my code and write my own memcopy just
to be able to execute the code above.

I have no problem with memcopy being an exported kernel symbol.
Memcopy may be superduper wonderfuly optimized but I do not want
it or any other open source symbols in our closed source library.

I hope that in the future gcc does not expand this optimization
to include other kernel symbols.  I would prefer to see this
feature removed, and i believe the gcc maintainers will find 
that many other normal kernel mode programers would like 
to see it removed if they knew it was there.

---
Dorian S. Araneda
Product Engineer,
Intel Residential Access Division (RAD)
http://developer.intel.com/design/modems/
www.intel.com   www.intc.com  (ticker: INTC)
110 Horizon Dr., Suite 300, Raleigh, NC  27615


-----Original Message-----
From: rth@gcc.gnu.org [mailto:rth@gcc.gnu.org]
Sent: Tuesday, April 02, 2002 5:10 AM
To: dorian.araneda@intel.com; gcc-bugs@gcc.gnu.org; gcc-prs@gcc.gnu.org;
nobody@gcc.gnu.org
Subject: Re: optimization/3329: optimization large memory copies uses
kernel memcpy function without user's knowledge.


Synopsis: optimization large memory copies uses kernel memcpy function
without user's knowledge.

State-Changed-From-To: open->closed
State-Changed-By: rth
State-Changed-When: Tue Apr  2 02:09:39 2002
State-Changed-Why:
    GCC requires that the memcpy symbol (among others) exist.
    I believe you'll find that at some point the x86 Linux kernel
    maintainers were convinced of this, and now that symbol does
    exist to be exported to your module.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p
r=3329


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