public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "amylaar at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/18032] [4.0.0] SH: wrong code for EH
Date: Mon, 18 Oct 2004 15:49:00 -0000	[thread overview]
Message-ID: <20041018154915.6726.qmail@sourceware.org> (raw)
In-Reply-To: <20041016082157.18032.kkojima@gcc.gnu.org>


------- Additional Comments From amylaar at gcc dot gnu dot org  2004-10-18 15:49 -------
We don't emit call frame information for the epilogue.  If we did, than any
basic blocks that happen to come after the epilogue due to block reordering
would end up with incorrect cfi information, since we don't have any machinery
for writing compensating cfi when we skip over an epilogue.

Thus, the only way we have to make this work with the current infrastructure
is to avoid scheduling the epilogue with previous basic blocks when exception
handling is enabled (this also affects debugging information, but I'd say we
shouldn't pessimize -O2 code to get better debugging information).

There is already code in sh.c:sh_expand_epilogue to emit a blockage instruction
before the stack adjustments.  However, if a frame pointer is needed, the
initial adjustment of the frame pointer isn't adjusted, since this doesn't
matter for interrupts:
 
  if (frame_pointer_needed)
    {
      output_stack_adjust (frame_size, frame_pointer_rtx, e, &live_regs_mask);

      /* We must avoid moving the stack pointer adjustment past code
         which reads from the local frame, else an interrupt could
         occur after the SP adjustment and clobber data in the local
         frame.  */
      emit_insn (gen_blockage ());
      emit_insn (GEN_MOV (stack_pointer_rtx, frame_pointer_rtx));
    }

So, if flag_exceptions is set, we should emit this blockage before the frame
pointer adjustment.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amylaar at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18032


  parent reply	other threads:[~2004-10-18 15:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-16  8:22 [Bug target/18032] New: " kkojima at gcc dot gnu dot org
2004-10-16  8:26 ` [Bug target/18032] " kkojima at gcc dot gnu dot org
2004-10-16 13:58 ` pinskia at gcc dot gnu dot org
2004-10-18 15:49 ` amylaar at gcc dot gnu dot org [this message]
2004-10-18 22:43 ` kkojima at gcc dot gnu dot org
2004-10-20 13:57 ` cvs-commit at gcc dot gnu dot org
2004-10-20 17:39 ` pinskia at gcc dot gnu dot org

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=20041018154915.6726.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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).