diff mbox series

[committed] rtl-ssa: Fix reg_raw_mode thinko [PR98347]

Message ID mpteejons7o.fsf@arm.com
State New
Headers show
Series [committed] rtl-ssa: Fix reg_raw_mode thinko [PR98347] | expand

Commit Message

Richard Sandiford Dec. 17, 2020, 7:32 p.m. UTC
I'd used reg_raw_mode[regno] for general registers, even though
the array is only valid for hard registers.  This patch uses
regno_reg_rtx instead.

Tested on i686-linux-gnu, committed as obvious.

Richard


gcc/
	PR rtl-optimization/98347
	* rtl-ssa/access-utils.h (full_register): Use regno_reg_rtx
	instead of reg_raw_mode.
---
 gcc/rtl-ssa/access-utils.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gcc/rtl-ssa/access-utils.h b/gcc/rtl-ssa/access-utils.h
index b200e3416d7..634f99bad88 100644
--- a/gcc/rtl-ssa/access-utils.h
+++ b/gcc/rtl-ssa/access-utils.h
@@ -23,7 +23,7 @@  namespace rtl_ssa {
 inline resource_info
 full_register (unsigned int regno)
 {
-  return { reg_raw_mode[regno], regno };
+  return { GET_MODE (regno_reg_rtx[regno]), regno };
 }
 
 // Return true if sorted array ACCESSES includes an access to hard registers.