public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jozef Lawrynowicz <jozef.l@mittosystems.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: gcc@gcc.gnu.org
Subject: Re: How to update .debug_frame CFA offset for function epilogues?
Date: Mon, 25 May 2020 18:20:49 +0100	[thread overview]
Message-ID: <20200525172049.2qtv2nokhyj7heu2@jozef-acer-manjaro> (raw)
In-Reply-To: <20200331214953.GW22482@gate.crashing.org>

Hi Segher,

On Tue, Mar 31, 2020 at 04:49:53PM -0500, Segher Boessenkool wrote:
> Hi Jozef,
> 
> On Thu, Mar 26, 2020 at 12:33:38PM +0000, Jozef Lawrynowicz wrote:
> > In some cases, I can fix the CFA offset by marking these epilogue insns as
> > frame_related anyway, and adding reg notes which describe the stack pointer
> > operations. For some other epilogue insns, marking them frame_related results in
> > an ICE, which I'm assuming comes back to the fact that epilogue insns shouldn't
> > be marked frame related.
> 
> > What is the standard way for updating the CFA offset in the epilogue?
> 
> What you already say you do: add notes, and often frame_related is set
> as well.  I agree that shouldn't be done, but it often is harmless.
> 
> You need reg_notes for more than just the stack updates: importantly,
> also for the restores of any saved register.

Thanks for the advice, indeed the reason I was having problems was
because not all stack operations were properly annotated with reg notes.

The reason I was seeing the ICE was because of unspec insns which were marked
as frame related but didn't have accompanything reg notes, of course it
is now clear that stack modifications in an unspec need to be explicitly
described.

(Apologies for the late response, but I figure I may as well document
the conclusion came to with this.)

Jozef

> 
> 
> Segher

  reply	other threads:[~2020-05-25 17:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-26 12:33 Jozef Lawrynowicz
2020-03-31 21:49 ` Segher Boessenkool
2020-05-25 17:20   ` Jozef Lawrynowicz [this message]
2020-05-25 17:54     ` Segher Boessenkool

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200525172049.2qtv2nokhyj7heu2@jozef-acer-manjaro \
    --to=jozef.l@mittosystems.com \
    --cc=gcc@gcc.gnu.org \
    --cc=segher@kernel.crashing.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).