From 8f64958b766d25f6ccf962da92983a32e4aa37ae Mon Sep 17 00:00:00 2001 From: Sandra Loosemore Date: Mon, 12 Nov 2018 01:23:16 -0500 Subject: [PATCH] re PR c/69502 (attribute aligned reduces alignment contrary to documentation) 2018-11-11 Sandra Loosemore PR c/69502 gcc/ * doc/extend.texi (Common Type Attributes): For the align type attribute, copy language about decreasing alignment from the corresponding variable attribute. From-SVN: r266025 --- gcc/ChangeLog | 7 +++++++ gcc/doc/extend.texi | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 066ef79f51d..07661bbe7c5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-11-11 Sandra Loosemore + + PR c/69502 + * doc/extend.texi (Common Type Attributes): For the align type + attribute, copy language about decreasing alignment from the + corresponding variable attribute. + 2018-11-11 Xianmiao Qu * config/csky/csky.md (*fpuv2_nmulsf3_1, *fpuv2_nmuldf3_1): Handle diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 022d0e0c121..ebdc0cec789 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -7101,8 +7101,11 @@ up to a maximum of 8-byte alignment, then specifying @code{aligned(16)} in an @code{__attribute__} still only provides you with 8-byte alignment. See your linker documentation for further information. -The @code{aligned} attribute can only increase alignment. Alignment -can be decreased by specifying the @code{packed} attribute. See below. +When used on a struct, or struct member, the @code{aligned} attribute can +only increase the alignment; in order to decrease it, the @code{packed} +attribute must be specified as well. When used as part of a typedef, the +@code{aligned} attribute can both increase and decrease alignment, and +specifying the @code{packed} attribute generates a warning. @cindex @code{warn_if_not_aligned} type attribute @item warn_if_not_aligned (@var{alignment}) -- 2.30.2