public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] fix hardreg_cprop to honor HARD_REGNO_MODE_OK.
@ 2014-08-11 13:49 Ilya Tocar
  2014-08-13 20:31 ` Jeff Law
  0 siblings, 1 reply; 8+ messages in thread
From: Ilya Tocar @ 2014-08-11 13:49 UTC (permalink / raw)
  To: gcc-patches

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

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

end of thread, other threads:[~2014-10-10 22:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-11 13:49 [PATCH] fix hardreg_cprop to honor HARD_REGNO_MODE_OK Ilya Tocar
2014-08-13 20:31 ` Jeff Law
2014-08-14 13:16   ` Ilya Tocar
2014-08-29 21:03     ` Jeff Law
2014-09-01 10:29       ` Ilya Tocar
2014-09-25 19:14         ` Jeff Law
2014-09-26 15:32           ` Ilya Tocar
2014-10-10 23:10             ` 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).