Hello Hao,
On Tue, 27 Oct 2026 at 16:03, LIU Hao <[email protected]> wrote:
I think this is over-complicated. First, when `__GCC_SEH` is defined, many
> of those CFI macros are empty
> placeholders that don't really do anything. And second, there's
> `cfi_push(%rcx)` in cygwin.S which
> expands to `.seh_pushreg %rcx` but it's not valid -- you can only push a
> non-volatile register.
>
> I suggest you replace cfi macros with explicit SEH directives. For Windows
> on x86-64, DWARF2 is not
> supported, but SEH is always there.
>
>
Thanks a lot for your prompt feedback!
Very good point on push_reg accepting only non-volatile registers. I didn't
know and the assembler didn't complain.
I'm very uncomfortable with modifying some/all of the sources to
replace/remove
the cfi macro calls. There are many places, and looking at uses of t-msabi,
some of the
sources are used in non windows configurations. It seems very easy to break
something
accidentally, unlike with an adjustment to the macro definitions, which are
well localized.
-D_GCC_SEH was motivated by the ability to configure the kind of eh scheme
even on Windows 64bits, e.g. requesting sjlj exceptions. For example:
<<
x86_64-*-mingw*)
...
# This has to match the logic for DWARF2_UNWIND_INFO in
gcc/config/i386/cygming.h
if test x$ac_cv_sjlj_exceptions = xyes; then
tmake_eh_file="i386/t-sjlj-eh"
elif test "${host_address}" = 32; then
# biarch -m32 with --disable-sjlj-exceptions
tmake_eh_file="i386/t-dw2-eh"
md_unwind_header=i386/w32-unwind.h
else
tmake_eh_file="mingw/t-seh-eh"
fi
>>
I suppose it doesn't hurt to have seh directives regardless, so I'm happy
to simplify
the change accordingly.
I'll experiment with a patch v2 and follow up as soon as I have the first
testing results.
With Kind Regards,
Olivier