public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Question about unspec and canon_reg()
@ 2001-12-14  4:08 Marco Altieri
  0 siblings, 0 replies; only message in thread
From: Marco Altieri @ 2001-12-14  4:08 UTC (permalink / raw)
  To: gcc

I am working on a gcc porting for a DSP architecture.
It happens that, while performing cse pass, in function
canon_reg() gcc tries to substitute each pseudoreg
with its older reference.
The problem we have is that when a pseudoreg appears
as an element of the vector operand of an unspec rtx, 
gcc performs substitution without checking the validity
of the resulting insn:

 fmt = GET_RTX_FORMAT (code);
  for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
    {
      register int j;

      if (fmt[i] == 'e')
	{
	  rtx new = canon_reg (XEXP (x, i), insn);
	  int insn_code;

	  /* If replacing pseudo with hard reg or vice versa, ensure the
	     insn remains valid.  Likewise if the insn has MATCH_DUPs.  */
	  if (insn != 0 && new != 0
	      && GET_CODE (new) == REG && GET_CODE (XEXP (x, i)) == REG
	      && (((REGNO (new) < FIRST_PSEUDO_REGISTER)
		   != (REGNO (XEXP (x, i)) < FIRST_PSEUDO_REGISTER))
		  || (insn_code = recog_memoized (insn)) < 0
		  || insn_data[insn_code].n_dups > 0))
	    validate_change (insn, &XEXP (x, i), new, 1);
	  else
	    XEXP (x, i) = new;
	}
      else if (fmt[i] == 'E')
	for (j = 0; j < XVECLEN (x, i); j++)
	  XVECEXP (x, i, j) = canon_reg (XVECEXP (x, i, j), insn);
	//NO CHECK IS DONE HERE!
    }


Thanks,

Marco Altieri

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-12-14 12:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-14  4:08 Question about unspec and canon_reg() Marco Altieri

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).