memcpy

Richard Henderson rth@redhat.com
Thu Feb 20 00:47:00 GMT 2003


[ re: http://gcc.gnu.org/ml/libstdc++/2003-02/msg00056.html ]

The problem here is the lameness of both our inliner and the
code that expands builtins.  Most of the builtins want to see
constants in one form or another, and if they don't, they 
don't expand.

Now, this can be combated in specific situations.  Namely, our
inliner is happy to do constant propagation, but *only* if the
argument itself is marked constant.  I.e.

  inline void foo(void * const x, const void * const y, size_t const s)
  {
    memcpy(x, y, s);
  }

instead of

  inline void foo(void * x, const void * y, size_t s)
  {
    memcpy(x, y, s);
  }

I don't know if you're allowed to make this change at will 
though, since it probably affects name mangling?

It is my fervent hope that this will eventually Just Work
with tree-ssa.


r~



More information about the Libstdc++ mailing list