sparc symbolic_operand fix

Richard Henderson rth@cygnus.com
Wed Oct 13 21:45:00 GMT 1999


Needed to fix sparc64 regressions spotted by Jim:

   We partially match the call_value_symbolic_sp32 pattern, failing only
   when we get to the clobber.  With the new genrecog, we then do not
   attempt a match against call_value_symbolic_sp64 because it assumes
   that a DImode predicate can not match if a SImode predicate did.  We
   thus end up with an unrecognizable insn.


r~

        * sparc.c (symbolic_operand): Verify mode; don't accept CONST_DOUBLE.
        * sparc.h (PREDICATE_CODES): Update.

Index: sparc.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/sparc/sparc.c,v
retrieving revision 1.83
diff -c -p -d -r1.83 sparc.c
*** sparc.c	1999/09/14 16:27:31	1.83
--- sparc.c	1999/10/14 04:41:24
*************** symbolic_operand (op, mode)
*** 490,495 ****
--- 490,500 ----
       register rtx op;
       enum machine_mode mode;
  {
+   enum machine_mode omode = GET_MODE (op);
+ 
+   if (omode != mode && omode != VOIDmode && mode != VOIDmode)
+     return 0;
+ 
    switch (GET_CODE (op))
      {
      case SYMBOL_REF:
*************** symbolic_operand (op, mode)
*** 501,510 ****
        return ((GET_CODE (XEXP (op, 0)) == SYMBOL_REF
  	       || GET_CODE (XEXP (op, 0)) == LABEL_REF)
  	      && GET_CODE (XEXP (op, 1)) == CONST_INT);
- 
-       /* ??? This clause seems to be irrelevant.  */
-     case CONST_DOUBLE:
-       return GET_MODE (op) == mode;
  
      default:
        return 0;
--- 506,511 ----
Index: sparc.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/sparc/sparc.h,v
retrieving revision 1.81
diff -c -p -d -r1.81 sparc.h
*** sparc.h	1999/09/14 16:27:32	1.81
--- sparc.h	1999/10/14 04:41:24
*************** do {									\
*** 3238,3244 ****
  {"call_operand", {MEM}},						\
  {"call_operand_address", {SYMBOL_REF, LABEL_REF, CONST, CONST_DOUBLE,	\
  	ADDRESSOF, SUBREG, REG, PLUS, LO_SUM, CONST_INT}},		\
! {"symbolic_operand", {SYMBOL_REF, LABEL_REF, CONST, CONST_DOUBLE}},	\
  {"symbolic_memory_operand", {SUBREG, MEM}},				\
  {"label_ref_operand", {LABEL_REF}},					\
  {"sp64_medium_pic_operand", {CONST}},					\
--- 3238,3244 ----
  {"call_operand", {MEM}},						\
  {"call_operand_address", {SYMBOL_REF, LABEL_REF, CONST, CONST_DOUBLE,	\
  	ADDRESSOF, SUBREG, REG, PLUS, LO_SUM, CONST_INT}},		\
! {"symbolic_operand", {SYMBOL_REF, LABEL_REF, CONST}},			\
  {"symbolic_memory_operand", {SUBREG, MEM}},				\
  {"label_ref_operand", {LABEL_REF}},					\
  {"sp64_medium_pic_operand", {CONST}},					\


More information about the Gcc-patches mailing list