The solution was to coerce GCC into not using its own inline memcpy without affecting other inlining. Turns out all you have to do is make the size argument a variable rather than a constant. So I changed lines like this:
memcpy(to, from, 8);
int sz = 8;
memcpy(to, from, sz);
I'll send this off to Matt tonight, and I should also port it to the main SQLite codebase. This took way too long to figure out...