Skip to contentSkip to conversation

memcpy embedded in gcc?

DISCUSSION Long Li 2 participants 2 messages Feb 13, 2003 MIPS

lore
Share & tools
lore

Long Li

author
#0 lore raw

Hi,

I am using a gcc 3.0.4 MIPS crosscompiler on Redhat. I found something interesting: when I use specifly -O1 for compilation, and I can use memcpy function even I did not tell the compiler where I declard it or define it. However, when I specify -O0, then the compiler tells me undefined reference to this memcpy function. So my questions are:

1. Is memcpy a built-in function for gcc? But why not for optimization level 0?

2. Besides memcpy, is there any other functions built in too?

Thanks a lot!

Long

__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

#1 lore raw
Quoted 10 lines · Long Li

Hi,

I am using a gcc 3.0.4 MIPS crosscompiler on Redhat. I found something interesting: when I use specifly -O1 for compilation, and I can use memcpy function even I did not tell the compiler where I declard it or define it. However, when I specify -O0, then the compiler tells me undefined reference to this memcpy function. So my questions are:

Quoted 2 lines

1. Is memcpy a built-in function for gcc? But why not for optimization level 0?

Because using it is an optimization.

Quoted 2 lines

2. Besides memcpy, is there any other functions built in too?

Lots. The list varies depending on the GCC version; see the manual.

Signature · 2 lines
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer