[PATCH] Fix PR29119, ICE on valid asm
Richard Guenther
rguenther@suse.de
Wed Oct 11 14:55:00 GMT 2006
We mark a TARGET_EXPR addressable in this case, the fix is to
mark the gimplified object addressable, as that should be forced an
lvalue instead.
Bootstrapped and tested on x86_64-unknown-linux-gnu.
Ok for mainline?
Thanks,
Richard.
--
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs
:ADDPATCH middle-end:
2006-10-11 Richard Guenther <rguenther@suse.de>
PR inline-asm/29119
* gimplify.c (gimplify_asm_expr): Mark the gimplified lvalue
addressable.
* gcc.dg/torture/pr29119.c: New testcase.
Index: gimplify.c
===================================================================
*** gimplify.c (revision 117629)
--- gimplify.c (working copy)
*************** gimplify_asm_expr (tree *expr_p, tree *p
*** 4036,4044 ****
/* If the operand is a memory input, it should be an lvalue. */
if (!allows_reg && allows_mem)
{
- lang_hooks.mark_addressable (TREE_VALUE (link));
tret = gimplify_expr (&TREE_VALUE (link), pre_p, post_p,
is_gimple_lvalue, fb_lvalue | fb_mayfail);
if (tret == GS_ERROR)
{
error ("memory input %d is not directly addressable", i);
--- 4036,4044 ----
/* If the operand is a memory input, it should be an lvalue. */
if (!allows_reg && allows_mem)
{
tret = gimplify_expr (&TREE_VALUE (link), pre_p, post_p,
is_gimple_lvalue, fb_lvalue | fb_mayfail);
+ lang_hooks.mark_addressable (TREE_VALUE (link));
if (tret == GS_ERROR)
{
error ("memory input %d is not directly addressable", i);
/* { dg-do compile } */
void ldt_add_entry(void)
{
__asm__ ("" :: "m"(({unsigned __v; __v;})));
}
More information about the Gcc-patches
mailing list