public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix hard regno checks
@ 2018-07-23  9:14 Ilya Leoshkevich
  2018-07-27 15:36 ` Vladimir Makarov
  0 siblings, 1 reply; 3+ messages in thread
From: Ilya Leoshkevich @ 2018-07-23  9:14 UTC (permalink / raw)
  To: gcc-patches; +Cc: krebbel, jasonwucj, zadeck, jakub, vmakarov, Ilya Leoshkevich

FIRST_PSEUDO_REGISTER is not a hard regno, so comparisons should use
"<" instead of "<=", and ">=" instread of ">".

2018-07-19  Ilya Leoshkevich  <iii@linux.ibm.com>

	* config/nds32/nds32.c (nds32_hard_regno_mode_ok):
        Replace > with >=.
	* df-problems.c (df_remove_dead_eq_notes):
        Replace > with >=.
	* dwarf2out.c (mem_loc_descriptor):
        Replace > with >=.
	* lra-constraints.c (spill_hard_reg_in_range):
        Replace <= with <.
	* lra-remat.c (call_used_input_regno_present_p):
        Replace <= with <.
---
 gcc/config/nds32/nds32.c | 2 +-
 gcc/df-problems.c        | 2 +-
 gcc/dwarf2out.c          | 2 +-
 gcc/lra-constraints.c    | 2 +-
 gcc/lra-remat.c          | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gcc/config/nds32/nds32.c b/gcc/config/nds32/nds32.c
index 85a29865c7a..721135e6ba1 100644
--- a/gcc/config/nds32/nds32.c
+++ b/gcc/config/nds32/nds32.c
@@ -4342,7 +4342,7 @@ nds32_hard_regno_nregs (unsigned regno ATTRIBUTE_UNUSED,
 static bool
 nds32_hard_regno_mode_ok (unsigned int regno, machine_mode mode)
 {
-  if (regno > FIRST_PSEUDO_REGISTER)
+  if (regno >= FIRST_PSEUDO_REGISTER)
     return true;
 
   if ((TARGET_FPU_SINGLE || TARGET_FPU_DOUBLE) && NDS32_IS_FPR_REGNUM (regno))
diff --git a/gcc/df-problems.c b/gcc/df-problems.c
index 3d73bc5df10..7ccb57c287a 100644
--- a/gcc/df-problems.c
+++ b/gcc/df-problems.c
@@ -3205,7 +3205,7 @@ df_remove_dead_eq_notes (rtx_insn *insn, bitmap live)
 	    bool deleted = false;
 
 	    FOR_EACH_INSN_EQ_USE (use, insn)
-	      if (DF_REF_REGNO (use) > FIRST_PSEUDO_REGISTER
+	      if (DF_REF_REGNO (use) >= FIRST_PSEUDO_REGISTER
 		  && DF_REF_LOC (use)
 		  && (DF_REF_FLAGS (use) & DF_REF_IN_NOTE)
 		  && !bitmap_bit_p (live, DF_REF_REGNO (use))
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index bd45e0b0685..d38aa10ebe6 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -15478,7 +15478,7 @@ mem_loc_descriptor (rtx rtl, machine_mode mode,
 
 	  if (dwarf_strict && dwarf_version < 5)
 	    break;
-	  if (REGNO (rtl) > FIRST_PSEUDO_REGISTER)
+	  if (REGNO (rtl) >= FIRST_PSEUDO_REGISTER)
 	    break;
 	  type_die = base_type_for_mode (mode, SCALAR_INT_MODE_P (mode));
 	  if (type_die == NULL)
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index 7eeec767445..f2e4f36ebd0 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -5709,7 +5709,7 @@ spill_hard_reg_in_range (int regno, enum reg_class rclass, rtx_insn *from, rtx_i
       struct lra_insn_reg *reg;
       
       for (reg = id->regs; reg != NULL; reg = reg->next)
-	if (reg->regno <= FIRST_PSEUDO_REGISTER)
+	if (reg->regno < FIRST_PSEUDO_REGISTER)
 	  SET_HARD_REG_BIT (ignore, reg->regno);
       for (reg = static_id->hard_regs; reg != NULL; reg = reg->next)
 	SET_HARD_REG_BIT (ignore, reg->regno);
diff --git a/gcc/lra-remat.c b/gcc/lra-remat.c
index 527f2dd2b59..faf74ca8de7 100644
--- a/gcc/lra-remat.c
+++ b/gcc/lra-remat.c
@@ -708,7 +708,7 @@ call_used_input_regno_present_p (rtx_insn *insn)
     for (reg = (iter == 0 ? id->regs : static_id->hard_regs);
 	 reg != NULL;
 	 reg = reg->next)
-      if (reg->type == OP_IN && reg->regno <= FIRST_PSEUDO_REGISTER
+      if (reg->type == OP_IN && reg->regno < FIRST_PSEUDO_REGISTER
 	  && TEST_HARD_REG_BIT (call_used_reg_set, reg->regno))
 	return true;
   return false;
-- 
2.18.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix hard regno checks
  2018-07-23  9:14 [PATCH] Fix hard regno checks Ilya Leoshkevich
@ 2018-07-27 15:36 ` Vladimir Makarov
  2018-08-02 22:40   ` Jeff Law
  0 siblings, 1 reply; 3+ messages in thread
From: Vladimir Makarov @ 2018-07-27 15:36 UTC (permalink / raw)
  To: gcc-patches

On 07/23/2018 05:14 AM, Ilya Leoshkevich wrote:
> FIRST_PSEUDO_REGISTER is not a hard regno, so comparisons should use
> "<" instead of "<=", and ">=" instread of ">".
>
Thank you for finding these typos.  LRA parts of the patch are ok for me.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix hard regno checks
  2018-07-27 15:36 ` Vladimir Makarov
@ 2018-08-02 22:40   ` Jeff Law
  0 siblings, 0 replies; 3+ messages in thread
From: Jeff Law @ 2018-08-02 22:40 UTC (permalink / raw)
  To: Vladimir Makarov, gcc-patches

On 07/27/2018 09:36 AM, Vladimir Makarov wrote:
> On 07/23/2018 05:14 AM, Ilya Leoshkevich wrote:
>> FIRST_PSEUDO_REGISTER is not a hard regno, so comparisons should use
>> "<" instead of "<=", and ">=" instread of ">".
>>
> Thank you for finding these typos.  LRA parts of the patch are ok for me.
The rest look good as well.  I went ahead and committed the changes to
the trunk.
jeff

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-08-02 22:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-23  9:14 [PATCH] Fix hard regno checks Ilya Leoshkevich
2018-07-27 15:36 ` Vladimir Makarov
2018-08-02 22:40   ` Jeff Law

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).