public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Chung-Lin Tang <cltang@codesourcery.com>
To: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: [PATCH 1/2] SH epilogue unwind, dwarf2 pass changes
Date: Fri, 18 May 2012 10:48:00 -0000	[thread overview]
Message-ID: <4FB628F9.7010901@codesourcery.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 542 bytes --]

Hi,

I found a few changes were needed to the dwarf2 pass when trying to
implement epilogue unwind for SH, mainly that the current handling of
annulled-taken branches does not seem correct; the delay slot insn
should be handled in a manner similar to an insn in the fallthru block.

Cross-tested on SH and MIPS, and bootstrapped/tested on x86_64.

Thanks,
Chung-Lin

2012-05-18  Chung-Lin Tang  <cltang@codesourcery.com>

	* dwarf2cfi.c (scan_trace): Update CFA before exiting scan.
	Handle annulled-taken branch (!INSN_FROM_TARGET_P) case.


[-- Attachment #2: dwarf2cfi.patch --]
[-- Type: text/plain, Size: 921 bytes --]

Index: dwarf2cfi.c
===================================================================
--- dwarf2cfi.c	(revision 187548)
+++ dwarf2cfi.c	(working copy)
@@ -2401,6 +2401,7 @@ scan_trace (dw_trace_info *trace)
 	{
 	  /* Propagate across fallthru edges.  */
 	  dwarf2out_flush_queued_reg_saves ();
+	  def_cfa_1 (&this_cfa);
 	  maybe_record_trace_start (insn, NULL);
 	  break;
 	}
@@ -2455,6 +2456,18 @@ scan_trace (dw_trace_info *trace)
 		  cur_cfa = &this_cfa;
 		  continue;
 		}
+	      else
+		{
+		  /* If ELT is a annulled branch-taken instruction (i.e. executed
+		     only when branch is not taken), the args_size and CFA should
+		     not change through the jump.  */
+		  create_trace_edges (control);
+
+		  /* Update and continue with the trace.  */
+		  add_cfi_insn = insn;
+		  scan_insn_after (elt);
+		  continue;
+		}
 	    }
 
 	  /* The insns in the delay slot should all be considered to happen

             reply	other threads:[~2012-05-18 10:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-18 10:48 Chung-Lin Tang [this message]
2012-05-22 17:35 ` Richard Henderson
2012-05-22 17:46 ` Richard Henderson
2012-06-01 10:24   ` Chung-Lin Tang
2012-06-11  8:50     ` Chung-Lin Tang
2012-06-11 18:28       ` Richard Henderson

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=4FB628F9.7010901@codesourcery.com \
    --to=cltang@codesourcery.com \
    --cc=gcc-patches@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).