From e294835aed9d0ad48131b1c91c9a7c774ea64a37 Mon Sep 17 00:00:00 2001 From: Segher Boessenkool Date: Tue, 7 May 2019 00:01:27 +0200 Subject: [PATCH] rs6000: rs6000_dbx_register_number for fp/ap/mq 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. * config/rs6000/rs6000.c (rs6000_dbx_register_number): Handle FRAME_POINTER_REGNUM, ARG_POINTER_REGNUM, and 64 (which was MQ). From-SVN: r270925 --- gcc/ChangeLog | 5 +++++ gcc/config/rs6000/rs6000.c | 19 +++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 95bddb35f781..0bec5e924dc5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-05-06 Segher Boessenkool + + * config/rs6000/rs6000.c (rs6000_dbx_register_number): Handle + FRAME_POINTER_REGNUM, ARG_POINTER_REGNUM, and 64 (which was MQ). + 2019-05-06 Jakub Jelinek PR tree-optimization/88709 diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 23db1302715d..1e5eef8d51b7 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -36309,7 +36309,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 } @@ -36341,7 +36349,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 */ -- 2.47.2