https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91306

--- Comment #3 from Jozef Lawrynowicz <jozefl.gcc at gmail dot com> ---
(In reply to Andrew Pinski from comment #2)
> If that is true, then maybe alignof should be used instead of sizeof.
> Can you try alignof (__alignof__)?

Thanks, __alignof__ works for me. Below change fixed the issue for
msp430-elf/-mlarge:

> diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c
> index 4927a9f8977..bd5c93c194e 100644
> --- a/libgcc/crtstuff.c
> +++ b/libgcc/crtstuff.c
> @@ -474,7 +474,7 @@ frame_dummy (void)
>  CRT_CALL_STATIC_FUNCTION (__LIBGCC_INIT_SECTION_ASM_OP__, frame_dummy)
>  #else /* defined(__LIBGCC_INIT_SECTION_ASM_OP__) */
>  static func_ptr __frame_dummy_init_array_entry[]
> -  __attribute__ ((__used__, section(".init_array"), 
> aligned(sizeof(func_ptr))))
> +  __attribute__ ((__used__, section(".init_array"), 
> aligned(__alignof__(func_ptr))))
>    = { frame_dummy };
>  #endif /* !defined(__LIBGCC_INIT_SECTION_ASM_OP__) */
>  #endif /* USE_EH_FRAME_REGISTRY || USE_TM_CLONE_REGISTRY */

The other structures using "aligned(sizeof(func_ptr))" are unused for msp430,
so they aren't causing problems, but alignof does seem like a better keyword to
use for those if it works for the other targets as well.

Reply via email to