This "fixes" it:
*** gimplify.c (revision 108853) --- gimplify.c (working copy) *************** gimplify_expr (tree *expr_p, tree *pre_p *** 4203,4210 **** break; }
! if (VOID_TYPE_P (TREE_TYPE (*expr_p)) ! || fallback == fb_none) { /* Just strip a conversion to void (or in void context) and try again. */ --- 4203,4211 ---- break; }
! if ((VOID_TYPE_P (TREE_TYPE (*expr_p)) ! || fallback == fb_none) ! && ! TREE_CODE (TREE_OPERAND (*expr_p, 0)) == CALL_EXPR) { /* Just strip a conversion to void (or in void context) and try again. */
it makes the gimplifier output
main () { int D.1519; int D.1520;
D.1519 = foo (); D.1520 = 0; return D.1520; }
instead of (with the (void) cast removed):
main () { int D.1519;
foo (); D.1519 = 0; return D.1519; }
The question whether this is an appropriate fix or just my astonishing ability to find ugly workarounds remains to be answered ;)
This "fixes" it:
*** gimplify.c (revision 108853)
break;
--- gimplify.c (working copy)
*************** gimplify_expr (tree *expr_p, tree *pre_p
*** 4203,4210 ****
}
! if (VOID_TYPE_P (TREE_TYPE (*expr_p))
try again. */
break;
! || fallback == fb_none)
{
/* Just strip a conversion to void (or in void context) and
--- 4203,4211 ----
}
! if ((VOID_TYPE_P (TREE_TYPE (*expr_p))
try again. */
! || fallback == fb_none)
! && ! TREE_CODE (TREE_OPERAND (*expr_p, 0)) == CALL_EXPR)
{
/* Just strip a conversion to void (or in void context) and
it makes the gimplifier output
main ()
{
int D.1519;
int D.1520;
D.1519 = foo ();
D.1520 = 0;
return D.1520;
}
instead of (with the (void) cast removed):
main ()
{
int D.1519;
foo ();
D.1519 = 0;
return D.1519;
}
The question whether this is an appropriate fix or just my astonishing ability
to find ugly workarounds remains to be answered ;)