Article ID: 000074187 Content Type: Troubleshooting Last Reviewed: 09/22/2011

memcpy() Optimization Misalignment

Environment

    Quartus® II Subscription Edition
BUILT IN - ARTICLE INTRO SECOND COMPONENT

Critical Issue

Description

When optimization is turned on (-O1 or higher), if you use memcpy() and the source pointer is aligned to a 32-bit boundary, the compiler implements memcpy() with word-oriented instructions as part of the optimization process. This optimization technique causes unexpected results in your software if memcpy() is used on a misaligned address.

Resolution

Take steps to ensure that an optimized implementation of memcpy() is called only with aligned data pointers.

Related Products

This article applies to 1 products

Intel® Programmable Devices

1