This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

patch: instantiate_virtual_regs and frv breakage


Hi folks.

FR-V on mainline is broken.

The simple varargs program below fails in instantiate_virtual_regs_in_insn.

The problem is that, with the new instantiation code, we expect
arithmetic on the virtual registers to yield a valid instruction.  In
the ICE below, we try to replace "virtual-incoming-args" with the 
fake AP register.  However, the addsi3 pattern only accepts GPRs.

This is unfortunate, since we would eliminate the AP register in the last
codegen stages.

We could put the AP register in the GPR register class, but the simpler patch 
below, relaxes the conditions of the integer_register_operand predicate, and 
also works.  Does anyone know why the AP register wasn't considered a
GPR in the first place?

Anyways, committed to mainline.  I'm willing to revisit this, if someone
has a better solution, but this will do to get FRV in a buildable state,
so I can fix other problems with the toolchain.

Tested on ppc64-linux x frv-elf with the simulator.

Aldy

a.i: In function â??fiprintfâ??:
a.i:8: error: unrecognizable insn:
(insn 11 22 12 1 (set (reg:SI 179)
        (plus:SI (reg/f:SI 168 ap)
            (const_int -16 [0xfffffff0]))) -1 (nil)
    (nil))
a.i:8: internal compiler error: in instantiate_virtual_regs_in_insn, at function.c:1539

void fiprintf(int * fp, const char *fmt,...)
{
  __builtin_va_list ap;


  __builtin_va_start(ap,fmt);
}

---------snip------------

	* config/frv/predicates.md (integer_register_operand): Use
	GPR_AP_OR_PSEUDO_P.

Index: config/frv/predicates.md
===================================================================
RCS file: /cvs/uberbaum/gcc/config/frv/predicates.md,v
retrieving revision 1.2
diff -c -p -r1.2 predicates.md
*** config/frv/predicates.md	25 Jun 2005 01:21:05 -0000	1.2
--- config/frv/predicates.md	25 Jul 2005 21:32:20 -0000
***************
*** 37,43 ****
    if (GET_CODE (op) != REG)
      return FALSE;
  
!   return GPR_OR_PSEUDO_P (REGNO (op));
  })
  
  ;; Return 1 is OP is a memory operand, or will be turned into one by
--- 37,43 ----
    if (GET_CODE (op) != REG)
      return FALSE;
  
!   return GPR_AP_OR_PSEUDO_P (REGNO (op));
  })
  
  ;; Return 1 is OP is a memory operand, or will be turned into one by


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]