Commit 8f1e28e0 by Marek Polacek Committed by Marek Polacek

re PR inline-asm/67448 (compiler crash#inline assembly#rvalue operand with constraint "m")

	PR inline-asm/67448
	* gimplify.c (gimplify_asm_expr): Don't allow MODIFY_EXPR as
	a memory input.

	* gcc.dg/asm-10.c: New test.

From-SVN: r227517
parent 85bc8baa
2015-09-07 Marek Polacek <polacek@redhat.com>
PR inline-asm/67448
* gimplify.c (gimplify_asm_expr): Don't allow MODIFY_EXPR as
a memory input.
2015-09-07 Marek Polacek <polacek@redhat.com>
* system.h (INTTYPE_MINIMUM): Rewrite to avoid shift warning.
2015-09-04 Paolo Bonzini <bonzini@gnu.org>
......
......@@ -5210,7 +5210,8 @@ gimplify_asm_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
if (TREE_CODE (inputv) == PREDECREMENT_EXPR
|| TREE_CODE (inputv) == PREINCREMENT_EXPR
|| TREE_CODE (inputv) == POSTDECREMENT_EXPR
|| TREE_CODE (inputv) == POSTINCREMENT_EXPR)
|| TREE_CODE (inputv) == POSTINCREMENT_EXPR
|| TREE_CODE (inputv) == MODIFY_EXPR)
TREE_VALUE (link) = error_mark_node;
tret = gimplify_expr (&TREE_VALUE (link), pre_p, post_p,
is_gimple_lvalue, fb_lvalue | fb_mayfail);
......
2015-09-07 Marek Polacek <polacek@redhat.com>
PR inline-asm/67448
* gcc.dg/asm-10.c: New test.
2015-09-04 Jakub Jelinek <jakub@redhat.com>
PR middle-end/67452
......
/* PR inline-asm/67448 */
/* { dg-do compile } */
/* { dg-options "" } */
void
f (int i)
{
asm ("" : : "m"(i += 1)); /* { dg-error "not directly addressable" } */
asm ("" : : "m"(i++)); /* { dg-error "not directly addressable" } */
asm ("" : : "m"(++i)); /* { dg-error "not directly addressable" } */
asm ("" : : "m"(i = 0)); /* { dg-error "not directly addressable" } */
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment