http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42112

--- Comment #7 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-11-25 
08:54:10 UTC ---
(In reply to comment #6)
> One probably needs:
> 
> a) If "a" is no TARGET:
>   deallocate (a)
>   f(&a)

... which has with -fno-realloc-lhs issues when bound checking is enabled. (I
do not know whether we should care.)

> b) If "a" is a TARGET
>   f(tmp)
>   memcpy(a,tmp)

... while this one can be optimized with realloc-lhs to a deallocate + pointer
assignment if the size does not fit (rather than a malloc plus deep copying).

Reply via email to