Re: Undefined references to 'memcpy' when compiling Linux Kernel

From: Martin v. Loewis (martin@loewis.home.cs.tu-berlin.de)
Date: Mon Jun 19 2000 - 14:08:54 EST


> 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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jun 23 2000 - 21:00:17 EST