c-family: Copy DECL_USER_ALIGN even if DECL_ALIGN is similar.
authorRobin Dapp <rdapp@linux.ibm.com>
Tue, 15 Jun 2021 07:06:02 +0000 (09:06 +0200)
committerRobin Dapp <rdapp@linux.ibm.com>
Tue, 15 Jun 2021 07:12:55 +0000 (09:12 +0200)
commitba2eef033e59d80fde35d0cc3acf4d82f7706e60
treedecf378f6ad15e1100d7317f31cc0bc033037980
parent327a6b55e171669f2e72588570c931cd000822d0
c-family: Copy DECL_USER_ALIGN even if DECL_ALIGN is similar.

When re-declaring a function with differing attributes DECL_USER_ALIGN
is usually not merged/copied when DECL_ALIGN is similar.  On s390 this
will cause a warning message not to be shown.  Similarly, we warned
about the wrong alignment when short-circuiting an alignment initialization in
common_handle_aligned_attribute ().

Fix this by copying DECL_USER_ALIGN even if DECL_ALIGN is similar as
well as getting rid of the short-circuited initialization.

gcc/c-family/ChangeLog:

* c-attribs.c (common_handle_aligned_attribute): Remove short
circuit and dead code.

gcc/c/ChangeLog:

* c-decl.c (merge_decls): Copy DECL_USER_ALIGN if DECL_ALIGN is
similar.

gcc/cp/ChangeLog:

* decl.c (duplicate_decls): Likewise.
gcc/c-family/c-attribs.c
gcc/c/c-decl.c
gcc/cp/decl.c