* gimplify.c (gimplify_asm_expr): If a "m" input is a
{pre,post}{in,de}crement, fail.
* c-c++-common/pr43690.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166354
138bc75d-0d04-0410-961f-
82ee72b054a4
* cfgexpand.c (expand_debug_expr): Handle MEM_REF
with non-zero offset.
+ PR middle-end/43690
+ * gimplify.c (gimplify_asm_expr): If a "m" input is a
+ {pre,post}{in,de}crement, fail.
+
PR debug/46307
* tree-ssa-operands.c (get_expr_operands): Handle FMA_EXPR.
* tree-pretty-print.c (dump_generic_node): Likewise.
/* If the operand is a memory input, it should be an lvalue. */
if (!allows_reg && allows_mem)
{
+ tree inputv = TREE_VALUE (link);
+ STRIP_NOPS (inputv);
+ if (TREE_CODE (inputv) == PREDECREMENT_EXPR
+ || TREE_CODE (inputv) == PREINCREMENT_EXPR
+ || TREE_CODE (inputv) == POSTDECREMENT_EXPR
+ || TREE_CODE (inputv) == POSTINCREMENT_EXPR)
+ TREE_VALUE (link) = error_mark_node;
tret = gimplify_expr (&TREE_VALUE (link), pre_p, post_p,
is_gimple_lvalue, fb_lvalue | fb_mayfail);
mark_addressable (TREE_VALUE (link));
+2010-11-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/43690
+ * c-c++-common/pr43690.c: New test.
+
2010-11-05 Iain Sandoe <iains@gcc.gnu.org>
* objc.dg/torture/forward-1.m: Restore for m32 NeXT.
--- /dev/null
+/* PR middle-end/43690 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void
+foo (char *x)
+{
+ asm ("" : : "m" (x++)); /* { dg-error "is not directly addressable" } */
+ asm ("" : : "m" (++x)); /* { dg-error "is not directly addressable" } */
+ asm ("" : : "m" (x--)); /* { dg-error "is not directly addressable" } */
+ asm ("" : : "m" (--x)); /* { dg-error "is not directly addressable" } */
+ asm ("" : : "m" (x + 1)); /* { dg-error "is not directly addressable" } */
+}