This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] fix hardreg_cprop to honor HARD_REGNO_MODE_OK.
- From: Ilya Tocar <tocarip dot intel at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 11 Aug 2014 17:49:37 +0400
- Subject: [PATCH] fix hardreg_cprop to honor HARD_REGNO_MODE_OK.
- Authentication-results: sourceware.org; auth=none
Hi,
I've observed SPEC2006 failure on avx512-vlbwdq branch.
It was caused by hardreg_cprop. In maybe_mode_change it was
assumed, that all values of the same register class and same mode.
are ok. This is not the case for i386/avx512. We need to honor
HARD_REGNO_MODE_OK.
Patch bellow does it.
Ok for trunk?
2014-08-11 Ilya Tocar <ilya.tocar@intel.com>
* regcprop.c (maybe_mode_change): Honor HARD_REGNO_MODE_OK.
---
gcc/regcprop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/regcprop.c b/gcc/regcprop.c
index 932037d..694deb2 100644
--- a/gcc/regcprop.c
+++ b/gcc/regcprop.c
@@ -410,7 +410,7 @@ maybe_mode_change (enum machine_mode orig_mode, enum machine_mode copy_mode,
&& GET_MODE_SIZE (copy_mode) < GET_MODE_SIZE (new_mode))
return NULL_RTX;
- if (orig_mode == new_mode)
+ if (orig_mode == new_mode && HARD_REGNO_MODE_OK (regno, new_mode))
return gen_rtx_raw_REG (new_mode, regno);
else if (mode_change_ok (orig_mode, new_mode, regno))
{
--
1.8.3.1