This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Inline memcpy in GCC 4.1.1


Hi,

I'm updating a port from 3.4.6 to 4.1.1. In 3.4.6, I hadn't implemented
movmemsi patterns, but the compiler could still inline memcpy's (and also
strcpys where source string is a const) by itself. After updating to 4.1.1,
calls to memcpy are always generated. 

I've had a bash at implementing movmemsi, but in a test case that does a
strcpy (dest, "const"), it appears the 4th parameter (alignment) is always
1, and doing a MEM_ALIGN on the source operand results in 8, despite the
fact I have implemented the CONSTANT_ALIGNMENT and DATA_ALIGNMENT macros to
ensure that STRING_CSTs and QImode ARRAY_TYPEs get implemented on a
BITS_PER_WORD boundary (If I look at the assembler output, then that shows
the string being aligned as expected on a word boundary). 

So, two questions: any idea why 4.1.1 is no longer able to automatically
inline memcpys and why is the source operand for movmemsi not know to be as
widely aligned as it actually is?

Cheers,
Jon


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]