This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: regrename creates invalid insn
- From: Ian Lance Taylor <iant at google dot com>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 12 Mar 2012 13:52:38 -0700
- Subject: Re: regrename creates invalid insn
- References: <m2d38hvigj.fsf@igel.home>
Andreas Schwab <schwab@linux-m68k.org> writes:
> When regrename runs it turns it into this:
>
> (insn 6 27 7 2 (parallel [
> (set (reg:SI 1 %d1 [35])
> (truncate:SI (lshiftrt:DI (mult:DI (sign_extend:DI (reg:SI 1 %d1 [36]))
> (const_int -2004318071 [0x88888889]))
> (const_int 32 [0x20]))))
> (clobber (reg:SI 1 %d1 [36]))
> ]) mulsl.c:4 192 {const_smulsi3_highpart}
> (expr_list:REG_UNUSED (reg:SI 1 %d1 [36])
> (nil)))
>
> Note that both output operands are allocated to the same register (which
> generates a muls.l producing undefined results). Is this transformation
> actually valid? I can stop regrename from doing this by marking operand
> 0 as earlyclobber, but the insn doesn't actually write the outputs
> before reading the inputs, the issue is the dependency between the
> outputs.
I assume there were two different hard register numbers before
regrename. That does not look like a valid transformation to me.
But it also looks like the pattern should use a match_scratch.
Ian