[PATCH] Reject pre/post inc/decrement in "m" input operands (PR middle-end/43690)

Jakub Jelinek jakub@redhat.com
Fri Nov 5 11:03:00 GMT 2010


On Fri, Nov 05, 2010 at 11:20:05AM +0100, Richard Guenther wrote:
> On Thu, Nov 4, 2010 at 9:12 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> I think it's a reasonable thing to do.  We should have discovered
> all code that does this by now (I guess it just worked pre-tree-ssa?)

On that testcase 3.4 diagnoses:
pr43690.c:8: warning: use of memory input without lvalue in asm operand 0 is deprecated
pr43690.c:10: warning: use of memory input without lvalue in asm operand 0 is deprecated
pr43690.c:12: warning: use of memory input without lvalue in asm operand 0 is deprecated
pr43690.c:8: error: impossible constraint in `asm'
pr43690.c:10: error: impossible constraint in `asm'
Surprisingly it accepted preincrement/postincrement, even without warning
(but that's quite hard to handle), for "m" (x + 1) it just warned and
for post increment/decrement it errored out.  For "m" (x + 1) we just error
out starting with 4.0, after all it has been deprecated.  And, ++x is not an
lvalue either, so we can just say it has been deprecated too, eventhough we
(incorrectly) didn't warn about it in 3.4.

	Jakub



More information about the Gcc-patches mailing list