This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Undefined references to 'memcpy' when compiling Linux Kernel
- To: john at Calva dot COM
- Subject: Re: Undefined references to 'memcpy' when compiling Linux Kernel
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Mon, 19 Jun 2000 21:08:54 +0200
- CC: linux-kernel at vger dot rutgers dot edu, gcc at gcc dot gnu dot org
- References: <NCBBLMGKIKDGJMEOMNMEMEEEGOAA.john@Calva.COM>
> I don't want to sound dumb; but does anyone know *why* it's not inlining
> the memcpy?
It seems clear from the discussion that your question could mean two
things:
1) Q. Why does the compiler emit that code?
A. Because there is an algorithm in the compiler that told it to do so.
Q. What is that algorithm?
A. Hard to tell, it depends on the exact code you threw at it, and the
exact version for the compiler. For the gcc mainline, most likely
the condition
else if (count >= 0
&& (align >= 8
|| (!TARGET_PENTIUMPRO && align >= 4)
|| optimize_size || count < 64))
was false. I.e. there was a known size, it was not >=8 aligned,
the target was not pentiumpro or it was not >=4 aligned, and you
did not optimize for size, or the count of data was >=64.
If so, it would run into
if (!TARGET_INLINE_ALL_STRINGOPS && align < 4)
FAIL;
I.e. you did not pass -minline-all-stringops, and the alignment was
<4.
Of course, without knowing the exact source, it is hard to tell.
2) Alternatively, you might have meant to ask:
Q. What is the rationale for having such an algorithm?
A. What part of the algorithm do you want a rationale for?
Regards,
Martin