RA sometimes will use lowest the cost of the mode with all different regclasses
w/o check if it's hard_regno_mode_ok.
It's impossible to put modes whose size > 8 into MASK_REGS, ajdust the cost to
avoid potential performance issue.

Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}.
Ok for trunk?

gcc/ChangeLog:

        * config/i386/i386.cc (inline_memory_move_cost): Return 100
        for MASK_REGS when MODE_SIZE > 8.
---
 gcc/config/i386/i386.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
index 2cc8e9548a9..2581b800a06 100644
--- a/gcc/config/i386/i386.cc
+++ b/gcc/config/i386/i386.cc
@@ -19847,9 +19847,12 @@ inline_memory_move_cost (machine_mode mode, enum 
reg_class regclass, int in)
          index = 1;
          break;
        /* DImode loads and stores assumed to cost the same as SImode.  */
-       default:
+       case 4:
+       case 8:
          index = 2;
          break;
+       default:
+         return 100;
        }
 
       if (in == 2)
-- 
2.39.1.388.g2fc9e9ca3c

Reply via email to