------- Comment #8 from rguenth at gcc dot gnu dot org 2010-03-27 19:05 ------- I suppose I should have provided a testcase. The FE now produces control-flow free allocation like:
D.1612 = D.1601 - D.1600; atmp.5.dtype = 537; atmp.5.dim[0].stride = 1; atmp.5.dim[0].lbound = 0; atmp.5.dim[0].ubound = D.1612; D.1616 = D.1612 < 0; D.1617 = D.1612 + 1; D.1618 = D.1616 ? 0 : D.1617 * 8; D.1619 = (void * restrict) __builtin_malloc (MAX_EXPR <D.1618, 1>); D.1620 = D.1619; atmp.5.data = D.1620; atmp.5.offset = 0; but there's still the conditional on negative D.1612. Also deallocation is D.1621 = (void *) atmp.5.data; if (D.1621 != 0B) { __builtin_free (D.1621); } where the check for NULL is not necessary (though the middle end might be able to remove that condition). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42958