This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: commutative asm operands
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Roman Zippel <zippel at linux-m68k dot org>
- Cc: gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Mon, 5 Aug 2002 07:16:10 +0930
- Subject: Re: commutative asm operands
- References: <20020731141425.GD12579@bubble.sa.bigpond.net.au> <3D4C48D6.2020702@linux-m68k.org> <20020804121553.U2148@bubble.sa.bigpond.net.au> <3D4D565F.1B8AF20A@linux-m68k.org>
On Sun, Aug 04, 2002 at 06:29:19PM +0200, Roman Zippel wrote:
> Alan Modra wrote:
> > * recog.c (constrain_operands): Handle commutative operands.
>
> What exactly does this patch fix?
The ICE reported at the beginning of this thread, and the following
similar one.
> What is the assembly output for this test case (register names might
> need a change):
Thanks, this testcase is useful.
void f (void)
{
register int a asm ("%r3");
register int b asm ("%r4");
register int c asm ("%r5");
register int d asm ("%r6");
asm volatile ("addc %0, %2, %3\n\tadde %1, %4, %5"
: "=r" (a), "=r" (b)
: "%0" (a), "r" (c), "%1" (b), "r" (d));
asm volatile ("addc %0, %2, %3\n\tadde %1, %4, %5"
: "=r" (a), "=r" (b)
: "%0" (c), "r" (a), "%1" (d), "r" (b));
}
produces, with my patch:
.f:
#APP
addc 3, 3, 5
adde 4, 4, 6
addc 3, 5, 3
adde 4, 4, 6
#NO_APP
blr
and without:
addc.c: In function `f':
addc.c:14: error: unrecognizable insn:
(insn:HI 14 12 22 0 0x4012c0c0 (parallel [
(set (reg/v:SI 3 r3)
(asm_operands/v:SI ("addc %0, %2, %3
adde %1, %4, %5") ("=r") 0 [
(reg/v:SI 5 r5)
(reg/v:SI 3 r3)
(reg/v:SI 4 r4)
(reg/v:SI 6 r6)
]
[
(asm_input:SI ("%0"))
(asm_input:SI ("r"))
(asm_input:SI ("%1"))
(asm_input:SI ("r"))
] ("addc.c") 11))
(set (reg/v:SI 4 r4)
(asm_operands/v:SI ("addc %0, %2, %3
adde %1, %4, %5") ("=r") 1 [
(reg/v:SI 5 r5)
(reg/v:SI 3 r3)
(reg/v:SI 4 r4)
(reg/v:SI 6 r6)
]
[
(asm_input:SI ("%0"))
(asm_input:SI ("r"))
(asm_input:SI ("%1"))
(asm_input:SI ("r"))
] ("addc.c") 11))
]) -1 (insn_list 12 (nil))
(nil))
addc.c:14: internal compiler error: Internal compiler error in reload_cse_simplify_operands, at reload1.c:8308
--
Alan Modra
IBM OzLabs - Linux Technology Centre