[PATCH] assert gimplifier assumption to prevent silent wrong code

Olivier Hainque hainque@adacore.com
Thu Jun 26 15:45:00 GMT 2008


[Thanks for your super prompt feedback Richard, btw :)]

Richard Guenther wrote:
> WITH_SIZE_EXPR shouldn't be checked

 ?

> after all we could decide to gimplify to memset also for
> constant-sized assignments.  I think the empty CONSTRUCTOR is
> enough.

 Ah, sure. My question was ambiguous: I meant something like

  /* Assert our assumptions, to abort instead of producing wrong code
     silently if they are not met.  Beware that the RHS CONSTRUCTOR might
     not be immediately exposed.  */
  from = GENERIC_TREE_OPERAND (*expr_p, 1);  
  if (TREE_CODE (from) == WITH_SIZE_EXPR)
    from = TREE_OPERAND (from, 0);

  gcc_assert (TREE_CODE (from) == CONSTRUCTOR
	      && VEC_empty (constructor_elt, CONSTRUCTOR_ELTS (from)));

 Would you rather skip other things than a WITH_SIZE_EXPR ? (conversions
 come to mind)




More information about the Gcc-patches mailing list