> -----Original Message----- > From: Gcc-patches <gcc-patches- > bounces+kyrylo.tkachov=arm....@gcc.gnu.org> On Behalf Of Richard Biener > via Gcc-patches > Sent: Monday, May 15, 2023 8:59 AM > To: Thomas Neumann <thomas.neum...@in.tum.de> > 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 > > On Sun, May 14, 2023 at 9:00 PM Thomas Neumann via Gcc-patches > <gcc-patches@gcc.gnu.org> wrote: > > > > Dear Sören, > > > > > we ran into a regression introduced by these changes. The regression > > > manifests itself in a failing assertion in __deregister_frame_info_bases. > > > The assertion failure was observed while using Chromium's `flatc` build > > > system tool. The failing assertion is: > > > > > > unwind-dw2-fde.c:281 gcc_assert (in_shutdown || ob); > > > [snip] > > > However, I believe there is one more edge case that isn't being account > > > for presently: If the inserted entry has a size of 0 (i.e. if range[1] - > > > range[0] == 0) then the btree_insert call in __register_frame_info_bases > > > will not insert anything. This is not accounted for in > > > [snip] > > > > > > Would be cool if this could be fixed on the GCC trunk. > > > > thanks for the details analysis and the patch, it looks obviously > > correct for me. I can apply it to trunk, but we need approval from a gcc > > maintainer first. > > The patch is OK for trunk and affected branches. >
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. Thanks, Kyrill > Thanks, > Richard. > > > But independent of your patch, do you have the test case available in > > some easily accessible form, for example a docker image or an automated > > build script? I ask because something odd is happening here, somebody > > registered a non-empty EH that does not contain a single unwind range. I > > am puzzled why anybody would do that, I would like to double check that > > this is indeed the intended behavior and not a bug somewhere else. Or if > > you have the test case at hand, it would be great if you could do a > > quick step through get_pc_range for the affected frame to double-check > > that the table is indeed empty and we don't miss an entry for some > > strange reason. > > > > Best > > > > Thomas > > > > > >