This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, Fortran] PR 41714: [OOP] ALLOCATE SOURCE= does not properly copy the value from SOURCE
On Sun, Oct 25, 2009 at 4:10 PM, Richard Guenther
<richard.guenther@gmail.com> wrote:
> On Sun, Oct 25, 2009 at 3:52 PM, Paul Richard Thomas
> <paul.richard.thomas@gmail.com> wrote:
>> Janus,
>>
>> It looks OK to me except:
>>
>>> ? ? ? ?PR fortran/41714
>>> ? ? ? ?* trans-expr.c (gfc_build_memcpy_call): Take care of the case that the
>>> ? ? ? ?call to '__builtin_memcpy' is optimized away (replaced by a direct
>>> ? ? ? ?assignment).
>>
>> How the heck does that work? ?It comes out as a NOP_EXPR and yet it's
>> really an assignment..... Is that documented somewhere?
>
> That patch looks indeed dubious. ?It tests for an implementation detail
> (the memcpy folder returns (void *) ({ *dst = *src; dst; })). ?You should
> be able to unconditionally fold-convert to void_type_node as in the
> original code. ?Instead tree_annotate_all_with_location should be fixed.
Or rather the FE should not call this function - it assumes that the code
is already gimplified.
Richard.
> Richard.
>