------- Comment #2 from rguenth at gcc dot gnu dot org 2010-02-10 09:42 ------- We still have these constructs and expand still properly deals with them (it uses the size of the LHS).
I'm not sure what's the best thing to do about this bug. Eventually better documenting what sizes in an assignment are really relevant. The FE now indeed emits memcpy whenever there is not a DECL or FIELD_DECL on the LHS that specifies sizes, like for void bar (Base *p, Base *q) { *p = *q; } ;; Function void bar(Base*, Base*) (null) ;; enabled by -tree-original <<cleanup_point <<< Unknown tree: expr_stmt (void) (struct Base *) __builtin_memcpy (NON_LVALUE_EXPR <p>, (const struct Base &) (const struct Base *) NON_LVALUE_EXPR <q>, 5) >>> >>; So the langhook was no longer necessary. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40058