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]

Re: asking for __attribute__((aligned()) clarification


On Wed, 21 Aug 2019, Paul Koning wrote:

> I agree, but if the new approach generates a warning for code that was written
> to the old rules, that would be unfortunate.

FWIW I don't know which GCC versions accepted 'packed' on a scalar type.
Already in 2006 GCC 3.4 would issue a warning:

$ echo 'typedef int ui __attribute__((packed));' | gcc34 -xc - -S -o-
        .file   ""
<stdin>:1: warning: `packed' attribute ignored
        .section        .note.GNU-stack,"",@progbits
        .ident  "GCC: (GNU) 3.4.6 20060404 (Red Hat 3.4.6-4)"

> Yes.  But last I tried, optimizing that for > 1 alignment is problematic
> because that information often doesn't make it down to the target code even
> though it is documented to do so.

Thanks, indeed this memcpy solution is not so well suited for that.

Alexander


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