Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Anitha Boyapati <anitha.boyapati@gmail.com>
To: Richard Henderson <rth@redhat.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Cc: "Petr Hluzín" <petr.hluzin@gmail.com>,
	gdb@sourceware.org, chertykov@gmail.com, aesok@post.ru,
	eric.weddington@atmel.com
Subject: Re: [avr] gas support for cfi info
Date: Tue, 22 Feb 2011 16:18:00 -0000	[thread overview]
Message-ID: <AANLkTimgTpm7EFz+6D6XgS6af8Ls+FFZXzs4-i5pMCid@mail.gmail.com> (raw)
In-Reply-To: <4D5D7C86.2080804@redhat.com>

2011/2/18 Richard Henderson <rth@redhat.com>
>
> On 02/17/2011 08:04 AM, Richard Henderson wrote:
> >> The other scenario is - how about functions with signals/interrupts?
> >> The compiler will give an ICE compiling a function as below:
> >>
> >> void my_interrupt_handler() __attribute__ (("interrupt"));
> >
> > It's a bug in the avr backend; the enable_interrupt insn should not be
> > marked as frame-related.  We should fix this separately.
>
> Looking at this closer, it seem that the FRAME_RELATED markers in avr.c
> were sprinkled at random without really knowing what is going on.

This is quite a clean up! I am yet to reach the changes in expand_epilogue.

>  There
> were 2 places where UNSPEC_VOLATILE insns were marked frame related,
> somehow expecting the unwinder to do something magical.
>

Just to be on same page, these are the 2 places:

1. gen_enable_interrupt()
2. gen_call_prologue_saves()


For the latter, can you  explain why adding reg notes is required?

+      add_reg_note (insn, REG_CFA_ADJUST_CFA,
+		    gen_rtx_SET (VOIDmode,
+				 (frame_pointer_needed
+				  ? frame_pointer_rtx : stack_pointer_rtx),
+				 plus_constant (stack_pointer_rtx,
+						-(size + live_seq))));
+

(The comment does say that this is to describe the effect of
UNSPEC_VOLATILE, but how reg notes help?)


> The following cleans all that up.  There are a couple of odd points:
>
>  (1) SREG and RAMPZ cannot be annotated as saved in the frame of an
>      interrupt function without allocating hard register numbers for
>      these registers.  Not to be confused with "real" registers,
>      these need a number in the same way that SP_L and SP_H have
>      register numbers.
>
>      I've simply ignored unwind info for these for now.
>

In addition to the above, there are atleast 4 more registers RAMPX,
RAMPY, RAMPD and EIND. (Actually the support for these registers is in
the form of patches which aren't upstream yet)


>  (2) At present it's possible to use epilogue_restores without
>      having used prologue_saves.  I.e. use epilogue_restores with
>      an inline prologue.  The problem being that the inline prologue
>      uses an HImode push of REG_Y (i.e. r29 first), whereas the code
>      in prologue_saves pushes r28 first and epilogue_restores is
>      written to expect that.
>

Is this is the line being referred to ?

if (frame_pointer_needed)
  {
...
   /* Push frame pointer.  */
insn = emit_move_insn (pushword, frame_pointer_rtx);


On the whole, when the patch is applied, an ICE is longer generated
during the compilation of interrupt and signal functions.  I am yet to
see the changes due to ARG_POINTER_CFA_OFFSET(FNDECL) definition and
the complete unwind info incase of interrupts.

Anitha


  reply	other threads:[~2011-02-22 16:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-01 13:04 Testing Call frame information in .debug_frame section Anitha Boyapati
2011-02-13  2:34 ` Petr Hluzín
2011-02-13  9:57   ` Anitha Boyapati
2011-02-13 15:11     ` Petr Hluzín
2011-02-15 17:41       ` Richard Henderson
2011-02-15 18:09         ` Anitha Boyapati
2011-02-15 18:48           ` Richard Henderson
2011-02-15 19:15             ` Anitha Boyapati
2011-02-15 19:03         ` [avr] gas support for cfi info Richard Henderson
2011-02-15 22:45           ` Petr Hluzín
2011-02-16 17:59             ` Richard Henderson
2011-02-16 22:49               ` Petr Hluzín
2011-02-17 16:12                 ` Richard Henderson
2011-02-17 16:16                   ` Tristan Gingold
2011-02-17 15:35               ` Anitha Boyapati
2011-02-17 16:05                 ` Richard Henderson
2011-02-17 19:53                   ` Richard Henderson
2011-02-22 16:18                     ` Anitha Boyapati [this message]
2011-02-22 17:51                       ` Richard Henderson
2011-02-15 18:18       ` Testing Call frame information in .debug_frame section Anitha Boyapati
2011-02-15 22:12         ` Petr Hluzín
2011-02-14 16:42     ` Tom Tromey
2011-02-14 22:43       ` Petr Hluzín
2011-02-15 15:06         ` Tom Tromey

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=AANLkTimgTpm7EFz+6D6XgS6af8Ls+FFZXzs4-i5pMCid@mail.gmail.com \
    --to=anitha.boyapati@gmail.com \
    --cc=aesok@post.ru \
    --cc=chertykov@gmail.com \
    --cc=eric.weddington@atmel.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gdb@sourceware.org \
    --cc=petr.hluzin@gmail.com \
    --cc=rth@redhat.com \
    /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