> -----Original Message-----
> From: Thomas Neumann <thomas.neum...@in.tum.de>
> Sent: Monday, May 15, 2023 2:06 PM
> To: Kyrylo Tkachov <kyrylo.tkac...@arm.com>; Richard Biener
> <richard.guent...@gmail.com>
> Cc: Sören Tempel <soe...@soeren-tempel.net>; gcc-patches@gcc.gnu.org;
> al...@ayaya.dev
> Subject: Re: [PATCH] Fix assertion for unwind-dw2-fde.c btree changes
> 
> > Hello, this patch breaks the build on targets where range is not declared 
> > i.e.
> where the #ifdef ATOMIC_FDE_FAST_PATH path is not taken.
> 
> argh, I did not realize I tested the patch only on atomic fast path
> platforms. The patch below fixes that by moving the check inside the #ifdef.
> 
> I will check that everything works on atomic and non-atomic platforms
> and commit the trivial move then. Sorry for the breakage.

Thanks for the quick fix. I can confirm the aarch64 build succeeds now.
Kyrill

> 
> Best
> 
> Thomas
> 
> 
> 
>  From 550dc27f547a067e96137adeb85148d8a84c81a0 Mon Sep 17 00:00:00
> 2001
> From: Thomas Neumann <tneum...@users.sourceforge.net>
> Date: Mon, 15 May 2023 14:59:22 +0200
> Subject: [PATCH] fix assert in non-atomic path
> 
> The non-atomic path does not have range information,
> we have to adjust the assert handle that case, too.
> 
> libgcc/ChangeLog:
>       * unwind-dw2-fde.c: Fix assert in non-atomic path.
> ---
>   libgcc/unwind-dw2-fde.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/libgcc/unwind-dw2-fde.c b/libgcc/unwind-dw2-fde.c
> index 8683a65aa02..df461a1527d 100644
> --- a/libgcc/unwind-dw2-fde.c
> +++ b/libgcc/unwind-dw2-fde.c
> @@ -240,6 +240,7 @@ __deregister_frame_info_bases (const void *begin)
> 
>     // And remove
>     ob = btree_remove (&registered_frames, range[0]);
> +  bool empty_table = (range[1] - range[0]) == 0;
>   #else
>     init_object_mutex_once ();
>     __gthread_mutex_lock (&object_mutex);
> @@ -276,11 +277,12 @@ __deregister_frame_info_bases (const void *begin)
> 
>    out:
>     __gthread_mutex_unlock (&object_mutex);
> +  bool empty_table = false;
>   #endif
> 
>     // If we didn't find anything in the lookup data structures then they
>     // were either already destroyed or we tried to remove an empty range.
> -  gcc_assert (in_shutdown || ((range[1] - range[0]) == 0 || ob));
> +  gcc_assert (in_shutdown || (empty_table || ob));
>     return (void *) ob;
>   }
> 
> --
> 2.39.2
> 

Reply via email to