[Patch, fortran] PR 47586 Missing deep copy when assigning from a function returning a pointer.

Mikael Morin mikael.morin@sfr.fr
Mon Aug 13 14:35:00 GMT 2012


Hello,

here is a fix for PR47586: missing deep copy for the case:

dt_w_alloc = ptr_func(arg)

where dt_w_alloc is of derived type with allocatable components, and
ptr_func returns a data pointer.
The fix tweaks expr_is_variable so that gfc_trans_scalar_assign is
called with the flag enabling deep copy set.

I added a few fixes loosely related before, so that the patches are as
follows:

1/4: gfc_is_proc_ptr_comp interface change,
2/4: gfc_is_scalar_ptr deep_copy flag lengthy explanation,
3/4: regression fix,
4/4: patch fixing the PR.

Regression-tested on x86_64-unknown-linux-gnu. OK for trunk?

Mikael

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr47586_v3-1.diff
Type: text/x-patch
Size: 12558 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120813/4321a9e8/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr47586_v3-2.diff
Type: text/x-patch
Size: 3844 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120813/4321a9e8/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr47586_v3-3.diff
Type: text/x-patch
Size: 1221 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120813/4321a9e8/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr47586_v3-4.diff
Type: text/x-patch
Size: 2020 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120813/4321a9e8/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr47586_tests.diff
Type: text/x-patch
Size: 553 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120813/4321a9e8/attachment-0004.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: typebound_proc_26.f03
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120813/4321a9e8/attachment.ksh>


More information about the Gcc-patches mailing list