public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: gcc-patches@gcc.gnu.org
Cc: dje.gcc@gmail.com,	Segher Boessenkool <segher@kernel.crashing.org>
Subject: [PATCH 1/3] rs6000: rs6000_dbx_register_number for fp/ap/mq
Date: Mon, 06 May 2019 21:56:00 -0000	[thread overview]
Message-ID: <87d86acc61792d5a094148360a5b46f4a4a3ba01.1557171132.git.segher@kernel.crashing.org> (raw)

The frame pointer and the argument pointer aren't real registers.  MQ
was a register on old POWER.  All three are still used as arguments to
rs6000_dbx_register_number during initialisation.  If we handle them
explicitly we can do a gcc_unreachable to catch other unexpected
registers.

Tested on powerpc64-linux {-m32,-m64} and on powerpc64le-linux;
installing on trunk.


Segher


2019-05-06  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/rs6000.c (rs6000_dbx_register_number): Handle
	FRAME_POINTER_REGNUM, ARG_POINTER_REGNUM, and 64 (which was MQ).

--
 gcc/config/rs6000/rs6000.c | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index c75fd86..6f46fdd 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -36305,7 +36305,15 @@ rs6000_dbx_register_number (unsigned int regno, unsigned int format)
       if (regno == TEXASR_REGNO)
 	return 230;
 
-      return regno;
+      /* These do not make much sense.  */
+      if (regno == FRAME_POINTER_REGNUM)
+	return 111;
+      if (regno == ARG_POINTER_REGNUM)
+	return 67;
+      if (regno == 64)
+	return 100;
+
+      gcc_unreachable ();
 #endif
     }
 
@@ -36337,7 +36345,14 @@ rs6000_dbx_register_number (unsigned int regno, unsigned int format)
   if (regno == TEXASR_REGNO)
     return 116;
 
-  return regno;
+  if (regno == FRAME_POINTER_REGNUM)
+    return 111;
+  if (regno == ARG_POINTER_REGNUM)
+    return 67;
+  if (regno == 64)
+    return 64;
+
+  gcc_unreachable ();
 }
 
 /* target hook eh_return_filter_mode */
-- 
1.8.3.1

             reply	other threads:[~2019-05-06 21:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-06 21:56 Segher Boessenkool [this message]
2019-05-06 21:56 ` [PATCH 2/3] rs6000: Delete PRE_GCC3_DWARF_FRAME_REGISTERS Segher Boessenkool
2023-01-13 18:05   ` Jakub Jelinek
2023-01-14 13:38     ` Segher Boessenkool
2023-01-14 14:10       ` Jakub Jelinek
2019-05-06 21:56 ` [PATCH 3/3] rs6000: Remove TM regs 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=87d86acc61792d5a094148360a5b46f4a4a3ba01.1557171132.git.segher@kernel.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=dje.gcc@gmail.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).