On Friday 26 December 2025 12:45:44 Pali Rohár wrote:
> On Friday 26 December 2025 17:34:04 LIU Hao wrote:
> > 在 2025-12-26 07:33, Pali Rohár 写道:
> > > diff --git a/mingw-w64-crt/crt/crtexe.c b/mingw-w64-crt/crt/crtexe.c
> > > index 90304061ca78..105e9c20f54b 100644
> > > --- a/mingw-w64-crt/crt/crtexe.c
> > > +++ b/mingw-w64-crt/crt/crtexe.c
> > > @@ -89,26 +94,11 @@ int WinMainCRTStartup (void)
> > > .Handler = __mingw_SEH_error_handler,
> > > };
> > > __writefsdword (0, (DWORD)&exception_record); /* register SEH handler
> > > */
> > > -#endif
> > > - int ret = 255;
> > > -#ifdef SEH_INLINE_ASM
> > > - asm ("\t.l_startw:\n");
> > > +#elif defined(SEH_INLINE_ASM)
> > > + asm volatile (".seh_handler %p0, " ASM_EXCEPT :: "i"
> > > (__mingw_SEH_error_handler)); /* applies for the whole function */
> >
> > This name should be hard-coded in the assembly string. Clang doesn't seem to
> > support `%p` modifier with an `i` input: https://gcc.godbolt.org/z/7shcoGMWq
> >
> > When you want to use a modifier in inline assembly, please do also test
> > Clang. It's a much more risky area where occasionally wrong results can
> > happen.
>
> Ok, thanks for input. I will recheck it. I did not know that clang
> inline assembly is such different than the gcc's one.
Seems that "%c0" is supported by clang also for "i" input. And per gcc
documentation, %c modifier is machine generic:
https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#GenericOperandmodifiers
What do you think about %c usage?
And do you know if there is asm inline documentation for clang? Because
I have not found anything yet.
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public