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.  Regtes

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 s

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 --- a/gcc/testsu

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. Regtest

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 locatio

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 int

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\\). beca

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

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