PR44492 was fixed in r161328. This revision changed the generated code for asm-es-2.c as follows: --- asm-es-2.s-ok +++ asm-es-2.s-bad @@ -23,9 +23,10 @@ f2: .p2align 4,,15 .L3: + addi 3,3,16 #APP # 14 "gcc-4.6-20100626/gcc/testsuite/gcc.target/powerpc/asm-es-2.c" 1 - asm2u 16(3) + asm2 0(3) # 0 "" 2 #NO_APP b .L3 Since asm-es-2.c contains /* { dg-final { scan-assembler "asm2u 16\\(3\\)" } } */ the code doesn't match causing the test case to now FAIL.
Guess something like: --- gcc/testsuite/gcc.target/powerpc/asm-es-2.c 2009-07-20 20:41:46.000000000 +0200 +++ gcc/testsuite/gcc.target/powerpc/asm-es-2.c 2010-06-29 11:37:05.482959217 +0200 @@ -11,7 +11,7 @@ f2 (int *p) while (1) { p += 4; - asm ("asm2%U0 %0" : "=m" (*p)); + asm ("asm2%U0 %0" : "=m<>" (*p)); } } should fix this.
(In reply to comment #1) > - asm ("asm2%U0 %0" : "=m" (*p)); > + asm ("asm2%U0 %0" : "=m<>" (*p)); That fixed the test case. Thanks. I didn't know about the PowerPC-specific %U thing, but now I see that the compiler did the right thing. Seems like the descriptions of "m" and "es" in the PowerPC-specific part of md.texi are now a bit stale: "es" should be equivalent to "m", and "m" should be safe (free of side-effects) unless accompanied by "<" or ">".
Confirmed.
Adding '<>' to the "=m" constraint fixes the testcase, but adding a single '>' (or '<') results in an error for impossible constraints. This is caused by the following snippet that was added to reload1.c: switch (GET_CODE (XEXP (recog_data.operand[opno], 0))) { case PRE_INC: case POST_INC: case PRE_DEC: case POST_DEC: case PRE_MODIFY: case POST_MODIFY: if (strchr (recog_data.constraints[opno], '<') == NULL || strchr (recog_data.constraints[opno], '>') == NULL) return 0; break; Should the code be using '&&' instead of '||'?
Sorry, recog.c is where the prior code snippet came from.
Subject: Bug 44701 Author: jakub Date: Tue Jul 13 14:03:49 2010 New Revision: 162142 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162142 Log: PR testsuite/44701 * recog.c (constrain_operands): Allow side-effects in memory operands if either < or > constraint is used, rather than if both < and > is used. Modified: trunk/gcc/ChangeLog trunk/gcc/recog.c
Fixed?
(In reply to comment #7) > Fixed? No, the test case itself needs a fix too. Jakub posted it to gcc-patches, but it was never approved AFAIK and is still not applied.
Subject: Bug 44701 Author: jakub Date: Tue Jul 27 17:52:35 2010 New Revision: 162581 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162581 Log: PR testsuite/44701 * doc/md.texi: Clarify m and es constraints on PowerPC and m and S constraints on IA-64. * gcc.target/powerpc/asm-es-2.c (f2): Add <> constraints. Modified: trunk/gcc/ChangeLog trunk/gcc/doc/md.texi trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.target/powerpc/asm-es-2.c
Should be fixed now.