Re: [PATCH] linker_lists.h: Add attribute used to ll_entry_start macro

2023-03-23 Thread appujee
I think the correct fix is to not use a zero sized array at all. AIUI, what Andrew Pinksi intended was: the `asm` fix and attribute(unused) fix aren't the same thing. Using either way to get around this is probably not going to work in future; but I'm not familiar with the codebase to do large

Re: [PATCH] linker_lists.h: Add attribute used to ll_entry_start macro

2023-03-23 Thread Tom Rini
On Thu, Mar 23, 2023 at 03:38:33PM -0700, appujee wrote: > added comments: https://lists.denx.de/pipermail/u-boot/2023-March/513078.html OK, and that references a gcc bugzilla entry where Andrew Pinski suggest a change to correct the code, and says not to do what you're suggesting here. And

Re: [PATCH] linker_lists.h: Add attribute used to ll_entry_start macro

2023-03-23 Thread appujee
added comments: https://lists.denx.de/pipermail/u-boot/2023-March/513078.html On Thu, Mar 23, 2023 at 1:31 PM Tom Rini wrote: > > On Thu, Mar 23, 2023 at 01:29:29PM -0700, appujee wrote: > > > > So, saying "unused" and then "used" doesn't seem to make any sense. > > unused and used attributes do

Re: [PATCH] linker_lists.h: Add attribute used to ll_entry_start macro

2023-03-23 Thread Tom Rini
On Thu, Mar 23, 2023 at 01:29:29PM -0700, appujee wrote: > > So, saying "unused" and then "used" doesn't seem to make any sense. > unused and used attributes do not cancel each other. They have different > semantics. I agree this part of the code needs some attention. zero sized > arrays are not

Re: [PATCH] linker_lists.h: Add attribute used to ll_entry_start macro

2023-03-23 Thread appujee
> So, saying "unused" and then "used" doesn't seem to make any sense. unused and used attributes do not cancel each other. They have different semantics. I agree this part of the code needs some attention. zero sized arrays are not C compliant as I understand it, even more so when it is declared

Re: [PATCH] linker_lists.h: Add attribute used to ll_entry_start macro

2023-03-22 Thread Tom Rini
On Tue, Feb 21, 2023 at 03:33:20PM -0800, Aditya Kumar wrote: > The variable gets dropped by clang compiler in an optimized builds. > Adding attribute((used)) allows the symbol to be preserved. Similar > changes have been proposed in the past e.g., > 569524741a01e1a96fc2b75dd7e5d12e41ce6c2b for

Re: [PATCH] linker_lists.h: Add attribute used to ll_entry_start macro

2023-02-22 Thread Simon Glass
On Tue, 21 Feb 2023 at 16:33, Aditya Kumar wrote: > > From 39d292a327b104dcb1347afb545b2baeb7b2227e Mon Sep 17 00:00:00 2001 > From: AdityaK > Date: Tue, 21 Feb 2023 15:05:54 -0800 > Subject: [PATCH] linker_lists.h: Add attribute used to ll_entry_start macro > > The

Re: [PATCH] linker_lists.h: Add attribute used to ll_entry_start macro

2023-02-22 Thread Simon Glass
On Tue, 21 Feb 2023 at 16:27, Aditya Kumar wrote: > > From 2d7c1398d048f11e92945c88a17a907efe8db553 Mon Sep 17 00:00:00 2001 > From: AdityaK > Date: Tue, 21 Feb 2023 15:05:54 -0800 > Subject: [PATCH] Add attribute used to macro > > The variable gets dropped by clang compiler in an optimized

[PATCH] linker_lists.h: Add attribute used to ll_entry_start macro

2023-02-21 Thread Aditya Kumar
>From 39d292a327b104dcb1347afb545b2baeb7b2227e Mon Sep 17 00:00:00 2001 From: AdityaK Date: Tue, 21 Feb 2023 15:05:54 -0800 Subject: [PATCH] linker_lists.h: Add attribute used to ll_entry_start macro The variable gets dropped by clang compiler in an optimized builds. Adding attribute((u