https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94075
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
GCC think incrementing start will never get to end.
So you need to hide that from GCC.
The best way is doing:
({ static const int foo[0] __attribute__((aligned(4), section(".foo_1")));
const int *a = &foo[0]; __asm__("":"+r"(a)); a});
libgcc does that in crtstuff.c:
fn = _ITM_deregisterTMCloneTable;
__asm ("" : "+r" (fn));