This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Correct debug for -mcall-ms2sysv-xlogues stubs (PR target/83917, take 2)
- From: Jeff Law <law at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>, Uros Bizjak <ubizjak at gmail dot com>, Jan Hubicka <jh at suse dot cz>, Daniel Santos <daniel dot santos at pobox dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 26 Feb 2018 12:43:13 -0700
- Subject: Re: [PATCH] Correct debug for -mcall-ms2sysv-xlogues stubs (PR target/83917, take 2)
- Authentication-results: sourceware.org; auth=none
- References: <20180119233310.19670-1-daniel.santos@pobox.com> <20180119233519.GA2063@tucnak> <735d9f2c-b57d-775a-84b1-d6089f4d4c1e@pobox.com> <20180222145615.GV5867@tucnak>
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