https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124748

--- Comment #3 from Adam Panchártek <adam.panchartek at gmail dot com> ---
Thank you for your response. I understand the point about C alignment
requirements, however I would like to clarify the context of our use case.
We are not writing new code that intentionally violates alignment rules. The
issue arises from two real-world embedded scenarios that are common in the
industry:

Legacy data structures – We are migrating a large existing codebase where
double variables ended up unaligned due to historical reasons (e.g. packed
structs, external binary protocols, memory-mapped data). Retrofitting every
affected struct with __attribute__((aligned(1))) or __attribute__((packed))
across a large codebase is error-prone and time-consuming.
External binary data layouts – When interfacing with externally defined binary
protocols or data formats, the layout is fixed and cannot be changed. Unaligned
doubles appear naturally in such structures.

The -munaligned-double-access option in the Atollic GCC fork was specifically
designed for this scenario — it allowed us to compile only the affected modules
with this flag, without touching the rest of the codebase or impacting
performance elsewhere.
We understand that -mno-unaligned-access exists, but as described in the
original request, it forces byte-wise access even for 16- and 32-bit types that
Cortex-M handles natively, which has an unacceptable impact on performance and
code size across the entire module.
We believe this is a legitimate use case that affects a broader audience of
embedded developers working with ARM Cortex-M, and we would appreciate
reconsideration of this enhancement request.

Reply via email to