public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bernd Schmidt <bernds@codesourcery.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Handle multi-word regsiters in REG_CFA_RESTORE notes
Date: Thu, 15 Sep 2011 02:42:00 -0000	[thread overview]
Message-ID: <4E7150E4.10004@codesourcery.com> (raw)

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

While testing the altest iteration of shrink-wrapping on mips-elf, a new
failure showed up in gcc.dg/pr43139.c. When restoring floating-point
registers, we attach REG_CFA_RESTORE notes for DFmode registers, but the
dwarf2cfi code only records a single regno for such a multiword hard reg.

Fixed with this patch, tested with shrink-wrapping on mips-elf (default
multilib plus two with -mips16). Ok?


Bernd

[-- Attachment #2: cfa-multiword.diff --]
[-- Type: text/plain, Size: 865 bytes --]

	* dwarf2cfi.c (dwarf2out_frame_debug_cfa_expression): Handle
	multi-word registers.

Index: gcc/dwarf2cfi.c
===================================================================
--- gcc/dwarf2cfi.c	(revision 178734)
+++ gcc/dwarf2cfi.c	(working copy)
@@ -1236,10 +1236,15 @@ dwarf2out_frame_debug_cfa_expression (rt
 static void
 dwarf2out_frame_debug_cfa_restore (rtx reg)
 {
-  unsigned int regno = dwf_regno (reg);
+  unsigned int orig_regno = REGNO (reg);
+  int nregs = hard_regno_nregs[orig_regno][GET_MODE (reg)];
+  while (nregs-- > 0)
+    {
+      unsigned int regno = DWARF_FRAME_REGNUM (orig_regno + nregs);
 
-  add_cfi_restore (regno);
-  update_row_reg_save (cur_row, regno, NULL);
+      add_cfi_restore (regno);
+      update_row_reg_save (cur_row, regno, NULL);
+    }
 }
 
 /* A subroutine of dwarf2out_frame_debug, process a REG_CFA_WINDOW_SAVE.

             reply	other threads:[~2011-09-15  1:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-15  2:42 Bernd Schmidt [this message]
2011-09-15 20:41 ` Richard Henderson
2011-09-21 15:14   ` Bernd Schmidt
2011-09-21 17:47     ` Richard Henderson
2011-09-22 22:09       ` Bernd Schmidt
2011-09-25 19:54         ` Richard Sandiford
2011-09-27 12:57           ` Bernd Schmidt

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=4E7150E4.10004@codesourcery.com \
    --to=bernds@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).