Re: [PATCH 1/2] c-family: Copy DECL_USER_ALIGN even if DECL_ALIGN is similar.

2021-06-09 Thread Jason Merrill via Gcc-patches
On 6/9/21 4:47 AM, Robin Dapp wrote: As you say, the logic is convoluted.  Let's simplify it rather than make it more convoluted.  One possibility would be to change || to | toavoid the shortcut, and then bool note = lastalign > curalign; if (note) curalign = lastalign; I went with your

Re: [PATCH 1/2] c-family: Copy DECL_USER_ALIGN even if DECL_ALIGN is similar.

2021-06-09 Thread Robin Dapp via Gcc-patches
As you say, the logic is convoluted.  Let's simplify it rather than make it more convoluted.  One possibility would be to change || to | to avoid the shortcut, and then bool note = lastalign > curalign; if (note)     curalign = lastalign; I went with your suggestion in the attached v2. 

Re: [PATCH 1/2] c-family: Copy DECL_USER_ALIGN even if DECL_ALIGN is similar.

2021-06-01 Thread Jason Merrill via Gcc-patches
On 6/1/21 9:20 AM, Robin Dapp wrote: As you say, the logic is convoluted.  Let's simplify it rather than make it more convoluted.  One possibility would be to change || to | to avoid the shortcut, and then bool note = lastalign > curalign; if (note)     curalign = lastalign; I went with your

Re: [PATCH 1/2] c-family: Copy DECL_USER_ALIGN even if DECL_ALIGN is similar.

2021-06-01 Thread Robin Dapp via Gcc-patches
This is the revised testsuite change with v2 adding a check for no separate note for __attribute__((aligned (32), aligned (4)). Regards Robin diff --git a/gcc/testsuite/c-c++-common/Wattributes.c b/gcc/testsuite/c-c++-common/Wattributes.c index 4ad90441b4d..a97e5ad5f74 100644 ---

Re: [PATCH 1/2] c-family: Copy DECL_USER_ALIGN even if DECL_ALIGN is similar.

2021-06-01 Thread Robin Dapp via Gcc-patches
As you say, the logic is convoluted. Let's simplify it rather than make it more convoluted. One possibility would be to change || to | to avoid the shortcut, and then bool note = lastalign > curalign; if (note) curalign = lastalign; I went with your suggestion in the attached v2.

Re: [PATCH 1/2] c-family: Copy DECL_USER_ALIGN even if DECL_ALIGN is similar.

2021-05-25 Thread Jason Merrill via Gcc-patches
On 5/25/21 11:15 AM, Martin Sebor wrote: On 5/25/21 4:38 AM, Robin Dapp wrote: Hi Martin and Jason, The removal of the dead code looks good to me.  The change to "re-init lastalign" doesn't seem right.  When it's zero it means the conflict is between two attributes on the same declaration, in

Re: [PATCH 1/2] c-family: Copy DECL_USER_ALIGN even if DECL_ALIGN is similar.

2021-05-25 Thread Martin Sebor via Gcc-patches
On 5/25/21 4:38 AM, Robin Dapp wrote: Hi Martin and Jason, The removal of the dead code looks good to me.  The change to "re-init lastalign" doesn't seem right.  When it's zero it means the conflict is between two attributes on the same declaration, in which case the note shouldn't be printed

Re: [PATCH 1/2] c-family: Copy DECL_USER_ALIGN even if DECL_ALIGN is similar.

2021-05-25 Thread Robin Dapp via Gcc-patches
Hi Martin and Jason, The removal of the dead code looks good to me.  The change to "re-init lastalign" doesn't seem right.  When it's zero it means the conflict is between two attributes on the same declaration, in which case the note shouldn't be printed (it would just point to the same

Re: [PATCH 1/2] c-family: Copy DECL_USER_ALIGN even if DECL_ALIGN is similar.

2021-05-21 Thread Jason Merrill via Gcc-patches
On 5/19/21 6:03 PM, Martin Sebor via Gcc-patches wrote: On 5/3/21 8:53 AM, Robin Dapp via Gcc-patches wrote: Hi, on s390 a warning test fails: inline int ATTR ((cold, aligned (8))) finline_hot_noret_align (int); inline int ATTR ((warn_unused_result)) finline_hot_noret_align (int); inline

Re: [PATCH 1/2] c-family: Copy DECL_USER_ALIGN even if DECL_ALIGN is similar.

2021-05-19 Thread Martin Sebor via Gcc-patches
On 5/3/21 8:53 AM, Robin Dapp via Gcc-patches wrote: Hi, on s390 a warning test fails: inline int ATTR ((cold, aligned (8))) finline_hot_noret_align (int); inline int ATTR ((warn_unused_result)) finline_hot_noret_align (int); inline int ATTR ((aligned (4)))   finline_hot_noret_align (int); 

Re: [PATCH 1/2] c-family: Copy DECL_USER_ALIGN even if DECL_ALIGN is similar.

2021-05-17 Thread Robin Dapp via Gcc-patches
on s390 a warning test fails: inline int ATTR ((cold, aligned (8))) finline_hot_noret_align (int); inline int ATTR ((warn_unused_result)) finline_hot_noret_align (int); inline int ATTR ((aligned (4))) finline_hot_noret_align (int); /* { dg-warning "ignoring attribute .aligned \\(4\\).

Re: [PATCH 1/2] c-family: Copy DECL_USER_ALIGN even if DECL_ALIGN is similar.

2021-05-10 Thread Robin Dapp via Gcc-patches
Ping.

[PATCH 1/2] c-family: Copy DECL_USER_ALIGN even if DECL_ALIGN is similar.

2021-05-03 Thread Robin Dapp via Gcc-patches
bd1e28c23f2efcdb061959852a91deb6 Mon Sep 17 00:00:00 2001 From: Robin Dapp Date: Tue, 20 Apr 2021 10:51:18 +0200 Subject: [PATCH 1/2] 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 wh