Re: [PATCH v3] LoongArch: Fix eh_return epilogue for normal returns

2023-12-07 Thread Yang Yujie
On Thu, Dec 07, 2023 at 04:13:51PM +0800, Xi Ruoyao wrote: > > I understand and I don't think adding {} is wrong. The problem is the > indent change causes a large chunk of diff and it makes reviewing more > difficult. Thus generally we should not mix real code change and format > change in a co

Re: [PATCH v3] LoongArch: Fix eh_return epilogue for normal returns

2023-12-07 Thread Xi Ruoyao
On Thu, 2023-12-07 at 14:18 +0800, Yang Yujie wrote: > On Thu, Dec 07, 2023 at 11:02:58AM +0800, Xi Ruoyao wrote: > > > > I don't like this pair of {} for the for statement.  It's not necessary > > and it changes the indent level, causing the diff hard to review. > > > > Otherwise LGTM.  I'm not

Re: [PATCH v3] LoongArch: Fix eh_return epilogue for normal returns

2023-12-06 Thread Yang Yujie
On Thu, Dec 07, 2023 at 11:02:58AM +0800, Xi Ruoyao wrote: > > I don't like this pair of {} for the for statement. It's not necessary > and it changes the indent level, causing the diff hard to review. > > Otherwise LGTM. I'm not sure why I didn't notice the eh_return issue > when I learnt shri

Re: [PATCH v3] LoongArch: Fix eh_return epilogue for normal returns

2023-12-06 Thread Xi Ruoyao
On Thu, 2023-12-07 at 09:40 +0800, Yang Yujie wrote: >  static void >  loongarch_for_each_saved_reg (HOST_WIDE_INT sp_offset, > -   loongarch_save_restore_fn fn) > +   loongarch_save_restore_fn fn, > +   bool skip_eh_data_regs_

[PATCH v3] LoongArch: Fix eh_return epilogue for normal returns

2023-12-06 Thread Yang Yujie
On LoongArch, the regitsters $r4 - $r7 (EH_RETURN_DATA_REGNO) will be saved and restored in the function prologue and epilogue if the given function calls __builtin_eh_return. This causes the return value to be overwritten on normal return paths and breaks a rare case of libgcc's _Unwind_RaiseExce