[Ada] Expand NRV optimization in gigi
Eric Botcazou
ebotcazou@adacore.com
Sun Nov 20 14:25:00 GMT 2011
This expands the recently implemented NRV optimization to the unconstrained
case, both for array types and discriminated record types with variant part.
Tested on i586-suse-linux, applied on the mainline.
2011-11-20 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (struct language_function): Add GNAT_RET.
(f_gnat_ret): New macro.
(struct nrv_data): Add GNAT_RET.
(finalize_nrv_unc_r): New helper function.
(finalize_nrv): Add GNAT_RET parameter. Copy it into DATA. If the
function returns unconstrained, use finalize_nrv_unc_r as callback.
(return_value_ok_for_nrv_p): Test the alignment of RET_OBJ only if
RET_OBJ is non-null.
(Subprogram_Body_to_gnu): Pass GNAT_RET to finalize_nrv.
(gnat_to_gnu) <N_Return_Statement>: In the return-unconstrained case,
if optimization is enabled, record candidates for the Named Return
Value optimization.
--
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-diff
Size: 10958 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20111120/2c642465/attachment.bin>
More information about the Gcc-patches
mailing list