------- Comment #16 from hjl dot tools at gmail dot com  2009-02-12 19:25 
-------
Subject: Re:  [4.4 regression] Revision 144098 breaks
        416.gamess in SPEC CPU 2006

On Thu, Feb 12, 2009 at 07:05:27PM -0000, bonzini at gnu dot org wrote:
> Subject: Re:  [4.4 regression] Revision 144098 breaks 
>         416.gamess in SPEC CPU 2006
> 
> > The patch is obviously okay, but it seems weird that this is accepted.
> >  I must be missing something on peephole2...
> 
> By obviously okay I don't mean that it should not be approved by a
> maintainer.  In fact, I wonder if the peephole2 shouldn't even be
> restricted to GENERAL_REGNO_P.
> 

We can't limit it to GENERAL_REGNO_P. See PR 38824. Here is a
different patch.

H.J.
---
--- gcc/config/i386/i386-protos.h.class 2008-10-07 14:03:40.000000000 -0700
+++ gcc/config/i386/i386-protos.h       2009-02-12 10:49:30.000000000 -0800
@@ -160,6 +160,7 @@ extern bool ix86_cannot_change_mode_clas
                                           enum machine_mode, enum reg_class);
 extern enum reg_class ix86_preferred_reload_class (rtx, enum reg_class);
 extern enum reg_class ix86_preferred_output_reload_class (rtx, enum
reg_class);
+extern enum reg_class ix86_hard_reg_class (int regno);
 extern int ix86_memory_move_cost (enum machine_mode, enum reg_class, int);
 extern int ix86_mode_needed (int, rtx);
 extern void emit_i387_cw_initialization (int);
--- gcc/config/i386/i386.c.class        2009-02-12 10:48:41.000000000 -0800
+++ gcc/config/i386/i386.c      2009-02-12 11:21:21.000000000 -0800
@@ -29483,6 +29483,23 @@ ix86_enum_va_list (int idx, const char *
   return 1;
 }

+/* Return GENERAL_REGS, FLOAT_REGS, MMX_REGS or SSE_REGS for hard 
+   register REGNO.  Return FLOAT_REGS for FP stack registers.  */
+
+enum reg_class
+ix86_hard_reg_class (int regno)
+{
+  if (GENERAL_REGNO_P (regno))
+    return GENERAL_REGS;
+  if (FP_REGNO_P (regno))
+    return FLOAT_REGS;
+  if (SSE_REGNO_P (regno))
+    return SSE_REGS;
+  if (MMX_REGNO_P (regno))
+    return MMX_REGS;
+  gcc_unreachable ();
+}
+
 /* Initialize the GCC target structure.  */
 #undef TARGET_RETURN_IN_MEMORY
 #define TARGET_RETURN_IN_MEMORY ix86_return_in_memory
--- gcc/config/i386/i386.md.class       2009-02-12 09:17:09.000000000 -0800
+++ gcc/config/i386/i386.md     2009-02-12 10:51:12.000000000 -0800
@@ -20736,7 +20736,9 @@
                      [(match_dup 0)
                       (match_operand:SI 2 "memory_operand" "")]))
               (clobber (reg:CC FLAGS_REG))])]
-  "operands[0] != operands[1]"
+  "operands[0] != operands[1]
+   && ix86_hard_reg_class (REGNO (operands[0]))
+      == ix86_hard_reg_class (REGNO (operands[1]))"
   [(set (match_dup 0) (match_dup 4))
    (parallel [(set (match_dup 0)
                    (match_op_dup 3 [(match_dup 0) (match_dup 1)]))


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39152

Reply via email to