[PATCH] Correct debug for -mcall-ms2sysv-xlogues stubs (PR target/83917, take 2)

Jeff Law law@redhat.com
Mon Feb 26 19:43:00 GMT 2018


On 02/22/2018 07:56 AM, Jakub Jelinek wrote:
> Hi!
> 
> On Sat, Jan 20, 2018 at 06:01:16PM -0600, Daniel Santos wrote:
>> Thanks.  I like the idea of commonizing the macros for consistency.
> 
> Didn't see a progress on this P3 for a while, so I've written this
> version of the patch; no tests though, what I've been using in testing was:
> /* { dg-do compile { target lp64 } } */
> /* { dg-options "-mno-avx -msse2 -mcall-ms2sysv-xlogues -O2" } */
> 
> void __attribute__((sysv_abi, noipa))
> foo (void)
> {
> }
> 
> static void __attribute__((sysv_abi)) (*volatile foop) () = foo;
> 
> void __attribute__((ms_abi, noipa))
> bar (void)
> {
>   foop ();
> }
> 
> int
> main ()
> {
>   bar ();
>   return 0;
> }
> 
> with/without -fno-omit-frame-pointer, disas bar; b on the tail
> call in there, stepi; bt (which before the patch failed, now works),
> also up; p $rbp to see if %rbp has been properly declared to be saved.
> There is no need to cfi_startproc/cfi_endproc for every single entrypoint in
> there, it is enough if the whole range is covered.  On the other side
> we need the cfi_offset for the frame pointer case, otherwise up; p/x $rbp
> doesn't work properly.
> 
> Ok for trunk if it passes bootstrap/regtest on x86_64-linux and i686-linux?
> 
> 2018-02-22  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR debug/83917
> 	* config/i386/i386-asm.h (PACKAGE_VERSION, PACKAGE_NAME,
> 	PACKAGE_STRING, PACKAGE_TARNAME, PACKAGE_URL): Undefine between
> 	inclusion of auto-target.h and auto-host.h.
> 	(USE_GAS_CFI_DIRECTIVES): Define if not defined already based on
> 	__GCC_HAVE_DWARF2_CFI_ASM.
> 	(cfi_startproc, cfi_endproc, cfi_adjust_cfa_offset,
> 	cfi_def_cfa_register, cfi_def_cfa, cfi_register, cfi_offset, cfi_push,
> 	cfi_pop): Define.
> 	* config/i386/cygwin.S: Don't include auto-host.h here, just
> 	define USE_GAS_CFI_DIRECTIVES to 1 or 0 and include i386-asm.h.
> 	(cfi_startproc, cfi_endproc, cfi_adjust_cfa_offset,
> 	cfi_def_cfa_register, cfi_register, cfi_push, cfi_pop): Remove.
> 	* config/i386/resms64fx.h: Add cfi_* directives.
> 	* config/i386/resms64x.h: Likewise.
It's a bit ugly.  But OK.  We can refine further if needed.

jeff



More information about the Gcc-patches mailing list